Class DataDictionaryDao
java.lang.Object
gov.nasa.pds.registry.common.es.dao.dd.DataDictionaryDao
Data dictionary DAO (Data Access Object). This class provides methods to read and update data
dictionary.
- Author:
- karpenko
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDataTypes(Collection<String> ids) Query Elasticsearch data dictionary to get data types for a list of field ids.getDataTypes(Collection<String> ids, boolean forceRefresh) Query Elasticsearch data dictionary to get data types for a list of field ids.getFieldNamesByEsType(String esType) Get field names by Elasticsearch type, such as "boolean" or "date".getLddInfo(String namespace) Get LDD date from data dictionary index in Elasticsearch.getLddInfoNoCache(String namespace) Get LDD date from data dictionary index in Elasticsearch.List registered LDDs
-
Constructor Details
-
DataDictionaryDao
Constructor- Parameters:
client- Elasticsearch clientindexName- Elasticsearch index name
-
-
Method Details
-
getLddInfo
Get LDD date from data dictionary index in Elasticsearch.- Parameters:
namespace- LDD namespace, e.g., "pds", "geom", etc.- Returns:
- ISO instant class representing LDD date.
- Throws:
IOExceptionResponseExceptionUnsupportedOperationExceptionException- an exception
-
getLddInfoNoCache
public LddVersions getLddInfoNoCache(String namespace) throws UnsupportedOperationException, IOException Get LDD date from data dictionary index in Elasticsearch. Force skip the OpenSearch cache.- Parameters:
namespace- LDD namespace, e.g., "pds", "geom", etc.- Returns:
- ISO instant class representing LDD date.
- Throws:
IOExceptionResponseExceptionUnsupportedOperationExceptionException- an exception
-
listLdds
List registered LDDs- Parameters:
namespace- if this parameter is null list all LDDs- Returns:
- a list of LDDs
- Throws:
IOExceptionResponseExceptionUnsupportedOperationExceptionException- an exception
-
getFieldNamesByEsType
public Set<String> getFieldNamesByEsType(String esType) throws UnsupportedOperationException, IOException Get field names by Elasticsearch type, such as "boolean" or "date".- Returns:
- a set of field names
- Throws:
IOExceptionResponseExceptionUnsupportedOperationExceptionException- an exception
-
getDataTypes
public List<Tuple> getDataTypes(Collection<String> ids) throws IOException, DataTypeNotFoundException Query Elasticsearch data dictionary to get data types for a list of field ids.- Parameters:
ids- A list of field IDs, e.g., "pds:Array_3D/pds:axes".- Returns:
- Data types information object
- Throws:
DataTypeNotFoundExceptionIOException
-
getDataTypes
public List<Tuple> getDataTypes(Collection<String> ids, boolean forceRefresh) throws IOException, DataTypeNotFoundException Query Elasticsearch data dictionary to get data types for a list of field ids.- Parameters:
ids- A list of field IDs, e.g., "pds:Array_3D/pds:axes".forceRefresh- If true, force a shard refresh before the mget. Use only in targeted wait loops after bulk loading an LDD — do not use in normal query paths.- Returns:
- Data types information object
- Throws:
DataTypeNotFoundExceptionIOException
-