diff --git a/indexer-core/pom.xml b/indexer-core/pom.xml index 3fd6fa05d20e9098b1dc904022513d8cb93ab994..b888f32f7dc8a12d46e2ff07887954dbb1da7af5 100644 --- a/indexer-core/pom.xml +++ b/indexer-core/pom.xml @@ -19,7 +19,7 @@ <gson.version>2.9.1</gson.version> <netty.version>4.1.70.Final</netty.version> <spring-webmvc.version>5.3.22</spring-webmvc.version> - <os-core-common.version>0.19.0</os-core-common.version> + <os-core-common.version>0.21.0-rc4</os-core-common.version> </properties> <dependencyManagement> diff --git a/pom.xml b/pom.xml index 95c8810bfe2cbe383adc2818fd063af924cc6b0f..41919837141fd99c52bad08bf487f436c68e4721 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.source>1.8</maven.compiler.source> <spring-cloud.version>Greenwich.SR2</spring-cloud.version> - <os-core-common.version>0.19.0</os-core-common.version> + <os-core-common.version>0.21.0-rc4</os-core-common.version> <snakeyaml.version>2.0</snakeyaml.version> <hibernate-validator.version>6.1.5.Final</hibernate-validator.version> <jackson-databind.version>2.14.1</jackson-databind.version> diff --git a/provider/indexer-gc/pom.xml b/provider/indexer-gc/pom.xml index 451d58a47610924ac4133b9c4893a4a0ba29d902..11f9db99c0c7eef965e60a2738bb9b7a4d04baa9 100644 --- a/provider/indexer-gc/pom.xml +++ b/provider/indexer-gc/pom.xml @@ -37,8 +37,8 @@ <dependencies> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>core-lib-gcp</artifactId> - <version>0.20.0-rc2</version> + <artifactId>core-lib-gc</artifactId> + <version>0.21.0-rc4</version> </dependency> <dependency> <groupId>org.opengroup.osdu.indexer</groupId> @@ -150,6 +150,12 @@ <artifactId>spring-webmvc</artifactId> <version>5.3.22</version> </dependency> + + <dependency> + <groupId>org.opengroup.osdu</groupId> + <artifactId>oqm</artifactId> + <version>0.21.0-rc3</version> + </dependency> </dependencies> <build> diff --git a/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/common/cache/CacheConfig.java b/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/common/cache/CacheConfig.java index 05757b74681b2c9d8771558200b11355f92619a0..2371910d15764b64bc7ba0aa60e6e28c662055be 100644 --- a/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/common/cache/CacheConfig.java +++ b/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/common/cache/CacheConfig.java @@ -1,6 +1,6 @@ /* - * Copyright 2020-2022 Google LLC - * Copyright 2020-2022 EPAM Systems, Inc + * Copyright 2020-2023 Google LLC + * Copyright 2020-2023 EPAM Systems, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,8 +18,11 @@ package org.opengroup.osdu.indexer.provider.gcp.common.cache; import lombok.RequiredArgsConstructor; +import org.opengroup.osdu.core.common.cache.ICache; import org.opengroup.osdu.core.common.cache.RedisCache; +import org.opengroup.osdu.core.common.cache.VmCache; import org.opengroup.osdu.core.common.model.search.ClusterSettings; +import org.opengroup.osdu.core.common.partition.PartitionInfo; import org.opengroup.osdu.core.common.provider.interfaces.IElasticCredentialsCache; import org.opengroup.osdu.core.common.provider.interfaces.IIndexCache; import org.opengroup.osdu.core.gcp.cache.RedisCacheBuilder; @@ -89,4 +92,9 @@ public class CacheConfig { Boolean.class ); } + + @Bean + public ICache<String, PartitionInfo> partitionInfoCache() { + return new VmCache<>(600, 2000); + } } diff --git a/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/common/di/ElasticSearchConfig.java b/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/common/di/ElasticSearchConfig.java index 9ef3bc8585f45297d42a54f4a51863e893ec3133..8e9e4dd84e116cddee55714d6825c9eb9e85715a 100644 --- a/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/common/di/ElasticSearchConfig.java +++ b/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/common/di/ElasticSearchConfig.java @@ -1,6 +1,6 @@ /* - * Copyright 2020-2022 Google LLC - * Copyright 2020-2022 EPAM Systems, Inc + * Copyright 2020-2023 Google LLC + * Copyright 2020-2023 EPAM Systems, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,9 +18,9 @@ package org.opengroup.osdu.indexer.provider.gcp.common.di; import org.opengroup.osdu.core.common.partition.IPartitionProvider; +import org.opengroup.osdu.core.common.partition.IPropertyResolver; import org.opengroup.osdu.core.common.provider.interfaces.IElasticRepository; import org.opengroup.osdu.core.destination.elastic.ElasticSearchDestinationResolver; -import org.opengroup.osdu.core.destination.util.IPartitionPropertyResolver; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -29,7 +29,7 @@ public class ElasticSearchConfig { @Bean public IElasticRepository elasticRepository(GcpConfigurationProperties properties, - IPartitionProvider partitionProvider, IPartitionPropertyResolver propertyResolver) { + IPartitionProvider partitionProvider, IPropertyResolver propertyResolver) { return new ElasticSearchDestinationResolver(properties.getElasticsearchPropertiesPrefix(), partitionProvider, propertyResolver); } } diff --git a/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/common/publish/ReprocessingTaskPublisher.java b/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/common/publish/ReprocessingTaskPublisher.java index 5a1efac6f08a34ae3f32ccbd2b1adb6a3abb335f..720628c8a042376ddf4d2ac549a428918674c95c 100644 --- a/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/common/publish/ReprocessingTaskPublisher.java +++ b/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/common/publish/ReprocessingTaskPublisher.java @@ -18,15 +18,8 @@ package org.opengroup.osdu.indexer.provider.gcp.common.publish; import com.google.gson.Gson; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import javax.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.jetbrains.annotations.NotNull; import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.core.common.model.search.RecordChangedMessages; import org.opengroup.osdu.core.gcp.oqm.driver.OqmDriver; @@ -38,6 +31,14 @@ import org.opengroup.osdu.indexer.util.IndexerQueueTaskBuilder; import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Component; +import javax.annotation.PostConstruct; +import javax.validation.constraints.NotNull; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + @Slf4j @Primary @Component diff --git a/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/indexing/processing/IndexerOqmMessageReceiver.java b/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/indexing/processing/IndexerOqmMessageReceiver.java index 82204d3e02aacd6b1b8f3d511c0272e9c2d25985..c14b4df4e59f4ce235d8eca7803de135fcea98aa 100644 --- a/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/indexing/processing/IndexerOqmMessageReceiver.java +++ b/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/indexing/processing/IndexerOqmMessageReceiver.java @@ -18,11 +18,8 @@ package org.opengroup.osdu.indexer.provider.gcp.indexing.processing; import com.google.common.base.Strings; - -import java.util.Optional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.jetbrains.annotations.NotNull; import org.opengroup.osdu.core.auth.TokenProvider; import org.opengroup.osdu.core.common.model.http.AppException; import org.opengroup.osdu.core.common.model.http.DpsHeaders; @@ -33,6 +30,9 @@ import org.opengroup.osdu.core.gcp.oqm.model.OqmMessageReceiver; import org.opengroup.osdu.indexer.provider.gcp.indexing.scope.ThreadDpsHeaders; import org.opengroup.osdu.indexer.provider.gcp.indexing.thread.ThreadScopeContextHolder; +import javax.validation.constraints.NotNull; +import java.util.Optional; + @Slf4j @RequiredArgsConstructor public abstract class IndexerOqmMessageReceiver implements OqmMessageReceiver { diff --git a/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/indexing/processing/OqmSubscriberManager.java b/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/indexing/processing/OqmSubscriberManager.java index b7f6bfd7d5687e1f663db57b5f64d6a13bc7cd10..acc4ecd7a9fa8fec98cf531077e993f44a95f919 100644 --- a/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/indexing/processing/OqmSubscriberManager.java +++ b/provider/indexer-gc/src/main/java/org/opengroup/osdu/indexer/provider/gcp/indexing/processing/OqmSubscriberManager.java @@ -1,6 +1,6 @@ /* - * Copyright 2020-2022 Google LLC - * Copyright 2020-2022 EPAM Systems, Inc + * Copyright 2020-2023 Google LLC + * Copyright 2020-2023 EPAM Systems, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,18 +19,13 @@ package org.opengroup.osdu.indexer.provider.gcp.indexing.processing; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.jetbrains.annotations.Nullable; import org.opengroup.osdu.core.common.model.tenant.TenantInfo; import org.opengroup.osdu.core.gcp.oqm.driver.OqmDriver; -import org.opengroup.osdu.core.gcp.oqm.model.OqmDestination; -import org.opengroup.osdu.core.gcp.oqm.model.OqmMessageReceiver; -import org.opengroup.osdu.core.gcp.oqm.model.OqmSubscriber; -import org.opengroup.osdu.core.gcp.oqm.model.OqmSubscriberThroughput; -import org.opengroup.osdu.core.gcp.oqm.model.OqmSubscription; -import org.opengroup.osdu.core.gcp.oqm.model.OqmSubscriptionQuery; -import org.opengroup.osdu.core.gcp.oqm.model.OqmTopic; +import org.opengroup.osdu.core.gcp.oqm.model.*; import org.springframework.stereotype.Service; +import javax.annotation.Nullable; + @Service @Slf4j @RequiredArgsConstructor diff --git a/provider/indexer-gc/src/main/resources/application.properties b/provider/indexer-gc/src/main/resources/application.properties index c9933e687eea8a33965f8e35ee19945d6c8a7baa..1a2613ffe5df6a87e20724b7fcfb6dd1f027c239 100644 --- a/provider/indexer-gc/src/main/resources/application.properties +++ b/provider/indexer-gc/src/main/resources/application.properties @@ -54,3 +54,5 @@ records-changed-topic-name=records-changed schema-changed-topic-name=schema-changed reprocess-topic-name=reprocess status-changed-topic-name=indexing-progress + +propertyResolver.strategy=partition \ No newline at end of file