Skip to content

Commit

Permalink
update with initial annotations
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
  • Loading branch information
nknize committed Aug 14, 2023
1 parent 42ca347 commit 4a22989
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<Map.Entry<String, Compressor>> getCompressors();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4a22989

Please sign in to comment.