Skip to content

Commit

Permalink
Default data_streams.auto_sharding.excludes to NO exclusions ([])
Browse files Browse the repository at this point in the history
  • Loading branch information
andreidan committed Apr 4, 2024
1 parent a32512f commit 384327d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
public void configureClusterSettings() {
updateClusterSettings(
Settings.builder()
.putList(DataStreamAutoShardingService.DATA_STREAMS_AUTO_SHARDING_EXCLUDES_SETTING.getKey(), List.of())
// we want to manually trigger the rollovers in this test suite to be able to assert incrementally the changes in shard
// configurations
.put(DataStreamLifecycleService.DATA_STREAM_LIFECYCLE_POLL_INTERVAL, "30d")
Expand All @@ -93,11 +92,7 @@ public void configureClusterSettings() {

@After
public void resetClusterSetting() {
updateClusterSettings(
Settings.builder()
.putNull(DataStreamAutoShardingService.DATA_STREAMS_AUTO_SHARDING_EXCLUDES_SETTING.getKey())
.putNull(DataStreamLifecycleService.DATA_STREAM_LIFECYCLE_POLL_INTERVAL)
);
updateClusterSettings(Settings.builder().putNull(DataStreamLifecycleService.DATA_STREAM_LIFECYCLE_POLL_INTERVAL));
}

public void testRolloverOnAutoShardCondition() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class DataStreamAutoShardingService {

public static final Setting<List<String>> DATA_STREAMS_AUTO_SHARDING_EXCLUDES_SETTING = Setting.listSetting(
"data_streams.auto_sharding.excludes",
List.of("*"),
List.of(),
Function.identity(),
Setting.Property.Dynamic,
Setting.Property.NodeScope
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ public void setupService() {
clusterService = createClusterService(threadPool, clusterSettings);
now = System.currentTimeMillis();
service = new DataStreamAutoShardingService(
Settings.builder()
.put(DataStreamAutoShardingService.DATA_STREAMS_AUTO_SHARDING_ENABLED, true)
.putList(DataStreamAutoShardingService.DATA_STREAMS_AUTO_SHARDING_EXCLUDES_SETTING.getKey(), List.of())
.build(),
Settings.builder().put(DataStreamAutoShardingService.DATA_STREAMS_AUTO_SHARDING_ENABLED, true).build(),
clusterService,
new FeatureService(List.of(new FeatureSpecification() {
@Override
Expand Down Expand Up @@ -147,10 +144,7 @@ public Set<NodeFeature> getFeatures() {
ClusterState stateNoFeature = ClusterState.builder(ClusterName.DEFAULT).metadata(Metadata.builder()).build();

DataStreamAutoShardingService noFeatureService = new DataStreamAutoShardingService(
Settings.builder()
.put(DataStreamAutoShardingService.DATA_STREAMS_AUTO_SHARDING_ENABLED, true)
.putList(DataStreamAutoShardingService.DATA_STREAMS_AUTO_SHARDING_EXCLUDES_SETTING.getKey(), List.of())
.build(),
Settings.builder().put(DataStreamAutoShardingService.DATA_STREAMS_AUTO_SHARDING_ENABLED, true).build(),
clusterService,
new FeatureService(List.of()),
() -> now
Expand Down

0 comments on commit 384327d

Please sign in to comment.