Skip to content

Commit

Permalink
nit fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Sarthak Aggarwal <sarthagg@amazon.com>
  • Loading branch information
sarthakaggarwal97 committed Sep 6, 2023
1 parent ca32bf4 commit 35e7083
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import org.opensearch.common.settings.Settings;
import org.opensearch.test.OpenSearchIntegTestCase;

import java.util.List;

@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST)
public class ZstdNotEnabledIT extends OpenSearchIntegTestCase {

Expand All @@ -20,18 +22,20 @@ public void testZStdCodecsWithoutPluginInstalled() {
internalCluster().startNode();
final String index = "test-index";

// creating index with zstd or zstd_no_dict should fail if custom-codecs plugin is not installed
assertThrows(
IllegalArgumentException.class,
() -> createIndex(
index,
Settings.builder()
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
.put("index.codec", randomFrom("zstd", "zstd_no_dict"))
.build()
)
);
// creating index with zstd and zstd_no_dict should fail if custom-codecs plugin is not installed
for (String codec : List.of("zstd", "zstd_no_dict")) {
assertThrows(
IllegalArgumentException.class,
() -> createIndex(
index,
Settings.builder()
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
.put("index.codec", codec)
.build()
)
);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.opensearch.index.codec;

import org.apache.lucene.codecs.Codec;
import org.opensearch.common.annotation.ExperimentalApi;

import java.util.Set;

Expand All @@ -17,6 +18,7 @@
*
* @opensearch.internal
*/
@ExperimentalApi
public interface CodecAliases {

/**
Expand Down

0 comments on commit 35e7083

Please sign in to comment.