From a38dc2c55a5973eacd0f8068432cbb3e180d2b1f Mon Sep 17 00:00:00 2001
From: Andriy Redko
Date: Mon, 13 Nov 2023 16:45:04 -0500
Subject: [PATCH] [BWC and API enforcement] Decorate the existing APIs with
proper annotations (part 3)
Signed-off-by: Andriy Redko
---
.../core/action/ActionResponse.java | 2 ++
.../core/common/io/stream/Writeable.java | 5 ++++-
.../core/common/util/ByteArray.java | 4 +++-
.../breaker/AllCircuitBreakerStats.java | 4 +++-
.../breaker/CircuitBreakerService.java | 8 +++----
.../indices/breaker/CircuitBreakerStats.java | 4 +++-
.../core/xcontent/ObjectParser.java | 4 +++-
.../org/opensearch/action/AliasesRequest.java | 5 ++++-
.../opensearch/action/OriginalIndices.java | 4 +++-
.../ClusterAllocationExplanation.java | 4 +++-
.../snapshots/status/SnapshotStatus.java | 4 +++-
.../admin/indices/rollover/RolloverInfo.java | 4 +++-
.../action/search/ParsedScrollId.java | 5 ++++-
.../action/search/SearchContextIdForNode.java | 4 +++-
.../opensearch/action/search/SearchPhase.java | 4 +++-
.../action/search/ShardSearchFailure.java | 4 +++-
.../action/support/ActiveShardCount.java | 4 +++-
.../org/opensearch/cluster/ClusterState.java | 10 ++++++---
.../org/opensearch/cluster/NamedDiff.java | 4 +++-
.../opensearch/cluster/RestoreInProgress.java | 13 +++++++----
.../cluster/SnapshotsInProgress.java | 4 +++-
.../ack/ClusterStateUpdateResponse.java | 5 ++++-
.../cluster/block/ClusterBlockException.java | 4 +++-
.../cluster/block/ClusterBlocks.java | 7 ++++--
.../block/IndexCreateBlockException.java | 4 +++-
.../coordination/CoordinationMetadata.java | 13 +++++++----
.../DecommissionAttributeMetadata.java | 4 +++-
.../cluster/metadata/ComponentTemplate.java | 4 +++-
.../metadata/ComposableIndexTemplate.java | 7 ++++--
.../cluster/metadata/DiffableStringMap.java | 4 +++-
.../cluster/metadata/IndexAbstraction.java | 10 +++++++--
.../cluster/metadata/IndexGraveyard.java | 10 ++++++---
.../cluster/metadata/IndexMetadata.java | 9 +++++---
.../opensearch/cluster/metadata/Metadata.java | 13 +++++++----
.../opensearch/cluster/metadata/Template.java | 4 +++-
.../metadata/WeightedRoutingMetadata.java | 7 +++---
.../cluster/node/DiscoveryNode.java | 22 -------------------
.../cluster/node/DiscoveryNodeFilters.java | 7 ++++--
.../cluster/routing/AllocationId.java | 4 +++-
.../cluster/routing/GroupShardsIterator.java | 4 +++-
.../cluster/routing/IndexRoutingTable.java | 7 ++++--
.../routing/IndexShardRoutingTable.java | 7 ++++--
.../cluster/routing/RecoverySource.java | 6 +++--
.../routing/RoutingChangesObserver.java | 5 ++++-
.../cluster/routing/RoutingNode.java | 4 +++-
.../cluster/routing/RoutingNodes.java | 10 ++++++---
.../cluster/routing/RoutingTable.java | 7 ++++--
.../cluster/routing/ShardIterator.java | 4 +++-
.../routing/ShardMovementStrategy.java | 4 +++-
.../cluster/routing/ShardRouting.java | 4 +++-
.../cluster/routing/ShardsIterator.java | 4 +++-
.../AllocateUnassignedDecision.java | 4 +++-
.../allocation/AllocationDecision.java | 4 +++-
.../routing/allocation/MoveDecision.java | 4 +++-
.../allocation/NodeAllocationResult.java | 7 ++++--
.../routing/allocation/RoutingAllocation.java | 7 ++++--
.../allocation/ShardAllocationDecision.java | 4 +++-
.../allocation/command/AllocationCommand.java | 4 +++-
.../command/AllocationCommands.java | 4 +++-
.../allocation/decider/AllocationDecider.java | 4 +++-
.../decider/AllocationDeciders.java | 4 +++-
.../java/org/opensearch/common/Rounding.java | 13 +++++++----
.../org/opensearch/common/cache/Cache.java | 7 ++++--
.../opensearch/common/cache/CacheLoader.java | 5 ++++-
.../common/cache/RemovalNotification.java | 5 ++++-
.../common/cache/RemovalReason.java | 5 ++++-
.../common/compress/CompressedXContent.java | 4 +++-
.../common/time/DateMathParser.java | 4 +++-
.../org/opensearch/common/util/BigArrays.java | 2 ++
.../org/opensearch/common/util/Countable.java | 5 ++++-
.../opensearch/common/util/DoubleArray.java | 4 +++-
.../opensearch/common/util/FloatArray.java | 4 +++-
.../org/opensearch/common/util/IntArray.java | 4 +++-
.../org/opensearch/common/util/LongArray.java | 4 +++-
.../opensearch/common/util/ObjectArray.java | 4 +++-
.../common/util/concurrent/ThreadContext.java | 7 ++++--
.../ThreadContextStatePropagator.java | 5 +++++
.../org/opensearch/env/NodeEnvironment.java | 3 +++
.../org/opensearch/index/IndexService.java | 7 ++++--
.../index/cache/query/QueryCache.java | 4 +++-
.../index/fielddata/DocValueBits.java | 5 ++++-
.../index/fielddata/IndexFieldData.java | 13 ++++++++---
.../index/fielddata/IndexFieldDataCache.java | 7 ++++--
.../index/fielddata/LeafFieldData.java | 4 +++-
.../index/fielddata/NumericDoubleValues.java | 4 +++-
.../fielddata/SortedNumericDoubleValues.java | 4 +++-
.../index/mapper/DocValueFetcher.java | 4 +++-
.../index/mapper/MappedFieldType.java | 7 ++++--
.../index/mapper/TextSearchInfo.java | 7 ++++--
.../opensearch/index/mapper/ValueFetcher.java | 4 +++-
.../index/query/InnerHitBuilder.java | 4 ++++
.../opensearch/index/query/Rewriteable.java | 4 +++-
.../index/seqno/SequenceNumbers.java | 5 ++++-
.../index/shard/IndexEventListener.java | 4 +++-
.../index/shard/IndexShardState.java | 5 ++++-
.../org/opensearch/index/shard/ShardPath.java | 4 +++-
.../index/similarity/SimilarityProvider.java | 4 +++-
.../snapshots/IndexShardSnapshotStatus.java | 11 +++++++---
.../org/opensearch/index/store/Store.java | 10 ++++++---
.../index/store/StoreFileMetadata.java | 4 +++-
.../remote/filecache/CachedIndexInput.java | 4 +++-
.../store/remote/filecache/FileCache.java | 4 +++-
.../store/remote/utils/cache/CacheUsage.java | 3 +++
.../remote/utils/cache/stats/CacheStats.java | 4 +++-
.../BufferedChecksumStreamOutput.java | 4 +++-
.../index/translog/ChannelFactory.java | 5 ++++-
.../opensearch/index/translog/Translog.java | 21 ++++++++++++------
.../index/translog/TranslogConfig.java | 4 +++-
.../translog/TranslogDeletionPolicy.java | 4 +++-
.../index/translog/TranslogFactory.java | 5 ++++-
.../opensearch/indices/IndicesQueryCache.java | 4 +++-
.../cluster/IndicesClusterStateService.java | 4 +++-
.../cache/IndicesFieldDataCache.java | 7 ++++--
.../node/AdaptiveSelectionStats.java | 4 +++-
.../main/java/org/opensearch/node/Node.java | 19 ++++++++--------
.../node/ResponseCollectorService.java | 7 +++++-
.../opensearch/plugins/IndexStorePlugin.java | 8 +++++++
.../org/opensearch/repositories/IndexId.java | 4 +++-
.../IndexMetaDataGenerations.java | 4 +++-
.../opensearch/repositories/Repository.java | 7 +++++-
.../repositories/RepositoryData.java | 4 +++-
.../repositories/RepositoryInfo.java | 4 +++-
.../repositories/RepositoryShardId.java | 4 +++-
.../repositories/RepositoryStats.java | 4 +++-
.../repositories/RepositoryStatsSnapshot.java | 4 +++-
.../repositories/ShardGenerations.java | 7 ++++--
.../opensearch/script/AggregationScript.java | 7 ++++--
.../org/opensearch/search/DocValueFormat.java | 4 +++-
.../org/opensearch/search/MultiValueMode.java | 4 +++-
.../java/org/opensearch/search/SearchHit.java | 7 ++++--
.../org/opensearch/search/SearchHits.java | 4 +++-
.../opensearch/search/SearchShardTarget.java | 4 +++-
.../opensearch/search/SearchSortValues.java | 4 +++-
.../search/SearchSortValuesAndFormats.java | 4 +++-
.../search/aggregations/Aggregation.java | 4 +++-
.../aggregations/AggregationBuilder.java | 7 ++++--
.../search/aggregations/Aggregations.java | 4 +++-
.../search/aggregations/Aggregator.java | 8 +++++--
.../aggregations/AggregatorFactories.java | 7 ++++--
.../aggregations/AggregatorFactory.java | 4 +++-
.../aggregations/CardinalityUpperBound.java | 4 +++-
.../aggregations/InternalAggregation.java | 10 ++++++---
.../aggregations/InternalAggregations.java | 4 +++-
.../PipelineAggregationBuilder.java | 4 +++-
.../bucket/LocalBucketCountThresholds.java | 4 +++-
.../bucket/terms/TermsAggregator.java | 4 +++-
.../pipeline/PipelineAggregator.java | 7 ++++--
.../aggregations/support/AggregationInfo.java | 4 +++-
.../aggregations/support/AggregationPath.java | 4 +++-
.../support/AggregationUsageService.java | 7 ++++--
.../aggregations/support/FieldContext.java | 4 +++-
.../aggregations/support/ValueType.java | 4 +++-
.../aggregations/support/ValuesSource.java | 4 +++-
.../support/ValuesSourceConfig.java | 4 +++-
.../support/ValuesSourceRegistry.java | 10 ++++++---
.../support/ValuesSourceType.java | 4 +++-
.../search/builder/SearchSourceBuilder.java | 10 ++++++---
.../search/fetch/StoredFieldsContext.java | 4 +++-
.../search/fetch/subphase/FieldAndFormat.java | 4 +++-
.../subphase/highlight/HighlightField.java | 4 +++-
.../search/internal/ShardSearchContextId.java | 4 +++-
.../search/internal/ShardSearchRequest.java | 4 +++-
.../search/rescore/RescoreContext.java | 4 +++-
.../opensearch/search/rescore/Rescorer.java | 4 +++-
.../search/rescore/RescorerBuilder.java | 4 +++-
.../opensearch/search/sort/BucketedSort.java | 16 ++++++++++----
.../search/sort/NestedSortBuilder.java | 4 +++-
.../search/sort/SortAndFormats.java | 4 +++-
.../opensearch/search/sort/SortBuilder.java | 4 +++-
.../org/opensearch/search/sort/SortValue.java | 4 +++-
.../InternalSnapshotsInfoService.java | 5 +++--
.../snapshots/SnapshotShardSizeInfo.java | 4 +++-
172 files changed, 685 insertions(+), 269 deletions(-)
diff --git a/libs/core/src/main/java/org/opensearch/core/action/ActionResponse.java b/libs/core/src/main/java/org/opensearch/core/action/ActionResponse.java
index 041d8b1bffb4a..7525bfb243aae 100644
--- a/libs/core/src/main/java/org/opensearch/core/action/ActionResponse.java
+++ b/libs/core/src/main/java/org/opensearch/core/action/ActionResponse.java
@@ -32,6 +32,7 @@
package org.opensearch.core.action;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.transport.TransportResponse;
@@ -42,6 +43,7 @@
*
* @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class ActionResponse extends TransportResponse {
public ActionResponse() {}
diff --git a/libs/core/src/main/java/org/opensearch/core/common/io/stream/Writeable.java b/libs/core/src/main/java/org/opensearch/core/common/io/stream/Writeable.java
index af9df51655414..c8d98478bd669 100644
--- a/libs/core/src/main/java/org/opensearch/core/common/io/stream/Writeable.java
+++ b/libs/core/src/main/java/org/opensearch/core/common/io/stream/Writeable.java
@@ -32,6 +32,8 @@
package org.opensearch.core.common.io.stream;
+import org.opensearch.common.annotation.PublicApi;
+
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -41,8 +43,9 @@
* 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
+ * @opensearch.api
*/
+@PublicApi(since = "2.8.0")
public interface Writeable {
/**
* A WriteableRegistry registers {@link Writer} methods for writing data types over a
diff --git a/libs/core/src/main/java/org/opensearch/core/common/util/ByteArray.java b/libs/core/src/main/java/org/opensearch/core/common/util/ByteArray.java
index e50f24417f8bc..f4d81c4ca4363 100644
--- a/libs/core/src/main/java/org/opensearch/core/common/util/ByteArray.java
+++ b/libs/core/src/main/java/org/opensearch/core/common/util/ByteArray.java
@@ -33,14 +33,16 @@
package org.opensearch.core.common.util;
import org.apache.lucene.util.BytesRef;
+import org.opensearch.common.annotation.PublicApi;
import java.nio.ByteBuffer;
/**
* Abstraction of an array of byte values.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface ByteArray extends BigArray {
/**
diff --git a/libs/core/src/main/java/org/opensearch/core/indices/breaker/AllCircuitBreakerStats.java b/libs/core/src/main/java/org/opensearch/core/indices/breaker/AllCircuitBreakerStats.java
index 3ce8b4953b9d6..992655efec8f0 100644
--- a/libs/core/src/main/java/org/opensearch/core/indices/breaker/AllCircuitBreakerStats.java
+++ b/libs/core/src/main/java/org/opensearch/core/indices/breaker/AllCircuitBreakerStats.java
@@ -32,6 +32,7 @@
package org.opensearch.core.indices.breaker;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
@@ -43,8 +44,9 @@
/**
* Stats class encapsulating all of the different circuit breaker stats
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class AllCircuitBreakerStats implements Writeable, ToXContentFragment {
/** An array of all the circuit breaker stats */
diff --git a/libs/core/src/main/java/org/opensearch/core/indices/breaker/CircuitBreakerService.java b/libs/core/src/main/java/org/opensearch/core/indices/breaker/CircuitBreakerService.java
index ee9c94f432a36..dedeb0803271f 100644
--- a/libs/core/src/main/java/org/opensearch/core/indices/breaker/CircuitBreakerService.java
+++ b/libs/core/src/main/java/org/opensearch/core/indices/breaker/CircuitBreakerService.java
@@ -32,8 +32,7 @@
package org.opensearch.core.indices.breaker;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lifecycle.AbstractLifecycleComponent;
import org.opensearch.core.common.breaker.CircuitBreaker;
@@ -41,11 +40,10 @@
* Interface for Circuit Breaker services, which provide breakers to classes
* that load field data.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class CircuitBreakerService extends AbstractLifecycleComponent {
- private static final Logger logger = LogManager.getLogger(CircuitBreakerService.class);
-
protected CircuitBreakerService() {}
/**
diff --git a/libs/core/src/main/java/org/opensearch/core/indices/breaker/CircuitBreakerStats.java b/libs/core/src/main/java/org/opensearch/core/indices/breaker/CircuitBreakerStats.java
index 9207d3ea77227..ee71cf8d2ac0e 100644
--- a/libs/core/src/main/java/org/opensearch/core/indices/breaker/CircuitBreakerStats.java
+++ b/libs/core/src/main/java/org/opensearch/core/indices/breaker/CircuitBreakerStats.java
@@ -32,6 +32,7 @@
package org.opensearch.core.indices.breaker;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
@@ -45,8 +46,9 @@
/**
* Class encapsulating stats about the {@link org.opensearch.core.common.breaker.CircuitBreaker}
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class CircuitBreakerStats implements Writeable, ToXContentObject {
/** The name of the circuit breaker */
diff --git a/libs/core/src/main/java/org/opensearch/core/xcontent/ObjectParser.java b/libs/core/src/main/java/org/opensearch/core/xcontent/ObjectParser.java
index 365b36c755dd2..04d0bce27c04f 100644
--- a/libs/core/src/main/java/org/opensearch/core/xcontent/ObjectParser.java
+++ b/libs/core/src/main/java/org/opensearch/core/xcontent/ObjectParser.java
@@ -32,6 +32,7 @@
package org.opensearch.core.xcontent;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.ParseField;
import java.io.IOException;
@@ -83,8 +84,9 @@
* It's highly recommended to use the high level declare methods like {@link #declareString(BiConsumer, ParseField)} instead of
* {@link #declareField} which can be used to implement exceptional parsing operations not covered by the high level methods.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class ObjectParser extends AbstractObjectParser
implements
BiFunction,
diff --git a/server/src/main/java/org/opensearch/action/AliasesRequest.java b/server/src/main/java/org/opensearch/action/AliasesRequest.java
index 3632ba2d7304f..8fe6f49c08af0 100644
--- a/server/src/main/java/org/opensearch/action/AliasesRequest.java
+++ b/server/src/main/java/org/opensearch/action/AliasesRequest.java
@@ -32,14 +32,17 @@
package org.opensearch.action;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* Needs to be implemented by all {@link org.opensearch.action.ActionRequest} subclasses that relate to
* one or more indices and one or more aliases. Meant to be used for aliases management requests (e.g. add/remove alias,
* get aliases) that hold aliases and indices in separate fields.
* Allows to retrieve which indices and aliases the action relates to.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface AliasesRequest extends IndicesRequest.Replaceable {
/**
diff --git a/server/src/main/java/org/opensearch/action/OriginalIndices.java b/server/src/main/java/org/opensearch/action/OriginalIndices.java
index 1e24c64bc60fc..1c26bf9d416f5 100644
--- a/server/src/main/java/org/opensearch/action/OriginalIndices.java
+++ b/server/src/main/java/org/opensearch/action/OriginalIndices.java
@@ -33,6 +33,7 @@
package org.opensearch.action;
import org.opensearch.action.support.IndicesOptions;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -42,8 +43,9 @@
/**
* Used to keep track of original indices within internal (e.g. shard level) requests
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class OriginalIndices implements IndicesRequest {
// constant to use when original indices are not applicable and will not be serialized across the wire
diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java
index f4705a21f5014..3c8f07613561d 100644
--- a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java
+++ b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java
@@ -40,6 +40,7 @@
import org.opensearch.cluster.routing.allocation.AllocationDecision;
import org.opensearch.cluster.routing.allocation.ShardAllocationDecision;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
@@ -58,8 +59,9 @@
* or if it is not unassigned, then which nodes it could possibly be relocated to.
* It is an immutable class.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class ClusterAllocationExplanation implements ToXContentObject, Writeable {
private final ShardRouting shardRouting;
diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStatus.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStatus.java
index 0b101070db478..e0f380b3ebbe6 100644
--- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStatus.java
+++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStatus.java
@@ -35,6 +35,7 @@
import org.opensearch.cluster.SnapshotsInProgress;
import org.opensearch.cluster.SnapshotsInProgress.State;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.ParseField;
import org.opensearch.core.common.Strings;
import org.opensearch.core.common.io.stream.StreamInput;
@@ -68,8 +69,9 @@
/**
* Status of a snapshot
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class SnapshotStatus implements ToXContentObject, Writeable {
private final Snapshot snapshot;
diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverInfo.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverInfo.java
index 475e44e1820d5..75c68350e2204 100644
--- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverInfo.java
+++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverInfo.java
@@ -34,6 +34,7 @@
import org.opensearch.cluster.AbstractDiffable;
import org.opensearch.cluster.Diff;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.ParseField;
import org.opensearch.core.common.Strings;
import org.opensearch.core.common.io.stream.StreamInput;
@@ -52,8 +53,9 @@
/**
* Class for holding Rollover related information within an index
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class RolloverInfo extends AbstractDiffable implements Writeable, ToXContentFragment {
public static final ParseField CONDITION_FIELD = new ParseField("met_conditions");
diff --git a/server/src/main/java/org/opensearch/action/search/ParsedScrollId.java b/server/src/main/java/org/opensearch/action/search/ParsedScrollId.java
index 70be9a0b19e08..b723b97b5c413 100644
--- a/server/src/main/java/org/opensearch/action/search/ParsedScrollId.java
+++ b/server/src/main/java/org/opensearch/action/search/ParsedScrollId.java
@@ -32,13 +32,16 @@
package org.opensearch.action.search;
+import org.opensearch.common.annotation.PublicApi;
+
import java.util.Arrays;
/**
* Search scroll id that has been parsed
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class ParsedScrollId {
public static final String QUERY_THEN_FETCH_TYPE = "queryThenFetch";
diff --git a/server/src/main/java/org/opensearch/action/search/SearchContextIdForNode.java b/server/src/main/java/org/opensearch/action/search/SearchContextIdForNode.java
index 59c0e54bb6cbc..7c702c16030b7 100644
--- a/server/src/main/java/org/opensearch/action/search/SearchContextIdForNode.java
+++ b/server/src/main/java/org/opensearch/action/search/SearchContextIdForNode.java
@@ -33,6 +33,7 @@
package org.opensearch.action.search;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
@@ -43,8 +44,9 @@
/**
* Id for a search context per node.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class SearchContextIdForNode implements Writeable {
private final String node;
private final ShardSearchContextId searchContextId;
diff --git a/server/src/main/java/org/opensearch/action/search/SearchPhase.java b/server/src/main/java/org/opensearch/action/search/SearchPhase.java
index 1c7b3c1f1563c..0890e9f5de8d4 100644
--- a/server/src/main/java/org/opensearch/action/search/SearchPhase.java
+++ b/server/src/main/java/org/opensearch/action/search/SearchPhase.java
@@ -32,6 +32,7 @@
package org.opensearch.action.search;
import org.opensearch.common.CheckedRunnable;
+import org.opensearch.common.annotation.PublicApi;
import java.io.IOException;
import java.util.Locale;
@@ -40,8 +41,9 @@
/**
* Base class for all individual search phases like collecting distributed frequencies, fetching documents, querying shards.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class SearchPhase implements CheckedRunnable {
private final String name;
private long startTimeInNanos;
diff --git a/server/src/main/java/org/opensearch/action/search/ShardSearchFailure.java b/server/src/main/java/org/opensearch/action/search/ShardSearchFailure.java
index 4d3f9b71a919c..ef490844db692 100644
--- a/server/src/main/java/org/opensearch/action/search/ShardSearchFailure.java
+++ b/server/src/main/java/org/opensearch/action/search/ShardSearchFailure.java
@@ -37,6 +37,7 @@
import org.opensearch.action.OriginalIndices;
import org.opensearch.cluster.metadata.IndexMetadata;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.action.ShardOperationFailedException;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -56,8 +57,9 @@
/**
* Represents a failure to search on a specific shard.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class ShardSearchFailure extends ShardOperationFailedException {
private static final String REASON_FIELD = "reason";
diff --git a/server/src/main/java/org/opensearch/action/support/ActiveShardCount.java b/server/src/main/java/org/opensearch/action/support/ActiveShardCount.java
index 15275ba48fc6e..e91342a7ce4b8 100644
--- a/server/src/main/java/org/opensearch/action/support/ActiveShardCount.java
+++ b/server/src/main/java/org/opensearch/action/support/ActiveShardCount.java
@@ -36,6 +36,7 @@
import org.opensearch.cluster.metadata.IndexMetadata;
import org.opensearch.cluster.routing.IndexRoutingTable;
import org.opensearch.cluster.routing.IndexShardRoutingTable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
@@ -48,8 +49,9 @@
* A class whose instances represent a value for counting the number
* of active shard copies for a given shard in an index.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class ActiveShardCount implements Writeable {
private static final int ACTIVE_SHARD_COUNT_DEFAULT = -2;
diff --git a/server/src/main/java/org/opensearch/cluster/ClusterState.java b/server/src/main/java/org/opensearch/cluster/ClusterState.java
index 1b87a60c2ccf5..9e63f961d241d 100644
--- a/server/src/main/java/org/opensearch/cluster/ClusterState.java
+++ b/server/src/main/java/org/opensearch/cluster/ClusterState.java
@@ -49,6 +49,7 @@
import org.opensearch.cluster.routing.ShardRouting;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.UUIDs;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.io.stream.BytesStreamOutput;
import org.opensearch.common.settings.Settings;
import org.opensearch.core.common.Strings;
@@ -97,8 +98,9 @@
* throws the {@link IncompatibleClusterStateVersionException}, which causes the publishing mechanism to send
* a full version of the cluster state to the node on which this exception was thrown.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class ClusterState implements ToXContentFragment, Diffable {
public static final ClusterState EMPTY_STATE = builder(ClusterName.CLUSTER_NAME_SETTING.getDefault(Settings.EMPTY)).build();
@@ -139,8 +141,9 @@ static boolean shouldSerializ
/**
* Custom cluster state.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface Custom extends NamedDiffable, ToXContentFragment, FeatureAware {
/**
@@ -596,8 +599,9 @@ public static Builder builder(ClusterState state) {
/**
* Builder for cluster state.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Builder {
private final ClusterName clusterName;
diff --git a/server/src/main/java/org/opensearch/cluster/NamedDiff.java b/server/src/main/java/org/opensearch/cluster/NamedDiff.java
index ce971aa723394..e994cfb224386 100644
--- a/server/src/main/java/org/opensearch/cluster/NamedDiff.java
+++ b/server/src/main/java/org/opensearch/cluster/NamedDiff.java
@@ -33,13 +33,15 @@
package org.opensearch.cluster;
import org.opensearch.Version;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.NamedWriteable;
/**
* Diff that also support NamedWriteable interface
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface NamedDiff> extends Diff, NamedWriteable {
/**
* The minimal version of the recipient this custom object can be sent to
diff --git a/server/src/main/java/org/opensearch/cluster/RestoreInProgress.java b/server/src/main/java/org/opensearch/cluster/RestoreInProgress.java
index 3e0c78099e6b4..769f97373f7b7 100644
--- a/server/src/main/java/org/opensearch/cluster/RestoreInProgress.java
+++ b/server/src/main/java/org/opensearch/cluster/RestoreInProgress.java
@@ -34,6 +34,7 @@
import org.opensearch.Version;
import org.opensearch.cluster.ClusterState.Custom;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
@@ -54,8 +55,9 @@
/**
* Meta data about restore processes that are currently executing
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class RestoreInProgress extends AbstractNamedDiffable implements Custom, Iterable {
/**
@@ -139,8 +141,9 @@ public RestoreInProgress build() {
/**
* Restore metadata
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Entry {
private final String uuid;
private final State state;
@@ -238,8 +241,9 @@ public int hashCode() {
/**
* Represents status of a restored shard
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class ShardRestoreStatus implements Writeable {
private State state;
private String nodeId;
@@ -363,8 +367,9 @@ public int hashCode() {
/**
* Shard restore process state
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public enum State {
/**
* Initializing state
diff --git a/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java b/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java
index 952591f346536..3de23d2490c63 100644
--- a/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java
+++ b/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java
@@ -35,6 +35,7 @@
import org.opensearch.Version;
import org.opensearch.cluster.ClusterState.Custom;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.unit.TimeValue;
import org.opensearch.core.common.Strings;
import org.opensearch.core.common.io.stream.StreamInput;
@@ -928,8 +929,9 @@ public String toString() {
/**
* State of the snapshots.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public enum State {
INIT((byte) 0, false),
STARTED((byte) 1, false),
diff --git a/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateResponse.java b/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateResponse.java
index db26496c6f263..837bf8af449ad 100644
--- a/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateResponse.java
+++ b/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateResponse.java
@@ -32,11 +32,14 @@
package org.opensearch.cluster.ack;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* Base response returned after a cluster state update
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class ClusterStateUpdateResponse {
private final boolean acknowledged;
diff --git a/server/src/main/java/org/opensearch/cluster/block/ClusterBlockException.java b/server/src/main/java/org/opensearch/cluster/block/ClusterBlockException.java
index 4673f075e8439..ea6c0c69c523d 100644
--- a/server/src/main/java/org/opensearch/cluster/block/ClusterBlockException.java
+++ b/server/src/main/java/org/opensearch/cluster/block/ClusterBlockException.java
@@ -33,6 +33,7 @@
package org.opensearch.cluster.block;
import org.opensearch.OpenSearchException;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.rest.RestStatus;
@@ -49,8 +50,9 @@
/**
* Internal exception on obtaining a cluster block
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class ClusterBlockException extends OpenSearchException {
private final Set blocks;
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 bcb4f7f71268e..304136166d515 100644
--- a/server/src/main/java/org/opensearch/cluster/block/ClusterBlocks.java
+++ b/server/src/main/java/org/opensearch/cluster/block/ClusterBlocks.java
@@ -37,6 +37,7 @@
import org.opensearch.cluster.metadata.IndexMetadata;
import org.opensearch.cluster.metadata.MetadataIndexStateService;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.set.Sets;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -59,8 +60,9 @@
/**
* Represents current cluster level blocks to block dirty operations done against the cluster.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class ClusterBlocks extends AbstractDiffable {
public static final ClusterBlocks EMPTY_CLUSTER_BLOCK = new ClusterBlocks(emptySet(), Map.of());
@@ -355,8 +357,9 @@ public static Builder builder() {
/**
* Builder for cluster blocks.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Builder {
private final Set global = new HashSet<>();
diff --git a/server/src/main/java/org/opensearch/cluster/block/IndexCreateBlockException.java b/server/src/main/java/org/opensearch/cluster/block/IndexCreateBlockException.java
index 729d76c72e99e..3e9fa3e23a12f 100644
--- a/server/src/main/java/org/opensearch/cluster/block/IndexCreateBlockException.java
+++ b/server/src/main/java/org/opensearch/cluster/block/IndexCreateBlockException.java
@@ -8,6 +8,7 @@
package org.opensearch.cluster.block;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import java.io.IOException;
@@ -16,8 +17,9 @@
/**
* Internal exception on obtaining an index create block
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndexCreateBlockException extends ClusterBlockException {
public IndexCreateBlockException(Set globalLevelBlocks) {
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 869c86ae75b90..53398d6f3f98f 100644
--- a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java
+++ b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java
@@ -32,6 +32,7 @@
package org.opensearch.cluster.coordination;
import org.opensearch.cluster.node.DiscoveryNode;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.set.Sets;
import org.opensearch.core.ParseField;
import org.opensearch.core.common.io.stream.StreamInput;
@@ -55,8 +56,9 @@
/**
* Metadata for cluster coordination
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class CoordinationMetadata implements Writeable, ToXContentFragment {
public static final CoordinationMetadata EMPTY_METADATA = builder().build();
@@ -214,8 +216,9 @@ public String toString() {
/**
* Builder for coordination metadata.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Builder {
private long term = 0;
private VotingConfiguration lastCommittedConfiguration = VotingConfiguration.EMPTY_CONFIG;
@@ -266,8 +269,9 @@ public CoordinationMetadata build() {
/**
* Excluded nodes from voting config.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class VotingConfigExclusion implements Writeable, ToXContentFragment {
public static final String MISSING_VALUE_MARKER = "_absent_";
private final String nodeId;
@@ -362,8 +366,9 @@ public String toString() {
/**
* A collection of persistent node ids, denoting the voting configuration for cluster state changes.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class VotingConfiguration implements Writeable, ToXContentFragment {
public static final VotingConfiguration EMPTY_CONFIG = new VotingConfiguration(Collections.emptySet());
diff --git a/server/src/main/java/org/opensearch/cluster/decommission/DecommissionAttributeMetadata.java b/server/src/main/java/org/opensearch/cluster/decommission/DecommissionAttributeMetadata.java
index 3df807a4f94d3..254d70b0422d7 100644
--- a/server/src/main/java/org/opensearch/cluster/decommission/DecommissionAttributeMetadata.java
+++ b/server/src/main/java/org/opensearch/cluster/decommission/DecommissionAttributeMetadata.java
@@ -14,6 +14,7 @@
import org.opensearch.cluster.NamedDiff;
import org.opensearch.cluster.metadata.Metadata;
import org.opensearch.cluster.metadata.Metadata.Custom;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.Strings;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -30,8 +31,9 @@
/**
* Contains metadata about decommission attribute
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "2.4.0")
public class DecommissionAttributeMetadata extends AbstractNamedDiffable implements Custom {
public static final String TYPE = "decommissionedAttribute";
diff --git a/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplate.java b/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplate.java
index cab1b75afe3e1..abc3712ee07e3 100644
--- a/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplate.java
+++ b/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplate.java
@@ -35,6 +35,7 @@
import org.opensearch.cluster.AbstractDiffable;
import org.opensearch.cluster.Diff;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.ParseField;
import org.opensearch.core.common.Strings;
import org.opensearch.core.common.io.stream.StreamInput;
@@ -55,8 +56,9 @@
* contains a field "foo", it's expected to contain all the necessary settings/mappings/etc for the
* "foo" field. These component templates make up the individual pieces composing an index template.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class ComponentTemplate extends AbstractDiffable implements ToXContentObject {
private static final ParseField TEMPLATE = new ParseField("template");
private static final ParseField VERSION = new ParseField("version");
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 5f1291f6c6d82..e7f1b97f28842 100644
--- a/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplate.java
+++ b/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplate.java
@@ -36,6 +36,7 @@
import org.opensearch.cluster.Diff;
import org.opensearch.cluster.metadata.DataStream.TimestampField;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.ParseField;
import org.opensearch.core.common.Strings;
import org.opensearch.core.common.io.stream.StreamInput;
@@ -63,8 +64,9 @@
* ids corresponding to component templates that should be composed in order when creating a new
* index.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class ComposableIndexTemplate extends AbstractDiffable implements ToXContentObject {
private static final ParseField INDEX_PATTERNS = new ParseField("index_patterns");
private static final ParseField TEMPLATE = new ParseField("template");
@@ -284,8 +286,9 @@ public String toString() {
/**
* Template for data stream.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
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/DiffableStringMap.java b/server/src/main/java/org/opensearch/cluster/metadata/DiffableStringMap.java
index 8209c7bb56ad8..a8102182576ff 100644
--- a/server/src/main/java/org/opensearch/cluster/metadata/DiffableStringMap.java
+++ b/server/src/main/java/org/opensearch/cluster/metadata/DiffableStringMap.java
@@ -34,6 +34,7 @@
import org.opensearch.cluster.Diff;
import org.opensearch.cluster.Diffable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -50,8 +51,9 @@
* This is a {@code Map} that implements AbstractDiffable so it
* can be used for cluster state purposes
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class DiffableStringMap extends AbstractMap implements Diffable {
public static final DiffableStringMap EMPTY = new DiffableStringMap(Collections.emptyMap());
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 0c316373e484f..0f3ee894a7f63 100644
--- a/server/src/main/java/org/opensearch/cluster/metadata/IndexAbstraction.java
+++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexAbstraction.java
@@ -33,6 +33,7 @@
import org.opensearch.common.Nullable;
import org.opensearch.common.SetOnce;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.collect.Tuple;
import org.opensearch.core.common.Strings;
@@ -52,8 +53,9 @@
* An index abstraction has a unique name and encapsulates all the {@link IndexMetadata} instances it is pointing to.
* Also depending on type it may refer to a single or many concrete indices and may or may not have a write index.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface IndexAbstraction {
/**
@@ -102,7 +104,10 @@ public interface IndexAbstraction {
/**
* An index abstraction type.
+ *
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
enum Type {
/**
@@ -335,8 +340,9 @@ private boolean isNonEmpty(List idxMetas) {
/**
* A data stream.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
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 85a203e5e059a..b4f8b6b188531 100644
--- a/server/src/main/java/org/opensearch/cluster/metadata/IndexGraveyard.java
+++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexGraveyard.java
@@ -35,6 +35,7 @@
import org.opensearch.Version;
import org.opensearch.cluster.Diff;
import org.opensearch.cluster.NamedDiff;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.time.DateFormatter;
@@ -68,8 +69,9 @@
* tombstones remain in the cluster state for a fixed period of time, after which
* they are purged.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class IndexGraveyard implements Metadata.Custom {
/**
@@ -191,8 +193,9 @@ public static IndexGraveyard.Builder builder(final IndexGraveyard graveyard) {
/**
* A class to build an IndexGraveyard.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static final class Builder {
private List tombstones;
private int numPurged = -1;
@@ -367,8 +370,9 @@ public String getWriteableName() {
/**
* An individual tombstone entry for representing a deleted index.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static final class Tombstone implements ToXContentObject, Writeable {
private static final String INDEX_KEY = "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 2e1421c278879..03784df509ed6 100644
--- a/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java
+++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java
@@ -97,8 +97,9 @@
/**
* Index metadata information
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndexMetadata implements Diffable, ToXContentFragment {
public static final ClusterBlock INDEX_READ_ONLY_BLOCK = new ClusterBlock(
@@ -160,8 +161,9 @@ public class IndexMetadata implements Diffable, ToXContentFragmen
/**
* The state of the index.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public enum State {
OPEN((byte) 0),
CLOSE((byte) 1);
@@ -1211,8 +1213,9 @@ public static Builder builder(IndexMetadata indexMetadata) {
/**
* Builder of index metadata.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Builder {
private String 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 70c1d059a1b9e..1871ed24973c2 100644
--- a/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java
+++ b/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java
@@ -49,6 +49,7 @@
import org.opensearch.cluster.decommission.DecommissionAttributeMetadata;
import org.opensearch.common.Nullable;
import org.opensearch.common.UUIDs;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.regex.Regex;
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Setting.Property;
@@ -98,8 +99,9 @@
/**
* Metadata information
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class Metadata implements Iterable, Diffable, ToXContentFragment {
private static final Logger logger = LogManager.getLogger(Metadata.class);
@@ -127,8 +129,9 @@ public boolean isSegmentReplicationEnabled(String indexName) {
/**
* Context of the XContent.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public enum XContentContext {
/* Custom metadata should be returns as part of API call */
API,
@@ -166,8 +169,9 @@ public enum XContentContext {
/**
* Custom metadata.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface Custom extends NamedDiffable, ToXContentFragment, ClusterState.FeatureAware {
EnumSet context();
@@ -1129,8 +1133,9 @@ public static Builder builder(Metadata metadata) {
/**
* Builder of metadata.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Builder {
private String clusterUUID;
diff --git a/server/src/main/java/org/opensearch/cluster/metadata/Template.java b/server/src/main/java/org/opensearch/cluster/metadata/Template.java
index 8e367c71ed166..bd110c6af8975 100644
--- a/server/src/main/java/org/opensearch/cluster/metadata/Template.java
+++ b/server/src/main/java/org/opensearch/cluster/metadata/Template.java
@@ -34,6 +34,7 @@
import org.opensearch.cluster.AbstractDiffable;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.compress.CompressedXContent;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.xcontent.XContentHelper;
@@ -58,8 +59,9 @@
* it is entirely independent from an index. It's a building block forming part of a regular index
* template and a {@link ComponentTemplate}.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class Template extends AbstractDiffable implements ToXContentObject {
private static final ParseField SETTINGS = new ParseField("settings");
private static final ParseField MAPPINGS = new ParseField("mappings");
diff --git a/server/src/main/java/org/opensearch/cluster/metadata/WeightedRoutingMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/WeightedRoutingMetadata.java
index cc56a0daf6db7..bc24dd22f5c6e 100644
--- a/server/src/main/java/org/opensearch/cluster/metadata/WeightedRoutingMetadata.java
+++ b/server/src/main/java/org/opensearch/cluster/metadata/WeightedRoutingMetadata.java
@@ -8,13 +8,12 @@
package org.opensearch.cluster.metadata;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.opensearch.OpenSearchParseException;
import org.opensearch.Version;
import org.opensearch.cluster.AbstractNamedDiffable;
import org.opensearch.cluster.NamedDiff;
import org.opensearch.cluster.routing.WeightedRouting;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.Strings;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -31,10 +30,10 @@
/**
* Contains metadata for weighted routing
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class WeightedRoutingMetadata extends AbstractNamedDiffable implements Metadata.Custom {
- private static final Logger logger = LogManager.getLogger(WeightedRoutingMetadata.class);
public static final String TYPE = "weighted_shard_routing";
public static final String AWARENESS = "awareness";
public static final String VERSION = "_version";
diff --git a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNode.java b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNode.java
index 0c58aabf95207..5226e9570ac14 100644
--- a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNode.java
+++ b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNode.java
@@ -44,7 +44,6 @@
import org.opensearch.core.xcontent.ToXContentFragment;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.node.Node;
-import org.opensearch.node.remotestore.RemoteStoreNodeService;
import java.io.IOException;
import java.util.Collections;
@@ -283,27 +282,6 @@ public static DiscoveryNode createLocal(Settings settings, TransportAddress publ
return new DiscoveryNode(Node.NODE_NAME_SETTING.get(settings), nodeId, publishAddress, attributes, roles, Version.CURRENT);
}
- /** Creates a DiscoveryNode representing the local node and verifies the repository. */
- public static DiscoveryNode createRemoteNodeLocal(
- Settings settings,
- TransportAddress publishAddress,
- String nodeId,
- RemoteStoreNodeService remoteStoreNodeService
- ) {
- Map attributes = Node.NODE_ATTRIBUTES.getAsMap(settings);
- Set roles = getRolesFromSettings(settings);
- DiscoveryNode discoveryNode = new DiscoveryNode(
- Node.NODE_NAME_SETTING.get(settings),
- nodeId,
- publishAddress,
- attributes,
- roles,
- Version.CURRENT
- );
- remoteStoreNodeService.createAndVerifyRepositories(discoveryNode);
- return discoveryNode;
- }
-
/** extract node roles from the given settings */
public static Set getRolesFromSettings(final Settings settings) {
if (NODE_ROLES_SETTING.exists(settings)) {
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 54f30690f18e1..b27e1aa49a803 100644
--- a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodeFilters.java
+++ b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodeFilters.java
@@ -33,6 +33,7 @@
package org.opensearch.cluster.node;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.network.InetAddresses;
import org.opensearch.common.network.NetworkAddress;
import org.opensearch.common.regex.Regex;
@@ -48,15 +49,17 @@
/**
* Filters Discovery nodes
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class DiscoveryNodeFilters {
/**
* Operation type.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public enum OpType {
AND,
OR
diff --git a/server/src/main/java/org/opensearch/cluster/routing/AllocationId.java b/server/src/main/java/org/opensearch/cluster/routing/AllocationId.java
index 6e6ea3919c813..ade3afa4a500c 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/AllocationId.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/AllocationId.java
@@ -34,6 +34,7 @@
import org.opensearch.common.Nullable;
import org.opensearch.common.UUIDs;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.ParseField;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -55,8 +56,9 @@
* relocationId. Once relocation is done, the new allocation id is set to the relocationId. This is similar
* behavior to how ShardRouting#currentNodeId is used.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class AllocationId implements ToXContentObject, Writeable {
private static final String ID_KEY = "id";
private static final String RELOCATION_ID_KEY = "relocation_id";
diff --git a/server/src/main/java/org/opensearch/cluster/routing/GroupShardsIterator.java b/server/src/main/java/org/opensearch/cluster/routing/GroupShardsIterator.java
index 8e9371e6a714c..dcb60e79358e3 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/GroupShardsIterator.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/GroupShardsIterator.java
@@ -33,6 +33,7 @@
package org.opensearch.cluster.routing;
import org.apache.lucene.util.CollectionUtil;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.Countable;
import java.util.Iterator;
@@ -44,8 +45,9 @@
* ShardsIterators are always returned in ascending order independently of their order at construction
* time. The incoming iterators are sorted to ensure consistent iteration behavior across Nodes / JVMs.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class GroupShardsIterator & Countable> implements Iterable {
private final List iterators;
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 d77d44580798a..faadc3f7583fb 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/IndexRoutingTable.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/IndexRoutingTable.java
@@ -44,6 +44,7 @@
import org.opensearch.cluster.routing.RecoverySource.RemoteStoreRecoverySource;
import org.opensearch.cluster.routing.RecoverySource.SnapshotRecoverySource;
import org.opensearch.common.Randomness;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.index.Index;
@@ -75,8 +76,9 @@
* represented as {@link ShardRouting}.
*
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndexRoutingTable extends AbstractDiffable implements Iterable {
private final Index index;
@@ -367,8 +369,9 @@ public static Builder builder(Index index) {
/**
* Builder of a routing table.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
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 2dd57431d0375..36149d014ea84 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/IndexShardRoutingTable.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/IndexShardRoutingTable.java
@@ -39,6 +39,7 @@
import org.opensearch.cluster.node.DiscoveryNodes;
import org.opensearch.common.Nullable;
import org.opensearch.common.Randomness;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.collect.MapBuilder;
import org.opensearch.common.util.set.Sets;
import org.opensearch.core.common.io.stream.StreamInput;
@@ -73,8 +74,9 @@
* referred to as replicas of a shard. Given that, this class encapsulates all
* replicas (instances) for a single index shard.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndexShardRoutingTable implements Iterable {
final ShardShuffler shuffler;
@@ -921,8 +923,9 @@ public int shardsMatchingPredicateCount(Predicate predicate) {
/**
* Key for WeightedRouting Shard Iterator
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "2.4.0")
public static class WeightedRoutingKey {
private final WeightedRouting weightedRouting;
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 3dcf4ae3c9b99..8d407c6aff5b6 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java
@@ -250,8 +250,9 @@ public String toString() {
/**
* recovery from a snapshot
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class SnapshotRecoverySource extends RecoverySource {
public static final String NO_API_RESTORE_UUID = "_no_api_";
@@ -415,8 +416,9 @@ public int hashCode() {
/**
* Recovery from remote store
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class RemoteStoreRecoverySource extends RecoverySource {
private final String restoreUUID;
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 1ec572f7f8cc4..614cccb069048 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/RoutingChangesObserver.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/RoutingChangesObserver.java
@@ -32,11 +32,14 @@
package org.opensearch.cluster.routing;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* Records changes made to {@link RoutingNodes} during an allocation round.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface RoutingChangesObserver {
/**
* Called when unassigned shard is initialized. Does not include initializing relocation target shards.
diff --git a/server/src/main/java/org/opensearch/cluster/routing/RoutingNode.java b/server/src/main/java/org/opensearch/cluster/routing/RoutingNode.java
index e10734eb17e0d..15ec41d5c3fbb 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/RoutingNode.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/RoutingNode.java
@@ -34,6 +34,7 @@
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.collect.Tuple;
import org.opensearch.core.index.Index;
import org.opensearch.core.index.shard.ShardId;
@@ -56,8 +57,9 @@
* A {@link RoutingNode} represents a cluster node associated with a single {@link DiscoveryNode} including all shards
* that are hosted on that nodes. Each {@link RoutingNode} has a unique node id that can be used to identify the node.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class RoutingNode implements Iterable {
static class BucketedShards implements Iterable {
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 5a4352653cc89..a406552f854da 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/RoutingNodes.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/RoutingNodes.java
@@ -42,6 +42,7 @@
import org.opensearch.cluster.routing.allocation.ExistingShardsAllocator;
import org.opensearch.common.Nullable;
import org.opensearch.common.Randomness;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.collect.Tuple;
import org.opensearch.core.Assertions;
import org.opensearch.core.index.Index;
@@ -79,8 +80,9 @@
* {@link #failShard} fails/cancels an assigned shard.
*
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class RoutingNodes implements Iterable {
private final Metadata metadata;
@@ -943,8 +945,9 @@ public int size() {
/**
* Unassigned shard list.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static final class UnassignedShards implements Iterable {
private final RoutingNodes nodes;
@@ -1044,8 +1047,9 @@ public void ignoreShard(ShardRouting shard, AllocationStatus allocationStatus, R
/**
* An unassigned iterator.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public class UnassignedIterator implements Iterator, ExistingShardsAllocator.UnassignedAllocationHandler {
private final ListIterator iterator;
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 2b56163f852e8..7f2382f8b4910 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/RoutingTable.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/RoutingTable.java
@@ -40,6 +40,7 @@
import org.opensearch.cluster.routing.RecoverySource.RemoteStoreRecoverySource;
import org.opensearch.cluster.routing.RecoverySource.SnapshotRecoverySource;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.iterable.Iterables;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -66,8 +67,9 @@
*
* @see IndexRoutingTable
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class RoutingTable implements Iterable, Diffable {
public static final RoutingTable EMPTY_ROUTING_TABLE = builder().build();
@@ -433,8 +435,9 @@ public static Builder builder(RoutingTable routingTable) {
/**
* Builder for the routing table. Note that build can only be called one time.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Builder {
private long version;
diff --git a/server/src/main/java/org/opensearch/cluster/routing/ShardIterator.java b/server/src/main/java/org/opensearch/cluster/routing/ShardIterator.java
index 623846b6e1dda..95055d2ffe2ad 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/ShardIterator.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/ShardIterator.java
@@ -32,13 +32,15 @@
package org.opensearch.cluster.routing;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.index.shard.ShardId;
/**
* Allows to iterate over a set of shard instances (routing) within a shard id group.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface ShardIterator extends ShardsIterator, Comparable {
/**
diff --git a/server/src/main/java/org/opensearch/cluster/routing/ShardMovementStrategy.java b/server/src/main/java/org/opensearch/cluster/routing/ShardMovementStrategy.java
index 7f5109416494e..d1ed94087e20d 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/ShardMovementStrategy.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/ShardMovementStrategy.java
@@ -9,6 +9,7 @@
package org.opensearch.cluster.routing;
import org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator;
+import org.opensearch.common.annotation.PublicApi;
import java.util.Locale;
@@ -18,8 +19,9 @@
* ShardMovementStrategy values or rather their string representation to be used with
* {@link BalancedShardsAllocator#SHARD_MOVEMENT_STRATEGY_SETTING} via cluster settings.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "2.9.0")
public enum ShardMovementStrategy {
/**
* default behavior in which order of shard movement doesn't matter.
diff --git a/server/src/main/java/org/opensearch/cluster/routing/ShardRouting.java b/server/src/main/java/org/opensearch/cluster/routing/ShardRouting.java
index 666046d97f8d0..45de045a8fc69 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/ShardRouting.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/ShardRouting.java
@@ -36,6 +36,7 @@
import org.opensearch.cluster.routing.RecoverySource.PeerRecoverySource;
import org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
@@ -52,8 +53,9 @@
* {@link ShardRouting} immutably encapsulates information about shard
* indexRoutings like id, state, version, etc.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class ShardRouting implements Writeable, ToXContentObject {
/**
diff --git a/server/src/main/java/org/opensearch/cluster/routing/ShardsIterator.java b/server/src/main/java/org/opensearch/cluster/routing/ShardsIterator.java
index e715be1676c6f..fc3fefbc3836c 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/ShardsIterator.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/ShardsIterator.java
@@ -31,6 +31,7 @@
package org.opensearch.cluster.routing;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.Countable;
import java.util.List;
@@ -38,8 +39,9 @@
/**
* Allows to iterate over unrelated shards.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface ShardsIterator extends Iterable, Countable {
/**
diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocateUnassignedDecision.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocateUnassignedDecision.java
index 2afdd930cda1f..4e77ab772f390 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocateUnassignedDecision.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocateUnassignedDecision.java
@@ -37,6 +37,7 @@
import org.opensearch.cluster.routing.allocation.decider.Decision;
import org.opensearch.cluster.routing.allocation.decider.Decision.Type;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.unit.TimeValue;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -52,8 +53,9 @@
/**
* Represents the allocation decision by an allocator for an unassigned shard.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class AllocateUnassignedDecision extends AbstractAllocationDecision {
/** a constant representing a shard decision where no decision was taken */
public static final AllocateUnassignedDecision NOT_TAKEN = new AllocateUnassignedDecision(
diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocationDecision.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocationDecision.java
index 3f1c025fce405..6aeb904fed66f 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocationDecision.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocationDecision.java
@@ -34,6 +34,7 @@
import org.opensearch.cluster.routing.UnassignedInfo.AllocationStatus;
import org.opensearch.cluster.routing.allocation.decider.Decision;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
@@ -45,8 +46,9 @@
* An enum which represents the various decision types that can be taken by the
* allocators and deciders for allocating a shard to a node.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public enum AllocationDecision implements Writeable {
/**
* The shard can be allocated to a node.
diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/MoveDecision.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/MoveDecision.java
index fc39f813ca181..13578d1a11472 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/allocation/MoveDecision.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/MoveDecision.java
@@ -36,6 +36,7 @@
import org.opensearch.cluster.routing.allocation.decider.Decision;
import org.opensearch.cluster.routing.allocation.decider.Decision.Type;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.xcontent.XContentBuilder;
@@ -48,8 +49,9 @@
* Represents a decision to move a started shard, either because it is no longer allowed to remain on its current node
* or because moving it to another node will form a better cluster balance.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class MoveDecision extends AbstractAllocationDecision {
/** a constant representing no decision taken */
public static final MoveDecision NOT_TAKEN = new MoveDecision(null, null, AllocationDecision.NO_ATTEMPT, null, null, 0);
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 ad568fc5ffa57..4163a5fd4c16f 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
@@ -36,6 +36,7 @@
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.cluster.routing.allocation.decider.Decision;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
@@ -52,8 +53,9 @@
/**
* This class represents the shard allocation decision and its explanation for a single node.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class NodeAllocationResult implements ToXContentObject, Writeable, Comparable {
private static final Comparator nodeResultComparator = Comparator.comparing(NodeAllocationResult::getNodeDecision)
@@ -191,8 +193,9 @@ public int compareTo(NodeAllocationResult other) {
/**
* A class that captures metadata about a shard store on a node.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
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 9e8e399384467..bf2db57128517 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
@@ -43,6 +43,7 @@
import org.opensearch.cluster.routing.ShardRouting;
import org.opensearch.cluster.routing.allocation.decider.AllocationDeciders;
import org.opensearch.cluster.routing.allocation.decider.Decision;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.index.shard.ShardId;
import org.opensearch.snapshots.RestoreService.RestoreInProgressUpdater;
import org.opensearch.snapshots.SnapshotShardSizeInfo;
@@ -60,8 +61,9 @@
* of shards and holds the {@link AllocationDeciders} which are responsible
* for the current routing state.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class RoutingAllocation {
private final AllocationDeciders deciders;
@@ -317,8 +319,9 @@ public void setHasPendingAsyncFetch() {
/**
* Debug mode.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public enum DebugMode {
/**
* debug mode is off
diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/ShardAllocationDecision.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/ShardAllocationDecision.java
index e1a7fb43827f3..49e8d82c6eb97 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/allocation/ShardAllocationDecision.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/ShardAllocationDecision.java
@@ -32,6 +32,7 @@
package org.opensearch.cluster.routing.allocation;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
@@ -53,8 +54,9 @@
* then both {@link #getAllocateDecision()} and {@link #getMoveDecision()} will return
* objects whose {@code isDecisionTaken()} method returns {@code false}.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class ShardAllocationDecision implements ToXContentFragment, Writeable {
public static final ShardAllocationDecision NOT_TAKEN = new ShardAllocationDecision(
AllocateUnassignedDecision.NOT_TAKEN,
diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommand.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommand.java
index def0411853643..bce3191240323 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommand.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommand.java
@@ -35,6 +35,7 @@
import org.opensearch.OpenSearchException;
import org.opensearch.cluster.routing.allocation.RerouteExplanation;
import org.opensearch.cluster.routing.allocation.RoutingAllocation;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.network.NetworkModule;
import org.opensearch.core.common.io.stream.NamedWriteable;
import org.opensearch.core.xcontent.ToXContentObject;
@@ -46,8 +47,9 @@
*
* Commands are registered in {@link NetworkModule}.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface AllocationCommand extends NamedWriteable, ToXContentObject {
/**
diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommands.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommands.java
index ac804819443a5..2ee4124e9d909 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommands.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommands.java
@@ -36,6 +36,7 @@
import org.opensearch.OpenSearchParseException;
import org.opensearch.cluster.routing.allocation.RoutingAllocation;
import org.opensearch.cluster.routing.allocation.RoutingExplanations;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.Strings;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -54,8 +55,9 @@
* A simple {@link AllocationCommand} composite managing several
* {@link AllocationCommand} implementations
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class AllocationCommands implements ToXContentFragment {
private final List commands = new ArrayList<>();
diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDecider.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDecider.java
index 85f193c8c5580..19faacc3a3ae1 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDecider.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDecider.java
@@ -38,14 +38,16 @@
import org.opensearch.cluster.routing.ShardRouting;
import org.opensearch.cluster.routing.allocation.RoutingAllocation;
import org.opensearch.cluster.routing.allocation.decider.Decision.Type;
+import org.opensearch.common.annotation.PublicApi;
/**
* {@link AllocationDecider} is an abstract base class that allows to make
* dynamic cluster- or index-wide shard allocation decisions on a per-node
* basis.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class AllocationDecider {
/**
* Returns a {@link Decision} whether the given shard routing can be
diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDeciders.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDeciders.java
index dca82f75d6fb5..22c3156fb3537 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDeciders.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDeciders.java
@@ -39,6 +39,7 @@
import org.opensearch.cluster.routing.RoutingNode;
import org.opensearch.cluster.routing.ShardRouting;
import org.opensearch.cluster.routing.allocation.RoutingAllocation;
+import org.opensearch.common.annotation.PublicApi;
import java.util.Collection;
import java.util.Collections;
@@ -47,8 +48,9 @@
* A composite {@link AllocationDecider} combining the "decision" of multiple
* {@link AllocationDecider} implementations into a single allocation decision.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class AllocationDeciders extends AllocationDecider {
private static final Logger logger = LogManager.getLogger(AllocationDeciders.class);
diff --git a/server/src/main/java/org/opensearch/common/Rounding.java b/server/src/main/java/org/opensearch/common/Rounding.java
index 667eb4529fe38..861cdf78cc056 100644
--- a/server/src/main/java/org/opensearch/common/Rounding.java
+++ b/server/src/main/java/org/opensearch/common/Rounding.java
@@ -38,6 +38,7 @@
import org.opensearch.common.LocalTimeOffset.Gap;
import org.opensearch.common.LocalTimeOffset.Overlap;
import org.opensearch.common.annotation.InternalApi;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.time.DateUtils;
import org.opensearch.common.unit.TimeValue;
import org.opensearch.core.common.io.stream.StreamInput;
@@ -76,16 +77,18 @@
* 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
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class Rounding implements Writeable {
private static final Logger logger = LogManager.getLogger(Rounding.class);
/**
* A Date Time Unit
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
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);
@@ -268,8 +271,9 @@ public void writeTo(StreamOutput out) throws IOException {
/**
* A strategy for rounding milliseconds since epoch.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface Prepared {
/**
* Rounds the given value.
@@ -359,8 +363,9 @@ public static Builder builder(TimeValue interval) {
/**
* Builder for rounding
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Builder {
private final DateTimeUnit unit;
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 0b2b608b55df0..30e7c014a2ec0 100644
--- a/server/src/main/java/org/opensearch/common/cache/Cache.java
+++ b/server/src/main/java/org/opensearch/common/cache/Cache.java
@@ -32,6 +32,7 @@
package org.opensearch.common.cache;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.collect.Tuple;
import org.opensearch.common.util.concurrent.ReleasableLock;
@@ -80,8 +81,9 @@
* @param The type of the keys
* @param The type of the values
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class Cache {
// positive if entries have an expiration
@@ -732,8 +734,9 @@ public CacheStats stats() {
/**
* Cache statistics
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class CacheStats {
private long hits;
private long misses;
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 3c80fe5d66d5d..9fd43a03e7f9d 100644
--- a/server/src/main/java/org/opensearch/common/cache/CacheLoader.java
+++ b/server/src/main/java/org/opensearch/common/cache/CacheLoader.java
@@ -32,12 +32,15 @@
package org.opensearch.common.cache;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* An interface for a cache loader.
*
- * @opensearch.internal
+ * @opensearch.api
*/
@FunctionalInterface
+@PublicApi(since = "1.0.0")
public interface CacheLoader {
V load(K key) throws Exception;
}
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 6d355b2122460..42303b8cfdc73 100644
--- a/server/src/main/java/org/opensearch/common/cache/RemovalNotification.java
+++ b/server/src/main/java/org/opensearch/common/cache/RemovalNotification.java
@@ -32,11 +32,14 @@
package org.opensearch.common.cache;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* Notification when an element is removed from the cache
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class RemovalNotification {
private final K key;
diff --git a/server/src/main/java/org/opensearch/common/cache/RemovalReason.java b/server/src/main/java/org/opensearch/common/cache/RemovalReason.java
index e5d795c093547..514b84a7823ca 100644
--- a/server/src/main/java/org/opensearch/common/cache/RemovalReason.java
+++ b/server/src/main/java/org/opensearch/common/cache/RemovalReason.java
@@ -8,11 +8,14 @@
package org.opensearch.common.cache;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* Reason for notification removal
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public enum RemovalReason {
REPLACED,
INVALIDATED,
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 550bc5b3fd524..23fc6353dbad3 100644
--- a/server/src/main/java/org/opensearch/common/compress/CompressedXContent.java
+++ b/server/src/main/java/org/opensearch/common/compress/CompressedXContent.java
@@ -32,6 +32,7 @@
package org.opensearch.common.compress;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.io.Streams;
import org.opensearch.common.io.stream.BytesStreamOutput;
import org.opensearch.common.xcontent.XContentFactory;
@@ -57,8 +58,9 @@
* 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
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class CompressedXContent {
private static int crc32(BytesReference data) {
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 7088d6cb7a498..8c123d7d2ebc9 100644
--- a/server/src/main/java/org/opensearch/common/time/DateMathParser.java
+++ b/server/src/main/java/org/opensearch/common/time/DateMathParser.java
@@ -32,6 +32,7 @@
package org.opensearch.common.time;
+import org.opensearch.common.annotation.PublicApi;
import org.joda.time.DateTimeZone;
import java.time.Instant;
@@ -41,8 +42,9 @@
/**
* An abstraction over date math parsing to allow different implementation for joda and java time.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface DateMathParser {
/**
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 59c84ea45a65a..cbe8ab76797ce 100644
--- a/server/src/main/java/org/opensearch/common/util/BigArrays.java
+++ b/server/src/main/java/org/opensearch/common/util/BigArrays.java
@@ -36,6 +36,7 @@
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.RamUsageEstimator;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lease.Releasable;
import org.opensearch.common.lease.Releasables;
import org.opensearch.common.recycler.Recycler;
@@ -48,6 +49,7 @@
import java.util.Arrays;
/** Utility class to work with arrays. */
+@PublicApi(since = "1.0.0")
public class BigArrays {
public static final BigArrays NON_RECYCLING_INSTANCE = new BigArrays(null, null, CircuitBreaker.REQUEST);
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 1adf6d2fb015c..925d1b6066a99 100644
--- a/server/src/main/java/org/opensearch/common/util/Countable.java
+++ b/server/src/main/java/org/opensearch/common/util/Countable.java
@@ -32,11 +32,14 @@
package org.opensearch.common.util;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* Base countable interface.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface Countable {
int size();
}
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 ae66902f6f795..aa9238634f2c7 100644
--- a/server/src/main/java/org/opensearch/common/util/DoubleArray.java
+++ b/server/src/main/java/org/opensearch/common/util/DoubleArray.java
@@ -32,13 +32,15 @@
package org.opensearch.common.util;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.util.BigArray;
/**
* Abstraction of an array of double values.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface DoubleArray extends BigArray {
/**
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 81f6bebb7508c..bda7324d19273 100644
--- a/server/src/main/java/org/opensearch/common/util/FloatArray.java
+++ b/server/src/main/java/org/opensearch/common/util/FloatArray.java
@@ -32,13 +32,15 @@
package org.opensearch.common.util;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.util.BigArray;
/**
* Abstraction of an array of double values.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
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 eb43e013f3758..ad0173904f74a 100644
--- a/server/src/main/java/org/opensearch/common/util/IntArray.java
+++ b/server/src/main/java/org/opensearch/common/util/IntArray.java
@@ -32,13 +32,15 @@
package org.opensearch.common.util;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.util.BigArray;
/**
* Abstraction of an array of integer values.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface IntArray extends BigArray {
/**
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 0c32effd04cdc..c2f649e49f470 100644
--- a/server/src/main/java/org/opensearch/common/util/LongArray.java
+++ b/server/src/main/java/org/opensearch/common/util/LongArray.java
@@ -32,13 +32,15 @@
package org.opensearch.common.util;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.util.BigArray;
/**
* Abstraction of an array of long values.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface LongArray extends BigArray {
/**
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 9c882742b56ab..f3f73b7e37485 100644
--- a/server/src/main/java/org/opensearch/common/util/ObjectArray.java
+++ b/server/src/main/java/org/opensearch/common/util/ObjectArray.java
@@ -32,13 +32,15 @@
package org.opensearch.common.util;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.util.BigArray;
/**
* Abstraction of an array of object values.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface ObjectArray extends BigArray {
/**
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 fc2e4217bae79..3da21a6777456 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
@@ -35,6 +35,7 @@
import org.apache.logging.log4j.Logger;
import org.opensearch.action.support.ContextPreservingActionListener;
import org.opensearch.client.OriginSettingClient;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.collect.MapBuilder;
import org.opensearch.common.collect.Tuple;
import org.opensearch.common.settings.Setting;
@@ -97,8 +98,9 @@
* // previous context is restored on StoredContext#close()
*
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class ThreadContext implements Writeable {
public static final String PREFIX = "request.headers";
@@ -545,9 +547,10 @@ public boolean isSystemContext() {
/**
* A stored context
*
- * @opensearch.internal
+ * @opensearch.api
*/
@FunctionalInterface
+ @PublicApi(since = "1.0.0")
public interface StoredContext extends AutoCloseable {
@Override
void close();
diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContextStatePropagator.java b/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContextStatePropagator.java
index b3fc79c5446db..dac70b0e8124e 100644
--- a/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContextStatePropagator.java
+++ b/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContextStatePropagator.java
@@ -8,12 +8,17 @@
package org.opensearch.common.util.concurrent;
+import org.opensearch.common.annotation.PublicApi;
+
import java.util.Map;
/**
* The propagator for {@link ThreadContext} that helps to carry-over the state from one
* thread to another (tasks, tracing context, etc).
+ *
+ * @opensearch.api
*/
+@PublicApi(since = "2.8.0")
public interface ThreadContextStatePropagator {
/**
* Returns the list of transient headers that needs to be propagated from current context to new thread context.
diff --git a/server/src/main/java/org/opensearch/env/NodeEnvironment.java b/server/src/main/java/org/opensearch/env/NodeEnvironment.java
index 40c5722308b79..c7ba5eb040a1f 100644
--- a/server/src/main/java/org/opensearch/env/NodeEnvironment.java
+++ b/server/src/main/java/org/opensearch/env/NodeEnvironment.java
@@ -770,8 +770,11 @@ public void setDetails(String details) {
/**
* A functional interface that people can use to reference {@link #shardLock(ShardId, String, long)}
+ *
+ * @opensearch.api
*/
@FunctionalInterface
+ @PublicApi(since = "1.0.0")
public interface ShardLocker {
ShardLock lock(ShardId shardId, String lockDetails, long lockTimeoutMS) throws ShardLockObtainFailedException;
}
diff --git a/server/src/main/java/org/opensearch/index/IndexService.java b/server/src/main/java/org/opensearch/index/IndexService.java
index 84e8e2f41aaf1..46e4dbb61be74 100644
--- a/server/src/main/java/org/opensearch/index/IndexService.java
+++ b/server/src/main/java/org/opensearch/index/IndexService.java
@@ -48,6 +48,7 @@
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.CheckedFunction;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Setting.Property;
import org.opensearch.common.settings.Settings;
@@ -304,8 +305,9 @@ static boolean needsMapperService(IndexSettings indexSettings, IndexCreationCont
/**
* Context for index creation
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public enum IndexCreationContext {
CREATE_INDEX,
METADATA_VERIFICATION
@@ -979,8 +981,9 @@ private void rescheduleRefreshTasks() {
/**
* Shard Store Deleter Interface
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface ShardStoreDeleter {
void deleteShardStore(String reason, ShardLock lock, IndexSettings indexSettings) throws IOException;
diff --git a/server/src/main/java/org/opensearch/index/cache/query/QueryCache.java b/server/src/main/java/org/opensearch/index/cache/query/QueryCache.java
index 384f66fcfc132..2c8188a523ade 100644
--- a/server/src/main/java/org/opensearch/index/cache/query/QueryCache.java
+++ b/server/src/main/java/org/opensearch/index/cache/query/QueryCache.java
@@ -32,6 +32,7 @@
package org.opensearch.index.cache.query;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.index.IndexComponent;
import java.io.Closeable;
@@ -39,8 +40,9 @@
/**
* Base interface for a query cache
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface QueryCache extends IndexComponent, Closeable, org.apache.lucene.search.QueryCache {
void clear(String reason);
diff --git a/server/src/main/java/org/opensearch/index/fielddata/DocValueBits.java b/server/src/main/java/org/opensearch/index/fielddata/DocValueBits.java
index 18fa26bd10623..cf62688b88b65 100644
--- a/server/src/main/java/org/opensearch/index/fielddata/DocValueBits.java
+++ b/server/src/main/java/org/opensearch/index/fielddata/DocValueBits.java
@@ -32,13 +32,16 @@
package org.opensearch.index.fielddata;
+import org.opensearch.common.annotation.PublicApi;
+
import java.io.IOException;
/**
* Base class for doc value bit sets
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class DocValueBits {
/**
diff --git a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java
index 81d4ce2dd8772..6a79679cc2f09 100644
--- a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java
+++ b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java
@@ -48,6 +48,7 @@
import org.apache.lucene.util.BitSet;
import org.apache.lucene.util.BytesRef;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.BigArrays;
import org.opensearch.core.indices.breaker.CircuitBreakerService;
import org.opensearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested;
@@ -64,8 +65,9 @@
* Thread-safe utility class that allows to get per-segment values via the
* {@link #load(LeafReaderContext)} method.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface IndexFieldData {
/**
@@ -154,7 +156,10 @@ public void disableSkipping() {
* R will be in the parent filter and its children documents will be the
* documents that are contained in the inner set between the previous
* parent + 1, or 0 if there is no previous parent, and R (excluded).
+ *
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Nested {
private final BitSetProducer rootFilter;
@@ -293,8 +298,9 @@ public abstract BucketedSort newBucketedSort(
/**
* Base builder interface
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
interface Builder {
IndexFieldData> build(IndexFieldDataCache cache, CircuitBreakerService breakerService);
@@ -303,8 +309,9 @@ interface Builder {
/**
* Base Global field data class
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
interface Global extends IndexFieldData {
IndexFieldData loadGlobal(DirectoryReader indexReader);
diff --git a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java
index 72df2453fc7fd..5cdcc3f82879f 100644
--- a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java
+++ b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java
@@ -35,13 +35,15 @@
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.util.Accountable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.index.shard.ShardId;
/**
* A simple field data cache abstraction on the *index* level.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface IndexFieldDataCache {
> FD load(LeafReaderContext context, IFD indexFieldData) throws Exception;
@@ -62,8 +64,9 @@ > IFD load(Direc
/**
* The listener interface
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
interface Listener {
/**
diff --git a/server/src/main/java/org/opensearch/index/fielddata/LeafFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/LeafFieldData.java
index 2982363937710..da7179254d70f 100644
--- a/server/src/main/java/org/opensearch/index/fielddata/LeafFieldData.java
+++ b/server/src/main/java/org/opensearch/index/fielddata/LeafFieldData.java
@@ -33,6 +33,7 @@
package org.opensearch.index.fielddata;
import org.apache.lucene.util.Accountable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lease.Releasable;
import org.opensearch.index.mapper.DocValueFetcher;
import org.opensearch.search.DocValueFormat;
@@ -42,8 +43,9 @@
/**
* The thread safe {@link org.apache.lucene.index.LeafReader} level cache of the data.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface LeafFieldData extends Accountable, Releasable {
/**
diff --git a/server/src/main/java/org/opensearch/index/fielddata/NumericDoubleValues.java b/server/src/main/java/org/opensearch/index/fielddata/NumericDoubleValues.java
index 94ea91849ff12..b0f3400acfb3d 100644
--- a/server/src/main/java/org/opensearch/index/fielddata/NumericDoubleValues.java
+++ b/server/src/main/java/org/opensearch/index/fielddata/NumericDoubleValues.java
@@ -34,14 +34,16 @@
import org.apache.lucene.index.NumericDocValues;
import org.apache.lucene.search.DoubleValues;
+import org.opensearch.common.annotation.PublicApi;
import java.io.IOException;
/**
* A per-document numeric value.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class NumericDoubleValues extends DoubleValues {
/** Sole constructor. (For invocation by subclass
diff --git a/server/src/main/java/org/opensearch/index/fielddata/SortedNumericDoubleValues.java b/server/src/main/java/org/opensearch/index/fielddata/SortedNumericDoubleValues.java
index 91d28113ae783..dce1aff9cc94f 100644
--- a/server/src/main/java/org/opensearch/index/fielddata/SortedNumericDoubleValues.java
+++ b/server/src/main/java/org/opensearch/index/fielddata/SortedNumericDoubleValues.java
@@ -33,14 +33,16 @@
package org.opensearch.index.fielddata;
import org.apache.lucene.index.SortedNumericDocValues;
+import org.opensearch.common.annotation.PublicApi;
import java.io.IOException;
/**
* Clone of {@link SortedNumericDocValues} for double values.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class SortedNumericDoubleValues {
/** Sole constructor. (For invocation by subclass
diff --git a/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java b/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java
index bf14af809fbfd..827792cdb1091 100644
--- a/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java
+++ b/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java
@@ -33,6 +33,7 @@
package org.opensearch.index.mapper;
import org.apache.lucene.index.LeafReaderContext;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.index.fielddata.IndexFieldData;
import org.opensearch.search.DocValueFormat;
import org.opensearch.search.lookup.SourceLookup;
@@ -77,8 +78,9 @@ public List
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface IndexEventListener {
/**
diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardState.java b/server/src/main/java/org/opensearch/index/shard/IndexShardState.java
index dc6f2fc3a86d9..deadf1db8314f 100644
--- a/server/src/main/java/org/opensearch/index/shard/IndexShardState.java
+++ b/server/src/main/java/org/opensearch/index/shard/IndexShardState.java
@@ -32,11 +32,14 @@
package org.opensearch.index.shard;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* Index Shard States
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public enum IndexShardState {
CREATED((byte) 0),
RECOVERING((byte) 1),
diff --git a/server/src/main/java/org/opensearch/index/shard/ShardPath.java b/server/src/main/java/org/opensearch/index/shard/ShardPath.java
index b7bb4283eca32..d16e5707b2e0e 100644
--- a/server/src/main/java/org/opensearch/index/shard/ShardPath.java
+++ b/server/src/main/java/org/opensearch/index/shard/ShardPath.java
@@ -34,6 +34,7 @@
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.util.Strings;
import org.opensearch.cluster.metadata.IndexMetadata;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.io.IOUtils;
import org.opensearch.core.index.shard.ShardId;
import org.opensearch.core.xcontent.NamedXContentRegistry;
@@ -54,8 +55,9 @@
/**
* Path for a shard
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class ShardPath {
public static final String INDEX_FOLDER_NAME = "index";
public static final String TRANSLOG_FOLDER_NAME = "translog";
diff --git a/server/src/main/java/org/opensearch/index/similarity/SimilarityProvider.java b/server/src/main/java/org/opensearch/index/similarity/SimilarityProvider.java
index 085e93c794fb7..33065dc1739a3 100644
--- a/server/src/main/java/org/opensearch/index/similarity/SimilarityProvider.java
+++ b/server/src/main/java/org/opensearch/index/similarity/SimilarityProvider.java
@@ -33,14 +33,16 @@
package org.opensearch.index.similarity;
import org.apache.lucene.search.similarities.Similarity;
+import org.opensearch.common.annotation.PublicApi;
import java.util.Objects;
/**
* Wrapper around a {@link Similarity} and its name.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class SimilarityProvider {
private final String name;
diff --git a/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotStatus.java b/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotStatus.java
index d48da6f462502..d844a7d2d25c4 100644
--- a/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotStatus.java
+++ b/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotStatus.java
@@ -32,21 +32,25 @@
package org.opensearch.index.snapshots;
+import org.opensearch.common.annotation.PublicApi;
+
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
/**
* Represent shard snapshot status
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndexShardSnapshotStatus {
/**
* Snapshot stage
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public enum Stage {
/**
* Snapshot hasn't started yet
@@ -248,8 +252,9 @@ public static IndexShardSnapshotStatus newDone(
/**
* Returns an immutable state of {@link IndexShardSnapshotStatus} at a given point in time.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Copy {
private final Stage stage;
diff --git a/server/src/main/java/org/opensearch/index/store/Store.java b/server/src/main/java/org/opensearch/index/store/Store.java
index b822742de6e97..11505e82d5ccb 100644
--- a/server/src/main/java/org/opensearch/index/store/Store.java
+++ b/server/src/main/java/org/opensearch/index/store/Store.java
@@ -67,6 +67,7 @@
import org.opensearch.ExceptionsHelper;
import org.opensearch.common.UUIDs;
import org.opensearch.common.annotation.InternalApi;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.io.stream.BytesStreamOutput;
import org.opensearch.common.logging.Loggers;
import org.opensearch.common.lucene.Lucene;
@@ -145,8 +146,9 @@
* }
*
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class Store extends AbstractIndexShardComponent implements Closeable, RefCounted {
/**
* This is an escape hatch for lucenes internal optimization that checks if the IndexInput is an instance of ByteBufferIndexInput
@@ -1022,8 +1024,9 @@ private void downloadFailed(long fileSize, long startTimeInMs) {
*
* @see StoreFileMetadata
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static final class MetadataSnapshot implements Iterable, Writeable {
private final Map metadata;
@@ -1429,8 +1432,9 @@ public String getSyncId() {
*
* @see MetadataSnapshot#recoveryDiff(org.opensearch.index.store.Store.MetadataSnapshot)
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static final class RecoveryDiff {
/**
* Files that exist in both snapshots and they can be considered the same ie. they don't need to be recovered
diff --git a/server/src/main/java/org/opensearch/index/store/StoreFileMetadata.java b/server/src/main/java/org/opensearch/index/store/StoreFileMetadata.java
index f8c4df50afc8f..c286a5bdbd9d8 100644
--- a/server/src/main/java/org/opensearch/index/store/StoreFileMetadata.java
+++ b/server/src/main/java/org/opensearch/index/store/StoreFileMetadata.java
@@ -35,6 +35,7 @@
import org.apache.lucene.codecs.CodecUtil;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.Version;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lucene.store.ByteArrayIndexInput;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -47,8 +48,9 @@
/**
* Metadata for the store file
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class StoreFileMetadata implements Writeable {
private final String name;
diff --git a/server/src/main/java/org/opensearch/index/store/remote/filecache/CachedIndexInput.java b/server/src/main/java/org/opensearch/index/store/remote/filecache/CachedIndexInput.java
index a29598dbee505..b7dacb3761c33 100644
--- a/server/src/main/java/org/opensearch/index/store/remote/filecache/CachedIndexInput.java
+++ b/server/src/main/java/org/opensearch/index/store/remote/filecache/CachedIndexInput.java
@@ -9,6 +9,7 @@
package org.opensearch.index.store.remote.filecache;
import org.apache.lucene.store.IndexInput;
+import org.opensearch.common.annotation.PublicApi;
import java.io.IOException;
@@ -17,8 +18,9 @@
* {@link IndexInput}. Exactly how the IndexInput is created is determined by
* the implementations.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "2.7.0")
public interface CachedIndexInput extends AutoCloseable {
/**
* Gets the {@link IndexInput} this cache entry represents.
diff --git a/server/src/main/java/org/opensearch/index/store/remote/filecache/FileCache.java b/server/src/main/java/org/opensearch/index/store/remote/filecache/FileCache.java
index dbbbbecbc6afd..2029b461674c7 100644
--- a/server/src/main/java/org/opensearch/index/store/remote/filecache/FileCache.java
+++ b/server/src/main/java/org/opensearch/index/store/remote/filecache/FileCache.java
@@ -9,6 +9,7 @@
package org.opensearch.index.store.remote.filecache;
import org.apache.lucene.store.IndexInput;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.settings.Setting;
import org.opensearch.core.common.breaker.CircuitBreaker;
import org.opensearch.core.common.breaker.CircuitBreakingException;
@@ -43,8 +44,9 @@
* items from cache tail and triggers a callback to clean up the file from disk. The
* cleanup process also includes closing file’s descriptor.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "2.7.0")
public class FileCache implements RefCountedCache {
private final SegmentedCache theCache;
diff --git a/server/src/main/java/org/opensearch/index/store/remote/utils/cache/CacheUsage.java b/server/src/main/java/org/opensearch/index/store/remote/utils/cache/CacheUsage.java
index 1cb9242926046..0b5480d3ca978 100644
--- a/server/src/main/java/org/opensearch/index/store/remote/utils/cache/CacheUsage.java
+++ b/server/src/main/java/org/opensearch/index/store/remote/utils/cache/CacheUsage.java
@@ -8,11 +8,14 @@
package org.opensearch.index.store.remote.utils.cache;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* Usage metrics for {@link RefCountedCache}
*
* @opensearch.internal
*/
+@PublicApi(since = "2.7.0")
public class CacheUsage {
/**
* Cache usage of the system
diff --git a/server/src/main/java/org/opensearch/index/store/remote/utils/cache/stats/CacheStats.java b/server/src/main/java/org/opensearch/index/store/remote/utils/cache/stats/CacheStats.java
index f0a7154effb1d..55893752669a8 100644
--- a/server/src/main/java/org/opensearch/index/store/remote/utils/cache/stats/CacheStats.java
+++ b/server/src/main/java/org/opensearch/index/store/remote/utils/cache/stats/CacheStats.java
@@ -8,6 +8,7 @@
package org.opensearch.index.store.remote.utils.cache.stats;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.index.store.remote.utils.cache.RefCountedCache;
import java.util.Objects;
@@ -15,8 +16,9 @@
/**
* Statistics about the performance of a {@link RefCountedCache}.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "2.7.0")
public final class CacheStats {
private final long hitCount;
private final long missCount;
diff --git a/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamOutput.java b/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamOutput.java
index eaf9ac0893f1b..9e96664c79cc5 100644
--- a/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamOutput.java
+++ b/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamOutput.java
@@ -33,6 +33,7 @@
package org.opensearch.index.translog;
import org.apache.lucene.store.BufferedChecksum;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamOutput;
import java.io.IOException;
@@ -43,8 +44,9 @@
* Similar to Lucene's BufferedChecksumIndexOutput, however this wraps a
* {@link StreamOutput} so anything written will update the checksum
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class BufferedChecksumStreamOutput extends StreamOutput {
private final StreamOutput out;
private final Checksum digest;
diff --git a/server/src/main/java/org/opensearch/index/translog/ChannelFactory.java b/server/src/main/java/org/opensearch/index/translog/ChannelFactory.java
index f86b9dea0a5f7..4fba85b9d224d 100644
--- a/server/src/main/java/org/opensearch/index/translog/ChannelFactory.java
+++ b/server/src/main/java/org/opensearch/index/translog/ChannelFactory.java
@@ -31,6 +31,8 @@
package org.opensearch.index.translog;
+import org.opensearch.common.annotation.PublicApi;
+
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.file.OpenOption;
@@ -40,9 +42,10 @@
/**
* only for testing until we have a disk-full FileSystem
*
- * @opensearch.internal
+ * @opensearch.api
*/
@FunctionalInterface
+@PublicApi(since = "1.0.0")
public interface ChannelFactory {
default FileChannel open(Path path) throws IOException {
return open(path, StandardOpenOption.WRITE, StandardOpenOption.READ, StandardOpenOption.CREATE_NEW);
diff --git a/server/src/main/java/org/opensearch/index/translog/Translog.java b/server/src/main/java/org/opensearch/index/translog/Translog.java
index 9f80bc38a8222..8b4662238ed25 100644
--- a/server/src/main/java/org/opensearch/index/translog/Translog.java
+++ b/server/src/main/java/org/opensearch/index/translog/Translog.java
@@ -111,8 +111,9 @@
* operation etc. are still preserved.
*
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class Translog extends AbstractIndexShardComponent implements IndexShardComponent, Closeable {
/*
@@ -895,8 +896,9 @@ public TranslogDeletionPolicy getDeletionPolicy() {
/**
* Location in the translot
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Location implements Comparable {
public final long generation;
@@ -954,8 +956,9 @@ public int hashCode() {
/**
* A snapshot of the transaction log, allows to iterate over all the transaction log operations.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface Snapshot extends Closeable {
/**
@@ -1040,14 +1043,16 @@ public void close() throws IOException {
* A generic interface representing an operation performed on the transaction log.
* Each is associated with a type.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface Operation {
/**
* The type of operation
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
enum Type {
@Deprecated
CREATE((byte) 1),
@@ -1138,8 +1143,9 @@ static void writeOperation(final StreamOutput output, final Operation operation)
/**
* The source in the translog
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Source {
public final BytesReference source;
@@ -1835,8 +1841,9 @@ void closeFilesIfNoPendingRetentionLocks() throws IOException {
/**
* References a transaction log generation
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static final class TranslogGeneration {
public final String translogUUID;
public final long translogFileGeneration;
diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogConfig.java b/server/src/main/java/org/opensearch/index/translog/TranslogConfig.java
index 6e75ebd847b5e..2f00773075d41 100644
--- a/server/src/main/java/org/opensearch/index/translog/TranslogConfig.java
+++ b/server/src/main/java/org/opensearch/index/translog/TranslogConfig.java
@@ -32,6 +32,7 @@
package org.opensearch.index.translog;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.BigArrays;
import org.opensearch.core.common.unit.ByteSizeUnit;
import org.opensearch.core.common.unit.ByteSizeValue;
@@ -45,8 +46,9 @@
* Once {@link Translog} has been created with this object, changes to this
* object will affect the {@link Translog} instance.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class TranslogConfig {
public static final ByteSizeValue DEFAULT_BUFFER_SIZE = new ByteSizeValue(1, ByteSizeUnit.MB);
diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java b/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java
index 99784b77c61f5..972b19a029a8b 100644
--- a/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java
+++ b/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java
@@ -33,6 +33,7 @@
package org.opensearch.index.translog;
import org.apache.lucene.util.Counter;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lease.Releasable;
import org.opensearch.core.Assertions;
import org.opensearch.index.seqno.SequenceNumbers;
@@ -47,8 +48,9 @@
/**
* Defines a translog deletion policy
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class TranslogDeletionPolicy {
private final Map