Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,6 @@ public int getMaxKillTaskSlots()
return maxKillTaskSlots;
}

@JsonIgnore
public boolean isKillUnusedSegmentsInAllDataSources()
{
return specificDataSourcesToKillUnusedSegmentsIn.isEmpty();
}

@JsonProperty("killPendingSegmentsSkipList")
public Set<String> getDataSourcesToNotKillStalePendingSegmentsIn()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ public void testConstructorWithNullsShouldKillUnusedSegmentsInAllDataSources()
false,
null
);
Assert.assertTrue(config.isKillUnusedSegmentsInAllDataSources());
Assert.assertTrue(config.getSpecificDataSourcesToKillUnusedSegmentsIn().isEmpty());
}

Expand All @@ -290,7 +289,6 @@ public void testConstructorWithSpecificDataSourcesToKillShouldNotKillUnusedSegme
false,
null
);
Assert.assertFalse(config.isKillUnusedSegmentsInAllDataSources());
Assert.assertEquals(ImmutableSet.of("test1"), config.getSpecificDataSourcesToKillUnusedSegmentsIn());
}

Expand Down Expand Up @@ -468,60 +466,6 @@ public void testHandleMissingPercentOfSegmentsToConsiderPerMove() throws Excepti
);
}

@Test
public void testSerdeWithKillAllDataSources() throws Exception
{
String jsonStr = "{\n"
+ " \"millisToWaitBeforeDeleting\": 1,\n"
+ " \"mergeBytesLimit\": 1,\n"
+ " \"mergeSegmentsLimit\" : 1,\n"
+ " \"maxSegmentsToMove\": 1,\n"
+ " \"replicantLifetime\": 1,\n"
+ " \"replicationThrottleLimit\": 1,\n"
+ " \"balancerComputeThreads\": 2, \n"
+ " \"killAllDataSources\": true,\n"
+ " \"maxSegmentsInNodeLoadingQueue\": 1\n"
+ "}\n";

CoordinatorDynamicConfig actual = mapper.readValue(
mapper.writeValueAsString(
mapper.readValue(jsonStr, CoordinatorDynamicConfig.class)
),
CoordinatorDynamicConfig.class
);

assertConfig(
actual,
1,
1,
1,
1,
1,
1,
2,
ImmutableSet.of(),
0.1,
Integer.MAX_VALUE,
true,
1,
ImmutableSet.of(),
false,
false
);

// killAllDataSources is a config in versions 0.22.x and older and is no longer used.
// This used to be an invalid config, but as of 0.23.0 the killAllDataSources flag no longer exsist,
// so this is a valid config
jsonStr = "{\n"
+ " \"killDataSourceWhitelist\": [\"test1\",\"test2\"],\n"
+ " \"killAllDataSources\": true\n"
+ "}\n";
actual = mapper.readValue(jsonStr, CoordinatorDynamicConfig.class);

Assert.assertFalse(actual.isKillUnusedSegmentsInAllDataSources());
Assert.assertEquals(2, actual.getSpecificDataSourcesToKillUnusedSegmentsIn().size());
}

@Test
public void testDeserializeWithoutMaxSegmentsInNodeLoadingQueue() throws Exception
{
Expand All @@ -532,8 +476,7 @@ public void testDeserializeWithoutMaxSegmentsInNodeLoadingQueue() throws Excepti
+ " \"maxSegmentsToMove\": 1,\n"
+ " \"replicantLifetime\": 1,\n"
+ " \"replicationThrottleLimit\": 1,\n"
+ " \"balancerComputeThreads\": 2, \n"
+ " \"killAllDataSources\": true\n"
+ " \"balancerComputeThreads\": 2\n"
+ "}\n";

CoordinatorDynamicConfig actual = mapper.readValue(
Expand Down Expand Up @@ -691,7 +634,6 @@ private void assertConfig(
expectedSpecificDataSourcesToKillUnusedSegmentsIn,
config.getSpecificDataSourcesToKillUnusedSegmentsIn()
);
Assert.assertEquals(expectedKillUnusedSegmentsInAllDataSources, config.isKillUnusedSegmentsInAllDataSources());
Assert.assertEquals(expectedKillTaskSlotRatio, config.getKillTaskSlotRatio(), 0.001);
Assert.assertEquals((int) expectedMaxKillTaskSlots, config.getMaxKillTaskSlots());
Assert.assertEquals(expectedMaxSegmentsInNodeLoadingQueue, config.getMaxSegmentsInNodeLoadingQueue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { getLink } from '../../links';
export interface CoordinatorDynamicConfig {
maxSegmentsToMove?: number;
balancerComputeThreads?: number;
killAllDataSources?: boolean;
killDataSourceWhitelist?: string[];
killTaskSlotRatio?: number;
maxKillTaskSlots?: number;
Expand Down