Skip to content

Commit

Permalink
Checkstyle and test update
Browse files Browse the repository at this point in the history
  • Loading branch information
andreidan committed Mar 13, 2024
1 parent ae8adff commit 984d9c0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.datastreams.autosharding.AutoShardingResult;
import org.elasticsearch.action.datastreams.autosharding.AutoShardingType;
import org.elasticsearch.cluster.metadata.DataStream;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ public void testRolloverDataStreamWithoutExistingAutosharding() throws Exception
{
// we have another condition that matched, so the rollover will be executed and the new number of shards
// will be 1
List<Condition<?>> metConditions = List.of(new MaxDocsCondition(2L));
AutoShardingResult autoShardingResult = new AutoShardingResult(DECREASE_SHARDS, 3, 1, TimeValue.ZERO, 0.33);
List<Condition<?>> metConditions = List.of(
new MaxDocsCondition(2L),
new AutoShardCondition(autoShardingResult)
);
MetadataRolloverService.RolloverResult rolloverResult = rolloverService.rolloverClusterState(
clusterState,
dataStream.getName(),
Expand All @@ -127,7 +131,7 @@ public void testRolloverDataStreamWithoutExistingAutosharding() throws Exception
randomBoolean(),
false,
null,
new AutoShardingResult(DECREASE_SHARDS, 3, 1, TimeValue.ZERO, 0.33)
autoShardingResult
);
assertRolloverResult(
dataStream,
Expand All @@ -142,7 +146,8 @@ public void testRolloverDataStreamWithoutExistingAutosharding() throws Exception
{
// even if the decrease shards recommendation is not a rollover condition, an empty POST _rollover request will
// configure the decrease shards recommendation
List<Condition<?>> metConditions = List.of();
AutoShardingResult autoShardingResult = new AutoShardingResult(DECREASE_SHARDS, 3, 1, TimeValue.ZERO, 0.33);
List<Condition<?>> metConditions = List.of(new AutoShardCondition(autoShardingResult));
MetadataRolloverService.RolloverResult rolloverResult = rolloverService.rolloverClusterState(
clusterState,
dataStream.getName(),
Expand All @@ -153,7 +158,7 @@ public void testRolloverDataStreamWithoutExistingAutosharding() throws Exception
randomBoolean(),
false,
null,
new AutoShardingResult(DECREASE_SHARDS, 3, 1, TimeValue.ZERO, 0.33)
autoShardingResult
);
assertRolloverResult(
dataStream,
Expand Down Expand Up @@ -313,7 +318,11 @@ public void testRolloverDataStreamWithExistingAutoShardEvent() throws Exception
{
// we have another condition that matched, so the rollover will be executed and the new number of shards
// will be 1
List<Condition<?>> metConditions = List.of(new MaxDocsCondition(2L));
AutoShardingResult autoShardingResult = new AutoShardingResult(DECREASE_SHARDS, 3, 1, TimeValue.ZERO, 0.33);
List<Condition<?>> metConditions = List.of(
new MaxDocsCondition(2L),
new AutoShardCondition(autoShardingResult)
);
MetadataRolloverService.RolloverResult rolloverResult = rolloverService.rolloverClusterState(
clusterState,
dataStream.getName(),
Expand All @@ -324,7 +333,7 @@ public void testRolloverDataStreamWithExistingAutoShardEvent() throws Exception
randomBoolean(),
false,
null,
new AutoShardingResult(DECREASE_SHARDS, 3, 1, TimeValue.ZERO, 0.33)
autoShardingResult
);
assertRolloverResult(
dataStream,
Expand All @@ -339,7 +348,8 @@ public void testRolloverDataStreamWithExistingAutoShardEvent() throws Exception
{
// even if the decrease shards recommendation is not a rollover condition, an empty POST _rollover request will
// configure the decrease shards recommendation
List<Condition<?>> metConditions = List.of();
AutoShardingResult autoShardingResult = new AutoShardingResult(DECREASE_SHARDS, 3, 1, TimeValue.ZERO, 0.33);
List<Condition<?>> metConditions = List.of(new AutoShardCondition(autoShardingResult));
MetadataRolloverService.RolloverResult rolloverResult = rolloverService.rolloverClusterState(
clusterState,
dataStream.getName(),
Expand All @@ -350,7 +360,7 @@ public void testRolloverDataStreamWithExistingAutoShardEvent() throws Exception
randomBoolean(),
false,
null,
new AutoShardingResult(DECREASE_SHARDS, 3, 1, TimeValue.ZERO, 0.33)
autoShardingResult
);
assertRolloverResult(
dataStream,
Expand Down

0 comments on commit 984d9c0

Please sign in to comment.