From 7de9a367d755a0812fc94952070904e73cbfd25f 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/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 +++-
.../snapshots/status/SnapshotStatus.java | 4 +++-
.../admin/indices/rollover/RolloverInfo.java | 4 +++-
.../action/search/ParsedScrollId.java | 5 ++++-
.../action/search/SearchContextIdForNode.java | 4 +++-
.../action/search/ShardSearchFailure.java | 4 +++-
.../action/support/ActiveShardCount.java | 4 +++-
.../org/opensearch/cluster/ClusterState.java | 10 ++++++---
.../org/opensearch/cluster/NamedDiff.java | 4 +++-
.../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 +++-
.../common/compress/CompressedXContent.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 +++-
.../org/opensearch/env/NodeEnvironment.java | 3 +++
.../org/opensearch/index/IndexService.java | 7 ++++--
.../index/cache/query/QueryCache.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 +++-
.../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 +++-
.../opensearch/indices/IndicesQueryCache.java | 4 +++-
.../cluster/IndicesClusterStateService.java | 4 +++-
.../main/java/org/opensearch/node/Node.java | 19 ++++++++--------
.../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 ++++--
.../org/opensearch/search/DocValueFormat.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/internal/ShardSearchContextId.java | 4 +++-
.../search/internal/ShardSearchRequest.java | 4 +++-
90 files changed, 346 insertions(+), 151 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/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/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/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/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/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/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/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/query/Rewriteable.java b/server/src/main/java/org/opensearch/index/query/Rewriteable.java
index 3ed779b52debf..bca719c6fe857 100644
--- a/server/src/main/java/org/opensearch/index/query/Rewriteable.java
+++ b/server/src/main/java/org/opensearch/index/query/Rewriteable.java
@@ -31,6 +31,7 @@
package org.opensearch.index.query;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.action.ActionListener;
import org.opensearch.core.common.ParsingException;
@@ -41,8 +42,9 @@
/**
* A basic interface for rewriteable classes.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface Rewriteable {
int MAX_REWRITE_ROUNDS = 16;
diff --git a/server/src/main/java/org/opensearch/index/seqno/SequenceNumbers.java b/server/src/main/java/org/opensearch/index/seqno/SequenceNumbers.java
index 210976ffba58a..b9959941d843f 100644
--- a/server/src/main/java/org/opensearch/index/seqno/SequenceNumbers.java
+++ b/server/src/main/java/org/opensearch/index/seqno/SequenceNumbers.java
@@ -32,6 +32,8 @@
package org.opensearch.index.seqno;
+import org.opensearch.common.annotation.PublicApi;
+
import java.util.Map;
/**
@@ -132,8 +134,9 @@ public static long max(final long maxSeqNo, final long seqNo) {
/**
* Commit information
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static final class CommitInfo {
public final long maxSeqNo;
public final long localCheckpoint;
diff --git a/server/src/main/java/org/opensearch/index/shard/IndexEventListener.java b/server/src/main/java/org/opensearch/index/shard/IndexEventListener.java
index 3017c3ce6dcff..693686ec228e9 100644
--- a/server/src/main/java/org/opensearch/index/shard/IndexEventListener.java
+++ b/server/src/main/java/org/opensearch/index/shard/IndexEventListener.java
@@ -33,6 +33,7 @@
import org.opensearch.cluster.routing.ShardRouting;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.settings.Settings;
import org.opensearch.core.index.Index;
import org.opensearch.core.index.shard.ShardId;
@@ -51,8 +52,9 @@
* modify local state without sufficient synchronization.
*
*
- * @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/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/indices/IndicesQueryCache.java b/server/src/main/java/org/opensearch/indices/IndicesQueryCache.java
index 228723045d8cc..48fe717de8ae7 100644
--- a/server/src/main/java/org/opensearch/indices/IndicesQueryCache.java
+++ b/server/src/main/java/org/opensearch/indices/IndicesQueryCache.java
@@ -44,6 +44,7 @@
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.ScorerSupplier;
import org.apache.lucene.search.Weight;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lucene.ShardCoreKeyMap;
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Setting.Property;
@@ -65,8 +66,9 @@
/**
* The query cache for indices
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndicesQueryCache implements QueryCache, Closeable {
private static final Logger logger = LogManager.getLogger(IndicesQueryCache.class);
diff --git a/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java b/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java
index dc538a03de595..7fb8b172ae352 100644
--- a/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java
+++ b/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java
@@ -51,6 +51,7 @@
import org.opensearch.cluster.routing.ShardRouting;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.inject.Inject;
import org.opensearch.common.lifecycle.AbstractLifecycleComponent;
import org.opensearch.common.settings.Settings;
@@ -1059,8 +1060,9 @@ void processPendingDeletes(Index index, IndexSettings indexSettings, TimeValue t
/**
* Why the index was removed
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
enum IndexRemovalReason {
/**
* Shard of this index were previously assigned to this node but all shards have been relocated.
diff --git a/server/src/main/java/org/opensearch/node/Node.java b/server/src/main/java/org/opensearch/node/Node.java
index e80b768074fc7..03138b933896a 100644
--- a/server/src/main/java/org/opensearch/node/Node.java
+++ b/server/src/main/java/org/opensearch/node/Node.java
@@ -1850,18 +1850,17 @@ private LocalNodeFactory(Settings settings, String persistentNodeId, RemoteStore
@Override
public DiscoveryNode apply(BoundTransportAddress boundTransportAddress) {
+ final DiscoveryNode discoveryNode = DiscoveryNode.createLocal(
+ settings,
+ boundTransportAddress.publishAddress(),
+ persistentNodeId
+ );
+
if (isRemoteStoreAttributePresent(settings)) {
- localNode.set(
- DiscoveryNode.createRemoteNodeLocal(
- settings,
- boundTransportAddress.publishAddress(),
- persistentNodeId,
- remoteStoreNodeService
- )
- );
- } else {
- localNode.set(DiscoveryNode.createLocal(settings, boundTransportAddress.publishAddress(), persistentNodeId));
+ remoteStoreNodeService.createAndVerifyRepositories(discoveryNode);
}
+
+ localNode.set(discoveryNode);
return localNode.get();
}
diff --git a/server/src/main/java/org/opensearch/plugins/IndexStorePlugin.java b/server/src/main/java/org/opensearch/plugins/IndexStorePlugin.java
index 2f549fec54759..ebd5717a00319 100644
--- a/server/src/main/java/org/opensearch/plugins/IndexStorePlugin.java
+++ b/server/src/main/java/org/opensearch/plugins/IndexStorePlugin.java
@@ -36,6 +36,7 @@
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.cluster.routing.ShardRouting;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.index.IndexSettings;
import org.opensearch.index.shard.ShardPath;
import org.opensearch.indices.recovery.RecoveryState;
@@ -49,12 +50,16 @@
*
* @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface IndexStorePlugin {
/**
* An interface that describes how to create a new directory instance per shard.
+ *
+ * @opensearch.api
*/
@FunctionalInterface
+ @PublicApi(since = "1.0.0")
interface DirectoryFactory {
/**
* Creates a new directory per shard. This method is called once per shard on shard creation.
@@ -77,8 +82,11 @@ interface DirectoryFactory {
/**
* An interface that allows to create a new {@link RecoveryState} per shard.
+ *
+ * @opensearch.api
*/
@FunctionalInterface
+ @PublicApi(since = "1.0.0")
interface RecoveryStateFactory {
/**
* Creates a new {@link RecoveryState} per shard. This method is called once per shard on shard creation.
diff --git a/server/src/main/java/org/opensearch/repositories/IndexId.java b/server/src/main/java/org/opensearch/repositories/IndexId.java
index d88eeb5aa9c49..87a0063e8c21b 100644
--- a/server/src/main/java/org/opensearch/repositories/IndexId.java
+++ b/server/src/main/java/org/opensearch/repositories/IndexId.java
@@ -32,6 +32,7 @@
package org.opensearch.repositories;
+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;
@@ -46,8 +47,9 @@
/**
* Represents a single snapshotted index in the repository.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class IndexId implements Writeable, ToXContentObject {
protected static final String NAME = "name";
protected static final String ID = "id";
diff --git a/server/src/main/java/org/opensearch/repositories/IndexMetaDataGenerations.java b/server/src/main/java/org/opensearch/repositories/IndexMetaDataGenerations.java
index 25cb0eaf43455..41f77e6830f5f 100644
--- a/server/src/main/java/org/opensearch/repositories/IndexMetaDataGenerations.java
+++ b/server/src/main/java/org/opensearch/repositories/IndexMetaDataGenerations.java
@@ -34,6 +34,7 @@
import org.opensearch.cluster.metadata.IndexMetadata;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.snapshots.SnapshotId;
import java.util.Collection;
@@ -50,8 +51,9 @@
* {@link IndexMetadata} should be computed and then used to check if it already exists in the repository via
* {@link #getIndexMetaBlobId(String)}.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class IndexMetaDataGenerations {
public static final IndexMetaDataGenerations EMPTY = new IndexMetaDataGenerations(Collections.emptyMap(), Collections.emptyMap());
diff --git a/server/src/main/java/org/opensearch/repositories/Repository.java b/server/src/main/java/org/opensearch/repositories/Repository.java
index 74cda9bcc3393..b3f1e9ce2eed9 100644
--- a/server/src/main/java/org/opensearch/repositories/Repository.java
+++ b/server/src/main/java/org/opensearch/repositories/Repository.java
@@ -41,6 +41,7 @@
import org.opensearch.cluster.metadata.RepositoryMetadata;
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lifecycle.LifecycleComponent;
import org.opensearch.common.settings.Setting;
import org.opensearch.core.action.ActionListener;
@@ -75,14 +76,18 @@
* When all shard calls return cluster-manager calls {@link #finalizeSnapshot} with possible list of failures
*
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface Repository extends LifecycleComponent {
/**
* An factory interface for constructing repositories.
* See {@link org.opensearch.plugins.RepositoryPlugin}.
+ *
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
interface Factory {
/**
* Constructs a repository.
diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryData.java b/server/src/main/java/org/opensearch/repositories/RepositoryData.java
index 90d7b404d089a..ea48d9b1a49fe 100644
--- a/server/src/main/java/org/opensearch/repositories/RepositoryData.java
+++ b/server/src/main/java/org/opensearch/repositories/RepositoryData.java
@@ -37,6 +37,7 @@
import org.opensearch.Version;
import org.opensearch.common.Nullable;
import org.opensearch.common.UUIDs;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.core.xcontent.XContentParser;
import org.opensearch.core.xcontent.XContentParserUtils;
@@ -60,8 +61,9 @@
* A class that represents the data in a repository, as captured in the
* repository's index blob.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class RepositoryData {
/**
diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryInfo.java b/server/src/main/java/org/opensearch/repositories/RepositoryInfo.java
index 387a685bd6526..c947ff19bbca8 100644
--- a/server/src/main/java/org/opensearch/repositories/RepositoryInfo.java
+++ b/server/src/main/java/org/opensearch/repositories/RepositoryInfo.java
@@ -32,6 +32,7 @@
package org.opensearch.repositories;
+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;
@@ -47,8 +48,9 @@
/**
* Information about a repository
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class RepositoryInfo implements Writeable, ToXContentFragment {
public final String name;
public final String type;
diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryShardId.java b/server/src/main/java/org/opensearch/repositories/RepositoryShardId.java
index 4799f36156a73..5b16ffcdf83a4 100644
--- a/server/src/main/java/org/opensearch/repositories/RepositoryShardId.java
+++ b/server/src/main/java/org/opensearch/repositories/RepositoryShardId.java
@@ -32,6 +32,7 @@
package org.opensearch.repositories;
+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;
@@ -42,8 +43,9 @@
/**
* Represents a shard snapshot in a repository.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class RepositoryShardId implements Writeable {
private final IndexId index;
diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryStats.java b/server/src/main/java/org/opensearch/repositories/RepositoryStats.java
index ab97c5eaa1f7a..a0cc1637af00e 100644
--- a/server/src/main/java/org/opensearch/repositories/RepositoryStats.java
+++ b/server/src/main/java/org/opensearch/repositories/RepositoryStats.java
@@ -33,6 +33,7 @@
package org.opensearch.repositories;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.blobstore.BlobStore;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -49,8 +50,9 @@
/**
* Stats about a repository
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class RepositoryStats implements Writeable, ToXContentFragment {
public static final RepositoryStats EMPTY_STATS = new RepositoryStats(Collections.emptyMap());
diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryStatsSnapshot.java b/server/src/main/java/org/opensearch/repositories/RepositoryStatsSnapshot.java
index 0a727980fad0d..3340defffc90f 100644
--- a/server/src/main/java/org/opensearch/repositories/RepositoryStatsSnapshot.java
+++ b/server/src/main/java/org/opensearch/repositories/RepositoryStatsSnapshot.java
@@ -32,6 +32,7 @@
package org.opensearch.repositories;
+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;
@@ -46,8 +47,9 @@
/**
* Stats snapshot about a repository
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class RepositoryStatsSnapshot implements Writeable, ToXContentObject {
public static final long UNKNOWN_CLUSTER_VERSION = -1;
private final RepositoryInfo repositoryInfo;
diff --git a/server/src/main/java/org/opensearch/repositories/ShardGenerations.java b/server/src/main/java/org/opensearch/repositories/ShardGenerations.java
index d918eb7e1e476..3591e683e58c1 100644
--- a/server/src/main/java/org/opensearch/repositories/ShardGenerations.java
+++ b/server/src/main/java/org/opensearch/repositories/ShardGenerations.java
@@ -33,6 +33,7 @@
package org.opensearch.repositories;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import java.util.Arrays;
import java.util.Collection;
@@ -48,8 +49,9 @@
/**
* Generations of shards for snapshots
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class ShardGenerations {
public static final ShardGenerations EMPTY = new ShardGenerations(Collections.emptyMap());
@@ -177,8 +179,9 @@ public static Builder builder() {
/**
* Builder for the shard generations.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static final class Builder {
private final Map> generations = new HashMap<>();
diff --git a/server/src/main/java/org/opensearch/search/DocValueFormat.java b/server/src/main/java/org/opensearch/search/DocValueFormat.java
index 7be51643eeb7d..9fae14f69b0af 100644
--- a/server/src/main/java/org/opensearch/search/DocValueFormat.java
+++ b/server/src/main/java/org/opensearch/search/DocValueFormat.java
@@ -36,6 +36,7 @@
import org.apache.lucene.util.BytesRef;
import org.opensearch.Version;
import org.opensearch.common.Numbers;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.network.InetAddresses;
import org.opensearch.common.network.NetworkAddress;
import org.opensearch.common.time.DateFormatter;
@@ -64,8 +65,9 @@
/**
* A formatter for values as returned by the fielddata/doc-values APIs.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface DocValueFormat extends NamedWriteable {
long MASK_2_63 = 0x8000000000000000L;
BigInteger BIGINTEGER_2_64_MINUS_ONE = BigInteger.ONE.shiftLeft(64).subtract(BigInteger.ONE); // 2^64 -1
diff --git a/server/src/main/java/org/opensearch/search/SearchHit.java b/server/src/main/java/org/opensearch/search/SearchHit.java
index 5649ec383a9e9..10e65fca3afb5 100644
--- a/server/src/main/java/org/opensearch/search/SearchHit.java
+++ b/server/src/main/java/org/opensearch/search/SearchHit.java
@@ -37,6 +37,7 @@
import org.opensearch.Version;
import org.opensearch.action.OriginalIndices;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.document.DocumentField;
import org.opensearch.common.xcontent.XContentHelper;
import org.opensearch.core.ParseField;
@@ -92,8 +93,9 @@
*
* @see SearchHits
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class SearchHit implements Writeable, ToXContentObject, Iterable {
private final transient int docId;
@@ -995,8 +997,9 @@ public int hashCode() {
/**
* Encapsulates the nested identity of a hit.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static final class NestedIdentity implements Writeable, ToXContentFragment {
private static final String _NESTED = "_nested";
diff --git a/server/src/main/java/org/opensearch/search/SearchHits.java b/server/src/main/java/org/opensearch/search/SearchHits.java
index 1d497840bd12b..8232643b353f5 100644
--- a/server/src/main/java/org/opensearch/search/SearchHits.java
+++ b/server/src/main/java/org/opensearch/search/SearchHits.java
@@ -36,6 +36,7 @@
import org.apache.lucene.search.TotalHits;
import org.apache.lucene.search.TotalHits.Relation;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lucene.Lucene;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -57,8 +58,9 @@
/**
* Encapsulates the results of a search operation
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class SearchHits implements Writeable, ToXContentFragment, Iterable {
public static SearchHits empty() {
return empty(true);
diff --git a/server/src/main/java/org/opensearch/search/SearchShardTarget.java b/server/src/main/java/org/opensearch/search/SearchShardTarget.java
index 882ba8e069c2e..80b4feda374c6 100644
--- a/server/src/main/java/org/opensearch/search/SearchShardTarget.java
+++ b/server/src/main/java/org/opensearch/search/SearchShardTarget.java
@@ -34,6 +34,7 @@
import org.opensearch.action.OriginalIndices;
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;
@@ -47,8 +48,9 @@
/**
* The target that the search request was executed on.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class SearchShardTarget implements Writeable, Comparable {
private final Text nodeId;
diff --git a/server/src/main/java/org/opensearch/search/SearchSortValues.java b/server/src/main/java/org/opensearch/search/SearchSortValues.java
index c1f6b45ded7a5..cbc3900f72f79 100644
--- a/server/src/main/java/org/opensearch/search/SearchSortValues.java
+++ b/server/src/main/java/org/opensearch/search/SearchSortValues.java
@@ -33,6 +33,7 @@
package org.opensearch.search;
import org.apache.lucene.util.BytesRef;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lucene.Lucene;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -50,8 +51,9 @@
/**
* Values to sort during search
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class SearchSortValues implements ToXContentFragment, Writeable {
private static final Object[] EMPTY_ARRAY = new Object[0];
diff --git a/server/src/main/java/org/opensearch/search/internal/ShardSearchContextId.java b/server/src/main/java/org/opensearch/search/internal/ShardSearchContextId.java
index 3e0d2b1d6c638..c6c09ff54241b 100644
--- a/server/src/main/java/org/opensearch/search/internal/ShardSearchContextId.java
+++ b/server/src/main/java/org/opensearch/search/internal/ShardSearchContextId.java
@@ -32,6 +32,7 @@
package org.opensearch.search.internal;
+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;
@@ -42,8 +43,9 @@
/**
* Used to support Point in Time Searching
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class ShardSearchContextId implements Writeable {
private final String sessionId;
private final long id;
diff --git a/server/src/main/java/org/opensearch/search/internal/ShardSearchRequest.java b/server/src/main/java/org/opensearch/search/internal/ShardSearchRequest.java
index d46cad37e9b71..de1d5fb8b4098 100644
--- a/server/src/main/java/org/opensearch/search/internal/ShardSearchRequest.java
+++ b/server/src/main/java/org/opensearch/search/internal/ShardSearchRequest.java
@@ -43,6 +43,7 @@
import org.opensearch.cluster.metadata.IndexMetadata;
import org.opensearch.common.CheckedFunction;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.io.stream.BytesStreamOutput;
import org.opensearch.common.unit.TimeValue;
import org.opensearch.core.common.Strings;
@@ -82,8 +83,9 @@
* It provides all the methods that the {@link SearchContext} needs.
* Provides a cache key based on its content that can be used to cache shard level response.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class ShardSearchRequest extends TransportRequest implements IndicesRequest {
public static final ToXContent.Params FORMAT_PARAMS = new ToXContent.MapParams(Collections.singletonMap("pretty", "false"));