diff --git a/NOTICE b/NOTICE index 9f57723afbfba64aaa66f15f7d84699fe69ed964..6928cc6a651cd5df94cfa4932a8925a4059251a9 100644 --- a/NOTICE +++ b/NOTICE @@ -467,7 +467,6 @@ The following software have components provided under the terms of this license: - Kotlin Stdlib Common (from https://kotlinlang.org/) - Kotlin Stdlib Jdk7 (from <https://kotlinlang.org/>, https://kotlinlang.org/) - Kotlin Stdlib Jdk8 (from <https://kotlinlang.org/>, https://kotlinlang.org/) -- LatencyUtils (from http://latencyutils.github.io/LatencyUtils/) - Lucene Common Analyzers (from <https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common>, https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) - Lucene Core (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-core) - Lucene Grouping (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-grouping) @@ -695,6 +694,7 @@ The following software have components provided under the terms of this license: - JSch (from http://www.jcraft.com/jsch/) - Jodd BeanUtil (from http://jodd.org) - Jodd Core (from http://jodd.org) +- LatencyUtils (from http://latencyutils.github.io/LatencyUtils/) - Lucene Common Analyzers (from <https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common>, https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) - Lucene Grouping (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-grouping) - Lucene Highlighter (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-highlighter) @@ -726,6 +726,7 @@ The following software have components provided under the terms of this license: - Apache Lucene (module: suggest) (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-suggest) - AspectJ Weaver (from http://www.aspectj.org, https://www.eclipse.org/aspectj/) - Class Model for Hk2 (from https://repo1.maven.org/maven2/org/glassfish/hk2/class-model) +- FindBugs-jsr305 (from http://findbugs.sourceforge.net/) - GAX (Google Api eXtensions) for Java (Core) (from https://github.com/googleapis, https://github.com/googleapis/gax-java, https://repo1.maven.org/maven2/com/google/api/gax) - GAX (Google Api eXtensions) for Java (gRPC) (from <https://repo1.maven.org/maven2/com/google/api/gax-grpc>, https://repo1.maven.org/maven2/com/google/api/gax-grpc) - Google APIs Client Library for Java (from https://repo1.maven.org/maven2/com/google/api-client/google-api-client) @@ -880,6 +881,13 @@ The following software have components provided under the terms of this license: - JUnit (from http://junit.org) - System Rules (from http://stefanbirkner.github.com/system-rules/, http://stefanbirkner.github.io/system-rules/) +======================================================================== +EDL-1.0 +======================================================================== +The following software have components provided under the terms of this license: + +- Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) + ======================================================================== EPL-1.0 ======================================================================== @@ -892,7 +900,6 @@ The following software have components provided under the terms of this license: - JUnit Jupiter Params (from http://junit.org/junit5/, https://junit.org/junit5/) - JUnit Platform Commons (from http://junit.org/junit5/, https://junit.org/junit5/) - JUnit Platform Engine API (from http://junit.org/junit5/, https://junit.org/junit5/) -- Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) - Jakarta Bean Validation API (from https://beanvalidation.org) - Jakarta XML Binding API (from https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api, https://repo1.maven.org/maven2/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec) @@ -1310,7 +1317,6 @@ The following software have components provided under the terms of this license: - HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/) - JBoss Logging 3 (from http://www.jboss.org) - JSON in Java (from https://github.com/douglascrockford/JSON-java) -- LatencyUtils (from http://latencyutils.github.io/LatencyUtils/) - Microsoft Azure client library for Blob Storage (from https://github.com/Azure/azure-sdk-for-java) - jersey-core-common (from https://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-common) @@ -1319,7 +1325,6 @@ unknown ======================================================================== The following software have components provided under the terms of this license: -- Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) - System Rules (from http://stefanbirkner.github.com/system-rules/, http://stefanbirkner.github.io/system-rules/) - xml-apis (from https://repo1.maven.org/maven2/xml-apis/xml-apis) diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/ChildrenKindsCacheVmImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/ChildrenKindsCacheVmImpl.java index a200d0b25a166a40316e320f4d70d4cae247fef7..435e328353af2c137e26d83fe4e271cb44abe443 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/ChildrenKindsCacheVmImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/ChildrenKindsCacheVmImpl.java @@ -16,12 +16,13 @@ package org.opengroup.osdu.indexer.cache; import org.opengroup.osdu.core.common.cache.VmCache; +import org.opengroup.osdu.indexer.cache.interfaces.IChildrenKindsCache; import org.opengroup.osdu.indexer.model.Constants; import org.opengroup.osdu.indexer.model.indexproperty.ChildrenKinds; import org.springframework.stereotype.Component; @Component -public class ChildrenKindsCacheVmImpl implements IChildrenKindsCache{ +public class ChildrenKindsCacheVmImpl implements IChildrenKindsCache { private VmCache<String, ChildrenKinds> cache; public ChildrenKindsCacheVmImpl() { diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/FeatureFlagCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/FeatureFlagCache.java deleted file mode 100644 index d57a5dbffda83a72c785a692da47d0bb3b756b64..0000000000000000000000000000000000000000 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/FeatureFlagCache.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright © Schlumberger - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.opengroup.osdu.indexer.cache; - -import org.opengroup.osdu.core.common.cache.VmCache; -import org.springframework.stereotype.Component; - -@Component -public class FeatureFlagCache extends VmCache<String, Boolean> { - public FeatureFlagCache() { - super(300, 1000); - } - - public boolean containsKey(final String key) { - return this.get(key) != null; - } -} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/KindCacheVmImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/KindCacheVmImpl.java index 2eec5cead55d7a78c62ff3c3a946070edbdca02f..9b6362c6c3f9810400d1ce7fd13abb2f303fa664 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/KindCacheVmImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/KindCacheVmImpl.java @@ -16,6 +16,7 @@ package org.opengroup.osdu.indexer.cache; import org.opengroup.osdu.core.common.cache.VmCache; +import org.opengroup.osdu.indexer.cache.interfaces.IKindCache; import org.opengroup.osdu.indexer.model.Constants; import org.springframework.stereotype.Component; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/ParentChildRelationshipSpecsCacheVmImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/ParentChildRelationshipSpecsCacheVmImpl.java index a270ab77d5141ffca5130f607eec92e40264ba82..f630c1d556c205bf354b251b91e8b5300557e777 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/ParentChildRelationshipSpecsCacheVmImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/ParentChildRelationshipSpecsCacheVmImpl.java @@ -16,6 +16,7 @@ package org.opengroup.osdu.indexer.cache; import org.opengroup.osdu.core.common.cache.VmCache; +import org.opengroup.osdu.indexer.cache.interfaces.IParentChildRelationshipSpecsCache; import org.opengroup.osdu.indexer.model.Constants; import org.opengroup.osdu.indexer.model.indexproperty.ParentChildRelationshipSpecs; import org.springframework.stereotype.Component; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PropertyConfigurationsCacheVmImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PropertyConfigurationsCacheVmImpl.java index 4e8e0605237f42572ae0f4eb85e59c26a3d8248e..38e5f37a7ba1408711b9ccfbd55016e86e9c4c2d 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PropertyConfigurationsCacheVmImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PropertyConfigurationsCacheVmImpl.java @@ -16,6 +16,7 @@ package org.opengroup.osdu.indexer.cache; import org.opengroup.osdu.core.common.cache.VmCache; +import org.opengroup.osdu.indexer.cache.interfaces.IPropertyConfigurationsCache; import org.opengroup.osdu.indexer.model.Constants; import org.opengroup.osdu.indexer.model.indexproperty.PropertyConfigurations; import org.springframework.stereotype.Component; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PropertyConfigurationsEnabledCacheVmImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PropertyConfigurationsEnabledCacheVmImpl.java index 99d2b6d3a6b8f09001164804d6135d06f659e4b5..1db22ec6f4f7ca3da748d8cfefad1ad751547254 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PropertyConfigurationsEnabledCacheVmImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PropertyConfigurationsEnabledCacheVmImpl.java @@ -16,6 +16,7 @@ package org.opengroup.osdu.indexer.cache; import org.opengroup.osdu.core.common.cache.VmCache; +import org.opengroup.osdu.indexer.cache.interfaces.IPropertyConfigurationsEnabledCache; import org.opengroup.osdu.indexer.model.Constants; import org.springframework.stereotype.Component; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/RecordChangeInfoCacheVmImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/RecordChangeInfoCacheVmImpl.java index 796d13186d5dfe61f97de41ba8a437c28ccbf0a0..529231ee8f425fd42f3e004a215fdb195c8699de 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/RecordChangeInfoCacheVmImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/RecordChangeInfoCacheVmImpl.java @@ -16,6 +16,7 @@ package org.opengroup.osdu.indexer.cache; import org.opengroup.osdu.core.common.cache.VmCache; +import org.opengroup.osdu.indexer.cache.interfaces.IRecordChangeInfoCache; import org.opengroup.osdu.indexer.model.Constants; import org.opengroup.osdu.indexer.model.RecordChangeInfo; import org.springframework.stereotype.Component; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/RelatedObjectCacheVmImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/RelatedObjectCacheVmImpl.java index c6ba7d0906690c1bee850805e720e7f903603b5c..625d7f74dac26565e14f63e8426a80567447eb0e 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/RelatedObjectCacheVmImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/RelatedObjectCacheVmImpl.java @@ -17,6 +17,7 @@ package org.opengroup.osdu.indexer.cache; import org.opengroup.osdu.core.common.cache.VmCache; import org.opengroup.osdu.core.common.model.storage.RecordData; +import org.opengroup.osdu.indexer.cache.interfaces.IRelatedObjectCache; import org.opengroup.osdu.indexer.model.Constants; import org.springframework.stereotype.Component; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IChildrenKindsCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IChildrenKindsCache.java similarity index 93% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IChildrenKindsCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IChildrenKindsCache.java index dda43845814be42a0cee4131922343acebe9120f..0341270be39e331482cfd3c8604e5eb5adc3a70f 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IChildrenKindsCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IChildrenKindsCache.java @@ -13,7 +13,7 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.interfaces; import org.opengroup.osdu.core.common.cache.ICache; import org.opengroup.osdu.indexer.model.indexproperty.ChildrenKinds; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IKindCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IKindCache.java similarity index 93% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IKindCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IKindCache.java index c474065deded2a236e41e7d43436b874d9c295c1..6898d9d1d85a2cc63a14905d3675abdbb42a117a 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IKindCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IKindCache.java @@ -13,7 +13,7 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.interfaces; import org.opengroup.osdu.core.common.cache.ICache; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IParentChildRelationshipSpecsCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IParentChildRelationshipSpecsCache.java similarity index 94% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IParentChildRelationshipSpecsCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IParentChildRelationshipSpecsCache.java index 74aa48e4fadeb7d477c1fed19aef9dc9662619d7..b174f12915abd55d36ec5db6753b5141eb7674c2 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IParentChildRelationshipSpecsCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IParentChildRelationshipSpecsCache.java @@ -13,7 +13,7 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.interfaces; import org.opengroup.osdu.core.common.cache.ICache; import org.opengroup.osdu.indexer.model.indexproperty.ParentChildRelationshipSpecs; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IPropertyConfigurationsCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IPropertyConfigurationsCache.java similarity index 93% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IPropertyConfigurationsCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IPropertyConfigurationsCache.java index 24a51559f9955861969a2536de31c397b2e6e85f..65ee4f96ad29808912c80dec1fb14d1a79651f27 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IPropertyConfigurationsCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IPropertyConfigurationsCache.java @@ -13,7 +13,7 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.interfaces; import org.opengroup.osdu.core.common.cache.ICache; import org.opengroup.osdu.indexer.model.indexproperty.PropertyConfigurations; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IPropertyConfigurationsEnabledCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IPropertyConfigurationsEnabledCache.java similarity index 93% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IPropertyConfigurationsEnabledCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IPropertyConfigurationsEnabledCache.java index 4b6c372d333c2c5539ab5d1fab3f41dfdabff7e7..98bdbcc5dedeef3f5e1b5bff006a18dccea9afb9 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IPropertyConfigurationsEnabledCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IPropertyConfigurationsEnabledCache.java @@ -13,7 +13,7 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.interfaces; import org.opengroup.osdu.core.common.cache.ICache; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IRecordChangeInfoCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IRecordChangeInfoCache.java similarity index 93% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IRecordChangeInfoCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IRecordChangeInfoCache.java index 25591747a59e9f2d1a4de0f7217331979365d499..f4a8baa0193c34b5d0d9ccfbbf7aa6282683bab2 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IRecordChangeInfoCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IRecordChangeInfoCache.java @@ -13,7 +13,7 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.interfaces; import org.opengroup.osdu.core.common.cache.ICache; import org.opengroup.osdu.indexer.model.RecordChangeInfo; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IRelatedObjectCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IRelatedObjectCache.java similarity index 93% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IRelatedObjectCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IRelatedObjectCache.java index 4ddad5e468c7ea554033207cb7216dd55db1c7e0..53d47e4860bf5bf08dcb4b19b0a9c42c9a50d4b4 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/IRelatedObjectCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/interfaces/IRelatedObjectCache.java @@ -13,7 +13,7 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.interfaces; import org.opengroup.osdu.core.common.cache.ICache; import org.opengroup.osdu.core.common.model.storage.RecordData; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/AbstractPartitionSafeCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/AbstractPartitionSafeCache.java similarity index 83% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/AbstractPartitionSafeCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/AbstractPartitionSafeCache.java index 52d2cdf9e7e5220bd4c34293683fe6322b278d87..25d50faa789d2a46478d1339415448669f6d09d9 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/AbstractPartitionSafeCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/AbstractPartitionSafeCache.java @@ -13,20 +13,18 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.partitionsafe; import org.opengroup.osdu.core.common.cache.ICache; import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo; -import org.springframework.web.context.annotation.RequestScope; import javax.inject.Inject; -@RequestScope public abstract class AbstractPartitionSafeCache<K, V> implements ICache<K, V> { @Inject private IRequestInfo requestInfo; protected String cacheKey(String s) { - return this.requestInfo.getPartitionId() + "-" + s; + return this.requestInfo.getPartitionId() + "-" + this.getClass().getSimpleName().toLowerCase() + "-" + s; } } diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeParentChildRelationshipSpecsCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/ChildRelationshipSpecsCache.java similarity index 82% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeParentChildRelationshipSpecsCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/ChildRelationshipSpecsCache.java index 1ca0c87aa4215064fd15d4f9674db0830184994e..107811a67ef12d7ed5b8177efa2f665684c8a401 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeParentChildRelationshipSpecsCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/ChildRelationshipSpecsCache.java @@ -13,17 +13,16 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.partitionsafe; +import org.opengroup.osdu.indexer.cache.interfaces.IParentChildRelationshipSpecsCache; import org.opengroup.osdu.indexer.model.indexproperty.ParentChildRelationshipSpecs; import org.springframework.stereotype.Component; -import org.springframework.web.context.annotation.RequestScope; import javax.inject.Inject; @Component -@RequestScope -public class PartitionSafeParentChildRelationshipSpecsCache extends AbstractPartitionSafeCache<String, ParentChildRelationshipSpecs> { +public class ChildRelationshipSpecsCache extends AbstractPartitionSafeCache<String, ParentChildRelationshipSpecs> { @Inject private IParentChildRelationshipSpecsCache cache; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeChildrenKindsCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/ChildrenKindsCache.java similarity index 84% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeChildrenKindsCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/ChildrenKindsCache.java index 59dd354871e2d722a444dffb6204dcd9f6a8e018..1653212051961cbdf51f672e63d641f70936a9c0 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeChildrenKindsCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/ChildrenKindsCache.java @@ -13,18 +13,17 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.partitionsafe; +import org.opengroup.osdu.indexer.cache.interfaces.IChildrenKindsCache; import org.opengroup.osdu.indexer.model.indexproperty.ChildrenKinds; import org.springframework.stereotype.Component; -import org.springframework.web.context.annotation.RequestScope; import javax.inject.Inject; @Component -@RequestScope -public class PartitionSafeChildrenKindsCache extends AbstractPartitionSafeCache<String, ChildrenKinds>{ +public class ChildrenKindsCache extends AbstractPartitionSafeCache<String, ChildrenKinds> { @Inject private IChildrenKindsCache cache; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafePropertyConfigurationsEnabledCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/ConfigurationsEnabledCache.java similarity index 82% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafePropertyConfigurationsEnabledCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/ConfigurationsEnabledCache.java index e8bea9da70c3903302e5172dd20bcd9a622687b3..086b4b3ceac97d307d25f17e67e07d23a68cb428 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafePropertyConfigurationsEnabledCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/ConfigurationsEnabledCache.java @@ -13,16 +13,15 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.partitionsafe; +import org.opengroup.osdu.indexer.cache.interfaces.IPropertyConfigurationsEnabledCache; import org.springframework.stereotype.Component; -import org.springframework.web.context.annotation.RequestScope; import javax.inject.Inject; @Component -@RequestScope -public class PartitionSafePropertyConfigurationsEnabledCache extends AbstractPartitionSafeCache<String,Boolean> { +public class ConfigurationsEnabledCache extends AbstractPartitionSafeCache<String,Boolean> { @Inject private IPropertyConfigurationsEnabledCache cache; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/FeatureFlagCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/FeatureFlagCache.java new file mode 100644 index 0000000000000000000000000000000000000000..80dc5a9a813832eb9051fb79ae6d63a3b1d8fd9c --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/FeatureFlagCache.java @@ -0,0 +1,48 @@ +/* + * Copyright © Schlumberger + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.opengroup.osdu.indexer.cache.partitionsafe; + +import org.opengroup.osdu.core.common.cache.VmCache; +import org.springframework.stereotype.Component; + +@Component +public class FeatureFlagCache extends AbstractPartitionSafeCache<String, Boolean> { + private VmCache<String, Boolean> cache; + + public FeatureFlagCache() { + cache = new VmCache<>(300, 1000); + } + + @Override + public void put(String s, Boolean o) { + this.cache.put(cacheKey(s), o); + } + + @Override + public Boolean get(String s) { + return this.cache.get(cacheKey(s)); + } + + @Override + public void delete(String s) { + this.cache.delete(cacheKey(s)); + } + + @Override + public void clearAll() { + this.cache.clearAll(); + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeSchemaCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/FlattenedSchemaCache.java similarity index 85% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeSchemaCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/FlattenedSchemaCache.java index 4cbb38658b60e8eedc209e8f75023d8f983ccf02..27e88715be65a7c66ecfe9937f7e2843c1764d6c 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeSchemaCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/FlattenedSchemaCache.java @@ -13,17 +13,15 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.partitionsafe; import org.opengroup.osdu.indexer.provider.interfaces.ISchemaCache; import org.springframework.stereotype.Component; -import org.springframework.web.context.annotation.RequestScope; import javax.inject.Inject; @Component -@RequestScope -public class PartitionSafeSchemaCache extends AbstractPartitionSafeCache<String, String> { +public class FlattenedSchemaCache extends AbstractPartitionSafeCache<String, String> { @Inject private ISchemaCache schemaCache; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeIndexCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/IndexCache.java similarity index 75% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeIndexCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/IndexCache.java index 0942b5ecbc5decfc6d9902f96080505b7659f662..bb059f907a118b86c3808b3c640ac0e4ffc4de50 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeIndexCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/IndexCache.java @@ -12,22 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.partitionsafe; import org.opengroup.osdu.core.common.provider.interfaces.IIndexCache; -import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import org.springframework.web.context.annotation.RequestScope; @Component -@RequestScope -public class PartitionSafeIndexCache { +public class IndexCache extends AbstractPartitionSafeCache<String, Boolean> { @Autowired private IIndexCache indexCache; - @Autowired - private IRequestInfo requestInfo; public void put(String s, Boolean o) { this.indexCache.put(cacheKey(s), o); @@ -44,8 +39,4 @@ public class PartitionSafeIndexCache { public void clearAll() { this.indexCache.clearAll(); } - - private String cacheKey(String s) { - return this.requestInfo.getPartitionId() + "-" + s; - } -} \ No newline at end of file +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeKindCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/KindCache.java similarity index 84% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeKindCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/KindCache.java index e1bc5adce2686070b5cfed0587823b7b2e4700b4..99275df91692891f6581c7ac9181989a6443228f 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeKindCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/KindCache.java @@ -13,16 +13,15 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.partitionsafe; +import org.opengroup.osdu.indexer.cache.interfaces.IKindCache; import org.springframework.stereotype.Component; -import org.springframework.web.context.annotation.RequestScope; import javax.inject.Inject; @Component -@RequestScope -public class PartitionSafeKindCache extends AbstractPartitionSafeCache<String, String> { +public class KindCache extends AbstractPartitionSafeCache<String, String> { @Inject private IKindCache cache; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafePropertyConfigurationsCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/PropertyConfigurationsCache.java similarity index 83% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafePropertyConfigurationsCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/PropertyConfigurationsCache.java index 04a4d4082d91071722a2bc3500f86fd676ecae11..22752ecfb6a86b7bdd6b1fc85c94f02b32017529 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafePropertyConfigurationsCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/PropertyConfigurationsCache.java @@ -13,17 +13,16 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.partitionsafe; +import org.opengroup.osdu.indexer.cache.interfaces.IPropertyConfigurationsCache; import org.opengroup.osdu.indexer.model.indexproperty.PropertyConfigurations; import org.springframework.stereotype.Component; -import org.springframework.web.context.annotation.RequestScope; import javax.inject.Inject; @Component -@RequestScope -public class PartitionSafePropertyConfigurationsCache extends AbstractPartitionSafeCache<String,PropertyConfigurations> { +public class PropertyConfigurationsCache extends AbstractPartitionSafeCache<String,PropertyConfigurations> { @Inject private IPropertyConfigurationsCache cache; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/RecordChangeInfoCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/RecordChangeInfoCache.java new file mode 100644 index 0000000000000000000000000000000000000000..55730c01833eb37002b8eecf74b514f430626727 --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/RecordChangeInfoCache.java @@ -0,0 +1,48 @@ +/* + * Copyright © Schlumberger + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.opengroup.osdu.indexer.cache.partitionsafe; + +import org.opengroup.osdu.indexer.cache.interfaces.IRecordChangeInfoCache; +import org.opengroup.osdu.indexer.model.RecordChangeInfo; +import org.springframework.stereotype.Component; + +import javax.inject.Inject; + +@Component +public class RecordChangeInfoCache extends AbstractPartitionSafeCache<String, RecordChangeInfo> { + @Inject + private IRecordChangeInfoCache cache; + + @Override + public void put(String s, RecordChangeInfo o) { + this.cache.put(cacheKey(s), o); + } + + @Override + public RecordChangeInfo get(String s) { + return this.cache.get(cacheKey(s)); + } + + @Override + public void delete(String s) { + this.cache.delete(cacheKey(s)); + } + + @Override + public void clearAll() { + this.cache.clearAll(); + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/RelatedObjectCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/RelatedObjectCache.java new file mode 100644 index 0000000000000000000000000000000000000000..c0cecd24cd7aff320b7ac9b23255142d04080afa --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/RelatedObjectCache.java @@ -0,0 +1,48 @@ +/* + * Copyright © Schlumberger + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.opengroup.osdu.indexer.cache.partitionsafe; + +import org.opengroup.osdu.core.common.model.storage.RecordData; +import org.opengroup.osdu.indexer.cache.interfaces.IRelatedObjectCache; +import org.springframework.stereotype.Component; + +import javax.inject.Inject; + +@Component +public class RelatedObjectCache extends AbstractPartitionSafeCache<String, RecordData> { + @Inject + private IRelatedObjectCache cache; + + @Override + public void put(String s, RecordData o) { + this.cache.put(cacheKey(s), o); + } + + @Override + public RecordData get(String s) { + return this.cache.get(cacheKey(s)); + } + + @Override + public void delete(String s) { + this.cache.delete(cacheKey(s)); + } + + @Override + public void clearAll() { + this.cache.clearAll(); + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeFlattenedSchemaCache.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/SchemaCache.java similarity index 67% rename from indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeFlattenedSchemaCache.java rename to indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/SchemaCache.java index 862acb6e9399e3a7a32acc1a0d9303c6730de40d..1ec3f9f86a079ef1e7595431ef1010a81df50270 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/PartitionSafeFlattenedSchemaCache.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/cache/partitionsafe/SchemaCache.java @@ -13,42 +13,35 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.partitionsafe; import org.opengroup.osdu.indexer.provider.interfaces.ISchemaCache; import org.springframework.stereotype.Component; -import org.springframework.web.context.annotation.RequestScope; import javax.inject.Inject; @Component -@RequestScope -public class PartitionSafeFlattenedSchemaCache extends AbstractPartitionSafeCache<String, String> { - private static final String FLATTENED_SCHEMA = "_flattened"; +public class SchemaCache extends AbstractPartitionSafeCache<String, String> { @Inject private ISchemaCache schemaCache; @Override public void put(String s, String o) { - this.schemaCache.put(getKey(s), o); + this.schemaCache.put(cacheKey(s), o); } @Override public String get(String s) { - return (String)this.schemaCache.get(getKey(s)); + return (String)this.schemaCache.get(cacheKey(s)); } @Override public void delete(String s) { - this.schemaCache.delete(getKey(s)); + this.schemaCache.delete(cacheKey(s)); } @Override public void clearAll() { this.schemaCache.clearAll(); } - - private String getKey(String s) { - return cacheKey(s) + FLATTENED_SCHEMA; - } } diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java index 31b63bafb3fe19b1ad5a6302b94953c56c7f5c4f..048e87a393dd515143288d1426b0d152e777882a 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java @@ -30,8 +30,8 @@ import org.opengroup.osdu.core.common.model.search.RecordMetaAttribute; import org.opengroup.osdu.core.common.model.storage.Schema; import org.opengroup.osdu.core.common.model.storage.SchemaItem; import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver; -import org.opengroup.osdu.indexer.cache.PartitionSafeFlattenedSchemaCache; -import org.opengroup.osdu.indexer.cache.PartitionSafeSchemaCache; +import org.opengroup.osdu.indexer.cache.partitionsafe.FlattenedSchemaCache; +import org.opengroup.osdu.indexer.cache.partitionsafe.SchemaCache; import org.opengroup.osdu.indexer.model.Kind; import org.opengroup.osdu.indexer.model.indexproperty.PropertyConfigurations; import org.opengroup.osdu.indexer.schema.converter.exeption.SchemaProcessingException; @@ -65,9 +65,9 @@ public class IndexSchemaServiceImpl implements IndexSchemaService { @Inject private IndicesService indicesService; @Inject - private PartitionSafeSchemaCache schemaCache; + private SchemaCache schemaCache; @Inject - private PartitionSafeFlattenedSchemaCache flattenedSchemaCache; + private FlattenedSchemaCache flattenedSchemaCache; @Inject private IVirtualPropertiesSchemaCache virtualPropertiesSchemaCache; @Inject diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceImpl.java index a18cbd3fb4db5f5384e1ffb3585d08b436eb0f8e..3ac173b4fc1aaa65ac693e177f151d7d74585736 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceImpl.java @@ -33,7 +33,7 @@ import org.opengroup.osdu.core.common.model.indexer.IndexSchema; import org.opengroup.osdu.core.common.model.search.RecordMetaAttribute; import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver; import org.opengroup.osdu.core.common.search.Preconditions; -import org.opengroup.osdu.indexer.cache.PartitionSafeIndexCache; +import org.opengroup.osdu.indexer.cache.partitionsafe.IndexCache; import org.opengroup.osdu.indexer.model.Kind; import org.opengroup.osdu.indexer.util.TypeMapper; import org.springframework.beans.factory.annotation.Autowired; @@ -55,7 +55,7 @@ public class IndexerMappingServiceImpl extends MappingServiceImpl implements IMa @Inject private JaxRsDpsLog log; @Autowired - private PartitionSafeIndexCache indexCache; + private IndexCache indexCache; @Autowired private ElasticIndexNameResolver elasticIndexNameResolver; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndicesServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndicesServiceImpl.java index e585fca490a13a11f53acac4c9a1c5f54ee1a2cf..b2a55eb8870f23123b28070ea4cd6511354877b5 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndicesServiceImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndicesServiceImpl.java @@ -24,7 +24,6 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; -import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest; import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.client.Request; @@ -44,7 +43,7 @@ import org.opengroup.osdu.core.common.model.http.AppException; import org.opengroup.osdu.core.common.model.search.IndexInfo; import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver; import org.opengroup.osdu.core.common.search.Preconditions; -import org.opengroup.osdu.indexer.cache.PartitionSafeIndexCache; +import org.opengroup.osdu.indexer.cache.partitionsafe.IndexCache; import org.opengroup.osdu.indexer.util.ElasticClientHandler; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -64,7 +63,7 @@ public class IndicesServiceImpl implements IndicesService { @Autowired private ElasticIndexNameResolver elasticIndexNameResolver; @Autowired - private PartitionSafeIndexCache indexCache; + private IndexCache indexCache; @Inject private IndexAliasService indexAliasService; @Autowired diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/PropertyConfigurationsServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/PropertyConfigurationsServiceImpl.java index b2d5c822b9abbd40171f5cfb837de58c4338dc74..91b58d88e6482ccd0273c49c47c15d3b75ce9141 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/PropertyConfigurationsServiceImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/PropertyConfigurationsServiceImpl.java @@ -30,7 +30,7 @@ import org.opengroup.osdu.core.common.model.storage.RecordData; import org.opengroup.osdu.core.common.model.storage.Schema; import org.opengroup.osdu.core.common.model.storage.SchemaItem; import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo; -import org.opengroup.osdu.indexer.cache.*; +import org.opengroup.osdu.indexer.cache.partitionsafe.*; import org.opengroup.osdu.indexer.config.IndexerConfigurationProperties; import org.opengroup.osdu.indexer.model.*; import org.opengroup.osdu.indexer.model.indexproperty.*; @@ -71,19 +71,19 @@ public class PropertyConfigurationsServiceImpl implements PropertyConfigurations @Inject private IndexerConfigurationProperties configurationProperties; @Inject - private PartitionSafePropertyConfigurationsCache propertyConfigurationCache; + private PropertyConfigurationsCache propertyConfigurationCache; @Inject - private PartitionSafePropertyConfigurationsEnabledCache propertyConfigurationsEnabledCache; + private ConfigurationsEnabledCache propertyConfigurationsEnabledCache; @Inject - private PartitionSafeParentChildRelationshipSpecsCache parentChildRelationshipSpecsCache; + private ChildRelationshipSpecsCache parentChildRelationshipSpecsCache; @Inject - private PartitionSafeChildrenKindsCache childrenKindsCache; + private ChildrenKindsCache childrenKindsCache; @Inject - private PartitionSafeKindCache kindCache; + private KindCache kindCache; @Inject - private IRelatedObjectCache relatedObjectCache; + private RelatedObjectCache relatedObjectCache; @Inject - private IRecordChangeInfoCache recordChangeInfoCache; + private RecordChangeInfoCache recordChangeInfoCache; @Inject private SearchService searchService; @Inject @@ -172,6 +172,8 @@ public class PropertyConfigurationsServiceImpl implements PropertyConfigurations public Map<String, Object> getExtendedProperties(String objectId, Map<String, Object> originalDataMap, PropertyConfigurations propertyConfigurations) { Set<String> associatedIdentities = new HashSet<>(); Map<String, Object> extendedDataMap = new HashMap<>(); + + Map<String, Map<String, Object>> idObjectDataMap = getRelatedObjectsData(originalDataMap, propertyConfigurations); for (PropertyConfiguration configuration : propertyConfigurations.getConfigurations().stream().filter(c -> c.isValid()).collect(Collectors.toList())) { String extendedPropertyName = configuration.getName(); if (originalDataMap.containsKey(extendedPropertyName) && originalDataMap.get(extendedPropertyName) != null) { @@ -192,7 +194,8 @@ public class PropertyConfigurationsServiceImpl implements PropertyConfigurations } for (String relatedObjectId : relatedObjectIds) { - Map<String, Object> relatedObject = getRelatedObjectData(relatedObjectsSpec.getRelatedObjectKind(), relatedObjectId); + String id = PropertyUtil.removeIdPostfix(relatedObjectId); + Map<String, Object> relatedObject = idObjectDataMap.getOrDefault(id, new HashMap<>()); Map<String, Object> propertyValues = getExtendedPropertyValues(extendedPropertyName, relatedObject, path.getValueExtraction(), configuration.isExtractFirstMatch()); if (allPropertyValues.isEmpty() && configuration.isExtractFirstMatch()) { allPropertyValues = propertyValues; @@ -295,7 +298,7 @@ public class PropertyConfigurationsServiceImpl implements PropertyConfigurations @Override public void cacheDataRecord(String recordId, String kind, Map<String, Object> dataMap) { - Map<String, Object> previousDataMap = this.getRelatedObjectData(kind, recordId); + Map<String, Object> previousDataMap = this.getObjectData(kind, recordId); RecordInfo recordInfo = new RecordInfo(); recordInfo.setId(recordId); recordInfo.setKind(kind); @@ -393,22 +396,73 @@ public class PropertyConfigurationsServiceImpl implements PropertyConfigurations this.indexerQueueTaskBuilder.createWorkerTask(recordChangedMessagePayload, 0L, this.requestInfo.getHeadersWithDwdAuthZ()); } - private Map<String, Object> getRelatedObjectData(String relatedObjectKind, String relatedObjectId) { - String key = PropertyUtil.removeIdPostfix(relatedObjectId); - RecordData recordData = relatedObjectCache.get(key); - Map<String, Object> relatedObject = (recordData != null)? recordData.getData() : null; - if (relatedObject == null) { - SearchRecord searchRecord = searchRelatedRecord(relatedObjectKind, relatedObjectId); - if (searchRecord != null) { - relatedObject = searchRecord.getData(); + private Map<String, Object> getObjectData(String kind, String id) { + RecordData recordData = relatedObjectCache.get(id); + Map<String, Object> data = (recordData != null)? recordData.getData() : null; + if (data == null) { + SearchRequest searchRequest = new SearchRequest(); + searchRequest.setKind(kind); + String query = String.format("id: \"%s\"", id); + searchRequest.setQuery(query); + SearchRecord searchRecord = searchFirstRecord(searchRequest); + if (searchRecord != null) { + data = searchRecord.getData(); recordData = new RecordData(); - recordData.setData(relatedObject); - relatedObjectCache.put(key, recordData); + recordData.setData(data); + relatedObjectCache.put(id, recordData); } } - return relatedObject; + return data; + } + + private Map<String, Map<String, Object>> getRelatedObjectsData(Map<String, Object> originalDataMap, PropertyConfigurations propertyConfigurations) { + Map<String, Map<String, Object>> idData = new HashMap<>(); + Map<String, Set<String>> kindIds = new HashMap<>(); + for (PropertyConfiguration configuration : propertyConfigurations.getConfigurations().stream().filter(c -> c.isValid()).collect(Collectors.toList())) { + for (PropertyPath path : configuration.getPaths().stream().filter(p -> p.hasValidValueExtraction()).collect(Collectors.toList())) { + if (path.hasValidRelatedObjectsSpec()) { + RelatedObjectsSpec relatedObjectsSpec = path.getRelatedObjectsSpec(); + List<String> relatedObjectIds = getRelatedObjectIds(originalDataMap, relatedObjectsSpec); + String relatedObjectKind = relatedObjectsSpec.getRelatedObjectKind(); + if(!kindIds.containsKey(relatedObjectKind)) { + kindIds.put(relatedObjectKind, new HashSet<>()); + } + kindIds.get(relatedObjectKind).addAll(relatedObjectIds); + } + } + } + + if(!kindIds.isEmpty()) { + List<String> kindsToSearch = new ArrayList<>(); + List<String> idsToSearch = new ArrayList<>(); + for (Map.Entry<String, Set<String>> entry : kindIds.entrySet()) { + for (String recordId : entry.getValue()) { + String id = PropertyUtil.removeIdPostfix(recordId); + RecordData recordData = relatedObjectCache.get(id); + Map<String, Object> data = (recordData != null)? recordData.getData() : null;; + if (data != null) { + idData.put(id, data); + } else { + kindsToSearch.add(entry.getKey()); + idsToSearch.add(recordId); + } + } + } + if (kindsToSearch.size() > 0) { + List<SearchRecord> records = searchRelatedRecords(kindsToSearch, idsToSearch); + for (SearchRecord searchRecord : records) { + Map<String, Object> data = searchRecord.getData(); + String id = searchRecord.getId(); + RecordData recordData = new RecordData(); + recordData.setData(data); + relatedObjectCache.put(id, recordData); + idData.put(id, data); + } + } + } + return idData; } private Map<String, List<RecordChangeInfo>> createRecordChangeInfoMap(Map<String, List<String>> upsertKindIds, Map<String, List<String>> deleteKindIds) { @@ -567,7 +621,7 @@ public class PropertyConfigurationsServiceImpl implements PropertyConfigurations } else { // Flatten for (Map.Entry<String, Object> entry : dataMap.entrySet()) { String key = entry.getKey(); - if (key.equals(valuePath) || key.startsWith(valuePath + PROPERTY_DELIMITER)) { + if ((key.equals(valuePath) || key.startsWith(valuePath + PROPERTY_DELIMITER)) && entry.getValue() != null) { if (isExtractFirstMatch) { propertyValues.put(key, entry.getValue()); } else { @@ -812,7 +866,7 @@ public class PropertyConfigurationsServiceImpl implements PropertyConfigurations searchRequest.setQuery(query); searchRequest.setReturnedFields(Arrays.asList("kind", "id", "data." + ASSOCIATED_IDENTITIES_PROPERTY)); List<RecordInfo> recordInfos = new ArrayList<>(); - for (SearchRecord record : searchAllRecords(searchRequest)) { + for (SearchRecord record : searchRecordsWithCursor(searchRequest)) { Map<String, Object> data = record.getData(); if (!data.containsKey(ASSOCIATED_IDENTITIES_PROPERTY) || data.get(ASSOCIATED_IDENTITIES_PROPERTY) == null) continue; @@ -907,7 +961,7 @@ public class PropertyConfigurationsServiceImpl implements PropertyConfigurations private List<PropertyConfigurations> searchConfigurations(SearchRequest searchRequest) { List<PropertyConfigurations> configurationsList = new ArrayList<>(); - for (SearchRecord searchRecord : searchAllRecords(searchRequest)) { + for (SearchRecord searchRecord : searchRecords(searchRequest)) { try { String data = objectMapper.writeValueAsString(searchRecord.getData()); PropertyConfigurations configurations = objectMapper.readValue(data, PropertyConfigurations.class); @@ -921,14 +975,18 @@ public class PropertyConfigurationsServiceImpl implements PropertyConfigurations return configurationsList; } - private SearchRecord searchRelatedRecord(String relatedObjectKind, String relatedObjectId) { - String kind = PropertyUtil.isConcreteKind(relatedObjectKind) ? relatedObjectKind : relatedObjectKind + "*"; - String id = PropertyUtil.removeIdPostfix(relatedObjectId); + private List<SearchRecord> searchRelatedRecords(List<String> relatedObjectKinds, List<String> relatedObjectIds) { SearchRequest searchRequest = new SearchRequest(); - searchRequest.setKind(kind); - String query = String.format("id: \"%s\"", id); + List<String> kinds = new ArrayList<>(); + for(String kind : relatedObjectKinds) { + if(!PropertyUtil.isConcreteKind(kind)) + kind += "*"; + kinds.add(kind); + } + searchRequest.setKind(kinds); + String query = String.format("id: (%s)", createIdsFilter(relatedObjectIds)); searchRequest.setQuery(query); - return searchFirstRecord(searchRequest); + return searchRecords(searchRequest); } private Map<String, List<String>> searchKindIds(String majorKind, List<String> ids) { @@ -939,7 +997,7 @@ public class PropertyConfigurationsServiceImpl implements PropertyConfigurations String query = String.format("id: (%s)", createIdsFilter(ids)); searchRequest.setReturnedFields(Arrays.asList("kind", "id")); searchRequest.setQuery(query); - for (SearchRecord record : searchAllRecords(searchRequest)) { + for (SearchRecord record : searchRecords(searchRequest)) { if (kindIds.containsKey(record.getKind())) { kindIds.get(record.getKind()).add(record.getId()); } else { @@ -959,7 +1017,7 @@ public class PropertyConfigurationsServiceImpl implements PropertyConfigurations searchRequest.setReturnedFields(Arrays.asList(parentObjectIdPath)); searchRequest.setQuery(query); parentObjectIdPath = PropertyUtil.removeDataPrefix(parentObjectIdPath); - for (SearchRecord record : searchAllRecords(searchRequest)) { + for (SearchRecord record : searchRecords(searchRequest)) { if (record.getData().containsKey(parentObjectIdPath)) { Object id = record.getData().get(parentObjectIdPath); if (id != null && !parentIds.contains(id)) { @@ -976,27 +1034,46 @@ public class PropertyConfigurationsServiceImpl implements PropertyConfigurations searchRequest.setKind(kind); String query = String.format("%s: \"%s\"", childrenObjectField, parentId); searchRequest.setQuery(query); - return searchAllRecords(searchRequest); + return searchRecordsWithCursor(searchRequest); } - private List<SearchRecord> searchAllRecords(SearchRequest searchRequest) { + private List<SearchRecord> searchRecordsWithCursor(SearchRequest searchRequest) { searchRequest.setLimit(MAX_SEARCH_LIMIT); List<SearchRecord> allRecords = new ArrayList<>(); - boolean done = false; try { - while (!done) { + List<SearchRecord> results = null; + do { SearchResponse searchResponse = searchService.queryWithCursor(searchRequest); - List<SearchRecord> results = searchResponse.getResults(); + results = searchResponse.getResults(); if (results != null && results.size() > 0) { allRecords.addAll(results); + if (!Strings.isNullOrEmpty(searchResponse.getCursor()) && results.size() == MAX_SEARCH_LIMIT) { + searchRequest.setCursor(searchResponse.getCursor()); + } } + } while(results != null && results.size() == MAX_SEARCH_LIMIT); + } catch (URISyntaxException e) { + jaxRsDpsLog.error("Failed to call search service.", e); + } + return allRecords; + } - if (!Strings.isNullOrEmpty(searchResponse.getCursor())) { - searchRequest.setCursor(searchResponse.getCursor()); - } else { - done = true; + // The search without cursor can return max. 10,000 records + private List<SearchRecord> searchRecords(SearchRequest searchRequest) { + searchRequest.setLimit(MAX_SEARCH_LIMIT); + int offset = 0; + List<SearchRecord> allRecords = new ArrayList<>(); + try { + List<SearchRecord> results = null; + do { + SearchResponse searchResponse = searchService.query(searchRequest); + results = searchResponse.getResults(); + if (results != null && results.size() > 0) { + allRecords.addAll(results); + offset += results.size(); + searchRequest.setOffset(offset); } - } + } while(results != null && results.size() == MAX_SEARCH_LIMIT); } catch (URISyntaxException e) { jaxRsDpsLog.error("Failed to call search service.", e); } diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/AugmenterSetting.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/AugmenterSetting.java index d11d41cc38f5b3c7aaf1cd63cfbafd38ca4250eb..9e4a7820bc07953914e700ac5c4986805eea29ae 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/AugmenterSetting.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/AugmenterSetting.java @@ -1,3 +1,18 @@ +/* + * Copyright © Schlumberger + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.opengroup.osdu.indexer.util; import org.springframework.beans.factory.annotation.Autowired; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/BooleanFeatureFlagClient.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/BooleanFeatureFlagClient.java index b21bbb47aec44f2774bc2cec8486a9c4b77bb5cf..156c9f39edede7eabf8a9de2f3b2ecc30dc7f590 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/BooleanFeatureFlagClient.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/BooleanFeatureFlagClient.java @@ -1,18 +1,31 @@ +/* + * Copyright © Schlumberger + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.opengroup.osdu.indexer.util; import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.core.common.partition.*; import org.opengroup.osdu.core.common.util.IServiceAccountJwtClient; -import org.opengroup.osdu.indexer.cache.FeatureFlagCache; +import org.opengroup.osdu.indexer.cache.partitionsafe.FeatureFlagCache; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; @Component public class BooleanFeatureFlagClient { - private static final String TOKEN_PREFIX = "Bearer "; - @Lazy @Autowired private FeatureFlagCache cache; @@ -31,9 +44,8 @@ public class BooleanFeatureFlagClient { public boolean isEnabled(String featureName, boolean defaultValue) { String dataPartitionId = headers.getPartitionId(); - String cacheKey = String.format("%s-%s", dataPartitionId, featureName); - if (cache != null && cache.containsKey(cacheKey)) - return cache.get(cacheKey); + if (cache != null && cache.get(featureName) != null) + return cache.get(featureName); boolean isEnabled = defaultValue; try { @@ -42,7 +54,7 @@ public class BooleanFeatureFlagClient { } catch (Exception e) { this.logger.error(String.format("PartitionService: Error getting %s for dataPartition with Id: %s. Turn on the feature flag by default.", featureName, dataPartitionId), e); } - this.cache.put(cacheKey, isEnabled); + this.cache.put(featureName, isEnabled); return isEnabled; } diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/cache/FeatureFlagCacheTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/cache/partitionsafe/FeatureFlagCacheTest.java similarity index 65% rename from indexer-core/src/test/java/org/opengroup/osdu/indexer/cache/FeatureFlagCacheTest.java rename to indexer-core/src/test/java/org/opengroup/osdu/indexer/cache/partitionsafe/FeatureFlagCacheTest.java index b440c049d04c7575df51732a1c8f83aad8fe5f1a..977c466e74c94e7b8bf371ce9ed64952534598a5 100644 --- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/cache/FeatureFlagCacheTest.java +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/cache/partitionsafe/FeatureFlagCacheTest.java @@ -13,34 +13,47 @@ * limitations under the License. */ -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.partitionsafe; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.opengroup.osdu.indexer.cache.FeatureFlagCache; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo; +import org.opengroup.osdu.indexer.cache.partitionsafe.FeatureFlagCache; import org.springframework.test.context.junit4.SpringRunner; +import javax.inject.Inject; + +import static org.mockito.Mockito.when; + @RunWith(SpringRunner.class) public class FeatureFlagCacheTest { private static final String VALID_KEY = "Tenant1-indexer-decimation-enabled"; private static final String INVALID_KEY = "Tenant2-indexer-decimation-enabled"; + + @InjectMocks FeatureFlagCache cache; + @Mock + private IRequestInfo requestInfo; + @Before public void setup() { - cache = new FeatureFlagCache(); + when(requestInfo.getPartitionId()).thenReturn("data-partition-id"); cache.put(VALID_KEY, true); } @Test public void getValidKey() { - Assert.assertTrue(cache.containsKey(VALID_KEY)); + Assert.assertNotNull(cache.get(VALID_KEY)); + Assert.assertTrue(cache.get(VALID_KEY)); } @Test public void getInvalidKey() { - Assert.assertFalse(cache.containsKey(INVALID_KEY)); + Assert.assertNull(cache.get(INVALID_KEY));; } } diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/cache/PartitionSafeIndexCacheTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/cache/partitionsafe/IndexCacheTest.java similarity index 82% rename from indexer-core/src/test/java/org/opengroup/osdu/indexer/cache/PartitionSafeIndexCacheTest.java rename to indexer-core/src/test/java/org/opengroup/osdu/indexer/cache/partitionsafe/IndexCacheTest.java index 106aad0b910d85fc818b307f264a7218fb6cae63..e7eb9a8fa2788dedcd7c45d86cf23a8f77eccb39 100644 --- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/cache/PartitionSafeIndexCacheTest.java +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/cache/partitionsafe/IndexCacheTest.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.opengroup.osdu.indexer.cache; +package org.opengroup.osdu.indexer.cache.partitionsafe; import org.junit.Test; import org.junit.runner.RunWith; @@ -20,19 +20,20 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.opengroup.osdu.core.common.provider.interfaces.IIndexCache; import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo; +import org.opengroup.osdu.indexer.cache.partitionsafe.IndexCache; import org.springframework.test.context.junit4.SpringRunner; import static org.mockito.Mockito.*; @RunWith(SpringRunner.class) -public class PartitionSafeIndexCacheTest { +public class IndexCacheTest { @Mock private IIndexCache cache; @Mock private IRequestInfo requestInfo; @InjectMocks - private PartitionSafeIndexCache sut; + private IndexCache sut; @Test public void should_addopendesNamToKey_when_addingToCache() { @@ -40,7 +41,7 @@ public class PartitionSafeIndexCacheTest { this.sut.put("key", true); - verify(this.cache, times(1)).put("opendes-key", true); + verify(this.cache, times(1)).put("opendes-indexcache-key", true); } @Test @@ -49,7 +50,7 @@ public class PartitionSafeIndexCacheTest { this.sut.delete("key"); - verify(this.cache, times(1)).delete("opendes-key"); + verify(this.cache, times(1)).delete("opendes-indexcache-key"); } @Test @@ -58,7 +59,7 @@ public class PartitionSafeIndexCacheTest { this.sut.get("key"); - verify(this.cache, times(1)).get("opendes-key"); + verify(this.cache, times(1)).get("opendes-indexcache-key"); } @Test diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceTest.java index d7b8ce8ea814f24138780137d4356fb258b85b8f..12c098d8f3ff4f3dca05b037a0a2a8f43f323c4d 100644 --- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceTest.java +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceTest.java @@ -50,7 +50,7 @@ import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.model.indexer.IndexSchema; import org.opengroup.osdu.core.common.model.search.RecordMetaAttribute; import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver; -import org.opengroup.osdu.indexer.cache.PartitionSafeIndexCache; +import org.opengroup.osdu.indexer.cache.partitionsafe.IndexCache; import org.opengroup.osdu.indexer.util.ElasticClientHandler; import org.opengroup.osdu.indexer.util.TypeMapper; import org.mockito.junit.MockitoJUnitRunner; @@ -75,7 +75,7 @@ public class IndexerMappingServiceTest { @Mock private ElasticClientHandler elasticClientHandler; @Mock - private PartitionSafeIndexCache indexCache; + private IndexCache indexCache; @Mock private IndicesService indicesService; @Mock diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/IndexerSchemaServiceTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/IndexerSchemaServiceTest.java index 584bef57ee6d9b1e932494e57b722b5b1350ef5a..be63bc65290b01154deffe67a96e14e18b28abdb 100644 --- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/IndexerSchemaServiceTest.java +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/IndexerSchemaServiceTest.java @@ -32,8 +32,8 @@ import org.opengroup.osdu.core.common.model.indexer.IndexSchema; import org.opengroup.osdu.core.common.model.indexer.OperationType; import org.opengroup.osdu.core.common.model.storage.SchemaItem; import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver; -import org.opengroup.osdu.indexer.cache.PartitionSafeFlattenedSchemaCache; -import org.opengroup.osdu.indexer.cache.PartitionSafeSchemaCache; +import org.opengroup.osdu.indexer.cache.partitionsafe.FlattenedSchemaCache; +import org.opengroup.osdu.indexer.cache.partitionsafe.SchemaCache; import org.opengroup.osdu.indexer.model.indexproperty.PropertyConfigurations; import org.opengroup.osdu.indexer.schema.converter.exeption.SchemaProcessingException; import org.opengroup.osdu.indexer.schema.converter.interfaces.IVirtualPropertiesSchemaCache; @@ -75,9 +75,9 @@ public class IndexerSchemaServiceTest { @Mock private SchemaService schemaService; @Mock - private PartitionSafeSchemaCache schemaCache; + private SchemaCache schemaCache; @Mock - private PartitionSafeFlattenedSchemaCache flattenedSchemaCache; + private FlattenedSchemaCache flattenedSchemaCache; @Mock private IVirtualPropertiesSchemaCache virtualPropertiesSchemaCache; @Mock diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/IndicesServiceTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/IndicesServiceTest.java index 1f0c43a9fccd6c56862c0243ff46c54b39052142..4d3354778de3c3a873fc9902917a26cfbc84c6ce 100644 --- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/IndicesServiceTest.java +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/IndicesServiceTest.java @@ -20,7 +20,6 @@ import org.apache.http.HttpEntity; import org.apache.http.HttpStatus; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; -import org.apache.http.util.EntityUtils; import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; @@ -41,7 +40,7 @@ import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.model.http.AppException; import org.opengroup.osdu.core.common.model.search.IndexInfo; import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver; -import org.opengroup.osdu.indexer.cache.PartitionSafeIndexCache; +import org.opengroup.osdu.indexer.cache.partitionsafe.IndexCache; import org.opengroup.osdu.indexer.util.ElasticClientHandler; import org.springframework.context.annotation.Lazy; import org.springframework.test.context.junit4.SpringRunner; @@ -64,7 +63,7 @@ public class IndicesServiceTest { @Mock private ElasticIndexNameResolver elasticIndexNameResolver; @Mock - private PartitionSafeIndexCache indicesExistCache; + private IndexCache indicesExistCache; @Mock @Lazy private JaxRsDpsLog log; diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/PropertyConfigurationsServiceImplTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/PropertyConfigurationsServiceImplTest.java index cc4bd6e1999a2a5428ed04c8a82df17b11d72f09..e68ca9dbf6870b80157bc25115fb679d2ba9abfd 100644 --- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/PropertyConfigurationsServiceImplTest.java +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/PropertyConfigurationsServiceImplTest.java @@ -37,7 +37,7 @@ import org.opengroup.osdu.core.common.model.storage.RecordData; import org.opengroup.osdu.core.common.model.storage.Schema; import org.opengroup.osdu.core.common.model.storage.SchemaItem; import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo; -import org.opengroup.osdu.indexer.cache.*; +import org.opengroup.osdu.indexer.cache.partitionsafe.*; import org.opengroup.osdu.indexer.config.IndexerConfigurationProperties; import org.opengroup.osdu.indexer.model.*; import org.opengroup.osdu.indexer.model.indexproperty.PropertyConfigurations; @@ -50,15 +50,11 @@ import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.lang.reflect.Type; import java.net.URISyntaxException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; -import static org.mockito.ArgumentMatchers.*; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.*; @RunWith(SpringRunner.class) public class PropertyConfigurationsServiceImplTest { @@ -70,19 +66,19 @@ public class PropertyConfigurationsServiceImplTest { @Mock private IndexerConfigurationProperties configurationProperties; @Mock - private PartitionSafePropertyConfigurationsCache propertyConfigurationCache; + private PropertyConfigurationsCache propertyConfigurationCache; @Mock - private PartitionSafePropertyConfigurationsEnabledCache propertyConfigurationsEnabledCache; + private ConfigurationsEnabledCache propertyConfigurationsEnabledCache; @Mock - private PartitionSafeParentChildRelationshipSpecsCache parentChildRelationshipSpecsCache; + private ChildRelationshipSpecsCache parentChildRelationshipSpecsCache; @Mock - private PartitionSafeChildrenKindsCache childrenKindsCache; + private ChildrenKindsCache childrenKindsCache; @Mock - private PartitionSafeKindCache kindCache; + private KindCache kindCache; @Mock - private IRelatedObjectCache relatedObjectCache; + private RelatedObjectCache relatedObjectCache; @Mock - private IRecordChangeInfoCache recordChangeInfoCache; + private RecordChangeInfoCache recordChangeInfoCache; @Mock private SearchService searchService; @Mock @@ -184,7 +180,7 @@ public class PropertyConfigurationsServiceImplTest { SearchResponse searchResponse = new SearchResponse(); searchResponse.setResults(results); searchResponse.setTotalCount(results.size()); - when(this.searchService.queryWithCursor(any())).thenReturn(searchResponse); + when(this.searchService.query(any())).thenReturn(searchResponse); String kind = "osdu:wks:master-data--Well:1.0.0"; String code = "osdu:wks:master-data--Well:1."; PropertyConfigurations configuration = sut.getPropertyConfigurations(kind); @@ -199,7 +195,7 @@ public class PropertyConfigurationsServiceImplTest { @Test public void getPropertyConfigurations_without_result_from_search() throws URISyntaxException { - when(this.searchService.queryWithCursor(any())).thenReturn(new SearchResponse()); + when(this.searchService.query(any())).thenReturn(new SearchResponse()); String kind = "osdu:wks:master-data--Well:1.0.0"; PropertyConfigurations configuration = sut.getPropertyConfigurations(kind); @@ -230,34 +226,30 @@ public class PropertyConfigurationsServiceImplTest { public void getExtendedProperties_from_self_and_parent_objects() throws JsonProcessingException, URISyntaxException { PropertyConfigurations propertyConfigurations = getConfigurations("welllog_configuration_record.json"); Map<String, Object> originalDataMap = getDataMap("welllog_original_data.json"); - Map<String, Object> relatedObjectData; - Map<String, Map<String, Object>> relatedObjects = new HashMap<>(); - relatedObjectData = getDataMap("wellbore_data.json"); - relatedObjects.put("opendes:master-data--Wellbore:nz-100000113552", relatedObjectData); + + SearchResponse searchResponse = new SearchResponse(); + List<SearchRecord> records = new ArrayList<>(); + searchResponse.setResults(records); + + Map<String, Object> relatedObjectData = getDataMap("wellbore_data.json"); + SearchRecord record = new SearchRecord(); + record.setId("opendes:master-data--Wellbore:nz-100000113552"); + record.setData(relatedObjectData); + records.add(record); + relatedObjectData = getDataMap("organisation_data1.json"); - relatedObjects.put("opendes:master-data--Organisation:BigOil-Department-SeismicInterpretation", relatedObjectData); + record = new SearchRecord(); + record.setId("opendes:master-data--Organisation:BigOil-Department-SeismicInterpretation"); + record.setData(relatedObjectData); + records.add(record); + relatedObjectData = getDataMap("organisation_data2.json"); - relatedObjects.put("opendes:master-data--Organisation:BigOil-Department-SeismicProcessing", relatedObjectData); + record = new SearchRecord(); + record.setId("opendes:master-data--Organisation:BigOil-Department-SeismicProcessing"); + record.setData(relatedObjectData); + records.add(record); - // Setup search response for searchService.queryWithCursor(...) - when(this.searchService.query(any())).thenAnswer(invocation -> { - SearchRequest searchRequest = invocation.getArgument(0); - String query = searchRequest.getQuery(); - Map<String, Object> data = null; - for(Map.Entry<String, Map<String, Object>> entry: relatedObjects.entrySet()) { - if(query.contains(entry.getKey())) { - data = entry.getValue(); - break; - } - } - if(data == null) - throw new Exception("Unexpected search"); - SearchResponse searchResponse = new SearchResponse(); - SearchRecord record = new SearchRecord(); - record.setData(data); - searchResponse.setResults(Arrays.asList(record)); - return searchResponse; - }); + when(this.searchService.query(any())).thenReturn(searchResponse); Map<String, Object> extendedProperties = this.sut.getExtendedProperties("anyId", originalDataMap, propertyConfigurations); Map<String, Object> expectedExtendedProperties = getDataMap("welllog_extended_data.json"); @@ -658,8 +650,8 @@ public class PropertyConfigurationsServiceImplTest { parentKind = "osdu:wks:master-data--Wellbore:1.0.0"; parentId = "anyParentId"; - // Setup search response for searchService.queryWithCursor(...) - when(this.searchService.queryWithCursor(any())).thenAnswer(invocation -> { + // Setup search response for searchService.query(...) + when(this.searchService.query(any())).thenAnswer(invocation -> { SearchRequest searchRequest = invocation.getArgument(0); SearchResponse searchResponse = new SearchResponse(); if (searchRequest.getKind().toString().equals(propertyConfigurationKind)) { @@ -822,8 +814,8 @@ public class PropertyConfigurationsServiceImplTest { parentKind = "osdu:wks:master-data--GeoPoliticalEntity:1.0.0"; parentId = "anyParentId"; - // Setup search response for searchService.queryWithCursor(...) - when(this.searchService.queryWithCursor(any())).thenAnswer(invocation -> { + // Setup search response for searchService.query(...) + when(this.searchService.query(any())).thenAnswer(invocation -> { SearchRequest searchRequest = invocation.getArgument(0); SearchResponse searchResponse = new SearchResponse(); if (searchRequest.getKind().toString().equals(propertyConfigurationKind)) { @@ -838,22 +830,27 @@ public class PropertyConfigurationsServiceImplTest { // Search ParentToChildren // No result } - } else { - if(searchRequest.getKind().toString().contains("osdu:wks:master-data--Well:1.")) { - // Return of searchUniqueParentIds(...) - SearchRecord searchRecord = new SearchRecord(); - Map<String, Object> childDataMap = new HashMap<>(); - childDataMap.put("AssociatedIdentities", Arrays.asList(parentId)); - searchRecord.setKind(childKind); - searchRecord.setId(childId); - searchRecord.setData(childDataMap); - searchResponse.setResults(Arrays.asList(searchRecord)); - } - else { - // This branch is a setup for test case: - // updateAssociatedRecords_updateAssociatedChildrenRecords_circularIndexing - throw new Exception("Unexpected search"); - } + } + return searchResponse; + }); + + when(this.searchService.queryWithCursor(any())).thenAnswer(invocation -> { + SearchRequest searchRequest = invocation.getArgument(0); + SearchResponse searchResponse = new SearchResponse(); + if(searchRequest.getKind().toString().contains("osdu:wks:master-data--Well:1.")) { + // Return of searchUniqueParentIds(...) + SearchRecord searchRecord = new SearchRecord(); + Map<String, Object> childDataMap = new HashMap<>(); + childDataMap.put("AssociatedIdentities", Arrays.asList(parentId)); + searchRecord.setKind(childKind); + searchRecord.setId(childId); + searchRecord.setData(childDataMap); + searchResponse.setResults(Arrays.asList(searchRecord)); + } + else { + // This branch is a setup for test case: + // updateAssociatedRecords_updateAssociatedChildrenRecords_circularIndexing + throw new Exception("Unexpected search"); } return searchResponse; }); diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapperTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapperTest.java index b56339a96f294e8c8035d7844354cf885a7f1f2d..2310730c21be6c16723338cfffb4a7906706ef40 100644 --- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapperTest.java +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapperTest.java @@ -12,12 +12,13 @@ import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.core.common.model.indexer.IndexSchema; import org.opengroup.osdu.core.common.model.indexer.JobStatus; -import org.opengroup.osdu.indexer.cache.FeatureFlagCache; +import org.opengroup.osdu.indexer.cache.partitionsafe.FeatureFlagCache; import org.opengroup.osdu.indexer.schema.converter.config.SchemaConverterPropertiesConfig; import org.opengroup.osdu.indexer.schema.converter.exeption.SchemaProcessingException; import org.opengroup.osdu.indexer.schema.converter.interfaces.IVirtualPropertiesSchemaCache; import org.opengroup.osdu.indexer.schema.converter.tags.SchemaRoot; import org.opengroup.osdu.indexer.schema.converter.tags.VirtualProperties; +import org.opengroup.osdu.indexer.service.mock.RequestInfoMock; import org.opengroup.osdu.indexer.service.mock.ServiceAccountJwtClientMock; import org.opengroup.osdu.indexer.service.mock.VirtualPropertiesSchemaCacheMock; import org.opengroup.osdu.indexer.util.geo.decimator.*; @@ -45,7 +46,7 @@ import static org.junit.Assert.*; BooleanParser.class, DateTimeParser.class, GeoShapeParser.class, DouglasPeuckerReducer.class, GeoShapeDecimator.class, GeometryDecimator.class, GeometryConversionService.class, FeatureFlagCache.class, DpsHeaders.class, JobStatus.class, SchemaConverterPropertiesConfig.class, JaxRsDpsLog.class, - ServiceAccountJwtClientMock.class, VirtualPropertiesSchemaCacheMock.class, }) + ServiceAccountJwtClientMock.class, VirtualPropertiesSchemaCacheMock.class, RequestInfoMock.class}) public class StorageIndexerPayloadMapperTest { public static final String FIRST_OBJECT_INNER_PROPERTY = "FirstObjectInnerProperty"; diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/mock/RequestInfoMock.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/mock/RequestInfoMock.java new file mode 100644 index 0000000000000000000000000000000000000000..ce748b43bf3eb9beeb38e391eae0d6ce33f97127 --- /dev/null +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/mock/RequestInfoMock.java @@ -0,0 +1,60 @@ +/* + * Copyright © Schlumberger + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.opengroup.osdu.indexer.service.mock; + +import org.opengroup.osdu.core.common.model.http.DpsHeaders; +import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo; +import org.springframework.stereotype.Component; + +import java.util.Map; + +@Component +public class RequestInfoMock implements IRequestInfo { + @Override + public DpsHeaders getHeaders() { + return null; + } + + @Override + public String getPartitionId() { + return null; + } + + @Override + public Map<String, String> getHeadersMap() { + return null; + } + + @Override + public Map<String, String> getHeadersMapWithDwdAuthZ() { + return null; + } + + @Override + public DpsHeaders getHeadersWithDwdAuthZ() { + return null; + } + + @Override + public boolean isCronRequest() { + return false; + } + + @Override + public boolean isTaskQueueRequest() { + return false; + } +} diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/util/BooleanFeatureFlagClientTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/util/BooleanFeatureFlagClientTest.java index 4a309df7b7abd3028f69e79aa32c027bf08ec327..5e0c2ede26b5e0387ffa837c432e87b5f7e1135e 100644 --- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/util/BooleanFeatureFlagClientTest.java +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/util/BooleanFeatureFlagClientTest.java @@ -21,22 +21,24 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; +import org.mockito.Mockito; import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.core.common.partition.*; import org.opengroup.osdu.core.common.util.IServiceAccountJwtClient; -import org.opengroup.osdu.indexer.cache.FeatureFlagCache; +import org.opengroup.osdu.indexer.cache.partitionsafe.FeatureFlagCache; import org.springframework.test.context.junit4.SpringRunner; import java.util.HashMap; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @RunWith(SpringRunner.class) public class BooleanFeatureFlagClientTest { - private static final String PROPERTY_NAME = "indexer-decimation-enabled"; + private static final String PROPERTY_NAME = "any-feature-enabled"; @InjectMocks private BooleanFeatureFlagClient sut; @@ -56,6 +58,7 @@ public class BooleanFeatureFlagClientTest { @Mock private IServiceAccountJwtClient tokenService; + @Mock IPartitionProvider partitionProvider; @@ -68,13 +71,14 @@ public class BooleanFeatureFlagClientTest { } @Test - public void isDecimationEnabled_return_true() throws PartitionException { + public void isEnabled_return_true() throws PartitionException { PartitionInfo partitionInfo = new PartitionInfo(); Property property = new Property(); property.setSensitive(false); property.setValue("true"); partitionInfo.getProperties().put(PROPERTY_NAME, property); when(this.partitionProvider.get(anyString())).thenReturn(partitionInfo); + when(this.cache.get(anyString())).thenReturn(null); // Default value won't take any effect boolean enabled = sut.isEnabled(PROPERTY_NAME, true); @@ -85,13 +89,14 @@ public class BooleanFeatureFlagClientTest { } @Test - public void isDecimationEnabled_return_false_when_property_set_to_false() throws PartitionException { + public void isEnabled_return_false_when_property_set_to_false() throws PartitionException { PartitionInfo partitionInfo = new PartitionInfo(); Property property = new Property(); property.setSensitive(false); property.setValue("false"); partitionInfo.getProperties().put(PROPERTY_NAME, property); when(this.partitionProvider.get(anyString())).thenReturn(partitionInfo); + when(this.cache.get(anyString())).thenReturn(null); // Default value won't take any effect boolean enabled = sut.isEnabled(PROPERTY_NAME, true); @@ -102,10 +107,11 @@ public class BooleanFeatureFlagClientTest { } @Test - public void isDecimationEnabled_return_default_value_when_property_does_not_exist() throws PartitionException { + public void isEnabled_return_default_value_when_property_does_not_exist() throws PartitionException { // The feature flag is enabled by default PartitionInfo partitionInfo = new PartitionInfo(); when(this.partitionProvider.get(anyString())).thenReturn(partitionInfo); + when(this.cache.get(anyString())).thenReturn(null); boolean enabled = sut.isEnabled(PROPERTY_NAME, true);; Assert.assertTrue(enabled); @@ -114,9 +120,10 @@ public class BooleanFeatureFlagClientTest { } @Test - public void isDecimationEnabled_return_default_value_when_partitionProvider_throws_exception() throws PartitionException { + public void isEnabled_return_default_value_when_partitionProvider_throws_exception() throws PartitionException { // The feature flag is enabled by default when(this.partitionProvider.get(anyString())).thenThrow(PartitionException.class); + when(this.cache.get(anyString())).thenReturn(null); boolean enabled = sut.isEnabled(PROPERTY_NAME, true);; Assert.assertTrue(enabled); @@ -124,4 +131,22 @@ public class BooleanFeatureFlagClientTest { Assert.assertFalse(enabled); } + @Test + public void isEnabled_return_true_from_cache() throws PartitionException { + when(this.cache.get(anyString())).thenReturn(true); + boolean enabled = sut.isEnabled(PROPERTY_NAME, false);; + Assert.assertTrue(enabled); + verify(headers, Mockito.times(0)).getHeaders(); + verify(factory, Mockito.times(0)).create(any()); + } + + @Test + public void isEnabled_return_false_from_cache() throws PartitionException { + when(this.cache.get(anyString())).thenReturn(false); + boolean enabled = sut.isEnabled(PROPERTY_NAME, false);; + Assert.assertFalse(enabled); + verify(headers, Mockito.times(0)).getHeaders(); + verify(factory, Mockito.times(0)).create(any()); + } + } diff --git a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RecordChangeInfoRedisCache.java b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RecordChangeInfoRedisCache.java index 0f2634719b91a5fe752266cd7a0ed674a1bfbd15..b1a7996e096abca00ef2cc0583f34e69154994c3 100644 --- a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RecordChangeInfoRedisCache.java +++ b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RecordChangeInfoRedisCache.java @@ -16,7 +16,7 @@ package org.opengroup.osdu.indexer.azure.cache; import org.opengroup.osdu.core.common.cache.RedisCache; -import org.opengroup.osdu.indexer.cache.IRecordChangeInfoCache; +import org.opengroup.osdu.indexer.cache.interfaces.IRecordChangeInfoCache; import org.opengroup.osdu.indexer.model.RecordChangeInfo; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; diff --git a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RelatedObjectRedisCache.java b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RelatedObjectRedisCache.java index 9e6c0b58f60c51e25f8265f9b5ac36395ad8b7ee..0a65faa92721baada73724f6eb413fe4213d4938 100644 --- a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RelatedObjectRedisCache.java +++ b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/cache/RelatedObjectRedisCache.java @@ -17,7 +17,7 @@ package org.opengroup.osdu.indexer.azure.cache; import org.opengroup.osdu.core.common.cache.RedisCache; import org.opengroup.osdu.core.common.model.storage.RecordData; -import org.opengroup.osdu.indexer.cache.IRelatedObjectCache; +import org.opengroup.osdu.indexer.cache.interfaces.IRelatedObjectCache; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Primary;