From 86f8dd65a45810ae671ee1f607a2d5287649d66b Mon Sep 17 00:00:00 2001 From: Nick Knize Date: Wed, 11 May 2022 12:52:28 -0500 Subject: [PATCH 01/20] [Javadocs] add to internal classes in o.o.http, indices, and search (#3288) Adds javadocs to internal classes in org.opensearch.http, indices, and search packages. Signed-off-by: Nicholas Walter Knize --- .../src/main/java/org/opensearch/Build.java | 5 ++ .../java/org/opensearch/http/CorsHandler.java | 5 ++ .../java/org/opensearch/http/HttpRequest.java | 5 ++ .../indices/IndexingMemoryController.java | 5 ++ .../opensearch/indices/IndicesQueryCache.java | 10 +++ .../indices/IndicesRequestCache.java | 10 +++ .../opensearch/indices/IndicesService.java | 17 +++++ .../opensearch/indices/NodeIndicesStats.java | 5 ++ .../analysis/PreBuiltCacheFactory.java | 11 +++ .../breaker/AllCircuitBreakerStats.java | 5 ++ .../indices/breaker/CircuitBreakerStats.java | 5 ++ .../HierarchyCircuitBreakerService.java | 10 +++ .../cluster/IndicesClusterStateService.java | 20 ++++++ .../cache/IndicesFieldDataCache.java | 12 ++++ .../indices/recovery/MultiChunkTransfer.java | 10 +++ .../indices/recovery/MultiFileWriter.java | 5 ++ .../recovery/PeerRecoverySourceService.java | 5 ++ .../recovery/PeerRecoveryTargetService.java | 10 +++ .../recovery/RecoveriesCollection.java | 2 + .../recovery/RecoverySourceHandler.java | 20 ++++++ .../indices/recovery/RecoveryState.java | 20 ++++++ .../common/ReplicationLuceneIndex.java | 12 ++++ .../indices/store/IndicesStore.java | 10 +++ .../TransportNodesListShardStoreMetadata.java | 30 ++++++++ .../org/opensearch/search/DocValueFormat.java | 10 +++ .../java/org/opensearch/search/SearchHit.java | 7 ++ .../org/opensearch/search/SearchHits.java | 5 ++ .../org/opensearch/search/SearchService.java | 5 ++ .../aggregations/AggregationBuilder.java | 8 ++- .../search/aggregations/Aggregator.java | 10 ++- .../aggregations/AggregatorFactories.java | 2 + .../aggregations/CardinalityUpperBound.java | 2 + .../aggregations/InternalAggregation.java | 7 ++ .../aggregations/InternalAggregations.java | 5 ++ .../InternalMultiBucketAggregation.java | 5 ++ .../search/aggregations/InternalOrder.java | 10 +++ .../aggregations/MultiBucketCollector.java | 5 ++ .../MultiBucketConsumerService.java | 7 ++ .../ParsedMultiBucketAggregation.java | 5 ++ .../PipelineAggregationBuilder.java | 15 ++++ .../bucket/BestBucketsDeferringCollector.java | 5 ++ .../bucket/BucketsAggregator.java | 20 ++++++ .../bucket/DeferringBucketCollector.java | 5 ++ .../adjacency/AdjacencyMatrixAggregator.java | 5 ++ .../adjacency/InternalAdjacencyMatrix.java | 6 ++ .../adjacency/ParsedAdjacencyMatrix.java | 5 ++ .../composite/CompositeAggregation.java | 5 ++ .../bucket/composite/CompositeAggregator.java | 5 ++ .../CompositeValuesSourceConfig.java | 5 ++ .../DateHistogramValuesSourceBuilder.java | 5 ++ .../GeoTileGridValuesSourceBuilder.java | 5 ++ .../HistogramValuesSourceBuilder.java | 5 ++ .../bucket/composite/InternalComposite.java | 15 ++++ .../bucket/composite/ParsedComposite.java | 5 ++ .../composite/TermsValuesSourceBuilder.java | 6 +- .../bucket/filter/FiltersAggregator.java | 5 ++ .../bucket/filter/InternalFilters.java | 5 ++ .../bucket/filter/ParsedFilters.java | 5 ++ .../bucket/geogrid/CellIdSource.java | 2 + .../geogrid/GeoGridAggregationBuilder.java | 5 ++ .../AutoDateHistogramAggregationBuilder.java | 5 ++ .../AutoDateHistogramAggregator.java | 4 ++ .../bucket/histogram/DateIntervalWrapper.java | 5 ++ .../histogram/InternalAutoDateHistogram.java | 15 ++++ .../histogram/InternalDateHistogram.java | 10 +++ .../bucket/histogram/InternalHistogram.java | 10 +++ .../InternalVariableWidthHistogram.java | 15 ++++ .../histogram/ParsedAutoDateHistogram.java | 5 ++ .../bucket/histogram/ParsedDateHistogram.java | 5 ++ .../bucket/histogram/ParsedHistogram.java | 5 ++ .../ParsedVariableWidthHistogram.java | 5 ++ .../bucket/missing/InternalMissing.java | 5 ++ .../bucket/nested/NestedAggregator.java | 5 ++ .../nested/NestedAggregatorFactory.java | 5 ++ .../ReverseNestedAggregatorFactory.java | 5 ++ .../bucket/range/BinaryRangeAggregator.java | 15 ++++ .../range/GeoDistanceAggregationBuilder.java | 5 ++ .../GeoDistanceRangeAggregatorFactory.java | 5 ++ .../bucket/range/InternalBinaryRange.java | 5 ++ .../bucket/range/InternalDateRange.java | 10 +++ .../bucket/range/InternalGeoDistance.java | 10 +++ .../bucket/range/InternalRange.java | 10 +++ .../range/IpRangeAggregationBuilder.java | 5 ++ .../bucket/range/ParsedBinaryRange.java | 5 ++ .../bucket/range/ParsedDateRange.java | 5 ++ .../bucket/range/ParsedGeoDistance.java | 5 ++ .../bucket/range/ParsedRange.java | 5 ++ .../bucket/range/RangeAggregator.java | 10 +++ .../bucket/sampler/SamplerAggregator.java | 5 ++ .../bucket/terms/BytesKeyedBucketOrds.java | 6 ++ .../bucket/terms/DoubleTerms.java | 5 ++ .../GlobalOrdinalsStringTermsAggregator.java | 9 +++ .../bucket/terms/IncludeExclude.java | 59 ++++++++++++++-- .../bucket/terms/InternalMultiTerms.java | 4 ++ .../bucket/terms/InternalRareTerms.java | 7 ++ .../terms/InternalSignificantTerms.java | 7 ++ .../bucket/terms/InternalTerms.java | 12 ++++ .../bucket/terms/LongKeyedBucketOrds.java | 6 ++ .../bucket/terms/LongRareTerms.java | 5 ++ .../aggregations/bucket/terms/LongTerms.java | 5 ++ .../terms/MapStringTermsAggregator.java | 9 +++ .../terms/MultiTermsAggregationFactory.java | 5 ++ .../bucket/terms/MultiTermsAggregator.java | 4 ++ .../bucket/terms/ParsedDoubleTerms.java | 5 ++ .../bucket/terms/ParsedLongRareTerms.java | 5 ++ .../bucket/terms/ParsedLongTerms.java | 5 ++ .../bucket/terms/ParsedMultiTerms.java | 5 ++ .../bucket/terms/ParsedRareTerms.java | 5 ++ .../terms/ParsedSignificantLongTerms.java | 5 ++ .../terms/ParsedSignificantStringTerms.java | 5 ++ .../bucket/terms/ParsedSignificantTerms.java | 5 ++ .../bucket/terms/ParsedStringRareTerms.java | 5 ++ .../bucket/terms/ParsedStringTerms.java | 5 ++ .../bucket/terms/ParsedTerms.java | 5 ++ .../aggregations/bucket/terms/RareTerms.java | 2 + .../terms/RareTermsAggregatorFactory.java | 5 ++ .../bucket/terms/SignificantLongTerms.java | 5 ++ .../bucket/terms/SignificantStringTerms.java | 5 ++ .../bucket/terms/SignificantTerms.java | 5 ++ .../SignificantTermsAggregatorFactory.java | 5 ++ .../SignificantTextAggregatorFactory.java | 5 ++ .../bucket/terms/StringRareTerms.java | 5 ++ .../bucket/terms/StringTerms.java | 5 ++ .../aggregations/bucket/terms/Terms.java | 2 + .../bucket/terms/TermsAggregator.java | 5 ++ .../bucket/terms/TermsAggregatorFactory.java | 5 ++ .../bucket/terms/UnmappedRareTerms.java | 5 ++ .../terms/UnmappedSignificantTerms.java | 2 + .../bucket/terms/UnmappedTerms.java | 2 + .../bucket/terms/heuristic/ChiSquare.java | 5 ++ .../bucket/terms/heuristic/GND.java | 5 ++ .../bucket/terms/heuristic/JLHScore.java | 5 ++ .../terms/heuristic/MutualInformation.java | 5 ++ .../heuristic/NXYSignificanceHeuristic.java | 10 +++ .../terms/heuristic/PercentageScore.java | 5 ++ .../terms/heuristic/ScriptHeuristic.java | 13 +++- .../metrics/AbstractHyperLogLog.java | 6 +- .../metrics/AbstractLinearCounting.java | 6 +- .../metrics/CardinalityAggregator.java | 37 ++++++++++ .../aggregations/metrics/ExtendedStats.java | 5 ++ .../ExtendedStatsAggregatorProvider.java | 2 + .../metrics/HyperLogLogPlusPlus.java | 20 ++++++ .../metrics/HyperLogLogPlusPlusSparse.java | 10 +++ .../metrics/InternalExtendedStats.java | 10 +++ .../metrics/InternalGeoCentroid.java | 5 ++ .../metrics/InternalHDRPercentileRanks.java | 5 ++ .../metrics/InternalHDRPercentiles.java | 5 ++ .../InternalNumericMetricsAggregation.java | 10 +++ .../aggregations/metrics/InternalStats.java | 10 +++ .../InternalTDigestPercentileRanks.java | 5 ++ .../metrics/InternalTDigestPercentiles.java | 5 ++ .../metrics/NumericMetricsAggregation.java | 10 +++ .../metrics/NumericMetricsAggregator.java | 10 +++ .../metrics/PercentilesConfig.java | 10 +++ .../metrics/TopHitsAggregator.java | 5 ++ .../aggregations/pipeline/BucketHelpers.java | 2 + .../aggregations/pipeline/EwmaModel.java | 5 ++ .../pipeline/HoltLinearModel.java | 5 ++ .../pipeline/HoltWintersModel.java | 10 +++ .../pipeline/InternalPercentilesBucket.java | 5 ++ .../aggregations/pipeline/LinearModel.java | 5 ++ .../aggregations/pipeline/MovAvgModel.java | 2 + .../pipeline/MovingFunctionScript.java | 5 ++ .../pipeline/PipelineAggregator.java | 4 ++ .../aggregations/pipeline/SimpleModel.java | 5 ++ .../aggregations/support/AggregationPath.java | 5 ++ .../support/AggregationUsageService.java | 5 ++ .../BaseMultiValuesSourceFieldConfig.java | 5 ++ .../support/MultiTermsValuesSourceConfig.java | 10 +++ .../support/MultiValuesSource.java | 5 ++ .../MultiValuesSourceAggregationBuilder.java | 5 ++ .../support/MultiValuesSourceFieldConfig.java | 5 ++ .../aggregations/support/ValuesSource.java | 68 +++++++++++++++++++ .../ValuesSourceAggregationBuilder.java | 5 ++ .../support/ValuesSourceRegistry.java | 10 +++ .../search/builder/SearchSourceBuilder.java | 10 +++ .../search/fetch/FetchSubPhase.java | 5 ++ .../fetch/subphase/ScriptFieldsContext.java | 5 ++ .../subphase/highlight/HighlightBuilder.java | 15 ++++ .../subphase/highlight/HighlightUtils.java | 5 ++ .../highlight/SearchHighlightContext.java | 10 +++ .../opensearch/search/query/QueryPhase.java | 4 ++ .../search/rescore/QueryRescorer.java | 5 ++ .../opensearch/search/sort/BucketedSort.java | 24 +++++++ .../search/sort/ScriptSortBuilder.java | 5 ++ .../suggest/SuggestionSearchContext.java | 5 ++ .../completion/CompletionSuggestion.java | 10 +++ .../suggest/completion/FuzzyOptions.java | 2 + .../suggest/completion/RegexOptions.java | 2 + .../context/CategoryContextMapping.java | 2 + .../context/CategoryQueryContext.java | 5 ++ .../completion/context/ContextMapping.java | 10 +++ .../completion/context/GeoContextMapping.java | 5 ++ .../completion/context/GeoQueryContext.java | 5 ++ .../phrase/DirectCandidateGenerator.java | 15 ++++ .../suggest/phrase/PhraseSuggestion.java | 10 +++ .../phrase/PhraseSuggestionBuilder.java | 2 + .../search/suggest/phrase/WordScorer.java | 5 ++ .../search/suggest/term/TermSuggestion.java | 20 ++++-- .../suggest/term/TermSuggestionBuilder.java | 12 +++- 200 files changed, 1521 insertions(+), 18 deletions(-) diff --git a/server/src/main/java/org/opensearch/Build.java b/server/src/main/java/org/opensearch/Build.java index 1d21de6863eef..364b17ad4aa33 100644 --- a/server/src/main/java/org/opensearch/Build.java +++ b/server/src/main/java/org/opensearch/Build.java @@ -56,6 +56,11 @@ public class Build { */ public static final Build CURRENT; + /** + * The type of build + * + * @opensearch.internal + */ public enum Type { DEB("deb"), diff --git a/server/src/main/java/org/opensearch/http/CorsHandler.java b/server/src/main/java/org/opensearch/http/CorsHandler.java index 3a16c8f82e40c..fe6727b76ee28 100644 --- a/server/src/main/java/org/opensearch/http/CorsHandler.java +++ b/server/src/main/java/org/opensearch/http/CorsHandler.java @@ -261,6 +261,11 @@ private void setMaxAge(final HttpResponse response) { response.addHeader(ACCESS_CONTROL_MAX_AGE, Long.toString(config.maxAge)); } + /** + * The cors handler configuration + * + * @opensearch.internal + */ public static class Config { private final boolean enabled; diff --git a/server/src/main/java/org/opensearch/http/HttpRequest.java b/server/src/main/java/org/opensearch/http/HttpRequest.java index 83980c3539ddc..c78db0f40c9f0 100644 --- a/server/src/main/java/org/opensearch/http/HttpRequest.java +++ b/server/src/main/java/org/opensearch/http/HttpRequest.java @@ -49,6 +49,11 @@ */ public interface HttpRequest { + /** + * Which HTTP version being used + * + * @opensearch.internal + */ enum HttpVersion { HTTP_1_0, HTTP_1_1 diff --git a/server/src/main/java/org/opensearch/indices/IndexingMemoryController.java b/server/src/main/java/org/opensearch/indices/IndexingMemoryController.java index ae51a525765ba..611d348fb6791 100644 --- a/server/src/main/java/org/opensearch/indices/IndexingMemoryController.java +++ b/server/src/main/java/org/opensearch/indices/IndexingMemoryController.java @@ -260,6 +260,11 @@ private void recordOperationBytes(Engine.Operation operation, Engine.Result resu } } + /** + * The bytes used by a shard and a reference to the shard + * + * @opensearch.internal + */ private static final class ShardAndBytesUsed implements Comparable { final long bytesUsed; final IndexShard shard; diff --git a/server/src/main/java/org/opensearch/indices/IndicesQueryCache.java b/server/src/main/java/org/opensearch/indices/IndicesQueryCache.java index ce94d769f9c31..78970267f67c2 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesQueryCache.java +++ b/server/src/main/java/org/opensearch/indices/IndicesQueryCache.java @@ -216,6 +216,11 @@ public void close() { cache.clear(); } + /** + * Statistics for the indices query cache + * + * @opensearch.internal + */ private static class Stats implements Cloneable { final ShardId shardId; @@ -251,6 +256,11 @@ public String toString() { } } + /** + * Statistics and Counts + * + * @opensearch.internal + */ private static class StatsAndCount { volatile int count; final Stats stats; diff --git a/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java b/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java index 920d3492e0b62..151131e719dc1 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java +++ b/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java @@ -176,6 +176,11 @@ void invalidate(CacheEntity cacheEntity, DirectoryReader reader, BytesReference cache.invalidate(new Key(cacheEntity, reader.getReaderCacheHelper().getKey(), cacheKey)); } + /** + * Loader for the request cache + * + * @opensearch.internal + */ private static class Loader implements CacheLoader { private final CacheEntity entity; @@ -238,6 +243,11 @@ interface CacheEntity extends Accountable { void onRemoval(RemovalNotification notification); } + /** + * Unique key for the cache + * + * @opensearch.internal + */ static class Key implements Accountable { private static final long BASE_RAM_BYTES_USED = RamUsageEstimator.shallowSizeOfInstance(Key.class); diff --git a/server/src/main/java/org/opensearch/indices/IndicesService.java b/server/src/main/java/org/opensearch/indices/IndicesService.java index 87cd63119f1d4..b5da0ae1f7688 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesService.java +++ b/server/src/main/java/org/opensearch/indices/IndicesService.java @@ -913,6 +913,11 @@ public IndicesQueryCache getIndicesQueryCache() { return indicesQueryCache; } + /** + * Statistics for old shards + * + * @opensearch.internal + */ static class OldShardsStats implements IndexEventListener { final SearchStats searchStats = new SearchStats(); @@ -1236,6 +1241,11 @@ private void addPendingDelete(Index index, PendingDelete pendingDelete) { } } + /** + * A pending delete + * + * @opensearch.internal + */ private static final class PendingDelete implements Comparable { final Index index; final int shardId; @@ -1386,6 +1396,8 @@ public AnalysisRegistry getAnalysis() { * periodically. In this case it is the field data cache, because a cache that * has an entry invalidated may not clean up the entry if it is not read from * or written to after invalidation. + * + * @opensearch.internal */ private static final class CacheCleaner implements Runnable, Releasable { @@ -1574,6 +1586,11 @@ private BytesReference cacheShardLevelResult( return indicesRequestCache.getOrCompute(cacheEntity, supplier, reader, cacheKey); } + /** + * An item in the index shard cache + * + * @opensearch.internal + */ static final class IndexShardCacheEntity extends AbstractIndexShardCacheEntity { private static final long BASE_RAM_BYTES_USED = RamUsageEstimator.shallowSizeOfInstance(IndexShardCacheEntity.class); private final IndexShard indexShard; diff --git a/server/src/main/java/org/opensearch/indices/NodeIndicesStats.java b/server/src/main/java/org/opensearch/indices/NodeIndicesStats.java index b6eedb338b006..5771380023b83 100644 --- a/server/src/main/java/org/opensearch/indices/NodeIndicesStats.java +++ b/server/src/main/java/org/opensearch/indices/NodeIndicesStats.java @@ -271,6 +271,11 @@ public List getShardStats(Index index) { } } + /** + * Fields used for parsing and toXContent + * + * @opensearch.internal + */ static final class Fields { static final String INDICES = "indices"; } diff --git a/server/src/main/java/org/opensearch/indices/analysis/PreBuiltCacheFactory.java b/server/src/main/java/org/opensearch/indices/analysis/PreBuiltCacheFactory.java index 192301c7bd9cf..601bd79a24746 100644 --- a/server/src/main/java/org/opensearch/indices/analysis/PreBuiltCacheFactory.java +++ b/server/src/main/java/org/opensearch/indices/analysis/PreBuiltCacheFactory.java @@ -60,6 +60,11 @@ public enum CachingStrategy { OPENSEARCH } + /** + * The prebuilt cache + * + * @opensearch.internal + */ public interface PreBuiltCache { T get(Version version); @@ -86,6 +91,8 @@ public static PreBuiltCache getCache(CachingStrategy cachingStrategy) { /** * This is a pretty simple cache, it only contains one version + * + * @opensearch.internal */ private static class PreBuiltCacheStrategyOne implements PreBuiltCache { @@ -109,6 +116,8 @@ public Collection values() { /** * This cache contains one version for each opensearch version object + * + * @opensearch.internal */ private static class PreBuiltCacheStrategyOpenSearch implements PreBuiltCache { @@ -132,6 +141,8 @@ public Collection values() { /** * This cache uses the lucene version for caching + * + * @opensearch.internal */ private static class PreBuiltCacheStrategyLucene implements PreBuiltCache { diff --git a/server/src/main/java/org/opensearch/indices/breaker/AllCircuitBreakerStats.java b/server/src/main/java/org/opensearch/indices/breaker/AllCircuitBreakerStats.java index 01284d42a3cf9..0ecb3833fd066 100644 --- a/server/src/main/java/org/opensearch/indices/breaker/AllCircuitBreakerStats.java +++ b/server/src/main/java/org/opensearch/indices/breaker/AllCircuitBreakerStats.java @@ -87,6 +87,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields used for parsing and toXContent + * + * @opensearch.internal + */ static final class Fields { static final String BREAKERS = "breakers"; } diff --git a/server/src/main/java/org/opensearch/indices/breaker/CircuitBreakerStats.java b/server/src/main/java/org/opensearch/indices/breaker/CircuitBreakerStats.java index 64bf4c16a6059..ab06cfaacd115 100644 --- a/server/src/main/java/org/opensearch/indices/breaker/CircuitBreakerStats.java +++ b/server/src/main/java/org/opensearch/indices/breaker/CircuitBreakerStats.java @@ -132,6 +132,11 @@ public String toString() { + "]"; } + /** + * Fields used for statistics + * + * @opensearch.internal + */ static final class Fields { static final String LIMIT = "limit_size_in_bytes"; static final String LIMIT_HUMAN = "limit_size"; diff --git a/server/src/main/java/org/opensearch/indices/breaker/HierarchyCircuitBreakerService.java b/server/src/main/java/org/opensearch/indices/breaker/HierarchyCircuitBreakerService.java index 02d1e1a76f3f1..c0056aab3fb16 100644 --- a/server/src/main/java/org/opensearch/indices/breaker/HierarchyCircuitBreakerService.java +++ b/server/src/main/java/org/opensearch/indices/breaker/HierarchyCircuitBreakerService.java @@ -341,6 +341,11 @@ public CircuitBreakerStats stats(String name) { ); } + /** + * Tracks memory usage + * + * @opensearch.internal + */ static class MemoryUsage { final long baseUsage; final long totalUsage; @@ -505,6 +510,11 @@ interface OverLimitStrategy { MemoryUsage overLimit(MemoryUsage memoryUsed); } + /** + * Kicks in G1GC if heap gets too high + * + * @opensearch.internal + */ static class G1OverLimitStrategy implements OverLimitStrategy { private final long g1RegionSize; private final LongSupplier currentMemoryUsageSupplier; diff --git a/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java b/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java index b891784c81d1c..29f74f8a86d85 100644 --- a/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java +++ b/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java @@ -846,6 +846,11 @@ public void accept(final IndexShard.ShardFailure shardFailure) { } } + /** + * A shard + * + * @opensearch.internal + */ public interface Shard { /** @@ -894,6 +899,11 @@ void updateShardState( ) throws IOException; } + /** + * An allocated index + * + * @opensearch.internal + */ public interface AllocatedIndex extends Iterable, IndexComponent { /** @@ -926,6 +936,11 @@ public interface AllocatedIndex extends Iterable, IndexCompo void removeShard(int shardId, String message); } + /** + * Allocated indices + * + * @opensearch.internal + */ public interface AllocatedIndices> extends Iterable { /** @@ -1012,6 +1027,11 @@ default T getShardOrNull(ShardId shardId) { void processPendingDeletes(Index index, IndexSettings indexSettings, TimeValue timeValue) throws IOException, InterruptedException, ShardLockObtainFailedException; + /** + * Why the index was removed + * + * @opensearch.internal + */ enum IndexRemovalReason { /** * Shard of this index were previously assigned to this node but all shards have been relocated. diff --git a/server/src/main/java/org/opensearch/indices/fielddata/cache/IndicesFieldDataCache.java b/server/src/main/java/org/opensearch/indices/fielddata/cache/IndicesFieldDataCache.java index 01e00fdc19899..1833ae8900a9a 100644 --- a/server/src/main/java/org/opensearch/indices/fielddata/cache/IndicesFieldDataCache.java +++ b/server/src/main/java/org/opensearch/indices/fielddata/cache/IndicesFieldDataCache.java @@ -125,6 +125,11 @@ public void onRemoval(RemovalNotification notification) { } } + /** + * Computes a weight based on ramBytesUsed + * + * @opensearch.internal + */ public static class FieldDataWeigher implements ToLongBiFunction { @Override public long applyAsLong(Key key, Accountable ramUsage) { @@ -135,6 +140,8 @@ public long applyAsLong(Key key, Accountable ramUsage) { /** * A specific cache instance for the relevant parameters of it (index, fieldNames, fieldType). + * + * @opensearch.internal */ static class IndexFieldCache implements IndexFieldDataCache, IndexReader.ClosedListener { private final Logger logger; @@ -242,6 +249,11 @@ public void clear(String fieldName) { } } + /** + * Key for the indices field data cache + * + * @opensearch.internal + */ public static class Key { public final IndexFieldCache indexCache; public final IndexReader.CacheKey readerKey; diff --git a/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java b/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java index 8a6aa0db26610..4cc75de7cd5d9 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java +++ b/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java @@ -211,6 +211,11 @@ protected void onNewResource(Source resource) throws IOException { protected abstract void handleError(Source resource, Exception e) throws Exception; + /** + * A file chunk item as the response + * + * @opensearch.internal + */ private static class FileChunkResponseItem { final long requestSeqId; final Source source; @@ -223,6 +228,11 @@ private static class FileChunkResponseItem { } } + /** + * A chunk request + * + * @opensearch.internal + */ public interface ChunkRequest { /** * @return {@code true} if this chunk request is the last chunk of the current file diff --git a/server/src/main/java/org/opensearch/indices/recovery/MultiFileWriter.java b/server/src/main/java/org/opensearch/indices/recovery/MultiFileWriter.java index 8ea9a85597837..3509615052707 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/MultiFileWriter.java +++ b/server/src/main/java/org/opensearch/indices/recovery/MultiFileWriter.java @@ -199,6 +199,11 @@ public void renameAllTempFiles() throws IOException { store.renameTempFilesSafe(tempFileNames); } + /** + * A file chunk + * + * @opensearch.internal + */ static final class FileChunk { final StoreFileMetadata md; final BytesReference content; diff --git a/server/src/main/java/org/opensearch/indices/recovery/PeerRecoverySourceService.java b/server/src/main/java/org/opensearch/indices/recovery/PeerRecoverySourceService.java index 1eb0fe2c1929d..a1cf78920cf7e 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/PeerRecoverySourceService.java +++ b/server/src/main/java/org/opensearch/indices/recovery/PeerRecoverySourceService.java @@ -79,6 +79,11 @@ public class PeerRecoverySourceService extends AbstractLifecycleComponent implem private static final Logger logger = LogManager.getLogger(PeerRecoverySourceService.class); + /** + * The internal actions + * + * @opensearch.internal + */ public static class Actions { public static final String START_RECOVERY = "internal:index/shard/recovery/start_recovery"; public static final String REESTABLISH_RECOVERY = "internal:index/shard/recovery/reestablish_recovery"; diff --git a/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryTargetService.java b/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryTargetService.java index a85925ff5cff4..4ae188abe5896 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryTargetService.java +++ b/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryTargetService.java @@ -102,6 +102,11 @@ public class PeerRecoveryTargetService implements IndexEventListener { private static final Logger logger = LogManager.getLogger(PeerRecoveryTargetService.class); + /** + * The internal actions + * + * @opensearch.internal + */ public static class Actions { public static final String FILES_INFO = "internal:index/shard/recovery/filesInfo"; public static final String FILE_CHUNK = "internal:index/shard/recovery/file_chunk"; @@ -340,6 +345,11 @@ public static StartRecoveryRequest getStartRecoveryRequest( return request; } + /** + * The recovery listener + * + * @opensearch.internal + */ public interface RecoveryListener { void onRecoveryDone(RecoveryState state); diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveriesCollection.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveriesCollection.java index 0312dfeec4eeb..38b72dd0f7dee 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveriesCollection.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveriesCollection.java @@ -274,6 +274,8 @@ public boolean cancelRecoveriesForShard(ShardId shardId, String reason) { * a reference to {@link RecoveryTarget}, which implements {@link AutoCloseable}. closing the reference * causes {@link RecoveryTarget#decRef()} to be called. This makes sure that the underlying resources * will not be freed until {@link RecoveryRef#close()} is called. + * + * @opensearch.internal */ public static class RecoveryRef extends AutoCloseableRefCounted { diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoverySourceHandler.java b/server/src/main/java/org/opensearch/indices/recovery/RecoverySourceHandler.java index fdbdbf4c688e2..0870fd4ca9295 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoverySourceHandler.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoverySourceHandler.java @@ -498,6 +498,11 @@ private void runWithGenericThreadPool(CheckedRunnable task) { FutureUtils.get(future); } + /** + * A send file result + * + * @opensearch.internal + */ static final class SendFileResult { final List phase1FileNames; final List phase1FileSizes; @@ -853,6 +858,11 @@ void phase2( sender.start(); } + /** + * An operation chunk request + * + * @opensearch.internal + */ private static class OperationChunkRequest implements MultiChunkTransfer.ChunkRequest { final List operations; final boolean lastChunk; @@ -1009,6 +1019,11 @@ void finalizeRecovery(long targetLocalCheckpoint, long trimAboveSeqNo, ActionLis }, listener::onFailure); } + /** + * A result for a send snapshot + * + * @opensearch.internal + */ static final class SendSnapshotResult { final long targetLocalCheckpoint; final int sentOperations; @@ -1041,6 +1056,11 @@ public String toString() { + '}'; } + /** + * A file chunk from the recovery source + * + * @opensearch.internal + */ private static class FileChunk implements MultiChunkTransfer.ChunkRequest, Releasable { final StoreFileMetadata md; final BytesReference content; diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryState.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryState.java index edca0aaa2124a..35ac5cbc12bde 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryState.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryState.java @@ -58,6 +58,11 @@ */ public class RecoveryState implements ToXContentFragment, Writeable { + /** + * The stage of the recovery state + * + * @opensearch.internal + */ public enum Stage { INIT((byte) 0), @@ -328,6 +333,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields used in the recovery state + * + * @opensearch.internal + */ static final class Fields { static final String ID = "id"; static final String TYPE = "type"; @@ -356,6 +366,11 @@ static final class Fields { static final String PERCENT = "percent"; } + /** + * Verifys the lucene index + * + * @opensearch.internal + */ public static class VerifyIndex extends ReplicationTimer implements ToXContentFragment, Writeable { private volatile long checkIndexTime; @@ -393,6 +408,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } + /** + * The translog + * + * @opensearch.internal + */ public static class Translog extends ReplicationTimer implements ToXContentFragment, Writeable { public static final int UNKNOWN = -1; diff --git a/server/src/main/java/org/opensearch/indices/replication/common/ReplicationLuceneIndex.java b/server/src/main/java/org/opensearch/indices/replication/common/ReplicationLuceneIndex.java index ee8919d0dc9c4..d1066b867f982 100644 --- a/server/src/main/java/org/opensearch/indices/replication/common/ReplicationLuceneIndex.java +++ b/server/src/main/java/org/opensearch/indices/replication/common/ReplicationLuceneIndex.java @@ -307,6 +307,11 @@ public synchronized FileMetadata getFileDetails(String dest) { return filesDetails.get(dest); } + /** + * Details about the files + * + * @opensearch.internal + */ private static final class FilesDetails implements ToXContentFragment, Writeable { protected final Map fileMetadataMap = new HashMap<>(); protected boolean complete; @@ -397,6 +402,11 @@ public boolean isComplete() { } } + /** + * Metadata about a file + * + * @opensearch.internal + */ public static final class FileMetadata implements ToXContentObject, Writeable { private String name; private long length; @@ -500,6 +510,8 @@ public String toString() { /** * Duplicates many of Field names in {@link RecoveryState} + * + * @opensearch.internal */ static final class Fields { static final String TOTAL_TIME = "total_time"; diff --git a/server/src/main/java/org/opensearch/indices/store/IndicesStore.java b/server/src/main/java/org/opensearch/indices/store/IndicesStore.java index 11442632246b6..96e84fb69b573 100644 --- a/server/src/main/java/org/opensearch/indices/store/IndicesStore.java +++ b/server/src/main/java/org/opensearch/indices/store/IndicesStore.java @@ -452,6 +452,11 @@ private IndexShard getShard(ShardActiveRequest request) { } + /** + * A shard active request + * + * @opensearch.internal + */ private static class ShardActiveRequest extends TransportRequest { protected TimeValue timeout = null; private ClusterName clusterName; @@ -483,6 +488,11 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * The shard active response + * + * @opensearch.internal + */ private static class ShardActiveResponse extends TransportResponse { private final boolean shardActive; diff --git a/server/src/main/java/org/opensearch/indices/store/TransportNodesListShardStoreMetadata.java b/server/src/main/java/org/opensearch/indices/store/TransportNodesListShardStoreMetadata.java index 538a8c871cb5f..b49cdcd127962 100644 --- a/server/src/main/java/org/opensearch/indices/store/TransportNodesListShardStoreMetadata.java +++ b/server/src/main/java/org/opensearch/indices/store/TransportNodesListShardStoreMetadata.java @@ -77,6 +77,11 @@ import java.util.Objects; import java.util.concurrent.TimeUnit; +/** + * Metadata for shard stores from a list of transport nodes + * + * @opensearch.internal + */ public class TransportNodesListShardStoreMetadata extends TransportNodesAction< TransportNodesListShardStoreMetadata.Request, TransportNodesListShardStoreMetadata.NodesStoreFilesMetadata, @@ -225,6 +230,11 @@ private StoreFilesMetadata listStoreMetadata(NodeRequest request) throws IOExcep } } + /** + * Metadata for store files + * + * @opensearch.internal + */ public static class StoreFilesMetadata implements Iterable, Writeable { private final ShardId shardId; private final Store.MetadataSnapshot metadataSnapshot; @@ -318,6 +328,11 @@ public String toString() { } } + /** + * The request + * + * @opensearch.internal + */ public static class Request extends BaseNodesRequest { private final ShardId shardId; @@ -364,6 +379,11 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * Metadata for the nodes store files + * + * @opensearch.internal + */ public static class NodesStoreFilesMetadata extends BaseNodesResponse { public NodesStoreFilesMetadata(StreamInput in) throws IOException { @@ -385,6 +405,11 @@ protected void writeNodesTo(StreamOutput out, List nodes } } + /** + * The node request + * + * @opensearch.internal + */ public static class NodeRequest extends BaseNodeRequest { private final ShardId shardId; @@ -431,6 +456,11 @@ public String getCustomDataPath() { } } + /** + * The metadata for the node store files + * + * @opensearch.internal + */ public static class NodeStoreFilesMetadata extends BaseNodeResponse { private StoreFilesMetadata storeFilesMetadata; diff --git a/server/src/main/java/org/opensearch/search/DocValueFormat.java b/server/src/main/java/org/opensearch/search/DocValueFormat.java index 5c8bcfb4dcf7c..7e7e4f83334f5 100644 --- a/server/src/main/java/org/opensearch/search/DocValueFormat.java +++ b/server/src/main/java/org/opensearch/search/DocValueFormat.java @@ -201,6 +201,11 @@ static DocValueFormat withNanosecondResolution(final DocValueFormat format) { } } + /** + * Date time doc value format + * + * @opensearch.internal + */ final class DateTime implements DocValueFormat { public static final String NAME = "date_time"; @@ -406,6 +411,11 @@ public String toString() { } }; + /** + * Decimal doc value format + * + * @opensearch.internal + */ final class Decimal implements DocValueFormat { public static final String NAME = "decimal"; diff --git a/server/src/main/java/org/opensearch/search/SearchHit.java b/server/src/main/java/org/opensearch/search/SearchHit.java index 8297ae0798e7d..89eeddb07ce5d 100644 --- a/server/src/main/java/org/opensearch/search/SearchHit.java +++ b/server/src/main/java/org/opensearch/search/SearchHit.java @@ -590,6 +590,11 @@ public void setInnerHits(Map innerHits) { this.innerHits = innerHits; } + /** + * Fields in a search hit used for parsing and toXContent + * + * @opensearch.internal + */ public static class Fields { static final String _INDEX = "_index"; static final String _ID = "_id"; @@ -1000,6 +1005,8 @@ public int hashCode() { /** * Encapsulates the nested identity of a hit. + * + * @opensearch.internal */ public static final class NestedIdentity implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/search/SearchHits.java b/server/src/main/java/org/opensearch/search/SearchHits.java index 67198608e7d9e..c4bb0ca3a1137 100644 --- a/server/src/main/java/org/opensearch/search/SearchHits.java +++ b/server/src/main/java/org/opensearch/search/SearchHits.java @@ -201,6 +201,11 @@ public Iterator iterator() { return Arrays.stream(getHits()).iterator(); } + /** + * Fields for parsing and toXContent + * + * @opensearch.internal + */ public static final class Fields { public static final String HITS = "hits"; public static final String TOTAL = "total"; diff --git a/server/src/main/java/org/opensearch/search/SearchService.java b/server/src/main/java/org/opensearch/search/SearchService.java index 9b2e1e3168344..3b24d52bebe53 100644 --- a/server/src/main/java/org/opensearch/search/SearchService.java +++ b/server/src/main/java/org/opensearch/search/SearchService.java @@ -1418,6 +1418,11 @@ private static PipelineTree requestToPipelineTree(SearchRequest request) { return request.source().aggregations().buildPipelineTree(); } + /** + * Search phase result that can match a response + * + * @opensearch.internal + */ public static final class CanMatchResponse extends SearchPhaseResult { private final boolean canMatch; private final MinAndMax estimatedMinAndMax; diff --git a/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilder.java index 5c76f0cc091c3..f5f11834b4484 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilder.java @@ -166,6 +166,8 @@ public PipelineTree buildPipelineTree() { *

* Unlike {@link CardinalityUpperBound} which is total * instead of per parent bucket. + * + * @opensearch.internal */ public enum BucketCardinality { NONE, @@ -179,7 +181,11 @@ public enum BucketCardinality { */ public abstract BucketCardinality bucketCardinality(); - /** Common xcontent fields shared among aggregator builders */ + /** + * Common xcontent fields shared among aggregator builders + * + * @opensearch.internal + */ public static final class CommonFields extends ParseField.CommonFields { public static final ParseField VALUE_TYPE = new ParseField("value_type"); } diff --git a/server/src/main/java/org/opensearch/search/aggregations/Aggregator.java b/server/src/main/java/org/opensearch/search/aggregations/Aggregator.java index 99a54bbdc27b0..c1aa0965b0328 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/Aggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/Aggregator.java @@ -63,6 +63,8 @@ public abstract class Aggregator extends BucketCollector implements Releasable { * Parses the aggregation request and creates the appropriate aggregator factory for it. * * @see AggregationBuilder + * + * @opensearch.internal */ @FunctionalInterface public interface Parser { @@ -157,6 +159,8 @@ public BucketComparator bucketComparator(String key, SortOrder order) { /** * Compare two buckets by their ordinal. + * + * @opensearch.internal */ @FunctionalInterface public interface BucketComparator { @@ -204,7 +208,11 @@ public final InternalAggregation buildTopLevel() throws IOException { */ public void collectDebugInfo(BiConsumer add) {} - /** Aggregation mode for sub aggregations. */ + /** + * Aggregation mode for sub aggregations. + * + * @opensearch.internal + */ public enum SubAggCollectionMode implements Writeable { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/AggregatorFactories.java b/server/src/main/java/org/opensearch/search/aggregations/AggregatorFactories.java index ec536578f7251..75e887fbe0d0a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/AggregatorFactories.java +++ b/server/src/main/java/org/opensearch/search/aggregations/AggregatorFactories.java @@ -295,6 +295,8 @@ public int countAggregators() { /** * A mutable collection of {@link AggregationBuilder}s and * {@link PipelineAggregationBuilder}s. + * + * @opensearch.internal */ public static class Builder implements Writeable, ToXContentObject { private final Set names = new HashSet<>(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/CardinalityUpperBound.java b/server/src/main/java/org/opensearch/search/aggregations/CardinalityUpperBound.java index 7596cf471c4a3..15beeac82930a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/CardinalityUpperBound.java +++ b/server/src/main/java/org/opensearch/search/aggregations/CardinalityUpperBound.java @@ -113,6 +113,8 @@ private CardinalityUpperBound() { /** * Cardinality estimate with a known upper bound. + * + * @opensearch.internal */ private static class KnownCardinalityUpperBound extends CardinalityUpperBound { private final int estimate; diff --git a/server/src/main/java/org/opensearch/search/aggregations/InternalAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/InternalAggregation.java index 55c400218b06b..6ccd429388873 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/InternalAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/InternalAggregation.java @@ -64,6 +64,8 @@ public abstract class InternalAggregation implements Aggregation, NamedWriteable { /** * Builds {@link ReduceContext}. + * + * @opensearch.internal */ public interface ReduceContextBuilder { /** @@ -77,6 +79,11 @@ public interface ReduceContextBuilder { ReduceContext forFinalReduction(); } + /** + * The reduce context + * + * @opensearch.internal + */ public static class ReduceContext { private final BigArrays bigArrays; private final ScriptService scriptService; diff --git a/server/src/main/java/org/opensearch/search/aggregations/InternalAggregations.java b/server/src/main/java/org/opensearch/search/aggregations/InternalAggregations.java index fb8fb18598dac..79dd8d756dede 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/InternalAggregations.java +++ b/server/src/main/java/org/opensearch/search/aggregations/InternalAggregations.java @@ -304,6 +304,11 @@ public long getSerializedSize() { } } + /** + * A counting stream output + * + * @opensearch.internal + */ private static class CountingStreamOutput extends StreamOutput { long size = 0; diff --git a/server/src/main/java/org/opensearch/search/aggregations/InternalMultiBucketAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/InternalMultiBucketAggregation.java index b519334e6f92e..c191507cf991f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/InternalMultiBucketAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/InternalMultiBucketAggregation.java @@ -223,6 +223,11 @@ private List reducePipelineBuckets(ReduceContext reduceContext, PipelineTree return reducedBuckets; } + /** + * An internal buck for the internal multibucket agg + * + * @opensearch.internal + */ public abstract static class InternalBucket implements Bucket, Writeable { public Object getProperty(String containingAggName, List path) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/InternalOrder.java b/server/src/main/java/org/opensearch/search/aggregations/InternalOrder.java index 491e08bc847d1..ba1c6eea049c9 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/InternalOrder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/InternalOrder.java @@ -65,6 +65,8 @@ public abstract class InternalOrder extends BucketOrder { // TODO merge the contents of this file into BucketOrder. The way it is now is relic. /** * {@link Bucket} ordering strategy to sort by a sub-aggregation. + * + * @opensearch.internal */ public static class Aggregation extends InternalOrder { static final byte ID = 0; @@ -133,6 +135,8 @@ public boolean equals(Object obj) { /** * {@link Bucket} ordering strategy to sort by multiple criteria. + * + * @opensearch.internal */ public static class CompoundOrder extends BucketOrder { @@ -244,6 +248,8 @@ public boolean equals(Object obj) { * {@link BucketOrder} implementation for simple, fixed orders like * {@link InternalOrder#COUNT_ASC}. Complex implementations should not * use this. + * + * @opensearch.internal */ private static class SimpleOrder extends InternalOrder { private final byte id; @@ -405,6 +411,8 @@ private static boolean isOrder(BucketOrder order, BucketOrder expected) { /** * Contains logic for reading/writing {@link BucketOrder} from/to streams. + * + * @opensearch.internal */ public static class Streams { @@ -493,6 +501,8 @@ public static void writeHistogramOrder(BucketOrder order, StreamOutput out, bool /** * Contains logic for parsing a {@link BucketOrder} from a {@link XContentParser}. + * + * @opensearch.internal */ public static class Parser { diff --git a/server/src/main/java/org/opensearch/search/aggregations/MultiBucketCollector.java b/server/src/main/java/org/opensearch/search/aggregations/MultiBucketCollector.java index 80c7b37624fa5..8f7222729efdb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/MultiBucketCollector.java +++ b/server/src/main/java/org/opensearch/search/aggregations/MultiBucketCollector.java @@ -176,6 +176,11 @@ public LeafBucketCollector getLeafCollector(LeafReaderContext context) throws IO } } + /** + * A multi leaf bucket collector + * + * @opensearch.internal + */ private static class MultiLeafBucketCollector extends LeafBucketCollector { private final boolean cacheScores; diff --git a/server/src/main/java/org/opensearch/search/aggregations/MultiBucketConsumerService.java b/server/src/main/java/org/opensearch/search/aggregations/MultiBucketConsumerService.java index d7c1796b1715f..ec1729a0f5180 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/MultiBucketConsumerService.java +++ b/server/src/main/java/org/opensearch/search/aggregations/MultiBucketConsumerService.java @@ -76,6 +76,11 @@ private void setMaxBucket(int maxBucket) { this.maxBucket = maxBucket; } + /** + * Thrown when there are too many buckets + * + * @opensearch.internal + */ public static class TooManyBucketsException extends AggregationExecutionException { private final int maxBuckets; @@ -115,6 +120,8 @@ protected void metadataToXContent(XContentBuilder builder, Params params) throws * when the sum of the provided values is above the limit (`search.max_buckets`). * It is used by aggregators to limit the number of bucket creation during * {@link Aggregator#buildAggregations} and {@link InternalAggregation#reduce}. + * + * @opensearch.internal */ public static class MultiBucketConsumer implements IntConsumer { private final int limit; diff --git a/server/src/main/java/org/opensearch/search/aggregations/ParsedMultiBucketAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/ParsedMultiBucketAggregation.java index 6258295a2b733..d3997598baf08 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/ParsedMultiBucketAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/ParsedMultiBucketAggregation.java @@ -99,6 +99,11 @@ protected static void declareMultiBucketAggregationFields( }, CommonFields.BUCKETS, ObjectParser.ValueType.OBJECT_ARRAY); } + /** + * A parsed bucket + * + * @opensearch.internal + */ public abstract static class ParsedBucket implements MultiBucketsAggregation.Bucket { private Aggregations aggregations; diff --git a/server/src/main/java/org/opensearch/search/aggregations/PipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/PipelineAggregationBuilder.java index 6aba50ec912d8..dea7455c2e975 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/PipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/PipelineAggregationBuilder.java @@ -97,6 +97,11 @@ public final String[] getBucketsPaths() { */ protected abstract void validate(ValidationContext context); + /** + * The context used for validation + * + * @opensearch.internal + */ public abstract static class ValidationContext { /** * Build the context for the root of the aggregation tree. @@ -122,6 +127,11 @@ private ValidationContext(ActionRequestValidationException validationFailuresSoF this.e = validationFailuresSoFar; } + /** + * The root of the tree + * + * @opensearch.internal + */ private static class ForTreeRoot extends ValidationContext { private final Collection siblingAggregations; private final Collection siblingPipelineAggregations; @@ -162,6 +172,11 @@ public void validateParentAggSequentiallyOrdered(String type, String name) { } } + /** + * The internal tree node + * + * @opensearch.internal + */ private static class ForInsideTree extends ValidationContext { private final AggregationBuilder parent; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/BestBucketsDeferringCollector.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/BestBucketsDeferringCollector.java index f3addc9522a94..2e7c4659bcb00 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/BestBucketsDeferringCollector.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/BestBucketsDeferringCollector.java @@ -65,6 +65,11 @@ * @opensearch.internal */ public class BestBucketsDeferringCollector extends DeferringBucketCollector { + /** + * Entry in the bucket collector + * + * @opensearch.internal + */ static class Entry { final LeafReaderContext context; final PackedLongValues docDeltas; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/BucketsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/BucketsAggregator.java index 9e35a2745fc90..79512586d06de 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/BucketsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/BucketsAggregator.java @@ -330,6 +330,11 @@ protected final InternalAggregation[] buildAggregationsForFixedBucketCount( return results; } + /** + * A bucket builder for a fixed count + * + * @opensearch.internal + */ @FunctionalInterface protected interface BucketBuilderForFixedCount { B build(int offsetInOwningOrd, int docCount, InternalAggregations subAggregationResults); @@ -355,6 +360,11 @@ protected final InternalAggregation[] buildAggregationsForSingleBucket(long[] ow return results; } + /** + * A single bucket result builder + * + * @opensearch.internal + */ @FunctionalInterface protected interface SingleBucketResultBuilder { InternalAggregation build(long owningBucketOrd, InternalAggregations subAggregationResults); @@ -415,11 +425,21 @@ protected final InternalAggregation[] buildAggregationsForVariableBuckets( return results; } + /** + * A bucket builder for a variable + * + * @opensearch.internal + */ @FunctionalInterface protected interface BucketBuilderForVariable { B build(long bucketValue, int docCount, InternalAggregations subAggregationResults); } + /** + * A result builder for a bucket variable + * + * @opensearch.internal + */ @FunctionalInterface protected interface ResultBuilderForVariable { InternalAggregation build(long owninigBucketOrd, List buckets); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/DeferringBucketCollector.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/DeferringBucketCollector.java index d11fcfd104af1..cfac1046c77b4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/DeferringBucketCollector.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/DeferringBucketCollector.java @@ -72,6 +72,11 @@ public Aggregator wrap(final Aggregator in) { return new WrappedAggregator(in); } + /** + * A wrapped aggregator + * + * @opensearch.internal + */ protected class WrappedAggregator extends Aggregator { private Aggregator in; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregator.java index 1cae870a378a5..c33887878dbd6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregator.java @@ -72,6 +72,11 @@ public class AdjacencyMatrixAggregator extends BucketsAggregator { public static final ParseField FILTERS_FIELD = new ParseField("filters"); + /** + * A keyed filter + * + * @opensearch.internal + */ protected static class KeyedFilter implements Writeable, ToXContentFragment { private final String key; private final QueryBuilder filter; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/InternalAdjacencyMatrix.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/InternalAdjacencyMatrix.java index 52a8d638d8e1d..d3920b3e5151d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/InternalAdjacencyMatrix.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/InternalAdjacencyMatrix.java @@ -56,6 +56,12 @@ public class InternalAdjacencyMatrix extends InternalMultiBucketAggregation implements AdjacencyMatrix { + + /** + * An internal bucket of the adjacency matrix + * + * @opensearch.internal + */ public static class InternalBucket extends InternalMultiBucketAggregation.InternalBucket implements AdjacencyMatrix.Bucket { private final String key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/ParsedAdjacencyMatrix.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/ParsedAdjacencyMatrix.java index f211c072cbd1f..0a9ae67e29f65 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/ParsedAdjacencyMatrix.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/ParsedAdjacencyMatrix.java @@ -90,6 +90,11 @@ public static ParsedAdjacencyMatrix fromXContent(XContentParser parser, String n return aggregation; } + /** + * A parsed bucket + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedMultiBucketAggregation.ParsedBucket implements AdjacencyMatrix.Bucket { private String key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregation.java index 06ec7f8b1baf7..48374499d0e5c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregation.java @@ -45,6 +45,11 @@ * @opensearch.internal */ public interface CompositeAggregation extends MultiBucketsAggregation { + /** + * Bucket in a composite agg + * + * @opensearch.internal + */ interface Bucket extends MultiBucketsAggregation.Bucket { Map getKey(); } diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregator.java index 94fc48708c41f..a907d17a731fe 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregator.java @@ -577,6 +577,11 @@ public void collect(int doc, long zeroBucket) throws IOException { }; } + /** + * An entry in the composite aggregator + * + * @opensearch.internal + */ private static class Entry { final LeafReaderContext context; final DocIdSet docIdSet; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceConfig.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceConfig.java index c85099976b297..f26fc2144c9b6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceConfig.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceConfig.java @@ -50,6 +50,11 @@ */ public class CompositeValuesSourceConfig { + /** + * A single dimension provider + * + * @opensearch.internal + */ @FunctionalInterface public interface SingleDimensionValuesSourceProvider { SingleDimensionValuesSource createValuesSource( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java index ece8f506cbc4d..1d3a96e66885b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java @@ -75,6 +75,11 @@ public class DateHistogramValuesSourceBuilder extends CompositeValuesSourceBuilder implements DateIntervalConsumer { + /** + * Supplier for a composite date histogram + * + * @opensearch.internal + */ @FunctionalInterface public interface DateHistogramCompositeSupplier { CompositeValuesSourceConfig apply( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GeoTileGridValuesSourceBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GeoTileGridValuesSourceBuilder.java index d4252d132ee12..4b01a08d29a43 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GeoTileGridValuesSourceBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GeoTileGridValuesSourceBuilder.java @@ -68,6 +68,11 @@ * @opensearch.internal */ public class GeoTileGridValuesSourceBuilder extends CompositeValuesSourceBuilder { + /** + * Supplier for a composite geotile + * + * @opensearch.internal + */ @FunctionalInterface public interface GeoTileCompositeSuppier { CompositeValuesSourceConfig apply( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java index f087d2d0495dc..7f1393f7c8fb2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java @@ -61,6 +61,11 @@ * @opensearch.internal */ public class HistogramValuesSourceBuilder extends CompositeValuesSourceBuilder { + /** + * Composite histogram supplier + * + * @opensearch.internal + */ @FunctionalInterface public interface HistogramCompositeSupplier { CompositeValuesSourceConfig apply( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/InternalComposite.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/InternalComposite.java index 8b28c1a7c5ae4..49e3d3293527a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/InternalComposite.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/InternalComposite.java @@ -317,6 +317,11 @@ public int hashCode() { return Objects.hash(super.hashCode(), size, buckets, afterKey, Arrays.hashCode(reverseMuls), Arrays.hashCode(missingOrders)); } + /** + * The bucket iterator + * + * @opensearch.internal + */ private static class BucketIterator implements Comparable { final Iterator it; InternalBucket current; @@ -335,6 +340,11 @@ InternalBucket next() { } } + /** + * Internal bucket for the internal composite agg + * + * @opensearch.internal + */ public static class InternalBucket extends InternalMultiBucketAggregation.InternalBucket implements CompositeAggregation.Bucket, @@ -516,6 +526,11 @@ static Object formatObject(Object obj, DocValueFormat format) { return obj; } + /** + * An array map used for the internal composite agg + * + * @opensearch.internal + */ static class ArrayMap extends AbstractMap implements Comparable { final List keys; final Comparable[] values; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/ParsedComposite.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/ParsedComposite.java index 965dc42a1e011..69ac30bd6df73 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/ParsedComposite.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/ParsedComposite.java @@ -106,6 +106,11 @@ protected XContentBuilder doXContentBody(XContentBuilder builder, Params params) return CompositeAggregation.toXContentFragment(this, builder, params); } + /** + * Parsed bucket for the parsed composite agg + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedMultiBucketAggregation.ParsedBucket implements CompositeAggregation.Bucket { private Map key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java index ea1fc88e5cc32..64b2635ea7fee 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java @@ -62,7 +62,11 @@ * @opensearch.internal */ public class TermsValuesSourceBuilder extends CompositeValuesSourceBuilder { - + /** + * Composite supplier for terms + * + * @opensearch.internal + */ @FunctionalInterface public interface TermsCompositeSupplier { CompositeValuesSourceConfig apply( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregator.java index 1b58d5372c5bf..efdecbdd84deb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregator.java @@ -71,6 +71,11 @@ public class FiltersAggregator extends BucketsAggregator { public static final ParseField OTHER_BUCKET_FIELD = new ParseField("other_bucket"); public static final ParseField OTHER_BUCKET_KEY_FIELD = new ParseField("other_bucket_key"); + /** + * Keyed filter for the filters agg + * + * @opensearch.internal + */ public static class KeyedFilter implements Writeable, ToXContentFragment { private final String key; private final QueryBuilder filter; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/InternalFilters.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/InternalFilters.java index ba7cb41f63abb..c15caa46d52f4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/InternalFilters.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/InternalFilters.java @@ -53,6 +53,11 @@ * @opensearch.internal */ public class InternalFilters extends InternalMultiBucketAggregation implements Filters { + /** + * Internal bucket for an internal filters agg + * + * @opensearch.internal + */ public static class InternalBucket extends InternalMultiBucketAggregation.InternalBucket implements Filters.Bucket { private final boolean keyed; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/ParsedFilters.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/ParsedFilters.java index 0ac821b6c8a11..22a9165b4181f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/ParsedFilters.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/ParsedFilters.java @@ -106,6 +106,11 @@ public static ParsedFilters fromXContent(XContentParser parser, String name) thr return aggregation; } + /** + * Parsed bucket for the parsed filters agg + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedMultiBucketAggregation.ParsedBucket implements Filters.Bucket { private String key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/CellIdSource.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/CellIdSource.java index bf47fe218073b..12d9043a2fd5f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/CellIdSource.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/CellIdSource.java @@ -89,6 +89,8 @@ public SortedBinaryDocValues bytesValues(LeafReaderContext ctx) { /** * The encoder to use to convert a geopoint's (lon, lat, precision) into * a long-encoded bucket key for aggregating. + * + * @opensearch.internal */ @FunctionalInterface public interface GeoPointLongEncoder { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java index c235626e09a10..b08c40268c5cf 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java @@ -73,6 +73,11 @@ public abstract class GeoGridAggregationBuilder extends ValuesSourceAggregationB protected int shardSize; private GeoBoundingBox geoBoundingBox = new GeoBoundingBox(new GeoPoint(Double.NaN, Double.NaN), new GeoPoint(Double.NaN, Double.NaN)); + /** + * A precision parser + * + * @opensearch.internal + */ @FunctionalInterface protected interface PrecisionParser { int parse(XContentParser parser) throws IOException; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregationBuilder.java index 9321617174400..6b6d33717bab4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregationBuilder.java @@ -286,6 +286,11 @@ public boolean equals(Object obj) { return Objects.equals(numBuckets, other.numBuckets) && Objects.equals(minimumIntervalExpression, other.minimumIntervalExpression); } + /** + * Round off information + * + * @opensearch.internal + */ public static class RoundingInfo implements Writeable { final Rounding rounding; final int[] innerIntervals; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregator.java index 587e838568046..ec3c8ed5207a4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregator.java @@ -243,6 +243,8 @@ protected final void merge(long[] mergeMap, long newNumBuckets) { * rebucket roughly {@code O(log number_of_hits_collected_so_far)} because * the "shape" of the roundings is roughly * logarithmically increasing. + * + * @opensearch.internal */ private static class FromSingle extends AutoDateHistogramAggregator { private int roundingIdx; @@ -406,6 +408,8 @@ protected void doClose() { * rounding all of the keys for {@code owningBucketOrd} that we're going to * collect and picking the rounding based on a real, accurate count and the * min and max. + * + * @opensearch.internal */ private static class FromMany extends AutoDateHistogramAggregator { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java index 6c187f7924a19..d378bb2ec1bd2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java @@ -75,6 +75,11 @@ public class DateIntervalWrapper implements ToXContentFragment, Writeable { private static final ParseField FIXED_INTERVAL_FIELD = new ParseField("fixed_interval"); private static final ParseField CALENDAR_INTERVAL_FIELD = new ParseField("calendar_interval"); + /** + * The type of interval + * + * @opensearch.internal + */ public enum IntervalTypeEnum implements Writeable { NONE, FIXED, diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalAutoDateHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalAutoDateHistogram.java index 55ef48211bcb4..a91ddf2e64879 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalAutoDateHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalAutoDateHistogram.java @@ -66,6 +66,11 @@ public final class InternalAutoDateHistogram extends InternalMultiBucketAggregat InternalAutoDateHistogram, InternalAutoDateHistogram.Bucket> implements Histogram, HistogramFactory { + /** + * Bucket for the internal auto date histogram agg + * + * @opensearch.internal + */ public static class Bucket extends InternalMultiBucketAggregation.InternalBucket implements Histogram.Bucket, KeyComparable { final long key; @@ -157,6 +162,11 @@ public DocValueFormat getFormatter() { } } + /** + * Information about the bucket + * + * @opensearch.internal + */ static class BucketInfo { final RoundingInfo[] roundingInfos; @@ -422,6 +432,11 @@ protected Bucket reduceBucket(List buckets, ReduceContext context) { return new InternalAutoDateHistogram.Bucket(buckets.get(0).key, docCount, format, aggs); } + /** + * The result from a bucket reduce + * + * @opensearch.internal + */ private static class BucketReduceResult { final List buckets; final int roundingIdx; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalDateHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalDateHistogram.java index 068d6533c59b3..9aa6fd180c77b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalDateHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalDateHistogram.java @@ -68,6 +68,11 @@ public final class InternalDateHistogram extends InternalMultiBucketAggregation< Histogram, HistogramFactory { + /** + * Bucket for an internal date histogram agg + * + * @opensearch.internal + */ public static class Bucket extends InternalMultiBucketAggregation.InternalBucket implements Histogram.Bucket, KeyComparable { final long key; @@ -170,6 +175,11 @@ public boolean getKeyed() { } } + /** + * Information about an empty bucket + * + * @opensearch.internal + */ static class EmptyBucketInfo { final Rounding rounding; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalHistogram.java index c11f483392c25..23e9fb7a8b456 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalHistogram.java @@ -64,6 +64,11 @@ public final class InternalHistogram extends InternalMultiBucketAggregation { final double key; @@ -166,6 +171,11 @@ public boolean getKeyed() { } } + /** + * Information about an empty bucket + * + * @opensearch.internal + */ public static class EmptyBucketInfo { final double interval, offset, minBound, maxBound; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogram.java index ec4be47e4a62f..f6b5e23acbc91 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogram.java @@ -62,8 +62,18 @@ public class InternalVariableWidthHistogram extends InternalMultiBucketAggregati InternalVariableWidthHistogram, InternalVariableWidthHistogram.Bucket> implements Histogram, HistogramFactory { + /** + * Bucket for an internal variable width histogram + * + * @opensearch.internal + */ public static class Bucket extends InternalMultiBucketAggregation.InternalBucket implements Histogram.Bucket, KeyComparable { + /** + * Bounds of the bucket + * + * @opensearch.internal + */ public static class BucketBounds { public double min; public double max; @@ -219,6 +229,11 @@ public DocValueFormat getFormatter() { } } + /** + * Information about an empty bucket + * + * @opensearch.internal + */ static class EmptyBucketInfo { final InternalAggregations subAggregations; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedAutoDateHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedAutoDateHistogram.java index 83f776d34a17e..95cf93b7229db 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedAutoDateHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedAutoDateHistogram.java @@ -97,6 +97,11 @@ protected XContentBuilder doXContentBody(XContentBuilder builder, Params params) return builder; } + /** + * A parsed bucket for a parsed auto date histogram agg + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedMultiBucketAggregation.ParsedBucket implements Histogram.Bucket { private Long key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java index 248f41f213031..b961aba135683 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java @@ -78,6 +78,11 @@ public static ParsedDateHistogram fromXContent(XContentParser parser, String nam return aggregation; } + /** + * Parsed Bucket for a parsed date histogram + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedMultiBucketAggregation.ParsedBucket implements Histogram.Bucket { private Long key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedHistogram.java index 1cc7865d22f45..ff63079da29a4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedHistogram.java @@ -75,6 +75,11 @@ public static ParsedHistogram fromXContent(XContentParser parser, String name) t return aggregation; } + /** + * Parsed bucket for a parsed histogram + * + * @opensearch.internal + */ static class ParsedBucket extends ParsedMultiBucketAggregation.ParsedBucket implements Histogram.Bucket { private Double key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedVariableWidthHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedVariableWidthHistogram.java index c03221af74c15..4ac3ef6ea57cd 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedVariableWidthHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedVariableWidthHistogram.java @@ -84,6 +84,11 @@ public static ParsedVariableWidthHistogram fromXContent(XContentParser parser, S return aggregation; } + /** + * Parsed bucket for a parsed variable width histogram + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedMultiBucketAggregation.ParsedBucket implements Histogram.Bucket { private Double key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/InternalMissing.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/InternalMissing.java index a9aeda3f941cf..7cc86483f0b56 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/InternalMissing.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/InternalMissing.java @@ -38,6 +38,11 @@ import java.io.IOException; import java.util.Map; +/** + * Missing single bucket agg + * + * @opensearch.internal + */ public class InternalMissing extends InternalSingleBucketAggregation implements Missing { InternalMissing(String name, long docCount, InternalAggregations aggregations, Map metadata) { super(name, docCount, aggregations, metadata); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregator.java index dc536aebc0cde..5dc4d1c780350 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregator.java @@ -230,6 +230,11 @@ void processBufferedChildBuckets() throws IOException { } } + /** + * A cached scorable doc + * + * @opensearch.internal + */ private static class CachedScorable extends Scorable { int doc; float score; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregatorFactory.java index 22b87280c8534..ca1018795b518 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregatorFactory.java @@ -82,6 +82,11 @@ public Aggregator createInternal( return new NestedAggregator(name, factories, parentObjectMapper, childObjectMapper, searchContext, parent, cardinality, metadata); } + /** + * Unmapped class for nested agg + * + * @opensearch.internal + */ private static final class Unmapped extends NonCollectingAggregator { Unmapped(String name, SearchContext context, Aggregator parent, AggregatorFactories factories, Map metadata) diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregatorFactory.java index 2929df697ea58..27cd8a2688836 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregatorFactory.java @@ -83,6 +83,11 @@ public Aggregator createInternal( } } + /** + * Unmapped class for reverse nested agg + * + * @opensearch.internal + */ private static final class Unmapped extends NonCollectingAggregator { Unmapped(String name, SearchContext context, Aggregator parent, AggregatorFactories factories, Map metadata) diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/BinaryRangeAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/BinaryRangeAggregator.java index c846ba6c48b20..a48649af99be3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/BinaryRangeAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/BinaryRangeAggregator.java @@ -62,6 +62,11 @@ */ public final class BinaryRangeAggregator extends BucketsAggregator { + /** + * Range for the binary range agg + * + * @opensearch.internal + */ public static class Range { final String key; @@ -144,6 +149,11 @@ protected void doCollect(LeafBucketCollector sub, int doc, long bucket) throws I } } + /** + * Leaf collector for the sorted set range + * + * @opensearch.internal + */ abstract static class SortedSetRangeLeafCollector extends LeafBucketCollectorBase { final long[] froms, tos, maxTos; @@ -250,6 +260,11 @@ private int collect(int doc, long ord, long bucket, int lowBound) throws IOExcep protected abstract void doCollect(LeafBucketCollector sub, int doc, long bucket) throws IOException; } + /** + * Base class for a sorted binary range leaf collector + * + * @opensearch.internal + */ abstract static class SortedBinaryRangeLeafCollector extends LeafBucketCollectorBase { final Range[] ranges; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java index 701f46719b8e3..944a580efdeb7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java @@ -121,6 +121,11 @@ public static AggregationBuilder parse(String aggregationName, XContentParser pa return builder; } + /** + * Range for a geo distance agg + * + * @opensearch.internal + */ public static class Range extends RangeAggregator.Range { public Range(String key, Double from, Double to) { super(key(key, from, to), from == null ? 0 : from, to); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceRangeAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceRangeAggregatorFactory.java index cd8179f00a842..64c618e93510f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceRangeAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceRangeAggregatorFactory.java @@ -172,6 +172,11 @@ protected Aggregator doCreateInternal( ); } + /** + * The source location for the distance calculation + * + * @opensearch.internal + */ private static class DistanceSource extends ValuesSource.Numeric { private final ValuesSource.GeoPoint source; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalBinaryRange.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalBinaryRange.java index 95e04d3f47e7e..fad1705278f04 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalBinaryRange.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalBinaryRange.java @@ -61,6 +61,11 @@ public final class InternalBinaryRange extends InternalMultiBucketAggregation { public static final Factory FACTORY = new Factory(); + /** + * Bucket for a date range + * + * @opensearch.internal + */ public static class Bucket extends InternalRange.Bucket { public Bucket( @@ -113,6 +118,11 @@ DocValueFormat format() { } } + /** + * Factory to create a date range + * + * @opensearch.internal + */ public static class Factory extends InternalRange.Factory { @Override public ValueType getValueType() { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalGeoDistance.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalGeoDistance.java index 0cbe572e31917..4d5e9cbfb7e49 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalGeoDistance.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalGeoDistance.java @@ -50,6 +50,11 @@ public class InternalGeoDistance extends InternalRange { public static final Factory FACTORY = new Factory(); + /** + * Bucket for a geo distance range + * + * @opensearch.internal + */ static class Bucket extends InternalRange.Bucket { Bucket(String key, double from, double to, long docCount, InternalAggregations aggregations, boolean keyed) { @@ -66,6 +71,11 @@ boolean keyed() { } } + /** + * Factory for a geo distance bucket + * + * @opensearch.internal + */ public static class Factory extends InternalRange.Factory { @Override public ValuesSourceType getValueSourceType() { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalRange.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalRange.java index 8da0d132fd54f..274b3741e6acb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalRange.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalRange.java @@ -59,6 +59,11 @@ public class InternalRange> { public ValuesSourceType getValueSourceType() { return CoreValuesSourceType.NUMERIC; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java index 843733d736bc0..cc304f987bc61 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java @@ -128,6 +128,11 @@ private static Range parseRange(XContentParser parser) throws IOException { } } + /** + * Range for an IP range + * + * @opensearch.internal + */ public static class Range implements ToXContentObject { private final String key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedBinaryRange.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedBinaryRange.java index 68f8aae9aefb9..58c235f6df9a4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedBinaryRange.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedBinaryRange.java @@ -82,6 +82,11 @@ public static ParsedBinaryRange fromXContent(XContentParser parser, String name) return aggregation; } + /** + * Parsed bucket for a binary range + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedMultiBucketAggregation.ParsedBucket implements Range.Bucket { private String key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedDateRange.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedDateRange.java index 889b57b1a128c..3cff1b6a5fea5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedDateRange.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedDateRange.java @@ -71,6 +71,11 @@ public static ParsedDateRange fromXContent(XContentParser parser, String name) t return aggregation; } + /** + * Parsed bucket for a date range + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedRange.ParsedBucket { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedGeoDistance.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedGeoDistance.java index 86fa2555c727c..8902adea1e799 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedGeoDistance.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedGeoDistance.java @@ -68,6 +68,11 @@ public static ParsedGeoDistance fromXContent(XContentParser parser, String name) return aggregation; } + /** + * Parsed bucket for a geo distance + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedRange.ParsedBucket { static ParsedBucket fromXContent(final XContentParser parser, final boolean keyed) throws IOException { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedRange.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedRange.java index 0ad192636c0a7..1eda34de1c1e0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedRange.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedRange.java @@ -92,6 +92,11 @@ public static ParsedRange fromXContent(XContentParser parser, String name) throw return aggregation; } + /** + * Parsed bucket for a range + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedMultiBucketAggregation.ParsedBucket implements Range.Bucket { protected String key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregator.java index 4d2b0437adb08..40a455597a016 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregator.java @@ -75,6 +75,11 @@ public class RangeAggregator extends BucketsAggregator { public static final ParseField RANGES_FIELD = new ParseField("ranges"); public static final ParseField KEYED_FIELD = new ParseField("keyed"); + /** + * Range for the range aggregator + * + * @opensearch.internal + */ public static class Range implements Writeable, ToXContentObject { public static final ParseField KEY_FIELD = new ParseField("key"); public static final ParseField FROM_FIELD = new ParseField("from"); @@ -383,6 +388,11 @@ public InternalAggregation buildEmptyAggregation() { return rangeFactory.create(name, buckets, format, keyed, metadata()); } + /** + * Unmapped range + * + * @opensearch.internal + */ public static class Unmapped extends NonCollectingAggregator { private final R[] ranges; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregator.java index fd1d7bf2997ac..afbf52cbdd04e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregator.java @@ -73,6 +73,11 @@ public class SamplerAggregator extends DeferableBucketAggregator implements Sing static final long SCOREDOCKEY_SIZE = RamUsageEstimator.shallowSizeOfInstance(DiversifiedTopDocsCollector.ScoreDocKey.class); + /** + * The execution mode for the sampler + * + * @opensearch.internal + */ public enum ExecutionMode { MAP(new ParseField("map")) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BytesKeyedBucketOrds.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BytesKeyedBucketOrds.java index 7bfeff7615b83..0eb23013d1e47 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BytesKeyedBucketOrds.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BytesKeyedBucketOrds.java @@ -82,6 +82,8 @@ private BytesKeyedBucketOrds() {} /** * An iterator for buckets inside a particular {@code owningBucketOrd}. + * + * @opensearch.internal */ public interface BucketOrdsEnum { /** @@ -122,6 +124,8 @@ public void readValue(BytesRef dest) {} /** * Implementation that only works if it is collecting from a single bucket. + * + * @opensearch.internal */ private static class FromSingle extends BytesKeyedBucketOrds { private final BytesRefHash ords; @@ -177,6 +181,8 @@ public void close() { /** * Implementation that works properly when collecting from many buckets. + * + * @opensearch.internal */ private static class FromMany extends BytesKeyedBucketOrds { // TODO we can almost certainly do better here by building something fit for purpose rather than trying to lego together stuff diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/DoubleTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/DoubleTerms.java index 7f2765657781a..6b44b2cdb8cb7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/DoubleTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/DoubleTerms.java @@ -53,6 +53,11 @@ public class DoubleTerms extends InternalMappedTerms { public static final String NAME = "dterms"; + /** + * Bucket for a double terms agg + * + * @opensearch.internal + */ static class Bucket extends InternalTerms.Bucket { double term; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/GlobalOrdinalsStringTermsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/GlobalOrdinalsStringTermsAggregator.java index 4be90ac2f9b7a..4fcc42b6211b2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/GlobalOrdinalsStringTermsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/GlobalOrdinalsStringTermsAggregator.java @@ -90,6 +90,11 @@ public class GlobalOrdinalsStringTermsAggregator extends AbstractStringTermsAggr protected int segmentsWithSingleValuedOrds = 0; protected int segmentsWithMultiValuedOrds = 0; + /** + * Lookup global ordinals + * + * @opensearch.internal + */ public interface GlobalOrdLookupFunction { BytesRef apply(long ord) throws IOException; } @@ -231,6 +236,8 @@ public void collectDebugInfo(BiConsumer add) { /** * This is used internally only, just for compare using global ordinal instead of term bytes in the PQ + * + * @opensearch.internal */ static class OrdBucket extends InternalTerms.Bucket { long globalOrd; @@ -284,6 +291,8 @@ protected void doClose() { * This is only supported for the standard {@code terms} aggregation and * doesn't support {@code significant_terms} so this forces * {@link StandardTermsResults}. + * + * @opensearch.internal */ static class LowCardinality extends GlobalOrdinalsStringTermsAggregator { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java index 4464e4eb54760..ea4ee87f28a95 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java @@ -162,16 +162,29 @@ public static IncludeExclude parseExclude(XContentParser parser) throws IOExcept } } + /** + * Base filter class + * + * @opensearch.internal + */ public abstract static class Filter {} - // The includeValue and excludeValue ByteRefs which are the result of the parsing - // process are converted into a LongFilter when used on numeric fields - // in the index. + /** + * The includeValue and excludeValue ByteRefs which are the result of the parsing + * process are converted into a LongFilter when used on numeric fields + * in the index. + * + * @opensearch.internal + */ public abstract static class LongFilter extends Filter { public abstract boolean accept(long value); - } + /** + * Long filter that is partitioned + * + * @opensearch.internal + */ public class PartitionedLongFilter extends LongFilter { @Override public boolean accept(long value) { @@ -181,6 +194,11 @@ public boolean accept(long value) { } } + /** + * Long filter backed by valid values + * + * @opensearch.internal + */ public static class SetBackedLongFilter extends LongFilter { private LongSet valids; private LongSet invalids; @@ -208,7 +226,11 @@ private void addReject(long val) { } } - // Only used for the 'map' execution mode (ie. scripts) + /** + * Only used for the 'map' execution mode (ie. scripts) + * + * @opensearch.internal + */ public abstract static class StringFilter extends Filter { public abstract boolean accept(BytesRef value); } @@ -220,6 +242,11 @@ public boolean accept(BytesRef value) { } } + /** + * String filter backed by an automaton + * + * @opensearch.internal + */ static class AutomatonBackedStringFilter extends StringFilter { private final ByteRunAutomaton runAutomaton; @@ -237,6 +264,11 @@ public boolean accept(BytesRef value) { } } + /** + * String filter backed by a term list + * + * @opensearch.internal + */ static class TermListBackedStringFilter extends StringFilter { private final Set valids; @@ -257,6 +289,11 @@ public boolean accept(BytesRef value) { } } + /** + * An ordinals filter + * + * @opensearch.internal + */ public abstract static class OrdinalsFilter extends Filter { public abstract LongBitSet acceptedGlobalOrdinals(SortedSetDocValues globalOrdinals) throws IOException; @@ -284,6 +321,11 @@ public LongBitSet acceptedGlobalOrdinals(SortedSetDocValues globalOrdinals) thro } } + /** + * An ordinals filter backed by an automaton + * + * @opensearch.internal + */ static class AutomatonBackedOrdinalsFilter extends OrdinalsFilter { private final CompiledAutomaton compiled; @@ -311,6 +353,11 @@ public LongBitSet acceptedGlobalOrdinals(SortedSetDocValues globalOrdinals) thro } + /** + * An ordinals filter backed by a terms list + * + * @opensearch.internal + */ static class TermListBackedOrdinalsFilter extends OrdinalsFilter { private final SortedSet includeValues; @@ -508,6 +555,8 @@ private static SortedSet convertToBytesRefSet(long[] values) { /** * Terms adapter around doc values. + * + * @opensearch.internal */ private static class DocValuesTerms extends Terms { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTerms.java index f9207fb17a431..c0422dffd7cad 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTerms.java @@ -36,6 +36,8 @@ public class InternalMultiTerms extends InternalTerms { /** * Internal Multi Terms Bucket. + * + * @opensearch.internal */ public static class Bucket extends InternalTerms.AbstractInternalBucket implements KeyComparable { @@ -193,6 +195,8 @@ public int compareKey(Bucket other) { /** * Visible for testing. + * + * @opensearch.internal */ protected static class BucketComparator implements Comparator> { @SuppressWarnings({ "unchecked" }) diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalRareTerms.java index 441a0783536d5..f6dbf17d54644 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalRareTerms.java @@ -60,12 +60,19 @@ public abstract class InternalRareTerms, B ext implements RareTerms { + /** + * Bucket for a rare terms agg + * + * @opensearch.internal + */ public abstract static class Bucket> extends InternalMultiBucketAggregation.InternalBucket implements RareTerms.Bucket, KeyComparable { /** * Reads a bucket. Should be a constructor reference. + * + * @opensearch.internal */ @FunctionalInterface public interface Reader> { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalSignificantTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalSignificantTerms.java index 80fd4e2f5dc7a..3e7a6210350aa 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalSignificantTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalSignificantTerms.java @@ -62,12 +62,19 @@ public abstract class InternalSignificantTerms> extends InternalMultiBucketAggregation.InternalBucket implements SignificantTerms.Bucket { /** * Reads a bucket. Should be a constructor reference. + * + * @opensearch.internal */ @FunctionalInterface public interface Reader> { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalTerms.java index a376d7fab900b..68f25032a02a4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalTerms.java @@ -75,6 +75,11 @@ public abstract class InternalTerms, B extends Int protected static final ParseField DOC_COUNT_ERROR_UPPER_BOUND_FIELD_NAME = new ParseField("doc_count_error_upper_bound"); protected static final ParseField SUM_OF_OTHER_DOC_COUNTS = new ParseField("sum_other_doc_count"); + /** + * Base internal multi bucket + * + * @opensearch.internal + */ public abstract static class AbstractInternalBucket extends InternalMultiBucketAggregation.InternalBucket implements Terms.Bucket { abstract void setDocCountError(long docCountError); @@ -83,9 +88,16 @@ public abstract static class AbstractInternalBucket extends InternalMultiBucketA abstract boolean showDocCountError(); } + /** + * Base bucket class + * + * @opensearch.internal + */ public abstract static class Bucket> extends AbstractInternalBucket implements KeyComparable { /** * Reads a bucket. Should be a constructor reference. + * + * @opensearch.internal */ @FunctionalInterface public interface Reader> { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongKeyedBucketOrds.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongKeyedBucketOrds.java index d60c774adaa3c..bcf77ee194ea4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongKeyedBucketOrds.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongKeyedBucketOrds.java @@ -100,6 +100,8 @@ private LongKeyedBucketOrds() {} /** * An iterator for buckets inside a particular {@code owningBucketOrd}. + * + * @opensearch.internal */ public interface BucketOrdsEnum { /** @@ -142,6 +144,8 @@ public long value() { /** * Implementation that only works if it is collecting from a single bucket. + * + * @opensearch.internal */ public static class FromSingle extends LongKeyedBucketOrds { private final LongHash ords; @@ -221,6 +225,8 @@ public void close() { /** * Implementation that works properly when collecting from many buckets. + * + * @opensearch.internal */ public static class FromMany extends LongKeyedBucketOrds { private final LongLongHash ords; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongRareTerms.java index f65401f913a89..4a18d0ea7482a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongRareTerms.java @@ -52,6 +52,11 @@ public class LongRareTerms extends InternalMappedRareTerms { public static final String NAME = "lrareterms"; + /** + * Bucket for rare long valued terms + * + * @opensearch.internal + */ public static class Bucket extends InternalRareTerms.Bucket { long term; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongTerms.java index 2a92749943256..d9e7ad18751f3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongTerms.java @@ -53,6 +53,11 @@ public class LongTerms extends InternalMappedTerms { public static final String NAME = "lterms"; + /** + * Bucket for long terms + * + * @opensearch.internal + */ public static class Bucket extends InternalTerms.Bucket { long term; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MapStringTermsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MapStringTermsAggregator.java index 2450a5a3692e1..8ef33667e972c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MapStringTermsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MapStringTermsAggregator.java @@ -153,6 +153,8 @@ public void doClose() { /** * Abstaction on top of building collectors to fetch values. + * + * @opensearch.internal */ public interface CollectorSource extends Releasable { boolean needsScores(); @@ -166,6 +168,11 @@ LeafBucketCollector getLeafCollector( ) throws IOException; } + /** + * Consumer for the collector + * + * @opensearch.internal + */ @FunctionalInterface public interface CollectConsumer { void accept(LeafBucketCollector sub, int doc, long owningBucketOrd, BytesRef bytes) throws IOException; @@ -173,6 +180,8 @@ public interface CollectConsumer { /** * Fetch values from a {@link ValuesSource}. + * + * @opensearch.internal */ public static class ValuesSourceCollectorSource implements CollectorSource { private final ValuesSource valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationFactory.java index 695972564f720..8a061c0fbf512 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationFactory.java @@ -159,6 +159,11 @@ protected Aggregator createInternal( ); } + /** + * Supplier for internal values source + * + * @opensearch.internal + */ public interface InternalValuesSourceSupplier { MultiTermsAggregator.InternalValuesSource build(Tuple config); } diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregator.java index e5461ff7a03aa..45898a689a605 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregator.java @@ -304,6 +304,8 @@ interface InternalValuesSourceCollector { /** * Multi_Term ValuesSource, it is a collection of {@link InternalValuesSource} + * + * @opensearch.internal */ static class MultiTermsValuesSource { private final List valuesSources; @@ -354,6 +356,8 @@ private void apply( /** * Factory for construct {@link InternalValuesSource}. + * + * @opensearch.internal */ static class InternalValuesSourceFactory { static InternalValuesSource bytesValuesSource(ValuesSource valuesSource, IncludeExclude.StringFilter includeExclude) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedDoubleTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedDoubleTerms.java index 2ace6b637e6df..d41e8ccf73246 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedDoubleTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedDoubleTerms.java @@ -65,6 +65,11 @@ public static ParsedDoubleTerms fromXContent(XContentParser parser, String name) return aggregation; } + /** + * Parsed bucket for double terms + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedTerms.ParsedBucket { private Double key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongRareTerms.java index c66f3cd676893..634ed164dc5ab 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongRareTerms.java @@ -65,6 +65,11 @@ public static ParsedLongRareTerms fromXContent(XContentParser parser, String nam return aggregation; } + /** + * Parsed bucket for rare long values + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedRareTerms.ParsedBucket { private Long key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongTerms.java index 45f51854aa603..1d2b17e7d9130 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongTerms.java @@ -65,6 +65,11 @@ public static ParsedLongTerms fromXContent(XContentParser parser, String name) t return aggregation; } + /** + * Parsed bucket for long term values + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedTerms.ParsedBucket { private Long key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedMultiTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedMultiTerms.java index 3e1c6f6533b06..52199c6dbbfb9 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedMultiTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedMultiTerms.java @@ -41,6 +41,11 @@ public static ParsedMultiTerms fromXContent(XContentParser parser, String name) return aggregation; } + /** + * Parsed bucket for multi terms + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedTerms.ParsedBucket { private List key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedRareTerms.java index f195028244913..0af5347d290b6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedRareTerms.java @@ -85,6 +85,11 @@ static void declareParsedTermsFields( declareMultiBucketAggregationFields(objectParser, bucketParser::apply, bucketParser::apply); } + /** + * Parsed Bucket for rare term values + * + * @opensearch.internal + */ public abstract static class ParsedBucket extends ParsedMultiBucketAggregation.ParsedBucket implements RareTerms.Bucket { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantLongTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantLongTerms.java index 23c29b2745f73..49bf854f05f72 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantLongTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantLongTerms.java @@ -63,6 +63,11 @@ public static ParsedSignificantLongTerms fromXContent(XContentParser parser, Str return parseSignificantTermsXContent(() -> PARSER.parse(parser, null), name); } + /** + * Parsed bucket for significant long values + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedSignificantTerms.ParsedBucket { private Long key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantStringTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantStringTerms.java index ce508687aed6c..7953a476e2899 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantStringTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantStringTerms.java @@ -65,6 +65,11 @@ public static ParsedSignificantStringTerms fromXContent(XContentParser parser, S return parseSignificantTermsXContent(() -> PARSER.parse(parser, null), name); } + /** + * Parsed bucket for significant string values + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedSignificantTerms.ParsedBucket { private BytesRef key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantTerms.java index 1d6b64f3dcd0b..654086c28168d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantTerms.java @@ -128,6 +128,11 @@ static void declareParsedSignificantTermsFields( ); } + /** + * Parsed bucket for significant values + * + * @opensearch.internal + */ public abstract static class ParsedBucket extends ParsedMultiBucketAggregation.ParsedBucket implements SignificantTerms.Bucket { protected long subsetDf; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringRareTerms.java index ecf5bd84097b0..ee1b8f7e235e0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringRareTerms.java @@ -67,6 +67,11 @@ public static ParsedStringRareTerms fromXContent(XContentParser parser, String n return aggregation; } + /** + * Parsed bucket for rare string terms + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedRareTerms.ParsedBucket { private BytesRef key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringTerms.java index c849d6c8c8840..e5dfb7f9d07e9 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringTerms.java @@ -67,6 +67,11 @@ public static ParsedStringTerms fromXContent(XContentParser parser, String name) return aggregation; } + /** + * Parsed bucket for string values + * + * @opensearch.internal + */ public static class ParsedBucket extends ParsedTerms.ParsedBucket { private BytesRef key; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedTerms.java index 68de52a253188..841eddccc239a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedTerms.java @@ -109,6 +109,11 @@ static void declareParsedTermsFields( objectParser.declareLong((parsedTerms, value) -> parsedTerms.sumOtherDocCount = value, SUM_OF_OTHER_DOC_COUNTS); } + /** + * Base parsed bucket + * + * @opensearch.internal + */ public abstract static class ParsedBucket extends ParsedMultiBucketAggregation.ParsedBucket implements Terms.Bucket { boolean showDocCountError = false; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTerms.java index 6e26503c149c5..f930e199e8f1b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTerms.java @@ -44,6 +44,8 @@ public interface RareTerms extends MultiBucketsAggregation { /** * A bucket that is associated with a single term + * + * @opensearch.internal */ interface Bucket extends MultiBucketsAggregation.Bucket { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java index b689865ac8c99..f15d0bd9bc644 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java @@ -237,6 +237,11 @@ protected Aggregator doCreateInternal( ); } + /** + * Execution mode for rare terms agg + * + * @opensearch.internal + */ public enum ExecutionMode { MAP(new ParseField("map")) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantLongTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantLongTerms.java index 6e2b48f55796e..9106824d9df7c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantLongTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantLongTerms.java @@ -51,6 +51,11 @@ public class SignificantLongTerms extends InternalMappedSignificantTerms { public static final String NAME = "siglterms"; + /** + * Bucket for significant long values + * + * @opensearch.internal + */ static class Bucket extends InternalSignificantTerms.Bucket { long term; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantStringTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantStringTerms.java index 3795df964b0c4..9e9c7100c0842 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantStringTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantStringTerms.java @@ -52,6 +52,11 @@ public class SignificantStringTerms extends InternalMappedSignificantTerms { public static final String NAME = "sigsterms"; + /** + * Bucket for significant string values + * + * @opensearch.internal + */ public static class Bucket extends InternalSignificantTerms.Bucket { BytesRef termBytes; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTerms.java index a5d1c29b0ee0a..e2eeac18575b0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTerms.java @@ -42,6 +42,11 @@ */ public interface SignificantTerms extends MultiBucketsAggregation, Iterable { + /** + * Bucket for significant terms + * + * @opensearch.internal + */ interface Bucket extends MultiBucketsAggregation.Bucket { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java index ff35d128ef524..12b11dae33613 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java @@ -311,6 +311,11 @@ protected Aggregator doCreateInternal( ); } + /** + * The execution mode for the significant terms agg + * + * @opensearch.internal + */ public enum ExecutionMode { MAP(new ParseField("map")) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java index a509cbfd49ffd..39711cf0901f5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java @@ -173,6 +173,11 @@ protected Aggregator createInternal( ); } + /** + * Collects significant text + * + * @opensearch.internal + */ private static class SignificantTextCollectorSource implements MapStringTermsAggregator.CollectorSource { private final SourceLookup sourceLookup; private final BigArrays bigArrays; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringRareTerms.java index f6a925c5340a1..9b1047587969b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringRareTerms.java @@ -53,6 +53,11 @@ public class StringRareTerms extends InternalMappedRareTerms { public static final String NAME = "srareterms"; + /** + * Bucket for rare string terms + * + * @opensearch.internal + */ public static class Bucket extends InternalRareTerms.Bucket { BytesRef termBytes; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringTerms.java index 829ec07c91087..c053c80a101dc 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringTerms.java @@ -52,6 +52,11 @@ public class StringTerms extends InternalMappedTerms { public static final String NAME = "sterms"; + /** + * Bucket for string terms + * + * @opensearch.internal + */ public static class Bucket extends InternalTerms.Bucket { BytesRef termBytes; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/Terms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/Terms.java index df2028c81b1eb..e2e07ffa6ae59 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/Terms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/Terms.java @@ -45,6 +45,8 @@ public interface Terms extends MultiBucketsAggregation { /** * A bucket that is associated with a single term + * + * @opensearch.internal */ interface Bucket extends MultiBucketsAggregation.Bucket { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregator.java index d60d1609ae9d4..c63b410f2e468 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregator.java @@ -63,6 +63,11 @@ */ public abstract class TermsAggregator extends DeferableBucketAggregator { + /** + * Bucket count thresholds + * + * @opensearch.internal + */ public static class BucketCountThresholds implements Writeable, ToXContentFragment { private long minDocCount; private long shardMinDocCount; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java index abbd7945bdde4..50b1ae001db97 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java @@ -365,6 +365,11 @@ private static long getMaxOrd(ValuesSource source, IndexSearcher searcher) throw } } + /** + * The execution mode for the terms agg + * + * @opensearch.internal + */ public enum ExecutionMode { MAP(new ParseField("map")) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedRareTerms.java index 279bbf95641e0..1be7c82c26dc8 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedRareTerms.java @@ -54,6 +54,11 @@ public class UnmappedRareTerms extends InternalRareTerms { public static final String NAME = "umrareterms"; + /** + * Bucket for unmapped rare values + * + * @opensearch.internal + */ protected abstract static class Bucket extends InternalRareTerms.Bucket { private Bucket(long docCount, InternalAggregations aggregations, DocValueFormat formatter) { super(docCount, aggregations, formatter); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedSignificantTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedSignificantTerms.java index 535a6b58059a5..35914e9ebed43 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedSignificantTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedSignificantTerms.java @@ -60,6 +60,8 @@ public class UnmappedSignificantTerms extends InternalSignificantTerms { private Bucket( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedTerms.java index 9b792720b492a..164a3b1b7cf19 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedTerms.java @@ -57,6 +57,8 @@ public class UnmappedTerms extends InternalTerms { private Bucket( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/ChiSquare.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/ChiSquare.java index 1597976986beb..fd19fc8cfbaea 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/ChiSquare.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/ChiSquare.java @@ -108,6 +108,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Builder for a chi squared heuristic + * + * @opensearch.internal + */ public static class ChiSquareBuilder extends NXYSignificanceHeuristic.NXYBuilder { public ChiSquareBuilder(boolean includeNegatives, boolean backgroundIsSuperset) { super(includeNegatives, backgroundIsSuperset); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/GND.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/GND.java index 4f315836d9b3c..23f3815f779ae 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/GND.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/GND.java @@ -127,6 +127,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Builder for a GND heuristic + * + * @opensearch.internal + */ public static class GNDBuilder extends NXYBuilder { public GNDBuilder(boolean backgroundIsSuperset) { super(true, backgroundIsSuperset); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/JLHScore.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/JLHScore.java index 1b36947f72d02..4032334eba68f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/JLHScore.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/JLHScore.java @@ -129,6 +129,11 @@ public int hashCode() { return getClass().hashCode(); } + /** + * Builder for a JLH Score heuristic + * + * @opensearch.internal + */ public static class JLHScoreBuilder implements SignificanceHeuristicBuilder { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/MutualInformation.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/MutualInformation.java index 761e1cf31da10..e9198f0f4d3df 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/MutualInformation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/MutualInformation.java @@ -147,6 +147,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Builder for a Mutual Information heuristic + * + * @opensearch.internal + */ public static class MutualInformationBuilder extends NXYBuilder { public MutualInformationBuilder(boolean includeNegatives, boolean backgroundIsSuperset) { super(includeNegatives, backgroundIsSuperset); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/NXYSignificanceHeuristic.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/NXYSignificanceHeuristic.java index e385bea5a7c11..cdb1349765317 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/NXYSignificanceHeuristic.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/NXYSignificanceHeuristic.java @@ -106,6 +106,11 @@ public int hashCode() { return result; } + /** + * Frequencies for an NXY significance heuristic + * + * @opensearch.internal + */ protected static class Frequencies { double N00, N01, N10, N11, N0_, N1_, N_0, N_1, N; } @@ -194,6 +199,11 @@ protected static Function buildFromParsedArgs(BiFunction add) { add.accept("string_hashing_collectors_used", stringHashingCollectorsUsed); } + /** + * Collector for the cardinality agg + * + * @opensearch.internal + */ private abstract static class Collector extends LeafBucketCollector implements Releasable { public abstract void postCollect() throws IOException; } + /** + * Empty Collector for the Cardinality agg + * + * @opensearch.internal + */ private static class EmptyCollector extends Collector { @Override @@ -225,6 +235,11 @@ public void close() { } } + /** + * Direct Collector for the cardinality agg + * + * @opensearch.internal + */ private static class DirectCollector extends Collector { private final MurmurHash3Values hashes; @@ -257,6 +272,11 @@ public void close() { } + /** + * Ordinals Collector for the cardinality agg + * + * @opensearch.internal + */ private static class OrdinalsCollector extends Collector { private static final long SHALLOW_FIXEDBITSET_SIZE = RamUsageEstimator.shallowSizeOfInstance(FixedBitSet.class); @@ -345,6 +365,8 @@ public void close() { /** * Representation of a list of hash values. There might be dups and there is no guarantee on the order. + * + * @opensearch.internal */ abstract static class MurmurHash3Values { @@ -375,6 +397,11 @@ public static MurmurHash3Values hash(SortedBinaryDocValues values) { return new Bytes(values); } + /** + * Long hash value + * + * @opensearch.internal + */ private static class Long extends MurmurHash3Values { private final SortedNumericDocValues values; @@ -399,6 +426,11 @@ public long nextValue() throws IOException { } } + /** + * Double hash value + * + * @opensearch.internal + */ private static class Double extends MurmurHash3Values { private final SortedNumericDoubleValues values; @@ -423,6 +455,11 @@ public long nextValue() throws IOException { } } + /** + * Byte hash value + * + * @opensearch.internal + */ private static class Bytes extends MurmurHash3Values { private final MurmurHash3.Hash128 hash = new MurmurHash3.Hash128(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStats.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStats.java index 36e9c1f93866c..811a7e08caed3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStats.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStats.java @@ -118,6 +118,11 @@ public interface ExtendedStats extends Stats { */ String getVarianceSamplingAsString(); + /** + * The bounds of the extended stats + * + * @opensearch.internal + */ enum Bounds { UPPER, LOWER, diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregatorProvider.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregatorProvider.java index 88cdf60b7aebe..3c19c0b5867a1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregatorProvider.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregatorProvider.java @@ -40,6 +40,8 @@ /** * Base supplier of an ExtendesStats aggregator + * + * @opensearch.internal */ public interface ExtendedStatsAggregatorProvider { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlus.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlus.java index bfc121627bfe7..1e33b78d3f6c5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlus.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlus.java @@ -225,6 +225,11 @@ private void merge(long thisBucket, AbstractHyperLogLog.RunLenIterator runLens) } } + /** + * The hyper log log + * + * @opensearch.internal + */ private static class HyperLogLog extends AbstractHyperLogLog implements Releasable { private final BigArrays bigArrays; private final HyperLogLogIterator iterator; @@ -269,6 +274,11 @@ public void close() { } } + /** + * Iterator for hyper log log + * + * @opensearch.internal + */ private static class HyperLogLogIterator implements AbstractHyperLogLog.RunLenIterator { private final HyperLogLog hll; @@ -304,6 +314,11 @@ public byte value() { } } + /** + * The plus plus + * + * @opensearch.internal + */ private static class LinearCounting extends AbstractLinearCounting implements Releasable { protected final int threshold; @@ -397,6 +412,11 @@ public void close() { } } + /** + * The plus plus iterator + * + * @opensearch.internal + */ private static class LinearCountingIterator implements AbstractLinearCounting.HashesIterator { private final LinearCounting lc; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlusSparse.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlusSparse.java index 9a042726423e7..252df7358ddcd 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlusSparse.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlusSparse.java @@ -98,6 +98,11 @@ protected void addEncoded(long bucket, int encoded) { lc.addEncoded(bucket, encoded); } + /** + * The plus plus + * + * @opensearch.internal + */ private static class LinearCounting extends AbstractLinearCounting implements Releasable { private final int capacity; @@ -189,6 +194,11 @@ public void close() { } } + /** + * The plus plus iterator + * + * @opensearch.internal + */ private static class LinearCountingIterator implements AbstractLinearCounting.HashesIterator { private final LinearCounting lc; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalExtendedStats.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalExtendedStats.java index 75a4dbb4e74dd..cfc6e06b2cbdf 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalExtendedStats.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalExtendedStats.java @@ -48,6 +48,11 @@ * @opensearch.internal */ public class InternalExtendedStats extends InternalStats implements ExtendedStats { + /** + * The metrics for the extended stats + * + * @opensearch.internal + */ enum Metrics { count, @@ -304,6 +309,11 @@ public InternalExtendedStats reduce(List aggregations, Redu ); } + /** + * Fields for internal extended stats + * + * @opensearch.internal + */ static class Fields { public static final String SUM_OF_SQRS = "sum_of_squares"; public static final String SUM_OF_SQRS_AS_STRING = "sum_of_squares_as_string"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalGeoCentroid.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalGeoCentroid.java index 262f8cc890192..96e7541de25d9 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalGeoCentroid.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalGeoCentroid.java @@ -177,6 +177,11 @@ public Object getProperty(List path) { } } + /** + * Fields for geo centroid + * + * @opensearch.internal + */ static class Fields { static final ParseField CENTROID = new ParseField("location"); static final ParseField COUNT = new ParseField("count"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentileRanks.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentileRanks.java index ba3c917d1b5e6..f517fb678e44f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentileRanks.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentileRanks.java @@ -114,6 +114,11 @@ public static double percentileRank(DoubleHistogram state, double value) { return percentileRank; } + /** + * Terator for HDR percentile ranks agg + * + * @opensearch.internal + */ public static class Iter implements Iterator { private final double[] values; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentiles.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentiles.java index 2b1da6387494b..6bfab8c26ac9a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentiles.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentiles.java @@ -104,6 +104,11 @@ protected AbstractInternalHDRPercentiles createReduced( return new InternalHDRPercentiles(name, keys, merged, keyed, format, metadata); } + /** + * Iterator for HDR percentiles + * + * @opensearch.internal + */ public static class Iter implements Iterator { private final double[] percents; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java index 2c66321ecb331..2ef86786d4b13 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java @@ -53,6 +53,11 @@ public abstract class InternalNumericMetricsAggregation extends InternalAggregat protected DocValueFormat format = DEFAULT_FORMAT; + /** + * A single numeric metric value + * + * @opensearch.internal + */ public abstract static class SingleValue extends InternalNumericMetricsAggregation implements NumericMetricsAggregation.SingleValue { protected SingleValue(String name, Map metadata) { super(name, metadata); @@ -96,6 +101,11 @@ public final double sortValue(String key) { } } + /** + * Multe numeric metric values + * + * @opensearch.internal + */ public abstract static class MultiValue extends InternalNumericMetricsAggregation implements NumericMetricsAggregation.MultiValue { protected MultiValue(String name, Map metadata) { super(name, metadata); diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalStats.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalStats.java index 6bd48f221346b..f9407a0215414 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalStats.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalStats.java @@ -48,6 +48,11 @@ * @opensearch.internal */ public class InternalStats extends InternalNumericMetricsAggregation.MultiValue implements Stats { + /** + * The metrics for the internal stats + * + * @opensearch.internal + */ enum Metrics { count, @@ -195,6 +200,11 @@ public InternalStats reduce(List aggregations, ReduceContex return new InternalStats(name, count, kahanSummation.value(), min, max, format, getMetadata()); } + /** + * Fields for stats agg + * + * @opensearch.internal + */ static class Fields { public static final String COUNT = "count"; public static final String MIN = "min"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentileRanks.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentileRanks.java index 45ce6dc3ead3a..a87564c0a4766 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentileRanks.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentileRanks.java @@ -110,6 +110,11 @@ public static double percentileRank(TDigestState state, double value) { return percentileRank * 100; } + /** + * Iter for the TDigest percentile ranks agg + * + * @opensearch.internal + */ public static class Iter implements Iterator { private final double[] values; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentiles.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentiles.java index 8cc224f2f08ec..cbcb3f0bbcaff 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentiles.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentiles.java @@ -100,6 +100,11 @@ protected AbstractInternalTDigestPercentiles createReduced( return new InternalTDigestPercentiles(name, keys, merged, keyed, format, metadata); } + /** + * Iter for the TDigest percentiles agg + * + * @opensearch.internal + */ public static class Iter implements Iterator { private final double[] percents; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregation.java index 88e292f4d4bd3..d36976d8b703d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregation.java @@ -41,6 +41,11 @@ */ public interface NumericMetricsAggregation extends Aggregation { + /** + * A single value for the metrics agg + * + * @opensearch.internal + */ interface SingleValue extends NumericMetricsAggregation { double value(); @@ -49,5 +54,10 @@ interface SingleValue extends NumericMetricsAggregation { } + /** + * Multi values in a numeric metrics agg + * + * @opensearch.internal + */ interface MultiValue extends NumericMetricsAggregation {} } diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregator.java index 96d2d525e8386..f90e5a092385f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregator.java @@ -51,6 +51,11 @@ private NumericMetricsAggregator(String name, SearchContext context, Aggregator super(name, context, parent, metadata); } + /** + * Single numeric metric agg value + * + * @opensearch.internal + */ public abstract static class SingleValue extends NumericMetricsAggregator { protected SingleValue(String name, SearchContext context, Aggregator parent, Map metadata) throws IOException { @@ -75,6 +80,11 @@ public BucketComparator bucketComparator(String key, SortOrder order) { } } + /** + * Multi numeric metric agg value + * + * @opensearch.internal + */ public abstract static class MultiValue extends NumericMetricsAggregator { protected MultiValue(String name, SearchContext context, Aggregator parent, Map metadata) throws IOException { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesConfig.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesConfig.java index f20cf2eb22350..95b38fcd8cc29 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesConfig.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesConfig.java @@ -123,6 +123,11 @@ public int hashCode() { return Objects.hash(method); } + /** + * The TDigest + * + * @opensearch.internal + */ public static class TDigest extends PercentilesConfig { static final double DEFAULT_COMPRESSION = 100.0; private double compression; @@ -219,6 +224,11 @@ public int hashCode() { } } + /** + * The HDR value + * + * @opensearch.internal + */ public static class Hdr extends PercentilesConfig { static final int DEFAULT_NUMBER_SIG_FIGS = 3; private int numberOfSignificantValueDigits; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregator.java index 2964ede7979cb..414d2e6e99b43 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregator.java @@ -77,6 +77,11 @@ */ class TopHitsAggregator extends MetricsAggregator { + /** + * Collectors for top hits + * + * @opensearch.internal + */ private static class Collectors { public final TopDocsCollector topDocsCollector; public final MaxScoreCollector maxScoreCollector; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketHelpers.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketHelpers.java index d7f82f36a3a5e..3d63a31f24705 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketHelpers.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketHelpers.java @@ -67,6 +67,8 @@ public class BucketHelpers { * * "insert_zeros": empty buckets will be filled with zeros for all metrics * "skip": empty buckets will simply be ignored + * + * @opensearch.internal */ public enum GapPolicy implements Writeable { INSERT_ZEROS((byte) 0, "insert_zeros"), diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/EwmaModel.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/EwmaModel.java index 1fc86dce35390..440d1caddbd9b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/EwmaModel.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/EwmaModel.java @@ -153,6 +153,11 @@ public boolean equals(Object obj) { return Objects.equals(alpha, other.alpha); } + /** + * Builder for the EWMA model + * + * @opensearch.internal + */ public static class EWMAModelBuilder implements MovAvgModelBuilder { private double alpha = DEFAULT_ALPHA; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltLinearModel.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltLinearModel.java index 510f3396cf8a6..8b94a45b4674f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltLinearModel.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltLinearModel.java @@ -195,6 +195,11 @@ public boolean equals(Object obj) { return Objects.equals(alpha, other.alpha) && Objects.equals(beta, other.beta); } + /** + * Builder for the holt linear model + * + * @opensearch.internal + */ public static class HoltLinearModelBuilder implements MovAvgModelBuilder { private double alpha = DEFAULT_ALPHA; private double beta = DEFAULT_BETA; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltWintersModel.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltWintersModel.java index 1dccb17d78b84..34371a6502d85 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltWintersModel.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltWintersModel.java @@ -63,6 +63,11 @@ public class HoltWintersModel extends MovAvgModel { private static final SeasonalityType DEFAULT_SEASONALITY_TYPE = SeasonalityType.ADDITIVE; private static final boolean DEFAULT_PAD = false; + /** + * The seasonality type + * + * @opensearch.internal + */ public enum SeasonalityType { ADDITIVE((byte) 0, "add"), MULTIPLICATIVE((byte) 1, "mult"); @@ -392,6 +397,11 @@ public boolean equals(Object obj) { && Objects.equals(pad, other.pad); } + /** + * Builder for the holt winters model + * + * @opensearch.internal + */ public static class HoltWintersModelBuilder implements MovAvgModelBuilder { private double alpha = DEFAULT_ALPHA; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalPercentilesBucket.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalPercentilesBucket.java index 95028c5a560a5..40c7a5791454c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalPercentilesBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalPercentilesBucket.java @@ -209,6 +209,11 @@ public int hashCode() { return Objects.hash(super.hashCode(), Arrays.hashCode(percents), Arrays.hashCode(percentiles)); } + /** + * Iterator for the percentiles agg + * + * @opensearch.internal + */ public static class Iter implements Iterator { private final double[] percents; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/LinearModel.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/LinearModel.java index 1595c0f5f4514..f1b47730a5542 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/LinearModel.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/LinearModel.java @@ -113,6 +113,11 @@ public MovAvgModel parse(@Nullable Map settings, String pipeline } }; + /** + * Builder for the linear model + * + * @opensearch.internal + */ public static class LinearModelBuilder implements MovAvgModelBuilder { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgModel.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgModel.java index 6b7497235efd9..b629be21b764e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgModel.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgModel.java @@ -158,6 +158,8 @@ protected double[] emptyPredictions(int numPredictions) { /** * Abstract class which also provides some concrete parsing functionality. + * + * @opensearch.internal */ public abstract static class AbstractModelParser { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovingFunctionScript.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovingFunctionScript.java index ff5a4f254e666..20dd463a3cca7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovingFunctionScript.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovingFunctionScript.java @@ -51,6 +51,11 @@ public abstract class MovingFunctionScript { */ public abstract double execute(Map params, double[] values); + /** + * Factory interface + * + * @opensearch.internal + */ public interface Factory extends ScriptFactory { MovingFunctionScript newInstance(); } diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/PipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/PipelineAggregator.java index da4a3b90b273b..4b1134d9e1a60 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/PipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/PipelineAggregator.java @@ -57,6 +57,8 @@ public abstract class PipelineAggregator implements NamedWriteable { /** * Parse the {@link PipelineAggregationBuilder} from a {@link XContentParser}. + * + * @opensearch.internal */ @FunctionalInterface public interface Parser { @@ -81,6 +83,8 @@ public interface Parser { /** * Tree of {@link PipelineAggregator}s to modify a tree of aggregations * after their final reduction. + * + * @opensearch.internal */ public static class PipelineTree { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimpleModel.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimpleModel.java index 4336311c82ba2..0850d1eeb4081 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimpleModel.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimpleModel.java @@ -112,6 +112,11 @@ public MovAvgModel parse(@Nullable Map settings, String pipeline } }; + /** + * Builder for the simple model + * + * @opensearch.internal + */ public static class SimpleModelBuilder implements MovAvgModelBuilder { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/AggregationPath.java b/server/src/main/java/org/opensearch/search/aggregations/support/AggregationPath.java index d93d80493319a..2bdb561879baa 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/AggregationPath.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/AggregationPath.java @@ -128,6 +128,11 @@ public static AggregationPath parse(String path) { return new AggregationPath(tokens); } + /** + * Element in an agg path + * + * @opensearch.internal + */ public static class PathElement { private final String fullName; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/AggregationUsageService.java b/server/src/main/java/org/opensearch/search/aggregations/support/AggregationUsageService.java index f9b6a91444873..eba64998014e2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/AggregationUsageService.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/AggregationUsageService.java @@ -49,6 +49,11 @@ public class AggregationUsageService implements ReportingService> aggs; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/BaseMultiValuesSourceFieldConfig.java b/server/src/main/java/org/opensearch/search/aggregations/support/BaseMultiValuesSourceFieldConfig.java index 8527eaae2ec4b..b7e157b6050fc 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/BaseMultiValuesSourceFieldConfig.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/BaseMultiValuesSourceFieldConfig.java @@ -171,6 +171,11 @@ public String toString() { abstract void doWriteTo(StreamOutput out) throws IOException; + /** + * Base builder for the multi values source field configuration + * + * @opensearch.internal + */ public abstract static class Builder> { String fieldName; Object missing = null; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfig.java b/server/src/main/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfig.java index def1191c70f12..b0c828ca6b902 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfig.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfig.java @@ -36,6 +36,11 @@ public class MultiTermsValuesSourceConfig extends BaseMultiValuesSourceFieldConf private static final String NAME = "field_config"; public static final ParseField FILTER = new ParseField("filter"); + /** + * Parser supplier function + * + * @opensearch.internal + */ public interface ParserSupplier { ObjectParser apply( Boolean scriptable, @@ -156,6 +161,11 @@ public int hashCode() { return Objects.hash(super.hashCode(), userValueTypeHint, format, includeExclude); } + /** + * Builder for the multi terms values source configuration + * + * @opensearch.internal + */ public static class Builder extends BaseMultiValuesSourceFieldConfig.Builder { private ValueType userValueTypeHint = null; private String format; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSource.java b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSource.java index 3ef949c6eebbb..0889a1c90d12d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSource.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSource.java @@ -49,6 +49,11 @@ public abstract class MultiValuesSource { protected Map values; + /** + * Numeric format + * + * @opensearch.internal + */ public static class NumericMultiValuesSource extends MultiValuesSource { public NumericMultiValuesSource(Map valuesSourceConfigs, QueryShardContext context) { values = new HashMap<>(valuesSourceConfigs.size()); diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceAggregationBuilder.java index 7573f69e0833e..a49fd83b9df9f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceAggregationBuilder.java @@ -59,6 +59,11 @@ public abstract class MultiValuesSourceAggregationBuilder> extends AbstractAggregationBuilder { + /** + * Base leaf only class + * + * @opensearch.internal + */ public abstract static class LeafOnly> extends MultiValuesSourceAggregationBuilder< AB> { diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceFieldConfig.java b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceFieldConfig.java index a7145ac871305..63fce83369c18 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceFieldConfig.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceFieldConfig.java @@ -130,6 +130,11 @@ public int hashCode() { return Objects.hash(super.hashCode(), filter); } + /** + * Builder for the field config + * + * @opensearch.internal + */ public static class Builder extends BaseMultiValuesSourceFieldConfig.Builder { private QueryBuilder filter = null; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSource.java b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSource.java index 9bcf7df85d098..ba9e1fcb3ccc1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSource.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSource.java @@ -103,6 +103,11 @@ public boolean hasGlobalOrdinals() { return false; } + /** + * Range type + * + * @opensearch.internal + */ public static class Range extends ValuesSource { private final RangeType rangeType; protected final IndexFieldData indexFieldData; @@ -134,6 +139,11 @@ public RangeType rangeType() { } } + /** + * Bytes type + * + * @opensearch.internal + */ public abstract static class Bytes extends ValuesSource { @Override @@ -147,6 +157,11 @@ public final Function roundingPreparer(IndexReader throw new AggregationExecutionException("can't round a [BYTES]"); } + /** + * Provides ordinals for bytes + * + * @opensearch.internal + */ public abstract static class WithOrdinals extends Bytes { public static final WithOrdinals EMPTY = new WithOrdinals() { @@ -211,6 +226,11 @@ public long globalMaxOrd(IndexSearcher indexSearcher) throws IOException { } } + /** + * Field data for the bytes values source + * + * @opensearch.internal + */ public static class FieldData extends WithOrdinals { protected final IndexOrdinalsFieldData indexFieldData; @@ -257,6 +277,11 @@ public LongUnaryOperator globalOrdinalsMapping(LeafReaderContext context) throws } } + /** + * Field data without ordinals + * + * @opensearch.internal + */ public static class FieldData extends Bytes { protected final IndexFieldData indexFieldData; @@ -274,6 +299,8 @@ public SortedBinaryDocValues bytesValues(LeafReaderContext context) { /** * {@link ValuesSource} implementation for stand alone scripts returning a Bytes value + * + * @opensearch.internal */ public static class Script extends Bytes { @@ -297,6 +324,8 @@ public boolean needsScores() { // No need to implement ReaderContextAware here, the delegate already takes care of updating data structures /** * {@link ValuesSource} subclass for Bytes fields with a Value Script applied + * + * @opensearch.internal */ public static class WithScript extends Bytes { @@ -318,6 +347,11 @@ public SortedBinaryDocValues bytesValues(LeafReaderContext context) throws IOExc return new BytesValues(delegate.bytesValues(context), script.newInstance(context)); } + /** + * Bytes values + * + * @opensearch.internal + */ static class BytesValues extends SortingBinaryDocValues implements ScorerAware { private final SortedBinaryDocValues bytesValues; @@ -358,6 +392,11 @@ public boolean advanceExact(int doc) throws IOException { } } + /** + * Numeric values source type + * + * @opensearch.internal + */ public abstract static class Numeric extends ValuesSource { public static final Numeric EMPTY = new Numeric() { @@ -411,6 +450,8 @@ public Function roundingPreparer(IndexReader reader) throws /** * {@link ValuesSource} subclass for Numeric fields with a Value Script applied + * + * @opensearch.internal */ public static class WithScript extends Numeric { @@ -447,6 +488,11 @@ public SortedNumericDoubleValues doubleValues(LeafReaderContext context) throws return new DoubleValues(delegate.doubleValues(context), script.newInstance(context)); } + /** + * Long values source type + * + * @opensearch.internal + */ static class LongValues extends AbstractSortingNumericDocValues implements ScorerAware { private final SortedNumericDocValues longValues; @@ -478,6 +524,11 @@ public boolean advanceExact(int target) throws IOException { } } + /** + * Double values source type + * + * @opensearch.internal + */ static class DoubleValues extends SortingNumericDoubleValues implements ScorerAware { private final SortedNumericDoubleValues doubleValues; @@ -510,6 +561,11 @@ public boolean advanceExact(int target) throws IOException { } } + /** + * Field data for numerics + * + * @opensearch.internal + */ public static class FieldData extends Numeric { protected final IndexNumericFieldData indexFieldData; @@ -541,6 +597,8 @@ public SortedNumericDoubleValues doubleValues(LeafReaderContext context) { /** * {@link ValuesSource} implementation for stand alone scripts returning a Numeric value + * + * @opensearch.internal */ public static class Script extends Numeric { private final AggregationScript.LeafFactory script; @@ -579,6 +637,11 @@ public boolean needsScores() { } + /** + * Geo point values source + * + * @opensearch.internal + */ public abstract static class GeoPoint extends ValuesSource { public static final GeoPoint EMPTY = new GeoPoint() { @@ -608,6 +671,11 @@ public final Function roundingPreparer(IndexReader public abstract MultiGeoPointValues geoPointValues(LeafReaderContext context); + /** + * Field data for geo point values source + * + * @opensearch.internal + */ public static class Fielddata extends GeoPoint { protected final IndexGeoPointFieldData indexFieldData; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceAggregationBuilder.java index 5eb880642b983..52afc6435d562 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceAggregationBuilder.java @@ -140,6 +140,11 @@ public static void declareFields( } } + /** + * Base leaf only + * + * @opensearch.internal + */ public abstract static class LeafOnly> extends ValuesSourceAggregationBuilder { diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceRegistry.java b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceRegistry.java index 430accde5c279..0cb5a12bac4af 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceRegistry.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceRegistry.java @@ -53,6 +53,11 @@ */ public class ValuesSourceRegistry { + /** + * The registry key for the values source registry key + * + * @opensearch.internal + */ public static final class RegistryKey { private final String name; private final Class supplierType; @@ -82,6 +87,11 @@ public int hashCode() { public static final RegistryKey UNREGISTERED_KEY = new RegistryKey("unregistered", RegistryKey.class); + /** + * Builder for the values source registry + * + * @opensearch.internal + */ public static class Builder { private final AggregationUsageService.Builder usageServiceBuilder; private Map, List>> aggregatorRegistry = new HashMap<>(); diff --git a/server/src/main/java/org/opensearch/search/builder/SearchSourceBuilder.java b/server/src/main/java/org/opensearch/search/builder/SearchSourceBuilder.java index 88281b12f47eb..d3b131cf9f792 100644 --- a/server/src/main/java/org/opensearch/search/builder/SearchSourceBuilder.java +++ b/server/src/main/java/org/opensearch/search/builder/SearchSourceBuilder.java @@ -1471,6 +1471,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Boosts on an index + * + * @opensearch.internal + */ public static class IndexBoost implements Writeable, ToXContentObject { private final String index; private final float boost; @@ -1567,6 +1572,11 @@ public boolean equals(Object obj) { } + /** + * Script field + * + * @opensearch.internal + */ public static class ScriptField implements Writeable, ToXContentFragment { private final boolean ignoreFailure; diff --git a/server/src/main/java/org/opensearch/search/fetch/FetchSubPhase.java b/server/src/main/java/org/opensearch/search/fetch/FetchSubPhase.java index 744505ec98c68..fa30b2a5c7450 100644 --- a/server/src/main/java/org/opensearch/search/fetch/FetchSubPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/FetchSubPhase.java @@ -47,6 +47,11 @@ */ public interface FetchSubPhase { + /** + * The hit context for the fetch subphase + * + * @opensearch.internal + */ class HitContext { private final SearchHit hit; private final LeafReaderContext readerContext; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsContext.java index 04bbe9457661c..78c35098d9cc4 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsContext.java @@ -44,6 +44,11 @@ */ public class ScriptFieldsContext { + /** + * Script field use in the script fields context + * + * @opensearch.internal + */ public static class ScriptField { private final String name; private final FieldScript.LeafFactory script; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightBuilder.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightBuilder.java index 7c2cc5ae1def3..a8a7d290c827e 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightBuilder.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightBuilder.java @@ -469,6 +469,11 @@ public HighlightBuilder rewrite(QueryRewriteContext ctx) throws IOException { } + /** + * Field for highlight builder + * + * @opensearch.internal + */ public static class Field extends AbstractHighlighterBuilder { static final NamedObjectParser PARSER; static { @@ -572,6 +577,11 @@ public Field rewrite(QueryRewriteContext ctx) throws IOException { } } + /** + * Order for highlight builder + * + * @opensearch.internal + */ public enum Order implements Writeable { NONE, SCORE; @@ -598,6 +608,11 @@ public String toString() { } } + /** + * Boundary scanner type + * + * @opensearch.internal + */ public enum BoundaryScannerType implements Writeable { CHARS, WORD, diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightUtils.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightUtils.java index e37d56b1f86b2..7a358b7e4b252 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightUtils.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightUtils.java @@ -80,6 +80,11 @@ public static List loadFieldValues( return fetcher.fetchValues(hitContext.sourceLookup()); } + /** + * Encoders for the highlighters + * + * @opensearch.internal + */ public static class Encoders { public static final Encoder DEFAULT = new DefaultEncoder(); public static final Encoder HTML = new SimpleHTMLEncoder(); diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SearchHighlightContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SearchHighlightContext.java index 6072c738d9d80..33a5397ae964b 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SearchHighlightContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SearchHighlightContext.java @@ -79,6 +79,11 @@ public boolean forceSource(Field field) { return _field == null ? false : _field.fieldOptions.forceSource; } + /** + * Field for the search highlight context + * + * @opensearch.internal + */ public static class Field { private final String field; private final FieldOptions fieldOptions; @@ -99,6 +104,11 @@ public FieldOptions fieldOptions() { } } + /** + * Field options for the search highlight context + * + * @opensearch.internal + */ public static class FieldOptions { // Field options that default to null or -1 are often set to their real default in HighlighterParseElement#parse diff --git a/server/src/main/java/org/opensearch/search/query/QueryPhase.java b/server/src/main/java/org/opensearch/search/query/QueryPhase.java index 0b935baf6419b..340a32e914e08 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryPhase.java +++ b/server/src/main/java/org/opensearch/search/query/QueryPhase.java @@ -388,6 +388,8 @@ private static boolean canEarlyTerminate(IndexReader reader, SortAndFormats sort /** * The exception being raised when search timeout is reached. + * + * @opensearch.internal */ public static class TimeExceededException extends RuntimeException { private static final long serialVersionUID = 1L; @@ -395,6 +397,8 @@ public static class TimeExceededException extends RuntimeException { /** * Default {@link QueryPhaseSearcher} implementation which delegates to the {@link QueryPhase}. + * + * @opensearch.internal */ public static class DefaultQueryPhaseSearcher implements QueryPhaseSearcher { /** diff --git a/server/src/main/java/org/opensearch/search/rescore/QueryRescorer.java b/server/src/main/java/org/opensearch/search/rescore/QueryRescorer.java index afd897ef49aa7..008bff18cea5b 100644 --- a/server/src/main/java/org/opensearch/search/rescore/QueryRescorer.java +++ b/server/src/main/java/org/opensearch/search/rescore/QueryRescorer.java @@ -184,6 +184,11 @@ private TopDocs combine(TopDocs in, TopDocs resorted, QueryRescoreContext ctx) { return in; } + /** + * Context used during query rescoring + * + * @opensearch.internal + */ public static class QueryRescoreContext extends RescoreContext { private Query query; private float queryWeight = 1.0f; diff --git a/server/src/main/java/org/opensearch/search/sort/BucketedSort.java b/server/src/main/java/org/opensearch/search/sort/BucketedSort.java index b6b5c58502063..9266469db2b05 100644 --- a/server/src/main/java/org/opensearch/search/sort/BucketedSort.java +++ b/server/src/main/java/org/opensearch/search/sort/BucketedSort.java @@ -98,6 +98,8 @@ public abstract class BucketedSort implements Releasable { /** * Callbacks for storing extra data along with competitive sorts. + * + * @opensearch.internal */ public interface ExtraData { /** @@ -115,6 +117,11 @@ public interface ExtraData { */ Loader loader(LeafReaderContext ctx) throws IOException; + /** + * Loader for extra data + * + * @opensearch.internal + */ @FunctionalInterface interface Loader { /** @@ -185,6 +192,8 @@ public int getBucketSize() { /** * Used with {@link BucketedSort#getValues(long, ResultBuilder)} to * build results from the sorting operation. + * + * @opensearch.internal */ @FunctionalInterface public interface ResultBuilder { @@ -532,6 +541,11 @@ protected final void swap(long lhs, long rhs) { values.set(rhs, tmp); } + /** + * Leaf for doubles + * + * @opensearch.internal + */ protected abstract class Leaf extends BucketedSort.Leaf { protected Leaf(LeafReaderContext ctx) { super(ctx); @@ -625,6 +639,11 @@ protected final void swap(long lhs, long rhs) { values.set(rhs, tmp); } + /** + * Leaf for floats + * + * @opensearch.internal + */ protected abstract class Leaf extends BucketedSort.Leaf { protected Leaf(LeafReaderContext ctx) { super(ctx); @@ -704,6 +723,11 @@ protected final void swap(long lhs, long rhs) { values.set(rhs, tmp); } + /** + * Leaf for bucketed sort + * + * @opensearch.internal + */ protected abstract class Leaf extends BucketedSort.Leaf { protected Leaf(LeafReaderContext ctx) { super(ctx); diff --git a/server/src/main/java/org/opensearch/search/sort/ScriptSortBuilder.java b/server/src/main/java/org/opensearch/search/sort/ScriptSortBuilder.java index 6a412eb3b5e2b..685284dfe99ff 100644 --- a/server/src/main/java/org/opensearch/search/sort/ScriptSortBuilder.java +++ b/server/src/main/java/org/opensearch/search/sort/ScriptSortBuilder.java @@ -460,6 +460,11 @@ public String getWriteableName() { return NAME; } + /** + * Sort type for scripting + * + * @opensearch.internal + */ public enum ScriptSortType implements Writeable { /** script sort for a string value **/ STRING, diff --git a/server/src/main/java/org/opensearch/search/suggest/SuggestionSearchContext.java b/server/src/main/java/org/opensearch/search/suggest/SuggestionSearchContext.java index 9b38c73692eda..f0d8efc64b6b3 100644 --- a/server/src/main/java/org/opensearch/search/suggest/SuggestionSearchContext.java +++ b/server/src/main/java/org/opensearch/search/suggest/SuggestionSearchContext.java @@ -55,6 +55,11 @@ public Map suggestions() { return suggestions; } + /** + * The suggestion context + * + * @opensearch.internal + */ public abstract static class SuggestionContext { private BytesRef text; diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestion.java b/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestion.java index e8245d46a6231..95133585f99d9 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestion.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestion.java @@ -256,6 +256,11 @@ protected Entry newEntry(StreamInput in) throws IOException { return new Entry(in); } + /** + * Entry in the completion suggester + * + * @opensearch.internal + */ public static final class Entry extends Suggest.Suggestion.Entry { public Entry(Text text, int offset, int length) { @@ -287,6 +292,11 @@ public static Entry fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } + /** + * Options for the completion suggester + * + * @opensearch.internal + */ public static class Option extends Suggest.Suggestion.Entry.Option { private final Map> contexts; private final ScoreDoc doc; diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/FuzzyOptions.java b/server/src/main/java/org/opensearch/search/suggest/completion/FuzzyOptions.java index 6c4a71a00e07a..af7a07af58d45 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/FuzzyOptions.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/FuzzyOptions.java @@ -220,6 +220,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws /** * Options for fuzzy queries + * + * @opensearch.internal */ public static class Builder { diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/RegexOptions.java b/server/src/main/java/org/opensearch/search/suggest/completion/RegexOptions.java index fc33eda23a423..d832dc9d8d5d8 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/RegexOptions.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/RegexOptions.java @@ -155,6 +155,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws /** * Options for regular expression queries + * + * @opensearch.internal */ public static class Builder { private int flagsValue = RegExp.ALL; diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryContextMapping.java b/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryContextMapping.java index 624e828d78b83..dbefaff2b1ac9 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryContextMapping.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryContextMapping.java @@ -219,6 +219,8 @@ public int hashCode() { /** * Builder for {@link CategoryContextMapping} + * + * @opensearch.internal */ public static class Builder extends ContextBuilder { diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryQueryContext.java b/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryQueryContext.java index bc31e88587870..5a1b218eab510 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryQueryContext.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryQueryContext.java @@ -151,6 +151,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Builder for the category query context + * + * @opensearch.internal + */ public static class Builder { private String category; private boolean isPrefix = false; diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextMapping.java b/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextMapping.java index 3492da40edd77..6b6588e125fe0 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextMapping.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextMapping.java @@ -67,6 +67,11 @@ public abstract class ContextMapping implements ToXContent protected final Type type; protected final String name; + /** + * Type of context mapping + * + * @opensearch.internal + */ public enum Type { CATEGORY, GEO; @@ -189,6 +194,11 @@ public String toString() { } } + /** + * The internal query context + * + * @opensearch.internal + */ public static class InternalQueryContext { public final String context; public final int boost; diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoContextMapping.java b/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoContextMapping.java index f191e371d672f..e3b809dc57b83 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoContextMapping.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoContextMapping.java @@ -363,6 +363,11 @@ public int hashCode() { return Objects.hash(super.hashCode(), precision, fieldName); } + /** + * Builder for geo context mapping + * + * @opensearch.internal + */ public static class Builder extends ContextBuilder { private int precision = DEFAULT_PRECISION; diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoQueryContext.java b/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoQueryContext.java index d47c79747a841..b362d01304e22 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoQueryContext.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoQueryContext.java @@ -177,6 +177,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Builder for the geo context + * + * @opensearch.internal + */ public static class Builder { private GeoPoint geoPoint; private int boost = 1; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGenerator.java b/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGenerator.java index c8ca01d6991cb..cbf1d332dfa1b 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGenerator.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGenerator.java @@ -278,6 +278,11 @@ int thresholdTermFrequency(int docFreq) { return 0; } + /** + * Token consumer for a direct candidate + * + * @opensearch.internal + */ public abstract static class TokenConsumer { protected CharTermAttribute charTermAttr; protected PositionIncrementAttribute posIncAttr; @@ -299,6 +304,11 @@ protected BytesRef fillBytesRef(BytesRefBuilder spare) { public void end() {} } + /** + * Candidate set of terms + * + * @opensearch.internal + */ public static class CandidateSet { public Candidate[] candidates; public final Candidate originalTerm; @@ -328,6 +338,11 @@ public void addOneCandidate(Candidate candidate) { } + /** + * Candidate term + * + * @opensearch.internal + */ public static class Candidate implements Comparable { public static final Candidate[] EMPTY = new Candidate[0]; public final BytesRef term; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestion.java b/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestion.java index 648d00e350976..4a2ff2388c04d 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestion.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestion.java @@ -87,6 +87,11 @@ public static PhraseSuggestion fromXContent(XContentParser parser, String name) return suggestion; } + /** + * Entry in the phrase suggester + * + * @opensearch.internal + */ public static class Entry extends Suggestion.Entry { protected double cutoffScore = Double.MIN_VALUE; @@ -170,6 +175,11 @@ public int hashCode() { return Objects.hash(super.hashCode(), cutoffScore); } + /** + * Options for phrase suggestion + * + * @opensearch.internal + */ public static class Option extends Suggestion.Entry.Option { public Option(Text text, Text highlighted, float score, Boolean collateMatch) { diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestionBuilder.java b/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestionBuilder.java index ca9effe722297..dd9046e182cc2 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestionBuilder.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestionBuilder.java @@ -772,6 +772,8 @@ protected int doHashCode() { /** * {@link CandidateGenerator} interface. + * + * @opensearch.internal */ public interface CandidateGenerator extends Writeable, ToXContentObject { String getType(); diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/WordScorer.java b/server/src/main/java/org/opensearch/search/suggest/phrase/WordScorer.java index 4a32aee83b36e..184e3828b06e5 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/WordScorer.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/WordScorer.java @@ -133,6 +133,11 @@ public static BytesRef join(BytesRef separator, BytesRefBuilder result, BytesRef return result.get(); } + /** + * Factory for a new scorer + * + * @opensearch.internal + */ public interface WordScorerFactory { WordScorer newScorer(IndexReader reader, Terms terms, String field, double realWordLikelihood, BytesRef separator) throws IOException; diff --git a/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestion.java b/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestion.java index 78d0e8f58e6a5..d7d0b57213c15 100644 --- a/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestion.java +++ b/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestion.java @@ -79,8 +79,12 @@ public TermSuggestion(StreamInput in) throws IOException { } } - // Same behaviour as comparators in suggest module, but for SuggestedWord - // Highest score first, then highest freq first, then lowest term first + /** + * Same behaviour as comparators in suggest module, but for SuggestedWord + * Highest score first, then highest freq first, then lowest term first + * + * @opensearch.internal + */ public static class Score implements Comparator { @Override @@ -94,8 +98,12 @@ public int compare(Suggestion.Entry.Option first, Suggestion.Entry.Option second } } - // Same behaviour as comparators in suggest module, but for SuggestedWord - // Highest freq first, then highest score first, then lowest term first + /** + * Same behaviour as comparators in suggest module, but for SuggestedWord + * Highest freq first, then highest score first, then lowest term first + * + * @opensearch.internal + */ public static class Frequency implements Comparator { @Override @@ -181,6 +189,8 @@ public int hashCode() { /** * Represents a part from the suggest text with suggested options. + * + * @opensearch.internal */ public static class Entry extends Suggest.Suggestion.Entry { @@ -215,6 +225,8 @@ public static Entry fromXContent(XContentParser parser) { /** * Contains the suggested text with its document frequency and score. + * + * @opensearch.internal */ public static class Option extends Suggest.Suggestion.Entry.Option { diff --git a/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestionBuilder.java b/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestionBuilder.java index 27916ef03e9b1..e53c27596e5fd 100644 --- a/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestionBuilder.java +++ b/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestionBuilder.java @@ -512,7 +512,11 @@ protected int doHashCode() { ); } - /** An enum representing the valid suggest modes. */ + /** + * An enum representing the valid suggest modes. + * + * @opensearch.internal + */ public enum SuggestMode implements Writeable { /** Only suggest terms in the suggest text that aren't in the index. This is the default. */ MISSING { @@ -553,7 +557,11 @@ public static SuggestMode resolve(final String str) { public abstract org.apache.lucene.search.spell.SuggestMode toLucene(); } - /** An enum representing the valid string edit distance algorithms for determining suggestions. */ + /** + * An enum representing the valid string edit distance algorithms for determining suggestions. + * + * @opensearch.internal + */ public enum StringDistanceImpl implements Writeable { /** This is the default and is based on damerau_levenshtein, but highly optimized * for comparing string distance for terms inside the index. */ From ad7ce4cd446523d52286530ccfbb1dabc2dc7f86 Mon Sep 17 00:00:00 2001 From: Nick Knize Date: Wed, 11 May 2022 15:58:10 -0500 Subject: [PATCH 02/20] [Javadocs] add to o.o.common (#3289) Add javadocs to top level and internal classes in the org.opensearch.common package. Signed-off-by: Nicholas Walter Knize --- .../opensearch/common/AsyncBiFunction.java | 2 + .../opensearch/common/CheckedBiConsumer.java | 2 + .../opensearch/common/CheckedBiFunction.java | 2 + .../opensearch/common/CheckedSupplier.java | 2 + .../java/org/opensearch/common/Classes.java | 5 ++ .../java/org/opensearch/common/Explicit.java | 1 + .../ExponentiallyWeightedMovingAverage.java | 2 + .../opensearch/common/FieldMemoryStats.java | 2 + .../common/LegacyTimeBasedUUIDGenerator.java | 2 + .../opensearch/common/LocalTimeOffset.java | 38 ++++++++++++++ .../opensearch/common/MacAddressProvider.java | 5 ++ .../org/opensearch/common/NamedRegistry.java | 2 + .../java/org/opensearch/common/Numbers.java | 2 + .../opensearch/common/ParsingException.java | 2 + .../java/org/opensearch/common/PidFile.java | 2 + .../java/org/opensearch/common/Priority.java | 5 ++ .../common/RandomBasedUUIDGenerator.java | 5 ++ .../org/opensearch/common/Randomness.java | 2 + .../java/org/opensearch/common/Rounding.java | 24 +++++++++ .../opensearch/common/SecureRandomHolder.java | 5 ++ .../java/org/opensearch/common/StopWatch.java | 4 +- .../java/org/opensearch/common/Strings.java | 5 ++ .../common/SuppressLoggerChecks.java | 2 + .../java/org/opensearch/common/Table.java | 10 ++++ .../common/TimeBasedUUIDGenerator.java | 2 + .../org/opensearch/common/TriConsumer.java | 2 + .../org/opensearch/common/TriFunction.java | 2 + .../org/opensearch/common/UUIDGenerator.java | 2 + .../java/org/opensearch/common/UUIDs.java | 5 ++ .../common/ValidationException.java | 2 + .../common/blobstore/BlobContainer.java | 2 + .../common/blobstore/BlobMetadata.java | 2 + .../opensearch/common/blobstore/BlobPath.java | 2 + .../common/blobstore/BlobStore.java | 2 + .../common/blobstore/BlobStoreException.java | 5 ++ .../common/blobstore/DeleteResult.java | 2 + .../common/blobstore/fs/FsBlobContainer.java | 2 + .../common/blobstore/fs/FsBlobStore.java | 5 ++ .../support/AbstractBlobContainer.java | 2 + .../support/FilterBlobContainer.java | 5 ++ .../blobstore/support/PlainBlobMetadata.java | 5 ++ .../breaker/ChildMemoryCircuitBreaker.java | 7 +++ .../common/breaker/CircuitBreaker.java | 2 + .../breaker/CircuitBreakingException.java | 2 + .../common/breaker/NoopCircuitBreaker.java | 2 + .../common/bytes/AbstractBytesReference.java | 5 ++ .../opensearch/common/bytes/BytesArray.java | 5 ++ .../common/bytes/BytesReference.java | 2 + .../common/bytes/CompositeBytesReference.java | 2 + .../common/bytes/PagedBytesReference.java | 2 + .../bytes/RecyclingBytesStreamOutput.java | 2 + .../bytes/ReleasableBytesReference.java | 2 + .../org/opensearch/common/cache/Cache.java | 19 +++++++ .../opensearch/common/cache/CacheBuilder.java | 5 ++ .../opensearch/common/cache/CacheLoader.java | 5 ++ .../common/cache/RemovalListener.java | 5 ++ .../common/cache/RemovalNotification.java | 5 ++ .../common/collect/CopyOnWriteHashMap.java | 13 +++++ .../common/collect/EvictingQueue.java | 2 + .../opensearch/common/collect/HppcMaps.java | 5 ++ .../common/collect/ImmutableOpenIntMap.java | 7 +++ .../common/collect/ImmutableOpenMap.java | 7 +++ .../opensearch/common/collect/Iterators.java | 5 ++ .../opensearch/common/collect/MapBuilder.java | 5 ++ .../component/AbstractLifecycleComponent.java | 5 ++ .../common/component/Lifecycle.java | 2 + .../common/component/LifecycleComponent.java | 5 ++ .../common/component/LifecycleListener.java | 5 ++ .../common/compress/CompressedXContent.java | 2 + .../common/compress/Compressor.java | 5 ++ .../common/compress/CompressorFactory.java | 5 ++ .../common/compress/DeflateCompressor.java | 2 + .../compress/NotCompressedException.java | 10 ++-- .../common/compress/NotXContentException.java | 8 ++- .../concurrent/AutoCloseableRefCounted.java | 2 + .../common/concurrent/GatedCloseable.java | 2 + .../common/concurrent/OneWayGate.java | 2 + .../concurrent/RefCountedReleasable.java | 2 + .../common/document/DocumentField.java | 2 + .../opensearch/common/geo/GeoBoundingBox.java | 2 + .../opensearch/common/geo/GeoDistance.java | 2 + .../org/opensearch/common/geo/GeoJson.java | 5 ++ .../common/geo/GeoJsonGeometryFormat.java | 5 ++ .../common/geo/GeoLineDecomposer.java | 2 + .../org/opensearch/common/geo/GeoPoint.java | 5 ++ .../common/geo/GeoPolygonDecomposer.java | 2 + .../opensearch/common/geo/GeoShapeType.java | 2 + .../opensearch/common/geo/GeoShapeUtils.java | 2 + .../org/opensearch/common/geo/GeoUtils.java | 5 ++ .../opensearch/common/geo/GeometryFormat.java | 2 + .../org/opensearch/common/geo/GeometryIO.java | 2 + .../opensearch/common/geo/GeometryParser.java | 2 + .../opensearch/common/geo/ShapeRelation.java | 2 + .../common/geo/ShapesAvailability.java | 5 ++ .../common/geo/SpatialStrategy.java | 8 +++ .../common/geo/WKTGeometryFormat.java | 5 ++ .../common/geo/XShapeCollection.java | 2 + .../common/geo/builders/CircleBuilder.java | 5 ++ .../geo/builders/CoordinatesBuilder.java | 2 + .../common/geo/builders/EnvelopeBuilder.java | 5 ++ .../builders/GeometryCollectionBuilder.java | 5 ++ .../geo/builders/LineStringBuilder.java | 5 ++ .../geo/builders/MultiLineStringBuilder.java | 5 ++ .../geo/builders/MultiPointBuilder.java | 5 ++ .../geo/builders/MultiPolygonBuilder.java | 5 ++ .../common/geo/builders/PointBuilder.java | 5 ++ .../common/geo/builders/PolygonBuilder.java | 2 + .../common/geo/builders/ShapeBuilder.java | 2 + .../common/geo/parsers/CoordinateNode.java | 2 + .../common/geo/parsers/GeoJsonParser.java | 2 + .../common/geo/parsers/GeoWKTParser.java | 2 + .../common/geo/parsers/ShapeParser.java | 2 + .../common/hash/MessageDigests.java | 2 + .../opensearch/common/hash/MurmurHash3.java | 4 ++ .../common/inject/AbstractModule.java | 2 + .../common/inject/AbstractProcessor.java | 2 + .../org/opensearch/common/inject/Binder.java | 2 + .../org/opensearch/common/inject/Binding.java | 2 + .../common/inject/BindingAnnotation.java | 2 + .../common/inject/BindingProcessor.java | 2 + .../common/inject/BoundProviderFactory.java | 2 + .../common/inject/ConfigurationException.java | 2 + .../common/inject/ConstantFactory.java | 4 ++ .../common/inject/ConstructionProxy.java | 2 + .../inject/ConstructionProxyFactory.java | 2 + .../common/inject/ConstructorBindingImpl.java | 10 ++++ .../common/inject/ConstructorInjector.java | 2 + .../inject/ConstructorInjectorStore.java | 2 + .../common/inject/ContextualCallable.java | 4 ++ .../common/inject/CreationException.java | 2 + .../DefaultConstructionProxyFactory.java | 2 + .../common/inject/DeferredLookups.java | 2 + .../common/inject/EncounterImpl.java | 4 ++ .../org/opensearch/common/inject/Exposed.java | 2 + .../common/inject/ExposedKeyFactory.java | 2 + .../common/inject/FactoryProxy.java | 2 + .../org/opensearch/common/inject/Guice.java | 2 + .../common/inject/ImplementedBy.java | 2 + .../common/inject/InheritingState.java | 4 ++ .../common/inject/Initializable.java | 2 + .../common/inject/Initializables.java | 4 ++ .../opensearch/common/inject/Initializer.java | 2 + .../org/opensearch/common/inject/Inject.java | 2 + .../inject/InjectionRequestProcessor.java | 2 + .../opensearch/common/inject/Injector.java | 2 + .../common/inject/InjectorBuilder.java | 2 + .../common/inject/InjectorImpl.java | 17 ++++++ .../common/inject/InjectorShell.java | 22 ++++++++ .../InternalFactoryToProviderAdapter.java | 4 ++ .../org/opensearch/common/inject/Key.java | 12 +++++ .../common/inject/LookupProcessor.java | 2 + .../org/opensearch/common/inject/Lookups.java | 2 + .../common/inject/MembersInjector.java | 2 + .../common/inject/MembersInjectorImpl.java | 2 + .../common/inject/MembersInjectorStore.java | 2 + .../common/inject/MessageProcessor.java | 2 + .../org/opensearch/common/inject/Module.java | 2 + .../common/inject/ModulesBuilder.java | 5 ++ .../common/inject/OutOfScopeException.java | 2 + .../common/inject/PreProcessModule.java | 2 +- .../common/inject/PrivateBinder.java | 2 + .../inject/PrivateElementProcessor.java | 2 + .../common/inject/PrivateModule.java | 2 + .../opensearch/common/inject/ProvidedBy.java | 2 + .../opensearch/common/inject/Provider.java | 2 + .../ProviderToInternalFactoryAdapter.java | 4 ++ .../opensearch/common/inject/Provides.java | 2 + .../common/inject/ProvisionException.java | 2 + .../opensearch/common/inject/Reflection.java | 2 + .../org/opensearch/common/inject/Scope.java | 2 + .../common/inject/ScopeAnnotation.java | 2 + .../common/inject/ScopeBindingProcessor.java | 2 + .../org/opensearch/common/inject/Scopes.java | 2 + .../common/inject/SingleFieldInjector.java | 2 + .../common/inject/SingleMemberInjector.java | 2 + .../common/inject/SingleMethodInjector.java | 2 + .../inject/SingleParameterInjector.java | 2 + .../opensearch/common/inject/Singleton.java | 2 + .../org/opensearch/common/inject/Stage.java | 2 + .../org/opensearch/common/inject/State.java | 2 + .../inject/TypeConverterBindingProcessor.java | 2 + .../inject/TypeListenerBindingProcessor.java | 2 + .../opensearch/common/inject/TypeLiteral.java | 2 + .../opensearch/common/inject/WeakKeySet.java | 2 + .../inject/assistedinject/Assisted.java | 2 + .../assistedinject/AssistedConstructor.java | 2 + .../inject/assistedinject/AssistedInject.java | 2 + .../assistedinject/FactoryProvider.java | 2 + .../inject/assistedinject/Parameter.java | 2 + .../assistedinject/ParameterListKey.java | 2 + .../binder/AnnotatedBindingBuilder.java | 2 + .../AnnotatedConstantBindingBuilder.java | 2 + .../binder/AnnotatedElementBuilder.java | 2 + .../inject/binder/ConstantBindingBuilder.java | 2 + .../inject/binder/LinkedBindingBuilder.java | 2 + .../inject/binder/ScopedBindingBuilder.java | 2 + .../internal/AbstractBindingBuilder.java | 2 + .../common/inject/internal/Annotations.java | 2 + .../inject/internal/BindingBuilder.java | 2 + .../common/inject/internal/BindingImpl.java | 4 ++ .../internal/ConstantBindingBuilderImpl.java | 2 + .../inject/internal/ConstructionContext.java | 7 +++ .../common/inject/internal/ErrorHandler.java | 2 + .../common/inject/internal/Errors.java | 7 +++ .../inject/internal/ErrorsException.java | 2 + .../inject/internal/ExpirationTimer.java | 2 + .../inject/internal/ExposedBindingImpl.java | 5 ++ .../inject/internal/ExposureBuilder.java | 2 + .../common/inject/internal/FailableCache.java | 2 + .../inject/internal/InstanceBindingImpl.java | 5 ++ .../inject/internal/InternalContext.java | 2 + .../inject/internal/InternalFactory.java | 2 + .../inject/internal/LinkedBindingImpl.java | 5 ++ .../internal/LinkedProviderBindingImpl.java | 5 ++ .../inject/internal/MatcherAndConverter.java | 4 ++ .../common/inject/internal/MoreTypes.java | 16 ++++++ .../common/inject/internal/Nullability.java | 2 + .../inject/internal/PrivateElementsImpl.java | 4 ++ .../internal/ProviderInstanceBindingImpl.java | 5 ++ .../inject/internal/ProviderMethod.java | 2 + .../internal/ProviderMethodsModule.java | 2 + .../common/inject/internal/Scoping.java | 2 + .../inject/internal/SourceProvider.java | 2 + .../inject/internal/StackTraceElements.java | 2 + .../common/inject/internal/Stopwatch.java | 2 + .../common/inject/internal/Strings.java | 2 + .../inject/internal/ToStringBuilder.java | 2 + .../inject/internal/UniqueAnnotations.java | 4 ++ .../internal/UntargettedBindingImpl.java | 5 ++ .../inject/matcher/AbstractMatcher.java | 12 +++++ .../common/inject/matcher/Matcher.java | 2 + .../common/inject/matcher/Matchers.java | 52 +++++++++++++++++++ .../common/inject/multibindings/Element.java | 2 + .../inject/multibindings/MapBinder.java | 7 +++ .../inject/multibindings/Multibinder.java | 2 + .../inject/multibindings/RealElement.java | 4 ++ .../opensearch/common/inject/name/Named.java | 2 + .../common/inject/name/NamedImpl.java | 5 ++ .../opensearch/common/inject/name/Names.java | 2 + .../inject/spi/BindingScopingVisitor.java | 2 + .../inject/spi/BindingTargetVisitor.java | 2 + .../common/inject/spi/ConstructorBinding.java | 2 + .../inject/spi/ConvertedConstantBinding.java | 2 + .../spi/DefaultBindingScopingVisitor.java | 2 + .../spi/DefaultBindingTargetVisitor.java | 2 + .../inject/spi/DefaultElementVisitor.java | 2 + .../common/inject/spi/Dependency.java | 2 + .../opensearch/common/inject/spi/Element.java | 2 + .../common/inject/spi/ElementVisitor.java | 2 + .../common/inject/spi/Elements.java | 7 +++ .../common/inject/spi/ExposedBinding.java | 2 + .../common/inject/spi/HasDependencies.java | 2 + .../common/inject/spi/InjectionListener.java | 2 + .../common/inject/spi/InjectionPoint.java | 2 + .../common/inject/spi/InjectionRequest.java | 2 + .../common/inject/spi/InstanceBinding.java | 2 + .../common/inject/spi/LinkedKeyBinding.java | 2 + .../inject/spi/MembersInjectorLookup.java | 2 + .../opensearch/common/inject/spi/Message.java | 2 + .../common/inject/spi/PrivateElements.java | 2 + .../common/inject/spi/ProviderBinding.java | 2 + .../inject/spi/ProviderInstanceBinding.java | 2 + .../common/inject/spi/ProviderKeyBinding.java | 2 + .../common/inject/spi/ProviderLookup.java | 7 +++ .../inject/spi/ProviderWithDependencies.java | 2 + .../common/inject/spi/ScopeBinding.java | 2 + .../inject/spi/StaticInjectionRequest.java | 2 + .../common/inject/spi/TypeConverter.java | 2 + .../inject/spi/TypeConverterBinding.java | 2 + .../common/inject/spi/TypeEncounter.java | 2 + .../common/inject/spi/TypeListener.java | 2 + .../inject/spi/TypeListenerBinding.java | 2 + .../common/inject/spi/UntargettedBinding.java | 2 + .../common/inject/util/Modules.java | 7 +++ .../common/inject/util/Providers.java | 2 + .../opensearch/common/inject/util/Types.java | 2 + .../org/opensearch/common/io/Channels.java | 5 ++ .../common/io/DiskIoBufferPool.java | 5 ++ .../opensearch/common/io/FileSystemUtils.java | 2 + .../org/opensearch/common/io/Streams.java | 6 +++ .../common/io/UTF8StreamWriter.java | 5 ++ .../io/stream/ByteBufferStreamInput.java | 5 ++ .../common/io/stream/BytesStream.java | 5 ++ .../common/io/stream/BytesStreamInput.java | 2 + .../common/io/stream/BytesStreamOutput.java | 2 + .../io/stream/DataOutputStreamOutput.java | 5 ++ .../common/io/stream/DelayableWriteable.java | 9 ++++ .../common/io/stream/FilterStreamInput.java | 2 + .../io/stream/InputStreamStreamInput.java | 5 ++ .../common/io/stream/NamedWriteable.java | 2 + .../NamedWriteableAwareStreamInput.java | 2 + .../io/stream/NamedWriteableRegistry.java | 8 ++- .../NotSerializableExceptionWrapper.java | 2 + .../io/stream/OutputStreamStreamOutput.java | 5 ++ .../stream/ReleasableBytesStreamOutput.java | 2 + .../common/io/stream/StreamInput.java | 2 + .../common/io/stream/StreamOutput.java | 2 + .../io/stream/VersionedNamedWriteable.java | 2 + .../common/io/stream/Writeable.java | 2 + .../java/org/opensearch/common/joda/Joda.java | 17 ++++++ .../common/joda/JodaDateFormatter.java | 5 ++ .../common/joda/JodaDateMathParser.java | 2 + .../common/joda/JodaDeprecationPatterns.java | 5 ++ .../opensearch/common/lease/Releasable.java | 2 + .../opensearch/common/lease/Releasables.java | 6 ++- .../common/logging/DeprecatedMessage.java | 2 + .../common/logging/DeprecationLogger.java | 2 + .../common/logging/HeaderWarning.java | 2 + .../common/logging/HeaderWarningAppender.java | 5 ++ .../JsonThrowablePatternConverter.java | 2 + .../common/logging/LogConfigurator.java | 5 ++ .../common/logging/LoggerMessageFormat.java | 2 + .../opensearch/common/logging/Loggers.java | 2 + .../common/logging/LoggingOutputStream.java | 2 + .../logging/NodeAndClusterIdConverter.java | 2 + .../NodeAndClusterIdStateListener.java | 2 + .../logging/NodeNamePatternConverter.java | 2 + .../common/logging/OpenSearchJsonLayout.java | 7 +++ .../common/logging/OpenSearchLogMessage.java | 2 + .../OpenSearchMessageFieldConverter.java | 2 + .../common/logging/PrefixLogger.java | 2 + .../common/logging/RateLimitingFilter.java | 5 ++ .../opensearch/common/lucene/BytesRefs.java | 5 ++ .../common/lucene/LoggerInfoStream.java | 8 ++- .../org/opensearch/common/lucene/Lucene.java | 5 ++ .../common/lucene/MinimumScoreCollector.java | 5 ++ .../opensearch/common/lucene/ScorerAware.java | 5 ++ .../common/lucene/ShardCoreKeyMap.java | 2 + .../lucene/index/FilterableTermsEnum.java | 7 +++ .../common/lucene/index/FreqTermsEnum.java | 2 + .../index/OpenSearchDirectoryReader.java | 2 + .../lucene/index/OpenSearchLeafReader.java | 2 + .../SequentialStoredFieldsLeafReader.java | 2 + .../lucene/search/AutomatonQueries.java | 2 + .../lucene/search/FilteredCollector.java | 5 ++ .../lucene/search/MoreLikeThisQuery.java | 5 ++ .../lucene/search/MultiPhrasePrefixQuery.java | 5 ++ .../common/lucene/search/Queries.java | 10 ++++ .../SpanBooleanQueryRewriteWithMaxClause.java | 2 + .../lucene/search/TopDocsAndMaxScore.java | 2 + .../common/lucene/search/XMoreLikeThis.java | 11 ++++ .../search/function/CombineFunction.java | 5 ++ .../function/FieldValueFactorFunction.java | 2 + .../search/function/FunctionScoreQuery.java | 12 +++++ .../lucene/search/function/Functions.java | 2 + .../search/function/LeafScoreFunction.java | 6 ++- .../search/function/MinScoreScorer.java | 8 ++- .../search/function/RandomScoreFunction.java | 2 + .../lucene/search/function/ScoreFunction.java | 5 ++ .../search/function/ScriptScoreFunction.java | 5 ++ .../search/function/ScriptScoreQuery.java | 14 +++++ .../search/function/WeightFactorFunction.java | 10 ++++ .../lucene/store/ByteArrayIndexInput.java | 2 + .../lucene/store/FilterIndexOutput.java | 2 + .../lucene/store/IndexOutputOutputStream.java | 2 + .../lucene/store/InputStreamIndexInput.java | 5 ++ .../uid/PerThreadIDVersionAndSeqNoLookup.java | 2 + .../common/lucene/uid/Versions.java | 5 ++ .../lucene/uid/VersionsAndSeqNoResolver.java | 18 +++++-- .../common/metrics/CounterMetric.java | 5 ++ .../opensearch/common/metrics/MeanMetric.java | 5 ++ .../org/opensearch/common/metrics/Metric.java | 5 ++ .../org/opensearch/common/network/Cidrs.java | 5 ++ .../common/network/CloseableChannel.java | 5 ++ .../opensearch/common/network/IfConfig.java | 2 + .../common/network/InetAddresses.java | 5 ++ .../common/network/NetworkAddress.java | 2 + .../common/network/NetworkModule.java | 2 + .../common/network/NetworkService.java | 5 ++ .../common/network/NetworkUtils.java | 2 + .../org/opensearch/common/path/PathTrie.java | 5 ++ .../common/recycler/AbstractRecycler.java | 5 ++ .../common/recycler/AbstractRecyclerC.java | 5 ++ .../recycler/ConcurrentDequeRecycler.java | 2 + .../common/recycler/DequeRecycler.java | 2 + .../common/recycler/FilterRecycler.java | 5 ++ .../common/recycler/NoneRecycler.java | 10 ++++ .../opensearch/common/recycler/Recycler.java | 2 + .../opensearch/common/recycler/Recyclers.java | 5 ++ .../org/opensearch/common/regex/Regex.java | 5 ++ .../common/rounding/DateTimeUnit.java | 5 ++ .../opensearch/common/rounding/Rounding.java | 22 ++++++++ .../settings/AbstractScopedSettings.java | 2 + .../common/settings/BaseKeyStoreCommand.java | 5 ++ .../ChangeKeyStorePasswordCommand.java | 2 + .../common/settings/ClusterSettings.java | 2 + .../settings/ConsistentSettingsService.java | 2 + .../settings/HasPasswordKeyStoreCommand.java | 5 ++ .../common/settings/IndexScopedSettings.java | 2 + .../common/settings/KeyStoreWrapper.java | 8 ++- .../settings/NoClassSettingsException.java | 2 +- .../common/settings/PropertyPlaceholder.java | 2 + .../common/settings/SecureSetting.java | 17 ++++++ .../common/settings/SecureSettings.java | 2 + .../common/settings/SecureString.java | 2 + .../opensearch/common/settings/Setting.java | 22 ++++++++ .../common/settings/SettingUpgrader.java | 2 + .../opensearch/common/settings/Settings.java | 11 ++++ .../common/settings/SettingsException.java | 2 +- .../common/settings/SettingsFilter.java | 2 + .../common/settings/SettingsModule.java | 2 + .../settings/UpgradeKeyStoreCommand.java | 2 + .../java/org/opensearch/common/text/Text.java | 2 + .../opensearch/common/time/DateFormatter.java | 5 ++ .../common/time/DateFormatters.java | 5 ++ .../common/time/DateMathParser.java | 2 + .../org/opensearch/common/time/DateUtils.java | 5 ++ .../common/time/DateUtilsRounding.java | 2 + .../org/opensearch/common/time/EpochTime.java | 7 +++ .../opensearch/common/time/FormatNames.java | 5 ++ .../common/time/IsoCalendarDataProvider.java | 2 + .../common/time/JavaDateFormatter.java | 5 ++ .../common/time/JavaDateMathParser.java | 2 + .../transport/BoundTransportAddress.java | 2 + .../transport/NetworkExceptionHelper.java | 5 ++ .../common/transport/PortsRange.java | 5 ++ .../common/transport/TransportAddress.java | 2 + .../opensearch/common/unit/ByteSizeUnit.java | 2 + .../opensearch/common/unit/ByteSizeValue.java | 7 +++ .../opensearch/common/unit/DistanceUnit.java | 4 ++ .../org/opensearch/common/unit/Fuzziness.java | 2 + .../common/unit/MemorySizeValue.java | 6 ++- .../opensearch/common/unit/RatioValue.java | 2 + .../org/opensearch/common/unit/SizeUnit.java | 5 ++ .../org/opensearch/common/unit/SizeValue.java | 5 ++ .../opensearch/common/util/AbstractArray.java | 5 ++ .../common/util/AbstractBigArray.java | 6 ++- .../opensearch/common/util/AbstractHash.java | 2 + .../common/util/AbstractPagedHashMap.java | 2 + .../opensearch/common/util/ArrayUtils.java | 5 ++ .../org/opensearch/common/util/BigArray.java | 6 ++- .../org/opensearch/common/util/BigArrays.java | 40 ++++++++++++++ .../opensearch/common/util/BigByteArray.java | 2 + .../common/util/BigDoubleArray.java | 2 + .../opensearch/common/util/BigFloatArray.java | 2 + .../opensearch/common/util/BigIntArray.java | 2 + .../opensearch/common/util/BigLongArray.java | 2 + .../common/util/BigObjectArray.java | 2 + .../common/util/BinarySearcher.java | 2 + .../org/opensearch/common/util/BitArray.java | 2 + .../org/opensearch/common/util/ByteArray.java | 2 + .../org/opensearch/common/util/ByteUtils.java | 8 ++- .../opensearch/common/util/BytesRefHash.java | 2 + .../common/util/CachedSupplier.java | 2 + .../common/util/CancellableThreads.java | 7 +++ .../common/util/CollectionUtils.java | 11 +++- .../common/util/CombinedRateLimiter.java | 2 + .../opensearch/common/util/Comparators.java | 2 + .../org/opensearch/common/util/Countable.java | 5 ++ .../opensearch/common/util/CuckooFilter.java | 2 + .../opensearch/common/util/DoubleArray.java | 2 + .../opensearch/common/util/FeatureFlags.java | 2 + .../opensearch/common/util/FloatArray.java | 2 + .../org/opensearch/common/util/IntArray.java | 2 + .../common/util/LazyInitializable.java | 2 + .../opensearch/common/util/LocaleUtils.java | 2 + .../org/opensearch/common/util/LongArray.java | 2 + .../org/opensearch/common/util/LongHash.java | 2 + .../opensearch/common/util/LongLongHash.java | 2 + .../common/util/LongObjectPagedHashMap.java | 2 + .../java/org/opensearch/common/util/Maps.java | 5 ++ .../opensearch/common/util/ObjectArray.java | 2 + .../common/util/PageCacheRecycler.java | 6 ++- .../opensearch/common/util/PlainIterator.java | 5 ++ .../util/SetBackedScalingCuckooFilter.java | 2 + .../common/util/SingleObjectCache.java | 2 + .../opensearch/common/util/URIPattern.java | 2 + .../util/concurrent/AbstractAsyncTask.java | 2 + .../concurrent/AbstractLifecycleRunnable.java | 2 + .../util/concurrent/AbstractRunnable.java | 2 + .../util/concurrent/AsyncIOProcessor.java | 2 + .../common/util/concurrent/AtomicArray.java | 2 + .../common/util/concurrent/BaseFuture.java | 5 ++ .../concurrent/ConcurrentCollections.java | 5 ++ .../concurrent/ConcurrentHashMapLong.java | 5 ++ .../util/concurrent/ConcurrentMapLong.java | 5 ++ .../common/util/concurrent/CountDown.java | 2 + .../common/util/concurrent/FutureUtils.java | 5 ++ .../common/util/concurrent/KeyedLock.java | 3 +- .../util/concurrent/ListenableFuture.java | 2 + .../concurrent/OpenSearchAbortPolicy.java | 5 ++ .../util/concurrent/OpenSearchExecutors.java | 17 ++++++ .../OpenSearchRejectedExecutionException.java | 5 ++ .../OpenSearchThreadPoolExecutor.java | 2 + .../util/concurrent/PrioritizedCallable.java | 10 ++++ ...ioritizedOpenSearchThreadPoolExecutor.java | 7 +++ .../util/concurrent/PrioritizedRunnable.java | 10 ++++ ...eResizingOpenSearchThreadPoolExecutor.java | 2 + .../util/concurrent/ReleasableLock.java | 2 + .../concurrent/ResizableBlockingQueue.java | 2 + .../common/util/concurrent/RunOnce.java | 2 + .../util/concurrent/SizeBlockingQueue.java | 2 + .../common/util/concurrent/ThreadContext.java | 6 +++ .../common/util/concurrent/TimedRunnable.java | 2 + .../UncategorizedExecutionException.java | 5 ++ .../util/concurrent/WrappedRunnable.java | 5 ++ .../concurrent/XRejectedExecutionHandler.java | 5 ++ .../common/util/iterable/Iterables.java | 15 ++++++ .../org/opensearch/common/util/set/Sets.java | 10 ++++ .../xcontent/LoggingDeprecationHandler.java | 2 + .../common/xcontent/ObjectParserHelper.java | 2 + .../common/xcontent/ParseFieldRegistry.java | 2 + .../xcontent/StatusToXContentObject.java | 2 + .../xcontent/SuggestingErrorOnUnknown.java | 5 ++ .../common/xcontent/XContentHelper.java | 5 ++ .../xcontent/XContentOpenSearchExtension.java | 2 + .../common/xcontent/XContentParserUtils.java | 2 + .../xcontent/support/XContentMapValues.java | 5 ++ .../InternalSnapshotsInfoService.java | 11 ++++ .../opensearch/snapshots/RestoreService.java | 5 ++ .../opensearch/snapshots/SnapshotInfo.java | 5 ++ 511 files changed, 2018 insertions(+), 28 deletions(-) diff --git a/server/src/main/java/org/opensearch/common/AsyncBiFunction.java b/server/src/main/java/org/opensearch/common/AsyncBiFunction.java index 916a0c09cf83d..12e6377682723 100644 --- a/server/src/main/java/org/opensearch/common/AsyncBiFunction.java +++ b/server/src/main/java/org/opensearch/common/AsyncBiFunction.java @@ -35,6 +35,8 @@ /** * A {@link java.util.function.BiFunction}-like interface designed to be used with asynchronous executions. + * + * @opensearch.internal */ public interface AsyncBiFunction { diff --git a/server/src/main/java/org/opensearch/common/CheckedBiConsumer.java b/server/src/main/java/org/opensearch/common/CheckedBiConsumer.java index 1dc133584829e..50c15bb7a95a8 100644 --- a/server/src/main/java/org/opensearch/common/CheckedBiConsumer.java +++ b/server/src/main/java/org/opensearch/common/CheckedBiConsumer.java @@ -36,6 +36,8 @@ /** * A {@link BiConsumer}-like interface which allows throwing checked exceptions. + * + * @opensearch.internal */ @FunctionalInterface public interface CheckedBiConsumer { diff --git a/server/src/main/java/org/opensearch/common/CheckedBiFunction.java b/server/src/main/java/org/opensearch/common/CheckedBiFunction.java index 057c189e2ce0a..100588eb6d966 100644 --- a/server/src/main/java/org/opensearch/common/CheckedBiFunction.java +++ b/server/src/main/java/org/opensearch/common/CheckedBiFunction.java @@ -34,6 +34,8 @@ /** * A {@link java.util.function.BiFunction}-like interface which allows throwing checked exceptions. + * + * @opensearch.internal */ @FunctionalInterface public interface CheckedBiFunction { diff --git a/server/src/main/java/org/opensearch/common/CheckedSupplier.java b/server/src/main/java/org/opensearch/common/CheckedSupplier.java index 8ef1b026c7991..3099146901001 100644 --- a/server/src/main/java/org/opensearch/common/CheckedSupplier.java +++ b/server/src/main/java/org/opensearch/common/CheckedSupplier.java @@ -36,6 +36,8 @@ /** * A {@link Supplier}-like interface which allows throwing checked exceptions. + * + * @opensearch.internal */ @FunctionalInterface public interface CheckedSupplier { diff --git a/server/src/main/java/org/opensearch/common/Classes.java b/server/src/main/java/org/opensearch/common/Classes.java index 5a59e6f9862a0..1b297639aff6a 100644 --- a/server/src/main/java/org/opensearch/common/Classes.java +++ b/server/src/main/java/org/opensearch/common/Classes.java @@ -34,6 +34,11 @@ import java.lang.reflect.Modifier; +/** + * Base class utilities + * + * @opensearch.internal + */ public class Classes { /** diff --git a/server/src/main/java/org/opensearch/common/Explicit.java b/server/src/main/java/org/opensearch/common/Explicit.java index 8607ba49415f5..66e079c461e75 100644 --- a/server/src/main/java/org/opensearch/common/Explicit.java +++ b/server/src/main/java/org/opensearch/common/Explicit.java @@ -43,6 +43,7 @@ * field mapping settings it is preferable to preserve an explicit * choice rather than a choice made only made implicitly by defaults. * + * @opensearch.internal */ public class Explicit { diff --git a/server/src/main/java/org/opensearch/common/ExponentiallyWeightedMovingAverage.java b/server/src/main/java/org/opensearch/common/ExponentiallyWeightedMovingAverage.java index 4c38483329dec..a6c236fe4fa0a 100644 --- a/server/src/main/java/org/opensearch/common/ExponentiallyWeightedMovingAverage.java +++ b/server/src/main/java/org/opensearch/common/ExponentiallyWeightedMovingAverage.java @@ -37,6 +37,8 @@ /** * Implements exponentially weighted moving averages (commonly abbreviated EWMA) for a single value. * This class is safe to share between threads. + * + * @opensearch.internal */ public class ExponentiallyWeightedMovingAverage { diff --git a/server/src/main/java/org/opensearch/common/FieldMemoryStats.java b/server/src/main/java/org/opensearch/common/FieldMemoryStats.java index 8de38292e4cd0..12a693d6ee512 100644 --- a/server/src/main/java/org/opensearch/common/FieldMemoryStats.java +++ b/server/src/main/java/org/opensearch/common/FieldMemoryStats.java @@ -46,6 +46,8 @@ /** * A reusable class to encode {@code field -> memory size} mappings + * + * @opensearch.internal */ public final class FieldMemoryStats implements Writeable, Iterable> { diff --git a/server/src/main/java/org/opensearch/common/LegacyTimeBasedUUIDGenerator.java b/server/src/main/java/org/opensearch/common/LegacyTimeBasedUUIDGenerator.java index f9a7572afa2bf..1e2d9b87281d6 100644 --- a/server/src/main/java/org/opensearch/common/LegacyTimeBasedUUIDGenerator.java +++ b/server/src/main/java/org/opensearch/common/LegacyTimeBasedUUIDGenerator.java @@ -39,6 +39,8 @@ * These are essentially flake ids, but we use 6 (not 8) bytes for timestamp, and use 3 (not 2) bytes for sequence number. * For more information about flake ids, check out * https://archive.fo/2015.07.08-082503/http://www.boundary.com/blog/2012/01/flake-a-decentralized-k-ordered-unique-id-generator-in-erlang/ + * + * @opensearch.internal */ class LegacyTimeBasedUUIDGenerator implements UUIDGenerator { diff --git a/server/src/main/java/org/opensearch/common/LocalTimeOffset.java b/server/src/main/java/org/opensearch/common/LocalTimeOffset.java index 94347c47e56e0..ce2bd2f21ce37 100644 --- a/server/src/main/java/org/opensearch/common/LocalTimeOffset.java +++ b/server/src/main/java/org/opensearch/common/LocalTimeOffset.java @@ -61,6 +61,8 @@ *

* So there are two methods to convert from local time back to utc, * {@link #localToUtc(long, Strategy)} and {@link #localToUtcInThisOffset(long)}. + * + * @opensearch.internal */ public abstract class LocalTimeOffset { /** @@ -206,6 +208,8 @@ public String toString() { /** * How to get instances of {@link LocalTimeOffset}. + * + * @opensearch.internal */ public abstract static class Lookup { /** @@ -234,6 +238,11 @@ public abstract static class Lookup { abstract int size(); } + /** + * No previous local time offset + * + * @opensearch.internal + */ private static class NoPrevious extends LocalTimeOffset { NoPrevious(long millis) { super(millis); @@ -269,6 +278,11 @@ protected String toString(long millis) { } } + /** + * Transition for a local time offset + * + * @opensearch.internal + */ public abstract static class Transition extends LocalTimeOffset { private final LocalTimeOffset previous; private final long startUtcMillis; @@ -307,6 +321,11 @@ public long startUtcMillis() { } } + /** + * Gap for a local time offset + * + * @opensearch.internal + */ public static class Gap extends Transition { private final long firstMissingLocalTime; private final long firstLocalTimeAfterGap; @@ -347,6 +366,11 @@ protected String toString(long millis) { } } + /** + * Overlap for a local time offset + * + * @opensearch.internal + */ public static class Overlap extends Transition { private final long firstOverlappingLocalTime; private final long firstNonOverlappingLocalTime; @@ -403,6 +427,11 @@ protected String toString(long millis) { } } + /** + * Fixed lookup the local time offset + * + * @opensearch.internal + */ private static class FixedLookup extends Lookup { private final ZoneId zone; private final LocalTimeOffset fixed; @@ -441,6 +470,8 @@ public boolean anyMoveBackToPreviousDay() { /** * Looks up transitions by checking whether the date is after the start * of each transition. Simple so fast for small numbers of transitions. + * + * @opensearch.internal */ private static class LinkedListLookup extends AbstractManyTransitionsLookup { private final LocalTimeOffset lastOffset; @@ -477,6 +508,8 @@ public boolean anyMoveBackToPreviousDay() { /** * Builds an array that can be {@link Arrays#binarySearch(long[], long)}ed * for the daylight savings time transitions. + * + * @openearch.internal */ private static class TransitionArrayLookup extends AbstractManyTransitionsLookup { private final LocalTimeOffset[] offsets; @@ -536,6 +569,11 @@ public String toString() { } } + /** + * Base class for many transitions lookup + * + * @opensearch.internal + */ private abstract static class AbstractManyTransitionsLookup extends Lookup { protected final ZoneId zone; protected final long minUtcMillis; diff --git a/server/src/main/java/org/opensearch/common/MacAddressProvider.java b/server/src/main/java/org/opensearch/common/MacAddressProvider.java index 244d3032d2315..db51cc64c5d66 100644 --- a/server/src/main/java/org/opensearch/common/MacAddressProvider.java +++ b/server/src/main/java/org/opensearch/common/MacAddressProvider.java @@ -36,6 +36,11 @@ import java.net.SocketException; import java.util.Enumeration; +/** + * Provider of MAC addressing + * + * @opensearch.internal + */ public class MacAddressProvider { private static byte[] getMacAddress() throws SocketException { diff --git a/server/src/main/java/org/opensearch/common/NamedRegistry.java b/server/src/main/java/org/opensearch/common/NamedRegistry.java index c48cbfaedd7de..a0e98d9126628 100644 --- a/server/src/main/java/org/opensearch/common/NamedRegistry.java +++ b/server/src/main/java/org/opensearch/common/NamedRegistry.java @@ -41,6 +41,8 @@ /** * A registry from String to some class implementation. Used to ensure implementations are registered only once. + * + * @opensearch.internal */ public class NamedRegistry { private final Map registry = new HashMap<>(); diff --git a/server/src/main/java/org/opensearch/common/Numbers.java b/server/src/main/java/org/opensearch/common/Numbers.java index e2f5cdc0ab22d..7a87cd58b0e29 100644 --- a/server/src/main/java/org/opensearch/common/Numbers.java +++ b/server/src/main/java/org/opensearch/common/Numbers.java @@ -39,6 +39,8 @@ /** * A set of utilities for numbers. + * + * @opensearch.internal */ public final class Numbers { diff --git a/server/src/main/java/org/opensearch/common/ParsingException.java b/server/src/main/java/org/opensearch/common/ParsingException.java index 31129eaf1d882..02ae1cb0717a3 100644 --- a/server/src/main/java/org/opensearch/common/ParsingException.java +++ b/server/src/main/java/org/opensearch/common/ParsingException.java @@ -46,6 +46,8 @@ * Exception that can be used when parsing queries with a given {@link * XContentParser}. * Can contain information about location of the error. + * + * @opensearch.internal */ public class ParsingException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/common/PidFile.java b/server/src/main/java/org/opensearch/common/PidFile.java index ed3a3c1deb3c5..7033b63d38b6d 100644 --- a/server/src/main/java/org/opensearch/common/PidFile.java +++ b/server/src/main/java/org/opensearch/common/PidFile.java @@ -44,6 +44,8 @@ /** * Process ID file abstraction that writes the current pid into a file and optionally * removes it on system exit. + * + * @opensearch.internal */ public final class PidFile { diff --git a/server/src/main/java/org/opensearch/common/Priority.java b/server/src/main/java/org/opensearch/common/Priority.java index 908e19057e2ca..aadaa695324b6 100644 --- a/server/src/main/java/org/opensearch/common/Priority.java +++ b/server/src/main/java/org/opensearch/common/Priority.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Priority levels. + * + * @opensearch.internal + */ public enum Priority { IMMEDIATE((byte) 0), diff --git a/server/src/main/java/org/opensearch/common/RandomBasedUUIDGenerator.java b/server/src/main/java/org/opensearch/common/RandomBasedUUIDGenerator.java index e8b79f33f2313..fdc53d8335c2f 100644 --- a/server/src/main/java/org/opensearch/common/RandomBasedUUIDGenerator.java +++ b/server/src/main/java/org/opensearch/common/RandomBasedUUIDGenerator.java @@ -38,6 +38,11 @@ import java.util.Base64; import java.util.Random; +/** + * Random UUID generator. + * + * @opensearch.internal + */ class RandomBasedUUIDGenerator implements UUIDGenerator { /** diff --git a/server/src/main/java/org/opensearch/common/Randomness.java b/server/src/main/java/org/opensearch/common/Randomness.java index 419a85cd973c4..2c60e848b9db9 100644 --- a/server/src/main/java/org/opensearch/common/Randomness.java +++ b/server/src/main/java/org/opensearch/common/Randomness.java @@ -56,6 +56,8 @@ * process, non-reproducible sources of randomness are provided (unless * a setting is provided for a module that exposes a seed setting (e.g., * NodeEnvironment#NODE_ID_SEED_SETTING)). + * + * @opensearch.internal */ public final class Randomness { private static final Method currentMethod; diff --git a/server/src/main/java/org/opensearch/common/Rounding.java b/server/src/main/java/org/opensearch/common/Rounding.java index eb6737530a2b0..f5ca75882eac0 100644 --- a/server/src/main/java/org/opensearch/common/Rounding.java +++ b/server/src/main/java/org/opensearch/common/Rounding.java @@ -75,6 +75,8 @@ * See this * blog for some background reading. Its super interesting and the links are * a comedy gold mine. If you like time zones. Or hate them. + * + * @opensearch.internal */ public abstract class Rounding implements Writeable { private static final Logger logger = LogManager.getLogger(Rounding.class); @@ -347,6 +349,11 @@ public static Builder builder(TimeValue interval) { return new Builder(interval); } + /** + * Builder for rounding + * + * @opensearch.internal + */ public static class Builder { private final DateTimeUnit unit; @@ -426,6 +433,11 @@ protected Prepared maybeUseArray(long minUtcMillis, long maxUtcMillis, int max) } } + /** + * Rounding time units + * + * @opensearch.internal + */ static class TimeUnitRounding extends Rounding { static final byte ID = 1; @@ -887,6 +899,11 @@ public final long nextRoundingValue(long utcMillis) { } } + /** + * Rounding time intervals + * + * @opensearch.internal + */ static class TimeIntervalRounding extends Rounding { static final byte ID = 2; @@ -1204,6 +1221,11 @@ public long nextRoundingValue(long utcMillis) { } } + /** + * Rounding offsets + * + * @opensearch.internal + */ static class OffsetRounding extends Rounding { static final byte ID = 3; @@ -1315,6 +1337,8 @@ public static Rounding read(StreamInput in) throws IOException { /** * Implementation of {@link Prepared} using pre-calculated "round down" points. + * + * @opensearch.internal */ private static class ArrayRounding implements Prepared { private final long[] values; diff --git a/server/src/main/java/org/opensearch/common/SecureRandomHolder.java b/server/src/main/java/org/opensearch/common/SecureRandomHolder.java index 37076f8f4e6e4..14844293b3274 100644 --- a/server/src/main/java/org/opensearch/common/SecureRandomHolder.java +++ b/server/src/main/java/org/opensearch/common/SecureRandomHolder.java @@ -34,6 +34,11 @@ import java.security.SecureRandom; +/** + * Random holder that is secure. + * + * @opensearch.internal + */ class SecureRandomHolder { // class loading is atomic - this is a lazy & safe singleton to be used by this package public static final SecureRandom INSTANCE = new SecureRandom(); diff --git a/server/src/main/java/org/opensearch/common/StopWatch.java b/server/src/main/java/org/opensearch/common/StopWatch.java index 973277fae65b7..53b6da4a3bf02 100644 --- a/server/src/main/java/org/opensearch/common/StopWatch.java +++ b/server/src/main/java/org/opensearch/common/StopWatch.java @@ -54,7 +54,7 @@ * This class is normally used to verify performance during proof-of-concepts * and in development, rather than as part of production applications. * - * + * @opensearch.internal */ public class StopWatch { @@ -239,6 +239,8 @@ public String toString() { /** * Inner class to hold data about one task executed within the stop watch. + * + * @opensearch.internal */ public static class TaskInfo { diff --git a/server/src/main/java/org/opensearch/common/Strings.java b/server/src/main/java/org/opensearch/common/Strings.java index 139ace6c481c8..cbf12f264ee30 100644 --- a/server/src/main/java/org/opensearch/common/Strings.java +++ b/server/src/main/java/org/opensearch/common/Strings.java @@ -59,6 +59,11 @@ import static java.util.Collections.unmodifiableSet; import static org.opensearch.common.util.set.Sets.newHashSet; +/** + * String utility class. + * + * @opensearch.internal + */ public class Strings { public static final String[] EMPTY_ARRAY = new String[0]; diff --git a/server/src/main/java/org/opensearch/common/SuppressLoggerChecks.java b/server/src/main/java/org/opensearch/common/SuppressLoggerChecks.java index d93743e03f9db..75d3b63a1841d 100644 --- a/server/src/main/java/org/opensearch/common/SuppressLoggerChecks.java +++ b/server/src/main/java/org/opensearch/common/SuppressLoggerChecks.java @@ -39,6 +39,8 @@ /** * Annotation to suppress logging usage checks errors inside a whole class or a method. + * + * @opensearch.internal */ @Retention(RetentionPolicy.CLASS) @Target({ ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE }) diff --git a/server/src/main/java/org/opensearch/common/Table.java b/server/src/main/java/org/opensearch/common/Table.java index ff32faeb94edf..9c3462e7077cd 100644 --- a/server/src/main/java/org/opensearch/common/Table.java +++ b/server/src/main/java/org/opensearch/common/Table.java @@ -44,6 +44,11 @@ import static java.util.Collections.emptyMap; +/** + * A table. + * + * @opensearch.internal + */ public class Table { private List headers = new ArrayList<>(); @@ -224,6 +229,11 @@ public Map getAliasMap() { return headerAliasMap; } + /** + * Cell in a table + * + * @opensearch.internal + */ public static class Cell { public final Object value; public final Map attr; diff --git a/server/src/main/java/org/opensearch/common/TimeBasedUUIDGenerator.java b/server/src/main/java/org/opensearch/common/TimeBasedUUIDGenerator.java index f76f739787f63..b00a4383b388e 100644 --- a/server/src/main/java/org/opensearch/common/TimeBasedUUIDGenerator.java +++ b/server/src/main/java/org/opensearch/common/TimeBasedUUIDGenerator.java @@ -42,6 +42,8 @@ * structured. * For more information about flake ids, check out * https://archive.fo/2015.07.08-082503/http://www.boundary.com/blog/2012/01/flake-a-decentralized-k-ordered-unique-id-generator-in-erlang/ + * + * @opensearch.internal */ class TimeBasedUUIDGenerator implements UUIDGenerator { diff --git a/server/src/main/java/org/opensearch/common/TriConsumer.java b/server/src/main/java/org/opensearch/common/TriConsumer.java index 2a41b73ad5388..f98276b6d007d 100644 --- a/server/src/main/java/org/opensearch/common/TriConsumer.java +++ b/server/src/main/java/org/opensearch/common/TriConsumer.java @@ -38,6 +38,8 @@ * @param the type of the first argument * @param the type of the second argument * @param the type of the third argument + * + * @opensearch.internal */ @FunctionalInterface public interface TriConsumer { diff --git a/server/src/main/java/org/opensearch/common/TriFunction.java b/server/src/main/java/org/opensearch/common/TriFunction.java index 2ce82eb49aa37..7b1bbece68680 100644 --- a/server/src/main/java/org/opensearch/common/TriFunction.java +++ b/server/src/main/java/org/opensearch/common/TriFunction.java @@ -39,6 +39,8 @@ * @param the type of the second argument * @param the type of the third argument * @param the return type + * + * @opensearch.internal */ @FunctionalInterface public interface TriFunction { diff --git a/server/src/main/java/org/opensearch/common/UUIDGenerator.java b/server/src/main/java/org/opensearch/common/UUIDGenerator.java index bf94d8346e842..8705f415216d8 100644 --- a/server/src/main/java/org/opensearch/common/UUIDGenerator.java +++ b/server/src/main/java/org/opensearch/common/UUIDGenerator.java @@ -34,6 +34,8 @@ /** * Generates opaque unique strings. + * + * @opensearch.internal */ interface UUIDGenerator { String getBase64UUID(); diff --git a/server/src/main/java/org/opensearch/common/UUIDs.java b/server/src/main/java/org/opensearch/common/UUIDs.java index 5ddb628c237fa..a04a10430254f 100644 --- a/server/src/main/java/org/opensearch/common/UUIDs.java +++ b/server/src/main/java/org/opensearch/common/UUIDs.java @@ -36,6 +36,11 @@ import java.util.Random; +/** + * UUID utility class. + * + * @opensearch.internal + */ public class UUIDs { private static final RandomBasedUUIDGenerator RANDOM_UUID_GENERATOR = new RandomBasedUUIDGenerator(); diff --git a/server/src/main/java/org/opensearch/common/ValidationException.java b/server/src/main/java/org/opensearch/common/ValidationException.java index 979d2be5ae148..09e4344df1b80 100644 --- a/server/src/main/java/org/opensearch/common/ValidationException.java +++ b/server/src/main/java/org/opensearch/common/ValidationException.java @@ -37,6 +37,8 @@ /** * Encapsulates an accumulation of validation errors + * + * @opensearch.internal */ public class ValidationException extends IllegalArgumentException { private final List validationErrors = new ArrayList<>(); diff --git a/server/src/main/java/org/opensearch/common/blobstore/BlobContainer.java b/server/src/main/java/org/opensearch/common/blobstore/BlobContainer.java index bdc1d56759963..ac38768c9f3d3 100644 --- a/server/src/main/java/org/opensearch/common/blobstore/BlobContainer.java +++ b/server/src/main/java/org/opensearch/common/blobstore/BlobContainer.java @@ -41,6 +41,8 @@ /** * An interface for managing a repository of blob entries, where each blob entry is just a named group of bytes. + * + * @opensearch.internal */ public interface BlobContainer { diff --git a/server/src/main/java/org/opensearch/common/blobstore/BlobMetadata.java b/server/src/main/java/org/opensearch/common/blobstore/BlobMetadata.java index 52b103eaf79bb..37c70365b6a11 100644 --- a/server/src/main/java/org/opensearch/common/blobstore/BlobMetadata.java +++ b/server/src/main/java/org/opensearch/common/blobstore/BlobMetadata.java @@ -34,6 +34,8 @@ /** * An interface for providing basic metadata about a blob. + * + * @opensearch.internal */ public interface BlobMetadata { diff --git a/server/src/main/java/org/opensearch/common/blobstore/BlobPath.java b/server/src/main/java/org/opensearch/common/blobstore/BlobPath.java index 24aee647e7ac0..d5242fd5e7347 100644 --- a/server/src/main/java/org/opensearch/common/blobstore/BlobPath.java +++ b/server/src/main/java/org/opensearch/common/blobstore/BlobPath.java @@ -41,6 +41,8 @@ /** * The list of paths where a blob can reside. The contents of the paths are dependent upon the implementation of {@link BlobContainer}. + * + * @opensearch.internal */ public class BlobPath implements Iterable { diff --git a/server/src/main/java/org/opensearch/common/blobstore/BlobStore.java b/server/src/main/java/org/opensearch/common/blobstore/BlobStore.java index 42a347d378823..ab40b1e2a082e 100644 --- a/server/src/main/java/org/opensearch/common/blobstore/BlobStore.java +++ b/server/src/main/java/org/opensearch/common/blobstore/BlobStore.java @@ -37,6 +37,8 @@ /** * An interface for storing blobs. + * + * @opensearch.internal */ public interface BlobStore extends Closeable { diff --git a/server/src/main/java/org/opensearch/common/blobstore/BlobStoreException.java b/server/src/main/java/org/opensearch/common/blobstore/BlobStoreException.java index a71a686dbd0d0..71786bb8e80dd 100644 --- a/server/src/main/java/org/opensearch/common/blobstore/BlobStoreException.java +++ b/server/src/main/java/org/opensearch/common/blobstore/BlobStoreException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Thrown on blob store errors + * + * @opensearch.internal + */ public class BlobStoreException extends OpenSearchException { public BlobStoreException(String msg) { diff --git a/server/src/main/java/org/opensearch/common/blobstore/DeleteResult.java b/server/src/main/java/org/opensearch/common/blobstore/DeleteResult.java index 1a6577cbbb21d..3b424c582ebc6 100644 --- a/server/src/main/java/org/opensearch/common/blobstore/DeleteResult.java +++ b/server/src/main/java/org/opensearch/common/blobstore/DeleteResult.java @@ -34,6 +34,8 @@ /** * The result of deleting multiple blobs from a {@link BlobStore}. + * + * @opensearch.internal */ public final class DeleteResult { diff --git a/server/src/main/java/org/opensearch/common/blobstore/fs/FsBlobContainer.java b/server/src/main/java/org/opensearch/common/blobstore/fs/FsBlobContainer.java index 0fd20e6bb4990..940192d77630b 100644 --- a/server/src/main/java/org/opensearch/common/blobstore/fs/FsBlobContainer.java +++ b/server/src/main/java/org/opensearch/common/blobstore/fs/FsBlobContainer.java @@ -73,6 +73,8 @@ * Note that the methods in this implementation of {@link org.opensearch.common.blobstore.BlobContainer} may * additionally throw a {@link java.lang.SecurityException} if the configured {@link java.lang.SecurityManager} * does not permit read and/or write access to the underlying files. + * + * @opensearch.internal */ public class FsBlobContainer extends AbstractBlobContainer { diff --git a/server/src/main/java/org/opensearch/common/blobstore/fs/FsBlobStore.java b/server/src/main/java/org/opensearch/common/blobstore/fs/FsBlobStore.java index 346100ccb9527..f25a741b93c8d 100644 --- a/server/src/main/java/org/opensearch/common/blobstore/fs/FsBlobStore.java +++ b/server/src/main/java/org/opensearch/common/blobstore/fs/FsBlobStore.java @@ -41,6 +41,11 @@ import java.nio.file.Files; import java.nio.file.Path; +/** + * FileSystem blob store + * + * @opensearch.internal + */ public class FsBlobStore implements BlobStore { private final Path path; diff --git a/server/src/main/java/org/opensearch/common/blobstore/support/AbstractBlobContainer.java b/server/src/main/java/org/opensearch/common/blobstore/support/AbstractBlobContainer.java index ec498404c8803..de167b0a2423f 100644 --- a/server/src/main/java/org/opensearch/common/blobstore/support/AbstractBlobContainer.java +++ b/server/src/main/java/org/opensearch/common/blobstore/support/AbstractBlobContainer.java @@ -37,6 +37,8 @@ /** * A base abstract blob container that implements higher level container methods. + * + * @opensearch.internal */ public abstract class AbstractBlobContainer implements BlobContainer { diff --git a/server/src/main/java/org/opensearch/common/blobstore/support/FilterBlobContainer.java b/server/src/main/java/org/opensearch/common/blobstore/support/FilterBlobContainer.java index 1cf50027b2994..1965aee7f7ef6 100644 --- a/server/src/main/java/org/opensearch/common/blobstore/support/FilterBlobContainer.java +++ b/server/src/main/java/org/opensearch/common/blobstore/support/FilterBlobContainer.java @@ -44,6 +44,11 @@ import java.util.Objects; import java.util.stream.Collectors; +/** + * Filter blob container. + * + * @opensearch.internal + */ public abstract class FilterBlobContainer implements BlobContainer { private final BlobContainer delegate; diff --git a/server/src/main/java/org/opensearch/common/blobstore/support/PlainBlobMetadata.java b/server/src/main/java/org/opensearch/common/blobstore/support/PlainBlobMetadata.java index a97566fd3fc33..8d2aee199ea61 100644 --- a/server/src/main/java/org/opensearch/common/blobstore/support/PlainBlobMetadata.java +++ b/server/src/main/java/org/opensearch/common/blobstore/support/PlainBlobMetadata.java @@ -34,6 +34,11 @@ import org.opensearch.common.blobstore.BlobMetadata; +/** + * Plain blob metadata + * + * @opensearch.internal + */ public class PlainBlobMetadata implements BlobMetadata { private final String name; diff --git a/server/src/main/java/org/opensearch/common/breaker/ChildMemoryCircuitBreaker.java b/server/src/main/java/org/opensearch/common/breaker/ChildMemoryCircuitBreaker.java index 7698771f51170..923f592c6bc79 100644 --- a/server/src/main/java/org/opensearch/common/breaker/ChildMemoryCircuitBreaker.java +++ b/server/src/main/java/org/opensearch/common/breaker/ChildMemoryCircuitBreaker.java @@ -42,6 +42,8 @@ /** * Breaker that will check a parent's when incrementing + * + * @opensearch.internal */ public class ChildMemoryCircuitBreaker implements CircuitBreaker { @@ -268,6 +270,11 @@ public void setLimitAndOverhead(long limit, double overhead) { this.limitAndOverhead = new LimitAndOverhead(limit, overhead); } + /** + * Breaker limit and overhead info + * + * @opensearch.internal + */ private static class LimitAndOverhead { private final long limit; diff --git a/server/src/main/java/org/opensearch/common/breaker/CircuitBreaker.java b/server/src/main/java/org/opensearch/common/breaker/CircuitBreaker.java index ca6c5aa9698c3..8eaf7aba99945 100644 --- a/server/src/main/java/org/opensearch/common/breaker/CircuitBreaker.java +++ b/server/src/main/java/org/opensearch/common/breaker/CircuitBreaker.java @@ -37,6 +37,8 @@ /** * Interface for an object that can be incremented, breaking after some * configured limit has been reached. + * + * @opensearch.internal */ public interface CircuitBreaker { diff --git a/server/src/main/java/org/opensearch/common/breaker/CircuitBreakingException.java b/server/src/main/java/org/opensearch/common/breaker/CircuitBreakingException.java index 8983ad3b46e60..ee9977bfa2eb0 100644 --- a/server/src/main/java/org/opensearch/common/breaker/CircuitBreakingException.java +++ b/server/src/main/java/org/opensearch/common/breaker/CircuitBreakingException.java @@ -42,6 +42,8 @@ /** * Exception thrown when the circuit breaker trips + * + * @opensearch.internal */ public class CircuitBreakingException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/common/breaker/NoopCircuitBreaker.java b/server/src/main/java/org/opensearch/common/breaker/NoopCircuitBreaker.java index aa6f3769a07ca..ddd72280faa4f 100644 --- a/server/src/main/java/org/opensearch/common/breaker/NoopCircuitBreaker.java +++ b/server/src/main/java/org/opensearch/common/breaker/NoopCircuitBreaker.java @@ -35,6 +35,8 @@ /** * A CircuitBreaker that doesn't increment or adjust, and all operations are * basically noops + * + * @opensearch.internal */ public class NoopCircuitBreaker implements CircuitBreaker { public static final int LIMIT = -1; diff --git a/server/src/main/java/org/opensearch/common/bytes/AbstractBytesReference.java b/server/src/main/java/org/opensearch/common/bytes/AbstractBytesReference.java index 77ee4df7da2cb..24e200c2da2f3 100644 --- a/server/src/main/java/org/opensearch/common/bytes/AbstractBytesReference.java +++ b/server/src/main/java/org/opensearch/common/bytes/AbstractBytesReference.java @@ -41,6 +41,11 @@ import java.io.OutputStream; import java.util.function.ToIntBiFunction; +/** + * Base bytesref class + * + * @opensearch.internal + */ public abstract class AbstractBytesReference implements BytesReference { private Integer hash = null; // we cache the hash of this reference since it can be quite costly to re-calculated it diff --git a/server/src/main/java/org/opensearch/common/bytes/BytesArray.java b/server/src/main/java/org/opensearch/common/bytes/BytesArray.java index 69f715856c696..aac34b991d186 100644 --- a/server/src/main/java/org/opensearch/common/bytes/BytesArray.java +++ b/server/src/main/java/org/opensearch/common/bytes/BytesArray.java @@ -39,6 +39,11 @@ import java.io.OutputStream; import java.util.Arrays; +/** + * A bytes array. + * + * @opensearch.internal + */ public final class BytesArray extends AbstractBytesReference { public static final BytesArray EMPTY = new BytesArray(BytesRef.EMPTY_BYTES, 0, 0); diff --git a/server/src/main/java/org/opensearch/common/bytes/BytesReference.java b/server/src/main/java/org/opensearch/common/bytes/BytesReference.java index 1107eda4b5a81..3e0623bf8d128 100644 --- a/server/src/main/java/org/opensearch/common/bytes/BytesReference.java +++ b/server/src/main/java/org/opensearch/common/bytes/BytesReference.java @@ -49,6 +49,8 @@ /** * A reference to bytes. + * + * @opensearch.internal */ public interface BytesReference extends Comparable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/common/bytes/CompositeBytesReference.java b/server/src/main/java/org/opensearch/common/bytes/CompositeBytesReference.java index 2a989e33e918f..2d505d14124f2 100644 --- a/server/src/main/java/org/opensearch/common/bytes/CompositeBytesReference.java +++ b/server/src/main/java/org/opensearch/common/bytes/CompositeBytesReference.java @@ -47,6 +47,8 @@ * into one without copying. * * Note, {@link #toBytesRef()} will materialize all pages in this BytesReference. + * + * @opensearch.internal */ public final class CompositeBytesReference extends AbstractBytesReference { diff --git a/server/src/main/java/org/opensearch/common/bytes/PagedBytesReference.java b/server/src/main/java/org/opensearch/common/bytes/PagedBytesReference.java index f9a2c6b95c03b..b7439853f11ba 100644 --- a/server/src/main/java/org/opensearch/common/bytes/PagedBytesReference.java +++ b/server/src/main/java/org/opensearch/common/bytes/PagedBytesReference.java @@ -42,6 +42,8 @@ /** * A page based bytes reference, internally holding the bytes in a paged * data structure. + * + * @opensearch.internal */ public class PagedBytesReference extends AbstractBytesReference { diff --git a/server/src/main/java/org/opensearch/common/bytes/RecyclingBytesStreamOutput.java b/server/src/main/java/org/opensearch/common/bytes/RecyclingBytesStreamOutput.java index e9a9b96ea81ac..28c3f4c9d5349 100644 --- a/server/src/main/java/org/opensearch/common/bytes/RecyclingBytesStreamOutput.java +++ b/server/src/main/java/org/opensearch/common/bytes/RecyclingBytesStreamOutput.java @@ -49,6 +49,8 @@ * {@link BigArrays} if needed. The idea is that you can use this for passing data to an API that requires a single {@code byte[]} (or a * {@link org.apache.lucene.util.BytesRef}) which you'd prefer to re-use if possible, avoiding excessive allocations, but which may not * always be large enough. + * + * @opensearch.internal */ public class RecyclingBytesStreamOutput extends BytesStream { diff --git a/server/src/main/java/org/opensearch/common/bytes/ReleasableBytesReference.java b/server/src/main/java/org/opensearch/common/bytes/ReleasableBytesReference.java index 9ed47ef6cbf39..5989e2fab8826 100644 --- a/server/src/main/java/org/opensearch/common/bytes/ReleasableBytesReference.java +++ b/server/src/main/java/org/opensearch/common/bytes/ReleasableBytesReference.java @@ -45,6 +45,8 @@ /** * An extension to {@link BytesReference} that requires releasing its content. This * class exists to make it explicit when a bytes reference needs to be released, and when not. + * + * @opensearch.internal */ public final class ReleasableBytesReference implements Releasable, BytesReference { diff --git a/server/src/main/java/org/opensearch/common/cache/Cache.java b/server/src/main/java/org/opensearch/common/cache/Cache.java index 8ab0bc9114c0e..007b1bfd3cfda 100644 --- a/server/src/main/java/org/opensearch/common/cache/Cache.java +++ b/server/src/main/java/org/opensearch/common/cache/Cache.java @@ -79,6 +79,8 @@ * * @param The type of the keys * @param The type of the values + * + * @opensearch.internal */ public class Cache { @@ -173,6 +175,11 @@ enum State { DELETED } + /** + * Entry in a cache + * + * @opensearch.internal + */ static class Entry { final K key; final V value; @@ -196,6 +203,8 @@ static class Entry { * * @param the type of the keys * @param the type of the values + * + * @opensearch.internal */ private static class CacheSegment { // read/write lock protecting mutations to the segment @@ -329,6 +338,11 @@ void remove(K key, V value, Consumer>> onRemoval) } } + /** + * Segment statistics + * + * @opensearch.internal + */ private static class SegmentStats { private final LongAdder hits = new LongAdder(); private final LongAdder misses = new LongAdder(); @@ -717,6 +731,11 @@ public CacheStats stats() { return new CacheStats(hits, misses, evictions); } + /** + * Cache statistics + * + * @opensearch.internal + */ public static class CacheStats { private long hits; private long misses; diff --git a/server/src/main/java/org/opensearch/common/cache/CacheBuilder.java b/server/src/main/java/org/opensearch/common/cache/CacheBuilder.java index 9fd340ccca320..b6d7979aa4108 100644 --- a/server/src/main/java/org/opensearch/common/cache/CacheBuilder.java +++ b/server/src/main/java/org/opensearch/common/cache/CacheBuilder.java @@ -37,6 +37,11 @@ import java.util.Objects; import java.util.function.ToLongBiFunction; +/** + * The cache builder. + * + * @opensearch.internal + */ public class CacheBuilder { private long maximumWeight = -1; private long expireAfterAccessNanos = -1; diff --git a/server/src/main/java/org/opensearch/common/cache/CacheLoader.java b/server/src/main/java/org/opensearch/common/cache/CacheLoader.java index 721a1a9885527..3c80fe5d66d5d 100644 --- a/server/src/main/java/org/opensearch/common/cache/CacheLoader.java +++ b/server/src/main/java/org/opensearch/common/cache/CacheLoader.java @@ -32,6 +32,11 @@ package org.opensearch.common.cache; +/** + * An interface for a cache loader. + * + * @opensearch.internal + */ @FunctionalInterface public interface CacheLoader { V load(K key) throws Exception; diff --git a/server/src/main/java/org/opensearch/common/cache/RemovalListener.java b/server/src/main/java/org/opensearch/common/cache/RemovalListener.java index eb84108319b16..369313f9f93f4 100644 --- a/server/src/main/java/org/opensearch/common/cache/RemovalListener.java +++ b/server/src/main/java/org/opensearch/common/cache/RemovalListener.java @@ -32,6 +32,11 @@ package org.opensearch.common.cache; +/** + * Listener for removing an element from the cache + * + * @opensearch.internal + */ @FunctionalInterface public interface RemovalListener { void onRemoval(RemovalNotification notification); diff --git a/server/src/main/java/org/opensearch/common/cache/RemovalNotification.java b/server/src/main/java/org/opensearch/common/cache/RemovalNotification.java index 89ab6decff43f..f8dc8fa4a6d0f 100644 --- a/server/src/main/java/org/opensearch/common/cache/RemovalNotification.java +++ b/server/src/main/java/org/opensearch/common/cache/RemovalNotification.java @@ -32,6 +32,11 @@ package org.opensearch.common.cache; +/** + * Notification when an element is removed from the cache + * + * @opensearch.internal + */ public class RemovalNotification { public enum RemovalReason { REPLACED, diff --git a/server/src/main/java/org/opensearch/common/collect/CopyOnWriteHashMap.java b/server/src/main/java/org/opensearch/common/collect/CopyOnWriteHashMap.java index 5066ffa76ba0a..5ce77cdc75fe5 100644 --- a/server/src/main/java/org/opensearch/common/collect/CopyOnWriteHashMap.java +++ b/server/src/main/java/org/opensearch/common/collect/CopyOnWriteHashMap.java @@ -62,6 +62,8 @@ * it is better suited for work-loads that are not too write-intensive. * * @see the wikipedia page + * + * @opensearch.internal */ public final class CopyOnWriteHashMap extends AbstractMap { @@ -87,6 +89,8 @@ public static CopyOnWriteHashMap copyOf(Map { @@ -124,6 +128,8 @@ private abstract static class Node { /** * A leaf of the tree where all hashes are equal. Values are added and retrieved in linear time. + * + * @opensearch.internal */ private static class Leaf extends Node { @@ -247,6 +253,8 @@ public static T[] insertElement(final T[] array, final T element, final int * * As a consequence, the number of slots in an inner node is equal to the * number of one bits in the bitmap. + * + * @opensearch.internal */ private static class InnerNode extends Node { @@ -440,6 +448,11 @@ InnerNode remove(Object key, int hash) { } + /** + * Iterates over an entry + * + * @opensearch.internal + */ private static class EntryIterator implements Iterator> { private final Deque> entries; diff --git a/server/src/main/java/org/opensearch/common/collect/EvictingQueue.java b/server/src/main/java/org/opensearch/common/collect/EvictingQueue.java index fd2c23af30e35..3d505b8c38a37 100644 --- a/server/src/main/java/org/opensearch/common/collect/EvictingQueue.java +++ b/server/src/main/java/org/opensearch/common/collect/EvictingQueue.java @@ -60,6 +60,8 @@ * full queue, elements are evicted from the head of the queue to accommodate the new elements. * * @param The type of elements in the queue. + * + * @opensearch.internal */ public class EvictingQueue implements Queue { private final int maximumSize; diff --git a/server/src/main/java/org/opensearch/common/collect/HppcMaps.java b/server/src/main/java/org/opensearch/common/collect/HppcMaps.java index 55696568de47f..7d78b71421069 100644 --- a/server/src/main/java/org/opensearch/common/collect/HppcMaps.java +++ b/server/src/main/java/org/opensearch/common/collect/HppcMaps.java @@ -39,6 +39,11 @@ import java.util.Iterator; +/** + * High performance maps + * + * @opensearch.internal + */ public final class HppcMaps { private HppcMaps() {} diff --git a/server/src/main/java/org/opensearch/common/collect/ImmutableOpenIntMap.java b/server/src/main/java/org/opensearch/common/collect/ImmutableOpenIntMap.java index a5ebb19423732..0bff76e7ec90e 100644 --- a/server/src/main/java/org/opensearch/common/collect/ImmutableOpenIntMap.java +++ b/server/src/main/java/org/opensearch/common/collect/ImmutableOpenIntMap.java @@ -54,6 +54,8 @@ *

* Can be constructed using a {@link #builder()}, or using {@link #builder(org.opensearch.common.collect.ImmutableOpenIntMap)} * (which is an optimized option to copy over existing content and modify it). + * + * @opensearch.internal */ public final class ImmutableOpenIntMap implements Iterable> { @@ -223,6 +225,11 @@ public static Builder builder(ImmutableOpenIntMap map) { return new Builder<>(map); } + /** + * Base builder for an immutable int + * + * @opensearch.internal + */ public static class Builder implements IntObjectMap { private IntObjectHashMap map; diff --git a/server/src/main/java/org/opensearch/common/collect/ImmutableOpenMap.java b/server/src/main/java/org/opensearch/common/collect/ImmutableOpenMap.java index 82b9afd1d3c08..77716c951c524 100644 --- a/server/src/main/java/org/opensearch/common/collect/ImmutableOpenMap.java +++ b/server/src/main/java/org/opensearch/common/collect/ImmutableOpenMap.java @@ -52,6 +52,8 @@ *

* Can be constructed using a {@link #builder()}, or using {@link #builder(ImmutableOpenMap)} (which is an optimized * option to copy over existing content and modify it). + * + * @opensearch.internal */ public final class ImmutableOpenMap implements Iterable> { @@ -238,6 +240,11 @@ public static Builder builder(ImmutableOpenMap(map); } + /** + * Builder for an immuatable map + * + * @opensearch.internal + */ public static class Builder implements ObjectObjectMap { private ObjectObjectHashMap map; diff --git a/server/src/main/java/org/opensearch/common/collect/Iterators.java b/server/src/main/java/org/opensearch/common/collect/Iterators.java index a76f4246b1780..9536bbb1ba46b 100644 --- a/server/src/main/java/org/opensearch/common/collect/Iterators.java +++ b/server/src/main/java/org/opensearch/common/collect/Iterators.java @@ -45,6 +45,11 @@ public static Iterator concat(Iterator... iterators) { return new ConcatenatedIterator(iterators); } + /** + * Concat iterators + * + * @opensearch.internal + */ static class ConcatenatedIterator implements Iterator { private final Iterator[] iterators; private int index = 0; diff --git a/server/src/main/java/org/opensearch/common/collect/MapBuilder.java b/server/src/main/java/org/opensearch/common/collect/MapBuilder.java index 39e95d46e3a4a..7a28f02ab4b43 100644 --- a/server/src/main/java/org/opensearch/common/collect/MapBuilder.java +++ b/server/src/main/java/org/opensearch/common/collect/MapBuilder.java @@ -37,6 +37,11 @@ import static java.util.Collections.unmodifiableMap; +/** + * Builder for a map. + * + * @opensearch.internal + */ public class MapBuilder { public static MapBuilder newMapBuilder() { diff --git a/server/src/main/java/org/opensearch/common/component/AbstractLifecycleComponent.java b/server/src/main/java/org/opensearch/common/component/AbstractLifecycleComponent.java index cae81cb0931b3..837f8af44bf13 100644 --- a/server/src/main/java/org/opensearch/common/component/AbstractLifecycleComponent.java +++ b/server/src/main/java/org/opensearch/common/component/AbstractLifecycleComponent.java @@ -37,6 +37,11 @@ import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; +/** + * Base class for a lifecycle component. + * + * @opensearch.internal + */ public abstract class AbstractLifecycleComponent implements LifecycleComponent { protected final Lifecycle lifecycle = new Lifecycle(); diff --git a/server/src/main/java/org/opensearch/common/component/Lifecycle.java b/server/src/main/java/org/opensearch/common/component/Lifecycle.java index afeb3c97cc027..b0db6435d6126 100644 --- a/server/src/main/java/org/opensearch/common/component/Lifecycle.java +++ b/server/src/main/java/org/opensearch/common/component/Lifecycle.java @@ -72,6 +72,8 @@ * // perform close logic here * } * + * + * @opensearch.internal */ public class Lifecycle { diff --git a/server/src/main/java/org/opensearch/common/component/LifecycleComponent.java b/server/src/main/java/org/opensearch/common/component/LifecycleComponent.java index d0691c54dc220..984d55df1bdfa 100644 --- a/server/src/main/java/org/opensearch/common/component/LifecycleComponent.java +++ b/server/src/main/java/org/opensearch/common/component/LifecycleComponent.java @@ -34,6 +34,11 @@ import org.opensearch.common.lease.Releasable; +/** + * Base interface for a lifecycle component. + * + * @opensearch.internal + */ public interface LifecycleComponent extends Releasable { Lifecycle.State lifecycleState(); diff --git a/server/src/main/java/org/opensearch/common/component/LifecycleListener.java b/server/src/main/java/org/opensearch/common/component/LifecycleListener.java index dedf9a4899739..89c344b955bc9 100644 --- a/server/src/main/java/org/opensearch/common/component/LifecycleListener.java +++ b/server/src/main/java/org/opensearch/common/component/LifecycleListener.java @@ -32,6 +32,11 @@ package org.opensearch.common.component; +/** + * Base lifecycle listener. + * + * @opensearch.internal + */ public abstract class LifecycleListener { public void beforeStart() { diff --git a/server/src/main/java/org/opensearch/common/compress/CompressedXContent.java b/server/src/main/java/org/opensearch/common/compress/CompressedXContent.java index f15e213b9a773..9400955f87a1b 100644 --- a/server/src/main/java/org/opensearch/common/compress/CompressedXContent.java +++ b/server/src/main/java/org/opensearch/common/compress/CompressedXContent.java @@ -54,6 +54,8 @@ * data using a compressed representation in order to require less permanent * memory. Note that the compressed string might still sometimes need to be * decompressed in order to perform equality checks or to compute hash codes. + * + * @opensearch.internal */ public final class CompressedXContent { diff --git a/server/src/main/java/org/opensearch/common/compress/Compressor.java b/server/src/main/java/org/opensearch/common/compress/Compressor.java index b5116598ea4ce..4f55010be2f7f 100644 --- a/server/src/main/java/org/opensearch/common/compress/Compressor.java +++ b/server/src/main/java/org/opensearch/common/compress/Compressor.java @@ -38,6 +38,11 @@ import java.io.InputStream; import java.io.OutputStream; +/** + * Compressor interface + * + * @opensearch.internal + */ public interface Compressor { boolean isCompressed(BytesReference bytes); diff --git a/server/src/main/java/org/opensearch/common/compress/CompressorFactory.java b/server/src/main/java/org/opensearch/common/compress/CompressorFactory.java index 79d785296f9f5..cb30f11fa4157 100644 --- a/server/src/main/java/org/opensearch/common/compress/CompressorFactory.java +++ b/server/src/main/java/org/opensearch/common/compress/CompressorFactory.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Factory to create a compressor instance. + * + * @opensearch.internal + */ public class CompressorFactory { public static final Compressor COMPRESSOR = new DeflateCompressor(); diff --git a/server/src/main/java/org/opensearch/common/compress/DeflateCompressor.java b/server/src/main/java/org/opensearch/common/compress/DeflateCompressor.java index b622ac6d3f640..05c5250ee32a4 100644 --- a/server/src/main/java/org/opensearch/common/compress/DeflateCompressor.java +++ b/server/src/main/java/org/opensearch/common/compress/DeflateCompressor.java @@ -51,6 +51,8 @@ /** * {@link Compressor} implementation based on the DEFLATE compression algorithm. + * + * @opensearch.internal */ public class DeflateCompressor implements Compressor { diff --git a/server/src/main/java/org/opensearch/common/compress/NotCompressedException.java b/server/src/main/java/org/opensearch/common/compress/NotCompressedException.java index eedb3c0b9ac98..7f070e0b499d8 100644 --- a/server/src/main/java/org/opensearch/common/compress/NotCompressedException.java +++ b/server/src/main/java/org/opensearch/common/compress/NotCompressedException.java @@ -32,9 +32,13 @@ package org.opensearch.common.compress; -/** Exception indicating that we were expecting something compressed, which - * was not compressed or corrupted so that the compression format could not - * be detected. */ +/** + * Exception indicating that we were expecting something compressed, which + * was not compressed or corrupted so that the compression format could not + * be detected. + * + * @opensearch.internal + */ public class NotCompressedException extends RuntimeException { public NotCompressedException() { diff --git a/server/src/main/java/org/opensearch/common/compress/NotXContentException.java b/server/src/main/java/org/opensearch/common/compress/NotXContentException.java index e06b6ee96ab72..e17676fc1c508 100644 --- a/server/src/main/java/org/opensearch/common/compress/NotXContentException.java +++ b/server/src/main/java/org/opensearch/common/compress/NotXContentException.java @@ -34,8 +34,12 @@ import org.opensearch.common.xcontent.XContent; -/** Exception indicating that we were expecting some {@link XContent} but could - * not detect its type. */ +/** + * Exception indicating that we were expecting some {@link XContent} but could + * not detect its type. + * + * @opensearch.internal + */ public class NotXContentException extends RuntimeException { public NotXContentException(String message) { diff --git a/server/src/main/java/org/opensearch/common/concurrent/AutoCloseableRefCounted.java b/server/src/main/java/org/opensearch/common/concurrent/AutoCloseableRefCounted.java index 795d352542881..926eb9cb6fd45 100644 --- a/server/src/main/java/org/opensearch/common/concurrent/AutoCloseableRefCounted.java +++ b/server/src/main/java/org/opensearch/common/concurrent/AutoCloseableRefCounted.java @@ -18,6 +18,8 @@ /** * Adapter class that enables a {@link RefCounted} implementation to function like an {@link AutoCloseable}. * The {@link #close()} API invokes {@link RefCounted#decRef()} and ensures idempotency using a {@link OneWayGate}. + * + * @opensearch.internal */ public class AutoCloseableRefCounted implements AutoCloseable { diff --git a/server/src/main/java/org/opensearch/common/concurrent/GatedCloseable.java b/server/src/main/java/org/opensearch/common/concurrent/GatedCloseable.java index 467b5e4cfb3ea..8bf620ee2cd50 100644 --- a/server/src/main/java/org/opensearch/common/concurrent/GatedCloseable.java +++ b/server/src/main/java/org/opensearch/common/concurrent/GatedCloseable.java @@ -22,6 +22,8 @@ * Decorator class that wraps an object reference with a {@link CheckedRunnable} that is * invoked when {@link #close()} is called. The internal {@link OneWayGate} instance ensures * that this is invoked only once. See also {@link AutoCloseableRefCounted} + * + * @opensearch.internal */ public class GatedCloseable implements Closeable { diff --git a/server/src/main/java/org/opensearch/common/concurrent/OneWayGate.java b/server/src/main/java/org/opensearch/common/concurrent/OneWayGate.java index 76625094f3ca6..b7ddd755503b5 100644 --- a/server/src/main/java/org/opensearch/common/concurrent/OneWayGate.java +++ b/server/src/main/java/org/opensearch/common/concurrent/OneWayGate.java @@ -18,6 +18,8 @@ /** * Encapsulates logic for a one-way gate. Guarantees idempotency via the {@link AtomicBoolean} instance * and the return value of the {@link #close()} function. + * + * @opensearch.internal */ public class OneWayGate { diff --git a/server/src/main/java/org/opensearch/common/concurrent/RefCountedReleasable.java b/server/src/main/java/org/opensearch/common/concurrent/RefCountedReleasable.java index 975f2295d7c32..f71213779404e 100644 --- a/server/src/main/java/org/opensearch/common/concurrent/RefCountedReleasable.java +++ b/server/src/main/java/org/opensearch/common/concurrent/RefCountedReleasable.java @@ -20,6 +20,8 @@ * Decorator class that wraps an object reference as a {@link AbstractRefCounted} instance. * In addition to a {@link String} name, it accepts a {@link Runnable} shutdown hook that is * invoked when the reference count reaches zero i.e. on {@link #closeInternal()}. + * + * @opensearch.internal */ public class RefCountedReleasable extends AbstractRefCounted implements Releasable { diff --git a/server/src/main/java/org/opensearch/common/document/DocumentField.java b/server/src/main/java/org/opensearch/common/document/DocumentField.java index 9c6be10e5ea59..20c454f9442be 100644 --- a/server/src/main/java/org/opensearch/common/document/DocumentField.java +++ b/server/src/main/java/org/opensearch/common/document/DocumentField.java @@ -55,6 +55,8 @@ * * @see SearchHit * @see GetResult + * + * @opensearch.internal */ public class DocumentField implements Writeable, ToXContentFragment, Iterable { diff --git a/server/src/main/java/org/opensearch/common/geo/GeoBoundingBox.java b/server/src/main/java/org/opensearch/common/geo/GeoBoundingBox.java index 7413c27e63d23..6cf7a0096482c 100644 --- a/server/src/main/java/org/opensearch/common/geo/GeoBoundingBox.java +++ b/server/src/main/java/org/opensearch/common/geo/GeoBoundingBox.java @@ -52,6 +52,8 @@ /** * A class representing a Geo-Bounding-Box for use by Geo queries and aggregations * that deal with extents/rectangles representing rectangular areas of interest. + * + * @opensearch.internal */ public class GeoBoundingBox implements ToXContentObject, Writeable { private static final WellKnownText WKT_PARSER = new WellKnownText(true, new StandardValidator(true)); diff --git a/server/src/main/java/org/opensearch/common/geo/GeoDistance.java b/server/src/main/java/org/opensearch/common/geo/GeoDistance.java index f21caaff4a058..1c28233049376 100644 --- a/server/src/main/java/org/opensearch/common/geo/GeoDistance.java +++ b/server/src/main/java/org/opensearch/common/geo/GeoDistance.java @@ -42,6 +42,8 @@ /** * Geo distance calculation. + * + * @opensearch.internal */ public enum GeoDistance implements Writeable { PLANE, diff --git a/server/src/main/java/org/opensearch/common/geo/GeoJson.java b/server/src/main/java/org/opensearch/common/geo/GeoJson.java index 529126c46241d..dcce457503992 100644 --- a/server/src/main/java/org/opensearch/common/geo/GeoJson.java +++ b/server/src/main/java/org/opensearch/common/geo/GeoJson.java @@ -593,6 +593,11 @@ public String visit(Rectangle rectangle) { }); } + /** + * A node for a geo coordinate + * + * @opensearch.internal + */ private static class CoordinateNode implements ToXContentObject { public final Point coordinate; public final List children; diff --git a/server/src/main/java/org/opensearch/common/geo/GeoJsonGeometryFormat.java b/server/src/main/java/org/opensearch/common/geo/GeoJsonGeometryFormat.java index 26844d8b5c02a..5d93aec870c80 100644 --- a/server/src/main/java/org/opensearch/common/geo/GeoJsonGeometryFormat.java +++ b/server/src/main/java/org/opensearch/common/geo/GeoJsonGeometryFormat.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Geometry format for geojson + * + * @opensearch.internal + */ public class GeoJsonGeometryFormat implements GeometryFormat { public static final String NAME = "geojson"; diff --git a/server/src/main/java/org/opensearch/common/geo/GeoLineDecomposer.java b/server/src/main/java/org/opensearch/common/geo/GeoLineDecomposer.java index dea59d042f3cb..e380e6a9e68d5 100644 --- a/server/src/main/java/org/opensearch/common/geo/GeoLineDecomposer.java +++ b/server/src/main/java/org/opensearch/common/geo/GeoLineDecomposer.java @@ -42,6 +42,8 @@ /** * Splits lines by datelines. + * + * @opensearch.internal */ public class GeoLineDecomposer { diff --git a/server/src/main/java/org/opensearch/common/geo/GeoPoint.java b/server/src/main/java/org/opensearch/common/geo/GeoPoint.java index a272228af5ab6..a2b06dccded8c 100644 --- a/server/src/main/java/org/opensearch/common/geo/GeoPoint.java +++ b/server/src/main/java/org/opensearch/common/geo/GeoPoint.java @@ -56,6 +56,11 @@ import static org.opensearch.index.mapper.AbstractPointGeometryFieldMapper.Names.IGNORE_Z_VALUE; +/** + * Core geo point + * + * @opensearch.internal + */ public class GeoPoint implements ToXContentFragment { protected double lat; diff --git a/server/src/main/java/org/opensearch/common/geo/GeoPolygonDecomposer.java b/server/src/main/java/org/opensearch/common/geo/GeoPolygonDecomposer.java index 6577b10403fa2..bf2192a28a299 100644 --- a/server/src/main/java/org/opensearch/common/geo/GeoPolygonDecomposer.java +++ b/server/src/main/java/org/opensearch/common/geo/GeoPolygonDecomposer.java @@ -55,6 +55,8 @@ /** * Splits polygons by datelines. + * + * @opensearch.internal */ public class GeoPolygonDecomposer { diff --git a/server/src/main/java/org/opensearch/common/geo/GeoShapeType.java b/server/src/main/java/org/opensearch/common/geo/GeoShapeType.java index 7b2e90d8ed62b..af96566ebc44a 100644 --- a/server/src/main/java/org/opensearch/common/geo/GeoShapeType.java +++ b/server/src/main/java/org/opensearch/common/geo/GeoShapeType.java @@ -57,6 +57,8 @@ /** * Enumeration that lists all {@link GeoShapeType}s that can be parsed and indexed + * + * @opensearch.internal */ public enum GeoShapeType { POINT("point") { diff --git a/server/src/main/java/org/opensearch/common/geo/GeoShapeUtils.java b/server/src/main/java/org/opensearch/common/geo/GeoShapeUtils.java index ac248f6bb6dcc..7a59c7a08014b 100644 --- a/server/src/main/java/org/opensearch/common/geo/GeoShapeUtils.java +++ b/server/src/main/java/org/opensearch/common/geo/GeoShapeUtils.java @@ -39,6 +39,8 @@ /** * Utility class that transforms OpenSearch geometry objects to the Lucene representation + * + * @opensearch.internal */ public class GeoShapeUtils { diff --git a/server/src/main/java/org/opensearch/common/geo/GeoUtils.java b/server/src/main/java/org/opensearch/common/geo/GeoUtils.java index 1585e6cf2ad60..9cff3e56b56e3 100644 --- a/server/src/main/java/org/opensearch/common/geo/GeoUtils.java +++ b/server/src/main/java/org/opensearch/common/geo/GeoUtils.java @@ -54,6 +54,11 @@ import java.io.IOException; import java.util.Collections; +/** + * Useful geo utilities + * + * @opensearch.internal + */ public class GeoUtils { /** Maximum valid latitude in degrees. */ diff --git a/server/src/main/java/org/opensearch/common/geo/GeometryFormat.java b/server/src/main/java/org/opensearch/common/geo/GeometryFormat.java index c907ee722c1ae..b759def6785d1 100644 --- a/server/src/main/java/org/opensearch/common/geo/GeometryFormat.java +++ b/server/src/main/java/org/opensearch/common/geo/GeometryFormat.java @@ -41,6 +41,8 @@ /** * Geometry serializer/deserializer + * + * @opensearch.internal */ public interface GeometryFormat { diff --git a/server/src/main/java/org/opensearch/common/geo/GeometryIO.java b/server/src/main/java/org/opensearch/common/geo/GeometryIO.java index 113e7a6e9fa0e..09bebda50047a 100644 --- a/server/src/main/java/org/opensearch/common/geo/GeometryIO.java +++ b/server/src/main/java/org/opensearch/common/geo/GeometryIO.java @@ -55,6 +55,8 @@ /** * Utility class for binary serializtion/deserialization of libs/geo classes + * + * @opensearch.internal */ public final class GeometryIO { diff --git a/server/src/main/java/org/opensearch/common/geo/GeometryParser.java b/server/src/main/java/org/opensearch/common/geo/GeometryParser.java index f1fc1f9a1b1d0..e8c1be616ba7e 100644 --- a/server/src/main/java/org/opensearch/common/geo/GeometryParser.java +++ b/server/src/main/java/org/opensearch/common/geo/GeometryParser.java @@ -53,6 +53,8 @@ /** * An utility class with a geometry parser methods supporting different shape representation formats + * + * @opensearch.internal */ public final class GeometryParser { diff --git a/server/src/main/java/org/opensearch/common/geo/ShapeRelation.java b/server/src/main/java/org/opensearch/common/geo/ShapeRelation.java index 96ffe19129db9..19b508734c245 100644 --- a/server/src/main/java/org/opensearch/common/geo/ShapeRelation.java +++ b/server/src/main/java/org/opensearch/common/geo/ShapeRelation.java @@ -43,6 +43,8 @@ /** * Enum representing the relationship between a Query / Filter Shape and indexed Shapes * that will be used to determine if a Document should be matched or not + * + * @opensearch.internal */ public enum ShapeRelation implements Writeable { diff --git a/server/src/main/java/org/opensearch/common/geo/ShapesAvailability.java b/server/src/main/java/org/opensearch/common/geo/ShapesAvailability.java index f1a9638e998ff..abf7e7effb464 100644 --- a/server/src/main/java/org/opensearch/common/geo/ShapesAvailability.java +++ b/server/src/main/java/org/opensearch/common/geo/ShapesAvailability.java @@ -32,6 +32,11 @@ package org.opensearch.common.geo; +/** + * Checks if certain geometry packages are available + * + * @opensearch.internal + */ public class ShapesAvailability { public static final boolean SPATIAL4J_AVAILABLE; diff --git a/server/src/main/java/org/opensearch/common/geo/SpatialStrategy.java b/server/src/main/java/org/opensearch/common/geo/SpatialStrategy.java index 5eda2471e73fe..89bba47fc65a0 100644 --- a/server/src/main/java/org/opensearch/common/geo/SpatialStrategy.java +++ b/server/src/main/java/org/opensearch/common/geo/SpatialStrategy.java @@ -37,6 +37,14 @@ import java.io.IOException; +/** + * Spatial strategy for legacy prefix trees + * + * @deprecated will be removed in future version + * + * @opensearch.internal + */ +@Deprecated public enum SpatialStrategy implements Writeable { TERM("term"), diff --git a/server/src/main/java/org/opensearch/common/geo/WKTGeometryFormat.java b/server/src/main/java/org/opensearch/common/geo/WKTGeometryFormat.java index 84d12d2ebb5ab..f73c94057da9c 100644 --- a/server/src/main/java/org/opensearch/common/geo/WKTGeometryFormat.java +++ b/server/src/main/java/org/opensearch/common/geo/WKTGeometryFormat.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.text.ParseException; +/** + * Well Known Text Format + * + * @opensearch.internal + */ public class WKTGeometryFormat implements GeometryFormat { public static final String NAME = "wkt"; diff --git a/server/src/main/java/org/opensearch/common/geo/XShapeCollection.java b/server/src/main/java/org/opensearch/common/geo/XShapeCollection.java index e505a804e790e..e97bf69eae7d5 100644 --- a/server/src/main/java/org/opensearch/common/geo/XShapeCollection.java +++ b/server/src/main/java/org/opensearch/common/geo/XShapeCollection.java @@ -40,6 +40,8 @@ /** * Extends spatial4j ShapeCollection for points_only shape indexing support + * + * @opensearch.internal */ public class XShapeCollection extends ShapeCollection { diff --git a/server/src/main/java/org/opensearch/common/geo/builders/CircleBuilder.java b/server/src/main/java/org/opensearch/common/geo/builders/CircleBuilder.java index fb773ed6654d3..3b64c647df181 100644 --- a/server/src/main/java/org/opensearch/common/geo/builders/CircleBuilder.java +++ b/server/src/main/java/org/opensearch/common/geo/builders/CircleBuilder.java @@ -47,6 +47,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Builds a circle geometry + * + * @opensearch.internal + */ public class CircleBuilder extends ShapeBuilder { public static final ParseField FIELD_RADIUS = new ParseField("radius"); diff --git a/server/src/main/java/org/opensearch/common/geo/builders/CoordinatesBuilder.java b/server/src/main/java/org/opensearch/common/geo/builders/CoordinatesBuilder.java index 9c727830623da..0892e9bd57c8b 100644 --- a/server/src/main/java/org/opensearch/common/geo/builders/CoordinatesBuilder.java +++ b/server/src/main/java/org/opensearch/common/geo/builders/CoordinatesBuilder.java @@ -44,6 +44,8 @@ * A builder for a list of coordinates. * Enables chaining of individual coordinates either as long/lat pairs * or as {@link Coordinate} elements, arrays or collections. + * + * @opensearch.internal */ public class CoordinatesBuilder { diff --git a/server/src/main/java/org/opensearch/common/geo/builders/EnvelopeBuilder.java b/server/src/main/java/org/opensearch/common/geo/builders/EnvelopeBuilder.java index 5513d9912b92c..2bb4ce0472a12 100644 --- a/server/src/main/java/org/opensearch/common/geo/builders/EnvelopeBuilder.java +++ b/server/src/main/java/org/opensearch/common/geo/builders/EnvelopeBuilder.java @@ -45,6 +45,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Builds an envelope geometry + * + * @opensearch.internal + */ public class EnvelopeBuilder extends ShapeBuilder { public static final GeoShapeType TYPE = GeoShapeType.ENVELOPE; diff --git a/server/src/main/java/org/opensearch/common/geo/builders/GeometryCollectionBuilder.java b/server/src/main/java/org/opensearch/common/geo/builders/GeometryCollectionBuilder.java index 09fec96e0e693..8ff561118374c 100644 --- a/server/src/main/java/org/opensearch/common/geo/builders/GeometryCollectionBuilder.java +++ b/server/src/main/java/org/opensearch/common/geo/builders/GeometryCollectionBuilder.java @@ -49,6 +49,11 @@ import java.util.List; import java.util.Objects; +/** + * Builds a geometry collection + * + * @opensearch.internal + */ public class GeometryCollectionBuilder extends ShapeBuilder, GeometryCollectionBuilder> { public static final GeoShapeType TYPE = GeoShapeType.GEOMETRYCOLLECTION; diff --git a/server/src/main/java/org/opensearch/common/geo/builders/LineStringBuilder.java b/server/src/main/java/org/opensearch/common/geo/builders/LineStringBuilder.java index ae7075ff7bb47..fc9548a4d9072 100644 --- a/server/src/main/java/org/opensearch/common/geo/builders/LineStringBuilder.java +++ b/server/src/main/java/org/opensearch/common/geo/builders/LineStringBuilder.java @@ -48,6 +48,11 @@ import java.util.Arrays; import java.util.List; +/** + * Builds a line string geometry + * + * @opensearch.internal + */ public class LineStringBuilder extends ShapeBuilder { public static final GeoShapeType TYPE = GeoShapeType.LINESTRING; diff --git a/server/src/main/java/org/opensearch/common/geo/builders/MultiLineStringBuilder.java b/server/src/main/java/org/opensearch/common/geo/builders/MultiLineStringBuilder.java index 9e303b8de2a6e..64ca4aae326c9 100644 --- a/server/src/main/java/org/opensearch/common/geo/builders/MultiLineStringBuilder.java +++ b/server/src/main/java/org/opensearch/common/geo/builders/MultiLineStringBuilder.java @@ -51,6 +51,11 @@ import java.util.List; import java.util.Objects; +/** + * Builds a multi line string geometry + * + * @opensearch.internal + */ public class MultiLineStringBuilder extends ShapeBuilder { public static final GeoShapeType TYPE = GeoShapeType.MULTILINESTRING; diff --git a/server/src/main/java/org/opensearch/common/geo/builders/MultiPointBuilder.java b/server/src/main/java/org/opensearch/common/geo/builders/MultiPointBuilder.java index 29ec72f4755be..7d5fb4b1c8dd6 100644 --- a/server/src/main/java/org/opensearch/common/geo/builders/MultiPointBuilder.java +++ b/server/src/main/java/org/opensearch/common/geo/builders/MultiPointBuilder.java @@ -46,6 +46,11 @@ import java.util.List; import java.util.stream.Collectors; +/** + * Builds a multi point geometry + * + * @opensearch.internal + */ public class MultiPointBuilder extends ShapeBuilder, MultiPoint, MultiPointBuilder> { public static final GeoShapeType TYPE = GeoShapeType.MULTIPOINT; diff --git a/server/src/main/java/org/opensearch/common/geo/builders/MultiPolygonBuilder.java b/server/src/main/java/org/opensearch/common/geo/builders/MultiPolygonBuilder.java index ac78c09c91b48..27fc84d229d9d 100644 --- a/server/src/main/java/org/opensearch/common/geo/builders/MultiPolygonBuilder.java +++ b/server/src/main/java/org/opensearch/common/geo/builders/MultiPolygonBuilder.java @@ -50,6 +50,11 @@ import java.util.Locale; import java.util.Objects; +/** + * Builds a multi polygon geometry + * + * @opensearch.internal + */ public class MultiPolygonBuilder extends ShapeBuilder { public static final GeoShapeType TYPE = GeoShapeType.MULTIPOLYGON; diff --git a/server/src/main/java/org/opensearch/common/geo/builders/PointBuilder.java b/server/src/main/java/org/opensearch/common/geo/builders/PointBuilder.java index 86878f736d6e6..885733cde5828 100644 --- a/server/src/main/java/org/opensearch/common/geo/builders/PointBuilder.java +++ b/server/src/main/java/org/opensearch/common/geo/builders/PointBuilder.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Builds a point geometry + * + * @opensearch.internal + */ public class PointBuilder extends ShapeBuilder { public static final GeoShapeType TYPE = GeoShapeType.POINT; diff --git a/server/src/main/java/org/opensearch/common/geo/builders/PolygonBuilder.java b/server/src/main/java/org/opensearch/common/geo/builders/PolygonBuilder.java index 5abc01e5aade6..0341d2a1af325 100644 --- a/server/src/main/java/org/opensearch/common/geo/builders/PolygonBuilder.java +++ b/server/src/main/java/org/opensearch/common/geo/builders/PolygonBuilder.java @@ -65,6 +65,8 @@ * The {@link PolygonBuilder} implements the groundwork to create polygons. This contains * Methods to wrap polygons at the dateline and building shapes from the data held by the * builder. + * + * @opensearch.internal */ public class PolygonBuilder extends ShapeBuilder { diff --git a/server/src/main/java/org/opensearch/common/geo/builders/ShapeBuilder.java b/server/src/main/java/org/opensearch/common/geo/builders/ShapeBuilder.java index afd57ad6ab5f3..4e7524400958a 100644 --- a/server/src/main/java/org/opensearch/common/geo/builders/ShapeBuilder.java +++ b/server/src/main/java/org/opensearch/common/geo/builders/ShapeBuilder.java @@ -63,6 +63,8 @@ /** * Basic class for building GeoJSON shapes like Polygons, Linestrings, etc + * + * @opensearch.internal */ public abstract class ShapeBuilder> implements diff --git a/server/src/main/java/org/opensearch/common/geo/parsers/CoordinateNode.java b/server/src/main/java/org/opensearch/common/geo/parsers/CoordinateNode.java index c4c091b0e25fe..2404081325592 100644 --- a/server/src/main/java/org/opensearch/common/geo/parsers/CoordinateNode.java +++ b/server/src/main/java/org/opensearch/common/geo/parsers/CoordinateNode.java @@ -44,6 +44,8 @@ *

* Can either be a leaf node consisting of a Coordinate, or a parent with * children + * + * @opensearch.internal */ public class CoordinateNode implements ToXContentObject { public final Coordinate coordinate; diff --git a/server/src/main/java/org/opensearch/common/geo/parsers/GeoJsonParser.java b/server/src/main/java/org/opensearch/common/geo/parsers/GeoJsonParser.java index 45ad538187fa4..28feb0d5c2e95 100644 --- a/server/src/main/java/org/opensearch/common/geo/parsers/GeoJsonParser.java +++ b/server/src/main/java/org/opensearch/common/geo/parsers/GeoJsonParser.java @@ -53,6 +53,8 @@ * Parses shape geometry represented in geojson * * complies with geojson specification: https://tools.ietf.org/html/rfc7946 + * + * @opensearch.internal */ abstract class GeoJsonParser { protected static ShapeBuilder parse(XContentParser parser, AbstractShapeGeometryFieldMapper shapeMapper) throws IOException { diff --git a/server/src/main/java/org/opensearch/common/geo/parsers/GeoWKTParser.java b/server/src/main/java/org/opensearch/common/geo/parsers/GeoWKTParser.java index 7aa5b0a165f90..adccedae88185 100644 --- a/server/src/main/java/org/opensearch/common/geo/parsers/GeoWKTParser.java +++ b/server/src/main/java/org/opensearch/common/geo/parsers/GeoWKTParser.java @@ -60,6 +60,8 @@ * * complies with OGC® document: 12-063r5 and ISO/IEC 13249-3:2016 standard * located at http://docs.opengeospatial.org/is/12-063r5/12-063r5.html + * + * @opensearch.internal */ public class GeoWKTParser { public static final String EMPTY = "EMPTY"; diff --git a/server/src/main/java/org/opensearch/common/geo/parsers/ShapeParser.java b/server/src/main/java/org/opensearch/common/geo/parsers/ShapeParser.java index f2670fd4efff5..c8f3db84ba6c4 100644 --- a/server/src/main/java/org/opensearch/common/geo/parsers/ShapeParser.java +++ b/server/src/main/java/org/opensearch/common/geo/parsers/ShapeParser.java @@ -47,6 +47,8 @@ /** * first point of entry for a shape parser + * + * @opensearch.internal */ public interface ShapeParser { ParseField FIELD_TYPE = new ParseField("type"); diff --git a/server/src/main/java/org/opensearch/common/hash/MessageDigests.java b/server/src/main/java/org/opensearch/common/hash/MessageDigests.java index c2a294828332d..f53f60a3a97a3 100644 --- a/server/src/main/java/org/opensearch/common/hash/MessageDigests.java +++ b/server/src/main/java/org/opensearch/common/hash/MessageDigests.java @@ -40,6 +40,8 @@ * This MessageDigests class provides convenience methods for obtaining * thread local {@link MessageDigest} instances for MD5, SHA-1, and * SHA-256 message digests. + * + * @opensearch.internal */ public final class MessageDigests { diff --git a/server/src/main/java/org/opensearch/common/hash/MurmurHash3.java b/server/src/main/java/org/opensearch/common/hash/MurmurHash3.java index f8b8b92027bba..8ba0bd7ee1be4 100644 --- a/server/src/main/java/org/opensearch/common/hash/MurmurHash3.java +++ b/server/src/main/java/org/opensearch/common/hash/MurmurHash3.java @@ -38,12 +38,16 @@ /** * MurmurHash3 hashing functions. + * + * @opensearch.internal */ public enum MurmurHash3 { ; /** * A 128-bits hash. + * + * @opensearch.internal */ public static class Hash128 { /** lower 64 bits part **/ diff --git a/server/src/main/java/org/opensearch/common/inject/AbstractModule.java b/server/src/main/java/org/opensearch/common/inject/AbstractModule.java index da0473dd25e01..7d2b65c23b6c2 100644 --- a/server/src/main/java/org/opensearch/common/inject/AbstractModule.java +++ b/server/src/main/java/org/opensearch/common/inject/AbstractModule.java @@ -57,6 +57,8 @@ * * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public abstract class AbstractModule implements Module { diff --git a/server/src/main/java/org/opensearch/common/inject/AbstractProcessor.java b/server/src/main/java/org/opensearch/common/inject/AbstractProcessor.java index 53010c50baf02..bc9624b9a13e7 100644 --- a/server/src/main/java/org/opensearch/common/inject/AbstractProcessor.java +++ b/server/src/main/java/org/opensearch/common/inject/AbstractProcessor.java @@ -53,6 +53,8 @@ * handled element. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ abstract class AbstractProcessor implements ElementVisitor { diff --git a/server/src/main/java/org/opensearch/common/inject/Binder.java b/server/src/main/java/org/opensearch/common/inject/Binder.java index 3782734b0d927..a733a19608ac1 100644 --- a/server/src/main/java/org/opensearch/common/inject/Binder.java +++ b/server/src/main/java/org/opensearch/common/inject/Binder.java @@ -197,6 +197,8 @@ * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) * @author kevinb@google.com (Kevin Bourrillion) + * + * @opensearch.internal */ public interface Binder { diff --git a/server/src/main/java/org/opensearch/common/inject/Binding.java b/server/src/main/java/org/opensearch/common/inject/Binding.java index d40aec8a25d6d..53d02e37502af 100644 --- a/server/src/main/java/org/opensearch/common/inject/Binding.java +++ b/server/src/main/java/org/opensearch/common/inject/Binding.java @@ -68,6 +68,8 @@ * @param the bound type. The injected is always assignable to this type. * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public interface Binding extends Element { diff --git a/server/src/main/java/org/opensearch/common/inject/BindingAnnotation.java b/server/src/main/java/org/opensearch/common/inject/BindingAnnotation.java index 183ee13db162d..430b204c3e640 100644 --- a/server/src/main/java/org/opensearch/common/inject/BindingAnnotation.java +++ b/server/src/main/java/org/opensearch/common/inject/BindingAnnotation.java @@ -47,6 +47,8 @@ * * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ @Target(ANNOTATION_TYPE) @Retention(RUNTIME) diff --git a/server/src/main/java/org/opensearch/common/inject/BindingProcessor.java b/server/src/main/java/org/opensearch/common/inject/BindingProcessor.java index 2635ead8d7f51..1dd3c83b1474e 100644 --- a/server/src/main/java/org/opensearch/common/inject/BindingProcessor.java +++ b/server/src/main/java/org/opensearch/common/inject/BindingProcessor.java @@ -67,6 +67,8 @@ * * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class BindingProcessor extends AbstractProcessor { diff --git a/server/src/main/java/org/opensearch/common/inject/BoundProviderFactory.java b/server/src/main/java/org/opensearch/common/inject/BoundProviderFactory.java index ba73fbb0848f7..687da29eb27d3 100644 --- a/server/src/main/java/org/opensearch/common/inject/BoundProviderFactory.java +++ b/server/src/main/java/org/opensearch/common/inject/BoundProviderFactory.java @@ -38,6 +38,8 @@ /** * Delegates to a custom factory which is also bound in the injector. + * + * @opensearch.internal */ class BoundProviderFactory implements InternalFactory, CreationListener { diff --git a/server/src/main/java/org/opensearch/common/inject/ConfigurationException.java b/server/src/main/java/org/opensearch/common/inject/ConfigurationException.java index b62fe8f753505..4379a93482560 100644 --- a/server/src/main/java/org/opensearch/common/inject/ConfigurationException.java +++ b/server/src/main/java/org/opensearch/common/inject/ConfigurationException.java @@ -45,6 +45,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public final class ConfigurationException extends RuntimeException { private final Set messages; diff --git a/server/src/main/java/org/opensearch/common/inject/ConstantFactory.java b/server/src/main/java/org/opensearch/common/inject/ConstantFactory.java index 2b1c6aa258226..935448d811532 100644 --- a/server/src/main/java/org/opensearch/common/inject/ConstantFactory.java +++ b/server/src/main/java/org/opensearch/common/inject/ConstantFactory.java @@ -37,7 +37,11 @@ import org.opensearch.common.inject.spi.Dependency; /** + * Constant factory. + * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ class ConstantFactory implements InternalFactory { diff --git a/server/src/main/java/org/opensearch/common/inject/ConstructionProxy.java b/server/src/main/java/org/opensearch/common/inject/ConstructionProxy.java index 6a8ca2ac820f9..7d30e3307d500 100644 --- a/server/src/main/java/org/opensearch/common/inject/ConstructionProxy.java +++ b/server/src/main/java/org/opensearch/common/inject/ConstructionProxy.java @@ -39,6 +39,8 @@ * {@code T}. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ interface ConstructionProxy { diff --git a/server/src/main/java/org/opensearch/common/inject/ConstructionProxyFactory.java b/server/src/main/java/org/opensearch/common/inject/ConstructionProxyFactory.java index f84f7c03a2caf..5b1a3f453d2f0 100644 --- a/server/src/main/java/org/opensearch/common/inject/ConstructionProxyFactory.java +++ b/server/src/main/java/org/opensearch/common/inject/ConstructionProxyFactory.java @@ -33,6 +33,8 @@ * Creates {@link ConstructionProxy} instances. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ interface ConstructionProxyFactory { diff --git a/server/src/main/java/org/opensearch/common/inject/ConstructorBindingImpl.java b/server/src/main/java/org/opensearch/common/inject/ConstructorBindingImpl.java index 5f8458e76d349..8027ff74a4e21 100644 --- a/server/src/main/java/org/opensearch/common/inject/ConstructorBindingImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/ConstructorBindingImpl.java @@ -44,6 +44,11 @@ import java.util.HashSet; import java.util.Set; +/** + * Constructor binding implementation + * + * @opensearch.internal + */ class ConstructorBindingImpl extends BindingImpl implements ConstructorBinding { private final Factory factory; @@ -115,6 +120,11 @@ public String toString() { .toString(); } + /** + * Factory to build a binding object + * + * @opensearch.internal + */ private static class Factory implements InternalFactory { private ConstructorInjector constructorInjector; diff --git a/server/src/main/java/org/opensearch/common/inject/ConstructorInjector.java b/server/src/main/java/org/opensearch/common/inject/ConstructorInjector.java index a83eed858fb0b..ff8806d1fda98 100644 --- a/server/src/main/java/org/opensearch/common/inject/ConstructorInjector.java +++ b/server/src/main/java/org/opensearch/common/inject/ConstructorInjector.java @@ -43,6 +43,8 @@ * methods are injected. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ class ConstructorInjector { diff --git a/server/src/main/java/org/opensearch/common/inject/ConstructorInjectorStore.java b/server/src/main/java/org/opensearch/common/inject/ConstructorInjectorStore.java index d06896c2b4243..220de16201cf7 100644 --- a/server/src/main/java/org/opensearch/common/inject/ConstructorInjectorStore.java +++ b/server/src/main/java/org/opensearch/common/inject/ConstructorInjectorStore.java @@ -38,6 +38,8 @@ * Constructor injectors by type. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class ConstructorInjectorStore { private final InjectorImpl injector; diff --git a/server/src/main/java/org/opensearch/common/inject/ContextualCallable.java b/server/src/main/java/org/opensearch/common/inject/ContextualCallable.java index 0e8404898aad2..22afccdaf12c0 100644 --- a/server/src/main/java/org/opensearch/common/inject/ContextualCallable.java +++ b/server/src/main/java/org/opensearch/common/inject/ContextualCallable.java @@ -33,7 +33,11 @@ import org.opensearch.common.inject.internal.InternalContext; /** + * Contextual callable + * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ interface ContextualCallable { T call(InternalContext context) throws ErrorsException; diff --git a/server/src/main/java/org/opensearch/common/inject/CreationException.java b/server/src/main/java/org/opensearch/common/inject/CreationException.java index 9ab1c882e9d51..8b2271ba3630e 100644 --- a/server/src/main/java/org/opensearch/common/inject/CreationException.java +++ b/server/src/main/java/org/opensearch/common/inject/CreationException.java @@ -39,6 +39,8 @@ * errors. Clients should catch this exception, log it, and stop execution. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public class CreationException extends RuntimeException { private final Collection messages; diff --git a/server/src/main/java/org/opensearch/common/inject/DefaultConstructionProxyFactory.java b/server/src/main/java/org/opensearch/common/inject/DefaultConstructionProxyFactory.java index cdc6bf36034df..146398714b78d 100644 --- a/server/src/main/java/org/opensearch/common/inject/DefaultConstructionProxyFactory.java +++ b/server/src/main/java/org/opensearch/common/inject/DefaultConstructionProxyFactory.java @@ -38,6 +38,8 @@ * Produces construction proxies that invoke the class constructor. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ class DefaultConstructionProxyFactory implements ConstructionProxyFactory { diff --git a/server/src/main/java/org/opensearch/common/inject/DeferredLookups.java b/server/src/main/java/org/opensearch/common/inject/DeferredLookups.java index 20a437e0a80a3..9004cba954bce 100644 --- a/server/src/main/java/org/opensearch/common/inject/DeferredLookups.java +++ b/server/src/main/java/org/opensearch/common/inject/DeferredLookups.java @@ -42,6 +42,8 @@ * creation it's necessary to {@link #initialize initialize} these lookups. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class DeferredLookups implements Lookups { private final InjectorImpl injector; diff --git a/server/src/main/java/org/opensearch/common/inject/EncounterImpl.java b/server/src/main/java/org/opensearch/common/inject/EncounterImpl.java index 296a176ab83bc..39b9574b62ba3 100644 --- a/server/src/main/java/org/opensearch/common/inject/EncounterImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/EncounterImpl.java @@ -39,7 +39,11 @@ import java.util.List; /** + * Encounter implementation + * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ final class EncounterImpl implements TypeEncounter { diff --git a/server/src/main/java/org/opensearch/common/inject/Exposed.java b/server/src/main/java/org/opensearch/common/inject/Exposed.java index 65f7f3037714c..204d74ca096b7 100644 --- a/server/src/main/java/org/opensearch/common/inject/Exposed.java +++ b/server/src/main/java/org/opensearch/common/inject/Exposed.java @@ -42,6 +42,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ @Target(ElementType.METHOD) @Retention(RUNTIME) diff --git a/server/src/main/java/org/opensearch/common/inject/ExposedKeyFactory.java b/server/src/main/java/org/opensearch/common/inject/ExposedKeyFactory.java index 3983984470c18..9a07bcf1adc00 100644 --- a/server/src/main/java/org/opensearch/common/inject/ExposedKeyFactory.java +++ b/server/src/main/java/org/opensearch/common/inject/ExposedKeyFactory.java @@ -40,6 +40,8 @@ /** * This factory exists in a parent injector. When invoked, it retrieves its value from a child * injector. + * + * @opensearch.internal */ class ExposedKeyFactory implements InternalFactory, BindingProcessor.CreationListener { private final Key key; diff --git a/server/src/main/java/org/opensearch/common/inject/FactoryProxy.java b/server/src/main/java/org/opensearch/common/inject/FactoryProxy.java index 97146198e4b95..ffb1873efc1bb 100644 --- a/server/src/main/java/org/opensearch/common/inject/FactoryProxy.java +++ b/server/src/main/java/org/opensearch/common/inject/FactoryProxy.java @@ -38,6 +38,8 @@ /** * A placeholder which enables us to swap in the real factory once the injector is created. + * + * @opensearch.internal */ class FactoryProxy implements InternalFactory, BindingProcessor.CreationListener { diff --git a/server/src/main/java/org/opensearch/common/inject/Guice.java b/server/src/main/java/org/opensearch/common/inject/Guice.java index 1ffdd5267fd6e..6513f720bea98 100644 --- a/server/src/main/java/org/opensearch/common/inject/Guice.java +++ b/server/src/main/java/org/opensearch/common/inject/Guice.java @@ -57,6 +57,8 @@ * } * } * + * + * @opensearch.internal */ public final class Guice { diff --git a/server/src/main/java/org/opensearch/common/inject/ImplementedBy.java b/server/src/main/java/org/opensearch/common/inject/ImplementedBy.java index 05df90d9dba78..1d0fec8033f62 100644 --- a/server/src/main/java/org/opensearch/common/inject/ImplementedBy.java +++ b/server/src/main/java/org/opensearch/common/inject/ImplementedBy.java @@ -39,6 +39,8 @@ * A pointer to the default implementation of a type. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ @Retention(RUNTIME) @Target(TYPE) diff --git a/server/src/main/java/org/opensearch/common/inject/InheritingState.java b/server/src/main/java/org/opensearch/common/inject/InheritingState.java index a25017ab9a2c0..dc31de4e20084 100644 --- a/server/src/main/java/org/opensearch/common/inject/InheritingState.java +++ b/server/src/main/java/org/opensearch/common/inject/InheritingState.java @@ -49,7 +49,11 @@ import static java.util.Collections.emptySet; /** + * Inheriting state. + * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class InheritingState implements State { diff --git a/server/src/main/java/org/opensearch/common/inject/Initializable.java b/server/src/main/java/org/opensearch/common/inject/Initializable.java index 779d50bbfcea0..9dbc26645fad1 100644 --- a/server/src/main/java/org/opensearch/common/inject/Initializable.java +++ b/server/src/main/java/org/opensearch/common/inject/Initializable.java @@ -36,6 +36,8 @@ * Holds a reference that requires initialization to be performed before it can be used. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ interface Initializable { diff --git a/server/src/main/java/org/opensearch/common/inject/Initializables.java b/server/src/main/java/org/opensearch/common/inject/Initializables.java index 4ace6a059c847..6d1d5b88e4306 100644 --- a/server/src/main/java/org/opensearch/common/inject/Initializables.java +++ b/server/src/main/java/org/opensearch/common/inject/Initializables.java @@ -33,7 +33,11 @@ import org.opensearch.common.inject.internal.ErrorsException; /** + * Initializables. + * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class Initializables { diff --git a/server/src/main/java/org/opensearch/common/inject/Initializer.java b/server/src/main/java/org/opensearch/common/inject/Initializer.java index 8b333f7ac29ed..e806eba6df707 100644 --- a/server/src/main/java/org/opensearch/common/inject/Initializer.java +++ b/server/src/main/java/org/opensearch/common/inject/Initializer.java @@ -46,6 +46,8 @@ * {@link Initializable}, which attempts to perform injection before use. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class Initializer { /** diff --git a/server/src/main/java/org/opensearch/common/inject/Inject.java b/server/src/main/java/org/opensearch/common/inject/Inject.java index 658d5dcd1ae7c..0c58238459d42 100644 --- a/server/src/main/java/org/opensearch/common/inject/Inject.java +++ b/server/src/main/java/org/opensearch/common/inject/Inject.java @@ -60,6 +60,8 @@ * specifier (private, default, protected, public). * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ @Target({ METHOD, CONSTRUCTOR, FIELD }) @Retention(RUNTIME) diff --git a/server/src/main/java/org/opensearch/common/inject/InjectionRequestProcessor.java b/server/src/main/java/org/opensearch/common/inject/InjectionRequestProcessor.java index 63740859ba0d5..062e1bb1257f1 100644 --- a/server/src/main/java/org/opensearch/common/inject/InjectionRequestProcessor.java +++ b/server/src/main/java/org/opensearch/common/inject/InjectionRequestProcessor.java @@ -46,6 +46,8 @@ * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) * @author mikeward@google.com (Mike Ward) + * + * @opensearch.internal */ class InjectionRequestProcessor extends AbstractProcessor { diff --git a/server/src/main/java/org/opensearch/common/inject/Injector.java b/server/src/main/java/org/opensearch/common/inject/Injector.java index adf8a6c742f67..ff212c6313371 100644 --- a/server/src/main/java/org/opensearch/common/inject/Injector.java +++ b/server/src/main/java/org/opensearch/common/inject/Injector.java @@ -53,6 +53,8 @@ * * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public interface Injector { diff --git a/server/src/main/java/org/opensearch/common/inject/InjectorBuilder.java b/server/src/main/java/org/opensearch/common/inject/InjectorBuilder.java index 944ff64d508ac..3dd858356ba16 100644 --- a/server/src/main/java/org/opensearch/common/inject/InjectorBuilder.java +++ b/server/src/main/java/org/opensearch/common/inject/InjectorBuilder.java @@ -56,6 +56,8 @@ * * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class InjectorBuilder { diff --git a/server/src/main/java/org/opensearch/common/inject/InjectorImpl.java b/server/src/main/java/org/opensearch/common/inject/InjectorImpl.java index 439ce8fbae33b..c01f155c399e4 100644 --- a/server/src/main/java/org/opensearch/common/inject/InjectorImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/InjectorImpl.java @@ -72,6 +72,8 @@ * * @author crazybob@google.com (Bob Lee) * @see InjectorBuilder + * + * @opensearch.internal */ class InjectorImpl implements Injector, Lookups { final State state; @@ -199,6 +201,11 @@ private BindingImpl> createProviderBinding(Key> key, return new ProviderBindingImpl<>(this, key, delegate); } + /** + * Implementation for a binding object + * + * @opensearch.internal + */ static class ProviderBindingImpl extends BindingImpl> implements ProviderBinding> { final BindingImpl providedBinding; @@ -286,6 +293,11 @@ private BindingImpl convertConstantStringBinding(Key key, Errors error } } + /** + * Implementation for a converted constant + * + * @opensearch.internal + */ private static class ConvertedConstantBindingImpl extends BindingImpl implements ConvertedConstantBinding { final T value; final Provider provider; @@ -607,6 +619,11 @@ InternalFactory getInternalFactory(Key key, Errors errors) t return getBindingOrThrow(key, errors).getInternalFactory(); } + /** + * Multimap for java bindings + * + * @opensearch.internal + */ private static class BindingsMultimap { final Map, List>> multimap = new HashMap<>(); diff --git a/server/src/main/java/org/opensearch/common/inject/InjectorShell.java b/server/src/main/java/org/opensearch/common/inject/InjectorShell.java index 0af8aa5a895a0..006d39b6d8348 100644 --- a/server/src/main/java/org/opensearch/common/inject/InjectorShell.java +++ b/server/src/main/java/org/opensearch/common/inject/InjectorShell.java @@ -58,6 +58,8 @@ * of injectors in batch. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class InjectorShell { @@ -77,6 +79,11 @@ List getElements() { return elements; } + /** + * Builder for an injector + * + * @opensearch.internal + */ static class Builder { private final List elements = new ArrayList<>(); private final List modules = new ArrayList<>(); @@ -215,6 +222,11 @@ private static void bindInjector(InjectorImpl injector) { ); } + /** + * The factory for the injector + * + * @opensearch.internal + */ private static class InjectorFactory implements InternalFactory, Provider { private final Injector injector; @@ -259,6 +271,11 @@ private static void bindLogger(InjectorImpl injector) { ); } + /** + * Factory for a logger + * + * @opensearch.internal + */ private static class LoggerFactory implements InternalFactory, Provider { @Override public Logger get(Errors errors, InternalContext context, Dependency dependency) { @@ -279,6 +296,11 @@ public String toString() { } } + /** + * The root module + * + * @opensearch.internal + */ private static class RootModule implements Module { final Stage stage; diff --git a/server/src/main/java/org/opensearch/common/inject/InternalFactoryToProviderAdapter.java b/server/src/main/java/org/opensearch/common/inject/InternalFactoryToProviderAdapter.java index 3eb40b8d567a0..9925418c34a30 100644 --- a/server/src/main/java/org/opensearch/common/inject/InternalFactoryToProviderAdapter.java +++ b/server/src/main/java/org/opensearch/common/inject/InternalFactoryToProviderAdapter.java @@ -39,7 +39,11 @@ import java.util.Objects; /** + * Adapats internal factory to a provider + * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ class InternalFactoryToProviderAdapter implements InternalFactory { diff --git a/server/src/main/java/org/opensearch/common/inject/Key.java b/server/src/main/java/org/opensearch/common/inject/Key.java index d36791c154450..56730cbfa495a 100644 --- a/server/src/main/java/org/opensearch/common/inject/Key.java +++ b/server/src/main/java/org/opensearch/common/inject/Key.java @@ -58,6 +58,8 @@ * types will be replaced with their wrapper types when keys are created. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public class Key { @@ -411,6 +413,11 @@ public String toString() { } } + /** + * Strategy for an annotation + * + * @opensearch.internal + */ // this class not test-covered static class AnnotationInstanceStrategy implements AnnotationStrategy { @@ -461,6 +468,11 @@ public String toString() { } } + /** + * Type of annotation + * + * @opensearch.internal + */ static class AnnotationTypeStrategy implements AnnotationStrategy { final Class annotationType; diff --git a/server/src/main/java/org/opensearch/common/inject/LookupProcessor.java b/server/src/main/java/org/opensearch/common/inject/LookupProcessor.java index 153dad9ce0cf8..c9d1546ca9e92 100644 --- a/server/src/main/java/org/opensearch/common/inject/LookupProcessor.java +++ b/server/src/main/java/org/opensearch/common/inject/LookupProcessor.java @@ -39,6 +39,8 @@ * * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class LookupProcessor extends AbstractProcessor { diff --git a/server/src/main/java/org/opensearch/common/inject/Lookups.java b/server/src/main/java/org/opensearch/common/inject/Lookups.java index 798a665cdb3d0..241bae072217a 100644 --- a/server/src/main/java/org/opensearch/common/inject/Lookups.java +++ b/server/src/main/java/org/opensearch/common/inject/Lookups.java @@ -34,6 +34,8 @@ * the injector has been created. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ interface Lookups { diff --git a/server/src/main/java/org/opensearch/common/inject/MembersInjector.java b/server/src/main/java/org/opensearch/common/inject/MembersInjector.java index 132616ac35a08..891762375d5a2 100644 --- a/server/src/main/java/org/opensearch/common/inject/MembersInjector.java +++ b/server/src/main/java/org/opensearch/common/inject/MembersInjector.java @@ -37,6 +37,8 @@ * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface MembersInjector { diff --git a/server/src/main/java/org/opensearch/common/inject/MembersInjectorImpl.java b/server/src/main/java/org/opensearch/common/inject/MembersInjectorImpl.java index 507b21f872b0a..47eca6840b3e2 100644 --- a/server/src/main/java/org/opensearch/common/inject/MembersInjectorImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/MembersInjectorImpl.java @@ -45,6 +45,8 @@ * Injects members of instances of a given type. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class MembersInjectorImpl implements MembersInjector { private final TypeLiteral typeLiteral; diff --git a/server/src/main/java/org/opensearch/common/inject/MembersInjectorStore.java b/server/src/main/java/org/opensearch/common/inject/MembersInjectorStore.java index 207803abe6df7..c63460d1a9a96 100644 --- a/server/src/main/java/org/opensearch/common/inject/MembersInjectorStore.java +++ b/server/src/main/java/org/opensearch/common/inject/MembersInjectorStore.java @@ -45,6 +45,8 @@ * Members injectors by type. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class MembersInjectorStore { private final InjectorImpl injector; diff --git a/server/src/main/java/org/opensearch/common/inject/MessageProcessor.java b/server/src/main/java/org/opensearch/common/inject/MessageProcessor.java index e2f06cfeaf144..f81babc803019 100644 --- a/server/src/main/java/org/opensearch/common/inject/MessageProcessor.java +++ b/server/src/main/java/org/opensearch/common/inject/MessageProcessor.java @@ -37,6 +37,8 @@ * * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class MessageProcessor extends AbstractProcessor { diff --git a/server/src/main/java/org/opensearch/common/inject/Module.java b/server/src/main/java/org/opensearch/common/inject/Module.java index 49a12714c8de4..b1fc031192ea0 100644 --- a/server/src/main/java/org/opensearch/common/inject/Module.java +++ b/server/src/main/java/org/opensearch/common/inject/Module.java @@ -42,6 +42,8 @@ * will be created for all methods annotated with {@literal @}{@link Provides}. * Use scope and binding annotations on these methods to configure the * bindings. + * + * @opensearch.internal */ public interface Module { diff --git a/server/src/main/java/org/opensearch/common/inject/ModulesBuilder.java b/server/src/main/java/org/opensearch/common/inject/ModulesBuilder.java index 0ad304ad90d5c..55fc263ffc574 100644 --- a/server/src/main/java/org/opensearch/common/inject/ModulesBuilder.java +++ b/server/src/main/java/org/opensearch/common/inject/ModulesBuilder.java @@ -37,6 +37,11 @@ import java.util.Iterator; import java.util.List; +/** + * A modules builder + * + * @opensearch.internal + */ public class ModulesBuilder implements Iterable { private final List modules = new ArrayList<>(); diff --git a/server/src/main/java/org/opensearch/common/inject/OutOfScopeException.java b/server/src/main/java/org/opensearch/common/inject/OutOfScopeException.java index ed222d014fbc2..bf1d25498fb90 100644 --- a/server/src/main/java/org/opensearch/common/inject/OutOfScopeException.java +++ b/server/src/main/java/org/opensearch/common/inject/OutOfScopeException.java @@ -35,6 +35,8 @@ * * @author kevinb@google.com (Kevin Bourrillion) * @since 2.0 + * + * @opensearch.internal */ public final class OutOfScopeException extends RuntimeException { diff --git a/server/src/main/java/org/opensearch/common/inject/PreProcessModule.java b/server/src/main/java/org/opensearch/common/inject/PreProcessModule.java index 48778fd78292a..e34e564d8e253 100644 --- a/server/src/main/java/org/opensearch/common/inject/PreProcessModule.java +++ b/server/src/main/java/org/opensearch/common/inject/PreProcessModule.java @@ -36,7 +36,7 @@ * A module can implement this interface to allow to pre process other modules * before an injector is created. * - * + * @opensearch.internal */ public interface PreProcessModule { diff --git a/server/src/main/java/org/opensearch/common/inject/PrivateBinder.java b/server/src/main/java/org/opensearch/common/inject/PrivateBinder.java index 22e334a52c9b7..87635880e29d8 100644 --- a/server/src/main/java/org/opensearch/common/inject/PrivateBinder.java +++ b/server/src/main/java/org/opensearch/common/inject/PrivateBinder.java @@ -37,6 +37,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface PrivateBinder extends Binder { diff --git a/server/src/main/java/org/opensearch/common/inject/PrivateElementProcessor.java b/server/src/main/java/org/opensearch/common/inject/PrivateElementProcessor.java index 103fb2f9049dd..b1a97b8defcd9 100644 --- a/server/src/main/java/org/opensearch/common/inject/PrivateElementProcessor.java +++ b/server/src/main/java/org/opensearch/common/inject/PrivateElementProcessor.java @@ -39,6 +39,8 @@ * Handles {@link Binder#newPrivateBinder()} elements. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class PrivateElementProcessor extends AbstractProcessor { diff --git a/server/src/main/java/org/opensearch/common/inject/PrivateModule.java b/server/src/main/java/org/opensearch/common/inject/PrivateModule.java index df47d5eb261f3..09c02c944c316 100644 --- a/server/src/main/java/org/opensearch/common/inject/PrivateModule.java +++ b/server/src/main/java/org/opensearch/common/inject/PrivateModule.java @@ -83,6 +83,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public abstract class PrivateModule implements Module { diff --git a/server/src/main/java/org/opensearch/common/inject/ProvidedBy.java b/server/src/main/java/org/opensearch/common/inject/ProvidedBy.java index 4a8c9dece954f..b6879a9ea3dc0 100644 --- a/server/src/main/java/org/opensearch/common/inject/ProvidedBy.java +++ b/server/src/main/java/org/opensearch/common/inject/ProvidedBy.java @@ -39,6 +39,8 @@ * A pointer to the default provider type for a type. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ @Retention(RUNTIME) @Target(TYPE) diff --git a/server/src/main/java/org/opensearch/common/inject/Provider.java b/server/src/main/java/org/opensearch/common/inject/Provider.java index 96c08d1f943fc..97f9e9ae503cd 100644 --- a/server/src/main/java/org/opensearch/common/inject/Provider.java +++ b/server/src/main/java/org/opensearch/common/inject/Provider.java @@ -49,6 +49,8 @@ * * @param the type of object this provides * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public interface Provider { diff --git a/server/src/main/java/org/opensearch/common/inject/ProviderToInternalFactoryAdapter.java b/server/src/main/java/org/opensearch/common/inject/ProviderToInternalFactoryAdapter.java index f67b601ca8662..c90d4dcf7469d 100644 --- a/server/src/main/java/org/opensearch/common/inject/ProviderToInternalFactoryAdapter.java +++ b/server/src/main/java/org/opensearch/common/inject/ProviderToInternalFactoryAdapter.java @@ -36,7 +36,11 @@ import org.opensearch.common.inject.spi.Dependency; /** + * Adapts a provider to an internal factory. + * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ class ProviderToInternalFactoryAdapter implements Provider { diff --git a/server/src/main/java/org/opensearch/common/inject/Provides.java b/server/src/main/java/org/opensearch/common/inject/Provides.java index 694816b971692..5620b30774af5 100644 --- a/server/src/main/java/org/opensearch/common/inject/Provides.java +++ b/server/src/main/java/org/opensearch/common/inject/Provides.java @@ -42,6 +42,8 @@ * * @author crazybob@google.com (Bob Lee) * @since 2.0 + * + * @opensearch.internal */ @Documented @Target(METHOD) diff --git a/server/src/main/java/org/opensearch/common/inject/ProvisionException.java b/server/src/main/java/org/opensearch/common/inject/ProvisionException.java index 122777f550c7a..452e7982ddca4 100644 --- a/server/src/main/java/org/opensearch/common/inject/ProvisionException.java +++ b/server/src/main/java/org/opensearch/common/inject/ProvisionException.java @@ -46,6 +46,8 @@ * @author kevinb@google.com (Kevin Bourrillion) * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public final class ProvisionException extends RuntimeException { private final Set messages; diff --git a/server/src/main/java/org/opensearch/common/inject/Reflection.java b/server/src/main/java/org/opensearch/common/inject/Reflection.java index f835b3ea41d8e..296ac9a63a1de 100644 --- a/server/src/main/java/org/opensearch/common/inject/Reflection.java +++ b/server/src/main/java/org/opensearch/common/inject/Reflection.java @@ -43,6 +43,8 @@ class Reflection { /** * A placeholder. This enables us to continue processing and gather more * errors but blows up if you actually try to use it. + * + * @opensearch.internal */ static class InvalidConstructor { InvalidConstructor() { diff --git a/server/src/main/java/org/opensearch/common/inject/Scope.java b/server/src/main/java/org/opensearch/common/inject/Scope.java index 97017e997aeba..a21495f522d5e 100644 --- a/server/src/main/java/org/opensearch/common/inject/Scope.java +++ b/server/src/main/java/org/opensearch/common/inject/Scope.java @@ -41,6 +41,8 @@ * An example of a scope is {@link Scopes#SINGLETON}. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public interface Scope { diff --git a/server/src/main/java/org/opensearch/common/inject/ScopeAnnotation.java b/server/src/main/java/org/opensearch/common/inject/ScopeAnnotation.java index 88ed59025553b..5617112fb30c4 100644 --- a/server/src/main/java/org/opensearch/common/inject/ScopeAnnotation.java +++ b/server/src/main/java/org/opensearch/common/inject/ScopeAnnotation.java @@ -47,6 +47,8 @@ * * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ @Target(ANNOTATION_TYPE) @Retention(RUNTIME) diff --git a/server/src/main/java/org/opensearch/common/inject/ScopeBindingProcessor.java b/server/src/main/java/org/opensearch/common/inject/ScopeBindingProcessor.java index 77a5f92074673..f36172ecd1779 100644 --- a/server/src/main/java/org/opensearch/common/inject/ScopeBindingProcessor.java +++ b/server/src/main/java/org/opensearch/common/inject/ScopeBindingProcessor.java @@ -41,6 +41,8 @@ * * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class ScopeBindingProcessor extends AbstractProcessor { diff --git a/server/src/main/java/org/opensearch/common/inject/Scopes.java b/server/src/main/java/org/opensearch/common/inject/Scopes.java index a3821fdc7fa67..557455b31b02d 100644 --- a/server/src/main/java/org/opensearch/common/inject/Scopes.java +++ b/server/src/main/java/org/opensearch/common/inject/Scopes.java @@ -40,6 +40,8 @@ * Built-in scope implementations. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public class Scopes { diff --git a/server/src/main/java/org/opensearch/common/inject/SingleFieldInjector.java b/server/src/main/java/org/opensearch/common/inject/SingleFieldInjector.java index 8a6e1e446fca0..3d02213c743c1 100644 --- a/server/src/main/java/org/opensearch/common/inject/SingleFieldInjector.java +++ b/server/src/main/java/org/opensearch/common/inject/SingleFieldInjector.java @@ -40,6 +40,8 @@ /** * Sets an injectable field. + * + * @opensearch.internal */ class SingleFieldInjector implements SingleMemberInjector { final Field field; diff --git a/server/src/main/java/org/opensearch/common/inject/SingleMemberInjector.java b/server/src/main/java/org/opensearch/common/inject/SingleMemberInjector.java index 009fbcfb1128f..d26ed98ef91f8 100644 --- a/server/src/main/java/org/opensearch/common/inject/SingleMemberInjector.java +++ b/server/src/main/java/org/opensearch/common/inject/SingleMemberInjector.java @@ -35,6 +35,8 @@ /** * Injects a field or method of a given object. + * + * @opensearch.internal */ interface SingleMemberInjector { void inject(Errors errors, InternalContext context, Object o); diff --git a/server/src/main/java/org/opensearch/common/inject/SingleMethodInjector.java b/server/src/main/java/org/opensearch/common/inject/SingleMethodInjector.java index 6ca2b1b367f1a..600b953964010 100644 --- a/server/src/main/java/org/opensearch/common/inject/SingleMethodInjector.java +++ b/server/src/main/java/org/opensearch/common/inject/SingleMethodInjector.java @@ -41,6 +41,8 @@ /** * Invokes an injectable method. + * + * @opensearch.internal */ class SingleMethodInjector implements SingleMemberInjector { final MethodInvoker methodInvoker; diff --git a/server/src/main/java/org/opensearch/common/inject/SingleParameterInjector.java b/server/src/main/java/org/opensearch/common/inject/SingleParameterInjector.java index 7fa6cd1d5df18..cc6636d35c670 100644 --- a/server/src/main/java/org/opensearch/common/inject/SingleParameterInjector.java +++ b/server/src/main/java/org/opensearch/common/inject/SingleParameterInjector.java @@ -37,6 +37,8 @@ /** * Resolves a single parameter, to be used in a constructor or method invocation. + * + * @opensearch.internal */ class SingleParameterInjector { private static final Object[] NO_ARGUMENTS = {}; diff --git a/server/src/main/java/org/opensearch/common/inject/Singleton.java b/server/src/main/java/org/opensearch/common/inject/Singleton.java index d3d894e2d6cfe..29c743ae47e82 100644 --- a/server/src/main/java/org/opensearch/common/inject/Singleton.java +++ b/server/src/main/java/org/opensearch/common/inject/Singleton.java @@ -40,6 +40,8 @@ * (per {@link Injector}) to be reused for all injections for that binding. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ @Target({ ElementType.TYPE, ElementType.METHOD }) @Retention(RUNTIME) diff --git a/server/src/main/java/org/opensearch/common/inject/Stage.java b/server/src/main/java/org/opensearch/common/inject/Stage.java index befb6409d7457..d5996bd1363e9 100644 --- a/server/src/main/java/org/opensearch/common/inject/Stage.java +++ b/server/src/main/java/org/opensearch/common/inject/Stage.java @@ -33,6 +33,8 @@ * The stage we're running in. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public enum Stage { diff --git a/server/src/main/java/org/opensearch/common/inject/State.java b/server/src/main/java/org/opensearch/common/inject/State.java index 560824c065793..3d90737f40dc2 100644 --- a/server/src/main/java/org/opensearch/common/inject/State.java +++ b/server/src/main/java/org/opensearch/common/inject/State.java @@ -46,6 +46,8 @@ * injector data to be accessed as a unit. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ interface State { diff --git a/server/src/main/java/org/opensearch/common/inject/TypeConverterBindingProcessor.java b/server/src/main/java/org/opensearch/common/inject/TypeConverterBindingProcessor.java index 07b4628044904..abe8a24eead8d 100644 --- a/server/src/main/java/org/opensearch/common/inject/TypeConverterBindingProcessor.java +++ b/server/src/main/java/org/opensearch/common/inject/TypeConverterBindingProcessor.java @@ -48,6 +48,8 @@ * * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class TypeConverterBindingProcessor extends AbstractProcessor { diff --git a/server/src/main/java/org/opensearch/common/inject/TypeListenerBindingProcessor.java b/server/src/main/java/org/opensearch/common/inject/TypeListenerBindingProcessor.java index 07916ccb1aeb4..64a47ab97cbb7 100644 --- a/server/src/main/java/org/opensearch/common/inject/TypeListenerBindingProcessor.java +++ b/server/src/main/java/org/opensearch/common/inject/TypeListenerBindingProcessor.java @@ -36,6 +36,8 @@ * Handles {@link Binder#bindListener} commands. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class TypeListenerBindingProcessor extends AbstractProcessor { diff --git a/server/src/main/java/org/opensearch/common/inject/TypeLiteral.java b/server/src/main/java/org/opensearch/common/inject/TypeLiteral.java index 6fb267a911fcf..48b33d9df5f09 100644 --- a/server/src/main/java/org/opensearch/common/inject/TypeLiteral.java +++ b/server/src/main/java/org/opensearch/common/inject/TypeLiteral.java @@ -76,6 +76,8 @@ * * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public class TypeLiteral { diff --git a/server/src/main/java/org/opensearch/common/inject/WeakKeySet.java b/server/src/main/java/org/opensearch/common/inject/WeakKeySet.java index 7ad49a7b9759c..44e3864d991ae 100644 --- a/server/src/main/java/org/opensearch/common/inject/WeakKeySet.java +++ b/server/src/main/java/org/opensearch/common/inject/WeakKeySet.java @@ -36,6 +36,8 @@ * Minimal set that doesn't hold strong references to the contained keys. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ final class WeakKeySet { diff --git a/server/src/main/java/org/opensearch/common/inject/assistedinject/Assisted.java b/server/src/main/java/org/opensearch/common/inject/assistedinject/Assisted.java index 656260952c5d2..8379458a8c069 100644 --- a/server/src/main/java/org/opensearch/common/inject/assistedinject/Assisted.java +++ b/server/src/main/java/org/opensearch/common/inject/assistedinject/Assisted.java @@ -44,6 +44,8 @@ * * @author jmourits@google.com (Jerome Mourits) * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ @BindingAnnotation @Target({ FIELD, PARAMETER, METHOD }) diff --git a/server/src/main/java/org/opensearch/common/inject/assistedinject/AssistedConstructor.java b/server/src/main/java/org/opensearch/common/inject/assistedinject/AssistedConstructor.java index 663a859402a26..989eb26274101 100644 --- a/server/src/main/java/org/opensearch/common/inject/assistedinject/AssistedConstructor.java +++ b/server/src/main/java/org/opensearch/common/inject/assistedinject/AssistedConstructor.java @@ -48,6 +48,8 @@ * * @author jmourits@google.com (Jerome Mourits) * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class AssistedConstructor { diff --git a/server/src/main/java/org/opensearch/common/inject/assistedinject/AssistedInject.java b/server/src/main/java/org/opensearch/common/inject/assistedinject/AssistedInject.java index 4f2d9b7915175..976c148f95275 100644 --- a/server/src/main/java/org/opensearch/common/inject/assistedinject/AssistedInject.java +++ b/server/src/main/java/org/opensearch/common/inject/assistedinject/AssistedInject.java @@ -49,6 +49,8 @@ * annotation. When using that annotation, parameters are matched by name and type rather than * by position. In addition, values that use the standard {@literal @Inject} constructor * annotation are eligible for method interception. + * + * @opensearch.internal */ @Target({ CONSTRUCTOR }) @Retention(RUNTIME) diff --git a/server/src/main/java/org/opensearch/common/inject/assistedinject/FactoryProvider.java b/server/src/main/java/org/opensearch/common/inject/assistedinject/FactoryProvider.java index 6f288a0c4c9a8..e7eb2fcc4727c 100644 --- a/server/src/main/java/org/opensearch/common/inject/assistedinject/FactoryProvider.java +++ b/server/src/main/java/org/opensearch/common/inject/assistedinject/FactoryProvider.java @@ -134,6 +134,8 @@ * @author jmourits@google.com (Jerome Mourits) * @author jessewilson@google.com (Jesse Wilson) * @author dtm@google.com (Daniel Martin) + * + * @opensearch.internal */ public class FactoryProvider implements Provider, HasDependencies { diff --git a/server/src/main/java/org/opensearch/common/inject/assistedinject/Parameter.java b/server/src/main/java/org/opensearch/common/inject/assistedinject/Parameter.java index 8f8df0a2ac373..960fc079e6438 100644 --- a/server/src/main/java/org/opensearch/common/inject/assistedinject/Parameter.java +++ b/server/src/main/java/org/opensearch/common/inject/assistedinject/Parameter.java @@ -43,6 +43,8 @@ * * @author jmourits@google.com (Jerome Mourits) * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class Parameter { diff --git a/server/src/main/java/org/opensearch/common/inject/assistedinject/ParameterListKey.java b/server/src/main/java/org/opensearch/common/inject/assistedinject/ParameterListKey.java index 0f48371a89ec1..12474dfceb69b 100644 --- a/server/src/main/java/org/opensearch/common/inject/assistedinject/ParameterListKey.java +++ b/server/src/main/java/org/opensearch/common/inject/assistedinject/ParameterListKey.java @@ -42,6 +42,8 @@ * * @author jmourits@google.com (Jerome Mourits) * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class ParameterListKey { diff --git a/server/src/main/java/org/opensearch/common/inject/binder/AnnotatedBindingBuilder.java b/server/src/main/java/org/opensearch/common/inject/binder/AnnotatedBindingBuilder.java index 0a6aacb79ab54..bcd593a8cbf7b 100644 --- a/server/src/main/java/org/opensearch/common/inject/binder/AnnotatedBindingBuilder.java +++ b/server/src/main/java/org/opensearch/common/inject/binder/AnnotatedBindingBuilder.java @@ -35,6 +35,8 @@ * See the EDSL examples at {@link org.opensearch.common.inject.Binder}. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public interface AnnotatedBindingBuilder extends LinkedBindingBuilder { diff --git a/server/src/main/java/org/opensearch/common/inject/binder/AnnotatedConstantBindingBuilder.java b/server/src/main/java/org/opensearch/common/inject/binder/AnnotatedConstantBindingBuilder.java index 11e11e3b8cf7a..42c208a2b37ea 100644 --- a/server/src/main/java/org/opensearch/common/inject/binder/AnnotatedConstantBindingBuilder.java +++ b/server/src/main/java/org/opensearch/common/inject/binder/AnnotatedConstantBindingBuilder.java @@ -35,6 +35,8 @@ * See the EDSL examples at {@link org.opensearch.common.inject.Binder}. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public interface AnnotatedConstantBindingBuilder { diff --git a/server/src/main/java/org/opensearch/common/inject/binder/AnnotatedElementBuilder.java b/server/src/main/java/org/opensearch/common/inject/binder/AnnotatedElementBuilder.java index b63e25b1baa42..f2d0916790b6b 100644 --- a/server/src/main/java/org/opensearch/common/inject/binder/AnnotatedElementBuilder.java +++ b/server/src/main/java/org/opensearch/common/inject/binder/AnnotatedElementBuilder.java @@ -36,6 +36,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface AnnotatedElementBuilder { diff --git a/server/src/main/java/org/opensearch/common/inject/binder/ConstantBindingBuilder.java b/server/src/main/java/org/opensearch/common/inject/binder/ConstantBindingBuilder.java index b03c2a937f36b..595c477d3e28b 100644 --- a/server/src/main/java/org/opensearch/common/inject/binder/ConstantBindingBuilder.java +++ b/server/src/main/java/org/opensearch/common/inject/binder/ConstantBindingBuilder.java @@ -31,6 +31,8 @@ /** * Binds to a constant value. + * + * @opensearch.internal */ public interface ConstantBindingBuilder { diff --git a/server/src/main/java/org/opensearch/common/inject/binder/LinkedBindingBuilder.java b/server/src/main/java/org/opensearch/common/inject/binder/LinkedBindingBuilder.java index 708a2d632518f..2368fef16471c 100644 --- a/server/src/main/java/org/opensearch/common/inject/binder/LinkedBindingBuilder.java +++ b/server/src/main/java/org/opensearch/common/inject/binder/LinkedBindingBuilder.java @@ -37,6 +37,8 @@ * See the EDSL examples at {@link org.opensearch.common.inject.Binder}. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public interface LinkedBindingBuilder extends ScopedBindingBuilder { diff --git a/server/src/main/java/org/opensearch/common/inject/binder/ScopedBindingBuilder.java b/server/src/main/java/org/opensearch/common/inject/binder/ScopedBindingBuilder.java index cd52cd8e574e9..73dd4414f17a2 100644 --- a/server/src/main/java/org/opensearch/common/inject/binder/ScopedBindingBuilder.java +++ b/server/src/main/java/org/opensearch/common/inject/binder/ScopedBindingBuilder.java @@ -37,6 +37,8 @@ * See the EDSL examples at {@link org.opensearch.common.inject.Binder}. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public interface ScopedBindingBuilder { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/AbstractBindingBuilder.java b/server/src/main/java/org/opensearch/common/inject/internal/AbstractBindingBuilder.java index a6622a3e6af7c..ba7951894b801 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/AbstractBindingBuilder.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/AbstractBindingBuilder.java @@ -43,6 +43,8 @@ * Bind a value or constant. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public abstract class AbstractBindingBuilder { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/Annotations.java b/server/src/main/java/org/opensearch/common/inject/internal/Annotations.java index 3b83bd9693df1..1d61acad60324 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/Annotations.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/Annotations.java @@ -44,6 +44,8 @@ * Annotation utilities. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public class Annotations { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/BindingBuilder.java b/server/src/main/java/org/opensearch/common/inject/internal/BindingBuilder.java index d4927adafc258..9f5f0dc4a7bc6 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/BindingBuilder.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/BindingBuilder.java @@ -52,6 +52,8 @@ * Bind a non-constant key. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public class BindingBuilder extends AbstractBindingBuilder implements AnnotatedBindingBuilder { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/BindingImpl.java b/server/src/main/java/org/opensearch/common/inject/internal/BindingImpl.java index 0365158d02461..1004398e844d8 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/BindingImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/BindingImpl.java @@ -38,7 +38,11 @@ import org.opensearch.common.inject.spi.InstanceBinding; /** + * A binding implementation + * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public abstract class BindingImpl implements Binding { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/ConstantBindingBuilderImpl.java b/server/src/main/java/org/opensearch/common/inject/internal/ConstantBindingBuilderImpl.java index 62108baaea324..53883e8c4b8ae 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/ConstantBindingBuilderImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/ConstantBindingBuilderImpl.java @@ -44,6 +44,8 @@ * Bind a constant. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public final class ConstantBindingBuilderImpl extends AbstractBindingBuilder implements diff --git a/server/src/main/java/org/opensearch/common/inject/internal/ConstructionContext.java b/server/src/main/java/org/opensearch/common/inject/internal/ConstructionContext.java index 58988f16b1d2d..63ae0584fdee9 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/ConstructionContext.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/ConstructionContext.java @@ -40,6 +40,8 @@ * Context of a dependency construction. Used to manage circular references. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public class ConstructionContext { @@ -105,6 +107,11 @@ public void setProxyDelegates(T delegate) { } } + /** + * An invocation handler that delegates the implementation + * + * @opensearch.internal + */ static class DelegatingInvocationHandler implements InvocationHandler { T delegate; diff --git a/server/src/main/java/org/opensearch/common/inject/internal/ErrorHandler.java b/server/src/main/java/org/opensearch/common/inject/internal/ErrorHandler.java index cf3d3eaddc528..283c8c468401b 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/ErrorHandler.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/ErrorHandler.java @@ -35,6 +35,8 @@ * Handles errors in the Injector. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public interface ErrorHandler { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/Errors.java b/server/src/main/java/org/opensearch/common/inject/internal/Errors.java index 3a2a1b980c1e3..86d7ef2a2ca36 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/Errors.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/Errors.java @@ -77,6 +77,8 @@ * method with an errors object that includes its context. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public final class Errors { @@ -590,6 +592,11 @@ public int size() { return root.errors == null ? 0 : root.errors.size(); } + /** + * A converter + * + * @opensearch.internal + */ private abstract static class Converter { final Class type; diff --git a/server/src/main/java/org/opensearch/common/inject/internal/ErrorsException.java b/server/src/main/java/org/opensearch/common/inject/internal/ErrorsException.java index 555ec2bddbe2c..d472305ce860b 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/ErrorsException.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/ErrorsException.java @@ -35,6 +35,8 @@ * errors. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public class ErrorsException extends Exception { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/ExpirationTimer.java b/server/src/main/java/org/opensearch/common/inject/internal/ExpirationTimer.java index 0c838e0a574a4..ab9d67a6a24eb 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/ExpirationTimer.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/ExpirationTimer.java @@ -33,6 +33,8 @@ /** * Timer used for entry expiration in MapMaker. + * + * @opensearch.internal */ class ExpirationTimer { static Timer instance = new Timer(true); diff --git a/server/src/main/java/org/opensearch/common/inject/internal/ExposedBindingImpl.java b/server/src/main/java/org/opensearch/common/inject/internal/ExposedBindingImpl.java index d70892ee92e60..18d55ce703608 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/ExposedBindingImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/ExposedBindingImpl.java @@ -41,6 +41,11 @@ import static java.util.Collections.singleton; +/** + * Exposed binding implementation + * + * @opensearch.internal + */ public class ExposedBindingImpl extends BindingImpl implements ExposedBinding { private final PrivateElements privateElements; diff --git a/server/src/main/java/org/opensearch/common/inject/internal/ExposureBuilder.java b/server/src/main/java/org/opensearch/common/inject/internal/ExposureBuilder.java index 46585b02ab0f1..792c208d872d4 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/ExposureBuilder.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/ExposureBuilder.java @@ -38,6 +38,8 @@ /** * For private binder's expose() method. + * + * @opensearch.internal */ public class ExposureBuilder implements AnnotatedElementBuilder { private final Binder binder; diff --git a/server/src/main/java/org/opensearch/common/inject/internal/FailableCache.java b/server/src/main/java/org/opensearch/common/inject/internal/FailableCache.java index 0c8495df8ddf2..a5d57f94cb670 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/FailableCache.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/FailableCache.java @@ -36,6 +36,8 @@ * exception is thrown on retrieval. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public abstract class FailableCache { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/InstanceBindingImpl.java b/server/src/main/java/org/opensearch/common/inject/internal/InstanceBindingImpl.java index 3b6741bbbcaac..22b1c8dd1cf85 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/InstanceBindingImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/InstanceBindingImpl.java @@ -45,6 +45,11 @@ import static java.util.Collections.unmodifiableSet; +/** + * Instance binding implementation + * + * @opensearch.internal + */ public class InstanceBindingImpl extends BindingImpl implements InstanceBinding { final T instance; diff --git a/server/src/main/java/org/opensearch/common/inject/internal/InternalContext.java b/server/src/main/java/org/opensearch/common/inject/internal/InternalContext.java index 79dc11677e043..7cde5c6a35f8d 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/InternalContext.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/InternalContext.java @@ -39,6 +39,8 @@ * dependencies. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public final class InternalContext { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/InternalFactory.java b/server/src/main/java/org/opensearch/common/inject/internal/InternalFactory.java index 8d8e919cae8af..d7b8a5a4f49ef 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/InternalFactory.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/InternalFactory.java @@ -35,6 +35,8 @@ * Creates objects which will be injected. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public interface InternalFactory { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/LinkedBindingImpl.java b/server/src/main/java/org/opensearch/common/inject/internal/LinkedBindingImpl.java index 2c03d582e53da..f81ec7517d4e3 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/LinkedBindingImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/LinkedBindingImpl.java @@ -35,6 +35,11 @@ import org.opensearch.common.inject.spi.BindingTargetVisitor; import org.opensearch.common.inject.spi.LinkedKeyBinding; +/** + * Linked binding implementation + * + * @opensearch.internal + */ public final class LinkedBindingImpl extends BindingImpl implements LinkedKeyBinding { final Key targetKey; diff --git a/server/src/main/java/org/opensearch/common/inject/internal/LinkedProviderBindingImpl.java b/server/src/main/java/org/opensearch/common/inject/internal/LinkedProviderBindingImpl.java index 80ae73cd4c223..5c8be66b21103 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/LinkedProviderBindingImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/LinkedProviderBindingImpl.java @@ -36,6 +36,11 @@ import org.opensearch.common.inject.spi.BindingTargetVisitor; import org.opensearch.common.inject.spi.ProviderKeyBinding; +/** + * Linked provider binding implementation + * + * @opensearch.internal + */ public final class LinkedProviderBindingImpl extends BindingImpl implements ProviderKeyBinding { final Key> providerKey; diff --git a/server/src/main/java/org/opensearch/common/inject/internal/MatcherAndConverter.java b/server/src/main/java/org/opensearch/common/inject/internal/MatcherAndConverter.java index 4d744f2634da8..53051044b2f32 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/MatcherAndConverter.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/MatcherAndConverter.java @@ -36,7 +36,11 @@ import java.util.Objects; /** + * Matches and converts + * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public final class MatcherAndConverter { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/MoreTypes.java b/server/src/main/java/org/opensearch/common/inject/internal/MoreTypes.java index ce215b3867793..5ccdc0c59908e 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/MoreTypes.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/MoreTypes.java @@ -57,6 +57,8 @@ * public {@code Types} API. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public class MoreTypes { @@ -432,6 +434,11 @@ private static Class declaringClassOf(TypeVariable typeVariable) { return genericDeclaration instanceof Class ? (Class) genericDeclaration : null; } + /** + * Implementation for a parameterized type + * + * @opensearch.internal + */ public static class ParameterizedTypeImpl implements ParameterizedType, CompositeType { private final Type ownerType; private final Type rawType; @@ -510,6 +517,11 @@ public String toString() { } } + /** + * Implementation for a generic array + * + * @opensearch.internal + */ public static class GenericArrayTypeImpl implements GenericArrayType, CompositeType { private final Type componentType; @@ -547,6 +559,8 @@ public String toString() { * The WildcardType interface supports multiple upper bounds and multiple * lower bounds. We only support what the Java 6 language needs - at most one * bound. If a lower bound is set, the upper bound must be Object.class. + * + * @opensearch.internal */ public static class WildcardTypeImpl implements WildcardType, CompositeType { private final Type upperBound; @@ -617,6 +631,8 @@ private static void checkNotPrimitive(Type type, String use) { * We cannot serialize the built-in Java member classes, which prevents us from using Members in * our exception types. We workaround this with this serializable implementation. It includes all * of the API methods, plus everything we use for line numbers and messaging. + * + * @opensearch.internal */ public static class MemberImpl implements Member { private final Class declaringClass; diff --git a/server/src/main/java/org/opensearch/common/inject/internal/Nullability.java b/server/src/main/java/org/opensearch/common/inject/internal/Nullability.java index ecc7d5f9f5b3c..1f968adfe57ea 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/Nullability.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/Nullability.java @@ -43,6 +43,8 @@ * org.jetbrains.annotations.Nullable. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public class Nullability { private Nullability() {} diff --git a/server/src/main/java/org/opensearch/common/inject/internal/PrivateElementsImpl.java b/server/src/main/java/org/opensearch/common/inject/internal/PrivateElementsImpl.java index c8cd137bdf5fd..46caeeebc8cc6 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/PrivateElementsImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/PrivateElementsImpl.java @@ -48,7 +48,11 @@ import static java.util.Collections.unmodifiableMap; /** + * Private elements implementation + * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public final class PrivateElementsImpl implements PrivateElements { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/ProviderInstanceBindingImpl.java b/server/src/main/java/org/opensearch/common/inject/internal/ProviderInstanceBindingImpl.java index 96f4b0644172a..b74429fe6728e 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/ProviderInstanceBindingImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/ProviderInstanceBindingImpl.java @@ -44,6 +44,11 @@ import static java.util.Collections.unmodifiableSet; +/** + * Provider instance binding + * + * @opensearch.internal + */ public final class ProviderInstanceBindingImpl extends BindingImpl implements ProviderInstanceBinding { final Provider providerInstance; diff --git a/server/src/main/java/org/opensearch/common/inject/internal/ProviderMethod.java b/server/src/main/java/org/opensearch/common/inject/internal/ProviderMethod.java index 8acbc663aca7d..5368eaee7539a 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/ProviderMethod.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/ProviderMethod.java @@ -47,6 +47,8 @@ * A provider that invokes a method and returns its result. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public class ProviderMethod implements ProviderWithDependencies { private final Key key; diff --git a/server/src/main/java/org/opensearch/common/inject/internal/ProviderMethodsModule.java b/server/src/main/java/org/opensearch/common/inject/internal/ProviderMethodsModule.java index e34a338fdc41e..0ca911d4d9be4 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/ProviderMethodsModule.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/ProviderMethodsModule.java @@ -56,6 +56,8 @@ * * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public final class ProviderMethodsModule implements Module { private final Object delegate; diff --git a/server/src/main/java/org/opensearch/common/inject/internal/Scoping.java b/server/src/main/java/org/opensearch/common/inject/internal/Scoping.java index cda8d6e41a1ff..da0601fd9145f 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/Scoping.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/Scoping.java @@ -43,6 +43,8 @@ * The scope's eager or laziness is also exposed. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public abstract class Scoping { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/SourceProvider.java b/server/src/main/java/org/opensearch/common/inject/internal/SourceProvider.java index 0ff1c6bef3566..e7e2afe35aa89 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/SourceProvider.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/SourceProvider.java @@ -39,6 +39,8 @@ * Provides access to the calling line of code. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public class SourceProvider { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/StackTraceElements.java b/server/src/main/java/org/opensearch/common/inject/internal/StackTraceElements.java index f0335639e9b34..2c0e67351dfdd 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/StackTraceElements.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/StackTraceElements.java @@ -36,6 +36,8 @@ * Creates stack trace elements for members. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public class StackTraceElements { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/Stopwatch.java b/server/src/main/java/org/opensearch/common/inject/internal/Stopwatch.java index c35c4334fb609..61038306f48cc 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/Stopwatch.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/Stopwatch.java @@ -37,6 +37,8 @@ * Enables simple performance monitoring. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public class Stopwatch { private static final Logger logger = Logger.getLogger(Stopwatch.class.getName()); diff --git a/server/src/main/java/org/opensearch/common/inject/internal/Strings.java b/server/src/main/java/org/opensearch/common/inject/internal/Strings.java index 5ad1e96c319c4..97004ce6dd3ac 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/Strings.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/Strings.java @@ -33,6 +33,8 @@ * String utilities. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public class Strings { private Strings() {} diff --git a/server/src/main/java/org/opensearch/common/inject/internal/ToStringBuilder.java b/server/src/main/java/org/opensearch/common/inject/internal/ToStringBuilder.java index 2953f2430df95..d9af76322297c 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/ToStringBuilder.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/ToStringBuilder.java @@ -36,6 +36,8 @@ * Helps with {@code toString()} methods. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public class ToStringBuilder { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/UniqueAnnotations.java b/server/src/main/java/org/opensearch/common/inject/internal/UniqueAnnotations.java index 6b5e859258c15..3c037f7cd552a 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/UniqueAnnotations.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/UniqueAnnotations.java @@ -38,7 +38,11 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; /** + * Unique annotations. + * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public class UniqueAnnotations { private UniqueAnnotations() {} diff --git a/server/src/main/java/org/opensearch/common/inject/internal/UntargettedBindingImpl.java b/server/src/main/java/org/opensearch/common/inject/internal/UntargettedBindingImpl.java index 9e2c148ec79ce..a4a472a061fee 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/UntargettedBindingImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/UntargettedBindingImpl.java @@ -36,6 +36,11 @@ import org.opensearch.common.inject.spi.Dependency; import org.opensearch.common.inject.spi.UntargettedBinding; +/** + * An untargeted binding implementation + * + * @opensearch.internal + */ public class UntargettedBindingImpl extends BindingImpl implements UntargettedBinding { public UntargettedBindingImpl(Injector injector, Key key, Object source) { diff --git a/server/src/main/java/org/opensearch/common/inject/matcher/AbstractMatcher.java b/server/src/main/java/org/opensearch/common/inject/matcher/AbstractMatcher.java index c6c77cb62f46f..9d9c3ec490bec 100644 --- a/server/src/main/java/org/opensearch/common/inject/matcher/AbstractMatcher.java +++ b/server/src/main/java/org/opensearch/common/inject/matcher/AbstractMatcher.java @@ -33,6 +33,8 @@ * Implements {@code and()} and {@code or()}. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public abstract class AbstractMatcher implements Matcher { @@ -46,6 +48,11 @@ public Matcher or(Matcher other) { return new OrMatcher<>(this, other); } + /** + * An AND matcher + * + * @opensearch.internal + */ private static class AndMatcher extends AbstractMatcher { private final Matcher a, b; @@ -75,6 +82,11 @@ public String toString() { } } + /** + * An OR matcher + * + * @opensearch.internal + */ private static class OrMatcher extends AbstractMatcher { private final Matcher a, b; diff --git a/server/src/main/java/org/opensearch/common/inject/matcher/Matcher.java b/server/src/main/java/org/opensearch/common/inject/matcher/Matcher.java index 090a8ef63fc57..21bb63cfef097 100644 --- a/server/src/main/java/org/opensearch/common/inject/matcher/Matcher.java +++ b/server/src/main/java/org/opensearch/common/inject/matcher/Matcher.java @@ -33,6 +33,8 @@ * Returns {@code true} or {@code false} for a given input. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public interface Matcher { diff --git a/server/src/main/java/org/opensearch/common/inject/matcher/Matchers.java b/server/src/main/java/org/opensearch/common/inject/matcher/Matchers.java index dd997e0168f09..e33e7f32ee5de 100644 --- a/server/src/main/java/org/opensearch/common/inject/matcher/Matchers.java +++ b/server/src/main/java/org/opensearch/common/inject/matcher/Matchers.java @@ -42,6 +42,8 @@ * Matcher implementations. Supports matching classes and methods. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public class Matchers { private Matchers() {} @@ -55,6 +57,11 @@ public static Matcher any() { private static final Matcher ANY = new Any(); + /** + * Matches ANY + * + * @opensearch.internal + */ private static class Any extends AbstractMatcher { @Override public boolean matches(Object o) { @@ -78,6 +85,11 @@ public static Matcher not(final Matcher p) { return new Not<>(p); } + /** + * A NOT Matcher + * + * @opensearch.internal + */ private static class Not extends AbstractMatcher { final Matcher delegate; @@ -121,6 +133,11 @@ public static Matcher annotatedWith(final Class { private final Class annotationType; @@ -158,6 +175,11 @@ public static Matcher annotatedWith(final Annotation annotatio return new AnnotatedWith(annotation); } + /** + * An annotated With matcher + * + * @opensearch.internal + */ private static class AnnotatedWith extends AbstractMatcher { private final Annotation annotation; @@ -196,6 +218,11 @@ public static Matcher subclassesOf(final Class superclass) { return new SubclassesOf(superclass); } + /** + * A subclass matcher + * + * @opensearch.internal + */ private static class SubclassesOf extends AbstractMatcher { private final Class superclass; @@ -231,6 +258,11 @@ public static Matcher only(Object value) { return new Only(value); } + /** + * ONLY matcher + * + * @opensearch.internal + */ private static class Only extends AbstractMatcher { private final Object value; @@ -266,6 +298,11 @@ public static Matcher identicalTo(final Object value) { return new IdenticalTo(value); } + /** + * Identical matcher + * + * @opensearch.internal + */ private static class IdenticalTo extends AbstractMatcher { private final Object value; @@ -302,6 +339,11 @@ public static Matcher inPackage(final Package targetPackage) { return new InPackage(targetPackage); } + /** + * In Package matcher + * + * @opensearch.internal + */ private static class InPackage extends AbstractMatcher { private final transient Package targetPackage; private final String packageName; @@ -348,6 +390,11 @@ public static Matcher inSubpackage(final String targetPackageName) { return new InSubpackage(targetPackageName); } + /** + * In Subpackage matcher + * + * @opensearch.internal + */ private static class InSubpackage extends AbstractMatcher { private final String targetPackageName; @@ -384,6 +431,11 @@ public static Matcher returns(final Matcher> returnType return new Returns(returnType); } + /** + * Returns matcher + * + * @opensearch.internal + */ private static class Returns extends AbstractMatcher { private final Matcher> returnType; diff --git a/server/src/main/java/org/opensearch/common/inject/multibindings/Element.java b/server/src/main/java/org/opensearch/common/inject/multibindings/Element.java index f1dae7da4ae1c..c0c1dc02f51be 100644 --- a/server/src/main/java/org/opensearch/common/inject/multibindings/Element.java +++ b/server/src/main/java/org/opensearch/common/inject/multibindings/Element.java @@ -41,6 +41,8 @@ * to contribute multibindings independently. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ @Retention(RUNTIME) @BindingAnnotation diff --git a/server/src/main/java/org/opensearch/common/inject/multibindings/MapBinder.java b/server/src/main/java/org/opensearch/common/inject/multibindings/MapBinder.java index 734d6da15a2ab..e8d984fce3d48 100644 --- a/server/src/main/java/org/opensearch/common/inject/multibindings/MapBinder.java +++ b/server/src/main/java/org/opensearch/common/inject/multibindings/MapBinder.java @@ -106,6 +106,8 @@ * will not). * * @author dpb@google.com (David P. Baker) + * + * @opensearch.internal */ public abstract class MapBinder { private MapBinder() {} @@ -299,6 +301,11 @@ public LinkedBindingBuilder addBinding(K key) { return binder.bind(valueKey); } + /** + * A binder provider with dependencies + * + * @opensearch.internal + */ public static class MapBinderProviderWithDependencies implements ProviderWithDependencies>> { private Map> providerMap; diff --git a/server/src/main/java/org/opensearch/common/inject/multibindings/Multibinder.java b/server/src/main/java/org/opensearch/common/inject/multibindings/Multibinder.java index 6cd9fbc46d544..09e3a0ea9842c 100644 --- a/server/src/main/java/org/opensearch/common/inject/multibindings/Multibinder.java +++ b/server/src/main/java/org/opensearch/common/inject/multibindings/Multibinder.java @@ -102,6 +102,8 @@ * set injection will fail. * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ public abstract class Multibinder { private Multibinder() {} diff --git a/server/src/main/java/org/opensearch/common/inject/multibindings/RealElement.java b/server/src/main/java/org/opensearch/common/inject/multibindings/RealElement.java index 7603df43c9d9a..1363103fdd21e 100644 --- a/server/src/main/java/org/opensearch/common/inject/multibindings/RealElement.java +++ b/server/src/main/java/org/opensearch/common/inject/multibindings/RealElement.java @@ -33,7 +33,11 @@ import java.util.concurrent.atomic.AtomicInteger; /** + * A real element. + * * @author jessewilson@google.com (Jesse Wilson) + * + * @opensearch.internal */ class RealElement implements Element { private static final AtomicInteger nextUniqueId = new AtomicInteger(1); diff --git a/server/src/main/java/org/opensearch/common/inject/name/Named.java b/server/src/main/java/org/opensearch/common/inject/name/Named.java index ddc1065cdcadd..3972c2f631d58 100644 --- a/server/src/main/java/org/opensearch/common/inject/name/Named.java +++ b/server/src/main/java/org/opensearch/common/inject/name/Named.java @@ -41,6 +41,8 @@ * Annotates named things. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ @Retention(RUNTIME) @Target({ ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD }) diff --git a/server/src/main/java/org/opensearch/common/inject/name/NamedImpl.java b/server/src/main/java/org/opensearch/common/inject/name/NamedImpl.java index b15ffd073e270..beed8be7218ac 100644 --- a/server/src/main/java/org/opensearch/common/inject/name/NamedImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/name/NamedImpl.java @@ -32,6 +32,11 @@ import java.lang.annotation.Annotation; import java.util.Objects; +/** + * A named implementation + * + * @opensearch.internal + */ class NamedImpl implements Named { private final String value; diff --git a/server/src/main/java/org/opensearch/common/inject/name/Names.java b/server/src/main/java/org/opensearch/common/inject/name/Names.java index 8de65534baffd..1de439f2cfbfd 100644 --- a/server/src/main/java/org/opensearch/common/inject/name/Names.java +++ b/server/src/main/java/org/opensearch/common/inject/name/Names.java @@ -40,6 +40,8 @@ * Utility methods for use with {@code @}{@link Named}. * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public class Names { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/BindingScopingVisitor.java b/server/src/main/java/org/opensearch/common/inject/spi/BindingScopingVisitor.java index 596ec0df01063..d7c7d9d65051d 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/BindingScopingVisitor.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/BindingScopingVisitor.java @@ -39,6 +39,8 @@ * @param any type to be returned by the visit method. Use {@link Void} with * {@code return null} if no return type is needed. * @since 2.0 + * + * @opensearch.internal */ public interface BindingScopingVisitor { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/BindingTargetVisitor.java b/server/src/main/java/org/opensearch/common/inject/spi/BindingTargetVisitor.java index 2633245f804a8..91df812b58ac4 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/BindingTargetVisitor.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/BindingTargetVisitor.java @@ -35,6 +35,8 @@ * @param any type to be returned by the visit method. Use {@link Void} with * {@code return null} if no return type is needed. * @since 2.0 + * + * @opensearch.internal */ public interface BindingTargetVisitor { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/ConstructorBinding.java b/server/src/main/java/org/opensearch/common/inject/spi/ConstructorBinding.java index 22e7d763e97b5..997bf78234fd1 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/ConstructorBinding.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/ConstructorBinding.java @@ -39,6 +39,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface ConstructorBinding extends Binding, HasDependencies { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/ConvertedConstantBinding.java b/server/src/main/java/org/opensearch/common/inject/spi/ConvertedConstantBinding.java index 9b5242298ac74..e8d6b346f8596 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/ConvertedConstantBinding.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/ConvertedConstantBinding.java @@ -40,6 +40,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface ConvertedConstantBinding extends Binding, HasDependencies { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/DefaultBindingScopingVisitor.java b/server/src/main/java/org/opensearch/common/inject/spi/DefaultBindingScopingVisitor.java index f4744525bedf1..8fa5610e899bb 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/DefaultBindingScopingVisitor.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/DefaultBindingScopingVisitor.java @@ -41,6 +41,8 @@ * {@code return null} if no return type is needed. * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public class DefaultBindingScopingVisitor implements BindingScopingVisitor { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/DefaultBindingTargetVisitor.java b/server/src/main/java/org/opensearch/common/inject/spi/DefaultBindingTargetVisitor.java index 9ac3413155c15..f66199736740f 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/DefaultBindingTargetVisitor.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/DefaultBindingTargetVisitor.java @@ -39,6 +39,8 @@ * {@code return null} if no return type is needed. * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public abstract class DefaultBindingTargetVisitor implements BindingTargetVisitor { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/DefaultElementVisitor.java b/server/src/main/java/org/opensearch/common/inject/spi/DefaultElementVisitor.java index 5196fa68a88a6..01568e56242dc 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/DefaultElementVisitor.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/DefaultElementVisitor.java @@ -39,6 +39,8 @@ * {@code return null} if no return type is needed. * @author sberlin@gmail.com (Sam Berlin) * @since 2.0 + * + * @opensearch.internal */ public abstract class DefaultElementVisitor implements ElementVisitor { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/Dependency.java b/server/src/main/java/org/opensearch/common/inject/spi/Dependency.java index 99158a4432067..be1336ad0f297 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/Dependency.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/Dependency.java @@ -46,6 +46,8 @@ * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public final class Dependency { private final InjectionPoint injectionPoint; diff --git a/server/src/main/java/org/opensearch/common/inject/spi/Element.java b/server/src/main/java/org/opensearch/common/inject/spi/Element.java index 3f30a2643b48f..660aca1bd45ab 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/Element.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/Element.java @@ -42,6 +42,8 @@ * @author jessewilson@google.com (Jesse Wilson) * @author crazybob@google.com (Bob Lee) * @since 2.0 + * + * @opensearch.internal */ public interface Element { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/ElementVisitor.java b/server/src/main/java/org/opensearch/common/inject/spi/ElementVisitor.java index f6cbc39d5edcf..d415560fc03c8 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/ElementVisitor.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/ElementVisitor.java @@ -37,6 +37,8 @@ * @param any type to be returned by the visit method. Use {@link Void} with * {@code return null} if no return type is needed. * @since 2.0 + * + * @opensearch.internal */ public interface ElementVisitor { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/Elements.java b/server/src/main/java/org/opensearch/common/inject/spi/Elements.java index 9ae2877e8b78d..21dcc9ba54920 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/Elements.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/Elements.java @@ -70,6 +70,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public final class Elements { @@ -112,6 +114,11 @@ public void configure(Binder binder) { }; } + /** + * A recording binder + * + * @opensearch.internal + */ private static class RecordingBinder implements Binder, PrivateBinder { private final Stage stage; private final Set modules; diff --git a/server/src/main/java/org/opensearch/common/inject/spi/ExposedBinding.java b/server/src/main/java/org/opensearch/common/inject/spi/ExposedBinding.java index 42afd5377396c..d2563bc2728cd 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/ExposedBinding.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/ExposedBinding.java @@ -37,6 +37,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface ExposedBinding extends Binding, HasDependencies { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/HasDependencies.java b/server/src/main/java/org/opensearch/common/inject/spi/HasDependencies.java index 51141bea2a066..b142197fb7126 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/HasDependencies.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/HasDependencies.java @@ -37,6 +37,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface HasDependencies { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/InjectionListener.java b/server/src/main/java/org/opensearch/common/inject/spi/InjectionListener.java index aab5d65188f9a..7a760d2b84e9f 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/InjectionListener.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/InjectionListener.java @@ -36,6 +36,8 @@ * @author crazybob@google.com (Bob Lee) * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface InjectionListener { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/InjectionPoint.java b/server/src/main/java/org/opensearch/common/inject/spi/InjectionPoint.java index 36c145433c0d4..387f9ba0f3f6c 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/InjectionPoint.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/InjectionPoint.java @@ -65,6 +65,8 @@ * * @author crazybob@google.com (Bob Lee) * @since 2.0 + * + * @opensearch.internal */ public final class InjectionPoint { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/InjectionRequest.java b/server/src/main/java/org/opensearch/common/inject/spi/InjectionRequest.java index bc15e00c12089..6ce5febbb6711 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/InjectionRequest.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/InjectionRequest.java @@ -45,6 +45,8 @@ * * @author mikeward@google.com (Mike Ward) * @since 2.0 + * + * @opensearch.internal */ public final class InjectionRequest implements Element { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/InstanceBinding.java b/server/src/main/java/org/opensearch/common/inject/spi/InstanceBinding.java index 6db9caa209bf1..fd7c1303ed6fc 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/InstanceBinding.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/InstanceBinding.java @@ -38,6 +38,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface InstanceBinding extends Binding, HasDependencies { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/LinkedKeyBinding.java b/server/src/main/java/org/opensearch/common/inject/spi/LinkedKeyBinding.java index 046c28f8d9340..10b270e499603 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/LinkedKeyBinding.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/LinkedKeyBinding.java @@ -37,6 +37,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface LinkedKeyBinding extends Binding { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/MembersInjectorLookup.java b/server/src/main/java/org/opensearch/common/inject/spi/MembersInjectorLookup.java index d85d49ae8dd36..1f652708de875 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/MembersInjectorLookup.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/MembersInjectorLookup.java @@ -44,6 +44,8 @@ * * @author crazybob@google.com (Bob Lee) * @since 2.0 + * + * @opensearch.internal */ public final class MembersInjectorLookup implements Element { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/Message.java b/server/src/main/java/org/opensearch/common/inject/spi/Message.java index b47eb787c737d..78829e82c150e 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/Message.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/Message.java @@ -49,6 +49,8 @@ * } * * @author crazybob@google.com (Bob Lee) + * + * @opensearch.internal */ public final class Message implements Element { private final String message; diff --git a/server/src/main/java/org/opensearch/common/inject/spi/PrivateElements.java b/server/src/main/java/org/opensearch/common/inject/spi/PrivateElements.java index badcc273359ea..e4d86a356cd53 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/PrivateElements.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/PrivateElements.java @@ -41,6 +41,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface PrivateElements extends Element { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/ProviderBinding.java b/server/src/main/java/org/opensearch/common/inject/spi/ProviderBinding.java index e2fa36741517c..0a63fefc0a9e9 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/ProviderBinding.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/ProviderBinding.java @@ -39,6 +39,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface ProviderBinding> extends Binding { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/ProviderInstanceBinding.java b/server/src/main/java/org/opensearch/common/inject/spi/ProviderInstanceBinding.java index 8245f6cb65ab1..654f40e627e4b 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/ProviderInstanceBinding.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/ProviderInstanceBinding.java @@ -40,6 +40,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface ProviderInstanceBinding extends Binding, HasDependencies { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/ProviderKeyBinding.java b/server/src/main/java/org/opensearch/common/inject/spi/ProviderKeyBinding.java index 92004d8d5c60e..6f1ae8f2b9a03 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/ProviderKeyBinding.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/ProviderKeyBinding.java @@ -39,6 +39,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface ProviderKeyBinding extends Binding { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/ProviderLookup.java b/server/src/main/java/org/opensearch/common/inject/spi/ProviderLookup.java index 190a8b14cf168..16060ddd3e222 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/ProviderLookup.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/ProviderLookup.java @@ -44,9 +44,16 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public final class ProviderLookup implements Element { + /** + * A provider implementation + * + * @opensearch.internal + */ // NOTE: this class is not part of guice and was added so the provider lookup's key can be accessible for tests public static class ProviderImpl implements Provider { private ProviderLookup lookup; diff --git a/server/src/main/java/org/opensearch/common/inject/spi/ProviderWithDependencies.java b/server/src/main/java/org/opensearch/common/inject/spi/ProviderWithDependencies.java index 2f5485c23c956..6c450095a310b 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/ProviderWithDependencies.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/ProviderWithDependencies.java @@ -36,5 +36,7 @@ * aren't specified in injections, this interface should be used to expose all dependencies. * * @since 2.0 + * + * @opensearch.internal */ public interface ProviderWithDependencies extends Provider, HasDependencies {} diff --git a/server/src/main/java/org/opensearch/common/inject/spi/ScopeBinding.java b/server/src/main/java/org/opensearch/common/inject/spi/ScopeBinding.java index 26b611e656ed0..7a619456e06e3 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/ScopeBinding.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/ScopeBinding.java @@ -45,6 +45,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public final class ScopeBinding implements Element { private final Object source; diff --git a/server/src/main/java/org/opensearch/common/inject/spi/StaticInjectionRequest.java b/server/src/main/java/org/opensearch/common/inject/spi/StaticInjectionRequest.java index 64dc3d15a505c..494e35e6c4490 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/StaticInjectionRequest.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/StaticInjectionRequest.java @@ -44,6 +44,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public final class StaticInjectionRequest implements Element { private final Object source; diff --git a/server/src/main/java/org/opensearch/common/inject/spi/TypeConverter.java b/server/src/main/java/org/opensearch/common/inject/spi/TypeConverter.java index 3b748b3eb1be1..93a0f607ddc27 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/TypeConverter.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/TypeConverter.java @@ -36,6 +36,8 @@ * * @author crazybob@google.com (Bob Lee) * @since 2.0 + * + * @opensearch.internal */ public interface TypeConverter { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/TypeConverterBinding.java b/server/src/main/java/org/opensearch/common/inject/spi/TypeConverterBinding.java index 66bfa472e72a3..00b8c7c013b5a 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/TypeConverterBinding.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/TypeConverterBinding.java @@ -44,6 +44,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public final class TypeConverterBinding implements Element { private final Object source; diff --git a/server/src/main/java/org/opensearch/common/inject/spi/TypeEncounter.java b/server/src/main/java/org/opensearch/common/inject/spi/TypeEncounter.java index 9db116db6bedb..e06751668c0f1 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/TypeEncounter.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/TypeEncounter.java @@ -42,6 +42,8 @@ * * @param the injectable type encountered * @since 2.0 + * + * @opensearch.internal */ @SuppressWarnings("overloads") public interface TypeEncounter { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/TypeListener.java b/server/src/main/java/org/opensearch/common/inject/spi/TypeListener.java index 720766f2a4dc4..fd7004aa80df0 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/TypeListener.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/TypeListener.java @@ -42,6 +42,8 @@ * binding method interceptors}. * * @since 2.0 + * + * @opensearch.internal */ public interface TypeListener { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/TypeListenerBinding.java b/server/src/main/java/org/opensearch/common/inject/spi/TypeListenerBinding.java index 84d78698268df..505028f09232d 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/TypeListenerBinding.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/TypeListenerBinding.java @@ -41,6 +41,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public final class TypeListenerBinding implements Element { diff --git a/server/src/main/java/org/opensearch/common/inject/spi/UntargettedBinding.java b/server/src/main/java/org/opensearch/common/inject/spi/UntargettedBinding.java index 940706aaffbe6..37e40d45cb5a9 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/UntargettedBinding.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/UntargettedBinding.java @@ -37,5 +37,7 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public interface UntargettedBinding extends Binding {} diff --git a/server/src/main/java/org/opensearch/common/inject/util/Modules.java b/server/src/main/java/org/opensearch/common/inject/util/Modules.java index c4461b893b75a..ff2f2e7d0dac1 100644 --- a/server/src/main/java/org/opensearch/common/inject/util/Modules.java +++ b/server/src/main/java/org/opensearch/common/inject/util/Modules.java @@ -60,6 +60,8 @@ * * @author jessewilson@google.com (Jesse Wilson) * @since 2.0 + * + * @opensearch.internal */ public final class Modules { private Modules() {} @@ -277,6 +279,11 @@ public Scope visitScope(Scope scope) { } } + /** + * A module writer + * + * @opensearch.internal + */ private static class ModuleWriter extends DefaultElementVisitor { protected final Binder binder; diff --git a/server/src/main/java/org/opensearch/common/inject/util/Providers.java b/server/src/main/java/org/opensearch/common/inject/util/Providers.java index d7444e9b60e73..8eb46885e2967 100644 --- a/server/src/main/java/org/opensearch/common/inject/util/Providers.java +++ b/server/src/main/java/org/opensearch/common/inject/util/Providers.java @@ -37,6 +37,8 @@ * * @author Kevin Bourrillion (kevinb9n@gmail.com) * @since 2.0 + * + * @opensearch.internal */ public final class Providers { diff --git a/server/src/main/java/org/opensearch/common/inject/util/Types.java b/server/src/main/java/org/opensearch/common/inject/util/Types.java index 01f0385602222..82f8190ebc22d 100644 --- a/server/src/main/java/org/opensearch/common/inject/util/Types.java +++ b/server/src/main/java/org/opensearch/common/inject/util/Types.java @@ -48,6 +48,8 @@ * * @author crazybob@google.com (Bob Lee) * @since 2.0 + * + * @opensearch.internal */ public final class Types { private Types() {} diff --git a/server/src/main/java/org/opensearch/common/io/Channels.java b/server/src/main/java/org/opensearch/common/io/Channels.java index 3880d4dbf19aa..29f50b117234d 100644 --- a/server/src/main/java/org/opensearch/common/io/Channels.java +++ b/server/src/main/java/org/opensearch/common/io/Channels.java @@ -40,6 +40,11 @@ import java.nio.channels.FileChannel; import java.nio.channels.WritableByteChannel; +/** + * Data channels + * + * @opensearch.internal + */ @SuppressForbidden(reason = "Channel#read") public final class Channels { diff --git a/server/src/main/java/org/opensearch/common/io/DiskIoBufferPool.java b/server/src/main/java/org/opensearch/common/io/DiskIoBufferPool.java index 73fc09f6683b4..80b5dd353703c 100644 --- a/server/src/main/java/org/opensearch/common/io/DiskIoBufferPool.java +++ b/server/src/main/java/org/opensearch/common/io/DiskIoBufferPool.java @@ -38,6 +38,11 @@ import java.nio.ByteBuffer; import java.util.Arrays; +/** + * Pool of disk io buffers + * + * @opensearch.internal + */ public class DiskIoBufferPool { public static final int BUFFER_SIZE = StrictMath.toIntExact( diff --git a/server/src/main/java/org/opensearch/common/io/FileSystemUtils.java b/server/src/main/java/org/opensearch/common/io/FileSystemUtils.java index e8ba699f61e7a..e65c430783013 100644 --- a/server/src/main/java/org/opensearch/common/io/FileSystemUtils.java +++ b/server/src/main/java/org/opensearch/common/io/FileSystemUtils.java @@ -48,6 +48,8 @@ /** * OpenSearch utils to work with {@link java.nio.file.Path} + * + * @opensearch.internal */ public final class FileSystemUtils { diff --git a/server/src/main/java/org/opensearch/common/io/Streams.java b/server/src/main/java/org/opensearch/common/io/Streams.java index 5d347e636935b..b4dab5ecb7e54 100644 --- a/server/src/main/java/org/opensearch/common/io/Streams.java +++ b/server/src/main/java/org/opensearch/common/io/Streams.java @@ -59,6 +59,8 @@ *

* Mainly for use within the framework, * but also useful for application code. + * + * @opensearch.internal */ public abstract class Streams { @@ -257,6 +259,8 @@ public static InputStream limitStream(InputStream in, long limit) { * A wrapper around a {@link BytesStream} that makes the close operation a flush. This is * needed as sometimes a stream will be closed but the bytes that the stream holds still need * to be used and the stream cannot be closed until the bytes have been consumed. + * + * @opensearch.internal */ private static class FlushOnCloseOutputStream extends BytesStream { @@ -299,6 +303,8 @@ public BytesReference bytes() { /** * A wrapper around an {@link InputStream} that limits the number of bytes that can be read from the stream. + * + * @opensearch.internal */ static class LimitedInputStream extends FilterInputStream { diff --git a/server/src/main/java/org/opensearch/common/io/UTF8StreamWriter.java b/server/src/main/java/org/opensearch/common/io/UTF8StreamWriter.java index f8f90f290358b..4c299d7c10a92 100644 --- a/server/src/main/java/org/opensearch/common/io/UTF8StreamWriter.java +++ b/server/src/main/java/org/opensearch/common/io/UTF8StreamWriter.java @@ -37,6 +37,11 @@ import java.io.OutputStream; import java.io.Writer; +/** + * UTF8 Stream Writer. + * + * @opensearch.internal + */ public final class UTF8StreamWriter extends Writer { /** diff --git a/server/src/main/java/org/opensearch/common/io/stream/ByteBufferStreamInput.java b/server/src/main/java/org/opensearch/common/io/stream/ByteBufferStreamInput.java index 92b38e67f02c8..707b32a0c50f3 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/ByteBufferStreamInput.java +++ b/server/src/main/java/org/opensearch/common/io/stream/ByteBufferStreamInput.java @@ -36,6 +36,11 @@ import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; +/** + * Byte Buffer Stream Input + * + * @opensearch.internal + */ public class ByteBufferStreamInput extends StreamInput { private final ByteBuffer buffer; diff --git a/server/src/main/java/org/opensearch/common/io/stream/BytesStream.java b/server/src/main/java/org/opensearch/common/io/stream/BytesStream.java index 1a4e34d9e7e0e..d9e1b19cccae7 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/BytesStream.java +++ b/server/src/main/java/org/opensearch/common/io/stream/BytesStream.java @@ -34,6 +34,11 @@ import org.opensearch.common.bytes.BytesReference; +/** + * Base Bytes Stream. + * + * @opensearch.internal + */ public abstract class BytesStream extends StreamOutput { public abstract BytesReference bytes(); diff --git a/server/src/main/java/org/opensearch/common/io/stream/BytesStreamInput.java b/server/src/main/java/org/opensearch/common/io/stream/BytesStreamInput.java index e593f3c89b008..1572cd1f500f4 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/BytesStreamInput.java +++ b/server/src/main/java/org/opensearch/common/io/stream/BytesStreamInput.java @@ -34,6 +34,8 @@ * 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. + * + * @opensearch.internal */ public class BytesStreamInput extends StreamInput { private byte[] bytes; diff --git a/server/src/main/java/org/opensearch/common/io/stream/BytesStreamOutput.java b/server/src/main/java/org/opensearch/common/io/stream/BytesStreamOutput.java index 22c37ab476a73..e6aacf7d0fcea 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/BytesStreamOutput.java +++ b/server/src/main/java/org/opensearch/common/io/stream/BytesStreamOutput.java @@ -46,6 +46,8 @@ /** * A @link {@link StreamOutput} that uses {@link BigArrays} to acquire pages of * bytes, which avoids frequent reallocation & copying of the internal data. + * + * @opensearch.internal */ public class BytesStreamOutput extends BytesStream { diff --git a/server/src/main/java/org/opensearch/common/io/stream/DataOutputStreamOutput.java b/server/src/main/java/org/opensearch/common/io/stream/DataOutputStreamOutput.java index 9fcbc39417257..e9b0b8d1f8876 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/DataOutputStreamOutput.java +++ b/server/src/main/java/org/opensearch/common/io/stream/DataOutputStreamOutput.java @@ -36,6 +36,11 @@ import java.io.DataOutput; import java.io.IOException; +/** + * Main stream output for data output + * + * @opensearch.internal + */ public class DataOutputStreamOutput extends StreamOutput { private final DataOutput out; diff --git a/server/src/main/java/org/opensearch/common/io/stream/DelayableWriteable.java b/server/src/main/java/org/opensearch/common/io/stream/DelayableWriteable.java index a4dddaf1f172a..67cfe5f1025e6 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/DelayableWriteable.java +++ b/server/src/main/java/org/opensearch/common/io/stream/DelayableWriteable.java @@ -56,6 +56,8 @@ * to delayed expansion). When such objects are buffered for some time it may be desirable * to force their buffering in serialized format by calling * {@link #asSerialized(Reader, NamedWriteableRegistry)}. + * + * @opensearch.internal */ public abstract class DelayableWriteable implements Writeable { /** @@ -94,6 +96,11 @@ private DelayableWriteable() {} */ abstract boolean isSerialized(); + /** + * A referencing writable + * + * @opensearch.internal + */ private static class Referencing extends DelayableWriteable { private final T reference; @@ -138,6 +145,8 @@ private BytesStreamOutput writeToBuffer(Version version) throws IOException { /** * A {@link Writeable} stored in serialized form. + * + * @opensearch.internal */ public static class Serialized extends DelayableWriteable implements Accountable { private final Writeable.Reader reader; diff --git a/server/src/main/java/org/opensearch/common/io/stream/FilterStreamInput.java b/server/src/main/java/org/opensearch/common/io/stream/FilterStreamInput.java index 7c5ebde4b5eae..5f6bbd7c16cf3 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/FilterStreamInput.java +++ b/server/src/main/java/org/opensearch/common/io/stream/FilterStreamInput.java @@ -39,6 +39,8 @@ /** * Wraps a {@link StreamInput} and delegates to it. To be used to add functionality to an existing stream by subclassing. + * + * @opensearch.internal */ public abstract class FilterStreamInput extends StreamInput { diff --git a/server/src/main/java/org/opensearch/common/io/stream/InputStreamStreamInput.java b/server/src/main/java/org/opensearch/common/io/stream/InputStreamStreamInput.java index f46ecc09f6416..991fd0fc09a9d 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/InputStreamStreamInput.java +++ b/server/src/main/java/org/opensearch/common/io/stream/InputStreamStreamInput.java @@ -38,6 +38,11 @@ import java.io.IOException; import java.io.InputStream; +/** + * Main input stream for input data + * + * @opensearch.internal + */ public class InputStreamStreamInput extends StreamInput { private final InputStream is; diff --git a/server/src/main/java/org/opensearch/common/io/stream/NamedWriteable.java b/server/src/main/java/org/opensearch/common/io/stream/NamedWriteable.java index e61cb729d8463..380d764b60f9f 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/NamedWriteable.java +++ b/server/src/main/java/org/opensearch/common/io/stream/NamedWriteable.java @@ -36,6 +36,8 @@ * A {@link Writeable} object identified by its name. * To be used for arbitrary serializable objects (e.g. queries); when reading them, their name tells * which specific object needs to be created. + * + * @opensearch.internal */ public interface NamedWriteable extends Writeable { diff --git a/server/src/main/java/org/opensearch/common/io/stream/NamedWriteableAwareStreamInput.java b/server/src/main/java/org/opensearch/common/io/stream/NamedWriteableAwareStreamInput.java index e695cbec979e5..cf537a59edbdf 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/NamedWriteableAwareStreamInput.java +++ b/server/src/main/java/org/opensearch/common/io/stream/NamedWriteableAwareStreamInput.java @@ -36,6 +36,8 @@ /** * Wraps a {@link StreamInput} and associates it with a {@link NamedWriteableRegistry} + * + * @opensearch.internal */ public class NamedWriteableAwareStreamInput extends FilterStreamInput { diff --git a/server/src/main/java/org/opensearch/common/io/stream/NamedWriteableRegistry.java b/server/src/main/java/org/opensearch/common/io/stream/NamedWriteableRegistry.java index 15de91e551a15..0240d0a0a8bb3 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/NamedWriteableRegistry.java +++ b/server/src/main/java/org/opensearch/common/io/stream/NamedWriteableRegistry.java @@ -44,10 +44,16 @@ * * The registration is keyed by the combination of the category class of {@link NamedWriteable}, and a name unique * to that category. + * + * @opensearch.internal */ public class NamedWriteableRegistry { - /** An entry in the registry, made up of a category class and name, and a reader for that category class. */ + /** + * An entry in the registry, made up of a category class and name, and a reader for that category class. + * + * @opensearch.internal + */ public static class Entry { /** The superclass of a {@link NamedWriteable} which will be read by {@link #reader}. */ diff --git a/server/src/main/java/org/opensearch/common/io/stream/NotSerializableExceptionWrapper.java b/server/src/main/java/org/opensearch/common/io/stream/NotSerializableExceptionWrapper.java index e1e0f69aadb09..f642dd17ad688 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/NotSerializableExceptionWrapper.java +++ b/server/src/main/java/org/opensearch/common/io/stream/NotSerializableExceptionWrapper.java @@ -44,6 +44,8 @@ * This class will preserve the stacktrace as well as the suppressed exceptions of * the throwable it was created with instead of it's own. The stacktrace has no indication * of where this exception was created. + * + * @opensearch.internal */ public final class NotSerializableExceptionWrapper extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/common/io/stream/OutputStreamStreamOutput.java b/server/src/main/java/org/opensearch/common/io/stream/OutputStreamStreamOutput.java index c849ed9e523f9..44cbe13be9aa7 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/OutputStreamStreamOutput.java +++ b/server/src/main/java/org/opensearch/common/io/stream/OutputStreamStreamOutput.java @@ -35,6 +35,11 @@ import java.io.IOException; import java.io.OutputStream; +/** + * Streaming output data + * + * @opensearch.internal + */ public class OutputStreamStreamOutput extends StreamOutput { private final OutputStream out; diff --git a/server/src/main/java/org/opensearch/common/io/stream/ReleasableBytesStreamOutput.java b/server/src/main/java/org/opensearch/common/io/stream/ReleasableBytesStreamOutput.java index 35d5aac182f81..0fd8640305326 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/ReleasableBytesStreamOutput.java +++ b/server/src/main/java/org/opensearch/common/io/stream/ReleasableBytesStreamOutput.java @@ -46,6 +46,8 @@ * {@link ReleasableBytesReference} returned from {@link #bytes()}, so this * stream should only be closed after the bytes have been output or copied * elsewhere. + * + * @opensearch.internal */ public class ReleasableBytesStreamOutput extends BytesStreamOutput implements Releasable { diff --git a/server/src/main/java/org/opensearch/common/io/stream/StreamInput.java b/server/src/main/java/org/opensearch/common/io/stream/StreamInput.java index fc50a4f8b08fe..4f3555fdb1852 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/StreamInput.java +++ b/server/src/main/java/org/opensearch/common/io/stream/StreamInput.java @@ -105,6 +105,8 @@ * everywhere. That being said, this class deals primarily with {@code List}s rather than Arrays. For the most part calls should adapt to * lists, either by storing {@code List}s internally or just converting to and from a {@code List} when calling. This comment is repeated * on {@link StreamInput}. + * + * @opensearch.internal */ public abstract class StreamInput extends InputStream { diff --git a/server/src/main/java/org/opensearch/common/io/stream/StreamOutput.java b/server/src/main/java/org/opensearch/common/io/stream/StreamOutput.java index e53e24171d8b6..11a22c4edf0c1 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/StreamOutput.java +++ b/server/src/main/java/org/opensearch/common/io/stream/StreamOutput.java @@ -101,6 +101,8 @@ * everywhere. That being said, this class deals primarily with {@code List}s rather than Arrays. For the most part calls should adapt to * lists, either by storing {@code List}s internally or just converting to and from a {@code List} when calling. This comment is repeated * on {@link StreamInput}. + * + * @opensearch.internal */ public abstract class StreamOutput extends OutputStream { diff --git a/server/src/main/java/org/opensearch/common/io/stream/VersionedNamedWriteable.java b/server/src/main/java/org/opensearch/common/io/stream/VersionedNamedWriteable.java index 6ce224c8e218a..408a2dc26386e 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/VersionedNamedWriteable.java +++ b/server/src/main/java/org/opensearch/common/io/stream/VersionedNamedWriteable.java @@ -36,6 +36,8 @@ /** * A {@link NamedWriteable} that has a minimum version associated with it. + * + * @opensearch.internal */ public interface VersionedNamedWriteable extends NamedWriteable { diff --git a/server/src/main/java/org/opensearch/common/io/stream/Writeable.java b/server/src/main/java/org/opensearch/common/io/stream/Writeable.java index 253609cbaca77..5fd227db6ca83 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/Writeable.java +++ b/server/src/main/java/org/opensearch/common/io/stream/Writeable.java @@ -38,6 +38,8 @@ * Implementers can be written to a {@linkplain StreamOutput} and read from a {@linkplain StreamInput}. This allows them to be "thrown * across the wire" using OpenSearch's internal protocol. If the implementer also implements equals and hashCode then a copy made by * serializing and deserializing must be equal and have the same hashCode. It isn't required that such a copy be entirely unchanged. + * + * @opensearch.internal */ public interface Writeable { diff --git a/server/src/main/java/org/opensearch/common/joda/Joda.java b/server/src/main/java/org/opensearch/common/joda/Joda.java index f644ef43ae472..9ecb3f2236e7c 100644 --- a/server/src/main/java/org/opensearch/common/joda/Joda.java +++ b/server/src/main/java/org/opensearch/common/joda/Joda.java @@ -65,6 +65,13 @@ import java.util.Locale; import java.util.regex.Pattern; +/** + * Joda class. + * + * @deprecated + * + * @opensearch.internal + */ @Deprecated public class Joda { // Joda.forPattern could be used even before the logging is initialized. @@ -392,6 +399,11 @@ public static boolean isJodaPattern(Version version, String pattern) { return version.before(LegacyESVersion.V_7_0_0) && pattern.startsWith("8") == false; } + /** + * parses epcoch timers + * + * @opensearch.internal + */ public static class EpochTimeParser implements DateTimeParser { private static final Pattern scientificNotation = Pattern.compile("[Ee]"); @@ -458,6 +470,11 @@ private static DeprecationLogger getDeprecationLogger() { return deprecationLogger.getOrCompute(); } + /** + * Epoch timer printer + * + * @opensearch.internal + */ public static class EpochTimePrinter implements DateTimePrinter { private boolean hasMilliSecondPrecision; diff --git a/server/src/main/java/org/opensearch/common/joda/JodaDateFormatter.java b/server/src/main/java/org/opensearch/common/joda/JodaDateFormatter.java index 3b36e36624fe3..12d48a0b362ce 100644 --- a/server/src/main/java/org/opensearch/common/joda/JodaDateFormatter.java +++ b/server/src/main/java/org/opensearch/common/joda/JodaDateFormatter.java @@ -46,6 +46,11 @@ import java.util.Locale; import java.util.Objects; +/** + * Joda date formatter. + * + * @opensearch.internal + */ public class JodaDateFormatter implements DateFormatter { final String pattern; diff --git a/server/src/main/java/org/opensearch/common/joda/JodaDateMathParser.java b/server/src/main/java/org/opensearch/common/joda/JodaDateMathParser.java index 7ea576f9852c5..131c9b001f733 100644 --- a/server/src/main/java/org/opensearch/common/joda/JodaDateMathParser.java +++ b/server/src/main/java/org/opensearch/common/joda/JodaDateMathParser.java @@ -50,6 +50,8 @@ * The format of the datetime is configurable, and unix timestamps can also be used. Datemath * is appended to a datetime with the following syntax: * ||[+-/](\d+)?[yMwdhHms]. + * + * @opensearch.internal */ public class JodaDateMathParser implements DateMathParser { diff --git a/server/src/main/java/org/opensearch/common/joda/JodaDeprecationPatterns.java b/server/src/main/java/org/opensearch/common/joda/JodaDeprecationPatterns.java index cf0e2394c7805..efb6362ab63aa 100644 --- a/server/src/main/java/org/opensearch/common/joda/JodaDeprecationPatterns.java +++ b/server/src/main/java/org/opensearch/common/joda/JodaDeprecationPatterns.java @@ -42,6 +42,11 @@ import java.util.Set; import java.util.stream.Collectors; +/** + * Deprecated patters for joda date/time + * + * @opensearch.internal + */ public class JodaDeprecationPatterns { public static final String USE_NEW_FORMAT_SPECIFIERS = "Use new java.time date format specifiers."; private static Map JODA_PATTERNS_DEPRECATIONS = new LinkedHashMap<>(); diff --git a/server/src/main/java/org/opensearch/common/lease/Releasable.java b/server/src/main/java/org/opensearch/common/lease/Releasable.java index e7f854d7d10b2..4b167ff29ee71 100644 --- a/server/src/main/java/org/opensearch/common/lease/Releasable.java +++ b/server/src/main/java/org/opensearch/common/lease/Releasable.java @@ -38,6 +38,8 @@ /** * Specialization of {@link AutoCloseable} that may only throw an {@link OpenSearchException}. + * + * @opensearch.internal */ public interface Releasable extends Closeable { diff --git a/server/src/main/java/org/opensearch/common/lease/Releasables.java b/server/src/main/java/org/opensearch/common/lease/Releasables.java index bed26c6facd36..5e885d239f884 100644 --- a/server/src/main/java/org/opensearch/common/lease/Releasables.java +++ b/server/src/main/java/org/opensearch/common/lease/Releasables.java @@ -40,7 +40,11 @@ import java.util.Arrays; import java.util.concurrent.atomic.AtomicBoolean; -/** Utility methods to work with {@link Releasable}s. */ +/** + * Utility methods to work with {@link Releasable}s. + * + * @opensearch.internal + */ public enum Releasables { ; diff --git a/server/src/main/java/org/opensearch/common/logging/DeprecatedMessage.java b/server/src/main/java/org/opensearch/common/logging/DeprecatedMessage.java index bb8ded8098b88..8905fb6f391a2 100644 --- a/server/src/main/java/org/opensearch/common/logging/DeprecatedMessage.java +++ b/server/src/main/java/org/opensearch/common/logging/DeprecatedMessage.java @@ -43,6 +43,8 @@ /** * A logger message used by {@link DeprecationLogger}. * Carries x-opaque-id field if provided in the headers. Will populate the x-opaque-id field in JSON logs. + * + * @opensearch.internal */ public class DeprecatedMessage extends OpenSearchLogMessage { public static final String X_OPAQUE_ID_FIELD_NAME = "x-opaque-id"; diff --git a/server/src/main/java/org/opensearch/common/logging/DeprecationLogger.java b/server/src/main/java/org/opensearch/common/logging/DeprecationLogger.java index 9e9715b8fa867..57e222680ce41 100644 --- a/server/src/main/java/org/opensearch/common/logging/DeprecationLogger.java +++ b/server/src/main/java/org/opensearch/common/logging/DeprecationLogger.java @@ -49,6 +49,8 @@ * uses {@link RateLimitingFilter} to prevent the same message being logged repeatedly in a short span of time. This * key is combined with the X-Opaque-Id request header value, if supplied, which allows for per-client * message limiting. + * + * @opensearch.internal */ public class DeprecationLogger { diff --git a/server/src/main/java/org/opensearch/common/logging/HeaderWarning.java b/server/src/main/java/org/opensearch/common/logging/HeaderWarning.java index 1914b86703640..df5a94ccd34e4 100644 --- a/server/src/main/java/org/opensearch/common/logging/HeaderWarning.java +++ b/server/src/main/java/org/opensearch/common/logging/HeaderWarning.java @@ -52,6 +52,8 @@ * This is a simplistic logger that adds warning messages to HTTP headers. * Use HeaderWarning.addWarning(message,params). Message will be formatted according to RFC7234. * The result will be returned as HTTP response headers. + * + * @opensearch.internal */ public class HeaderWarning { /** diff --git a/server/src/main/java/org/opensearch/common/logging/HeaderWarningAppender.java b/server/src/main/java/org/opensearch/common/logging/HeaderWarningAppender.java index 6643c03b09e54..16c3858b15761 100644 --- a/server/src/main/java/org/opensearch/common/logging/HeaderWarningAppender.java +++ b/server/src/main/java/org/opensearch/common/logging/HeaderWarningAppender.java @@ -43,6 +43,11 @@ import org.apache.logging.log4j.core.config.plugins.PluginFactory; import org.apache.logging.log4j.message.Message; +/** + * Appends warnings to the header + * + * @opensearch.internal + */ @Plugin(name = "HeaderWarningAppender", category = Core.CATEGORY_NAME, elementType = Appender.ELEMENT_TYPE) public class HeaderWarningAppender extends AbstractAppender { public HeaderWarningAppender(String name, Filter filter) { diff --git a/server/src/main/java/org/opensearch/common/logging/JsonThrowablePatternConverter.java b/server/src/main/java/org/opensearch/common/logging/JsonThrowablePatternConverter.java index ff70ba883e15a..f3ac7162e242e 100644 --- a/server/src/main/java/org/opensearch/common/logging/JsonThrowablePatternConverter.java +++ b/server/src/main/java/org/opensearch/common/logging/JsonThrowablePatternConverter.java @@ -49,6 +49,8 @@ * * Reusing @link org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverter which already converts a Throwable from * LoggingEvent into a multiline string + * + * @opensearch.internal */ @Plugin(name = "JsonThrowablePatternConverter", category = PatternConverter.CATEGORY) @ConverterKeys({ "exceptionAsJson" }) diff --git a/server/src/main/java/org/opensearch/common/logging/LogConfigurator.java b/server/src/main/java/org/opensearch/common/logging/LogConfigurator.java index 38803c002ca78..e70692808a641 100644 --- a/server/src/main/java/org/opensearch/common/logging/LogConfigurator.java +++ b/server/src/main/java/org/opensearch/common/logging/LogConfigurator.java @@ -80,6 +80,11 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.StreamSupport; +/** + * Configures the logger + * + * @opensearch.internal + */ public class LogConfigurator { /* diff --git a/server/src/main/java/org/opensearch/common/logging/LoggerMessageFormat.java b/server/src/main/java/org/opensearch/common/logging/LoggerMessageFormat.java index a81e2a4fc479f..ad9981809ae3a 100644 --- a/server/src/main/java/org/opensearch/common/logging/LoggerMessageFormat.java +++ b/server/src/main/java/org/opensearch/common/logging/LoggerMessageFormat.java @@ -37,6 +37,8 @@ /** * Format string for OpenSearch log messages. + * + * @opensearch.internal */ public class LoggerMessageFormat { diff --git a/server/src/main/java/org/opensearch/common/logging/Loggers.java b/server/src/main/java/org/opensearch/common/logging/Loggers.java index 845f6f2ad1995..1273e1263c5b2 100644 --- a/server/src/main/java/org/opensearch/common/logging/Loggers.java +++ b/server/src/main/java/org/opensearch/common/logging/Loggers.java @@ -50,6 +50,8 @@ /** * A set of utilities around Logging. + * + * @opensearch.internal */ public class Loggers { diff --git a/server/src/main/java/org/opensearch/common/logging/LoggingOutputStream.java b/server/src/main/java/org/opensearch/common/logging/LoggingOutputStream.java index 64905ced94632..c1529b1875a59 100644 --- a/server/src/main/java/org/opensearch/common/logging/LoggingOutputStream.java +++ b/server/src/main/java/org/opensearch/common/logging/LoggingOutputStream.java @@ -42,6 +42,8 @@ /** * A stream whose output is sent to the configured logger, line by line. + * + * @opensearch.internal */ class LoggingOutputStream extends OutputStream { /** The starting length of the buffer */ diff --git a/server/src/main/java/org/opensearch/common/logging/NodeAndClusterIdConverter.java b/server/src/main/java/org/opensearch/common/logging/NodeAndClusterIdConverter.java index e882ccc5f59f9..a3062bca90158 100644 --- a/server/src/main/java/org/opensearch/common/logging/NodeAndClusterIdConverter.java +++ b/server/src/main/java/org/opensearch/common/logging/NodeAndClusterIdConverter.java @@ -44,6 +44,8 @@ /** * Pattern converter to format the node_and_cluster_id variable into JSON fields node.id and cluster.uuid. * Keeping those two fields together assures that they will be atomically set and become visible in logs at the same time. + * + * @opensearch.internal */ @Plugin(category = PatternConverter.CATEGORY, name = "NodeAndClusterIdConverter") @ConverterKeys({ "node_and_cluster_id" }) diff --git a/server/src/main/java/org/opensearch/common/logging/NodeAndClusterIdStateListener.java b/server/src/main/java/org/opensearch/common/logging/NodeAndClusterIdStateListener.java index 48eba12ae0e1f..18051f9ca50c4 100644 --- a/server/src/main/java/org/opensearch/common/logging/NodeAndClusterIdStateListener.java +++ b/server/src/main/java/org/opensearch/common/logging/NodeAndClusterIdStateListener.java @@ -44,6 +44,8 @@ * The {@link NodeAndClusterIdStateListener} listens to cluster state changes and ONLY when receives the first update * it sets the clusterUUID and nodeID in log4j pattern converter {@link NodeAndClusterIdConverter}. * Once the first update is received, it will automatically be de-registered from subsequent updates. + * + * @opensearch.internal */ public class NodeAndClusterIdStateListener implements ClusterStateObserver.Listener { private static final Logger logger = LogManager.getLogger(NodeAndClusterIdStateListener.class); diff --git a/server/src/main/java/org/opensearch/common/logging/NodeNamePatternConverter.java b/server/src/main/java/org/opensearch/common/logging/NodeNamePatternConverter.java index a21857d082ecf..bc25f690d4a64 100644 --- a/server/src/main/java/org/opensearch/common/logging/NodeNamePatternConverter.java +++ b/server/src/main/java/org/opensearch/common/logging/NodeNamePatternConverter.java @@ -46,6 +46,8 @@ * We can't use a system property for this because the node name system * property is only set if the node name is explicitly defined in * opensearch.yml. + * + * @opensearch.internal */ @Plugin(category = PatternConverter.CATEGORY, name = "NodeNamePatternConverter") @ConverterKeys({ "node_name" }) diff --git a/server/src/main/java/org/opensearch/common/logging/OpenSearchJsonLayout.java b/server/src/main/java/org/opensearch/common/logging/OpenSearchJsonLayout.java index 3cb4b591e2cd3..a1b014a81be64 100644 --- a/server/src/main/java/org/opensearch/common/logging/OpenSearchJsonLayout.java +++ b/server/src/main/java/org/opensearch/common/logging/OpenSearchJsonLayout.java @@ -83,6 +83,8 @@ *

* The value taken from %OpenSearchMessageField{message} has to be a simple escaped JSON value and is populated in subclasses of * OpenSearchLogMessage + * + * @opensearch.internal */ @Plugin(name = "OpenSearchJsonLayout", category = Node.CATEGORY, elementType = Layout.ELEMENT_TYPE, printObject = true) public class OpenSearchJsonLayout extends AbstractStringLayout { @@ -168,6 +170,11 @@ PatternLayout getPatternLayout() { return patternLayout; } + /** + * Builder for a json layout + * + * @opensearch.internal + */ public static class Builder> extends AbstractStringLayout.Builder implements org.apache.logging.log4j.core.util.Builder { diff --git a/server/src/main/java/org/opensearch/common/logging/OpenSearchLogMessage.java b/server/src/main/java/org/opensearch/common/logging/OpenSearchLogMessage.java index dafe315ba046c..f163e5e6a2539 100644 --- a/server/src/main/java/org/opensearch/common/logging/OpenSearchLogMessage.java +++ b/server/src/main/java/org/opensearch/common/logging/OpenSearchLogMessage.java @@ -41,6 +41,8 @@ /** * A base class for custom log4j logger messages. Carries additional fields which will populate JSON fields in logs. + * + * @opensearch.internal */ @SuppressLoggerChecks(reason = "Safe as this is abstract class") public abstract class OpenSearchLogMessage extends ParameterizedMessage { diff --git a/server/src/main/java/org/opensearch/common/logging/OpenSearchMessageFieldConverter.java b/server/src/main/java/org/opensearch/common/logging/OpenSearchMessageFieldConverter.java index 6e0c1c4ef4c1b..fc9e523d00dd1 100644 --- a/server/src/main/java/org/opensearch/common/logging/OpenSearchMessageFieldConverter.java +++ b/server/src/main/java/org/opensearch/common/logging/OpenSearchMessageFieldConverter.java @@ -44,6 +44,8 @@ /** * Pattern converter to populate OpenSearchMessageField in a pattern. * It will only populate these if the event have message of type OpenSearchLogMessage. + * + * @opensearch.internal */ @Plugin(category = PatternConverter.CATEGORY, name = "OpenSearchMessageField") @ConverterKeys({ "OpenSearchMessageField" }) diff --git a/server/src/main/java/org/opensearch/common/logging/PrefixLogger.java b/server/src/main/java/org/opensearch/common/logging/PrefixLogger.java index eaec8a71e741f..7d55ee7dbf975 100644 --- a/server/src/main/java/org/opensearch/common/logging/PrefixLogger.java +++ b/server/src/main/java/org/opensearch/common/logging/PrefixLogger.java @@ -45,6 +45,8 @@ /** * A logger that prefixes all messages with a fixed prefix specified during construction. The prefix mechanism uses the marker construct, so * for the prefixes to appear, the logging layout pattern must include the marker in its pattern. + * + * @opensearch.internal */ class PrefixLogger extends ExtendedLoggerWrapper { diff --git a/server/src/main/java/org/opensearch/common/logging/RateLimitingFilter.java b/server/src/main/java/org/opensearch/common/logging/RateLimitingFilter.java index a93f1188a76a2..c6e8a714f045d 100644 --- a/server/src/main/java/org/opensearch/common/logging/RateLimitingFilter.java +++ b/server/src/main/java/org/opensearch/common/logging/RateLimitingFilter.java @@ -51,6 +51,11 @@ import static org.opensearch.common.logging.DeprecatedMessage.X_OPAQUE_ID_FIELD_NAME; +/** + * Filter that is rate limiting + * + * @opensearch.internal + */ @Plugin(name = "RateLimitingFilter", category = Node.CATEGORY, elementType = Filter.ELEMENT_TYPE) public class RateLimitingFilter extends AbstractFilter { diff --git a/server/src/main/java/org/opensearch/common/lucene/BytesRefs.java b/server/src/main/java/org/opensearch/common/lucene/BytesRefs.java index 34e32b03426d4..2600a9a96c9ec 100644 --- a/server/src/main/java/org/opensearch/common/lucene/BytesRefs.java +++ b/server/src/main/java/org/opensearch/common/lucene/BytesRefs.java @@ -35,6 +35,11 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; +/** + * Base bytes ref. + * + * @opensearch.internal + */ public class BytesRefs { /** diff --git a/server/src/main/java/org/opensearch/common/lucene/LoggerInfoStream.java b/server/src/main/java/org/opensearch/common/lucene/LoggerInfoStream.java index deca9baf56f1d..45a07e397cd6a 100644 --- a/server/src/main/java/org/opensearch/common/lucene/LoggerInfoStream.java +++ b/server/src/main/java/org/opensearch/common/lucene/LoggerInfoStream.java @@ -39,8 +39,12 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -/** An InfoStream (for Lucene's IndexWriter) that redirects - * messages to "lucene.iw.ifd" and "lucene.iw" Logger.trace. */ +/** + * An InfoStream (for Lucene's IndexWriter) that redirects + * messages to "lucene.iw.ifd" and "lucene.iw" Logger.trace. + * + * @opensearch.internal + */ public final class LoggerInfoStream extends InfoStream { private final Logger parentLogger; diff --git a/server/src/main/java/org/opensearch/common/lucene/Lucene.java b/server/src/main/java/org/opensearch/common/lucene/Lucene.java index 4cbc7a6668dee..63a85c2475063 100644 --- a/server/src/main/java/org/opensearch/common/lucene/Lucene.java +++ b/server/src/main/java/org/opensearch/common/lucene/Lucene.java @@ -119,6 +119,11 @@ import java.util.List; import java.util.Map; +/** + * Main lucene class. + * + * @opensearch.internal + */ public class Lucene { public static final String LATEST_CODEC = "Lucene91"; diff --git a/server/src/main/java/org/opensearch/common/lucene/MinimumScoreCollector.java b/server/src/main/java/org/opensearch/common/lucene/MinimumScoreCollector.java index a883e111f7c95..32581f2c843d5 100644 --- a/server/src/main/java/org/opensearch/common/lucene/MinimumScoreCollector.java +++ b/server/src/main/java/org/opensearch/common/lucene/MinimumScoreCollector.java @@ -42,6 +42,11 @@ import java.io.IOException; +/** + * A minimum score collector. + * + * @opensearch.internal + */ public class MinimumScoreCollector extends SimpleCollector { private final Collector collector; diff --git a/server/src/main/java/org/opensearch/common/lucene/ScorerAware.java b/server/src/main/java/org/opensearch/common/lucene/ScorerAware.java index 4fe253878021c..f8a0758a9533e 100644 --- a/server/src/main/java/org/opensearch/common/lucene/ScorerAware.java +++ b/server/src/main/java/org/opensearch/common/lucene/ScorerAware.java @@ -33,6 +33,11 @@ import org.apache.lucene.search.Scorable; +/** + * Interface that is scorer aware. + * + * @opensearch.internal + */ public interface ScorerAware { void setScorer(Scorable scorer); diff --git a/server/src/main/java/org/opensearch/common/lucene/ShardCoreKeyMap.java b/server/src/main/java/org/opensearch/common/lucene/ShardCoreKeyMap.java index 22360a23586df..017aef1528243 100644 --- a/server/src/main/java/org/opensearch/common/lucene/ShardCoreKeyMap.java +++ b/server/src/main/java/org/opensearch/common/lucene/ShardCoreKeyMap.java @@ -57,6 +57,8 @@ * segments so that at any time it only tracks live segments. * * NOTE: This is heavy. Avoid using this class unless absolutely required. + * + * @opensearch.internal */ public final class ShardCoreKeyMap { diff --git a/server/src/main/java/org/opensearch/common/lucene/index/FilterableTermsEnum.java b/server/src/main/java/org/opensearch/common/lucene/index/FilterableTermsEnum.java index ebd108b79d61a..61c9e9f54cb51 100644 --- a/server/src/main/java/org/opensearch/common/lucene/index/FilterableTermsEnum.java +++ b/server/src/main/java/org/opensearch/common/lucene/index/FilterableTermsEnum.java @@ -60,9 +60,16 @@ * A frequency TermsEnum that returns frequencies derived from a collection of * cached leaf termEnums. It also allows to provide a filter to explicitly * compute frequencies only for docs that match the filter (heavier!). + * + * @opensearch.internal */ public class FilterableTermsEnum extends TermsEnum { + /** + * Holds a terms enum, doc enum, and bitset + * + * @opensearch.internal + */ static class Holder { final TermsEnum termsEnum; @Nullable diff --git a/server/src/main/java/org/opensearch/common/lucene/index/FreqTermsEnum.java b/server/src/main/java/org/opensearch/common/lucene/index/FreqTermsEnum.java index bedd372d28453..eabdc25f1125a 100644 --- a/server/src/main/java/org/opensearch/common/lucene/index/FreqTermsEnum.java +++ b/server/src/main/java/org/opensearch/common/lucene/index/FreqTermsEnum.java @@ -48,6 +48,8 @@ /** * A frequency terms enum that maintains a cache of docFreq, totalTermFreq, or both for repeated term lookup. + * + * @opensearch.internal */ public class FreqTermsEnum extends FilterableTermsEnum implements Releasable { diff --git a/server/src/main/java/org/opensearch/common/lucene/index/OpenSearchDirectoryReader.java b/server/src/main/java/org/opensearch/common/lucene/index/OpenSearchDirectoryReader.java index 8d99eda7acf7d..26f3bb9ccbd92 100644 --- a/server/src/main/java/org/opensearch/common/lucene/index/OpenSearchDirectoryReader.java +++ b/server/src/main/java/org/opensearch/common/lucene/index/OpenSearchDirectoryReader.java @@ -43,6 +43,8 @@ /** * A {@link org.apache.lucene.index.FilterDirectoryReader} that exposes * OpenSearch internal per shard / index information like the shard ID. + * + * @opensearch.internal */ public final class OpenSearchDirectoryReader extends FilterDirectoryReader { diff --git a/server/src/main/java/org/opensearch/common/lucene/index/OpenSearchLeafReader.java b/server/src/main/java/org/opensearch/common/lucene/index/OpenSearchLeafReader.java index 5ff20666ed68d..10c76e43a7176 100644 --- a/server/src/main/java/org/opensearch/common/lucene/index/OpenSearchLeafReader.java +++ b/server/src/main/java/org/opensearch/common/lucene/index/OpenSearchLeafReader.java @@ -39,6 +39,8 @@ /** * A {@link org.apache.lucene.index.FilterLeafReader} that exposes * OpenSearch internal per shard / index information like the shard ID. + * + * @opensearch.internal */ public final class OpenSearchLeafReader extends SequentialStoredFieldsLeafReader { diff --git a/server/src/main/java/org/opensearch/common/lucene/index/SequentialStoredFieldsLeafReader.java b/server/src/main/java/org/opensearch/common/lucene/index/SequentialStoredFieldsLeafReader.java index 73c6e1e73f897..3e6630af074fd 100644 --- a/server/src/main/java/org/opensearch/common/lucene/index/SequentialStoredFieldsLeafReader.java +++ b/server/src/main/java/org/opensearch/common/lucene/index/SequentialStoredFieldsLeafReader.java @@ -45,6 +45,8 @@ * {@link FilterLeafReader} that are used at search time in order to * leverage sequential access when retrieving stored fields in queries, * aggregations or during the fetch phase. + * + * @opensearch.internal */ public abstract class SequentialStoredFieldsLeafReader extends FilterLeafReader { /** diff --git a/server/src/main/java/org/opensearch/common/lucene/search/AutomatonQueries.java b/server/src/main/java/org/opensearch/common/lucene/search/AutomatonQueries.java index 12dec26090b48..ada5bc0598478 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/AutomatonQueries.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/AutomatonQueries.java @@ -47,6 +47,8 @@ /** * Helper functions for creating various forms of {@link AutomatonQuery} + * + * @opensearch.internal */ public class AutomatonQueries { diff --git a/server/src/main/java/org/opensearch/common/lucene/search/FilteredCollector.java b/server/src/main/java/org/opensearch/common/lucene/search/FilteredCollector.java index 2dcb0578fd23d..0d7a8866f7788 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/FilteredCollector.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/FilteredCollector.java @@ -43,6 +43,11 @@ import java.io.IOException; +/** + * A filtered collector. + * + * @opensearch.internal + */ public class FilteredCollector implements Collector { private final Collector collector; diff --git a/server/src/main/java/org/opensearch/common/lucene/search/MoreLikeThisQuery.java b/server/src/main/java/org/opensearch/common/lucene/search/MoreLikeThisQuery.java index bc83f07f74103..93d18b3533d5c 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/MoreLikeThisQuery.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/MoreLikeThisQuery.java @@ -59,6 +59,11 @@ import java.util.Objects; import java.util.Set; +/** + * The more like this query. + * + * @opensearch.internal + */ public class MoreLikeThisQuery extends Query { public static final String DEFAULT_MINIMUM_SHOULD_MATCH = "30%"; diff --git a/server/src/main/java/org/opensearch/common/lucene/search/MultiPhrasePrefixQuery.java b/server/src/main/java/org/opensearch/common/lucene/search/MultiPhrasePrefixQuery.java index 982779333e7da..a893fcecf5b88 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/MultiPhrasePrefixQuery.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/MultiPhrasePrefixQuery.java @@ -55,6 +55,11 @@ import java.util.ListIterator; import java.util.Objects; +/** + * A multi phrase prefix query. + * + * @opensearch.internal + */ public class MultiPhrasePrefixQuery extends Query { private final String field; diff --git a/server/src/main/java/org/opensearch/common/lucene/search/Queries.java b/server/src/main/java/org/opensearch/common/lucene/search/Queries.java index ac77420a79f73..8b64a45b9db25 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/Queries.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/Queries.java @@ -58,6 +58,11 @@ import java.util.Objects; import java.util.regex.Pattern; +/** + * Lucene queries class + * + * @opensearch.internal + */ public class Queries { public static Query newMatchAllQuery() { @@ -210,6 +215,11 @@ public static Query newMatchNoDocsQueryWithoutRewrite(String reason) { return new MatchNoDocsWithoutRewriteQuery(reason); } + /** + * Matches no docs w/o rewriting the query + * + * @opensearch.internal + */ static class MatchNoDocsWithoutRewriteQuery extends Query { private final String reason; diff --git a/server/src/main/java/org/opensearch/common/lucene/search/SpanBooleanQueryRewriteWithMaxClause.java b/server/src/main/java/org/opensearch/common/lucene/search/SpanBooleanQueryRewriteWithMaxClause.java index 4b770529af4a8..65cffa208a47f 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/SpanBooleanQueryRewriteWithMaxClause.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/SpanBooleanQueryRewriteWithMaxClause.java @@ -59,6 +59,8 @@ * that match the {@link MultiTermQuery} in the terms dictionary. * The rewrite throws an error if more than maxExpansions terms are found and hardLimit * is set. + * + * @opensearch.internal */ public class SpanBooleanQueryRewriteWithMaxClause extends SpanMultiTermQueryWrapper.SpanRewriteMethod { private final int maxExpansions; diff --git a/server/src/main/java/org/opensearch/common/lucene/search/TopDocsAndMaxScore.java b/server/src/main/java/org/opensearch/common/lucene/search/TopDocsAndMaxScore.java index b7976058afcf6..5f8c52676b481 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/TopDocsAndMaxScore.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/TopDocsAndMaxScore.java @@ -36,6 +36,8 @@ /** * Wrapper around a {@link TopDocs} instance and the maximum score. + * + * @opensearch.internal */ // TODO: Remove this class when https://github.com/elastic/elasticsearch/issues/32981 is addressed. public final class TopDocsAndMaxScore { diff --git a/server/src/main/java/org/opensearch/common/lucene/search/XMoreLikeThis.java b/server/src/main/java/org/opensearch/common/lucene/search/XMoreLikeThis.java index 63e6304fa50e5..35aab81e94bc4 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/XMoreLikeThis.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/XMoreLikeThis.java @@ -165,6 +165,8 @@ * - refactor: moved common code into isNoiseWord() * - optimise: when no termvector support available - used maxNumTermsParsed to limit amount of tokenization * + * + * @opensearch.internal */ public final class XMoreLikeThis { @@ -1016,6 +1018,8 @@ public String[] retrieveInterestingTerms(Reader r, String fieldName) throws IOEx /** * PriorityQueue that orders words by score. + * + * @opensearch.internal */ private static class FreqQ extends PriorityQueue { FreqQ(int maxSize) { @@ -1028,6 +1032,11 @@ protected boolean lessThan(ScoreTerm a, ScoreTerm b) { } } + /** + * A scored term + * + * @opensearch.internal + */ private static class ScoreTerm { String word; String topField; @@ -1048,6 +1057,8 @@ void update(String word, String topField, float score) { /** * Use for frequencies and to avoid renewing Integers. + * + * @opensearch.internal */ private static class Int { int x; diff --git a/server/src/main/java/org/opensearch/common/lucene/search/function/CombineFunction.java b/server/src/main/java/org/opensearch/common/lucene/search/function/CombineFunction.java index 3e0a6f59b4e1a..48a729d347ea1 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/function/CombineFunction.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/function/CombineFunction.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.util.Locale; +/** + * Combine function for search + * + * @opensearch.internal + */ public enum CombineFunction implements Writeable { MULTIPLY { @Override diff --git a/server/src/main/java/org/opensearch/common/lucene/search/function/FieldValueFactorFunction.java b/server/src/main/java/org/opensearch/common/lucene/search/function/FieldValueFactorFunction.java index 3233fc9f8cecc..3a21246da06c0 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/function/FieldValueFactorFunction.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/function/FieldValueFactorFunction.java @@ -51,6 +51,8 @@ * A function_score function that multiplies the score with the value of a * field from the document, optionally multiplying the field by a factor first, * and applying a modification (log, ln, sqrt, square, etc) afterwards. + * + * @opensearch.internal */ public class FieldValueFactorFunction extends ScoreFunction { private final String field; diff --git a/server/src/main/java/org/opensearch/common/lucene/search/function/FunctionScoreQuery.java b/server/src/main/java/org/opensearch/common/lucene/search/function/FunctionScoreQuery.java index 09239b0108422..e52f77bf49216 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/function/FunctionScoreQuery.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/function/FunctionScoreQuery.java @@ -62,10 +62,17 @@ /** * A query that allows for a pluggable boost function / filter. If it matches * the filter, it will be boosted by the formula. + * + * @opensearch.internal */ public class FunctionScoreQuery extends Query { public static final float DEFAULT_MAX_BOOST = Float.MAX_VALUE; + /** + * Filter score function + * + * @opensearch.internal + */ public static class FilterScoreFunction extends ScoreFunction { public final Query filter; public final ScoreFunction function; @@ -481,6 +488,11 @@ public boolean isCacheable(LeafReaderContext ctx) { } } + /** + * Internal function factor scorer + * + * @opensearch.internal + */ static class FunctionFactorScorer extends FilterScorer { private final ScoreFunction[] functions; private final ScoreMode scoreMode; diff --git a/server/src/main/java/org/opensearch/common/lucene/search/function/Functions.java b/server/src/main/java/org/opensearch/common/lucene/search/function/Functions.java index a9de8ead31e2a..ce733bbe78684 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/function/Functions.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/function/Functions.java @@ -15,6 +15,8 @@ /** * Helper utility class for functions + * + * @opensearch.internal */ public final class Functions { private Functions() {} diff --git a/server/src/main/java/org/opensearch/common/lucene/search/function/LeafScoreFunction.java b/server/src/main/java/org/opensearch/common/lucene/search/function/LeafScoreFunction.java index ad3c5b8031dd7..4ff283730a9a1 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/function/LeafScoreFunction.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/function/LeafScoreFunction.java @@ -36,7 +36,11 @@ import java.io.IOException; -/** Per-leaf {@link ScoreFunction}. */ +/** + * Per-leaf {@link ScoreFunction}. + * + * @opensearch.internal + */ public abstract class LeafScoreFunction { public abstract double score(int docId, float subQueryScore) throws IOException; diff --git a/server/src/main/java/org/opensearch/common/lucene/search/function/MinScoreScorer.java b/server/src/main/java/org/opensearch/common/lucene/search/function/MinScoreScorer.java index 368c41a149b63..30be06489dea5 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/function/MinScoreScorer.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/function/MinScoreScorer.java @@ -39,8 +39,12 @@ import java.io.IOException; -/** A {@link Scorer} that filters out documents that have a score that is - * lower than a configured constant. */ +/** + * A {@link Scorer} that filters out documents that have a score that is + * lower than a configured constant. + * + * @opensearch.internal + */ final class MinScoreScorer extends Scorer { private final Scorer in; diff --git a/server/src/main/java/org/opensearch/common/lucene/search/function/RandomScoreFunction.java b/server/src/main/java/org/opensearch/common/lucene/search/function/RandomScoreFunction.java index f4fcda47b0078..48b3e0d04bdc3 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/function/RandomScoreFunction.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/function/RandomScoreFunction.java @@ -45,6 +45,8 @@ /** * Pseudo randomly generate a score for each {@link LeafScoreFunction#score}. + * + * @opensearch.internal */ public class RandomScoreFunction extends ScoreFunction { diff --git a/server/src/main/java/org/opensearch/common/lucene/search/function/ScoreFunction.java b/server/src/main/java/org/opensearch/common/lucene/search/function/ScoreFunction.java index 48200d9dbacff..fe01e8489d61f 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/function/ScoreFunction.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/function/ScoreFunction.java @@ -38,6 +38,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Score function for search. + * + * @opensearch.internal + */ public abstract class ScoreFunction { private final CombineFunction scoreCombiner; diff --git a/server/src/main/java/org/opensearch/common/lucene/search/function/ScriptScoreFunction.java b/server/src/main/java/org/opensearch/common/lucene/search/function/ScriptScoreFunction.java index 3a7cc970908a5..533d74e916c09 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/function/ScriptScoreFunction.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/function/ScriptScoreFunction.java @@ -44,6 +44,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Script score function for search. + * + * @opensearch.internal + */ public class ScriptScoreFunction extends ScoreFunction { static final class CannedScorer extends Scorable { diff --git a/server/src/main/java/org/opensearch/common/lucene/search/function/ScriptScoreQuery.java b/server/src/main/java/org/opensearch/common/lucene/search/function/ScriptScoreQuery.java index 846cfd4b6431e..8bf5fc0f89d31 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/function/ScriptScoreQuery.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/function/ScriptScoreQuery.java @@ -59,6 +59,8 @@ /** * A query that uses a script to compute documents' scores. + * + * @opensearch.internal */ public class ScriptScoreQuery extends Query { private final Query subQuery; @@ -244,6 +246,11 @@ public int hashCode() { return Objects.hash(subQuery, script, minScore, indexName, shardId, indexVersion, queryName); } + /** + * A script scorer + * + * @opensearch.internal + */ private static class ScriptScorer extends Scorer { private final ScoreScript scoreScript; private final Scorer subQueryScorer; @@ -303,6 +310,11 @@ public float getMaxScore(int upTo) { } + /** + * A script scorable + * + * @opensearch.internal + */ private static class ScriptScorable extends Scorable { private final ScoreScript scoreScript; private final Scorable subQueryScorer; @@ -352,6 +364,8 @@ public int docID() { /** * Use the {@link BulkScorer} of the sub-query, * as it may be significantly faster (e.g. BooleanScorer) than iterating over the scorer + * + * @opensearch.internal */ private static class ScriptScoreBulkScorer extends BulkScorer { private final BulkScorer subQueryBulkScorer; diff --git a/server/src/main/java/org/opensearch/common/lucene/search/function/WeightFactorFunction.java b/server/src/main/java/org/opensearch/common/lucene/search/function/WeightFactorFunction.java index 71968a0545cff..c439b57de41cd 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/function/WeightFactorFunction.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/function/WeightFactorFunction.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Weight factor function + * + * @opensearch.internal + */ public class WeightFactorFunction extends ScoreFunction { private static final ScoreFunction SCORE_ONE = new ScoreOne(CombineFunction.MULTIPLY); @@ -123,6 +128,11 @@ protected int doHashCode() { return Objects.hash(weight, scoreFunction); } + /** + * A constant score of 1.0 + * + * @opensearch.internal + */ private static class ScoreOne extends ScoreFunction { private final String functionName; diff --git a/server/src/main/java/org/opensearch/common/lucene/store/ByteArrayIndexInput.java b/server/src/main/java/org/opensearch/common/lucene/store/ByteArrayIndexInput.java index ed352fbf208b3..0113d238869c5 100644 --- a/server/src/main/java/org/opensearch/common/lucene/store/ByteArrayIndexInput.java +++ b/server/src/main/java/org/opensearch/common/lucene/store/ByteArrayIndexInput.java @@ -38,6 +38,8 @@ /** * Wraps array of bytes into IndexInput + * + * @opensearch.internal */ public class ByteArrayIndexInput extends IndexInput { private final byte[] bytes; diff --git a/server/src/main/java/org/opensearch/common/lucene/store/FilterIndexOutput.java b/server/src/main/java/org/opensearch/common/lucene/store/FilterIndexOutput.java index e23cedf86eaa7..618e02e9546b2 100644 --- a/server/src/main/java/org/opensearch/common/lucene/store/FilterIndexOutput.java +++ b/server/src/main/java/org/opensearch/common/lucene/store/FilterIndexOutput.java @@ -37,6 +37,8 @@ /** * IndexOutput that delegates all calls to another IndexOutput + * + * @opensearch.internal */ public class FilterIndexOutput extends IndexOutput { diff --git a/server/src/main/java/org/opensearch/common/lucene/store/IndexOutputOutputStream.java b/server/src/main/java/org/opensearch/common/lucene/store/IndexOutputOutputStream.java index d0d776c816da2..f71b0d3e3617d 100644 --- a/server/src/main/java/org/opensearch/common/lucene/store/IndexOutputOutputStream.java +++ b/server/src/main/java/org/opensearch/common/lucene/store/IndexOutputOutputStream.java @@ -39,6 +39,8 @@ /** * {@link OutputStream} that writes into underlying IndexOutput + * + * @opensearch.internal */ public class IndexOutputOutputStream extends OutputStream { diff --git a/server/src/main/java/org/opensearch/common/lucene/store/InputStreamIndexInput.java b/server/src/main/java/org/opensearch/common/lucene/store/InputStreamIndexInput.java index 47e454b6f755c..71075de0037e2 100644 --- a/server/src/main/java/org/opensearch/common/lucene/store/InputStreamIndexInput.java +++ b/server/src/main/java/org/opensearch/common/lucene/store/InputStreamIndexInput.java @@ -37,6 +37,11 @@ import java.io.IOException; import java.io.InputStream; +/** + * Index input over an input stream. + * + * @opensearch.internal + */ public class InputStreamIndexInput extends InputStream { private final IndexInput indexInput; diff --git a/server/src/main/java/org/opensearch/common/lucene/uid/PerThreadIDVersionAndSeqNoLookup.java b/server/src/main/java/org/opensearch/common/lucene/uid/PerThreadIDVersionAndSeqNoLookup.java index 362badf046b75..60d1f9e41ea2c 100644 --- a/server/src/main/java/org/opensearch/common/lucene/uid/PerThreadIDVersionAndSeqNoLookup.java +++ b/server/src/main/java/org/opensearch/common/lucene/uid/PerThreadIDVersionAndSeqNoLookup.java @@ -61,6 +61,8 @@ * This class uses live docs, so it should be cached based on the * {@link org.apache.lucene.index.IndexReader#getReaderCacheHelper() reader cache helper} * rather than the {@link LeafReader#getCoreCacheHelper() core cache helper}. + * + * @opensearch.internal */ final class PerThreadIDVersionAndSeqNoLookup { // TODO: do we really need to store all this stuff? some if it might not speed up anything. diff --git a/server/src/main/java/org/opensearch/common/lucene/uid/Versions.java b/server/src/main/java/org/opensearch/common/lucene/uid/Versions.java index bd10085c0153f..09b9a7e3e692d 100644 --- a/server/src/main/java/org/opensearch/common/lucene/uid/Versions.java +++ b/server/src/main/java/org/opensearch/common/lucene/uid/Versions.java @@ -32,6 +32,11 @@ package org.opensearch.common.lucene.uid; +/** + * UID versions. + * + * @opensearch.internal + */ public final class Versions { /** used to indicate the write operation should succeed regardless of current version **/ diff --git a/server/src/main/java/org/opensearch/common/lucene/uid/VersionsAndSeqNoResolver.java b/server/src/main/java/org/opensearch/common/lucene/uid/VersionsAndSeqNoResolver.java index bea9c7b6bdc8c..57524bc3657d9 100644 --- a/server/src/main/java/org/opensearch/common/lucene/uid/VersionsAndSeqNoResolver.java +++ b/server/src/main/java/org/opensearch/common/lucene/uid/VersionsAndSeqNoResolver.java @@ -44,7 +44,11 @@ import java.util.Objects; import java.util.concurrent.ConcurrentMap; -/** Utility class to resolve the Lucene doc ID, version, seqNo and primaryTerms for a given uid. */ +/** + * Utility class to resolve the Lucene doc ID, version, seqNo and primaryTerms for a given uid. + * + * @opensearch.internal + */ public final class VersionsAndSeqNoResolver { static final ConcurrentMap> lookupStates = @@ -103,7 +107,11 @@ private static PerThreadIDVersionAndSeqNoLookup[] getLookupState(IndexReader rea private VersionsAndSeqNoResolver() {} - /** Wraps an {@link LeafReaderContext}, a doc ID relative to the context doc base and a version. */ + /** + * Wraps an {@link LeafReaderContext}, a doc ID relative to the context doc base and a version. + * + * @opensearch.internal + */ public static class DocIdAndVersion { public final int docId; public final long version; @@ -122,7 +130,11 @@ public DocIdAndVersion(int docId, long version, long seqNo, long primaryTerm, Le } } - /** Wraps an {@link LeafReaderContext}, a doc ID relative to the context doc base and a seqNo. */ + /** + * Wraps an {@link LeafReaderContext}, a doc ID relative to the context doc base and a seqNo. + * + * @opensearch.internal + */ public static class DocIdAndSeqNo { public final int docId; public final long seqNo; diff --git a/server/src/main/java/org/opensearch/common/metrics/CounterMetric.java b/server/src/main/java/org/opensearch/common/metrics/CounterMetric.java index 5d0b21df21a08..5c48c1f772ff0 100644 --- a/server/src/main/java/org/opensearch/common/metrics/CounterMetric.java +++ b/server/src/main/java/org/opensearch/common/metrics/CounterMetric.java @@ -34,6 +34,11 @@ import java.util.concurrent.atomic.LongAdder; +/** + * A counter metric for tracking. + * + * @opensearch.internal + */ public class CounterMetric implements Metric { private final LongAdder counter = new LongAdder(); diff --git a/server/src/main/java/org/opensearch/common/metrics/MeanMetric.java b/server/src/main/java/org/opensearch/common/metrics/MeanMetric.java index 977d8e62a3411..79c04d431e97b 100644 --- a/server/src/main/java/org/opensearch/common/metrics/MeanMetric.java +++ b/server/src/main/java/org/opensearch/common/metrics/MeanMetric.java @@ -34,6 +34,11 @@ import java.util.concurrent.atomic.LongAdder; +/** + * An average metric for tracking. + * + * @opensearch.internal + */ public class MeanMetric implements Metric { private final LongAdder counter = new LongAdder(); diff --git a/server/src/main/java/org/opensearch/common/metrics/Metric.java b/server/src/main/java/org/opensearch/common/metrics/Metric.java index f56d1dd0e7fad..f39de634ec477 100644 --- a/server/src/main/java/org/opensearch/common/metrics/Metric.java +++ b/server/src/main/java/org/opensearch/common/metrics/Metric.java @@ -32,4 +32,9 @@ package org.opensearch.common.metrics; +/** + * Base metric. + * + * @opensearch.internal + */ public interface Metric {} diff --git a/server/src/main/java/org/opensearch/common/network/Cidrs.java b/server/src/main/java/org/opensearch/common/network/Cidrs.java index 86034fa8cac9c..651ab8883a9aa 100644 --- a/server/src/main/java/org/opensearch/common/network/Cidrs.java +++ b/server/src/main/java/org/opensearch/common/network/Cidrs.java @@ -36,6 +36,11 @@ import java.util.Locale; import java.util.Objects; +/** + * Network Cidrs + * + * @opensearch.internal + */ public final class Cidrs { private Cidrs() {} diff --git a/server/src/main/java/org/opensearch/common/network/CloseableChannel.java b/server/src/main/java/org/opensearch/common/network/CloseableChannel.java index 054a5fac838e9..a849e0403a007 100644 --- a/server/src/main/java/org/opensearch/common/network/CloseableChannel.java +++ b/server/src/main/java/org/opensearch/common/network/CloseableChannel.java @@ -44,6 +44,11 @@ import java.util.List; import java.util.concurrent.ExecutionException; +/** + * Channel that can be closed + * + * @opensearch.internal + */ public interface CloseableChannel extends Closeable { /** diff --git a/server/src/main/java/org/opensearch/common/network/IfConfig.java b/server/src/main/java/org/opensearch/common/network/IfConfig.java index 6c4e14aa29700..9e2ef0263f6ed 100644 --- a/server/src/main/java/org/opensearch/common/network/IfConfig.java +++ b/server/src/main/java/org/opensearch/common/network/IfConfig.java @@ -46,6 +46,8 @@ /** * Simple class to log {@code ifconfig}-style output at DEBUG logging. + * + * @opensearch.internal */ public final class IfConfig { diff --git a/server/src/main/java/org/opensearch/common/network/InetAddresses.java b/server/src/main/java/org/opensearch/common/network/InetAddresses.java index 87a18f41deecc..a4fbc6cb65b0d 100644 --- a/server/src/main/java/org/opensearch/common/network/InetAddresses.java +++ b/server/src/main/java/org/opensearch/common/network/InetAddresses.java @@ -39,6 +39,11 @@ import java.util.Arrays; import java.util.Locale; +/** + * Network addresses. + * + * @opensearch.internal + */ public class InetAddresses { private static int IPV4_PART_COUNT = 4; private static int IPV6_PART_COUNT = 8; diff --git a/server/src/main/java/org/opensearch/common/network/NetworkAddress.java b/server/src/main/java/org/opensearch/common/network/NetworkAddress.java index 324e35f683a11..f5bc3face6e45 100644 --- a/server/src/main/java/org/opensearch/common/network/NetworkAddress.java +++ b/server/src/main/java/org/opensearch/common/network/NetworkAddress.java @@ -60,6 +60,8 @@ * This class provides sane address formatting instead, e.g. * {@code 127.0.0.1} and {@code ::1} respectively. No methods do reverse * lookups. + * + * @opensearch.internal */ public final class NetworkAddress { /** No instantiation */ diff --git a/server/src/main/java/org/opensearch/common/network/NetworkModule.java b/server/src/main/java/org/opensearch/common/network/NetworkModule.java index 0b517b8bda97a..49002802a8f07 100644 --- a/server/src/main/java/org/opensearch/common/network/NetworkModule.java +++ b/server/src/main/java/org/opensearch/common/network/NetworkModule.java @@ -74,6 +74,8 @@ /** * A module to handle registering and binding all network related classes. + * + * @opensearch.internal */ public final class NetworkModule { diff --git a/server/src/main/java/org/opensearch/common/network/NetworkService.java b/server/src/main/java/org/opensearch/common/network/NetworkService.java index b5cad48643b95..6a630dceadc18 100644 --- a/server/src/main/java/org/opensearch/common/network/NetworkService.java +++ b/server/src/main/java/org/opensearch/common/network/NetworkService.java @@ -48,6 +48,11 @@ import java.util.concurrent.TimeUnit; import java.util.function.Function; +/** + * Core network service. + * + * @opensearch.internal + */ public final class NetworkService { /** By default, we bind to loopback interfaces */ diff --git a/server/src/main/java/org/opensearch/common/network/NetworkUtils.java b/server/src/main/java/org/opensearch/common/network/NetworkUtils.java index 13e4e5d2434c1..8660b876fa187 100644 --- a/server/src/main/java/org/opensearch/common/network/NetworkUtils.java +++ b/server/src/main/java/org/opensearch/common/network/NetworkUtils.java @@ -52,6 +52,8 @@ /** * Utilities for network interfaces / addresses binding and publishing. * Its only intended for that purpose, not general purpose usage!!!! + * + * @opensearch.internal */ public abstract class NetworkUtils { diff --git a/server/src/main/java/org/opensearch/common/path/PathTrie.java b/server/src/main/java/org/opensearch/common/path/PathTrie.java index 4f28b19700799..360da4c58bda9 100644 --- a/server/src/main/java/org/opensearch/common/path/PathTrie.java +++ b/server/src/main/java/org/opensearch/common/path/PathTrie.java @@ -43,6 +43,11 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.unmodifiableMap; +/** + * Path based on a trie structure. + * + * @opensearch.internal + */ public class PathTrie { enum TrieMatchingMode { diff --git a/server/src/main/java/org/opensearch/common/recycler/AbstractRecycler.java b/server/src/main/java/org/opensearch/common/recycler/AbstractRecycler.java index 66adee7ae45f0..321062556ef86 100644 --- a/server/src/main/java/org/opensearch/common/recycler/AbstractRecycler.java +++ b/server/src/main/java/org/opensearch/common/recycler/AbstractRecycler.java @@ -32,6 +32,11 @@ package org.opensearch.common.recycler; +/** + * Base recycler. + * + * @opensearch.internal + */ abstract class AbstractRecycler implements Recycler { protected final Recycler.C c; diff --git a/server/src/main/java/org/opensearch/common/recycler/AbstractRecyclerC.java b/server/src/main/java/org/opensearch/common/recycler/AbstractRecyclerC.java index 16a85ad6eda7f..8957880c27cdf 100644 --- a/server/src/main/java/org/opensearch/common/recycler/AbstractRecyclerC.java +++ b/server/src/main/java/org/opensearch/common/recycler/AbstractRecyclerC.java @@ -32,6 +32,11 @@ package org.opensearch.common.recycler; +/** + * Base recycler. + * + * @opensearch.internal + */ public abstract class AbstractRecyclerC implements Recycler.C { @Override diff --git a/server/src/main/java/org/opensearch/common/recycler/ConcurrentDequeRecycler.java b/server/src/main/java/org/opensearch/common/recycler/ConcurrentDequeRecycler.java index c279a554890a2..68d108d58603f 100644 --- a/server/src/main/java/org/opensearch/common/recycler/ConcurrentDequeRecycler.java +++ b/server/src/main/java/org/opensearch/common/recycler/ConcurrentDequeRecycler.java @@ -39,6 +39,8 @@ /** * A {@link Recycler} implementation based on a concurrent {@link Deque}. This implementation is thread-safe. + * + * @opensearch.internal */ public class ConcurrentDequeRecycler extends DequeRecycler { diff --git a/server/src/main/java/org/opensearch/common/recycler/DequeRecycler.java b/server/src/main/java/org/opensearch/common/recycler/DequeRecycler.java index 44a6c86f791a7..1d6588119e7f5 100644 --- a/server/src/main/java/org/opensearch/common/recycler/DequeRecycler.java +++ b/server/src/main/java/org/opensearch/common/recycler/DequeRecycler.java @@ -36,6 +36,8 @@ /** * A {@link Recycler} implementation based on a {@link Deque}. This implementation is NOT thread-safe. + * + * @opensearch.internal */ public class DequeRecycler extends AbstractRecycler { diff --git a/server/src/main/java/org/opensearch/common/recycler/FilterRecycler.java b/server/src/main/java/org/opensearch/common/recycler/FilterRecycler.java index 77a9a8cbc224d..e3825eb53c501 100644 --- a/server/src/main/java/org/opensearch/common/recycler/FilterRecycler.java +++ b/server/src/main/java/org/opensearch/common/recycler/FilterRecycler.java @@ -32,6 +32,11 @@ package org.opensearch.common.recycler; +/** + * Base filter recycler. + * + * @opensearch.internal + */ abstract class FilterRecycler implements Recycler { /** Get the delegate instance to forward calls to. */ diff --git a/server/src/main/java/org/opensearch/common/recycler/NoneRecycler.java b/server/src/main/java/org/opensearch/common/recycler/NoneRecycler.java index cab62c7fc218d..d3d74138d3d6a 100644 --- a/server/src/main/java/org/opensearch/common/recycler/NoneRecycler.java +++ b/server/src/main/java/org/opensearch/common/recycler/NoneRecycler.java @@ -32,6 +32,11 @@ package org.opensearch.common.recycler; +/** + * No value recycler + * + * @opensearch.internal + */ public class NoneRecycler extends AbstractRecycler { public NoneRecycler(C c) { @@ -43,6 +48,11 @@ public V obtain() { return new NV<>(c.newInstance()); } + /** + * Generic no value recycler + * + * @opensearch.internal + */ public static class NV implements Recycler.V { T value; diff --git a/server/src/main/java/org/opensearch/common/recycler/Recycler.java b/server/src/main/java/org/opensearch/common/recycler/Recycler.java index e700a324f38f3..0c9127bf3ebde 100644 --- a/server/src/main/java/org/opensearch/common/recycler/Recycler.java +++ b/server/src/main/java/org/opensearch/common/recycler/Recycler.java @@ -37,6 +37,8 @@ /** * A recycled object, note, implementations should support calling obtain and then recycle * on different threads. + * + * @opensearch.internal */ public interface Recycler { diff --git a/server/src/main/java/org/opensearch/common/recycler/Recyclers.java b/server/src/main/java/org/opensearch/common/recycler/Recyclers.java index 6f7a254ec015c..74916cf4e6d10 100644 --- a/server/src/main/java/org/opensearch/common/recycler/Recyclers.java +++ b/server/src/main/java/org/opensearch/common/recycler/Recyclers.java @@ -36,6 +36,11 @@ import java.util.ArrayDeque; +/** + * Utility class of recyclers. + * + * @opensearch.internal + */ public enum Recyclers { ; diff --git a/server/src/main/java/org/opensearch/common/regex/Regex.java b/server/src/main/java/org/opensearch/common/regex/Regex.java index dc42b09848e36..2445f80cf7e28 100644 --- a/server/src/main/java/org/opensearch/common/regex/Regex.java +++ b/server/src/main/java/org/opensearch/common/regex/Regex.java @@ -42,6 +42,11 @@ import java.util.Locale; import java.util.regex.Pattern; +/** + * Main regex class. + * + * @opensearch.internal + */ public class Regex { /** diff --git a/server/src/main/java/org/opensearch/common/rounding/DateTimeUnit.java b/server/src/main/java/org/opensearch/common/rounding/DateTimeUnit.java index eb109ac3d9603..47e182b3caf84 100644 --- a/server/src/main/java/org/opensearch/common/rounding/DateTimeUnit.java +++ b/server/src/main/java/org/opensearch/common/rounding/DateTimeUnit.java @@ -39,6 +39,11 @@ import java.util.function.Function; +/** + * Main date time unit class. + * + * @opensearch.internal + */ public enum DateTimeUnit { WEEK_OF_WEEKYEAR((byte) 1, tz -> ISOChronology.getInstance(tz).weekOfWeekyear()), diff --git a/server/src/main/java/org/opensearch/common/rounding/Rounding.java b/server/src/main/java/org/opensearch/common/rounding/Rounding.java index 70677a79b125f..cbbbb09185ed2 100644 --- a/server/src/main/java/org/opensearch/common/rounding/Rounding.java +++ b/server/src/main/java/org/opensearch/common/rounding/Rounding.java @@ -47,6 +47,8 @@ * A strategy for rounding long values. * * Use the java based Rounding class where applicable + * + * @opensearch.internal */ @Deprecated public abstract class Rounding implements Writeable { @@ -81,6 +83,11 @@ public static Builder builder(TimeValue interval) { return new Builder(interval); } + /** + * Builder for rounding + * + * @opensearch.internal + */ public static class Builder { private final DateTimeUnit unit; @@ -118,6 +125,11 @@ public Rounding build() { } } + /** + * Rounding time units + * + * @opensearch.internal + */ static class TimeUnitRounding extends Rounding { static final byte ID = 1; @@ -284,6 +296,11 @@ public String toString() { } } + /** + * Rounding time intervals + * + * @opensearch.internal + */ static class TimeIntervalRounding extends Rounding { static final byte ID = 2; @@ -409,6 +426,11 @@ public boolean equals(Object obj) { } } + /** + * Rounding streams + * + * @opensearch.internal + */ public static class Streams { public static void write(Rounding rounding, StreamOutput out) throws IOException { diff --git a/server/src/main/java/org/opensearch/common/settings/AbstractScopedSettings.java b/server/src/main/java/org/opensearch/common/settings/AbstractScopedSettings.java index e6a8db808e72a..640e8cbca469a 100644 --- a/server/src/main/java/org/opensearch/common/settings/AbstractScopedSettings.java +++ b/server/src/main/java/org/opensearch/common/settings/AbstractScopedSettings.java @@ -60,6 +60,8 @@ /** * A basic setting service that can be used for per-index and per-cluster settings. * This service offers transactional application of updates settings. + * + * @opensearch.internal */ public abstract class AbstractScopedSettings { diff --git a/server/src/main/java/org/opensearch/common/settings/BaseKeyStoreCommand.java b/server/src/main/java/org/opensearch/common/settings/BaseKeyStoreCommand.java index a5fe3f8b0b34f..d35d43e53c0d6 100644 --- a/server/src/main/java/org/opensearch/common/settings/BaseKeyStoreCommand.java +++ b/server/src/main/java/org/opensearch/common/settings/BaseKeyStoreCommand.java @@ -42,6 +42,11 @@ import java.nio.file.Path; +/** + * Base settings class for key store commands. + * + * @opensearch.internal + */ public abstract class BaseKeyStoreCommand extends KeyStoreAwareCommand { private KeyStoreWrapper keyStore; diff --git a/server/src/main/java/org/opensearch/common/settings/ChangeKeyStorePasswordCommand.java b/server/src/main/java/org/opensearch/common/settings/ChangeKeyStorePasswordCommand.java index e386fffc3f5dc..cae8ca6002252 100644 --- a/server/src/main/java/org/opensearch/common/settings/ChangeKeyStorePasswordCommand.java +++ b/server/src/main/java/org/opensearch/common/settings/ChangeKeyStorePasswordCommand.java @@ -40,6 +40,8 @@ /** * A sub-command for the keystore cli which changes the password. + * + * @opensearch.internal */ class ChangeKeyStorePasswordCommand extends BaseKeyStoreCommand { diff --git a/server/src/main/java/org/opensearch/common/settings/ClusterSettings.java b/server/src/main/java/org/opensearch/common/settings/ClusterSettings.java index c3f0212b99812..be92bf1643aee 100644 --- a/server/src/main/java/org/opensearch/common/settings/ClusterSettings.java +++ b/server/src/main/java/org/opensearch/common/settings/ClusterSettings.java @@ -148,6 +148,8 @@ /** * Encapsulates all valid cluster level settings. + * + * @opensearch.internal */ public final class ClusterSettings extends AbstractScopedSettings { diff --git a/server/src/main/java/org/opensearch/common/settings/ConsistentSettingsService.java b/server/src/main/java/org/opensearch/common/settings/ConsistentSettingsService.java index 8f3cb9e90ee56..8be242165afd1 100644 --- a/server/src/main/java/org/opensearch/common/settings/ConsistentSettingsService.java +++ b/server/src/main/java/org/opensearch/common/settings/ConsistentSettingsService.java @@ -64,6 +64,8 @@ * Used to publish secure setting hashes in the cluster state and to validate those hashes against the local values of those same settings. * This is colloquially referred to as the secure setting consistency check. It will publish and verify hashes only for the collection * of settings passed in the constructor. The settings have to have the {@link Setting.Property#Consistent} property. + * + * @opensearch.internal */ public final class ConsistentSettingsService { private static final Logger logger = LogManager.getLogger(ConsistentSettingsService.class); diff --git a/server/src/main/java/org/opensearch/common/settings/HasPasswordKeyStoreCommand.java b/server/src/main/java/org/opensearch/common/settings/HasPasswordKeyStoreCommand.java index 3733c985046c1..59d8a44846e11 100644 --- a/server/src/main/java/org/opensearch/common/settings/HasPasswordKeyStoreCommand.java +++ b/server/src/main/java/org/opensearch/common/settings/HasPasswordKeyStoreCommand.java @@ -40,6 +40,11 @@ import java.nio.file.Path; +/** + * KeyStore command that has a password. + * + * @opensearch.internal + */ public class HasPasswordKeyStoreCommand extends KeyStoreAwareCommand { static final int NO_PASSWORD_EXIT_CODE = 1; diff --git a/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java b/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java index 68e1b5b598d40..ba2666b53d7a8 100644 --- a/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java +++ b/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java @@ -68,6 +68,8 @@ /** * Encapsulates all valid index level settings. * @see Property#IndexScope + * + * @opensearch.internal */ public final class IndexScopedSettings extends AbstractScopedSettings { diff --git a/server/src/main/java/org/opensearch/common/settings/KeyStoreWrapper.java b/server/src/main/java/org/opensearch/common/settings/KeyStoreWrapper.java index 900eda6975526..508e1bc38ea8a 100644 --- a/server/src/main/java/org/opensearch/common/settings/KeyStoreWrapper.java +++ b/server/src/main/java/org/opensearch/common/settings/KeyStoreWrapper.java @@ -91,6 +91,8 @@ * {@link #decrypt(char[])} with the keystore password, or an empty char array if * {@link #hasPassword()} is {@code false}. Loading and decrypting should happen * in a single thread. Once decrypted, settings may be read in multiple threads. + * + * @opensearch.internal */ public class KeyStoreWrapper implements SecureSettings { @@ -100,7 +102,11 @@ private enum EntryType { FILE } - /** An entry in the keystore. The bytes are opaque and interpreted based on the entry type. */ + /** + * An entry in the keystore. The bytes are opaque and interpreted based on the entry type. + * + * @opensearch.internal + */ private static class Entry { final byte[] bytes; final byte[] sha256Digest; diff --git a/server/src/main/java/org/opensearch/common/settings/NoClassSettingsException.java b/server/src/main/java/org/opensearch/common/settings/NoClassSettingsException.java index 5600900c1f02b..dc5d96536fc2c 100644 --- a/server/src/main/java/org/opensearch/common/settings/NoClassSettingsException.java +++ b/server/src/main/java/org/opensearch/common/settings/NoClassSettingsException.java @@ -40,7 +40,7 @@ * A specific type of {@link SettingsException} indicating failure to load a class * based on a settings value. * - * + * @opensearch.internal */ public class NoClassSettingsException extends SettingsException { diff --git a/server/src/main/java/org/opensearch/common/settings/PropertyPlaceholder.java b/server/src/main/java/org/opensearch/common/settings/PropertyPlaceholder.java index 557710b7b69f1..ae5875cc8aaa0 100644 --- a/server/src/main/java/org/opensearch/common/settings/PropertyPlaceholder.java +++ b/server/src/main/java/org/opensearch/common/settings/PropertyPlaceholder.java @@ -46,6 +46,8 @@ *

* Values for substitution can be supplied using a {@link Properties} instance or using a * {@link PlaceholderResolver}. + * + * @opensearch.internal */ class PropertyPlaceholder { diff --git a/server/src/main/java/org/opensearch/common/settings/SecureSetting.java b/server/src/main/java/org/opensearch/common/settings/SecureSetting.java index fa828746ab36d..13abbcdc706e0 100644 --- a/server/src/main/java/org/opensearch/common/settings/SecureSetting.java +++ b/server/src/main/java/org/opensearch/common/settings/SecureSetting.java @@ -44,6 +44,8 @@ * A secure setting. * * This class allows access to settings from the OpenSearch keystore. + * + * @opensearch.internal */ public abstract class SecureSetting extends Setting { @@ -171,6 +173,11 @@ public static Setting secureFile(String name, Setting return new SecureFileSetting(name, fallback, properties); } + /** + * Setting for a secure string + * + * @opensearch.internal + */ private static class SecureStringSetting extends SecureSetting { private final Setting fallback; @@ -193,6 +200,11 @@ SecureString getFallback(Settings settings) { } } + /** + * An insecure string setting + * + * @opensearch.internal + */ private static class InsecureStringSetting extends Setting { private final String name; @@ -212,6 +224,11 @@ public SecureString get(Settings settings) { } } + /** + * A secure file setting + * + * @opensearch.internal + */ private static class SecureFileSetting extends SecureSetting { private final Setting fallback; diff --git a/server/src/main/java/org/opensearch/common/settings/SecureSettings.java b/server/src/main/java/org/opensearch/common/settings/SecureSettings.java index 05ed83573bb6c..e9829aac46716 100644 --- a/server/src/main/java/org/opensearch/common/settings/SecureSettings.java +++ b/server/src/main/java/org/opensearch/common/settings/SecureSettings.java @@ -40,6 +40,8 @@ /** * An accessor for settings which are securely stored. See {@link SecureSetting}. + * + * @opensearch.internal */ public interface SecureSettings extends Closeable { diff --git a/server/src/main/java/org/opensearch/common/settings/SecureString.java b/server/src/main/java/org/opensearch/common/settings/SecureString.java index 83c6fbb78c976..468d760766b96 100644 --- a/server/src/main/java/org/opensearch/common/settings/SecureString.java +++ b/server/src/main/java/org/opensearch/common/settings/SecureString.java @@ -38,6 +38,8 @@ /** * A String implementations which allows clearing the underlying char array. + * + * @opensearch.internal */ public final class SecureString implements CharSequence, Closeable { diff --git a/server/src/main/java/org/opensearch/common/settings/Setting.java b/server/src/main/java/org/opensearch/common/settings/Setting.java index 8618687218987..39cf0b9a4f32d 100644 --- a/server/src/main/java/org/opensearch/common/settings/Setting.java +++ b/server/src/main/java/org/opensearch/common/settings/Setting.java @@ -97,6 +97,8 @@ * new Setting<>("my.color.setting", Color.RED.toString(), Color::valueOf, Setting.Property.NodeScope); * } * + * + * @opensearch.internal */ public class Setting implements ToXContentObject { @@ -773,6 +775,11 @@ public interface AffixSettingDependency extends SettingDependency { } + /** + * An affix setting + * + * @opensearch.internal + */ public static class AffixSetting extends Setting { private final AffixKey key; private final BiFunction> delegateFactory; @@ -1044,6 +1051,11 @@ default Iterator> settings() { } + /** + * A group setting + * + * @opensearch.internal + */ private static class GroupSetting extends Setting { private final String key; private final Consumer validator; @@ -1918,6 +1930,11 @@ private static String arrayToParsableString(List array) { } } + /** + * A list setting + * + * @opensearch.internal + */ private static class ListSetting extends Setting> { private final Function> defaultStringValue; @@ -2234,6 +2251,11 @@ public interface Key { boolean match(String key); } + /** + * A simple key for a setting + * + * @opensearch.internal + */ public static class SimpleKey implements Key { protected final String key; diff --git a/server/src/main/java/org/opensearch/common/settings/SettingUpgrader.java b/server/src/main/java/org/opensearch/common/settings/SettingUpgrader.java index d841278b34405..1dabf020d8398 100644 --- a/server/src/main/java/org/opensearch/common/settings/SettingUpgrader.java +++ b/server/src/main/java/org/opensearch/common/settings/SettingUpgrader.java @@ -38,6 +38,8 @@ * Represents the logic to upgrade a setting. * * @param the type of the underlying setting + * + * @opensearch.internal */ public interface SettingUpgrader { diff --git a/server/src/main/java/org/opensearch/common/settings/Settings.java b/server/src/main/java/org/opensearch/common/settings/Settings.java index 9b9d3f54ffa1b..725817ef22c6c 100644 --- a/server/src/main/java/org/opensearch/common/settings/Settings.java +++ b/server/src/main/java/org/opensearch/common/settings/Settings.java @@ -91,6 +91,8 @@ /** * An immutable settings implementation. + * + * @opensearch.internal */ public final class Settings implements ToXContentFragment { @@ -338,6 +340,8 @@ public boolean hasValue(String key) { * We have to lazy initialize the deprecation logger as otherwise a static logger here would be constructed before logging is configured * leading to a runtime failure (see {@link LogConfigurator#checkErrorListener()} ). The premature construction would come from any * {@link Setting} object constructed in, for example, {@link org.opensearch.env.Environment}. + * + * @opensearch.internal */ static class DeprecationLoggerHolder { static DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(Settings.class); @@ -742,6 +746,8 @@ public Set keySet() { * A builder allowing to put different settings and then {@link #build()} an immutable * settings implementation. Use {@link Settings#builder()} in order to * construct it. + * + * @opensearch.internal */ public static class Builder { @@ -1357,6 +1363,11 @@ public int size() { } } + /** + * Prefixed secure settings + * + * @opensearch.internal + */ private static class PrefixedSecureSettings implements SecureSettings { private final SecureSettings delegate; private final UnaryOperator addPrefix; diff --git a/server/src/main/java/org/opensearch/common/settings/SettingsException.java b/server/src/main/java/org/opensearch/common/settings/SettingsException.java index db1c70ae20889..965255903d23f 100644 --- a/server/src/main/java/org/opensearch/common/settings/SettingsException.java +++ b/server/src/main/java/org/opensearch/common/settings/SettingsException.java @@ -40,7 +40,7 @@ /** * A generic failure to handle settings. * - * + * @opensearch.internal */ public class SettingsException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/common/settings/SettingsFilter.java b/server/src/main/java/org/opensearch/common/settings/SettingsFilter.java index 43e6553aba128..9914674068e66 100644 --- a/server/src/main/java/org/opensearch/common/settings/SettingsFilter.java +++ b/server/src/main/java/org/opensearch/common/settings/SettingsFilter.java @@ -47,6 +47,8 @@ /** * A class that allows to filter settings objects by simple regular expression patterns or full settings keys. * It's used for response filtering on the rest layer to for instance filter out sensitive information like access keys. + * + * @opensearch.internal */ public final class SettingsFilter { /** diff --git a/server/src/main/java/org/opensearch/common/settings/SettingsModule.java b/server/src/main/java/org/opensearch/common/settings/SettingsModule.java index 0874814f940d4..16b39bb2e33f9 100644 --- a/server/src/main/java/org/opensearch/common/settings/SettingsModule.java +++ b/server/src/main/java/org/opensearch/common/settings/SettingsModule.java @@ -55,6 +55,8 @@ /** * A module that binds the provided settings to the {@link Settings} interface. + * + * @opensearch.internal */ public class SettingsModule implements Module { private static final Logger logger = LogManager.getLogger(SettingsModule.class); diff --git a/server/src/main/java/org/opensearch/common/settings/UpgradeKeyStoreCommand.java b/server/src/main/java/org/opensearch/common/settings/UpgradeKeyStoreCommand.java index e897b0989176a..46da933e3bf11 100644 --- a/server/src/main/java/org/opensearch/common/settings/UpgradeKeyStoreCommand.java +++ b/server/src/main/java/org/opensearch/common/settings/UpgradeKeyStoreCommand.java @@ -38,6 +38,8 @@ /** * A sub-command for the keystore CLI that enables upgrading the keystore format. + * + * @opensearch.internal */ public class UpgradeKeyStoreCommand extends BaseKeyStoreCommand { diff --git a/server/src/main/java/org/opensearch/common/text/Text.java b/server/src/main/java/org/opensearch/common/text/Text.java index 6756fa8a001f0..389195ba07926 100644 --- a/server/src/main/java/org/opensearch/common/text/Text.java +++ b/server/src/main/java/org/opensearch/common/text/Text.java @@ -43,6 +43,8 @@ /** * Both {@link String} and {@link BytesReference} representation of the text. Starts with one of those, and if * the other is requests, caches the other one in a local reference so no additional conversion will be needed. + * + * @opensearch.internal */ public final class Text implements Comparable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/common/time/DateFormatter.java b/server/src/main/java/org/opensearch/common/time/DateFormatter.java index 4ff810a1c5041..dec08b68644f2 100644 --- a/server/src/main/java/org/opensearch/common/time/DateFormatter.java +++ b/server/src/main/java/org/opensearch/common/time/DateFormatter.java @@ -46,6 +46,11 @@ import java.util.Locale; import java.util.stream.Collectors; +/** + * Base Date formatter + * + * @opensearch.internal + */ public interface DateFormatter { /** diff --git a/server/src/main/java/org/opensearch/common/time/DateFormatters.java b/server/src/main/java/org/opensearch/common/time/DateFormatters.java index bf8b9ea67ea94..26af6fc40429d 100644 --- a/server/src/main/java/org/opensearch/common/time/DateFormatters.java +++ b/server/src/main/java/org/opensearch/common/time/DateFormatters.java @@ -67,6 +67,11 @@ import static java.time.temporal.ChronoField.NANO_OF_SECOND; import static java.time.temporal.ChronoField.SECOND_OF_MINUTE; +/** + * Utility of date formatters. + * + * @opensearch.internal + */ public class DateFormatters { // when run with JDK8, WeekFields for Locale.ROOT would return WeekFields.of(DayOfWeek.SUNDAY,1) public static final WeekFields WEEK_FIELDS_ROOT = WeekFields.of(DayOfWeek.MONDAY, 4); diff --git a/server/src/main/java/org/opensearch/common/time/DateMathParser.java b/server/src/main/java/org/opensearch/common/time/DateMathParser.java index f75f70c35a31f..f6573eaa90286 100644 --- a/server/src/main/java/org/opensearch/common/time/DateMathParser.java +++ b/server/src/main/java/org/opensearch/common/time/DateMathParser.java @@ -40,6 +40,8 @@ /** * An abstraction over date math parsing to allow different implementation for joda and java time. + * + * @opensearch.internal */ public interface DateMathParser { diff --git a/server/src/main/java/org/opensearch/common/time/DateUtils.java b/server/src/main/java/org/opensearch/common/time/DateUtils.java index 4eec4e810af3b..021b8a3be8b23 100644 --- a/server/src/main/java/org/opensearch/common/time/DateUtils.java +++ b/server/src/main/java/org/opensearch/common/time/DateUtils.java @@ -51,6 +51,11 @@ import static org.opensearch.common.time.DateUtilsRounding.getYear; import static org.opensearch.common.time.DateUtilsRounding.utcMillisAtStartOfYear; +/** + * Date utilities. + * + * @opensearch.internal + */ public class DateUtils { public static DateTimeZone zoneIdToDateTimeZone(ZoneId zoneId) { if (zoneId == null) { diff --git a/server/src/main/java/org/opensearch/common/time/DateUtilsRounding.java b/server/src/main/java/org/opensearch/common/time/DateUtilsRounding.java index 4b0fa49b76687..f3459a5857b9e 100644 --- a/server/src/main/java/org/opensearch/common/time/DateUtilsRounding.java +++ b/server/src/main/java/org/opensearch/common/time/DateUtilsRounding.java @@ -42,6 +42,8 @@ * - org.joda.time.chrono.BasicChronology.getYear(int year) * - org.joda.time.chrono.BasicGJChronology.getMonthOfYear(long utcMillis, int year) * - org.joda.time.chrono.BasicGJChronology.getTotalMillisByYearMonth(int year, int month) + * + * @opensearch.internal */ class DateUtilsRounding { diff --git a/server/src/main/java/org/opensearch/common/time/EpochTime.java b/server/src/main/java/org/opensearch/common/time/EpochTime.java index 7894a653492c8..c80d95aad1283 100644 --- a/server/src/main/java/org/opensearch/common/time/EpochTime.java +++ b/server/src/main/java/org/opensearch/common/time/EpochTime.java @@ -55,6 +55,8 @@ * The milliseconds formatter is provided by {@link #MILLIS_FORMATTER}. *

* Both formatters support fractional time, up to nanosecond precision. + * + * @opensearch.internal */ class EpochTime { @@ -270,6 +272,11 @@ public long getFrom(TemporalAccessor temporal) { MILLISECONDS_FORMATTER2 ); + /** + * Base class for an epoch field + * + * @opensearch.internal + */ private abstract static class EpochField implements TemporalField { private final TemporalUnit baseUnit; diff --git a/server/src/main/java/org/opensearch/common/time/FormatNames.java b/server/src/main/java/org/opensearch/common/time/FormatNames.java index 4e1cfc5df87fc..ba0a8fcf4a17a 100644 --- a/server/src/main/java/org/opensearch/common/time/FormatNames.java +++ b/server/src/main/java/org/opensearch/common/time/FormatNames.java @@ -37,6 +37,11 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +/** + * Date format names. + * + * @opensearch.internal + */ public enum FormatNames { ISO8601(null, "iso8601"), BASIC_DATE("basicDate", "basic_date"), diff --git a/server/src/main/java/org/opensearch/common/time/IsoCalendarDataProvider.java b/server/src/main/java/org/opensearch/common/time/IsoCalendarDataProvider.java index f54bacc08f1f9..30a2cde37bbc1 100644 --- a/server/src/main/java/org/opensearch/common/time/IsoCalendarDataProvider.java +++ b/server/src/main/java/org/opensearch/common/time/IsoCalendarDataProvider.java @@ -41,6 +41,8 @@ * This class overrides default behaviour for Locale.ROOT (start of the week Sunday, minimum 1 day in the first week of the year). * Java SPI mechanism requires java.locale.providers to contain SPI value (i.e. java.locale.providers=SPI,COMPAT) * @see ISO week date + * + * @opensearch.internal */ public class IsoCalendarDataProvider extends CalendarDataProvider { diff --git a/server/src/main/java/org/opensearch/common/time/JavaDateFormatter.java b/server/src/main/java/org/opensearch/common/time/JavaDateFormatter.java index 289dd0fe1ea29..f9eeab38b2848 100644 --- a/server/src/main/java/org/opensearch/common/time/JavaDateFormatter.java +++ b/server/src/main/java/org/opensearch/common/time/JavaDateFormatter.java @@ -73,6 +73,11 @@ class JavaDateFormatter implements DateFormatter { private final List parsers; private final JavaDateFormatter roundupParser; + /** + * A round up formatter + * + * @opensearch.internal + */ static class RoundUpFormatter extends JavaDateFormatter { RoundUpFormatter(String format, List roundUpParsers) { diff --git a/server/src/main/java/org/opensearch/common/time/JavaDateMathParser.java b/server/src/main/java/org/opensearch/common/time/JavaDateMathParser.java index 87119002b070e..1110d07693c85 100644 --- a/server/src/main/java/org/opensearch/common/time/JavaDateMathParser.java +++ b/server/src/main/java/org/opensearch/common/time/JavaDateMathParser.java @@ -55,6 +55,8 @@ * The format of the datetime is configurable, and unix timestamps can also be used. Datemath * is appended to a datetime with the following syntax: * ||[+-/](\d+)?[yMwdhHms]. + * + * @opensearch.internal */ public class JavaDateMathParser implements DateMathParser { diff --git a/server/src/main/java/org/opensearch/common/transport/BoundTransportAddress.java b/server/src/main/java/org/opensearch/common/transport/BoundTransportAddress.java index a6aae5674615b..2a131c6704724 100644 --- a/server/src/main/java/org/opensearch/common/transport/BoundTransportAddress.java +++ b/server/src/main/java/org/opensearch/common/transport/BoundTransportAddress.java @@ -43,6 +43,8 @@ * A bounded transport address is a tuple of {@link TransportAddress}, one array that represents * the addresses the transport is bound to, and the other is the published one that represents the address clients * should communicate on. + * + * @opensearch.internal */ public class BoundTransportAddress implements Writeable { diff --git a/server/src/main/java/org/opensearch/common/transport/NetworkExceptionHelper.java b/server/src/main/java/org/opensearch/common/transport/NetworkExceptionHelper.java index c950749b4979d..72f8146cb969d 100644 --- a/server/src/main/java/org/opensearch/common/transport/NetworkExceptionHelper.java +++ b/server/src/main/java/org/opensearch/common/transport/NetworkExceptionHelper.java @@ -35,6 +35,11 @@ import java.net.ConnectException; import java.nio.channels.ClosedChannelException; +/** + * Helper class for network exceptions. + * + * @opensearch.internal + */ public class NetworkExceptionHelper { public static boolean isConnectException(Throwable e) { diff --git a/server/src/main/java/org/opensearch/common/transport/PortsRange.java b/server/src/main/java/org/opensearch/common/transport/PortsRange.java index c2f164680463a..c3ab5084e6e01 100644 --- a/server/src/main/java/org/opensearch/common/transport/PortsRange.java +++ b/server/src/main/java/org/opensearch/common/transport/PortsRange.java @@ -36,6 +36,11 @@ import java.util.StringTokenizer; +/** + * Port range utility classes + * + * @opensearch.internal + */ public class PortsRange { private final String portRange; diff --git a/server/src/main/java/org/opensearch/common/transport/TransportAddress.java b/server/src/main/java/org/opensearch/common/transport/TransportAddress.java index 3efdfb1f97681..666962e9aeb7b 100644 --- a/server/src/main/java/org/opensearch/common/transport/TransportAddress.java +++ b/server/src/main/java/org/opensearch/common/transport/TransportAddress.java @@ -46,6 +46,8 @@ /** * A transport address used for IP socket address (wraps {@link java.net.InetSocketAddress}). + * + * @opensearch.internal */ public final class TransportAddress implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/common/unit/ByteSizeUnit.java b/server/src/main/java/org/opensearch/common/unit/ByteSizeUnit.java index 1552833fe5694..0a407bb3fe4bc 100644 --- a/server/src/main/java/org/opensearch/common/unit/ByteSizeUnit.java +++ b/server/src/main/java/org/opensearch/common/unit/ByteSizeUnit.java @@ -44,6 +44,8 @@ * A {@code SizeUnit} does not maintain size information, but only * helps organize and use size representations that may be maintained * separately across various contexts. + * + * @opensearch.internal */ public enum ByteSizeUnit implements Writeable { BYTES { diff --git a/server/src/main/java/org/opensearch/common/unit/ByteSizeValue.java b/server/src/main/java/org/opensearch/common/unit/ByteSizeValue.java index 4f58abc64e495..b8aca01e3058d 100644 --- a/server/src/main/java/org/opensearch/common/unit/ByteSizeValue.java +++ b/server/src/main/java/org/opensearch/common/unit/ByteSizeValue.java @@ -47,12 +47,19 @@ import java.util.Locale; import java.util.Objects; +/** + * A byte size value + * + * @opensearch.internal + */ public class ByteSizeValue implements Writeable, Comparable, ToXContentFragment { /** * We have to lazy initialize the deprecation logger as otherwise a static logger here would be constructed before logging is configured * leading to a runtime failure (see {@link LogConfigurator#checkErrorListener()} ). The premature construction would come from any * {@link ByteSizeValue} object constructed in, for example, settings in {@link NetworkService}. + * + * @opensearch.internal */ static class DeprecationLoggerHolder { static DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(ByteSizeValue.class); diff --git a/server/src/main/java/org/opensearch/common/unit/DistanceUnit.java b/server/src/main/java/org/opensearch/common/unit/DistanceUnit.java index a4df3c6b5902d..0ca9dfe5f394e 100644 --- a/server/src/main/java/org/opensearch/common/unit/DistanceUnit.java +++ b/server/src/main/java/org/opensearch/common/unit/DistanceUnit.java @@ -45,6 +45,8 @@ * others. Some methods like {@link DistanceUnit#getEarthCircumference} refer to * the earth ellipsoid defined in {@link GeoUtils}. The default unit used within * this project is METERS which is defined by DEFAULT + * + * @opensearch.internal */ public enum DistanceUnit implements Writeable { INCH(0.0254, "in", "inch"), @@ -225,6 +227,8 @@ public static DistanceUnit parseUnit(String distance, DistanceUnit defaultUnit) /** * This class implements a value+unit tuple. + * + * @opensearch.internal */ public static class Distance implements Comparable { public final double value; diff --git a/server/src/main/java/org/opensearch/common/unit/Fuzziness.java b/server/src/main/java/org/opensearch/common/unit/Fuzziness.java index 8b10d88235142..c3b6ea6b8c23d 100644 --- a/server/src/main/java/org/opensearch/common/unit/Fuzziness.java +++ b/server/src/main/java/org/opensearch/common/unit/Fuzziness.java @@ -48,6 +48,8 @@ * A unit class that encapsulates all in-exact search * parsing and conversion from similarities to edit distances * etc. + * + * @opensearch.internal */ public final class Fuzziness implements ToXContentFragment, Writeable { diff --git a/server/src/main/java/org/opensearch/common/unit/MemorySizeValue.java b/server/src/main/java/org/opensearch/common/unit/MemorySizeValue.java index ef212762c3ffe..18aae6277c379 100644 --- a/server/src/main/java/org/opensearch/common/unit/MemorySizeValue.java +++ b/server/src/main/java/org/opensearch/common/unit/MemorySizeValue.java @@ -39,7 +39,11 @@ import static org.opensearch.common.unit.ByteSizeValue.parseBytesSizeValue; -/** Utility methods to get memory sizes. */ +/** + * Utility methods to get memory sizes. + * + * @opensearch.internal + */ public enum MemorySizeValue { ; diff --git a/server/src/main/java/org/opensearch/common/unit/RatioValue.java b/server/src/main/java/org/opensearch/common/unit/RatioValue.java index 00cd999ed6264..7f1840dae0fc7 100644 --- a/server/src/main/java/org/opensearch/common/unit/RatioValue.java +++ b/server/src/main/java/org/opensearch/common/unit/RatioValue.java @@ -36,6 +36,8 @@ /** * Utility class to represent ratio and percentage values between 0 and 100 + * + * @opensearch.internal */ public class RatioValue { private final double percent; diff --git a/server/src/main/java/org/opensearch/common/unit/SizeUnit.java b/server/src/main/java/org/opensearch/common/unit/SizeUnit.java index 8ceb0bc9f5360..a9491ef1919ed 100644 --- a/server/src/main/java/org/opensearch/common/unit/SizeUnit.java +++ b/server/src/main/java/org/opensearch/common/unit/SizeUnit.java @@ -32,6 +32,11 @@ package org.opensearch.common.unit; +/** + * Utility classe for size units. + * + * @opensearch.internal + */ public enum SizeUnit { SINGLE { @Override diff --git a/server/src/main/java/org/opensearch/common/unit/SizeValue.java b/server/src/main/java/org/opensearch/common/unit/SizeValue.java index 1a644823d3dd9..bebb3fdf2a895 100644 --- a/server/src/main/java/org/opensearch/common/unit/SizeValue.java +++ b/server/src/main/java/org/opensearch/common/unit/SizeValue.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Conversion values. + * + * @opensearch.internal + */ public class SizeValue implements Writeable, Comparable { private final long size; diff --git a/server/src/main/java/org/opensearch/common/util/AbstractArray.java b/server/src/main/java/org/opensearch/common/util/AbstractArray.java index 3833b479c946f..c3560ec1e8665 100644 --- a/server/src/main/java/org/opensearch/common/util/AbstractArray.java +++ b/server/src/main/java/org/opensearch/common/util/AbstractArray.java @@ -38,6 +38,11 @@ import java.util.Collections; import java.util.concurrent.atomic.AtomicBoolean; +/** + * Base array + * + * @opensearch.internal + */ abstract class AbstractArray implements BigArray { private final BigArrays bigArrays; diff --git a/server/src/main/java/org/opensearch/common/util/AbstractBigArray.java b/server/src/main/java/org/opensearch/common/util/AbstractBigArray.java index 4b18ebba81045..e8fd3990befa8 100644 --- a/server/src/main/java/org/opensearch/common/util/AbstractBigArray.java +++ b/server/src/main/java/org/opensearch/common/util/AbstractBigArray.java @@ -40,7 +40,11 @@ import java.lang.reflect.Array; import java.util.Arrays; -/** Common implementation for array lists that slice data into fixed-size blocks. */ +/** + * Common implementation for array lists that slice data into fixed-size blocks. + * + * @opensearch.internal + */ abstract class AbstractBigArray extends AbstractArray { private final PageCacheRecycler recycler; diff --git a/server/src/main/java/org/opensearch/common/util/AbstractHash.java b/server/src/main/java/org/opensearch/common/util/AbstractHash.java index edf4d93ef410a..ce12a4f5d1bf2 100644 --- a/server/src/main/java/org/opensearch/common/util/AbstractHash.java +++ b/server/src/main/java/org/opensearch/common/util/AbstractHash.java @@ -37,6 +37,8 @@ /** * Base implementation for {@link BytesRefHash} and {@link LongHash}, or any class that * needs to map values to dense ords. This class is not thread-safe. + * + * @opensearch.internal */ // IDs are internally stored as id + 1 so that 0 encodes for an empty slot abstract class AbstractHash extends AbstractPagedHashMap { diff --git a/server/src/main/java/org/opensearch/common/util/AbstractPagedHashMap.java b/server/src/main/java/org/opensearch/common/util/AbstractPagedHashMap.java index bc76bfa52404d..1ff3038297008 100644 --- a/server/src/main/java/org/opensearch/common/util/AbstractPagedHashMap.java +++ b/server/src/main/java/org/opensearch/common/util/AbstractPagedHashMap.java @@ -37,6 +37,8 @@ /** * Base implementation for a hash table that is paged, recycles arrays and grows in-place. + * + * @opensearch.internal */ abstract class AbstractPagedHashMap implements Releasable { diff --git a/server/src/main/java/org/opensearch/common/util/ArrayUtils.java b/server/src/main/java/org/opensearch/common/util/ArrayUtils.java index ccd6a51ff505d..6a01d9b3901e5 100644 --- a/server/src/main/java/org/opensearch/common/util/ArrayUtils.java +++ b/server/src/main/java/org/opensearch/common/util/ArrayUtils.java @@ -35,6 +35,11 @@ import java.lang.reflect.Array; import java.util.Arrays; +/** + * Array utilities. + * + * @opensearch.internal + */ public class ArrayUtils { private ArrayUtils() {} diff --git a/server/src/main/java/org/opensearch/common/util/BigArray.java b/server/src/main/java/org/opensearch/common/util/BigArray.java index c71b3da9ef14c..f6cac6374bbeb 100644 --- a/server/src/main/java/org/opensearch/common/util/BigArray.java +++ b/server/src/main/java/org/opensearch/common/util/BigArray.java @@ -35,7 +35,11 @@ import org.apache.lucene.util.Accountable; import org.opensearch.common.lease.Releasable; -/** Base abstraction of an array. */ +/** + * Base abstraction of an array. + * + * @opensearch.internal + */ public interface BigArray extends Releasable, Accountable { /** Return the length of this array. */ diff --git a/server/src/main/java/org/opensearch/common/util/BigArrays.java b/server/src/main/java/org/opensearch/common/util/BigArrays.java index e877f75bd2a0f..b3a4a7d25d3f5 100644 --- a/server/src/main/java/org/opensearch/common/util/BigArrays.java +++ b/server/src/main/java/org/opensearch/common/util/BigArrays.java @@ -84,6 +84,11 @@ static boolean indexIsInt(long index) { return index == (int) index; } + /** + * Base array wrapper class + * + * @opensearch.internal + */ private abstract static class AbstractArrayWrapper extends AbstractArray implements BigArray { static final long SHALLOW_SIZE = RamUsageEstimator.shallowSizeOfInstance(ByteArrayWrapper.class); @@ -109,6 +114,11 @@ protected final void doClose() { } + /** + * Wraps a byte array + * + * @opensearch.internal + */ private static class ByteArrayWrapper extends AbstractArrayWrapper implements ByteArray { private final byte[] array; @@ -170,6 +180,11 @@ public byte[] array() { } } + /** + * Wraps an int array + * + * @opensearch.internal + */ private static class IntArrayWrapper extends AbstractArrayWrapper implements IntArray { private final int[] array; @@ -213,6 +228,11 @@ public void fill(long fromIndex, long toIndex, int value) { } + /** + * Wraps a long array + * + * @opensearch.internal + */ private static class LongArrayWrapper extends AbstractArrayWrapper implements LongArray { private final long[] array; @@ -255,6 +275,11 @@ public void fill(long fromIndex, long toIndex, long value) { } } + /** + * Wraps a double array + * + * @opensearch.internal + */ private static class DoubleArrayWrapper extends AbstractArrayWrapper implements DoubleArray { private final long[] array; @@ -298,6 +323,11 @@ public void fill(long fromIndex, long toIndex, double value) { } + /** + * Wraps a float array + * + * @opensearch.internal + */ private static class FloatArrayWrapper extends AbstractArrayWrapper implements FloatArray { private final int[] array; @@ -341,6 +371,11 @@ public void fill(long fromIndex, long toIndex, float value) { } + /** + * Wraps an object array + * + * @opensearch.internal + */ private static class ObjectArrayWrapper extends AbstractArrayWrapper implements ObjectArray { private final Object[] array; @@ -716,6 +751,11 @@ public DoubleArray grow(DoubleArray array, long minSize) { return resize(array, newSize); } + /** + * A double value binary searcher + * + * @opensearch.internal + */ public static class DoubleBinarySearcher extends BinarySearcher { DoubleArray array; diff --git a/server/src/main/java/org/opensearch/common/util/BigByteArray.java b/server/src/main/java/org/opensearch/common/util/BigByteArray.java index 6dac5ec705ad2..db1d1014ffed2 100644 --- a/server/src/main/java/org/opensearch/common/util/BigByteArray.java +++ b/server/src/main/java/org/opensearch/common/util/BigByteArray.java @@ -43,6 +43,8 @@ /** * Byte array abstraction able to support more than 2B values. This implementation slices data into fixed-sized blocks of * configurable length. + * + * @opensearch.internal */ final class BigByteArray extends AbstractBigArray implements ByteArray { diff --git a/server/src/main/java/org/opensearch/common/util/BigDoubleArray.java b/server/src/main/java/org/opensearch/common/util/BigDoubleArray.java index ad75f13c80a8c..c66b0720d0a85 100644 --- a/server/src/main/java/org/opensearch/common/util/BigDoubleArray.java +++ b/server/src/main/java/org/opensearch/common/util/BigDoubleArray.java @@ -42,6 +42,8 @@ /** * Double array abstraction able to support more than 2B values. This implementation slices data into fixed-sized blocks of * configurable length. + * + * @opensearch.internal */ final class BigDoubleArray extends AbstractBigArray implements DoubleArray { diff --git a/server/src/main/java/org/opensearch/common/util/BigFloatArray.java b/server/src/main/java/org/opensearch/common/util/BigFloatArray.java index 5935e02f9a920..028248c3cc961 100644 --- a/server/src/main/java/org/opensearch/common/util/BigFloatArray.java +++ b/server/src/main/java/org/opensearch/common/util/BigFloatArray.java @@ -42,6 +42,8 @@ /** * Float array abstraction able to support more than 2B values. This implementation slices data into fixed-sized blocks of * configurable length. + * + * @opensearch.internal */ final class BigFloatArray extends AbstractBigArray implements FloatArray { diff --git a/server/src/main/java/org/opensearch/common/util/BigIntArray.java b/server/src/main/java/org/opensearch/common/util/BigIntArray.java index d403d99e285c9..03ae3e642df3d 100644 --- a/server/src/main/java/org/opensearch/common/util/BigIntArray.java +++ b/server/src/main/java/org/opensearch/common/util/BigIntArray.java @@ -42,6 +42,8 @@ /** * Int array abstraction able to support more than 2B values. This implementation slices data into fixed-sized blocks of * configurable length. + * + * @opensearch.internal */ final class BigIntArray extends AbstractBigArray implements IntArray { diff --git a/server/src/main/java/org/opensearch/common/util/BigLongArray.java b/server/src/main/java/org/opensearch/common/util/BigLongArray.java index 23a72706fccdd..19f954eca2d64 100644 --- a/server/src/main/java/org/opensearch/common/util/BigLongArray.java +++ b/server/src/main/java/org/opensearch/common/util/BigLongArray.java @@ -42,6 +42,8 @@ /** * Long array abstraction able to support more than 2B values. This implementation slices data into fixed-sized blocks of * configurable length. + * + * @opensearch.internal */ final class BigLongArray extends AbstractBigArray implements LongArray { diff --git a/server/src/main/java/org/opensearch/common/util/BigObjectArray.java b/server/src/main/java/org/opensearch/common/util/BigObjectArray.java index c90e74efb1672..6fb5662686a34 100644 --- a/server/src/main/java/org/opensearch/common/util/BigObjectArray.java +++ b/server/src/main/java/org/opensearch/common/util/BigObjectArray.java @@ -42,6 +42,8 @@ /** * Int array abstraction able to support more than 2B values. This implementation slices data into fixed-sized blocks of * configurable length. + * + * @opensearch.internal */ final class BigObjectArray extends AbstractBigArray implements ObjectArray { diff --git a/server/src/main/java/org/opensearch/common/util/BinarySearcher.java b/server/src/main/java/org/opensearch/common/util/BinarySearcher.java index 5807fc192ab62..ca63c170c0ccd 100644 --- a/server/src/main/java/org/opensearch/common/util/BinarySearcher.java +++ b/server/src/main/java/org/opensearch/common/util/BinarySearcher.java @@ -43,6 +43,8 @@ * Refer to {@link BigArrays.DoubleBinarySearcher} for an example. * * NOTE: this class is not thread safe + * + * @opensearch.internal */ public abstract class BinarySearcher { diff --git a/server/src/main/java/org/opensearch/common/util/BitArray.java b/server/src/main/java/org/opensearch/common/util/BitArray.java index 57ad5ae326c03..b75a5d07e70d7 100644 --- a/server/src/main/java/org/opensearch/common/util/BitArray.java +++ b/server/src/main/java/org/opensearch/common/util/BitArray.java @@ -40,6 +40,8 @@ * created from {@link BigArrays}. * The underlying long array grows lazily based on the biggest index * that needs to be set. + * + * @opensearch.internal */ public final class BitArray implements Releasable { private final BigArrays bigArrays; diff --git a/server/src/main/java/org/opensearch/common/util/ByteArray.java b/server/src/main/java/org/opensearch/common/util/ByteArray.java index 0b360148ddc01..44deb7f4fdb5a 100644 --- a/server/src/main/java/org/opensearch/common/util/ByteArray.java +++ b/server/src/main/java/org/opensearch/common/util/ByteArray.java @@ -38,6 +38,8 @@ /** * Abstraction of an array of byte values. + * + * @opensearch.internal */ public interface ByteArray extends BigArray { diff --git a/server/src/main/java/org/opensearch/common/util/ByteUtils.java b/server/src/main/java/org/opensearch/common/util/ByteUtils.java index b0054bc1a06b7..36ae3b1f5bcaa 100644 --- a/server/src/main/java/org/opensearch/common/util/ByteUtils.java +++ b/server/src/main/java/org/opensearch/common/util/ByteUtils.java @@ -32,8 +32,12 @@ package org.opensearch.common.util; -/** Utility methods to do byte-level encoding. These methods are biased towards little-endian byte order because it is the most - * common byte order and reading several bytes at once may be optimizable in the future with the help of sun.mist.Unsafe. */ +/** + * Utility methods to do byte-level encoding. These methods are biased towards little-endian byte order because it is the most + * common byte order and reading several bytes at once may be optimizable in the future with the help of sun.mist.Unsafe. + * + * @opensearch.internal + */ public final class ByteUtils { private ByteUtils() {}; diff --git a/server/src/main/java/org/opensearch/common/util/BytesRefHash.java b/server/src/main/java/org/opensearch/common/util/BytesRefHash.java index 5de58016de372..eb44b30a7e36c 100644 --- a/server/src/main/java/org/opensearch/common/util/BytesRefHash.java +++ b/server/src/main/java/org/opensearch/common/util/BytesRefHash.java @@ -43,6 +43,8 @@ * probing, growth is smooth thanks to {@link BigArrays}, hashes are cached for faster * re-hashing and capacity is always a multiple of 2 for faster identification of buckets. * This class is not thread-safe. + * + * @opensearch.internal */ public final class BytesRefHash extends AbstractHash { diff --git a/server/src/main/java/org/opensearch/common/util/CachedSupplier.java b/server/src/main/java/org/opensearch/common/util/CachedSupplier.java index 647ef46f7a890..f81e57d9fbad6 100644 --- a/server/src/main/java/org/opensearch/common/util/CachedSupplier.java +++ b/server/src/main/java/org/opensearch/common/util/CachedSupplier.java @@ -38,6 +38,8 @@ * A {@link Supplier} that caches its return value. This may be useful to make * a {@link Supplier} idempotent or for performance reasons if always returning * the same instance is acceptable. + * + * @opensearch.internal */ public final class CachedSupplier implements Supplier { diff --git a/server/src/main/java/org/opensearch/common/util/CancellableThreads.java b/server/src/main/java/org/opensearch/common/util/CancellableThreads.java index f9cb8cc2d60f5..d52d717865dbf 100644 --- a/server/src/main/java/org/opensearch/common/util/CancellableThreads.java +++ b/server/src/main/java/org/opensearch/common/util/CancellableThreads.java @@ -47,6 +47,8 @@ * of cancellation. * * Cancellation policy: This class does not support external interruption via Thread#interrupt(). Always use #cancel() instead. + * + * @opensearch.internal */ public class CancellableThreads { private final Set threads = new HashSet<>(); @@ -186,6 +188,11 @@ public interface IOInterruptible { void run() throws IOException, InterruptedException; } + /** + * Thrown if there is an error cancelling execution + * + * @opensearch.internal + */ public static class ExecutionCancelledException extends OpenSearchException { public ExecutionCancelledException(String msg) { diff --git a/server/src/main/java/org/opensearch/common/util/CollectionUtils.java b/server/src/main/java/org/opensearch/common/util/CollectionUtils.java index 7817e7b29df9a..622efc2074d0a 100644 --- a/server/src/main/java/org/opensearch/common/util/CollectionUtils.java +++ b/server/src/main/java/org/opensearch/common/util/CollectionUtils.java @@ -57,7 +57,11 @@ import java.util.RandomAccess; import java.util.Set; -/** Collections-related utility methods. */ +/** + * Collections-related utility methods. + * + * @opensearch.internal + */ public class CollectionUtils { /** @@ -212,6 +216,11 @@ public static Map copyMap(Map map) { } } + /** + * A rotated list + * + * @opensearch.internal + */ private static class RotatedList extends AbstractList implements RandomAccess { private final List in; diff --git a/server/src/main/java/org/opensearch/common/util/CombinedRateLimiter.java b/server/src/main/java/org/opensearch/common/util/CombinedRateLimiter.java index 6fe67d378c273..451add56b255a 100644 --- a/server/src/main/java/org/opensearch/common/util/CombinedRateLimiter.java +++ b/server/src/main/java/org/opensearch/common/util/CombinedRateLimiter.java @@ -39,6 +39,8 @@ /** * A rate limiter designed for multiple concurrent users. + * + * @opensearch.internal */ public class CombinedRateLimiter { diff --git a/server/src/main/java/org/opensearch/common/util/Comparators.java b/server/src/main/java/org/opensearch/common/util/Comparators.java index 9a5f8d1849e8d..39e57dc5d16ab 100644 --- a/server/src/main/java/org/opensearch/common/util/Comparators.java +++ b/server/src/main/java/org/opensearch/common/util/Comparators.java @@ -36,6 +36,8 @@ /** * {@link Comparator}-related utility methods. + * + * @opensearch.internal */ public enum Comparators { ; diff --git a/server/src/main/java/org/opensearch/common/util/Countable.java b/server/src/main/java/org/opensearch/common/util/Countable.java index ee354421a8633..1adf6d2fb015c 100644 --- a/server/src/main/java/org/opensearch/common/util/Countable.java +++ b/server/src/main/java/org/opensearch/common/util/Countable.java @@ -32,6 +32,11 @@ package org.opensearch.common.util; +/** + * Base countable interface. + * + * @opensearch.internal + */ public interface Countable { int size(); } diff --git a/server/src/main/java/org/opensearch/common/util/CuckooFilter.java b/server/src/main/java/org/opensearch/common/util/CuckooFilter.java index e23b21936dfe3..8ef48c8d6e1a4 100644 --- a/server/src/main/java/org/opensearch/common/util/CuckooFilter.java +++ b/server/src/main/java/org/opensearch/common/util/CuckooFilter.java @@ -74,6 +74,8 @@ * Proceedings of the 10th ACM International on Conference on emerging Networking Experiments and Technologies. ACM, 2014. * * https://www.cs.cmu.edu/~dga/papers/cuckoo-conext2014.pdf + * + * @opensearch.internal */ public class CuckooFilter implements Writeable { diff --git a/server/src/main/java/org/opensearch/common/util/DoubleArray.java b/server/src/main/java/org/opensearch/common/util/DoubleArray.java index f047882c842a5..45e57085dcca4 100644 --- a/server/src/main/java/org/opensearch/common/util/DoubleArray.java +++ b/server/src/main/java/org/opensearch/common/util/DoubleArray.java @@ -34,6 +34,8 @@ /** * Abstraction of an array of double values. + * + * @opensearch.internal */ public interface DoubleArray extends BigArray { diff --git a/server/src/main/java/org/opensearch/common/util/FeatureFlags.java b/server/src/main/java/org/opensearch/common/util/FeatureFlags.java index 34c613f5423d0..0b31e3814667a 100644 --- a/server/src/main/java/org/opensearch/common/util/FeatureFlags.java +++ b/server/src/main/java/org/opensearch/common/util/FeatureFlags.java @@ -12,6 +12,8 @@ * Utility class to manage feature flags. Feature flags are system properties that must be set on the JVM. * These are used to gate the visibility/availability of incomplete features. Fore more information, see * https://featureflags.io/feature-flag-introduction/ + * + * @opensearch.internal */ public class FeatureFlags { diff --git a/server/src/main/java/org/opensearch/common/util/FloatArray.java b/server/src/main/java/org/opensearch/common/util/FloatArray.java index f1744fef83199..b402b8e81aa43 100644 --- a/server/src/main/java/org/opensearch/common/util/FloatArray.java +++ b/server/src/main/java/org/opensearch/common/util/FloatArray.java @@ -34,6 +34,8 @@ /** * Abstraction of an array of double values. + * + * @opensearch.internal */ public interface FloatArray extends BigArray { diff --git a/server/src/main/java/org/opensearch/common/util/IntArray.java b/server/src/main/java/org/opensearch/common/util/IntArray.java index 0beb5e12134ad..4a6e8fe5a6f95 100644 --- a/server/src/main/java/org/opensearch/common/util/IntArray.java +++ b/server/src/main/java/org/opensearch/common/util/IntArray.java @@ -34,6 +34,8 @@ /** * Abstraction of an array of integer values. + * + * @opensearch.internal */ public interface IntArray extends BigArray { diff --git a/server/src/main/java/org/opensearch/common/util/LazyInitializable.java b/server/src/main/java/org/opensearch/common/util/LazyInitializable.java index e302f22bd0aaa..98192796fb920 100644 --- a/server/src/main/java/org/opensearch/common/util/LazyInitializable.java +++ b/server/src/main/java/org/opensearch/common/util/LazyInitializable.java @@ -46,6 +46,8 @@ * {@link Consumer}. On {@code #reset()} the value will be passed to the * onReset {@code Consumer} and the next {@code #getOrCompute()} * will regenerate the value. + * + * @opensearch.internal */ public final class LazyInitializable { diff --git a/server/src/main/java/org/opensearch/common/util/LocaleUtils.java b/server/src/main/java/org/opensearch/common/util/LocaleUtils.java index 47617d198b6b6..c684b1b2d781f 100644 --- a/server/src/main/java/org/opensearch/common/util/LocaleUtils.java +++ b/server/src/main/java/org/opensearch/common/util/LocaleUtils.java @@ -38,6 +38,8 @@ /** * Utilities for for dealing with {@link Locale} objects + * + * @opensearch.internal */ public class LocaleUtils { diff --git a/server/src/main/java/org/opensearch/common/util/LongArray.java b/server/src/main/java/org/opensearch/common/util/LongArray.java index e88c27cb0e856..c794af8504398 100644 --- a/server/src/main/java/org/opensearch/common/util/LongArray.java +++ b/server/src/main/java/org/opensearch/common/util/LongArray.java @@ -34,6 +34,8 @@ /** * Abstraction of an array of long values. + * + * @opensearch.internal */ public interface LongArray extends BigArray { diff --git a/server/src/main/java/org/opensearch/common/util/LongHash.java b/server/src/main/java/org/opensearch/common/util/LongHash.java index 079577b1530a7..71272e79c65b3 100644 --- a/server/src/main/java/org/opensearch/common/util/LongHash.java +++ b/server/src/main/java/org/opensearch/common/util/LongHash.java @@ -40,6 +40,8 @@ * probing, growth is smooth thanks to {@link BigArrays} and capacity is always * a multiple of 2 for faster identification of buckets. * This class is not thread-safe. + * + * @opensearch.internal */ // IDs are internally stored as id + 1 so that 0 encodes for an empty slot public final class LongHash extends AbstractHash { diff --git a/server/src/main/java/org/opensearch/common/util/LongLongHash.java b/server/src/main/java/org/opensearch/common/util/LongLongHash.java index 33777ecc89fb6..1a720eae82a1d 100644 --- a/server/src/main/java/org/opensearch/common/util/LongLongHash.java +++ b/server/src/main/java/org/opensearch/common/util/LongLongHash.java @@ -42,6 +42,8 @@ * linear probing, growth is smooth thanks to {@link BigArrays} and capacity * is always a multiple of 2 for faster identification of buckets. * This class is not thread-safe. + * + * @opensearch.internal */ // IDs are internally stored as id + 1 so that 0 encodes for an empty slot public final class LongLongHash extends AbstractHash { diff --git a/server/src/main/java/org/opensearch/common/util/LongObjectPagedHashMap.java b/server/src/main/java/org/opensearch/common/util/LongObjectPagedHashMap.java index 9abd0c9d46682..9b8f9621fb9c1 100644 --- a/server/src/main/java/org/opensearch/common/util/LongObjectPagedHashMap.java +++ b/server/src/main/java/org/opensearch/common/util/LongObjectPagedHashMap.java @@ -40,6 +40,8 @@ /** * A hash table from native longs to objects. This implementation resolves collisions * using open-addressing and does not support null values. This class is not thread-safe. + * + * @opensearch.internal */ public class LongObjectPagedHashMap extends AbstractPagedHashMap implements Iterable> { diff --git a/server/src/main/java/org/opensearch/common/util/Maps.java b/server/src/main/java/org/opensearch/common/util/Maps.java index db99ec29d3a2d..08ee2375d1f94 100644 --- a/server/src/main/java/org/opensearch/common/util/Maps.java +++ b/server/src/main/java/org/opensearch/common/util/Maps.java @@ -35,6 +35,11 @@ import java.util.Map; import java.util.Objects; +/** + * Map utility class. + * + * @opensearch.internal + */ public class Maps { /** diff --git a/server/src/main/java/org/opensearch/common/util/ObjectArray.java b/server/src/main/java/org/opensearch/common/util/ObjectArray.java index 7663c53bb5175..142a722821e90 100644 --- a/server/src/main/java/org/opensearch/common/util/ObjectArray.java +++ b/server/src/main/java/org/opensearch/common/util/ObjectArray.java @@ -34,6 +34,8 @@ /** * Abstraction of an array of object values. + * + * @opensearch.internal */ public interface ObjectArray extends BigArray { diff --git a/server/src/main/java/org/opensearch/common/util/PageCacheRecycler.java b/server/src/main/java/org/opensearch/common/util/PageCacheRecycler.java index ae9555902c395..d0f660b9ac445 100644 --- a/server/src/main/java/org/opensearch/common/util/PageCacheRecycler.java +++ b/server/src/main/java/org/opensearch/common/util/PageCacheRecycler.java @@ -49,7 +49,11 @@ import static org.opensearch.common.recycler.Recyclers.dequeFactory; import static org.opensearch.common.recycler.Recyclers.none; -/** A recycler of fixed-size pages. */ +/** + * A recycler of fixed-size pages. + * + * @opensearch.internal + */ public class PageCacheRecycler { public static final Setting TYPE_SETTING = new Setting<>( diff --git a/server/src/main/java/org/opensearch/common/util/PlainIterator.java b/server/src/main/java/org/opensearch/common/util/PlainIterator.java index a84e8a064804d..fff8126f13e5d 100644 --- a/server/src/main/java/org/opensearch/common/util/PlainIterator.java +++ b/server/src/main/java/org/opensearch/common/util/PlainIterator.java @@ -36,6 +36,11 @@ import java.util.Iterator; import java.util.List; +/** + * A plain iterator + * + * @opensearch.internal + */ public class PlainIterator implements Iterable, Countable { private final List elements; diff --git a/server/src/main/java/org/opensearch/common/util/SetBackedScalingCuckooFilter.java b/server/src/main/java/org/opensearch/common/util/SetBackedScalingCuckooFilter.java index 474e33ccf29f1..c8e60bddb8d0f 100644 --- a/server/src/main/java/org/opensearch/common/util/SetBackedScalingCuckooFilter.java +++ b/server/src/main/java/org/opensearch/common/util/SetBackedScalingCuckooFilter.java @@ -61,6 +61,8 @@ *

* This datastructure scales as more values are inserted by growing the list of CuckooFilters. * Final size is dependent on the cardinality of data inserted, and the precision specified. + * + * @opensearch.internal */ public class SetBackedScalingCuckooFilter implements Writeable { diff --git a/server/src/main/java/org/opensearch/common/util/SingleObjectCache.java b/server/src/main/java/org/opensearch/common/util/SingleObjectCache.java index dafcff9dfd11d..c2c5613f0f301 100644 --- a/server/src/main/java/org/opensearch/common/util/SingleObjectCache.java +++ b/server/src/main/java/org/opensearch/common/util/SingleObjectCache.java @@ -39,6 +39,8 @@ /** * A very simple single object cache that allows non-blocking refresh calls * triggered by expiry time. + * + * @opensearch.internal */ public abstract class SingleObjectCache { diff --git a/server/src/main/java/org/opensearch/common/util/URIPattern.java b/server/src/main/java/org/opensearch/common/util/URIPattern.java index 2558374dda24b..a3c385e5ea660 100644 --- a/server/src/main/java/org/opensearch/common/util/URIPattern.java +++ b/server/src/main/java/org/opensearch/common/util/URIPattern.java @@ -44,6 +44,8 @@ * * For example: foobar://*.local/some_path/*?*#* will match all uris with schema foobar in local domain * with any port, with path that starts some_path and with any query and fragment. + * + * @opensearch.internal */ public class URIPattern { private final URI uriPattern; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/AbstractAsyncTask.java b/server/src/main/java/org/opensearch/common/util/concurrent/AbstractAsyncTask.java index 337fd59cfce7c..7c599476e263d 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/AbstractAsyncTask.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/AbstractAsyncTask.java @@ -43,6 +43,8 @@ /** * A base class for tasks that need to repeat. + * + * @opensearch.internal */ public abstract class AbstractAsyncTask implements Runnable, Closeable { diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/AbstractLifecycleRunnable.java b/server/src/main/java/org/opensearch/common/util/concurrent/AbstractLifecycleRunnable.java index c283c5c618390..b55280d43a473 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/AbstractLifecycleRunnable.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/AbstractLifecycleRunnable.java @@ -40,6 +40,8 @@ * {@code AbstractLifecycleRunnable} is a service-lifecycle aware {@link AbstractRunnable}. *

* This simplifies the running and rescheduling of {@link Lifecycle}-based {@code Runnable}s. + * + * @opensearch.internal */ public abstract class AbstractLifecycleRunnable extends AbstractRunnable { /** diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/AbstractRunnable.java b/server/src/main/java/org/opensearch/common/util/concurrent/AbstractRunnable.java index 446e563575e7d..3afeb10bcb9fa 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/AbstractRunnable.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/AbstractRunnable.java @@ -34,6 +34,8 @@ /** * An extension to runnable. + * + * @opensearch.internal */ public abstract class AbstractRunnable implements Runnable { diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/AsyncIOProcessor.java b/server/src/main/java/org/opensearch/common/util/concurrent/AsyncIOProcessor.java index d04982da32704..72cc0f5ee21d2 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/AsyncIOProcessor.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/AsyncIOProcessor.java @@ -49,6 +49,8 @@ * by a single worker. A worker in this context can be any caller of the {@link #put(Object, Consumer)} method since it will * hijack a worker if nobody else is currently processing queued items. If the internal queue has reached it's capacity incoming threads * might be blocked until other items are processed + * + * @opensearch.internal */ public abstract class AsyncIOProcessor { private final Logger logger; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/AtomicArray.java b/server/src/main/java/org/opensearch/common/util/concurrent/AtomicArray.java index efb8fce467a21..dd1f71a7d2166 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/AtomicArray.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/AtomicArray.java @@ -42,6 +42,8 @@ /** * A list backed by an {@link AtomicReferenceArray} with potential null values, easily allowing * to get the concrete values as a list using {@link #asList()}. + * + * @opensearch.internal */ public class AtomicArray { private final AtomicReferenceArray array; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/BaseFuture.java b/server/src/main/java/org/opensearch/common/util/concurrent/BaseFuture.java index 14c6c366f0bb9..fef37299b349d 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/BaseFuture.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/BaseFuture.java @@ -46,6 +46,11 @@ import java.util.concurrent.TimeoutException; import java.util.concurrent.locks.AbstractQueuedSynchronizer; +/** + * Base future class. + * + * @opensearch.internal + */ public abstract class BaseFuture implements Future { private static final String BLOCKING_OP_REASON = "Blocking operation"; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/ConcurrentCollections.java b/server/src/main/java/org/opensearch/common/util/concurrent/ConcurrentCollections.java index 758682fb9ff96..c646d476e17ab 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/ConcurrentCollections.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/ConcurrentCollections.java @@ -43,6 +43,11 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.LinkedTransferQueue; +/** + * Thread safe collection base class. + * + * @opensearch.internal + */ public abstract class ConcurrentCollections { static final int aggressiveConcurrencyLevel; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/ConcurrentHashMapLong.java b/server/src/main/java/org/opensearch/common/util/concurrent/ConcurrentHashMapLong.java index d93d55d106e6e..6ee1b0a38248a 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/ConcurrentHashMapLong.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/ConcurrentHashMapLong.java @@ -37,6 +37,11 @@ import java.util.Set; import java.util.concurrent.ConcurrentMap; +/** + * Thread safe hash map of longs. + * + * @opensearch.internal + */ public class ConcurrentHashMapLong implements ConcurrentMapLong { private final ConcurrentMap map; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/ConcurrentMapLong.java b/server/src/main/java/org/opensearch/common/util/concurrent/ConcurrentMapLong.java index fb1c752dd7a55..7656a957dc534 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/ConcurrentMapLong.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/ConcurrentMapLong.java @@ -34,6 +34,11 @@ import java.util.concurrent.ConcurrentMap; +/** + * Thread safe long value hash map + * + * @opensearch.internal + */ public interface ConcurrentMapLong extends ConcurrentMap { T get(long key); diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/CountDown.java b/server/src/main/java/org/opensearch/common/util/concurrent/CountDown.java index 23843b9e0c5bf..9dc67ab40dba2 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/CountDown.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/CountDown.java @@ -39,6 +39,8 @@ * A simple thread safe count-down class that in contrast to a {@link CountDownLatch} * never blocks. This class is useful if a certain action has to wait for N concurrent * tasks to return or a timeout to occur in order to proceed. + * + * @opensearch.internal */ public final class CountDown { diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/FutureUtils.java b/server/src/main/java/org/opensearch/common/util/concurrent/FutureUtils.java index 50ab3bccf6b90..83fdbf8790eba 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/FutureUtils.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/FutureUtils.java @@ -41,6 +41,11 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +/** + * Future utilities. + * + * @opensearch.internal + */ public class FutureUtils { /** diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/KeyedLock.java b/server/src/main/java/org/opensearch/common/util/concurrent/KeyedLock.java index 5b2cb6c2312fe..9d4235f8d8a1a 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/KeyedLock.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/KeyedLock.java @@ -46,7 +46,8 @@ * infinitely. * Note: this lock is reentrant * - * */ + * @opensearch.internal + */ public final class KeyedLock { private final ConcurrentMap map = ConcurrentCollections.newConcurrentMapWithAggressiveConcurrency(); diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/ListenableFuture.java b/server/src/main/java/org/opensearch/common/util/concurrent/ListenableFuture.java index ce6fa0e46d0c0..cc865022e1e8a 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/ListenableFuture.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/ListenableFuture.java @@ -50,6 +50,8 @@ * for execution in the provided {@link ExecutorService}. If the computation has already * been performed, a request to add a listener will simply result in execution of the listener * on the calling thread. + * + * @opensearch.internal */ public final class ListenableFuture extends BaseFuture implements ActionListener { diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchAbortPolicy.java b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchAbortPolicy.java index aa13d1d8f5cb5..fc9a179083f59 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchAbortPolicy.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchAbortPolicy.java @@ -37,6 +37,11 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.ThreadPoolExecutor; +/** + * OpenSearch abortion policies. + * + * @opensearch.internal + */ public class OpenSearchAbortPolicy implements XRejectedExecutionHandler { private final CounterMetric rejected = new CounterMetric(); diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchExecutors.java b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchExecutors.java index 5a967528a6ae2..094a356151b78 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchExecutors.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchExecutors.java @@ -57,6 +57,11 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; +/** + * Executors. + * + * @opensearch.internal + */ public class OpenSearchExecutors { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(OpenSearchExecutors.class); @@ -337,6 +342,11 @@ public static ThreadFactory daemonThreadFactory(String namePrefix) { return new OpenSearchThreadFactory(namePrefix); } + /** + * A thread factory + * + * @opensearch.internal + */ static class OpenSearchThreadFactory implements ThreadFactory { final ThreadGroup group; @@ -363,6 +373,11 @@ public Thread newThread(Runnable r) { */ private OpenSearchExecutors() {} + /** + * A scaling queue for executors + * + * @opensearch.internal + */ static class ExecutorScalingQueue extends LinkedTransferQueue { ThreadPoolExecutor executor; @@ -396,6 +411,8 @@ public boolean offer(E e) { /** * A handler for rejected tasks that adds the specified element to this queue, * waiting if necessary for space to become available. + * + * @opensearch.internal */ static class ForceQueuePolicy implements XRejectedExecutionHandler { diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchRejectedExecutionException.java b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchRejectedExecutionException.java index aee5bc63d9dbc..74b5e477c36ee 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchRejectedExecutionException.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchRejectedExecutionException.java @@ -34,6 +34,11 @@ import java.util.concurrent.RejectedExecutionException; +/** + * Thrown when an execution is rejected + * + * @opensearch.internal + */ public class OpenSearchRejectedExecutionException extends RejectedExecutionException { private final boolean isExecutorShutdown; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchThreadPoolExecutor.java b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchThreadPoolExecutor.java index a04554f9b029c..2ebf8a1cc970c 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchThreadPoolExecutor.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchThreadPoolExecutor.java @@ -42,6 +42,8 @@ /** * An extension to thread pool executor, allowing (in the future) to add specific additional stats to it. + * + * @opensearch.internal */ public class OpenSearchThreadPoolExecutor extends ThreadPoolExecutor { diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/PrioritizedCallable.java b/server/src/main/java/org/opensearch/common/util/concurrent/PrioritizedCallable.java index 93250eea8e75b..806a6e11606df 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/PrioritizedCallable.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/PrioritizedCallable.java @@ -35,6 +35,11 @@ import java.util.concurrent.Callable; +/** + * A prioritized callable. + * + * @opensearch.internal + */ public abstract class PrioritizedCallable implements Callable, Comparable { private final Priority priority; @@ -56,6 +61,11 @@ public Priority priority() { return priority; } + /** + * Wrapped generic + * + * @opensearch.internal + */ static class Wrapped extends PrioritizedCallable { private final Callable callable; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/PrioritizedOpenSearchThreadPoolExecutor.java b/server/src/main/java/org/opensearch/common/util/concurrent/PrioritizedOpenSearchThreadPoolExecutor.java index 797d476017005..d3d0f6080e7f6 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/PrioritizedOpenSearchThreadPoolExecutor.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/PrioritizedOpenSearchThreadPoolExecutor.java @@ -53,6 +53,8 @@ * be wrapped and assign a default {@link Priority#NORMAL} priority. *

* Note, if two tasks have the same priority, the first to arrive will be executed first (FIFO style). + * + * @opensearch.internal */ public class PrioritizedOpenSearchThreadPoolExecutor extends OpenSearchThreadPoolExecutor { @@ -198,6 +200,11 @@ protected RunnableFuture newTaskFor(Callable callable) { return new PrioritizedFutureTask<>((PrioritizedCallable) callable, insertionOrder.incrementAndGet()); } + /** + * A pending thread + * + * @opensearch.internal + */ public static class Pending { public final Object task; public final Priority priority; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/PrioritizedRunnable.java b/server/src/main/java/org/opensearch/common/util/concurrent/PrioritizedRunnable.java index 8a932b799eee6..96a74e44a576a 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/PrioritizedRunnable.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/PrioritizedRunnable.java @@ -36,6 +36,11 @@ import java.util.concurrent.TimeUnit; import java.util.function.LongSupplier; +/** + * A base prioritized runnable + * + * @opensearch.internal + */ public abstract class PrioritizedRunnable implements Runnable, Comparable { private final Priority priority; @@ -82,6 +87,11 @@ public Priority priority() { return priority; } + /** + * Wrapped runnable + * + * @opensearch.internal + */ static class Wrapped extends PrioritizedRunnable implements WrappedRunnable { private final Runnable runnable; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/QueueResizingOpenSearchThreadPoolExecutor.java b/server/src/main/java/org/opensearch/common/util/concurrent/QueueResizingOpenSearchThreadPoolExecutor.java index 39561039c5c6f..94306906d8c1e 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/QueueResizingOpenSearchThreadPoolExecutor.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/QueueResizingOpenSearchThreadPoolExecutor.java @@ -48,6 +48,8 @@ /** * An extension to thread pool executor, which automatically adjusts the queue size of the * {@code ResizableBlockingQueue} according to Little's Law. + * + * @opensearch.internal */ public final class QueueResizingOpenSearchThreadPoolExecutor extends OpenSearchThreadPoolExecutor { diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/ReleasableLock.java b/server/src/main/java/org/opensearch/common/util/concurrent/ReleasableLock.java index afa793b009f15..e1aa6bd5d169a 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/ReleasableLock.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/ReleasableLock.java @@ -41,6 +41,8 @@ /** * Releasable lock used inside of Engine implementations + * + * @opensearch.internal */ public class ReleasableLock implements Releasable { private final Lock lock; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/ResizableBlockingQueue.java b/server/src/main/java/org/opensearch/common/util/concurrent/ResizableBlockingQueue.java index bf8a9c86870fa..7ef40ba2f086e 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/ResizableBlockingQueue.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/ResizableBlockingQueue.java @@ -37,6 +37,8 @@ /** * Extends the {@code SizeBlockingQueue} to add the {@code adjustCapacity} method, which will adjust * the capacity by a certain amount towards a maximum or minimum. + * + * @opensearch.internal */ final class ResizableBlockingQueue extends SizeBlockingQueue { diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/RunOnce.java b/server/src/main/java/org/opensearch/common/util/concurrent/RunOnce.java index a2bb53ad909fb..5539b5efa4a1c 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/RunOnce.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/RunOnce.java @@ -36,6 +36,8 @@ /** * Runnable that can only be run one time. + * + * @opensearch.internal */ public class RunOnce implements Runnable { diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/SizeBlockingQueue.java b/server/src/main/java/org/opensearch/common/util/concurrent/SizeBlockingQueue.java index d2d50eb95edb1..ad790b8dbd418 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/SizeBlockingQueue.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/SizeBlockingQueue.java @@ -43,6 +43,8 @@ * A size based queue wrapping another blocking queue to provide (somewhat relaxed) capacity checks. * Mainly makes sense to use with blocking queues that are unbounded to provide the ability to do * capacity verification. + * + * @opensearch.internal */ public class SizeBlockingQueue extends AbstractQueue implements BlockingQueue { diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContext.java b/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContext.java index d844a8f158ea4..02a3b24e028a8 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContext.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContext.java @@ -94,6 +94,7 @@ * // previous context is restored on StoredContext#close() * * + * @opensearch.internal */ public final class ThreadContext implements Writeable { @@ -805,6 +806,11 @@ public AbstractRunnable unwrap() { private static final Collector, Set> LINKED_HASH_SET_COLLECTOR = new LinkedHashSetCollector<>(); + /** + * Collector based on a linked hash set + * + * @opensearch.internal + */ private static class LinkedHashSetCollector implements Collector, Set> { @Override public Supplier> supplier() { diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/TimedRunnable.java b/server/src/main/java/org/opensearch/common/util/concurrent/TimedRunnable.java index 8aa14d556e8e2..f3bc50a33453b 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/TimedRunnable.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/TimedRunnable.java @@ -37,6 +37,8 @@ /** * A class used to wrap a {@code Runnable} that allows capturing the time of the task since creation * through execution as well as only execution time. + * + * @opensearch.internal */ class TimedRunnable extends AbstractRunnable implements WrappedRunnable { private final Runnable original; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/UncategorizedExecutionException.java b/server/src/main/java/org/opensearch/common/util/concurrent/UncategorizedExecutionException.java index 85f8de915e339..5d99a346f6fb0 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/UncategorizedExecutionException.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/UncategorizedExecutionException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Thrown when an uncategorized error occurs. + * + * @opensearch.internal + */ public class UncategorizedExecutionException extends OpenSearchException { public UncategorizedExecutionException(String msg, Throwable cause) { diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/WrappedRunnable.java b/server/src/main/java/org/opensearch/common/util/concurrent/WrappedRunnable.java index ee4fe31ffa0b7..9763786ff4aae 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/WrappedRunnable.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/WrappedRunnable.java @@ -31,6 +31,11 @@ package org.opensearch.common.util.concurrent; +/** + * A wrapped runnable. + * + * @opensearch.internal + */ public interface WrappedRunnable extends Runnable { Runnable unwrap(); } diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/XRejectedExecutionHandler.java b/server/src/main/java/org/opensearch/common/util/concurrent/XRejectedExecutionHandler.java index 51d30a7312f8c..c56910348c13b 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/XRejectedExecutionHandler.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/XRejectedExecutionHandler.java @@ -34,6 +34,11 @@ import java.util.concurrent.RejectedExecutionHandler; +/** + * Base handler for rejected executions. + * + * @opensearch.internal + */ public interface XRejectedExecutionHandler extends RejectedExecutionHandler { /** diff --git a/server/src/main/java/org/opensearch/common/util/iterable/Iterables.java b/server/src/main/java/org/opensearch/common/util/iterable/Iterables.java index 788386e9d156c..e3f13fef37a7e 100644 --- a/server/src/main/java/org/opensearch/common/util/iterable/Iterables.java +++ b/server/src/main/java/org/opensearch/common/util/iterable/Iterables.java @@ -40,6 +40,11 @@ import java.util.stream.Stream; import java.util.stream.StreamSupport; +/** + * Iterables. + * + * @opensearch.internal + */ public class Iterables { public static Iterable concat(Iterable... inputs) { @@ -47,6 +52,11 @@ public static Iterable concat(Iterable... inputs) { return new ConcatenatedIterable<>(inputs); } + /** + * Concatenated interable + * + * @opensearch.internal + */ static class ConcatenatedIterable implements Iterable { private final Iterable[] inputs; @@ -71,6 +81,11 @@ public static Iterable flatten(Iterable> inputs) { return new FlattenedIterables<>(inputs); } + /** + * A flattened iterable + * + * @opensearch.internal + */ static class FlattenedIterables implements Iterable { private final Iterable> inputs; diff --git a/server/src/main/java/org/opensearch/common/util/set/Sets.java b/server/src/main/java/org/opensearch/common/util/set/Sets.java index 1d7175ad424b2..2dc2fb3175d27 100644 --- a/server/src/main/java/org/opensearch/common/util/set/Sets.java +++ b/server/src/main/java/org/opensearch/common/util/set/Sets.java @@ -49,6 +49,11 @@ import java.util.stream.Collector; import java.util.stream.Collectors; +/** + * OpenSearch sets. + * + * @opensearch.internal + */ public final class Sets { private Sets() {} @@ -114,6 +119,11 @@ public static SortedSet sortedDifference(Set left, Set right) { return left.stream().filter(k -> !right.contains(k)).collect(new SortedSetCollector<>()); } + /** + * A sorted set collector + * + * @opensearch.internal + */ private static class SortedSetCollector implements Collector, SortedSet> { @Override diff --git a/server/src/main/java/org/opensearch/common/xcontent/LoggingDeprecationHandler.java b/server/src/main/java/org/opensearch/common/xcontent/LoggingDeprecationHandler.java index 6ce57857515ab..f390ebee55d79 100644 --- a/server/src/main/java/org/opensearch/common/xcontent/LoggingDeprecationHandler.java +++ b/server/src/main/java/org/opensearch/common/xcontent/LoggingDeprecationHandler.java @@ -44,6 +44,8 @@ * requests. It is much less appropriate when parsing responses from external * sources because it will report deprecated fields back to the user as * though the user sent them. + * + * @opensearch.internal */ public class LoggingDeprecationHandler implements DeprecationHandler { public static final LoggingDeprecationHandler INSTANCE = new LoggingDeprecationHandler(); diff --git a/server/src/main/java/org/opensearch/common/xcontent/ObjectParserHelper.java b/server/src/main/java/org/opensearch/common/xcontent/ObjectParserHelper.java index c833fd5cedebf..d342ee30a5300 100644 --- a/server/src/main/java/org/opensearch/common/xcontent/ObjectParserHelper.java +++ b/server/src/main/java/org/opensearch/common/xcontent/ObjectParserHelper.java @@ -44,6 +44,8 @@ /** * This class provides helpers for {@link ObjectParser} that allow dealing with * classes outside of the xcontent dependencies. + * + * @opensearch.internal */ public final class ObjectParserHelper { diff --git a/server/src/main/java/org/opensearch/common/xcontent/ParseFieldRegistry.java b/server/src/main/java/org/opensearch/common/xcontent/ParseFieldRegistry.java index f2d1c815d70a9..bb69a43e714dc 100644 --- a/server/src/main/java/org/opensearch/common/xcontent/ParseFieldRegistry.java +++ b/server/src/main/java/org/opensearch/common/xcontent/ParseFieldRegistry.java @@ -42,6 +42,8 @@ /** * Registry for looking things up using ParseField semantics. + * + * @opensearch.internal */ public class ParseFieldRegistry { private final Map> registry = new HashMap<>(); diff --git a/server/src/main/java/org/opensearch/common/xcontent/StatusToXContentObject.java b/server/src/main/java/org/opensearch/common/xcontent/StatusToXContentObject.java index 45d41bca95e5a..8eedd5fb468bb 100644 --- a/server/src/main/java/org/opensearch/common/xcontent/StatusToXContentObject.java +++ b/server/src/main/java/org/opensearch/common/xcontent/StatusToXContentObject.java @@ -36,6 +36,8 @@ /** * Objects that can both render themselves in as json/yaml/etc and can provide a {@link RestStatus} for their response. Usually should be * implemented by top level responses sent back to users from REST endpoints. + * + * @opensearch.internal */ public interface StatusToXContentObject extends ToXContentObject { diff --git a/server/src/main/java/org/opensearch/common/xcontent/SuggestingErrorOnUnknown.java b/server/src/main/java/org/opensearch/common/xcontent/SuggestingErrorOnUnknown.java index 0fd473f47acf6..f765045bf274b 100644 --- a/server/src/main/java/org/opensearch/common/xcontent/SuggestingErrorOnUnknown.java +++ b/server/src/main/java/org/opensearch/common/xcontent/SuggestingErrorOnUnknown.java @@ -42,6 +42,11 @@ import static java.util.stream.Collectors.toList; +/** + * Utility for suggesting source of errors. + * + * @opensearch.internal + */ public class SuggestingErrorOnUnknown implements ErrorOnUnknown { @Override public String errorMessage(String parserName, String unknownField, Iterable candidates) { diff --git a/server/src/main/java/org/opensearch/common/xcontent/XContentHelper.java b/server/src/main/java/org/opensearch/common/xcontent/XContentHelper.java index d0eca4228d153..e4b35d6ee2753 100644 --- a/server/src/main/java/org/opensearch/common/xcontent/XContentHelper.java +++ b/server/src/main/java/org/opensearch/common/xcontent/XContentHelper.java @@ -51,6 +51,11 @@ import java.util.Map; import java.util.Objects; +/** + * Helper for xcontent utilities. + * + * @opensearch.internal + */ @SuppressWarnings("unchecked") public class XContentHelper { diff --git a/server/src/main/java/org/opensearch/common/xcontent/XContentOpenSearchExtension.java b/server/src/main/java/org/opensearch/common/xcontent/XContentOpenSearchExtension.java index 214b35c13c7cd..f90f180f1eb4f 100644 --- a/server/src/main/java/org/opensearch/common/xcontent/XContentOpenSearchExtension.java +++ b/server/src/main/java/org/opensearch/common/xcontent/XContentOpenSearchExtension.java @@ -73,6 +73,8 @@ * SPI extensions for OpenSearch-specific classes (like the Lucene or Joda * dependency classes) that need to be encoded by {@link XContentBuilder} in a * specific way. + * + * @opensearch.internal */ public class XContentOpenSearchExtension implements XContentBuilderExtension { diff --git a/server/src/main/java/org/opensearch/common/xcontent/XContentParserUtils.java b/server/src/main/java/org/opensearch/common/xcontent/XContentParserUtils.java index 822210ffc1898..6848bbc639ec5 100644 --- a/server/src/main/java/org/opensearch/common/xcontent/XContentParserUtils.java +++ b/server/src/main/java/org/opensearch/common/xcontent/XContentParserUtils.java @@ -44,6 +44,8 @@ /** * A set of static methods to get {@link Token} from {@link XContentParser} * while checking for their types and throw {@link ParsingException} if needed. + * + * @opensearch.internal */ public final class XContentParserUtils { diff --git a/server/src/main/java/org/opensearch/common/xcontent/support/XContentMapValues.java b/server/src/main/java/org/opensearch/common/xcontent/support/XContentMapValues.java index 5eb4b782b3f4a..9170cfaf8eadf 100644 --- a/server/src/main/java/org/opensearch/common/xcontent/support/XContentMapValues.java +++ b/server/src/main/java/org/opensearch/common/xcontent/support/XContentMapValues.java @@ -50,6 +50,11 @@ import java.util.Map; import java.util.function.Function; +/** + * Map values for xcontent parsing. + * + * @opensearch.internal + */ public class XContentMapValues { /** diff --git a/server/src/main/java/org/opensearch/snapshots/InternalSnapshotsInfoService.java b/server/src/main/java/org/opensearch/snapshots/InternalSnapshotsInfoService.java index 2314cbd11dfdd..10328d3e2ce9f 100644 --- a/server/src/main/java/org/opensearch/snapshots/InternalSnapshotsInfoService.java +++ b/server/src/main/java/org/opensearch/snapshots/InternalSnapshotsInfoService.java @@ -67,6 +67,11 @@ import java.util.Set; import java.util.function.Supplier; +/** + * Information service for snapshots + * + * @opensearch.internal + */ public class InternalSnapshotsInfoService implements ClusterStateListener, SnapshotsInfoService { public static final Setting INTERNAL_SNAPSHOT_INFO_MAX_CONCURRENT_FETCHES_SETTING = Setting.intSetting( @@ -358,6 +363,12 @@ private static Set listOfSnapshotShards(final ClusterState state) return Collections.unmodifiableSet(snapshotShards); } + /** + * A snapshot of a shard + * + * @opensearch.internal + */ + public static class SnapshotShard { private final Snapshot snapshot; diff --git a/server/src/main/java/org/opensearch/snapshots/RestoreService.java b/server/src/main/java/org/opensearch/snapshots/RestoreService.java index a95c711870e9b..3bdda9413cfd9 100644 --- a/server/src/main/java/org/opensearch/snapshots/RestoreService.java +++ b/server/src/main/java/org/opensearch/snapshots/RestoreService.java @@ -800,6 +800,11 @@ public RestoreInfo getRestoreInfo() { } } + /** + * Updates based on restore progress + * + * @opensearch.internal + */ public static class RestoreInProgressUpdater extends RoutingChangesObserver.AbstractRoutingChangesObserver { // Map of RestoreUUID to a of changes to the shards' restore statuses private final Map> shardChanges = new HashMap<>(); diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotInfo.java b/server/src/main/java/org/opensearch/snapshots/SnapshotInfo.java index f08a52a4e7523..d7ebba721a52c 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotInfo.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotInfo.java @@ -103,6 +103,11 @@ public final class SnapshotInfo implements Comparable, ToXContent, private static final Comparator COMPARATOR = Comparator.comparing(SnapshotInfo::startTime) .thenComparing(SnapshotInfo::snapshotId); + /** + * Builds snapshot information + * + * @opensearch.internal + */ public static final class SnapshotInfoBuilder { private String snapshotName = null; private String snapshotUUID = null; From 677915dc00f990957ff8ec6f9c8e450977c88a0e Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Wed, 11 May 2022 18:33:48 -0400 Subject: [PATCH 03/20] Bootstrap should implement a denylist of Java versions (ranges) (#3164) * Bootstrap should implement a denylist of Java versions (ranges) Signed-off-by: Andriy Redko * Addressing code review comments Signed-off-by: Andriy Redko --- .../opensearch/bootstrap/BootstrapChecks.java | 22 +++ .../bootstrap/jvm/DenyJvmVersionsParser.java | 169 ++++++++++++++++++ .../bootstrap/jvm/deny-jvm-versions.txt | 10 ++ .../bootstrap/BootstrapChecksTests.java | 29 +++ .../jvm/DenyJvmVersionsParserTests.java | 99 ++++++++++ 5 files changed, 329 insertions(+) create mode 100644 server/src/main/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParser.java create mode 100644 server/src/main/resources/org/opensearch/bootstrap/jvm/deny-jvm-versions.txt create mode 100644 server/src/test/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParserTests.java diff --git a/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java b/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java index 7953dee644ea4..5d595dc1abedf 100644 --- a/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java +++ b/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java @@ -36,6 +36,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.lucene.util.Constants; +import org.opensearch.bootstrap.jvm.DenyJvmVersionsParser; import org.opensearch.cluster.coordination.ClusterBootstrapService; import org.opensearch.common.SuppressForbidden; import org.opensearch.common.io.PathUtils; @@ -224,11 +225,32 @@ static List checks() { checks.add(new OnErrorCheck()); checks.add(new OnOutOfMemoryErrorCheck()); checks.add(new EarlyAccessCheck()); + checks.add(new JavaVersionCheck()); checks.add(new AllPermissionCheck()); checks.add(new DiscoveryConfiguredCheck()); return Collections.unmodifiableList(checks); } + static class JavaVersionCheck implements BootstrapCheck { + @Override + public BootstrapCheckResult check(BootstrapContext context) { + return DenyJvmVersionsParser.getDeniedJvmVersions() + .stream() + .filter(p -> p.test(getVersion())) + .findAny() + .map( + p -> BootstrapCheckResult.failure( + String.format(Locale.ROOT, "The current JVM version %s is not recommended for use: %s", getVersion(), p.getReason()) + ) + ) + .orElseGet(() -> BootstrapCheckResult.success()); + } + + Runtime.Version getVersion() { + return Runtime.version(); + } + } + static class HeapSizeCheck implements BootstrapCheck { @Override diff --git a/server/src/main/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParser.java b/server/src/main/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParser.java new file mode 100644 index 0000000000000..a9c908c058508 --- /dev/null +++ b/server/src/main/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParser.java @@ -0,0 +1,169 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.bootstrap.jvm; + +import org.opensearch.common.Nullable; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.UncheckedIOException; +import java.lang.Runtime.Version; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Collection; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +/** + * Parses the list of JVM versions which should be denied to run Opensearch engine with due to discovered + * issues or flaws. + */ +public class DenyJvmVersionsParser { + public interface VersionPredicate extends Predicate { + String getReason(); + } + + private static class SingleVersion implements VersionPredicate { + final private Version version; + final private String reason; + + public SingleVersion(Version version, String reason) { + this.version = version; + this.reason = reason; + } + + @Override + public boolean test(Version v) { + return version.compareTo(v) == 0; + } + + @Override + public String getReason() { + return reason; + } + } + + private static class VersionRange implements VersionPredicate { + private Version lower; + private boolean lowerIncluded; + private Version upper; + private boolean upperIncluded; + private String reason; + + public VersionRange(@Nullable Version lower, boolean lowerIncluded, @Nullable Version upper, boolean upperIncluded, String reason) { + this.lower = lower; + this.lowerIncluded = lowerIncluded; + this.upper = upper; + this.upperIncluded = upperIncluded; + this.reason = reason; + } + + @Override + public boolean test(Version v) { + if (lower != null) { + int compare = lower.compareTo(v); + if (compare > 0 || (compare == 0 && lowerIncluded != true)) { + return false; + } + } + + if (upper != null) { + int compare = upper.compareTo(v); + if (compare < 0 || (compare == 0 && upperIncluded != true)) { + return false; + } + } + + return true; + } + + @Override + public String getReason() { + return reason; + } + } + + public static Collection getDeniedJvmVersions() { + try ( + final InputStreamReader in = new InputStreamReader( + DenyJvmVersionsParser.class.getResourceAsStream("deny-jvm-versions.txt"), + StandardCharsets.UTF_8 + ) + ) { + try (final BufferedReader reader = new BufferedReader(in)) { + return reader.lines() + .map(String::trim) + // filter empty lines + .filter(line -> line.isEmpty() == false) + // filter out all comments + .filter(line -> line.startsWith("//") == false) + .map(DenyJvmVersionsParser::parse) + .collect(Collectors.toList()); + } + } catch (final IOException ex) { + throw new UncheckedIOException("Unable to read the list of denied JVM versions", ex); + } + } + + /** + * Parse individual line from the list of denied JVM versions. Some version and version range examples are: + *

    + *
  • 11.0.2: "... reason ..." - version 11.0.2
  • + *
  • [11.0.2, 11.0.14): "... reason ..." - versions 11.0.2.2 (included) to 11.0.14 (not included)
  • + *
  • [11.0.2, 11.0.14]: "... reason ..." - versions 11.0.2 to 11.0.14 (both included)
  • + *
  • [11.0.2,): "... reason ..." - versions 11.0.2 and higher
  • + *
+ * @param line line to parse + * @return version or version range predicate + */ + static VersionPredicate parse(String line) { + final String[] parts = Arrays.stream(line.split("[:]", 2)).map(String::trim).toArray(String[]::new); + + if (parts.length != 2) { + throw new IllegalArgumentException("Unable to parse JVM version or version range: " + line); + } + + final String versionOrRange = parts[0]; + final String reason = parts[1]; + + // dealing with version range here + if (versionOrRange.startsWith("[") == true || versionOrRange.startsWith("(") == true) { + if (versionOrRange.endsWith("]") == false && versionOrRange.endsWith(")") == false) { + throw new IllegalArgumentException("Unable to parse JVM version range: " + versionOrRange); + } + + final boolean lowerIncluded = versionOrRange.startsWith("["); + final boolean upperIncluded = versionOrRange.endsWith("]"); + + final String[] range = Arrays.stream(versionOrRange.substring(1, versionOrRange.length() - 1).split("[,]", 2)) + .map(String::trim) + .toArray(String[]::new); + + if (range.length != 2) { + throw new IllegalArgumentException("Unable to parse JVM version range: " + versionOrRange); + } + + Version lower = null; + if (range[0].isEmpty() == false && range[0].equals("*") == false) { + lower = Version.parse(range[0]); + } + + Version upper = null; + if (range[1].isEmpty() == false && range[1].equals("*") == false) { + upper = Version.parse(range[1]); + } + + return new VersionRange(lower, lowerIncluded, upper, upperIncluded, reason); + } else { + // this is just a single version + return new SingleVersion(Version.parse(versionOrRange), reason); + } + } +} diff --git a/server/src/main/resources/org/opensearch/bootstrap/jvm/deny-jvm-versions.txt b/server/src/main/resources/org/opensearch/bootstrap/jvm/deny-jvm-versions.txt new file mode 100644 index 0000000000000..e3bfbea397570 --- /dev/null +++ b/server/src/main/resources/org/opensearch/bootstrap/jvm/deny-jvm-versions.txt @@ -0,0 +1,10 @@ +// Some version and version range examples are: +// 11.0.2: <... reason ...> version 11.0.2. +// [11.0.2, 11.0.14): <... reason ...> versions 11.0.2.2 (included) to 11.0.14 (not included) +// [11.0.2, 11.0.14]: <... reason ...> versions 11.0.2 to 11.0.14 (both included) +// [11.0.2,): <... reason ...> versions 11.0.2 and higher +// [11.0.2,*): <... reason ...> versions 11.0.2 and higher +// (, 11.0.14]: <... reason ...> versions up to 11.0.14 (included) +// (*, 11.0.14]: <... reason ...> versions up to 11.0.14 (included) + +[11.0.2, 11.0.14): for more details, please check https://github.com/opensearch-project/OpenSearch/issues/2791 and https://bugs.openjdk.java.net/browse/JDK-8259541 \ No newline at end of file diff --git a/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java b/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java index 88f2047ffaa0f..8edb204ac0402 100644 --- a/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java @@ -47,6 +47,7 @@ import org.opensearch.test.AbstractBootstrapCheckTestCase; import org.hamcrest.Matcher; +import java.lang.Runtime.Version; import java.net.InetAddress; import java.util.ArrayList; import java.util.Arrays; @@ -745,4 +746,32 @@ public void testDiscoveryConfiguredCheck() throws NodeValidationException { // Validate the deprecated setting is still valid during the node bootstrap. ensureChecksPass.accept(Settings.builder().putList(ClusterBootstrapService.INITIAL_MASTER_NODES_SETTING.getKey())); } + + public void testJvmVersionCheck() throws NodeValidationException { + final AtomicReference version = new AtomicReference<>(Version.parse("11.0.13+8")); + final BootstrapCheck check = new BootstrapChecks.JavaVersionCheck() { + @Override + Version getVersion() { + return version.get(); + } + }; + + final NodeValidationException e = expectThrows( + NodeValidationException.class, + () -> BootstrapChecks.check(emptyContext, true, Collections.singletonList(check)) + ); + assertThat( + e.getMessage(), + containsString( + "The current JVM version 11.0.13+8 is not recommended for use: " + + "for more details, please check https://github.com/opensearch-project/OpenSearch/issues/2791 and https://bugs.openjdk.java.net/browse/JDK-8259541" + ) + ); + + version.set(Version.parse("11.0.14")); + BootstrapChecks.check(emptyContext, true, Collections.singletonList(check)); + + version.set(Runtime.version()); + BootstrapChecks.check(emptyContext, true, Collections.singletonList(check)); + } } diff --git a/server/src/test/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParserTests.java b/server/src/test/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParserTests.java new file mode 100644 index 0000000000000..c0507c54be36a --- /dev/null +++ b/server/src/test/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParserTests.java @@ -0,0 +1,99 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.bootstrap.jvm; + +import org.opensearch.bootstrap.jvm.DenyJvmVersionsParser.VersionPredicate; +import org.opensearch.test.OpenSearchTestCase; + +import java.lang.Runtime.Version; +import java.util.Collection; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.collection.IsEmptyCollection.empty; + +public class DenyJvmVersionsParserTests extends OpenSearchTestCase { + public void testDefaults() { + final Collection versions = DenyJvmVersionsParser.getDeniedJvmVersions(); + assertThat(versions, not(empty())); + } + + public void testSingleVersion() { + final VersionPredicate predicate = DenyJvmVersionsParser.parse("11.0.2: know to be flawed version"); + assertThat(predicate.test(Version.parse("11.0.2")), is(true)); + assertThat(predicate.test(Version.parse("11.0.1")), is(false)); + assertThat(predicate.test(Version.parse("11.0.3")), is(false)); + assertThat(predicate.getReason(), equalTo("know to be flawed version")); + } + + public void testVersionRangeLowerIncluded() { + final VersionPredicate predicate = DenyJvmVersionsParser.parse("[11.0.2, 11.0.14): know to be flawed version"); + assertThat(predicate.test(Version.parse("11.0.2")), is(true)); + assertThat(predicate.test(Version.parse("11.0.1")), is(false)); + assertThat(predicate.test(Version.parse("11.0.13+1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14")), is(false)); + assertThat(predicate.getReason(), equalTo("know to be flawed version")); + } + + public void testVersionRangeUpperIncluded() { + final VersionPredicate predicate = DenyJvmVersionsParser.parse("[11.0.2,): know to be flawed version"); + assertThat(predicate.test(Version.parse("11.0.2")), is(true)); + assertThat(predicate.test(Version.parse("11.0.1")), is(false)); + assertThat(predicate.test(Version.parse("11.0.13+1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14")), is(true)); + assertThat(predicate.test(Version.parse("17.2.1")), is(true)); + assertThat(predicate.getReason(), equalTo("know to be flawed version")); + } + + public void testVersionRangeLowerAndUpperIncluded() { + final VersionPredicate predicate = DenyJvmVersionsParser.parse("[11.0.2, 11.0.14]: know to be flawed version"); + assertThat(predicate.test(Version.parse("11.0.2")), is(true)); + assertThat(predicate.test(Version.parse("11.0.1")), is(false)); + assertThat(predicate.test(Version.parse("11.0.13+1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14.1")), is(false)); + assertThat(predicate.test(Version.parse("11.0.15")), is(false)); + assertThat(predicate.getReason(), equalTo("know to be flawed version")); + } + + public void testAllVersionsRange() { + final VersionPredicate predicate = DenyJvmVersionsParser.parse("(,): know to be flawed version"); + assertThat(predicate.test(Version.parse("11.0.2")), is(true)); + assertThat(predicate.test(Version.parse("11.0.1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.13+1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14.1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.15")), is(true)); + assertThat(predicate.test(Version.parse("17.2.1")), is(true)); + assertThat(predicate.getReason(), equalTo("know to be flawed version")); + } + + public void testAllVersionsRangeIncluded() { + final VersionPredicate predicate = DenyJvmVersionsParser.parse("[*, *]: know to be flawed version"); + assertThat(predicate.test(Version.parse("11.0.2")), is(true)); + assertThat(predicate.test(Version.parse("11.0.1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.13+1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14.1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.15")), is(true)); + assertThat(predicate.test(Version.parse("17.2.1")), is(true)); + assertThat(predicate.getReason(), equalTo("know to be flawed version")); + } + + public void testIncorrectVersionRanges() { + assertThrows(IllegalArgumentException.class, () -> DenyJvmVersionsParser.parse("[*, *: know to be flawed version")); + assertThrows(IllegalArgumentException.class, () -> DenyJvmVersionsParser.parse("*, *: know to be flawed version")); + assertThrows(IllegalArgumentException.class, () -> DenyJvmVersionsParser.parse("*, *): know to be flawed version")); + assertThrows(IllegalArgumentException.class, () -> DenyJvmVersionsParser.parse("(): know to be flawed version")); + assertThrows(IllegalArgumentException.class, () -> DenyJvmVersionsParser.parse("[]: know to be flawed version")); + assertThrows(IllegalArgumentException.class, () -> DenyJvmVersionsParser.parse("[,]")); + assertThrows(IllegalArgumentException.class, () -> DenyJvmVersionsParser.parse("11.0.2")); + } +} From 10bff0c9f5b9ca78b3dc50f5c704dabf41b9d535 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Wed, 11 May 2022 16:34:57 -0700 Subject: [PATCH 04/20] Replace internal usages of 'master' term in 'test' directory (#3283) * Replace internal usages of 'master' terminology in server/src/internalClusterTest directory Signed-off-by: Tianli Feng * Replace 'master' terminology with 'cluster manager' in test directory Signed-off-by: Tianli Feng * Replace 'master' terminology with 'cluster manager' in server/src/internalClusterTest directory Signed-off-by: Tianli Feng * Adjust format by spotlessApply task Signed-off-by: Tianli Feng * Replace 'master' terminology with 'cluster manager' in test directory Signed-off-by: Tianli Feng * Adjust format by spotlessApply task Signed-off-by: Tianli Feng --- .../ingest/common/IngestRestartIT.java | 2 +- .../rest/discovery/Zen2RestApiIT.java | 10 +- .../discovery/gce/GceDiscoverTests.java | 2 +- .../http/DanglingIndicesRestIT.java | 6 +- .../action/admin/ClientTimeoutIT.java | 14 +- .../ClusterAllocationExplainIT.java | 6 +- .../admin/cluster/node/tasks/TasksIT.java | 8 +- ...ansportClusterStateActionDisruptionIT.java | 46 +-- .../admin/cluster/stats/ClusterStatsIT.java | 12 +- .../admin/indices/exists/IndicesExistsIT.java | 2 +- .../master/IndexingMasterFailoverIT.java | 2 +- .../cluster/ClusterStateDiffIT.java | 8 +- .../cluster/MinimumMasterNodesIT.java | 18 +- .../cluster/SpecificMasterNodesIT.java | 14 +- .../coordination/RareClusterStateIT.java | 2 +- .../coordination/RemoveCustomsCommandIT.java | 6 +- .../coordination/RemoveSettingsCommandIT.java | 6 +- .../UnsafeBootstrapAndDetachCommandIT.java | 58 ++-- .../coordination/VotingConfigurationIT.java | 4 +- .../cluster/coordination/ZenDiscoveryIT.java | 8 +- .../cluster/routing/AllocationIdIT.java | 2 +- .../cluster/routing/PrimaryAllocationIT.java | 28 +- .../decider/DiskThresholdDeciderIT.java | 4 +- .../ClusterDisruptionCleanSettingsIT.java | 2 +- .../discovery/ClusterDisruptionIT.java | 28 +- .../discovery/DiscoveryDisruptionIT.java | 50 +-- .../discovery/MasterDisruptionIT.java | 29 +- .../discovery/StableMasterDisruptionIT.java | 8 +- .../env/NodeRepurposeCommandIT.java | 24 +- .../gateway/GatewayIndexStateIT.java | 2 +- .../opensearch/gateway/MetadataNodesIT.java | 6 +- .../gateway/RecoverAfterNodesIT.java | 16 +- .../gateway/RecoveryFromGatewayIT.java | 2 +- .../gateway/ReplicaShardAllocatorIT.java | 6 +- .../PeerRecoveryRetentionLeaseCreationIT.java | 2 +- .../RemoveCorruptedShardDataCommandIT.java | 2 +- .../DedicatedMasterGetFieldMappingIT.java | 2 +- .../indices/recovery/IndexRecoveryIT.java | 6 +- .../store/IndicesStoreIntegrationIT.java | 20 +- .../org/opensearch/ingest/IngestClientIT.java | 6 +- .../recovery/FullRollingRestartIT.java | 2 +- .../snapshots/AbortedRestoreIT.java | 2 +- .../snapshots/BlobStoreIncrementalityIT.java | 4 +- .../opensearch/snapshots/CloneSnapshotIT.java | 44 +-- .../snapshots/ConcurrentSnapshotsIT.java | 90 +++--- .../DedicatedClusterSnapshotRestoreIT.java | 16 +- .../snapshots/MultiClusterRepoAccessIT.java | 4 +- .../snapshots/SnapshotShardsServiceIT.java | 2 +- .../DelayedAllocationServiceTests.java | 2 +- .../allocation/AllocationCommandsTests.java | 4 +- .../NodeVersionAllocationDeciderTests.java | 12 +- .../allocation/SameShardRoutingTests.java | 6 +- .../decider/DiskThresholdDeciderTests.java | 4 +- .../IncrementalClusterStateWriterTests.java | 4 +- .../transport/RemoteClusterServiceTests.java | 4 +- .../ClusterStateCreationUtils.java | 18 +- .../cluster/OpenSearchAllocationTestCase.java | 8 +- .../AbstractCoordinatorTestCase.java | 66 ++-- .../CoordinationStateTestCluster.java | 14 +- .../service/FakeThreadPoolMasterService.java | 4 +- .../opensearch/common/util/MockBigArrays.java | 19 +- .../common/util/MockPageCacheRecycler.java | 22 +- .../blobstore/BlobStoreTestUtil.java | 2 +- .../AbstractSnapshotIntegTestCase.java | 26 +- .../snapshots/mockstore/MockRepository.java | 4 +- .../test/AbstractBuilderTestCase.java | 6 +- .../opensearch/test/ClusterServiceUtils.java | 12 +- .../opensearch/test/ExternalTestCluster.java | 12 +- .../opensearch/test/InternalTestCluster.java | 296 +++++++++--------- .../java/org/opensearch/test/NodeRoles.java | 6 +- .../test/OpenSearchIntegTestCase.java | 86 ++--- .../test/OpenSearchSingleNodeTestCase.java | 2 +- .../java/org/opensearch/test/TestCluster.java | 2 +- .../org/opensearch/test/VersionUtils.java | 4 +- .../BlockMasterServiceOnMaster.java | 2 +- .../BusyMasterServiceDisruption.java | 2 +- .../test/disruption/NetworkDisruption.java | 2 +- .../rest/yaml/ClientYamlDocsTestClient.java | 4 +- .../test/rest/yaml/ClientYamlTestClient.java | 10 +- .../yaml/ClientYamlTestExecutionContext.java | 2 +- .../OpenSearchClientYamlSuiteTestCase.java | 43 +-- .../test/rest/yaml/section/DoSection.java | 6 +- .../FakeThreadPoolMasterServiceTests.java | 16 +- .../test/disruption/NetworkDisruptionIT.java | 6 +- .../test/test/InternalTestClusterIT.java | 2 +- .../test/test/InternalTestClusterTests.java | 52 +-- 86 files changed, 743 insertions(+), 692 deletions(-) diff --git a/modules/ingest-common/src/internalClusterTest/java/org/opensearch/ingest/common/IngestRestartIT.java b/modules/ingest-common/src/internalClusterTest/java/org/opensearch/ingest/common/IngestRestartIT.java index aeaa7246f33b8..c662843b91ebb 100644 --- a/modules/ingest-common/src/internalClusterTest/java/org/opensearch/ingest/common/IngestRestartIT.java +++ b/modules/ingest-common/src/internalClusterTest/java/org/opensearch/ingest/common/IngestRestartIT.java @@ -86,7 +86,7 @@ protected Map, Object>> pluginScripts() { public void testFailureInConditionalProcessor() { internalCluster().ensureAtLeastNumDataNodes(1); - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String pipelineId = "foo"; client().admin() .cluster() diff --git a/modules/transport-netty4/src/internalClusterTest/java/org/opensearch/rest/discovery/Zen2RestApiIT.java b/modules/transport-netty4/src/internalClusterTest/java/org/opensearch/rest/discovery/Zen2RestApiIT.java index f7899d91e0cb9..96e21e0e05ff7 100644 --- a/modules/transport-netty4/src/internalClusterTest/java/org/opensearch/rest/discovery/Zen2RestApiIT.java +++ b/modules/transport-netty4/src/internalClusterTest/java/org/opensearch/rest/discovery/Zen2RestApiIT.java @@ -69,7 +69,7 @@ protected boolean addMockHttpTransport() { } public void testRollingRestartOfTwoNodeCluster() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(1); + internalCluster().setBootstrapClusterManagerNodeIndex(1); final List nodes = internalCluster().startNodes(2); createIndex( "test", @@ -135,7 +135,7 @@ public Settings onNodeStopped(String nodeName) throws IOException { } public void testClearVotingTombstonesNotWaitingForRemoval() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(2); + internalCluster().setBootstrapClusterManagerNodeIndex(2); List nodes = internalCluster().startNodes(3); ensureStableCluster(3); RestClient restClient = getRestClient(); @@ -150,7 +150,7 @@ public void testClearVotingTombstonesNotWaitingForRemoval() throws Exception { } public void testClearVotingTombstonesWaitingForRemoval() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(2); + internalCluster().setBootstrapClusterManagerNodeIndex(2); List nodes = internalCluster().startNodes(3); ensureStableCluster(3); RestClient restClient = getRestClient(); @@ -165,7 +165,7 @@ public void testClearVotingTombstonesWaitingForRemoval() throws Exception { } public void testFailsOnUnknownNode() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(2); + internalCluster().setBootstrapClusterManagerNodeIndex(2); internalCluster().startNodes(3); ensureStableCluster(3); RestClient restClient = getRestClient(); @@ -182,7 +182,7 @@ public void testFailsOnUnknownNode() throws Exception { } public void testRemoveTwoNodesAtOnce() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(2); + internalCluster().setBootstrapClusterManagerNodeIndex(2); List nodes = internalCluster().startNodes(3); ensureStableCluster(3); RestClient restClient = getRestClient(); diff --git a/plugins/discovery-gce/src/internalClusterTest/java/org/opensearch/discovery/gce/GceDiscoverTests.java b/plugins/discovery-gce/src/internalClusterTest/java/org/opensearch/discovery/gce/GceDiscoverTests.java index 815537b534586..60293614254c5 100644 --- a/plugins/discovery-gce/src/internalClusterTest/java/org/opensearch/discovery/gce/GceDiscoverTests.java +++ b/plugins/discovery-gce/src/internalClusterTest/java/org/opensearch/discovery/gce/GceDiscoverTests.java @@ -86,7 +86,7 @@ protected Settings nodeSettings(int nodeOrdinal) { public void testJoin() { // start master node - final String masterNode = internalCluster().startMasterOnlyNode(); + final String masterNode = internalCluster().startClusterManagerOnlyNode(); registerGceNode(masterNode); ClusterStateResponse clusterStateResponse = client(masterNode).admin() diff --git a/qa/smoke-test-http/src/test/java/org/opensearch/http/DanglingIndicesRestIT.java b/qa/smoke-test-http/src/test/java/org/opensearch/http/DanglingIndicesRestIT.java index 3b32ac40917e4..8ce546e327c31 100644 --- a/qa/smoke-test-http/src/test/java/org/opensearch/http/DanglingIndicesRestIT.java +++ b/qa/smoke-test-http/src/test/java/org/opensearch/http/DanglingIndicesRestIT.java @@ -91,7 +91,7 @@ private Settings buildSettings(int maxTombstones) { * Check that when dangling indices are discovered, then they can be listed via the REST API. */ public void testDanglingIndicesCanBeListed() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(1); + internalCluster().setBootstrapClusterManagerNodeIndex(1); internalCluster().startNodes(3, buildSettings(0)); final DanglingIndexDetails danglingIndexDetails = createDanglingIndices(INDEX_NAME); @@ -121,7 +121,7 @@ public void testDanglingIndicesCanBeListed() throws Exception { * Check that dangling indices can be imported. */ public void testDanglingIndicesCanBeImported() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(1); + internalCluster().setBootstrapClusterManagerNodeIndex(1); internalCluster().startNodes(3, buildSettings(0)); createDanglingIndices(INDEX_NAME); @@ -157,7 +157,7 @@ public void testDanglingIndicesCanBeImported() throws Exception { * deleted through the API */ public void testDanglingIndicesCanBeDeleted() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(1); + internalCluster().setBootstrapClusterManagerNodeIndex(1); internalCluster().startNodes(3, buildSettings(1)); createDanglingIndices(INDEX_NAME, OTHER_INDEX_NAME); diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/ClientTimeoutIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/ClientTimeoutIT.java index d83e8112569ee..3b56c07cb10c8 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/ClientTimeoutIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/ClientTimeoutIT.java @@ -47,7 +47,7 @@ protected Collection> nodePlugins() { } public void testNodesInfoTimeout() { - String masterNode = internalCluster().startMasterOnlyNode(); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); String dataNode = internalCluster().startDataOnlyNode(); String anotherDataNode = internalCluster().startDataOnlyNode(); @@ -65,11 +65,11 @@ public void testNodesInfoTimeout() { nodes.add(node.getNode().getName()); } assertThat(response.getNodes().size(), equalTo(2)); - assertThat(nodes.contains(masterNode), is(true)); + assertThat(nodes.contains(clusterManagerNode), is(true)); } public void testNodesStatsTimeout() { - String masterNode = internalCluster().startMasterOnlyNode(); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); String dataNode = internalCluster().startDataOnlyNode(); String anotherDataNode = internalCluster().startDataOnlyNode(); TimeValue timeout = TimeValue.timeValueMillis(1000); @@ -87,11 +87,11 @@ public void testNodesStatsTimeout() { nodes.add(node.getNode().getName()); } assertThat(response.getNodes().size(), equalTo(2)); - assertThat(nodes.contains(masterNode), is(true)); + assertThat(nodes.contains(clusterManagerNode), is(true)); } public void testListTasksTimeout() { - String masterNode = internalCluster().startMasterOnlyNode(); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); String dataNode = internalCluster().startDataOnlyNode(); String anotherDataNode = internalCluster().startDataOnlyNode(); TimeValue timeout = TimeValue.timeValueMillis(1000); @@ -108,7 +108,7 @@ public void testListTasksTimeout() { } public void testRecoveriesWithTimeout() { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); String dataNode = internalCluster().startDataOnlyNode(); String anotherDataNode = internalCluster().startDataOnlyNode(); @@ -148,7 +148,7 @@ public void testRecoveriesWithTimeout() { } public void testStatsWithTimeout() { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); String dataNode = internalCluster().startDataOnlyNode(); String anotherDataNode = internalCluster().startDataOnlyNode(); diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainIT.java index 8c7e5378516bf..542d2069a21ce 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainIT.java @@ -1110,7 +1110,7 @@ public void testAssignedReplicaOnSpecificNode() throws Exception { public void testCannotAllocateStaleReplicaExplanation() throws Exception { logger.info("--> starting 3 nodes"); - final String masterNode = internalCluster().startNode(); + final String clusterManagerNode = internalCluster().startNode(); // start replica node first, so it's path will be used first when we start a node after // stopping all of them at end of test. final String replicaNode = internalCluster().startNode(); @@ -1123,7 +1123,7 @@ public void testCannotAllocateStaleReplicaExplanation() throws Exception { 1, Settings.builder() .put("index.routing.allocation.include._name", primaryNode) - .put("index.routing.allocation.exclude._name", masterNode) + .put("index.routing.allocation.exclude._name", clusterManagerNode) .build(), ActiveShardCount.ONE ); @@ -1165,7 +1165,7 @@ public void testCannotAllocateStaleReplicaExplanation() throws Exception { logger.info("--> restart the node with the stale replica"); String restartedNode = internalCluster().startDataOnlyNode(replicaDataPathSettings); - ensureClusterSizeConsistency(); // wait for the master to finish processing join. + ensureClusterSizeConsistency(); // wait for the cluster-manager to finish processing join. // wait until the system has fetched shard data and we know there is no valid shard copy assertBusy(() -> { diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/TasksIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/TasksIT.java index ac0ae44eb732e..9c6c67116ef8a 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/TasksIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/TasksIT.java @@ -117,7 +117,7 @@ /** * Integration tests for task management API *

- * We need at least 2 nodes so we have a master node a non-master node + * We need at least 2 nodes so we have a cluster-manager node a non-cluster-manager node */ @OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.SUITE, minNumDataNodes = 2) public class TasksIT extends OpenSearchIntegTestCase { @@ -154,17 +154,17 @@ public void testTaskCounts() { assertThat(response.getTasks().size(), greaterThanOrEqualTo(cluster().numDataNodes())); } - public void testMasterNodeOperationTasks() { + public void testClusterManagerNodeOperationTasks() { registerTaskManagerListeners(ClusterHealthAction.NAME); - // First run the health on the master node - should produce only one task on the master node + // First run the health on the cluster-manager node - should produce only one task on the cluster-manager node internalCluster().masterClient().admin().cluster().prepareHealth().get(); assertEquals(1, numberOfEvents(ClusterHealthAction.NAME, Tuple::v1)); // counting only registration events assertEquals(1, numberOfEvents(ClusterHealthAction.NAME, event -> event.v1() == false)); // counting only unregistration events resetTaskManagerListeners(ClusterHealthAction.NAME); - // Now run the health on a non-master node - should produce one task on master and one task on another node + // Now run the health on a non-cluster-manager node - should produce one task on cluster-manager and one task on another node internalCluster().nonMasterClient().admin().cluster().prepareHealth().get(); assertEquals(2, numberOfEvents(ClusterHealthAction.NAME, Tuple::v1)); // counting only registration events assertEquals(2, numberOfEvents(ClusterHealthAction.NAME, event -> event.v1() == false)); // counting only unregistration events diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/state/TransportClusterStateActionDisruptionIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/state/TransportClusterStateActionDisruptionIT.java index c6f47a01ed2d2..b7538f6752ec4 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/state/TransportClusterStateActionDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/state/TransportClusterStateActionDisruptionIT.java @@ -68,8 +68,8 @@ protected Collection> nodePlugins() { return Collections.singletonList(MockTransportService.TestPlugin.class); } - public void testNonLocalRequestAlwaysFindsMaster() throws Exception { - runRepeatedlyWhileChangingMaster(() -> { + public void testNonLocalRequestAlwaysFindsClusterManager() throws Exception { + runRepeatedlyWhileChangingClusterManager(() -> { final ClusterStateRequestBuilder clusterStateRequestBuilder = client().admin() .cluster() .prepareState() @@ -82,12 +82,12 @@ public void testNonLocalRequestAlwaysFindsMaster() throws Exception { } catch (MasterNotDiscoveredException e) { return; // ok, we hit the disconnected node } - assertNotNull("should always contain a master node", clusterStateResponse.getState().nodes().getMasterNodeId()); + assertNotNull("should always contain a cluster-manager node", clusterStateResponse.getState().nodes().getMasterNodeId()); }); } public void testLocalRequestAlwaysSucceeds() throws Exception { - runRepeatedlyWhileChangingMaster(() -> { + runRepeatedlyWhileChangingClusterManager(() -> { final String node = randomFrom(internalCluster().getNodeNames()); final DiscoveryNodes discoveryNodes = client(node).admin() .cluster() @@ -108,8 +108,8 @@ public void testLocalRequestAlwaysSucceeds() throws Exception { }); } - public void testNonLocalRequestAlwaysFindsMasterAndWaitsForMetadata() throws Exception { - runRepeatedlyWhileChangingMaster(() -> { + public void testNonLocalRequestAlwaysFindsClusterManagerAndWaitsForMetadata() throws Exception { + runRepeatedlyWhileChangingClusterManager(() -> { final String node = randomFrom(internalCluster().getNodeNames()); final long metadataVersion = internalCluster().getInstance(ClusterService.class, node) .getClusterApplierService() @@ -134,14 +134,14 @@ public void testNonLocalRequestAlwaysFindsMasterAndWaitsForMetadata() throws Exc } if (clusterStateResponse.isWaitForTimedOut() == false) { final ClusterState state = clusterStateResponse.getState(); - assertNotNull("should always contain a master node", state.nodes().getMasterNodeId()); + assertNotNull("should always contain a cluster-manager node", state.nodes().getMasterNodeId()); assertThat("waited for metadata version", state.metadata().version(), greaterThanOrEqualTo(waitForMetadataVersion)); } }); } public void testLocalRequestWaitsForMetadata() throws Exception { - runRepeatedlyWhileChangingMaster(() -> { + runRepeatedlyWhileChangingClusterManager(() -> { final String node = randomFrom(internalCluster().getNodeNames()); final long metadataVersion = internalCluster().getInstance(ClusterService.class, node) .getClusterApplierService() @@ -170,7 +170,7 @@ public void testLocalRequestWaitsForMetadata() throws Exception { }); } - public void runRepeatedlyWhileChangingMaster(Runnable runnable) throws Exception { + public void runRepeatedlyWhileChangingClusterManager(Runnable runnable) throws Exception { internalCluster().startNodes(3); assertBusy( @@ -191,7 +191,7 @@ public void runRepeatedlyWhileChangingMaster(Runnable runnable) throws Exception ) ); - final String masterName = internalCluster().getMasterName(); + final String clusterManagerName = internalCluster().getMasterName(); final AtomicBoolean shutdown = new AtomicBoolean(); final Thread assertingThread = new Thread(() -> { @@ -204,9 +204,12 @@ public void runRepeatedlyWhileChangingMaster(Runnable runnable) throws Exception String value = "none"; while (shutdown.get() == false) { value = "none".equals(value) ? "all" : "none"; - final String nonMasterNode = randomValueOtherThan(masterName, () -> randomFrom(internalCluster().getNodeNames())); + final String nonClusterManagerNode = randomValueOtherThan( + clusterManagerName, + () -> randomFrom(internalCluster().getNodeNames()) + ); assertAcked( - client(nonMasterNode).admin() + client(nonClusterManagerNode).admin() .cluster() .prepareUpdateSettings() .setPersistentSettings(Settings.builder().put(CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), value)) @@ -222,22 +225,25 @@ public void runRepeatedlyWhileChangingMaster(Runnable runnable) throws Exception assertingThread.start(); updatingThread.start(); - final MockTransportService masterTransportService = (MockTransportService) internalCluster().getInstance( + final MockTransportService clusterManagerTransportService = (MockTransportService) internalCluster().getInstance( TransportService.class, - masterName + clusterManagerName ); for (MockTransportService mockTransportService : mockTransportServices) { - if (masterTransportService != mockTransportService) { - masterTransportService.addFailToSendNoConnectRule(mockTransportService); - mockTransportService.addFailToSendNoConnectRule(masterTransportService); + if (clusterManagerTransportService != mockTransportService) { + clusterManagerTransportService.addFailToSendNoConnectRule(mockTransportService); + mockTransportService.addFailToSendNoConnectRule(clusterManagerTransportService); } } assertBusy(() -> { - final String nonMasterNode = randomValueOtherThan(masterName, () -> randomFrom(internalCluster().getNodeNames())); - final String claimedMasterName = internalCluster().getMasterName(nonMasterNode); - assertThat(claimedMasterName, not(equalTo(masterName))); + final String nonClusterManagerNode = randomValueOtherThan( + clusterManagerName, + () -> randomFrom(internalCluster().getNodeNames()) + ); + final String claimedClusterManagerName = internalCluster().getMasterName(nonClusterManagerNode); + assertThat(claimedClusterManagerName, not(equalTo(clusterManagerName))); }); shutdown.set(true); diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIT.java index 5b48268dfa89f..48e9f49ece629 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIT.java @@ -97,7 +97,7 @@ public void testNodeCounts() { for (int i = 0; i < numNodes; i++) { boolean isDataNode = randomBoolean(); boolean isIngestNode = randomBoolean(); - boolean isMasterNode = randomBoolean(); + boolean isClusterManagerNode = randomBoolean(); boolean isRemoteClusterClientNode = false; final Set roles = new HashSet<>(); if (isDataNode) { @@ -106,7 +106,7 @@ public void testNodeCounts() { if (isIngestNode) { roles.add(DiscoveryNodeRole.INGEST_ROLE); } - if (isMasterNode) { + if (isClusterManagerNode) { roles.add(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE); } if (isRemoteClusterClientNode) { @@ -128,14 +128,14 @@ public void testNodeCounts() { if (isIngestNode) { incrementCountForRole(DiscoveryNodeRole.INGEST_ROLE.roleName(), expectedCounts); } - if (isMasterNode) { + if (isClusterManagerNode) { incrementCountForRole(DiscoveryNodeRole.MASTER_ROLE.roleName(), expectedCounts); incrementCountForRole(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE.roleName(), expectedCounts); } if (isRemoteClusterClientNode) { incrementCountForRole(DiscoveryNodeRole.REMOTE_CLUSTER_CLIENT_ROLE.roleName(), expectedCounts); } - if (!isDataNode && !isMasterNode && !isIngestNode && !isRemoteClusterClientNode) { + if (!isDataNode && !isClusterManagerNode && !isIngestNode && !isRemoteClusterClientNode) { incrementCountForRole(ClusterStatsNodes.Counts.COORDINATING_ONLY, expectedCounts); } @@ -254,12 +254,12 @@ public void testAllocatedProcessors() throws Exception { } public void testClusterStatusWhenStateNotRecovered() throws Exception { - internalCluster().startMasterOnlyNode(Settings.builder().put("gateway.recover_after_nodes", 2).build()); + internalCluster().startClusterManagerOnlyNode(Settings.builder().put("gateway.recover_after_nodes", 2).build()); ClusterStatsResponse response = client().admin().cluster().prepareClusterStats().get(); assertThat(response.getStatus(), equalTo(ClusterHealthStatus.RED)); if (randomBoolean()) { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); } else { internalCluster().startDataOnlyNode(); } diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/exists/IndicesExistsIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/exists/IndicesExistsIT.java index f8be80948f8cf..810d8b9f2d226 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/exists/IndicesExistsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/exists/IndicesExistsIT.java @@ -48,7 +48,7 @@ public class IndicesExistsIT extends OpenSearchIntegTestCase { public void testIndexExistsWithBlocksInPlace() throws IOException { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); Settings settings = Settings.builder().put(GatewayService.RECOVER_AFTER_NODES_SETTING.getKey(), 99).build(); String node = internalCluster().startNode(settings); diff --git a/server/src/internalClusterTest/java/org/opensearch/action/support/master/IndexingMasterFailoverIT.java b/server/src/internalClusterTest/java/org/opensearch/action/support/master/IndexingMasterFailoverIT.java index f8db63bc8b61d..b4e4c058be198 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/support/master/IndexingMasterFailoverIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/support/master/IndexingMasterFailoverIT.java @@ -65,7 +65,7 @@ protected Collection> nodePlugins() { public void testMasterFailoverDuringIndexingWithMappingChanges() throws Throwable { logger.info("--> start 4 nodes, 3 master, 1 data"); - internalCluster().setBootstrapMasterNodeIndex(2); + internalCluster().setBootstrapClusterManagerNodeIndex(2); internalCluster().startMasterOnlyNodes(3, Settings.EMPTY); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterStateDiffIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterStateDiffIT.java index ea1daffaf770d..7654a937c8dc0 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterStateDiffIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterStateDiffIT.java @@ -93,9 +93,13 @@ public class ClusterStateDiffIT extends OpenSearchIntegTestCase { public void testClusterStateDiffSerialization() throws Exception { NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry(ClusterModule.getNamedWriteables()); - DiscoveryNode masterNode = randomNode("master"); + DiscoveryNode clusterManagerNode = randomNode("master"); DiscoveryNode otherNode = randomNode("other"); - DiscoveryNodes discoveryNodes = DiscoveryNodes.builder().add(masterNode).add(otherNode).localNodeId(masterNode.getId()).build(); + DiscoveryNodes discoveryNodes = DiscoveryNodes.builder() + .add(clusterManagerNode) + .add(otherNode) + .localNodeId(clusterManagerNode.getId()) + .build(); ClusterState clusterState = ClusterState.builder(new ClusterName("test")).nodes(discoveryNodes).build(); ClusterState clusterStateFromDiffs = ClusterState.Builder.fromBytes( ClusterState.Builder.toBytes(clusterState), diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java index 32899690799d3..4981da39197c3 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java @@ -84,7 +84,7 @@ protected Collection> nodePlugins() { } public void testTwoNodesNoMasterBlock() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(1); + internalCluster().setBootstrapClusterManagerNodeIndex(1); Settings settings = Settings.builder().put("discovery.initial_state_timeout", "500ms").build(); @@ -250,7 +250,7 @@ public void testTwoNodesNoMasterBlock() throws Exception { } public void testThreeNodesNoMasterBlock() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(2); + internalCluster().setBootstrapClusterManagerNodeIndex(2); Settings settings = Settings.builder().put("discovery.initial_state_timeout", "500ms").build(); @@ -309,11 +309,11 @@ public void testThreeNodesNoMasterBlock() throws Exception { assertHitCount(client().prepareSearch().setSize(0).setQuery(QueryBuilders.matchAllQuery()).execute().actionGet(), 100); } - List nonMasterNodes = new ArrayList<>( + List nonClusterManagerNodes = new ArrayList<>( Sets.difference(Sets.newHashSet(internalCluster().getNodeNames()), Collections.singleton(internalCluster().getMasterName())) ); - Settings nonMasterDataPathSettings1 = internalCluster().dataPathSettings(nonMasterNodes.get(0)); - Settings nonMasterDataPathSettings2 = internalCluster().dataPathSettings(nonMasterNodes.get(1)); + Settings nonMasterDataPathSettings1 = internalCluster().dataPathSettings(nonClusterManagerNodes.get(0)); + Settings nonMasterDataPathSettings2 = internalCluster().dataPathSettings(nonClusterManagerNodes.get(1)); internalCluster().stopRandomNonMasterNode(); internalCluster().stopRandomNonMasterNode(); @@ -340,7 +340,7 @@ public void testThreeNodesNoMasterBlock() throws Exception { } public void testCannotCommitStateThreeNodes() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(2); + internalCluster().setBootstrapClusterManagerNodeIndex(2); Settings settings = Settings.builder().put("discovery.initial_state_timeout", "500ms").build(); @@ -393,7 +393,7 @@ public void onFailure(String source, Exception e) { // otherwise persistent setting (which is a part of accepted state on old master) will be propagated to other nodes logger.debug("--> wait for master to be elected in major partition"); assertBusy(() -> { - DiscoveryNode masterNode = internalCluster().client(randomFrom(otherNodes)) + DiscoveryNode clusterManagerNode = internalCluster().client(randomFrom(otherNodes)) .admin() .cluster() .prepareState() @@ -402,8 +402,8 @@ public void onFailure(String source, Exception e) { .getState() .nodes() .getMasterNode(); - assertThat(masterNode, notNullValue()); - assertThat(masterNode.getName(), not(equalTo(master))); + assertThat(clusterManagerNode, notNullValue()); + assertThat(clusterManagerNode.getName(), not(equalTo(master))); }); partition.stopDisrupting(); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java index 5380b61c446d4..e72ce5d85303d 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java @@ -56,7 +56,7 @@ public class SpecificMasterNodesIT extends OpenSearchIntegTestCase { public void testSimpleOnlyMasterNodeElection() throws IOException { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); logger.info("--> start data node / non master node"); internalCluster().startNode(Settings.builder().put(dataOnlyNode()).put("discovery.initial_state_timeout", "1s")); try { @@ -77,7 +77,7 @@ public void testSimpleOnlyMasterNodeElection() throws IOException { // all is well, no cluster-manager elected } logger.info("--> start master node"); - final String masterNodeName = internalCluster().startMasterOnlyNode(); + final String masterNodeName = internalCluster().startClusterManagerOnlyNode(); assertThat( internalCluster().nonMasterClient() .admin() @@ -160,7 +160,7 @@ public void testSimpleOnlyMasterNodeElection() throws IOException { } public void testElectOnlyBetweenMasterNodes() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); logger.info("--> start data node / non master node"); internalCluster().startNode(Settings.builder().put(dataOnlyNode()).put("discovery.initial_state_timeout", "1s")); try { @@ -181,7 +181,7 @@ public void testElectOnlyBetweenMasterNodes() throws Exception { // all is well, no cluster-manager elected } logger.info("--> start master node (1)"); - final String masterNodeName = internalCluster().startMasterOnlyNode(); + final String masterNodeName = internalCluster().startClusterManagerOnlyNode(); assertThat( internalCluster().nonMasterClient() .admin() @@ -210,7 +210,7 @@ public void testElectOnlyBetweenMasterNodes() throws Exception { ); logger.info("--> start master node (2)"); - final String nextMasterEligableNodeName = internalCluster().startMasterOnlyNode(); + final String nextMasterEligableNodeName = internalCluster().startClusterManagerOnlyNode(); assertThat( internalCluster().nonMasterClient() .admin() @@ -312,9 +312,9 @@ public void testElectOnlyBetweenMasterNodes() throws Exception { } public void testAliasFilterValidation() { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); logger.info("--> start master node / non data"); - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); logger.info("--> start data node / non master node"); internalCluster().startDataOnlyNode(); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/RareClusterStateIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/RareClusterStateIT.java index 6f4c6fca77196..2e0ff9aeb5956 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/RareClusterStateIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/RareClusterStateIT.java @@ -173,7 +173,7 @@ private ActionFuture masterNodes = new ArrayList<>(); logger.info("--> start 1st cluster-manager-eligible node"); masterNodes.add( - internalCluster().startMasterOnlyNode( + internalCluster().startClusterManagerOnlyNode( Settings.builder().put(DiscoverySettings.INITIAL_STATE_TIMEOUT_SETTING.getKey(), "0s").build() ) ); // node ordinal 0 @@ -364,7 +364,7 @@ public void test3MasterNodes2Failed() throws Exception { ); logger.info("--> start 1st cluster-manager-eligible node"); - String masterNode2 = internalCluster().startMasterOnlyNode(master1DataPathSettings); + String masterNode2 = internalCluster().startClusterManagerOnlyNode(master1DataPathSettings); logger.info("--> detach-cluster on data-only node"); Environment environmentData = TestEnvironment.newEnvironment( @@ -410,15 +410,15 @@ public void test3MasterNodes2Failed() throws Exception { detachCluster(environmentMaster3, false); logger.info("--> start 2nd and 3rd cluster-manager-eligible nodes and ensure 4 nodes stable cluster"); - bootstrappedNodes.add(internalCluster().startMasterOnlyNode(master2DataPathSettings)); - bootstrappedNodes.add(internalCluster().startMasterOnlyNode(master3DataPathSettings)); + bootstrappedNodes.add(internalCluster().startClusterManagerOnlyNode(master2DataPathSettings)); + bootstrappedNodes.add(internalCluster().startClusterManagerOnlyNode(master3DataPathSettings)); ensureStableCluster(4); bootstrappedNodes.forEach(node -> ensureReadOnlyBlock(true, node)); removeBlock(); } public void testAllMasterEligibleNodesFailedDanglingIndexImport() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); Settings settings = Settings.builder().put(AUTO_IMPORT_DANGLING_INDICES_SETTING.getKey(), true).build(); @@ -478,21 +478,21 @@ public boolean clearData(String nodeName) { } public void testNoInitialBootstrapAfterDetach() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); - String masterNode = internalCluster().startMasterOnlyNode(); - Settings masterNodeDataPathSettings = internalCluster().dataPathSettings(masterNode); + internalCluster().setBootstrapClusterManagerNodeIndex(0); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); + Settings clusterManagerNodeDataPathSettings = internalCluster().dataPathSettings(clusterManagerNode); internalCluster().stopCurrentMasterNode(); final Environment environment = TestEnvironment.newEnvironment( - Settings.builder().put(internalCluster().getDefaultSettings()).put(masterNodeDataPathSettings).build() + Settings.builder().put(internalCluster().getDefaultSettings()).put(clusterManagerNodeDataPathSettings).build() ); detachCluster(environment); - String node = internalCluster().startMasterOnlyNode( + String node = internalCluster().startClusterManagerOnlyNode( Settings.builder() // give the cluster 2 seconds to elect the master (it should not) .put(DiscoverySettings.INITIAL_STATE_TIMEOUT_SETTING.getKey(), "2s") - .put(masterNodeDataPathSettings) + .put(clusterManagerNodeDataPathSettings) .build() ); @@ -503,9 +503,9 @@ public void testNoInitialBootstrapAfterDetach() throws Exception { } public void testCanRunUnsafeBootstrapAfterErroneousDetachWithoutLoosingMetadata() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); - String masterNode = internalCluster().startMasterOnlyNode(); - Settings masterNodeDataPathSettings = internalCluster().dataPathSettings(masterNode); + internalCluster().setBootstrapClusterManagerNodeIndex(0); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); + Settings clusterManagerNodeDataPathSettings = internalCluster().dataPathSettings(clusterManagerNode); ClusterUpdateSettingsRequest req = new ClusterUpdateSettingsRequest().persistentSettings( Settings.builder().put(INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey(), "1234kb") ); @@ -514,17 +514,17 @@ public void testCanRunUnsafeBootstrapAfterErroneousDetachWithoutLoosingMetadata( ClusterState state = internalCluster().client().admin().cluster().prepareState().execute().actionGet().getState(); assertThat(state.metadata().persistentSettings().get(INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey()), equalTo("1234kb")); - ensureReadOnlyBlock(false, masterNode); + ensureReadOnlyBlock(false, clusterManagerNode); internalCluster().stopCurrentMasterNode(); final Environment environment = TestEnvironment.newEnvironment( - Settings.builder().put(internalCluster().getDefaultSettings()).put(masterNodeDataPathSettings).build() + Settings.builder().put(internalCluster().getDefaultSettings()).put(clusterManagerNodeDataPathSettings).build() ); detachCluster(environment); unsafeBootstrap(environment); // read-only block will remain same as one before bootstrap, in this case it is false - String masterNode2 = internalCluster().startMasterOnlyNode(masterNodeDataPathSettings); + String masterNode2 = internalCluster().startClusterManagerOnlyNode(clusterManagerNodeDataPathSettings); ensureGreen(); ensureReadOnlyBlock(false, masterNode2); @@ -533,9 +533,9 @@ public void testCanRunUnsafeBootstrapAfterErroneousDetachWithoutLoosingMetadata( } public void testUnsafeBootstrapWithApplyClusterReadOnlyBlockAsFalse() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); - String masterNode = internalCluster().startMasterOnlyNode(); - Settings masterNodeDataPathSettings = internalCluster().dataPathSettings(masterNode); + internalCluster().setBootstrapClusterManagerNodeIndex(0); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); + Settings clusterManagerNodeDataPathSettings = internalCluster().dataPathSettings(clusterManagerNode); ClusterUpdateSettingsRequest req = new ClusterUpdateSettingsRequest().persistentSettings( Settings.builder().put(INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey(), "1234kb") ); @@ -544,18 +544,18 @@ public void testUnsafeBootstrapWithApplyClusterReadOnlyBlockAsFalse() throws Exc ClusterState state = internalCluster().client().admin().cluster().prepareState().execute().actionGet().getState(); assertThat(state.metadata().persistentSettings().get(INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey()), equalTo("1234kb")); - ensureReadOnlyBlock(false, masterNode); + ensureReadOnlyBlock(false, clusterManagerNode); internalCluster().stopCurrentMasterNode(); final Environment environment = TestEnvironment.newEnvironment( - Settings.builder().put(internalCluster().getDefaultSettings()).put(masterNodeDataPathSettings).build() + Settings.builder().put(internalCluster().getDefaultSettings()).put(clusterManagerNodeDataPathSettings).build() ); unsafeBootstrap(environment, false, false); - String masterNode2 = internalCluster().startMasterOnlyNode(masterNodeDataPathSettings); + String clusterManagerNode2 = internalCluster().startClusterManagerOnlyNode(clusterManagerNodeDataPathSettings); ensureGreen(); - ensureReadOnlyBlock(false, masterNode2); + ensureReadOnlyBlock(false, clusterManagerNode2); state = internalCluster().client().admin().cluster().prepareState().execute().actionGet().getState(); assertThat(state.metadata().settings().get(INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey()), equalTo("1234kb")); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/VotingConfigurationIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/VotingConfigurationIT.java index f73ec8dc4bcd0..ef2d52e2de7b9 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/VotingConfigurationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/VotingConfigurationIT.java @@ -62,7 +62,7 @@ protected Collection> nodePlugins() { } public void testAbdicateAfterVotingConfigExclusionAdded() throws ExecutionException, InterruptedException { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); internalCluster().startNodes(2); final String originalMaster = internalCluster().getMasterName(); @@ -73,7 +73,7 @@ public void testAbdicateAfterVotingConfigExclusionAdded() throws ExecutionExcept } public void testElectsNodeNotInVotingConfiguration() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); final List nodeNames = internalCluster().startNodes(4); // a 4-node cluster settles on a 3-node configuration; we then prevent the nodes in the configuration from winning an election diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/ZenDiscoveryIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/ZenDiscoveryIT.java index 1baac9071110a..d70da69853f17 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/ZenDiscoveryIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/ZenDiscoveryIT.java @@ -60,7 +60,7 @@ import static org.opensearch.action.admin.cluster.node.stats.NodesStatsRequest.Metric.DISCOVERY; import static org.opensearch.test.NodeRoles.dataNode; -import static org.opensearch.test.NodeRoles.masterOnlyNode; +import static org.opensearch.test.NodeRoles.clusterManagerOnlyNode; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; @@ -73,7 +73,7 @@ public class ZenDiscoveryIT extends OpenSearchIntegTestCase { public void testNoShardRelocationsOccurWhenElectedMasterNodeFails() throws Exception { - Settings masterNodeSettings = masterOnlyNode(); + Settings masterNodeSettings = clusterManagerOnlyNode(); internalCluster().startNodes(2, masterNodeSettings); Settings dateNodeSettings = dataNode(); internalCluster().startNodes(2, dateNodeSettings); @@ -106,10 +106,10 @@ public void testNoShardRelocationsOccurWhenElectedMasterNodeFails() throws Excep } public void testHandleNodeJoin_incompatibleClusterState() throws InterruptedException, ExecutionException, TimeoutException { - String masterNode = internalCluster().startMasterOnlyNode(); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); String node1 = internalCluster().startNode(); ClusterService clusterService = internalCluster().getInstance(ClusterService.class, node1); - Coordinator coordinator = (Coordinator) internalCluster().getInstance(Discovery.class, masterNode); + Coordinator coordinator = (Coordinator) internalCluster().getInstance(Discovery.class, clusterManagerNode); final ClusterState state = clusterService.state(); Metadata.Builder mdBuilder = Metadata.builder(state.metadata()); mdBuilder.putCustom(CustomMetadata.TYPE, new CustomMetadata("data")); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java index a20e944caebb2..7b0ffa0ceea32 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java @@ -100,7 +100,7 @@ public void testFailedRecoveryOnAllocateStalePrimaryRequiresAnotherAllocateStale // initial set up final String indexName = "index42"; - final String master = internalCluster().startMasterOnlyNode(); + final String clusterManager = internalCluster().startClusterManagerOnlyNode(); String node1 = internalCluster().startNode(); createIndex( indexName, diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/PrimaryAllocationIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/PrimaryAllocationIT.java index 55bdc2a4ac3c4..00e603e196a0c 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/PrimaryAllocationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/PrimaryAllocationIT.java @@ -110,7 +110,7 @@ protected boolean addMockInternalEngine() { } public void testBulkWeirdScenario() throws Exception { - String master = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String master = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNodes(2); assertAcked( @@ -203,7 +203,7 @@ private Settings createStaleReplicaScenario(String master) throws Exception { public void testDoNotAllowStaleReplicasToBePromotedToPrimary() throws Exception { logger.info("--> starting 3 nodes, 1 master, 2 data"); - String master = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String master = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNodes(2); assertAcked( client().admin() @@ -292,7 +292,7 @@ public void testFailedAllocationOfStalePrimaryToDataNodeWithNoData() throws Exce public void testForceStaleReplicaToBePromotedToPrimary() throws Exception { logger.info("--> starting 3 nodes, 1 master, 2 data"); - String master = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String clusterManager = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNodes(2); assertAcked( client().admin() @@ -305,7 +305,7 @@ public void testForceStaleReplicaToBePromotedToPrimary() throws Exception { Set historyUUIDs = Arrays.stream(client().admin().indices().prepareStats("test").clear().get().getShards()) .map(shard -> shard.getCommitStats().getUserData().get(Engine.HISTORY_UUID_KEY)) .collect(Collectors.toSet()); - createStaleReplicaScenario(master); + createStaleReplicaScenario(clusterManager); if (randomBoolean()) { assertAcked(client().admin().indices().prepareClose("test").setWaitForActiveShards(0)); } @@ -343,7 +343,7 @@ public void testForceStaleReplicaToBePromotedToPrimary() throws Exception { } logger.info("expected allocation ids: {} actual allocation ids: {}", expectedAllocationIds, allocationIds); }; - final ClusterService clusterService = internalCluster().getInstance(ClusterService.class, master); + final ClusterService clusterService = internalCluster().getInstance(ClusterService.class, clusterManager); clusterService.addListener(clusterStateListener); rerouteBuilder.get(); @@ -390,7 +390,7 @@ public void testForceStaleReplicaToBePromotedToPrimary() throws Exception { } public void testForceStaleReplicaToBePromotedToPrimaryOnWrongNode() throws Exception { - String master = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String clusterManager = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNodes(2); final String idxName = "test"; assertAcked( @@ -401,14 +401,14 @@ public void testForceStaleReplicaToBePromotedToPrimaryOnWrongNode() throws Excep .get() ); ensureGreen(); - createStaleReplicaScenario(master); + createStaleReplicaScenario(clusterManager); // Ensure the stopped primary's data is deleted so that it doesn't get picked up by the next datanode we start internalCluster().wipePendingDataDirectories(); internalCluster().startDataOnlyNodes(1); - ensureStableCluster(3, master); + ensureStableCluster(3, clusterManager); final int shardId = 0; final List nodeNames = new ArrayList<>(Arrays.asList(internalCluster().getNodeNames())); - nodeNames.remove(master); + nodeNames.remove(clusterManager); client().admin() .indices() .prepareShardStores(idxName) @@ -434,7 +434,7 @@ public void testForceStaleReplicaToBePromotedToPrimaryOnWrongNode() throws Excep } public void testForceStaleReplicaToBePromotedForGreenIndex() { - internalCluster().startMasterOnlyNode(Settings.EMPTY); + internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); final List dataNodes = internalCluster().startDataOnlyNodes(2); final String idxName = "test"; assertAcked( @@ -459,7 +459,7 @@ public void testForceStaleReplicaToBePromotedForGreenIndex() { } public void testForceStaleReplicaToBePromotedForMissingIndex() { - internalCluster().startMasterOnlyNode(Settings.EMPTY); + internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); final String dataNode = internalCluster().startDataOnlyNode(); final String idxName = "test"; IndexNotFoundException ex = expectThrows( @@ -497,7 +497,7 @@ public void testForcePrimaryShardIfAllocationDecidersSayNoAfterIndexCreation() t } public void testDoNotRemoveAllocationIdOnNodeLeave() throws Exception { - internalCluster().startMasterOnlyNode(Settings.EMPTY); + internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNode(Settings.EMPTY); assertAcked( client().admin() @@ -537,7 +537,7 @@ public boolean clearData(String nodeName) { } public void testRemoveAllocationIdOnWriteAfterNodeLeave() throws Exception { - internalCluster().startMasterOnlyNode(Settings.EMPTY); + internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNode(Settings.EMPTY); assertAcked( client().admin() @@ -657,7 +657,7 @@ public void testForceAllocatePrimaryOnNoDecision() throws Exception { * This test asserts that replicas failed to execute resync operations will be failed but not marked as stale. */ public void testPrimaryReplicaResyncFailed() throws Exception { - String master = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String master = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); final int numberOfReplicas = between(2, 3); final String oldPrimary = internalCluster().startDataOnlyNode(); assertAcked( diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java index eb3e61d83a948..2fe7efdf8fc3a 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java @@ -154,7 +154,7 @@ protected Collection> nodePlugins() { } public void testHighWatermarkNotExceeded() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String dataNodeName = internalCluster().startDataOnlyNode(); ensureStableCluster(3); @@ -189,7 +189,7 @@ public void testHighWatermarkNotExceeded() throws Exception { } public void testRestoreSnapshotAllocationDoesNotExceedWatermark() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String dataNodeName = internalCluster().startDataOnlyNode(); ensureStableCluster(3); diff --git a/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionCleanSettingsIT.java b/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionCleanSettingsIT.java index 61a47d2bb0237..7040bfb950663 100644 --- a/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionCleanSettingsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionCleanSettingsIT.java @@ -63,7 +63,7 @@ protected Collection> nodePlugins() { public void testSearchWithRelocationAndSlowClusterStateProcessing() throws Exception { // Don't use AbstractDisruptionTestCase.DEFAULT_SETTINGS as settings // (which can cause node disconnects on a slow CI machine) - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String node_1 = internalCluster().startDataOnlyNode(); logger.info("--> creating index [test] with one shard and on replica"); diff --git a/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionIT.java b/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionIT.java index ceec1315a9d59..c52918ee80fe0 100644 --- a/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionIT.java @@ -338,26 +338,26 @@ public void testRejoinDocumentExistsInAllShardCopies() throws Exception { // simulate handling of sending shard failure during an isolation public void testSendingShardFailure() throws Exception { List nodes = startCluster(3); - String masterNode = internalCluster().getMasterName(); - List nonMasterNodes = nodes.stream().filter(node -> !node.equals(masterNode)).collect(Collectors.toList()); - String nonMasterNode = randomFrom(nonMasterNodes); + String clusterManagerNode = internalCluster().getMasterName(); + List nonClusterManagerNodes = nodes.stream().filter(node -> !node.equals(clusterManagerNode)).collect(Collectors.toList()); + String nonClusterManagerNode = randomFrom(nonClusterManagerNodes); assertAcked( prepareCreate("test").setSettings( Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 3).put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 2) ) ); ensureGreen(); - String nonMasterNodeId = internalCluster().clusterService(nonMasterNode).localNode().getId(); + String nonClusterManagerNodeId = internalCluster().clusterService(nonClusterManagerNode).localNode().getId(); // fail a random shard ShardRouting failedShard = randomFrom( - clusterService().state().getRoutingNodes().node(nonMasterNodeId).shardsWithState(ShardRoutingState.STARTED) + clusterService().state().getRoutingNodes().node(nonClusterManagerNodeId).shardsWithState(ShardRoutingState.STARTED) ); - ShardStateAction service = internalCluster().getInstance(ShardStateAction.class, nonMasterNode); + ShardStateAction service = internalCluster().getInstance(ShardStateAction.class, nonClusterManagerNode); CountDownLatch latch = new CountDownLatch(1); AtomicBoolean success = new AtomicBoolean(); - String isolatedNode = randomBoolean() ? masterNode : nonMasterNode; + String isolatedNode = randomBoolean() ? clusterManagerNode : nonClusterManagerNode; TwoPartitions partitions = isolateNode(isolatedNode); // we cannot use the NetworkUnresponsive disruption type here as it will swallow the "shard failed" request, calling neither // onSuccess nor onFailure on the provided listener. @@ -385,10 +385,10 @@ public void onFailure(Exception e) { } ); - if (isolatedNode.equals(nonMasterNode)) { - assertNoMaster(nonMasterNode); + if (isolatedNode.equals(nonClusterManagerNode)) { + assertNoMaster(nonClusterManagerNode); } else { - ensureStableCluster(2, nonMasterNode); + ensureStableCluster(2, nonClusterManagerNode); } // heal the partition @@ -410,10 +410,10 @@ public void onFailure(Exception e) { } public void testCannotJoinIfMasterLostDataFolder() throws Exception { - String masterNode = internalCluster().startMasterOnlyNode(); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); String dataNode = internalCluster().startDataOnlyNode(); - internalCluster().restartNode(masterNode, new InternalTestCluster.RestartCallback() { + internalCluster().restartNode(clusterManagerNode, new InternalTestCluster.RestartCallback() { @Override public boolean clearData(String nodeName) { return true; @@ -442,9 +442,9 @@ public boolean validateClusterForming() { }); assertBusy(() -> { - assertFalse(internalCluster().client(masterNode).admin().cluster().prepareHealth().get().isTimedOut()); + assertFalse(internalCluster().client(clusterManagerNode).admin().cluster().prepareHealth().get().isTimedOut()); assertTrue( - internalCluster().client(masterNode) + internalCluster().client(clusterManagerNode) .admin() .cluster() .prepareHealth() diff --git a/server/src/internalClusterTest/java/org/opensearch/discovery/DiscoveryDisruptionIT.java b/server/src/internalClusterTest/java/org/opensearch/discovery/DiscoveryDisruptionIT.java index bea70bd0f5919..6fb311ba9a7b2 100644 --- a/server/src/internalClusterTest/java/org/opensearch/discovery/DiscoveryDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/discovery/DiscoveryDisruptionIT.java @@ -64,29 +64,29 @@ public class DiscoveryDisruptionIT extends AbstractDisruptionTestCase { * Test cluster join with issues in cluster state publishing * */ public void testClusterJoinDespiteOfPublishingIssues() throws Exception { - String masterNode = internalCluster().startMasterOnlyNode(); - String nonMasterNode = internalCluster().startDataOnlyNode(); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); + String nonClusterManagerNode = internalCluster().startDataOnlyNode(); - DiscoveryNodes discoveryNodes = internalCluster().getInstance(ClusterService.class, nonMasterNode).state().nodes(); + DiscoveryNodes discoveryNodes = internalCluster().getInstance(ClusterService.class, nonClusterManagerNode).state().nodes(); TransportService masterTranspotService = internalCluster().getInstance( TransportService.class, discoveryNodes.getMasterNode().getName() ); - logger.info("blocking requests from non master [{}] to master [{}]", nonMasterNode, masterNode); + logger.info("blocking requests from non master [{}] to master [{}]", nonClusterManagerNode, clusterManagerNode); MockTransportService nonMasterTransportService = (MockTransportService) internalCluster().getInstance( TransportService.class, - nonMasterNode + nonClusterManagerNode ); nonMasterTransportService.addFailToSendNoConnectRule(masterTranspotService); - assertNoMaster(nonMasterNode); + assertNoMaster(nonClusterManagerNode); - logger.info("blocking cluster state publishing from master [{}] to non master [{}]", masterNode, nonMasterNode); + logger.info("blocking cluster state publishing from master [{}] to non master [{}]", clusterManagerNode, nonClusterManagerNode); MockTransportService masterTransportService = (MockTransportService) internalCluster().getInstance( TransportService.class, - masterNode + clusterManagerNode ); TransportService localTransportService = internalCluster().getInstance( TransportService.class, @@ -98,7 +98,11 @@ public void testClusterJoinDespiteOfPublishingIssues() throws Exception { masterTransportService.addFailToSendNoConnectRule(localTransportService, PublicationTransportHandler.COMMIT_STATE_ACTION_NAME); } - logger.info("allowing requests from non master [{}] to master [{}], waiting for two join request", nonMasterNode, masterNode); + logger.info( + "allowing requests from non master [{}] to master [{}], waiting for two join request", + nonClusterManagerNode, + clusterManagerNode + ); final CountDownLatch countDownLatch = new CountDownLatch(2); nonMasterTransportService.addSendBehavior(masterTransportService, (connection, requestId, action, request, options) -> { if (action.equals(JoinHelper.JOIN_ACTION_NAME)) { @@ -197,31 +201,31 @@ public void testElectMasterWithLatestVersion() throws Exception { public void testNodeNotReachableFromMaster() throws Exception { startCluster(3); - String masterNode = internalCluster().getMasterName(); - String nonMasterNode = null; - while (nonMasterNode == null) { - nonMasterNode = randomFrom(internalCluster().getNodeNames()); - if (nonMasterNode.equals(masterNode)) { - nonMasterNode = null; + String clusterManagerNode = internalCluster().getMasterName(); + String nonClusterManagerNode = null; + while (nonClusterManagerNode == null) { + nonClusterManagerNode = randomFrom(internalCluster().getNodeNames()); + if (nonClusterManagerNode.equals(clusterManagerNode)) { + nonClusterManagerNode = null; } } - logger.info("blocking request from master [{}] to [{}]", masterNode, nonMasterNode); + logger.info("blocking request from master [{}] to [{}]", clusterManagerNode, nonClusterManagerNode); MockTransportService masterTransportService = (MockTransportService) internalCluster().getInstance( TransportService.class, - masterNode + clusterManagerNode ); if (randomBoolean()) { - masterTransportService.addUnresponsiveRule(internalCluster().getInstance(TransportService.class, nonMasterNode)); + masterTransportService.addUnresponsiveRule(internalCluster().getInstance(TransportService.class, nonClusterManagerNode)); } else { - masterTransportService.addFailToSendNoConnectRule(internalCluster().getInstance(TransportService.class, nonMasterNode)); + masterTransportService.addFailToSendNoConnectRule(internalCluster().getInstance(TransportService.class, nonClusterManagerNode)); } - logger.info("waiting for [{}] to be removed from cluster", nonMasterNode); - ensureStableCluster(2, masterNode); + logger.info("waiting for [{}] to be removed from cluster", nonClusterManagerNode); + ensureStableCluster(2, clusterManagerNode); - logger.info("waiting for [{}] to have no cluster-manager", nonMasterNode); - assertNoMaster(nonMasterNode); + logger.info("waiting for [{}] to have no cluster-manager", nonClusterManagerNode); + assertNoMaster(nonClusterManagerNode); logger.info("healing partition and checking cluster reforms"); masterTransportService.clearAllRules(); diff --git a/server/src/internalClusterTest/java/org/opensearch/discovery/MasterDisruptionIT.java b/server/src/internalClusterTest/java/org/opensearch/discovery/MasterDisruptionIT.java index 2434537d7a424..090423b380bf7 100644 --- a/server/src/internalClusterTest/java/org/opensearch/discovery/MasterDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/discovery/MasterDisruptionIT.java @@ -71,33 +71,40 @@ public class MasterDisruptionIT extends AbstractDisruptionTestCase { public void testMasterNodeGCs() throws Exception { List nodes = startCluster(3); - String oldMasterNode = internalCluster().getMasterName(); + String oldClusterManagerNode = internalCluster().getMasterName(); // a very long GC, but it's OK as we remove the disruption when it has had an effect - SingleNodeDisruption masterNodeDisruption = new IntermittentLongGCDisruption(random(), oldMasterNode, 100, 200, 30000, 60000); + SingleNodeDisruption masterNodeDisruption = new IntermittentLongGCDisruption( + random(), + oldClusterManagerNode, + 100, + 200, + 30000, + 60000 + ); internalCluster().setDisruptionScheme(masterNodeDisruption); masterNodeDisruption.startDisrupting(); - Set oldNonMasterNodesSet = new HashSet<>(nodes); - oldNonMasterNodesSet.remove(oldMasterNode); + Set oldNonClusterManagerNodesSet = new HashSet<>(nodes); + oldNonClusterManagerNodesSet.remove(oldClusterManagerNode); - List oldNonMasterNodes = new ArrayList<>(oldNonMasterNodesSet); + List oldNonClusterManagerNodes = new ArrayList<>(oldNonClusterManagerNodesSet); - logger.info("waiting for nodes to de-elect master [{}]", oldMasterNode); - for (String node : oldNonMasterNodesSet) { - assertDifferentMaster(node, oldMasterNode); + logger.info("waiting for nodes to de-elect master [{}]", oldClusterManagerNode); + for (String node : oldNonClusterManagerNodesSet) { + assertDifferentMaster(node, oldClusterManagerNode); } logger.info("waiting for nodes to elect a new master"); - ensureStableCluster(2, oldNonMasterNodes.get(0)); + ensureStableCluster(2, oldNonClusterManagerNodes.get(0)); // restore GC masterNodeDisruption.stopDisrupting(); final TimeValue waitTime = new TimeValue(DISRUPTION_HEALING_OVERHEAD.millis() + masterNodeDisruption.expectedTimeToHeal().millis()); - ensureStableCluster(3, waitTime, false, oldNonMasterNodes.get(0)); + ensureStableCluster(3, waitTime, false, oldNonClusterManagerNodes.get(0)); // make sure all nodes agree on master String newMaster = internalCluster().getMasterName(); - assertThat(newMaster, not(equalTo(oldMasterNode))); + assertThat(newMaster, not(equalTo(oldClusterManagerNode))); assertMaster(newMaster, nodes); } diff --git a/server/src/internalClusterTest/java/org/opensearch/discovery/StableMasterDisruptionIT.java b/server/src/internalClusterTest/java/org/opensearch/discovery/StableMasterDisruptionIT.java index 77553ba713540..614c5a13c3253 100644 --- a/server/src/internalClusterTest/java/org/opensearch/discovery/StableMasterDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/discovery/StableMasterDisruptionIT.java @@ -73,8 +73,8 @@ import static org.hamcrest.Matchers.equalTo; /** - * Tests relating to the loss of the master, but which work with the default fault detection settings which are rather lenient and will - * not detect a master failure too quickly. + * Tests relating to the loss of the cluster-manager, but which work with the default fault detection settings which are rather lenient and will + * not detect a cluster-manager failure too quickly. */ @OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST, numDataNodes = 0) public class StableMasterDisruptionIT extends OpenSearchIntegTestCase { @@ -228,9 +228,9 @@ public void testStaleMasterNotHijackingMajority() throws Exception { event.state(), event.previousState() ); - String previousMasterNodeName = previousMaster != null ? previousMaster.getName() : null; + String previousClusterManagerNodeName = previousMaster != null ? previousMaster.getName() : null; String currentMasterNodeName = currentMaster != null ? currentMaster.getName() : null; - masters.get(node).add(new Tuple<>(previousMasterNodeName, currentMasterNodeName)); + masters.get(node).add(new Tuple<>(previousClusterManagerNodeName, currentMasterNodeName)); } }); } diff --git a/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java b/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java index e2bbd0ee13db3..11ece43ea90d7 100644 --- a/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java @@ -56,7 +56,7 @@ public void testRepurpose() throws Exception { final String indexName = "test-repurpose"; logger.info("--> starting two nodes"); - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode( Settings.builder().put(IndicesService.WRITE_DANGLING_INDICES_INFO_SETTING.getKey(), false).build() ); @@ -71,20 +71,20 @@ public void testRepurpose() throws Exception { assertTrue(client().prepareGet(indexName, "1").get().isExists()); - final Settings masterNodeDataPathSettings = internalCluster().dataPathSettings(masterNode); + final Settings clusterManagerNodeDataPathSettings = internalCluster().dataPathSettings(clusterManagerNode); final Settings dataNodeDataPathSettings = internalCluster().dataPathSettings(dataNode); - final Settings noMasterNoDataSettings = NodeRoles.removeRoles( + final Settings noClusterManagerNoDataSettings = NodeRoles.removeRoles( Collections.unmodifiableSet(new HashSet<>(Arrays.asList(DiscoveryNodeRole.DATA_ROLE, DiscoveryNodeRole.MASTER_ROLE))) ); - final Settings noMasterNoDataSettingsForMasterNode = Settings.builder() - .put(noMasterNoDataSettings) - .put(masterNodeDataPathSettings) + final Settings noClusterManagerNoDataSettingsForClusterManagerNode = Settings.builder() + .put(noClusterManagerNoDataSettings) + .put(clusterManagerNodeDataPathSettings) .build(); - final Settings noMasterNoDataSettingsForDataNode = Settings.builder() - .put(noMasterNoDataSettings) + final Settings noClusterManagerNoDataSettingsForDataNode = Settings.builder() + .put(noClusterManagerNoDataSettings) .put(dataNodeDataPathSettings) .build(); @@ -99,11 +99,11 @@ public void testRepurpose() throws Exception { ); logger.info("--> Repurposing node 1"); - executeRepurposeCommand(noMasterNoDataSettingsForDataNode, 1, 1); + executeRepurposeCommand(noClusterManagerNoDataSettingsForDataNode, 1, 1); OpenSearchException lockedException = expectThrows( OpenSearchException.class, - () -> executeRepurposeCommand(noMasterNoDataSettingsForMasterNode, 1, 1) + () -> executeRepurposeCommand(noClusterManagerNoDataSettingsForClusterManagerNode, 1, 1) ); assertThat(lockedException.getMessage(), containsString(NodeRepurposeCommand.FAILED_TO_OBTAIN_NODE_LOCK_MSG)); @@ -119,11 +119,11 @@ public void testRepurpose() throws Exception { internalCluster().stopRandomNode(s -> true); internalCluster().stopRandomNode(s -> true); - executeRepurposeCommand(noMasterNoDataSettingsForMasterNode, 1, 0); + executeRepurposeCommand(noClusterManagerNoDataSettingsForClusterManagerNode, 1, 0); // by restarting as master and data node, we can check that the index definition was really deleted and also that the tool // does not mess things up so much that the nodes cannot boot as master or data node any longer. - internalCluster().startMasterOnlyNode(masterNodeDataPathSettings); + internalCluster().startClusterManagerOnlyNode(clusterManagerNodeDataPathSettings); internalCluster().startDataOnlyNode(dataNodeDataPathSettings); ensureGreen(); diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/GatewayIndexStateIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/GatewayIndexStateIT.java index a8828c7ad38b5..1542d6800eaa1 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/GatewayIndexStateIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/GatewayIndexStateIT.java @@ -277,7 +277,7 @@ public void testJustMasterNodeAndJustDataNode() { logger.info("--> cleaning nodes"); logger.info("--> starting 1 master node non data"); - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); logger.info("--> create an index"); diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/MetadataNodesIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/MetadataNodesIT.java index c9807aa24e259..c96a71d5b2617 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/MetadataNodesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/MetadataNodesIT.java @@ -60,7 +60,7 @@ public class MetadataNodesIT extends OpenSearchIntegTestCase { public void testMetaWrittenAlsoOnDataNode() throws Exception { // this test checks that index state is written on data only nodes if they have a shard allocated - String masterNode = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String masterNode = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); String dataNode = internalCluster().startDataOnlyNode(Settings.EMPTY); assertAcked(prepareCreate("test").setSettings(Settings.builder().put("index.number_of_replicas", 0))); index("test", "_doc", "1", jsonBuilder().startObject().field("text", "some text").endObject()); @@ -71,7 +71,7 @@ public void testMetaWrittenAlsoOnDataNode() throws Exception { public void testIndexFilesAreRemovedIfAllShardsFromIndexRemoved() throws Exception { // this test checks that the index data is removed from a data only node once all shards have been allocated away from it - String masterNode = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String masterNode = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); List nodeNames = internalCluster().startDataOnlyNodes(2); String node1 = nodeNames.get(0); String node2 = nodeNames.get(1); @@ -114,7 +114,7 @@ public void testIndexFilesAreRemovedIfAllShardsFromIndexRemoved() throws Excepti @SuppressWarnings("unchecked") public void testMetaWrittenWhenIndexIsClosedAndMetaUpdated() throws Exception { - String masterNode = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String masterNode = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); final String dataNode = internalCluster().startDataOnlyNode(Settings.EMPTY); final String index = "index"; diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoverAfterNodesIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoverAfterNodesIT.java index 7365ef1c8847d..77a9d37063c83 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoverAfterNodesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoverAfterNodesIT.java @@ -44,7 +44,7 @@ import java.util.Set; import static org.opensearch.test.NodeRoles.dataOnlyNode; -import static org.opensearch.test.NodeRoles.masterOnlyNode; +import static org.opensearch.test.NodeRoles.clusterManagerOnlyNode; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItem; @@ -75,7 +75,7 @@ public Client startNode(Settings.Builder settings) { } public void testRecoverAfterNodes() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); logger.info("--> start node (1)"); Client clientNode1 = startNode(Settings.builder().put("gateway.recover_after_nodes", 3)); assertThat( @@ -128,9 +128,9 @@ public void testRecoverAfterNodes() throws Exception { } public void testRecoverAfterMasterNodes() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); logger.info("--> start master_node (1)"); - Client master1 = startNode(Settings.builder().put("gateway.recover_after_master_nodes", 2).put(masterOnlyNode())); + Client master1 = startNode(Settings.builder().put("gateway.recover_after_master_nodes", 2).put(clusterManagerOnlyNode())); assertThat( master1.admin() .cluster() @@ -211,7 +211,7 @@ public void testRecoverAfterMasterNodes() throws Exception { ); logger.info("--> start master_node (2)"); - Client master2 = startNode(Settings.builder().put("gateway.recover_after_master_nodes", 2).put(masterOnlyNode())); + Client master2 = startNode(Settings.builder().put("gateway.recover_after_master_nodes", 2).put(clusterManagerOnlyNode())); assertThat(waitForNoBlocksOnNode(BLOCK_WAIT_TIMEOUT, master1).isEmpty(), equalTo(true)); assertThat(waitForNoBlocksOnNode(BLOCK_WAIT_TIMEOUT, master2).isEmpty(), equalTo(true)); assertThat(waitForNoBlocksOnNode(BLOCK_WAIT_TIMEOUT, data1).isEmpty(), equalTo(true)); @@ -219,9 +219,9 @@ public void testRecoverAfterMasterNodes() throws Exception { } public void testRecoverAfterDataNodes() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); logger.info("--> start master_node (1)"); - Client master1 = startNode(Settings.builder().put("gateway.recover_after_data_nodes", 2).put(masterOnlyNode())); + Client master1 = startNode(Settings.builder().put("gateway.recover_after_data_nodes", 2).put(clusterManagerOnlyNode())); assertThat( master1.admin() .cluster() @@ -263,7 +263,7 @@ public void testRecoverAfterDataNodes() throws Exception { ); logger.info("--> start master_node (2)"); - Client master2 = startNode(Settings.builder().put("gateway.recover_after_data_nodes", 2).put(masterOnlyNode())); + Client master2 = startNode(Settings.builder().put("gateway.recover_after_data_nodes", 2).put(clusterManagerOnlyNode())); assertThat( master2.admin() .cluster() diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java index 19939a5a3cbc0..79ffe12d13129 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java @@ -512,7 +512,7 @@ public void testLatestVersionLoaded() throws Exception { } public void testReuseInFileBasedPeerRecovery() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String primaryNode = internalCluster().startDataOnlyNode(nodeSettings(0)); // create the index with our mapping diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/ReplicaShardAllocatorIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/ReplicaShardAllocatorIT.java index 345ed668a3bf4..db46fb4424848 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/ReplicaShardAllocatorIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/ReplicaShardAllocatorIT.java @@ -327,7 +327,7 @@ public void testFullClusterRestartPerformNoopRecovery() throws Exception { public void testPreferCopyWithHighestMatchingOperations() throws Exception { String indexName = "test"; - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNodes(3); assertAcked( client().admin() @@ -402,7 +402,7 @@ public void testPreferCopyWithHighestMatchingOperations() throws Exception { * Make sure that we do not repeatedly cancel an ongoing recovery for a noop copy on a broken node. */ public void testDoNotCancelRecoveryForBrokenNode() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); String nodeWithPrimary = internalCluster().startDataOnlyNode(); String indexName = "test"; assertAcked( @@ -518,7 +518,7 @@ public void testPeerRecoveryForClosedIndices() throws Exception { * this behavior by changing the global checkpoint in phase1 to unassigned. */ public void testSimulateRecoverySourceOnOldNode() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); String source = internalCluster().startDataOnlyNode(); String indexName = "test"; assertAcked( diff --git a/server/src/internalClusterTest/java/org/opensearch/index/seqno/PeerRecoveryRetentionLeaseCreationIT.java b/server/src/internalClusterTest/java/org/opensearch/index/seqno/PeerRecoveryRetentionLeaseCreationIT.java index e1e969345d5ed..686911f8d4741 100644 --- a/server/src/internalClusterTest/java/org/opensearch/index/seqno/PeerRecoveryRetentionLeaseCreationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/index/seqno/PeerRecoveryRetentionLeaseCreationIT.java @@ -63,7 +63,7 @@ public void testCanRecoverFromStoreWithoutPeerRecoveryRetentionLease() throws Ex * primary that is recovering from store creates a lease for itself. */ - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final Path[] nodeDataPaths = internalCluster().getInstance(NodeEnvironment.class, dataNode).nodeDataPaths(); diff --git a/server/src/internalClusterTest/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommandIT.java b/server/src/internalClusterTest/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommandIT.java index 2dc241e278768..7f7914b1ead87 100644 --- a/server/src/internalClusterTest/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommandIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommandIT.java @@ -497,7 +497,7 @@ public Settings onNodeStopped(String nodeName) throws Exception { } public void testCorruptTranslogTruncationOfReplica() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String node1 = internalCluster().startDataOnlyNode(); final String node2 = internalCluster().startDataOnlyNode(); diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/mapping/DedicatedMasterGetFieldMappingIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/mapping/DedicatedMasterGetFieldMappingIT.java index 98134531d4f31..a4123ccc46ab6 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/mapping/DedicatedMasterGetFieldMappingIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/mapping/DedicatedMasterGetFieldMappingIT.java @@ -42,7 +42,7 @@ public class DedicatedMasterGetFieldMappingIT extends SimpleGetFieldMappingsIT { @Before public void before1() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startNode(); } diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/recovery/IndexRecoveryIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/recovery/IndexRecoveryIT.java index 27f3b3c8a28f4..09caf8f1e4358 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/recovery/IndexRecoveryIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/recovery/IndexRecoveryIT.java @@ -1212,7 +1212,7 @@ public void testDisconnectsDuringRecovery() throws Exception { .build(); TimeValue disconnectAfterDelay = TimeValue.timeValueMillis(randomIntBetween(0, 100)); // start a master node - String masterNodeName = internalCluster().startMasterOnlyNode(nodeSettings); + String masterNodeName = internalCluster().startClusterManagerOnlyNode(nodeSettings); final String blueNodeName = internalCluster().startNode( Settings.builder().put("node.attr.color", "blue").put(nodeSettings).build() @@ -2085,7 +2085,7 @@ public void testRepeatedRecovery() throws Exception { } public void testAllocateEmptyPrimaryResetsGlobalCheckpoint() throws Exception { - internalCluster().startMasterOnlyNode(Settings.EMPTY); + internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); final List dataNodes = internalCluster().startDataOnlyNodes(2); final Settings randomNodeDataPathSettings = internalCluster().dataPathSettings(randomFrom(dataNodes)); final String indexName = "test"; @@ -2185,7 +2185,7 @@ public void testPeerRecoveryTrimsLocalTranslog() throws Exception { } public void testCancelRecoveryWithAutoExpandReplicas() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); assertAcked( client().admin() .indices() diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/store/IndicesStoreIntegrationIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/store/IndicesStoreIntegrationIT.java index b85afa80496d0..2e35b7159b6aa 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/store/IndicesStoreIntegrationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/store/IndicesStoreIntegrationIT.java @@ -345,7 +345,7 @@ public void testShardsCleanup() throws Exception { } public void testShardActiveElsewhereDoesNotDeleteAnother() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final List nodes = internalCluster().startDataOnlyNodes(4); final String node1 = nodes.get(0); @@ -459,11 +459,11 @@ public void testShardActiveElsewhereDoesNotDeleteAnother() throws Exception { public void testShardActiveElseWhere() throws Exception { List nodes = internalCluster().startNodes(2); - final String masterNode = internalCluster().getMasterName(); - final String nonMasterNode = nodes.get(0).equals(masterNode) ? nodes.get(1) : nodes.get(0); + final String clusterManagerNode = internalCluster().getMasterName(); + final String nonClusterManagerNode = nodes.get(0).equals(clusterManagerNode) ? nodes.get(1) : nodes.get(0); - final String masterId = internalCluster().clusterService(masterNode).localNode().getId(); - final String nonMasterId = internalCluster().clusterService(nonMasterNode).localNode().getId(); + final String clusterManagerId = internalCluster().clusterService(clusterManagerNode).localNode().getId(); + final String nonClusterManagerId = internalCluster().clusterService(nonClusterManagerNode).localNode().getId(); final int numShards = scaledRandomIntBetween(2, 10); assertAcked( @@ -476,14 +476,14 @@ public void testShardActiveElseWhere() throws Exception { waitNoPendingTasksOnAll(); ClusterStateResponse stateResponse = client().admin().cluster().prepareState().get(); final Index index = stateResponse.getState().metadata().index("test").getIndex(); - RoutingNode routingNode = stateResponse.getState().getRoutingNodes().node(nonMasterId); + RoutingNode routingNode = stateResponse.getState().getRoutingNodes().node(nonClusterManagerId); final int[] node2Shards = new int[routingNode.numberOfOwningShards()]; int i = 0; for (ShardRouting shardRouting : routingNode) { node2Shards[i] = shardRouting.shardId().id(); i++; } - logger.info("Node [{}] has shards: {}", nonMasterNode, Arrays.toString(node2Shards)); + logger.info("Node [{}] has shards: {}", nonClusterManagerNode, Arrays.toString(node2Shards)); // disable relocations when we do this, to make sure the shards are not relocated from node2 // due to rebalancing, and delete its content @@ -496,14 +496,14 @@ public void testShardActiveElseWhere() throws Exception { ) .get(); - ClusterApplierService clusterApplierService = internalCluster().getInstance(ClusterService.class, nonMasterNode) + ClusterApplierService clusterApplierService = internalCluster().getInstance(ClusterService.class, nonClusterManagerNode) .getClusterApplierService(); ClusterState currentState = clusterApplierService.state(); IndexRoutingTable.Builder indexRoutingTableBuilder = IndexRoutingTable.builder(index); for (int j = 0; j < numShards; j++) { indexRoutingTableBuilder.addIndexShard( new IndexShardRoutingTable.Builder(new ShardId(index, j)).addShard( - TestShardRouting.newShardRouting("test", j, masterId, true, ShardRoutingState.STARTED) + TestShardRouting.newShardRouting("test", j, clusterManagerId, true, ShardRoutingState.STARTED) ).build() ); } @@ -528,7 +528,7 @@ public void onFailure(String source, Exception e) { waitNoPendingTasksOnAll(); logger.info("Checking if shards aren't removed"); for (int shard : node2Shards) { - assertShardExists(nonMasterNode, index, shard); + assertShardExists(nonClusterManagerNode, index, shard); } } diff --git a/server/src/internalClusterTest/java/org/opensearch/ingest/IngestClientIT.java b/server/src/internalClusterTest/java/org/opensearch/ingest/IngestClientIT.java index 2f666bbd65d4d..d577019590019 100644 --- a/server/src/internalClusterTest/java/org/opensearch/ingest/IngestClientIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/ingest/IngestClientIT.java @@ -302,8 +302,8 @@ public void testPutWithPipelineFactoryError() throws Exception { assertFalse(response.isFound()); } - public void testWithDedicatedMaster() throws Exception { - String masterOnlyNode = internalCluster().startMasterOnlyNode(); + public void testWithDedicatedClusterManager() throws Exception { + String clusterManagerOnlyNode = internalCluster().startClusterManagerOnlyNode(); BytesReference source = BytesReference.bytes( jsonBuilder().startObject() .field("description", "my_pipeline") @@ -318,7 +318,7 @@ public void testWithDedicatedMaster() throws Exception { PutPipelineRequest putPipelineRequest = new PutPipelineRequest("_id", source, XContentType.JSON); client().admin().cluster().putPipeline(putPipelineRequest).get(); - BulkItemResponse item = client(masterOnlyNode).prepareBulk() + BulkItemResponse item = client(clusterManagerOnlyNode).prepareBulk() .add(client().prepareIndex("test").setSource("field", "value2", "drop", true).setPipeline("_id")) .get() .getItems()[0]; diff --git a/server/src/internalClusterTest/java/org/opensearch/recovery/FullRollingRestartIT.java b/server/src/internalClusterTest/java/org/opensearch/recovery/FullRollingRestartIT.java index 15d1f3a0559a8..a8423312de271 100644 --- a/server/src/internalClusterTest/java/org/opensearch/recovery/FullRollingRestartIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/recovery/FullRollingRestartIT.java @@ -196,7 +196,7 @@ public void testFullRollingRestart() throws Exception { public void testNoRebalanceOnRollingRestart() throws Exception { // see https://github.com/elastic/elasticsearch/issues/14387 - internalCluster().startMasterOnlyNode(Settings.EMPTY); + internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNodes(3); /** * We start 3 nodes and a dedicated master. Restart on of the data-nodes and ensure that we got no relocations. diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/AbortedRestoreIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/AbortedRestoreIT.java index 6a8e45920e806..97faacb38bc50 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/AbortedRestoreIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/AbortedRestoreIT.java @@ -59,7 +59,7 @@ public class AbortedRestoreIT extends AbstractSnapshotIntegTestCase { public void testAbortedRestoreAlsoAbortFileRestores() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String indexName = "test-abort-restore"; diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/BlobStoreIncrementalityIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/BlobStoreIncrementalityIT.java index 5a3d2c6c4bafd..9a40ea2c95b28 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/BlobStoreIncrementalityIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/BlobStoreIncrementalityIT.java @@ -59,7 +59,7 @@ public class BlobStoreIncrementalityIT extends AbstractSnapshotIntegTestCase { public void testIncrementalBehaviorOnPrimaryFailover() throws InterruptedException, ExecutionException, IOException { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String primaryNode = internalCluster().startDataOnlyNode(); final String indexName = "test-index"; createIndex( @@ -148,7 +148,7 @@ public void testIncrementalBehaviorOnPrimaryFailover() throws InterruptedExcepti } public void testForceMergeCausesFullSnapshot() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().ensureAtLeastNumDataNodes(2); final String indexName = "test-index"; createIndex(indexName, Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).build()); diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/CloneSnapshotIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/CloneSnapshotIT.java index 137be2187fe57..7dc33294ce783 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/CloneSnapshotIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/CloneSnapshotIT.java @@ -72,7 +72,7 @@ public class CloneSnapshotIT extends AbstractSnapshotIntegTestCase { public void testShardClone() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "repo-name"; final Path repoPath = randomRepoPath(); @@ -143,7 +143,7 @@ public void testShardClone() throws Exception { } public void testCloneSnapshotIndex() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "repo-name"; createRepository(repoName, "fs"); @@ -172,7 +172,7 @@ public void testCloneSnapshotIndex() throws Exception { } public void testClonePreventsSnapshotDelete() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "repo-name"; createRepository(repoName, "mock"); @@ -185,9 +185,9 @@ public void testClonePreventsSnapshotDelete() throws Exception { indexRandomDocs(indexName, randomIntBetween(20, 100)); final String targetSnapshot = "target-snapshot"; - blockNodeOnAnyFiles(repoName, masterName); + blockNodeOnAnyFiles(repoName, clusterManagerName); final ActionFuture cloneFuture = startClone(repoName, sourceSnapshot, targetSnapshot, indexName); - waitForBlock(masterName, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L)); assertFalse(cloneFuture.isDone()); ConcurrentSnapshotExecutionException ex = expectThrows( @@ -196,7 +196,7 @@ public void testClonePreventsSnapshotDelete() throws Exception { ); assertThat(ex.getMessage(), containsString("cannot delete snapshot while it is being cloned")); - unblockNode(repoName, masterName); + unblockNode(repoName, clusterManagerName); assertAcked(cloneFuture.get()); final List status = clusterAdmin().prepareSnapshotStatus(repoName) .setSnapshots(sourceSnapshot, targetSnapshot) @@ -210,7 +210,7 @@ public void testClonePreventsSnapshotDelete() throws Exception { } public void testConcurrentCloneAndSnapshot() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "repo-name"; createRepository(repoName, "mock"); @@ -234,7 +234,7 @@ public void testConcurrentCloneAndSnapshot() throws Exception { public void testLongRunningCloneAllowsConcurrentSnapshot() throws Exception { // large snapshot pool so blocked snapshot threads from cloning don't prevent concurrent snapshot finalizations - final String masterNode = internalCluster().startMasterOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); + final String masterNode = internalCluster().startClusterManagerOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -263,7 +263,7 @@ public void testLongRunningCloneAllowsConcurrentSnapshot() throws Exception { } public void testLongRunningSnapshotAllowsConcurrentClone() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -293,7 +293,7 @@ public void testLongRunningSnapshotAllowsConcurrentClone() throws Exception { } public void testDeletePreventsClone() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "repo-name"; createRepository(repoName, "mock"); @@ -306,9 +306,9 @@ public void testDeletePreventsClone() throws Exception { indexRandomDocs(indexName, randomIntBetween(20, 100)); final String targetSnapshot = "target-snapshot"; - blockNodeOnAnyFiles(repoName, masterName); + blockNodeOnAnyFiles(repoName, clusterManagerName); final ActionFuture deleteFuture = startDeleteSnapshot(repoName, sourceSnapshot); - waitForBlock(masterName, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L)); assertFalse(deleteFuture.isDone()); ConcurrentSnapshotExecutionException ex = expectThrows( @@ -317,13 +317,13 @@ public void testDeletePreventsClone() throws Exception { ); assertThat(ex.getMessage(), containsString("cannot clone from snapshot that is being deleted")); - unblockNode(repoName, masterName); + unblockNode(repoName, clusterManagerName); assertAcked(deleteFuture.get()); } public void testBackToBackClonesForIndexNotInCluster() throws Exception { // large snapshot pool so blocked snapshot threads from cloning don't prevent concurrent snapshot finalizations - final String masterNode = internalCluster().startMasterOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); + final String masterNode = internalCluster().startClusterManagerOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -413,7 +413,7 @@ public void testMasterFailoverDuringCloneStep1() throws Exception { } public void testFailsOnCloneMissingIndices() { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "repo-name"; final Path repoPath = randomRepoPath(); @@ -481,7 +481,7 @@ public void testExceptionDuringShardClone() throws Exception { } public void testDoesNotStartOnBrokenSourceSnapshot() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -516,7 +516,7 @@ public void testDoesNotStartOnBrokenSourceSnapshot() throws Exception { } public void testStartSnapshotWithSuccessfulShardClonePendingFinalization() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); + final String masterName = internalCluster().startClusterManagerOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -546,7 +546,7 @@ public void testStartSnapshotWithSuccessfulShardClonePendingFinalization() throw } public void testStartCloneWithSuccessfulShardClonePendingFinalization() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -560,14 +560,14 @@ public void testStartCloneWithSuccessfulShardClonePendingFinalization() throws E blockMasterOnWriteIndexFile(repoName); final String cloneName = "clone-blocked"; final ActionFuture blockedClone = startClone(repoName, sourceSnapshot, cloneName, indexName); - waitForBlock(masterName, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L)); awaitNumberOfSnapshotsInProgress(1); final String otherCloneName = "other-clone"; final ActionFuture otherClone = startClone(repoName, sourceSnapshot, otherCloneName, indexName); awaitNumberOfSnapshotsInProgress(2); assertFalse(blockedClone.isDone()); - unblockNode(repoName, masterName); - awaitNoMoreRunningOperations(masterName); + unblockNode(repoName, clusterManagerName); + awaitNoMoreRunningOperations(clusterManagerName); awaitMasterFinishRepoOperations(); assertAcked(blockedClone.get()); assertAcked(otherClone.get()); @@ -576,7 +576,7 @@ public void testStartCloneWithSuccessfulShardClonePendingFinalization() throws E } public void testStartCloneWithSuccessfulShardSnapshotPendingFinalization() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); + final String masterName = internalCluster().startClusterManagerOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/ConcurrentSnapshotsIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/ConcurrentSnapshotsIT.java index 9adb0ff6260e8..edae4fa4a6b5e 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/ConcurrentSnapshotsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/ConcurrentSnapshotsIT.java @@ -106,7 +106,7 @@ protected Settings nodeSettings(int nodeOrdinal) { } public void testLongRunningSnapshotAllowsConcurrentSnapshot() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -139,7 +139,7 @@ public void testLongRunningSnapshotAllowsConcurrentSnapshot() throws Exception { } public void testDeletesAreBatched() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -205,7 +205,7 @@ public void testDeletesAreBatched() throws Exception { } public void testBlockedRepoDoesNotBlockOtherRepos() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String blockedRepoName = "test-repo-blocked"; final String otherRepoName = "test-repo"; @@ -231,7 +231,7 @@ public void testBlockedRepoDoesNotBlockOtherRepos() throws Exception { } public void testMultipleReposAreIndependent() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); // We're blocking a some of the snapshot threads when we block the first repo below so we have to make sure we have enough threads // left for the second concurrent snapshot. final String dataNode = startDataNodeWithLargeSnapshotPool(); @@ -255,7 +255,7 @@ public void testMultipleReposAreIndependent() throws Exception { } public void testMultipleReposAreIndependent2() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); // We're blocking a some of the snapshot threads when we block the first repo below so we have to make sure we have enough threads // left for the second repository's concurrent operations. final String dataNode = startDataNodeWithLargeSnapshotPool(); @@ -280,7 +280,7 @@ public void testMultipleReposAreIndependent2() throws Exception { } public void testMultipleReposAreIndependent3() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); + final String masterNode = internalCluster().startClusterManagerOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); internalCluster().startDataOnlyNode(); final String blockedRepoName = "test-repo-blocked"; final String otherRepoName = "test-repo"; @@ -301,7 +301,7 @@ public void testMultipleReposAreIndependent3() throws Exception { } public void testSnapshotRunsAfterInProgressDelete() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -314,11 +314,11 @@ public void testSnapshotRunsAfterInProgressDelete() throws Exception { blockMasterFromFinalizingSnapshotOnIndexFile(repoName); final ActionFuture deleteFuture = startDeleteSnapshot(repoName, firstSnapshot); - waitForBlock(masterNode, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerNode, repoName, TimeValue.timeValueSeconds(30L)); final ActionFuture snapshotFuture = startFullSnapshot(repoName, "second-snapshot"); - unblockNode(repoName, masterNode); + unblockNode(repoName, clusterManagerNode); final UncategorizedExecutionException ex = expectThrows(UncategorizedExecutionException.class, deleteFuture::actionGet); assertThat(ex.getRootCause(), instanceOf(IOException.class)); @@ -326,7 +326,7 @@ public void testSnapshotRunsAfterInProgressDelete() throws Exception { } public void testAbortOneOfMultipleSnapshots() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -386,7 +386,7 @@ public void testAbortOneOfMultipleSnapshots() throws Exception { } public void testCascadedAborts() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -540,7 +540,7 @@ public void testMasterFailOverWithQueuedDeletes() throws Exception { } public void testAssertMultipleSnapshotsAndPrimaryFailOver() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -571,7 +571,7 @@ public void testAssertMultipleSnapshotsAndPrimaryFailOver() throws Exception { } public void testQueuedDeletesWithFailures() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -580,7 +580,7 @@ public void testQueuedDeletesWithFailures() throws Exception { blockMasterFromFinalizingSnapshotOnIndexFile(repoName); final ActionFuture firstDeleteFuture = startDeleteSnapshot(repoName, "*"); - waitForBlock(masterNode, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerNode, repoName, TimeValue.timeValueSeconds(30L)); final ActionFuture snapshotFuture = startFullSnapshot(repoName, "snapshot-queued"); awaitNumberOfSnapshotsInProgress(1); @@ -588,7 +588,7 @@ public void testQueuedDeletesWithFailures() throws Exception { final ActionFuture secondDeleteFuture = startDeleteSnapshot(repoName, "*"); awaitNDeletionsInProgress(2); - unblockNode(repoName, masterNode); + unblockNode(repoName, clusterManagerNode); expectThrows(UncategorizedExecutionException.class, firstDeleteFuture::actionGet); // Second delete works out cleanly since the repo is unblocked now @@ -601,7 +601,7 @@ public void testQueuedDeletesWithFailures() throws Exception { } public void testQueuedDeletesWithOverlap() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -615,7 +615,7 @@ public void testQueuedDeletesWithOverlap() throws Exception { final ActionFuture secondDeleteFuture = startDeleteSnapshot(repoName, "*"); awaitNDeletionsInProgress(2); - unblockNode(repoName, masterNode); + unblockNode(repoName, clusterManagerNode); assertThat(firstDeleteFuture.get().isAcknowledged(), is(true)); // Second delete works out cleanly since the repo is unblocked now @@ -878,7 +878,7 @@ public void testQueuedSnapshotOperationsAndBrokenRepoOnMasterFailOverMultipleRep } public void testMultipleSnapshotsQueuedAfterDelete() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -889,7 +889,7 @@ public void testMultipleSnapshotsQueuedAfterDelete() throws Exception { final ActionFuture snapshotThree = startFullSnapshot(repoName, "snapshot-three"); final ActionFuture snapshotFour = startFullSnapshot(repoName, "snapshot-four"); - unblockNode(repoName, masterNode); + unblockNode(repoName, clusterManagerNode); assertSuccessful(snapshotThree); assertSuccessful(snapshotFour); @@ -897,7 +897,7 @@ public void testMultipleSnapshotsQueuedAfterDelete() throws Exception { } public void testMultiplePartialSnapshotsQueuedAfterDelete() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -911,7 +911,7 @@ public void testMultiplePartialSnapshotsQueuedAfterDelete() throws Exception { awaitNumberOfSnapshotsInProgress(2); assertAcked(client().admin().indices().prepareDelete("index-two")); - unblockNode(repoName, masterNode); + unblockNode(repoName, clusterManagerNode); assertThat(snapshotThree.get().getSnapshotInfo().state(), is(SnapshotState.PARTIAL)); assertThat(snapshotFour.get().getSnapshotInfo().state(), is(SnapshotState.PARTIAL)); @@ -919,7 +919,7 @@ public void testMultiplePartialSnapshotsQueuedAfterDelete() throws Exception { } public void testQueuedSnapshotsWaitingForShardReady() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNodes(2); final String repoName = "test-repo"; createRepository(repoName, "fs"); @@ -977,7 +977,7 @@ public void testQueuedSnapshotsWaitingForShardReady() throws Exception { } public void testBackToBackQueuedDeletes() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -990,7 +990,7 @@ public void testBackToBackQueuedDeletes() throws Exception { final ActionFuture deleteSnapshotTwo = startDeleteSnapshot(repoName, snapshotTwo); awaitNDeletionsInProgress(2); - unblockNode(repoName, masterName); + unblockNode(repoName, clusterManagerName); assertAcked(deleteSnapshotOne.get()); assertAcked(deleteSnapshotTwo.get()); @@ -1024,7 +1024,7 @@ public void testQueuedOperationsAfterFinalizationFailure() throws Exception { } public void testStartDeleteDuringFinalizationCleanup() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -1033,35 +1033,35 @@ public void testStartDeleteDuringFinalizationCleanup() throws Exception { final String snapshotName = "snap-name"; blockMasterFromDeletingIndexNFile(repoName); final ActionFuture snapshotFuture = startFullSnapshot(repoName, snapshotName); - waitForBlock(masterName, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L)); final ActionFuture deleteFuture = startDeleteSnapshot(repoName, snapshotName); awaitNDeletionsInProgress(1); - unblockNode(repoName, masterName); + unblockNode(repoName, clusterManagerName); assertSuccessful(snapshotFuture); assertAcked(deleteFuture.get(30L, TimeUnit.SECONDS)); } public void testEquivalentDeletesAreDeduplicated() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); createIndexWithContent("index-test"); createNSnapshots(repoName, randomIntBetween(1, 5)); - blockNodeOnAnyFiles(repoName, masterName); + blockNodeOnAnyFiles(repoName, clusterManagerName); final int deletes = randomIntBetween(2, 10); final List> deleteResponses = new ArrayList<>(deletes); for (int i = 0; i < deletes; ++i) { deleteResponses.add(client().admin().cluster().prepareDeleteSnapshot(repoName, "*").execute()); } - waitForBlock(masterName, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L)); awaitNDeletionsInProgress(1); for (ActionFuture deleteResponse : deleteResponses) { assertFalse(deleteResponse.isDone()); } awaitNDeletionsInProgress(1); - unblockNode(repoName, masterName); + unblockNode(repoName, clusterManagerName); for (ActionFuture deleteResponse : deleteResponses) { assertAcked(deleteResponse.get()); } @@ -1102,7 +1102,7 @@ public void testMasterFailoverOnFinalizationLoop() throws Exception { } public void testStatusMultipleSnapshotsMultipleRepos() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); // We're blocking a some of the snapshot threads when we block the first repo below so we have to make sure we have enough threads // left for the second concurrent snapshot. final String dataNode = startDataNodeWithLargeSnapshotPool(); @@ -1146,7 +1146,7 @@ public void testStatusMultipleSnapshotsMultipleRepos() throws Exception { } public void testInterleavedAcrossMultipleRepos() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); // We're blocking a some of the snapshot threads when we block the first repo below so we have to make sure we have enough threads // left for the second concurrent snapshot. final String dataNode = startDataNodeWithLargeSnapshotPool(); @@ -1219,7 +1219,7 @@ public void testMasterFailoverAndMultipleQueuedUpSnapshotsAcrossTwoRepos() throw } public void testConcurrentOperationsLimit() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -1237,7 +1237,7 @@ public void testConcurrentOperationsLimit() throws Exception { ); final List snapshotNames = createNSnapshots(repoName, limitToTest + 1); - blockNodeOnAnyFiles(repoName, masterName); + blockNodeOnAnyFiles(repoName, clusterManagerName); int blockedSnapshots = 0; boolean blockedDelete = false; final List> snapshotFutures = new ArrayList<>(); @@ -1255,7 +1255,7 @@ public void testConcurrentOperationsLimit() throws Exception { if (blockedDelete) { awaitNDeletionsInProgress(1); } - waitForBlock(masterName, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L)); final String expectedFailureMessage = "Cannot start another operation, already running [" + limitToTest @@ -1275,7 +1275,7 @@ public void testConcurrentOperationsLimit() throws Exception { assertThat(csen2.getMessage(), containsString(expectedFailureMessage)); } - unblockNode(repoName, masterName); + unblockNode(repoName, clusterManagerName); if (deleteFuture != null) { assertAcked(deleteFuture.get()); } @@ -1285,7 +1285,7 @@ public void testConcurrentOperationsLimit() throws Exception { } public void testConcurrentSnapshotWorksWithOldVersionRepo() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; final Path repoPath = randomRepoPath(); @@ -1322,23 +1322,23 @@ public void testConcurrentSnapshotWorksWithOldVersionRepo() throws Exception { } public void testQueuedDeleteAfterFinalizationFailure() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); blockMasterFromFinalizingSnapshotOnIndexFile(repoName); final String snapshotName = "snap-1"; final ActionFuture snapshotFuture = startFullSnapshot(repoName, snapshotName); - waitForBlock(masterNode, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerNode, repoName, TimeValue.timeValueSeconds(30L)); final ActionFuture deleteFuture = startDeleteSnapshot(repoName, snapshotName); awaitNDeletionsInProgress(1); - unblockNode(repoName, masterNode); + unblockNode(repoName, clusterManagerNode); assertAcked(deleteFuture.get()); final SnapshotException sne = expectThrows(SnapshotException.class, snapshotFuture::actionGet); assertThat(sne.getCause().getMessage(), containsString("exception after block")); } public void testAbortNotStartedSnapshotWithoutIO() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -1365,7 +1365,7 @@ public void testAbortNotStartedSnapshotWithoutIO() throws Exception { } public void testStartWithSuccessfulShardSnapshotPendingFinalization() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -1375,13 +1375,13 @@ public void testStartWithSuccessfulShardSnapshotPendingFinalization() throws Exc blockMasterOnWriteIndexFile(repoName); final ActionFuture blockedSnapshot = startFullSnapshot(repoName, "snap-blocked"); - waitForBlock(masterName, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L)); awaitNumberOfSnapshotsInProgress(1); blockNodeOnAnyFiles(repoName, dataNode); final ActionFuture otherSnapshot = startFullSnapshot(repoName, "other-snapshot"); awaitNumberOfSnapshotsInProgress(2); assertFalse(blockedSnapshot.isDone()); - unblockNode(repoName, masterName); + unblockNode(repoName, clusterManagerName); awaitNumberOfSnapshotsInProgress(1); awaitMasterFinishRepoOperations(); diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/DedicatedClusterSnapshotRestoreIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/DedicatedClusterSnapshotRestoreIT.java index 0c392dbe8bbe6..46638f31b6cca 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/DedicatedClusterSnapshotRestoreIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/DedicatedClusterSnapshotRestoreIT.java @@ -926,7 +926,7 @@ public void testMasterAndDataShutdownDuringSnapshot() throws Exception { */ public void testRestoreShrinkIndex() throws Exception { logger.info("--> starting a cluster-manager node and a data node"); - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repo = "test-repo"; @@ -1145,7 +1145,7 @@ public void testDeduplicateIndexMetadata() throws Exception { public void testDataNodeRestartWithBusyMasterDuringSnapshot() throws Exception { logger.info("--> starting a cluster-manager node and two data nodes"); - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNodes(2); final Path repoPath = randomRepoPath(); createRepository("test-repo", "mock", repoPath); @@ -1201,7 +1201,7 @@ public void testDataNodeRestartWithBusyMasterDuringSnapshot() throws Exception { public void testDataNodeRestartAfterShardSnapshotFailure() throws Exception { logger.info("--> starting a cluster-manager node and two data nodes"); - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final List dataNodes = internalCluster().startDataOnlyNodes(2); final Path repoPath = randomRepoPath(); createRepository("test-repo", "mock", repoPath); @@ -1323,7 +1323,7 @@ public void testRetentionLeasesClearedOnRestore() throws Exception { } public void testAbortWaitsOnDataNode() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNodeName = internalCluster().startDataOnlyNode(); final String indexName = "test-index"; createIndex(indexName); @@ -1375,7 +1375,7 @@ public void onRequestSent( } public void testPartialSnapshotAllShardsMissing() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "fs"); @@ -1393,7 +1393,7 @@ public void testPartialSnapshotAllShardsMissing() throws Exception { * correctly by testing a snapshot name collision. */ public void testCreateSnapshotLegacyPath() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "fs"); @@ -1403,7 +1403,7 @@ public void testCreateSnapshotLegacyPath() throws Exception { final Snapshot snapshot1 = PlainActionFuture.get( f -> snapshotsService.createSnapshotLegacy(new CreateSnapshotRequest(repoName, "snap-1"), f) ); - awaitNoMoreRunningOperations(masterNode); + awaitNoMoreRunningOperations(clusterManagerNode); final InvalidSnapshotNameException sne = expectThrows( InvalidSnapshotNameException.class, @@ -1425,7 +1425,7 @@ public void testCreateSnapshotLegacyPath() throws Exception { } public void testSnapshotDeleteRelocatingPrimaryIndex() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final List dataNodes = internalCluster().startDataOnlyNodes(2); final String repoName = "test-repo"; createRepository(repoName, "fs"); diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/MultiClusterRepoAccessIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/MultiClusterRepoAccessIT.java index 2b2b656d5dd0e..13aee8b8e18a6 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/MultiClusterRepoAccessIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/MultiClusterRepoAccessIT.java @@ -107,13 +107,13 @@ public void stopSecondCluster() throws IOException { } public void testConcurrentDeleteFromOtherCluster() throws InterruptedException { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoNameOnFirstCluster = "test-repo"; final String repoNameOnSecondCluster = randomBoolean() ? "test-repo" : "other-repo"; createRepository(repoNameOnFirstCluster, "fs", repoPath); - secondCluster.startMasterOnlyNode(); + secondCluster.startClusterManagerOnlyNode(); secondCluster.startDataOnlyNode(); secondCluster.client() .admin() diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/SnapshotShardsServiceIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/SnapshotShardsServiceIT.java index 762656e251659..4543a3e0a1b6d 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/SnapshotShardsServiceIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/SnapshotShardsServiceIT.java @@ -60,7 +60,7 @@ protected Collection> nodePlugins() { } public void testRetryPostingSnapshotStatusMessages() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); createRepository("test-repo", "mock"); diff --git a/server/src/test/java/org/opensearch/cluster/routing/DelayedAllocationServiceTests.java b/server/src/test/java/org/opensearch/cluster/routing/DelayedAllocationServiceTests.java index 1f45c5c1dfce4..635dfe409058a 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/DelayedAllocationServiceTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/DelayedAllocationServiceTests.java @@ -83,7 +83,7 @@ public void createDelayedAllocationService() { threadPool = new TestThreadPool(getTestName()); clusterService = mock(ClusterService.class); allocationService = createAllocationService(Settings.EMPTY, new DelayedShardsMockGatewayAllocator()); - when(clusterService.getSettings()).thenReturn(NodeRoles.masterOnlyNode()); + when(clusterService.getSettings()).thenReturn(NodeRoles.clusterManagerOnlyNode()); delayedAllocationService = new TestDelayAllocationService(threadPool, clusterService, allocationService); verify(clusterService).addListener(delayedAllocationService); verify(clusterService).getSettings(); diff --git a/server/src/test/java/org/opensearch/cluster/routing/allocation/AllocationCommandsTests.java b/server/src/test/java/org/opensearch/cluster/routing/allocation/AllocationCommandsTests.java index cda0f1afaf62c..4db9c0cf49b73 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/allocation/AllocationCommandsTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/allocation/AllocationCommandsTests.java @@ -737,7 +737,7 @@ public void testMoveShardToNonDataNode() { "test1", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ); DiscoveryNode node2 = new DiscoveryNode( @@ -808,7 +808,7 @@ public void testMoveShardFromNonDataNode() { "test1", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ); DiscoveryNode node2 = new DiscoveryNode( diff --git a/server/src/test/java/org/opensearch/cluster/routing/allocation/NodeVersionAllocationDeciderTests.java b/server/src/test/java/org/opensearch/cluster/routing/allocation/NodeVersionAllocationDeciderTests.java index 5972cc9981254..38e24af421475 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/allocation/NodeVersionAllocationDeciderTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/allocation/NodeVersionAllocationDeciderTests.java @@ -338,21 +338,21 @@ public void testRebalanceDoesNotAllocatePrimaryAndReplicasOnDifferentVersionNode "newNode", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ); final DiscoveryNode oldNode1 = new DiscoveryNode( "oldNode1", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, VersionUtils.getPreviousVersion() ); final DiscoveryNode oldNode2 = new DiscoveryNode( "oldNode2", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, VersionUtils.getPreviousVersion() ); AllocationId allocationId1P = AllocationId.newInitializing(); @@ -457,21 +457,21 @@ public void testRestoreDoesNotAllocateSnapshotOnOlderNodes() { "newNode", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ); final DiscoveryNode oldNode1 = new DiscoveryNode( "oldNode1", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, VersionUtils.getPreviousVersion() ); final DiscoveryNode oldNode2 = new DiscoveryNode( "oldNode2", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, VersionUtils.getPreviousVersion() ); diff --git a/server/src/test/java/org/opensearch/cluster/routing/allocation/SameShardRoutingTests.java b/server/src/test/java/org/opensearch/cluster/routing/allocation/SameShardRoutingTests.java index 36cb68e460418..cd19f78d54be5 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/allocation/SameShardRoutingTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/allocation/SameShardRoutingTests.java @@ -96,7 +96,7 @@ public void testSameHost() { "test1", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ) ) @@ -109,7 +109,7 @@ public void testSameHost() { "test1", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ) ) @@ -138,7 +138,7 @@ public void testSameHost() { "test2", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ) ) diff --git a/server/src/test/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderTests.java b/server/src/test/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderTests.java index a2fcf14638d45..cbf624cdad2ca 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderTests.java @@ -921,14 +921,14 @@ public void testCanRemainWithShardRelocatingAway() { "node1", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ); DiscoveryNode discoveryNode2 = new DiscoveryNode( "node2", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ); DiscoveryNodes discoveryNodes = DiscoveryNodes.builder().add(discoveryNode1).add(discoveryNode2).build(); diff --git a/server/src/test/java/org/opensearch/gateway/IncrementalClusterStateWriterTests.java b/server/src/test/java/org/opensearch/gateway/IncrementalClusterStateWriterTests.java index 21d5c897c4a7d..1907abbfcaabd 100644 --- a/server/src/test/java/org/opensearch/gateway/IncrementalClusterStateWriterTests.java +++ b/server/src/test/java/org/opensearch/gateway/IncrementalClusterStateWriterTests.java @@ -181,8 +181,8 @@ private ClusterState clusterStateWithReplicatedClosedIndex(IndexMetadata indexMe private DiscoveryNodes.Builder generateDiscoveryNodes(boolean masterEligible) { Set dataOnlyRoles = Collections.singleton(DiscoveryNodeRole.DATA_ROLE); return DiscoveryNodes.builder() - .add(newNode("node1", masterEligible ? MASTER_DATA_ROLES : dataOnlyRoles)) - .add(newNode("master_node", MASTER_DATA_ROLES)) + .add(newNode("node1", masterEligible ? CLUSTER_MANAGER_DATA_ROLES : dataOnlyRoles)) + .add(newNode("master_node", CLUSTER_MANAGER_DATA_ROLES)) .localNodeId("node1") .masterNodeId(masterEligible ? "node1" : "master_node"); } diff --git a/server/src/test/java/org/opensearch/transport/RemoteClusterServiceTests.java b/server/src/test/java/org/opensearch/transport/RemoteClusterServiceTests.java index 75ba1fb56aa1d..0092763b4ba20 100644 --- a/server/src/test/java/org/opensearch/transport/RemoteClusterServiceTests.java +++ b/server/src/test/java/org/opensearch/transport/RemoteClusterServiceTests.java @@ -62,7 +62,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiFunction; -import static org.opensearch.test.NodeRoles.masterOnlyNode; +import static org.opensearch.test.NodeRoles.clusterManagerOnlyNode; import static org.opensearch.test.NodeRoles.nonMasterNode; import static org.opensearch.test.NodeRoles.removeRoles; import static org.hamcrest.Matchers.either; @@ -553,7 +553,7 @@ public void testRemoteNodeRoles() throws IOException, InterruptedException { final Settings settings = Settings.EMPTY; final List knownNodes = new CopyOnWriteArrayList<>(); final Settings data = nonMasterNode(); - final Settings dedicatedMaster = masterOnlyNode(); + final Settings dedicatedMaster = clusterManagerOnlyNode(); try ( MockTransportService c1N1 = startTransport("cluster_1_node_1", knownNodes, Version.CURRENT, dedicatedMaster); MockTransportService c1N2 = startTransport("cluster_1_node_2", knownNodes, Version.CURRENT, data); diff --git a/test/framework/src/main/java/org/opensearch/action/support/replication/ClusterStateCreationUtils.java b/test/framework/src/main/java/org/opensearch/action/support/replication/ClusterStateCreationUtils.java index 72ca3617c40a3..18f8f4e584748 100644 --- a/test/framework/src/main/java/org/opensearch/action/support/replication/ClusterStateCreationUtils.java +++ b/test/framework/src/main/java/org/opensearch/action/support/replication/ClusterStateCreationUtils.java @@ -97,7 +97,7 @@ public static ClusterState state( numberOfNodes++; } } - numberOfNodes = Math.max(2, numberOfNodes); // we need a non-local master to test shard failures + numberOfNodes = Math.max(2, numberOfNodes); // we need a non-local cluster-manager to test shard failures final ShardId shardId = new ShardId(index, "_na_", 0); DiscoveryNodes.Builder discoBuilder = DiscoveryNodes.builder(); Set unassignedNodes = new HashSet<>(); @@ -107,7 +107,7 @@ public static ClusterState state( unassignedNodes.add(node.getId()); } discoBuilder.localNodeId(newNode(0).getId()); - discoBuilder.masterNodeId(newNode(1).getId()); // we need a non-local master to test shard failures + discoBuilder.masterNodeId(newNode(1).getId()); // we need a non-local cluster-manager to test shard failures final int primaryTerm = 1 + randomInt(200); IndexMetadata indexMetadata = IndexMetadata.builder(index) .settings( @@ -284,14 +284,14 @@ public static ClusterState state(final int numberOfNodes, final String[] indices */ public static ClusterState stateWithAssignedPrimariesAndOneReplica(String index, int numberOfShards) { - int numberOfNodes = 2; // we need a non-local master to test shard failures + int numberOfNodes = 2; // we need a non-local cluster-manager to test shard failures DiscoveryNodes.Builder discoBuilder = DiscoveryNodes.builder(); for (int i = 0; i < numberOfNodes + 1; i++) { final DiscoveryNode node = newNode(i); discoBuilder = discoBuilder.add(node); } discoBuilder.localNodeId(newNode(0).getId()); - discoBuilder.masterNodeId(newNode(1).getId()); // we need a non-local master to test shard failures + discoBuilder.masterNodeId(newNode(1).getId()); // we need a non-local cluster-manager to test shard failures IndexMetadata indexMetadata = IndexMetadata.builder(index) .settings( Settings.builder() @@ -426,20 +426,20 @@ public static ClusterState stateWithNoShard() { } /** - * Creates a cluster state where local node and master node can be specified + * Creates a cluster state where local node and cluster-manager node can be specified * * @param localNode node in allNodes that is the local node - * @param masterNode node in allNodes that is the master node. Can be null if no cluster-manager exists + * @param clusterManagerNode node in allNodes that is the cluster-manager node. Can be null if no cluster-manager exists * @param allNodes all nodes in the cluster * @return cluster state */ - public static ClusterState state(DiscoveryNode localNode, DiscoveryNode masterNode, DiscoveryNode... allNodes) { + public static ClusterState state(DiscoveryNode localNode, DiscoveryNode clusterManagerNode, DiscoveryNode... allNodes) { DiscoveryNodes.Builder discoBuilder = DiscoveryNodes.builder(); for (DiscoveryNode node : allNodes) { discoBuilder.add(node); } - if (masterNode != null) { - discoBuilder.masterNodeId(masterNode.getId()); + if (clusterManagerNode != null) { + discoBuilder.masterNodeId(clusterManagerNode.getId()); } discoBuilder.localNodeId(localNode.getId()); diff --git a/test/framework/src/main/java/org/opensearch/cluster/OpenSearchAllocationTestCase.java b/test/framework/src/main/java/org/opensearch/cluster/OpenSearchAllocationTestCase.java index e42dd42b18da5..a13d337fa4d26 100644 --- a/test/framework/src/main/java/org/opensearch/cluster/OpenSearchAllocationTestCase.java +++ b/test/framework/src/main/java/org/opensearch/cluster/OpenSearchAllocationTestCase.java @@ -148,7 +148,7 @@ public static AllocationDeciders randomAllocationDeciders(Settings settings, Clu return new AllocationDeciders(deciders); } - protected static Set MASTER_DATA_ROLES = Collections.unmodifiableSet( + protected static Set CLUSTER_MANAGER_DATA_ROLES = Collections.unmodifiableSet( new HashSet<>(Arrays.asList(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE, DiscoveryNodeRole.DATA_ROLE)) ); @@ -157,11 +157,11 @@ protected static DiscoveryNode newNode(String nodeId) { } protected static DiscoveryNode newNode(String nodeName, String nodeId, Map attributes) { - return new DiscoveryNode(nodeName, nodeId, buildNewFakeTransportAddress(), attributes, MASTER_DATA_ROLES, Version.CURRENT); + return new DiscoveryNode(nodeName, nodeId, buildNewFakeTransportAddress(), attributes, CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT); } protected static DiscoveryNode newNode(String nodeId, Map attributes) { - return new DiscoveryNode(nodeId, buildNewFakeTransportAddress(), attributes, MASTER_DATA_ROLES, Version.CURRENT); + return new DiscoveryNode(nodeId, buildNewFakeTransportAddress(), attributes, CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT); } protected static DiscoveryNode newNode(String nodeId, Set roles) { @@ -169,7 +169,7 @@ protected static DiscoveryNode newNode(String nodeId, Set rol } protected static DiscoveryNode newNode(String nodeId, Version version) { - return new DiscoveryNode(nodeId, buildNewFakeTransportAddress(), emptyMap(), MASTER_DATA_ROLES, version); + return new DiscoveryNode(nodeId, buildNewFakeTransportAddress(), emptyMap(), CLUSTER_MANAGER_DATA_ROLES, version); } protected static ClusterState startRandomInitializingShard(ClusterState clusterState, AllocationService strategy) { diff --git a/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java b/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java index 6178ead662870..e341a330e2c4c 100644 --- a/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java +++ b/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java @@ -217,13 +217,13 @@ protected static int defaultInt(Setting setting) { } // Updating the cluster state involves up to 7 delays: - // 1. submit the task to the master service + // 1. submit the task to the cluster-manager service // 2. send PublishRequest // 3. receive PublishResponse // 4. send ApplyCommitRequest // 5. apply committed cluster state // 6. receive ApplyCommitResponse - // 7. apply committed state on master (last one to apply cluster state) + // 7. apply committed state on cluster-manager (last one to apply cluster state) public static final long DEFAULT_CLUSTER_STATE_UPDATE_DELAY = 7 * DEFAULT_DELAY_VARIABILITY; private static final int ELECTION_RETRIES = 10; @@ -288,11 +288,11 @@ class Cluster implements Releasable { this(initialNodeCount, true, Settings.EMPTY); } - Cluster(int initialNodeCount, boolean allNodesMasterEligible, Settings nodeSettings) { - this(initialNodeCount, allNodesMasterEligible, nodeSettings, () -> new StatusInfo(HEALTHY, "healthy-info")); + Cluster(int initialNodeCount, boolean allNodesclusterManagerEligible, Settings nodeSettings) { + this(initialNodeCount, allNodesclusterManagerEligible, nodeSettings, () -> new StatusInfo(HEALTHY, "healthy-info")); } - Cluster(int initialNodeCount, boolean allNodesMasterEligible, Settings nodeSettings, NodeHealthService nodeHealthService) { + Cluster(int initialNodeCount, boolean allNodesClusterManagerEligible, Settings nodeSettings, NodeHealthService nodeHealthService) { this.nodeHealthService = nodeHealthService; bigArrays = usually() ? BigArrays.NON_RECYCLING_INSTANCE @@ -301,29 +301,29 @@ class Cluster implements Releasable { assertThat(initialNodeCount, greaterThan(0)); - final Set masterEligibleNodeIds = new HashSet<>(initialNodeCount); + final Set clusterManagerEligibleNodeIds = new HashSet<>(initialNodeCount); clusterNodes = new ArrayList<>(initialNodeCount); for (int i = 0; i < initialNodeCount; i++) { final ClusterNode clusterNode = new ClusterNode( nextNodeIndex.getAndIncrement(), - allNodesMasterEligible || i == 0 || randomBoolean(), + allNodesClusterManagerEligible || i == 0 || randomBoolean(), nodeSettings, nodeHealthService ); clusterNodes.add(clusterNode); if (clusterNode.getLocalNode().isMasterNode()) { - masterEligibleNodeIds.add(clusterNode.getId()); + clusterManagerEligibleNodeIds.add(clusterNode.getId()); } } initialConfiguration = new VotingConfiguration( - new HashSet<>(randomSubsetOf(randomIntBetween(1, masterEligibleNodeIds.size()), masterEligibleNodeIds)) + new HashSet<>(randomSubsetOf(randomIntBetween(1, clusterManagerEligibleNodeIds.size()), clusterManagerEligibleNodeIds)) ); logger.info( "--> creating cluster of {} nodes (cluster-manager-eligible nodes: {}) with initial configuration {}", initialNodeCount, - masterEligibleNodeIds, + clusterManagerEligibleNodeIds, initialConfiguration ); } @@ -336,7 +336,7 @@ void addNodesAndStabilise(int newNodesCount) { addNodes(newNodesCount); stabilise( - // The first pinging discovers the master + // The first pinging discovers the cluster-manager defaultMillis(DISCOVERY_FIND_PEERS_INTERVAL_SETTING) // One message delay to send a join + DEFAULT_DELAY_VARIABILITY @@ -557,7 +557,7 @@ void stabilise(long stabilisationDurationMillis) { final ClusterNode leader = getAnyLeader(); final long leaderTerm = leader.coordinator.getCurrentTerm(); - final int pendingTaskCount = leader.masterService.getFakeMasterServicePendingTaskCount(); + final int pendingTaskCount = leader.clusterManagerService.getFakeMasterServicePendingTaskCount(); runFor((pendingTaskCount + 1) * DEFAULT_CLUSTER_STATE_UPDATE_DELAY, "draining task queue"); final Matcher isEqualToLeaderVersion = equalTo(leader.coordinator.getLastAcceptedState().getVersion()); @@ -566,7 +566,7 @@ void stabilise(long stabilisationDurationMillis) { assertTrue(leaderId + " has been bootstrapped", leader.coordinator.isInitialConfigurationSet()); assertTrue(leaderId + " exists in its last-applied state", leader.getLastAppliedClusterState().getNodes().nodeExists(leaderId)); assertThat( - leaderId + " has no NO_MASTER_BLOCK", + leaderId + " has no NO_CLUSTER_MANAGER_BLOCK", leader.getLastAppliedClusterState().blocks().hasGlobalBlockWithId(NO_MASTER_BLOCK_ID), equalTo(false) ); @@ -616,12 +616,12 @@ void stabilise(long stabilisationDurationMillis) { ); assertTrue(nodeId + " has been bootstrapped", clusterNode.coordinator.isInitialConfigurationSet()); assertThat( - nodeId + " has correct master", + nodeId + " has correct cluster-manager", clusterNode.getLastAppliedClusterState().nodes().getMasterNode(), equalTo(leader.getLocalNode()) ); assertThat( - nodeId + " has no NO_MASTER_BLOCK", + nodeId + " has no NO_CLUSTER_MANAGER_BLOCK", clusterNode.getLastAppliedClusterState().blocks().hasGlobalBlockWithId(NO_MASTER_BLOCK_ID), equalTo(false) ); @@ -638,7 +638,7 @@ void stabilise(long stabilisationDurationMillis) { nullValue() ); assertThat( - nodeId + " has NO_MASTER_BLOCK", + nodeId + " has NO_CLUSTER_MANAGER_BLOCK", clusterNode.getLastAppliedClusterState().blocks().hasGlobalBlockWithId(NO_MASTER_BLOCK_ID), equalTo(true) ); @@ -898,7 +898,7 @@ class MockPersistedState implements CoordinationState.PersistedState { final long persistedCurrentTerm; - if ( // node is master-ineligible either before or after the restart ... + if ( // node is cluster-manager-ineligible either before or after the restart ... (oldState.getLastAcceptedState().nodes().getLocalNode().isMasterNode() && newLocalNode.isMasterNode()) == false // ... and it's accepted some non-initial state so we can roll back ... && (oldState.getLastAcceptedState().term() > 0L || oldState.getLastAcceptedState().version() > 0L) @@ -930,7 +930,7 @@ && randomBoolean()) { final long newValue = randomLong(); logger.trace( - "rolling back persisted cluster state on master-ineligible node [{}]: " + "rolling back persisted cluster state on cluster-manager-ineligible node [{}]: " + "previously currentTerm={}, lastAcceptedTerm={}, lastAcceptedVersion={} " + "but now currentTerm={}, lastAcceptedTerm={}, lastAcceptedVersion={}", newLocalNode, @@ -1025,7 +1025,7 @@ class ClusterNode { private final DiscoveryNode localNode; final MockPersistedState persistedState; final Settings nodeSettings; - private AckedFakeThreadPoolMasterService masterService; + private AckedFakeThreadPoolClusterManagerService clusterManagerService; private DisruptableClusterApplierService clusterApplierService; private ClusterService clusterService; TransportService transportService; @@ -1033,10 +1033,10 @@ class ClusterNode { private NodeHealthService nodeHealthService; List> extraJoinValidators = new ArrayList<>(); - ClusterNode(int nodeIndex, boolean masterEligible, Settings nodeSettings, NodeHealthService nodeHealthService) { + ClusterNode(int nodeIndex, boolean clusterManagerEligible, Settings nodeSettings, NodeHealthService nodeHealthService) { this( nodeIndex, - createDiscoveryNode(nodeIndex, masterEligible), + createDiscoveryNode(nodeIndex, clusterManagerEligible), defaultPersistedStateSupplier, nodeSettings, nodeHealthService @@ -1105,7 +1105,7 @@ protected Optional getDisruptableMockTransport(Transpo null, emptySet() ); - masterService = new AckedFakeThreadPoolMasterService( + clusterManagerService = new AckedFakeThreadPoolClusterManagerService( localNode.getId(), "test", threadPool, @@ -1119,7 +1119,7 @@ protected Optional getDisruptableMockTransport(Transpo deterministicTaskQueue, threadPool ); - clusterService = new ClusterService(settings, clusterSettings, masterService, clusterApplierService); + clusterService = new ClusterService(settings, clusterSettings, clusterManagerService, clusterApplierService); clusterService.setNodeConnectionsService( new NodeConnectionsService(clusterService.getSettings(), threadPool, transportService) ); @@ -1134,7 +1134,7 @@ protected Optional getDisruptableMockTransport(Transpo transportService, writableRegistry(), allocationService, - masterService, + clusterManagerService, this::getPersistedState, Cluster.this::provideSeedHosts, clusterApplierService, @@ -1144,7 +1144,7 @@ protected Optional getDisruptableMockTransport(Transpo getElectionStrategy(), nodeHealthService ); - masterService.setClusterStatePublisher(coordinator); + clusterManagerService.setClusterStatePublisher(coordinator); final GatewayService gatewayService = new GatewayService( settings, allocationService, @@ -1261,7 +1261,7 @@ public String toString() { void submitSetAutoShrinkVotingConfiguration(final boolean autoShrinkVotingConfiguration) { submitUpdateTask( - "set master nodes failure tolerance [" + autoShrinkVotingConfiguration + "]", + "set cluster-manager nodes failure tolerance [" + autoShrinkVotingConfiguration + "]", cs -> ClusterState.builder(cs) .metadata( Metadata.builder(cs.metadata()) @@ -1331,11 +1331,11 @@ AckCollector submitUpdateTask( onNode(() -> { logger.trace("[{}] submitUpdateTask: enqueueing [{}]", localNode.getId(), source); final long submittedTerm = coordinator.getCurrentTerm(); - masterService.submitStateUpdateTask(source, new ClusterStateUpdateTask() { + clusterManagerService.submitStateUpdateTask(source, new ClusterStateUpdateTask() { @Override public ClusterState execute(ClusterState currentState) { assertThat(currentState.term(), greaterThanOrEqualTo(submittedTerm)); - masterService.nextAckCollector = ackCollector; + clusterManagerService.nextAckCollector = ackCollector; return clusterStateUpdate.apply(currentState); } @@ -1347,7 +1347,7 @@ public void onFailure(String source, Exception e) { @Override public void onNoLongerMaster(String source) { - logger.trace("no longer master: [{}]", source); + logger.trace("no longer cluster-manager: [{}]", source); taskListener.onNoLongerMaster(source); } @@ -1510,11 +1510,11 @@ int getSuccessfulAckIndex(ClusterNode clusterNode) { } } - static class AckedFakeThreadPoolMasterService extends FakeThreadPoolMasterService { + static class AckedFakeThreadPoolClusterManagerService extends FakeThreadPoolMasterService { AckCollector nextAckCollector = new AckCollector(); - AckedFakeThreadPoolMasterService( + AckedFakeThreadPoolClusterManagerService( String nodeName, String serviceName, ThreadPool threadPool, @@ -1610,7 +1610,7 @@ void allowClusterStateApplicationFailure() { } } - protected DiscoveryNode createDiscoveryNode(int nodeIndex, boolean masterEligible) { + protected DiscoveryNode createDiscoveryNode(int nodeIndex, boolean clusterManagerEligible) { final TransportAddress address = buildNewFakeTransportAddress(); return new DiscoveryNode( "", @@ -1620,7 +1620,7 @@ protected DiscoveryNode createDiscoveryNode(int nodeIndex, boolean masterEligibl address.getAddress(), address, Collections.emptyMap(), - masterEligible ? DiscoveryNodeRole.BUILT_IN_ROLES : emptySet(), + clusterManagerEligible ? DiscoveryNodeRole.BUILT_IN_ROLES : emptySet(), Version.CURRENT ); } diff --git a/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java b/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java index 1e7456e03ce6f..ca4a33fa677c6 100644 --- a/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java +++ b/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java @@ -285,11 +285,11 @@ void runRandomly() { } else if (rarely() && rarely()) { randomFrom(clusterNodes).reboot(); } else if (rarely()) { - final List masterNodes = clusterNodes.stream() + final List clusterManangerNodes = clusterNodes.stream() .filter(cn -> cn.state.electionWon()) .collect(Collectors.toList()); - if (masterNodes.isEmpty() == false) { - final ClusterNode clusterNode = randomFrom(masterNodes); + if (clusterManangerNodes.isEmpty() == false) { + final ClusterNode clusterNode = randomFrom(clusterManangerNodes); final long term = rarely() ? randomLongBetween(0, maxTerm + 1) : clusterNode.state.getCurrentTerm(); final long version = rarely() ? randomIntBetween(0, 5) : clusterNode.state.getLastPublishedVersion() + 1; final CoordinationMetadata.VotingConfiguration acceptedConfig = rarely() @@ -323,13 +323,15 @@ void runRandomly() { } void invariant() { - // one master per term + // one cluster-manager per term messages.stream() .filter(m -> m.payload instanceof PublishRequest) .collect(Collectors.groupingBy(m -> ((PublishRequest) m.payload).getAcceptedState().term())) .forEach((term, publishMessages) -> { - Set mastersForTerm = publishMessages.stream().collect(Collectors.groupingBy(m -> m.sourceNode)).keySet(); - assertThat("Multiple masters " + mastersForTerm + " for term " + term, mastersForTerm, hasSize(1)); + Set clusterManagersForTerm = publishMessages.stream() + .collect(Collectors.groupingBy(m -> m.sourceNode)) + .keySet(); + assertThat("Multiple cluster-managers " + clusterManagersForTerm + " for term " + term, clusterManagersForTerm, hasSize(1)); }); // unique cluster state per (term, version) pair diff --git a/test/framework/src/main/java/org/opensearch/cluster/service/FakeThreadPoolMasterService.java b/test/framework/src/main/java/org/opensearch/cluster/service/FakeThreadPoolMasterService.java index 14d9f9554004f..c532a0cc36472 100644 --- a/test/framework/src/main/java/org/opensearch/cluster/service/FakeThreadPoolMasterService.java +++ b/test/framework/src/main/java/org/opensearch/cluster/service/FakeThreadPoolMasterService.java @@ -116,7 +116,7 @@ private void scheduleNextTaskIfNecessary() { onTaskAvailableToRun.accept(new Runnable() { @Override public String toString() { - return "master service scheduling next task"; + return "cluster-manager service scheduling next task"; } @Override @@ -125,7 +125,7 @@ public void run() { assert waitForPublish == false; assert scheduledNextTask; final int taskIndex = randomInt(pendingTasks.size() - 1); - logger.debug("next master service task: choosing task {} of {}", taskIndex, pendingTasks.size()); + logger.debug("next cluster-manager service task: choosing task {} of {}", taskIndex, pendingTasks.size()); final Runnable task = pendingTasks.remove(taskIndex); taskInProgress = true; scheduledNextTask = false; diff --git a/test/framework/src/main/java/org/opensearch/common/util/MockBigArrays.java b/test/framework/src/main/java/org/opensearch/common/util/MockBigArrays.java index fc628ca5228e6..ed7a1643bf674 100644 --- a/test/framework/src/main/java/org/opensearch/common/util/MockBigArrays.java +++ b/test/framework/src/main/java/org/opensearch/common/util/MockBigArrays.java @@ -66,21 +66,22 @@ public class MockBigArrays extends BigArrays { private static final ConcurrentMap ACQUIRED_ARRAYS = new ConcurrentHashMap<>(); public static void ensureAllArraysAreReleased() throws Exception { - final Map masterCopy = new HashMap<>(ACQUIRED_ARRAYS); - if (!masterCopy.isEmpty()) { + final Map clusterManagerCopy = new HashMap<>(ACQUIRED_ARRAYS); + if (!clusterManagerCopy.isEmpty()) { // not empty, we might be executing on a shared cluster that keeps on obtaining - // and releasing arrays, lets make sure that after a reasonable timeout, all master + // and releasing arrays, lets make sure that after a reasonable timeout, all cluster-manager // copy (snapshot) have been released try { - assertBusy(() -> assertTrue(Sets.haveEmptyIntersection(masterCopy.keySet(), ACQUIRED_ARRAYS.keySet()))); + assertBusy(() -> assertTrue(Sets.haveEmptyIntersection(clusterManagerCopy.keySet(), ACQUIRED_ARRAYS.keySet()))); } catch (AssertionError ex) { - masterCopy.keySet().retainAll(ACQUIRED_ARRAYS.keySet()); - ACQUIRED_ARRAYS.keySet().removeAll(masterCopy.keySet()); // remove all existing master copy we will report on - if (!masterCopy.isEmpty()) { - Iterator causes = masterCopy.values().iterator(); + clusterManagerCopy.keySet().retainAll(ACQUIRED_ARRAYS.keySet()); + // remove all existing cluster-manager copy we will report on + ACQUIRED_ARRAYS.keySet().removeAll(clusterManagerCopy.keySet()); + if (!clusterManagerCopy.isEmpty()) { + Iterator causes = clusterManagerCopy.values().iterator(); Object firstCause = causes.next(); RuntimeException exception = new RuntimeException( - masterCopy.size() + " arrays have not been released", + clusterManagerCopy.size() + " arrays have not been released", firstCause instanceof Throwable ? (Throwable) firstCause : null ); while (causes.hasNext()) { diff --git a/test/framework/src/main/java/org/opensearch/common/util/MockPageCacheRecycler.java b/test/framework/src/main/java/org/opensearch/common/util/MockPageCacheRecycler.java index 471cf01a3f7d2..431267c9dfb0d 100644 --- a/test/framework/src/main/java/org/opensearch/common/util/MockPageCacheRecycler.java +++ b/test/framework/src/main/java/org/opensearch/common/util/MockPageCacheRecycler.java @@ -53,19 +53,23 @@ public class MockPageCacheRecycler extends PageCacheRecycler { private static final ConcurrentMap ACQUIRED_PAGES = new ConcurrentHashMap<>(); public static void ensureAllPagesAreReleased() throws Exception { - final Map masterCopy = new HashMap<>(ACQUIRED_PAGES); - if (!masterCopy.isEmpty()) { + final Map clusterManagerCopy = new HashMap<>(ACQUIRED_PAGES); + if (!clusterManagerCopy.isEmpty()) { // not empty, we might be executing on a shared cluster that keeps on obtaining - // and releasing pages, lets make sure that after a reasonable timeout, all master + // and releasing pages, lets make sure that after a reasonable timeout, all cluster-manager // copy (snapshot) have been released - final boolean success = waitUntil(() -> Sets.haveEmptyIntersection(masterCopy.keySet(), ACQUIRED_PAGES.keySet())); + final boolean success = waitUntil(() -> Sets.haveEmptyIntersection(clusterManagerCopy.keySet(), ACQUIRED_PAGES.keySet())); if (!success) { - masterCopy.keySet().retainAll(ACQUIRED_PAGES.keySet()); - ACQUIRED_PAGES.keySet().removeAll(masterCopy.keySet()); // remove all existing master copy we will report on - if (!masterCopy.isEmpty()) { - Iterator causes = masterCopy.values().iterator(); + clusterManagerCopy.keySet().retainAll(ACQUIRED_PAGES.keySet()); + // remove all existing cluster-manager copy we will report on + ACQUIRED_PAGES.keySet().removeAll(clusterManagerCopy.keySet()); + if (!clusterManagerCopy.isEmpty()) { + Iterator causes = clusterManagerCopy.values().iterator(); Throwable firstCause = causes.next(); - RuntimeException exception = new RuntimeException(masterCopy.size() + " pages have not been released", firstCause); + RuntimeException exception = new RuntimeException( + clusterManagerCopy.size() + " pages have not been released", + firstCause + ); while (causes.hasNext()) { exception.addSuppressed(causes.next()); } diff --git a/test/framework/src/main/java/org/opensearch/repositories/blobstore/BlobStoreTestUtil.java b/test/framework/src/main/java/org/opensearch/repositories/blobstore/BlobStoreTestUtil.java index ad61153b62a06..89d5f6f95bc5a 100644 --- a/test/framework/src/main/java/org/opensearch/repositories/blobstore/BlobStoreTestUtil.java +++ b/test/framework/src/main/java/org/opensearch/repositories/blobstore/BlobStoreTestUtil.java @@ -410,7 +410,7 @@ private static ClusterService mockClusterService(ClusterState initialState) { final ClusterService clusterService = mock(ClusterService.class); final ClusterApplierService clusterApplierService = mock(ClusterApplierService.class); when(clusterService.getClusterApplierService()).thenReturn(clusterApplierService); - // Setting local node as master so it may update the repository metadata in the cluster state + // Setting local node as cluster-manager so it may update the repository metadata in the cluster state final DiscoveryNode localNode = new DiscoveryNode("", buildNewFakeTransportAddress(), Version.CURRENT); final AtomicReference currentState = new AtomicReference<>( ClusterState.builder(initialState) diff --git a/test/framework/src/main/java/org/opensearch/snapshots/AbstractSnapshotIntegTestCase.java b/test/framework/src/main/java/org/opensearch/snapshots/AbstractSnapshotIntegTestCase.java index 3a55848c46150..70839be718e47 100644 --- a/test/framework/src/main/java/org/opensearch/snapshots/AbstractSnapshotIntegTestCase.java +++ b/test/framework/src/main/java/org/opensearch/snapshots/AbstractSnapshotIntegTestCase.java @@ -252,30 +252,30 @@ public SnapshotInfo waitForCompletion(String repository, String snapshotName, Ti } public static String blockMasterFromFinalizingSnapshotOnIndexFile(final String repositoryName) { - final String masterName = internalCluster().getMasterName(); - ((MockRepository) internalCluster().getInstance(RepositoriesService.class, masterName).repository(repositoryName)) + final String clusterManagerName = internalCluster().getMasterName(); + ((MockRepository) internalCluster().getInstance(RepositoriesService.class, clusterManagerName).repository(repositoryName)) .setBlockAndFailOnWriteIndexFile(); - return masterName; + return clusterManagerName; } public static String blockMasterOnWriteIndexFile(final String repositoryName) { - final String masterName = internalCluster().getMasterName(); + final String clusterManagerName = internalCluster().getMasterName(); ((MockRepository) internalCluster().getMasterNodeInstance(RepositoriesService.class).repository(repositoryName)) .setBlockOnWriteIndexFile(); - return masterName; + return clusterManagerName; } public static void blockMasterFromDeletingIndexNFile(String repositoryName) { - final String masterName = internalCluster().getMasterName(); - ((MockRepository) internalCluster().getInstance(RepositoriesService.class, masterName).repository(repositoryName)) + final String clusterManagerName = internalCluster().getMasterName(); + ((MockRepository) internalCluster().getInstance(RepositoriesService.class, clusterManagerName).repository(repositoryName)) .setBlockOnDeleteIndexFile(); } public static String blockMasterFromFinalizingSnapshotOnSnapFile(final String repositoryName) { - final String masterName = internalCluster().getMasterName(); - ((MockRepository) internalCluster().getInstance(RepositoriesService.class, masterName).repository(repositoryName)) + final String clusterManagerName = internalCluster().getMasterName(); + ((MockRepository) internalCluster().getInstance(RepositoriesService.class, clusterManagerName).repository(repositoryName)) .setBlockAndFailOnWriteSnapFiles(true); - return masterName; + return clusterManagerName; } public static String blockNodeWithIndex(final String repositoryName, final String indexName) { @@ -628,10 +628,10 @@ protected SnapshotInfo getSnapshot(String repository, String snapshot) { } protected void awaitMasterFinishRepoOperations() throws Exception { - logger.info("--> waiting for master to finish all repo operations on its SNAPSHOT pool"); - final ThreadPool masterThreadPool = internalCluster().getMasterNodeInstance(ThreadPool.class); + logger.info("--> waiting for cluster-manager to finish all repo operations on its SNAPSHOT pool"); + final ThreadPool clusterManagerThreadPool = internalCluster().getMasterNodeInstance(ThreadPool.class); assertBusy(() -> { - for (ThreadPoolStats.Stats stat : masterThreadPool.stats()) { + for (ThreadPoolStats.Stats stat : clusterManagerThreadPool.stats()) { if (ThreadPool.Names.SNAPSHOT.equals(stat.getName())) { assertEquals(stat.getActive(), 0); break; diff --git a/test/framework/src/main/java/org/opensearch/snapshots/mockstore/MockRepository.java b/test/framework/src/main/java/org/opensearch/snapshots/mockstore/MockRepository.java index b26ffc9bd69d9..4e641f9505e3e 100644 --- a/test/framework/src/main/java/org/opensearch/snapshots/mockstore/MockRepository.java +++ b/test/framework/src/main/java/org/opensearch/snapshots/mockstore/MockRepository.java @@ -143,7 +143,7 @@ public long getFailureCount() { */ private volatile boolean blockOnWriteIndexFile; - /** Allows blocking on writing the snapshot file at the end of snapshot creation to simulate a died master node */ + /** Allows blocking on writing the snapshot file at the end of snapshot creation to simulate a died cluster-manager node */ private volatile boolean blockAndFailOnWriteSnapFile; private volatile boolean blockOnWriteShardLevelMeta; @@ -191,7 +191,7 @@ public RepositoryMetadata getMetadata() { } private static RepositoryMetadata overrideSettings(RepositoryMetadata metadata, Environment environment) { - // TODO: use another method of testing not being able to read the test file written by the master... + // TODO: use another method of testing not being able to read the test file written by the cluster-manager... // this is super duper hacky if (metadata.settings().getAsBoolean("localize_location", false)) { Path location = PathUtils.get(metadata.settings().get("location")); diff --git a/test/framework/src/main/java/org/opensearch/test/AbstractBuilderTestCase.java b/test/framework/src/main/java/org/opensearch/test/AbstractBuilderTestCase.java index b29d6a26054ff..526ae1452f578 100644 --- a/test/framework/src/main/java/org/opensearch/test/AbstractBuilderTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/AbstractBuilderTestCase.java @@ -248,10 +248,10 @@ public void beforeTest() throws Exception { assert serviceHolderWithNoType == null; // we initialize the serviceHolder and serviceHolderWithNoType just once, but need some // calls to the randomness source during its setup. In order to not mix these calls with - // the randomness source that is later used in the test method, we use the master seed during + // the randomness source that is later used in the test method, we use the cluster-manager seed during // this setup - long masterSeed = SeedUtils.parseSeed(RandomizedTest.getContext().getRunnerSeedAsString()); - RandomizedTest.getContext().runWithPrivateRandomness(masterSeed, (Callable) () -> { + long clusterManagerSeed = SeedUtils.parseSeed(RandomizedTest.getContext().getRunnerSeedAsString()); + RandomizedTest.getContext().runWithPrivateRandomness(clusterManagerSeed, (Callable) () -> { serviceHolder = new ServiceHolder( nodeSettings, createTestIndexSettings(), diff --git a/test/framework/src/main/java/org/opensearch/test/ClusterServiceUtils.java b/test/framework/src/main/java/org/opensearch/test/ClusterServiceUtils.java index b97a35a3431b6..f709d8bcaff34 100644 --- a/test/framework/src/main/java/org/opensearch/test/ClusterServiceUtils.java +++ b/test/framework/src/main/java/org/opensearch/test/ClusterServiceUtils.java @@ -62,19 +62,19 @@ public class ClusterServiceUtils { public static MasterService createMasterService(ThreadPool threadPool, ClusterState initialClusterState) { - MasterService masterService = new MasterService( - Settings.builder().put(Node.NODE_NAME_SETTING.getKey(), "test_master_node").build(), + MasterService clusterManagerService = new MasterService( + Settings.builder().put(Node.NODE_NAME_SETTING.getKey(), "test_cluster_manager_node").build(), new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), threadPool ); AtomicReference clusterStateRef = new AtomicReference<>(initialClusterState); - masterService.setClusterStatePublisher((event, publishListener, ackListener) -> { + clusterManagerService.setClusterStatePublisher((event, publishListener, ackListener) -> { clusterStateRef.set(event.state()); publishListener.onResponse(null); }); - masterService.setClusterStateSupplier(clusterStateRef::get); - masterService.start(); - return masterService; + clusterManagerService.setClusterStateSupplier(clusterStateRef::get); + clusterManagerService.start(); + return clusterManagerService; } public static MasterService createMasterService(ThreadPool threadPool, DiscoveryNode localNode) { diff --git a/test/framework/src/main/java/org/opensearch/test/ExternalTestCluster.java b/test/framework/src/main/java/org/opensearch/test/ExternalTestCluster.java index 805e578a8e8db..6dec5858b398a 100644 --- a/test/framework/src/main/java/org/opensearch/test/ExternalTestCluster.java +++ b/test/framework/src/main/java/org/opensearch/test/ExternalTestCluster.java @@ -90,7 +90,7 @@ public final class ExternalTestCluster extends TestCluster { private final String clusterName; private final int numDataNodes; - private final int numMasterAndDataNodes; + private final int numClusterManagerAndDataNodes; public ExternalTestCluster( Path tempDir, @@ -141,19 +141,19 @@ public ExternalTestCluster( .get(); httpAddresses = new InetSocketAddress[nodeInfos.getNodes().size()]; int dataNodes = 0; - int masterAndDataNodes = 0; + int clusterManagerAndDataNodes = 0; for (int i = 0; i < nodeInfos.getNodes().size(); i++) { NodeInfo nodeInfo = nodeInfos.getNodes().get(i); httpAddresses[i] = nodeInfo.getInfo(HttpInfo.class).address().publishAddress().address(); if (DiscoveryNode.isDataNode(nodeInfo.getSettings())) { dataNodes++; - masterAndDataNodes++; + clusterManagerAndDataNodes++; } else if (DiscoveryNode.isMasterNode(nodeInfo.getSettings())) { - masterAndDataNodes++; + clusterManagerAndDataNodes++; } } this.numDataNodes = dataNodes; - this.numMasterAndDataNodes = masterAndDataNodes; + this.numClusterManagerAndDataNodes = clusterManagerAndDataNodes; this.client = client; this.node = node; @@ -191,7 +191,7 @@ public int numDataNodes() { @Override public int numDataAndMasterNodes() { - return numMasterAndDataNodes; + return numClusterManagerAndDataNodes; } @Override diff --git a/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java b/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java index f37a1d68ec384..637dff1d8169f 100644 --- a/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java +++ b/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java @@ -166,7 +166,6 @@ import static org.opensearch.test.OpenSearchTestCase.assertBusy; import static org.opensearch.test.OpenSearchTestCase.randomFrom; import static org.opensearch.test.NodeRoles.dataOnlyNode; -import static org.opensearch.test.NodeRoles.masterOnlyNode; import static org.opensearch.test.NodeRoles.noRoles; import static org.opensearch.test.NodeRoles.onlyRole; import static org.opensearch.test.NodeRoles.removeRoles; @@ -200,11 +199,11 @@ public final class InternalTestCluster extends TestCluster { nodeAndClient.node.settings() ); - private static final Predicate NO_DATA_NO_MASTER_PREDICATE = nodeAndClient -> DiscoveryNode.isMasterNode( + private static final Predicate NO_DATA_NO_CLUSTER_MANAGER_PREDICATE = nodeAndClient -> DiscoveryNode.isMasterNode( nodeAndClient.node.settings() ) == false && DiscoveryNode.isDataNode(nodeAndClient.node.settings()) == false; - private static final Predicate MASTER_NODE_PREDICATE = nodeAndClient -> DiscoveryNode.isMasterNode( + private static final Predicate CLUSTER_MANAGER_NODE_PREDICATE = nodeAndClient -> DiscoveryNode.isMasterNode( nodeAndClient.node.settings() ); @@ -238,8 +237,8 @@ public final class InternalTestCluster extends TestCluster { * fully shared cluster to be more reproducible */ private final long[] sharedNodesSeeds; - // if set to 0, data nodes will also assume the master role - private final int numSharedDedicatedMasterNodes; + // if set to 0, data nodes will also assume the cluster-manager role + private final int numSharedDedicatedClusterManagerNodes; private final int numSharedDataNodes; @@ -249,7 +248,7 @@ public final class InternalTestCluster extends TestCluster { private final ExecutorService executor; - private final boolean autoManageMasterNodes; + private final boolean autoManageClusterManagerNodes; private final Collection> mockPlugins; @@ -266,13 +265,13 @@ public final class InternalTestCluster extends TestCluster { private ServiceDisruptionScheme activeDisruptionScheme; private final Function clientWrapper; - private int bootstrapMasterNodeIndex = -1; + private int bootstrapClusterManagerNodeIndex = -1; public InternalTestCluster( final long clusterSeed, final Path baseDir, - final boolean randomlyAddDedicatedMasters, - final boolean autoManageMasterNodes, + final boolean randomlyAddDedicatedClusterManagers, + final boolean autoManageClusterManagerNodes, final int minNumDataNodes, final int maxNumDataNodes, final String clusterName, @@ -285,8 +284,8 @@ public InternalTestCluster( this( clusterSeed, baseDir, - randomlyAddDedicatedMasters, - autoManageMasterNodes, + randomlyAddDedicatedClusterManagers, + autoManageClusterManagerNodes, minNumDataNodes, maxNumDataNodes, clusterName, @@ -302,8 +301,8 @@ public InternalTestCluster( public InternalTestCluster( final long clusterSeed, final Path baseDir, - final boolean randomlyAddDedicatedMasters, - final boolean autoManageMasterNodes, + final boolean randomlyAddDedicatedClusterManagers, + final boolean autoManageClusterManagerNodes, final int minNumDataNodes, final int maxNumDataNodes, final String clusterName, @@ -315,7 +314,7 @@ public InternalTestCluster( final boolean forbidPrivateIndexSettings ) { super(clusterSeed); - this.autoManageMasterNodes = autoManageMasterNodes; + this.autoManageClusterManagerNodes = autoManageClusterManagerNodes; this.clientWrapper = clientWrapper; this.forbidPrivateIndexSettings = forbidPrivateIndexSettings; this.baseDir = baseDir; @@ -330,24 +329,24 @@ public InternalTestCluster( Random random = new Random(clusterSeed); - boolean useDedicatedMasterNodes = randomlyAddDedicatedMasters ? random.nextBoolean() : false; + boolean useDedicatedClusterManagerNodes = randomlyAddDedicatedClusterManagers ? random.nextBoolean() : false; this.numSharedDataNodes = RandomNumbers.randomIntBetween(random, minNumDataNodes, maxNumDataNodes); assert this.numSharedDataNodes >= 0; if (numSharedDataNodes == 0) { this.numSharedCoordOnlyNodes = 0; - this.numSharedDedicatedMasterNodes = 0; + this.numSharedDedicatedClusterManagerNodes = 0; } else { - if (useDedicatedMasterNodes) { + if (useDedicatedClusterManagerNodes) { if (random.nextBoolean()) { - // use a dedicated master, but only low number to reduce overhead to tests - this.numSharedDedicatedMasterNodes = DEFAULT_LOW_NUM_MASTER_NODES; + // use a dedicated cluster-manager, but only low number to reduce overhead to tests + this.numSharedDedicatedClusterManagerNodes = DEFAULT_LOW_NUM_MASTER_NODES; } else { - this.numSharedDedicatedMasterNodes = DEFAULT_HIGH_NUM_MASTER_NODES; + this.numSharedDedicatedClusterManagerNodes = DEFAULT_HIGH_NUM_MASTER_NODES; } } else { - this.numSharedDedicatedMasterNodes = 0; + this.numSharedDedicatedClusterManagerNodes = 0; } if (numClientNodes < 0) { this.numSharedCoordOnlyNodes = RandomNumbers.randomIntBetween( @@ -367,20 +366,20 @@ public InternalTestCluster( this.mockPlugins = mockPlugins; - sharedNodesSeeds = new long[numSharedDedicatedMasterNodes + numSharedDataNodes + numSharedCoordOnlyNodes]; + sharedNodesSeeds = new long[numSharedDedicatedClusterManagerNodes + numSharedDataNodes + numSharedCoordOnlyNodes]; for (int i = 0; i < sharedNodesSeeds.length; i++) { sharedNodesSeeds[i] = random.nextLong(); } logger.info( - "Setup InternalTestCluster [{}] with seed [{}] using [{}] dedicated masters, " - + "[{}] (data) nodes and [{}] coord only nodes (min_master_nodes are [{}])", + "Setup InternalTestCluster [{}] with seed [{}] using [{}] dedicated cluster-managers, " + + "[{}] (data) nodes and [{}] coord only nodes (min_cluster_manager_nodes are [{}])", clusterName, SeedUtils.formatSeed(clusterSeed), - numSharedDedicatedMasterNodes, + numSharedDedicatedClusterManagerNodes, numSharedDataNodes, numSharedCoordOnlyNodes, - autoManageMasterNodes ? "auto-managed" : "manual" + autoManageClusterManagerNodes ? "auto-managed" : "manual" ); this.nodeConfigurationSource = nodeConfigurationSource; numDataPaths = random.nextInt(5) == 0 ? 2 + random.nextInt(3) : 1; @@ -433,8 +432,8 @@ public InternalTestCluster( RecoverySettings.INDICES_RECOVERY_MAX_CONCURRENT_OPERATIONS_SETTING.getKey(), RandomNumbers.randomIntBetween(random, 1, 4) ); - // TODO: currently we only randomize "cluster.no_master_block" between "write" and "metadata_write", as "all" is fragile - // and fails shards when a master abdicates, which breaks many tests. + // TODO: currently we only randomize "cluster.no_cluster_manager_block" between "write" and "metadata_write", as "all" is fragile + // and fails shards when a cluster-manager abdicates, which breaks many tests. builder.put(NoMasterBlockService.NO_CLUSTER_MANAGER_BLOCK_SETTING.getKey(), randomFrom(random, "write", "metadata_write")); defaultSettings = builder.build(); executor = OpenSearchExecutors.newScaling( @@ -449,14 +448,15 @@ public InternalTestCluster( } /** - * Sets {@link #bootstrapMasterNodeIndex} to the given value, see {@link #bootstrapMasterNodeWithSpecifiedIndex(List)} + * Sets {@link #bootstrapClusterManagerNodeIndex} to the given value, see {@link #bootstrapClusterManagerNodeWithSpecifiedIndex(List)} * for the description of how this field is used. - * It's only possible to change {@link #bootstrapMasterNodeIndex} value if autoManageMasterNodes is false. + * It's only possible to change {@link #bootstrapClusterManagerNodeIndex} value if autoManageClusterManagerNodes is false. */ - public void setBootstrapMasterNodeIndex(int bootstrapMasterNodeIndex) { - assert autoManageMasterNodes == false || bootstrapMasterNodeIndex == -1 - : "bootstrapMasterNodeIndex should be -1 if autoManageMasterNodes is true, but was " + bootstrapMasterNodeIndex; - this.bootstrapMasterNodeIndex = bootstrapMasterNodeIndex; + public void setBootstrapClusterManagerNodeIndex(int bootstrapClusterManagerNodeIndex) { + assert autoManageClusterManagerNodes == false || bootstrapClusterManagerNodeIndex == -1 + : "bootstrapClusterManagerNodeIndex should be -1 if autoManageClusterManagerNodes is true, but was " + + bootstrapClusterManagerNodeIndex; + this.bootstrapClusterManagerNodeIndex = bootstrapClusterManagerNodeIndex; } @Override @@ -648,7 +648,7 @@ public synchronized void ensureAtLeastNumDataNodes(int n) { int size = numDataNodes(); if (size < n) { logger.info("increasing cluster size from {} to {}", size, n); - if (numSharedDedicatedMasterNodes > 0) { + if (numSharedDedicatedClusterManagerNodes > 0) { startDataOnlyNodes(n - size); } else { startNodes(n - size); @@ -667,7 +667,7 @@ public synchronized void ensureAtMostNumDataNodes(int n) throws IOException { if (size <= n) { return; } - // prevent killing the master if possible and client nodes + // prevent killing the cluster-manager if possible and client nodes final Stream collection = n == 0 ? nodes.values().stream() : nodes.values().stream().filter(DATA_NODE_PREDICATE.and(new NodeNamePredicate(getMasterName()).negate())); @@ -687,7 +687,12 @@ public synchronized void ensureAtMostNumDataNodes(int n) throws IOException { } } - private Settings getNodeSettings(final int nodeId, final long seed, final Settings extraSettings, final int defaultMinMasterNodes) { + private Settings getNodeSettings( + final int nodeId, + final long seed, + final Settings extraSettings, + final int defaultMinClusterManagerNodes + ) { final Settings settings = getSettings(nodeId, seed, extraSettings); final String name = buildNodeName(nodeId, settings); @@ -718,9 +723,9 @@ private Settings getNodeSettings(final int nodeId, final long seed, final Settin final String discoveryType = DISCOVERY_TYPE_SETTING.get(updatedSettings.build()); final boolean usingSingleNodeDiscovery = discoveryType.equals("single-node"); if (usingSingleNodeDiscovery == false) { - if (autoManageMasterNodes) { + if (autoManageClusterManagerNodes) { assertThat( - "if master nodes are automatically managed then nodes must complete a join cycle when starting", + "if cluster-manager nodes are automatically managed then nodes must complete a join cycle when starting", updatedSettings.get(DiscoverySettings.INITIAL_STATE_TIMEOUT_SETTING.getKey()), nullValue() ); @@ -817,26 +822,26 @@ public Client dataNodeClient() { } /** - * Returns a node client to the current master node. + * Returns a node client to the current cluster-manager node. * Note: use this with care tests should not rely on a certain nodes client. */ public Client masterClient() { NodeAndClient randomNodeAndClient = getRandomNodeAndClient(new NodeNamePredicate(getMasterName())); if (randomNodeAndClient != null) { - return randomNodeAndClient.nodeClient(); // ensure node client master is requested + return randomNodeAndClient.nodeClient(); // ensure node client cluster-manager is requested } throw new AssertionError("No cluster-manager client found"); } /** - * Returns a node client to random node but not the master. This method will fail if no non-master client is available. + * Returns a node client to random node but not the cluster-manager. This method will fail if no non-cluster-manager client is available. */ public Client nonMasterClient() { NodeAndClient randomNodeAndClient = getRandomNodeAndClient(new NodeNamePredicate(getMasterName()).negate()); if (randomNodeAndClient != null) { - return randomNodeAndClient.nodeClient(); // ensure node client non-master is requested + return randomNodeAndClient.nodeClient(); // ensure node client non-cluster-manager is requested } - throw new AssertionError("No non-master client found"); + throw new AssertionError("No non-cluster-manager client found"); } /** @@ -844,14 +849,14 @@ public Client nonMasterClient() { */ public synchronized Client coordOnlyNodeClient() { ensureOpen(); - NodeAndClient randomNodeAndClient = getRandomNodeAndClient(NO_DATA_NO_MASTER_PREDICATE); + NodeAndClient randomNodeAndClient = getRandomNodeAndClient(NO_DATA_NO_CLUSTER_MANAGER_PREDICATE); if (randomNodeAndClient != null) { return randomNodeAndClient.client(); } int nodeId = nextNodeId.getAndIncrement(); Settings settings = getSettings(nodeId, random.nextLong(), Settings.EMPTY); startCoordinatingOnlyNode(settings); - return getRandomNodeAndClient(NO_DATA_NO_MASTER_PREDICATE).client(); + return getRandomNodeAndClient(NO_DATA_NO_CLUSTER_MANAGER_PREDICATE).client(); } public synchronized String startCoordinatingOnlyNode(Settings settings) { @@ -981,7 +986,7 @@ void startNode() { /** * closes the node and prepares it to be restarted */ - Settings closeForRestart(RestartCallback callback, int minMasterNodes) throws Exception { + Settings closeForRestart(RestartCallback callback, int minClusterManagerNodes) throws Exception { assert callback != null; close(); removeNode(this); @@ -989,7 +994,7 @@ Settings closeForRestart(RestartCallback callback, int minMasterNodes) throws Ex assert callbackSettings != null; Settings.Builder newSettings = Settings.builder(); newSettings.put(callbackSettings); - if (minMasterNodes >= 0) { + if (minClusterManagerNodes >= 0) { if (INITIAL_CLUSTER_MANAGER_NODES_SETTING.exists(callbackSettings) == false) { newSettings.putList(INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey()); } @@ -1128,54 +1133,56 @@ private synchronized void reset(boolean wipeData) throws IOException { final int prevNodeCount = nodes.size(); // start any missing node - assert newSize == numSharedDedicatedMasterNodes + numSharedDataNodes + numSharedCoordOnlyNodes; - final int numberOfMasterNodes = numSharedDedicatedMasterNodes > 0 ? numSharedDedicatedMasterNodes : numSharedDataNodes; - final int defaultMinMasterNodes = (numberOfMasterNodes / 2) + 1; + assert newSize == numSharedDedicatedClusterManagerNodes + numSharedDataNodes + numSharedCoordOnlyNodes; + final int numberOfClusterManagerNodes = numSharedDedicatedClusterManagerNodes > 0 + ? numSharedDedicatedClusterManagerNodes + : numSharedDataNodes; + final int defaultMinClusterManagerNodes = (numberOfClusterManagerNodes / 2) + 1; final List toStartAndPublish = new ArrayList<>(); // we want to start nodes in one go final Runnable onTransportServiceStarted = () -> rebuildUnicastHostFiles(toStartAndPublish); final List settings = new ArrayList<>(); - for (int i = 0; i < numSharedDedicatedMasterNodes; i++) { - final Settings nodeSettings = getNodeSettings(i, sharedNodesSeeds[i], Settings.EMPTY, defaultMinMasterNodes); + for (int i = 0; i < numSharedDedicatedClusterManagerNodes; i++) { + final Settings nodeSettings = getNodeSettings(i, sharedNodesSeeds[i], Settings.EMPTY, defaultMinClusterManagerNodes); settings.add(removeRoles(nodeSettings, Collections.singleton(DiscoveryNodeRole.DATA_ROLE))); } - for (int i = numSharedDedicatedMasterNodes; i < numSharedDedicatedMasterNodes + numSharedDataNodes; i++) { - final Settings nodeSettings = getNodeSettings(i, sharedNodesSeeds[i], Settings.EMPTY, defaultMinMasterNodes); - if (numSharedDedicatedMasterNodes > 0) { + for (int i = numSharedDedicatedClusterManagerNodes; i < numSharedDedicatedClusterManagerNodes + numSharedDataNodes; i++) { + final Settings nodeSettings = getNodeSettings(i, sharedNodesSeeds[i], Settings.EMPTY, defaultMinClusterManagerNodes); + if (numSharedDedicatedClusterManagerNodes > 0) { settings.add(removeRoles(nodeSettings, Collections.singleton(DiscoveryNodeRole.MASTER_ROLE))); } else { - // if we don't have dedicated master nodes, keep things default + // if we don't have dedicated cluster-manager nodes, keep things default settings.add(nodeSettings); } } - for (int i = numSharedDedicatedMasterNodes + numSharedDataNodes; i < numSharedDedicatedMasterNodes + numSharedDataNodes - + numSharedCoordOnlyNodes; i++) { + for (int i = numSharedDedicatedClusterManagerNodes + numSharedDataNodes; i < numSharedDedicatedClusterManagerNodes + + numSharedDataNodes + numSharedCoordOnlyNodes; i++) { final Builder extraSettings = Settings.builder().put(noRoles()); - settings.add(getNodeSettings(i, sharedNodesSeeds[i], extraSettings.build(), defaultMinMasterNodes)); + settings.add(getNodeSettings(i, sharedNodesSeeds[i], extraSettings.build(), defaultMinClusterManagerNodes)); } - int autoBootstrapMasterNodeIndex = -1; - final List masterNodeNames = settings.stream() + int autoBootstrapClusterManagerNodeIndex = -1; + final List clusterManagerNodeNames = settings.stream() .filter(DiscoveryNode::isMasterNode) .map(Node.NODE_NAME_SETTING::get) .collect(Collectors.toList()); - if (prevNodeCount == 0 && autoManageMasterNodes) { - if (numSharedDedicatedMasterNodes > 0) { - autoBootstrapMasterNodeIndex = RandomNumbers.randomIntBetween(random, 0, numSharedDedicatedMasterNodes - 1); + if (prevNodeCount == 0 && autoManageClusterManagerNodes) { + if (numSharedDedicatedClusterManagerNodes > 0) { + autoBootstrapClusterManagerNodeIndex = RandomNumbers.randomIntBetween(random, 0, numSharedDedicatedClusterManagerNodes - 1); } else if (numSharedDataNodes > 0) { - autoBootstrapMasterNodeIndex = RandomNumbers.randomIntBetween(random, 0, numSharedDataNodes - 1); + autoBootstrapClusterManagerNodeIndex = RandomNumbers.randomIntBetween(random, 0, numSharedDataNodes - 1); } } - final List updatedSettings = bootstrapMasterNodeWithSpecifiedIndex(settings); + final List updatedSettings = bootstrapClusterManagerNodeWithSpecifiedIndex(settings); - for (int i = 0; i < numSharedDedicatedMasterNodes + numSharedDataNodes + numSharedCoordOnlyNodes; i++) { + for (int i = 0; i < numSharedDedicatedClusterManagerNodes + numSharedDataNodes + numSharedCoordOnlyNodes; i++) { Settings nodeSettings = updatedSettings.get(i); - if (i == autoBootstrapMasterNodeIndex) { + if (i == autoBootstrapClusterManagerNodeIndex) { nodeSettings = Settings.builder() - .putList(INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey(), masterNodeNames) + .putList(INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey(), clusterManagerNodeNames) .put(nodeSettings) .build(); } @@ -1187,7 +1194,7 @@ private synchronized void reset(boolean wipeData) throws IOException { nextNodeId.set(newSize); assert size() == newSize; - if (autoManageMasterNodes && newSize > 0) { + if (autoManageClusterManagerNodes && newSize > 0) { validateClusterFormed(); } logger.debug( @@ -1214,11 +1221,11 @@ public synchronized void validateClusterFormed() { .map(ClusterService::state) .collect(Collectors.toList()); final String debugString = ", expected nodes: " + expectedNodes + " and actual cluster states " + states; - // all nodes have a master - assertTrue("Missing master" + debugString, states.stream().allMatch(cs -> cs.nodes().getMasterNodeId() != null)); - // all nodes have the same master (in same term) + // all nodes have a cluster-manager + assertTrue("Missing cluster-manager" + debugString, states.stream().allMatch(cs -> cs.nodes().getMasterNodeId() != null)); + // all nodes have the same cluster-manager (in same term) assertEquals( - "Not all masters in same term" + debugString, + "Not all cluster-managers in same term" + debugString, 1, states.stream().mapToLong(ClusterState::term).distinct().count() ); @@ -1555,11 +1562,11 @@ public synchronized T getCurrentMasterNodeInstance(Class clazz) { } /** - * Returns an Iterable to all instances for the given class >T< across all data and master nodes + * Returns an Iterable to all instances for the given class >T< across all data and cluster-manager nodes * in the cluster. */ public Iterable getDataOrMasterNodeInstances(Class clazz) { - return getInstances(clazz, DATA_NODE_PREDICATE.or(MASTER_NODE_PREDICATE)); + return getInstances(clazz, DATA_NODE_PREDICATE.or(CLUSTER_MANAGER_NODE_PREDICATE)); } private Iterable getInstances(Class clazz, Predicate predicate) { @@ -1583,7 +1590,7 @@ public T getDataNodeInstance(Class clazz) { } public T getMasterNodeInstance(Class clazz) { - return getInstance(clazz, MASTER_NODE_PREDICATE); + return getInstance(clazz, CLUSTER_MANAGER_NODE_PREDICATE); } private synchronized T getInstance(Class clazz, Predicate predicate) { @@ -1653,13 +1660,13 @@ public synchronized void stopRandomNode(final Predicate filter) throws if (nodePrefix.equals(OpenSearchIntegTestCase.SUITE_CLUSTER_NODE_PREFIX) && nodeAndClient.nodeAndClientId() < sharedNodesSeeds.length && nodeAndClient.isMasterEligible() - && autoManageMasterNodes + && autoManageClusterManagerNodes && nodes.values() .stream() .filter(NodeAndClient::isMasterEligible) .filter(n -> n.nodeAndClientId() < sharedNodesSeeds.length) .count() == 1) { - throw new AssertionError("Tried to stop the only master eligible shared node"); + throw new AssertionError("Tried to stop the only cluster-manager eligible shared node"); } logger.info("Closing filtered random node [{}] ", nodeAndClient.name); stopNodesAndClient(nodeAndClient); @@ -1667,36 +1674,36 @@ public synchronized void stopRandomNode(final Predicate filter) throws } /** - * Stops the current master node forcefully + * Stops the current cluster-manager node forcefully */ public synchronized void stopCurrentMasterNode() throws IOException { ensureOpen(); assert size() > 0; - String masterNodeName = getMasterName(); - final NodeAndClient masterNode = nodes.get(masterNodeName); - assert masterNode != null; - logger.info("Closing master node [{}] ", masterNodeName); - stopNodesAndClient(masterNode); + String clusterManagerNodeName = getMasterName(); + final NodeAndClient clusterManagerNode = nodes.get(clusterManagerNodeName); + assert clusterManagerNode != null; + logger.info("Closing cluster-manager node [{}] ", clusterManagerNodeName); + stopNodesAndClient(clusterManagerNode); } /** - * Stops any of the current nodes but not the master node. + * Stops any of the current nodes but not the cluster-manager node. */ public synchronized void stopRandomNonMasterNode() throws IOException { NodeAndClient nodeAndClient = getRandomNodeAndClient(new NodeNamePredicate(getMasterName()).negate()); if (nodeAndClient != null) { - logger.info("Closing random non master node [{}] current master [{}] ", nodeAndClient.name, getMasterName()); + logger.info("Closing random non cluster-manager node [{}] current cluster-manager [{}] ", nodeAndClient.name, getMasterName()); stopNodesAndClient(nodeAndClient); } } private synchronized void startAndPublishNodesAndClients(List nodeAndClients) { if (nodeAndClients.size() > 0) { - final int newMasters = (int) nodeAndClients.stream() + final int newClusterManagers = (int) nodeAndClients.stream() .filter(NodeAndClient::isMasterEligible) - .filter(nac -> nodes.containsKey(nac.name) == false) // filter out old masters + .filter(nac -> nodes.containsKey(nac.name) == false) // filter out old cluster-managers .count(); - final int currentMasters = getMasterNodesCount(); + final int currentClusterManagers = getClusterManagerNodesCount(); rebuildUnicastHostFiles(nodeAndClients); // ensure that new nodes can find the existing nodes when they start List> futures = nodeAndClients.stream().map(node -> executor.submit(node::startNode)).collect(Collectors.toList()); @@ -1713,11 +1720,11 @@ private synchronized void startAndPublishNodesAndClients(List nod } nodeAndClients.forEach(this::publishNode); - if (autoManageMasterNodes - && currentMasters > 0 - && newMasters > 0 - && getMinMasterNodes(currentMasters + newMasters) > currentMasters) { - // update once masters have joined + if (autoManageClusterManagerNodes + && currentClusterManagers > 0 + && newClusterManagers > 0 + && getMinClusterManagerNodes(currentClusterManagers + newClusterManagers) > currentClusterManagers) { + // update once cluster-managers have joined validateClusterFormed(); } } @@ -1758,7 +1765,7 @@ private void stopNodesAndClient(NodeAndClient nodeAndClient) throws IOException } private synchronized void stopNodesAndClients(Collection nodeAndClients) throws IOException { - final Set excludedNodeIds = excludeMasters(nodeAndClients); + final Set excludedNodeIds = excludeClusterManagers(nodeAndClients); for (NodeAndClient nodeAndClient : nodeAndClients) { removeDisruptionSchemeFromNode(nodeAndClient); @@ -1834,11 +1841,11 @@ private void restartNode(NodeAndClient nodeAndClient, RestartCallback callback) activeDisruptionScheme.removeFromNode(nodeAndClient.name, this); } - Set excludedNodeIds = excludeMasters(Collections.singleton(nodeAndClient)); + Set excludedNodeIds = excludeClusterManagers(Collections.singleton(nodeAndClient)); final Settings newSettings = nodeAndClient.closeForRestart( callback, - autoManageMasterNodes ? getMinMasterNodes(getMasterNodesCount()) : -1 + autoManageClusterManagerNodes ? getMinClusterManagerNodes(getClusterManagerNodesCount()) : -1 ); removeExclusions(excludedNodeIds); @@ -1862,22 +1869,23 @@ private NodeAndClient removeNode(NodeAndClient nodeAndClient) { return previous; } - private Set excludeMasters(Collection nodeAndClients) { + private Set excludeClusterManagers(Collection nodeAndClients) { assert Thread.holdsLock(this); final Set excludedNodeNames = new HashSet<>(); - if (autoManageMasterNodes && nodeAndClients.size() > 0) { + if (autoManageClusterManagerNodes && nodeAndClients.size() > 0) { - final long currentMasters = nodes.values().stream().filter(NodeAndClient::isMasterEligible).count(); - final long stoppingMasters = nodeAndClients.stream().filter(NodeAndClient::isMasterEligible).count(); + final long currentClusterManagers = nodes.values().stream().filter(NodeAndClient::isMasterEligible).count(); + final long stoppingClusterManagers = nodeAndClients.stream().filter(NodeAndClient::isMasterEligible).count(); - assert stoppingMasters <= currentMasters : currentMasters + " < " + stoppingMasters; - if (stoppingMasters != currentMasters && stoppingMasters > 0) { - // If stopping few enough master-nodes that there's still a majority left, there is no need to withdraw their votes first. + assert stoppingClusterManagers <= currentClusterManagers : currentClusterManagers + " < " + stoppingClusterManagers; + if (stoppingClusterManagers != currentClusterManagers && stoppingClusterManagers > 0) { + // If stopping few enough cluster-manager-nodes that there's still a majority left, there is no need to withdraw their votes + // first. // However, we do not yet have a way to be sure there's a majority left, because the voting configuration may not yet have // been updated when the previous nodes shut down, so we must always explicitly withdraw votes. // TODO add cluster health API to check that voting configuration is optimal so this isn't always needed nodeAndClients.stream().filter(NodeAndClient::isMasterEligible).map(NodeAndClient::getName).forEach(excludedNodeNames::add); - assert excludedNodeNames.size() == stoppingMasters; + assert excludedNodeNames.size() == stoppingClusterManagers; logger.info("adding voting config exclusions {} prior to restart/shutdown", excludedNodeNames); try { @@ -1912,7 +1920,7 @@ private void removeExclusions(Set excludedNodeIds) { public synchronized void fullRestart(RestartCallback callback) throws Exception { int numNodesRestarted = 0; final Settings[] newNodeSettings = new Settings[nextNodeId.get()]; - final int minMasterNodes = autoManageMasterNodes ? getMinMasterNodes(getMasterNodesCount()) : -1; + final int minClusterManagerNodes = autoManageClusterManagerNodes ? getMinClusterManagerNodes(getClusterManagerNodesCount()) : -1; final List toStartAndPublish = new ArrayList<>(); // we want to start nodes in one go for (NodeAndClient nodeAndClient : nodes.values()) { callback.doAfterNodes(numNodesRestarted++, nodeAndClient.nodeClient()); @@ -1920,7 +1928,7 @@ public synchronized void fullRestart(RestartCallback callback) throws Exception if (activeDisruptionScheme != null) { activeDisruptionScheme.removeFromNode(nodeAndClient.name, this); } - final Settings newSettings = nodeAndClient.closeForRestart(callback, minMasterNodes); + final Settings newSettings = nodeAndClient.closeForRestart(callback, minClusterManagerNodes); newNodeSettings[nodeAndClient.nodeAndClientId()] = newSettings; toStartAndPublish.add(nodeAndClient); } @@ -1943,14 +1951,14 @@ public synchronized void fullRestart(RestartCallback callback) throws Exception } /** - * Returns the name of the current master node in the cluster. + * Returns the name of the current cluster-manager node in the cluster. */ public String getMasterName() { return getMasterName(null); } /** - * Returns the name of the current master node in the cluster and executes the request via the node specified + * Returns the name of the current cluster-manager node in the cluster and executes the request via the node specified * in the viaNode parameter. If viaNode isn't specified a random node will be picked to the send the request to. */ public String getMasterName(@Nullable String viaNode) { @@ -1959,7 +1967,7 @@ public String getMasterName(@Nullable String viaNode) { return client.admin().cluster().prepareState().get().getState().nodes().getMasterNode().getName(); } catch (Exception e) { logger.warn("Can't fetch cluster state", e); - throw new RuntimeException("Can't get master node " + e.getMessage(), e); + throw new RuntimeException("Can't get cluster-manager node " + e.getMessage(), e); } } @@ -1999,14 +2007,14 @@ public synchronized Set nodesInclude(String index) { } /** - * Performs cluster bootstrap when node with index {@link #bootstrapMasterNodeIndex} is started + * Performs cluster bootstrap when node with index {@link #bootstrapClusterManagerNodeIndex} is started * with the names of all existing and new cluster-manager-eligible nodes. * Indexing starts from 0. - * If {@link #bootstrapMasterNodeIndex} is -1 (default), this method does nothing. + * If {@link #bootstrapClusterManagerNodeIndex} is -1 (default), this method does nothing. */ - private List bootstrapMasterNodeWithSpecifiedIndex(List allNodesSettings) { + private List bootstrapClusterManagerNodeWithSpecifiedIndex(List allNodesSettings) { assert Thread.holdsLock(this); - if (bootstrapMasterNodeIndex == -1) { // fast-path + if (bootstrapClusterManagerNodeIndex == -1) { // fast-path return allNodesSettings; } @@ -2018,7 +2026,7 @@ private List bootstrapMasterNodeWithSpecifiedIndex(List allN newSettings.add(settings); } else { currentNodeId++; - if (currentNodeId != bootstrapMasterNodeIndex) { + if (currentNodeId != bootstrapClusterManagerNodeIndex) { newSettings.add(settings); } else { List nodeNames = new ArrayList<>(); @@ -2042,7 +2050,7 @@ private List bootstrapMasterNodeWithSpecifiedIndex(List allN .build() ); - setBootstrapMasterNodeIndex(-1); + setBootstrapClusterManagerNodeIndex(-1); } } } @@ -2089,46 +2097,46 @@ public List startNodes(int numOfNodes, Settings settings) { * Starts multiple nodes with the given settings and returns their names */ public synchronized List startNodes(Settings... extraSettings) { - final int newMasterCount = Math.toIntExact(Stream.of(extraSettings).filter(DiscoveryNode::isMasterNode).count()); - final int defaultMinMasterNodes; - if (autoManageMasterNodes) { - defaultMinMasterNodes = getMinMasterNodes(getMasterNodesCount() + newMasterCount); + final int newClusterManagerCount = Math.toIntExact(Stream.of(extraSettings).filter(DiscoveryNode::isMasterNode).count()); + final int defaultMinClusterManagerNodes; + if (autoManageClusterManagerNodes) { + defaultMinClusterManagerNodes = getMinClusterManagerNodes(getClusterManagerNodesCount() + newClusterManagerCount); } else { - defaultMinMasterNodes = -1; + defaultMinClusterManagerNodes = -1; } final List nodes = new ArrayList<>(); - final int prevMasterCount = getMasterNodesCount(); - int autoBootstrapMasterNodeIndex = autoManageMasterNodes - && prevMasterCount == 0 - && newMasterCount > 0 + final int prevClusterManagerCount = getClusterManagerNodesCount(); + int autoBootstrapClusterManagerNodeIndex = autoManageClusterManagerNodes + && prevClusterManagerCount == 0 + && newClusterManagerCount > 0 && Arrays.stream(extraSettings) .allMatch(s -> DiscoveryNode.isMasterNode(s) == false || ZEN2_DISCOVERY_TYPE.equals(DISCOVERY_TYPE_SETTING.get(s))) - ? RandomNumbers.randomIntBetween(random, 0, newMasterCount - 1) + ? RandomNumbers.randomIntBetween(random, 0, newClusterManagerCount - 1) : -1; final int numOfNodes = extraSettings.length; final int firstNodeId = nextNodeId.getAndIncrement(); final List settings = new ArrayList<>(); for (int i = 0; i < numOfNodes; i++) { - settings.add(getNodeSettings(firstNodeId + i, random.nextLong(), extraSettings[i], defaultMinMasterNodes)); + settings.add(getNodeSettings(firstNodeId + i, random.nextLong(), extraSettings[i], defaultMinClusterManagerNodes)); } nextNodeId.set(firstNodeId + numOfNodes); - final List initialMasterNodes = settings.stream() + final List initialClusterManagerNodes = settings.stream() .filter(DiscoveryNode::isMasterNode) .map(Node.NODE_NAME_SETTING::get) .collect(Collectors.toList()); - final List updatedSettings = bootstrapMasterNodeWithSpecifiedIndex(settings); + final List updatedSettings = bootstrapClusterManagerNodeWithSpecifiedIndex(settings); for (int i = 0; i < numOfNodes; i++) { final Settings nodeSettings = updatedSettings.get(i); final Builder builder = Settings.builder(); if (DiscoveryNode.isMasterNode(nodeSettings)) { - if (autoBootstrapMasterNodeIndex == 0) { - builder.putList(INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey(), initialMasterNodes); + if (autoBootstrapClusterManagerNodeIndex == 0) { + builder.putList(INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey(), initialClusterManagerNodes); } - autoBootstrapMasterNodeIndex -= 1; + autoBootstrapClusterManagerNodeIndex -= 1; } final NodeAndClient nodeAndClient = buildNode( @@ -2140,7 +2148,7 @@ public synchronized List startNodes(Settings... extraSettings) { nodes.add(nodeAndClient); } startAndPublishNodesAndClients(nodes); - if (autoManageMasterNodes) { + if (autoManageClusterManagerNodes) { validateClusterFormed(); } return nodes.stream().map(NodeAndClient::getName).collect(Collectors.toList()); @@ -2162,21 +2170,21 @@ public List startDataOnlyNodes(int numNodes, Settings settings) { return startNodes(numNodes, Settings.builder().put(onlyRole(settings, DiscoveryNodeRole.DATA_ROLE)).build()); } - /** calculates a min master nodes value based on the given number of master nodes */ - private static int getMinMasterNodes(int eligibleMasterNodes) { - return eligibleMasterNodes / 2 + 1; + /** calculates a min cluster-manager nodes value based on the given number of cluster-manager nodes */ + private static int getMinClusterManagerNodes(int eligibleClusterManagerNodes) { + return eligibleClusterManagerNodes / 2 + 1; } - private int getMasterNodesCount() { + private int getClusterManagerNodesCount() { return (int) nodes.values().stream().filter(n -> DiscoveryNode.isMasterNode(n.node().settings())).count(); } - public String startMasterOnlyNode() { - return startMasterOnlyNode(Settings.EMPTY); + public String startClusterManagerOnlyNode() { + return startClusterManagerOnlyNode(Settings.EMPTY); } - public String startMasterOnlyNode(Settings settings) { - Settings settings1 = Settings.builder().put(settings).put(masterOnlyNode(settings)).build(); + public String startClusterManagerOnlyNode(Settings settings) { + Settings settings1 = Settings.builder().put(settings).put(NodeRoles.clusterManagerOnlyNode(settings)).build(); return startNode(settings1); } @@ -2208,7 +2216,7 @@ public int numDataNodes() { @Override public int numDataAndMasterNodes() { - return filterNodes(nodes, DATA_NODE_PREDICATE.or(MASTER_NODE_PREDICATE)).size(); + return filterNodes(nodes, DATA_NODE_PREDICATE.or(CLUSTER_MANAGER_NODE_PREDICATE)).size(); } public int numMasterNodes() { diff --git a/test/framework/src/main/java/org/opensearch/test/NodeRoles.java b/test/framework/src/main/java/org/opensearch/test/NodeRoles.java index 64fd6b22e9805..4f448e230a2b6 100644 --- a/test/framework/src/main/java/org/opensearch/test/NodeRoles.java +++ b/test/framework/src/main/java/org/opensearch/test/NodeRoles.java @@ -176,11 +176,11 @@ public static Settings masterNode(final Settings settings) { return addRoles(settings, Collections.singleton(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE)); } - public static Settings masterOnlyNode() { - return masterOnlyNode(Settings.EMPTY); + public static Settings clusterManagerOnlyNode() { + return clusterManagerOnlyNode(Settings.EMPTY); } - public static Settings masterOnlyNode(final Settings settings) { + public static Settings clusterManagerOnlyNode(final Settings settings) { return onlyRole(settings, DiscoveryNodeRole.CLUSTER_MANAGER_ROLE); } diff --git a/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java b/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java index 8a3a5bcb5bb50..f36f4dedfdfaa 100644 --- a/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java @@ -707,17 +707,19 @@ public void setDisruptionScheme(ServiceDisruptionScheme scheme) { } /** - * Creates a disruption that isolates the current master node from all other nodes in the cluster. + * Creates a disruption that isolates the current cluster-manager node from all other nodes in the cluster. * * @param disruptionType type of disruption to create * @return disruption */ protected static NetworkDisruption isolateMasterDisruption(NetworkDisruption.NetworkLinkDisruptionType disruptionType) { - final String masterNode = internalCluster().getMasterName(); + final String clusterManagerNode = internalCluster().getMasterName(); return new NetworkDisruption( new NetworkDisruption.TwoPartitions( - Collections.singleton(masterNode), - Arrays.stream(internalCluster().getNodeNames()).filter(name -> name.equals(masterNode) == false).collect(Collectors.toSet()) + Collections.singleton(clusterManagerNode), + Arrays.stream(internalCluster().getNodeNames()) + .filter(name -> name.equals(clusterManagerNode) == false) + .collect(Collectors.toSet()) ), disruptionType ); @@ -949,12 +951,13 @@ private ClusterHealthStatus ensureColor( .waitForNoRelocatingShards(true) .waitForNoInitializingShards(waitForNoInitializingShards) // We currently often use ensureGreen or ensureYellow to check whether the cluster is back in a good state after shutting down - // a node. If the node that is stopped is the master node, another node will become master and publish a cluster state where it - // is master but where the node that was stopped hasn't been removed yet from the cluster state. It will only subsequently - // publish a second state where the old master is removed. If the ensureGreen/ensureYellow is timed just right, it will get to - // execute before the second cluster state update removes the old master and the condition ensureGreen / ensureYellow will - // trivially hold if it held before the node was shut down. The following "waitForNodes" condition ensures that the node has - // been removed by the master so that the health check applies to the set of nodes we expect to be part of the cluster. + // a node. If the node that is stopped is the cluster-manager node, another node will become cluster-manager and publish a + // cluster state where it is cluster-manager but where the node that was stopped hasn't been removed yet from the cluster state. + // It will only subsequently publish a second state where the old cluster-manager is removed. + // If the ensureGreen/ensureYellow is timed just right, it will get to execute before the second cluster state update removes + // the old cluster-manager and the condition ensureGreen / ensureYellow will trivially hold if it held before the node was + // shut down. The following "waitForNodes" condition ensures that the node has been removed by the cluster-manager + // so that the health check applies to the set of nodes we expect to be part of the cluster. .waitForNodes(Integer.toString(cluster().size())); ClusterHealthResponse actionGet = client().admin().cluster().health(healthRequest).actionGet(); @@ -1085,19 +1088,19 @@ protected void ensureClusterSizeConsistency() { } /** - * Verifies that all nodes that have the same version of the cluster state as master have same cluster state + * Verifies that all nodes that have the same version of the cluster state as cluster-manager have same cluster state */ protected void ensureClusterStateConsistency() throws IOException { if (cluster() != null && cluster().size() > 0) { final NamedWriteableRegistry namedWriteableRegistry = cluster().getNamedWriteableRegistry(); - final Client masterClient = client(); - ClusterState masterClusterState = masterClient.admin().cluster().prepareState().all().get().getState(); - byte[] masterClusterStateBytes = ClusterState.Builder.toBytes(masterClusterState); + final Client clusterManagerClient = client(); + ClusterState clusterManagerClusterState = clusterManagerClient.admin().cluster().prepareState().all().get().getState(); + byte[] masterClusterStateBytes = ClusterState.Builder.toBytes(clusterManagerClusterState); // remove local node reference - masterClusterState = ClusterState.Builder.fromBytes(masterClusterStateBytes, null, namedWriteableRegistry); - Map masterStateMap = convertToMap(masterClusterState); - int masterClusterStateSize = masterClusterState.toString().length(); - String masterId = masterClusterState.nodes().getMasterNodeId(); + clusterManagerClusterState = ClusterState.Builder.fromBytes(masterClusterStateBytes, null, namedWriteableRegistry); + Map clusterManagerStateMap = convertToMap(clusterManagerClusterState); + int clusterManagerClusterStateSize = clusterManagerClusterState.toString().length(); + String clusterManagerId = clusterManagerClusterState.nodes().getMasterNodeId(); for (Client client : cluster().getClients()) { ClusterState localClusterState = client.admin().cluster().prepareState().all().setLocal(true).get().getState(); byte[] localClusterStateBytes = ClusterState.Builder.toBytes(localClusterState); @@ -1105,27 +1108,32 @@ protected void ensureClusterStateConsistency() throws IOException { localClusterState = ClusterState.Builder.fromBytes(localClusterStateBytes, null, namedWriteableRegistry); final Map localStateMap = convertToMap(localClusterState); final int localClusterStateSize = localClusterState.toString().length(); - // Check that the non-master node has the same version of the cluster state as the master and - // that the master node matches the master (otherwise there is no requirement for the cluster state to match) - if (masterClusterState.version() == localClusterState.version() - && masterId.equals(localClusterState.nodes().getMasterNodeId())) { + // Check that the non-cluster-manager node has the same version of the cluster state as the cluster-manager and + // that the cluster-manager node matches the cluster-manager (otherwise there is no requirement for the cluster state to + // match) + if (clusterManagerClusterState.version() == localClusterState.version() + && clusterManagerId.equals(localClusterState.nodes().getMasterNodeId())) { try { - assertEquals("cluster state UUID does not match", masterClusterState.stateUUID(), localClusterState.stateUUID()); + assertEquals( + "cluster state UUID does not match", + clusterManagerClusterState.stateUUID(), + localClusterState.stateUUID() + ); // We cannot compare serialization bytes since serialization order of maps is not guaranteed // We also cannot compare byte array size because CompressedXContent's DeflateCompressor uses // a synced flush that can affect the size of the compressed byte array // (see: DeflateCompressedXContentTests#testDifferentCompressedRepresentation for an example) // instead we compare the string length of cluster state - they should be the same - assertEquals("cluster state size does not match", masterClusterStateSize, localClusterStateSize); + assertEquals("cluster state size does not match", clusterManagerClusterStateSize, localClusterStateSize); // Compare JSON serialization assertNull( "cluster state JSON serialization does not match", - differenceBetweenMapsIgnoringArrayOrder(masterStateMap, localStateMap) + differenceBetweenMapsIgnoringArrayOrder(clusterManagerStateMap, localStateMap) ); } catch (final AssertionError error) { logger.error( - "Cluster state from master:\n{}\nLocal cluster state:\n{}", - masterClusterState.toString(), + "Cluster state from cluster-manager:\n{}\nLocal cluster state:\n{}", + clusterManagerClusterState.toString(), localClusterState.toString() ); throw error; @@ -1138,8 +1146,8 @@ protected void ensureClusterStateConsistency() throws IOException { protected void ensureClusterStateCanBeReadByNodeTool() throws IOException { if (cluster() != null && cluster().size() > 0) { - final Client masterClient = client(); - Metadata metadata = masterClient.admin().cluster().prepareState().all().get().getState().metadata(); + final Client clusterManagerClient = client(); + Metadata metadata = clusterManagerClient.admin().cluster().prepareState().all().get().getState().metadata(); final Map serializationParams = new HashMap<>(2); serializationParams.put("binary", "true"); serializationParams.put(Metadata.CONTEXT_MODE_PARAM, Metadata.CONTEXT_MODE_GATEWAY); @@ -1320,7 +1328,7 @@ protected void ensureStableCluster(int nodeCount, TimeValue timeValue, boolean l /** * Ensures that all nodes in the cluster are connected to each other. * - * Some network disruptions may leave nodes that are not the master disconnected from each other. + * Some network disruptions may leave nodes that are not the cluster-manager disconnected from each other. * {@link org.opensearch.cluster.NodeConnectionsService} will eventually reconnect but it's * handy to be able to ensure this happens faster */ @@ -1738,9 +1746,9 @@ public enum Scope { int maxNumDataNodes() default -1; /** - * Indicates whether the cluster can have dedicated master nodes. If {@code false} means data nodes will serve as master nodes - * and there will be no dedicated master (and data) nodes. Default is {@code false} which means - * dedicated master nodes will be randomly used. + * Indicates whether the cluster can have dedicated cluster-manager nodes. If {@code false} means data nodes will serve as cluster-manager nodes + * and there will be no dedicated cluster-manager (and data) nodes. Default is {@code false} which means + * dedicated cluster-manager nodes will be randomly used. */ boolean supportsDedicatedMasters() default true; @@ -1829,12 +1837,12 @@ private static Scope getCurrentClusterScope(Class clazz) { return annotation == null ? Scope.SUITE : annotation.scope(); } - private boolean getSupportsDedicatedMasters() { + private boolean getSupportsDedicatedClusterManagers() { ClusterScope annotation = getAnnotation(this.getClass(), ClusterScope.class); return annotation == null ? true : annotation.supportsDedicatedMasters(); } - private boolean getAutoManageMasterNodes() { + private boolean getAutoManageClusterManagerNodes() { ClusterScope annotation = getAnnotation(this.getClass(), ClusterScope.class); return annotation == null ? true : annotation.autoManageMasterNodes(); } @@ -1959,7 +1967,7 @@ protected TestCluster buildTestCluster(Scope scope, long seed) throws IOExceptio throw new OpenSearchException("Scope not supported: " + scope); } - boolean supportsDedicatedMasters = getSupportsDedicatedMasters(); + boolean supportsDedicatedClusterManagers = getSupportsDedicatedClusterManagers(); int numDataNodes = getNumDataNodes(); int minNumDataNodes; int maxNumDataNodes; @@ -1983,8 +1991,8 @@ protected TestCluster buildTestCluster(Scope scope, long seed) throws IOExceptio return new InternalTestCluster( seed, createTempDir(), - supportsDedicatedMasters, - getAutoManageMasterNodes(), + supportsDedicatedClusterManagers, + getAutoManageClusterManagerNodes(), minNumDataNodes, maxNumDataNodes, InternalTestCluster.clusterName(scope.name(), seed) + "-cluster", @@ -2227,7 +2235,7 @@ public final void cleanUpCluster() throws Exception { // need to check that there are no more in-flight search contexts before // we remove indices if (isInternalCluster()) { - internalCluster().setBootstrapMasterNodeIndex(-1); + internalCluster().setBootstrapClusterManagerNodeIndex(-1); } super.ensureAllSearchContextsReleased(); if (runTestScopeLifecycle()) { diff --git a/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java b/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java index e3f6e6019546b..04b3773c1d385 100644 --- a/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java @@ -97,7 +97,7 @@ protected void startNode(long seed) throws Exception { assert NODE == null; NODE = RandomizedContext.current().runWithPrivateRandomness(seed, this::newNode); // we must wait for the node to actually be up and running. otherwise the node might have started, - // elected itself master but might not yet have removed the + // elected itself cluster-manager but might not yet have removed the // SERVICE_UNAVAILABLE/1/state not recovered / initialized block ClusterHealthResponse clusterHealthResponse = client().admin().cluster().prepareHealth().setWaitForGreenStatus().get(); assertFalse(clusterHealthResponse.isTimedOut()); diff --git a/test/framework/src/main/java/org/opensearch/test/TestCluster.java b/test/framework/src/main/java/org/opensearch/test/TestCluster.java index 2bc0ffd941502..26081d947431d 100644 --- a/test/framework/src/main/java/org/opensearch/test/TestCluster.java +++ b/test/framework/src/main/java/org/opensearch/test/TestCluster.java @@ -125,7 +125,7 @@ public void assertAfterTest() throws Exception { public abstract int numDataNodes(); /** - * Returns the number of data and master eligible nodes in the cluster. + * Returns the number of data and cluster-manager eligible nodes in the cluster. */ public abstract int numDataAndMasterNodes(); diff --git a/test/framework/src/main/java/org/opensearch/test/VersionUtils.java b/test/framework/src/main/java/org/opensearch/test/VersionUtils.java index 5989dfa7898fd..f763d749d70c1 100644 --- a/test/framework/src/main/java/org/opensearch/test/VersionUtils.java +++ b/test/framework/src/main/java/org/opensearch/test/VersionUtils.java @@ -65,7 +65,7 @@ static Tuple, List> resolveReleasedVersions(Version curre Map> majorVersions = Version.getDeclaredVersions(versionClass) .stream() .collect(Collectors.groupingBy(v -> (int) v.major)); - // this breaks b/c 5.x is still in version list but master doesn't care about it! + // this breaks b/c 5.x is still in version list but cluster-manager doesn't care about it! // assert majorVersions.size() == 2; List> oldVersions = new ArrayList<>(0); List> previousMajor = new ArrayList<>(0); @@ -85,7 +85,7 @@ static Tuple, List> resolveReleasedVersions(Version curre List unreleasedVersions = new ArrayList<>(); final List> stableVersions; if (currentMajor.size() == 1) { - // on master branch + // on main branch stableVersions = previousMajor; // remove current moveLastToUnreleased(currentMajor, unreleasedVersions); diff --git a/test/framework/src/main/java/org/opensearch/test/disruption/BlockMasterServiceOnMaster.java b/test/framework/src/main/java/org/opensearch/test/disruption/BlockMasterServiceOnMaster.java index 99397f0ffd953..85f8e5c250066 100644 --- a/test/framework/src/main/java/org/opensearch/test/disruption/BlockMasterServiceOnMaster.java +++ b/test/framework/src/main/java/org/opensearch/test/disruption/BlockMasterServiceOnMaster.java @@ -62,7 +62,7 @@ public void startDisrupting() { if (clusterService == null) { return; } - logger.info("blocking master service on node [{}]", disruptionNodeCopy); + logger.info("blocking cluster-manager service on node [{}]", disruptionNodeCopy); boolean success = disruptionLatch.compareAndSet(null, new CountDownLatch(1)); assert success : "startDisrupting called without waiting on stopDisrupting to complete"; final CountDownLatch started = new CountDownLatch(1); diff --git a/test/framework/src/main/java/org/opensearch/test/disruption/BusyMasterServiceDisruption.java b/test/framework/src/main/java/org/opensearch/test/disruption/BusyMasterServiceDisruption.java index 65cc0dac47a2b..4830f9b0359fb 100644 --- a/test/framework/src/main/java/org/opensearch/test/disruption/BusyMasterServiceDisruption.java +++ b/test/framework/src/main/java/org/opensearch/test/disruption/BusyMasterServiceDisruption.java @@ -61,7 +61,7 @@ public void startDisrupting() { if (clusterService == null) { return; } - logger.info("making master service busy on node [{}] at priority [{}]", disruptionNodeCopy, priority); + logger.info("making cluster-manager service busy on node [{}] at priority [{}]", disruptionNodeCopy, priority); active.set(true); submitTask(clusterService); } diff --git a/test/framework/src/main/java/org/opensearch/test/disruption/NetworkDisruption.java b/test/framework/src/main/java/org/opensearch/test/disruption/NetworkDisruption.java index b3877b202d36d..7f2644d8e857c 100644 --- a/test/framework/src/main/java/org/opensearch/test/disruption/NetworkDisruption.java +++ b/test/framework/src/main/java/org/opensearch/test/disruption/NetworkDisruption.java @@ -109,7 +109,7 @@ public void ensureHealthy(InternalTestCluster cluster) { /** * Ensures that all nodes in the cluster are connected to each other. * - * Some network disruptions may leave nodes that are not the master disconnected from each other. + * Some network disruptions may leave nodes that are not the cluster-manager disconnected from each other. * {@link org.opensearch.cluster.NodeConnectionsService} will eventually reconnect but it's * handy to be able to ensure this happens faster */ diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlDocsTestClient.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlDocsTestClient.java index d57fa7ff82f07..cd5f1fe168b12 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlDocsTestClient.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlDocsTestClient.java @@ -62,10 +62,10 @@ public ClientYamlDocsTestClient( final RestClient restClient, final List hosts, final Version esVersion, - final Version masterVersion, + final Version clusterManagerVersion, final CheckedSupplier clientBuilderWithSniffedNodes ) { - super(restSpec, restClient, hosts, esVersion, masterVersion, clientBuilderWithSniffedNodes); + super(restSpec, restClient, hosts, esVersion, clusterManagerVersion, clientBuilderWithSniffedNodes); } @Override diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestClient.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestClient.java index 7a31c73d24305..6a87a89db4959 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestClient.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestClient.java @@ -78,7 +78,7 @@ public class ClientYamlTestClient implements Closeable { private final ClientYamlSuiteRestSpec restSpec; private final Map restClients = new HashMap<>(); private final Version esVersion; - private final Version masterVersion; + private final Version clusterManagerVersion; private final CheckedSupplier clientBuilderWithSniffedNodes; ClientYamlTestClient( @@ -86,14 +86,14 @@ public class ClientYamlTestClient implements Closeable { final RestClient restClient, final List hosts, final Version esVersion, - final Version masterVersion, + final Version clusterManagerVersion, final CheckedSupplier clientBuilderWithSniffedNodes ) { assert hosts.size() > 0; this.restSpec = restSpec; this.restClients.put(NodeSelector.ANY, restClient); this.esVersion = esVersion; - this.masterVersion = masterVersion; + this.clusterManagerVersion = clusterManagerVersion; this.clientBuilderWithSniffedNodes = clientBuilderWithSniffedNodes; } @@ -101,8 +101,8 @@ public Version getEsVersion() { return esVersion; } - public Version getMasterVersion() { - return masterVersion; + public Version getClusterManagerVersion() { + return clusterManagerVersion; } /** diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestExecutionContext.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestExecutionContext.java index 4c3a1ec863d31..8e6bbd009dc2f 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestExecutionContext.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestExecutionContext.java @@ -228,7 +228,7 @@ public Version esVersion() { } public Version masterVersion() { - return clientYamlTestClient.getMasterVersion(); + return clientYamlTestClient.getClusterManagerVersion(); } } diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java index 1b19f03f46174..f228c87186afd 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java @@ -144,14 +144,14 @@ public void initAndResetContext() throws Exception { final List hosts = getClusterHosts(); Tuple versionVersionTuple = readVersionsFromCatNodes(adminClient()); final Version minVersion = versionVersionTuple.v1(); - final Version masterVersion = versionVersionTuple.v2(); + final Version clusterManagerVersion = versionVersionTuple.v2(); logger.info( - "initializing client, minimum OpenSearch version [{}], master version, [{}], hosts {}", + "initializing client, minimum OpenSearch version [{}], cluster-manager version, [{}], hosts {}", minVersion, - masterVersion, + clusterManagerVersion, hosts ); - clientYamlTestClient = initClientYamlTestClient(restSpec, client(), hosts, minVersion, masterVersion); + clientYamlTestClient = initClientYamlTestClient(restSpec, client(), hosts, minVersion, clusterManagerVersion); restTestExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, randomizeContentType()); adminExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, false); final String[] denylist = resolvePathsProperty(REST_TESTS_DENYLIST, null); @@ -179,9 +179,16 @@ protected ClientYamlTestClient initClientYamlTestClient( final RestClient restClient, final List hosts, final Version esVersion, - final Version masterVersion + final Version clusterManagerVersion ) { - return new ClientYamlTestClient(restSpec, restClient, hosts, esVersion, masterVersion, this::getClientBuilderWithSniffedHosts); + return new ClientYamlTestClient( + restSpec, + restClient, + hosts, + esVersion, + clusterManagerVersion, + this::getClientBuilderWithSniffedHosts + ); } @AfterClass @@ -330,28 +337,28 @@ private static void validateSpec(ClientYamlSuiteRestSpec restSpec) { * Detect minimal node version and master node version of cluster using REST Client. * * @param restClient REST client used to discover cluster nodes - * @return {@link Tuple} of [minimal node version, master node version] + * @return {@link Tuple} of [minimal node version, cluster-manager node version] * @throws IOException When _cat API output parsing fails */ private Tuple readVersionsFromCatNodes(RestClient restClient) throws IOException { // we simply go to the _cat/nodes API and parse all versions in the cluster final Request request = new Request("GET", "/_cat/nodes"); request.addParameter("h", "version,master"); - request.setOptions(getCatNodesVersionMasterRequestOptions()); + request.setOptions(getCatNodesVersionClusterManagerRequestOptions()); Response response = restClient.performRequest(request); ClientYamlTestResponse restTestResponse = new ClientYamlTestResponse(response); String nodesCatResponse = restTestResponse.getBodyAsString(); String[] split = nodesCatResponse.split("\n"); Version version = null; - Version masterVersion = null; + Version clusterManagerVersion = null; for (String perNode : split) { - final String[] versionAndMaster = perNode.split("\\s+"); - assert versionAndMaster.length == 2 : "invalid line: " + perNode + " length: " + versionAndMaster.length; - final Version currentVersion = Version.fromString(versionAndMaster[0]); - final boolean master = versionAndMaster[1].trim().equals("*"); - if (master) { - assert masterVersion == null; - masterVersion = currentVersion; + final String[] versionAndClusterManager = perNode.split("\\s+"); + assert versionAndClusterManager.length == 2 : "invalid line: " + perNode + " length: " + versionAndClusterManager.length; + final Version currentVersion = Version.fromString(versionAndClusterManager[0]); + final boolean clusterManager = versionAndClusterManager[1].trim().equals("*"); + if (clusterManager) { + assert clusterManagerVersion == null; + clusterManagerVersion = currentVersion; } if (version == null) { version = currentVersion; @@ -359,10 +366,10 @@ private Tuple readVersionsFromCatNodes(RestClient restClient) version = currentVersion; } } - return new Tuple<>(version, masterVersion); + return new Tuple<>(version, clusterManagerVersion); } - protected RequestOptions getCatNodesVersionMasterRequestOptions() { + protected RequestOptions getCatNodesVersionClusterManagerRequestOptions() { return RequestOptions.DEFAULT; } diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/section/DoSection.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/section/DoSection.java index 6f29207e2a823..6fdc77984c339 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/section/DoSection.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/section/DoSection.java @@ -353,7 +353,7 @@ public void execute(ClientYamlTestExecutionContext executionContext) throws IOEx /** * Check that the response contains only the warning headers that we expect. */ - void checkWarningHeaders(final List warningHeaders, final Version masterVersion) { + void checkWarningHeaders(final List warningHeaders, final Version clusterManagerVersion) { final List unexpected = new ArrayList<>(); final List unmatched = new ArrayList<>(); final List missing = new ArrayList<>(); @@ -367,7 +367,7 @@ void checkWarningHeaders(final List warningHeaders, final Version master final boolean matches = matcher.matches(); if (matches) { final String message = HeaderWarning.extractWarningValueFromWarningHeader(header, true); - if (masterVersion.before(LegacyESVersion.V_7_0_0) + if (clusterManagerVersion.before(LegacyESVersion.V_7_0_0) && message.equals( "the default number of shards will change from [5] to [1] in 7.0.0; " + "if you wish to continue using the default of [5] shards, " @@ -375,7 +375,7 @@ void checkWarningHeaders(final List warningHeaders, final Version master )) { /* * This warning header will come back in the vast majority of our tests that create an index when running against an - * older master. Rather than rewrite our tests to assert this warning header, we assume that it is expected. + * older cluster-manager. Rather than rewrite our tests to assert this warning header, we assume that it is expected. */ continue; } diff --git a/test/framework/src/test/java/org/opensearch/cluster/service/FakeThreadPoolMasterServiceTests.java b/test/framework/src/test/java/org/opensearch/cluster/service/FakeThreadPoolMasterServiceTests.java index 4f321019a37ac..dabeeb6742ec4 100644 --- a/test/framework/src/test/java/org/opensearch/cluster/service/FakeThreadPoolMasterServiceTests.java +++ b/test/framework/src/test/java/org/opensearch/cluster/service/FakeThreadPoolMasterServiceTests.java @@ -63,7 +63,7 @@ public class FakeThreadPoolMasterServiceTests extends OpenSearchTestCase { - public void testFakeMasterService() { + public void testFakeClusterManagerService() { List runnableTasks = new ArrayList<>(); AtomicReference lastClusterStateRef = new AtomicReference<>(); DiscoveryNode discoveryNode = new DiscoveryNode( @@ -84,21 +84,21 @@ public void testFakeMasterService() { doAnswer(invocationOnMock -> runnableTasks.add((Runnable) invocationOnMock.getArguments()[0])).when(executorService).execute(any()); when(mockThreadPool.generic()).thenReturn(executorService); - FakeThreadPoolMasterService masterService = new FakeThreadPoolMasterService( + FakeThreadPoolMasterService clusterManagerService = new FakeThreadPoolMasterService( "test_node", "test", mockThreadPool, runnableTasks::add ); - masterService.setClusterStateSupplier(lastClusterStateRef::get); - masterService.setClusterStatePublisher((event, publishListener, ackListener) -> { + clusterManagerService.setClusterStateSupplier(lastClusterStateRef::get); + clusterManagerService.setClusterStatePublisher((event, publishListener, ackListener) -> { lastClusterStateRef.set(event.state()); publishingCallback.set(publishListener); }); - masterService.start(); + clusterManagerService.start(); AtomicBoolean firstTaskCompleted = new AtomicBoolean(); - masterService.submitStateUpdateTask("test1", new ClusterStateUpdateTask() { + clusterManagerService.submitStateUpdateTask("test1", new ClusterStateUpdateTask() { @Override public ClusterState execute(ClusterState currentState) { return ClusterState.builder(currentState) @@ -124,7 +124,7 @@ public void onFailure(String source, Exception e) { assertFalse(firstTaskCompleted.get()); final Runnable scheduleTask = runnableTasks.remove(0); - assertThat(scheduleTask, hasToString("master service scheduling next task")); + assertThat(scheduleTask, hasToString("cluster-manager service scheduling next task")); scheduleTask.run(); final Runnable publishTask = runnableTasks.remove(0); @@ -138,7 +138,7 @@ public void onFailure(String source, Exception e) { assertThat(runnableTasks.size(), equalTo(0)); AtomicBoolean secondTaskCompleted = new AtomicBoolean(); - masterService.submitStateUpdateTask("test2", new ClusterStateUpdateTask() { + clusterManagerService.submitStateUpdateTask("test2", new ClusterStateUpdateTask() { @Override public ClusterState execute(ClusterState currentState) { return ClusterState.builder(currentState) diff --git a/test/framework/src/test/java/org/opensearch/test/disruption/NetworkDisruptionIT.java b/test/framework/src/test/java/org/opensearch/test/disruption/NetworkDisruptionIT.java index b58d4fd45ff93..20ce592bbfd46 100644 --- a/test/framework/src/test/java/org/opensearch/test/disruption/NetworkDisruptionIT.java +++ b/test/framework/src/test/java/org/opensearch/test/disruption/NetworkDisruptionIT.java @@ -76,11 +76,11 @@ protected Collection> nodePlugins() { /** * Creates 3 to 5 mixed-node cluster and splits it into 2 parts. * The first part is guaranteed to have at least the majority of the nodes, - * so that master could be elected on this side. + * so that cluster-manager could be elected on this side. */ private Tuple, Set> prepareDisruptedCluster() { int numOfNodes = randomIntBetween(3, 5); - internalCluster().setBootstrapMasterNodeIndex(numOfNodes - 1); + internalCluster().setBootstrapClusterManagerNodeIndex(numOfNodes - 1); Set nodes = new HashSet<>(internalCluster().startNodes(numOfNodes, DISRUPTION_TUNED_SETTINGS)); ensureGreen(); assertThat(nodes.size(), greaterThanOrEqualTo(3)); @@ -127,7 +127,7 @@ public void testNetworkPartitionRemovalRestoresConnections() throws Exception { } public void testTransportRespondsEventually() throws InterruptedException { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); internalCluster().ensureAtLeastNumDataNodes(randomIntBetween(3, 5)); final NetworkDisruption.DisruptedLinks disruptedLinks; if (randomBoolean()) { diff --git a/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterIT.java b/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterIT.java index b650eb2c03022..0464343c2c6ee 100644 --- a/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterIT.java +++ b/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterIT.java @@ -79,7 +79,7 @@ public void testStoppingNodesOneByOne() throws IOException { } public void testOperationsDuringRestart() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNodes(2); internalCluster().restartRandomDataNode(new InternalTestCluster.RestartCallback() { @Override diff --git a/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java b/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java index 87cd98a717be6..262008507753e 100644 --- a/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java +++ b/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java @@ -86,7 +86,7 @@ private static Collection> mockPlugins() { public void testInitializiationIsConsistent() { long clusterSeed = randomLong(); - boolean masterNodes = randomBoolean(); + boolean clusterManagerNodes = randomBoolean(); int minNumDataNodes = randomIntBetween(0, 9); int maxNumDataNodes = randomIntBetween(minNumDataNodes, 10); String clusterName = randomRealisticUnicodeOfCodepointLengthBetween(1, 10); @@ -98,7 +98,7 @@ public void testInitializiationIsConsistent() { InternalTestCluster cluster0 = new InternalTestCluster( clusterSeed, baseDir, - masterNodes, + clusterManagerNodes, randomBoolean(), minNumDataNodes, maxNumDataNodes, @@ -112,7 +112,7 @@ public void testInitializiationIsConsistent() { InternalTestCluster cluster1 = new InternalTestCluster( clusterSeed, baseDir, - masterNodes, + clusterManagerNodes, randomBoolean(), minNumDataNodes, maxNumDataNodes, @@ -165,23 +165,23 @@ public static void assertSettings(Settings left, Settings right, boolean checkCl } public void testBeforeTest() throws Exception { - final boolean autoManageMinMasterNodes = randomBoolean(); + final boolean autoManageMinClusterManagerNodes = randomBoolean(); long clusterSeed = randomLong(); - final boolean masterNodes; + final boolean clusterManagerNodes; final int minNumDataNodes; final int maxNumDataNodes; - final int bootstrapMasterNodeIndex; - if (autoManageMinMasterNodes) { - masterNodes = randomBoolean(); + final int bootstrapClusterManagerNodeIndex; + if (autoManageMinClusterManagerNodes) { + clusterManagerNodes = randomBoolean(); minNumDataNodes = randomIntBetween(0, 3); maxNumDataNodes = randomIntBetween(minNumDataNodes, 4); - bootstrapMasterNodeIndex = -1; + bootstrapClusterManagerNodeIndex = -1; } else { - // if we manage min master nodes, we need to lock down the number of nodes + // if we manage min cluster-manager nodes, we need to lock down the number of nodes minNumDataNodes = randomIntBetween(0, 4); maxNumDataNodes = minNumDataNodes; - masterNodes = false; - bootstrapMasterNodeIndex = maxNumDataNodes == 0 ? -1 : randomIntBetween(0, maxNumDataNodes - 1); + clusterManagerNodes = false; + bootstrapClusterManagerNodeIndex = maxNumDataNodes == 0 ? -1 : randomIntBetween(0, maxNumDataNodes - 1); } final int numClientNodes = randomIntBetween(0, 2); NodeConfigurationSource nodeConfigurationSource = new NodeConfigurationSource() { @@ -191,9 +191,9 @@ public Settings nodeSettings(int nodeOrdinal) { .put(DiscoveryModule.DISCOVERY_SEED_PROVIDERS_SETTING.getKey(), "file") .putList(SettingsBasedSeedHostsProvider.DISCOVERY_SEED_HOSTS_SETTING.getKey()) .put(NetworkModule.TRANSPORT_TYPE_KEY, getTestTransportType()); - if (autoManageMinMasterNodes == false) { + if (autoManageMinClusterManagerNodes == false) { assert minNumDataNodes == maxNumDataNodes; - assert masterNodes == false; + assert clusterManagerNodes == false; } return settings.build(); } @@ -209,8 +209,8 @@ public Path nodeConfigPath(int nodeOrdinal) { InternalTestCluster cluster0 = new InternalTestCluster( clusterSeed, createTempDir(), - masterNodes, - autoManageMinMasterNodes, + clusterManagerNodes, + autoManageMinClusterManagerNodes, minNumDataNodes, maxNumDataNodes, "clustername", @@ -220,13 +220,13 @@ public Path nodeConfigPath(int nodeOrdinal) { mockPlugins(), Function.identity() ); - cluster0.setBootstrapMasterNodeIndex(bootstrapMasterNodeIndex); + cluster0.setBootstrapClusterManagerNodeIndex(bootstrapClusterManagerNodeIndex); InternalTestCluster cluster1 = new InternalTestCluster( clusterSeed, createTempDir(), - masterNodes, - autoManageMinMasterNodes, + clusterManagerNodes, + autoManageMinClusterManagerNodes, minNumDataNodes, maxNumDataNodes, "clustername", @@ -236,7 +236,7 @@ public Path nodeConfigPath(int nodeOrdinal) { mockPlugins(), Function.identity() ); - cluster1.setBootstrapMasterNodeIndex(bootstrapMasterNodeIndex); + cluster1.setBootstrapClusterManagerNodeIndex(bootstrapClusterManagerNodeIndex); assertClusters(cluster0, cluster1, false); long seed = randomLong(); @@ -265,7 +265,7 @@ public Path nodeConfigPath(int nodeOrdinal) { public void testDataFolderAssignmentAndCleaning() throws IOException, InterruptedException { long clusterSeed = randomLong(); - boolean masterNodes = randomBoolean(); + boolean clusterManagerNodes = randomBoolean(); // we need one stable node final int minNumDataNodes = 2; final int maxNumDataNodes = 2; @@ -291,7 +291,7 @@ public Path nodeConfigPath(int nodeOrdinal) { InternalTestCluster cluster = new InternalTestCluster( clusterSeed, baseDir, - masterNodes, + clusterManagerNodes, true, minNumDataNodes, maxNumDataNodes, @@ -304,13 +304,13 @@ public Path nodeConfigPath(int nodeOrdinal) { ); try { cluster.beforeTest(random()); - final int originalMasterCount = cluster.numMasterNodes(); + final int originalClusterManagerCount = cluster.numMasterNodes(); final Map shardNodePaths = new HashMap<>(); for (String name : cluster.getNodeNames()) { shardNodePaths.put(name, getNodePaths(cluster, name)); } String poorNode = randomValueOtherThanMany( - n -> originalMasterCount == 1 && n.equals(cluster.getMasterName()), + n -> originalClusterManagerCount == 1 && n.equals(cluster.getMasterName()), () -> randomFrom(cluster.getNodeNames()) ); Path dataPath = getNodePaths(cluster, poorNode)[0]; @@ -409,7 +409,7 @@ public Path nodeConfigPath(int nodeOrdinal) { roles.add(role); } - cluster.setBootstrapMasterNodeIndex( + cluster.setBootstrapClusterManagerNodeIndex( randomIntBetween(0, (int) roles.stream().filter(role -> role.equals(clusterManagerRole)).count() - 1) ); @@ -419,7 +419,7 @@ public Path nodeConfigPath(int nodeOrdinal) { final DiscoveryNodeRole role = roles.get(i); final String node; if (role == clusterManagerRole) { - node = cluster.startMasterOnlyNode(); + node = cluster.startClusterManagerOnlyNode(); } else if (role == DiscoveryNodeRole.DATA_ROLE) { node = cluster.startDataOnlyNode(); } else if (role == DiscoveryNodeRole.INGEST_ROLE) { From 3aef125d0dbf2f29d9bf00b84cb52892a27a5328 Mon Sep 17 00:00:00 2001 From: Nick Knize Date: Thu, 12 May 2022 14:29:58 -0500 Subject: [PATCH 05/20] [Javadocs] add remaining internal classes and reenable missingJavadoc on server (#3296) Adds the remaining javadocs to internal classes and reenables the missingJavadoc gradle task on the server module. From here forward if class level javadocs are missing in the server module, gradle check will fail! Signed-off-by: Nicholas Walter Knize --- gradle/missing-javadoc.gradle | 3 +- .../org/opensearch/action/IndicesRequest.java | 5 ++ .../cluster/health/ClusterHealthRequest.java | 5 ++ .../indices/alias/IndicesAliasesRequest.java | 5 ++ .../admin/indices/get/GetIndexRequest.java | 5 ++ .../admin/indices/stats/CommonStatsFlags.java | 5 ++ .../action/search/TransportSearchAction.java | 5 ++ .../action/support/IndicesOptions.java | 10 ++++ .../action/support/WriteRequest.java | 5 ++ .../replication/ReplicationOperation.java | 5 ++ .../termvectors/TermVectorsRequest.java | 5 ++ .../bootstrap/jvm/DenyJvmVersionsParser.java | 7 +++ .../bootstrap/jvm/package-info.java | 10 ++++ .../opensearch/cluster/AbstractDiffable.java | 5 ++ .../cluster/AbstractNamedDiffable.java | 5 ++ .../org/opensearch/cluster/ClusterInfo.java | 9 +++ .../org/opensearch/cluster/ClusterState.java | 22 +++++++ .../cluster/ClusterStateObserver.java | 22 +++++++ .../cluster/ClusterStateTaskConfig.java | 5 ++ .../cluster/ClusterStateTaskExecutor.java | 12 ++++ .../org/opensearch/cluster/DiffableUtils.java | 26 +++++++++ .../cluster/InternalClusterInfoService.java | 9 +++ .../cluster/NodeConnectionsService.java | 7 +++ .../cluster/RepositoryCleanupInProgress.java | 5 ++ .../opensearch/cluster/RestoreInProgress.java | 11 ++++ .../cluster/SnapshotDeletionsInProgress.java | 7 +++ .../cluster/SnapshotsInProgress.java | 20 +++++++ .../action/index/MappingUpdatedAction.java | 5 ++ .../index/NodeMappingRefreshAction.java | 10 ++++ .../action/shard/ShardStateAction.java | 35 +++++++++++ .../cluster/block/ClusterBlocks.java | 10 ++++ .../ClusterFormationFailureHelper.java | 10 ++++ .../coordination/ClusterStatePublisher.java | 5 ++ .../coordination/CoordinationMetadata.java | 12 ++++ .../coordination/CoordinationState.java | 4 ++ .../cluster/coordination/Coordinator.java | 15 +++++ .../ElectionSchedulerFactory.java | 5 ++ .../coordination/FollowersChecker.java | 12 ++++ .../cluster/coordination/JoinHelper.java | 35 +++++++++++ .../coordination/JoinTaskExecutor.java | 5 ++ .../cluster/coordination/LagDetector.java | 5 ++ .../cluster/coordination/LeaderChecker.java | 10 ++++ .../NodeRemovalClusterStateTaskExecutor.java | 5 ++ .../coordination/OpenSearchNodeCommand.java | 10 ++++ .../PendingClusterStateStats.java | 5 ++ .../coordination/PreVoteCollector.java | 5 ++ .../cluster/coordination/Publication.java | 15 +++++ .../PublicationTransportHandler.java | 2 + .../cluster/coordination/Reconfigurator.java | 5 ++ .../cluster/metadata/AliasAction.java | 8 +++ .../cluster/metadata/AliasMetadata.java | 5 ++ .../ClusterNameExpressionResolver.java | 5 ++ .../metadata/ComponentTemplateMetadata.java | 5 ++ .../metadata/ComposableIndexTemplate.java | 5 ++ .../ComposableIndexTemplateMetadata.java | 5 ++ .../cluster/metadata/DataStream.java | 5 ++ .../cluster/metadata/DataStreamMetadata.java | 10 ++++ .../cluster/metadata/DiffableStringMap.java | 2 + .../cluster/metadata/IndexAbstraction.java | 9 +++ .../cluster/metadata/IndexGraveyard.java | 8 +++ .../cluster/metadata/IndexMetadata.java | 20 +++++++ .../metadata/IndexNameExpressionResolver.java | 12 ++++ .../metadata/IndexTemplateMetadata.java | 5 ++ .../opensearch/cluster/metadata/Manifest.java | 5 ++ .../opensearch/cluster/metadata/Metadata.java | 20 +++++++ .../MetadataCreateDataStreamService.java | 5 ++ .../metadata/MetadataIndexStateService.java | 4 ++ .../MetadataIndexTemplateService.java | 30 ++++++++++ .../SystemIndexMetadataUpgradeService.java | 5 ++ .../cluster/node/DiscoveryNodeFilters.java | 5 ++ .../cluster/node/DiscoveryNodes.java | 10 ++++ .../cluster/routing/IndexRoutingTable.java | 5 ++ .../routing/IndexShardRoutingTable.java | 5 ++ .../cluster/routing/RecoverySource.java | 15 +++++ .../routing/RoutingChangesObserver.java | 5 ++ .../cluster/routing/RoutingNodes.java | 15 +++++ .../cluster/routing/RoutingTable.java | 2 + .../cluster/routing/UnassignedInfo.java | 4 ++ .../routing/allocation/AllocationService.java | 2 + .../allocation/DiskThresholdSettings.java | 15 +++++ .../allocation/NodeAllocationResult.java | 6 +- .../routing/allocation/RoutingAllocation.java | 5 ++ .../allocator/BalancedShardsAllocator.java | 17 ++++++ ...AllocateEmptyPrimaryAllocationCommand.java | 5 ++ .../AllocateReplicaAllocationCommand.java | 5 ++ ...AllocateStalePrimaryAllocationCommand.java | 5 ++ .../command/BasePrimaryAllocationCommand.java | 5 ++ .../ClusterRebalanceAllocationDecider.java | 2 + .../routing/allocation/decider/Decision.java | 6 ++ .../decider/EnableAllocationDecider.java | 4 ++ .../opensearch/common/LocalTimeOffset.java | 5 ++ .../java/org/opensearch/common/Rounding.java | 7 +++ .../common/breaker/CircuitBreaker.java | 10 ++++ .../common/cache/RemovalNotification.java | 5 ++ .../opensearch/common/collect/HppcMaps.java | 10 ++++ .../opensearch/common/collect/Iterators.java | 5 ++ .../common/component/Lifecycle.java | 5 ++ .../org/opensearch/common/geo/GeoUtils.java | 2 + .../common/geo/builders/ShapeBuilder.java | 5 ++ .../common/inject/BindingProcessor.java | 5 ++ .../common/inject/InjectorImpl.java | 2 + .../org/opensearch/common/inject/Key.java | 5 ++ .../opensearch/common/inject/TypeLiteral.java | 2 + .../common/inject/internal/MoreTypes.java | 2 + .../common/inject/spi/InjectionPoint.java | 5 ++ .../common/inject/util/Modules.java | 2 + .../common/logging/DeprecationLogger.java | 5 ++ .../function/FieldValueFactorFunction.java | 2 + .../search/function/FunctionScoreQuery.java | 5 ++ .../common/network/NetworkService.java | 2 + .../org/opensearch/common/path/PathTrie.java | 10 ++++ .../opensearch/common/recycler/Recycler.java | 15 +++++ .../settings/AbstractScopedSettings.java | 2 + .../common/settings/PropertyPlaceholder.java | 2 + .../opensearch/common/settings/Setting.java | 28 +++++++++ .../common/transport/PortsRange.java | 5 ++ .../common/util/CancellableThreads.java | 15 +++++ .../common/util/LongObjectPagedHashMap.java | 5 ++ .../common/util/PageCacheRecycler.java | 5 ++ .../OpenSearchThreadPoolExecutor.java | 5 ++ .../common/util/concurrent/ThreadContext.java | 5 ++ .../org/opensearch/discovery/PeerFinder.java | 10 ++++ .../org/opensearch/env/NodeEnvironment.java | 10 ++++ .../java/org/opensearch/gateway/Gateway.java | 5 ++ .../gateway/LocalAllocateDangledIndices.java | 11 ++++ .../gateway/PersistedClusterStateService.java | 10 ++++ .../TransportNodesListGatewayMetaState.java | 20 +++++++ ...ransportNodesListGatewayStartedShards.java | 20 +++++++ .../org/opensearch/ingest/DropProcessor.java | 5 ++ .../org/opensearch/ingest/IngestDocument.java | 5 ++ .../org/opensearch/ingest/IngestStats.java | 5 ++ .../opensearch/ingest/PipelineProcessor.java | 5 ++ .../org/opensearch/ingest/ValueSource.java | 25 ++++++++ .../org/opensearch/monitor/StatusInfo.java | 5 ++ .../org/opensearch/monitor/fs/FsInfo.java | 15 +++++ .../monitor/jvm/DeadlockAnalyzer.java | 5 ++ .../org/opensearch/monitor/jvm/JvmInfo.java | 5 ++ .../org/opensearch/monitor/jvm/JvmStats.java | 37 ++++++++++++ .../org/opensearch/monitor/os/OsStats.java | 19 ++++++ .../monitor/process/ProcessStats.java | 10 ++++ .../main/java/org/opensearch/node/Node.java | 5 ++ .../org/opensearch/node/ReportingService.java | 5 ++ .../persistent/AllocatedPersistentTask.java | 5 ++ .../CompletionPersistentTaskAction.java | 15 +++++ .../PersistentTasksCustomMetadata.java | 11 ++++ .../PersistentTasksNodeService.java | 5 ++ .../persistent/PersistentTasksService.java | 5 ++ .../RemovePersistentTaskAction.java | 15 +++++ .../persistent/StartPersistentTaskAction.java | 15 +++++ .../UpdatePersistentTaskStatusAction.java | 16 +++++ .../decider/AssignmentDecision.java | 5 ++ .../repositories/ShardGenerations.java | 5 ++ .../VerifyNodeRepositoryAction.java | 5 ++ .../org/opensearch/rest/BaseRestHandler.java | 5 ++ .../java/org/opensearch/rest/RestHandler.java | 10 ++++ .../java/org/opensearch/rest/RestRequest.java | 15 +++++ .../admin/indices/RestAnalyzeAction.java | 5 ++ .../admin/indices/RestResizeHandler.java | 15 +++++ .../rest/action/document/RestIndexAction.java | 10 ++++ .../opensearch/script/AggregationScript.java | 4 ++ .../script/BucketAggregationScript.java | 5 ++ .../BucketAggregationSelectorScript.java | 5 ++ .../org/opensearch/script/FieldScript.java | 11 +++- .../org/opensearch/script/FilterScript.java | 12 +++- .../script/IngestConditionalScript.java | 5 ++ .../org/opensearch/script/IngestScript.java | 5 ++ .../opensearch/script/NumberSortScript.java | 4 ++ .../org/opensearch/script/ScoreScript.java | 18 +++++- .../opensearch/script/ScoreScriptUtils.java | 58 ++++++++++++++++++- .../org/opensearch/script/ScriptCache.java | 5 ++ .../opensearch/script/ScriptContextInfo.java | 10 ++++ .../opensearch/script/ScriptException.java | 5 ++ .../org/opensearch/script/ScriptMetadata.java | 2 + .../script/ScriptedMetricAggContexts.java | 45 ++++++++++++++ .../SignificantTermsHeuristicScoreScript.java | 5 ++ .../opensearch/script/SimilarityScript.java | 5 ++ .../script/SimilarityWeightScript.java | 5 ++ .../opensearch/script/StringSortScript.java | 4 ++ .../org/opensearch/script/TemplateScript.java | 5 ++ .../script/TermsSetQueryScript.java | 4 ++ .../org/opensearch/script/UpdateScript.java | 5 ++ .../opensearch/snapshots/RestoreService.java | 5 ++ .../org/opensearch/threadpool/ThreadPool.java | 15 +++++ .../threadpool/ThreadPoolStats.java | 5 ++ .../watcher/ResourceWatcherService.java | 5 ++ 185 files changed, 1613 insertions(+), 12 deletions(-) create mode 100644 server/src/main/java/org/opensearch/bootstrap/jvm/package-info.java diff --git a/gradle/missing-javadoc.gradle b/gradle/missing-javadoc.gradle index 29fede8967a59..2313807e0bd02 100644 --- a/gradle/missing-javadoc.gradle +++ b/gradle/missing-javadoc.gradle @@ -178,8 +178,7 @@ configure([ configure(project(":server")) { project.tasks.withType(MissingJavadocTask) { - isExcluded = true - // TODO: reenable after fixing missing javadocs + // TODO: bump to variable missing level after increasing javadoc coverage javadocMissingLevel = "class" } } diff --git a/server/src/main/java/org/opensearch/action/IndicesRequest.java b/server/src/main/java/org/opensearch/action/IndicesRequest.java index d2e4504dd7db1..7e4c2f5076cda 100644 --- a/server/src/main/java/org/opensearch/action/IndicesRequest.java +++ b/server/src/main/java/org/opensearch/action/IndicesRequest.java @@ -64,6 +64,11 @@ default boolean includeDataStreams() { return false; } + /** + * Replaceable interface. + * + * @opensearch.internal + */ interface Replaceable extends IndicesRequest { /** * Sets the indices that the action relates to. diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequest.java index d6d494c4261bd..026cf2274452e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequest.java @@ -289,6 +289,11 @@ public ActionRequestValidationException validate() { return null; } + /** + * The level of the health request. + * + * @opensearch.internal + */ public enum Level { CLUSTER, INDICES, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java index d6a1488f3f226..62f51aa3f3bff 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java @@ -120,6 +120,11 @@ public static class AliasActions implements AliasesRequest, Writeable, ToXConten private static final ParseField REMOVE = new ParseField("remove"); private static final ParseField REMOVE_INDEX = new ParseField("remove_index"); + /** + * The type of request. + * + * @opensearch.internal + */ public enum Type { ADD((byte) 0, AliasActions.ADD), REMOVE((byte) 1, AliasActions.REMOVE), diff --git a/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexRequest.java index 909092078b6ae..9a7fae9f84a98 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexRequest.java @@ -46,6 +46,11 @@ * @opensearch.internal */ public class GetIndexRequest extends ClusterInfoRequest { + /** + * The features to get. + * + * @opensearch.internal + */ public enum Feature { ALIASES((byte) 0), MAPPINGS((byte) 1), diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStatsFlags.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStatsFlags.java index 9eec34d87c384..9a24d8a42dc9d 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStatsFlags.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStatsFlags.java @@ -261,6 +261,11 @@ public CommonStatsFlags clone() { } } + /** + * The flags. + * + * @opensearch.internal + */ public enum Flag { Store("store", 0), Indexing("indexing", 1), diff --git a/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java b/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java index 6ab49d975cddd..5dd576fa6ce53 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java @@ -284,6 +284,11 @@ protected void doExecute(Task task, SearchRequest searchRequest, ActionListener< executeRequest(task, searchRequest, this::searchAsyncAction, listener); } + /** + * The single phase search action. + * + * @opensearch.internal + */ public interface SinglePhaseSearchAction { void executeOnShardTarget( SearchTask searchTask, diff --git a/server/src/main/java/org/opensearch/action/support/IndicesOptions.java b/server/src/main/java/org/opensearch/action/support/IndicesOptions.java index 292a2c4b7d3da..3fb572d0ecbbf 100644 --- a/server/src/main/java/org/opensearch/action/support/IndicesOptions.java +++ b/server/src/main/java/org/opensearch/action/support/IndicesOptions.java @@ -60,6 +60,11 @@ */ public class IndicesOptions implements ToXContentFragment { + /** + * The wildcard states. + * + * @opensearch.internal + */ public enum WildcardStates { OPEN, CLOSED, @@ -120,6 +125,11 @@ private static void updateSetForValue(EnumSet states, String wil } } + /** + * The options. + * + * @opensearch.internal + */ public enum Option { IGNORE_UNAVAILABLE, IGNORE_ALIASES, diff --git a/server/src/main/java/org/opensearch/action/support/WriteRequest.java b/server/src/main/java/org/opensearch/action/support/WriteRequest.java index 81faf9a8f88ca..16573ab619f2f 100644 --- a/server/src/main/java/org/opensearch/action/support/WriteRequest.java +++ b/server/src/main/java/org/opensearch/action/support/WriteRequest.java @@ -75,6 +75,11 @@ default R setRefreshPolicy(String refreshPolicy) { ActionRequestValidationException validate(); + /** + * The refresh policy of the request. + * + * @opensearch.internal + */ enum RefreshPolicy implements Writeable { /** * Don't refresh after this request. The default. diff --git a/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java b/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java index cf40e872fe9b8..da37eee88a4e0 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java +++ b/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java @@ -616,6 +616,11 @@ public RetryOnPrimaryException(StreamInput in) throws IOException { } } + /** + * The result of the primary. + * + * @opensearch.internal + */ public interface PrimaryResult> { /** diff --git a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequest.java b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequest.java index 25f33934dbb80..cf2d10d2f1db3 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequest.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequest.java @@ -568,6 +568,11 @@ public void writeTo(StreamOutput out) throws IOException { out.writeLong(version); } + /** + * The flags. + * + * @opensearch.internal + */ public enum Flag { // Do not change the order of these flags we use // the ordinal for encoding! Only append to the end! diff --git a/server/src/main/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParser.java b/server/src/main/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParser.java index a9c908c058508..65b50344b8e3a 100644 --- a/server/src/main/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParser.java +++ b/server/src/main/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParser.java @@ -24,8 +24,15 @@ /** * Parses the list of JVM versions which should be denied to run Opensearch engine with due to discovered * issues or flaws. + * + * @opensearch.internal */ public class DenyJvmVersionsParser { + /** + * Provides the reason for the denial + * + * @opensearch.internal + */ public interface VersionPredicate extends Predicate { String getReason(); } diff --git a/server/src/main/java/org/opensearch/bootstrap/jvm/package-info.java b/server/src/main/java/org/opensearch/bootstrap/jvm/package-info.java new file mode 100644 index 0000000000000..e171e705a29f7 --- /dev/null +++ b/server/src/main/java/org/opensearch/bootstrap/jvm/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** jvm specific bootstrapping */ +package org.opensearch.bootstrap.jvm; diff --git a/server/src/main/java/org/opensearch/cluster/AbstractDiffable.java b/server/src/main/java/org/opensearch/cluster/AbstractDiffable.java index 600f972fd9d63..834d78a384423 100644 --- a/server/src/main/java/org/opensearch/cluster/AbstractDiffable.java +++ b/server/src/main/java/org/opensearch/cluster/AbstractDiffable.java @@ -66,6 +66,11 @@ public static > Diff readDiffFrom(Reader reader, Str return (Diff) EMPTY; } + /** + * A complete diff. + * + * @opensearch.internal + */ private static class CompleteDiff> implements Diff { @Nullable diff --git a/server/src/main/java/org/opensearch/cluster/AbstractNamedDiffable.java b/server/src/main/java/org/opensearch/cluster/AbstractNamedDiffable.java index 8af061a0874c9..f4780eb71edda 100644 --- a/server/src/main/java/org/opensearch/cluster/AbstractNamedDiffable.java +++ b/server/src/main/java/org/opensearch/cluster/AbstractNamedDiffable.java @@ -62,6 +62,11 @@ public static > NamedDiff readDiffFrom(Class(tClass, name, in); } + /** + * A complete named diff. + * + * @opensearch.internal + */ private static class CompleteNamedDiff> implements NamedDiff { @Nullable diff --git a/server/src/main/java/org/opensearch/cluster/ClusterInfo.java b/server/src/main/java/org/opensearch/cluster/ClusterInfo.java index 8803af9a5419a..6c7f4ba487568 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterInfo.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterInfo.java @@ -244,6 +244,8 @@ static String shardIdentifierFromRouting(ShardRouting shardRouting) { /** * Represents a data path on a node + * + * @opensearch.internal */ public static class NodeAndPath implements Writeable { public final String nodeId; @@ -281,6 +283,8 @@ public void writeTo(StreamOutput out) throws IOException { /** * Represents the total amount of "reserved" space on a particular data path, together with the set of shards considered. + * + * @opensearch.internal */ public static class ReservedSpace implements Writeable { @@ -344,6 +348,11 @@ void toXContent(XContentBuilder builder, Params params) throws IOException { builder.endArray(); // end "shards" } + /** + * Builder for Reserved Space. + * + * @opensearch.internal + */ public static class Builder { private long total; private ObjectHashSet shardIds = new ObjectHashSet<>(); diff --git a/server/src/main/java/org/opensearch/cluster/ClusterState.java b/server/src/main/java/org/opensearch/cluster/ClusterState.java index 4010002561930..5431bbdbeaf38 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterState.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterState.java @@ -106,6 +106,8 @@ public class ClusterState implements ToXContentFragment, Diffable /** * An interface that implementors use when a class requires a client to maybe have a feature. + * + * @opensearch.internal */ public interface FeatureAware { @@ -135,6 +137,11 @@ static boolean shouldSerializ } + /** + * Custom cluster state. + * + * @opensearch.internal + */ public interface Custom extends NamedDiffable, ToXContentFragment, FeatureAware { /** @@ -403,6 +410,11 @@ public boolean supersedes(ClusterState other) { } + /** + * Metrics for cluster state. + * + * @opensearch.internal + */ public enum Metric { VERSION("version"), @@ -582,6 +594,11 @@ public static Builder builder(ClusterState state) { return new Builder(state); } + /** + * Builder for cluster state. + * + * @opensearch.internal + */ public static class Builder { private final ClusterName clusterName; @@ -778,6 +795,11 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVInt(minimumClusterManagerNodesOnPublishingClusterManager); } + /** + * The cluster state diff. + * + * @opensearch.internal + */ private static class ClusterStateDiff implements Diff { private final long toVersion; diff --git a/server/src/main/java/org/opensearch/cluster/ClusterStateObserver.java b/server/src/main/java/org/opensearch/cluster/ClusterStateObserver.java index 5e99ebe229c6a..7ab5785bac350 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterStateObserver.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterStateObserver.java @@ -207,6 +207,11 @@ public void waitForNextChange(Listener listener, Predicate statePr } } + /** + * An observer of the cluster state for changes. + * + * @opensearch.internal + */ class ObserverClusterStateListener implements TimeoutClusterStateListener { @Override @@ -298,6 +303,8 @@ public String toString() { /** * The observer considers two cluster states to be the same if they have the same version and cluster-manager node id (i.e. null or set) + * + * @opensearch.internal */ private static class StoredState { private final String clusterManagerNodeId; @@ -317,6 +324,11 @@ public boolean isOlderOrDifferentClusterManager(ClusterState clusterState) { } } + /** + * Listener for the observer. + * + * @opensearch.internal + */ public interface Listener { /** called when a new state is observed */ @@ -328,6 +340,11 @@ public interface Listener { void onTimeout(TimeValue timeout); } + /** + * Context for the observer. + * + * @opensearch.internal + */ static class ObservingContext { public final Listener listener; public final Predicate statePredicate; @@ -343,6 +360,11 @@ public String toString() { } } + /** + * A context preserving listener. + * + * @opensearch.internal + */ private static final class ContextPreservingListener implements Listener { private final Listener delegate; private final Supplier contextSupplier; diff --git a/server/src/main/java/org/opensearch/cluster/ClusterStateTaskConfig.java b/server/src/main/java/org/opensearch/cluster/ClusterStateTaskConfig.java index 8d775b92a0431..9a4b708548a7d 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterStateTaskConfig.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterStateTaskConfig.java @@ -85,6 +85,11 @@ static ClusterStateTaskConfig build(Priority priority, TimeValue timeout) { return new Basic(priority, timeout); } + /** + * Basic task config. + * + * @opensearch.internal + */ class Basic implements ClusterStateTaskConfig { final TimeValue timeout; final Priority priority; diff --git a/server/src/main/java/org/opensearch/cluster/ClusterStateTaskExecutor.java b/server/src/main/java/org/opensearch/cluster/ClusterStateTaskExecutor.java index 8d40f447abe98..00e58d88d8798 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterStateTaskExecutor.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterStateTaskExecutor.java @@ -81,6 +81,8 @@ default String describeTasks(List tasks) { /** * Represents the result of a batched execution of cluster state update tasks * @param the type of the cluster state update task + * + * @opensearch.internal */ class ClusterTasksResult { @Nullable @@ -101,6 +103,11 @@ public static Builder builder() { return new Builder<>(); } + /** + * Builder for cluster state task. + * + * @opensearch.internal + */ public static class Builder { private final Map executionResults = new IdentityHashMap<>(); @@ -142,6 +149,11 @@ ClusterTasksResult build(ClusterTasksResult result, ClusterState previousS } } + /** + * The task result. + * + * @opensearch.internal + */ final class TaskResult { private final Exception failure; diff --git a/server/src/main/java/org/opensearch/cluster/DiffableUtils.java b/server/src/main/java/org/opensearch/cluster/DiffableUtils.java index 88a240938c468..f2a20b356d25d 100644 --- a/server/src/main/java/org/opensearch/cluster/DiffableUtils.java +++ b/server/src/main/java/org/opensearch/cluster/DiffableUtils.java @@ -229,6 +229,8 @@ public static > MapDiff> readJdkMapDiff * Represents differences between two Maps of (possibly diffable) objects. * * @param the diffable object + * + * @opensearch.internal */ private static class JdkMapDiff extends MapDiff> { @@ -283,6 +285,8 @@ public Map apply(Map map) { * Represents differences between two ImmutableOpenMap of (possibly diffable) objects * * @param the object type + * + * @opensearch.internal */ public static class ImmutableOpenMapDiff extends MapDiff> { @@ -369,6 +373,8 @@ public ImmutableOpenMap apply(ImmutableOpenMap map) { * Represents differences between two ImmutableOpenIntMap of (possibly diffable) objects * * @param the object type + * + * @opensearch.internal */ private static class ImmutableOpenIntMapDiff extends MapDiff> { @@ -434,6 +440,8 @@ public ImmutableOpenIntMap apply(ImmutableOpenIntMap map) { * @param the type of map keys * @param the type of map values * @param the map implementation type + * + * @opensearch.internal */ public abstract static class MapDiff implements Diff { @@ -553,6 +561,8 @@ public void writeTo(StreamOutput out) throws IOException { /** * Provides read and write operations to serialize keys of map * @param type of key + * + * @opensearch.internal */ public interface KeySerializer { void writeKey(K key, StreamOutput out) throws IOException; @@ -562,6 +572,8 @@ public interface KeySerializer { /** * Serializes String keys of a map + * + * @opensearch.internal */ private static final class StringKeySerializer implements KeySerializer { private static final StringKeySerializer INSTANCE = new StringKeySerializer(); @@ -579,6 +591,8 @@ public String readKey(StreamInput in) throws IOException { /** * Serializes Integer keys of a map as an Int + * + * @opensearch.internal */ private static final class IntKeySerializer implements KeySerializer { public static final IntKeySerializer INSTANCE = new IntKeySerializer(); @@ -596,6 +610,8 @@ public Integer readKey(StreamInput in) throws IOException { /** * Serializes Integer keys of a map as a VInt. Requires keys to be positive. + * + * @opensearch.internal */ private static final class VIntKeySerializer implements KeySerializer { public static final IntKeySerializer INSTANCE = new IntKeySerializer(); @@ -625,6 +641,8 @@ public Integer readKey(StreamInput in) throws IOException { * * @param key type of map * @param value type of map + * + * @opensearch.internal */ public interface ValueSerializer { @@ -679,6 +697,8 @@ default boolean supportsVersion(V value, Version version) { * * @param type of map keys * @param type of map values + * + * @opensearch.internal */ public abstract static class DiffableValueSerializer> implements ValueSerializer { private static final DiffableValueSerializer WRITE_ONLY_INSTANCE = new DiffableValueSerializer() { @@ -722,6 +742,8 @@ public void writeDiff(Diff value, StreamOutput out) throws IOException { * * @param type of map keys * @param type of map values + * + * @opensearch.internal */ public abstract static class NonDiffableValueSerializer implements ValueSerializer { @Override @@ -749,6 +771,8 @@ public Diff readDiff(StreamInput in, K key) throws IOException { * Implementation of the ValueSerializer that wraps value and diff readers. * * Note: this implementation is ignoring the key. + * + * @opensearch.internal */ public static class DiffableValueReader> extends DiffableValueSerializer { private final Reader reader; @@ -774,6 +798,8 @@ public Diff readDiff(StreamInput in, K key) throws IOException { * Implementation of ValueSerializer that serializes immutable sets * * @param type of map key + * + * @opensearch.internal */ public static class StringSetValueSerializer extends NonDiffableValueSerializer> { private static final StringSetValueSerializer INSTANCE = new StringSetValueSerializer(); diff --git a/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java b/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java index ac70e42149086..97b6f81f35449 100644 --- a/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java +++ b/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java @@ -469,6 +469,11 @@ static void fillDiskUsagePerNode( } } + /** + * Indices statistics summary. + * + * @opensearch.internal + */ private static class IndicesStatsSummary { static final IndicesStatsSummary EMPTY = new IndicesStatsSummary( ImmutableOpenMap.of(), @@ -493,6 +498,8 @@ private static class IndicesStatsSummary { /** * Runs {@link InternalClusterInfoService#refresh()}, logging failures/rejections appropriately. + * + * @opensearch.internal */ private class RefreshRunnable extends AbstractRunnable { private final String reason; @@ -526,6 +533,8 @@ public void onRejection(Exception e) { /** * Runs {@link InternalClusterInfoService#refresh()}, logging failures/rejections appropriately, and reschedules itself on completion. + * + * @opensearch.internal */ private class RefreshAndRescheduleRunnable extends RefreshRunnable { RefreshAndRescheduleRunnable() { diff --git a/server/src/main/java/org/opensearch/cluster/NodeConnectionsService.java b/server/src/main/java/org/opensearch/cluster/NodeConnectionsService.java index c642d3652c47a..0014d5c61fb2d 100644 --- a/server/src/main/java/org/opensearch/cluster/NodeConnectionsService.java +++ b/server/src/main/java/org/opensearch/cluster/NodeConnectionsService.java @@ -229,6 +229,11 @@ private void connectDisconnectedTargets(Runnable onCompletion) { runnables.forEach(Runnable::run); } + /** + * A connection checker. + * + * @opensearch.internal + */ class ConnectionChecker extends AbstractRunnable { protected void doRun() { if (connectionChecker == this) { @@ -311,6 +316,8 @@ private enum ActivityType { * Similarly if we are currently disconnecting and then {@link ConnectionTarget#connect(ActionListener)} is called then all * disconnection listeners are immediately removed for failure notification and a connection is started once the disconnection is * complete. + * + * @opensearch.internal */ private class ConnectionTarget { private final DiscoveryNode discoveryNode; diff --git a/server/src/main/java/org/opensearch/cluster/RepositoryCleanupInProgress.java b/server/src/main/java/org/opensearch/cluster/RepositoryCleanupInProgress.java index 0f69acf12272a..2cf9d66fee2bd 100644 --- a/server/src/main/java/org/opensearch/cluster/RepositoryCleanupInProgress.java +++ b/server/src/main/java/org/opensearch/cluster/RepositoryCleanupInProgress.java @@ -117,6 +117,11 @@ public Version getMinimalSupportedVersion() { return LegacyESVersion.V_7_4_0; } + /** + * Entry in the collection. + * + * @opensearch.internal + */ public static final class Entry implements Writeable, RepositoryOperation { private final String repository; diff --git a/server/src/main/java/org/opensearch/cluster/RestoreInProgress.java b/server/src/main/java/org/opensearch/cluster/RestoreInProgress.java index 45d9c8b373298..c68c8c54461a3 100644 --- a/server/src/main/java/org/opensearch/cluster/RestoreInProgress.java +++ b/server/src/main/java/org/opensearch/cluster/RestoreInProgress.java @@ -112,6 +112,11 @@ public Iterator iterator() { return entries.valuesIt(); } + /** + * Builder of the restore. + * + * @opensearch.internal + */ public static final class Builder { private final ImmutableOpenMap.Builder entries = ImmutableOpenMap.builder(); @@ -134,6 +139,8 @@ public RestoreInProgress build() { /** * Restore metadata + * + * @opensearch.internal */ public static class Entry { private final String uuid; @@ -237,6 +244,8 @@ public int hashCode() { /** * Represents status of a restored shard + * + * @opensearch.internal */ public static class ShardRestoreStatus implements Writeable { private State state; @@ -360,6 +369,8 @@ public int hashCode() { /** * Shard restore process state + * + * @opensearch.internal */ public enum State { /** diff --git a/server/src/main/java/org/opensearch/cluster/SnapshotDeletionsInProgress.java b/server/src/main/java/org/opensearch/cluster/SnapshotDeletionsInProgress.java index bf2ab3f269357..0f95890e56ec2 100644 --- a/server/src/main/java/org/opensearch/cluster/SnapshotDeletionsInProgress.java +++ b/server/src/main/java/org/opensearch/cluster/SnapshotDeletionsInProgress.java @@ -219,6 +219,8 @@ public String toString() { /** * A class representing a snapshot deletion request entry in the cluster state. + * + * @opensearch.internal */ public static final class Entry implements Writeable, RepositoryOperation { private final List snapshots; @@ -375,6 +377,11 @@ public String toString() { } } + /** + * State of the deletions. + * + * @opensearch.internal + */ public enum State implements Writeable { /** diff --git a/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java b/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java index 033c0bafc971d..0ff373b6116de 100644 --- a/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java +++ b/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java @@ -177,6 +177,11 @@ public static Entry startClone( ); } + /** + * Entry in the collection. + * + * @opensearch.internal + */ public static class Entry implements Writeable, ToXContent, RepositoryOperation { private final State state; private final Snapshot snapshot; @@ -778,6 +783,11 @@ private static boolean hasFailures(ImmutableOpenMap { @Override @@ -96,6 +101,11 @@ public void messageReceived(NodeMappingRefreshRequest request, TransportChannel } } + /** + * Request to refresh node mapping. + * + * @opensearch.internal + */ public static class NodeMappingRefreshRequest extends TransportRequest implements IndicesRequest { private String index; diff --git a/server/src/main/java/org/opensearch/cluster/action/shard/ShardStateAction.java b/server/src/main/java/org/opensearch/cluster/action/shard/ShardStateAction.java index 47ad61913a947..93ddd74322ce9 100644 --- a/server/src/main/java/org/opensearch/cluster/action/shard/ShardStateAction.java +++ b/server/src/main/java/org/opensearch/cluster/action/shard/ShardStateAction.java @@ -333,6 +333,11 @@ private void setFollowUpRerouteTaskPriority(Priority followUpRerouteTaskPriority this.followUpRerouteTaskPriority = followUpRerouteTaskPriority; } + /** + * A transport handler for a shard failed action. + * + * @opensearch.internal + */ private static class ShardFailedTransportHandler implements TransportRequestHandler { private final ClusterService clusterService; private final ShardFailedClusterStateTaskExecutor shardFailedClusterStateTaskExecutor; @@ -416,6 +421,11 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS } } + /** + * Executor if shard fails cluster state task. + * + * @opensearch.internal + */ public static class ShardFailedClusterStateTaskExecutor implements ClusterStateTaskExecutor { private final AllocationService allocationService; private final RerouteService rerouteService; @@ -552,6 +562,11 @@ public void clusterStatePublished(ClusterChangedEvent clusterChangedEvent) { } } + /** + * Entry for a failed shard. + * + * @opensearch.internal + */ public static class FailedShardEntry extends TransportRequest { final ShardId shardId; final String allocationId; @@ -658,6 +673,11 @@ public void shardStarted( sendShardAction(SHARD_STARTED_ACTION_NAME, currentState, entry, listener); } + /** + * Handler for a shard started action. + * + * @opensearch.internal + */ private static class ShardStartedTransportHandler implements TransportRequestHandler { private final ClusterService clusterService; private final ShardStartedClusterStateTaskExecutor shardStartedClusterStateTaskExecutor; @@ -687,6 +707,11 @@ public void messageReceived(StartedShardEntry request, TransportChannel channel, } } + /** + * Executor for when shard starts cluster state. + * + * @opensearch.internal + */ public static class ShardStartedClusterStateTaskExecutor implements ClusterStateTaskExecutor, @@ -812,6 +837,11 @@ public void clusterStatePublished(ClusterChangedEvent clusterChangedEvent) { } } + /** + * try for started shard. + * + * @opensearch.internal + */ public static class StartedShardEntry extends TransportRequest { final ShardId shardId; final String allocationId; @@ -855,6 +885,11 @@ public String toString() { } } + /** + * Error thrown when a shard is no longer primary. + * + * @opensearch.internal + */ public static class NoLongerPrimaryShardException extends OpenSearchException { public NoLongerPrimaryShardException(ShardId shardId, String msg) { diff --git a/server/src/main/java/org/opensearch/cluster/block/ClusterBlocks.java b/server/src/main/java/org/opensearch/cluster/block/ClusterBlocks.java index b889688bdd390..f5dc0eb8fdb5e 100644 --- a/server/src/main/java/org/opensearch/cluster/block/ClusterBlocks.java +++ b/server/src/main/java/org/opensearch/cluster/block/ClusterBlocks.java @@ -321,6 +321,11 @@ public static Diff readDiffFrom(StreamInput in) throws IOExceptio return AbstractDiffable.readDiffFrom(ClusterBlocks::readFrom, in); } + /** + * An immutable level holder. + * + * @opensearch.internal + */ static class ImmutableLevelHolder { private final Set global; @@ -344,6 +349,11 @@ public static Builder builder() { return new Builder(); } + /** + * Builder for cluster blocks. + * + * @opensearch.internal + */ public static class Builder { private final Set global = new HashSet<>(); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java b/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java index ee175b5f6fd24..e93eddc02337e 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java @@ -107,6 +107,11 @@ public void stop() { warningScheduler = null; } + /** + * A warning scheduler. + * + * @opensearch.internal + */ private class WarningScheduler { private boolean isActive() { @@ -143,6 +148,11 @@ public String toString() { } } + /** + * State of the cluster formation. + * + * @opensearch.internal + */ static class ClusterFormationState { private final Settings settings; private final ClusterState clusterState; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ClusterStatePublisher.java b/server/src/main/java/org/opensearch/cluster/coordination/ClusterStatePublisher.java index 6e932afb34ab1..3900155ffc12e 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ClusterStatePublisher.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ClusterStatePublisher.java @@ -56,6 +56,11 @@ public interface ClusterStatePublisher { */ void publish(ClusterChangedEvent clusterChangedEvent, ActionListener publishListener, AckListener ackListener); + /** + * An acknowledgement listener. + * + * @opensearch.internal + */ interface AckListener { /** * Should be called when the cluster coordination layer has committed the cluster state (i.e. even if this publication fails, diff --git a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java index 3f24f59179641..9a3d7817e6e00 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java @@ -211,6 +211,11 @@ public String toString() { + '}'; } + /** + * Builder for coordination metadata. + * + * @opensearch.internal + */ public static class Builder { private long term = 0; private VotingConfiguration lastCommittedConfiguration = VotingConfiguration.EMPTY_CONFIG; @@ -258,6 +263,11 @@ public CoordinationMetadata build() { } } + /** + * Excluded nodes from voting config. + * + * @opensearch.internal + */ public static class VotingConfigExclusion implements Writeable, ToXContentFragment { public static final String MISSING_VALUE_MARKER = "_absent_"; private final String nodeId; @@ -351,6 +361,8 @@ public String toString() { /** * A collection of persistent node ids, denoting the voting configuration for cluster state changes. + * + * @opensearch.internal */ public static class VotingConfiguration implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationState.java b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationState.java index eff55e6d88193..fcae32af9cad5 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationState.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationState.java @@ -569,6 +569,8 @@ public void close() throws IOException { /** * Pluggable persistence layer for {@link CoordinationState}. + * + * @opensearch.internal */ public interface PersistedState extends Closeable { @@ -641,6 +643,8 @@ default void close() throws IOException {} /** * A collection of votes, used to calculate quorums. Optionally records the Joins as well. + * + * @opensearch.internal */ public static class VoteCollection { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java b/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java index 52052b3c1adde..5a4f9be40600d 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java @@ -1351,12 +1351,22 @@ public Collection> getOnJoinValidators() return onJoinValidators; } + /** + * The mode of the coordinator. + * + * @opensearch.internal + */ public enum Mode { CANDIDATE, LEADER, FOLLOWER } + /** + * The coordinator peer finder. + * + * @opensearch.internal + */ private class CoordinatorPeerFinder extends PeerFinder { CoordinatorPeerFinder( @@ -1480,6 +1490,11 @@ boolean cancelCommittedPublication() { } } + /** + * The coordinator publication. + * + * @opensearch.internal + */ class CoordinatorPublication extends Publication { private final PublishRequest publishRequest; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ElectionSchedulerFactory.java b/server/src/main/java/org/opensearch/cluster/coordination/ElectionSchedulerFactory.java index dfaed3a598acc..828db5864d28b 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ElectionSchedulerFactory.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ElectionSchedulerFactory.java @@ -183,6 +183,11 @@ public String toString() { + '}'; } + /** + * The Election scheduler. + * + * @opensearch.internal + */ private class ElectionScheduler implements Releasable { private final AtomicBoolean isClosed = new AtomicBoolean(); private final AtomicLong attempt = new AtomicLong(); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/FollowersChecker.java b/server/src/main/java/org/opensearch/cluster/coordination/FollowersChecker.java index 24eac6ac06a8c..c9a9ba9af09cd 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/FollowersChecker.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/FollowersChecker.java @@ -294,6 +294,11 @@ private void handleDisconnectedNode(DiscoveryNode discoveryNode) { } } + /** + * A fast response state. + * + * @opensearch.internal + */ static class FastResponseState { final long term; final Mode mode; @@ -311,6 +316,8 @@ public String toString() { /** * A checker for an individual follower. + * + * @opensearch.internal */ private class FollowerChecker { private final DiscoveryNode discoveryNode; @@ -449,6 +456,11 @@ public String toString() { } } + /** + * Request to check follower. + * + * @opensearch.internal + */ public static class FollowerCheckRequest extends TransportRequest { private final long term; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java b/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java index 54894c4e28196..8ec215719b642 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java @@ -253,6 +253,11 @@ public void sendJoinRequest(DiscoveryNode destination, long term, Optional sendJoinRequest(destination, term, optionalJoin, () -> {}); } + /** + * A failed join attempt. + * + * @opensearch.internal + */ // package-private for testing static class FailedJoinAttempt { private final DiscoveryNode destination; @@ -392,12 +397,22 @@ public void sendValidateJoinRequest(DiscoveryNode node, ClusterState state, Acti ); } + /** + * The callback interface. + * + * @opensearch.internal + */ public interface JoinCallback { void onSuccess(); void onFailure(Exception e); } + /** + * Listener for the join task + * + * @opensearch.internal + */ static class JoinTaskListener implements ClusterStateTaskListener { private final JoinTaskExecutor.Task task; private final JoinCallback joinCallback; @@ -429,6 +444,11 @@ interface JoinAccumulator { default void close(Mode newMode) {} } + /** + * A leader join accumulator. + * + * @opensearch.internal + */ class LeaderJoinAccumulator implements JoinAccumulator { @Override public void handleJoinRequest(DiscoveryNode sender, JoinCallback joinCallback) { @@ -449,6 +469,11 @@ public String toString() { } } + /** + * An initial join accumulator. + * + * @opensearch.internal + */ static class InitialJoinAccumulator implements JoinAccumulator { @Override public void handleJoinRequest(DiscoveryNode sender, JoinCallback joinCallback) { @@ -462,6 +487,11 @@ public String toString() { } } + /** + * A follower join accumulator. + * + * @opensearch.internal + */ static class FollowerJoinAccumulator implements JoinAccumulator { @Override public void handleJoinRequest(DiscoveryNode sender, JoinCallback joinCallback) { @@ -474,6 +504,11 @@ public String toString() { } } + /** + * A candidate join accumulator. + * + * @opensearch.internal + */ class CandidateJoinAccumulator implements JoinAccumulator { private final Map joinRequestAccumulator = new HashMap<>(); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java b/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java index aaaa73e891073..766dd2d11b03e 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java @@ -75,6 +75,11 @@ public class JoinTaskExecutor implements ClusterStateTaskExecutor getTrackedNodes() { return Collections.unmodifiableSet(appliedStateTrackersByNode.keySet()); } + /** + * A tracker that the node applied state. + * + * @opensearch.internal + */ private class NodeAppliedStateTracker { private final DiscoveryNode discoveryNode; private final AtomicLong appliedVersion = new AtomicLong(); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/LeaderChecker.java b/server/src/main/java/org/opensearch/cluster/coordination/LeaderChecker.java index 7cb306bfd89f6..f1d2754fbbfa7 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/LeaderChecker.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/LeaderChecker.java @@ -233,6 +233,11 @@ private void handleDisconnectedNode(DiscoveryNode discoveryNode) { } } + /** + * A check scheduler. + * + * @opensearch.internal + */ private class CheckScheduler implements Releasable { private final AtomicBoolean isClosed = new AtomicBoolean(); @@ -380,6 +385,11 @@ public String toString() { } } + /** + * A leader check request. + * + * @opensearch.internal + */ static class LeaderCheckRequest extends TransportRequest { private final DiscoveryNode sender; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/NodeRemovalClusterStateTaskExecutor.java b/server/src/main/java/org/opensearch/cluster/coordination/NodeRemovalClusterStateTaskExecutor.java index 3625366fa4de1..3a466d0bfe6dd 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/NodeRemovalClusterStateTaskExecutor.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/NodeRemovalClusterStateTaskExecutor.java @@ -56,6 +56,11 @@ public class NodeRemovalClusterStateTaskExecutor private final AllocationService allocationService; private final Logger logger; + /** + * Task for the executor. + * + * @opensearch.internal + */ public static class Task { private final DiscoveryNode node; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/OpenSearchNodeCommand.java b/server/src/main/java/org/opensearch/cluster/coordination/OpenSearchNodeCommand.java index 9110f1789521e..9f8e1c6c1e848 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/OpenSearchNodeCommand.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/OpenSearchNodeCommand.java @@ -230,6 +230,11 @@ OptionParser getParser() { return parser; } + /** + * Custom unknown metadata. + * + * @opensearch.internal + */ public static class UnknownMetadataCustom implements Metadata.Custom { private final String name; @@ -274,6 +279,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } + /** + * An unknown condition. + * + * @opensearch.internal + */ public static class UnknownCondition extends Condition { public UnknownCondition(String name, Object value) { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PendingClusterStateStats.java b/server/src/main/java/org/opensearch/cluster/coordination/PendingClusterStateStats.java index d6f767d3e6235..a4e09d00a874f 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PendingClusterStateStats.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PendingClusterStateStats.java @@ -92,6 +92,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields for parsing and toXContent + * + * @opensearch.internal + */ static final class Fields { static final String QUEUE = "cluster_state_queue"; static final String TOTAL = "total"; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PreVoteCollector.java b/server/src/main/java/org/opensearch/cluster/coordination/PreVoteCollector.java index c635dee173792..2cf7ebcc850a5 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PreVoteCollector.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PreVoteCollector.java @@ -167,6 +167,11 @@ public String toString() { return "PreVoteCollector{" + "state=" + state + '}'; } + /** + * The pre vote round. + * + * @opensearch.internal + */ private class PreVotingRound implements Releasable { private final Map preVotesReceived = newConcurrentMap(); private final AtomicBoolean electionStarted = new AtomicBoolean(); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/Publication.java b/server/src/main/java/org/opensearch/cluster/coordination/Publication.java index 3580de423ac95..c85ea07591edc 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/Publication.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/Publication.java @@ -252,6 +252,11 @@ enum PublicationTargetState { APPLIED_COMMIT, } + /** + * A publication target. + * + * @opensearch.internal + */ class PublicationTarget { private final DiscoveryNode discoveryNode; private boolean ackIsPending = true; @@ -363,6 +368,11 @@ boolean isFailed() { return state == PublicationTargetState.FAILED; } + /** + * A handler for a publish response. + * + * @opensearch.internal + */ private class PublishResponseHandler implements ActionListener { @Override @@ -404,6 +414,11 @@ public void onFailure(Exception e) { } + /** + * An apply commit response handler. + * + * @opensearch.internal + */ private class ApplyCommitResponseHandler implements ActionListener { @Override diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java b/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java index 7591a09b07740..c3b3b237a1944 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java @@ -284,6 +284,8 @@ private static BytesReference serializeDiffClusterState(Diff diff, * Publishing a cluster state typically involves sending the same cluster state (or diff) to every node, so the work of diffing, * serializing, and compressing the state can be done once and the results shared across publish requests. The * {@code PublicationContext} implements this sharing. + * + * @opensearch.internal */ public class PublicationContext { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java b/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java index 931f8ff228d9c..2d268b5cca779 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java @@ -170,6 +170,11 @@ public VotingConfiguration reconfigure( } } + /** + * A node to handle voting configs. + * + * @opensearch.internal + */ static class VotingConfigNode implements Comparable { final String id; final boolean live; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/AliasAction.java b/server/src/main/java/org/opensearch/cluster/metadata/AliasAction.java index be69090e0c33c..a53f8411b2549 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/AliasAction.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/AliasAction.java @@ -76,6 +76,8 @@ public String getIndex() { /** * Validate a new alias. + * + * @opensearch.internal */ @FunctionalInterface public interface NewAliasValidator { @@ -84,6 +86,8 @@ public interface NewAliasValidator { /** * Operation to add an alias to an index. + * + * @opensearch.internal */ public static class Add extends AliasAction { private final String alias; @@ -174,6 +178,8 @@ boolean apply(NewAliasValidator aliasValidator, Metadata.Builder metadata, Index /** * Operation to remove an alias from an index. + * + * @opensearch.internal */ public static class Remove extends AliasAction { private final String alias; @@ -220,6 +226,8 @@ boolean apply(NewAliasValidator aliasValidator, Metadata.Builder metadata, Index /** * Operation to remove an index. This is an "alias action" because it allows us to remove an index at the same time as we remove add an * alias to replace it. + * + * @opensearch.internal */ public static class RemoveIndex extends AliasAction { public RemoveIndex(String index) { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/AliasMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/AliasMetadata.java index 375317b32b293..dc22af42ac801 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/AliasMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/AliasMetadata.java @@ -276,6 +276,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Builder of alias metadata. + * + * @opensearch.internal + */ public static class Builder { private final String alias; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/ClusterNameExpressionResolver.java b/server/src/main/java/org/opensearch/cluster/metadata/ClusterNameExpressionResolver.java index afa0ec64b72b5..fdc6c17cb3b13 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/ClusterNameExpressionResolver.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/ClusterNameExpressionResolver.java @@ -68,6 +68,11 @@ public List resolveClusterNames(Set remoteClusters, String clust } } + /** + * A wildcard expression resolver. + * + * @opensearch.internal + */ private static class WildcardExpressionResolver { private List resolve(Set remoteClusters, String clusterExpression) { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplateMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplateMetadata.java index 4850e212b832f..9607eb181d5e7 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplateMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplateMetadata.java @@ -156,6 +156,11 @@ public String toString() { return Strings.toString(this); } + /** + * A diff between component template metadata. + * + * @opensearch.internal + */ static class ComponentTemplateMetadataDiff implements NamedDiff { final Diff> componentTemplateDiff; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplate.java b/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplate.java index 5b16733e12fbb..33c50c938c3db 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplate.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplate.java @@ -289,6 +289,11 @@ public String toString() { return Strings.toString(this); } + /** + * Template for data stream. + * + * @opensearch.internal + */ public static class DataStreamTemplate implements Writeable, ToXContentObject { private static final ParseField TIMESTAMP_FIELD_FIELD = new ParseField("timestamp_field"); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplateMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplateMetadata.java index a0e228f5d3ea5..a9b8f99b0a568 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplateMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplateMetadata.java @@ -157,6 +157,11 @@ public String toString() { return Strings.toString(this); } + /** + * A diff between composable metadata templates. + * + * @opensearch.internal + */ static class ComposableIndexTemplateMetadataDiff implements NamedDiff { final Diff> indexTemplateDiff; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/DataStream.java b/server/src/main/java/org/opensearch/cluster/metadata/DataStream.java index dffcb11619be4..f48b784e38606 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/DataStream.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/DataStream.java @@ -232,6 +232,11 @@ public int hashCode() { return Objects.hash(name, timeStampField, indices, generation); } + /** + * A timestamp field. + * + * @opensearch.internal + */ public static final class TimestampField implements Writeable, ToXContentObject { static ParseField NAME_FIELD = new ParseField("name"); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/DataStreamMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/DataStreamMetadata.java index 6045f745e1584..181ddcb21cb3b 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/DataStreamMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/DataStreamMetadata.java @@ -161,6 +161,11 @@ public String toString() { return Strings.toString(this); } + /** + * Builder of data stream metadata. + * + * @opensearch.internal + */ public static class Builder { private final Map dataStreams = new HashMap<>(); @@ -175,6 +180,11 @@ public DataStreamMetadata build() { } } + /** + * A diff between data stream metadata. + * + * @opensearch.internal + */ static class DataStreamMetadataDiff implements NamedDiff { final Diff> dataStreamDiff; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/DiffableStringMap.java b/server/src/main/java/org/opensearch/cluster/metadata/DiffableStringMap.java index 542af9c54283a..2372ec75445c9 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/DiffableStringMap.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/DiffableStringMap.java @@ -90,6 +90,8 @@ public static Diff readDiffFrom(StreamInput in) throws IOExce /** * Represents differences between two DiffableStringMaps. + * + * @opensearch.internal */ public static class DiffableStringMapDiff implements Diff { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/IndexAbstraction.java b/server/src/main/java/org/opensearch/cluster/metadata/IndexAbstraction.java index 77c585ca875aa..975c71ab75110 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexAbstraction.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexAbstraction.java @@ -139,6 +139,8 @@ public String getDisplayName() { /** * Represents an concrete index and encapsulates its {@link IndexMetadata} + * + * @opensearch.internal */ class Index implements IndexAbstraction { @@ -192,6 +194,8 @@ public boolean isSystem() { /** * Represents an alias and groups all {@link IndexMetadata} instances sharing the same alias name together. + * + * @opensearch.internal */ class Alias implements IndexAbstraction { @@ -329,6 +333,11 @@ private boolean isNonEmpty(List idxMetas) { } } + /** + * A data stream. + * + * @opensearch.internal + */ class DataStream implements IndexAbstraction { private final org.opensearch.cluster.metadata.DataStream dataStream; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/IndexGraveyard.java b/server/src/main/java/org/opensearch/cluster/metadata/IndexGraveyard.java index de9d616d79b0b..0e42197ad77fd 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexGraveyard.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexGraveyard.java @@ -190,6 +190,8 @@ public static IndexGraveyard.Builder builder(final IndexGraveyard graveyard) { /** * A class to build an IndexGraveyard. + * + * @opensearch.internal */ public static final class Builder { private List tombstones; @@ -275,6 +277,8 @@ public IndexGraveyard build(final Settings settings) { /** * A class representing a diff of two IndexGraveyard objects. + * + * @opensearch.internal */ public static final class IndexGraveyardDiff implements NamedDiff { @@ -362,6 +366,8 @@ public String getWriteableName() { /** * An individual tombstone entry for representing a deleted index. + * + * @opensearch.internal */ public static final class Tombstone implements ToXContentObject, Writeable { @@ -460,6 +466,8 @@ public XContentBuilder toXContent(final XContentBuilder builder, final Params pa /** * A builder for building tombstone entries. + * + * @opensearch.internal */ private static final class Builder { private Index index; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java index 0b3b2116f6cee..ec70e642ababc 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java @@ -149,6 +149,11 @@ public class IndexMetadata implements Diffable, ToXContentFragmen EnumSet.of(ClusterBlockLevel.METADATA_WRITE, ClusterBlockLevel.WRITE) ); + /** + * The state of the index. + * + * @opensearch.internal + */ public enum State { OPEN((byte) 0), CLOSE((byte) 1); @@ -281,6 +286,11 @@ public Iterator> settings() { public static final String SETTING_AUTO_EXPAND_REPLICAS = "index.auto_expand_replicas"; public static final Setting INDEX_AUTO_EXPAND_REPLICAS_SETTING = AutoExpandReplicas.SETTING; + /** + * Blocks the API. + * + * @opensearch.internal + */ public enum APIBlock implements Writeable { READ_ONLY("read_only", INDEX_READ_ONLY_BLOCK), READ("read", INDEX_READ_BLOCK), @@ -832,6 +842,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * A diff of index metadata. + * + * @opensearch.internal + */ private static class IndexMetadataDiff implements Diff { private final String index; @@ -1058,6 +1073,11 @@ public static Builder builder(IndexMetadata indexMetadata) { return new Builder(indexMetadata); } + /** + * Builder of index metadata. + * + * @opensearch.internal + */ public static class Builder { private String index; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/IndexNameExpressionResolver.java b/server/src/main/java/org/opensearch/cluster/metadata/IndexNameExpressionResolver.java index 4a6df1bc0a53c..3d1609e0eb9c0 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexNameExpressionResolver.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexNameExpressionResolver.java @@ -773,6 +773,11 @@ public boolean isSystemIndexAccessAllowed() { return Booleans.parseBoolean(threadContext.getHeader(SYSTEM_INDEX_ACCESS_CONTROL_HEADER_KEY), true); } + /** + * Context for the resolver. + * + * @opensearch.internal + */ public static class Context { private final ClusterState state; @@ -912,6 +917,8 @@ private interface ExpressionResolver { /** * Resolves alias/index name expressions with wildcards into the corresponding concrete indices/aliases + * + * @opensearch.internal */ static final class WildcardExpressionResolver implements ExpressionResolver { @@ -1192,6 +1199,11 @@ private static List resolveEmptyOrTrivialWildcard(IndicesOptions options } } + /** + * A date math expression resolver. + * + * @opensearch.internal + */ public static final class DateMathExpressionResolver implements ExpressionResolver { private static final DateFormatter DEFAULT_DATE_FORMATTER = DateFormatter.forPattern("uuuu.MM.dd"); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/IndexTemplateMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/IndexTemplateMetadata.java index 367a15560200f..976edb0bbad47 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexTemplateMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexTemplateMetadata.java @@ -270,6 +270,11 @@ public String toString() { } } + /** + * Builder of index template metadata. + * + * @opensearch.internal + */ public static class Builder { private static final Set VALID_FIELDS = Sets.newHashSet( diff --git a/server/src/main/java/org/opensearch/cluster/metadata/Manifest.java b/server/src/main/java/org/opensearch/cluster/metadata/Manifest.java index b14e970360dce..23500f7ca4ce0 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/Manifest.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/Manifest.java @@ -233,6 +233,11 @@ public boolean isGlobalGenerationMissing() { return globalGeneration == MISSING_GLOBAL_GENERATION; } + /** + * An index entry. + * + * @opensearch.internal + */ private static final class IndexEntry implements ToXContentFragment { private static final ParseField INDEX_GENERATION_PARSE_FIELD = new ParseField("generation"); private static final ParseField INDEX_PARSE_FIELD = new ParseField("index"); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java b/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java index bec72b696acdd..5f7e98e9e1199 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java @@ -112,6 +112,11 @@ public class Metadata implements Iterable, Diffable, To public static final String UNKNOWN_CLUSTER_UUID = "_na_"; public static final Pattern NUMBER_PATTERN = Pattern.compile("[0-9]+$"); + /** + * Context of the XContent. + * + * @opensearch.internal + */ public enum XContentContext { /* Custom metadata should be returns as part of API call */ API, @@ -146,6 +151,11 @@ public enum XContentContext { */ public static EnumSet ALL_CONTEXTS = EnumSet.allOf(XContentContext.class); + /** + * Custom metadata. + * + * @opensearch.internal + */ public interface Custom extends NamedDiffable, ToXContentFragment, ClusterState.FeatureAware { EnumSet context(); @@ -920,6 +930,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * A diff of metadata. + * + * @opensearch.internal + */ private static class MetadataDiff implements Diff { private final long version; @@ -1088,6 +1103,11 @@ public static Builder builder(Metadata metadata) { return new Builder(metadata); } + /** + * Builder of metadata. + * + * @opensearch.internal + */ public static class Builder { private String clusterUUID; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateDataStreamService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateDataStreamService.java index 66fe3c5ce61dd..412d4dba628cb 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateDataStreamService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateDataStreamService.java @@ -125,6 +125,11 @@ public ClusterState createDataStream(CreateDataStreamClusterStateUpdateRequest r return createDataStream(metadataCreateIndexService, current, request); } + /** + * A request to create a data stream cluster state update + * + * @opensearch.internal + */ public static final class CreateDataStreamClusterStateUpdateRequest extends ClusterStateUpdateRequest { private final String name; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexStateService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexStateService.java index d8715d07a31a3..4f1000e3407fd 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexStateService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexStateService.java @@ -583,6 +583,8 @@ public TimeValue timeout() { * This step iterates over the indices previously blocked and sends a {@link TransportVerifyShardBeforeCloseAction} to each shard. If * this action succeed then the shard is considered to be ready for closing. When all shards of a given index are ready for closing, * the index is considered ready to be closed. + * + * @opensearch.internal */ class WaitForClosedBlocksApplied extends ActionRunnable> { @@ -715,6 +717,8 @@ public void onFailure(Exception e) { /** * Helper class that coordinates with shards to ensure that blocks have been properly applied to all shards using * {@link TransportVerifyShardIndexBlockAction}. + * + * @opensearch.metadata */ class WaitForBlocksApplied extends ActionRunnable> { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexTemplateService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexTemplateService.java index c14170e358f4c..9c734fd7b3bdc 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexTemplateService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexTemplateService.java @@ -1498,6 +1498,11 @@ private void validate(String name, @Nullable Settings settings, List ind } } + /** + * Listener for putting metadata in the template + * + * @opensearch.internal + */ public interface PutListener { void onResponse(PutResponse response); @@ -1505,6 +1510,11 @@ public interface PutListener { void onFailure(Exception e); } + /** + * A PUT request. + * + * @opensearch.internal + */ public static class PutRequest { final String name; final String cause; @@ -1564,6 +1574,11 @@ public PutRequest version(Integer version) { } } + /** + * The PUT response. + * + * @opensearch.internal + */ public static class PutResponse { private final boolean acknowledged; @@ -1576,6 +1591,11 @@ public boolean acknowledged() { } } + /** + * A remove Request. + * + * @opensearch.internal + */ public static class RemoveRequest { final String name; TimeValue masterTimeout = MasterNodeRequest.DEFAULT_MASTER_NODE_TIMEOUT; @@ -1590,6 +1610,11 @@ public RemoveRequest masterTimeout(TimeValue masterTimeout) { } } + /** + * A remove Response. + * + * @opensearch.internal + */ public static class RemoveResponse { private final boolean acknowledged; @@ -1602,6 +1627,11 @@ public boolean acknowledged() { } } + /** + * A remove listener. + * + * @opensearch.internal + */ public interface RemoveListener { void onResponse(RemoveResponse response); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/SystemIndexMetadataUpgradeService.java b/server/src/main/java/org/opensearch/cluster/metadata/SystemIndexMetadataUpgradeService.java index 85568d69639cb..c708f3830f431 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/SystemIndexMetadataUpgradeService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/SystemIndexMetadataUpgradeService.java @@ -94,6 +94,11 @@ public void clusterChanged(ClusterChangedEvent event) { } } + /** + * Task to update system index metadata. + * + * @opensearch.internal + */ public class SystemIndexMetadataUpdateTask extends ClusterStateUpdateTask { @Override diff --git a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodeFilters.java b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodeFilters.java index 8ed4eb27ba17b..b47ad43d44efb 100644 --- a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodeFilters.java +++ b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodeFilters.java @@ -52,6 +52,11 @@ */ public class DiscoveryNodeFilters { + /** + * Operation type. + * + * @opensearch.internal + */ public enum OpType { AND, OR diff --git a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodes.java b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodes.java index a209c51ea5245..0304a51f330c8 100644 --- a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodes.java +++ b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodes.java @@ -515,6 +515,11 @@ public String toString() { return sb.toString(); } + /** + * Delta between nodes. + * + * @opensearch.internal + */ public static class Delta { private final String localNodeId; @@ -658,6 +663,11 @@ public static Builder builder(DiscoveryNodes nodes) { return new Builder(nodes); } + /** + * Builder of a map of discovery nodes. + * + * @opensearch.internal + */ public static class Builder { private final ImmutableOpenMap.Builder nodes; diff --git a/server/src/main/java/org/opensearch/cluster/routing/IndexRoutingTable.java b/server/src/main/java/org/opensearch/cluster/routing/IndexRoutingTable.java index 121c104d2bca2..9eca838bb7945 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/IndexRoutingTable.java +++ b/server/src/main/java/org/opensearch/cluster/routing/IndexRoutingTable.java @@ -365,6 +365,11 @@ public static Builder builder(Index index) { return new Builder(index); } + /** + * Builder of a routing table. + * + * @opensearch.internal + */ public static class Builder { private final Index index; diff --git a/server/src/main/java/org/opensearch/cluster/routing/IndexShardRoutingTable.java b/server/src/main/java/org/opensearch/cluster/routing/IndexShardRoutingTable.java index 1be7f5295f866..d4597f47d9a6c 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/IndexShardRoutingTable.java +++ b/server/src/main/java/org/opensearch/cluster/routing/IndexShardRoutingTable.java @@ -698,6 +698,11 @@ public int shardsMatchingPredicateCount(Predicate predicate) { return count; } + /** + * Builder of an index shard routing table. + * + * @opensearch.internal + */ public static class Builder { private ShardId shardId; diff --git a/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java b/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java index 1483831c82a35..6ffa155729c7a 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java +++ b/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java @@ -106,6 +106,11 @@ protected void writeAdditionalFields(StreamOutput out) throws IOException { } + /** + * Type of recovery. + * + * @opensearch.internal + */ public enum Type { EMPTY_STORE, EXISTING_STORE, @@ -141,6 +146,8 @@ public int hashCode() { /** * Recovery from a fresh copy + * + * @opensearch.internal */ public static final class EmptyStoreRecoverySource extends RecoverySource { public static final EmptyStoreRecoverySource INSTANCE = new EmptyStoreRecoverySource(); @@ -158,6 +165,8 @@ public String toString() { /** * Recovery from an existing on-disk store + * + * @opensearch.internal */ public static final class ExistingStoreRecoverySource extends RecoverySource { /** @@ -211,6 +220,8 @@ public boolean expectEmptyRetentionLeases() { /** * recovery from other shards on same node (shrink index action) + * + * @opensearch.internal */ public static class LocalShardsRecoverySource extends RecoverySource { @@ -232,6 +243,8 @@ public String toString() { /** * recovery from a snapshot + * + * @opensearch.internal */ public static class SnapshotRecoverySource extends RecoverySource { @@ -338,6 +351,8 @@ public int hashCode() { /** * peer recovery from a primary shard + * + * @opensearch.internal */ public static class PeerRecoverySource extends RecoverySource { diff --git a/server/src/main/java/org/opensearch/cluster/routing/RoutingChangesObserver.java b/server/src/main/java/org/opensearch/cluster/routing/RoutingChangesObserver.java index 6b2cd59a6df15..1ec572f7f8cc4 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/RoutingChangesObserver.java +++ b/server/src/main/java/org/opensearch/cluster/routing/RoutingChangesObserver.java @@ -137,6 +137,11 @@ public void initializedReplicaReinitialized(ShardRouting oldReplica, ShardRoutin } } + /** + * Observer of routing changes. + * + * @opensearch.internal + */ class DelegatingRoutingChangesObserver implements RoutingChangesObserver { private final RoutingChangesObserver[] routingChangesObservers; diff --git a/server/src/main/java/org/opensearch/cluster/routing/RoutingNodes.java b/server/src/main/java/org/opensearch/cluster/routing/RoutingNodes.java index 9b7d912c28598..986df494917c0 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/RoutingNodes.java +++ b/server/src/main/java/org/opensearch/cluster/routing/RoutingNodes.java @@ -893,6 +893,11 @@ public int size() { return nodesToShards.size(); } + /** + * Unassigned shard list. + * + * @opensearch.internal + */ public static final class UnassignedShards implements Iterable { private final RoutingNodes nodes; @@ -989,6 +994,11 @@ public void ignoreShard(ShardRouting shard, AllocationStatus allocationStatus, R ignored.add(shard); } + /** + * An unassigned iterator. + * + * @opensearch.internal + */ public class UnassignedIterator implements Iterator, ExistingShardsAllocator.UnassignedAllocationHandler { private final ListIterator iterator; @@ -1369,6 +1379,11 @@ public void remove() { } } + /** + * A collection of recoveries. + * + * @opensearch.internal + */ private static final class Recoveries { private static final Recoveries EMPTY = new Recoveries(); private int incoming = 0; diff --git a/server/src/main/java/org/opensearch/cluster/routing/RoutingTable.java b/server/src/main/java/org/opensearch/cluster/routing/RoutingTable.java index dc4210a42c78a..8c2d3ddb0697f 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/RoutingTable.java +++ b/server/src/main/java/org/opensearch/cluster/routing/RoutingTable.java @@ -424,6 +424,8 @@ public static Builder builder(RoutingTable routingTable) { /** * Builder for the routing table. Note that build can only be called one time. + * + * @opensearch.internal */ public static class Builder { diff --git a/server/src/main/java/org/opensearch/cluster/routing/UnassignedInfo.java b/server/src/main/java/org/opensearch/cluster/routing/UnassignedInfo.java index 0f5028d2295f8..49c18fe44cc04 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/UnassignedInfo.java +++ b/server/src/main/java/org/opensearch/cluster/routing/UnassignedInfo.java @@ -81,6 +81,8 @@ public final class UnassignedInfo implements ToXContentFragment, Writeable { *

* Note, ordering of the enum is important, make sure to add new values * at the end and handle version serialization properly. + * + * @opensearch.internal */ public enum Reason { /** @@ -155,6 +157,8 @@ public enum Reason { * * Note, ordering of the enum is important, make sure to add new values * at the end and handle version serialization properly. + * + * @opensearch.internal */ public enum AllocationStatus implements Writeable { /** diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocationService.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocationService.java index 0c04860f09682..1c6e4732a2ab7 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocationService.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocationService.java @@ -742,6 +742,8 @@ public int getNumberOfInFlightFetches() { /** * this class is used to describe results of applying a set of * {@link org.opensearch.cluster.routing.allocation.command.AllocationCommand} + * + * @opensearch.internal */ public static class CommandsResult { diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/DiskThresholdSettings.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/DiskThresholdSettings.java index 9cabffbcd80c0..0ce0b1bd7b688 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/DiskThresholdSettings.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/DiskThresholdSettings.java @@ -142,6 +142,11 @@ public DiskThresholdSettings(Settings settings, ClusterSettings clusterSettings) clusterSettings.addSettingsUpdateConsumer(CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING, this::setEnabled); } + /** + * Validates a low disk watermark. + * + * @opensearch.internal + */ static final class LowDiskWatermarkValidator implements Setting.Validator { @Override @@ -167,6 +172,11 @@ public Iterator> settings() { } + /** + * Validates a high disk watermark. + * + * @opensearch.internal + */ static final class HighDiskWatermarkValidator implements Setting.Validator { @Override @@ -192,6 +202,11 @@ public Iterator> settings() { } + /** + * Validates the flood stage. + * + * @opensearch.internal + */ static final class FloodStageValidator implements Setting.Validator { @Override diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/NodeAllocationResult.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/NodeAllocationResult.java index 10f9f3b93d685..e600dc50177bb 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/NodeAllocationResult.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/NodeAllocationResult.java @@ -188,7 +188,11 @@ public int compareTo(NodeAllocationResult other) { return nodeResultComparator.compare(this, other); } - /** A class that captures metadata about a shard store on a node. */ + /** + * A class that captures metadata about a shard store on a node. + * + * @opensearch.internal + */ public static final class ShardStoreInfo implements ToXContentFragment, Writeable { private final boolean inSync; @Nullable diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/RoutingAllocation.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/RoutingAllocation.java index 959cef1931fc4..3ac22f5eee362 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/RoutingAllocation.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/RoutingAllocation.java @@ -315,6 +315,11 @@ public void setHasPendingAsyncFetch() { this.hasPendingAsyncFetch = true; } + /** + * Debug mode. + * + * @opensearch.internal + */ public enum DebugMode { /** * debug mode is off diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java index 6f500ab1538bb..181910e3ac1c4 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java @@ -291,6 +291,8 @@ float weight(Balancer balancer, ModelNode node, String index) { /** * A {@link Balancer} + * + * @opensearch.internal */ public static class Balancer { private final Logger logger; @@ -1192,6 +1194,11 @@ private boolean tryRelocateShard(ModelNode minNode, ModelNode maxNode, String id } + /** + * A model node. + * + * @opensearch.internal + */ public static class ModelNode implements Iterable { private final Map indices = new HashMap<>(); private int numShards = 0; @@ -1270,6 +1277,11 @@ public boolean containsShard(ShardRouting shard) { } + /** + * A model index. + * + * @opensearch.internal + */ static final class ModelIndex implements Iterable { private final String id; private final Set shards = new HashSet<>(4); // expect few shards of same index to be allocated on same node @@ -1322,6 +1334,11 @@ public boolean containsShard(ShardRouting shard) { } } + /** + * A node sorter. + * + * @opensearch.internal + */ static final class NodeSorter extends IntroSorter { final ModelNode[] modelNodes; diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocateEmptyPrimaryAllocationCommand.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocateEmptyPrimaryAllocationCommand.java index 31188685ee677..aef86a4e1a59b 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocateEmptyPrimaryAllocationCommand.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocateEmptyPrimaryAllocationCommand.java @@ -98,6 +98,11 @@ public static AllocateEmptyPrimaryAllocationCommand fromXContent(XContentParser return new Builder().parse(parser).build(); } + /** + * Builder for an empty primary allocation. + * + * @opensearch.internal + */ public static class Builder extends BasePrimaryAllocationCommand.Builder { @Override diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocateReplicaAllocationCommand.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocateReplicaAllocationCommand.java index 5d83a464c9ac2..43a100446410f 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocateReplicaAllocationCommand.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocateReplicaAllocationCommand.java @@ -88,6 +88,11 @@ public static AllocateReplicaAllocationCommand fromXContent(XContentParser parse return new Builder().parse(parser).build(); } + /** + * A builder for the command. + * + * @opensearch.internal + */ protected static class Builder extends AbstractAllocateAllocationCommand.Builder { @Override diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocateStalePrimaryAllocationCommand.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocateStalePrimaryAllocationCommand.java index e9b79d5ce730e..493f20ec5e4ec 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocateStalePrimaryAllocationCommand.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocateStalePrimaryAllocationCommand.java @@ -95,6 +95,11 @@ public static AllocateStalePrimaryAllocationCommand fromXContent(XContentParser return new Builder().parse(parser).build(); } + /** + * Builder for a stale primary allocation + * + * @opensearch.internal + */ public static class Builder extends BasePrimaryAllocationCommand.Builder { @Override diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/BasePrimaryAllocationCommand.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/BasePrimaryAllocationCommand.java index a39433866863a..6f0629bcf2520 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/BasePrimaryAllocationCommand.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/BasePrimaryAllocationCommand.java @@ -85,6 +85,11 @@ public boolean acceptDataLoss() { return acceptDataLoss; } + /** + * Base builder class for the primary allocation command. + * + * @opensearch.internal + */ protected abstract static class Builder extends AbstractAllocateAllocationCommand.Builder { protected boolean acceptDataLoss; diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/ClusterRebalanceAllocationDecider.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/ClusterRebalanceAllocationDecider.java index 58b9ba6476301..75c4d2aa3953d 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/ClusterRebalanceAllocationDecider.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/ClusterRebalanceAllocationDecider.java @@ -78,6 +78,8 @@ public class ClusterRebalanceAllocationDecider extends AllocationDecider { /** * An enum representation for the configured re-balance type. + * + * @opensearch.internal */ public enum ClusterRebalanceType { /** diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/Decision.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/Decision.java index 52e02c6b0d049..b105411083601 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/Decision.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/Decision.java @@ -97,6 +97,8 @@ public static Decision readFrom(StreamInput in) throws IOException { /** * This enumeration defines the * possible types of decisions + * + * @opensearch.internal */ public enum Type implements Writeable { YES(1), @@ -170,6 +172,8 @@ public boolean canPremptivelyReturn() { /** * Simple class representing a single decision + * + * @opensearch.internal */ public static class Single extends Decision implements ToXContentObject { private Type type; @@ -287,6 +291,8 @@ public void writeTo(StreamOutput out) throws IOException { /** * Simple class representing a list of decisions + * + * @opensearch.internal */ public static class Multi extends Decision implements ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/EnableAllocationDecider.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/EnableAllocationDecider.java index ebeed170ca426..a51546920c6a0 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/EnableAllocationDecider.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/EnableAllocationDecider.java @@ -282,6 +282,8 @@ private static String setting(Rebalance rebalance, boolean usedIndexSetting) { * {@link EnableAllocationDecider#CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING} / * {@link EnableAllocationDecider#INDEX_ROUTING_ALLOCATION_ENABLE_SETTING} * via cluster / index settings. + * + * @opensearch.internal */ public enum Allocation { @@ -314,6 +316,8 @@ public String toString() { * {@link EnableAllocationDecider#CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING} / * {@link EnableAllocationDecider#INDEX_ROUTING_REBALANCE_ENABLE_SETTING} * via cluster / index settings. + * + * @opensearch.internal */ public enum Rebalance { diff --git a/server/src/main/java/org/opensearch/common/LocalTimeOffset.java b/server/src/main/java/org/opensearch/common/LocalTimeOffset.java index ce2bd2f21ce37..7e89641927ed5 100644 --- a/server/src/main/java/org/opensearch/common/LocalTimeOffset.java +++ b/server/src/main/java/org/opensearch/common/LocalTimeOffset.java @@ -148,6 +148,11 @@ public final long localToUtcInThisOffset(long localMillis) { */ public abstract long localToUtc(long localMillis, Strategy strat); + /** + * Strategy for a local time + * + * @opensearch.internal + */ public interface Strategy { /** * Handle a local time that never actually happened because a "gap" diff --git a/server/src/main/java/org/opensearch/common/Rounding.java b/server/src/main/java/org/opensearch/common/Rounding.java index f5ca75882eac0..c396f6c88fd57 100644 --- a/server/src/main/java/org/opensearch/common/Rounding.java +++ b/server/src/main/java/org/opensearch/common/Rounding.java @@ -81,6 +81,11 @@ public abstract class Rounding implements Writeable { private static final Logger logger = LogManager.getLogger(Rounding.class); + /** + * A Date Time Unit + * + * @opensearch.internal + */ public enum DateTimeUnit { WEEK_OF_WEEKYEAR((byte) 1, "week", IsoFields.WEEK_OF_WEEK_BASED_YEAR, true, TimeUnit.DAYS.toMillis(7)) { private final long extraLocalOffsetLookup = TimeUnit.DAYS.toMillis(7); @@ -262,6 +267,8 @@ public void writeTo(StreamOutput out) throws IOException { /** * A strategy for rounding milliseconds since epoch. + * + * @opensearch.internal */ public interface Prepared { /** diff --git a/server/src/main/java/org/opensearch/common/breaker/CircuitBreaker.java b/server/src/main/java/org/opensearch/common/breaker/CircuitBreaker.java index 8eaf7aba99945..4cbd375e8c1ff 100644 --- a/server/src/main/java/org/opensearch/common/breaker/CircuitBreaker.java +++ b/server/src/main/java/org/opensearch/common/breaker/CircuitBreaker.java @@ -69,6 +69,11 @@ public interface CircuitBreaker { */ String IN_FLIGHT_REQUESTS = "in_flight_requests"; + /** + * The type of breaker + * + * @opensearch.internal + */ enum Type { // A regular or ChildMemoryCircuitBreaker MEMORY, @@ -91,6 +96,11 @@ public static Type parseValue(String value) { } } + /** + * The breaker durability + * + * @opensearch.internal + */ enum Durability { // The condition that tripped the circuit breaker fixes itself eventually. TRANSIENT, diff --git a/server/src/main/java/org/opensearch/common/cache/RemovalNotification.java b/server/src/main/java/org/opensearch/common/cache/RemovalNotification.java index f8dc8fa4a6d0f..454f7b5a96a64 100644 --- a/server/src/main/java/org/opensearch/common/cache/RemovalNotification.java +++ b/server/src/main/java/org/opensearch/common/cache/RemovalNotification.java @@ -38,6 +38,11 @@ * @opensearch.internal */ public class RemovalNotification { + /** + * Reason for notification removal + * + * @opensearch.internal + */ public enum RemovalReason { REPLACED, INVALIDATED, diff --git a/server/src/main/java/org/opensearch/common/collect/HppcMaps.java b/server/src/main/java/org/opensearch/common/collect/HppcMaps.java index 7d78b71421069..2fd7316accf6e 100644 --- a/server/src/main/java/org/opensearch/common/collect/HppcMaps.java +++ b/server/src/main/java/org/opensearch/common/collect/HppcMaps.java @@ -147,7 +147,17 @@ public Iterator iterator() { }; } + /** + * Object for the map + * + * @opensearch.internal + */ public static final class Object { + /** + * Integer type for the map + * + * @opensearch.internal + */ public static final class Integer { public static ObjectIntHashMap ensureNoNullKeys(int capacity, float loadFactor) { return new ObjectIntHashMap(capacity, loadFactor) { diff --git a/server/src/main/java/org/opensearch/common/collect/Iterators.java b/server/src/main/java/org/opensearch/common/collect/Iterators.java index 9536bbb1ba46b..c7e7ae6a44a21 100644 --- a/server/src/main/java/org/opensearch/common/collect/Iterators.java +++ b/server/src/main/java/org/opensearch/common/collect/Iterators.java @@ -35,6 +35,11 @@ import java.util.Iterator; import java.util.NoSuchElementException; +/** + * Iterators utility class. + * + * @opensearch.internal + */ public class Iterators { public static Iterator concat(Iterator... iterators) { if (iterators == null) { diff --git a/server/src/main/java/org/opensearch/common/component/Lifecycle.java b/server/src/main/java/org/opensearch/common/component/Lifecycle.java index b0db6435d6126..fb12c1fc9ac4b 100644 --- a/server/src/main/java/org/opensearch/common/component/Lifecycle.java +++ b/server/src/main/java/org/opensearch/common/component/Lifecycle.java @@ -77,6 +77,11 @@ */ public class Lifecycle { + /** + * State in the lifecycle + * + * @opensearch.internal + */ public enum State { INITIALIZED, STOPPED, diff --git a/server/src/main/java/org/opensearch/common/geo/GeoUtils.java b/server/src/main/java/org/opensearch/common/geo/GeoUtils.java index 9cff3e56b56e3..5534967d559d6 100644 --- a/server/src/main/java/org/opensearch/common/geo/GeoUtils.java +++ b/server/src/main/java/org/opensearch/common/geo/GeoUtils.java @@ -421,6 +421,8 @@ public static GeoPoint parseGeoPoint(Object value, GeoPoint point, final boolean /** * Represents the point of the geohash cell that should be used as the value of geohash + * + * @opensearch.internal */ public enum EffectivePoint { TOP_LEFT, diff --git a/server/src/main/java/org/opensearch/common/geo/builders/ShapeBuilder.java b/server/src/main/java/org/opensearch/common/geo/builders/ShapeBuilder.java index 4e7524400958a..92681ce4c4700 100644 --- a/server/src/main/java/org/opensearch/common/geo/builders/ShapeBuilder.java +++ b/server/src/main/java/org/opensearch/common/geo/builders/ShapeBuilder.java @@ -420,6 +420,11 @@ public int compare(Edge o1, Edge o2) { } } + /** + * The orientation of the vertices + * + * @opensearch.internal + */ public enum Orientation { LEFT, RIGHT; diff --git a/server/src/main/java/org/opensearch/common/inject/BindingProcessor.java b/server/src/main/java/org/opensearch/common/inject/BindingProcessor.java index 1dd3c83b1474e..f0edad2df8bcc 100644 --- a/server/src/main/java/org/opensearch/common/inject/BindingProcessor.java +++ b/server/src/main/java/org/opensearch/common/inject/BindingProcessor.java @@ -314,6 +314,11 @@ private boolean isOkayDuplicate(Binding original, BindingImpl binding) { ); // TODO(jessewilson): fix BuiltInModule, then add Stage + /** + * A listener for a process creation + * + * @opensearch.internal + */ interface CreationListener { void notify(Errors errors); } diff --git a/server/src/main/java/org/opensearch/common/inject/InjectorImpl.java b/server/src/main/java/org/opensearch/common/inject/InjectorImpl.java index c01f155c399e4..f004f5e418b26 100644 --- a/server/src/main/java/org/opensearch/common/inject/InjectorImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/InjectorImpl.java @@ -676,6 +676,8 @@ SingleParameterInjector createParameterInjector(final Dependency depen /** * Invokes a method. + * + * @opensearch.internal */ interface MethodInvoker { Object invoke(Object target, Object... parameters) throws IllegalAccessException, InvocationTargetException; diff --git a/server/src/main/java/org/opensearch/common/inject/Key.java b/server/src/main/java/org/opensearch/common/inject/Key.java index 56730cbfa495a..cd305353a555d 100644 --- a/server/src/main/java/org/opensearch/common/inject/Key.java +++ b/server/src/main/java/org/opensearch/common/inject/Key.java @@ -325,6 +325,11 @@ Key withoutAttributes() { return new Key<>(typeLiteral, annotationStrategy.withoutAttributes()); } + /** + * Strategy for annotations + * + * @opensearch.internal + */ interface AnnotationStrategy { Annotation getAnnotation(); diff --git a/server/src/main/java/org/opensearch/common/inject/TypeLiteral.java b/server/src/main/java/org/opensearch/common/inject/TypeLiteral.java index 48b33d9df5f09..f0cca2990b407 100644 --- a/server/src/main/java/org/opensearch/common/inject/TypeLiteral.java +++ b/server/src/main/java/org/opensearch/common/inject/TypeLiteral.java @@ -270,6 +270,8 @@ Type resolveType(Type toResolve) { * * @param supertype a superclass of, or interface implemented by, this. * @since 2.0 + * + * @opensearch.internal */ public TypeLiteral getSupertype(Class supertype) { if (!supertype.isAssignableFrom(rawType)) { diff --git a/server/src/main/java/org/opensearch/common/inject/internal/MoreTypes.java b/server/src/main/java/org/opensearch/common/inject/internal/MoreTypes.java index 5ccdc0c59908e..6b9feedc9174e 100644 --- a/server/src/main/java/org/opensearch/common/inject/internal/MoreTypes.java +++ b/server/src/main/java/org/opensearch/common/inject/internal/MoreTypes.java @@ -677,6 +677,8 @@ public String toString() { /** * A type formed from other types, such as arrays, parameterized types or wildcard types + * + * @opensearch.internal */ private interface CompositeType { /** diff --git a/server/src/main/java/org/opensearch/common/inject/spi/InjectionPoint.java b/server/src/main/java/org/opensearch/common/inject/spi/InjectionPoint.java index 387f9ba0f3f6c..c88b2281107ed 100644 --- a/server/src/main/java/org/opensearch/common/inject/spi/InjectionPoint.java +++ b/server/src/main/java/org/opensearch/common/inject/spi/InjectionPoint.java @@ -406,6 +406,11 @@ private static boolean isStatic(Member member) { return Modifier.isStatic(member.getModifiers()); } + /** + * Factory for the injection point + * + * @opensearch.internal + */ private interface Factory { Factory FIELDS = new Factory() { @Override diff --git a/server/src/main/java/org/opensearch/common/inject/util/Modules.java b/server/src/main/java/org/opensearch/common/inject/util/Modules.java index ff2f2e7d0dac1..ae37cb3d29a68 100644 --- a/server/src/main/java/org/opensearch/common/inject/util/Modules.java +++ b/server/src/main/java/org/opensearch/common/inject/util/Modules.java @@ -130,6 +130,8 @@ public void configure(Binder binder) { /** * See the EDSL example at {@link Modules#override(Module[]) override()}. + * + * @opensearch.internal */ public interface OverriddenModuleBuilder { diff --git a/server/src/main/java/org/opensearch/common/logging/DeprecationLogger.java b/server/src/main/java/org/opensearch/common/logging/DeprecationLogger.java index 57e222680ce41..98b4ebbc330da 100644 --- a/server/src/main/java/org/opensearch/common/logging/DeprecationLogger.java +++ b/server/src/main/java/org/opensearch/common/logging/DeprecationLogger.java @@ -105,6 +105,11 @@ public DeprecationLoggerBuilder deprecate(final String key, final String msg, fi return new DeprecationLoggerBuilder().withDeprecation(key, msg, params); } + /** + * The builder for the deprecation logger + * + * @opensearch.internal + */ public class DeprecationLoggerBuilder { public DeprecationLoggerBuilder withDeprecation(String key, String msg, Object[] params) { diff --git a/server/src/main/java/org/opensearch/common/lucene/search/function/FieldValueFactorFunction.java b/server/src/main/java/org/opensearch/common/lucene/search/function/FieldValueFactorFunction.java index 3a21246da06c0..f60fd16a488a1 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/function/FieldValueFactorFunction.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/function/FieldValueFactorFunction.java @@ -176,6 +176,8 @@ protected int doHashCode() { /** * The Type class encapsulates the modification types that can be applied * to the score/value product. + * + * @opensearch.internal */ public enum Modifier implements Writeable { NONE { diff --git a/server/src/main/java/org/opensearch/common/lucene/search/function/FunctionScoreQuery.java b/server/src/main/java/org/opensearch/common/lucene/search/function/FunctionScoreQuery.java index e52f77bf49216..66ac66b004697 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/function/FunctionScoreQuery.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/function/FunctionScoreQuery.java @@ -141,6 +141,11 @@ public float getWeight() { } } + /** + * The mode of the score + * + * @opensearch.internal + */ public enum ScoreMode implements Writeable { FIRST, AVG, diff --git a/server/src/main/java/org/opensearch/common/network/NetworkService.java b/server/src/main/java/org/opensearch/common/network/NetworkService.java index 6a630dceadc18..e50c71af4f483 100644 --- a/server/src/main/java/org/opensearch/common/network/NetworkService.java +++ b/server/src/main/java/org/opensearch/common/network/NetworkService.java @@ -113,6 +113,8 @@ public final class NetworkService { /** * A custom name resolver can support custom lookup keys (my_net_key:ipv4) and also change * the default inet address used in case no settings is provided. + * + * @opensearch.internal */ public interface CustomNameResolver { /** diff --git a/server/src/main/java/org/opensearch/common/path/PathTrie.java b/server/src/main/java/org/opensearch/common/path/PathTrie.java index 360da4c58bda9..7cb7b46acfafe 100644 --- a/server/src/main/java/org/opensearch/common/path/PathTrie.java +++ b/server/src/main/java/org/opensearch/common/path/PathTrie.java @@ -77,6 +77,11 @@ enum TrieMatchingMode { TrieMatchingMode.WILDCARD_ROOT_NODES_ALLOWED ); + /** + * Decoder for the path + * + * @opensearch.internal + */ public interface Decoder { String decode(String value); } @@ -93,6 +98,11 @@ public PathTrie(Decoder decoder) { root = new TrieNode(SEPARATOR, null, WILDCARD); } + /** + * Node for the trie + * + * @opensearch.internal + */ public class TrieNode { private transient String key; private transient T value; diff --git a/server/src/main/java/org/opensearch/common/recycler/Recycler.java b/server/src/main/java/org/opensearch/common/recycler/Recycler.java index 0c9127bf3ebde..0b0c98772a77c 100644 --- a/server/src/main/java/org/opensearch/common/recycler/Recycler.java +++ b/server/src/main/java/org/opensearch/common/recycler/Recycler.java @@ -42,10 +42,20 @@ */ public interface Recycler { + /** + * Base factory interface + * + * @opensearch.internal + */ interface Factory { Recycler build(); } + /** + * Generic for recycler + * + * @opensearch.internal + */ interface C { /** Create a new empty instance of the given size. */ @@ -58,6 +68,11 @@ interface C { void destroy(T value); } + /** + * Generic releasable + * + * @opensearch.internal + */ interface V extends Releasable { /** Reference to the value. */ diff --git a/server/src/main/java/org/opensearch/common/settings/AbstractScopedSettings.java b/server/src/main/java/org/opensearch/common/settings/AbstractScopedSettings.java index 640e8cbca469a..a75d4f035b790 100644 --- a/server/src/main/java/org/opensearch/common/settings/AbstractScopedSettings.java +++ b/server/src/main/java/org/opensearch/common/settings/AbstractScopedSettings.java @@ -631,6 +631,8 @@ void validate( * Transactional interface to update settings. * @see Setting * @param the type of the value of the setting + * + * @opensearch.internal */ public interface SettingUpdater { diff --git a/server/src/main/java/org/opensearch/common/settings/PropertyPlaceholder.java b/server/src/main/java/org/opensearch/common/settings/PropertyPlaceholder.java index ae5875cc8aaa0..76b5642949e03 100644 --- a/server/src/main/java/org/opensearch/common/settings/PropertyPlaceholder.java +++ b/server/src/main/java/org/opensearch/common/settings/PropertyPlaceholder.java @@ -162,6 +162,8 @@ private int findPlaceholderEndIndex(CharSequence buf, int startIndex) { * Strategy interface used to resolve replacement values for placeholders contained in Strings. * * @see PropertyPlaceholder + * + * @opensearch.internal */ interface PlaceholderResolver { diff --git a/server/src/main/java/org/opensearch/common/settings/Setting.java b/server/src/main/java/org/opensearch/common/settings/Setting.java index 39cf0b9a4f32d..f86fe6771dfcd 100644 --- a/server/src/main/java/org/opensearch/common/settings/Setting.java +++ b/server/src/main/java/org/opensearch/common/settings/Setting.java @@ -102,6 +102,11 @@ */ public class Setting implements ToXContentObject { + /** + * Property of the setting + * + * @opensearch.internal + */ public enum Property { /** * should be filtered in some api (mask password/credentials) @@ -620,6 +625,8 @@ public Setting getConcreteSetting(String key) { /** * Allows a setting to declare a dependency on another setting being set. Optionally, a setting can validate the value of the dependent * setting. + * + * @opensearch.internal */ public interface SettingDependency { @@ -767,6 +774,8 @@ public String toString() { /** * Allows an affix setting to declare a dependency on another affix setting. + * + * @opensearch.internal */ public interface AffixSettingDependency extends SettingDependency { @@ -1007,6 +1016,8 @@ public Map getAsMap(Settings settings) { * {@link #settings()}} to their values. All these values come from the same {@link Settings} instance. * * @param the type of the {@link Setting} + * + * @opensearch.internal */ @FunctionalInterface public interface Validator { @@ -2247,6 +2258,11 @@ private static AffixSetting affixKeySetting( return new AffixSetting<>(key, delegate, delegateFactory, dependencies); } + /** + * Key for the setting + * + * @opensearch.internal + */ public interface Key { boolean match(String key); } @@ -2287,6 +2303,11 @@ public int hashCode() { } } + /** + * Settings Group keys + * + * @opensearch.internal + */ public static final class GroupKey extends SimpleKey { public GroupKey(String key) { super(key); @@ -2301,6 +2322,11 @@ public boolean match(String toTest) { } } + /** + * List settings key + * + * @opensearch.internal + */ public static final class ListKey extends SimpleKey { private final Pattern pattern; @@ -2318,6 +2344,8 @@ public boolean match(String toTest) { /** * A key that allows for static pre and suffix. This is used for settings * that have dynamic namespaces like for different accounts etc. + * + * @opensearch.internal */ public static final class AffixKey implements Key { private final Pattern pattern; diff --git a/server/src/main/java/org/opensearch/common/transport/PortsRange.java b/server/src/main/java/org/opensearch/common/transport/PortsRange.java index c3ab5084e6e01..30ab5e355f090 100644 --- a/server/src/main/java/org/opensearch/common/transport/PortsRange.java +++ b/server/src/main/java/org/opensearch/common/transport/PortsRange.java @@ -94,6 +94,11 @@ public boolean iterate(PortCallback callback) throws NumberFormatException { return success; } + /** + * Callback for the port + * + * @opensearch.internal + */ public interface PortCallback { boolean onPortNumber(int portNumber); } diff --git a/server/src/main/java/org/opensearch/common/util/CancellableThreads.java b/server/src/main/java/org/opensearch/common/util/CancellableThreads.java index d52d717865dbf..bb9ae9502f746 100644 --- a/server/src/main/java/org/opensearch/common/util/CancellableThreads.java +++ b/server/src/main/java/org/opensearch/common/util/CancellableThreads.java @@ -180,10 +180,20 @@ public synchronized void cancel(String reason) { threads.clear(); } + /** + * Interruptible interface + * + * @opensearch.internal + */ public interface Interruptible extends IOInterruptible { void run() throws InterruptedException; } + /** + * IO Interruptible + * + * @opensearch.internal + */ public interface IOInterruptible { void run() throws IOException, InterruptedException; } @@ -211,6 +221,11 @@ public synchronized void setOnCancel(OnCancel onCancel) { this.onCancel.set(onCancel); } + /** + * Called when a thread is cancelled + * + * @opensearch.internal + */ @FunctionalInterface public interface OnCancel { /** diff --git a/server/src/main/java/org/opensearch/common/util/LongObjectPagedHashMap.java b/server/src/main/java/org/opensearch/common/util/LongObjectPagedHashMap.java index 9b8f9621fb9c1..9d654e96779bf 100644 --- a/server/src/main/java/org/opensearch/common/util/LongObjectPagedHashMap.java +++ b/server/src/main/java/org/opensearch/common/util/LongObjectPagedHashMap.java @@ -202,6 +202,11 @@ protected void removeAndAdd(long index) { assert removed == null; } + /** + * Cursor for the map + * + * @opensearch.internal + */ public static final class Cursor { public long index; public long key; diff --git a/server/src/main/java/org/opensearch/common/util/PageCacheRecycler.java b/server/src/main/java/org/opensearch/common/util/PageCacheRecycler.java index d0f660b9ac445..6d786e85bab1c 100644 --- a/server/src/main/java/org/opensearch/common/util/PageCacheRecycler.java +++ b/server/src/main/java/org/opensearch/common/util/PageCacheRecycler.java @@ -231,6 +231,11 @@ private static Recycler build(Type type, int limit, int availableProcesso return recycler; } + /** + * Type of the page cache recycler + * + * @opensearch.internal + */ public enum Type { QUEUE { @Override diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchThreadPoolExecutor.java b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchThreadPoolExecutor.java index 2ebf8a1cc970c..7fda911fe7959 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchThreadPoolExecutor.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchThreadPoolExecutor.java @@ -114,6 +114,11 @@ protected synchronized void terminated() { } } + /** + * Listener on shut down + * + * @opensearch.internal + */ public interface ShutdownListener { void onTerminated(); } diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContext.java b/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContext.java index 02a3b24e028a8..5e2381c949c00 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContext.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContext.java @@ -486,6 +486,11 @@ public boolean isSystemContext() { return threadLocal.get().isSystemContext; } + /** + * A stored context + * + * @opensearch.internal + */ @FunctionalInterface public interface StoredContext extends AutoCloseable { @Override diff --git a/server/src/main/java/org/opensearch/discovery/PeerFinder.java b/server/src/main/java/org/opensearch/discovery/PeerFinder.java index 45b21b1eaa5da..03cdc4ba68cc9 100644 --- a/server/src/main/java/org/opensearch/discovery/PeerFinder.java +++ b/server/src/main/java/org/opensearch/discovery/PeerFinder.java @@ -228,6 +228,11 @@ public List getLastResolvedAddresses() { return lastResolvedAddresses; } + /** + * Transport address connector interface. + * + * @opensearch.internal + */ public interface TransportAddressConnector { /** * Identify the node at the given address and, if it is a cluster-manager node and not the local node then establish a full connection to it. @@ -235,6 +240,11 @@ public interface TransportAddressConnector { void connectToRemoteMasterNode(TransportAddress transportAddress, ActionListener listener); } + /** + * Resolves the configured unicast host. + * + * @opensearch.internal + */ public interface ConfiguredHostsResolver { /** * Attempt to resolve the configured unicast hosts list to a list of transport addresses. diff --git a/server/src/main/java/org/opensearch/env/NodeEnvironment.java b/server/src/main/java/org/opensearch/env/NodeEnvironment.java index 54bd376371b86..3da2cce8a2620 100644 --- a/server/src/main/java/org/opensearch/env/NodeEnvironment.java +++ b/server/src/main/java/org/opensearch/env/NodeEnvironment.java @@ -111,6 +111,11 @@ * @opensearch.internal */ public final class NodeEnvironment implements Closeable { + /** + * A node path. + * + * @opensearch.internal + */ public static class NodePath { /* ${data.paths}/nodes/{node.id} */ public final Path path; @@ -214,6 +219,11 @@ public String toString() { public static final String INDICES_FOLDER = "indices"; public static final String NODE_LOCK_FILENAME = "node.lock"; + /** + * The node lock. + * + * @opensearch.internal + */ public static class NodeLock implements Releasable { private final int nodeId; diff --git a/server/src/main/java/org/opensearch/gateway/Gateway.java b/server/src/main/java/org/opensearch/gateway/Gateway.java index 1891c5020015c..f46f4317c83e1 100644 --- a/server/src/main/java/org/opensearch/gateway/Gateway.java +++ b/server/src/main/java/org/opensearch/gateway/Gateway.java @@ -144,6 +144,11 @@ public void performStateRecovery(final GatewayStateRecoveredListener listener) t listener.onSuccess(recoveredState); } + /** + * The lister for state recovered. + * + * @opensearch.internal + */ public interface GatewayStateRecoveredListener { void onSuccess(ClusterState build); diff --git a/server/src/main/java/org/opensearch/gateway/LocalAllocateDangledIndices.java b/server/src/main/java/org/opensearch/gateway/LocalAllocateDangledIndices.java index c100bbb9a7406..fe0eacc244f32 100644 --- a/server/src/main/java/org/opensearch/gateway/LocalAllocateDangledIndices.java +++ b/server/src/main/java/org/opensearch/gateway/LocalAllocateDangledIndices.java @@ -266,6 +266,12 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS } } + /** + * The request. + * + * @opensearch.internal + */ + public static class AllocateDangledRequest extends TransportRequest { DiscoveryNode fromNode; @@ -290,6 +296,11 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * The response. + * + * @opensearch.internal + */ public static class AllocateDangledResponse extends TransportResponse { private boolean ack; diff --git a/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java b/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java index c3581265945b1..ea77e4ae5f13b 100644 --- a/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java +++ b/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java @@ -268,6 +268,11 @@ public Path[] getDataPaths() { return dataPaths; } + /** + * The on disk state. + * + * @opensearch.internal + */ public static class OnDiskState { private static final OnDiskState NO_ON_DISK_STATE = new OnDiskState(null, null, 0L, 0L, Metadata.EMPTY_METADATA); @@ -585,6 +590,11 @@ public void close() throws IOException { } } + /** + * Writer for cluster state service + * + * @opensearch.internal + */ public static class Writer implements Closeable { private final List metadataIndexWriters; diff --git a/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayMetaState.java b/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayMetaState.java index ce9af1a7dd748..be914c6a40a83 100644 --- a/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayMetaState.java +++ b/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayMetaState.java @@ -121,6 +121,11 @@ protected NodeGatewayMetaState nodeOperation(NodeRequest request) { return new NodeGatewayMetaState(clusterService.localNode(), metaState.getMetadata()); } + /** + * The request. + * + * @opensearch.internal + */ public static class Request extends BaseNodesRequest { public Request(StreamInput in) throws IOException { @@ -132,6 +137,11 @@ public Request(String... nodesIds) { } } + /** + * The nodes gateway metastate. + * + * @opensearch.internal + */ public static class NodesGatewayMetaState extends BaseNodesResponse { public NodesGatewayMetaState(StreamInput in) throws IOException { @@ -153,6 +163,11 @@ protected void writeNodesTo(StreamOutput out, List nodes) } } + /** + * The node request. + * + * @opensearch.internal + */ public static class NodeRequest extends BaseNodeRequest { NodeRequest() {} @@ -161,6 +176,11 @@ public static class NodeRequest extends BaseNodeRequest { } } + /** + * The node gateway metastate. + * + * @opensearch.internal + */ public static class NodeGatewayMetaState extends BaseNodeResponse { private Metadata metadata; diff --git a/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShards.java b/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShards.java index 11a2c8370ae7b..78b4fa287ef59 100644 --- a/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShards.java +++ b/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShards.java @@ -211,6 +211,11 @@ protected NodeGatewayStartedShards nodeOperation(NodeRequest request) { } } + /** + * The nodes request. + * + * @opensearch.internal + */ public static class Request extends BaseNodesRequest { private final ShardId shardId; @@ -257,6 +262,11 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * The nodes response. + * + * @opensearch.internal + */ public static class NodesGatewayStartedShards extends BaseNodesResponse { public NodesGatewayStartedShards(StreamInput in) throws IOException { @@ -282,6 +292,11 @@ protected void writeNodesTo(StreamOutput out, List nod } } + /** + * The request. + * + * @opensearch.internal + */ public static class NodeRequest extends BaseNodeRequest { private final ShardId shardId; @@ -328,6 +343,11 @@ public String getCustomDataPath() { } } + /** + * The response. + * + * @opensearch.internal + */ public static class NodeGatewayStartedShards extends BaseNodeResponse { private final String allocationId; diff --git a/server/src/main/java/org/opensearch/ingest/DropProcessor.java b/server/src/main/java/org/opensearch/ingest/DropProcessor.java index b3110755fa2d2..44aee29c7b4a6 100644 --- a/server/src/main/java/org/opensearch/ingest/DropProcessor.java +++ b/server/src/main/java/org/opensearch/ingest/DropProcessor.java @@ -58,6 +58,11 @@ public String getType() { return TYPE; } + /** + * A factory for the processor. + * + * @opensearch.internal + */ public static final class Factory implements Processor.Factory { @Override diff --git a/server/src/main/java/org/opensearch/ingest/IngestDocument.java b/server/src/main/java/org/opensearch/ingest/IngestDocument.java index e1759342da7ef..ecc5758299e42 100644 --- a/server/src/main/java/org/opensearch/ingest/IngestDocument.java +++ b/server/src/main/java/org/opensearch/ingest/IngestDocument.java @@ -845,6 +845,11 @@ public String toString() { return "IngestDocument{" + " sourceAndMetadata=" + sourceAndMetadata + ", ingestMetadata=" + ingestMetadata + '}'; } + /** + * The ingest metadata. + * + * @opensearch.internal + */ public enum Metadata { INDEX(IndexFieldMapper.NAME), ID(IdFieldMapper.NAME), diff --git a/server/src/main/java/org/opensearch/ingest/IngestStats.java b/server/src/main/java/org/opensearch/ingest/IngestStats.java index 115ae66113462..1f31e7931786d 100644 --- a/server/src/main/java/org/opensearch/ingest/IngestStats.java +++ b/server/src/main/java/org/opensearch/ingest/IngestStats.java @@ -180,6 +180,11 @@ public int hashCode() { return Objects.hash(totalStats, pipelineStats, processorStats); } + /** + * The ingest statistics. + * + * @opensearch.internal + */ public static class Stats implements Writeable, ToXContentFragment { private final long ingestCount; diff --git a/server/src/main/java/org/opensearch/ingest/PipelineProcessor.java b/server/src/main/java/org/opensearch/ingest/PipelineProcessor.java index 62226ef7682cb..300b9824b277a 100644 --- a/server/src/main/java/org/opensearch/ingest/PipelineProcessor.java +++ b/server/src/main/java/org/opensearch/ingest/PipelineProcessor.java @@ -91,6 +91,11 @@ TemplateScript.Factory getPipelineTemplate() { return pipelineTemplate; } + /** + * Factory for the processor. + * + * @opensearch.internal + */ public static final class Factory implements Processor.Factory { private final IngestService ingestService; diff --git a/server/src/main/java/org/opensearch/ingest/ValueSource.java b/server/src/main/java/org/opensearch/ingest/ValueSource.java index fefa535797e27..0ef7c3373596d 100644 --- a/server/src/main/java/org/opensearch/ingest/ValueSource.java +++ b/server/src/main/java/org/opensearch/ingest/ValueSource.java @@ -101,6 +101,11 @@ static ValueSource wrap(Object value, ScriptService scriptService) { } } + /** + * A map value source. + * + * @opensearch.internal + */ final class MapValue implements ValueSource { private final Map map; @@ -134,6 +139,11 @@ public int hashCode() { } } + /** + * A list value source. + * + * @opensearch.internal + */ final class ListValue implements ValueSource { private final List values; @@ -167,6 +177,11 @@ public int hashCode() { } } + /** + * An object value source. + * + * @opensearch.internal + */ final class ObjectValue implements ValueSource { private final Object value; @@ -195,6 +210,11 @@ public int hashCode() { } } + /** + * A byte value source. + * + * @opensearch.internal + */ final class ByteValue implements ValueSource { private final byte[] value; @@ -224,6 +244,11 @@ public int hashCode() { } + /** + * A templated value. + * + * @opensearch.internal + */ final class TemplatedValue implements ValueSource { private final TemplateScript.Factory template; diff --git a/server/src/main/java/org/opensearch/monitor/StatusInfo.java b/server/src/main/java/org/opensearch/monitor/StatusInfo.java index fdb8bc9469b6a..d6f8aa060385d 100644 --- a/server/src/main/java/org/opensearch/monitor/StatusInfo.java +++ b/server/src/main/java/org/opensearch/monitor/StatusInfo.java @@ -40,6 +40,11 @@ */ public class StatusInfo { + /** + * The status. + * + * @opensearch.internal + */ public enum Status { HEALTHY, UNHEALTHY diff --git a/server/src/main/java/org/opensearch/monitor/fs/FsInfo.java b/server/src/main/java/org/opensearch/monitor/fs/FsInfo.java index f28bdbfa916a2..f2a117cbc76a2 100644 --- a/server/src/main/java/org/opensearch/monitor/fs/FsInfo.java +++ b/server/src/main/java/org/opensearch/monitor/fs/FsInfo.java @@ -56,6 +56,11 @@ */ public class FsInfo implements Iterable, Writeable, ToXContentFragment { + /** + * Path for the file system + * + * @opensearch.internal + */ public static class Path implements Writeable, ToXContentObject { String path; @@ -183,6 +188,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } + /** + * The device status. + * + * @opensearch.internal + */ public static class DeviceStats implements Writeable, ToXContentFragment { final int majorDeviceNumber; @@ -320,6 +330,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } + /** + * The I/O statistics. + * + * @opensearch.internal + */ public static class IoStats implements Writeable, ToXContentFragment { private static final String OPERATIONS = "operations"; diff --git a/server/src/main/java/org/opensearch/monitor/jvm/DeadlockAnalyzer.java b/server/src/main/java/org/opensearch/monitor/jvm/DeadlockAnalyzer.java index 6751c52a0a536..12d749a2b9102 100644 --- a/server/src/main/java/org/opensearch/monitor/jvm/DeadlockAnalyzer.java +++ b/server/src/main/java/org/opensearch/monitor/jvm/DeadlockAnalyzer.java @@ -140,6 +140,11 @@ private Map createThreadInfoMap(long threadIds[]) { return unmodifiableMap(threadInfoMap); } + /** + * The deadlock being analyzed. + * + * @opensearch.internal + */ public static class Deadlock { private final ThreadInfo members[]; private final String description; diff --git a/server/src/main/java/org/opensearch/monitor/jvm/JvmInfo.java b/server/src/main/java/org/opensearch/monitor/jvm/JvmInfo.java index 31f597ebebcc8..819d67cb8621a 100644 --- a/server/src/main/java/org/opensearch/monitor/jvm/JvmInfo.java +++ b/server/src/main/java/org/opensearch/monitor/jvm/JvmInfo.java @@ -599,6 +599,11 @@ static final class Fields { static final String INPUT_ARGUMENTS = "input_arguments"; } + /** + * Memory information. + * + * @opensearch.internal + */ public static class Mem implements Writeable { private final long heapInit; diff --git a/server/src/main/java/org/opensearch/monitor/jvm/JvmStats.java b/server/src/main/java/org/opensearch/monitor/jvm/JvmStats.java index 0924adb4e8114..172ab8aae4ccd 100644 --- a/server/src/main/java/org/opensearch/monitor/jvm/JvmStats.java +++ b/server/src/main/java/org/opensearch/monitor/jvm/JvmStats.java @@ -371,6 +371,11 @@ static final class Fields { static final String TOTAL_UNLOADED_COUNT = "total_unloaded_count"; } + /** + * Garbage collector references. + * + * @opensearch.internal + */ public static class GarbageCollectors implements Writeable, Iterable { private final GarbageCollector[] collectors; @@ -398,6 +403,11 @@ public Iterator iterator() { } } + /** + * The garbage collector. + * + * @opensearch.internal + */ public static class GarbageCollector implements Writeable { private final String name; @@ -436,6 +446,11 @@ public TimeValue getCollectionTime() { } } + /** + * Thread information. + * + * @opensearch.internal + */ public static class Threads implements Writeable { private final int count; @@ -470,6 +485,8 @@ public int getPeakCount() { * Stores the memory usage after the Java virtual machine * most recently expended effort in recycling unused objects * in particular memory pool. + * + * @opensearch.internal */ public static class MemoryPoolGcStats implements Writeable { @@ -508,6 +525,11 @@ public short getUsagePercent() { } } + /** + * A memory pool. + * + * @opensearch.internal + */ public static class MemoryPool implements Writeable { private final String name; @@ -579,6 +601,11 @@ public MemoryPoolGcStats getLastGcStats() { } } + /** + * Memory data. + * + * @opensearch.internal + */ public static class Mem implements Writeable, Iterable { private final long heapCommitted; @@ -655,6 +682,11 @@ public ByteSizeValue getNonHeapUsed() { } } + /** + * A buffer pool. + * + * @opensearch.internal + */ public static class BufferPool implements Writeable { private final String name; @@ -701,6 +733,11 @@ public ByteSizeValue getUsed() { } } + /** + * Class information. + * + * @opensearch.internal + */ public static class Classes implements Writeable { private final long loadedClassCount; diff --git a/server/src/main/java/org/opensearch/monitor/os/OsStats.java b/server/src/main/java/org/opensearch/monitor/os/OsStats.java index e05fb56ba5570..9f3a83f677540 100644 --- a/server/src/main/java/org/opensearch/monitor/os/OsStats.java +++ b/server/src/main/java/org/opensearch/monitor/os/OsStats.java @@ -140,6 +140,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * CPU Information. + * + * @opensearch.internal + */ public static class Cpu implements Writeable, ToXContentFragment { private final short percent; @@ -200,6 +205,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } + /** + * Swap information. + * + * @opensearch.internal + */ public static class Swap implements Writeable, ToXContentFragment { private static final Logger logger = LogManager.getLogger(Swap.class); @@ -263,6 +273,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } + /** + * OS Memory information. + * + * @opensearch.internal + */ public static class Mem implements Writeable, ToXContentFragment { private static final Logger logger = LogManager.getLogger(Mem.class); @@ -337,6 +352,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws /** * Encapsulates basic cgroup statistics. + * + * @opensearch.internal */ public static class Cgroup implements Writeable, ToXContentFragment { @@ -528,6 +545,8 @@ public XContentBuilder toXContent(final XContentBuilder builder, final Params pa /** * Encapsulates CPU time statistics. + * + * @opensearch.internal */ public static class CpuStat implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/monitor/process/ProcessStats.java b/server/src/main/java/org/opensearch/monitor/process/ProcessStats.java index e5ed6a4a7d369..874b32a74c912 100644 --- a/server/src/main/java/org/opensearch/monitor/process/ProcessStats.java +++ b/server/src/main/java/org/opensearch/monitor/process/ProcessStats.java @@ -138,6 +138,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Process memory information. + * + * @opensearch.internal + */ public static class Mem implements Writeable { private final long totalVirtual; @@ -160,6 +165,11 @@ public ByteSizeValue getTotalVirtual() { } } + /** + * Process CPU information. + * + * @opensearch.internal + */ public static class Cpu implements Writeable { private final short percent; diff --git a/server/src/main/java/org/opensearch/node/Node.java b/server/src/main/java/org/opensearch/node/Node.java index c09bdc11693c4..7e205b88e9eb1 100644 --- a/server/src/main/java/org/opensearch/node/Node.java +++ b/server/src/main/java/org/opensearch/node/Node.java @@ -297,6 +297,11 @@ public class Node implements Closeable { private static final String CLIENT_TYPE = "node"; + /** + * The discovery settings for the node. + * + * @opensearch.internal + */ public static class DiscoverySettings { public static final Setting INITIAL_STATE_TIMEOUT_SETTING = Setting.positiveTimeSetting( "discovery.initial_state_timeout", diff --git a/server/src/main/java/org/opensearch/node/ReportingService.java b/server/src/main/java/org/opensearch/node/ReportingService.java index 97d4b2a1bafaa..eca52d5f0f3fc 100644 --- a/server/src/main/java/org/opensearch/node/ReportingService.java +++ b/server/src/main/java/org/opensearch/node/ReportingService.java @@ -43,6 +43,11 @@ public interface ReportingService { I info(); + /** + * Information interface. + * + * @opensearch.internal + */ interface Info extends Writeable, ToXContent { } diff --git a/server/src/main/java/org/opensearch/persistent/AllocatedPersistentTask.java b/server/src/main/java/org/opensearch/persistent/AllocatedPersistentTask.java index caede050df5a7..e5af66dd5054f 100644 --- a/server/src/main/java/org/opensearch/persistent/AllocatedPersistentTask.java +++ b/server/src/main/java/org/opensearch/persistent/AllocatedPersistentTask.java @@ -206,6 +206,11 @@ public void onFailure(Exception e) { } } + /** + * The state of the task. + * + * @opensearch.internal + */ public enum State { STARTED, // the task is currently running PENDING_CANCEL, // the task is cancelled on master, cancelling it locally diff --git a/server/src/main/java/org/opensearch/persistent/CompletionPersistentTaskAction.java b/server/src/main/java/org/opensearch/persistent/CompletionPersistentTaskAction.java index 6ae3150a04019..69f6c7ca6c233 100644 --- a/server/src/main/java/org/opensearch/persistent/CompletionPersistentTaskAction.java +++ b/server/src/main/java/org/opensearch/persistent/CompletionPersistentTaskAction.java @@ -70,6 +70,11 @@ private CompletionPersistentTaskAction() { super(NAME, PersistentTaskResponse::new); } + /** + * The request. + * + * @opensearch.internal + */ public static class Request extends MasterNodeRequest { private String taskId; @@ -129,6 +134,11 @@ public int hashCode() { } } + /** + * The request bulder. + * + * @opensearch.internal + */ public static class RequestBuilder extends MasterNodeOperationRequestBuilder< CompletionPersistentTaskAction.Request, PersistentTaskResponse, @@ -139,6 +149,11 @@ protected RequestBuilder(OpenSearchClient client, CompletionPersistentTaskAction } } + /** + * The transport action. + * + * @opensearch.internal + */ public static class TransportAction extends TransportMasterNodeAction { private final PersistentTasksClusterService persistentTasksClusterService; diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTasksCustomMetadata.java b/server/src/main/java/org/opensearch/persistent/PersistentTasksCustomMetadata.java index ac6536564d8d0..19d75355c8d04 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTasksCustomMetadata.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTasksCustomMetadata.java @@ -276,6 +276,12 @@ public static ClusterState disassociateDeadNodes(ClusterState clusterState) { return ClusterState.builder(clusterState).metadata(metadataBuilder).build(); } + /** + * The assignment. + * + * @opensearch.internal + */ + public static class Assignment { @Nullable private final String executorNode; @@ -598,6 +604,11 @@ public static Builder builder(PersistentTasksCustomMetadata tasks) { return new Builder(tasks); } + /** + * The task builder. + * + * @opensearch.internal + */ public static class Builder { private final Map> tasks = new HashMap<>(); private long lastAllocationId; diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTasksNodeService.java b/server/src/main/java/org/opensearch/persistent/PersistentTasksNodeService.java index 54ffadb96243a..34fe90ef58d36 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTasksNodeService.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTasksNodeService.java @@ -324,6 +324,11 @@ public void onFailure(Exception e) { } } + /** + * The executor status. + * + * @opensearch.internal + */ public static class Status implements Task.Status { public static final String NAME = "persistent_executor"; diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTasksService.java b/server/src/main/java/org/opensearch/persistent/PersistentTasksService.java index 1026be4ad8161..224943ce8ce38 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTasksService.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTasksService.java @@ -245,6 +245,11 @@ public void onTimeout(TimeValue timeout) { } } + /** + * Interface for a class that waits and listens for a persistent task. + * + * @opensearch.internal + */ public interface WaitForPersistentTaskListener

extends ActionListener> { default void onTimeout(TimeValue timeout) { onFailure(new IllegalStateException("Timed out when waiting for persistent task after " + timeout)); diff --git a/server/src/main/java/org/opensearch/persistent/RemovePersistentTaskAction.java b/server/src/main/java/org/opensearch/persistent/RemovePersistentTaskAction.java index 855e5b0099b29..4f706ac1c48fb 100644 --- a/server/src/main/java/org/opensearch/persistent/RemovePersistentTaskAction.java +++ b/server/src/main/java/org/opensearch/persistent/RemovePersistentTaskAction.java @@ -67,6 +67,11 @@ private RemovePersistentTaskAction() { super(NAME, PersistentTaskResponse::new); } + /** + * The request. + * + * @opensearch.internal + */ public static class Request extends MasterNodeRequest { private String taskId; @@ -111,6 +116,11 @@ public int hashCode() { } } + /** + * The request builder. + * + * @opensearch.internal + */ public static class RequestBuilder extends MasterNodeOperationRequestBuilder< RemovePersistentTaskAction.Request, PersistentTaskResponse, @@ -127,6 +137,11 @@ public final RequestBuilder setTaskId(String taskId) { } + /** + * The transport action. + * + * @opensearch.internal + */ public static class TransportAction extends TransportMasterNodeAction { private final PersistentTasksClusterService persistentTasksClusterService; diff --git a/server/src/main/java/org/opensearch/persistent/StartPersistentTaskAction.java b/server/src/main/java/org/opensearch/persistent/StartPersistentTaskAction.java index 2bd822d2fab62..122313e6a8ebf 100644 --- a/server/src/main/java/org/opensearch/persistent/StartPersistentTaskAction.java +++ b/server/src/main/java/org/opensearch/persistent/StartPersistentTaskAction.java @@ -70,6 +70,11 @@ private StartPersistentTaskAction() { super(NAME, PersistentTaskResponse::new); } + /** + * Request for the action. + * + * @opensearch.internal + */ public static class Request extends MasterNodeRequest { private String taskId; @@ -163,6 +168,11 @@ public void setParams(PersistentTaskParams params) { } + /** + * The request builder. + * + * @opensearch.internal + */ public static class RequestBuilder extends MasterNodeOperationRequestBuilder< StartPersistentTaskAction.Request, PersistentTaskResponse, @@ -189,6 +199,11 @@ public RequestBuilder setRequest(PersistentTaskParams params) { } + /** + * The transport action. + * + * @opensearch.internal + */ public static class TransportAction extends TransportMasterNodeAction { private final PersistentTasksClusterService persistentTasksClusterService; diff --git a/server/src/main/java/org/opensearch/persistent/UpdatePersistentTaskStatusAction.java b/server/src/main/java/org/opensearch/persistent/UpdatePersistentTaskStatusAction.java index 928e51f5a594c..5cbbcee937247 100644 --- a/server/src/main/java/org/opensearch/persistent/UpdatePersistentTaskStatusAction.java +++ b/server/src/main/java/org/opensearch/persistent/UpdatePersistentTaskStatusAction.java @@ -69,6 +69,11 @@ private UpdatePersistentTaskStatusAction() { super(NAME, PersistentTaskResponse::new); } + /** + * The action request. + * + * @opensearch.internal + */ public static class Request extends MasterNodeRequest { private String taskId; @@ -138,6 +143,11 @@ public int hashCode() { } } + /** + * The request builder. + * + * @opensearch.internal + */ public static class RequestBuilder extends MasterNodeOperationRequestBuilder< UpdatePersistentTaskStatusAction.Request, PersistentTaskResponse, @@ -158,6 +168,12 @@ public final RequestBuilder setState(PersistentTaskState state) { } } + /** + * The transport action. + * + * @opensearch.internal + */ + public static class TransportAction extends TransportMasterNodeAction { private final PersistentTasksClusterService persistentTasksClusterService; diff --git a/server/src/main/java/org/opensearch/persistent/decider/AssignmentDecision.java b/server/src/main/java/org/opensearch/persistent/decider/AssignmentDecision.java index 70a03b7710b6f..7b5840324b921 100644 --- a/server/src/main/java/org/opensearch/persistent/decider/AssignmentDecision.java +++ b/server/src/main/java/org/opensearch/persistent/decider/AssignmentDecision.java @@ -67,6 +67,11 @@ public String toString() { return "assignment decision [type=" + type + ", reason=" + reason + "]"; } + /** + * The decision. + * + * @opensearch.internal + */ public enum Type { NO(0), YES(1); diff --git a/server/src/main/java/org/opensearch/repositories/ShardGenerations.java b/server/src/main/java/org/opensearch/repositories/ShardGenerations.java index 5857ec537d1dc..27eac4dfdd8c1 100644 --- a/server/src/main/java/org/opensearch/repositories/ShardGenerations.java +++ b/server/src/main/java/org/opensearch/repositories/ShardGenerations.java @@ -195,6 +195,11 @@ public static Builder builder() { return new Builder(); } + /** + * Builder for the shard generations. + * + * @opensearch.internal + */ public static final class Builder { private final Map> generations = new HashMap<>(); diff --git a/server/src/main/java/org/opensearch/repositories/VerifyNodeRepositoryAction.java b/server/src/main/java/org/opensearch/repositories/VerifyNodeRepositoryAction.java index 6b8c44ed6d54c..98e8521ecff57 100644 --- a/server/src/main/java/org/opensearch/repositories/VerifyNodeRepositoryAction.java +++ b/server/src/main/java/org/opensearch/repositories/VerifyNodeRepositoryAction.java @@ -161,6 +161,11 @@ private void doVerify(String repositoryName, String verificationToken, Discovery repository.verify(verificationToken, localNode); } + /** + * Request to verify a node repository. + * + * @opensearch.internal + */ public static class VerifyNodeRepositoryRequest extends TransportRequest { private String repository; diff --git a/server/src/main/java/org/opensearch/rest/BaseRestHandler.java b/server/src/main/java/org/opensearch/rest/BaseRestHandler.java index 4519f2a3622b1..4b4c020b43e74 100644 --- a/server/src/main/java/org/opensearch/rest/BaseRestHandler.java +++ b/server/src/main/java/org/opensearch/rest/BaseRestHandler.java @@ -233,6 +233,11 @@ public static void parseDeprecatedMasterTimeoutParameter( } } + /** + * A wrapper for the base handler. + * + * @opensearch.internal + */ public static class Wrapper extends BaseRestHandler { protected final BaseRestHandler delegate; diff --git a/server/src/main/java/org/opensearch/rest/RestHandler.java b/server/src/main/java/org/opensearch/rest/RestHandler.java index 14f54d371632d..1350522c99a01 100644 --- a/server/src/main/java/org/opensearch/rest/RestHandler.java +++ b/server/src/main/java/org/opensearch/rest/RestHandler.java @@ -119,6 +119,11 @@ static RestHandler wrapper(RestHandler delegate) { return new Wrapper(delegate); } + /** + * Wrapper for a handler. + * + * @opensearch.internal + */ class Wrapper implements RestHandler { private final RestHandler delegate; @@ -172,6 +177,11 @@ public boolean allowSystemIndexAccessByDefault() { } } + /** + * Route for the request. + * + * @opensearch.internal + */ class Route { private final String path; diff --git a/server/src/main/java/org/opensearch/rest/RestRequest.java b/server/src/main/java/org/opensearch/rest/RestRequest.java index 65ba5b61eeddd..d44a4e3039543 100644 --- a/server/src/main/java/org/opensearch/rest/RestRequest.java +++ b/server/src/main/java/org/opensearch/rest/RestRequest.java @@ -228,6 +228,11 @@ public static RestRequest requestWithoutParameters( ); } + /** + * The method used. + * + * @opensearch.internal + */ public enum Method { GET, POST, @@ -583,6 +588,11 @@ public static XContentType parseContentType(List header) { throw new IllegalArgumentException("empty Content-Type header"); } + /** + * Thrown if there is an error in the content type header. + * + * @opensearch.internal + */ public static class ContentTypeHeaderException extends RuntimeException { ContentTypeHeaderException(final IllegalArgumentException cause) { @@ -591,6 +601,11 @@ public static class ContentTypeHeaderException extends RuntimeException { } + /** + * Thrown if there is a bad parameter. + * + * @opensearch.internal + */ public static class BadParameterException extends RuntimeException { BadParameterException(final IllegalArgumentException cause) { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAnalyzeAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAnalyzeAction.java index f61cf8ddbbd59..b9c165a033c64 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAnalyzeAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAnalyzeAction.java @@ -54,6 +54,11 @@ */ public class RestAnalyzeAction extends BaseRestHandler { + /** + * Fields for parsing and toXContent + * + * @opensearch.internal + */ public static class Fields { public static final ParseField ANALYZER = new ParseField("analyzer"); public static final ParseField TEXT = new ParseField("text"); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java index 50bd8c9d1aab4..e2348aa04f07a 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java @@ -102,6 +102,11 @@ public final RestChannelConsumer prepareRequest(final RestRequest request, final return channel -> client.admin().indices().resizeIndex(resizeRequest, new RestToXContentListener<>(channel)); } + /** + * Shrink index action. + * + * @opensearch.internal + */ public static class RestShrinkIndexAction extends RestResizeHandler { @Override @@ -121,6 +126,11 @@ protected ResizeType getResizeType() { } + /** + * Split index action. + * + * @opensearch.internal + */ public static class RestSplitIndexAction extends RestResizeHandler { @Override @@ -140,6 +150,11 @@ protected ResizeType getResizeType() { } + /** + * Clone index action. + * + * @opensearch.internal + */ public static class RestCloneIndexAction extends RestResizeHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/document/RestIndexAction.java b/server/src/main/java/org/opensearch/rest/action/document/RestIndexAction.java index ba3558f6fe80c..e7b1da91aba8f 100644 --- a/server/src/main/java/org/opensearch/rest/action/document/RestIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/document/RestIndexAction.java @@ -71,6 +71,11 @@ public String getName() { return "document_index_action"; } + /** + * Create handler action. + * + * @opensearch.internal + */ public static final class CreateHandler extends RestIndexAction { @Override @@ -97,6 +102,11 @@ void validateOpType(String opType) { } } + /** + * The auto id handler. + * + * @opensearch.internal + */ public static final class AutoIdHandler extends RestIndexAction { private final Supplier nodesInCluster; diff --git a/server/src/main/java/org/opensearch/script/AggregationScript.java b/server/src/main/java/org/opensearch/script/AggregationScript.java index 84dd308a9088d..4c9d6060ddbfd 100644 --- a/server/src/main/java/org/opensearch/script/AggregationScript.java +++ b/server/src/main/java/org/opensearch/script/AggregationScript.java @@ -167,6 +167,8 @@ public double runAsDouble() { /** * A factory to construct {@link AggregationScript} instances. + * + * @opensearch.internal */ public interface LeafFactory { AggregationScript newInstance(LeafReaderContext ctx) throws IOException; @@ -179,6 +181,8 @@ public interface LeafFactory { /** * A factory to construct stateful {@link AggregationScript} factories for a specific index. + * + * @opensearch.internal */ public interface Factory extends ScriptFactory { LeafFactory newFactory(Map params, SearchLookup lookup); diff --git a/server/src/main/java/org/opensearch/script/BucketAggregationScript.java b/server/src/main/java/org/opensearch/script/BucketAggregationScript.java index ee54e83adcdea..55614e7fd7b9e 100644 --- a/server/src/main/java/org/opensearch/script/BucketAggregationScript.java +++ b/server/src/main/java/org/opensearch/script/BucketAggregationScript.java @@ -63,6 +63,11 @@ public Map getParams() { public abstract Number execute(); + /** + * Factory for bucket agg script + * + * @opensearch.internal + */ public interface Factory extends ScriptFactory { BucketAggregationScript newInstance(Map params); } diff --git a/server/src/main/java/org/opensearch/script/BucketAggregationSelectorScript.java b/server/src/main/java/org/opensearch/script/BucketAggregationSelectorScript.java index 6accb3043b8db..bc4ffbd57ebaa 100644 --- a/server/src/main/java/org/opensearch/script/BucketAggregationSelectorScript.java +++ b/server/src/main/java/org/opensearch/script/BucketAggregationSelectorScript.java @@ -63,6 +63,11 @@ public Map getParams() { public abstract boolean execute(); + /** + * Factory for bucket agg selector script + * + * @opensearch.internal + */ public interface Factory { BucketAggregationSelectorScript newInstance(Map params); } diff --git a/server/src/main/java/org/opensearch/script/FieldScript.java b/server/src/main/java/org/opensearch/script/FieldScript.java index 40d3e8a70f923..531616a74dce9 100644 --- a/server/src/main/java/org/opensearch/script/FieldScript.java +++ b/server/src/main/java/org/opensearch/script/FieldScript.java @@ -110,11 +110,20 @@ public void setDocument(int docid) { leafLookup.setDocument(docid); } - /** A factory to construct {@link FieldScript} instances. */ + /** + * A factory to construct {@link FieldScript} instances. + * + * @opensearch.internal + */ public interface LeafFactory { FieldScript newInstance(LeafReaderContext ctx) throws IOException; } + /** + * Factory for field script + * + * @opensearch.internal + */ public interface Factory extends ScriptFactory { LeafFactory newFactory(Map params, SearchLookup lookup); } diff --git a/server/src/main/java/org/opensearch/script/FilterScript.java b/server/src/main/java/org/opensearch/script/FilterScript.java index ca3bc79de0929..caba1c1e7d34a 100644 --- a/server/src/main/java/org/opensearch/script/FilterScript.java +++ b/server/src/main/java/org/opensearch/script/FilterScript.java @@ -79,12 +79,20 @@ public void setDocument(int docid) { leafLookup.setDocument(docid); } - /** A factory to construct {@link FilterScript} instances. */ + /** + * A factory to construct {@link FilterScript} instances. + * + * @opensearch.internal + */ public interface LeafFactory { FilterScript newInstance(LeafReaderContext ctx) throws IOException; } - /** A factory to construct stateful {@link FilterScript} factories for a specific index. */ + /** + * A factory to construct stateful {@link FilterScript} factories for a specific index. + * + * @opensearch.internal + */ public interface Factory extends ScriptFactory { LeafFactory newFactory(Map params, SearchLookup lookup); } diff --git a/server/src/main/java/org/opensearch/script/IngestConditionalScript.java b/server/src/main/java/org/opensearch/script/IngestConditionalScript.java index 378ac6e39394f..2136a55cb69e8 100644 --- a/server/src/main/java/org/opensearch/script/IngestConditionalScript.java +++ b/server/src/main/java/org/opensearch/script/IngestConditionalScript.java @@ -68,6 +68,11 @@ public Map getParams() { public abstract boolean execute(Map ctx); + /** + * Factory for ingest condition script + * + * @opensearch.internal + */ public interface Factory { IngestConditionalScript newInstance(Map params); } diff --git a/server/src/main/java/org/opensearch/script/IngestScript.java b/server/src/main/java/org/opensearch/script/IngestScript.java index 96802df1096e4..b427e09308573 100644 --- a/server/src/main/java/org/opensearch/script/IngestScript.java +++ b/server/src/main/java/org/opensearch/script/IngestScript.java @@ -68,6 +68,11 @@ public Map getParams() { public abstract void execute(Map ctx); + /** + * Factory for ingest script + * + * @opensearch.internal + */ public interface Factory { IngestScript newInstance(Map params); } diff --git a/server/src/main/java/org/opensearch/script/NumberSortScript.java b/server/src/main/java/org/opensearch/script/NumberSortScript.java index 097e5045aa803..fc4cfdb83f7cb 100644 --- a/server/src/main/java/org/opensearch/script/NumberSortScript.java +++ b/server/src/main/java/org/opensearch/script/NumberSortScript.java @@ -59,6 +59,8 @@ protected NumberSortScript() { /** * A factory to construct {@link NumberSortScript} instances. + * + * @opensearch.internal */ public interface LeafFactory { NumberSortScript newInstance(LeafReaderContext ctx) throws IOException; @@ -71,6 +73,8 @@ public interface LeafFactory { /** * A factory to construct stateful {@link NumberSortScript} factories for a specific index. + * + * @opensearch.internal */ public interface Factory extends ScriptFactory { LeafFactory newFactory(Map params, SearchLookup lookup); diff --git a/server/src/main/java/org/opensearch/script/ScoreScript.java b/server/src/main/java/org/opensearch/script/ScoreScript.java index 887032aa97811..dba44995b18f0 100644 --- a/server/src/main/java/org/opensearch/script/ScoreScript.java +++ b/server/src/main/java/org/opensearch/script/ScoreScript.java @@ -55,7 +55,11 @@ */ public abstract class ScoreScript { - /** A helper to take in an explanation from a script and turn it into an {@link org.apache.lucene.search.Explanation} */ + /** + * A helper to take in an explanation from a script and turn it into an {@link org.apache.lucene.search.Explanation} + * + * @opensearch.internal + */ public static class ExplanationHolder { private String description; @@ -242,7 +246,11 @@ public void _setIndexVersion(Version indexVersion) { this.indexVersion = indexVersion; } - /** A factory to construct {@link ScoreScript} instances. */ + /** + * A factory to construct {@link ScoreScript} instances. + * + * @opensearch.internal + */ public interface LeafFactory { /** @@ -253,7 +261,11 @@ public interface LeafFactory { ScoreScript newInstance(LeafReaderContext ctx) throws IOException; } - /** A factory to construct stateful {@link ScoreScript} factories for a specific index. */ + /** + * A factory to construct stateful {@link ScoreScript} factories for a specific index. + * + * @opensearch.internal + */ public interface Factory extends ScriptFactory { ScoreScript.LeafFactory newFactory(Map params, SearchLookup lookup); diff --git a/server/src/main/java/org/opensearch/script/ScoreScriptUtils.java b/server/src/main/java/org/opensearch/script/ScoreScriptUtils.java index 1b1f7d7ba427b..f955413907714 100644 --- a/server/src/main/java/org/opensearch/script/ScoreScriptUtils.java +++ b/server/src/main/java/org/opensearch/script/ScoreScriptUtils.java @@ -69,7 +69,11 @@ public static double sigmoid(double value, double k, double a) { return Math.pow(value, a) / (Math.pow(k, a) + Math.pow(value, a)); } - // random score based on the documents' values of the given field + /** + * random score based on the documents' values of the given field + * + * @opensearch.internal + */ public static final class RandomScoreField { private final ScoreScript scoreScript; private final ScriptDocValues docValues; @@ -95,7 +99,11 @@ public double randomScore() { } } - // random score based on the internal Lucene document Ids + /** + * random score based on the internal Lucene document Ids + * + * @opensearch.internal + */ public static final class RandomScoreDoc { private final ScoreScript scoreScript; private final int saltedSeed; @@ -113,7 +121,11 @@ public double randomScore() { } } - // **** Decay functions on geo field + /** + * **** Decay functions on geo field + * + * @opensearch.internal + */ public static final class DecayGeoLinear { // cached variables calculated once per script execution double originLat; @@ -137,6 +149,11 @@ public double decayGeoLinear(GeoPoint docValue) { } } + /** + * Exponential geo decay + * + * @opensearch.internal + */ public static final class DecayGeoExp { double originLat; double originLon; @@ -159,6 +176,11 @@ public double decayGeoExp(GeoPoint docValue) { } } + /** + * Gaussian geo decay + * + * @opensearch.internal + */ public static final class DecayGeoGauss { double originLat; double originLon; @@ -183,6 +205,11 @@ public double decayGeoGauss(GeoPoint docValue) { // **** Decay functions on numeric field + /** + * Linear numeric decay + * + * @opensearch.internal + */ public static final class DecayNumericLinear { double origin; double offset; @@ -200,6 +227,11 @@ public double decayNumericLinear(double docValue) { } } + /** + * Exponential numeric decay + * + * @opensearch.internal + */ public static final class DecayNumericExp { double origin; double offset; @@ -217,6 +249,11 @@ public double decayNumericExp(double docValue) { } } + /** + * Gaussian numeric decay + * + * @opensearch.internal + */ public static final class DecayNumericGauss { double origin; double offset; @@ -245,6 +282,11 @@ public double decayNumericGauss(double docValue) { private static final ZoneId defaultZoneId = ZoneId.of("UTC"); private static final DateMathParser dateParser = DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER.toDateMathParser(); + /** + * Linear date decay + * + * @opensearch.internal + */ public static final class DecayDateLinear { long origin; long offset; @@ -268,6 +310,11 @@ public double decayDateLinear(JodaCompatibleZonedDateTime docValueDate) { } } + /** + * Exponential date decay + * + * @opensearch.internal + */ public static final class DecayDateExp { long origin; long offset; @@ -290,6 +337,11 @@ public double decayDateExp(JodaCompatibleZonedDateTime docValueDate) { } } + /** + * Gaussian date decay + * + * @opensearch.internal + */ public static final class DecayDateGauss { long origin; long offset; diff --git a/server/src/main/java/org/opensearch/script/ScriptCache.java b/server/src/main/java/org/opensearch/script/ScriptCache.java index 1b898b90ba144..874888b53b978 100644 --- a/server/src/main/java/org/opensearch/script/ScriptCache.java +++ b/server/src/main/java/org/opensearch/script/ScriptCache.java @@ -264,6 +264,11 @@ private TokenBucketState(long lastInlineCompileTime, double availableTokens, boo } } + /** + * Tracking compilation rate + * + * @opensearch.internal + */ public static class CompilationRate { public final int count; public final TimeValue time; diff --git a/server/src/main/java/org/opensearch/script/ScriptContextInfo.java b/server/src/main/java/org/opensearch/script/ScriptContextInfo.java index 68297eb12216a..124cbf5406d2a 100644 --- a/server/src/main/java/org/opensearch/script/ScriptContextInfo.java +++ b/server/src/main/java/org/opensearch/script/ScriptContextInfo.java @@ -199,6 +199,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder.endArray().endObject(); } + /** + * Script method information + * + * @opensearch.internal + */ public static class ScriptMethodInfo implements ToXContentObject, Writeable { public final String name, returnType; public final List parameters; @@ -277,6 +282,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder.endArray().endObject(); } + /** + * Parameter information + * + * @opensearch.internal + */ public static class ParameterInfo implements ToXContentObject, Writeable { public final String type, name; diff --git a/server/src/main/java/org/opensearch/script/ScriptException.java b/server/src/main/java/org/opensearch/script/ScriptException.java index 8255751189002..619b9a4239512 100644 --- a/server/src/main/java/org/opensearch/script/ScriptException.java +++ b/server/src/main/java/org/opensearch/script/ScriptException.java @@ -188,6 +188,11 @@ public RestStatus status() { return RestStatus.BAD_REQUEST; } + /** + * Position data + * + * @opensearch.internal + */ public static class Position { public final int offset; public final int start; diff --git a/server/src/main/java/org/opensearch/script/ScriptMetadata.java b/server/src/main/java/org/opensearch/script/ScriptMetadata.java index ed57d978bf2ff..eef3ed84d2cc2 100644 --- a/server/src/main/java/org/opensearch/script/ScriptMetadata.java +++ b/server/src/main/java/org/opensearch/script/ScriptMetadata.java @@ -72,6 +72,8 @@ public final class ScriptMetadata implements Metadata.Custom, Writeable, ToXCont * the {@link ClusterState}. Scripts can be added or deleted, then built * to generate a new {@link Map} of scripts that will be used to update * the current {@link ClusterState}. + * + * @opensearch.internal */ public static final class Builder { diff --git a/server/src/main/java/org/opensearch/script/ScriptedMetricAggContexts.java b/server/src/main/java/org/opensearch/script/ScriptedMetricAggContexts.java index 43c6bb0a89890..58d0f7b4f6040 100644 --- a/server/src/main/java/org/opensearch/script/ScriptedMetricAggContexts.java +++ b/server/src/main/java/org/opensearch/script/ScriptedMetricAggContexts.java @@ -54,6 +54,11 @@ */ public class ScriptedMetricAggContexts { + /** + * Base initialization script + * + * @opensearch.internal + */ public abstract static class InitScript { private final Map params; private final Map state; @@ -73,6 +78,11 @@ public Object getState() { public abstract void execute(); + /** + * Factory for a scripted metric agg context + * + * @opensearch.internal + */ public interface Factory extends ScriptFactory { InitScript newInstance(Map params, Map state); } @@ -81,6 +91,11 @@ public interface Factory extends ScriptFactory { public static ScriptContext CONTEXT = new ScriptContext<>("aggs_init", Factory.class); } + /** + * Base map script + * + * @opensearch.internal + */ public abstract static class MapScript { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class); @@ -162,10 +177,20 @@ public double get_score() { public abstract void execute(); + /** + * Factory for a scripted metric agg context + * + * @opensearch.internal + */ public interface LeafFactory { MapScript newInstance(LeafReaderContext ctx); } + /** + * Factory for a scripted metric agg factory + * + * @opensearch.internal + */ public interface Factory extends ScriptFactory { LeafFactory newFactory(Map params, Map state, SearchLookup lookup); } @@ -174,6 +199,11 @@ public interface Factory extends ScriptFactory { public static ScriptContext CONTEXT = new ScriptContext<>("aggs_map", Factory.class); } + /** + * Base combination script + * + * @opensearch.internal + */ public abstract static class CombineScript { private final Map params; private final Map state; @@ -193,6 +223,11 @@ public Map getState() { public abstract Object execute(); + /** + * Factory for a scripted metric agg context + * + * @opensearch.internal + */ public interface Factory extends ScriptFactory { CombineScript newInstance(Map params, Map state); } @@ -201,6 +236,11 @@ public interface Factory extends ScriptFactory { public static ScriptContext CONTEXT = new ScriptContext<>("aggs_combine", Factory.class); } + /** + * Base reduce script + * + * @opensearch.internal + */ public abstract static class ReduceScript { private final Map params; private final List states; @@ -220,6 +260,11 @@ public List getStates() { public abstract Object execute(); + /** + * Factory for a scripted metric agg context + * + * @opensearch.internal + */ public interface Factory extends ScriptFactory { ReduceScript newInstance(Map params, List states); } diff --git a/server/src/main/java/org/opensearch/script/SignificantTermsHeuristicScoreScript.java b/server/src/main/java/org/opensearch/script/SignificantTermsHeuristicScoreScript.java index 9d61407570546..3165dbc0641bb 100644 --- a/server/src/main/java/org/opensearch/script/SignificantTermsHeuristicScoreScript.java +++ b/server/src/main/java/org/opensearch/script/SignificantTermsHeuristicScoreScript.java @@ -47,6 +47,11 @@ public abstract class SignificantTermsHeuristicScoreScript { public abstract double execute(Map params); + /** + * Factory for a significant terms heuristic score script + * + * @opensearch.internal + */ public interface Factory extends ScriptFactory { SignificantTermsHeuristicScoreScript newInstance(); } diff --git a/server/src/main/java/org/opensearch/script/SimilarityScript.java b/server/src/main/java/org/opensearch/script/SimilarityScript.java index dbee5af77e309..9b0987598b0de 100644 --- a/server/src/main/java/org/opensearch/script/SimilarityScript.java +++ b/server/src/main/java/org/opensearch/script/SimilarityScript.java @@ -56,6 +56,11 @@ public abstract double execute( ScriptedSimilarity.Doc doc ); + /** + * Factory for a similarity script + * + * @opensearch.internal + */ public interface Factory extends ScriptFactory { SimilarityScript newInstance(); } diff --git a/server/src/main/java/org/opensearch/script/SimilarityWeightScript.java b/server/src/main/java/org/opensearch/script/SimilarityWeightScript.java index f780f87741680..cb355728ae894 100644 --- a/server/src/main/java/org/opensearch/script/SimilarityWeightScript.java +++ b/server/src/main/java/org/opensearch/script/SimilarityWeightScript.java @@ -48,6 +48,11 @@ public abstract class SimilarityWeightScript { */ public abstract double execute(ScriptedSimilarity.Query query, ScriptedSimilarity.Field field, ScriptedSimilarity.Term term); + /** + * Factory for a similarity weight script + * + * @opensearch.internal + */ public interface Factory extends ScriptFactory { SimilarityWeightScript newInstance(); } diff --git a/server/src/main/java/org/opensearch/script/StringSortScript.java b/server/src/main/java/org/opensearch/script/StringSortScript.java index eee60d9dc4ef9..5b7ac1fc853e5 100644 --- a/server/src/main/java/org/opensearch/script/StringSortScript.java +++ b/server/src/main/java/org/opensearch/script/StringSortScript.java @@ -55,6 +55,8 @@ public StringSortScript(Map params, SearchLookup lookup, LeafRea /** * A factory to construct {@link StringSortScript} instances. + * + * @opensearch.internal */ public interface LeafFactory { StringSortScript newInstance(LeafReaderContext ctx) throws IOException; @@ -62,6 +64,8 @@ public interface LeafFactory { /** * A factory to construct stateful {@link StringSortScript} factories for a specific index. + * + * @opensearch.internal */ public interface Factory extends ScriptFactory { LeafFactory newFactory(Map params, SearchLookup lookup); diff --git a/server/src/main/java/org/opensearch/script/TemplateScript.java b/server/src/main/java/org/opensearch/script/TemplateScript.java index 0b03a4fd931c1..769999baba98d 100644 --- a/server/src/main/java/org/opensearch/script/TemplateScript.java +++ b/server/src/main/java/org/opensearch/script/TemplateScript.java @@ -57,6 +57,11 @@ public Map getParams() { /** Run a template and return the resulting string, encoded in utf8 bytes. */ public abstract String execute(); + /** + * Factory for a template script + * + * @opensearch.internal + */ public interface Factory { TemplateScript newInstance(Map params); } diff --git a/server/src/main/java/org/opensearch/script/TermsSetQueryScript.java b/server/src/main/java/org/opensearch/script/TermsSetQueryScript.java index d4a4d1cccbd5b..02e361b0f5415 100644 --- a/server/src/main/java/org/opensearch/script/TermsSetQueryScript.java +++ b/server/src/main/java/org/opensearch/script/TermsSetQueryScript.java @@ -125,6 +125,8 @@ public long runAsLong() { /** * A factory to construct {@link TermsSetQueryScript} instances. + * + * @opensearch.internal */ public interface LeafFactory { TermsSetQueryScript newInstance(LeafReaderContext ctx) throws IOException; @@ -132,6 +134,8 @@ public interface LeafFactory { /** * A factory to construct stateful {@link TermsSetQueryScript} factories for a specific index. + * + * @opensearch.internal */ public interface Factory extends ScriptFactory { LeafFactory newFactory(Map params, SearchLookup lookup); diff --git a/server/src/main/java/org/opensearch/script/UpdateScript.java b/server/src/main/java/org/opensearch/script/UpdateScript.java index 41f21f337877b..fdceadc03879e 100644 --- a/server/src/main/java/org/opensearch/script/UpdateScript.java +++ b/server/src/main/java/org/opensearch/script/UpdateScript.java @@ -78,6 +78,11 @@ public Map getCtx() { public abstract void execute(); + /** + * Factory for an update script + * + * @opensearch.internal + */ public interface Factory { UpdateScript newInstance(Map params, Map ctx); } diff --git a/server/src/main/java/org/opensearch/snapshots/RestoreService.java b/server/src/main/java/org/opensearch/snapshots/RestoreService.java index 3bdda9413cfd9..cc4b8e556a3c7 100644 --- a/server/src/main/java/org/opensearch/snapshots/RestoreService.java +++ b/server/src/main/java/org/opensearch/snapshots/RestoreService.java @@ -776,6 +776,11 @@ public static RestoreInProgress updateRestoreStateWithDeletedIndices(RestoreInPr } } + /** + * Response once restore is completed. + * + * @opensearch.internal + */ public static final class RestoreCompletionResponse { private final String uuid; private final Snapshot snapshot; diff --git a/server/src/main/java/org/opensearch/threadpool/ThreadPool.java b/server/src/main/java/org/opensearch/threadpool/ThreadPool.java index a6cb566cba678..fb62c1243db7d 100644 --- a/server/src/main/java/org/opensearch/threadpool/ThreadPool.java +++ b/server/src/main/java/org/opensearch/threadpool/ThreadPool.java @@ -81,6 +81,11 @@ public class ThreadPool implements ReportingService, Scheduler { private static final Logger logger = LogManager.getLogger(ThreadPool.class); + /** + * The threadpool names. + * + * @opensearch.internal + */ public static class Names { public static final String SAME = "same"; public static final String GENERIC = "generic"; @@ -103,6 +108,11 @@ public static class Names { public static final String SYSTEM_WRITE = "system_write"; } + /** + * The threadpool type. + * + * @opensearch.internal + */ public enum ThreadPoolType { DIRECT("direct"), FIXED("fixed"), @@ -657,6 +667,11 @@ ExecutorService executor() { } } + /** + * The thread pool information. + * + * @opensearch.internal + */ public static class Info implements Writeable, ToXContentFragment { private final String name; diff --git a/server/src/main/java/org/opensearch/threadpool/ThreadPoolStats.java b/server/src/main/java/org/opensearch/threadpool/ThreadPoolStats.java index cf9e85ac30a92..9ebe16bf8e7ec 100644 --- a/server/src/main/java/org/opensearch/threadpool/ThreadPoolStats.java +++ b/server/src/main/java/org/opensearch/threadpool/ThreadPoolStats.java @@ -51,6 +51,11 @@ */ public class ThreadPoolStats implements Writeable, ToXContentFragment, Iterable { + /** + * The statistics. + * + * @opensearch.internal + */ public static class Stats implements Writeable, ToXContentFragment, Comparable { private final String name; diff --git a/server/src/main/java/org/opensearch/watcher/ResourceWatcherService.java b/server/src/main/java/org/opensearch/watcher/ResourceWatcherService.java index b8c819e187efd..5ac1b735f72ae 100644 --- a/server/src/main/java/org/opensearch/watcher/ResourceWatcherService.java +++ b/server/src/main/java/org/opensearch/watcher/ResourceWatcherService.java @@ -59,6 +59,11 @@ public class ResourceWatcherService implements Closeable { private static final Logger logger = LogManager.getLogger(ResourceWatcherService.class); + /** + * Frequency level to watch. + * + * @opensearch.internal + */ public enum Frequency { /** From 35d8cc4ea092a32bd89ec956521cb1c9d90f8947 Mon Sep 17 00:00:00 2001 From: Bharathwaj G Date: Fri, 13 May 2022 11:50:29 +0530 Subject: [PATCH 06/20] addressing comments Signed-off-by: Bharathwaj G --- .../opensearch/client/RequestConverters.java | 2 +- .../action/search/CreatePitController.java | 23 +++++----- .../opensearch/action/search/SearchUtils.java | 42 +++++++++++++++++++ .../search/TransportCreatePitAction.java | 6 +++ .../org/opensearch/search/SearchService.java | 19 ++------- .../search/CreatePitControllerTests.java | 3 +- 6 files changed, 64 insertions(+), 31 deletions(-) create mode 100644 server/src/main/java/org/opensearch/action/search/SearchUtils.java diff --git a/client/rest-high-level/src/main/java/org/opensearch/client/RequestConverters.java b/client/rest-high-level/src/main/java/org/opensearch/client/RequestConverters.java index 47bb6630c08db..277759c921fbf 100644 --- a/client/rest-high-level/src/main/java/org/opensearch/client/RequestConverters.java +++ b/client/rest-high-level/src/main/java/org/opensearch/client/RequestConverters.java @@ -439,7 +439,7 @@ static void addSearchRequestParams(Params params, SearchRequest searchRequest) { params.withIndicesOptions(searchRequest.indicesOptions()); } params.withSearchType(searchRequest.searchType().name().toLowerCase(Locale.ROOT)); - if (searchRequest.pointInTimeBuilder() == null) { + if (searchRequest.pointInTimeBuilder() != null) { params.putParam("ccs_minimize_roundtrips", "false"); } else { params.putParam("ccs_minimize_roundtrips", Boolean.toString(searchRequest.isCcsMinimizeRoundtrips())); diff --git a/server/src/main/java/org/opensearch/action/search/CreatePitController.java b/server/src/main/java/org/opensearch/action/search/CreatePitController.java index 5b20bbf2696db..4ed2e5b3de0a3 100644 --- a/server/src/main/java/org/opensearch/action/search/CreatePitController.java +++ b/server/src/main/java/org/opensearch/action/search/CreatePitController.java @@ -103,7 +103,7 @@ public void executeCreatePit(StepListener createPitListener, Act * Phase 2 of create PIT where we update pit id in pit contexts */ createPitListener.whenComplete( - searchResponse -> { executeUpdatePitId(request, searchResponse, updatePitIdListener); }, + searchResponse -> { executeUpdatePitId(request, searchRequest, searchResponse, updatePitIdListener); }, updatePitIdListener::onFailure ); } @@ -148,6 +148,7 @@ public void executeOnShardTarget( */ void executeUpdatePitId( CreatePitRequest request, + SearchRequest searchRequest, SearchResponse searchResponse, ActionListener updatePitIdListener ) { @@ -161,7 +162,13 @@ void executeUpdatePitId( * store the create time ( same create time for all PIT contexts across shards ) to be used * for list PIT api */ - final long creationTime = System.currentTimeMillis(); + final long relativeStartNanos = System.nanoTime(); + final TransportSearchAction.SearchTimeProvider timeProvider = new TransportSearchAction.SearchTimeProvider( + searchRequest.getOrCreateAbsoluteStartMillis(), + relativeStartNanos, + System::nanoTime + ); + final long creationTime = timeProvider.getAbsoluteStartMillis(); CreatePitResponse createPITResponse = new CreatePitResponse( searchResponse.pointInTimeId(), creationTime, @@ -212,27 +219,17 @@ void executeUpdatePitId( } } }, updatePitIdListener::onFailure); - } private StepListener> getConnectionLookupListener(SearchContextId contextId) { ClusterState state = clusterService.state(); - final Set clusters = contextId.shards() .values() .stream() .filter(ctx -> Strings.isEmpty(ctx.getClusterAlias()) == false) .map(SearchContextIdForNode::getClusterAlias) .collect(Collectors.toSet()); - - final StepListener> lookupListener = new StepListener<>(); - - if (clusters.isEmpty()) { - lookupListener.onResponse((cluster, nodeId) -> state.getNodes().get(nodeId)); - } else { - searchTransportService.getRemoteClusterService().collectNodes(clusters, lookupListener); - } - return lookupListener; + return SearchUtils.getConnectionLookupListener(searchTransportService, state, clusters); } private ActionListener getGroupedListener( diff --git a/server/src/main/java/org/opensearch/action/search/SearchUtils.java b/server/src/main/java/org/opensearch/action/search/SearchUtils.java new file mode 100644 index 0000000000000..0fdb1331d8ad6 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/search/SearchUtils.java @@ -0,0 +1,42 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.action.search; + +import org.opensearch.action.StepListener; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.node.DiscoveryNode; + +import java.util.Set; +import java.util.function.BiFunction; + +/** + * Helper class for common search functions + */ +public class SearchUtils { + + public SearchUtils() {} + + /** + * Get connection lookup listener for list of clusters passed + */ + public static StepListener> getConnectionLookupListener( + SearchTransportService searchTransportService, + ClusterState state, + Set clusters + ) { + final StepListener> lookupListener = new StepListener<>(); + + if (clusters.isEmpty()) { + lookupListener.onResponse((cluster, nodeId) -> state.getNodes().get(nodeId)); + } else { + searchTransportService.getRemoteClusterService().collectNodes(clusters, lookupListener); + } + return lookupListener; + } +} diff --git a/server/src/main/java/org/opensearch/action/search/TransportCreatePitAction.java b/server/src/main/java/org/opensearch/action/search/TransportCreatePitAction.java index a128230e268ba..3ec821dbed9c4 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportCreatePitAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportCreatePitAction.java @@ -82,6 +82,9 @@ protected void doExecute(Task task, CreatePitRequest request, ActionListener { - Releasable decreasePitContexts = null; Engine.SearcherSupplier searcherSupplier = null; ReaderContext readerContext = null; - boolean success = false; try { - // use this when reader context is freed - decreasePitContexts = openPitContexts::decrementAndGet; if (openPitContexts.incrementAndGet() > maxOpenPitContext) { throw new OpenSearchRejectedExecutionException( "Trying to create too many Point In Time contexts. Must be less than or equal to: [" @@ -894,10 +890,9 @@ public void createPitReaderContext(ShardId shardId, TimeValue keepAlive, ActionL searchOperationListener.onNewReaderContext(readerContext); searchOperationListener.onNewPitContext(finalReaderContext); - readerContext.addOnClose(decreasePitContexts); - decreasePitContexts = null; readerContext.addOnClose(() -> { + openPitContexts.decrementAndGet(); searchOperationListener.onFreeReaderContext(finalReaderContext); searchOperationListener.onFreePitContext(finalReaderContext); }); @@ -905,15 +900,9 @@ public void createPitReaderContext(ShardId shardId, TimeValue keepAlive, ActionL putReaderContext(readerContext); readerContext = null; listener.onResponse(finalReaderContext.id()); - success = true; } catch (Exception exc) { + Releasables.closeWhileHandlingException(searcherSupplier, readerContext); listener.onFailure(exc); - } finally { - if (success) { - Releasables.close(readerContext, searcherSupplier, decreasePitContexts); - } else { - Releasables.closeWhileHandlingException(searcherSupplier, readerContext, decreasePitContexts); - } } }); } @@ -1043,14 +1032,14 @@ public void updatePitIdAndKeepAlive(UpdatePitContextRequest request, ActionListe Releasable updatePit = null; try { updatePit = readerContext.updatePitIdAndKeepAlive(request.getKeepAlive(), request.getPitId(), request.getCreationTime()); - updatePit.close(); listener.onResponse(new UpdatePitContextResponse(request.getPitId(), request.getCreationTime(), request.getKeepAlive())); } catch (Exception e) { freeReaderContext(readerContext.id()); + listener.onFailure(e); + } finally { if (updatePit != null) { updatePit.close(); } - listener.onFailure(e); } } diff --git a/server/src/test/java/org/opensearch/action/search/CreatePitControllerTests.java b/server/src/test/java/org/opensearch/action/search/CreatePitControllerTests.java index 5411d6c72686d..a1521cca03640 100644 --- a/server/src/test/java/org/opensearch/action/search/CreatePitControllerTests.java +++ b/server/src/test/java/org/opensearch/action/search/CreatePitControllerTests.java @@ -126,7 +126,7 @@ public void onFailure(Exception e) { clusterServiceMock = mock(ClusterService.class); ClusterState state = mock(ClusterState.class); - final Settings keepAliveSettings = Settings.builder().put(CreatePitController.PIT_CREATE_PHASE_KEEP_ALIVE.getKey(), 30000).build(); + final Settings keepAliveSettings = Settings.builder().put(CreatePitController.PIT_INIT_KEEP_ALIVE.getKey(), 30000).build(); when(clusterServiceMock.getSettings()).thenReturn(keepAliveSettings); when(state.getMetadata()).thenReturn(Metadata.EMPTY_METADATA); @@ -177,7 +177,6 @@ public Transport.Connection getConnection(String clusterAlias, DiscoveryNode nod CreatePitRequest request = new CreatePitRequest(TimeValue.timeValueDays(1), true); request.setIndices(new String[] { "index" }); - CreatePitController controller = new CreatePitController( request, searchTransportService, From 065e3cb80b47172c0b6b874c277db73f5078d9f6 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Fri, 13 May 2022 12:56:51 -0400 Subject: [PATCH 07/20] Update generated ANTLR lexer/parser to match runtime version (#3297) Signed-off-by: Andriy Redko --- modules/lang-painless/build.gradle | 6 +- .../painless/antlr/PainlessLexer.java | 626 +++++++++--------- .../painless/antlr/PainlessParser.java | 508 +++++++------- 3 files changed, 613 insertions(+), 527 deletions(-) diff --git a/modules/lang-painless/build.gradle b/modules/lang-painless/build.gradle index f8e25c20cbf15..c997068ccb6c9 100644 --- a/modules/lang-painless/build.gradle +++ b/modules/lang-painless/build.gradle @@ -139,7 +139,7 @@ tasks.register("generateContextDoc", DefaultTestClustersTask) { useCluster testClusters.generateContextCluster doFirst { project.javaexec { - main = 'org.opensearch.painless.ContextDocGenerator' + mainClass = 'org.opensearch.painless.ContextDocGenerator' classpath = sourceSets.doc.runtimeClasspath systemProperty "cluster.uri", "${-> testClusters.generateContextCluster.singleNode().getAllHttpSocketURI().get(0)}" }.assertNormalExitValue() @@ -172,7 +172,7 @@ tasks.register("cleanGenerated", Delete) { tasks.register("regenLexer", JavaExec) { dependsOn "cleanGenerated" - main = 'org.antlr.v4.Tool' + mainClass = 'org.antlr.v4.Tool' classpath = configurations.regenerate systemProperty 'file.encoding', 'UTF-8' systemProperty 'user.language', 'en' @@ -186,7 +186,7 @@ tasks.register("regenLexer", JavaExec) { tasks.register("regenParser", JavaExec) { dependsOn "regenLexer" - main = 'org.antlr.v4.Tool' + mainClass = 'org.antlr.v4.Tool' classpath = configurations.regenerate systemProperty 'file.encoding', 'UTF-8' systemProperty 'user.language', 'en' diff --git a/modules/lang-painless/src/main/java/org/opensearch/painless/antlr/PainlessLexer.java b/modules/lang-painless/src/main/java/org/opensearch/painless/antlr/PainlessLexer.java index 82b8bc939e910..60c6f9763bd95 100644 --- a/modules/lang-painless/src/main/java/org/opensearch/painless/antlr/PainlessLexer.java +++ b/modules/lang-painless/src/main/java/org/opensearch/painless/antlr/PainlessLexer.java @@ -43,7 +43,7 @@ @SuppressWarnings({ "all", "warnings", "unchecked", "unused", "cast" }) abstract class PainlessLexer extends Lexer { static { - RuntimeMetaData.checkVersion("4.5.3", RuntimeMetaData.VERSION); + RuntimeMetaData.checkVersion("4.9.3", RuntimeMetaData.VERSION); } protected static final DFA[] _decisionToDFA; @@ -57,266 +57,281 @@ abstract class PainlessLexer extends Lexer { 68, ALSH = 69, ARSH = 70, AUSH = 71, OCTAL = 72, HEX = 73, INTEGER = 74, DECIMAL = 75, STRING = 76, REGEX = 77, TRUE = 78, FALSE = 79, NULL = 80, PRIMITIVE = 81, DEF = 82, ID = 83, DOTINTEGER = 84, DOTID = 85; public static final int AFTER_DOT = 1; + public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; + public static String[] modeNames = { "DEFAULT_MODE", "AFTER_DOT" }; - public static final String[] ruleNames = { - "WS", - "COMMENT", - "LBRACK", - "RBRACK", - "LBRACE", - "RBRACE", - "LP", - "RP", - "DOT", - "NSDOT", - "COMMA", - "SEMICOLON", - "IF", - "IN", - "ELSE", - "WHILE", - "DO", - "FOR", - "CONTINUE", - "BREAK", - "RETURN", - "NEW", - "TRY", - "CATCH", - "THROW", - "THIS", - "INSTANCEOF", - "BOOLNOT", - "BWNOT", - "MUL", - "DIV", - "REM", - "ADD", - "SUB", - "LSH", - "RSH", - "USH", - "LT", - "LTE", - "GT", - "GTE", - "EQ", - "EQR", - "NE", - "NER", - "BWAND", - "XOR", - "BWOR", - "BOOLAND", - "BOOLOR", - "COND", - "COLON", - "ELVIS", - "REF", - "ARROW", - "FIND", - "MATCH", - "INCR", - "DECR", - "ASSIGN", - "AADD", - "ASUB", - "AMUL", - "ADIV", - "AREM", - "AAND", - "AXOR", - "AOR", - "ALSH", - "ARSH", - "AUSH", - "OCTAL", - "HEX", - "INTEGER", - "DECIMAL", - "STRING", - "REGEX", - "TRUE", - "FALSE", - "NULL", - "PRIMITIVE", - "DEF", - "ID", - "DOTINTEGER", - "DOTID" }; + private static String[] makeRuleNames() { + return new String[] { + "WS", + "COMMENT", + "LBRACK", + "RBRACK", + "LBRACE", + "RBRACE", + "LP", + "RP", + "DOT", + "NSDOT", + "COMMA", + "SEMICOLON", + "IF", + "IN", + "ELSE", + "WHILE", + "DO", + "FOR", + "CONTINUE", + "BREAK", + "RETURN", + "NEW", + "TRY", + "CATCH", + "THROW", + "THIS", + "INSTANCEOF", + "BOOLNOT", + "BWNOT", + "MUL", + "DIV", + "REM", + "ADD", + "SUB", + "LSH", + "RSH", + "USH", + "LT", + "LTE", + "GT", + "GTE", + "EQ", + "EQR", + "NE", + "NER", + "BWAND", + "XOR", + "BWOR", + "BOOLAND", + "BOOLOR", + "COND", + "COLON", + "ELVIS", + "REF", + "ARROW", + "FIND", + "MATCH", + "INCR", + "DECR", + "ASSIGN", + "AADD", + "ASUB", + "AMUL", + "ADIV", + "AREM", + "AAND", + "AXOR", + "AOR", + "ALSH", + "ARSH", + "AUSH", + "OCTAL", + "HEX", + "INTEGER", + "DECIMAL", + "STRING", + "REGEX", + "TRUE", + "FALSE", + "NULL", + "PRIMITIVE", + "DEF", + "ID", + "DOTINTEGER", + "DOTID" }; + } + + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, + null, + null, + "'{'", + "'}'", + "'['", + "']'", + "'('", + "')'", + "'.'", + "'?.'", + "','", + "';'", + "'if'", + "'in'", + "'else'", + "'while'", + "'do'", + "'for'", + "'continue'", + "'break'", + "'return'", + "'new'", + "'try'", + "'catch'", + "'throw'", + "'this'", + "'instanceof'", + "'!'", + "'~'", + "'*'", + "'/'", + "'%'", + "'+'", + "'-'", + "'<<'", + "'>>'", + "'>>>'", + "'<'", + "'<='", + "'>'", + "'>='", + "'=='", + "'==='", + "'!='", + "'!=='", + "'&'", + "'^'", + "'|'", + "'&&'", + "'||'", + "'?'", + "':'", + "'?:'", + "'::'", + "'->'", + "'=~'", + "'==~'", + "'++'", + "'--'", + "'='", + "'+='", + "'-='", + "'*='", + "'/='", + "'%='", + "'&='", + "'^='", + "'|='", + "'<<='", + "'>>='", + "'>>>='", + null, + null, + null, + null, + null, + null, + "'true'", + "'false'", + "'null'", + null, + "'def'" }; + } + + private static final String[] _LITERAL_NAMES = makeLiteralNames(); - private static final String[] _LITERAL_NAMES = { - null, - null, - null, - "'{'", - "'}'", - "'['", - "']'", - "'('", - "')'", - "'.'", - "'?.'", - "','", - "';'", - "'if'", - "'in'", - "'else'", - "'while'", - "'do'", - "'for'", - "'continue'", - "'break'", - "'return'", - "'new'", - "'try'", - "'catch'", - "'throw'", - "'this'", - "'instanceof'", - "'!'", - "'~'", - "'*'", - "'/'", - "'%'", - "'+'", - "'-'", - "'<<'", - "'>>'", - "'>>>'", - "'<'", - "'<='", - "'>'", - "'>='", - "'=='", - "'==='", - "'!='", - "'!=='", - "'&'", - "'^'", - "'|'", - "'&&'", - "'||'", - "'?'", - "':'", - "'?:'", - "'::'", - "'->'", - "'=~'", - "'==~'", - "'++'", - "'--'", - "'='", - "'+='", - "'-='", - "'*='", - "'/='", - "'%='", - "'&='", - "'^='", - "'|='", - "'<<='", - "'>>='", - "'>>>='", - null, - null, - null, - null, - null, - null, - "'true'", - "'false'", - "'null'", - null, - "'def'" }; - private static final String[] _SYMBOLIC_NAMES = { - null, - "WS", - "COMMENT", - "LBRACK", - "RBRACK", - "LBRACE", - "RBRACE", - "LP", - "RP", - "DOT", - "NSDOT", - "COMMA", - "SEMICOLON", - "IF", - "IN", - "ELSE", - "WHILE", - "DO", - "FOR", - "CONTINUE", - "BREAK", - "RETURN", - "NEW", - "TRY", - "CATCH", - "THROW", - "THIS", - "INSTANCEOF", - "BOOLNOT", - "BWNOT", - "MUL", - "DIV", - "REM", - "ADD", - "SUB", - "LSH", - "RSH", - "USH", - "LT", - "LTE", - "GT", - "GTE", - "EQ", - "EQR", - "NE", - "NER", - "BWAND", - "XOR", - "BWOR", - "BOOLAND", - "BOOLOR", - "COND", - "COLON", - "ELVIS", - "REF", - "ARROW", - "FIND", - "MATCH", - "INCR", - "DECR", - "ASSIGN", - "AADD", - "ASUB", - "AMUL", - "ADIV", - "AREM", - "AAND", - "AXOR", - "AOR", - "ALSH", - "ARSH", - "AUSH", - "OCTAL", - "HEX", - "INTEGER", - "DECIMAL", - "STRING", - "REGEX", - "TRUE", - "FALSE", - "NULL", - "PRIMITIVE", - "DEF", - "ID", - "DOTINTEGER", - "DOTID" }; + private static String[] makeSymbolicNames() { + return new String[] { + null, + "WS", + "COMMENT", + "LBRACK", + "RBRACK", + "LBRACE", + "RBRACE", + "LP", + "RP", + "DOT", + "NSDOT", + "COMMA", + "SEMICOLON", + "IF", + "IN", + "ELSE", + "WHILE", + "DO", + "FOR", + "CONTINUE", + "BREAK", + "RETURN", + "NEW", + "TRY", + "CATCH", + "THROW", + "THIS", + "INSTANCEOF", + "BOOLNOT", + "BWNOT", + "MUL", + "DIV", + "REM", + "ADD", + "SUB", + "LSH", + "RSH", + "USH", + "LT", + "LTE", + "GT", + "GTE", + "EQ", + "EQR", + "NE", + "NER", + "BWAND", + "XOR", + "BWOR", + "BOOLAND", + "BOOLOR", + "COND", + "COLON", + "ELVIS", + "REF", + "ARROW", + "FIND", + "MATCH", + "INCR", + "DECR", + "ASSIGN", + "AADD", + "ASUB", + "AMUL", + "ADIV", + "AREM", + "AAND", + "AXOR", + "AOR", + "ALSH", + "ARSH", + "AUSH", + "OCTAL", + "HEX", + "INTEGER", + "DECIMAL", + "STRING", + "REGEX", + "TRUE", + "FALSE", + "NULL", + "PRIMITIVE", + "DEF", + "ID", + "DOTINTEGER", + "DOTID" }; + } + + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); /** @@ -373,6 +388,11 @@ public String getSerializedATN() { return _serializedATN; } + @Override + public String[] getChannelNames() { + return channelNames; + } + @Override public String[] getModeNames() { return modeNames; @@ -410,7 +430,7 @@ private boolean REGEX_sempred(RuleContext _localctx, int predIndex) { return true; } - public static final String _serializedATN = "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2W\u027a\b\1\b\1\4" + public static final String _serializedATN = "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2W\u027a\b\1\b\1\4" + "\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n" + "\4\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22" + "\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31" @@ -457,50 +477,50 @@ private boolean REGEX_sempred(RuleContext _localctx, int predIndex) { + "S\u00a6T\u00a8U\u00aaV\u00acW\4\2\3\25\5\2\13\f\17\17\"\"\4\2\f\f\17\17" + "\3\2\629\4\2NNnn\4\2ZZzz\5\2\62;CHch\3\2\63;\3\2\62;\b\2FFHHNNffhhnn\4" + "\2GGgg\4\2--//\6\2FFHHffhh\4\2$$^^\4\2))^^\3\2\f\f\4\2\f\f\61\61\t\2W" - + "Weekknouuwwzz\5\2C\\aac|\6\2\62;C\\aac|\u02a0\2\4\3\2\2\2\2\6\3\2\2\2" - + "\2\b\3\2\2\2\2\n\3\2\2\2\2\f\3\2\2\2\2\16\3\2\2\2\2\20\3\2\2\2\2\22\3" - + "\2\2\2\2\24\3\2\2\2\2\26\3\2\2\2\2\30\3\2\2\2\2\32\3\2\2\2\2\34\3\2\2" - + "\2\2\36\3\2\2\2\2 \3\2\2\2\2\"\3\2\2\2\2$\3\2\2\2\2&\3\2\2\2\2(\3\2\2" - + "\2\2*\3\2\2\2\2,\3\2\2\2\2.\3\2\2\2\2\60\3\2\2\2\2\62\3\2\2\2\2\64\3\2" - + "\2\2\2\66\3\2\2\2\28\3\2\2\2\2:\3\2\2\2\2<\3\2\2\2\2>\3\2\2\2\2@\3\2\2" - + "\2\2B\3\2\2\2\2D\3\2\2\2\2F\3\2\2\2\2H\3\2\2\2\2J\3\2\2\2\2L\3\2\2\2\2" - + "N\3\2\2\2\2P\3\2\2\2\2R\3\2\2\2\2T\3\2\2\2\2V\3\2\2\2\2X\3\2\2\2\2Z\3" - + "\2\2\2\2\\\3\2\2\2\2^\3\2\2\2\2`\3\2\2\2\2b\3\2\2\2\2d\3\2\2\2\2f\3\2" - + "\2\2\2h\3\2\2\2\2j\3\2\2\2\2l\3\2\2\2\2n\3\2\2\2\2p\3\2\2\2\2r\3\2\2\2" - + "\2t\3\2\2\2\2v\3\2\2\2\2x\3\2\2\2\2z\3\2\2\2\2|\3\2\2\2\2~\3\2\2\2\2\u0080" - + "\3\2\2\2\2\u0082\3\2\2\2\2\u0084\3\2\2\2\2\u0086\3\2\2\2\2\u0088\3\2\2" - + "\2\2\u008a\3\2\2\2\2\u008c\3\2\2\2\2\u008e\3\2\2\2\2\u0090\3\2\2\2\2\u0092" - + "\3\2\2\2\2\u0094\3\2\2\2\2\u0096\3\2\2\2\2\u0098\3\2\2\2\2\u009a\3\2\2" - + "\2\2\u009c\3\2\2\2\2\u009e\3\2\2\2\2\u00a0\3\2\2\2\2\u00a2\3\2\2\2\2\u00a4" - + "\3\2\2\2\2\u00a6\3\2\2\2\2\u00a8\3\2\2\2\3\u00aa\3\2\2\2\3\u00ac\3\2\2" - + "\2\4\u00af\3\2\2\2\6\u00ca\3\2\2\2\b\u00ce\3\2\2\2\n\u00d0\3\2\2\2\f\u00d2" - + "\3\2\2\2\16\u00d4\3\2\2\2\20\u00d6\3\2\2\2\22\u00d8\3\2\2\2\24\u00da\3" - + "\2\2\2\26\u00de\3\2\2\2\30\u00e3\3\2\2\2\32\u00e5\3\2\2\2\34\u00e7\3\2" - + "\2\2\36\u00ea\3\2\2\2 \u00ed\3\2\2\2\"\u00f2\3\2\2\2$\u00f8\3\2\2\2&\u00fb" - + "\3\2\2\2(\u00ff\3\2\2\2*\u0108\3\2\2\2,\u010e\3\2\2\2.\u0115\3\2\2\2\60" - + "\u0119\3\2\2\2\62\u011d\3\2\2\2\64\u0123\3\2\2\2\66\u0129\3\2\2\28\u012e" - + "\3\2\2\2:\u0139\3\2\2\2<\u013b\3\2\2\2>\u013d\3\2\2\2@\u013f\3\2\2\2B" - + "\u0142\3\2\2\2D\u0144\3\2\2\2F\u0146\3\2\2\2H\u0148\3\2\2\2J\u014b\3\2" - + "\2\2L\u014e\3\2\2\2N\u0152\3\2\2\2P\u0154\3\2\2\2R\u0157\3\2\2\2T\u0159" - + "\3\2\2\2V\u015c\3\2\2\2X\u015f\3\2\2\2Z\u0163\3\2\2\2\\\u0166\3\2\2\2" - + "^\u016a\3\2\2\2`\u016c\3\2\2\2b\u016e\3\2\2\2d\u0170\3\2\2\2f\u0173\3" - + "\2\2\2h\u0176\3\2\2\2j\u0178\3\2\2\2l\u017a\3\2\2\2n\u017d\3\2\2\2p\u0180" - + "\3\2\2\2r\u0183\3\2\2\2t\u0186\3\2\2\2v\u018a\3\2\2\2x\u018d\3\2\2\2z" - + "\u0190\3\2\2\2|\u0192\3\2\2\2~\u0195\3\2\2\2\u0080\u0198\3\2\2\2\u0082" - + "\u019b\3\2\2\2\u0084\u019e\3\2\2\2\u0086\u01a1\3\2\2\2\u0088\u01a4\3\2" - + "\2\2\u008a\u01a7\3\2\2\2\u008c\u01aa\3\2\2\2\u008e\u01ae\3\2\2\2\u0090" - + "\u01b2\3\2\2\2\u0092\u01b7\3\2\2\2\u0094\u01c0\3\2\2\2\u0096\u01d2\3\2" - + "\2\2\u0098\u01df\3\2\2\2\u009a\u020f\3\2\2\2\u009c\u0211\3\2\2\2\u009e" - + "\u0222\3\2\2\2\u00a0\u0227\3\2\2\2\u00a2\u022d\3\2\2\2\u00a4\u0258\3\2" - + "\2\2\u00a6\u025a\3\2\2\2\u00a8\u025e\3\2\2\2\u00aa\u026d\3\2\2\2\u00ac" - + "\u0271\3\2\2\2\u00ae\u00b0\t\2\2\2\u00af\u00ae\3\2\2\2\u00b0\u00b1\3\2" - + "\2\2\u00b1\u00af\3\2\2\2\u00b1\u00b2\3\2\2\2\u00b2\u00b3\3\2\2\2\u00b3" - + "\u00b4\b\2\2\2\u00b4\5\3\2\2\2\u00b5\u00b6\7\61\2\2\u00b6\u00b7\7\61\2" - + "\2\u00b7\u00bb\3\2\2\2\u00b8\u00ba\13\2\2\2\u00b9\u00b8\3\2\2\2\u00ba" - + "\u00bd\3\2\2\2\u00bb\u00bc\3\2\2\2\u00bb\u00b9\3\2\2\2\u00bc\u00be\3\2" - + "\2\2\u00bd\u00bb\3\2\2\2\u00be\u00cb\t\3\2\2\u00bf\u00c0\7\61\2\2\u00c0" - + "\u00c1\7,\2\2\u00c1\u00c5\3\2\2\2\u00c2\u00c4\13\2\2\2\u00c3\u00c2\3\2" - + "\2\2\u00c4\u00c7\3\2\2\2\u00c5\u00c6\3\2\2\2\u00c5\u00c3\3\2\2\2\u00c6" + + "Weekknouuwwzz\5\2C\\aac|\6\2\62;C\\aac|\2\u02a0\2\4\3\2\2\2\2\6\3\2\2" + + "\2\2\b\3\2\2\2\2\n\3\2\2\2\2\f\3\2\2\2\2\16\3\2\2\2\2\20\3\2\2\2\2\22" + + "\3\2\2\2\2\24\3\2\2\2\2\26\3\2\2\2\2\30\3\2\2\2\2\32\3\2\2\2\2\34\3\2" + + "\2\2\2\36\3\2\2\2\2 \3\2\2\2\2\"\3\2\2\2\2$\3\2\2\2\2&\3\2\2\2\2(\3\2" + + "\2\2\2*\3\2\2\2\2,\3\2\2\2\2.\3\2\2\2\2\60\3\2\2\2\2\62\3\2\2\2\2\64\3" + + "\2\2\2\2\66\3\2\2\2\28\3\2\2\2\2:\3\2\2\2\2<\3\2\2\2\2>\3\2\2\2\2@\3\2" + + "\2\2\2B\3\2\2\2\2D\3\2\2\2\2F\3\2\2\2\2H\3\2\2\2\2J\3\2\2\2\2L\3\2\2\2" + + "\2N\3\2\2\2\2P\3\2\2\2\2R\3\2\2\2\2T\3\2\2\2\2V\3\2\2\2\2X\3\2\2\2\2Z" + + "\3\2\2\2\2\\\3\2\2\2\2^\3\2\2\2\2`\3\2\2\2\2b\3\2\2\2\2d\3\2\2\2\2f\3" + + "\2\2\2\2h\3\2\2\2\2j\3\2\2\2\2l\3\2\2\2\2n\3\2\2\2\2p\3\2\2\2\2r\3\2\2" + + "\2\2t\3\2\2\2\2v\3\2\2\2\2x\3\2\2\2\2z\3\2\2\2\2|\3\2\2\2\2~\3\2\2\2\2" + + "\u0080\3\2\2\2\2\u0082\3\2\2\2\2\u0084\3\2\2\2\2\u0086\3\2\2\2\2\u0088" + + "\3\2\2\2\2\u008a\3\2\2\2\2\u008c\3\2\2\2\2\u008e\3\2\2\2\2\u0090\3\2\2" + + "\2\2\u0092\3\2\2\2\2\u0094\3\2\2\2\2\u0096\3\2\2\2\2\u0098\3\2\2\2\2\u009a" + + "\3\2\2\2\2\u009c\3\2\2\2\2\u009e\3\2\2\2\2\u00a0\3\2\2\2\2\u00a2\3\2\2" + + "\2\2\u00a4\3\2\2\2\2\u00a6\3\2\2\2\2\u00a8\3\2\2\2\3\u00aa\3\2\2\2\3\u00ac" + + "\3\2\2\2\4\u00af\3\2\2\2\6\u00ca\3\2\2\2\b\u00ce\3\2\2\2\n\u00d0\3\2\2" + + "\2\f\u00d2\3\2\2\2\16\u00d4\3\2\2\2\20\u00d6\3\2\2\2\22\u00d8\3\2\2\2" + + "\24\u00da\3\2\2\2\26\u00de\3\2\2\2\30\u00e3\3\2\2\2\32\u00e5\3\2\2\2\34" + + "\u00e7\3\2\2\2\36\u00ea\3\2\2\2 \u00ed\3\2\2\2\"\u00f2\3\2\2\2$\u00f8" + + "\3\2\2\2&\u00fb\3\2\2\2(\u00ff\3\2\2\2*\u0108\3\2\2\2,\u010e\3\2\2\2." + + "\u0115\3\2\2\2\60\u0119\3\2\2\2\62\u011d\3\2\2\2\64\u0123\3\2\2\2\66\u0129" + + "\3\2\2\28\u012e\3\2\2\2:\u0139\3\2\2\2<\u013b\3\2\2\2>\u013d\3\2\2\2@" + + "\u013f\3\2\2\2B\u0142\3\2\2\2D\u0144\3\2\2\2F\u0146\3\2\2\2H\u0148\3\2" + + "\2\2J\u014b\3\2\2\2L\u014e\3\2\2\2N\u0152\3\2\2\2P\u0154\3\2\2\2R\u0157" + + "\3\2\2\2T\u0159\3\2\2\2V\u015c\3\2\2\2X\u015f\3\2\2\2Z\u0163\3\2\2\2\\" + + "\u0166\3\2\2\2^\u016a\3\2\2\2`\u016c\3\2\2\2b\u016e\3\2\2\2d\u0170\3\2" + + "\2\2f\u0173\3\2\2\2h\u0176\3\2\2\2j\u0178\3\2\2\2l\u017a\3\2\2\2n\u017d" + + "\3\2\2\2p\u0180\3\2\2\2r\u0183\3\2\2\2t\u0186\3\2\2\2v\u018a\3\2\2\2x" + + "\u018d\3\2\2\2z\u0190\3\2\2\2|\u0192\3\2\2\2~\u0195\3\2\2\2\u0080\u0198" + + "\3\2\2\2\u0082\u019b\3\2\2\2\u0084\u019e\3\2\2\2\u0086\u01a1\3\2\2\2\u0088" + + "\u01a4\3\2\2\2\u008a\u01a7\3\2\2\2\u008c\u01aa\3\2\2\2\u008e\u01ae\3\2" + + "\2\2\u0090\u01b2\3\2\2\2\u0092\u01b7\3\2\2\2\u0094\u01c0\3\2\2\2\u0096" + + "\u01d2\3\2\2\2\u0098\u01df\3\2\2\2\u009a\u020f\3\2\2\2\u009c\u0211\3\2" + + "\2\2\u009e\u0222\3\2\2\2\u00a0\u0227\3\2\2\2\u00a2\u022d\3\2\2\2\u00a4" + + "\u0258\3\2\2\2\u00a6\u025a\3\2\2\2\u00a8\u025e\3\2\2\2\u00aa\u026d\3\2" + + "\2\2\u00ac\u0271\3\2\2\2\u00ae\u00b0\t\2\2\2\u00af\u00ae\3\2\2\2\u00b0" + + "\u00b1\3\2\2\2\u00b1\u00af\3\2\2\2\u00b1\u00b2\3\2\2\2\u00b2\u00b3\3\2" + + "\2\2\u00b3\u00b4\b\2\2\2\u00b4\5\3\2\2\2\u00b5\u00b6\7\61\2\2\u00b6\u00b7" + + "\7\61\2\2\u00b7\u00bb\3\2\2\2\u00b8\u00ba\13\2\2\2\u00b9\u00b8\3\2\2\2" + + "\u00ba\u00bd\3\2\2\2\u00bb\u00bc\3\2\2\2\u00bb\u00b9\3\2\2\2\u00bc\u00be" + + "\3\2\2\2\u00bd\u00bb\3\2\2\2\u00be\u00cb\t\3\2\2\u00bf\u00c0\7\61\2\2" + + "\u00c0\u00c1\7,\2\2\u00c1\u00c5\3\2\2\2\u00c2\u00c4\13\2\2\2\u00c3\u00c2" + + "\3\2\2\2\u00c4\u00c7\3\2\2\2\u00c5\u00c6\3\2\2\2\u00c5\u00c3\3\2\2\2\u00c6" + "\u00c8\3\2\2\2\u00c7\u00c5\3\2\2\2\u00c8\u00c9\7,\2\2\u00c9\u00cb\7\61" + "\2\2\u00ca\u00b5\3\2\2\2\u00ca\u00bf\3\2\2\2\u00cb\u00cc\3\2\2\2\u00cc" + "\u00cd\b\3\2\2\u00cd\7\3\2\2\2\u00ce\u00cf\7}\2\2\u00cf\t\3\2\2\2\u00d0" diff --git a/modules/lang-painless/src/main/java/org/opensearch/painless/antlr/PainlessParser.java b/modules/lang-painless/src/main/java/org/opensearch/painless/antlr/PainlessParser.java index 1e064724c2451..03cf58f336d10 100644 --- a/modules/lang-painless/src/main/java/org/opensearch/painless/antlr/PainlessParser.java +++ b/modules/lang-painless/src/main/java/org/opensearch/painless/antlr/PainlessParser.java @@ -30,7 +30,6 @@ * Modifications Copyright OpenSearch Contributors. See * GitHub history for details. */ - package org.opensearch.painless.antlr; import org.antlr.v4.runtime.atn.*; @@ -43,7 +42,7 @@ @SuppressWarnings({ "all", "warnings", "unchecked", "unused", "cast" }) class PainlessParser extends Parser { static { - RuntimeMetaData.checkVersion("4.5.3", RuntimeMetaData.VERSION); + RuntimeMetaData.checkVersion("4.9.3", RuntimeMetaData.VERSION); } protected static final DFA[] _decisionToDFA; @@ -63,218 +62,232 @@ class PainlessParser extends Parser { RULE_refcasttype = 22, RULE_chain = 23, RULE_primary = 24, RULE_postfix = 25, RULE_postdot = 26, RULE_callinvoke = 27, RULE_fieldaccess = 28, RULE_braceaccess = 29, RULE_arrayinitializer = 30, RULE_listinitializer = 31, RULE_mapinitializer = 32, RULE_maptoken = 33, RULE_arguments = 34, RULE_argument = 35, RULE_lambda = 36, RULE_lamtype = 37, RULE_funcref = 38; - public static final String[] ruleNames = { - "source", - "function", - "parameters", - "statement", - "rstatement", - "dstatement", - "trailer", - "block", - "empty", - "initializer", - "afterthought", - "declaration", - "decltype", - "type", - "declvar", - "trap", - "noncondexpression", - "expression", - "unary", - "unarynotaddsub", - "castexpression", - "primordefcasttype", - "refcasttype", - "chain", - "primary", - "postfix", - "postdot", - "callinvoke", - "fieldaccess", - "braceaccess", - "arrayinitializer", - "listinitializer", - "mapinitializer", - "maptoken", - "arguments", - "argument", - "lambda", - "lamtype", - "funcref" }; - - private static final String[] _LITERAL_NAMES = { - null, - null, - null, - "'{'", - "'}'", - "'['", - "']'", - "'('", - "')'", - "'.'", - "'?.'", - "','", - "';'", - "'if'", - "'in'", - "'else'", - "'while'", - "'do'", - "'for'", - "'continue'", - "'break'", - "'return'", - "'new'", - "'try'", - "'catch'", - "'throw'", - "'this'", - "'instanceof'", - "'!'", - "'~'", - "'*'", - "'/'", - "'%'", - "'+'", - "'-'", - "'<<'", - "'>>'", - "'>>>'", - "'<'", - "'<='", - "'>'", - "'>='", - "'=='", - "'==='", - "'!='", - "'!=='", - "'&'", - "'^'", - "'|'", - "'&&'", - "'||'", - "'?'", - "':'", - "'?:'", - "'::'", - "'->'", - "'=~'", - "'==~'", - "'++'", - "'--'", - "'='", - "'+='", - "'-='", - "'*='", - "'/='", - "'%='", - "'&='", - "'^='", - "'|='", - "'<<='", - "'>>='", - "'>>>='", - null, - null, - null, - null, - null, - null, - "'true'", - "'false'", - "'null'", - null, - "'def'" }; - private static final String[] _SYMBOLIC_NAMES = { - null, - "WS", - "COMMENT", - "LBRACK", - "RBRACK", - "LBRACE", - "RBRACE", - "LP", - "RP", - "DOT", - "NSDOT", - "COMMA", - "SEMICOLON", - "IF", - "IN", - "ELSE", - "WHILE", - "DO", - "FOR", - "CONTINUE", - "BREAK", - "RETURN", - "NEW", - "TRY", - "CATCH", - "THROW", - "THIS", - "INSTANCEOF", - "BOOLNOT", - "BWNOT", - "MUL", - "DIV", - "REM", - "ADD", - "SUB", - "LSH", - "RSH", - "USH", - "LT", - "LTE", - "GT", - "GTE", - "EQ", - "EQR", - "NE", - "NER", - "BWAND", - "XOR", - "BWOR", - "BOOLAND", - "BOOLOR", - "COND", - "COLON", - "ELVIS", - "REF", - "ARROW", - "FIND", - "MATCH", - "INCR", - "DECR", - "ASSIGN", - "AADD", - "ASUB", - "AMUL", - "ADIV", - "AREM", - "AAND", - "AXOR", - "AOR", - "ALSH", - "ARSH", - "AUSH", - "OCTAL", - "HEX", - "INTEGER", - "DECIMAL", - "STRING", - "REGEX", - "TRUE", - "FALSE", - "NULL", - "PRIMITIVE", - "DEF", - "ID", - "DOTINTEGER", - "DOTID" }; + + private static String[] makeRuleNames() { + return new String[] { + "source", + "function", + "parameters", + "statement", + "rstatement", + "dstatement", + "trailer", + "block", + "empty", + "initializer", + "afterthought", + "declaration", + "decltype", + "type", + "declvar", + "trap", + "noncondexpression", + "expression", + "unary", + "unarynotaddsub", + "castexpression", + "primordefcasttype", + "refcasttype", + "chain", + "primary", + "postfix", + "postdot", + "callinvoke", + "fieldaccess", + "braceaccess", + "arrayinitializer", + "listinitializer", + "mapinitializer", + "maptoken", + "arguments", + "argument", + "lambda", + "lamtype", + "funcref" }; + } + + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, + null, + null, + "'{'", + "'}'", + "'['", + "']'", + "'('", + "')'", + "'.'", + "'?.'", + "','", + "';'", + "'if'", + "'in'", + "'else'", + "'while'", + "'do'", + "'for'", + "'continue'", + "'break'", + "'return'", + "'new'", + "'try'", + "'catch'", + "'throw'", + "'this'", + "'instanceof'", + "'!'", + "'~'", + "'*'", + "'/'", + "'%'", + "'+'", + "'-'", + "'<<'", + "'>>'", + "'>>>'", + "'<'", + "'<='", + "'>'", + "'>='", + "'=='", + "'==='", + "'!='", + "'!=='", + "'&'", + "'^'", + "'|'", + "'&&'", + "'||'", + "'?'", + "':'", + "'?:'", + "'::'", + "'->'", + "'=~'", + "'==~'", + "'++'", + "'--'", + "'='", + "'+='", + "'-='", + "'*='", + "'/='", + "'%='", + "'&='", + "'^='", + "'|='", + "'<<='", + "'>>='", + "'>>>='", + null, + null, + null, + null, + null, + null, + "'true'", + "'false'", + "'null'", + null, + "'def'" }; + } + + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + + private static String[] makeSymbolicNames() { + return new String[] { + null, + "WS", + "COMMENT", + "LBRACK", + "RBRACK", + "LBRACE", + "RBRACE", + "LP", + "RP", + "DOT", + "NSDOT", + "COMMA", + "SEMICOLON", + "IF", + "IN", + "ELSE", + "WHILE", + "DO", + "FOR", + "CONTINUE", + "BREAK", + "RETURN", + "NEW", + "TRY", + "CATCH", + "THROW", + "THIS", + "INSTANCEOF", + "BOOLNOT", + "BWNOT", + "MUL", + "DIV", + "REM", + "ADD", + "SUB", + "LSH", + "RSH", + "USH", + "LT", + "LTE", + "GT", + "GTE", + "EQ", + "EQR", + "NE", + "NER", + "BWAND", + "XOR", + "BWOR", + "BOOLAND", + "BOOLOR", + "COND", + "COLON", + "ELVIS", + "REF", + "ARROW", + "FIND", + "MATCH", + "INCR", + "DECR", + "ASSIGN", + "AADD", + "ASUB", + "AMUL", + "ADIV", + "AREM", + "AAND", + "AXOR", + "AOR", + "ALSH", + "ARSH", + "AUSH", + "OCTAL", + "HEX", + "INTEGER", + "DECIMAL", + "STRING", + "REGEX", + "TRUE", + "FALSE", + "NULL", + "PRIMITIVE", + "DEF", + "ID", + "DOTINTEGER", + "DOTID" }; + } + + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); /** @@ -545,6 +558,7 @@ public final ParametersContext parameters() throws RecognitionException { setState(97); match(LP); setState(109); + _errHandler.sync(this); _la = _input.LA(1); if (((((_la - 81)) & ~0x3f) == 0 && ((1L << (_la - 81)) & ((1L << (PRIMITIVE - 81)) | (1L << (DEF - 81)) | (1L << (ID - 81)))) != 0)) { @@ -626,6 +640,7 @@ public final StatementContext statement() throws RecognitionException { int _la; try { setState(117); + _errHandler.sync(this); switch (_input.LA(1)) { case IF: case WHILE: @@ -670,6 +685,8 @@ public final StatementContext statement() throws RecognitionException { if (!(_la == EOF || _la == SEMICOLON)) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } } @@ -996,6 +1013,7 @@ public final RstatementContext rstatement() throws RecognitionException { setState(132); match(RP); setState(135); + _errHandler.sync(this); switch (_input.LA(1)) { case LBRACK: case LBRACE: @@ -1050,6 +1068,7 @@ public final RstatementContext rstatement() throws RecognitionException { setState(138); match(LP); setState(140); + _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LBRACE) | (1L << LP) | (1L << NEW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L @@ -1067,6 +1086,7 @@ public final RstatementContext rstatement() throws RecognitionException { setState(142); match(SEMICOLON); setState(144); + _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LBRACE) | (1L << LP) | (1L << NEW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L @@ -1084,6 +1104,7 @@ public final RstatementContext rstatement() throws RecognitionException { setState(146); match(SEMICOLON); setState(148); + _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LBRACE) | (1L << LP) | (1L << NEW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L @@ -1101,6 +1122,7 @@ public final RstatementContext rstatement() throws RecognitionException { setState(150); match(RP); setState(153); + _errHandler.sync(this); switch (_input.LA(1)) { case LBRACK: case LBRACE: @@ -1435,6 +1457,7 @@ public final DstatementContext dstatement() throws RecognitionException { setState(191); match(RETURN); setState(193); + _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LBRACE) | (1L << LP) | (1L << NEW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L @@ -1508,6 +1531,7 @@ public final TrailerContext trailer() throws RecognitionException { enterRule(_localctx, 12, RULE_trailer); try { setState(202); + _errHandler.sync(this); switch (_input.LA(1)) { case LBRACK: enterOuterAlt(_localctx, 1); { @@ -1627,6 +1651,7 @@ public final BlockContext block() throws RecognitionException { _alt = getInterpreter().adaptivePredict(_input, 16, _ctx); } setState(212); + _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LBRACE) | (1L << LP) | (1L << DO) | (1L << CONTINUE) | (1L << BREAK) | (1L << RETURN) | (1L @@ -1991,6 +2016,7 @@ public final TypeContext type() throws RecognitionException { try { int _alt; setState(251); + _errHandler.sync(this); switch (_input.LA(1)) { case DEF: enterOuterAlt(_localctx, 1); { @@ -2080,6 +2106,7 @@ public final DeclvarContext declvar() throws RecognitionException { setState(253); match(ID); setState(256); + _errHandler.sync(this); _la = _input.LA(1); if (_la == ASSIGN) { { @@ -2450,6 +2477,8 @@ private NoncondexpressionContext noncondexpression(int _p) throws RecognitionExc if (!((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << MUL) | (1L << DIV) | (1L << REM))) != 0))) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } setState(270); @@ -2466,6 +2495,8 @@ private NoncondexpressionContext noncondexpression(int _p) throws RecognitionExc if (!(_la == ADD || _la == SUB)) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } setState(273); @@ -2482,6 +2513,8 @@ private NoncondexpressionContext noncondexpression(int _p) throws RecognitionExc if (!(_la == FIND || _la == MATCH)) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } setState(276); @@ -2498,6 +2531,8 @@ private NoncondexpressionContext noncondexpression(int _p) throws RecognitionExc if (!((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LSH) | (1L << RSH) | (1L << USH))) != 0))) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } setState(279); @@ -2515,6 +2550,8 @@ private NoncondexpressionContext noncondexpression(int _p) throws RecognitionExc && ((1L << _la) & ((1L << LT) | (1L << LTE) | (1L << GT) | (1L << GTE))) != 0))) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } setState(282); @@ -2532,6 +2569,8 @@ private NoncondexpressionContext noncondexpression(int _p) throws RecognitionExc && ((1L << _la) & ((1L << EQ) | (1L << EQR) | (1L << NE) | (1L << NER))) != 0))) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } setState(285); @@ -2809,6 +2848,8 @@ public final ExpressionContext expression() throws RecognitionException { | (1L << (ALSH - 60)) | (1L << (ARSH - 60)) | (1L << (AUSH - 60)))) != 0))) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } setState(321); @@ -2913,6 +2954,7 @@ public final UnaryContext unary() throws RecognitionException { int _la; try { setState(330); + _errHandler.sync(this); switch (_input.LA(1)) { case INCR: case DECR: @@ -2923,6 +2965,8 @@ public final UnaryContext unary() throws RecognitionException { if (!(_la == INCR || _la == DECR)) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } setState(326); @@ -2938,6 +2982,8 @@ public final UnaryContext unary() throws RecognitionException { if (!(_la == ADD || _la == SUB)) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } setState(328); @@ -3100,6 +3146,8 @@ public final UnarynotaddsubContext unarynotaddsub() throws RecognitionException if (!(_la == INCR || _la == DECR)) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } } @@ -3112,6 +3160,8 @@ public final UnarynotaddsubContext unarynotaddsub() throws RecognitionException if (!(_la == BOOLNOT || _la == BWNOT)) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } setState(337); @@ -3292,6 +3342,8 @@ public final PrimordefcasttypeContext primordefcasttype() throws RecognitionExce if (!(_la == PRIMITIVE || _la == DEF)) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } } @@ -3372,6 +3424,7 @@ public final RefcasttypeContext refcasttype() throws RecognitionException { int _la; try { setState(384); + _errHandler.sync(this); switch (_input.LA(1)) { case DEF: enterOuterAlt(_localctx, 1); { @@ -3844,6 +3897,8 @@ public final PrimaryContext primary() throws RecognitionException { - 72)))) != 0))) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } } @@ -4100,6 +4155,8 @@ public final CallinvokeContext callinvoke() throws RecognitionException { if (!(_la == DOT || _la == NSDOT)) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } setState(427); @@ -4162,6 +4219,8 @@ public final FieldaccessContext fieldaccess() throws RecognitionException { if (!(_la == DOT || _la == NSDOT)) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } setState(431); @@ -4169,6 +4228,8 @@ public final FieldaccessContext fieldaccess() throws RecognitionException { if (!(_la == DOTINTEGER || _la == DOTID)) { _errHandler.recoverInline(this); } else { + if (_input.LA(1) == Token.EOF) matchedEOF = true; + _errHandler.reportMatch(this); consume(); } } @@ -4449,6 +4510,7 @@ public final ArrayinitializerContext arrayinitializer() throws RecognitionExcept setState(460); match(LBRACK); setState(469); + _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LBRACE) | (1L << LP) | (1L << NEW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L @@ -4808,6 +4870,7 @@ public final ArgumentsContext arguments() throws RecognitionException { setState(515); match(LP); setState(524); + _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LBRACE) | (1L << LP) | (1L << NEW) | (1L << THIS) | (1L << BOOLNOT) | (1L << BWNOT) | (1L @@ -4978,6 +5041,7 @@ public final LambdaContext lambda() throws RecognitionException { enterOuterAlt(_localctx, 1); { setState(546); + _errHandler.sync(this); switch (_input.LA(1)) { case PRIMITIVE: case DEF: @@ -4990,6 +5054,7 @@ public final LambdaContext lambda() throws RecognitionException { setState(534); match(LP); setState(543); + _errHandler.sync(this); _la = _input.LA(1); if (((((_la - 81)) & ~0x3f) == 0 && ((1L << (_la - 81)) & ((1L << (PRIMITIVE - 81)) | (1L << (DEF - 81)) | (1L << (ID - 81)))) != 0)) { @@ -5025,6 +5090,7 @@ public final LambdaContext lambda() throws RecognitionException { setState(548); match(ARROW); setState(551); + _errHandler.sync(this); switch (_input.LA(1)) { case LBRACK: { setState(549); @@ -5313,7 +5379,7 @@ private boolean noncondexpression_sempred(NoncondexpressionContext _localctx, in return true; } - public static final String _serializedATN = "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3W\u023e\4\2\t\2\4" + public static final String _serializedATN = "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3W\u023e\4\2\t\2\4" + "\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t" + "\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22" + "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31" @@ -5357,12 +5423,12 @@ private boolean noncondexpression_sempred(NoncondexpressionContext _localctx, in + "\5&\u022a\n&\3\'\5\'\u022d\n\'\3\'\3\'\3(\3(\3(\3(\3(\3(\3(\3(\3(\3(\3" + "(\5(\u023c\n(\3(\2\3\")\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*" + ",.\60\62\64\668:<>@BDFHJLN\2\20\3\3\16\16\3\2 \"\3\2#$\3\2:;\3\2%\'\3" - + "\2(+\3\2,/\3\2>I\3\2<=\3\2\36\37\3\2ST\3\2JM\3\2\13\f\3\2VW\u0279\2S\3" - + "\2\2\2\4^\3\2\2\2\6c\3\2\2\2\bw\3\2\2\2\n\u00b5\3\2\2\2\f\u00c8\3\2\2" - + "\2\16\u00cc\3\2\2\2\20\u00ce\3\2\2\2\22\u00da\3\2\2\2\24\u00de\3\2\2\2" - + "\26\u00e0\3\2\2\2\30\u00e2\3\2\2\2\32\u00eb\3\2\2\2\34\u00fd\3\2\2\2\36" - + "\u00ff\3\2\2\2 \u0104\3\2\2\2\"\u010b\3\2\2\2$\u0145\3\2\2\2&\u014c\3" - + "\2\2\2(\u0155\3\2\2\2*\u0161\3\2\2\2,\u0163\3\2\2\2.\u0182\3\2\2\2\60" + + "\2(+\3\2,/\3\2>I\3\2<=\3\2\36\37\3\2ST\3\2JM\3\2\13\f\3\2VW\2\u0279\2" + + "S\3\2\2\2\4^\3\2\2\2\6c\3\2\2\2\bw\3\2\2\2\n\u00b5\3\2\2\2\f\u00c8\3\2" + + "\2\2\16\u00cc\3\2\2\2\20\u00ce\3\2\2\2\22\u00da\3\2\2\2\24\u00de\3\2\2" + + "\2\26\u00e0\3\2\2\2\30\u00e2\3\2\2\2\32\u00eb\3\2\2\2\34\u00fd\3\2\2\2" + + "\36\u00ff\3\2\2\2 \u0104\3\2\2\2\"\u010b\3\2\2\2$\u0145\3\2\2\2&\u014c" + + "\3\2\2\2(\u0155\3\2\2\2*\u0161\3\2\2\2,\u0163\3\2\2\2.\u0182\3\2\2\2\60" + "\u018c\3\2\2\2\62\u01a1\3\2\2\2\64\u01a6\3\2\2\2\66\u01aa\3\2\2\28\u01ac" + "\3\2\2\2:\u01b0\3\2\2\2<\u01b3\3\2\2\2>\u01e0\3\2\2\2@\u01ef\3\2\2\2B" + "\u01ff\3\2\2\2D\u0201\3\2\2\2F\u0205\3\2\2\2H\u0215\3\2\2\2J\u0224\3\2" From e0743954527005f5037f1a2a03cf084b631b7a7e Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Fri, 13 May 2022 17:39:14 -0400 Subject: [PATCH 08/20] Added Adoptium JDK8 support and updated DistroTestPlugin JDK version used by Gradle (#3324) Signed-off-by: Andriy Redko --- .../main/java/org/opensearch/gradle/Jdk.java | 2 +- .../opensearch/gradle/JdkDownloadPlugin.java | 48 ++++++++++++------- .../gradle/test/DistroTestPlugin.java | 4 +- 3 files changed, 35 insertions(+), 19 deletions(-) diff --git a/buildSrc/src/main/java/org/opensearch/gradle/Jdk.java b/buildSrc/src/main/java/org/opensearch/gradle/Jdk.java index 792debe3f350a..53fd998bcc53f 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/Jdk.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/Jdk.java @@ -54,7 +54,7 @@ public class Jdk implements Buildable, Iterable { Arrays.asList("darwin", "freebsd", "linux", "mac", "windows") ); private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d+)(\\.\\d+\\.\\d+)?\\+(\\d+(?:\\.\\d+)?)(@([a-f0-9]{32}))?"); - private static final Pattern LEGACY_VERSION_PATTERN = Pattern.compile("(\\d)(u\\d+)\\+(b\\d+?)(@([a-f0-9]{32}))?"); + private static final Pattern LEGACY_VERSION_PATTERN = Pattern.compile("(\\d)(u\\d+)(?:\\+|\\-)(b\\d+?)(@([a-f0-9]{32}))?"); private final String name; private final Configuration configuration; diff --git a/buildSrc/src/main/java/org/opensearch/gradle/JdkDownloadPlugin.java b/buildSrc/src/main/java/org/opensearch/gradle/JdkDownloadPlugin.java index b9f3036f7aad9..f638f1931cf62 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/JdkDownloadPlugin.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/JdkDownloadPlugin.java @@ -110,22 +110,38 @@ private void setupRepository(Project project, Jdk jdk) { if (jdk.getVendor().equals(VENDOR_ADOPTIUM)) { repoUrl = "https://github.com/adoptium/temurin" + jdk.getMajor() + "-binaries/releases/download/"; - // JDK updates are suffixed with 'U' (fe OpenJDK17U), whereas GA releases are not (fe OpenJDK17). - // To distinguish between those, the GA releases have only major version component (fe 17+32), - // the updates always have minor/patch components (fe 17.0.1+12), checking for the presence of - // version separator '.' should be enough. - artifactPattern = "jdk-" - + jdk.getBaseVersion() - + "+" - + jdk.getBuild() - + "/OpenJDK" - + jdk.getMajor() - + (jdk.getBaseVersion().contains(".") ? "U" : "") - + "-jdk_[classifier]_[module]_hotspot_" - + jdk.getBaseVersion() - + "_" - + jdk.getBuild() - + ".[ext]"; + + if (jdk.getMajor().equals("8")) { + // JDK-8 updates are always suffixed with 'U' (fe OpenJDK8U). + artifactPattern = "jdk" + + jdk.getBaseVersion() + + "-" + + jdk.getBuild() + + "/OpenJDK" + + jdk.getMajor() + + "U" + + "-jdk_[classifier]_[module]_hotspot_" + + jdk.getBaseVersion() + + jdk.getBuild() + + ".[ext]"; + } else { + // JDK updates are suffixed with 'U' (fe OpenJDK17U), whereas GA releases are not (fe OpenJDK17). + // To distinguish between those, the GA releases have only major version component (fe 17+32), + // the updates always have minor/patch components (fe 17.0.1+12), checking for the presence of + // version separator '.' should be enough. + artifactPattern = "jdk-" + + jdk.getBaseVersion() + + "+" + + jdk.getBuild() + + "/OpenJDK" + + jdk.getMajor() + + (jdk.getBaseVersion().contains(".") ? "U" : "") + + "-jdk_[classifier]_[module]_hotspot_" + + jdk.getBaseVersion() + + "_" + + jdk.getBuild() + + ".[ext]"; + } } else if (jdk.getVendor().equals(VENDOR_ADOPTOPENJDK)) { repoUrl = "https://api.adoptopenjdk.net/v3/binary/version/"; if (jdk.getMajor().equals("8")) { diff --git a/buildSrc/src/main/java/org/opensearch/gradle/test/DistroTestPlugin.java b/buildSrc/src/main/java/org/opensearch/gradle/test/DistroTestPlugin.java index c206860bb0117..c947a457d33ec 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/test/DistroTestPlugin.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/test/DistroTestPlugin.java @@ -75,8 +75,8 @@ import java.util.stream.Stream; public class DistroTestPlugin implements Plugin { - private static final String SYSTEM_JDK_VERSION = "8u242+b08"; - private static final String SYSTEM_JDK_VENDOR = "adoptopenjdk"; + private static final String SYSTEM_JDK_VERSION = "11.0.15+10"; + private static final String SYSTEM_JDK_VENDOR = "adoptium"; private static final String GRADLE_JDK_VERSION = "17.0.3+7"; private static final String GRADLE_JDK_VENDOR = "adoptium"; From 11c5195857c64020b893f2757c11767e9073f103 Mon Sep 17 00:00:00 2001 From: Bharathwaj G Date: Mon, 16 May 2022 11:11:53 +0530 Subject: [PATCH 09/20] addressing comments Signed-off-by: Bharathwaj G --- .../java/org/opensearch/client/PitIT.java | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/PitIT.java b/client/rest-high-level/src/test/java/org/opensearch/client/PitIT.java index 13845d029b9a0..99901eabc91aa 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/PitIT.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/PitIT.java @@ -25,24 +25,21 @@ public class PitIT extends OpenSearchRestHighLevelClientTestCase { @Before public void indexDocuments() throws IOException { - { - Request doc1 = new Request(HttpPut.METHOD_NAME, "/index/_doc/1"); - doc1.setJsonEntity("{\"type\":\"type1\", \"id\":1, \"num\":10, \"num2\":50}"); - client().performRequest(doc1); - Request doc2 = new Request(HttpPut.METHOD_NAME, "/index/_doc/2"); - doc2.setJsonEntity("{\"type\":\"type1\", \"id\":2, \"num\":20, \"num2\":40}"); - client().performRequest(doc2); - Request doc3 = new Request(HttpPut.METHOD_NAME, "/index/_doc/3"); - doc3.setJsonEntity("{\"type\":\"type1\", \"id\":3, \"num\":50, \"num2\":35}"); - client().performRequest(doc3); - Request doc4 = new Request(HttpPut.METHOD_NAME, "/index/_doc/4"); - doc4.setJsonEntity("{\"type\":\"type2\", \"id\":4, \"num\":100, \"num2\":10}"); - client().performRequest(doc4); - Request doc5 = new Request(HttpPut.METHOD_NAME, "/index/_doc/5"); - doc5.setJsonEntity("{\"type\":\"type2\", \"id\":5, \"num\":100, \"num2\":10}"); - client().performRequest(doc5); - } - + Request doc1 = new Request(HttpPut.METHOD_NAME, "/index/_doc/1"); + doc1.setJsonEntity("{\"type\":\"type1\", \"id\":1, \"num\":10, \"num2\":50}"); + client().performRequest(doc1); + Request doc2 = new Request(HttpPut.METHOD_NAME, "/index/_doc/2"); + doc2.setJsonEntity("{\"type\":\"type1\", \"id\":2, \"num\":20, \"num2\":40}"); + client().performRequest(doc2); + Request doc3 = new Request(HttpPut.METHOD_NAME, "/index/_doc/3"); + doc3.setJsonEntity("{\"type\":\"type1\", \"id\":3, \"num\":50, \"num2\":35}"); + client().performRequest(doc3); + Request doc4 = new Request(HttpPut.METHOD_NAME, "/index/_doc/4"); + doc4.setJsonEntity("{\"type\":\"type2\", \"id\":4, \"num\":100, \"num2\":10}"); + client().performRequest(doc4); + Request doc5 = new Request(HttpPut.METHOD_NAME, "/index/_doc/5"); + doc5.setJsonEntity("{\"type\":\"type2\", \"id\":5, \"num\":100, \"num2\":10}"); + client().performRequest(doc5); client().performRequest(new Request(HttpPost.METHOD_NAME, "/_refresh")); } From 38fb1d927516d7f769de667682889b8de58458b2 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Mon, 16 May 2022 08:37:41 -0400 Subject: [PATCH 10/20] Add resizable search queue to OpenSearch (picking up #826) (#3207) * Make search/write queue resizable Signed-off-by: Ruizhen * Address PR comments Signed-off-by: Ruizhen * Refactoring resizable queue implementation Signed-off-by: Andriy Redko * Addressing code review comments Signed-off-by: Andriy Redko * Addressing code review comments Signed-off-by: Andriy Redko * Addressing code review comments Signed-off-by: Andriy Redko Co-authored-by: Ruizhen --- .../EWMATrackingThreadPoolExecutor.java | 31 +++ .../util/concurrent/OpenSearchExecutors.java | 26 ++ ...ResizableOpenSearchThreadPoolExecutor.java | 176 ++++++++++++++ ...eResizingOpenSearchThreadPoolExecutor.java | 9 +- .../opensearch/search/query/QueryPhase.java | 6 +- .../threadpool/ResizableExecutorBuilder.java | 116 +++++++++ .../org/opensearch/threadpool/ThreadPool.java | 24 +- ...ableOpenSearchThreadPoolExecutorTests.java | 226 ++++++++++++++++++ ...zingOpenSearchThreadPoolExecutorTests.java | 2 +- .../ThreadPoolSerializationTests.java | 3 + .../test/OpenSearchIntegTestCase.java | 6 - 11 files changed, 600 insertions(+), 25 deletions(-) create mode 100644 server/src/main/java/org/opensearch/common/util/concurrent/EWMATrackingThreadPoolExecutor.java create mode 100644 server/src/main/java/org/opensearch/common/util/concurrent/QueueResizableOpenSearchThreadPoolExecutor.java create mode 100644 server/src/main/java/org/opensearch/threadpool/ResizableExecutorBuilder.java create mode 100644 server/src/test/java/org/opensearch/common/util/concurrent/QueueResizableOpenSearchThreadPoolExecutorTests.java diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/EWMATrackingThreadPoolExecutor.java b/server/src/main/java/org/opensearch/common/util/concurrent/EWMATrackingThreadPoolExecutor.java new file mode 100644 index 0000000000000..ab65c68dadc85 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/util/concurrent/EWMATrackingThreadPoolExecutor.java @@ -0,0 +1,31 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.common.util.concurrent; + +/** + * Marks the thread pool executor as supporting EWMA (exponential weighted moving average) tracking + * + * @opensearch.internal + */ +public interface EWMATrackingThreadPoolExecutor { + /** + * This is a random starting point alpha + */ + double EWMA_ALPHA = 0.3; + + /** + * Returns the exponentially weighted moving average of the task execution time + */ + double getTaskExecutionEWMA(); + + /** + * Returns the current queue size (operations that are queued) + */ + int getCurrentQueueSize(); +} diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchExecutors.java b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchExecutors.java index 094a356151b78..14f9486b4baf0 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchExecutors.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchExecutors.java @@ -177,6 +177,32 @@ public static OpenSearchThreadPoolExecutor newFixed( ); } + public static OpenSearchThreadPoolExecutor newResizable( + String name, + int size, + int queueCapacity, + ThreadFactory threadFactory, + ThreadContext contextHolder + ) { + + if (queueCapacity <= 0) { + throw new IllegalArgumentException("queue capacity for [" + name + "] executor must be positive, got: " + queueCapacity); + } + + return new QueueResizableOpenSearchThreadPoolExecutor( + name, + size, + size, + 0, + TimeUnit.MILLISECONDS, + new ResizableBlockingQueue<>(ConcurrentCollections.newBlockingQueue(), queueCapacity), + TimedRunnable::new, + threadFactory, + new OpenSearchAbortPolicy(), + contextHolder + ); + } + /** * Return a new executor that will automatically adjust the queue size based on queue throughput. * diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/QueueResizableOpenSearchThreadPoolExecutor.java b/server/src/main/java/org/opensearch/common/util/concurrent/QueueResizableOpenSearchThreadPoolExecutor.java new file mode 100644 index 0000000000000..7a0ce8244efe4 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/util/concurrent/QueueResizableOpenSearchThreadPoolExecutor.java @@ -0,0 +1,176 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.common.util.concurrent; + +import org.opensearch.common.ExponentiallyWeightedMovingAverage; + +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; + +/** + * An extension to thread pool executor, which allows to adjusts the queue size of the + * {@code ResizableBlockingQueue} and tracks EWMA. + * + * @opensearch.internal + */ +public final class QueueResizableOpenSearchThreadPoolExecutor extends OpenSearchThreadPoolExecutor + implements + EWMATrackingThreadPoolExecutor { + + private final ResizableBlockingQueue workQueue; + private final Function runnableWrapper; + private final ExponentiallyWeightedMovingAverage executionEWMA; + + /** + * Create new resizable at runtime thread pool executor + * @param name thread pool name + * @param corePoolSize core pool size + * @param maximumPoolSize maximum pool size + * @param keepAliveTime keep alive time + * @param unit time unit for keep alive time + * @param workQueue work queue + * @param runnableWrapper runnable wrapper + * @param threadFactory thread factory + * @param handler rejected execution handler + * @param contextHolder context holder + */ + QueueResizableOpenSearchThreadPoolExecutor( + String name, + int corePoolSize, + int maximumPoolSize, + long keepAliveTime, + TimeUnit unit, + ResizableBlockingQueue workQueue, + Function runnableWrapper, + ThreadFactory threadFactory, + XRejectedExecutionHandler handler, + ThreadContext contextHolder + ) { + this( + name, + corePoolSize, + maximumPoolSize, + keepAliveTime, + unit, + workQueue, + runnableWrapper, + threadFactory, + handler, + contextHolder, + EWMA_ALPHA + ); + } + + /** + * Create new resizable at runtime thread pool executor + * @param name thread pool name + * @param corePoolSize core pool size + * @param maximumPoolSize maximum pool size + * @param keepAliveTime keep alive time + * @param unit time unit for keep alive time + * @param workQueue work queue + * @param runnableWrapper runnable wrapper + * @param threadFactory thread factory + * @param handler rejected execution handler + * @param contextHolder context holder + * @param ewmaAlpha the alpha parameter for exponentially weighted moving average (a smaller alpha means + * that new data points will have less weight, where a high alpha means older data points will + * have a lower influence) + */ + QueueResizableOpenSearchThreadPoolExecutor( + String name, + int corePoolSize, + int maximumPoolSize, + long keepAliveTime, + TimeUnit unit, + ResizableBlockingQueue workQueue, + Function runnableWrapper, + ThreadFactory threadFactory, + XRejectedExecutionHandler handler, + ThreadContext contextHolder, + double ewmaAlpha + ) { + super(name, corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, handler, contextHolder); + this.workQueue = workQueue; + this.runnableWrapper = runnableWrapper; + this.executionEWMA = new ExponentiallyWeightedMovingAverage(ewmaAlpha, 0); + } + + @Override + protected Runnable wrapRunnable(Runnable command) { + return super.wrapRunnable(this.runnableWrapper.apply(command)); + } + + @Override + protected Runnable unwrap(Runnable runnable) { + final Runnable unwrapped = super.unwrap(runnable); + if (unwrapped instanceof WrappedRunnable) { + return ((WrappedRunnable) unwrapped).unwrap(); + } else { + return unwrapped; + } + } + + /** + * Returns the exponentially weighted moving average of the task execution time + */ + @Override + public double getTaskExecutionEWMA() { + return executionEWMA.getAverage(); + } + + /** + * Returns the current queue size (operations that are queued) + */ + @Override + public int getCurrentQueueSize() { + return workQueue.size(); + } + + @Override + protected void afterExecute(Runnable r, Throwable t) { + super.afterExecute(r, t); + // A task has been completed, it has left the building. We should now be able to get the + // total time as a combination of the time in the queue and time spent running the task. We + // only want runnables that did not throw errors though, because they could be fast-failures + // that throw off our timings, so only check when t is null. + assert super.unwrap(r) instanceof TimedRunnable : "expected only TimedRunnables in queue"; + final TimedRunnable timedRunnable = (TimedRunnable) super.unwrap(r); + final boolean failedOrRejected = timedRunnable.getFailedOrRejected(); + + final long taskExecutionNanos = timedRunnable.getTotalExecutionNanos(); + assert taskExecutionNanos >= 0 || (failedOrRejected && taskExecutionNanos == -1) + : "expected task to always take longer than 0 nanoseconds or have '-1' failure code, got: " + + taskExecutionNanos + + ", failedOrRejected: " + + failedOrRejected; + + if (taskExecutionNanos != -1) { + // taskExecutionNanos may be -1 if the task threw an exception + executionEWMA.addValue(taskExecutionNanos); + } + } + + /** + * Resizes the work queue capacity of the pool + * @param capacity the new capacity + */ + public synchronized int resize(int capacity) { + final ResizableBlockingQueue resizableWorkQueue = (ResizableBlockingQueue) workQueue; + final int currentCapacity = resizableWorkQueue.capacity(); + // Reusing adjustCapacity method instead of introducing the new one + return resizableWorkQueue.adjustCapacity( + currentCapacity < capacity ? capacity + 1 : capacity - 1, + StrictMath.abs(capacity - currentCapacity), + capacity, + capacity + ); + } +} diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/QueueResizingOpenSearchThreadPoolExecutor.java b/server/src/main/java/org/opensearch/common/util/concurrent/QueueResizingOpenSearchThreadPoolExecutor.java index 94306906d8c1e..336c605e1a590 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/QueueResizingOpenSearchThreadPoolExecutor.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/QueueResizingOpenSearchThreadPoolExecutor.java @@ -51,10 +51,9 @@ * * @opensearch.internal */ -public final class QueueResizingOpenSearchThreadPoolExecutor extends OpenSearchThreadPoolExecutor { - - // This is a random starting point alpha. TODO: revisit this with actual testing and/or make it configurable - public static double EWMA_ALPHA = 0.3; +public final class QueueResizingOpenSearchThreadPoolExecutor extends OpenSearchThreadPoolExecutor + implements + EWMATrackingThreadPoolExecutor { private static final Logger logger = LogManager.getLogger(QueueResizingOpenSearchThreadPoolExecutor.class); // The amount the queue size is adjusted by for each calcuation @@ -155,6 +154,7 @@ static int calculateL(final double lambda, final long targetedResponseTimeNanos) /** * Returns the exponentially weighted moving average of the task execution time */ + @Override public double getTaskExecutionEWMA() { return executionEWMA.getAverage(); } @@ -162,6 +162,7 @@ public double getTaskExecutionEWMA() { /** * Returns the current queue size (operations that are queued) */ + @Override public int getCurrentQueueSize() { return workQueue.size(); } diff --git a/server/src/main/java/org/opensearch/search/query/QueryPhase.java b/server/src/main/java/org/opensearch/search/query/QueryPhase.java index 340a32e914e08..8de44a7448023 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryPhase.java +++ b/server/src/main/java/org/opensearch/search/query/QueryPhase.java @@ -53,7 +53,7 @@ import org.opensearch.common.Booleans; import org.opensearch.common.lucene.Lucene; import org.opensearch.common.lucene.search.TopDocsAndMaxScore; -import org.opensearch.common.util.concurrent.QueueResizingOpenSearchThreadPoolExecutor; +import org.opensearch.common.util.concurrent.EWMATrackingThreadPoolExecutor; import org.opensearch.search.DocValueFormat; import org.opensearch.search.SearchContextSourcePrinter; import org.opensearch.search.SearchService; @@ -290,8 +290,8 @@ static boolean executeInternal(SearchContext searchContext, QueryPhaseSearcher q ); ExecutorService executor = searchContext.indexShard().getThreadPool().executor(ThreadPool.Names.SEARCH); - if (executor instanceof QueueResizingOpenSearchThreadPoolExecutor) { - QueueResizingOpenSearchThreadPoolExecutor rExecutor = (QueueResizingOpenSearchThreadPoolExecutor) executor; + if (executor instanceof EWMATrackingThreadPoolExecutor) { + final EWMATrackingThreadPoolExecutor rExecutor = (EWMATrackingThreadPoolExecutor) executor; queryResult.nodeQueueSize(rExecutor.getCurrentQueueSize()); queryResult.serviceTimeEWMA((long) rExecutor.getTaskExecutionEWMA()); } diff --git a/server/src/main/java/org/opensearch/threadpool/ResizableExecutorBuilder.java b/server/src/main/java/org/opensearch/threadpool/ResizableExecutorBuilder.java new file mode 100644 index 0000000000000..fd9ca1d3b5f3b --- /dev/null +++ b/server/src/main/java/org/opensearch/threadpool/ResizableExecutorBuilder.java @@ -0,0 +1,116 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.threadpool; + +import org.opensearch.common.settings.Setting; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.SizeValue; +import org.opensearch.common.util.concurrent.OpenSearchExecutors; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.node.Node; + +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.ThreadFactory; + +/** + * A builder for resizable executors. + * + * @opensearch.internal + */ +public final class ResizableExecutorBuilder extends ExecutorBuilder { + + private final Setting sizeSetting; + private final Setting queueSizeSetting; + + ResizableExecutorBuilder(final Settings settings, final String name, final int size, final int queueSize) { + this(settings, name, size, queueSize, "thread_pool." + name); + } + + public ResizableExecutorBuilder(final Settings settings, final String name, final int size, final int queueSize, final String prefix) { + super(name); + final String sizeKey = settingsKey(prefix, "size"); + this.sizeSetting = new Setting<>( + sizeKey, + s -> Integer.toString(size), + s -> Setting.parseInt(s, 1, applyHardSizeLimit(settings, name), sizeKey), + Setting.Property.NodeScope + ); + final String queueSizeKey = settingsKey(prefix, "queue_size"); + this.queueSizeSetting = Setting.intSetting( + queueSizeKey, + queueSize, + new Setting.Property[] { Setting.Property.NodeScope, Setting.Property.Dynamic } + ); + } + + @Override + public List> getRegisteredSettings() { + return Arrays.asList(sizeSetting, queueSizeSetting); + } + + @Override + ResizableExecutorSettings getSettings(Settings settings) { + final String nodeName = Node.NODE_NAME_SETTING.get(settings); + final int size = sizeSetting.get(settings); + final int queueSize = queueSizeSetting.get(settings); + return new ResizableExecutorSettings(nodeName, size, queueSize); + } + + @Override + ThreadPool.ExecutorHolder build(final ResizableExecutorSettings settings, final ThreadContext threadContext) { + int size = settings.size; + int queueSize = settings.queueSize; + final ThreadFactory threadFactory = OpenSearchExecutors.daemonThreadFactory( + OpenSearchExecutors.threadName(settings.nodeName, name()) + ); + final ExecutorService executor = OpenSearchExecutors.newResizable( + settings.nodeName + "/" + name(), + size, + queueSize, + threadFactory, + threadContext + ); + final ThreadPool.Info info = new ThreadPool.Info( + name(), + ThreadPool.ThreadPoolType.RESIZABLE, + size, + size, + null, + queueSize < 0 ? null : new SizeValue(queueSize) + ); + return new ThreadPool.ExecutorHolder(executor, info); + } + + @Override + String formatInfo(ThreadPool.Info info) { + return String.format( + Locale.ROOT, + "name [%s], size [%d], queue size [%s]", + info.getName(), + info.getMax(), + info.getQueueSize() == null ? "unbounded" : info.getQueueSize() + ); + } + + static class ResizableExecutorSettings extends ExecutorBuilder.ExecutorSettings { + + private final int size; + private final int queueSize; + + ResizableExecutorSettings(final String nodeName, final int size, final int queueSize) { + super(nodeName); + this.size = size; + this.queueSize = queueSize; + } + + } +} diff --git a/server/src/main/java/org/opensearch/threadpool/ThreadPool.java b/server/src/main/java/org/opensearch/threadpool/ThreadPool.java index fb62c1243db7d..77682a7946c8f 100644 --- a/server/src/main/java/org/opensearch/threadpool/ThreadPool.java +++ b/server/src/main/java/org/opensearch/threadpool/ThreadPool.java @@ -35,6 +35,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; +import org.opensearch.Version; import org.opensearch.common.Nullable; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; @@ -116,6 +117,7 @@ public static class Names { public enum ThreadPoolType { DIRECT("direct"), FIXED("fixed"), + RESIZABLE("resizable"), FIXED_AUTO_QUEUE_SIZE("fixed_auto_queue_size"), SCALING("scaling"); @@ -158,7 +160,7 @@ public static ThreadPoolType fromType(String type) { map.put(Names.GET, ThreadPoolType.FIXED); map.put(Names.ANALYZE, ThreadPoolType.FIXED); map.put(Names.WRITE, ThreadPoolType.FIXED); - map.put(Names.SEARCH, ThreadPoolType.FIXED_AUTO_QUEUE_SIZE); + map.put(Names.SEARCH, ThreadPoolType.RESIZABLE); map.put(Names.MANAGEMENT, ThreadPoolType.SCALING); map.put(Names.FLUSH, ThreadPoolType.SCALING); map.put(Names.REFRESH, ThreadPoolType.SCALING); @@ -167,7 +169,7 @@ public static ThreadPoolType fromType(String type) { map.put(Names.FORCE_MERGE, ThreadPoolType.FIXED); map.put(Names.FETCH_SHARD_STARTED, ThreadPoolType.SCALING); map.put(Names.FETCH_SHARD_STORE, ThreadPoolType.SCALING); - map.put(Names.SEARCH_THROTTLED, ThreadPoolType.FIXED_AUTO_QUEUE_SIZE); + map.put(Names.SEARCH_THROTTLED, ThreadPoolType.RESIZABLE); map.put(Names.SYSTEM_READ, ThreadPoolType.FIXED); map.put(Names.SYSTEM_WRITE, ThreadPoolType.FIXED); THREAD_POOL_TYPES = Collections.unmodifiableMap(map); @@ -210,14 +212,8 @@ public ThreadPool(final Settings settings, final ExecutorBuilder... customBui builders.put(Names.WRITE, new FixedExecutorBuilder(settings, Names.WRITE, allocatedProcessors, 10000)); builders.put(Names.GET, new FixedExecutorBuilder(settings, Names.GET, allocatedProcessors, 1000)); builders.put(Names.ANALYZE, new FixedExecutorBuilder(settings, Names.ANALYZE, 1, 16)); - builders.put( - Names.SEARCH, - new AutoQueueAdjustingExecutorBuilder(settings, Names.SEARCH, searchThreadPoolSize(allocatedProcessors), 1000, 1000, 1000, 2000) - ); - builders.put( - Names.SEARCH_THROTTLED, - new AutoQueueAdjustingExecutorBuilder(settings, Names.SEARCH_THROTTLED, 1, 100, 100, 100, 200) - ); + builders.put(Names.SEARCH, new ResizableExecutorBuilder(settings, Names.SEARCH, searchThreadPoolSize(allocatedProcessors), 1000)); + builders.put(Names.SEARCH_THROTTLED, new ResizableExecutorBuilder(settings, Names.SEARCH_THROTTLED, 1, 100)); builders.put(Names.MANAGEMENT, new ScalingExecutorBuilder(Names.MANAGEMENT, 1, 5, TimeValue.timeValueMinutes(5))); // no queue as this means clients will need to handle rejections on listener queue even if the operation succeeded // the assumption here is that the listeners should be very lightweight on the listeners side @@ -710,7 +706,13 @@ public Info(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(name); - out.writeString(type.getType()); + if (type == ThreadPoolType.RESIZABLE && out.getVersion().before(Version.V_3_0_0)) { + // Opensearch on older version doesn't know about "resizable" thread pool. Convert RESIZABLE to FIXED + // to avoid serialization/de-serization issue between nodes with different OpenSearch version + out.writeString(ThreadPoolType.FIXED.getType()); + } else { + out.writeString(type.getType()); + } out.writeInt(min); out.writeInt(max); out.writeOptionalTimeValue(keepAlive); diff --git a/server/src/test/java/org/opensearch/common/util/concurrent/QueueResizableOpenSearchThreadPoolExecutorTests.java b/server/src/test/java/org/opensearch/common/util/concurrent/QueueResizableOpenSearchThreadPoolExecutorTests.java new file mode 100644 index 0000000000000..1fa3e3b4c0372 --- /dev/null +++ b/server/src/test/java/org/opensearch/common/util/concurrent/QueueResizableOpenSearchThreadPoolExecutorTests.java @@ -0,0 +1,226 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.common.util.concurrent; + +import org.opensearch.common.settings.Settings; +import org.opensearch.test.OpenSearchTestCase; + +import java.util.concurrent.TimeUnit; +import java.util.function.Function; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.hamcrest.Matchers.lessThanOrEqualTo; + +/** + * Tests for the automatic queue resizing of the {@code QueueResizableOpenSearchThreadPoolExecutor} + * based on the time taken for each event. + */ +public class QueueResizableOpenSearchThreadPoolExecutorTests extends OpenSearchTestCase { + public void testResizeQueueSameSize() throws Exception { + ThreadContext context = new ThreadContext(Settings.EMPTY); + ResizableBlockingQueue queue = new ResizableBlockingQueue<>(ConcurrentCollections.newBlockingQueue(), 2000); + + int threads = randomIntBetween(1, 10); + int measureWindow = randomIntBetween(100, 200); + logger.info("--> auto-queue with a measurement window of {} tasks", measureWindow); + QueueResizableOpenSearchThreadPoolExecutor executor = new QueueResizableOpenSearchThreadPoolExecutor( + "test-threadpool", + threads, + threads, + 1000, + TimeUnit.MILLISECONDS, + queue, + fastWrapper(), + OpenSearchExecutors.daemonThreadFactory("queuetest"), + new OpenSearchAbortPolicy(), + context + ); + executor.prestartAllCoreThreads(); + logger.info("--> executor: {}", executor); + + // Execute a task multiple times that takes 1ms + assertThat(executor.resize(1000), equalTo(1000)); + executeTask(executor, (measureWindow * 5) + 2); + + assertBusy(() -> { assertThat(queue.capacity(), lessThanOrEqualTo(1000)); }); + executor.shutdown(); + executor.awaitTermination(10, TimeUnit.SECONDS); + } + + public void testResizeQueueUp() throws Exception { + ThreadContext context = new ThreadContext(Settings.EMPTY); + ResizableBlockingQueue queue = new ResizableBlockingQueue<>(ConcurrentCollections.newBlockingQueue(), 2000); + + int threads = randomIntBetween(1, 10); + int measureWindow = randomIntBetween(100, 200); + logger.info("--> auto-queue with a measurement window of {} tasks", measureWindow); + QueueResizableOpenSearchThreadPoolExecutor executor = new QueueResizableOpenSearchThreadPoolExecutor( + "test-threadpool", + threads, + threads, + 1000, + TimeUnit.MILLISECONDS, + queue, + fastWrapper(), + OpenSearchExecutors.daemonThreadFactory("queuetest"), + new OpenSearchAbortPolicy(), + context + ); + executor.prestartAllCoreThreads(); + logger.info("--> executor: {}", executor); + + // Execute a task multiple times that takes 1ms + assertThat(executor.resize(3000), equalTo(3000)); + executeTask(executor, (measureWindow * 5) + 2); + + assertBusy(() -> { assertThat(queue.capacity(), greaterThanOrEqualTo(2000)); }); + executor.shutdown(); + executor.awaitTermination(10, TimeUnit.SECONDS); + } + + public void testResizeQueueDown() throws Exception { + ThreadContext context = new ThreadContext(Settings.EMPTY); + ResizableBlockingQueue queue = new ResizableBlockingQueue<>(ConcurrentCollections.newBlockingQueue(), 2000); + + int threads = randomIntBetween(1, 10); + int measureWindow = randomIntBetween(100, 200); + logger.info("--> auto-queue with a measurement window of {} tasks", measureWindow); + QueueResizableOpenSearchThreadPoolExecutor executor = new QueueResizableOpenSearchThreadPoolExecutor( + "test-threadpool", + threads, + threads, + 1000, + TimeUnit.MILLISECONDS, + queue, + fastWrapper(), + OpenSearchExecutors.daemonThreadFactory("queuetest"), + new OpenSearchAbortPolicy(), + context + ); + executor.prestartAllCoreThreads(); + logger.info("--> executor: {}", executor); + + // Execute a task multiple times that takes 1ms + assertThat(executor.resize(900), equalTo(900)); + executeTask(executor, (measureWindow * 5) + 2); + + assertBusy(() -> { assertThat(queue.capacity(), lessThanOrEqualTo(900)); }); + executor.shutdown(); + executor.awaitTermination(10, TimeUnit.SECONDS); + } + + public void testExecutionEWMACalculation() throws Exception { + ThreadContext context = new ThreadContext(Settings.EMPTY); + ResizableBlockingQueue queue = new ResizableBlockingQueue<>(ConcurrentCollections.newBlockingQueue(), 100); + + QueueResizableOpenSearchThreadPoolExecutor executor = new QueueResizableOpenSearchThreadPoolExecutor( + "test-threadpool", + 1, + 1, + 1000, + TimeUnit.MILLISECONDS, + queue, + fastWrapper(), + OpenSearchExecutors.daemonThreadFactory("queuetest"), + new OpenSearchAbortPolicy(), + context + ); + executor.prestartAllCoreThreads(); + logger.info("--> executor: {}", executor); + + assertThat((long) executor.getTaskExecutionEWMA(), equalTo(0L)); + executeTask(executor, 1); + assertBusy(() -> { assertThat((long) executor.getTaskExecutionEWMA(), equalTo(30L)); }); + executeTask(executor, 1); + assertBusy(() -> { assertThat((long) executor.getTaskExecutionEWMA(), equalTo(51L)); }); + executeTask(executor, 1); + assertBusy(() -> { assertThat((long) executor.getTaskExecutionEWMA(), equalTo(65L)); }); + executeTask(executor, 1); + assertBusy(() -> { assertThat((long) executor.getTaskExecutionEWMA(), equalTo(75L)); }); + executeTask(executor, 1); + assertBusy(() -> { assertThat((long) executor.getTaskExecutionEWMA(), equalTo(83L)); }); + + executor.shutdown(); + executor.awaitTermination(10, TimeUnit.SECONDS); + } + + /** Use a runnable wrapper that simulates a task with unknown failures. */ + public void testExceptionThrowingTask() throws Exception { + ThreadContext context = new ThreadContext(Settings.EMPTY); + ResizableBlockingQueue queue = new ResizableBlockingQueue<>(ConcurrentCollections.newBlockingQueue(), 100); + + QueueResizableOpenSearchThreadPoolExecutor executor = new QueueResizableOpenSearchThreadPoolExecutor( + "test-threadpool", + 1, + 1, + 1000, + TimeUnit.MILLISECONDS, + queue, + exceptionalWrapper(), + OpenSearchExecutors.daemonThreadFactory("queuetest"), + new OpenSearchAbortPolicy(), + context + ); + executor.prestartAllCoreThreads(); + logger.info("--> executor: {}", executor); + + assertThat((long) executor.getTaskExecutionEWMA(), equalTo(0L)); + executeTask(executor, 1); + executor.shutdown(); + executor.awaitTermination(10, TimeUnit.SECONDS); + } + + private Function fastWrapper() { + return (runnable) -> new SettableTimedRunnable(TimeUnit.NANOSECONDS.toNanos(100), false); + } + + /** + * The returned function outputs a WrappedRunnabled that simulates the case + * where {@link TimedRunnable#getTotalExecutionNanos()} returns -1 because + * the job failed or was rejected before it finished. + */ + private Function exceptionalWrapper() { + return (runnable) -> new SettableTimedRunnable(TimeUnit.NANOSECONDS.toNanos(-1), true); + } + + /** Execute a blank task {@code times} times for the executor */ + private void executeTask(QueueResizableOpenSearchThreadPoolExecutor executor, int times) { + logger.info("--> executing a task [{}] times", times); + for (int i = 0; i < times; i++) { + executor.execute(() -> {}); + } + } + + public class SettableTimedRunnable extends TimedRunnable { + private final long timeTaken; + private final boolean testFailedOrRejected; + + public SettableTimedRunnable(long timeTaken, boolean failedOrRejected) { + super(() -> {}); + this.timeTaken = timeTaken; + this.testFailedOrRejected = failedOrRejected; + } + + @Override + public long getTotalNanos() { + return timeTaken; + } + + @Override + public long getTotalExecutionNanos() { + return timeTaken; + } + + @Override + public boolean getFailedOrRejected() { + return testFailedOrRejected; + } + } +} diff --git a/server/src/test/java/org/opensearch/common/util/concurrent/QueueResizingOpenSearchThreadPoolExecutorTests.java b/server/src/test/java/org/opensearch/common/util/concurrent/QueueResizingOpenSearchThreadPoolExecutorTests.java index f2bbfe91525f0..3d8faeeee3ec7 100644 --- a/server/src/test/java/org/opensearch/common/util/concurrent/QueueResizingOpenSearchThreadPoolExecutorTests.java +++ b/server/src/test/java/org/opensearch/common/util/concurrent/QueueResizingOpenSearchThreadPoolExecutorTests.java @@ -44,7 +44,7 @@ import static org.hamcrest.Matchers.lessThan; /** - * Tests for the automatic queue resizing of the {@code QueueResizingOpenSearchThreadPoolExecutorTests} + * Tests for the automatic queue resizing of the {@code QueueResizingOpenSearchThreadPoolExecutor} * based on the time taken for each event. */ public class QueueResizingOpenSearchThreadPoolExecutorTests extends OpenSearchTestCase { diff --git a/server/src/test/java/org/opensearch/threadpool/ThreadPoolSerializationTests.java b/server/src/test/java/org/opensearch/threadpool/ThreadPoolSerializationTests.java index 6623cb0e18819..80434519b0d88 100644 --- a/server/src/test/java/org/opensearch/threadpool/ThreadPoolSerializationTests.java +++ b/server/src/test/java/org/opensearch/threadpool/ThreadPoolSerializationTests.java @@ -141,6 +141,9 @@ public void testThatThreadPoolTypeIsSerializedCorrectly() throws IOException { StreamInput input = output.bytes().streamInput(); ThreadPool.Info newInfo = new ThreadPool.Info(input); + /* The SerDe patch converts RESIZABLE threadpool type value to FIXED. Implementing + * the same conversion in test to maintain parity. + */ assertThat(newInfo.getThreadPoolType(), is(threadPoolType)); } } diff --git a/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java b/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java index f36f4dedfdfaa..1af6b03ff24af 100644 --- a/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java @@ -1895,12 +1895,6 @@ protected Settings nodeSettings(int nodeOrdinal) { .put(SearchService.LOW_LEVEL_CANCELLATION_SETTING.getKey(), randomBoolean()) .putList(DISCOVERY_SEED_HOSTS_SETTING.getKey()) // empty list disables a port scan for other nodes .putList(DISCOVERY_SEED_PROVIDERS_SETTING.getKey(), "file"); - if (rarely()) { - // Sometimes adjust the minimum search thread pool size, causing - // QueueResizingOpenSearchThreadPoolExecutor to be used instead of a regular - // fixed thread pool - builder.put("thread_pool.search.min_queue_size", 100); - } return builder.build(); } From e2ad4ffbe9dc98ce6a87c99f5839eaadf7f6bc33 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Mon, 16 May 2022 05:45:17 -0700 Subject: [PATCH 11/20] Replace 'master' terminology with 'cluster manager' in 'qa' directory (#3330) * Replace 'master' terminology with 'cluster manager' in 'qa' directory Signed-off-by: Tianli Feng * Replace master_node with cluster_manager_node in cluster.state API test Signed-off-by: Tianli Feng --- .../opensearch/upgrades/FullClusterRestartIT.java | 2 +- .../java/org/opensearch/backwards/IndexingIT.java | 14 +++++++------- qa/multi-cluster-search/build.gradle | 2 +- .../java/org/opensearch/upgrades/RecoveryIT.java | 12 ++++++------ qa/smoke-test-ingest-disabled/build.gradle | 2 +- .../test/smoke_test_plugins/10_basic.yml | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/qa/full-cluster-restart/src/test/java/org/opensearch/upgrades/FullClusterRestartIT.java b/qa/full-cluster-restart/src/test/java/org/opensearch/upgrades/FullClusterRestartIT.java index a8302fdd6bc76..714d8a252579f 100644 --- a/qa/full-cluster-restart/src/test/java/org/opensearch/upgrades/FullClusterRestartIT.java +++ b/qa/full-cluster-restart/src/test/java/org/opensearch/upgrades/FullClusterRestartIT.java @@ -659,7 +659,7 @@ public void testEmptyShard() throws IOException { .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1) // if the node with the replica is the first to be restarted, while a replica is still recovering - // then delayed allocation will kick in. When the node comes back, the master will search for a copy + // then delayed allocation will kick in. When the node comes back, the cluster-manager will search for a copy // but the recovering copy will be seen as invalid and the cluster health won't return to GREEN // before timing out .put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms") diff --git a/qa/mixed-cluster/src/test/java/org/opensearch/backwards/IndexingIT.java b/qa/mixed-cluster/src/test/java/org/opensearch/backwards/IndexingIT.java index b133a6462a525..69c4f0110a3ff 100644 --- a/qa/mixed-cluster/src/test/java/org/opensearch/backwards/IndexingIT.java +++ b/qa/mixed-cluster/src/test/java/org/opensearch/backwards/IndexingIT.java @@ -429,23 +429,23 @@ private Nodes buildNodeAndVersions() throws IOException { HttpHost.create(objectPath.evaluate("nodes." + id + ".http.publish_address")))); } response = client().performRequest(new Request("GET", "_cluster/state")); - nodes.setMasterNodeId(ObjectPath.createFromResponse(response).evaluate("master_node")); + nodes.setClusterManagerNodeId(ObjectPath.createFromResponse(response).evaluate("master_node")); return nodes; } final class Nodes extends HashMap { - private String masterNodeId = null; + private String clusterManagerNodeId = null; - public Node getMaster() { - return get(masterNodeId); + public Node getClusterManager() { + return get(clusterManagerNodeId); } - public void setMasterNodeId(String id) { + public void setClusterManagerNodeId(String id) { if (get(id) == null) { throw new IllegalArgumentException("node with id [" + id + "] not found. got:" + toString()); } - masterNodeId = id; + clusterManagerNodeId = id; } public void add(Node node) { @@ -480,7 +480,7 @@ public Node getSafe(String id) { @Override public String toString() { return "Nodes{" + - "masterNodeId='" + masterNodeId + "'\n" + + "masterNodeId='" + clusterManagerNodeId + "'\n" + values().stream().map(Node::toString).collect(Collectors.joining("\n")) + '}'; } diff --git a/qa/multi-cluster-search/build.gradle b/qa/multi-cluster-search/build.gradle index 64aabf602e501..907791bd6a7de 100644 --- a/qa/multi-cluster-search/build.gradle +++ b/qa/multi-cluster-search/build.gradle @@ -45,7 +45,7 @@ task 'remote-cluster'(type: RestIntegTestTask) { testClusters.'remote-cluster' { numberOfNodes = 2 - setting 'node.roles', '[data,ingest,master]' + setting 'node.roles', '[data,ingest,cluster_manager]' } task mixedClusterTest(type: RestIntegTestTask) { diff --git a/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/RecoveryIT.java b/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/RecoveryIT.java index 687fd1743c3d3..cbf91fa9d71e7 100644 --- a/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/RecoveryIT.java +++ b/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/RecoveryIT.java @@ -90,7 +90,7 @@ public void testHistoryUUIDIsGenerated() throws Exception { .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1) // if the node with the replica is the first to be restarted, while a replica is still recovering - // then delayed allocation will kick in. When the node comes back, the master will search for a copy + // then delayed allocation will kick in. When the node comes back, the cluster-manager will search for a copy // but the recovering copy will be seen as invalid and the cluster health won't return to GREEN // before timing out .put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms"); @@ -158,7 +158,7 @@ public void testRecoveryWithConcurrentIndexing() throws Exception { .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 2) // if the node with the replica is the first to be restarted, while a replica is still recovering - // then delayed allocation will kick in. When the node comes back, the master will search for a copy + // then delayed allocation will kick in. When the node comes back, the cluster-manager will search for a copy // but the recovering copy will be seen as invalid and the cluster health won't return to GREEN // before timing out .put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms") @@ -256,7 +256,7 @@ public void testRelocationWithConcurrentIndexing() throws Exception { .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 2) // if the node with the replica is the first to be restarted, while a replica is still recovering - // then delayed allocation will kick in. When the node comes back, the master will search for a copy + // then delayed allocation will kick in. When the node comes back, the cluster-manager will search for a copy // but the recovering copy will be seen as invalid and the cluster health won't return to GREEN // before timing out .put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms") @@ -266,7 +266,7 @@ public void testRelocationWithConcurrentIndexing() throws Exception { indexDocs(index, 0, 10); ensureGreen(index); // make sure that no shards are allocated, so we can make sure the primary stays on the old node (when one - // node stops, we lose the master too, so a replica will not be promoted) + // node stops, we lose the cluster-manager too, so a replica will not be promoted) updateIndexSettings(index, Settings.builder().put(INDEX_ROUTING_ALLOCATION_ENABLE_SETTING.getKey(), "none")); break; case MIXED: @@ -330,7 +330,7 @@ public void testRecovery() throws Exception { .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1) // if the node with the replica is the first to be restarted, while a replica is still recovering - // then delayed allocation will kick in. When the node comes back, the master will search for a copy + // then delayed allocation will kick in. When the node comes back, the cluster-manager will search for a copy // but the recovering copy will be seen as invalid and the cluster health won't return to GREEN // before timing out .put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms") @@ -448,7 +448,7 @@ public void testRecoveryClosedIndex() throws Exception { .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1) // if the node with the replica is the first to be restarted, while a replica is still recovering - // then delayed allocation will kick in. When the node comes back, the master will search for a copy + // then delayed allocation will kick in. When the node comes back, the cluster-manager will search for a copy // but the recovering copy will be seen as invalid and the cluster health won't return to GREEN // before timing out .put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms") diff --git a/qa/smoke-test-ingest-disabled/build.gradle b/qa/smoke-test-ingest-disabled/build.gradle index d7676a5b5ecbd..79abbf84fbc09 100644 --- a/qa/smoke-test-ingest-disabled/build.gradle +++ b/qa/smoke-test-ingest-disabled/build.gradle @@ -38,5 +38,5 @@ dependencies { } testClusters.integTest { - setting 'node.roles', '[data,master,remote_cluster_client]' + setting 'node.roles', '[data,cluster_manager,remote_cluster_client]' } diff --git a/qa/smoke-test-plugins/src/test/resources/rest-api-spec/test/smoke_test_plugins/10_basic.yml b/qa/smoke-test-plugins/src/test/resources/rest-api-spec/test/smoke_test_plugins/10_basic.yml index 6a92845a062aa..a4c8d4baabd1b 100644 --- a/qa/smoke-test-plugins/src/test/resources/rest-api-spec/test/smoke_test_plugins/10_basic.yml +++ b/qa/smoke-test-plugins/src/test/resources/rest-api-spec/test/smoke_test_plugins/10_basic.yml @@ -4,10 +4,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - length: { nodes.$master.plugins: ${expected.plugins.count} } + - length: { nodes.$cluster_manager.plugins: ${expected.plugins.count} } From 5a02949bbe45187b7b9f2bfb17480fe2171ef6fa Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Mon, 16 May 2022 05:46:01 -0700 Subject: [PATCH 12/20] Replace 'master' terminology with 'cluster manager' in 'modules' directory (#3328) * Replace 'master' terminology with 'cluster manager' in modules directory Signed-off-by: Tianli Feng * Replace 'master' with 'cluster_manager' in yaml rest test files Signed-off-by: Tianli Feng * Replace master_node with cluster_manager_node in cluster.state API test Signed-off-by: Tianli Feng --- .../rest-api-spec/test/stats/10_basic.yml | 6 +- .../test/analysis-common/10_basic.yml | 6 +- .../rest-api-spec/test/ingest/10_basic.yml | 54 +++++++------- .../rest-api-spec/test/ingest/70_bulk.yml | 40 +++++------ .../geoip/DatabaseReaderLazyLoader.java | 2 +- .../test/ingest_geoip/10_basic.yml | 6 +- .../test/ingest-useragent/10_basic.yml | 6 +- .../test/lang_expression/10_basic.yml | 6 +- .../test/lang_mustache/10_basic.yml | 6 +- .../rest-api-spec/test/painless/10_basic.yml | 6 +- .../index/mapper/metricbeat-6.0.template.json | 4 +- .../join/aggregations/ChildrenIT.java | 10 ++- .../opensearch/index/reindex/RetryTests.java | 14 ++-- .../rest-api-spec/test/reindex/90_remote.yml | 72 +++++++++---------- .../test/reindex/95_parent_join.yml | 8 +-- .../test/repository_url/10_basic.yml | 6 +- .../resources/rest-api-spec/test/10_basic.yml | 6 +- 17 files changed, 128 insertions(+), 130 deletions(-) diff --git a/modules/aggs-matrix-stats/src/yamlRestTest/resources/rest-api-spec/test/stats/10_basic.yml b/modules/aggs-matrix-stats/src/yamlRestTest/resources/rest-api-spec/test/stats/10_basic.yml index 2416d2b2b3141..b983a3960c64e 100644 --- a/modules/aggs-matrix-stats/src/yamlRestTest/resources/rest-api-spec/test/stats/10_basic.yml +++ b/modules/aggs-matrix-stats/src/yamlRestTest/resources/rest-api-spec/test/stats/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.modules: { name: aggs-matrix-stats } } + - contains: { nodes.$cluster_manager.modules: { name: aggs-matrix-stats } } diff --git a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/analysis-common/10_basic.yml b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/analysis-common/10_basic.yml index ca6cd2e953be4..c42438797496c 100644 --- a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/analysis-common/10_basic.yml +++ b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/analysis-common/10_basic.yml @@ -5,10 +5,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.modules: { name: analysis-common } } + - contains: { nodes.$cluster_manager.modules: { name: analysis-common } } diff --git a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/10_basic.yml b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/10_basic.yml index 8a803eae1fc3d..f44cc1f9f9fcf 100644 --- a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/10_basic.yml +++ b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/10_basic.yml @@ -5,34 +5,34 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.modules: { name: ingest-common } } - - contains: { nodes.$master.ingest.processors: { type: append } } - - contains: { nodes.$master.ingest.processors: { type: bytes } } - - contains: { nodes.$master.ingest.processors: { type: convert } } - - contains: { nodes.$master.ingest.processors: { type: date } } - - contains: { nodes.$master.ingest.processors: { type: date_index_name } } - - contains: { nodes.$master.ingest.processors: { type: dissect } } - - contains: { nodes.$master.ingest.processors: { type: dot_expander } } - - contains: { nodes.$master.ingest.processors: { type: fail } } - - contains: { nodes.$master.ingest.processors: { type: foreach } } - - contains: { nodes.$master.ingest.processors: { type: grok } } - - contains: { nodes.$master.ingest.processors: { type: gsub } } - - contains: { nodes.$master.ingest.processors: { type: html_strip } } - - contains: { nodes.$master.ingest.processors: { type: join } } - - contains: { nodes.$master.ingest.processors: { type: json } } - - contains: { nodes.$master.ingest.processors: { type: kv } } - - contains: { nodes.$master.ingest.processors: { type: lowercase } } - - contains: { nodes.$master.ingest.processors: { type: remove } } - - contains: { nodes.$master.ingest.processors: { type: rename } } - - contains: { nodes.$master.ingest.processors: { type: script } } - - contains: { nodes.$master.ingest.processors: { type: set } } - - contains: { nodes.$master.ingest.processors: { type: sort } } - - contains: { nodes.$master.ingest.processors: { type: split } } - - contains: { nodes.$master.ingest.processors: { type: trim } } - - contains: { nodes.$master.ingest.processors: { type: uppercase } } + - contains: { nodes.$cluster_manager.modules: { name: ingest-common } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: append } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: bytes } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: convert } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: date } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: date_index_name } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: dissect } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: dot_expander } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: fail } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: foreach } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: grok } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: gsub } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: html_strip } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: join } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: json } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: kv } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: lowercase } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: remove } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: rename } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: script } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: set } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: sort } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: split } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: trim } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: uppercase } } diff --git a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/70_bulk.yml b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/70_bulk.yml index 5b442456e64d0..2dfa17174b139 100644 --- a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/70_bulk.yml +++ b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/70_bulk.yml @@ -77,21 +77,21 @@ teardown: - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.stats: metric: [ ingest ] #we can't assert anything here since we might have more than one node in the cluster - - gte: {nodes.$master.ingest.total.count: 0} - - gte: {nodes.$master.ingest.total.failed: 0} - - gte: {nodes.$master.ingest.total.time_in_millis: 0} - - match: {nodes.$master.ingest.total.current: 0} - - gte: {nodes.$master.ingest.pipelines.pipeline1.count: 0} - - match: {nodes.$master.ingest.pipelines.pipeline1.failed: 0} - - gte: {nodes.$master.ingest.pipelines.pipeline1.time_in_millis: 0} - - match: {nodes.$master.ingest.pipelines.pipeline1.current: 0} + - gte: {nodes.$cluster_manager.ingest.total.count: 0} + - gte: {nodes.$cluster_manager.ingest.total.failed: 0} + - gte: {nodes.$cluster_manager.ingest.total.time_in_millis: 0} + - match: {nodes.$cluster_manager.ingest.total.current: 0} + - gte: {nodes.$cluster_manager.ingest.pipelines.pipeline1.count: 0} + - match: {nodes.$cluster_manager.ingest.pipelines.pipeline1.failed: 0} + - gte: {nodes.$cluster_manager.ingest.pipelines.pipeline1.time_in_millis: 0} + - match: {nodes.$cluster_manager.ingest.pipelines.pipeline1.current: 0} --- "Test bulk request with default pipeline": @@ -113,21 +113,21 @@ teardown: - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.stats: metric: [ ingest ] #we can't assert anything here since we might have more than one node in the cluster - - gte: {nodes.$master.ingest.total.count: 0} - - gte: {nodes.$master.ingest.total.failed: 0} - - gte: {nodes.$master.ingest.total.time_in_millis: 0} - - match: {nodes.$master.ingest.total.current: 0} - - gte: {nodes.$master.ingest.pipelines.pipeline2.count: 0} - - match: {nodes.$master.ingest.pipelines.pipeline2.failed: 0} - - gte: {nodes.$master.ingest.pipelines.pipeline2.time_in_millis: 0} - - match: {nodes.$master.ingest.pipelines.pipeline2.current: 0} + - gte: {nodes.$cluster_manager.ingest.total.count: 0} + - gte: {nodes.$cluster_manager.ingest.total.failed: 0} + - gte: {nodes.$cluster_manager.ingest.total.time_in_millis: 0} + - match: {nodes.$cluster_manager.ingest.total.current: 0} + - gte: {nodes.$cluster_manager.ingest.pipelines.pipeline2.count: 0} + - match: {nodes.$cluster_manager.ingest.pipelines.pipeline2.failed: 0} + - gte: {nodes.$cluster_manager.ingest.pipelines.pipeline2.time_in_millis: 0} + - match: {nodes.$cluster_manager.ingest.pipelines.pipeline2.current: 0} - do: get: diff --git a/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/DatabaseReaderLazyLoader.java b/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/DatabaseReaderLazyLoader.java index 1cafae0e50cef..70feb44f0f385 100644 --- a/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/DatabaseReaderLazyLoader.java +++ b/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/DatabaseReaderLazyLoader.java @@ -71,7 +71,7 @@ class DatabaseReaderLazyLoader implements Closeable { /** * Read the database type from the database. We do this manually instead of relying on the built-in mechanism to avoid reading the - * entire database into memory merely to read the type. This is especially important to maintain on master nodes where pipelines are + * entire database into memory merely to read the type. This is especially important to maintain on cluster-manager nodes where pipelines are * validated. If we read the entire database into memory, we could potentially run into low-memory constraints on such nodes where * loading this data would otherwise be wasteful if they are not also ingest nodes. * diff --git a/modules/ingest-geoip/src/yamlRestTest/resources/rest-api-spec/test/ingest_geoip/10_basic.yml b/modules/ingest-geoip/src/yamlRestTest/resources/rest-api-spec/test/ingest_geoip/10_basic.yml index 5cd45da2bda38..3b414022ede66 100644 --- a/modules/ingest-geoip/src/yamlRestTest/resources/rest-api-spec/test/ingest_geoip/10_basic.yml +++ b/modules/ingest-geoip/src/yamlRestTest/resources/rest-api-spec/test/ingest_geoip/10_basic.yml @@ -5,10 +5,10 @@ - do: cluster.state: {} - - set: {master_node: master} + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.modules: { name: ingest-geoip } } - - contains: { nodes.$master.ingest.processors: { type: geoip } } + - contains: { nodes.$cluster_manager.modules: { name: ingest-geoip } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: geoip } } diff --git a/modules/ingest-user-agent/src/yamlRestTest/resources/rest-api-spec/test/ingest-useragent/10_basic.yml b/modules/ingest-user-agent/src/yamlRestTest/resources/rest-api-spec/test/ingest-useragent/10_basic.yml index 327d9cf451257..c0e1d14489a64 100644 --- a/modules/ingest-user-agent/src/yamlRestTest/resources/rest-api-spec/test/ingest-useragent/10_basic.yml +++ b/modules/ingest-user-agent/src/yamlRestTest/resources/rest-api-spec/test/ingest-useragent/10_basic.yml @@ -5,10 +5,10 @@ - do: cluster.state: {} - - set: {master_node: master} + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.modules: { name: ingest-user-agent } } - - contains: { nodes.$master.ingest.processors: { type: user_agent } } + - contains: { nodes.$cluster_manager.modules: { name: ingest-user-agent } } + - contains: { nodes.$cluster_manager.ingest.processors: { type: user_agent } } diff --git a/modules/lang-expression/src/yamlRestTest/resources/rest-api-spec/test/lang_expression/10_basic.yml b/modules/lang-expression/src/yamlRestTest/resources/rest-api-spec/test/lang_expression/10_basic.yml index 00ad6f890b0e0..d56ad1a8a244c 100644 --- a/modules/lang-expression/src/yamlRestTest/resources/rest-api-spec/test/lang_expression/10_basic.yml +++ b/modules/lang-expression/src/yamlRestTest/resources/rest-api-spec/test/lang_expression/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.modules: { name: lang-expression } } + - contains: { nodes.$cluster_manager.modules: { name: lang-expression } } diff --git a/modules/lang-mustache/src/yamlRestTest/resources/rest-api-spec/test/lang_mustache/10_basic.yml b/modules/lang-mustache/src/yamlRestTest/resources/rest-api-spec/test/lang_mustache/10_basic.yml index 0e853d6273142..5fc67b766cb1a 100644 --- a/modules/lang-mustache/src/yamlRestTest/resources/rest-api-spec/test/lang_mustache/10_basic.yml +++ b/modules/lang-mustache/src/yamlRestTest/resources/rest-api-spec/test/lang_mustache/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.modules: { name: lang-mustache } } + - contains: { nodes.$cluster_manager.modules: { name: lang-mustache } } diff --git a/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/10_basic.yml b/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/10_basic.yml index e442b40ffb845..a2458269b7aa1 100644 --- a/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/10_basic.yml +++ b/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.modules: { name: lang-painless } } + - contains: { nodes.$cluster_manager.modules: { name: lang-painless } } diff --git a/modules/mapper-extras/src/test/resources/org/opensearch/index/mapper/metricbeat-6.0.template.json b/modules/mapper-extras/src/test/resources/org/opensearch/index/mapper/metricbeat-6.0.template.json index f456755feeb93..5a83dbd2128c4 100644 --- a/modules/mapper-extras/src/test/resources/org/opensearch/index/mapper/metricbeat-6.0.template.json +++ b/modules/mapper-extras/src/test/resources/org/opensearch/index/mapper/metricbeat-6.0.template.json @@ -229,7 +229,7 @@ }, "objects": { "properties": { - "master": { + "primary": { "type": "long" }, "total": { @@ -4601,7 +4601,7 @@ "connected_replicas": { "type": "long" }, - "master_offset": { + "primary_offset": { "type": "long" }, "role": { diff --git a/modules/parent-join/src/internalClusterTest/java/org/opensearch/join/aggregations/ChildrenIT.java b/modules/parent-join/src/internalClusterTest/java/org/opensearch/join/aggregations/ChildrenIT.java index 08354cbaaf93b..72c502c616ff8 100644 --- a/modules/parent-join/src/internalClusterTest/java/org/opensearch/join/aggregations/ChildrenIT.java +++ b/modules/parent-join/src/internalClusterTest/java/org/opensearch/join/aggregations/ChildrenIT.java @@ -227,7 +227,7 @@ public void testNonExistingChildType() throws Exception { public void testPostCollection() throws Exception { String indexName = "prodcatalog"; - String masterType = "masterprod"; + String mainType = "mainprod"; String childType = "variantsku"; assertAcked( prepareCreate(indexName).setSettings( @@ -235,7 +235,7 @@ public void testPostCollection() throws Exception { ) .setMapping( addFieldMappings( - buildParentJoinFieldMappingFromSimplifiedDef("join_field", true, masterType, childType), + buildParentJoinFieldMappingFromSimplifiedDef("join_field", true, mainType, childType), "brand", "text", "name", @@ -251,7 +251,7 @@ public void testPostCollection() throws Exception { ); List requests = new ArrayList<>(); - requests.add(createIndexRequest(indexName, masterType, "1", null, "brand", "Levis", "name", "Style 501", "material", "Denim")); + requests.add(createIndexRequest(indexName, mainType, "1", null, "brand", "Levis", "name", "Style 501", "material", "Denim")); requests.add(createIndexRequest(indexName, childType, "3", "1", "color", "blue", "size", "32")); requests.add(createIndexRequest(indexName, childType, "4", "1", "color", "blue", "size", "34")); requests.add(createIndexRequest(indexName, childType, "5", "1", "color", "blue", "size", "36")); @@ -259,9 +259,7 @@ public void testPostCollection() throws Exception { requests.add(createIndexRequest(indexName, childType, "7", "1", "color", "black", "size", "40")); requests.add(createIndexRequest(indexName, childType, "8", "1", "color", "gray", "size", "36")); - requests.add( - createIndexRequest(indexName, masterType, "2", null, "brand", "Wrangler", "name", "Regular Cut", "material", "Leather") - ); + requests.add(createIndexRequest(indexName, mainType, "2", null, "brand", "Wrangler", "name", "Regular Cut", "material", "Leather")); requests.add(createIndexRequest(indexName, childType, "9", "2", "color", "blue", "size", "32")); requests.add(createIndexRequest(indexName, childType, "10", "2", "color", "blue", "size", "34")); requests.add(createIndexRequest(indexName, childType, "12", "2", "color", "black", "size", "36")); diff --git a/modules/reindex/src/test/java/org/opensearch/index/reindex/RetryTests.java b/modules/reindex/src/test/java/org/opensearch/index/reindex/RetryTests.java index 124670dba9510..1c1a55bf59537 100644 --- a/modules/reindex/src/test/java/org/opensearch/index/reindex/RetryTests.java +++ b/modules/reindex/src/test/java/org/opensearch/index/reindex/RetryTests.java @@ -118,18 +118,18 @@ public void testReindex() throws Exception { public void testReindexFromRemote() throws Exception { Function> function = client -> { /* - * Use the master node for the reindex from remote because that node + * Use the cluster-manager node for the reindex from remote because that node * doesn't have a copy of the data on it. */ - NodeInfo masterNode = null; + NodeInfo clusterManagerNode = null; for (NodeInfo candidate : client.admin().cluster().prepareNodesInfo().get().getNodes()) { if (candidate.getNode().isMasterNode()) { - masterNode = candidate; + clusterManagerNode = candidate; } } - assertNotNull(masterNode); + assertNotNull(clusterManagerNode); - TransportAddress address = masterNode.getInfo(HttpInfo.class).getAddress().publishAddress(); + TransportAddress address = clusterManagerNode.getInfo(HttpInfo.class).getAddress().publishAddress(); RemoteInfo remote = new RemoteInfo( "http", address.getAddress(), @@ -262,8 +262,8 @@ private CyclicBarrier blockExecutor(String name, String node) throws Exception { */ private BulkByScrollTask.Status taskStatus(String action) { /* - * We always use the master client because we always start the test requests on the - * master. We do this simply to make sure that the test request is not started on the + * We always use the cluster-manager client because we always start the test requests on the + * cluster-manager. We do this simply to make sure that the test request is not started on the * node who's queue we're manipulating. */ ListTasksResponse response = client().admin().cluster().prepareListTasks().setActions(action).setDetailed(true).get(); diff --git a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/90_remote.yml b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/90_remote.yml index ac8d0730ff283..b30f7fc73222b 100644 --- a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/90_remote.yml +++ b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/90_remote.yml @@ -7,15 +7,15 @@ body: { "text": "test" } refresh: true - # Fetch the http host. We use the host of the master because we know there will always be a master. + # Fetch the http host. We use the host of the cluster-manager because we know there will always be a cluster-manager. - do: cluster.state: {} - - set: { master_node: master } + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: metric: [ http ] - - is_true: nodes.$master.http.publish_address - - set: {nodes.$master.http.publish_address: host} + - is_true: nodes.$cluster_manager.http.publish_address + - set: {nodes.$cluster_manager.http.publish_address: host} - do: reindex: refresh: true @@ -68,15 +68,15 @@ - do: indices.refresh: {} - # Fetch the http host. We use the host of the master because we know there will always be a master. + # Fetch the http host. We use the host of the cluster-manager because we know there will always be a cluster-manager. - do: cluster.state: {} - - set: { master_node: master } + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: metric: [ http ] - - is_true: nodes.$master.http.publish_address - - set: {nodes.$master.http.publish_address: host} + - is_true: nodes.$cluster_manager.http.publish_address + - set: {nodes.$cluster_manager.http.publish_address: host} - do: reindex: refresh: true @@ -118,15 +118,15 @@ routing: foo refresh: true - # Fetch the http host. We use the host of the master because we know there will always be a master. + # Fetch the http host. We use the host of the cluster-manager because we know there will always be a cluster-manager. - do: cluster.state: {} - - set: { master_node: master } + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: metric: [ http ] - - is_true: nodes.$master.http.publish_address - - set: {nodes.$master.http.publish_address: host} + - is_true: nodes.$cluster_manager.http.publish_address + - set: {nodes.$cluster_manager.http.publish_address: host} - do: reindex: refresh: true @@ -169,15 +169,15 @@ body: { "text": "test" } refresh: true - # Fetch the http host. We use the host of the master because we know there will always be a master. + # Fetch the http host. We use the host of the cluster-manager because we know there will always be a cluster-manager. - do: cluster.state: {} - - set: { master_node: master } + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: metric: [ http ] - - is_true: nodes.$master.http.publish_address - - set: {nodes.$master.http.publish_address: host} + - is_true: nodes.$cluster_manager.http.publish_address + - set: {nodes.$cluster_manager.http.publish_address: host} - do: reindex: refresh: true @@ -236,15 +236,15 @@ body: { "text": "test" } refresh: true - # Fetch the http host. We use the host of the master because we know there will always be a master. + # Fetch the http host. We use the host of the cluster-manager because we know there will always be a cluster-manager. - do: cluster.state: {} - - set: { master_node: master } + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: metric: [ http ] - - is_true: nodes.$master.http.publish_address - - set: {nodes.$master.http.publish_address: host} + - is_true: nodes.$cluster_manager.http.publish_address + - set: {nodes.$cluster_manager.http.publish_address: host} - do: reindex: refresh: true @@ -302,15 +302,15 @@ body: { "text": "test" } refresh: true - # Fetch the http host. We use the host of the master because we know there will always be a master. + # Fetch the http host. We use the host of the cluster-manager because we know there will always be a cluster-manager. - do: cluster.state: {} - - set: { master_node: master } + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: metric: [ http ] - - is_true: nodes.$master.http.publish_address - - set: {nodes.$master.http.publish_address: host} + - is_true: nodes.$cluster_manager.http.publish_address + - set: {nodes.$cluster_manager.http.publish_address: host} - do: reindex: refresh: true @@ -358,15 +358,15 @@ body: { "text": "test" } refresh: true - # Fetch the http host. We use the host of the master because we know there will always be a master. + # Fetch the http host. We use the host of the cluster-manager because we know there will always be a cluster-manager. - do: cluster.state: {} - - set: { master_node: master } + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: metric: [ http ] - - is_true: nodes.$master.http.publish_address - - set: {nodes.$master.http.publish_address: host} + - is_true: nodes.$cluster_manager.http.publish_address + - set: {nodes.$cluster_manager.http.publish_address: host} - do: catch: /query malformed, no start_object after query name/ reindex: @@ -411,15 +411,15 @@ body: { "text": "test", "filtered": "removed" } refresh: true - # Fetch the http host. We use the host of the master because we know there will always be a master. + # Fetch the http host. We use the host of the cluster-manager because we know there will always be a cluster-manager. - do: cluster.state: {} - - set: { master_node: master } + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: metric: [ http ] - - is_true: nodes.$master.http.publish_address - - set: {nodes.$master.http.publish_address: host} + - is_true: nodes.$cluster_manager.http.publish_address + - set: {nodes.$cluster_manager.http.publish_address: host} - do: reindex: refresh: true @@ -480,15 +480,15 @@ indices.refresh: {} - # Fetch the http host. We use the host of the master because we know there will always be a master. + # Fetch the http host. We use the host of the cluster-manager because we know there will always be a cluster-manager. - do: cluster.state: {} - - set: { master_node: master } + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: metric: [ http ] - - is_true: nodes.$master.http.publish_address - - set: {nodes.$master.http.publish_address: host} + - is_true: nodes.$cluster_manager.http.publish_address + - set: {nodes.$cluster_manager.http.publish_address: host} - do: reindex: requests_per_second: .00000001 # About 9.5 years to complete the request diff --git a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/95_parent_join.yml b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/95_parent_join.yml index b36593b4b962c..a3c2e0505bda6 100644 --- a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/95_parent_join.yml +++ b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/95_parent_join.yml @@ -88,15 +88,15 @@ setup: --- "Reindex from remote with parent join field": - # Fetch the http host. We use the host of the master because we know there will always be a master. + # Fetch the http host. We use the host of the cluster-manager because we know there will always be a cluster-manager. - do: cluster.state: {} - - set: { master_node: master } + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: metric: [ http ] - - is_true: nodes.$master.http.publish_address - - set: {nodes.$master.http.publish_address: host} + - is_true: nodes.$cluster_manager.http.publish_address + - set: {nodes.$cluster_manager.http.publish_address: host} - do: reindex: refresh: true diff --git a/modules/repository-url/src/yamlRestTest/resources/rest-api-spec/test/repository_url/10_basic.yml b/modules/repository-url/src/yamlRestTest/resources/rest-api-spec/test/repository_url/10_basic.yml index b932f0d53caad..0c7aed0ae7103 100644 --- a/modules/repository-url/src/yamlRestTest/resources/rest-api-spec/test/repository_url/10_basic.yml +++ b/modules/repository-url/src/yamlRestTest/resources/rest-api-spec/test/repository_url/10_basic.yml @@ -102,13 +102,13 @@ teardown: - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.modules: { name: repository-url } } + - contains: { nodes.$cluster_manager.modules: { name: repository-url } } --- "Restore with repository-url using http://": diff --git a/modules/transport-netty4/src/yamlRestTest/resources/rest-api-spec/test/10_basic.yml b/modules/transport-netty4/src/yamlRestTest/resources/rest-api-spec/test/10_basic.yml index 19728c7d34cff..f4ac484757a41 100644 --- a/modules/transport-netty4/src/yamlRestTest/resources/rest-api-spec/test/10_basic.yml +++ b/modules/transport-netty4/src/yamlRestTest/resources/rest-api-spec/test/10_basic.yml @@ -7,13 +7,13 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.modules: { name: transport-netty4 } } + - contains: { nodes.$cluster_manager.modules: { name: transport-netty4 } } - do: cluster.stats: {} From 8460bcf2ec43f86a2078a6fcd2b3ca6f7c686f36 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Mon, 16 May 2022 05:46:39 -0700 Subject: [PATCH 13/20] Replace 'master' terminology with 'cluster manager' in 'plugins' directory (#3329) * Replace 'master' terminology with 'cluster manager' in 'plugins' directory Signed-off-by: Tianli Feng * Replace master_node with cluster_manager_node in cluster.state API test Signed-off-by: Tianli Feng --- .../test/discovery_azure_classic/10_basic.yml | 6 +++--- .../discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java | 2 +- .../rest-api-spec/test/discovery_ec2/10_basic.yml | 6 +++--- .../org/opensearch/discovery/gce/GceDiscoverTests.java | 8 ++++---- .../rest-api-spec/test/discovery_gce/10_basic.yml | 6 +++--- .../test/custom-significance-heuristic/10_basic.yml | 6 +++--- .../rest-api-spec/test/custom-suggester/10_basic.yml | 6 +++--- .../rest-api-spec/test/painless_whitelist/10_basic.yml | 6 +++--- .../rest-api-spec/test/example-rescore/10_basic.yml | 6 +++--- .../rest-api-spec/test/script_expert_scoring/10_basic.yml | 6 +++--- .../rest-api-spec/test/ingest_attachment/10_basic.yml | 6 +++--- .../rest-api-spec/test/repository_azure/10_basic.yml | 6 +++--- .../rest-api-spec/test/repository_gcs/10_basic.yml | 6 +++--- .../rest-api-spec/test/hdfs_repository/10_basic.yml | 6 +++--- .../test/secure_hdfs_repository/10_basic.yml | 6 +++--- .../rest-api-spec/test/repository_s3/10_basic.yml | 6 +++--- .../resources/rest-api-spec/test/store_smb/10_basic.yml | 6 +++--- 17 files changed, 50 insertions(+), 50 deletions(-) diff --git a/plugins/discovery-azure-classic/src/yamlRestTest/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml b/plugins/discovery-azure-classic/src/yamlRestTest/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml index 39aa9929f8a92..73523d17bbfb9 100644 --- a/plugins/discovery-azure-classic/src/yamlRestTest/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml +++ b/plugins/discovery-azure-classic/src/yamlRestTest/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.plugins: { name: discovery-azure-classic } } + - contains: { nodes.$cluster_manager.plugins: { name: discovery-azure-classic } } diff --git a/plugins/discovery-ec2/src/internalClusterTest/java/org/opensearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java b/plugins/discovery-ec2/src/internalClusterTest/java/org/opensearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java index 453ea2b3268a8..659bec0c6e89e 100644 --- a/plugins/discovery-ec2/src/internalClusterTest/java/org/opensearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java +++ b/plugins/discovery-ec2/src/internalClusterTest/java/org/opensearch/discovery/ec2/Ec2DiscoveryUpdateSettingsTests.java @@ -48,7 +48,7 @@ */ @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0) public class Ec2DiscoveryUpdateSettingsTests extends AbstractAwsTestCase { - public void testMinimumMasterNodesStart() { + public void testMinimumClusterManagerNodesStart() { Settings nodeSettings = Settings.builder().put(DiscoveryModule.DISCOVERY_SEED_PROVIDERS_SETTING.getKey(), "ec2").build(); internalCluster().startNode(nodeSettings); diff --git a/plugins/discovery-ec2/src/yamlRestTest/resources/rest-api-spec/test/discovery_ec2/10_basic.yml b/plugins/discovery-ec2/src/yamlRestTest/resources/rest-api-spec/test/discovery_ec2/10_basic.yml index ba51c623fe888..f91565c5d204b 100644 --- a/plugins/discovery-ec2/src/yamlRestTest/resources/rest-api-spec/test/discovery_ec2/10_basic.yml +++ b/plugins/discovery-ec2/src/yamlRestTest/resources/rest-api-spec/test/discovery_ec2/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.plugins: { name: discovery-ec2 } } + - contains: { nodes.$cluster_manager.plugins: { name: discovery-ec2 } } diff --git a/plugins/discovery-gce/src/internalClusterTest/java/org/opensearch/discovery/gce/GceDiscoverTests.java b/plugins/discovery-gce/src/internalClusterTest/java/org/opensearch/discovery/gce/GceDiscoverTests.java index 60293614254c5..d5682940ccfee 100644 --- a/plugins/discovery-gce/src/internalClusterTest/java/org/opensearch/discovery/gce/GceDiscoverTests.java +++ b/plugins/discovery-gce/src/internalClusterTest/java/org/opensearch/discovery/gce/GceDiscoverTests.java @@ -85,11 +85,11 @@ protected Settings nodeSettings(int nodeOrdinal) { } public void testJoin() { - // start master node - final String masterNode = internalCluster().startClusterManagerOnlyNode(); - registerGceNode(masterNode); + // start cluster-manager node + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); + registerGceNode(clusterManagerNode); - ClusterStateResponse clusterStateResponse = client(masterNode).admin() + ClusterStateResponse clusterStateResponse = client(clusterManagerNode).admin() .cluster() .prepareState() .setMasterNodeTimeout("1s") diff --git a/plugins/discovery-gce/src/yamlRestTest/resources/rest-api-spec/test/discovery_gce/10_basic.yml b/plugins/discovery-gce/src/yamlRestTest/resources/rest-api-spec/test/discovery_gce/10_basic.yml index a5379c2c68bed..828e006ae822d 100644 --- a/plugins/discovery-gce/src/yamlRestTest/resources/rest-api-spec/test/discovery_gce/10_basic.yml +++ b/plugins/discovery-gce/src/yamlRestTest/resources/rest-api-spec/test/discovery_gce/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.plugins: { name: discovery-gce } } + - contains: { nodes.$cluster_manager.plugins: { name: discovery-gce } } diff --git a/plugins/examples/custom-significance-heuristic/src/yamlRestTest/resources/rest-api-spec/test/custom-significance-heuristic/10_basic.yml b/plugins/examples/custom-significance-heuristic/src/yamlRestTest/resources/rest-api-spec/test/custom-significance-heuristic/10_basic.yml index 620aa393a6b5b..5cd56683f427d 100644 --- a/plugins/examples/custom-significance-heuristic/src/yamlRestTest/resources/rest-api-spec/test/custom-significance-heuristic/10_basic.yml +++ b/plugins/examples/custom-significance-heuristic/src/yamlRestTest/resources/rest-api-spec/test/custom-significance-heuristic/10_basic.yml @@ -5,12 +5,12 @@ reason: "contains is a newly added assertion" features: contains - # Get master node id + # Get cluster-manager node id - do: cluster.state: {} - - set: { master_node: master } + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.plugins: { name: custom-significance-heuristic } } + - contains: { nodes.$cluster_manager.plugins: { name: custom-significance-heuristic } } diff --git a/plugins/examples/custom-suggester/src/yamlRestTest/resources/rest-api-spec/test/custom-suggester/10_basic.yml b/plugins/examples/custom-suggester/src/yamlRestTest/resources/rest-api-spec/test/custom-suggester/10_basic.yml index ed8d0f78a092b..0ef1d4a0679d7 100644 --- a/plugins/examples/custom-suggester/src/yamlRestTest/resources/rest-api-spec/test/custom-suggester/10_basic.yml +++ b/plugins/examples/custom-suggester/src/yamlRestTest/resources/rest-api-spec/test/custom-suggester/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.plugins: { name: custom-suggester } } + - contains: { nodes.$cluster_manager.plugins: { name: custom-suggester } } diff --git a/plugins/examples/painless-whitelist/src/yamlRestTest/resources/rest-api-spec/test/painless_whitelist/10_basic.yml b/plugins/examples/painless-whitelist/src/yamlRestTest/resources/rest-api-spec/test/painless_whitelist/10_basic.yml index cc3762eb42d68..fab9789eeec10 100644 --- a/plugins/examples/painless-whitelist/src/yamlRestTest/resources/rest-api-spec/test/painless_whitelist/10_basic.yml +++ b/plugins/examples/painless-whitelist/src/yamlRestTest/resources/rest-api-spec/test/painless_whitelist/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.plugins: { name: painless-whitelist } } + - contains: { nodes.$cluster_manager.plugins: { name: painless-whitelist } } diff --git a/plugins/examples/rescore/src/yamlRestTest/resources/rest-api-spec/test/example-rescore/10_basic.yml b/plugins/examples/rescore/src/yamlRestTest/resources/rest-api-spec/test/example-rescore/10_basic.yml index f0d0bcb35fad9..00c5977529c6c 100644 --- a/plugins/examples/rescore/src/yamlRestTest/resources/rest-api-spec/test/example-rescore/10_basic.yml +++ b/plugins/examples/rescore/src/yamlRestTest/resources/rest-api-spec/test/example-rescore/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.plugins: { name: example-rescore } } + - contains: { nodes.$cluster_manager.plugins: { name: example-rescore } } diff --git a/plugins/examples/script-expert-scoring/src/yamlRestTest/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml b/plugins/examples/script-expert-scoring/src/yamlRestTest/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml index 70842d5e767e5..d65943f0201b3 100644 --- a/plugins/examples/script-expert-scoring/src/yamlRestTest/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml +++ b/plugins/examples/script-expert-scoring/src/yamlRestTest/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.plugins: { name: script-expert-scoring } } + - contains: { nodes.$cluster_manager.plugins: { name: script-expert-scoring } } diff --git a/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/10_basic.yml b/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/10_basic.yml index 88f6f33ad0a66..09075e0573fbe 100644 --- a/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/10_basic.yml +++ b/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/10_basic.yml @@ -5,10 +5,10 @@ - do: cluster.state: {} - - set: {master_node: master} + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { 'nodes.$master.plugins': { name: ingest-attachment } } - - contains: { 'nodes.$master.ingest.processors': { type: attachment } } + - contains: { 'nodes.$cluster_manager.plugins': { name: ingest-attachment } } + - contains: { 'nodes.$cluster_manager.ingest.processors': { type: attachment } } diff --git a/plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/10_basic.yml b/plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/10_basic.yml index fe21a295e37bb..caec0a89101b4 100644 --- a/plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/10_basic.yml +++ b/plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.plugins: { name: repository-azure } } + - contains: { nodes.$cluster_manager.plugins: { name: repository-azure } } diff --git a/plugins/repository-gcs/src/yamlRestTest/resources/rest-api-spec/test/repository_gcs/10_basic.yml b/plugins/repository-gcs/src/yamlRestTest/resources/rest-api-spec/test/repository_gcs/10_basic.yml index 072836280b3bc..265b4e2fecfc7 100644 --- a/plugins/repository-gcs/src/yamlRestTest/resources/rest-api-spec/test/repository_gcs/10_basic.yml +++ b/plugins/repository-gcs/src/yamlRestTest/resources/rest-api-spec/test/repository_gcs/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.plugins: { name: repository-gcs } } + - contains: { nodes.$cluster_manager.plugins: { name: repository-gcs } } diff --git a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/10_basic.yml b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/10_basic.yml index bc419d75ba773..eedcaf099ccef 100644 --- a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/10_basic.yml +++ b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/10_basic.yml @@ -9,13 +9,13 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.plugins: { name: repository-hdfs } } + - contains: { nodes.$cluster_manager.plugins: { name: repository-hdfs } } --- # # Check that we can't use file:// repositories or anything like that diff --git a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/10_basic.yml b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/10_basic.yml index bc419d75ba773..eedcaf099ccef 100644 --- a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/10_basic.yml +++ b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/10_basic.yml @@ -9,13 +9,13 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.plugins: { name: repository-hdfs } } + - contains: { nodes.$cluster_manager.plugins: { name: repository-hdfs } } --- # # Check that we can't use file:// repositories or anything like that diff --git a/plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/10_basic.yml b/plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/10_basic.yml index cde14321805f5..b35366d904263 100644 --- a/plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/10_basic.yml +++ b/plugins/repository-s3/src/yamlRestTest/resources/rest-api-spec/test/repository_s3/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.plugins: { name: repository-s3 } } + - contains: { nodes.$cluster_manager.plugins: { name: repository-s3 } } diff --git a/plugins/store-smb/src/yamlRestTest/resources/rest-api-spec/test/store_smb/10_basic.yml b/plugins/store-smb/src/yamlRestTest/resources/rest-api-spec/test/store_smb/10_basic.yml index 8956b3a8c116f..d358c8980d245 100644 --- a/plugins/store-smb/src/yamlRestTest/resources/rest-api-spec/test/store_smb/10_basic.yml +++ b/plugins/store-smb/src/yamlRestTest/resources/rest-api-spec/test/store_smb/10_basic.yml @@ -7,10 +7,10 @@ - do: cluster.state: {} - # Get master node id - - set: { master_node: master } + # Get cluster-manager node id + - set: { cluster_manager_node: cluster_manager } - do: nodes.info: {} - - contains: { nodes.$master.plugins: { name: store-smb } } + - contains: { nodes.$cluster_manager.plugins: { name: store-smb } } From 085cd70b8aa259df850d92c18dd9f50f50702edb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 May 2022 11:45:31 -0400 Subject: [PATCH 14/20] Bump org.gradle.test-retry from 1.3.2 to 1.4.0 (#3335) Bumps org.gradle.test-retry from 1.3.2 to 1.4.0. --- updated-dependencies: - dependency-name: org.gradle.test-retry dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 0be90a63adc22..fc8dc2be6aa47 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ plugins { id 'opensearch.docker-support' id 'opensearch.global-build-info' id "com.diffplug.spotless" version "6.5.2" apply false - id "org.gradle.test-retry" version "1.3.2" apply false + id "org.gradle.test-retry" version "1.4.0" apply false id "test-report-aggregation" id 'jacoco-report-aggregation' } From d734a9a78386ad893cbf378250e98b89d2d9fd6e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 May 2022 11:46:06 -0400 Subject: [PATCH 15/20] Bump azure-storage-blob from 12.16.0 to 12.16.1 in /plugins/repository-azure (#3338) * Bump azure-storage-blob in /plugins/repository-azure Bumps [azure-storage-blob](https://github.com/Azure/azure-sdk-for-java) from 12.16.0 to 12.16.1. - [Release notes](https://github.com/Azure/azure-sdk-for-java/releases) - [Commits](https://github.com/Azure/azure-sdk-for-java/compare/azure-storage-blob_12.16.0...azure-storage-blob_12.16.1) --- updated-dependencies: - dependency-name: com.azure:azure-storage-blob dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] --- plugins/repository-azure/build.gradle | 2 +- .../licenses/azure-storage-blob-12.16.0.jar.sha1 | 1 - .../licenses/azure-storage-blob-12.16.1.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-azure/licenses/azure-storage-blob-12.16.0.jar.sha1 create mode 100644 plugins/repository-azure/licenses/azure-storage-blob-12.16.1.jar.sha1 diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index fc5ac0d0aafc0..e644a4f37be25 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -54,7 +54,7 @@ dependencies { api "io.netty:netty-resolver-dns:${versions.netty}" api "io.netty:netty-transport-native-unix-common:${versions.netty}" implementation project(':modules:transport-netty4') - api 'com.azure:azure-storage-blob:12.16.0' + api 'com.azure:azure-storage-blob:12.16.1' api 'org.reactivestreams:reactive-streams:1.0.3' api 'io.projectreactor:reactor-core:3.4.17' api 'io.projectreactor.netty:reactor-netty:1.0.18' diff --git a/plugins/repository-azure/licenses/azure-storage-blob-12.16.0.jar.sha1 b/plugins/repository-azure/licenses/azure-storage-blob-12.16.0.jar.sha1 deleted file mode 100644 index 349d190bbbac3..0000000000000 --- a/plugins/repository-azure/licenses/azure-storage-blob-12.16.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -74b92065815f7affb0cd7897b683369b9ed982fd \ No newline at end of file diff --git a/plugins/repository-azure/licenses/azure-storage-blob-12.16.1.jar.sha1 b/plugins/repository-azure/licenses/azure-storage-blob-12.16.1.jar.sha1 new file mode 100644 index 0000000000000..71014103e517b --- /dev/null +++ b/plugins/repository-azure/licenses/azure-storage-blob-12.16.1.jar.sha1 @@ -0,0 +1 @@ +84054ca8a6660eb77910925d71f70330fd3d83aa \ No newline at end of file From 2711d324f6740e41e364e656a0ab201b40fb402f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 May 2022 11:46:35 -0400 Subject: [PATCH 16/20] Bump re2j from 1.1 to 1.6 in /plugins/repository-hdfs (#3337) * Bump re2j from 1.1 to 1.6 in /plugins/repository-hdfs Bumps [re2j](https://github.com/google/re2j) from 1.1 to 1.6. - [Release notes](https://github.com/google/re2j/releases) - [Commits](https://github.com/google/re2j/compare/re2j-1.1...re2j-1.6) --- updated-dependencies: - dependency-name: com.google.re2j:re2j dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] --- plugins/repository-hdfs/build.gradle | 2 +- plugins/repository-hdfs/licenses/re2j-1.1.jar.sha1 | 1 - plugins/repository-hdfs/licenses/re2j-1.6.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-hdfs/licenses/re2j-1.1.jar.sha1 create mode 100644 plugins/repository-hdfs/licenses/re2j-1.6.jar.sha1 diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index 81c160881790b..cf51daec2b740 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -76,7 +76,7 @@ dependencies { api 'org.apache.commons:commons-configuration2:2.7' api 'commons-io:commons-io:2.11.0' api 'org.apache.commons:commons-lang3:3.12.0' - implementation 'com.google.re2j:re2j:1.1' + implementation 'com.google.re2j:re2j:1.6' api 'javax.servlet:servlet-api:2.5' api "org.slf4j:slf4j-api:${versions.slf4j}" api "org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}" diff --git a/plugins/repository-hdfs/licenses/re2j-1.1.jar.sha1 b/plugins/repository-hdfs/licenses/re2j-1.1.jar.sha1 deleted file mode 100644 index d8a100dafd8c4..0000000000000 --- a/plugins/repository-hdfs/licenses/re2j-1.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -d716952ab58aa4369ea15126505a36544d50a333 \ No newline at end of file diff --git a/plugins/repository-hdfs/licenses/re2j-1.6.jar.sha1 b/plugins/repository-hdfs/licenses/re2j-1.6.jar.sha1 new file mode 100644 index 0000000000000..854bd3a225b92 --- /dev/null +++ b/plugins/repository-hdfs/licenses/re2j-1.6.jar.sha1 @@ -0,0 +1 @@ +a13e879fd7971738d06020fefeb108cc14e14169 \ No newline at end of file From 4886f8e162cbcfca1972b233a70880e60e554d80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 May 2022 11:47:08 -0400 Subject: [PATCH 17/20] Bump commons-collections4 from 4.1 to 4.4 in /plugins/ingest-attachment (#3339) * Bump commons-collections4 from 4.1 to 4.4 in /plugins/ingest-attachment Bumps commons-collections4 from 4.1 to 4.4. --- updated-dependencies: - dependency-name: org.apache.commons:commons-collections4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] --- plugins/ingest-attachment/build.gradle | 2 +- .../licenses/commons-collections4-4.1.jar.sha1 | 1 - .../licenses/commons-collections4-4.4.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/ingest-attachment/licenses/commons-collections4-4.1.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/commons-collections4-4.4.jar.sha1 diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index 4a81489e96d5e..1452d871a605b 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -80,7 +80,7 @@ dependencies { api "org.apache.poi:poi-ooxml-lite:${versions.poi}" api "commons-codec:commons-codec:${versions.commonscodec}" api 'org.apache.xmlbeans:xmlbeans:5.0.3' - api 'org.apache.commons:commons-collections4:4.1' + api 'org.apache.commons:commons-collections4:4.4' // MS Office api "org.apache.poi:poi-scratchpad:${versions.poi}" // Apple iWork diff --git a/plugins/ingest-attachment/licenses/commons-collections4-4.1.jar.sha1 b/plugins/ingest-attachment/licenses/commons-collections4-4.1.jar.sha1 deleted file mode 100644 index f054416580624..0000000000000 --- a/plugins/ingest-attachment/licenses/commons-collections4-4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -a4cf4688fe1c7e3a63aa636cc96d013af537768e \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/commons-collections4-4.4.jar.sha1 b/plugins/ingest-attachment/licenses/commons-collections4-4.4.jar.sha1 new file mode 100644 index 0000000000000..6b4ed5ab62b44 --- /dev/null +++ b/plugins/ingest-attachment/licenses/commons-collections4-4.4.jar.sha1 @@ -0,0 +1 @@ +62ebe7544cb7164d87e0637a2a6a2bdc981395e8 \ No newline at end of file From e73a410139e0b212c7c63ec1e2fc4cc14cc5902c Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Mon, 16 May 2022 11:05:13 -0700 Subject: [PATCH 18/20] Used set to make shell scripts more strict (#3278) * Use set to make shell scripts more strict Signed-off-by: Owais Kazi * Change -o pipefail to -e Signed-off-by: Owais Kazi * Set scripts to standard rule Signed-off-by: Owais Kazi --- client/sniffer/src/test/resources/create_test_nodes_info.bash | 2 +- dev-tools/atomic_push.sh | 2 +- dev-tools/signoff-check.sh | 4 +++- distribution/docker/docker-test-entrypoint.sh | 2 ++ distribution/docker/src/docker/bin/docker-entrypoint.sh | 2 +- distribution/packages/src/common/scripts/preinst | 2 ++ distribution/packages/src/common/systemd/systemd-entrypoint | 2 ++ distribution/packages/src/deb/init.d/opensearch | 2 ++ distribution/packages/src/rpm/init.d/opensearch | 2 ++ distribution/src/bin/opensearch | 2 ++ distribution/src/bin/opensearch-keystore | 2 ++ distribution/src/bin/opensearch-node | 1 + distribution/src/bin/opensearch-plugin | 2 ++ distribution/src/bin/opensearch-shard | 2 ++ distribution/src/bin/opensearch-upgrade | 1 + qa/remote-clusters/docker-test-entrypoint.sh | 2 ++ .../krb5kdc-fixture/src/main/resources/provision/addprinc.sh | 2 +- .../krb5kdc-fixture/src/main/resources/provision/hdfs.sh | 2 +- .../src/main/resources/provision/installkdc.sh | 2 +- .../krb5kdc-fixture/src/main/resources/provision/peppa.sh | 2 +- 20 files changed, 32 insertions(+), 8 deletions(-) diff --git a/client/sniffer/src/test/resources/create_test_nodes_info.bash b/client/sniffer/src/test/resources/create_test_nodes_info.bash index e5925b195057d..06350be4ba205 100644 --- a/client/sniffer/src/test/resources/create_test_nodes_info.bash +++ b/client/sniffer/src/test/resources/create_test_nodes_info.bash @@ -14,7 +14,7 @@ # when we do rebuild the files they don't jump around too much. That # way the diffs are smaller. -set -e +set -e -o pipefail script_path="$( cd "$(dirname "$0")" ; pwd -P )" work=$(mktemp -d) diff --git a/dev-tools/atomic_push.sh b/dev-tools/atomic_push.sh index d1b735f15374e..533fc5f6ed0b4 100755 --- a/dev-tools/atomic_push.sh +++ b/dev-tools/atomic_push.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -e +set -e -o pipefail if [ "$#" -eq 0 ]; then printf 'Usage: %s ...\n' "$(basename "$0")" diff --git a/dev-tools/signoff-check.sh b/dev-tools/signoff-check.sh index 5fe00c430ca79..539301a1cd79d 100755 --- a/dev-tools/signoff-check.sh +++ b/dev-tools/signoff-check.sh @@ -1,4 +1,6 @@ -#!/bin/sh +#!/usr/bin/env bash + +set -e -o pipefail ### Script to check for signoff presents on commits diff --git a/distribution/docker/docker-test-entrypoint.sh b/distribution/docker/docker-test-entrypoint.sh index 85a90df003ab4..1cfc62f6b02b0 100755 --- a/distribution/docker/docker-test-entrypoint.sh +++ b/distribution/docker/docker-test-entrypoint.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +set -e -o pipefail + cd /usr/share/opensearch/bin/ /usr/local/bin/docker-entrypoint.sh | tee > /usr/share/opensearch/logs/console.log diff --git a/distribution/docker/src/docker/bin/docker-entrypoint.sh b/distribution/docker/src/docker/bin/docker-entrypoint.sh index 0d6ca588d875d..33c68afce0bfc 100644 --- a/distribution/docker/src/docker/bin/docker-entrypoint.sh +++ b/distribution/docker/src/docker/bin/docker-entrypoint.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -e +set -e -o pipefail # Files created by Elasticsearch should always be group writable too umask 0002 diff --git a/distribution/packages/src/common/scripts/preinst b/distribution/packages/src/common/scripts/preinst index c13f079666467..31e5b803b1604 100644 --- a/distribution/packages/src/common/scripts/preinst +++ b/distribution/packages/src/common/scripts/preinst @@ -10,6 +10,8 @@ # $1=1 : indicates an new install # $1=2 : indicates an upgrade +set -e -o pipefail + err_exit() { echo "$@" >&2 exit 1 diff --git a/distribution/packages/src/common/systemd/systemd-entrypoint b/distribution/packages/src/common/systemd/systemd-entrypoint index 0773bc6f1dc04..d9eacdb7812af 100644 --- a/distribution/packages/src/common/systemd/systemd-entrypoint +++ b/distribution/packages/src/common/systemd/systemd-entrypoint @@ -3,6 +3,8 @@ # This wrapper script allows SystemD to feed a file containing a passphrase into # the main OpenSearch startup script +set -e -o pipefail + if [ -n "$OPENSEARCH_KEYSTORE_PASSPHRASE_FILE" ] ; then exec /usr/share/opensearch/bin/opensearch "$@" < "$OPENSEARCH_KEYSTORE_PASSPHRASE_FILE" else diff --git a/distribution/packages/src/deb/init.d/opensearch b/distribution/packages/src/deb/init.d/opensearch index e5195d2d54dba..681d87df1d356 100755 --- a/distribution/packages/src/deb/init.d/opensearch +++ b/distribution/packages/src/deb/init.d/opensearch @@ -12,6 +12,8 @@ # Description: Starts opensearch using start-stop-daemon ### END INIT INFO +set -e -o pipefail + PATH=/bin:/usr/bin:/sbin:/usr/sbin NAME=opensearch DESC="OpenSearch Server" diff --git a/distribution/packages/src/rpm/init.d/opensearch b/distribution/packages/src/rpm/init.d/opensearch index 12a1470e75acb..0cb9bf65796ad 100644 --- a/distribution/packages/src/rpm/init.d/opensearch +++ b/distribution/packages/src/rpm/init.d/opensearch @@ -16,6 +16,8 @@ # Description: OpenSearch is a very scalable, schema-free and high-performance search solution supporting multi-tenancy and near realtime search. ### END INIT INFO +set -e -o pipefail + # # init.d / servicectl compatibility (openSUSE) # diff --git a/distribution/src/bin/opensearch b/distribution/src/bin/opensearch index 52087ceb8bca9..947d1167f79f2 100755 --- a/distribution/src/bin/opensearch +++ b/distribution/src/bin/opensearch @@ -13,6 +13,8 @@ # # OPENSEARCH_JAVA_OPTS="-Xms8g -Xmx8g" ./bin/opensearch +set -e -o pipefail + source "`dirname "$0"`"/opensearch-env CHECK_KEYSTORE=true diff --git a/distribution/src/bin/opensearch-keystore b/distribution/src/bin/opensearch-keystore index 794d3eb5eba41..9f6cb65feeeeb 100755 --- a/distribution/src/bin/opensearch-keystore +++ b/distribution/src/bin/opensearch-keystore @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e -o pipefail + OPENSEARCH_MAIN_CLASS=org.opensearch.common.settings.KeyStoreCli \ OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/keystore-cli \ "`dirname "$0"`"/opensearch-cli \ diff --git a/distribution/src/bin/opensearch-node b/distribution/src/bin/opensearch-node index 210037e933b22..b8b231cc43d4a 100755 --- a/distribution/src/bin/opensearch-node +++ b/distribution/src/bin/opensearch-node @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e -o pipefail OPENSEARCH_MAIN_CLASS=org.opensearch.cluster.coordination.NodeToolCli \ "`dirname "$0"`"/opensearch-cli \ diff --git a/distribution/src/bin/opensearch-plugin b/distribution/src/bin/opensearch-plugin index 64d14e611fd04..b58a2695d2ecf 100755 --- a/distribution/src/bin/opensearch-plugin +++ b/distribution/src/bin/opensearch-plugin @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e -o pipefail + OPENSEARCH_MAIN_CLASS=org.opensearch.plugins.PluginCli \ OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/plugin-cli \ "`dirname "$0"`"/opensearch-cli \ diff --git a/distribution/src/bin/opensearch-shard b/distribution/src/bin/opensearch-shard index 59511ee68647d..953c792af16e8 100755 --- a/distribution/src/bin/opensearch-shard +++ b/distribution/src/bin/opensearch-shard @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e -o pipefail + OPENSEARCH_MAIN_CLASS=org.opensearch.index.shard.ShardToolCli \ "`dirname "$0"`"/opensearch-cli \ "$@" diff --git a/distribution/src/bin/opensearch-upgrade b/distribution/src/bin/opensearch-upgrade index 4305fae462726..5aae184341b6b 100755 --- a/distribution/src/bin/opensearch-upgrade +++ b/distribution/src/bin/opensearch-upgrade @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e -o pipefail OPENSEARCH_MAIN_CLASS=org.opensearch.upgrade.UpgradeCli \ OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/upgrade-cli \ diff --git a/qa/remote-clusters/docker-test-entrypoint.sh b/qa/remote-clusters/docker-test-entrypoint.sh index e08e388b8c98d..18a9363d375ab 100755 --- a/qa/remote-clusters/docker-test-entrypoint.sh +++ b/qa/remote-clusters/docker-test-entrypoint.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +set -e -o pipefail + cd /usr/share/opensearch/bin/ ./opensearch-users useradd rest_user -p test-password -r superuser || true echo "testnode" > /tmp/password diff --git a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/addprinc.sh b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/addprinc.sh index 201c437f00b73..2e3bf66d1403b 100755 --- a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/addprinc.sh +++ b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/addprinc.sh @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -set -e +set -e -o pipefail krb5kdc kadmind diff --git a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/hdfs.sh b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/hdfs.sh index 413c1ee29d0d9..81bc99a058344 100644 --- a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/hdfs.sh +++ b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/hdfs.sh @@ -10,7 +10,7 @@ # GitHub history for details. # -set -e +set -e -o pipefail addprinc.sh "opensearch" #TODO(OpenSearch): fix username diff --git a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/installkdc.sh b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/installkdc.sh index aec2d46073c83..111e8dcc5ea70 100755 --- a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/installkdc.sh +++ b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/installkdc.sh @@ -29,7 +29,7 @@ # GitHub history for details. # -set -e +set -e -o pipefail # KDC installation steps and considerations based on https://web.mit.edu/kerberos/krb5-latest/doc/admin/install_kdc.html # and helpful input from https://help.ubuntu.com/community/Kerberos diff --git a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/peppa.sh b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/peppa.sh index f70ad575d6582..422739d9df90d 100644 --- a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/peppa.sh +++ b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/peppa.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -e -o pipefail addprinc.sh opensearch addprinc.sh HTTP/localhost From c4705808e96bfb5f1131ffd911b95459eaf9446e Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Mon, 16 May 2022 18:38:17 -0400 Subject: [PATCH 19/20] Remove deprecated methods from JodaCompatibleZonedDateTime which are called by scripts (#3346) Signed-off-by: Andriy Redko --- .../painless/spi/org.opensearch.txt | 22 --- .../script/JodaCompatibleZonedDateTime.java | 139 --------------- .../JodaCompatibleZonedDateTimeTests.java | 163 +++--------------- 3 files changed, 20 insertions(+), 304 deletions(-) diff --git a/modules/lang-painless/src/main/resources/org/opensearch/painless/spi/org.opensearch.txt b/modules/lang-painless/src/main/resources/org/opensearch/painless/spi/org.opensearch.txt index debccf8ed4b9b..3741a13122bc8 100644 --- a/modules/lang-painless/src/main/resources/org/opensearch/painless/spi/org.opensearch.txt +++ b/modules/lang-painless/src/main/resources/org/opensearch/painless/spi/org.opensearch.txt @@ -124,29 +124,7 @@ class org.opensearch.script.JodaCompatibleZonedDateTime { ZonedDateTime withYear(int) ZonedDateTime withZoneSameLocal(ZoneId) ZonedDateTime withZoneSameInstant(ZoneId) - - #### Joda time methods - long getMillis() - int getCenturyOfEra() - int getEra() - int getHourOfDay() - int getMillisOfDay() - int getMillisOfSecond() - int getMinuteOfDay() - int getMinuteOfHour() - int getMonthOfYear() - int getSecondOfDay() - int getSecondOfMinute() - int getWeekOfWeekyear() - int getWeekyear() - int getYearOfCentury() - int getYearOfEra() - String toString(String) - String toString(String,Locale) - - # conflicting methods DayOfWeek getDayOfWeekEnum() - int getDayOfWeek() } class org.opensearch.index.fielddata.ScriptDocValues$Dates { diff --git a/server/src/main/java/org/opensearch/script/JodaCompatibleZonedDateTime.java b/server/src/main/java/org/opensearch/script/JodaCompatibleZonedDateTime.java index 8f48da739359a..08306b3f275a8 100644 --- a/server/src/main/java/org/opensearch/script/JodaCompatibleZonedDateTime.java +++ b/server/src/main/java/org/opensearch/script/JodaCompatibleZonedDateTime.java @@ -32,16 +32,9 @@ package org.opensearch.script; -import org.joda.time.DateTime; import org.opensearch.common.SuppressForbidden; -import org.opensearch.common.SuppressLoggerChecks; -import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.time.DateFormatter; -import org.opensearch.common.time.DateFormatters; -import org.opensearch.common.time.DateUtils; -import java.security.AccessController; -import java.security.PrivilegedAction; import java.time.DayOfWeek; import java.time.Instant; import java.time.LocalDate; @@ -55,7 +48,6 @@ import java.time.chrono.ChronoZonedDateTime; import java.time.chrono.Chronology; import java.time.format.DateTimeFormatter; -import java.time.temporal.ChronoField; import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; @@ -64,7 +56,6 @@ import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.ValueRange; -import java.util.Locale; import java.util.Objects; /** @@ -80,23 +71,6 @@ public class JodaCompatibleZonedDateTime TemporalAccessor { private static final DateFormatter DATE_FORMATTER = DateFormatter.forPattern("strict_date_time"); - private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(JodaCompatibleZonedDateTime.class); - - private static void logDeprecated(String key, String message, Object... params) { - AccessController.doPrivileged(new PrivilegedAction() { - @SuppressLoggerChecks(reason = "safely delegates to logger") - @Override - public Void run() { - deprecationLogger.deprecate(key, message, params); - return null; - } - }); - } - - private static void logDeprecatedMethod(String oldMethod, String newMethod) { - logDeprecated(oldMethod, "Use of the joda time method [{}] is deprecated. Use [{}] instead.", oldMethod, newMethod); - } - private ZonedDateTime dt; public JodaCompatibleZonedDateTime(Instant instant, ZoneId zone) { @@ -427,120 +401,7 @@ public ZonedDateTime withZoneSameInstant(ZoneId zone) { return dt.withZoneSameInstant(zone); } - @Deprecated - public long getMillis() { - logDeprecatedMethod("getMillis()", "toInstant().toEpochMilli()"); - return dt.toInstant().toEpochMilli(); - } - - @Deprecated - public int getCenturyOfEra() { - logDeprecatedMethod("getCenturyOfEra()", "get(ChronoField.YEAR_OF_ERA) / 100"); - return dt.get(ChronoField.YEAR_OF_ERA) / 100; - } - - @Deprecated - public int getEra() { - logDeprecatedMethod("getEra()", "get(ChronoField.ERA)"); - return dt.get(ChronoField.ERA); - } - - @Deprecated - public int getHourOfDay() { - logDeprecatedMethod("getHourOfDay()", "getHour()"); - return dt.getHour(); - } - - @Deprecated - public int getMillisOfDay() { - logDeprecatedMethod("getMillisOfDay()", "get(ChronoField.MILLI_OF_DAY)"); - return dt.get(ChronoField.MILLI_OF_DAY); - } - - @Deprecated - public int getMillisOfSecond() { - logDeprecatedMethod("getMillisOfSecond()", "get(ChronoField.MILLI_OF_SECOND)"); - return dt.get(ChronoField.MILLI_OF_SECOND); - } - - @Deprecated - public int getMinuteOfDay() { - logDeprecatedMethod("getMinuteOfDay()", "get(ChronoField.MINUTE_OF_DAY)"); - return dt.get(ChronoField.MINUTE_OF_DAY); - } - - @Deprecated - public int getMinuteOfHour() { - logDeprecatedMethod("getMinuteOfHour()", "getMinute()"); - return dt.getMinute(); - } - - @Deprecated - public int getMonthOfYear() { - logDeprecatedMethod("getMonthOfYear()", "getMonthValue()"); - return dt.getMonthValue(); - } - - @Deprecated - public int getSecondOfDay() { - logDeprecatedMethod("getSecondOfDay()", "get(ChronoField.SECOND_OF_DAY)"); - return dt.get(ChronoField.SECOND_OF_DAY); - } - - @Deprecated - public int getSecondOfMinute() { - logDeprecatedMethod("getSecondOfMinute()", "getSecond()"); - return dt.getSecond(); - } - - @Deprecated - public int getWeekOfWeekyear() { - logDeprecatedMethod("getWeekOfWeekyear()", "get(DateFormatters.WEEK_FIELDS_ROOT.weekOfWeekBasedYear())"); - return dt.get(DateFormatters.WEEK_FIELDS_ROOT.weekOfWeekBasedYear()); - } - - @Deprecated - public int getWeekyear() { - logDeprecatedMethod("getWeekyear()", "get(DateFormatters.WEEK_FIELDS_ROOT.weekBasedYear())"); - return dt.get(DateFormatters.WEEK_FIELDS_ROOT.weekBasedYear()); - } - - @Deprecated - public int getYearOfCentury() { - logDeprecatedMethod("getYearOfCentury()", "get(ChronoField.YEAR_OF_ERA) % 100"); - return dt.get(ChronoField.YEAR_OF_ERA) % 100; - } - - @Deprecated - public int getYearOfEra() { - logDeprecatedMethod("getYearOfEra()", "get(ChronoField.YEAR_OF_ERA)"); - return dt.get(ChronoField.YEAR_OF_ERA); - } - - @Deprecated - public String toString(String format) { - logDeprecatedMethod("toString(String)", "a DateTimeFormatter"); - // TODO: replace with bwc formatter - return new DateTime(dt.toInstant().toEpochMilli(), DateUtils.zoneIdToDateTimeZone(dt.getZone())).toString(format); - } - - @Deprecated - public String toString(String format, Locale locale) { - logDeprecatedMethod("toString(String,Locale)", "a DateTimeFormatter"); - // TODO: replace with bwc formatter - return new DateTime(dt.toInstant().toEpochMilli(), DateUtils.zoneIdToDateTimeZone(dt.getZone())).toString(format, locale); - } - public DayOfWeek getDayOfWeekEnum() { return dt.getDayOfWeek(); } - - @Deprecated - public int getDayOfWeek() { - logDeprecated( - "getDayOfWeek()", - "The return type of [getDayOfWeek()] will change to an enum in 7.0. Use getDayOfWeekEnum().getValue()." - ); - return dt.getDayOfWeek().getValue(); - } } diff --git a/server/src/test/java/org/opensearch/script/JodaCompatibleZonedDateTimeTests.java b/server/src/test/java/org/opensearch/script/JodaCompatibleZonedDateTimeTests.java index 81d0078d3d960..a3156897540b2 100644 --- a/server/src/test/java/org/opensearch/script/JodaCompatibleZonedDateTimeTests.java +++ b/server/src/test/java/org/opensearch/script/JodaCompatibleZonedDateTimeTests.java @@ -32,42 +32,25 @@ package org.opensearch.script; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.core.Appender; -import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.core.appender.AbstractAppender; -import org.opensearch.common.logging.Loggers; +import org.opensearch.common.time.DateFormatters; import org.opensearch.test.OpenSearchTestCase; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.junit.Before; -import java.security.AccessControlContext; -import java.security.AccessController; -import java.security.PermissionCollection; -import java.security.Permissions; -import java.security.PrivilegedAction; -import java.security.ProtectionDomain; import java.time.DayOfWeek; import java.time.Instant; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.Month; import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoField; import java.util.Locale; import static org.hamcrest.Matchers.equalTo; public class JodaCompatibleZonedDateTimeTests extends OpenSearchTestCase { - private static final Logger DEPRECATION_LOGGER = LogManager.getLogger("org.opensearch.deprecation.script.JodaCompatibleZonedDateTime"); - - // each call to get or getValue will be run with limited permissions, just as they are in scripts - private static PermissionCollection NO_PERMISSIONS = new Permissions(); - private static AccessControlContext NO_PERMISSIONS_ACC = new AccessControlContext( - new ProtectionDomain[] { new ProtectionDomain(null, NO_PERMISSIONS) } - ); - private JodaCompatibleZonedDateTime javaTime; private DateTime jodaTime; @@ -78,35 +61,6 @@ public void setupTime() { jodaTime = new DateTime(millis, DateTimeZone.forOffsetHours(-7)); } - void assertDeprecation(Runnable assertions, String message) { - Appender appender = new AbstractAppender("test", null, null) { - @Override - public void append(LogEvent event) { - /* Create a temporary directory to prove we are running with the - * server's permissions. */ - createTempDir(); - } - }; - appender.start(); - Loggers.addAppender(DEPRECATION_LOGGER, appender); - try { - // the assertions are run with the same reduced privileges scripts run with - AccessController.doPrivileged((PrivilegedAction) () -> { - assertions.run(); - return null; - }, NO_PERMISSIONS_ACC); - } finally { - appender.stop(); - Loggers.removeAppender(DEPRECATION_LOGGER, appender); - } - - assertWarnings(message); - } - - void assertMethodDeprecation(Runnable assertions, String oldMethod, String newMethod) { - assertDeprecation(assertions, "Use of the joda time method [" + oldMethod + "] is deprecated. Use [" + newMethod + "] instead."); - } - public void testEquals() { assertThat(javaTime, equalTo(javaTime)); } @@ -173,154 +127,77 @@ public void testZone() { } public void testMillis() { - assertMethodDeprecation( - () -> assertThat(javaTime.getMillis(), equalTo(jodaTime.getMillis())), - "getMillis()", - "toInstant().toEpochMilli()" - ); + assertThat(javaTime.toInstant().toEpochMilli(), equalTo(jodaTime.getMillis())); } public void testCenturyOfEra() { - assertMethodDeprecation( - () -> assertThat(javaTime.getCenturyOfEra(), equalTo(jodaTime.getCenturyOfEra())), - "getCenturyOfEra()", - "get(ChronoField.YEAR_OF_ERA) / 100" - ); + assertThat(javaTime.get(ChronoField.YEAR_OF_ERA) / 100, equalTo(jodaTime.getCenturyOfEra())); } public void testEra() { - assertMethodDeprecation(() -> assertThat(javaTime.getEra(), equalTo(jodaTime.getEra())), "getEra()", "get(ChronoField.ERA)"); + assertThat(javaTime.get(ChronoField.ERA), equalTo(jodaTime.getEra())); } public void testHourOfDay() { - assertMethodDeprecation(() -> assertThat(javaTime.getHourOfDay(), equalTo(jodaTime.getHourOfDay())), "getHourOfDay()", "getHour()"); + assertThat(javaTime.getHour(), equalTo(jodaTime.getHourOfDay())); } public void testMillisOfDay() { - assertMethodDeprecation( - () -> assertThat(javaTime.getMillisOfDay(), equalTo(jodaTime.getMillisOfDay())), - "getMillisOfDay()", - "get(ChronoField.MILLI_OF_DAY)" - ); + assertThat(javaTime.get(ChronoField.MILLI_OF_DAY), equalTo(jodaTime.getMillisOfDay())); } public void testMillisOfSecond() { - assertMethodDeprecation( - () -> assertThat(javaTime.getMillisOfSecond(), equalTo(jodaTime.getMillisOfSecond())), - "getMillisOfSecond()", - "get(ChronoField.MILLI_OF_SECOND)" - ); + assertThat(javaTime.get(ChronoField.MILLI_OF_SECOND), equalTo(jodaTime.getMillisOfSecond())); } public void testMinuteOfDay() { - assertMethodDeprecation( - () -> assertThat(javaTime.getMinuteOfDay(), equalTo(jodaTime.getMinuteOfDay())), - "getMinuteOfDay()", - "get(ChronoField.MINUTE_OF_DAY)" - ); + assertThat(javaTime.get(ChronoField.MINUTE_OF_DAY), equalTo(jodaTime.getMinuteOfDay())); } public void testMinuteOfHour() { - assertMethodDeprecation( - () -> assertThat(javaTime.getMinuteOfHour(), equalTo(jodaTime.getMinuteOfHour())), - "getMinuteOfHour()", - "getMinute()" - ); + assertThat(javaTime.getMinute(), equalTo(jodaTime.getMinuteOfHour())); } public void testMonthOfYear() { - assertMethodDeprecation( - () -> assertThat(javaTime.getMonthOfYear(), equalTo(jodaTime.getMonthOfYear())), - "getMonthOfYear()", - "getMonthValue()" - ); + assertThat(javaTime.getMonthValue(), equalTo(jodaTime.getMonthOfYear())); } public void testSecondOfDay() { - assertMethodDeprecation( - () -> assertThat(javaTime.getSecondOfDay(), equalTo(jodaTime.getSecondOfDay())), - "getSecondOfDay()", - "get(ChronoField.SECOND_OF_DAY)" - ); + assertThat(javaTime.get(ChronoField.SECOND_OF_DAY), equalTo(jodaTime.getSecondOfDay())); } public void testSecondOfMinute() { - assertMethodDeprecation( - () -> assertThat(javaTime.getSecondOfMinute(), equalTo(jodaTime.getSecondOfMinute())), - "getSecondOfMinute()", - "getSecond()" - ); + assertThat(javaTime.getSecond(), equalTo(jodaTime.getSecondOfMinute())); } public void testWeekOfWeekyear() { - assertMethodDeprecation( - () -> assertThat(javaTime.getWeekOfWeekyear(), equalTo(jodaTime.getWeekOfWeekyear())), - "getWeekOfWeekyear()", - "get(DateFormatters.WEEK_FIELDS_ROOT.weekOfWeekBasedYear())" - ); + assertThat(javaTime.get(DateFormatters.WEEK_FIELDS_ROOT.weekOfWeekBasedYear()), equalTo(jodaTime.getWeekOfWeekyear())); } public void testWeekyear() { - assertMethodDeprecation( - () -> assertThat(javaTime.getWeekyear(), equalTo(jodaTime.getWeekyear())), - "getWeekyear()", - "get(DateFormatters.WEEK_FIELDS_ROOT.weekBasedYear())" - ); + assertThat(javaTime.get(DateFormatters.WEEK_FIELDS_ROOT.weekBasedYear()), equalTo(jodaTime.getWeekyear())); } public void testYearOfCentury() { - assertMethodDeprecation( - () -> assertThat(javaTime.getYearOfCentury(), equalTo(jodaTime.getYearOfCentury())), - "getYearOfCentury()", - "get(ChronoField.YEAR_OF_ERA) % 100" - ); + assertThat(javaTime.get(ChronoField.YEAR_OF_ERA) % 100, equalTo(jodaTime.getYearOfCentury())); } public void testYearOfEra() { - assertMethodDeprecation( - () -> assertThat(javaTime.getYearOfEra(), equalTo(jodaTime.getYearOfEra())), - "getYearOfEra()", - "get(ChronoField.YEAR_OF_ERA)" - ); - } - - public void testToString1() { - assertMethodDeprecation( - () -> assertThat(javaTime.toString("YYYY/MM/dd HH:mm:ss.SSS"), equalTo(jodaTime.toString("YYYY/MM/dd HH:mm:ss.SSS"))), - "toString(String)", - "a DateTimeFormatter" - ); + assertThat(javaTime.get(ChronoField.YEAR_OF_ERA), equalTo(jodaTime.getYearOfEra())); } public void testToString2() { - assertMethodDeprecation( - () -> assertThat(javaTime.toString("EEE", Locale.GERMANY), equalTo(jodaTime.toString("EEE", Locale.GERMANY))), - "toString(String,Locale)", - "a DateTimeFormatter" - ); + assertThat(DateTimeFormatter.ofPattern("EEE", Locale.GERMANY).format(javaTime), equalTo(jodaTime.toString("EEE", Locale.GERMANY))); } public void testDayOfWeek() { - assertDeprecation( - () -> assertThat(javaTime.getDayOfWeek(), equalTo(jodaTime.getDayOfWeek())), - "The return type of [getDayOfWeek()] will change to an enum in 7.0. Use getDayOfWeekEnum().getValue()." - ); + assertThat(javaTime.getDayOfWeekEnum().getValue(), equalTo(jodaTime.getDayOfWeek())); } public void testDayOfWeekEnum() { assertThat(javaTime.getDayOfWeekEnum(), equalTo(DayOfWeek.of(jodaTime.getDayOfWeek()))); } - public void testToStringWithLocaleAndZeroOffset() { - JodaCompatibleZonedDateTime dt = new JodaCompatibleZonedDateTime(Instant.EPOCH, ZoneOffset.ofTotalSeconds(0)); - assertMethodDeprecation(() -> dt.toString("yyyy-MM-dd hh:mm", Locale.ROOT), "toString(String,Locale)", "a DateTimeFormatter"); - } - - public void testToStringAndZeroOffset() { - JodaCompatibleZonedDateTime dt = new JodaCompatibleZonedDateTime(Instant.EPOCH, ZoneOffset.ofTotalSeconds(0)); - assertMethodDeprecation(() -> dt.toString("yyyy-MM-dd hh:mm"), "toString(String)", "a DateTimeFormatter"); - } - public void testIsEqual() { assertTrue(javaTime.isEqual(javaTime)); } From 471a64a1961375af0b44678dec69dd9b83ed338b Mon Sep 17 00:00:00 2001 From: Bharathwaj G Date: Tue, 17 May 2022 10:19:53 +0530 Subject: [PATCH 20/20] addressing comments Signed-off-by: Bharathwaj G --- .../org/opensearch/action/search/CreatePitController.java | 2 +- .../main/java/org/opensearch/action/search/SearchUtils.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/opensearch/action/search/CreatePitController.java b/server/src/main/java/org/opensearch/action/search/CreatePitController.java index 4ed2e5b3de0a3..3d2ecc8b695c6 100644 --- a/server/src/main/java/org/opensearch/action/search/CreatePitController.java +++ b/server/src/main/java/org/opensearch/action/search/CreatePitController.java @@ -229,7 +229,7 @@ private StepListener> getConnectionLoo .filter(ctx -> Strings.isEmpty(ctx.getClusterAlias()) == false) .map(SearchContextIdForNode::getClusterAlias) .collect(Collectors.toSet()); - return SearchUtils.getConnectionLookupListener(searchTransportService, state, clusters); + return SearchUtils.getConnectionLookupListener(searchTransportService.getRemoteClusterService(), state, clusters); } private ActionListener getGroupedListener( diff --git a/server/src/main/java/org/opensearch/action/search/SearchUtils.java b/server/src/main/java/org/opensearch/action/search/SearchUtils.java index 0fdb1331d8ad6..148d1645568b1 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchUtils.java +++ b/server/src/main/java/org/opensearch/action/search/SearchUtils.java @@ -11,6 +11,7 @@ import org.opensearch.action.StepListener; import org.opensearch.cluster.ClusterState; import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.transport.RemoteClusterService; import java.util.Set; import java.util.function.BiFunction; @@ -26,7 +27,7 @@ public SearchUtils() {} * Get connection lookup listener for list of clusters passed */ public static StepListener> getConnectionLookupListener( - SearchTransportService searchTransportService, + RemoteClusterService remoteClusterService, ClusterState state, Set clusters ) { @@ -35,7 +36,7 @@ public static StepListener> getConnect if (clusters.isEmpty()) { lookupListener.onResponse((cluster, nodeId) -> state.getNodes().get(nodeId)); } else { - searchTransportService.getRemoteClusterService().collectNodes(clusters, lookupListener); + remoteClusterService.collectNodes(clusters, lookupListener); } return lookupListener; }