Class OpenSearchClientImpl
- java.lang.Object
-
- org.openmetadata.service.search.openSearch.OpenSearchClientImpl
-
- All Implemented Interfaces:
SearchClient
public class OpenSearchClientImpl extends Object implements SearchClient
-
-
Constructor Summary
Constructors Constructor Description OpenSearchClientImpl(ElasticSearchConfiguration esConfig, CollectionDAO dao)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openmetadata.service.search.SearchClient
applyESChangeEvent, bulk, getIndexMapping, getScriptWithParams, getSuccessFromBulkResponse, updateElasticSearch, updateElasticSearchFailureStatus, updateSearchForEntityUpdated, updateTestCase
-
-
-
-
Constructor Detail
-
OpenSearchClientImpl
public OpenSearchClientImpl(ElasticSearchConfiguration esConfig, CollectionDAO dao)
-
-
Method Detail
-
createIndex
public boolean createIndex(SearchIndexDefinition.ElasticSearchIndexType elasticSearchIndexType, String lang)
- Specified by:
createIndexin interfaceSearchClient
-
updateIndex
public void updateIndex(SearchIndexDefinition.ElasticSearchIndexType elasticSearchIndexType, String lang)
- Specified by:
updateIndexin interfaceSearchClient
-
deleteIndex
public void deleteIndex(SearchIndexDefinition.ElasticSearchIndexType elasticSearchIndexType)
- Specified by:
deleteIndexin interfaceSearchClient
-
search
public javax.ws.rs.core.Response search(SearchRequest request) throws IOException
- Specified by:
searchin interfaceSearchClient- Throws:
IOException
-
searchBySourceUrl
public javax.ws.rs.core.Response searchBySourceUrl(String sourceUrl) throws IOException
- Specified by:
searchBySourceUrlin interfaceSearchClient- Parameters:
sourceUrl-- Returns:
- Throws:
IOException
-
aggregate
public javax.ws.rs.core.Response aggregate(String index, String fieldName, String value, String query) throws IOException
- Specified by:
aggregatein interfaceSearchClient- Throws:
IOException
-
updateElasticSearch
public void updateElasticSearch(org.opensearch.action.update.UpdateRequest updateRequest) throws IOException- Specified by:
updateElasticSearchin interfaceSearchClient- Throws:
IOException
-
suggest
public javax.ws.rs.core.Response suggest(SearchRequest request) throws IOException
- Specified by:
suggestin interfaceSearchClient- Throws:
IOException
-
getSearchType
public ElasticSearchConfiguration.SearchType getSearchType()
- Specified by:
getSearchTypein interfaceSearchClient
-
updateEntity
public void updateEntity(ChangeEvent event) throws IOException
- Specified by:
updateEntityin interfaceSearchClient- Throws:
IOException
-
updateUser
public void updateUser(ChangeEvent event) throws IOException
- Specified by:
updateUserin interfaceSearchClient- Throws:
IOException
-
updateSearchForEntityCreated
public void updateSearchForEntityCreated(SearchIndexDefinition.ElasticSearchIndexType indexType, String entityType, ChangeEvent event) throws IOException
- Specified by:
updateSearchForEntityCreatedin interfaceSearchClient- Throws:
IOException
-
updateTeam
public void updateTeam(ChangeEvent event) throws IOException
- Specified by:
updateTeamin interfaceSearchClient- Throws:
IOException
-
updateGlossaryTerm
public void updateGlossaryTerm(ChangeEvent event) throws IOException
- Specified by:
updateGlossaryTermin interfaceSearchClient- Throws:
IOException
-
updateGlossary
public void updateGlossary(ChangeEvent event) throws IOException
- Specified by:
updateGlossaryin interfaceSearchClient- Throws:
IOException
-
updateTag
public void updateTag(ChangeEvent event) throws IOException
- Specified by:
updateTagin interfaceSearchClient- Throws:
IOException
-
updateDatabase
public void updateDatabase(ChangeEvent event) throws IOException
- Specified by:
updateDatabasein interfaceSearchClient- Throws:
IOException
-
updateDatabaseSchema
public void updateDatabaseSchema(ChangeEvent event) throws IOException
- Specified by:
updateDatabaseSchemain interfaceSearchClient- Throws:
IOException
-
updateDatabaseService
public void updateDatabaseService(ChangeEvent event) throws IOException
- Specified by:
updateDatabaseServicein interfaceSearchClient- Throws:
IOException
-
updatePipelineService
public void updatePipelineService(ChangeEvent event) throws IOException
- Specified by:
updatePipelineServicein interfaceSearchClient- Throws:
IOException
-
updateMlModelService
public void updateMlModelService(ChangeEvent event) throws IOException
- Specified by:
updateMlModelServicein interfaceSearchClient- Throws:
IOException
-
updateStorageService
public void updateStorageService(ChangeEvent event) throws IOException
- Specified by:
updateStorageServicein interfaceSearchClient- Throws:
IOException
-
updateMessagingService
public void updateMessagingService(ChangeEvent event) throws IOException
- Specified by:
updateMessagingServicein interfaceSearchClient- Throws:
IOException
-
updateDashboardService
public void updateDashboardService(ChangeEvent event) throws IOException
- Specified by:
updateDashboardServicein interfaceSearchClient- Throws:
IOException
-
updateClassification
public void updateClassification(ChangeEvent event) throws IOException
- Specified by:
updateClassificationin interfaceSearchClient- Throws:
IOException
-
updateTestSuite
public void updateTestSuite(ChangeEvent event) throws IOException
- Specified by:
updateTestSuitein interfaceSearchClient- Throws:
IOException
-
processTestCase
public void processTestCase(TestCase testCase, ChangeEvent event, SearchIndexDefinition.ElasticSearchIndexType indexType) throws IOException
- Specified by:
processTestCasein interfaceSearchClient- Throws:
IOException
-
addTestCaseFromLogicalTestSuite
public void addTestCaseFromLogicalTestSuite(TestSuite testSuite, ChangeEvent event, SearchIndexDefinition.ElasticSearchIndexType indexType) throws IOException
- Specified by:
addTestCaseFromLogicalTestSuitein interfaceSearchClient- Throws:
IOException
-
close
public void close()
- Specified by:
closein interfaceSearchClient
-
applyOSChangeEvent
public org.opensearch.action.update.UpdateRequest applyOSChangeEvent(ChangeEvent event)
- Specified by:
applyOSChangeEventin interfaceSearchClient
-
bulk
public org.opensearch.action.bulk.BulkResponse bulk(org.opensearch.action.bulk.BulkRequest data, org.opensearch.client.RequestOptions options) throws IOException- Specified by:
bulkin interfaceSearchClient- Throws:
IOException
-
getSuccessFromBulkResponse
public int getSuccessFromBulkResponse(org.opensearch.action.bulk.BulkResponse response)
- Specified by:
getSuccessFromBulkResponsein interfaceSearchClient
-
getSortedDate
public TreeMap<Long,List<Object>> getSortedDate(String team, Long scheduleTime, Long currentTime, DataInsightChartResult.DataInsightChartType chartType, String indexName) throws IOException, ParseException
- Specified by:
getSortedDatein interfaceSearchClient- Throws:
IOExceptionParseException
-
listDataInsightChartResult
public javax.ws.rs.core.Response listDataInsightChartResult(Long startTs, Long endTs, String tier, String team, DataInsightChartResult.DataInsightChartType dataInsightChartName, String dataReportIndex) throws IOException, ParseException
- Specified by:
listDataInsightChartResultin interfaceSearchClient- Throws:
IOExceptionParseException
-
getDao
public CollectionDAO getDao()
- Specified by:
getDaoin interfaceSearchClient
-
createOpenSearchClient
public static org.opensearch.client.RestHighLevelClient createOpenSearchClient(ElasticSearchConfiguration esConfig)
-
-