nodeResultComparator = Comparator.comparing(NodeAllocationResult::getNodeDecision)
@@ -191,8 +193,9 @@ public int compareTo(NodeAllocationResult other) {
/**
* A class that captures metadata about a shard store on a node.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static final class ShardStoreInfo implements ToXContentFragment, Writeable {
private final boolean inSync;
@Nullable
diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/RoutingAllocation.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/RoutingAllocation.java
index 9e8e399384467..bf2db57128517 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/allocation/RoutingAllocation.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/RoutingAllocation.java
@@ -43,6 +43,7 @@
import org.opensearch.cluster.routing.ShardRouting;
import org.opensearch.cluster.routing.allocation.decider.AllocationDeciders;
import org.opensearch.cluster.routing.allocation.decider.Decision;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.index.shard.ShardId;
import org.opensearch.snapshots.RestoreService.RestoreInProgressUpdater;
import org.opensearch.snapshots.SnapshotShardSizeInfo;
@@ -60,8 +61,9 @@
* of shards and holds the {@link AllocationDeciders} which are responsible
* for the current routing state.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class RoutingAllocation {
private final AllocationDeciders deciders;
@@ -317,8 +319,9 @@ public void setHasPendingAsyncFetch() {
/**
* Debug mode.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public enum DebugMode {
/**
* debug mode is off
diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/ShardAllocationDecision.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/ShardAllocationDecision.java
index e1a7fb43827f3..49e8d82c6eb97 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/allocation/ShardAllocationDecision.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/ShardAllocationDecision.java
@@ -32,6 +32,7 @@
package org.opensearch.cluster.routing.allocation;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
@@ -53,8 +54,9 @@
* then both {@link #getAllocateDecision()} and {@link #getMoveDecision()} will return
* objects whose {@code isDecisionTaken()} method returns {@code false}.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class ShardAllocationDecision implements ToXContentFragment, Writeable {
public static final ShardAllocationDecision NOT_TAKEN = new ShardAllocationDecision(
AllocateUnassignedDecision.NOT_TAKEN,
diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommand.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommand.java
index def0411853643..bce3191240323 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommand.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommand.java
@@ -35,6 +35,7 @@
import org.opensearch.OpenSearchException;
import org.opensearch.cluster.routing.allocation.RerouteExplanation;
import org.opensearch.cluster.routing.allocation.RoutingAllocation;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.network.NetworkModule;
import org.opensearch.core.common.io.stream.NamedWriteable;
import org.opensearch.core.xcontent.ToXContentObject;
@@ -46,8 +47,9 @@
*
* Commands are registered in {@link NetworkModule}.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface AllocationCommand extends NamedWriteable, ToXContentObject {
/**
diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommands.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommands.java
index ac804819443a5..2ee4124e9d909 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommands.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/AllocationCommands.java
@@ -36,6 +36,7 @@
import org.opensearch.OpenSearchParseException;
import org.opensearch.cluster.routing.allocation.RoutingAllocation;
import org.opensearch.cluster.routing.allocation.RoutingExplanations;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.Strings;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -54,8 +55,9 @@
* A simple {@link AllocationCommand} composite managing several
* {@link AllocationCommand} implementations
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class AllocationCommands implements ToXContentFragment {
private final List commands = new ArrayList<>();
diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDecider.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDecider.java
index 85f193c8c5580..19faacc3a3ae1 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDecider.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDecider.java
@@ -38,14 +38,16 @@
import org.opensearch.cluster.routing.ShardRouting;
import org.opensearch.cluster.routing.allocation.RoutingAllocation;
import org.opensearch.cluster.routing.allocation.decider.Decision.Type;
+import org.opensearch.common.annotation.PublicApi;
/**
* {@link AllocationDecider} is an abstract base class that allows to make
* dynamic cluster- or index-wide shard allocation decisions on a per-node
* basis.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class AllocationDecider {
/**
* Returns a {@link Decision} whether the given shard routing can be
diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDeciders.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDeciders.java
index dca82f75d6fb5..22c3156fb3537 100644
--- a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDeciders.java
+++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/AllocationDeciders.java
@@ -39,6 +39,7 @@
import org.opensearch.cluster.routing.RoutingNode;
import org.opensearch.cluster.routing.ShardRouting;
import org.opensearch.cluster.routing.allocation.RoutingAllocation;
+import org.opensearch.common.annotation.PublicApi;
import java.util.Collection;
import java.util.Collections;
@@ -47,8 +48,9 @@
* A composite {@link AllocationDecider} combining the "decision" of multiple
* {@link AllocationDecider} implementations into a single allocation decision.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class AllocationDeciders extends AllocationDecider {
private static final Logger logger = LogManager.getLogger(AllocationDeciders.class);
diff --git a/server/src/main/java/org/opensearch/cluster/service/ClusterApplier.java b/server/src/main/java/org/opensearch/cluster/service/ClusterApplier.java
index 939feb89b6054..5b3f7f1001779 100644
--- a/server/src/main/java/org/opensearch/cluster/service/ClusterApplier.java
+++ b/server/src/main/java/org/opensearch/cluster/service/ClusterApplier.java
@@ -33,6 +33,7 @@
package org.opensearch.cluster.service;
import org.opensearch.cluster.ClusterState;
+import org.opensearch.common.annotation.PublicApi;
import java.util.function.Supplier;
@@ -59,7 +60,10 @@ public interface ClusterApplier {
/**
* Listener for results of cluster state application
+ *
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
interface ClusterApplyListener {
/**
* Called on successful cluster state application
diff --git a/server/src/main/java/org/opensearch/cluster/service/ClusterApplierService.java b/server/src/main/java/org/opensearch/cluster/service/ClusterApplierService.java
index 8e94e7cab23d3..a55721fb13cdc 100644
--- a/server/src/main/java/org/opensearch/cluster/service/ClusterApplierService.java
+++ b/server/src/main/java/org/opensearch/cluster/service/ClusterApplierService.java
@@ -51,6 +51,7 @@
import org.opensearch.common.Priority;
import org.opensearch.common.StopWatch;
import org.opensearch.common.StopWatch.TimingHandle;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lifecycle.AbstractLifecycleComponent;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Setting;
@@ -82,8 +83,9 @@
/**
* Service that provides callbacks when cluster state changes
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class ClusterApplierService extends AbstractLifecycleComponent implements ClusterApplier {
private static final Logger logger = LogManager.getLogger(ClusterApplierService.class);
diff --git a/server/src/main/java/org/opensearch/cluster/service/ClusterManagerService.java b/server/src/main/java/org/opensearch/cluster/service/ClusterManagerService.java
index 74b623dd95e6f..e9224596e048d 100644
--- a/server/src/main/java/org/opensearch/cluster/service/ClusterManagerService.java
+++ b/server/src/main/java/org/opensearch/cluster/service/ClusterManagerService.java
@@ -8,6 +8,7 @@
package org.opensearch.cluster.service;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Settings;
import org.opensearch.threadpool.ThreadPool;
@@ -15,8 +16,9 @@
/**
* Main Cluster Manager Node Service
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "2.2.0")
public class ClusterManagerService extends MasterService {
public ClusterManagerService(Settings settings, ClusterSettings clusterSettings, ThreadPool threadPool) {
super(settings, clusterSettings, threadPool);
diff --git a/server/src/main/java/org/opensearch/cluster/service/ClusterManagerThrottlingStats.java b/server/src/main/java/org/opensearch/cluster/service/ClusterManagerThrottlingStats.java
index 7714b608c7c12..6a910e5f88536 100644
--- a/server/src/main/java/org/opensearch/cluster/service/ClusterManagerThrottlingStats.java
+++ b/server/src/main/java/org/opensearch/cluster/service/ClusterManagerThrottlingStats.java
@@ -8,6 +8,7 @@
package org.opensearch.cluster.service;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.metrics.CounterMetric;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
@@ -23,7 +24,10 @@
/**
* Contains stats of Cluster Manager Task Throttling.
* It stores the total cumulative count of throttled tasks per task type.
+ *
+ * @opensearch.api
*/
+@PublicApi(since = "2.5.0")
public class ClusterManagerThrottlingStats implements ClusterManagerTaskThrottlerListener, Writeable, ToXContentFragment {
private Map throttledTasksCount;
diff --git a/server/src/main/java/org/opensearch/cluster/service/ClusterService.java b/server/src/main/java/org/opensearch/cluster/service/ClusterService.java
index e097803d86b48..aa7766979e851 100644
--- a/server/src/main/java/org/opensearch/cluster/service/ClusterService.java
+++ b/server/src/main/java/org/opensearch/cluster/service/ClusterService.java
@@ -45,6 +45,7 @@
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.cluster.routing.OperationRouting;
import org.opensearch.cluster.routing.RerouteService;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lifecycle.AbstractLifecycleComponent;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Setting;
@@ -60,8 +61,9 @@
/**
* Main Cluster Service
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class ClusterService extends AbstractLifecycleComponent {
private final ClusterManagerService clusterManagerService;
diff --git a/server/src/main/java/org/opensearch/cluster/service/ClusterStateStats.java b/server/src/main/java/org/opensearch/cluster/service/ClusterStateStats.java
index 96683ce720d0b..79263e31b8f49 100644
--- a/server/src/main/java/org/opensearch/cluster/service/ClusterStateStats.java
+++ b/server/src/main/java/org/opensearch/cluster/service/ClusterStateStats.java
@@ -9,6 +9,7 @@
package org.opensearch.cluster.service;
import org.opensearch.cluster.coordination.PersistedStateStats;
+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;
@@ -23,8 +24,9 @@
/**
* Cluster state related stats.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "2.12.0")
public class ClusterStateStats implements Writeable, ToXContentObject {
private AtomicLong updateSuccess = new AtomicLong(0);
diff --git a/server/src/main/java/org/opensearch/cluster/service/MasterService.java b/server/src/main/java/org/opensearch/cluster/service/MasterService.java
index 07c3f93ae6486..af3e4f8437c43 100644
--- a/server/src/main/java/org/opensearch/cluster/service/MasterService.java
+++ b/server/src/main/java/org/opensearch/cluster/service/MasterService.java
@@ -54,6 +54,7 @@
import org.opensearch.cluster.routing.RoutingTable;
import org.opensearch.common.Nullable;
import org.opensearch.common.Priority;
+import org.opensearch.common.annotation.DeprecatedApi;
import org.opensearch.common.lifecycle.AbstractLifecycleComponent;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Setting;
@@ -87,10 +88,11 @@
/**
* Main Master Node Service
*
- * @opensearch.internal
+ * @opensearch.api
* @deprecated As of 2.2, because supporting inclusive language, replaced by {@link ClusterManagerService}.
*/
@Deprecated
+@DeprecatedApi(since = "2.2.0")
public class MasterService extends AbstractLifecycleComponent {
private static final Logger logger = LogManager.getLogger(MasterService.class);
diff --git a/server/src/main/java/org/opensearch/common/Rounding.java b/server/src/main/java/org/opensearch/common/Rounding.java
index 061934f9722f5..5a740b8527704 100644
--- a/server/src/main/java/org/opensearch/common/Rounding.java
+++ b/server/src/main/java/org/opensearch/common/Rounding.java
@@ -37,6 +37,7 @@
import org.opensearch.OpenSearchException;
import org.opensearch.common.LocalTimeOffset.Gap;
import org.opensearch.common.LocalTimeOffset.Overlap;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.round.Roundable;
import org.opensearch.common.round.RoundableFactory;
import org.opensearch.common.time.DateUtils;
@@ -76,16 +77,18 @@
* blog for some background reading. Its super interesting and the links are
* a comedy gold mine. If you like time zones. Or hate them.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class Rounding implements Writeable {
private static final Logger logger = LogManager.getLogger(Rounding.class);
/**
* A Date Time Unit
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public enum DateTimeUnit {
WEEK_OF_WEEKYEAR((byte) 1, "week", IsoFields.WEEK_OF_WEEK_BASED_YEAR, true, TimeUnit.DAYS.toMillis(7)) {
private final long extraLocalOffsetLookup = TimeUnit.DAYS.toMillis(7);
@@ -268,8 +271,9 @@ public void writeTo(StreamOutput out) throws IOException {
/**
* A strategy for rounding milliseconds since epoch.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface Prepared {
/**
* Rounds the given value.
@@ -359,8 +363,9 @@ public static Builder builder(TimeValue interval) {
/**
* Builder for rounding
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Builder {
private final DateTimeUnit unit;
diff --git a/server/src/main/java/org/opensearch/common/cache/Cache.java b/server/src/main/java/org/opensearch/common/cache/Cache.java
index 0b2b608b55df0..30e7c014a2ec0 100644
--- a/server/src/main/java/org/opensearch/common/cache/Cache.java
+++ b/server/src/main/java/org/opensearch/common/cache/Cache.java
@@ -32,6 +32,7 @@
package org.opensearch.common.cache;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.collect.Tuple;
import org.opensearch.common.util.concurrent.ReleasableLock;
@@ -80,8 +81,9 @@
* @param The type of the keys
* @param The type of the values
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class Cache {
// positive if entries have an expiration
@@ -732,8 +734,9 @@ public CacheStats stats() {
/**
* Cache statistics
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class CacheStats {
private long hits;
private long misses;
diff --git a/server/src/main/java/org/opensearch/common/cache/CacheLoader.java b/server/src/main/java/org/opensearch/common/cache/CacheLoader.java
index 3c80fe5d66d5d..9fd43a03e7f9d 100644
--- a/server/src/main/java/org/opensearch/common/cache/CacheLoader.java
+++ b/server/src/main/java/org/opensearch/common/cache/CacheLoader.java
@@ -32,12 +32,15 @@
package org.opensearch.common.cache;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* An interface for a cache loader.
*
- * @opensearch.internal
+ * @opensearch.api
*/
@FunctionalInterface
+@PublicApi(since = "1.0.0")
public interface CacheLoader {
V load(K key) throws Exception;
}
diff --git a/server/src/main/java/org/opensearch/common/cache/RemovalNotification.java b/server/src/main/java/org/opensearch/common/cache/RemovalNotification.java
index 6d355b2122460..42303b8cfdc73 100644
--- a/server/src/main/java/org/opensearch/common/cache/RemovalNotification.java
+++ b/server/src/main/java/org/opensearch/common/cache/RemovalNotification.java
@@ -32,11 +32,14 @@
package org.opensearch.common.cache;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* Notification when an element is removed from the cache
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class RemovalNotification {
private final K key;
diff --git a/server/src/main/java/org/opensearch/common/cache/RemovalReason.java b/server/src/main/java/org/opensearch/common/cache/RemovalReason.java
index e5d795c093547..514b84a7823ca 100644
--- a/server/src/main/java/org/opensearch/common/cache/RemovalReason.java
+++ b/server/src/main/java/org/opensearch/common/cache/RemovalReason.java
@@ -8,11 +8,14 @@
package org.opensearch.common.cache;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* Reason for notification removal
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public enum RemovalReason {
REPLACED,
INVALIDATED,
diff --git a/server/src/main/java/org/opensearch/common/compress/CompressedXContent.java b/server/src/main/java/org/opensearch/common/compress/CompressedXContent.java
index 550bc5b3fd524..23fc6353dbad3 100644
--- a/server/src/main/java/org/opensearch/common/compress/CompressedXContent.java
+++ b/server/src/main/java/org/opensearch/common/compress/CompressedXContent.java
@@ -32,6 +32,7 @@
package org.opensearch.common.compress;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.io.Streams;
import org.opensearch.common.io.stream.BytesStreamOutput;
import org.opensearch.common.xcontent.XContentFactory;
@@ -57,8 +58,9 @@
* memory. Note that the compressed string might still sometimes need to be
* decompressed in order to perform equality checks or to compute hash codes.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class CompressedXContent {
private static int crc32(BytesReference data) {
diff --git a/server/src/main/java/org/opensearch/common/concurrent/GatedCloseable.java b/server/src/main/java/org/opensearch/common/concurrent/GatedCloseable.java
index 8bf620ee2cd50..08ebc2f8786c5 100644
--- a/server/src/main/java/org/opensearch/common/concurrent/GatedCloseable.java
+++ b/server/src/main/java/org/opensearch/common/concurrent/GatedCloseable.java
@@ -14,6 +14,7 @@
package org.opensearch.common.concurrent;
import org.opensearch.common.CheckedRunnable;
+import org.opensearch.common.annotation.PublicApi;
import java.io.Closeable;
import java.io.IOException;
@@ -23,8 +24,9 @@
* invoked when {@link #close()} is called. The internal {@link OneWayGate} instance ensures
* that this is invoked only once. See also {@link AutoCloseableRefCounted}
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class GatedCloseable implements Closeable {
private final T ref;
diff --git a/server/src/main/java/org/opensearch/common/io/stream/DelayableWriteable.java b/server/src/main/java/org/opensearch/common/io/stream/DelayableWriteable.java
index 200f3e9225834..f345a5d3a804f 100644
--- a/server/src/main/java/org/opensearch/common/io/stream/DelayableWriteable.java
+++ b/server/src/main/java/org/opensearch/common/io/stream/DelayableWriteable.java
@@ -35,6 +35,7 @@
import org.apache.lucene.util.Accountable;
import org.apache.lucene.util.RamUsageEstimator;
import org.opensearch.Version;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.core.common.io.stream.NamedWriteableAwareStreamInput;
import org.opensearch.core.common.io.stream.NamedWriteableRegistry;
@@ -62,8 +63,9 @@
* to force their buffering in serialized format by calling
* {@link #asSerialized(Reader, NamedWriteableRegistry)}.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class DelayableWriteable implements Writeable {
/**
* Build a {@linkplain DelayableWriteable} that wraps an existing object
@@ -151,8 +153,9 @@ private BytesStreamOutput writeToBuffer(Version version) throws IOException {
/**
* A {@link Writeable} stored in serialized form.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Serialized extends DelayableWriteable implements Accountable {
private final Writeable.Reader reader;
private final Version serializedAtVersion;
diff --git a/server/src/main/java/org/opensearch/common/lucene/index/OpenSearchDirectoryReader.java b/server/src/main/java/org/opensearch/common/lucene/index/OpenSearchDirectoryReader.java
index 77609822d3d90..d6b2bb239b2a1 100644
--- a/server/src/main/java/org/opensearch/common/lucene/index/OpenSearchDirectoryReader.java
+++ b/server/src/main/java/org/opensearch/common/lucene/index/OpenSearchDirectoryReader.java
@@ -36,6 +36,7 @@
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.LeafReader;
import org.opensearch.common.SuppressForbidden;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.index.shard.ShardId;
import java.io.IOException;
@@ -44,8 +45,9 @@
* A {@link org.apache.lucene.index.FilterDirectoryReader} that exposes
* OpenSearch internal per shard / index information like the shard ID.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class OpenSearchDirectoryReader extends FilterDirectoryReader {
private final ShardId shardId;
diff --git a/server/src/main/java/org/opensearch/common/lucene/search/TopDocsAndMaxScore.java b/server/src/main/java/org/opensearch/common/lucene/search/TopDocsAndMaxScore.java
index 5f8c52676b481..5b7bae54a6fad 100644
--- a/server/src/main/java/org/opensearch/common/lucene/search/TopDocsAndMaxScore.java
+++ b/server/src/main/java/org/opensearch/common/lucene/search/TopDocsAndMaxScore.java
@@ -33,13 +33,15 @@
package org.opensearch.common.lucene.search;
import org.apache.lucene.search.TopDocs;
+import org.opensearch.common.annotation.PublicApi;
/**
* Wrapper around a {@link TopDocs} instance and the maximum score.
*
- * @opensearch.internal
+ * @opensearch.api
*/
// TODO: Remove this class when https://github.com/elastic/elasticsearch/issues/32981 is addressed.
+@PublicApi(since = "1.0.0")
public final class TopDocsAndMaxScore {
public final TopDocs topDocs;
diff --git a/server/src/main/java/org/opensearch/common/lucene/uid/VersionsAndSeqNoResolver.java b/server/src/main/java/org/opensearch/common/lucene/uid/VersionsAndSeqNoResolver.java
index 57524bc3657d9..4958267b1775b 100644
--- a/server/src/main/java/org/opensearch/common/lucene/uid/VersionsAndSeqNoResolver.java
+++ b/server/src/main/java/org/opensearch/common/lucene/uid/VersionsAndSeqNoResolver.java
@@ -37,6 +37,7 @@
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.Term;
import org.apache.lucene.util.CloseableThreadLocal;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.concurrent.ConcurrentCollections;
import java.io.IOException;
@@ -110,8 +111,9 @@ private VersionsAndSeqNoResolver() {}
/**
* Wraps an {@link LeafReaderContext}, a doc ID relative to the context doc base and a version.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class DocIdAndVersion {
public final int docId;
public final long version;
diff --git a/server/src/main/java/org/opensearch/common/time/DateFormatter.java b/server/src/main/java/org/opensearch/common/time/DateFormatter.java
index c98bd853dfced..0712b7b050bec 100644
--- a/server/src/main/java/org/opensearch/common/time/DateFormatter.java
+++ b/server/src/main/java/org/opensearch/common/time/DateFormatter.java
@@ -32,6 +32,7 @@
package org.opensearch.common.time;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.Strings;
import org.joda.time.DateTime;
@@ -49,8 +50,9 @@
/**
* Base Date formatter
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface DateFormatter {
/**
diff --git a/server/src/main/java/org/opensearch/common/time/DateMathParser.java b/server/src/main/java/org/opensearch/common/time/DateMathParser.java
index 7088d6cb7a498..8c123d7d2ebc9 100644
--- a/server/src/main/java/org/opensearch/common/time/DateMathParser.java
+++ b/server/src/main/java/org/opensearch/common/time/DateMathParser.java
@@ -32,6 +32,7 @@
package org.opensearch.common.time;
+import org.opensearch.common.annotation.PublicApi;
import org.joda.time.DateTimeZone;
import java.time.Instant;
@@ -41,8 +42,9 @@
/**
* An abstraction over date math parsing to allow different implementation for joda and java time.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface DateMathParser {
/**
diff --git a/server/src/main/java/org/opensearch/common/util/BigArrays.java b/server/src/main/java/org/opensearch/common/util/BigArrays.java
index 59c84ea45a65a..92371c2c77ef9 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;
@@ -47,7 +48,12 @@
import java.util.Arrays;
-/** Utility class to work with arrays. */
+/**
+ * Utility class to work with arrays.
+ *
+ * @opensearch.api
+ * */
+@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/CancellableThreads.java b/server/src/main/java/org/opensearch/common/util/CancellableThreads.java
index 67dd4b848f4c0..ea206ddf980cb 100644
--- a/server/src/main/java/org/opensearch/common/util/CancellableThreads.java
+++ b/server/src/main/java/org/opensearch/common/util/CancellableThreads.java
@@ -35,6 +35,7 @@
import org.opensearch.OpenSearchException;
import org.opensearch.common.Nullable;
import org.opensearch.common.SetOnce;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import java.io.IOException;
@@ -48,13 +49,14 @@
*
* Cancellation policy: This class does not support external interruption via Thread#interrupt()
. Always use #cancel() instead.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class CancellableThreads {
private final Set threads = new HashSet<>();
// needs to be volatile as it is also read outside of synchronized blocks.
- private volatile boolean cancelled = false;
private final SetOnce onCancel = new SetOnce<>();
+ private volatile boolean cancelled = false;
private String reason;
public synchronized boolean isCancelled() {
@@ -183,8 +185,9 @@ public synchronized void cancel(String reason) {
/**
* Interruptible interface
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface Interruptible extends IOInterruptible {
void run() throws InterruptedException;
}
@@ -192,8 +195,9 @@ public interface Interruptible extends IOInterruptible {
/**
* IO Interruptible
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface IOInterruptible {
void run() throws IOException, InterruptedException;
}
@@ -224,9 +228,10 @@ public synchronized void setOnCancel(OnCancel onCancel) {
/**
* Called when a thread is cancelled
*
- * @opensearch.internal
+ * @opensearch.api
*/
@FunctionalInterface
+ @PublicApi(since = "1.0.0")
public interface OnCancel {
/**
* Called when some running operations are cancelled or {@link #checkForCancel()} is explicitly called.
diff --git a/server/src/main/java/org/opensearch/common/util/Countable.java b/server/src/main/java/org/opensearch/common/util/Countable.java
index 1adf6d2fb015c..925d1b6066a99 100644
--- a/server/src/main/java/org/opensearch/common/util/Countable.java
+++ b/server/src/main/java/org/opensearch/common/util/Countable.java
@@ -32,11 +32,14 @@
package org.opensearch.common.util;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* Base countable interface.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface Countable {
int size();
}
diff --git a/server/src/main/java/org/opensearch/common/util/DoubleArray.java b/server/src/main/java/org/opensearch/common/util/DoubleArray.java
index ae66902f6f795..aa9238634f2c7 100644
--- a/server/src/main/java/org/opensearch/common/util/DoubleArray.java
+++ b/server/src/main/java/org/opensearch/common/util/DoubleArray.java
@@ -32,13 +32,15 @@
package org.opensearch.common.util;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.util.BigArray;
/**
* Abstraction of an array of double values.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface DoubleArray extends BigArray {
/**
diff --git a/server/src/main/java/org/opensearch/common/util/FloatArray.java b/server/src/main/java/org/opensearch/common/util/FloatArray.java
index 81f6bebb7508c..bda7324d19273 100644
--- a/server/src/main/java/org/opensearch/common/util/FloatArray.java
+++ b/server/src/main/java/org/opensearch/common/util/FloatArray.java
@@ -32,13 +32,15 @@
package org.opensearch.common.util;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.util.BigArray;
/**
* Abstraction of an array of double values.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface FloatArray extends BigArray {
/**
diff --git a/server/src/main/java/org/opensearch/common/util/IntArray.java b/server/src/main/java/org/opensearch/common/util/IntArray.java
index eb43e013f3758..ad0173904f74a 100644
--- a/server/src/main/java/org/opensearch/common/util/IntArray.java
+++ b/server/src/main/java/org/opensearch/common/util/IntArray.java
@@ -32,13 +32,15 @@
package org.opensearch.common.util;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.util.BigArray;
/**
* Abstraction of an array of integer values.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface IntArray extends BigArray {
/**
diff --git a/server/src/main/java/org/opensearch/common/util/LongArray.java b/server/src/main/java/org/opensearch/common/util/LongArray.java
index 0c32effd04cdc..c2f649e49f470 100644
--- a/server/src/main/java/org/opensearch/common/util/LongArray.java
+++ b/server/src/main/java/org/opensearch/common/util/LongArray.java
@@ -32,13 +32,15 @@
package org.opensearch.common.util;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.util.BigArray;
/**
* Abstraction of an array of long values.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface LongArray extends BigArray {
/**
diff --git a/server/src/main/java/org/opensearch/common/util/ObjectArray.java b/server/src/main/java/org/opensearch/common/util/ObjectArray.java
index 9c882742b56ab..f3f73b7e37485 100644
--- a/server/src/main/java/org/opensearch/common/util/ObjectArray.java
+++ b/server/src/main/java/org/opensearch/common/util/ObjectArray.java
@@ -32,13 +32,15 @@
package org.opensearch.common.util;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.util.BigArray;
/**
* Abstraction of an array of object values.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface ObjectArray extends BigArray {
/**
diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/AsyncIOProcessor.java b/server/src/main/java/org/opensearch/common/util/concurrent/AsyncIOProcessor.java
index e9b9442c555e5..7f6fef83b34a6 100644
--- a/server/src/main/java/org/opensearch/common/util/concurrent/AsyncIOProcessor.java
+++ b/server/src/main/java/org/opensearch/common/util/concurrent/AsyncIOProcessor.java
@@ -32,6 +32,7 @@
package org.opensearch.common.util.concurrent;
import org.apache.logging.log4j.Logger;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.collect.Tuple;
import java.io.IOException;
@@ -50,8 +51,9 @@
* hijack a worker if nobody else is currently processing queued items. If the internal queue has reached it's capacity incoming threads
* might be blocked until other items are processed
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class AsyncIOProcessor- {
private final Logger logger;
private final ArrayBlockingQueue>> queue;
diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/AtomicArray.java b/server/src/main/java/org/opensearch/common/util/concurrent/AtomicArray.java
index dd1f71a7d2166..4c599aeae7a7c 100644
--- a/server/src/main/java/org/opensearch/common/util/concurrent/AtomicArray.java
+++ b/server/src/main/java/org/opensearch/common/util/concurrent/AtomicArray.java
@@ -33,6 +33,7 @@
package org.opensearch.common.util.concurrent;
import org.opensearch.OpenSearchGenerationException;
+import org.opensearch.common.annotation.PublicApi;
import java.util.ArrayList;
import java.util.Collections;
@@ -43,8 +44,9 @@
* A list backed by an {@link AtomicReferenceArray} with potential null values, easily allowing
* to get the concrete values as a list using {@link #asList()}.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class AtomicArray {
private final AtomicReferenceArray array;
private volatile List nonNullList;
diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContext.java b/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContext.java
index fc2e4217bae79..3da21a6777456 100644
--- a/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContext.java
+++ b/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContext.java
@@ -35,6 +35,7 @@
import org.apache.logging.log4j.Logger;
import org.opensearch.action.support.ContextPreservingActionListener;
import org.opensearch.client.OriginSettingClient;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.collect.MapBuilder;
import org.opensearch.common.collect.Tuple;
import org.opensearch.common.settings.Setting;
@@ -97,8 +98,9 @@
* // previous context is restored on StoredContext#close()
*
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class ThreadContext implements Writeable {
public static final String PREFIX = "request.headers";
@@ -545,9 +547,10 @@ public boolean isSystemContext() {
/**
* A stored context
*
- * @opensearch.internal
+ * @opensearch.api
*/
@FunctionalInterface
+ @PublicApi(since = "1.0.0")
public interface StoredContext extends AutoCloseable {
@Override
void close();
diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContextStatePropagator.java b/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContextStatePropagator.java
index b3fc79c5446db..dac70b0e8124e 100644
--- a/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContextStatePropagator.java
+++ b/server/src/main/java/org/opensearch/common/util/concurrent/ThreadContextStatePropagator.java
@@ -8,12 +8,17 @@
package org.opensearch.common.util.concurrent;
+import org.opensearch.common.annotation.PublicApi;
+
import java.util.Map;
/**
* The propagator for {@link ThreadContext} that helps to carry-over the state from one
* thread to another (tasks, tracing context, etc).
+ *
+ * @opensearch.api
*/
+@PublicApi(since = "2.8.0")
public interface ThreadContextStatePropagator {
/**
* Returns the list of transient headers that needs to be propagated from current context to new thread context.
diff --git a/server/src/main/java/org/opensearch/env/NodeEnvironment.java b/server/src/main/java/org/opensearch/env/NodeEnvironment.java
index 40c5722308b79..c7ba5eb040a1f 100644
--- a/server/src/main/java/org/opensearch/env/NodeEnvironment.java
+++ b/server/src/main/java/org/opensearch/env/NodeEnvironment.java
@@ -770,8 +770,11 @@ public void setDetails(String details) {
/**
* A functional interface that people can use to reference {@link #shardLock(ShardId, String, long)}
+ *
+ * @opensearch.api
*/
@FunctionalInterface
+ @PublicApi(since = "1.0.0")
public interface ShardLocker {
ShardLock lock(ShardId shardId, String lockDetails, long lockTimeoutMS) throws ShardLockObtainFailedException;
}
diff --git a/server/src/main/java/org/opensearch/gateway/WriteStateException.java b/server/src/main/java/org/opensearch/gateway/WriteStateException.java
index e60eb0c11310d..e1de211ade38f 100644
--- a/server/src/main/java/org/opensearch/gateway/WriteStateException.java
+++ b/server/src/main/java/org/opensearch/gateway/WriteStateException.java
@@ -31,6 +31,8 @@
package org.opensearch.gateway;
+import org.opensearch.common.annotation.PublicApi;
+
import java.io.IOError;
import java.io.IOException;
import java.io.UncheckedIOException;
@@ -38,8 +40,9 @@
/**
* This exception is thrown when there is a problem of writing state to disk.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class WriteStateException extends IOException {
private final boolean dirty;
diff --git a/server/src/main/java/org/opensearch/index/IndexService.java b/server/src/main/java/org/opensearch/index/IndexService.java
index 84e8e2f41aaf1..0909e2d5c8ff0 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;
@@ -130,8 +131,9 @@
/**
* The main OpenSearch index service
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndexService extends AbstractIndexComponent implements IndicesClusterStateService.AllocatedIndex {
private final IndexEventListener eventListener;
@@ -304,8 +306,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 +982,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;
@@ -1289,7 +1293,7 @@ AsyncTranslogFSync getFsyncTask() { // for tests
return fsyncTask;
}
- public AsyncTrimTranslogTask getTrimTranslogTask() { // for tests
+ AsyncTrimTranslogTask getTrimTranslogTask() { // for tests
return trimTranslogTask;
}
diff --git a/server/src/main/java/org/opensearch/index/IndexWarmer.java b/server/src/main/java/org/opensearch/index/IndexWarmer.java
index b62afe6b6dcfc..81063cb9b9c38 100644
--- a/server/src/main/java/org/opensearch/index/IndexWarmer.java
+++ b/server/src/main/java/org/opensearch/index/IndexWarmer.java
@@ -35,6 +35,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessage;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lucene.index.OpenSearchDirectoryReader;
import org.opensearch.common.unit.TimeValue;
import org.opensearch.index.fielddata.IndexFieldData;
@@ -111,8 +112,9 @@ void warm(OpenSearchDirectoryReader reader, IndexShard shard, IndexSettings sett
/**
* A handle on the execution of warm-up action.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface TerminationHandle {
TerminationHandle NO_WAIT = () -> {};
@@ -124,8 +126,9 @@ public interface TerminationHandle {
/**
* Listener for the index warmer
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface Listener {
/** Queue tasks to warm-up the given segments and return handles that allow to wait for termination of the
* execution of those tasks. */
diff --git a/server/src/main/java/org/opensearch/index/IndexingPressureService.java b/server/src/main/java/org/opensearch/index/IndexingPressureService.java
index 70fb5692f5619..898c3686d7a84 100644
--- a/server/src/main/java/org/opensearch/index/IndexingPressureService.java
+++ b/server/src/main/java/org/opensearch/index/IndexingPressureService.java
@@ -7,6 +7,7 @@
import org.opensearch.action.admin.indices.stats.CommonStatsFlags;
import org.opensearch.cluster.service.ClusterService;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lease.Releasable;
import org.opensearch.common.settings.Settings;
import org.opensearch.core.index.shard.ShardId;
@@ -19,8 +20,9 @@
* Sets up classes for node/shard level indexing pressure.
* Provides abstraction and orchestration for indexing pressure interfaces when called from Transport Actions or for Stats.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.3.0")
public class IndexingPressureService {
private final ShardIndexingPressure shardIndexingPressure;
diff --git a/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java b/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java
index 3b1f6af8a0030..793cdcd5c5c1a 100644
--- a/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java
+++ b/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java
@@ -38,6 +38,7 @@
import org.opensearch.OpenSearchException;
import org.opensearch.Version;
import org.opensearch.cluster.metadata.IndexMetadata;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.util.io.IOUtils;
import org.opensearch.env.Environment;
@@ -67,8 +68,9 @@
* An internal registry for tokenizer, token filter, char filter and analyzer.
* This class exists per node and allows to create per-index {@link IndexAnalyzers} via {@link #build(IndexSettings)}
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class AnalysisRegistry implements Closeable {
public static final String INDEX_ANALYSIS_CHAR_FILTER = "index.analysis.char_filter";
public static final String INDEX_ANALYSIS_FILTER = "index.analysis.filter";
diff --git a/server/src/main/java/org/opensearch/index/analysis/AnalyzerProvider.java b/server/src/main/java/org/opensearch/index/analysis/AnalyzerProvider.java
index 24ddabca16f1e..db0b3e8d288d6 100644
--- a/server/src/main/java/org/opensearch/index/analysis/AnalyzerProvider.java
+++ b/server/src/main/java/org/opensearch/index/analysis/AnalyzerProvider.java
@@ -33,13 +33,15 @@
package org.opensearch.index.analysis;
import org.apache.lucene.analysis.Analyzer;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.inject.Provider;
/**
* Base interface for all analyzer providers
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface AnalyzerProvider extends Provider {
String name();
diff --git a/server/src/main/java/org/opensearch/index/analysis/CharFilterFactory.java b/server/src/main/java/org/opensearch/index/analysis/CharFilterFactory.java
index dc9d3704b1a3c..938932280a52a 100644
--- a/server/src/main/java/org/opensearch/index/analysis/CharFilterFactory.java
+++ b/server/src/main/java/org/opensearch/index/analysis/CharFilterFactory.java
@@ -32,13 +32,16 @@
package org.opensearch.index.analysis;
+import org.opensearch.common.annotation.PublicApi;
+
import java.io.Reader;
/**
* Base character filter factory behavior used in analysis chain
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface CharFilterFactory {
String name();
diff --git a/server/src/main/java/org/opensearch/index/analysis/IndexAnalyzers.java b/server/src/main/java/org/opensearch/index/analysis/IndexAnalyzers.java
index 4d72ee48cf33a..fe06504c71333 100644
--- a/server/src/main/java/org/opensearch/index/analysis/IndexAnalyzers.java
+++ b/server/src/main/java/org/opensearch/index/analysis/IndexAnalyzers.java
@@ -31,6 +31,7 @@
package org.opensearch.index.analysis;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.io.IOUtils;
import java.io.Closeable;
@@ -52,8 +53,9 @@
*
* @see AnalysisRegistry
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class IndexAnalyzers implements Closeable {
private final Map analyzers;
private final Map normalizers;
diff --git a/server/src/main/java/org/opensearch/index/analysis/TokenFilterFactory.java b/server/src/main/java/org/opensearch/index/analysis/TokenFilterFactory.java
index 6708db8571b2a..af18927de8a98 100644
--- a/server/src/main/java/org/opensearch/index/analysis/TokenFilterFactory.java
+++ b/server/src/main/java/org/opensearch/index/analysis/TokenFilterFactory.java
@@ -34,6 +34,7 @@
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.search.fetch.subphase.highlight.FastVectorHighlighter;
import java.util.List;
@@ -42,8 +43,9 @@
/**
* Base token filter factory used in analysis chain
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface TokenFilterFactory {
String name();
diff --git a/server/src/main/java/org/opensearch/index/analysis/TokenizerFactory.java b/server/src/main/java/org/opensearch/index/analysis/TokenizerFactory.java
index b667175e89b4a..a1a9c4966865d 100644
--- a/server/src/main/java/org/opensearch/index/analysis/TokenizerFactory.java
+++ b/server/src/main/java/org/opensearch/index/analysis/TokenizerFactory.java
@@ -33,14 +33,16 @@
package org.opensearch.index.analysis;
import org.apache.lucene.analysis.Tokenizer;
+import org.opensearch.common.annotation.PublicApi;
import java.util.function.Supplier;
/**
* Base tokenizer factory used in analysis chain
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface TokenizerFactory {
String name();
diff --git a/server/src/main/java/org/opensearch/index/cache/IndexCache.java b/server/src/main/java/org/opensearch/index/cache/IndexCache.java
index 90462e9919970..1067863fe9675 100644
--- a/server/src/main/java/org/opensearch/index/cache/IndexCache.java
+++ b/server/src/main/java/org/opensearch/index/cache/IndexCache.java
@@ -32,6 +32,7 @@
package org.opensearch.index.cache;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.io.IOUtils;
import org.opensearch.index.AbstractIndexComponent;
import org.opensearch.index.IndexSettings;
@@ -44,8 +45,9 @@
/**
* Wrapping class for the index cache
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndexCache extends AbstractIndexComponent implements Closeable {
private final QueryCache queryCache;
diff --git a/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java b/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java
index bd9074f77c196..88d20bca7b6d4 100644
--- a/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java
+++ b/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java
@@ -48,6 +48,7 @@
import org.apache.lucene.util.BitDocIdSet;
import org.apache.lucene.util.BitSet;
import org.opensearch.ExceptionsHelper;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.cache.Cache;
import org.opensearch.common.cache.CacheBuilder;
import org.opensearch.common.cache.RemovalListener;
@@ -85,8 +86,9 @@
* and require that it should always be around should use this cache, otherwise the
* {@link org.opensearch.index.cache.query.QueryCache} should be used instead.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class BitsetFilterCache extends AbstractIndexComponent
implements
IndexReader.ClosedListener,
@@ -195,8 +197,9 @@ public void onRemoval(RemovalNotification wrapper;
private final AtomicBoolean released = new AtomicBoolean(false);
@@ -1421,8 +1431,9 @@ public final void close() {
/**
* The engine searcher
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static final class Searcher extends IndexSearcher implements Releasable {
private final String source;
private final Closeable onClose;
@@ -1480,8 +1491,9 @@ public abstract static class Operation {
/**
* type of operation (index, delete), subclasses use static types
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public enum TYPE {
INDEX,
DELETE,
@@ -1519,8 +1531,9 @@ public Operation(Term uid, long seqNo, long primaryTerm, long version, VersionTy
/**
* Origin of the operation
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public enum Origin {
PRIMARY,
REPLICA,
@@ -1578,8 +1591,9 @@ public long startTime() {
/**
* Index operation
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Index extends Operation {
private final ParsedDocument doc;
@@ -1696,8 +1710,9 @@ public long getIfPrimaryTerm() {
/**
* Delete operation
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Delete extends Operation {
private final String id;
@@ -1784,8 +1799,9 @@ public long getIfPrimaryTerm() {
/**
* noop operation
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class NoOp extends Operation {
private final String reason;
@@ -1834,8 +1850,9 @@ public int estimatedSizeInBytes() {
/**
* Get operation
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Get {
private final boolean realtime;
private final Term uid;
@@ -1910,8 +1927,9 @@ public long getIfPrimaryTerm() {
/**
* The Get result
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class GetResult implements Releasable {
private final boolean exists;
private final long version;
@@ -2033,8 +2051,9 @@ public long getLastWriteNanos() {
*
* @see EngineConfig#getWarmer()
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface Warmer {
/**
* Called once a new top-level reader is opened.
diff --git a/server/src/main/java/org/opensearch/index/engine/EngineConfig.java b/server/src/main/java/org/opensearch/index/engine/EngineConfig.java
index 00f8ff6d3cd40..af65e993fcf26 100644
--- a/server/src/main/java/org/opensearch/index/engine/EngineConfig.java
+++ b/server/src/main/java/org/opensearch/index/engine/EngineConfig.java
@@ -41,6 +41,7 @@
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.similarities.Similarity;
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.unit.MemorySizeValue;
@@ -75,8 +76,9 @@
* Once {@link Engine} has been created with this object, changes to this
* object will affect the {@link Engine} instance.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class EngineConfig {
private final ShardId shardId;
private final IndexSettings indexSettings;
@@ -512,8 +514,9 @@ public TranslogFactory getTranslogFactory() {
* A supplier supplies tombstone documents which will be used in soft-update methods.
* The returned document consists only _uid, _seqno, _term and _version fields; other metadata fields are excluded.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface TombstoneDocSupplier {
/**
* Creates a tombstone document for a delete operation.
diff --git a/server/src/main/java/org/opensearch/index/engine/EngineException.java b/server/src/main/java/org/opensearch/index/engine/EngineException.java
index 484bc6c7eea6a..7d039d8922a19 100644
--- a/server/src/main/java/org/opensearch/index/engine/EngineException.java
+++ b/server/src/main/java/org/opensearch/index/engine/EngineException.java
@@ -33,6 +33,7 @@
package org.opensearch.index.engine;
import org.opensearch.OpenSearchException;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.index.shard.ShardId;
@@ -41,8 +42,9 @@
/**
* Exception if there are any errors in the engine
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class EngineException extends OpenSearchException {
public EngineException(ShardId shardId, String msg, Object... params) {
diff --git a/server/src/main/java/org/opensearch/index/engine/EngineFactory.java b/server/src/main/java/org/opensearch/index/engine/EngineFactory.java
index ced02ab3041c9..4e7e69bd3dd53 100644
--- a/server/src/main/java/org/opensearch/index/engine/EngineFactory.java
+++ b/server/src/main/java/org/opensearch/index/engine/EngineFactory.java
@@ -31,12 +31,15 @@
package org.opensearch.index.engine;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* Simple Engine Factory
*
- * @opensearch.internal
+ * @opensearch.api
*/
@FunctionalInterface
+@PublicApi(since = "1.0.0")
public interface EngineFactory {
Engine newReadWriteEngine(EngineConfig config);
diff --git a/server/src/main/java/org/opensearch/index/engine/NRTReplicationEngine.java b/server/src/main/java/org/opensearch/index/engine/NRTReplicationEngine.java
index f9f0458f45ee8..3b55c4e648f1c 100644
--- a/server/src/main/java/org/opensearch/index/engine/NRTReplicationEngine.java
+++ b/server/src/main/java/org/opensearch/index/engine/NRTReplicationEngine.java
@@ -13,6 +13,7 @@
import org.apache.lucene.index.SegmentInfos;
import org.apache.lucene.index.SoftDeletesDirectoryReaderWrapper;
import org.apache.lucene.search.ReferenceManager;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.concurrent.GatedCloseable;
import org.opensearch.common.lucene.Lucene;
import org.opensearch.common.lucene.index.OpenSearchDirectoryReader;
@@ -51,8 +52,9 @@
* is enabled. This Engine does not create an IndexWriter, rather it refreshes a {@link NRTReplicationReaderManager}
* with new Segments when received from an external source.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class NRTReplicationEngine extends Engine {
private volatile SegmentInfos lastCommittedSegmentInfos;
diff --git a/server/src/main/java/org/opensearch/index/engine/SafeCommitInfo.java b/server/src/main/java/org/opensearch/index/engine/SafeCommitInfo.java
index fcf1cb186269c..4b54033dc6728 100644
--- a/server/src/main/java/org/opensearch/index/engine/SafeCommitInfo.java
+++ b/server/src/main/java/org/opensearch/index/engine/SafeCommitInfo.java
@@ -31,13 +31,15 @@
package org.opensearch.index.engine;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.index.seqno.SequenceNumbers;
/**
* Information about the safe commit, for making decisions about recoveries.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class SafeCommitInfo {
public final long localCheckpoint;
diff --git a/server/src/main/java/org/opensearch/index/fielddata/DocValueBits.java b/server/src/main/java/org/opensearch/index/fielddata/DocValueBits.java
index 18fa26bd10623..cf62688b88b65 100644
--- a/server/src/main/java/org/opensearch/index/fielddata/DocValueBits.java
+++ b/server/src/main/java/org/opensearch/index/fielddata/DocValueBits.java
@@ -32,13 +32,16 @@
package org.opensearch.index.fielddata;
+import org.opensearch.common.annotation.PublicApi;
+
import java.io.IOException;
/**
* Base class for doc value bit sets
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class DocValueBits {
/**
diff --git a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java
index 81d4ce2dd8772..6a79679cc2f09 100644
--- a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java
+++ b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java
@@ -48,6 +48,7 @@
import org.apache.lucene.util.BitSet;
import org.apache.lucene.util.BytesRef;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.BigArrays;
import org.opensearch.core.indices.breaker.CircuitBreakerService;
import org.opensearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested;
@@ -64,8 +65,9 @@
* Thread-safe utility class that allows to get per-segment values via the
* {@link #load(LeafReaderContext)} method.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface IndexFieldData {
/**
@@ -154,7 +156,10 @@ public void disableSkipping() {
* R will be in the parent filter and its children documents will be the
* documents that are contained in the inner set between the previous
* parent + 1, or 0 if there is no previous parent, and R (excluded).
+ *
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Nested {
private final BitSetProducer rootFilter;
@@ -293,8 +298,9 @@ public abstract BucketedSort newBucketedSort(
/**
* Base builder interface
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
interface Builder {
IndexFieldData> build(IndexFieldDataCache cache, CircuitBreakerService breakerService);
@@ -303,8 +309,9 @@ interface Builder {
/**
* Base Global field data class
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
interface Global extends IndexFieldData {
IndexFieldData loadGlobal(DirectoryReader indexReader);
diff --git a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java
index 72df2453fc7fd..5cdcc3f82879f 100644
--- a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java
+++ b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java
@@ -35,13 +35,15 @@
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.util.Accountable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.index.shard.ShardId;
/**
* A simple field data cache abstraction on the *index* level.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface IndexFieldDataCache {
> FD load(LeafReaderContext context, IFD indexFieldData) throws Exception;
@@ -62,8 +64,9 @@ > IFD load(Direc
/**
* The listener interface
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
interface Listener {
/**
diff --git a/server/src/main/java/org/opensearch/index/fielddata/LeafFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/LeafFieldData.java
index 2982363937710..da7179254d70f 100644
--- a/server/src/main/java/org/opensearch/index/fielddata/LeafFieldData.java
+++ b/server/src/main/java/org/opensearch/index/fielddata/LeafFieldData.java
@@ -33,6 +33,7 @@
package org.opensearch.index.fielddata;
import org.apache.lucene.util.Accountable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lease.Releasable;
import org.opensearch.index.mapper.DocValueFetcher;
import org.opensearch.search.DocValueFormat;
@@ -42,8 +43,9 @@
/**
* The thread safe {@link org.apache.lucene.index.LeafReader} level cache of the data.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface LeafFieldData extends Accountable, Releasable {
/**
diff --git a/server/src/main/java/org/opensearch/index/fielddata/NumericDoubleValues.java b/server/src/main/java/org/opensearch/index/fielddata/NumericDoubleValues.java
index 94ea91849ff12..b0f3400acfb3d 100644
--- a/server/src/main/java/org/opensearch/index/fielddata/NumericDoubleValues.java
+++ b/server/src/main/java/org/opensearch/index/fielddata/NumericDoubleValues.java
@@ -34,14 +34,16 @@
import org.apache.lucene.index.NumericDocValues;
import org.apache.lucene.search.DoubleValues;
+import org.opensearch.common.annotation.PublicApi;
import java.io.IOException;
/**
* A per-document numeric value.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class NumericDoubleValues extends DoubleValues {
/** Sole constructor. (For invocation by subclass
diff --git a/server/src/main/java/org/opensearch/index/fielddata/ShardFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/ShardFieldData.java
index 87da81a0b3443..d8f49ba3d9c60 100644
--- a/server/src/main/java/org/opensearch/index/fielddata/ShardFieldData.java
+++ b/server/src/main/java/org/opensearch/index/fielddata/ShardFieldData.java
@@ -34,6 +34,7 @@
import org.apache.lucene.util.Accountable;
import org.opensearch.common.FieldMemoryStats;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.metrics.CounterMetric;
import org.opensearch.common.regex.Regex;
import org.opensearch.common.util.concurrent.ConcurrentCollections;
@@ -47,8 +48,9 @@
/**
* On heap field data for shards
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class ShardFieldData implements IndexFieldDataCache.Listener {
private final CounterMetric evictionsMetric = new CounterMetric();
diff --git a/server/src/main/java/org/opensearch/index/fielddata/SortedNumericDoubleValues.java b/server/src/main/java/org/opensearch/index/fielddata/SortedNumericDoubleValues.java
index 91d28113ae783..dce1aff9cc94f 100644
--- a/server/src/main/java/org/opensearch/index/fielddata/SortedNumericDoubleValues.java
+++ b/server/src/main/java/org/opensearch/index/fielddata/SortedNumericDoubleValues.java
@@ -33,14 +33,16 @@
package org.opensearch.index.fielddata;
import org.apache.lucene.index.SortedNumericDocValues;
+import org.opensearch.common.annotation.PublicApi;
import java.io.IOException;
/**
* Clone of {@link SortedNumericDocValues} for double values.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class SortedNumericDoubleValues {
/** Sole constructor. (For invocation by subclass
diff --git a/server/src/main/java/org/opensearch/index/get/ShardGetService.java b/server/src/main/java/org/opensearch/index/get/ShardGetService.java
index 546497a2e0d19..831bb8aff3be3 100644
--- a/server/src/main/java/org/opensearch/index/get/ShardGetService.java
+++ b/server/src/main/java/org/opensearch/index/get/ShardGetService.java
@@ -43,6 +43,7 @@
import org.apache.lucene.index.VectorSimilarityFunction;
import org.opensearch.OpenSearchException;
import org.opensearch.common.Nullable;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.collect.Tuple;
import org.opensearch.common.document.DocumentField;
import org.opensearch.common.lucene.uid.Versions;
@@ -88,8 +89,9 @@
/**
* Gets an index shard
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class ShardGetService extends AbstractIndexShardComponent {
private final MapperService mapperService;
private final MeanMetric existsMetric = new MeanMetric();
diff --git a/server/src/main/java/org/opensearch/index/mapper/ContentPath.java b/server/src/main/java/org/opensearch/index/mapper/ContentPath.java
index 8b0d5e24056d3..63e5731e2681b 100644
--- a/server/src/main/java/org/opensearch/index/mapper/ContentPath.java
+++ b/server/src/main/java/org/opensearch/index/mapper/ContentPath.java
@@ -32,11 +32,14 @@
package org.opensearch.index.mapper;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* JSON Path for a document / field
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class ContentPath {
private static final char DELIMITER = '.';
diff --git a/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java b/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java
index bf14af809fbfd..827792cdb1091 100644
--- a/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java
+++ b/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java
@@ -33,6 +33,7 @@
package org.opensearch.index.mapper;
import org.apache.lucene.index.LeafReaderContext;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.index.fielddata.IndexFieldData;
import org.opensearch.search.DocValueFormat;
import org.opensearch.search.lookup.SourceLookup;
@@ -77,8 +78,9 @@ public List
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface IndexEventListener {
/**
diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java
index cf42c6749fc79..f1873ac659400 100644
--- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java
+++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java
@@ -78,6 +78,7 @@
import org.opensearch.common.CheckedRunnable;
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.common.concurrent.GatedCloseable;
import org.opensearch.common.io.stream.BytesStreamOutput;
@@ -239,8 +240,9 @@
/**
* An OpenSearch index shard
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndexShard extends AbstractIndexShardComponent implements IndicesClusterStateService.Shard {
private final ThreadPool threadPool;
@@ -4403,8 +4405,9 @@ private RefreshListeners buildRefreshListeners() {
*
* @see IndexShard#addShardFailureCallback(Consumer)
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static final class ShardFailure {
public final ShardRouting routing;
public final String reason;
diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardClosedException.java b/server/src/main/java/org/opensearch/index/shard/IndexShardClosedException.java
index 8b4c9a188e00c..8cc8f0356b775 100644
--- a/server/src/main/java/org/opensearch/index/shard/IndexShardClosedException.java
+++ b/server/src/main/java/org/opensearch/index/shard/IndexShardClosedException.java
@@ -32,6 +32,7 @@
package org.opensearch.index.shard;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.index.shard.ShardId;
@@ -40,8 +41,9 @@
/**
* Exception thrown if trying to operate on a closed Index Shard
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndexShardClosedException extends IllegalIndexShardStateException {
public IndexShardClosedException(ShardId shardId) {
super(shardId, IndexShardState.CLOSED, "Closed");
diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardNotRecoveringException.java b/server/src/main/java/org/opensearch/index/shard/IndexShardNotRecoveringException.java
index 75af4ef53e638..d996464f25723 100644
--- a/server/src/main/java/org/opensearch/index/shard/IndexShardNotRecoveringException.java
+++ b/server/src/main/java/org/opensearch/index/shard/IndexShardNotRecoveringException.java
@@ -32,6 +32,7 @@
package org.opensearch.index.shard;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.index.shard.ShardId;
@@ -40,8 +41,9 @@
/**
* Exception thrown if an index shard is not recovering
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndexShardNotRecoveringException extends IllegalIndexShardStateException {
public IndexShardNotRecoveringException(ShardId shardId, IndexShardState currentState) {
diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardNotStartedException.java b/server/src/main/java/org/opensearch/index/shard/IndexShardNotStartedException.java
index 7f37ae2a00873..0371e57bfc282 100644
--- a/server/src/main/java/org/opensearch/index/shard/IndexShardNotStartedException.java
+++ b/server/src/main/java/org/opensearch/index/shard/IndexShardNotStartedException.java
@@ -32,6 +32,7 @@
package org.opensearch.index.shard;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.index.shard.ShardId;
@@ -40,8 +41,9 @@
/**
* Exception thrown when trying to operate on an Index Shard that hasn't been started
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndexShardNotStartedException extends IllegalIndexShardStateException {
public IndexShardNotStartedException(ShardId shardId, IndexShardState currentState) {
diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardRecoveringException.java b/server/src/main/java/org/opensearch/index/shard/IndexShardRecoveringException.java
index 9372ff222d6f0..eb145803d25ec 100644
--- a/server/src/main/java/org/opensearch/index/shard/IndexShardRecoveringException.java
+++ b/server/src/main/java/org/opensearch/index/shard/IndexShardRecoveringException.java
@@ -32,6 +32,7 @@
package org.opensearch.index.shard;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.index.shard.ShardId;
@@ -40,8 +41,9 @@
/**
* Exception thrown when there is an error recovering an Index Shard
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndexShardRecoveringException extends IllegalIndexShardStateException {
public IndexShardRecoveringException(ShardId shardId) {
diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardRelocatedException.java b/server/src/main/java/org/opensearch/index/shard/IndexShardRelocatedException.java
index 5176b23edcf82..be77a295d7bfc 100644
--- a/server/src/main/java/org/opensearch/index/shard/IndexShardRelocatedException.java
+++ b/server/src/main/java/org/opensearch/index/shard/IndexShardRelocatedException.java
@@ -32,6 +32,7 @@
package org.opensearch.index.shard;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.index.shard.ShardId;
@@ -40,8 +41,9 @@
/**
* Exception thrown if there is an error relocating an index shard
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndexShardRelocatedException extends IllegalIndexShardStateException {
public IndexShardRelocatedException(ShardId shardId) {
diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardStartedException.java b/server/src/main/java/org/opensearch/index/shard/IndexShardStartedException.java
index a724952e37707..f2f3554f6ef12 100644
--- a/server/src/main/java/org/opensearch/index/shard/IndexShardStartedException.java
+++ b/server/src/main/java/org/opensearch/index/shard/IndexShardStartedException.java
@@ -32,6 +32,7 @@
package org.opensearch.index.shard;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.index.shard.ShardId;
@@ -40,8 +41,9 @@
/**
* Exception thrown if there is an error starting an index shard
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class IndexShardStartedException extends IllegalIndexShardStateException {
public IndexShardStartedException(ShardId shardId) {
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/IndexingOperationListener.java b/server/src/main/java/org/opensearch/index/shard/IndexingOperationListener.java
index ccc4cd336cff7..edce676b7c81e 100644
--- a/server/src/main/java/org/opensearch/index/shard/IndexingOperationListener.java
+++ b/server/src/main/java/org/opensearch/index/shard/IndexingOperationListener.java
@@ -33,6 +33,7 @@
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessage;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.index.shard.ShardId;
import org.opensearch.index.engine.Engine;
@@ -41,8 +42,9 @@
/**
* An indexing listener for indexing, delete, events.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface IndexingOperationListener {
/**
diff --git a/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java b/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java
index 875eda5473806..af8220db25fcb 100644
--- a/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java
+++ b/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java
@@ -38,6 +38,7 @@
import org.opensearch.action.resync.ResyncReplicationRequest;
import org.opensearch.action.resync.ResyncReplicationResponse;
import org.opensearch.action.resync.TransportResyncReplicationAction;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.inject.Inject;
import org.opensearch.common.util.concurrent.AbstractRunnable;
import org.opensearch.common.util.io.IOUtils;
@@ -398,8 +399,9 @@ public ActionRequestValidationException validate() {
/**
* Task to resync primary and replica
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class ResyncTask extends Task {
private volatile String phase = "starting";
private volatile int totalOperations;
@@ -465,8 +467,9 @@ public ResyncTask.Status getStatus() {
/**
* Status for primary replica syncer
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Status implements Task.Status {
public static final String NAME = "resync";
diff --git a/server/src/main/java/org/opensearch/index/shard/ReplicationGroup.java b/server/src/main/java/org/opensearch/index/shard/ReplicationGroup.java
index 6d19e9f500411..f585267f21832 100644
--- a/server/src/main/java/org/opensearch/index/shard/ReplicationGroup.java
+++ b/server/src/main/java/org/opensearch/index/shard/ReplicationGroup.java
@@ -34,6 +34,7 @@
import org.opensearch.cluster.routing.IndexShardRoutingTable;
import org.opensearch.cluster.routing.ShardRouting;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.set.Sets;
import java.util.ArrayList;
@@ -43,8 +44,9 @@
/**
* Replication group for a shard. Used by a primary shard to coordinate replication and recoveries.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class ReplicationGroup {
private final IndexShardRoutingTable routingTable;
private final Set inSyncAllocationIds;
diff --git a/server/src/main/java/org/opensearch/index/shard/SearchOperationListener.java b/server/src/main/java/org/opensearch/index/shard/SearchOperationListener.java
index e9206731058db..849a4f9c15318 100644
--- a/server/src/main/java/org/opensearch/index/shard/SearchOperationListener.java
+++ b/server/src/main/java/org/opensearch/index/shard/SearchOperationListener.java
@@ -34,6 +34,7 @@
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessage;
import org.opensearch.ExceptionsHelper;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.search.internal.ReaderContext;
import org.opensearch.search.internal.SearchContext;
import org.opensearch.transport.TransportRequest;
@@ -43,8 +44,9 @@
/**
* An listener for search, fetch and context events.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public interface SearchOperationListener {
/**
diff --git a/server/src/main/java/org/opensearch/index/shard/ShardPath.java b/server/src/main/java/org/opensearch/index/shard/ShardPath.java
index b7bb4283eca32..d16e5707b2e0e 100644
--- a/server/src/main/java/org/opensearch/index/shard/ShardPath.java
+++ b/server/src/main/java/org/opensearch/index/shard/ShardPath.java
@@ -34,6 +34,7 @@
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.util.Strings;
import org.opensearch.cluster.metadata.IndexMetadata;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.io.IOUtils;
import org.opensearch.core.index.shard.ShardId;
import org.opensearch.core.xcontent.NamedXContentRegistry;
@@ -54,8 +55,9 @@
/**
* Path for a shard
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class ShardPath {
public static final String INDEX_FOLDER_NAME = "index";
public static final String TRANSLOG_FOLDER_NAME = "translog";
diff --git a/server/src/main/java/org/opensearch/index/similarity/SimilarityProvider.java b/server/src/main/java/org/opensearch/index/similarity/SimilarityProvider.java
index 085e93c794fb7..33065dc1739a3 100644
--- a/server/src/main/java/org/opensearch/index/similarity/SimilarityProvider.java
+++ b/server/src/main/java/org/opensearch/index/similarity/SimilarityProvider.java
@@ -33,14 +33,16 @@
package org.opensearch.index.similarity;
import org.apache.lucene.search.similarities.Similarity;
+import org.opensearch.common.annotation.PublicApi;
import java.util.Objects;
/**
* Wrapper around a {@link Similarity} and its name.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class SimilarityProvider {
private final String name;
diff --git a/server/src/main/java/org/opensearch/index/similarity/SimilarityService.java b/server/src/main/java/org/opensearch/index/similarity/SimilarityService.java
index c3fc7ffbb0fe5..6b4566826cedc 100644
--- a/server/src/main/java/org/opensearch/index/similarity/SimilarityService.java
+++ b/server/src/main/java/org/opensearch/index/similarity/SimilarityService.java
@@ -45,6 +45,7 @@
import org.apache.lucene.util.BytesRef;
import org.opensearch.Version;
import org.opensearch.common.TriFunction;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.logging.DeprecationLogger;
import org.opensearch.common.settings.Settings;
import org.opensearch.index.AbstractIndexComponent;
@@ -63,8 +64,9 @@
/**
* Service for similarity computations
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class SimilarityService extends AbstractIndexComponent {
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(SimilarityService.class);
public static final String DEFAULT_SIMILARITY = "BM25";
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/snapshots/blobstore/RemoteStoreShardShallowCopySnapshot.java b/server/src/main/java/org/opensearch/index/snapshots/blobstore/RemoteStoreShardShallowCopySnapshot.java
index aa5d90cc65803..d54e9686ab951 100644
--- a/server/src/main/java/org/opensearch/index/snapshots/blobstore/RemoteStoreShardShallowCopySnapshot.java
+++ b/server/src/main/java/org/opensearch/index/snapshots/blobstore/RemoteStoreShardShallowCopySnapshot.java
@@ -9,6 +9,7 @@
package org.opensearch.index.snapshots.blobstore;
import org.opensearch.OpenSearchParseException;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.ParseField;
import org.opensearch.core.xcontent.ToXContentFragment;
import org.opensearch.core.xcontent.XContentBuilder;
@@ -22,8 +23,9 @@
/**
* Remote Store based Shard snapshot metadata
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "2.9.0")
public class RemoteStoreShardShallowCopySnapshot implements ToXContentFragment, IndexShardSnapshot {
private final String snapshot;
diff --git a/server/src/main/java/org/opensearch/index/stats/IndexingPressurePerShardStats.java b/server/src/main/java/org/opensearch/index/stats/IndexingPressurePerShardStats.java
index d69ae02fa8e34..21e1105422725 100644
--- a/server/src/main/java/org/opensearch/index/stats/IndexingPressurePerShardStats.java
+++ b/server/src/main/java/org/opensearch/index/stats/IndexingPressurePerShardStats.java
@@ -8,6 +8,7 @@
package org.opensearch.index.stats;
+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;
@@ -22,8 +23,9 @@
/**
* Per shard indexing pressure statistics
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.3.0")
public class IndexingPressurePerShardStats implements Writeable, ToXContentFragment {
private final String shardId;
diff --git a/server/src/main/java/org/opensearch/index/stats/IndexingPressureStats.java b/server/src/main/java/org/opensearch/index/stats/IndexingPressureStats.java
index dcdea8adbbcde..53442a7a04adf 100644
--- a/server/src/main/java/org/opensearch/index/stats/IndexingPressureStats.java
+++ b/server/src/main/java/org/opensearch/index/stats/IndexingPressureStats.java
@@ -32,6 +32,7 @@
package org.opensearch.index.stats;
+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;
@@ -44,8 +45,9 @@
/**
* Base indexing pressure statistics
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.3.0")
public class IndexingPressureStats implements Writeable, ToXContentFragment {
private final long totalCombinedCoordinatingAndPrimaryBytes;
diff --git a/server/src/main/java/org/opensearch/index/stats/ShardIndexingPressureStats.java b/server/src/main/java/org/opensearch/index/stats/ShardIndexingPressureStats.java
index b7071d883bb4c..0b8cd75a24ded 100644
--- a/server/src/main/java/org/opensearch/index/stats/ShardIndexingPressureStats.java
+++ b/server/src/main/java/org/opensearch/index/stats/ShardIndexingPressureStats.java
@@ -8,6 +8,7 @@
package org.opensearch.index.stats;
+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;
@@ -23,8 +24,9 @@
/**
* Cumulative shard indexing pressure stats
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.3.0")
public class ShardIndexingPressureStats implements Writeable, ToXContentFragment {
private final Map shardIndexingPressureStore;
diff --git a/server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectory.java b/server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectory.java
index 988d52202f975..c7d0d5713925f 100644
--- a/server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectory.java
+++ b/server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectory.java
@@ -24,6 +24,7 @@
import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.Version;
import org.opensearch.common.UUIDs;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.collect.Tuple;
import org.opensearch.common.io.VersionedCodecStreamWrapper;
import org.opensearch.common.logging.Loggers;
@@ -67,8 +68,9 @@
* remote segment store also keeps track of refresh checkpoints as metadata in a separate path which is handled by
* another instance of {@code RemoteDirectory}.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "2.3.0")
public final class RemoteSegmentStoreDirectory extends FilterDirectory implements RemoteStoreCommitLevelLockManager {
/**
@@ -216,7 +218,10 @@ private RemoteSegmentMetadata readMetadataFile(String metadataFilename) throws I
/**
* Metadata of a segment that is uploaded to remote segment store.
+ *
+ * @opensearch.api
*/
+ @PublicApi(since = "2.3.0")
public static class UploadedSegmentMetadata {
// Visible for testing
static final String SEPARATOR = "::";
diff --git a/server/src/main/java/org/opensearch/index/store/RemoteStoreFileDownloader.java b/server/src/main/java/org/opensearch/index/store/RemoteStoreFileDownloader.java
index 727c57afd289b..134994c0ae32c 100644
--- a/server/src/main/java/org/opensearch/index/store/RemoteStoreFileDownloader.java
+++ b/server/src/main/java/org/opensearch/index/store/RemoteStoreFileDownloader.java
@@ -14,7 +14,7 @@
import org.opensearch.action.support.GroupedActionListener;
import org.opensearch.action.support.PlainActionFuture;
import org.opensearch.common.Nullable;
-import org.opensearch.common.annotation.InternalApi;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.logging.Loggers;
import org.opensearch.common.util.CancellableThreads;
import org.opensearch.core.action.ActionListener;
@@ -32,8 +32,10 @@
* Helper class to downloads files from a {@link RemoteSegmentStoreDirectory}
* instance to a local {@link Directory} instance in parallel depending on thread
* pool size and recovery settings.
+ *
+ * @opensearch.api
*/
-@InternalApi
+@PublicApi(since = "2.11.0")
public final class RemoteStoreFileDownloader {
private final Logger logger;
private final ThreadPool threadPool;
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..1930a37daa400 100644
--- a/server/src/main/java/org/opensearch/index/store/Store.java
+++ b/server/src/main/java/org/opensearch/index/store/Store.java
@@ -66,7 +66,7 @@
import org.apache.lucene.util.Version;
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 +145,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
@@ -224,7 +225,6 @@ public Directory directory() {
return directory;
}
- @InternalApi
public ShardPath shardPath() {
return shardPath;
}
@@ -1022,8 +1022,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 +1430,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/lockmanager/LockInfo.java b/server/src/main/java/org/opensearch/index/store/lockmanager/LockInfo.java
index 1470969540d36..6aab518808a3f 100644
--- a/server/src/main/java/org/opensearch/index/store/lockmanager/LockInfo.java
+++ b/server/src/main/java/org/opensearch/index/store/lockmanager/LockInfo.java
@@ -8,11 +8,15 @@
package org.opensearch.index.store.lockmanager;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* An Interface that defines Remote Store Lock Information.
* Individual Implemented Classes of this interface can decide how the lock should look like and its contents.
- * @opensearch.internal
+ *
+ * @opensearch.api
*/
+@PublicApi(since = "2.8.0")
public interface LockInfo {
/**
* A function which generates the lock name on the basis of given information.
diff --git a/server/src/main/java/org/opensearch/index/store/lockmanager/RemoteStoreLockManager.java b/server/src/main/java/org/opensearch/index/store/lockmanager/RemoteStoreLockManager.java
index 9eb066d9e955e..4fa23dfe9dc3a 100644
--- a/server/src/main/java/org/opensearch/index/store/lockmanager/RemoteStoreLockManager.java
+++ b/server/src/main/java/org/opensearch/index/store/lockmanager/RemoteStoreLockManager.java
@@ -8,14 +8,18 @@
package org.opensearch.index.store.lockmanager;
+import org.opensearch.common.annotation.PublicApi;
+
import java.io.IOException;
/**
* An Interface that defines Remote Store Lock Manager.
* This will provide the functionality to acquire lock, release lock or to check if a lock is acquired on a specific
* file in remote store.
- * @opensearch.internal
+ *
+ * @opensearch.api
*/
+@PublicApi(since = "2.8.0")
public interface RemoteStoreLockManager {
/**
*
diff --git a/server/src/main/java/org/opensearch/index/store/lockmanager/RemoteStoreLockManagerFactory.java b/server/src/main/java/org/opensearch/index/store/lockmanager/RemoteStoreLockManagerFactory.java
index 1a306f3261094..00666ada11983 100644
--- a/server/src/main/java/org/opensearch/index/store/lockmanager/RemoteStoreLockManagerFactory.java
+++ b/server/src/main/java/org/opensearch/index/store/lockmanager/RemoteStoreLockManagerFactory.java
@@ -8,6 +8,7 @@
package org.opensearch.index.store.lockmanager;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.blobstore.BlobContainer;
import org.opensearch.common.blobstore.BlobPath;
import org.opensearch.index.store.RemoteBufferedOutputDirectory;
@@ -22,8 +23,9 @@
/**
* Factory for remote store lock manager
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "2.8.0")
public class RemoteStoreLockManagerFactory {
private static final String SEGMENTS = "segments";
private static final String LOCK_FILES = "lock_files";
diff --git a/server/src/main/java/org/opensearch/index/store/lockmanager/RemoteStoreMetadataLockManager.java b/server/src/main/java/org/opensearch/index/store/lockmanager/RemoteStoreMetadataLockManager.java
index 756905d02229a..5ebd00f59ef49 100644
--- a/server/src/main/java/org/opensearch/index/store/lockmanager/RemoteStoreMetadataLockManager.java
+++ b/server/src/main/java/org/opensearch/index/store/lockmanager/RemoteStoreMetadataLockManager.java
@@ -12,6 +12,7 @@
import org.apache.logging.log4j.Logger;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexOutput;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.index.store.RemoteBufferedOutputDirectory;
import java.io.FileNotFoundException;
@@ -28,8 +29,9 @@
* It uses {@code LockFileInfo} instance to get the information about the lock file on which operations need to
* be executed.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "2.8.0")
public class RemoteStoreMetadataLockManager implements RemoteStoreLockManager {
private static final Logger logger = LogManager.getLogger(RemoteStoreMetadataLockManager.class);
private final RemoteBufferedOutputDirectory lockDirectory;
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/metadata/RemoteSegmentMetadata.java b/server/src/main/java/org/opensearch/index/store/remote/metadata/RemoteSegmentMetadata.java
index 1cec20ec3f6cc..41a145273e8ef 100644
--- a/server/src/main/java/org/opensearch/index/store/remote/metadata/RemoteSegmentMetadata.java
+++ b/server/src/main/java/org/opensearch/index/store/remote/metadata/RemoteSegmentMetadata.java
@@ -11,6 +11,7 @@
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.Version;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.index.Index;
import org.opensearch.core.index.shard.ShardId;
import org.opensearch.index.store.RemoteSegmentStoreDirectory;
@@ -25,8 +26,9 @@
/**
* Metadata object for Remote Segment
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "2.6.0")
public class RemoteSegmentMetadata {
/**
* Latest supported version of metadata
diff --git a/server/src/main/java/org/opensearch/index/store/remote/utils/cache/CacheUsage.java b/server/src/main/java/org/opensearch/index/store/remote/utils/cache/CacheUsage.java
index 1cb9242926046..0b5480d3ca978 100644
--- a/server/src/main/java/org/opensearch/index/store/remote/utils/cache/CacheUsage.java
+++ b/server/src/main/java/org/opensearch/index/store/remote/utils/cache/CacheUsage.java
@@ -8,11 +8,14 @@
package org.opensearch.index.store.remote.utils.cache;
+import org.opensearch.common.annotation.PublicApi;
+
/**
* Usage metrics for {@link RefCountedCache}
*
* @opensearch.internal
*/
+@PublicApi(since = "2.7.0")
public class CacheUsage {
/**
* Cache usage of the system
diff --git a/server/src/main/java/org/opensearch/index/store/remote/utils/cache/stats/CacheStats.java b/server/src/main/java/org/opensearch/index/store/remote/utils/cache/stats/CacheStats.java
index f0a7154effb1d..55893752669a8 100644
--- a/server/src/main/java/org/opensearch/index/store/remote/utils/cache/stats/CacheStats.java
+++ b/server/src/main/java/org/opensearch/index/store/remote/utils/cache/stats/CacheStats.java
@@ -8,6 +8,7 @@
package org.opensearch.index.store.remote.utils.cache.stats;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.index.store.remote.utils.cache.RefCountedCache;
import java.util.Objects;
@@ -15,8 +16,9 @@
/**
* Statistics about the performance of a {@link RefCountedCache}.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "2.7.0")
public final class CacheStats {
private final long hitCount;
private final long missCount;
diff --git a/server/src/main/java/org/opensearch/index/translog/BaseTranslogReader.java b/server/src/main/java/org/opensearch/index/translog/BaseTranslogReader.java
index ea817c4b0932a..d6fa2a2e53de3 100644
--- a/server/src/main/java/org/opensearch/index/translog/BaseTranslogReader.java
+++ b/server/src/main/java/org/opensearch/index/translog/BaseTranslogReader.java
@@ -108,7 +108,7 @@ protected final int readSize(ByteBuffer reusableBuffer, long position) throws IO
return size;
}
- public TranslogSnapshot newSnapshot() {
+ TranslogSnapshot newSnapshot() {
return new TranslogSnapshot(this, sizeInBytes());
}
diff --git a/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamOutput.java b/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamOutput.java
index eaf9ac0893f1b..9e96664c79cc5 100644
--- a/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamOutput.java
+++ b/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamOutput.java
@@ -33,6 +33,7 @@
package org.opensearch.index.translog;
import org.apache.lucene.store.BufferedChecksum;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamOutput;
import java.io.IOException;
@@ -43,8 +44,9 @@
* Similar to Lucene's BufferedChecksumIndexOutput, however this wraps a
* {@link StreamOutput} so anything written will update the checksum
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class BufferedChecksumStreamOutput extends StreamOutput {
private final StreamOutput out;
private final Checksum digest;
diff --git a/server/src/main/java/org/opensearch/index/translog/ChannelFactory.java b/server/src/main/java/org/opensearch/index/translog/ChannelFactory.java
index f86b9dea0a5f7..4fba85b9d224d 100644
--- a/server/src/main/java/org/opensearch/index/translog/ChannelFactory.java
+++ b/server/src/main/java/org/opensearch/index/translog/ChannelFactory.java
@@ -31,6 +31,8 @@
package org.opensearch.index.translog;
+import org.opensearch.common.annotation.PublicApi;
+
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.file.OpenOption;
@@ -40,9 +42,10 @@
/**
* only for testing until we have a disk-full FileSystem
*
- * @opensearch.internal
+ * @opensearch.api
*/
@FunctionalInterface
+@PublicApi(since = "1.0.0")
public interface ChannelFactory {
default FileChannel open(Path path) throws IOException {
return open(path, StandardOpenOption.WRITE, StandardOpenOption.READ, StandardOpenOption.CREATE_NEW);
diff --git a/server/src/main/java/org/opensearch/index/translog/Checkpoint.java b/server/src/main/java/org/opensearch/index/translog/Checkpoint.java
index a9f905f52bc3a..d309564ef5d32 100644
--- a/server/src/main/java/org/opensearch/index/translog/Checkpoint.java
+++ b/server/src/main/java/org/opensearch/index/translog/Checkpoint.java
@@ -44,6 +44,7 @@
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.NIOFSDirectory;
import org.apache.lucene.store.OutputStreamIndexOutput;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.io.Channels;
import org.opensearch.index.seqno.SequenceNumbers;
@@ -57,9 +58,10 @@
/**
* A checkpoint for OpenSearch operations
*
- * @opensearch.internal
+ * @opensearch.api
*/
-final public class Checkpoint {
+@PublicApi(since = "1.0.0")
+public final class Checkpoint {
final long offset;
final int numOps;
diff --git a/server/src/main/java/org/opensearch/index/translog/TragicExceptionHolder.java b/server/src/main/java/org/opensearch/index/translog/TragicExceptionHolder.java
index 818d840cb11fd..023e277edfd6c 100644
--- a/server/src/main/java/org/opensearch/index/translog/TragicExceptionHolder.java
+++ b/server/src/main/java/org/opensearch/index/translog/TragicExceptionHolder.java
@@ -34,14 +34,16 @@
import org.apache.lucene.store.AlreadyClosedException;
import org.opensearch.ExceptionsHelper;
+import org.opensearch.common.annotation.PublicApi;
import java.util.concurrent.atomic.AtomicReference;
/**
* Exception thrown if there are any massive OpenSearch failures
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public class TragicExceptionHolder {
private final AtomicReference tragedy = new AtomicReference<>();
diff --git a/server/src/main/java/org/opensearch/index/translog/Translog.java b/server/src/main/java/org/opensearch/index/translog/Translog.java
index 9f80bc38a8222..8b4662238ed25 100644
--- a/server/src/main/java/org/opensearch/index/translog/Translog.java
+++ b/server/src/main/java/org/opensearch/index/translog/Translog.java
@@ -111,8 +111,9 @@
* operation etc. are still preserved.
*
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class Translog extends AbstractIndexShardComponent implements IndexShardComponent, Closeable {
/*
@@ -895,8 +896,9 @@ public TranslogDeletionPolicy getDeletionPolicy() {
/**
* Location in the translot
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Location implements Comparable {
public final long generation;
@@ -954,8 +956,9 @@ public int hashCode() {
/**
* A snapshot of the transaction log, allows to iterate over all the transaction log operations.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface Snapshot extends Closeable {
/**
@@ -1040,14 +1043,16 @@ public void close() throws IOException {
* A generic interface representing an operation performed on the transaction log.
* Each is associated with a type.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public interface Operation {
/**
* The type of operation
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
enum Type {
@Deprecated
CREATE((byte) 1),
@@ -1138,8 +1143,9 @@ static void writeOperation(final StreamOutput output, final Operation operation)
/**
* The source in the translog
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static class Source {
public final BytesReference source;
@@ -1835,8 +1841,9 @@ void closeFilesIfNoPendingRetentionLocks() throws IOException {
/**
* References a transaction log generation
*
- * @opensearch.internal
+ * @opensearch.api
*/
+ @PublicApi(since = "1.0.0")
public static final class TranslogGeneration {
public final String translogUUID;
public final long translogFileGeneration;
diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogConfig.java b/server/src/main/java/org/opensearch/index/translog/TranslogConfig.java
index 6e75ebd847b5e..2f00773075d41 100644
--- a/server/src/main/java/org/opensearch/index/translog/TranslogConfig.java
+++ b/server/src/main/java/org/opensearch/index/translog/TranslogConfig.java
@@ -32,6 +32,7 @@
package org.opensearch.index.translog;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.util.BigArrays;
import org.opensearch.core.common.unit.ByteSizeUnit;
import org.opensearch.core.common.unit.ByteSizeValue;
@@ -45,8 +46,9 @@
* Once {@link Translog} has been created with this object, changes to this
* object will affect the {@link Translog} instance.
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public final class TranslogConfig {
public static final ByteSizeValue DEFAULT_BUFFER_SIZE = new ByteSizeValue(1, ByteSizeUnit.MB);
diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java b/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java
index 99784b77c61f5..972b19a029a8b 100644
--- a/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java
+++ b/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java
@@ -33,6 +33,7 @@
package org.opensearch.index.translog;
import org.apache.lucene.util.Counter;
+import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lease.Releasable;
import org.opensearch.core.Assertions;
import org.opensearch.index.seqno.SequenceNumbers;
@@ -47,8 +48,9 @@
/**
* Defines a translog deletion policy
*
- * @opensearch.internal
+ * @opensearch.api
*/
+@PublicApi(since = "1.0.0")
public abstract class TranslogDeletionPolicy {
private final Map