From 35c4e18663a23bbce76080ff172e4a2343c9e2a9 Mon Sep 17 00:00:00 2001 From: Sriharsha Chintalapani Date: Sun, 8 Oct 2023 11:55:34 -0700 Subject: [PATCH] Upgrade search versions (#13479) * working on maven shading * update es in docker * add maven shade for elasticsearch/opensearch dependencies * add submodule for es/os dependencies * upgrade docker elasticsearch to latest 8.10.2 * upgrade docker elasticsearch to latest 8.10.2 * Update Postgres dev to use OpenSearch * Fix container service dependency * revert conf change --------- Co-authored-by: 07Himank Co-authored-by: 07Himank <112613760+07Himank@users.noreply.github.com> --- .../development/docker-compose-postgres.yml | 19 +- docker/development/docker-compose.yml | 3 +- .../docker-compose-postgres.yml | 3 +- .../docker-compose.yml | 3 +- openmetadata-service/pom.xml | 208 ++++++++++++----- .../resources/search/SearchResource.java | 4 +- .../service/search/SearchClient.java | 12 +- .../elasticsearch/ElasticSearchClient.java | 180 +++++++-------- .../ElasticSearchDataInsightProcessor.java | 6 +- .../ElasticSearchEntitiesProcessor.java | 6 +- .../elasticsearch/ElasticSearchIndexSink.java | 6 +- ...AggregatedUnusedAssetsCountAggregator.java | 8 +- ...hAggregatedUnusedAssetsSizeAggregator.java | 8 +- ...atedUsedvsUnusedAssetsCountAggregator.java | 8 +- ...gatedUsedvsUnusedAssetsSizeAggregator.java | 8 +- ...asticSearchDailyActiveUsersAggregator.java | 4 +- ...icSearchEntitiesDescriptionAggregator.java | 6 +- .../ElasticSearchEntitiesOwnerAggregator.java | 6 +- ...lasticSearchMostActiveUsersAggregator.java | 8 +- ...ticSearchMostViewedEntitiesAggregator.java | 6 +- ...icSearchPageViewsByEntitiesAggregator.java | 6 +- ...icSearchServicesDescriptionAggregator.java | 6 +- .../ElasticSearchServicesOwnerAggregator.java | 6 +- .../ElasticSearchTotalEntitiesAggregator.java | 6 +- ...icSearchTotalEntitiesByTierAggregator.java | 6 +- .../ElasticSearchUnusedAssetsAggregator.java | 6 +- .../search/opensearch/OpenSearchClient.java | 216 +++++++++--------- .../OpenSearchDataInsightProcessor.java | 6 +- .../OpenSearchEntitiesProcessor.java | 6 +- .../opensearch/OpenSearchIndexSink.java | 6 +- ...AggregatedUnusedAssetsCountAggregator.java | 8 +- ...hAggregatedUnusedAssetsSizeAggregator.java | 8 +- ...atedUsedvsUnusedAssetsCountAggregator.java | 8 +- ...gatedUsedvsUnusedAssetsSizeAggregator.java | 8 +- .../OpenSearchDailyActiveUsersAggregator.java | 4 +- ...enSearchEntitiesDescriptionAggregator.java | 6 +- .../OpenSearchEntitiesOwnerAggregator.java | 6 +- .../OpenSearchMostActiveUsersAggregator.java | 8 +- ...penSearchMostViewedEntitiesAggregator.java | 6 +- ...enSearchPageViewsByEntitiesAggregator.java | 6 +- ...enSearchServicesDescriptionAggregator.java | 6 +- .../OpenSearchServicesOwnerAggregator.java | 6 +- .../OpenSearchTotalEntitiesAggregator.java | 6 +- ...enSearchTotalEntitiesByTierAggregator.java | 6 +- .../OpenSearchUnusedAssetsAggregator.java | 6 +- .../workflows/searchIndex/ReindexingUtil.java | 8 +- .../searchIndex/SearchIndexWorkflow.java | 30 +-- .../resources/elasticsearch/indexMapping.json | 10 +- .../service/OpenMetadataApplicationTest.java | 2 +- .../service/resources/EntityResourceTest.java | 32 +-- .../analytics/ReportDataResourceTest.java | 6 +- .../elasticsearch-dep/.gitignore | 29 +++ .../elasticsearch-dep/pom.xml | 111 +++++++++ .../opensearch-dep/.gitignore | 29 +++ .../opensearch-dep/pom.xml | 111 +++++++++ openmetadata-shaded-deps/pom.xml | 19 ++ pom.xml | 51 +---- 57 files changed, 839 insertions(+), 479 deletions(-) create mode 100644 openmetadata-shaded-deps/elasticsearch-dep/.gitignore create mode 100644 openmetadata-shaded-deps/elasticsearch-dep/pom.xml create mode 100644 openmetadata-shaded-deps/opensearch-dep/.gitignore create mode 100644 openmetadata-shaded-deps/opensearch-dep/pom.xml create mode 100644 openmetadata-shaded-deps/pom.xml diff --git a/docker/development/docker-compose-postgres.yml b/docker/development/docker-compose-postgres.yml index 6d80e3cf110d..c9857f006393 100644 --- a/docker/development/docker-compose-postgres.yml +++ b/docker/development/docker-compose-postgres.yml @@ -24,7 +24,7 @@ services: restart: always command: "--work_mem=10MB" depends_on: - - elasticsearch + - opensearch environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: password @@ -42,12 +42,13 @@ services: timeout: 10s retries: 10 - elasticsearch: - image: docker.elastic.co/elasticsearch/elasticsearch:7.16.3 - container_name: openmetadata_elasticsearch + opensearch: + image: opensearchproject/opensearch:latest + container_name: openmetadata_opensearch environment: - discovery.type=single-node - ES_JAVA_OPTS=-Xms1024m -Xmx1024m + - plugins.security.disabled=true networks: - local_app_net expose: @@ -57,7 +58,7 @@ services: - "9200:9200" - "9300:9300" volumes: - - es-data:/usr/share/elasticsearch/data + - es-data:/usr/share/opensearch/data execute-migrate-all: build: @@ -113,7 +114,7 @@ services: DB_PORT: ${DB_PORT:-5432} OM_DATABASE: ${OM_DATABASE:-openmetadata_db} # ElasticSearch Configurations - ELASTICSEARCH_HOST: ${ELASTICSEARCH_HOST:- elasticsearch} + ELASTICSEARCH_HOST: ${ELASTICSEARCH_HOST:- opensearch} ELASTICSEARCH_PORT: ${ELASTICSEARCH_PORT:-9200} ELASTICSEARCH_SCHEME: ${ELASTICSEARCH_SCHEME:-http} ELASTICSEARCH_USER: ${ELASTICSEARCH_USER:-""} @@ -211,7 +212,7 @@ services: WEB_CONF_PERMISSION_POLICY_ENABLED: ${WEB_CONF_PERMISSION_POLICY_ENABLED:-false} WEB_CONF_PERMISSION_POLICY_OPTION: ${WEB_CONF_PERMISSION_POLICY_OPTION:-""} depends_on: - elasticsearch: + opensearch: condition: service_started postgresql: condition: service_healthy @@ -344,7 +345,7 @@ services: - "8586:8586" - "5005:5005" depends_on: - elasticsearch: + ingestion: condition: service_started postgresql: condition: service_healthy @@ -376,7 +377,7 @@ services: command: - "/opt/airflow/ingestion_dependency.sh" depends_on: - elasticsearch: + opensearch: condition: service_started postgresql: condition: service_healthy diff --git a/docker/development/docker-compose.yml b/docker/development/docker-compose.yml index 2a5ca96a6be4..5f5ef67c19a9 100644 --- a/docker/development/docker-compose.yml +++ b/docker/development/docker-compose.yml @@ -42,11 +42,12 @@ services: - ./docker-volume/db-data:/var/lib/mysql elasticsearch: - image: docker.elastic.co/elasticsearch/elasticsearch:7.16.3 + image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2 container_name: openmetadata_elasticsearch environment: - discovery.type=single-node - ES_JAVA_OPTS=-Xms1024m -Xmx1024m + - xpack.security.enabled=false networks: - local_app_net expose: diff --git a/docker/docker-compose-quickstart/docker-compose-postgres.yml b/docker/docker-compose-quickstart/docker-compose-postgres.yml index c210abe9fd3e..663af91594ba 100644 --- a/docker/docker-compose-quickstart/docker-compose-postgres.yml +++ b/docker/docker-compose-quickstart/docker-compose-postgres.yml @@ -41,10 +41,11 @@ services: elasticsearch: container_name: openmetadata_elasticsearch - image: docker.elastic.co/elasticsearch/elasticsearch:7.16.3 + image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2 environment: - discovery.type=single-node - ES_JAVA_OPTS=-Xms1024m -Xmx1024m + - xpack.security.enabled=false networks: - app_net ports: diff --git a/docker/docker-compose-quickstart/docker-compose.yml b/docker/docker-compose-quickstart/docker-compose.yml index 775b52fb78ef..6e50976f193d 100644 --- a/docker/docker-compose-quickstart/docker-compose.yml +++ b/docker/docker-compose-quickstart/docker-compose.yml @@ -39,10 +39,11 @@ services: elasticsearch: container_name: openmetadata_elasticsearch - image: docker.elastic.co/elasticsearch/elasticsearch:7.16.3 + image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2 environment: - discovery.type=single-node - ES_JAVA_OPTS=-Xms1024m -Xmx1024m + - xpack.security.enabled=false networks: - app_net ports: diff --git a/openmetadata-service/pom.xml b/openmetadata-service/pom.xml index c3783de291a9..fa4645399093 100644 --- a/openmetadata-service/pom.xml +++ b/openmetadata-service/pom.xml @@ -39,6 +39,16 @@ common ${project.version} + + org.open-metadata + elasticsearch-deps + ${project.version} + + + org.open-metadata + opensearch-deps + ${project.version} + org.antlr antlr4-runtime @@ -129,57 +139,6 @@ commons-io commons-io - - org.elasticsearch.client - elasticsearch-rest-high-level-client - - - org.apache.lucene - lucene-analyzers-common - - - org.apache.lucene - lucene-backward-codecs - - - org.apache.lucene - lucene-grouping - - - org.apache.lucene - lucene-memory - - - org.apache.lucene - lucene-spatial - - - org.apache.lucene - lucene-spatial-extras - - - org.apache.lucene - lucene-spatial3d - - - org.apache.lucene - lucene-suggest - - - com.fasterxml.jackson.dataformat - jackson-dataformat-cbor - - - org.yaml - snakeyaml - - - - - org.opensearch.client - opensearch-rest-high-level-client - ${opensearch.version} - org.apache.httpcomponents httpasyncclient @@ -769,6 +728,153 @@ org.apache.maven.plugins maven-source-plugin + + org.apache.maven.plugins + maven-shade-plugin + 3.5.1 + + + package + + shade + + + my-app-shaded + true + shaded + + + + org.apache.lucene + es.lucene-core + + + org.apache.lucene + es.lucene-analyzers-common + + + org.apache.lucene + es.lucene-backward-codecs + + + org.apache.lucene + es.lucene-grouping + + + org.apache.lucene + es.lucene-highlighter + + + org.apache.lucene + es.lucene-join + + + org.apache.lucene + es.lucene-memory + + + org.apache.lucene + es.lucene-misc + + + org.apache.lucene + es.lucene-queries + + + org.apache.lucene + es.lucene-queryparser + + + org.apache.lucene + es.lucene-sandbox + + + org.apache.lucene + es.lucene-spatial3d + + + org.apache.lucene + es.lucene-suggest + + + + org.apache.lucene + os.lucene-core + + + org.apache.lucene + os.lucene-analysis-common + + + org.apache.lucene + os.lucene-backward-codecs + + + org.apache.lucene + os.lucene-grouping + + + org.apache.lucene + os.lucene-highlighter + + + org.apache.lucene + os.lucene-join + + + org.apache.lucene + os.lucene-memory + + + org.apache.lucene + os.lucene-misc + + + org.apache.lucene + os.lucene-queries + + + org.apache.lucene + os.lucene-queryparser + + + org.apache.lucene + os.lucene-sandbox + + + org.apache.lucene + os.lucene-spatial-extras + + + org.apache.lucene + os.lucene-spatial3d + + + org.apache.lucene + os.lucene-suggest + + + + + *:* + + module-info.class + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + org.openmetadata.service.OpenMetadataApplication + + + + + + diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/search/SearchResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/search/SearchResource.java index d9a7d23c5740..bac42f5050f8 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/search/SearchResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/search/SearchResource.java @@ -16,6 +16,8 @@ import static org.openmetadata.common.utils.CommonUtil.nullOrEmpty; import static org.openmetadata.service.search.SearchRepository.ELASTIC_SEARCH_EXTENSION; +import es.org.elasticsearch.action.search.SearchResponse; +import es.org.elasticsearch.search.suggest.Suggest; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; @@ -40,8 +42,6 @@ import javax.ws.rs.core.SecurityContext; import javax.ws.rs.core.UriInfo; import lombok.extern.slf4j.Slf4j; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.search.suggest.Suggest; import org.openmetadata.schema.api.CreateEventPublisherJob; import org.openmetadata.schema.system.EventPublisherJob; import org.openmetadata.service.Entity; diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchClient.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchClient.java index f8f764844d28..bcc88971e251 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchClient.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchClient.java @@ -17,9 +17,9 @@ import org.openmetadata.service.exception.CustomExceptionMessage; import org.openmetadata.service.search.models.IndexMapping; import org.openmetadata.service.util.SSLUtil; -import org.opensearch.action.bulk.BulkRequest; -import org.opensearch.action.bulk.BulkResponse; -import org.opensearch.client.RequestOptions; +import os.org.opensearch.action.bulk.BulkRequest; +import os.org.opensearch.action.bulk.BulkResponse; +import os.org.opensearch.client.RequestOptions; public interface SearchClient { @@ -110,8 +110,8 @@ default BulkResponse bulk(BulkRequest data, RequestOptions options) throws IOExc throw new CustomExceptionMessage(Response.Status.NOT_IMPLEMENTED, NOT_IMPLEMENTED_METHOD); } - default org.elasticsearch.action.bulk.BulkResponse bulk( - org.elasticsearch.action.bulk.BulkRequest data, org.elasticsearch.client.RequestOptions options) + default es.org.elasticsearch.action.bulk.BulkResponse bulk( + es.org.elasticsearch.action.bulk.BulkRequest data, es.org.elasticsearch.client.RequestOptions options) throws IOException { throw new CustomExceptionMessage(Response.Status.NOT_IMPLEMENTED, NOT_IMPLEMENTED_METHOD); } @@ -120,7 +120,7 @@ default int getSuccessFromBulkResponse(BulkResponse response) { throw new CustomExceptionMessage(Response.Status.NOT_IMPLEMENTED, NOT_IMPLEMENTED_METHOD); } - default int getSuccessFromBulkResponse(org.elasticsearch.action.bulk.BulkResponse response) { + default int getSuccessFromBulkResponse(es.org.elasticsearch.action.bulk.BulkResponse response) { throw new CustomExceptionMessage(Response.Status.NOT_IMPLEMENTED, NOT_IMPLEMENTED_METHOD); } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchClient.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchClient.java index 6bfe5b1367fa..1a5e9a16974e 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchClient.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchClient.java @@ -19,6 +19,73 @@ import static org.openmetadata.service.search.EntityBuilderConstant.UNIFIED; import static org.openmetadata.service.search.UpdateSearchEventsConstant.SENDING_REQUEST_TO_ELASTIC_SEARCH; +import es.org.elasticsearch.action.ActionListener; +import es.org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest; +import es.org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; +import es.org.elasticsearch.action.bulk.BulkItemResponse; +import es.org.elasticsearch.action.bulk.BulkRequest; +import es.org.elasticsearch.action.bulk.BulkResponse; +import es.org.elasticsearch.action.delete.DeleteRequest; +import es.org.elasticsearch.action.delete.DeleteResponse; +import es.org.elasticsearch.action.search.SearchResponse; +import es.org.elasticsearch.action.support.WriteRequest; +import es.org.elasticsearch.action.support.master.AcknowledgedResponse; +import es.org.elasticsearch.action.update.UpdateRequest; +import es.org.elasticsearch.action.update.UpdateResponse; +import es.org.elasticsearch.client.RequestOptions; +import es.org.elasticsearch.client.RestClient; +import es.org.elasticsearch.client.RestClientBuilder; +import es.org.elasticsearch.client.RestHighLevelClient; +import es.org.elasticsearch.client.RestHighLevelClientBuilder; +import es.org.elasticsearch.client.indices.CreateIndexRequest; +import es.org.elasticsearch.client.indices.CreateIndexResponse; +import es.org.elasticsearch.client.indices.GetIndexRequest; +import es.org.elasticsearch.client.indices.PutMappingRequest; +import es.org.elasticsearch.common.lucene.search.function.CombineFunction; +import es.org.elasticsearch.common.settings.Settings; +import es.org.elasticsearch.common.unit.Fuzziness; +import es.org.elasticsearch.common.xcontent.LoggingDeprecationHandler; +import es.org.elasticsearch.core.TimeValue; +import es.org.elasticsearch.index.query.BoolQueryBuilder; +import es.org.elasticsearch.index.query.MatchQueryBuilder; +import es.org.elasticsearch.index.query.MultiMatchQueryBuilder; +import es.org.elasticsearch.index.query.Operator; +import es.org.elasticsearch.index.query.QueryBuilder; +import es.org.elasticsearch.index.query.QueryBuilders; +import es.org.elasticsearch.index.query.QueryStringQueryBuilder; +import es.org.elasticsearch.index.query.RangeQueryBuilder; +import es.org.elasticsearch.index.query.ScriptQueryBuilder; +import es.org.elasticsearch.index.query.TermQueryBuilder; +import es.org.elasticsearch.index.query.functionscore.FieldValueFactorFunctionBuilder; +import es.org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder; +import es.org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders; +import es.org.elasticsearch.index.reindex.BulkByScrollResponse; +import es.org.elasticsearch.index.reindex.DeleteByQueryRequest; +import es.org.elasticsearch.index.reindex.UpdateByQueryRequest; +import es.org.elasticsearch.script.Script; +import es.org.elasticsearch.script.ScriptType; +import es.org.elasticsearch.search.SearchModule; +import es.org.elasticsearch.search.aggregations.AggregationBuilder; +import es.org.elasticsearch.search.aggregations.AggregationBuilders; +import es.org.elasticsearch.search.aggregations.BucketOrder; +import es.org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; +import es.org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; +import es.org.elasticsearch.search.aggregations.bucket.terms.IncludeExclude; +import es.org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; +import es.org.elasticsearch.search.aggregations.metrics.MaxAggregationBuilder; +import es.org.elasticsearch.search.aggregations.metrics.SumAggregationBuilder; +import es.org.elasticsearch.search.builder.SearchSourceBuilder; +import es.org.elasticsearch.search.fetch.subphase.FetchSourceContext; +import es.org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder; +import es.org.elasticsearch.search.sort.SortOrder; +import es.org.elasticsearch.search.suggest.Suggest; +import es.org.elasticsearch.search.suggest.SuggestBuilder; +import es.org.elasticsearch.search.suggest.SuggestBuilders; +import es.org.elasticsearch.search.suggest.completion.CompletionSuggestionBuilder; +import es.org.elasticsearch.search.suggest.completion.context.CategoryQueryContext; +import es.org.elasticsearch.xcontent.NamedXContentRegistry; +import es.org.elasticsearch.xcontent.XContentParser; +import es.org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.text.ParseException; import java.util.ArrayList; @@ -41,72 +108,6 @@ import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.CredentialsProvider; import org.apache.http.impl.client.BasicCredentialsProvider; -import org.elasticsearch.action.ActionListener; -import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest; -import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; -import org.elasticsearch.action.bulk.BulkItemResponse; -import org.elasticsearch.action.bulk.BulkRequest; -import org.elasticsearch.action.bulk.BulkResponse; -import org.elasticsearch.action.delete.DeleteRequest; -import org.elasticsearch.action.delete.DeleteResponse; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.support.WriteRequest; -import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.action.update.UpdateRequest; -import org.elasticsearch.action.update.UpdateResponse; -import org.elasticsearch.client.RequestOptions; -import org.elasticsearch.client.RestClient; -import org.elasticsearch.client.RestClientBuilder; -import org.elasticsearch.client.RestHighLevelClient; -import org.elasticsearch.client.indices.CreateIndexRequest; -import org.elasticsearch.client.indices.CreateIndexResponse; -import org.elasticsearch.client.indices.GetIndexRequest; -import org.elasticsearch.client.indices.PutMappingRequest; -import org.elasticsearch.common.lucene.search.function.CombineFunction; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.core.TimeValue; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.MatchQueryBuilder; -import org.elasticsearch.index.query.MultiMatchQueryBuilder; -import org.elasticsearch.index.query.Operator; -import org.elasticsearch.index.query.QueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.index.query.QueryStringQueryBuilder; -import org.elasticsearch.index.query.RangeQueryBuilder; -import org.elasticsearch.index.query.ScriptQueryBuilder; -import org.elasticsearch.index.query.TermQueryBuilder; -import org.elasticsearch.index.query.functionscore.FieldValueFactorFunctionBuilder; -import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder; -import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders; -import org.elasticsearch.index.reindex.BulkByScrollResponse; -import org.elasticsearch.index.reindex.DeleteByQueryRequest; -import org.elasticsearch.index.reindex.UpdateByQueryRequest; -import org.elasticsearch.script.Script; -import org.elasticsearch.script.ScriptType; -import org.elasticsearch.search.SearchModule; -import org.elasticsearch.search.aggregations.AggregationBuilder; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.BucketOrder; -import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; -import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; -import org.elasticsearch.search.aggregations.bucket.terms.IncludeExclude; -import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; -import org.elasticsearch.search.aggregations.metrics.MaxAggregationBuilder; -import org.elasticsearch.search.aggregations.metrics.SumAggregationBuilder; -import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.search.fetch.subphase.FetchSourceContext; -import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder; -import org.elasticsearch.search.sort.SortOrder; -import org.elasticsearch.search.suggest.Suggest; -import org.elasticsearch.search.suggest.SuggestBuilder; -import org.elasticsearch.search.suggest.SuggestBuilders; -import org.elasticsearch.search.suggest.completion.CompletionSuggestionBuilder; -import org.elasticsearch.search.suggest.completion.context.CategoryQueryContext; -import org.elasticsearch.xcontent.NamedXContentRegistry; -import org.elasticsearch.xcontent.XContentParser; -import org.elasticsearch.xcontent.XContentType; import org.openmetadata.schema.DataInsightInterface; import org.openmetadata.schema.dataInsight.DataInsightChartResult; import org.openmetadata.schema.service.configuration.elasticsearch.ElasticSearchConfiguration; @@ -211,18 +212,6 @@ public boolean createIndex(IndexMapping indexMapping, String indexMappingContent @Override public void createAliases(IndexMapping indexMapping) { try { - ActionListener listener = - new ActionListener<>() { - @Override - public void onResponse(AcknowledgedResponse acknowledgedResponse) { - LOG.debug("Created successfully: " + acknowledgedResponse.toString()); - } - - @Override - public void onFailure(Exception e) { - LOG.error("Creation failed: " + e.getMessage()); - } - }; Set aliases = new HashSet<>(indexMapping.getParentAliases()); aliases.add(indexMapping.getAlias()); IndicesAliasesRequest.AliasActions aliasAction = @@ -231,7 +220,7 @@ public void onFailure(Exception e) { .aliases(aliases.toArray(new String[0])); IndicesAliasesRequest aliasesRequest = new IndicesAliasesRequest(); aliasesRequest.addAliasAction(aliasAction); - client.indices().updateAliasesAsync(aliasesRequest, RequestOptions.DEFAULT, listener); + client.indices().updateAliases(aliasesRequest, RequestOptions.DEFAULT); } catch (Exception e) { LOG.error(String.format("Failed to create alias for %s due to", indexMapping.getIndexName()), e); } @@ -384,7 +373,7 @@ public Response search(SearchRequest request) throws IOException { String response = client .search( - new org.elasticsearch.action.search.SearchRequest(request.getIndex()).source(searchSourceBuilder), + new es.org.elasticsearch.action.search.SearchRequest(request.getIndex()).source(searchSourceBuilder), RequestOptions.DEFAULT) .toString(); return Response.status(OK).entity(response).build(); @@ -392,8 +381,8 @@ public Response search(SearchRequest request) throws IOException { @Override public Response searchBySourceUrl(String sourceUrl) throws IOException { - org.elasticsearch.action.search.SearchRequest searchRequest = - new org.elasticsearch.action.search.SearchRequest(GLOBAL_SEARCH_ALIAS); + es.org.elasticsearch.action.search.SearchRequest searchRequest = + new es.org.elasticsearch.action.search.SearchRequest(GLOBAL_SEARCH_ALIAS); SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); searchSourceBuilder.query(QueryBuilders.boolQuery().must(QueryBuilders.termQuery("sourceUrl", sourceUrl))); searchRequest.source(searchSourceBuilder); @@ -403,8 +392,8 @@ public Response searchBySourceUrl(String sourceUrl) throws IOException { @Override public Response searchByField(String fieldName, String fieldValue, String index) throws IOException { - org.elasticsearch.action.search.SearchRequest searchRequest = - new org.elasticsearch.action.search.SearchRequest(index); + es.org.elasticsearch.action.search.SearchRequest searchRequest = + new es.org.elasticsearch.action.search.SearchRequest(index); SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); searchSourceBuilder.query(QueryBuilders.wildcardQuery(fieldName, fieldValue)); searchRequest.source(searchSourceBuilder); @@ -433,7 +422,7 @@ public Response aggregate(String index, String fieldName, String value, String q String response = client .search( - new org.elasticsearch.action.search.SearchRequest(index).source(searchSourceBuilder), + new es.org.elasticsearch.action.search.SearchRequest(index).source(searchSourceBuilder), RequestOptions.DEFAULT) .toString(); return Response.status(OK).entity(response).build(); @@ -463,8 +452,8 @@ public Response suggest(SearchRequest request) throws IOException { .fetchSource( new FetchSourceContext( request.fetchSource(), request.getIncludeSourceFields().toArray(String[]::new), new String[] {})); - org.elasticsearch.action.search.SearchRequest searchRequest = - new org.elasticsearch.action.search.SearchRequest(request.getIndex()).source(searchSourceBuilder); + es.org.elasticsearch.action.search.SearchRequest searchRequest = + new es.org.elasticsearch.action.search.SearchRequest(request.getIndex()).source(searchSourceBuilder); SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT); Suggest suggest = searchResponse.getSuggest(); return Response.status(OK).entity(suggest.toString()).build(); @@ -1119,7 +1108,7 @@ public TreeMap> getSortedDate( DataInsightChartResult.DataInsightChartType chartType, String indexName) throws IOException, ParseException { - org.elasticsearch.action.search.SearchRequest searchRequestTotalAssets = + es.org.elasticsearch.action.search.SearchRequest searchRequestTotalAssets = buildSearchRequest(scheduleTime, currentTime, null, team, chartType, null, null, null, indexName); SearchResponse searchResponseTotalAssets = client.search(searchRequestTotalAssets, RequestOptions.DEFAULT); DataInsightChartResult processedDataTotalAssets = @@ -1150,7 +1139,7 @@ public Response listDataInsightChartResult( String queryFilter, String dataReportIndex) throws IOException, ParseException { - org.elasticsearch.action.search.SearchRequest searchRequest = + es.org.elasticsearch.action.search.SearchRequest searchRequest = buildSearchRequest(startTs, endTs, tier, team, dataInsightChartName, size, from, queryFilter, dataReportIndex); SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT); return Response.status(OK).entity(processDataInsightChartResult(searchResponse, dataInsightChartName)).build(); @@ -1203,7 +1192,7 @@ private static DataInsightAggregatorInterface createDataAggregator( } } - private static org.elasticsearch.action.search.SearchRequest buildSearchRequest( + private static es.org.elasticsearch.action.search.SearchRequest buildSearchRequest( Long startTs, Long endTs, String tier, @@ -1229,8 +1218,8 @@ private static org.elasticsearch.action.search.SearchRequest buildSearchRequest( searchSourceBuilder.sort("data.lifeCycle.accessed.timestamp", SortOrder.DESC); } - org.elasticsearch.action.search.SearchRequest searchRequest = - new org.elasticsearch.action.search.SearchRequest(dataReportIndex); + es.org.elasticsearch.action.search.SearchRequest searchRequest = + new es.org.elasticsearch.action.search.SearchRequest(dataReportIndex); searchRequest.source(searchSourceBuilder); return searchRequest; } @@ -1478,6 +1467,10 @@ public RestHighLevelClient createElasticSearchClient(ElasticSearchConfiguration try { RestClientBuilder restClientBuilder = RestClient.builder(new HttpHost(esConfig.getHost(), esConfig.getPort(), esConfig.getScheme())); + + RestClient restClient = + RestClient.builder(new HttpHost(esConfig.getHost(), esConfig.getPort(), esConfig.getScheme())).build(); + if (StringUtils.isNotEmpty(esConfig.getUsername()) && StringUtils.isNotEmpty(esConfig.getPassword())) { CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); credentialsProvider.setCredentials( @@ -1502,7 +1495,8 @@ public RestHighLevelClient createElasticSearchClient(ElasticSearchConfiguration requestConfigBuilder .setConnectTimeout(esConfig.getConnectionTimeoutSecs() * 1000) .setSocketTimeout(esConfig.getSocketTimeoutSecs() * 1000)); - return new RestHighLevelClient(restClientBuilder); + // return new RestHighLevelClient(restClientBuilder); + return new RestHighLevelClientBuilder(restClient).setApiCompatibilityMode(true).build(); } catch (Exception e) { LOG.error("Failed to create elastic search client ", e); return null; diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchDataInsightProcessor.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchDataInsightProcessor.java index 088d1dd43dd6..392e6c63ae03 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchDataInsightProcessor.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchDataInsightProcessor.java @@ -3,12 +3,12 @@ import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.ENTITY_TYPE_KEY; import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.getUpdatedStats; +import es.org.elasticsearch.action.bulk.BulkRequest; +import es.org.elasticsearch.action.update.UpdateRequest; +import es.org.elasticsearch.xcontent.XContentType; import java.util.List; import java.util.Map; import lombok.extern.slf4j.Slf4j; -import org.elasticsearch.action.bulk.BulkRequest; -import org.elasticsearch.action.update.UpdateRequest; -import org.elasticsearch.xcontent.XContentType; import org.openmetadata.common.utils.CommonUtil; import org.openmetadata.schema.analytics.ReportData; import org.openmetadata.schema.system.StepStats; diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchEntitiesProcessor.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchEntitiesProcessor.java index 5afcb8ac9641..326906571615 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchEntitiesProcessor.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchEntitiesProcessor.java @@ -3,13 +3,13 @@ import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.ENTITY_TYPE_KEY; import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.getUpdatedStats; +import es.org.elasticsearch.action.bulk.BulkRequest; +import es.org.elasticsearch.action.update.UpdateRequest; +import es.org.elasticsearch.xcontent.XContentType; import java.util.List; import java.util.Map; import java.util.Objects; import lombok.extern.slf4j.Slf4j; -import org.elasticsearch.action.bulk.BulkRequest; -import org.elasticsearch.action.update.UpdateRequest; -import org.elasticsearch.xcontent.XContentType; import org.openmetadata.common.utils.CommonUtil; import org.openmetadata.schema.EntityInterface; import org.openmetadata.schema.system.StepStats; diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchIndexSink.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchIndexSink.java index e74f9849fa74..54b673af423c 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchIndexSink.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchIndexSink.java @@ -3,11 +3,11 @@ import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.getSuccessFromBulkResponseEs; import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.getUpdatedStats; +import es.org.elasticsearch.action.bulk.BulkRequest; +import es.org.elasticsearch.action.bulk.BulkResponse; +import es.org.elasticsearch.client.RequestOptions; import java.util.Map; import lombok.extern.slf4j.Slf4j; -import org.elasticsearch.action.bulk.BulkRequest; -import org.elasticsearch.action.bulk.BulkResponse; -import org.elasticsearch.client.RequestOptions; import org.openmetadata.schema.system.StepStats; import org.openmetadata.service.exception.SinkException; import org.openmetadata.service.search.SearchRepository; diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUnusedAssetsCountAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUnusedAssetsCountAggregator.java index 85faf233c20e..b2f3c66de1f4 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUnusedAssetsCountAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUnusedAssetsCountAggregator.java @@ -1,10 +1,10 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; +import es.org.elasticsearch.search.aggregations.Aggregations; +import es.org.elasticsearch.search.aggregations.bucket.histogram.Histogram; +import es.org.elasticsearch.search.aggregations.bucket.histogram.Histogram.Bucket; +import es.org.elasticsearch.search.aggregations.metrics.Sum; import java.util.List; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; -import org.elasticsearch.search.aggregations.bucket.histogram.Histogram.Bucket; -import org.elasticsearch.search.aggregations.metrics.Sum; import org.openmetadata.service.dataInsight.AggregatedUnusedAssetsCountAggregator; public class ElasticSearchAggregatedUnusedAssetsCountAggregator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUnusedAssetsSizeAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUnusedAssetsSizeAggregator.java index 604952578f30..631de4b9aa87 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUnusedAssetsSizeAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUnusedAssetsSizeAggregator.java @@ -1,10 +1,10 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; +import es.org.elasticsearch.search.aggregations.Aggregations; +import es.org.elasticsearch.search.aggregations.bucket.histogram.Histogram; +import es.org.elasticsearch.search.aggregations.bucket.histogram.Histogram.Bucket; +import es.org.elasticsearch.search.aggregations.metrics.Sum; import java.util.List; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; -import org.elasticsearch.search.aggregations.bucket.histogram.Histogram.Bucket; -import org.elasticsearch.search.aggregations.metrics.Sum; import org.openmetadata.service.dataInsight.AggregatedUnusedAssetsSizeAggregator; public class ElasticSearchAggregatedUnusedAssetsSizeAggregator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUsedvsUnusedAssetsCountAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUsedvsUnusedAssetsCountAggregator.java index b1bbd3c1119a..94158643b310 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUsedvsUnusedAssetsCountAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUsedvsUnusedAssetsCountAggregator.java @@ -1,10 +1,10 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; +import es.org.elasticsearch.search.aggregations.Aggregations; +import es.org.elasticsearch.search.aggregations.bucket.histogram.Histogram; +import es.org.elasticsearch.search.aggregations.bucket.histogram.Histogram.Bucket; +import es.org.elasticsearch.search.aggregations.metrics.Sum; import java.util.List; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; -import org.elasticsearch.search.aggregations.bucket.histogram.Histogram.Bucket; -import org.elasticsearch.search.aggregations.metrics.Sum; import org.openmetadata.service.dataInsight.AggregatedUsedvsUnusedAssetsCountAggregator; public class ElasticSearchAggregatedUsedvsUnusedAssetsCountAggregator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUsedvsUnusedAssetsSizeAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUsedvsUnusedAssetsSizeAggregator.java index 38faccf3107f..2fd4f0ff1a8e 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUsedvsUnusedAssetsSizeAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchAggregatedUsedvsUnusedAssetsSizeAggregator.java @@ -1,10 +1,10 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; +import es.org.elasticsearch.search.aggregations.Aggregations; +import es.org.elasticsearch.search.aggregations.bucket.histogram.Histogram; +import es.org.elasticsearch.search.aggregations.bucket.histogram.Histogram.Bucket; +import es.org.elasticsearch.search.aggregations.metrics.Sum; import java.util.List; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; -import org.elasticsearch.search.aggregations.bucket.histogram.Histogram.Bucket; -import org.elasticsearch.search.aggregations.metrics.Sum; import org.openmetadata.service.dataInsight.AggregatedUsedvsUnusedAssetsSizeAggregator; public class ElasticSearchAggregatedUsedvsUnusedAssetsSizeAggregator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchDailyActiveUsersAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchDailyActiveUsersAggregator.java index ee91ac630ddd..2248442c1395 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchDailyActiveUsersAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchDailyActiveUsersAggregator.java @@ -1,8 +1,8 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; +import es.org.elasticsearch.search.aggregations.Aggregations; +import es.org.elasticsearch.search.aggregations.bucket.histogram.Histogram; import java.util.List; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; import org.openmetadata.service.dataInsight.DailyActiveUsersAggregator; public class ElasticSearchDailyActiveUsersAggregator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchEntitiesDescriptionAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchEntitiesDescriptionAggregator.java index 7147ae8749b8..12d6ae390b98 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchEntitiesDescriptionAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchEntitiesDescriptionAggregator.java @@ -1,9 +1,9 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; +import es.org.elasticsearch.search.aggregations.Aggregations; +import es.org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import es.org.elasticsearch.search.aggregations.metrics.Sum; import java.util.List; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.elasticsearch.search.aggregations.metrics.Sum; import org.openmetadata.service.dataInsight.EntitiesDescriptionAggregator; public class ElasticSearchEntitiesDescriptionAggregator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchEntitiesOwnerAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchEntitiesOwnerAggregator.java index a38128e84f0d..9f3e9d40f3e7 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchEntitiesOwnerAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchEntitiesOwnerAggregator.java @@ -1,9 +1,9 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; +import es.org.elasticsearch.search.aggregations.Aggregations; +import es.org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import es.org.elasticsearch.search.aggregations.metrics.Sum; import java.util.List; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.elasticsearch.search.aggregations.metrics.Sum; import org.openmetadata.service.dataInsight.EntitiesOwnerAggregator; public class ElasticSearchEntitiesOwnerAggregator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchMostActiveUsersAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchMostActiveUsersAggregator.java index a0872ea6b564..1b3124949f37 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchMostActiveUsersAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchMostActiveUsersAggregator.java @@ -1,10 +1,10 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; +import es.org.elasticsearch.search.aggregations.Aggregations; +import es.org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import es.org.elasticsearch.search.aggregations.metrics.Max; +import es.org.elasticsearch.search.aggregations.metrics.Sum; import java.util.List; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.elasticsearch.search.aggregations.metrics.Max; -import org.elasticsearch.search.aggregations.metrics.Sum; import org.openmetadata.service.dataInsight.MostActiveUsersAggregator; public class ElasticSearchMostActiveUsersAggregator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchMostViewedEntitiesAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchMostViewedEntitiesAggregator.java index b063bb7b9336..e0a5849392eb 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchMostViewedEntitiesAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchMostViewedEntitiesAggregator.java @@ -1,9 +1,9 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; +import es.org.elasticsearch.search.aggregations.Aggregations; +import es.org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import es.org.elasticsearch.search.aggregations.metrics.Sum; import java.util.List; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.elasticsearch.search.aggregations.metrics.Sum; import org.openmetadata.service.dataInsight.MostViewedEntitiesAggregator; public class ElasticSearchMostViewedEntitiesAggregator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchPageViewsByEntitiesAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchPageViewsByEntitiesAggregator.java index e1d4255fc7df..b645d730948a 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchPageViewsByEntitiesAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchPageViewsByEntitiesAggregator.java @@ -1,9 +1,9 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; +import es.org.elasticsearch.search.aggregations.Aggregations; +import es.org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import es.org.elasticsearch.search.aggregations.metrics.Sum; import java.util.List; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.elasticsearch.search.aggregations.metrics.Sum; import org.openmetadata.service.dataInsight.PageViewsByEntitiesAggregator; public class ElasticSearchPageViewsByEntitiesAggregator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchServicesDescriptionAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchServicesDescriptionAggregator.java index fbb3c752486a..484f116a0602 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchServicesDescriptionAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchServicesDescriptionAggregator.java @@ -1,9 +1,9 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; +import es.org.elasticsearch.search.aggregations.Aggregations; +import es.org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import es.org.elasticsearch.search.aggregations.metrics.Sum; import java.util.List; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.elasticsearch.search.aggregations.metrics.Sum; import org.openmetadata.service.dataInsight.ServicesDescriptionAggregator; public class ElasticSearchServicesDescriptionAggregator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchServicesOwnerAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchServicesOwnerAggregator.java index 0f9ce0446956..0a6270a29ac8 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchServicesOwnerAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchServicesOwnerAggregator.java @@ -1,9 +1,9 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; +import es.org.elasticsearch.search.aggregations.Aggregations; +import es.org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import es.org.elasticsearch.search.aggregations.metrics.Sum; import java.util.List; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.elasticsearch.search.aggregations.metrics.Sum; import org.openmetadata.service.dataInsight.ServicesOwnerAggregator; public class ElasticSearchServicesOwnerAggregator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchTotalEntitiesAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchTotalEntitiesAggregator.java index 3ff5d6cfece4..66de7d0d370c 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchTotalEntitiesAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchTotalEntitiesAggregator.java @@ -1,9 +1,9 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; +import es.org.elasticsearch.search.aggregations.Aggregations; +import es.org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import es.org.elasticsearch.search.aggregations.metrics.Sum; import java.util.List; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.elasticsearch.search.aggregations.metrics.Sum; import org.openmetadata.service.dataInsight.TotalEntitiesAggregator; public class ElasticSearchTotalEntitiesAggregator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchTotalEntitiesByTierAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchTotalEntitiesByTierAggregator.java index 922a7aec645e..cf8db18f1bf4 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchTotalEntitiesByTierAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchTotalEntitiesByTierAggregator.java @@ -1,9 +1,9 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; +import es.org.elasticsearch.search.aggregations.Aggregations; +import es.org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import es.org.elasticsearch.search.aggregations.metrics.Sum; import java.util.List; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.elasticsearch.search.aggregations.metrics.Sum; import org.openmetadata.service.dataInsight.TotalEntitiesByTierAggregator; public class ElasticSearchTotalEntitiesByTierAggregator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchUnusedAssetsAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchUnusedAssetsAggregator.java index f39c741f5114..4a02734786e5 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchUnusedAssetsAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/dataInsightAggregators/ElasticSearchUnusedAssetsAggregator.java @@ -1,8 +1,8 @@ package org.openmetadata.service.search.elasticsearch.dataInsightAggregators; -import org.apache.lucene.search.TotalHits; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.SearchHits; +import es.org.apache.lucene.search.TotalHits; +import es.org.elasticsearch.search.SearchHit; +import es.org.elasticsearch.search.SearchHits; import org.openmetadata.service.dataInsight.UnusedAssetsAggregator; public class ElasticSearchUnusedAssetsAggregator extends UnusedAssetsAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchClient.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchClient.java index cc1a268880af..096434b1fad1 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchClient.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchClient.java @@ -47,7 +47,6 @@ import org.openmetadata.service.jdbi3.DataInsightChartRepository; import org.openmetadata.service.search.SearchClient; import org.openmetadata.service.search.SearchRequest; -import org.openmetadata.service.search.UpdateSearchEventsConstant; import org.openmetadata.service.search.indexes.ContainerIndex; import org.openmetadata.service.search.indexes.DashboardDataModelIndex; import org.openmetadata.service.search.indexes.DashboardIndex; @@ -80,72 +79,72 @@ import org.openmetadata.service.search.opensearch.dataInsightAggregator.OpenSearchTotalEntitiesByTierAggregator; import org.openmetadata.service.search.opensearch.dataInsightAggregator.OpenSearchUnusedAssetsAggregator; import org.openmetadata.service.util.JsonUtils; -import org.opensearch.action.ActionListener; -import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest; -import org.opensearch.action.admin.indices.delete.DeleteIndexRequest; -import org.opensearch.action.bulk.BulkItemResponse; -import org.opensearch.action.bulk.BulkRequest; -import org.opensearch.action.bulk.BulkResponse; -import org.opensearch.action.delete.DeleteRequest; -import org.opensearch.action.delete.DeleteResponse; -import org.opensearch.action.search.SearchResponse; -import org.opensearch.action.support.WriteRequest; -import org.opensearch.action.support.master.AcknowledgedResponse; -import org.opensearch.action.update.UpdateRequest; -import org.opensearch.action.update.UpdateResponse; -import org.opensearch.client.RequestOptions; -import org.opensearch.client.RestClient; -import org.opensearch.client.RestClientBuilder; -import org.opensearch.client.RestHighLevelClient; -import org.opensearch.client.indices.CreateIndexRequest; -import org.opensearch.client.indices.CreateIndexResponse; -import org.opensearch.client.indices.GetIndexRequest; -import org.opensearch.client.indices.PutMappingRequest; -import org.opensearch.common.lucene.search.function.CombineFunction; -import org.opensearch.common.settings.Settings; -import org.opensearch.common.unit.Fuzziness; -import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.xcontent.LoggingDeprecationHandler; -import org.opensearch.common.xcontent.NamedXContentRegistry; -import org.opensearch.common.xcontent.XContentParser; -import org.opensearch.common.xcontent.XContentType; -import org.opensearch.index.query.BoolQueryBuilder; -import org.opensearch.index.query.MatchQueryBuilder; -import org.opensearch.index.query.MultiMatchQueryBuilder; -import org.opensearch.index.query.Operator; -import org.opensearch.index.query.QueryBuilder; -import org.opensearch.index.query.QueryBuilders; -import org.opensearch.index.query.QueryStringQueryBuilder; -import org.opensearch.index.query.RangeQueryBuilder; -import org.opensearch.index.query.ScriptQueryBuilder; -import org.opensearch.index.query.TermQueryBuilder; -import org.opensearch.index.query.functionscore.FieldValueFactorFunctionBuilder; -import org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder; -import org.opensearch.index.query.functionscore.ScoreFunctionBuilders; -import org.opensearch.index.reindex.BulkByScrollResponse; -import org.opensearch.index.reindex.DeleteByQueryRequest; -import org.opensearch.index.reindex.UpdateByQueryRequest; -import org.opensearch.script.Script; -import org.opensearch.script.ScriptType; -import org.opensearch.search.SearchModule; -import org.opensearch.search.aggregations.AggregationBuilder; -import org.opensearch.search.aggregations.AggregationBuilders; -import org.opensearch.search.aggregations.BucketOrder; -import org.opensearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; -import org.opensearch.search.aggregations.bucket.histogram.DateHistogramInterval; -import org.opensearch.search.aggregations.bucket.terms.IncludeExclude; -import org.opensearch.search.aggregations.bucket.terms.TermsAggregationBuilder; -import org.opensearch.search.aggregations.metrics.MaxAggregationBuilder; -import org.opensearch.search.aggregations.metrics.SumAggregationBuilder; -import org.opensearch.search.builder.SearchSourceBuilder; -import org.opensearch.search.fetch.subphase.FetchSourceContext; -import org.opensearch.search.fetch.subphase.highlight.HighlightBuilder; -import org.opensearch.search.sort.SortOrder; -import org.opensearch.search.suggest.Suggest; -import org.opensearch.search.suggest.SuggestBuilder; -import org.opensearch.search.suggest.SuggestBuilders; -import org.opensearch.search.suggest.completion.CompletionSuggestionBuilder; -import org.opensearch.search.suggest.completion.context.CategoryQueryContext; +import os.org.opensearch.action.ActionListener; +import os.org.opensearch.action.admin.indices.alias.IndicesAliasesRequest; +import os.org.opensearch.action.admin.indices.delete.DeleteIndexRequest; +import os.org.opensearch.action.bulk.BulkItemResponse; +import os.org.opensearch.action.bulk.BulkRequest; +import os.org.opensearch.action.bulk.BulkResponse; +import os.org.opensearch.action.delete.DeleteRequest; +import os.org.opensearch.action.delete.DeleteResponse; +import os.org.opensearch.action.search.SearchResponse; +import os.org.opensearch.action.support.WriteRequest; +import os.org.opensearch.action.support.master.AcknowledgedResponse; +import os.org.opensearch.action.update.UpdateRequest; +import os.org.opensearch.action.update.UpdateResponse; +import os.org.opensearch.client.RequestOptions; +import os.org.opensearch.client.RestClient; +import os.org.opensearch.client.RestClientBuilder; +import os.org.opensearch.client.RestHighLevelClient; +import os.org.opensearch.client.indices.CreateIndexRequest; +import os.org.opensearch.client.indices.CreateIndexResponse; +import os.org.opensearch.client.indices.GetIndexRequest; +import os.org.opensearch.client.indices.PutMappingRequest; +import os.org.opensearch.common.lucene.search.function.CombineFunction; +import os.org.opensearch.common.settings.Settings; +import os.org.opensearch.common.unit.Fuzziness; +import os.org.opensearch.common.unit.TimeValue; +import os.org.opensearch.common.xcontent.LoggingDeprecationHandler; +import os.org.opensearch.common.xcontent.NamedXContentRegistry; +import os.org.opensearch.common.xcontent.XContentParser; +import os.org.opensearch.common.xcontent.XContentType; +import os.org.opensearch.index.query.BoolQueryBuilder; +import os.org.opensearch.index.query.MatchQueryBuilder; +import os.org.opensearch.index.query.MultiMatchQueryBuilder; +import os.org.opensearch.index.query.Operator; +import os.org.opensearch.index.query.QueryBuilder; +import os.org.opensearch.index.query.QueryBuilders; +import os.org.opensearch.index.query.QueryStringQueryBuilder; +import os.org.opensearch.index.query.RangeQueryBuilder; +import os.org.opensearch.index.query.ScriptQueryBuilder; +import os.org.opensearch.index.query.TermQueryBuilder; +import os.org.opensearch.index.query.functionscore.FieldValueFactorFunctionBuilder; +import os.org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder; +import os.org.opensearch.index.query.functionscore.ScoreFunctionBuilders; +import os.org.opensearch.index.reindex.BulkByScrollResponse; +import os.org.opensearch.index.reindex.DeleteByQueryRequest; +import os.org.opensearch.index.reindex.UpdateByQueryRequest; +import os.org.opensearch.script.Script; +import os.org.opensearch.script.ScriptType; +import os.org.opensearch.search.SearchModule; +import os.org.opensearch.search.aggregations.AggregationBuilder; +import os.org.opensearch.search.aggregations.AggregationBuilders; +import os.org.opensearch.search.aggregations.BucketOrder; +import os.org.opensearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; +import os.org.opensearch.search.aggregations.bucket.histogram.DateHistogramInterval; +import os.org.opensearch.search.aggregations.bucket.terms.IncludeExclude; +import os.org.opensearch.search.aggregations.bucket.terms.TermsAggregationBuilder; +import os.org.opensearch.search.aggregations.metrics.MaxAggregationBuilder; +import os.org.opensearch.search.aggregations.metrics.SumAggregationBuilder; +import os.org.opensearch.search.builder.SearchSourceBuilder; +import os.org.opensearch.search.fetch.subphase.FetchSourceContext; +import os.org.opensearch.search.fetch.subphase.highlight.HighlightBuilder; +import os.org.opensearch.search.sort.SortOrder; +import os.org.opensearch.search.suggest.Suggest; +import os.org.opensearch.search.suggest.SuggestBuilder; +import os.org.opensearch.search.suggest.SuggestBuilders; +import os.org.opensearch.search.suggest.completion.CompletionSuggestionBuilder; +import os.org.opensearch.search.suggest.completion.context.CategoryQueryContext; @Slf4j // Not tagged with Repository annotation as it is programmatically initialized @@ -155,7 +154,7 @@ public class OpenSearchClient implements SearchClient { private final boolean isClientAvailable; static { - SearchModule searchModule = new SearchModule(Settings.EMPTY, false, List.of()); + SearchModule searchModule = new SearchModule(Settings.EMPTY, List.of()); X_CONTENT_REGISTRY = new NamedXContentRegistry(searchModule.getNamedXContents()); } @@ -192,13 +191,13 @@ public boolean createIndex(IndexMapping indexMapping, String indexMappingContent // creating alias for indexes createAliases(indexMapping); } catch (Exception e) { - LOG.error("Failed to create Elastic Search indexes due to", e); + LOG.error("Failed to create Open Search indexes due to", e); return false; } return true; } else { LOG.error( - "Failed to create Elastic Search index as client is not property configured, Please check your OpenMetadata configuration"); + "Failed to create Open Search index as client is not property configured, Please check your OpenMetadata configuration"); return false; } } @@ -206,27 +205,15 @@ public boolean createIndex(IndexMapping indexMapping, String indexMappingContent @Override public void createAliases(IndexMapping indexMapping) { try { - ActionListener listener = - new ActionListener<>() { - @Override - public void onResponse(AcknowledgedResponse acknowledgedResponse) { - LOG.debug("Created successfully: " + acknowledgedResponse.toString()); - } - - @Override - public void onFailure(Exception e) { - LOG.error("Creation failed: " + e.getMessage()); - } - }; List aliases = indexMapping.getParentAliases(); aliases.add(indexMapping.getAlias()); IndicesAliasesRequest.AliasActions aliasAction = IndicesAliasesRequest.AliasActions.add() - .index(indexMapping.getIndexMappingFile()) + .index(indexMapping.getIndexName()) .aliases(aliases.toArray(new String[0])); IndicesAliasesRequest aliasesRequest = new IndicesAliasesRequest(); aliasesRequest.addAliasAction(aliasAction); - client.indices().updateAliasesAsync(aliasesRequest, RequestOptions.DEFAULT, listener); + client.indices().updateAliases(aliasesRequest, RequestOptions.DEFAULT); } catch (Exception e) { LOG.error(String.format("Failed to create alias for %s due to", indexMapping.getIndexName()), e); } @@ -240,7 +227,7 @@ public void updateIndex(IndexMapping indexMapping, String indexMappingContent) { AcknowledgedResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT); LOG.debug("{} Updated {}", indexMapping.getIndexMappingFile(), putMappingResponse.isAcknowledged()); } catch (Exception e) { - LOG.error(String.format("Failed to Update Elastic Search index %s due to", indexMapping.getIndexName()), e); + LOG.error(String.format("Failed to Update Open Search index %s due to", indexMapping.getIndexName()), e); } } @@ -251,7 +238,7 @@ public void deleteIndex(IndexMapping indexMapping) { AcknowledgedResponse deleteIndexResponse = client.indices().delete(request, RequestOptions.DEFAULT); LOG.debug("{} Deleted {}", indexMapping.getIndexName(), deleteIndexResponse.isAcknowledged()); } catch (IOException e) { - LOG.error("Failed to delete Elastic Search indexes due to", e); + LOG.error("Failed to delete Open Search indexes due to", e); } } @@ -359,11 +346,11 @@ public Response search(SearchRequest request) throws IOException { searchSourceBuilder.sort(request.getSortFieldParam(), SortOrder.fromString(request.getSortOrder())); } - /* for performance reasons ElasticSearch doesn't provide accurate hits + /* for performance reasons OpenSearch doesn't provide accurate hits if we enable trackTotalHits parameter it will try to match every result, count and return hits however in most cases for search results an approximate value is good enough. we are displaying total entity counts in landing page and explore page where we need the total count - https://github.com/elastic/elasticsearch/issues/33028 */ + https://github.com/Open/Opensearch/issues/33028 */ searchSourceBuilder.fetchSource( new FetchSourceContext( request.fetchSource(), request.getIncludeSourceFields().toArray(String[]::new), new String[] {})); @@ -378,7 +365,7 @@ public Response search(SearchRequest request) throws IOException { String response = client .search( - new org.opensearch.action.search.SearchRequest(request.getIndex()).source(searchSourceBuilder), + new os.org.opensearch.action.search.SearchRequest(request.getIndex()).source(searchSourceBuilder), RequestOptions.DEFAULT) .toString(); return Response.status(OK).entity(response).build(); @@ -387,8 +374,8 @@ public Response search(SearchRequest request) throws IOException { @Override public Response searchBySourceUrl(String sourceUrl) throws IOException { QueryBuilder wildcardQuery = QueryBuilders.queryStringQuery(sourceUrl).field("sourceUrl").escape(true); - org.opensearch.action.search.SearchRequest searchRequest = - new org.opensearch.action.search.SearchRequest(GLOBAL_SEARCH_ALIAS); + os.org.opensearch.action.search.SearchRequest searchRequest = + new os.org.opensearch.action.search.SearchRequest(GLOBAL_SEARCH_ALIAS); SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); searchSourceBuilder.query(wildcardQuery); searchRequest.source(searchSourceBuilder); @@ -398,7 +385,8 @@ public Response searchBySourceUrl(String sourceUrl) throws IOException { @Override public Response searchByField(String fieldName, String fieldValue, String index) throws IOException { - org.opensearch.action.search.SearchRequest searchRequest = new org.opensearch.action.search.SearchRequest(index); + os.org.opensearch.action.search.SearchRequest searchRequest = + new os.org.opensearch.action.search.SearchRequest(index); SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); searchSourceBuilder.query(QueryBuilders.wildcardQuery(fieldName, fieldValue)); searchRequest.source(searchSourceBuilder); @@ -426,7 +414,7 @@ public Response aggregate(String index, String fieldName, String value, String q String response = client .search( - new org.opensearch.action.search.SearchRequest(index).source(searchSourceBuilder), + new os.org.opensearch.action.search.SearchRequest(index).source(searchSourceBuilder), RequestOptions.DEFAULT) .toString(); return Response.status(OK).entity(response).build(); @@ -441,12 +429,12 @@ public void updateSearch(UpdateRequest updateRequest) { new ActionListener<>() { @Override public void onResponse(UpdateResponse updateResponse) { - LOG.debug("Created successfully: " + updateResponse.toString()); + LOG.debug("Entity Updated successfully: " + updateResponse.toString()); } @Override public void onFailure(Exception e) { - LOG.error("Creation failed: " + e.getMessage()); + LOG.error("Entity Update failed: " + e.getMessage()); } }; client.updateAsync(updateRequest, RequestOptions.DEFAULT, listener); @@ -476,8 +464,8 @@ public Response suggest(SearchRequest request) throws IOException { .fetchSource( new FetchSourceContext( request.fetchSource(), request.getIncludeSourceFields().toArray(String[]::new), new String[] {})); - org.opensearch.action.search.SearchRequest searchRequest = - new org.opensearch.action.search.SearchRequest(request.getIndex()).source(searchSourceBuilder); + os.org.opensearch.action.search.SearchRequest searchRequest = + new os.org.opensearch.action.search.SearchRequest(request.getIndex()).source(searchSourceBuilder); SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT); Suggest suggest = searchResponse.getSuggest(); return Response.status(OK).entity(suggest.toString()).build(); @@ -932,7 +920,7 @@ public void deleteByScript(String indexName, String scriptTxt, Map> fi queryBuilder.must(new TermQueryBuilder(p.getKey(), p.getValue())); } deleteByQueryRequest.setQuery(queryBuilder); - deleteEntityFromElasticSearchByQuery(deleteByQueryRequest); + deleteEntityFromOpenSearchByQuery(deleteByQueryRequest); } } @@ -979,7 +967,7 @@ public void softDeleteOrRestoreChildren( updateByQueryRequest.setQuery(queryBuilder); Script script = new Script(ScriptType.INLINE, Script.DEFAULT_SCRIPT_LANG, scriptTxt, new HashMap<>()); updateByQueryRequest.setScript(script); - updateElasticSearchByQuery(updateByQueryRequest); + updateOpenSearchByQuery(updateByQueryRequest); } } @@ -1007,11 +995,11 @@ public void updateChildren( updates.getKey(), JsonUtils.getMap(updates.getValue() == null ? new HashMap<>() : updates.getValue())); updateByQueryRequest.setScript(script); - updateElasticSearchByQuery(updateByQueryRequest); + updateOpenSearchByQuery(updateByQueryRequest); } } - private void updateElasticSearchByQuery(UpdateByQueryRequest updateByQueryRequest) { + private void updateOpenSearchByQuery(UpdateByQueryRequest updateByQueryRequest) { if (updateByQueryRequest != null && isClientAvailable) { updateByQueryRequest.setRefresh(true); LOG.debug(SENDING_REQUEST_TO_ELASTIC_SEARCH, updateByQueryRequest); @@ -1034,26 +1022,26 @@ public void onFailure(Exception e) { public void updateOpenSearch(UpdateRequest updateRequest) { if (updateRequest != null && isClientAvailable) { updateRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE); - LOG.debug(UpdateSearchEventsConstant.SENDING_REQUEST_TO_ELASTIC_SEARCH, updateRequest); + LOG.debug(SENDING_REQUEST_TO_ELASTIC_SEARCH, updateRequest); ActionListener listener = new ActionListener<>() { @Override public void onResponse(UpdateResponse updateResponse) { - LOG.debug("Created successfully: " + updateResponse.toString()); + LOG.debug("Entity Updated successfully: " + updateResponse.toString()); } @Override public void onFailure(Exception e) { - LOG.error("Creation failed: " + e.getMessage()); + LOG.error("Entity Update failed: " + e.getMessage()); } }; client.updateAsync(updateRequest, RequestOptions.DEFAULT, listener); } } - private void deleteEntityFromElasticSearch(DeleteRequest deleteRequest) { + private void deleteEntityFromOpenSearch(DeleteRequest deleteRequest) { if (deleteRequest != null && isClientAvailable) { - LOG.debug(UpdateSearchEventsConstant.SENDING_REQUEST_TO_ELASTIC_SEARCH, deleteRequest); + LOG.debug(SENDING_REQUEST_TO_ELASTIC_SEARCH, deleteRequest); ActionListener listener = new ActionListener<>() { @Override @@ -1071,7 +1059,7 @@ public void onFailure(Exception e) { } } - private void deleteEntityFromElasticSearchByQuery(DeleteByQueryRequest deleteRequest) { + private void deleteEntityFromOpenSearchByQuery(DeleteByQueryRequest deleteRequest) { if (deleteRequest != null && isClientAvailable) { deleteRequest.setRefresh(true); ActionListener listener = @@ -1124,7 +1112,7 @@ public TreeMap> getSortedDate( DataInsightChartResult.DataInsightChartType chartType, String indexName) throws IOException, ParseException { - org.opensearch.action.search.SearchRequest searchRequestTotalAssets = + os.org.opensearch.action.search.SearchRequest searchRequestTotalAssets = buildSearchRequest(scheduleTime, currentTime, null, team, chartType, null, null, null, indexName); SearchResponse searchResponseTotalAssets = client.search(searchRequestTotalAssets, RequestOptions.DEFAULT); DataInsightChartResult processedDataTotalAssets = @@ -1155,7 +1143,7 @@ public Response listDataInsightChartResult( String queryFilter, String dataReportIndex) throws IOException, ParseException { - org.opensearch.action.search.SearchRequest searchRequest = + os.org.opensearch.action.search.SearchRequest searchRequest = buildSearchRequest(startTs, endTs, tier, team, dataInsightChartName, size, from, queryFilter, dataReportIndex); SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT); return Response.status(OK).entity(processDataInsightChartResult(searchResponse, dataInsightChartName)).build(); @@ -1208,7 +1196,7 @@ private static DataInsightAggregatorInterface createDataAggregator( } } - private static org.opensearch.action.search.SearchRequest buildSearchRequest( + private static os.org.opensearch.action.search.SearchRequest buildSearchRequest( Long startTs, Long endTs, String tier, @@ -1233,8 +1221,8 @@ private static org.opensearch.action.search.SearchRequest buildSearchRequest( searchSourceBuilder.sort("data.lifeCycle.accessed.timestamp", SortOrder.DESC); } - org.opensearch.action.search.SearchRequest searchRequest = - new org.opensearch.action.search.SearchRequest(dataReportIndex); + os.org.opensearch.action.search.SearchRequest searchRequest = + new os.org.opensearch.action.search.SearchRequest(dataReportIndex); searchRequest.source(searchSourceBuilder); return searchRequest; } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchDataInsightProcessor.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchDataInsightProcessor.java index 95626cde1c88..670cb7602ce6 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchDataInsightProcessor.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchDataInsightProcessor.java @@ -16,9 +16,9 @@ import org.openmetadata.service.util.JsonUtils; import org.openmetadata.service.util.ResultList; import org.openmetadata.service.workflows.interfaces.Processor; -import org.opensearch.action.bulk.BulkRequest; -import org.opensearch.action.update.UpdateRequest; -import org.opensearch.common.xcontent.XContentType; +import os.org.opensearch.action.bulk.BulkRequest; +import os.org.opensearch.action.update.UpdateRequest; +import os.org.opensearch.common.xcontent.XContentType; @Slf4j public class OpenSearchDataInsightProcessor implements Processor> { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchEntitiesProcessor.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchEntitiesProcessor.java index 940794d5236b..8f7064dc6270 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchEntitiesProcessor.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchEntitiesProcessor.java @@ -17,9 +17,9 @@ import org.openmetadata.service.util.JsonUtils; import org.openmetadata.service.util.ResultList; import org.openmetadata.service.workflows.interfaces.Processor; -import org.opensearch.action.bulk.BulkRequest; -import org.opensearch.action.update.UpdateRequest; -import org.opensearch.common.xcontent.XContentType; +import os.org.opensearch.action.bulk.BulkRequest; +import os.org.opensearch.action.update.UpdateRequest; +import os.org.opensearch.common.xcontent.XContentType; @Slf4j public class OpenSearchEntitiesProcessor implements Processor> { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchIndexSink.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchIndexSink.java index 331b9006c3ff..4283790076b4 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchIndexSink.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchIndexSink.java @@ -9,9 +9,9 @@ import org.openmetadata.service.exception.SinkException; import org.openmetadata.service.search.SearchRepository; import org.openmetadata.service.workflows.interfaces.Sink; -import org.opensearch.action.bulk.BulkRequest; -import org.opensearch.action.bulk.BulkResponse; -import org.opensearch.client.RequestOptions; +import os.org.opensearch.action.bulk.BulkRequest; +import os.org.opensearch.action.bulk.BulkResponse; +import os.org.opensearch.client.RequestOptions; @Slf4j public class OpenSearchIndexSink implements Sink { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUnusedAssetsCountAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUnusedAssetsCountAggregator.java index 30000d3e1f8f..c65c78efd7c4 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUnusedAssetsCountAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUnusedAssetsCountAggregator.java @@ -2,10 +2,10 @@ import java.util.List; import org.openmetadata.service.dataInsight.AggregatedUnusedAssetsCountAggregator; -import org.opensearch.search.aggregations.Aggregations; -import org.opensearch.search.aggregations.bucket.histogram.Histogram; -import org.opensearch.search.aggregations.bucket.histogram.Histogram.Bucket; -import org.opensearch.search.aggregations.metrics.Sum; +import os.org.opensearch.search.aggregations.Aggregations; +import os.org.opensearch.search.aggregations.bucket.histogram.Histogram; +import os.org.opensearch.search.aggregations.bucket.histogram.Histogram.Bucket; +import os.org.opensearch.search.aggregations.metrics.Sum; public class OpenSearchAggregatedUnusedAssetsCountAggregator extends AggregatedUnusedAssetsCountAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUnusedAssetsSizeAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUnusedAssetsSizeAggregator.java index d61c81aeebd3..6ec59174e421 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUnusedAssetsSizeAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUnusedAssetsSizeAggregator.java @@ -2,10 +2,10 @@ import java.util.List; import org.openmetadata.service.dataInsight.AggregatedUnusedAssetsSizeAggregator; -import org.opensearch.search.aggregations.Aggregations; -import org.opensearch.search.aggregations.bucket.histogram.Histogram; -import org.opensearch.search.aggregations.bucket.histogram.Histogram.Bucket; -import org.opensearch.search.aggregations.metrics.Sum; +import os.org.opensearch.search.aggregations.Aggregations; +import os.org.opensearch.search.aggregations.bucket.histogram.Histogram; +import os.org.opensearch.search.aggregations.bucket.histogram.Histogram.Bucket; +import os.org.opensearch.search.aggregations.metrics.Sum; public class OpenSearchAggregatedUnusedAssetsSizeAggregator extends AggregatedUnusedAssetsSizeAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUsedvsUnusedAssetsCountAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUsedvsUnusedAssetsCountAggregator.java index cb13d274ee88..ffeb0b5bf9a0 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUsedvsUnusedAssetsCountAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUsedvsUnusedAssetsCountAggregator.java @@ -2,10 +2,10 @@ import java.util.List; import org.openmetadata.service.dataInsight.AggregatedUsedvsUnusedAssetsCountAggregator; -import org.opensearch.search.aggregations.Aggregations; -import org.opensearch.search.aggregations.bucket.histogram.Histogram; -import org.opensearch.search.aggregations.bucket.histogram.Histogram.Bucket; -import org.opensearch.search.aggregations.metrics.Sum; +import os.org.opensearch.search.aggregations.Aggregations; +import os.org.opensearch.search.aggregations.bucket.histogram.Histogram; +import os.org.opensearch.search.aggregations.bucket.histogram.Histogram.Bucket; +import os.org.opensearch.search.aggregations.metrics.Sum; public class OpenSearchAggregatedUsedvsUnusedAssetsCountAggregator extends AggregatedUsedvsUnusedAssetsCountAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUsedvsUnusedAssetsSizeAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUsedvsUnusedAssetsSizeAggregator.java index 17e46cd0baeb..5403cc3fd752 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUsedvsUnusedAssetsSizeAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchAggregatedUsedvsUnusedAssetsSizeAggregator.java @@ -2,10 +2,10 @@ import java.util.List; import org.openmetadata.service.dataInsight.AggregatedUsedvsUnusedAssetsSizeAggregator; -import org.opensearch.search.aggregations.Aggregations; -import org.opensearch.search.aggregations.bucket.histogram.Histogram; -import org.opensearch.search.aggregations.bucket.histogram.Histogram.Bucket; -import org.opensearch.search.aggregations.metrics.Sum; +import os.org.opensearch.search.aggregations.Aggregations; +import os.org.opensearch.search.aggregations.bucket.histogram.Histogram; +import os.org.opensearch.search.aggregations.bucket.histogram.Histogram.Bucket; +import os.org.opensearch.search.aggregations.metrics.Sum; public class OpenSearchAggregatedUsedvsUnusedAssetsSizeAggregator extends AggregatedUsedvsUnusedAssetsSizeAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchDailyActiveUsersAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchDailyActiveUsersAggregator.java index d1f57383e9db..5015792c9f56 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchDailyActiveUsersAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchDailyActiveUsersAggregator.java @@ -1,8 +1,8 @@ package org.openmetadata.service.search.opensearch.dataInsightAggregator; import java.util.List; -import org.opensearch.search.aggregations.Aggregations; -import org.opensearch.search.aggregations.bucket.histogram.Histogram; +import os.org.opensearch.search.aggregations.Aggregations; +import os.org.opensearch.search.aggregations.bucket.histogram.Histogram; public class OpenSearchDailyActiveUsersAggregator extends org.openmetadata.service.dataInsight.DailyActiveUsersAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchEntitiesDescriptionAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchEntitiesDescriptionAggregator.java index 52c6f9752d16..2797a3fa35a9 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchEntitiesDescriptionAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchEntitiesDescriptionAggregator.java @@ -2,9 +2,9 @@ import java.util.List; import org.openmetadata.service.dataInsight.EntitiesDescriptionAggregator; -import org.opensearch.search.aggregations.Aggregations; -import org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.opensearch.search.aggregations.metrics.Sum; +import os.org.opensearch.search.aggregations.Aggregations; +import os.org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; +import os.org.opensearch.search.aggregations.metrics.Sum; public class OpenSearchEntitiesDescriptionAggregator extends EntitiesDescriptionAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchEntitiesOwnerAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchEntitiesOwnerAggregator.java index 8f27884ec2d4..2a98e742367b 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchEntitiesOwnerAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchEntitiesOwnerAggregator.java @@ -2,9 +2,9 @@ import java.util.List; import org.openmetadata.service.dataInsight.EntitiesOwnerAggregator; -import org.opensearch.search.aggregations.Aggregations; -import org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.opensearch.search.aggregations.metrics.Sum; +import os.org.opensearch.search.aggregations.Aggregations; +import os.org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; +import os.org.opensearch.search.aggregations.metrics.Sum; public class OpenSearchEntitiesOwnerAggregator extends EntitiesOwnerAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchMostActiveUsersAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchMostActiveUsersAggregator.java index 4d344397fd02..8a10699e5f6f 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchMostActiveUsersAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchMostActiveUsersAggregator.java @@ -2,10 +2,10 @@ import java.util.List; import org.openmetadata.service.dataInsight.MostActiveUsersAggregator; -import org.opensearch.search.aggregations.Aggregations; -import org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.opensearch.search.aggregations.metrics.Max; -import org.opensearch.search.aggregations.metrics.Sum; +import os.org.opensearch.search.aggregations.Aggregations; +import os.org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; +import os.org.opensearch.search.aggregations.metrics.Max; +import os.org.opensearch.search.aggregations.metrics.Sum; public class OpenSearchMostActiveUsersAggregator extends MostActiveUsersAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchMostViewedEntitiesAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchMostViewedEntitiesAggregator.java index c5f27abb828a..f05c05908139 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchMostViewedEntitiesAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchMostViewedEntitiesAggregator.java @@ -2,9 +2,9 @@ import java.util.List; import org.openmetadata.service.dataInsight.MostViewedEntitiesAggregator; -import org.opensearch.search.aggregations.Aggregations; -import org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.opensearch.search.aggregations.metrics.Sum; +import os.org.opensearch.search.aggregations.Aggregations; +import os.org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; +import os.org.opensearch.search.aggregations.metrics.Sum; public class OpenSearchMostViewedEntitiesAggregator extends MostViewedEntitiesAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchPageViewsByEntitiesAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchPageViewsByEntitiesAggregator.java index a98559c46968..10398e0eb0b0 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchPageViewsByEntitiesAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchPageViewsByEntitiesAggregator.java @@ -2,9 +2,9 @@ import java.util.List; import org.openmetadata.service.dataInsight.PageViewsByEntitiesAggregator; -import org.opensearch.search.aggregations.Aggregations; -import org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.opensearch.search.aggregations.metrics.Sum; +import os.org.opensearch.search.aggregations.Aggregations; +import os.org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; +import os.org.opensearch.search.aggregations.metrics.Sum; public class OpenSearchPageViewsByEntitiesAggregator extends PageViewsByEntitiesAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchServicesDescriptionAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchServicesDescriptionAggregator.java index 018c24d6e2e7..97b665a9f9c6 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchServicesDescriptionAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchServicesDescriptionAggregator.java @@ -2,9 +2,9 @@ import java.util.List; import org.openmetadata.service.dataInsight.ServicesDescriptionAggregator; -import org.opensearch.search.aggregations.Aggregations; -import org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.opensearch.search.aggregations.metrics.Sum; +import os.org.opensearch.search.aggregations.Aggregations; +import os.org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; +import os.org.opensearch.search.aggregations.metrics.Sum; public class OpenSearchServicesDescriptionAggregator extends ServicesDescriptionAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchServicesOwnerAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchServicesOwnerAggregator.java index e495bf7dbb4e..f70ddbe15fca 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchServicesOwnerAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchServicesOwnerAggregator.java @@ -2,9 +2,9 @@ import java.util.List; import org.openmetadata.service.dataInsight.ServicesOwnerAggregator; -import org.opensearch.search.aggregations.Aggregations; -import org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.opensearch.search.aggregations.metrics.Sum; +import os.org.opensearch.search.aggregations.Aggregations; +import os.org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; +import os.org.opensearch.search.aggregations.metrics.Sum; public class OpenSearchServicesOwnerAggregator extends ServicesOwnerAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchTotalEntitiesAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchTotalEntitiesAggregator.java index c865e8d2634a..16f074ff6578 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchTotalEntitiesAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchTotalEntitiesAggregator.java @@ -2,9 +2,9 @@ import java.util.List; import org.openmetadata.service.dataInsight.TotalEntitiesAggregator; -import org.opensearch.search.aggregations.Aggregations; -import org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.opensearch.search.aggregations.metrics.Sum; +import os.org.opensearch.search.aggregations.Aggregations; +import os.org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; +import os.org.opensearch.search.aggregations.metrics.Sum; public class OpenSearchTotalEntitiesAggregator extends TotalEntitiesAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchTotalEntitiesByTierAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchTotalEntitiesByTierAggregator.java index 99861667a6d0..44ce4a8c98f9 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchTotalEntitiesByTierAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchTotalEntitiesByTierAggregator.java @@ -2,9 +2,9 @@ import java.util.List; import org.openmetadata.service.dataInsight.TotalEntitiesByTierAggregator; -import org.opensearch.search.aggregations.Aggregations; -import org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; -import org.opensearch.search.aggregations.metrics.Sum; +import os.org.opensearch.search.aggregations.Aggregations; +import os.org.opensearch.search.aggregations.bucket.MultiBucketsAggregation; +import os.org.opensearch.search.aggregations.metrics.Sum; public class OpenSearchTotalEntitiesByTierAggregator extends TotalEntitiesByTierAggregator { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchUnusedAssetsAggregator.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchUnusedAssetsAggregator.java index c44f0dbfe650..2476bfb053b5 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchUnusedAssetsAggregator.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/dataInsightAggregator/OpenSearchUnusedAssetsAggregator.java @@ -1,9 +1,9 @@ package org.openmetadata.service.search.opensearch.dataInsightAggregator; -import org.apache.lucene.search.TotalHits; import org.openmetadata.service.dataInsight.UnusedAssetsAggregator; -import org.opensearch.search.SearchHit; -import org.opensearch.search.SearchHits; +import os.org.apache.lucene.search.TotalHits; +import os.org.opensearch.search.SearchHit; +import os.org.opensearch.search.SearchHits; public class OpenSearchUnusedAssetsAggregator extends UnusedAssetsAggregator { public OpenSearchUnusedAssetsAggregator(SearchHits hits) { diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/workflows/searchIndex/ReindexingUtil.java b/openmetadata-service/src/main/java/org/openmetadata/service/workflows/searchIndex/ReindexingUtil.java index 1a7752acd43f..31da3f9d4512 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/workflows/searchIndex/ReindexingUtil.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/workflows/searchIndex/ReindexingUtil.java @@ -18,8 +18,8 @@ import org.openmetadata.service.Entity; import org.openmetadata.service.jdbi3.CollectionDAO; import org.openmetadata.service.jdbi3.EntityRepository; -import org.opensearch.action.bulk.BulkItemResponse; -import org.opensearch.action.bulk.BulkResponse; +import os.org.opensearch.action.bulk.BulkItemResponse; +import os.org.opensearch.action.bulk.BulkResponse; public class ReindexingUtil { public static final String ENTITY_TYPE_KEY = "entityType"; @@ -57,9 +57,9 @@ public static int getSuccessFromBulkResponse(BulkResponse response) { return success; } - public static int getSuccessFromBulkResponseEs(org.elasticsearch.action.bulk.BulkResponse response) { + public static int getSuccessFromBulkResponseEs(es.org.elasticsearch.action.bulk.BulkResponse response) { int success = 0; - for (org.elasticsearch.action.bulk.BulkItemResponse bulkItemResponse : response) { + for (es.org.elasticsearch.action.bulk.BulkItemResponse bulkItemResponse : response) { if (!bulkItemResponse.isFailed()) { success++; } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/workflows/searchIndex/SearchIndexWorkflow.java b/openmetadata-service/src/main/java/org/openmetadata/service/workflows/searchIndex/SearchIndexWorkflow.java index f7828fe94d16..9d61dde9b428 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/workflows/searchIndex/SearchIndexWorkflow.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/workflows/searchIndex/SearchIndexWorkflow.java @@ -20,6 +20,9 @@ import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.getUpdatedStats; import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.isDataInsightIndex; +import es.org.elasticsearch.action.bulk.BulkItemResponse; +import es.org.elasticsearch.action.bulk.BulkRequest; +import es.org.elasticsearch.action.bulk.BulkResponse; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -28,9 +31,6 @@ import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.exception.ExceptionUtils; -import org.elasticsearch.action.bulk.BulkItemResponse; -import org.elasticsearch.action.bulk.BulkRequest; -import org.elasticsearch.action.bulk.BulkResponse; import org.openmetadata.common.utils.CommonUtil; import org.openmetadata.schema.EntityInterface; import org.openmetadata.schema.analytics.ReportData; @@ -151,11 +151,11 @@ private void entitiesReIndex() { if (!resultList.getData().isEmpty()) { if (searchRepository.getSearchType().equals(ElasticSearchConfiguration.SearchType.OPENSEARCH)) { // process data to build Reindex Request - org.opensearch.action.bulk.BulkRequest requests = - (org.opensearch.action.bulk.BulkRequest) entityProcessor.process(resultList, contextData); + os.org.opensearch.action.bulk.BulkRequest requests = + (os.org.opensearch.action.bulk.BulkRequest) entityProcessor.process(resultList, contextData); // process data to build Reindex Request - org.opensearch.action.bulk.BulkResponse response = - (org.opensearch.action.bulk.BulkResponse) searchIndexSink.write(requests, contextData); + os.org.opensearch.action.bulk.BulkResponse response = + (os.org.opensearch.action.bulk.BulkResponse) searchIndexSink.write(requests, contextData); // update Status handleErrorsOs(resultList, paginatedEntitiesSource.getLastFailedCursor(), response, currentTime); // Update stats @@ -222,11 +222,11 @@ private void dataInsightReindex() { if (!resultList.getData().isEmpty()) { if (searchRepository.getSearchType().equals(ElasticSearchConfiguration.SearchType.OPENSEARCH)) { // process data to build Reindex Request - org.opensearch.action.bulk.BulkRequest requests = - (org.opensearch.action.bulk.BulkRequest) dataInsightProcessor.process(resultList, contextData); + os.org.opensearch.action.bulk.BulkRequest requests = + (os.org.opensearch.action.bulk.BulkRequest) dataInsightProcessor.process(resultList, contextData); // process data to build Reindex Request - org.opensearch.action.bulk.BulkResponse response = - (org.opensearch.action.bulk.BulkResponse) searchIndexSink.write(requests, contextData); + os.org.opensearch.action.bulk.BulkResponse response = + (os.org.opensearch.action.bulk.BulkResponse) searchIndexSink.write(requests, contextData); handleErrorsOs(resultList, "", response, currentTime); // Update stats success = searchRepository.getSearchClient().getSuccessFromBulkResponse(response); @@ -338,7 +338,7 @@ private void reCreateIndexes(String entityType) { } private void handleErrorsOs( - ResultList data, String lastCursor, org.opensearch.action.bulk.BulkResponse response, long time) { + ResultList data, String lastCursor, os.org.opensearch.action.bulk.BulkResponse response, long time) { handleSourceError(data, lastCursor, time); handleOsSinkErrors(response, time); } @@ -388,11 +388,11 @@ private void handleSourceError(ResultList data, String lastCursor, long time) } @SneakyThrows - private void handleOsSinkErrors(org.opensearch.action.bulk.BulkResponse response, long time) { + private void handleOsSinkErrors(os.org.opensearch.action.bulk.BulkResponse response, long time) { List details = new ArrayList<>(); - for (org.opensearch.action.bulk.BulkItemResponse bulkItemResponse : response) { + for (os.org.opensearch.action.bulk.BulkItemResponse bulkItemResponse : response) { if (bulkItemResponse.isFailed()) { - org.opensearch.action.bulk.BulkItemResponse.Failure failure = bulkItemResponse.getFailure(); + os.org.opensearch.action.bulk.BulkItemResponse.Failure failure = bulkItemResponse.getFailure(); FailureDetails esFailure = new FailureDetails() .withContext( diff --git a/openmetadata-service/src/main/resources/elasticsearch/indexMapping.json b/openmetadata-service/src/main/resources/elasticsearch/indexMapping.json index ee9fb9f59aac..7af6fc602b58 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/indexMapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/indexMapping.json @@ -131,31 +131,31 @@ "alias": "team", "parentAliases": [] }, - "EntityReportData": { + "entityReportData": { "indexName": "entity_report_data_index", "indexMappingFile": "/elasticsearch/entity_report_data_index.json", "alias": "entityReportData", "parentAliases": [] }, - "WebAnalyticEntityViewReportData": { + "webAnalyticEntityViewReportData": { "indexName": "web_analytic_entity_view_report_data_index", "indexMappingFile": "/elasticsearch/web_analytic_entity_view_report_data_index.json", "alias": "webAnalyticEntityViewReportData", "parentAliases": [] }, - "WebAnalyticUserActivityReportData": { + "webAnalyticUserActivityReportData": { "indexName": "web_analytic_user_activity_report_data_index", "indexMappingFile": "/elasticsearch/web_analytic_user_activity_report_data_index.json", "alias": "webAnalyticUserActivityReportData", "parentAliases": [] }, - "RawCostAnalysisReportData": { + "rawCostAnalysisReportData": { "indexName": "raw_cost_analysis_report_data_index", "indexMappingFile": "/elasticsearch/raw_cost_analysis_report_data_index.json", "alias": "RawCostAnalysisReportData", "parentAliases": [] }, - "AggregatedCostAnalysisReportData": { + "aggregatedCostAnalysisReportData": { "indexName": "aggregated_cost_analysis_report_data_index", "indexMappingFile": "/elasticsearch/aggregated_cost_analysis_report_data_index.json", "alias": "AggregatedCostAnalysisReportData", diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/OpenMetadataApplicationTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/OpenMetadataApplicationTest.java index 0e221ba33094..4a444588107b 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/OpenMetadataApplicationTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/OpenMetadataApplicationTest.java @@ -16,6 +16,7 @@ import static java.lang.String.format; import static org.openmetadata.service.util.TablesInitializer.validateAndRunSystemDataMigrations; +import es.org.elasticsearch.client.RestClient; import io.dropwizard.jersey.jackson.JacksonFeature; import io.dropwizard.testing.ConfigOverride; import io.dropwizard.testing.ResourceHelpers; @@ -27,7 +28,6 @@ import javax.ws.rs.client.WebTarget; import lombok.extern.slf4j.Slf4j; import org.apache.http.HttpHost; -import org.elasticsearch.client.RestClient; import org.flywaydb.core.Flyway; import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.ClientProperties; diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/EntityResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/EntityResourceTest.java index 35422cf5f749..c383f002352d 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/EntityResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/EntityResourceTest.java @@ -52,6 +52,22 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; +import es.org.elasticsearch.action.search.SearchResponse; +import es.org.elasticsearch.client.Request; +import es.org.elasticsearch.client.Response; +import es.org.elasticsearch.client.RestClient; +import es.org.elasticsearch.search.SearchHit; +import es.org.elasticsearch.search.aggregations.Aggregation; +import es.org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms; +import es.org.elasticsearch.search.aggregations.bucket.terms.StringTerms; +import es.org.elasticsearch.search.aggregations.metrics.ParsedTopHits; +import es.org.elasticsearch.search.aggregations.metrics.TopHitsAggregationBuilder; +import es.org.elasticsearch.xcontent.ContextParser; +import es.org.elasticsearch.xcontent.DeprecationHandler; +import es.org.elasticsearch.xcontent.NamedXContentRegistry; +import es.org.elasticsearch.xcontent.ParseField; +import es.org.elasticsearch.xcontent.XContentParser; +import es.org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.net.URISyntaxException; import java.time.Duration; @@ -80,22 +96,6 @@ import org.apache.http.client.HttpResponseException; import org.apache.http.util.EntityUtils; import org.awaitility.Awaitility; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.Request; -import org.elasticsearch.client.Response; -import org.elasticsearch.client.RestClient; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.aggregations.Aggregation; -import org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms; -import org.elasticsearch.search.aggregations.bucket.terms.StringTerms; -import org.elasticsearch.search.aggregations.metrics.ParsedTopHits; -import org.elasticsearch.search.aggregations.metrics.TopHitsAggregationBuilder; -import org.elasticsearch.xcontent.ContextParser; -import org.elasticsearch.xcontent.DeprecationHandler; -import org.elasticsearch.xcontent.NamedXContentRegistry; -import org.elasticsearch.xcontent.ParseField; -import org.elasticsearch.xcontent.XContentParser; -import org.elasticsearch.xcontent.json.JsonXContent; import org.json.JSONArray; import org.json.JSONObject; import org.junit.jupiter.api.AfterAll; diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/analytics/ReportDataResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/analytics/ReportDataResourceTest.java index 7a958fc0ad73..ef784a5a59a4 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/analytics/ReportDataResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/analytics/ReportDataResourceTest.java @@ -13,6 +13,9 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import es.org.elasticsearch.client.Request; +import es.org.elasticsearch.client.Response; +import es.org.elasticsearch.client.RestClient; import java.io.IOException; import java.text.ParseException; import java.util.ArrayList; @@ -22,9 +25,6 @@ import java.util.UUID; import javax.ws.rs.client.WebTarget; import org.apache.http.client.HttpResponseException; -import org.elasticsearch.client.Request; -import org.elasticsearch.client.Response; -import org.elasticsearch.client.RestClient; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; diff --git a/openmetadata-shaded-deps/elasticsearch-dep/.gitignore b/openmetadata-shaded-deps/elasticsearch-dep/.gitignore new file mode 100644 index 000000000000..f68d1099657e --- /dev/null +++ b/openmetadata-shaded-deps/elasticsearch-dep/.gitignore @@ -0,0 +1,29 @@ +### IntelliJ IDEA ### +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/openmetadata-shaded-deps/elasticsearch-dep/pom.xml b/openmetadata-shaded-deps/elasticsearch-dep/pom.xml new file mode 100644 index 000000000000..e060a1f72bf2 --- /dev/null +++ b/openmetadata-shaded-deps/elasticsearch-dep/pom.xml @@ -0,0 +1,111 @@ + + + + openmetadata-shaded-deps + org.open-metadata + 1.2.0-SNAPSHOT + + 4.0.0 + elasticsearch-deps + Shaded Deps for OpenMetadata Server + Shaded version of dependencies used only for internal OpenMetadata code. + + + + org.elasticsearch.client + elasticsearch-rest-high-level-client + true + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.5.1 + + + package + + shade + + + + + false + true + false + + + *:* + + + + + org.elasticsearch + es.org.elasticsearch + + + org.elasticsearch.client + es.org.elasticsearch.client + + + org.apache.lucene + es.org.apache.lucene + + + + + *:* + + META-INF/*.SF + META-INF/*.sf + META-INF/*.DSA + META-INF/*.dsa + META-INF/*.RSA + META-INF/*.rsa + META-INF/*.EC + META-INF/*.ec + META-INF/MSFTSIG.SF + META-INF/MSFTSIG.RSA + META-INF/LICENSE.txt + META-INF/NOTICE.txt + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + workaround-makeItVisibleOnIntellij + none + + attach-artifact + + + + + ${project.build.directory}/${project.build.finalName}.jar + jar + optional + + + + + + + + + \ No newline at end of file diff --git a/openmetadata-shaded-deps/opensearch-dep/.gitignore b/openmetadata-shaded-deps/opensearch-dep/.gitignore new file mode 100644 index 000000000000..f68d1099657e --- /dev/null +++ b/openmetadata-shaded-deps/opensearch-dep/.gitignore @@ -0,0 +1,29 @@ +### IntelliJ IDEA ### +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/openmetadata-shaded-deps/opensearch-dep/pom.xml b/openmetadata-shaded-deps/opensearch-dep/pom.xml new file mode 100644 index 000000000000..3c2d510dae7d --- /dev/null +++ b/openmetadata-shaded-deps/opensearch-dep/pom.xml @@ -0,0 +1,111 @@ + + + + openmetadata-shaded-deps + org.open-metadata + 1.2.0-SNAPSHOT + + 4.0.0 + opensearch-deps + OpenSearch Shaded Deps for OpenMetadata Server + Shaded version of OpenSearch dependencies used only for internal OpenMetadata code. + + + + org.opensearch.client + opensearch-rest-high-level-client + true + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.5.1 + + + package + + shade + + + + + false + true + false + + + *:* + + + + + org.opensearch + os.org.opensearch + + + org.opensearch.client + os.org.opensearch.client + + + org.apache.lucene + os.org.apache.lucene + + + + + *:* + + META-INF/*.SF + META-INF/*.sf + META-INF/*.DSA + META-INF/*.dsa + META-INF/*.RSA + META-INF/*.rsa + META-INF/*.EC + META-INF/*.ec + META-INF/MSFTSIG.SF + META-INF/MSFTSIG.RSA + META-INF/LICENSE.txt + META-INF/NOTICE.txt + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + workaround-makeItVisibleOnIntellij + none + + attach-artifact + + + + + ${project.build.directory}/${project.build.finalName}.jar + jar + optional + + + + + + + + + \ No newline at end of file diff --git a/openmetadata-shaded-deps/pom.xml b/openmetadata-shaded-deps/pom.xml new file mode 100644 index 000000000000..d3980a0111e4 --- /dev/null +++ b/openmetadata-shaded-deps/pom.xml @@ -0,0 +1,19 @@ + + + + platform + org.open-metadata + 1.2.0-SNAPSHOT + + 4.0.0 + openmetadata-shaded-deps + Shaded Deps for OpenMetadata Server + Shaded version of dependencies used only for internal OpenMetadata code. + + elasticsearch-dep + opensearch-dep + + pom + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 4d1c397ec450..7661afca14a9 100644 --- a/pom.xml +++ b/pom.xml @@ -31,6 +31,7 @@ openmetadata-spec common + openmetadata-shaded-deps openmetadata-service openmetadata-ui openmetadata-dist @@ -107,8 +108,8 @@ - 7.16.3 - 1.3.0 + 7.17.13 + 2.5.0 4.1.5 2.2.15 1.0.1.RELEASE @@ -286,49 +287,17 @@ gson ${gson.version} - - org.elasticsearch.client - elasticsearch-rest-high-level-client - ${elasticsearch.version} - - - org.apache.lucene - lucene-analyzers-common - - - org.apache.lucene - lucene-backward-codecs - - - org.apache.lucene - lucene-grouping - - - org.apache.lucene - lucene-memory - - - org.apache.lucene - lucene-spatial - - - org.apache.lucene - lucene-spatial-extras - - - org.apache.lucene - lucene-spatial3d - - - org.apache.lucene - lucene-suggest - - - org.opensearch.client opensearch-rest-high-level-client ${opensearch.version} + + + + org.elasticsearch.client + elasticsearch-rest-high-level-client + ${elasticsearch.version} + org.apache.httpcomponents