Class AbstractSearchOperation
java.lang.Object
org.odpi.egeria.connectors.juxt.xtdb.readops.AbstractReadOperation
org.odpi.egeria.connectors.juxt.xtdb.readops.AbstractSearchOperation
- Direct Known Subclasses:
AbstractEntitySearchOperation,AbstractRelationshipSearchOperation
Base class that all search operations should implement.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus>protected final org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassificationsprotected final intprotected final org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrderprotected final Stringprotected final Stringprotected final StringFields inherited from class org.odpi.egeria.connectors.juxt.xtdb.readops.AbstractReadOperation
asOfTime, existingDB, xtdb -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSearchOperation(XtdbOMRSRepositoryConnector xtdb, String typeGUID, int fromElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, Date asOfTime, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String userId) Create a new search operation.protectedAbstractSearchOperation(XtdbOMRSRepositoryConnector xtdb, String typeGUID, int fromElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, xtdb.api.IXtdbDatasource existingDB, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String userId) Create a new search operation. -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<List<?>>deduplicateAndPage(xtdb.api.ICursor<List<?>> results, int fromElement, int pageSize) De-duplicate and return only the selected page of results from the provided collection of XTDB query results.protected abstract Collection<List<?>>runQuery(xtdb.api.IXtdbDatasource db) Interface that must be implemented to actually execute the query logic.protected Collection<List<?>>searchXtdb(xtdb.api.IXtdbDatasource db, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category, String typeGuid, List<String> subtypeGuids, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties matchProperties, int fromElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String namespace, String userId) Search XTDB based on the provided parameters, using an already-opened point-in-time view of the database (should work across both Entities and Relationships).protected Collection<List<?>>searchXtdbText(xtdb.api.IXtdbDatasource db, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category, String typeGuid, String searchCriteria, int fromElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String namespace, String userId) Search all text properties in XTDB based on the provided parameters, using an already-opened point-in-time view of the database (should work across both Entities and Relationships).protected voidupdateQuery(XtdbQuery query, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category, String typeGuid, List<String> subtypeGuids, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties matchProperties, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, String namespace, String userId) Update the provided query with the specified parameters.Methods inherited from class org.odpi.egeria.connectors.juxt.xtdb.readops.AbstractReadOperation
getXtdbObjectByReference
-
Field Details
-
typeGUID
-
fromElement
protected final int fromElement -
limitResultsByStatus
protected final List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus -
matchClassifications
protected final org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications -
sequencingProperty
-
sequencingOrder
protected final org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder -
pageSize
protected final int pageSize -
userId
-
-
Constructor Details
-
AbstractSearchOperation
protected AbstractSearchOperation(XtdbOMRSRepositoryConnector xtdb, String typeGUID, int fromElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, Date asOfTime, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String userId) Create a new search operation.- Parameters:
xtdb- connectivity to XTDBtypeGUID- unique identifier of a type definition by which to limit resultsfromElement- starting element for paged resultslimitResultsByStatus- list of statuses by which to limit resultsmatchClassifications- classification criteria by which to limit resultsasOfTime- the point-in-time for which to retrieve resultssequencingProperty- the name of the property by which to sort results (only applicable when sorting by property)sequencingOrder- the mechanism to use for sorting resultspageSize- the number of results to include per pageuserId- executing the search
-
AbstractSearchOperation
protected AbstractSearchOperation(XtdbOMRSRepositoryConnector xtdb, String typeGUID, int fromElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, xtdb.api.IXtdbDatasource existingDB, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String userId) Create a new search operation.- Parameters:
xtdb- connectivity to XTDBtypeGUID- unique identifier of a type definition by which to limit resultsfromElement- starting element for paged resultslimitResultsByStatus- list of statuses by which to limit resultsmatchClassifications- classification criteria by which to limit resultsexistingDB- the already-opened point-in-time from which to retrieve resultssequencingProperty- the name of the property by which to sort results (only applicable when sorting by property)sequencingOrder- the mechanism to use for sorting resultspageSize- the number of results to include per pageuserId- executing the search
-
-
Method Details
-
runQuery
protected abstract Collection<List<?>> runQuery(xtdb.api.IXtdbDatasource db) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException, TimeoutException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException Interface that must be implemented to actually execute the query logic.- Parameters:
db- the datasource against which to run the query- Returns:
Collection<List<?>>of internal XT references (IDs) that match the query- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException- if a requested type for searching is not known to the repositoryTimeoutException- if the query times outorg.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException- if there is any issue iterating through the results
-
searchXtdb
protected Collection<List<?>> searchXtdb(xtdb.api.IXtdbDatasource db, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category, String typeGuid, List<String> subtypeGuids, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties matchProperties, int fromElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String namespace, String userId) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException Search XTDB based on the provided parameters, using an already-opened point-in-time view of the database (should work across both Entities and Relationships).- Parameters:
db- already opened point-in-time view of the databasecategory- to limit the search to either entities or relationships (required)typeGuid- to limit the search by type (optional)subtypeGuids- to limit the search to a set of subtypes (optional)matchProperties- by which to limit the results (optional)fromElement- starting element for paginglimitResultsByStatus- by which to limit results (optional)matchClassifications- by which to limit entity results (must be null for relationships) (optional)sequencingProperty- by which to order the results (required if sequencingOrder involves a property)sequencingOrder- by which to order results (optional, will default to GUID)pageSize- maximum number of results per pagenamespace- by which to qualify the matchPropertiesuserId- of the user running the query- Returns:
Collection<List<?>>list of the XTDB document references that match- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException- if a requested type for searching is not known to the repositoryorg.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException- if there is any issue iterating through the results
-
updateQuery
protected void updateQuery(XtdbQuery query, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category, String typeGuid, List<String> subtypeGuids, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties matchProperties, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, String namespace, String userId) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException Update the provided query with the specified parameters.- Parameters:
query- into which to add conditionscategory- to limit the search to either entities or relationships (required)typeGuid- to limit the search by type (optional)subtypeGuids- to limit the search to a set of subtypes (optional)matchProperties- by which to limit the results (optional)limitResultsByStatus- by which to limit results (optional)matchClassifications- by which to limit entity results (must be null for relationships) (optional)sequencingProperty- by which to order the results (required if sequencingOrder involves a property)sequencingOrder- by which to order results (optional, will default to GUID)namespace- by which to qualify the matchPropertiesuserId- of the user running the query- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException- if a requested type for searching is not known to the repository
-
searchXtdbText
protected Collection<List<?>> searchXtdbText(xtdb.api.IXtdbDatasource db, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category, String typeGuid, String searchCriteria, int fromElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String namespace, String userId) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException Search all text properties in XTDB based on the provided parameters, using an already-opened point-in-time view of the database (should work across both Entities and Relationships).- Parameters:
db- already opened point-in-time view of the databasecategory- to limit the search to either entities or relationships (required)typeGuid- to limit the search by type (optional)searchCriteria- by which to limit the results (required, must be a Java regular expression)fromElement- starting element for paginglimitResultsByStatus- by which to limit results (optional)matchClassifications- by which to limit entity results (must be null for relationships) (optional)sequencingProperty- by which to order the results (required if sequencingOrder involves a property)sequencingOrder- by which to order results (optional, will default to GUID)pageSize- maximum number of results per pagenamespace- by which to qualify the matchPropertiesuserId- of the user running the query- Returns:
Collection<List<?>>list of the XTDB document references that match- Throws:
org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException- if a requested type for searching is not known to the repositoryorg.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException- if there is any issue iterating through the results
-
deduplicateAndPage
protected Collection<List<?>> deduplicateAndPage(xtdb.api.ICursor<List<?>> results, int fromElement, int pageSize) De-duplicate and return only the selected page of results from the provided collection of XTDB query results.- Parameters:
results- from a XTDB queryfromElement- starting point for the pagepageSize- number of elements to include in the page- Returns:
Collection<List<?>>of only the single page of results specified
-