From ec326aef02922bfd5ed87c767bec5632f21cc8d5 Mon Sep 17 00:00:00 2001 From: Nicholas Walter Knize Date: Mon, 14 Aug 2023 10:40:43 -0500 Subject: [PATCH] update with initial annotations Signed-off-by: Nicholas Walter Knize --- .../src/main/java/org/opensearch/compress/ZstdCompressor.java | 2 ++ .../main/java/org/opensearch/core/compress/Compressor.java | 4 ++++ .../java/org/opensearch/core/compress/CompressorRegistry.java | 3 +++ .../java/org/opensearch/core/compress/NoneCompressor.java | 2 ++ .../org/opensearch/core/compress/spi/CompressorProvider.java | 4 ++++ .../org/opensearch/common/compress/DeflateCompressor.java | 2 ++ 6 files changed, 17 insertions(+) diff --git a/libs/compress/src/main/java/org/opensearch/compress/ZstdCompressor.java b/libs/compress/src/main/java/org/opensearch/compress/ZstdCompressor.java index 55e2b37de383c..e9d09f21f7ace 100644 --- a/libs/compress/src/main/java/org/opensearch/compress/ZstdCompressor.java +++ b/libs/compress/src/main/java/org/opensearch/compress/ZstdCompressor.java @@ -11,6 +11,7 @@ import com.github.luben.zstd.RecyclingBufferPool; import com.github.luben.zstd.ZstdInputStreamNoFinalizer; import com.github.luben.zstd.ZstdOutputStreamNoFinalizer; +import org.opensearch.common.annotation.PublicApi; import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.compress.Compressor; @@ -39,6 +40,7 @@ public class ZstdCompressor implements Compressor { * * @opensearch.api - requires BWC support */ + @PublicApi(since = "2.10.0") public static final String NAME = "ZSTD"; private static final int LEVEL = 3; diff --git a/libs/core/src/main/java/org/opensearch/core/compress/Compressor.java b/libs/core/src/main/java/org/opensearch/core/compress/Compressor.java index 9eb3937f9b239..27d5b5dfdfa15 100644 --- a/libs/core/src/main/java/org/opensearch/core/compress/Compressor.java +++ b/libs/core/src/main/java/org/opensearch/core/compress/Compressor.java @@ -32,6 +32,8 @@ package org.opensearch.core.compress; +import org.opensearch.common.annotation.ExperimentalApi; +import org.opensearch.common.annotation.PublicApi; import org.opensearch.core.common.bytes.BytesReference; import java.io.IOException; @@ -49,6 +51,8 @@ * @opensearch.api - intended to be extended * @opensearch.experimental - however, bwc is not guaranteed at this time */ +@ExperimentalApi +@PublicApi(since = "2.10.0") public interface Compressor { boolean isCompressed(BytesReference bytes); diff --git a/libs/core/src/main/java/org/opensearch/core/compress/CompressorRegistry.java b/libs/core/src/main/java/org/opensearch/core/compress/CompressorRegistry.java index e65b34182d9ca..16971e4d3d348 100644 --- a/libs/core/src/main/java/org/opensearch/core/compress/CompressorRegistry.java +++ b/libs/core/src/main/java/org/opensearch/core/compress/CompressorRegistry.java @@ -9,6 +9,7 @@ package org.opensearch.core.compress; import org.opensearch.common.Nullable; +import org.opensearch.common.annotation.InternalApi; import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.core.compress.spi.CompressorProvider; import org.opensearch.core.xcontent.MediaTypeRegistry; @@ -25,8 +26,10 @@ * * This enables plugins, modules, extensions to register their own compression implementations through SPI * + * @opensearch.experimental * @opensearch.internal */ +@InternalApi public final class CompressorRegistry { /** No compression singleton - we still register so users can specify NONE in the API*/ public static final Compressor NONE; diff --git a/libs/core/src/main/java/org/opensearch/core/compress/NoneCompressor.java b/libs/core/src/main/java/org/opensearch/core/compress/NoneCompressor.java index 62260f301d88a..6e607ed701633 100644 --- a/libs/core/src/main/java/org/opensearch/core/compress/NoneCompressor.java +++ b/libs/core/src/main/java/org/opensearch/core/compress/NoneCompressor.java @@ -8,6 +8,7 @@ package org.opensearch.core.compress; +import org.opensearch.common.annotation.PublicApi; import org.opensearch.core.common.bytes.BytesReference; import java.io.IOException; @@ -26,6 +27,7 @@ public class NoneCompressor implements Compressor { * * @opensearch.api - requires BWC support */ + @PublicApi(since = "2.10.0") public static final String NAME = "NONE"; @Override diff --git a/libs/core/src/main/java/org/opensearch/core/compress/spi/CompressorProvider.java b/libs/core/src/main/java/org/opensearch/core/compress/spi/CompressorProvider.java index ba7883b3f9805..019e282444d64 100644 --- a/libs/core/src/main/java/org/opensearch/core/compress/spi/CompressorProvider.java +++ b/libs/core/src/main/java/org/opensearch/core/compress/spi/CompressorProvider.java @@ -8,6 +8,8 @@ package org.opensearch.core.compress.spi; +import org.opensearch.common.annotation.ExperimentalApi; +import org.opensearch.common.annotation.PublicApi; import org.opensearch.core.compress.Compressor; import java.util.List; @@ -24,6 +26,8 @@ * @opensearch.experimental * @opensearch.api */ +@ExperimentalApi +@PublicApi(since = "2.10.0") public interface CompressorProvider { /** Extensions that implement their own concrete {@link Compressor}s provide them through this interface method*/ List> getCompressors(); diff --git a/server/src/main/java/org/opensearch/common/compress/DeflateCompressor.java b/server/src/main/java/org/opensearch/common/compress/DeflateCompressor.java index d1ddf7e1b2d00..3ccac1a941741 100644 --- a/server/src/main/java/org/opensearch/common/compress/DeflateCompressor.java +++ b/server/src/main/java/org/opensearch/common/compress/DeflateCompressor.java @@ -32,6 +32,7 @@ package org.opensearch.common.compress; +import org.opensearch.common.annotation.PublicApi; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.lease.Releasable; import org.opensearch.core.Assertions; @@ -69,6 +70,7 @@ public class DeflateCompressor implements Compressor { * * @opensearch.api - requires BWC support */ + @PublicApi(since = "2.10.0") public static String NAME = "DEFLATE"; // 3 is a good trade-off between speed and compression ratio