From 3ce91d7310f19a075c2c54d1310208e43c14259e Mon Sep 17 00:00:00 2001 From: Jason Hinch Date: Thu, 26 Oct 2023 09:41:28 +1100 Subject: [PATCH] 2.9 compatibility --- build.gradle | 4 ++-- .../com/o19s/es/explore/ExplorerQueryBuilder.java | 8 ++++---- .../java/com/o19s/es/ltr/LtrQueryParserPlugin.java | 6 +++--- .../o19s/es/ltr/action/AddFeaturesToSetAction.java | 2 +- .../com/o19s/es/ltr/action/CachesStatsAction.java | 4 ++-- .../o19s/es/ltr/action/CreateModelFromSetAction.java | 2 +- .../com/o19s/es/ltr/action/FeatureStoreAction.java | 2 +- .../java/com/o19s/es/ltr/action/LTRStatsAction.java | 6 +++--- .../com/o19s/es/ltr/action/ListStoresAction.java | 6 +++--- .../com/o19s/es/ltr/feature/FeatureValidation.java | 12 ++++++------ .../es/ltr/feature/store/FeatureNormDefinition.java | 2 +- .../feature/store/MinMaxFeatureNormDefinition.java | 6 +++--- .../feature/store/PrecompiledTemplateFeature.java | 2 +- .../com/o19s/es/ltr/feature/store/ScriptFeature.java | 4 ++-- .../feature/store/StandardFeatureNormDefinition.java | 8 ++++---- .../o19s/es/ltr/feature/store/StorableElement.java | 4 ++-- .../com/o19s/es/ltr/feature/store/StoredFeature.java | 10 +++++----- .../ltr/feature/store/StoredFeatureNormalizers.java | 10 +++++----- .../o19s/es/ltr/feature/store/StoredFeatureSet.java | 8 ++++---- .../o19s/es/ltr/feature/store/StoredLtrModel.java | 10 +++++----- .../ltr/feature/store/index/IndexFeatureStore.java | 12 ++++++------ .../o19s/es/ltr/logging/LoggingSearchExtBuilder.java | 10 +++++----- .../java/com/o19s/es/ltr/query/LtrQueryBuilder.java | 8 ++++---- .../com/o19s/es/ltr/query/StoredLtrQueryBuilder.java | 8 ++++---- .../o19s/es/ltr/query/ValidatingLtrQueryBuilder.java | 8 ++++---- .../es/ltr/ranker/parser/LinearRankerParser.java | 4 ++-- .../o19s/es/ltr/ranker/parser/XGBoostJsonParser.java | 10 +++++----- .../java/com/o19s/es/ltr/rest/AutoDetectParser.java | 6 +++--- .../com/o19s/es/ltr/rest/RestAddFeatureToSet.java | 6 +++--- .../com/o19s/es/ltr/rest/RestCreateModelFromSet.java | 6 +++--- .../com/o19s/es/ltr/rest/RestFeatureStoreCaches.java | 2 +- .../java/com/o19s/es/ltr/rest/RestStoreManager.java | 2 +- src/main/java/com/o19s/es/ltr/utils/Suppliers.java | 2 +- .../es/template/mustache/CustomMustacheFactory.java | 2 +- .../com/o19s/es/termstat/TermStatQueryBuilder.java | 8 ++++---- src/test/java/com/o19s/es/ltr/LtrTestUtils.java | 2 +- .../ltr/feature/store/StoredFeatureParserTests.java | 10 +++++----- .../feature/store/StoredFeatureSetParserTests.java | 8 ++++---- .../ltr/feature/store/StoredLtrModelParserTests.java | 10 +++++----- .../feature/store/index/IndexFeatureStoreTests.java | 8 ++++---- .../es/ltr/logging/LoggingSearchExtBuilderTests.java | 8 ++++---- .../ltr/ranker/parser/LinearRankerParserTests.java | 4 ++-- .../es/ltr/ranker/parser/XGBoostJsonParserTests.java | 2 +- .../com/o19s/es/ltr/rest/FeaturesParserTests.java | 6 +++--- 44 files changed, 134 insertions(+), 134 deletions(-) diff --git a/build.gradle b/build.gradle index d8837fe6..41549276 100644 --- a/build.gradle +++ b/build.gradle @@ -54,8 +54,8 @@ validateNebulaPom.enabled = false buildscript { ext { isSnapshot = "true" == System.getProperty("build.snapshot", "true") - opensearch_version = System.getProperty("opensearch.version", "2.6.0") - lucene_version = "9.5.0" + opensearch_version = System.getProperty("opensearch.version", "2.9.0") + lucene_version = "9.7.0" plugin_version = opensearch_version + ".0" if (isSnapshot) { opensearch_version += "-SNAPSHOT" diff --git a/src/main/java/com/o19s/es/explore/ExplorerQueryBuilder.java b/src/main/java/com/o19s/es/explore/ExplorerQueryBuilder.java index 9a85ea6e..51e49e47 100644 --- a/src/main/java/com/o19s/es/explore/ExplorerQueryBuilder.java +++ b/src/main/java/com/o19s/es/explore/ExplorerQueryBuilder.java @@ -16,14 +16,14 @@ package com.o19s.es.explore; import org.apache.lucene.search.Query; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.ParsingException; import org.opensearch.common.io.stream.NamedWriteable; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentBuilder; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.query.AbstractQueryBuilder; import org.opensearch.index.query.QueryBuilder; import org.opensearch.index.query.QueryRewriteContext; diff --git a/src/main/java/com/o19s/es/ltr/LtrQueryParserPlugin.java b/src/main/java/com/o19s/es/ltr/LtrQueryParserPlugin.java index d0353036..1428a24f 100644 --- a/src/main/java/com/o19s/es/ltr/LtrQueryParserPlugin.java +++ b/src/main/java/com/o19s/es/ltr/LtrQueryParserPlugin.java @@ -75,7 +75,7 @@ import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.CheckedFunction; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.io.stream.NamedWriteableRegistry.Entry; import org.opensearch.common.settings.ClusterSettings; @@ -83,8 +83,8 @@ import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; import org.opensearch.common.settings.SettingsFilter; -import org.opensearch.common.xcontent.NamedXContentRegistry; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.env.Environment; import org.opensearch.env.NodeEnvironment; import org.opensearch.index.Index; diff --git a/src/main/java/com/o19s/es/ltr/action/AddFeaturesToSetAction.java b/src/main/java/com/o19s/es/ltr/action/AddFeaturesToSetAction.java index 3dea24d9..04ee4e4a 100644 --- a/src/main/java/com/o19s/es/ltr/action/AddFeaturesToSetAction.java +++ b/src/main/java/com/o19s/es/ltr/action/AddFeaturesToSetAction.java @@ -30,7 +30,7 @@ import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.io.stream.Writeable.Reader; import org.opensearch.common.xcontent.StatusToXContentObject; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.rest.RestStatus; import java.io.IOException; diff --git a/src/main/java/com/o19s/es/ltr/action/CachesStatsAction.java b/src/main/java/com/o19s/es/ltr/action/CachesStatsAction.java index 30963d6b..8e353499 100644 --- a/src/main/java/com/o19s/es/ltr/action/CachesStatsAction.java +++ b/src/main/java/com/o19s/es/ltr/action/CachesStatsAction.java @@ -30,8 +30,8 @@ import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.io.stream.Writeable; -import org.opensearch.common.xcontent.ToXContent; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.ToXContent; +import org.opensearch.core.xcontent.XContentBuilder; import java.io.IOException; import java.util.HashMap; diff --git a/src/main/java/com/o19s/es/ltr/action/CreateModelFromSetAction.java b/src/main/java/com/o19s/es/ltr/action/CreateModelFromSetAction.java index bf28f2b6..c19c6e23 100644 --- a/src/main/java/com/o19s/es/ltr/action/CreateModelFromSetAction.java +++ b/src/main/java/com/o19s/es/ltr/action/CreateModelFromSetAction.java @@ -29,7 +29,7 @@ import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.xcontent.StatusToXContentObject; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.rest.RestStatus; import java.io.IOException; diff --git a/src/main/java/com/o19s/es/ltr/action/FeatureStoreAction.java b/src/main/java/com/o19s/es/ltr/action/FeatureStoreAction.java index 5c7ca5fb..4e3b1033 100644 --- a/src/main/java/com/o19s/es/ltr/action/FeatureStoreAction.java +++ b/src/main/java/com/o19s/es/ltr/action/FeatureStoreAction.java @@ -31,7 +31,7 @@ import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.io.stream.Writeable.Reader; import org.opensearch.common.xcontent.StatusToXContentObject; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.rest.RestStatus; import java.io.IOException; diff --git a/src/main/java/com/o19s/es/ltr/action/LTRStatsAction.java b/src/main/java/com/o19s/es/ltr/action/LTRStatsAction.java index 54959328..3564cb8d 100644 --- a/src/main/java/com/o19s/es/ltr/action/LTRStatsAction.java +++ b/src/main/java/com/o19s/es/ltr/action/LTRStatsAction.java @@ -28,9 +28,9 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.xcontent.ToXContent; -import org.opensearch.common.xcontent.ToXContentFragment; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.ToXContent; +import org.opensearch.core.xcontent.ToXContentFragment; +import org.opensearch.core.xcontent.XContentBuilder; import java.io.IOException; import java.util.HashSet; diff --git a/src/main/java/com/o19s/es/ltr/action/ListStoresAction.java b/src/main/java/com/o19s/es/ltr/action/ListStoresAction.java index d1c604ec..1137e035 100644 --- a/src/main/java/com/o19s/es/ltr/action/ListStoresAction.java +++ b/src/main/java/com/o19s/es/ltr/action/ListStoresAction.java @@ -28,9 +28,9 @@ import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.io.stream.Writeable; import org.opensearch.common.io.stream.Writeable.Reader; -import org.opensearch.common.xcontent.ToXContent; -import org.opensearch.common.xcontent.ToXContentObject; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.ToXContent; +import org.opensearch.core.xcontent.ToXContentObject; +import org.opensearch.core.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/src/main/java/com/o19s/es/ltr/feature/FeatureValidation.java b/src/main/java/com/o19s/es/ltr/feature/FeatureValidation.java index d63b7b85..7d615256 100644 --- a/src/main/java/com/o19s/es/ltr/feature/FeatureValidation.java +++ b/src/main/java/com/o19s/es/ltr/feature/FeatureValidation.java @@ -16,15 +16,15 @@ package com.o19s.es.ltr.feature; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.io.stream.Writeable; -import org.opensearch.common.xcontent.ConstructingObjectParser; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.ToXContentObject; -import org.opensearch.common.xcontent.XContentBuilder; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.ConstructingObjectParser; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.ToXContentObject; +import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/src/main/java/com/o19s/es/ltr/feature/store/FeatureNormDefinition.java b/src/main/java/com/o19s/es/ltr/feature/store/FeatureNormDefinition.java index 7e1009d5..31bb917d 100644 --- a/src/main/java/com/o19s/es/ltr/feature/store/FeatureNormDefinition.java +++ b/src/main/java/com/o19s/es/ltr/feature/store/FeatureNormDefinition.java @@ -18,7 +18,7 @@ import com.o19s.es.ltr.ranker.normalizer.Normalizer; import org.opensearch.common.io.stream.Writeable; -import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.core.xcontent.ToXContent; /** * Parsed feature norm from model definition diff --git a/src/main/java/com/o19s/es/ltr/feature/store/MinMaxFeatureNormDefinition.java b/src/main/java/com/o19s/es/ltr/feature/store/MinMaxFeatureNormDefinition.java index fa4e44ef..b43c236d 100644 --- a/src/main/java/com/o19s/es/ltr/feature/store/MinMaxFeatureNormDefinition.java +++ b/src/main/java/com/o19s/es/ltr/feature/store/MinMaxFeatureNormDefinition.java @@ -18,11 +18,11 @@ import com.o19s.es.ltr.ranker.normalizer.MinMaxFeatureNormalizer; import com.o19s.es.ltr.ranker.normalizer.Normalizer; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentBuilder; import java.io.IOException; diff --git a/src/main/java/com/o19s/es/ltr/feature/store/PrecompiledTemplateFeature.java b/src/main/java/com/o19s/es/ltr/feature/store/PrecompiledTemplateFeature.java index 7e200c70..396ca312 100644 --- a/src/main/java/com/o19s/es/ltr/feature/store/PrecompiledTemplateFeature.java +++ b/src/main/java/com/o19s/es/ltr/feature/store/PrecompiledTemplateFeature.java @@ -27,7 +27,7 @@ import org.opensearch.common.ParsingException; import org.opensearch.common.xcontent.LoggingDeprecationHandler; import org.opensearch.common.xcontent.XContentFactory; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.query.QueryBuilder; import org.opensearch.index.query.QueryShardException; import org.opensearch.index.query.Rewriteable; diff --git a/src/main/java/com/o19s/es/ltr/feature/store/ScriptFeature.java b/src/main/java/com/o19s/es/ltr/feature/store/ScriptFeature.java index 1c78f5ac..b7763dd2 100644 --- a/src/main/java/com/o19s/es/ltr/feature/store/ScriptFeature.java +++ b/src/main/java/com/o19s/es/ltr/feature/store/ScriptFeature.java @@ -44,8 +44,8 @@ import org.opensearch.common.lucene.search.function.ScriptScoreFunction; import org.opensearch.common.xcontent.LoggingDeprecationHandler; -import org.opensearch.common.xcontent.NamedXContentRegistry; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentType; import org.opensearch.index.mapper.MappedFieldType; import org.opensearch.script.ScoreScript; diff --git a/src/main/java/com/o19s/es/ltr/feature/store/StandardFeatureNormDefinition.java b/src/main/java/com/o19s/es/ltr/feature/store/StandardFeatureNormDefinition.java index 2a707448..b4c9b91d 100644 --- a/src/main/java/com/o19s/es/ltr/feature/store/StandardFeatureNormDefinition.java +++ b/src/main/java/com/o19s/es/ltr/feature/store/StandardFeatureNormDefinition.java @@ -19,12 +19,12 @@ import com.o19s.es.ltr.ranker.normalizer.Normalizer; import com.o19s.es.ltr.ranker.normalizer.StandardFeatureNormalizer; import org.opensearch.OpenSearchException; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentBuilder; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentParser; import java.io.IOException; diff --git a/src/main/java/com/o19s/es/ltr/feature/store/StorableElement.java b/src/main/java/com/o19s/es/ltr/feature/store/StorableElement.java index c14b35d1..34ac4d94 100644 --- a/src/main/java/com/o19s/es/ltr/feature/store/StorableElement.java +++ b/src/main/java/com/o19s/es/ltr/feature/store/StorableElement.java @@ -18,8 +18,8 @@ import org.opensearch.common.ParsingException; import org.opensearch.common.io.stream.NamedWriteable; -import org.opensearch.common.xcontent.ToXContent; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.ToXContent; +import org.opensearch.core.xcontent.XContentParser; public interface StorableElement extends ToXContent, NamedWriteable { /** diff --git a/src/main/java/com/o19s/es/ltr/feature/store/StoredFeature.java b/src/main/java/com/o19s/es/ltr/feature/store/StoredFeature.java index 565a9ca6..a69e88c4 100644 --- a/src/main/java/com/o19s/es/ltr/feature/store/StoredFeature.java +++ b/src/main/java/com/o19s/es/ltr/feature/store/StoredFeature.java @@ -24,18 +24,18 @@ import org.apache.lucene.util.Accountable; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.RamUsageEstimator; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.ParsingException; import org.opensearch.common.Strings; import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.xcontent.LoggingDeprecationHandler; -import org.opensearch.common.xcontent.NamedXContentRegistry; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentFactory; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentType; import org.opensearch.index.query.QueryShardException; import org.opensearch.index.query.ScriptQueryBuilder; diff --git a/src/main/java/com/o19s/es/ltr/feature/store/StoredFeatureNormalizers.java b/src/main/java/com/o19s/es/ltr/feature/store/StoredFeatureNormalizers.java index 8a47c535..8aac603a 100644 --- a/src/main/java/com/o19s/es/ltr/feature/store/StoredFeatureNormalizers.java +++ b/src/main/java/com/o19s/es/ltr/feature/store/StoredFeatureNormalizers.java @@ -19,13 +19,13 @@ import com.o19s.es.ltr.feature.FeatureSet; import com.o19s.es.ltr.ranker.normalizer.Normalizer; import org.opensearch.OpenSearchException; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.ToXContent; -import org.opensearch.common.xcontent.XContentBuilder; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.ToXContent; +import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; diff --git a/src/main/java/com/o19s/es/ltr/feature/store/StoredFeatureSet.java b/src/main/java/com/o19s/es/ltr/feature/store/StoredFeatureSet.java index afe3620f..65fa328c 100644 --- a/src/main/java/com/o19s/es/ltr/feature/store/StoredFeatureSet.java +++ b/src/main/java/com/o19s/es/ltr/feature/store/StoredFeatureSet.java @@ -23,13 +23,13 @@ import org.apache.lucene.search.Query; import org.apache.lucene.util.Accountable; import org.apache.lucene.util.RamUsageEstimator; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.ParsingException; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentBuilder; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/src/main/java/com/o19s/es/ltr/feature/store/StoredLtrModel.java b/src/main/java/com/o19s/es/ltr/feature/store/StoredLtrModel.java index 4bed9c04..37954b60 100644 --- a/src/main/java/com/o19s/es/ltr/feature/store/StoredLtrModel.java +++ b/src/main/java/com/o19s/es/ltr/feature/store/StoredLtrModel.java @@ -23,16 +23,16 @@ import com.o19s.es.ltr.ranker.parser.LtrRankerParser; import com.o19s.es.ltr.ranker.parser.LtrRankerParserFactory; import org.opensearch.Version; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.ParsingException; import org.opensearch.common.Strings; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.io.stream.Writeable; import org.opensearch.common.xcontent.LoggingDeprecationHandler; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentBuilder; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.common.xcontent.json.JsonXContent; import java.io.IOException; @@ -40,7 +40,7 @@ import java.util.Map; import java.util.Objects; -import static org.opensearch.common.xcontent.NamedXContentRegistry.EMPTY; +import static org.opensearch.core.xcontent.NamedXContentRegistry.EMPTY; public class StoredLtrModel implements StorableElement { public static final String TYPE = "model"; diff --git a/src/main/java/com/o19s/es/ltr/feature/store/index/IndexFeatureStore.java b/src/main/java/com/o19s/es/ltr/feature/store/index/IndexFeatureStore.java index 6c3a3d4b..c1aa9abf 100644 --- a/src/main/java/com/o19s/es/ltr/feature/store/index/IndexFeatureStore.java +++ b/src/main/java/com/o19s/es/ltr/feature/store/index/IndexFeatureStore.java @@ -35,19 +35,19 @@ import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.cluster.metadata.MetadataCreateIndexService; import org.opensearch.common.CheckedFunction; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.bytes.BytesReference; import org.apache.logging.log4j.LogManager; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.LoggingDeprecationHandler; -import org.opensearch.common.xcontent.NamedXContentRegistry; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentFactory; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.Streams; +import org.opensearch.common.util.io.Streams; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/src/main/java/com/o19s/es/ltr/logging/LoggingSearchExtBuilder.java b/src/main/java/com/o19s/es/ltr/logging/LoggingSearchExtBuilder.java index 88ce4760..05e0bb2c 100644 --- a/src/main/java/com/o19s/es/ltr/logging/LoggingSearchExtBuilder.java +++ b/src/main/java/com/o19s/es/ltr/logging/LoggingSearchExtBuilder.java @@ -17,15 +17,15 @@ package com.o19s.es.ltr.logging; import org.opensearch.common.Nullable; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.ParsingException; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.io.stream.Writeable; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.ToXContentObject; -import org.opensearch.common.xcontent.XContentBuilder; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.ToXContentObject; +import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.search.SearchExtBuilder; import java.io.IOException; diff --git a/src/main/java/com/o19s/es/ltr/query/LtrQueryBuilder.java b/src/main/java/com/o19s/es/ltr/query/LtrQueryBuilder.java index 17cb4394..342ef2b8 100644 --- a/src/main/java/com/o19s/es/ltr/query/LtrQueryBuilder.java +++ b/src/main/java/com/o19s/es/ltr/query/LtrQueryBuilder.java @@ -24,13 +24,13 @@ import com.o19s.es.ltr.ranker.ranklib.RankLibScriptEngine; import com.o19s.es.ltr.utils.AbstractQueryBuilderUtils; import org.apache.lucene.search.Query; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.ParsingException; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentBuilder; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.query.AbstractQueryBuilder; import org.opensearch.index.query.MatchAllQueryBuilder; import org.opensearch.index.query.QueryBuilder; diff --git a/src/main/java/com/o19s/es/ltr/query/StoredLtrQueryBuilder.java b/src/main/java/com/o19s/es/ltr/query/StoredLtrQueryBuilder.java index 98d6bcae..abcc2584 100644 --- a/src/main/java/com/o19s/es/ltr/query/StoredLtrQueryBuilder.java +++ b/src/main/java/com/o19s/es/ltr/query/StoredLtrQueryBuilder.java @@ -24,14 +24,14 @@ import com.o19s.es.ltr.ranker.linear.LinearRanker; import com.o19s.es.ltr.utils.FeatureStoreLoader; import org.opensearch.Version; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.ParsingException; import org.opensearch.common.io.stream.NamedWriteable; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentBuilder; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.query.AbstractQueryBuilder; import org.opensearch.index.query.QueryShardContext; diff --git a/src/main/java/com/o19s/es/ltr/query/ValidatingLtrQueryBuilder.java b/src/main/java/com/o19s/es/ltr/query/ValidatingLtrQueryBuilder.java index a6f0363a..30f8d07f 100644 --- a/src/main/java/com/o19s/es/ltr/query/ValidatingLtrQueryBuilder.java +++ b/src/main/java/com/o19s/es/ltr/query/ValidatingLtrQueryBuilder.java @@ -30,13 +30,13 @@ import com.o19s.es.ltr.ranker.parser.LtrRankerParserFactory; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Query; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.ParsingException; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentBuilder; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.query.AbstractQueryBuilder; import org.opensearch.index.query.QueryShardContext; import org.opensearch.index.query.QueryShardException; diff --git a/src/main/java/com/o19s/es/ltr/ranker/parser/LinearRankerParser.java b/src/main/java/com/o19s/es/ltr/ranker/parser/LinearRankerParser.java index 8b747d6c..fc81cbc8 100644 --- a/src/main/java/com/o19s/es/ltr/ranker/parser/LinearRankerParser.java +++ b/src/main/java/com/o19s/es/ltr/ranker/parser/LinearRankerParser.java @@ -20,12 +20,12 @@ import com.o19s.es.ltr.ranker.linear.LinearRanker; import org.opensearch.common.ParsingException; import org.opensearch.common.xcontent.LoggingDeprecationHandler; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.common.xcontent.json.JsonXContent; import java.io.IOException; -import static org.opensearch.common.xcontent.NamedXContentRegistry.EMPTY; +import static org.opensearch.core.xcontent.NamedXContentRegistry.EMPTY; public class LinearRankerParser implements LtrRankerParser { public static final String TYPE = "model/linear"; diff --git a/src/main/java/com/o19s/es/ltr/ranker/parser/XGBoostJsonParser.java b/src/main/java/com/o19s/es/ltr/ranker/parser/XGBoostJsonParser.java index 536f7e2b..9d81bd1d 100644 --- a/src/main/java/com/o19s/es/ltr/ranker/parser/XGBoostJsonParser.java +++ b/src/main/java/com/o19s/es/ltr/ranker/parser/XGBoostJsonParser.java @@ -21,13 +21,13 @@ import com.o19s.es.ltr.ranker.dectree.NaiveAdditiveDecisionTree.Node; import com.o19s.es.ltr.ranker.normalizer.Normalizer; import com.o19s.es.ltr.ranker.normalizer.Normalizers; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.ParsingException; import org.opensearch.common.xcontent.LoggingDeprecationHandler; -import org.opensearch.common.xcontent.NamedXContentRegistry; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentParseException; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.NamedXContentRegistry; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentParseException; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.common.xcontent.json.JsonXContent; import java.io.IOException; diff --git a/src/main/java/com/o19s/es/ltr/rest/AutoDetectParser.java b/src/main/java/com/o19s/es/ltr/rest/AutoDetectParser.java index b487ccfa..274c305a 100644 --- a/src/main/java/com/o19s/es/ltr/rest/AutoDetectParser.java +++ b/src/main/java/com/o19s/es/ltr/rest/AutoDetectParser.java @@ -21,10 +21,10 @@ import com.o19s.es.ltr.feature.store.StoredFeature; import com.o19s.es.ltr.feature.store.StoredFeatureSet; import com.o19s.es.ltr.feature.store.StoredLtrModel; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.ParsingException; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentParser; import java.io.IOException; diff --git a/src/main/java/com/o19s/es/ltr/rest/RestAddFeatureToSet.java b/src/main/java/com/o19s/es/ltr/rest/RestAddFeatureToSet.java index 89a6efc7..0da780c7 100644 --- a/src/main/java/com/o19s/es/ltr/rest/RestAddFeatureToSet.java +++ b/src/main/java/com/o19s/es/ltr/rest/RestAddFeatureToSet.java @@ -20,9 +20,9 @@ import com.o19s.es.ltr.feature.FeatureValidation; import com.o19s.es.ltr.feature.store.StoredFeature; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.ParseField; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.ParseField; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestStatusToXContentListener; diff --git a/src/main/java/com/o19s/es/ltr/rest/RestCreateModelFromSet.java b/src/main/java/com/o19s/es/ltr/rest/RestCreateModelFromSet.java index 50459252..d492e169 100644 --- a/src/main/java/com/o19s/es/ltr/rest/RestCreateModelFromSet.java +++ b/src/main/java/com/o19s/es/ltr/rest/RestCreateModelFromSet.java @@ -23,10 +23,10 @@ import org.opensearch.ExceptionsHelper; import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.ParsingException; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.engine.VersionConflictEngineException; import org.opensearch.rest.BytesRestResponse; import org.opensearch.rest.RestRequest; diff --git a/src/main/java/com/o19s/es/ltr/rest/RestFeatureStoreCaches.java b/src/main/java/com/o19s/es/ltr/rest/RestFeatureStoreCaches.java index b8a701a9..9d3000e0 100644 --- a/src/main/java/com/o19s/es/ltr/rest/RestFeatureStoreCaches.java +++ b/src/main/java/com/o19s/es/ltr/rest/RestFeatureStoreCaches.java @@ -20,7 +20,7 @@ import com.o19s.es.ltr.action.ClearCachesAction; import com.o19s.es.ltr.action.ClearCachesAction.ClearCachesNodesResponse; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.rest.BytesRestResponse; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestResponse; diff --git a/src/main/java/com/o19s/es/ltr/rest/RestStoreManager.java b/src/main/java/com/o19s/es/ltr/rest/RestStoreManager.java index 0b64902b..d4be858f 100644 --- a/src/main/java/com/o19s/es/ltr/rest/RestStoreManager.java +++ b/src/main/java/com/o19s/es/ltr/rest/RestStoreManager.java @@ -20,7 +20,7 @@ import org.opensearch.action.admin.indices.delete.DeleteIndexRequest; import org.opensearch.action.admin.indices.exists.indices.IndicesExistsResponse; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.rest.BytesRestResponse; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestResponse; diff --git a/src/main/java/com/o19s/es/ltr/utils/Suppliers.java b/src/main/java/com/o19s/es/ltr/utils/Suppliers.java index 4c52a5a4..94bb7faf 100644 --- a/src/main/java/com/o19s/es/ltr/utils/Suppliers.java +++ b/src/main/java/com/o19s/es/ltr/utils/Suppliers.java @@ -17,7 +17,7 @@ package com.o19s.es.ltr.utils; import com.o19s.es.ltr.ranker.LtrRanker; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import java.util.Objects; import java.util.function.Supplier; diff --git a/src/main/java/com/o19s/es/template/mustache/CustomMustacheFactory.java b/src/main/java/com/o19s/es/template/mustache/CustomMustacheFactory.java index 01340ce0..f00c0344 100644 --- a/src/main/java/com/o19s/es/template/mustache/CustomMustacheFactory.java +++ b/src/main/java/com/o19s/es/template/mustache/CustomMustacheFactory.java @@ -28,7 +28,7 @@ import com.github.mustachejava.codes.IterableCode; import com.github.mustachejava.codes.WriteCode; import org.opensearch.common.Strings; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentType; import java.io.IOException; diff --git a/src/main/java/com/o19s/es/termstat/TermStatQueryBuilder.java b/src/main/java/com/o19s/es/termstat/TermStatQueryBuilder.java index fe34436e..74dec28a 100644 --- a/src/main/java/com/o19s/es/termstat/TermStatQueryBuilder.java +++ b/src/main/java/com/o19s/es/termstat/TermStatQueryBuilder.java @@ -24,14 +24,14 @@ import org.apache.lucene.expressions.Expression; import org.apache.lucene.index.Term; import org.apache.lucene.search.Query; -import org.opensearch.common.ParseField; +import org.opensearch.core.ParseField; import org.opensearch.common.ParsingException; import org.opensearch.common.io.stream.NamedWriteable; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.XContentBuilder; -import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.core.xcontent.ObjectParser; +import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentParser; import org.opensearch.index.mapper.MappedFieldType; import org.opensearch.index.query.AbstractQueryBuilder; import org.opensearch.index.query.QueryShardContext; diff --git a/src/test/java/com/o19s/es/ltr/LtrTestUtils.java b/src/test/java/com/o19s/es/ltr/LtrTestUtils.java index c6cfd94c..766f2942 100644 --- a/src/test/java/com/o19s/es/ltr/LtrTestUtils.java +++ b/src/test/java/com/o19s/es/ltr/LtrTestUtils.java @@ -39,7 +39,7 @@ import org.apache.lucene.tests.util.TestUtil; import org.opensearch.common.CheckedFunction; import org.opensearch.common.Strings; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.json.JsonXContent; import org.opensearch.index.query.WrapperQueryBuilder; diff --git a/src/test/java/com/o19s/es/ltr/feature/store/StoredFeatureParserTests.java b/src/test/java/com/o19s/es/ltr/feature/store/StoredFeatureParserTests.java index 86bcd36b..88f5ec61 100644 --- a/src/test/java/com/o19s/es/ltr/feature/store/StoredFeatureParserTests.java +++ b/src/test/java/com/o19s/es/ltr/feature/store/StoredFeatureParserTests.java @@ -20,8 +20,8 @@ import org.opensearch.common.ParsingException; import org.opensearch.common.Strings; import org.opensearch.common.xcontent.LoggingDeprecationHandler; -import org.opensearch.common.xcontent.ToXContent; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.ToXContent; +import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.index.query.AbstractQueryBuilder; @@ -31,7 +31,7 @@ import java.io.IOException; import java.util.Arrays; -import static org.opensearch.common.xcontent.NamedXContentRegistry.EMPTY; +import static org.opensearch.core.xcontent.NamedXContentRegistry.EMPTY; import static org.opensearch.common.xcontent.json.JsonXContent.jsonXContent; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.containsString; @@ -255,6 +255,6 @@ static StoredFeature parse(String featureString, String defaultName) throws IOEx } private String writeAsNonFormattedString(AbstractQueryBuilder builder) { - return Strings.toString(builder, false, false); + return Strings.toString(XContentType.JSON, builder, false, false); } -} \ No newline at end of file +} diff --git a/src/test/java/com/o19s/es/ltr/feature/store/StoredFeatureSetParserTests.java b/src/test/java/com/o19s/es/ltr/feature/store/StoredFeatureSetParserTests.java index d4815d3f..3ceac675 100644 --- a/src/test/java/com/o19s/es/ltr/feature/store/StoredFeatureSetParserTests.java +++ b/src/test/java/com/o19s/es/ltr/feature/store/StoredFeatureSetParserTests.java @@ -22,8 +22,8 @@ import org.opensearch.common.ParsingException; import org.opensearch.common.Strings; import org.opensearch.common.xcontent.LoggingDeprecationHandler; -import org.opensearch.common.xcontent.ToXContent; -import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.core.xcontent.ToXContent; +import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.index.query.MatchQueryBuilder; @@ -39,7 +39,7 @@ import static org.apache.lucene.tests.util.TestUtil.randomRealisticUnicodeString; import static org.apache.lucene.tests.util.TestUtil.randomSimpleString; -import static org.opensearch.common.xcontent.NamedXContentRegistry.EMPTY; +import static org.opensearch.core.xcontent.NamedXContentRegistry.EMPTY; import static org.opensearch.common.xcontent.json.JsonXContent.jsonXContent; import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.containsString; @@ -304,4 +304,4 @@ public static String generateRandomFeatureSet(String name, Consumer