mirror of
https://github.com/apache/druid.git
synced 2025-02-09 03:24:55 +00:00
Remove stale references to coordinator dynamic config killAllDataSources. (#16387)
This parameter has been removed for awhile now as of Druid 0.23.0 https://github.com/apache/druid/pull/12187. The code was only used in tests to verify that serialization works. Now remove all references to avoid any confusion.
This commit is contained in:
parent
588d442422
commit
2a638d77d9
@ -266,12 +266,6 @@ public class CoordinatorDynamicConfig
|
|||||||
return maxKillTaskSlots;
|
return maxKillTaskSlots;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public boolean isKillUnusedSegmentsInAllDataSources()
|
|
||||||
{
|
|
||||||
return specificDataSourcesToKillUnusedSegmentsIn.isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonProperty("killPendingSegmentsSkipList")
|
@JsonProperty("killPendingSegmentsSkipList")
|
||||||
public Set<String> getDataSourcesToNotKillStalePendingSegmentsIn()
|
public Set<String> getDataSourcesToNotKillStalePendingSegmentsIn()
|
||||||
{
|
{
|
||||||
|
@ -263,7 +263,6 @@ public class CoordinatorDynamicConfigTest
|
|||||||
false,
|
false,
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
Assert.assertTrue(config.isKillUnusedSegmentsInAllDataSources());
|
|
||||||
Assert.assertTrue(config.getSpecificDataSourcesToKillUnusedSegmentsIn().isEmpty());
|
Assert.assertTrue(config.getSpecificDataSourcesToKillUnusedSegmentsIn().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,7 +289,6 @@ public class CoordinatorDynamicConfigTest
|
|||||||
false,
|
false,
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
Assert.assertFalse(config.isKillUnusedSegmentsInAllDataSources());
|
|
||||||
Assert.assertEquals(ImmutableSet.of("test1"), config.getSpecificDataSourcesToKillUnusedSegmentsIn());
|
Assert.assertEquals(ImmutableSet.of("test1"), config.getSpecificDataSourcesToKillUnusedSegmentsIn());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,60 +466,6 @@ public class CoordinatorDynamicConfigTest
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@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
|
@Test
|
||||||
public void testDeserializeWithoutMaxSegmentsInNodeLoadingQueue() throws Exception
|
public void testDeserializeWithoutMaxSegmentsInNodeLoadingQueue() throws Exception
|
||||||
{
|
{
|
||||||
@ -532,8 +476,7 @@ public class CoordinatorDynamicConfigTest
|
|||||||
+ " \"maxSegmentsToMove\": 1,\n"
|
+ " \"maxSegmentsToMove\": 1,\n"
|
||||||
+ " \"replicantLifetime\": 1,\n"
|
+ " \"replicantLifetime\": 1,\n"
|
||||||
+ " \"replicationThrottleLimit\": 1,\n"
|
+ " \"replicationThrottleLimit\": 1,\n"
|
||||||
+ " \"balancerComputeThreads\": 2, \n"
|
+ " \"balancerComputeThreads\": 2\n"
|
||||||
+ " \"killAllDataSources\": true\n"
|
|
||||||
+ "}\n";
|
+ "}\n";
|
||||||
|
|
||||||
CoordinatorDynamicConfig actual = mapper.readValue(
|
CoordinatorDynamicConfig actual = mapper.readValue(
|
||||||
@ -691,7 +634,6 @@ public class CoordinatorDynamicConfigTest
|
|||||||
expectedSpecificDataSourcesToKillUnusedSegmentsIn,
|
expectedSpecificDataSourcesToKillUnusedSegmentsIn,
|
||||||
config.getSpecificDataSourcesToKillUnusedSegmentsIn()
|
config.getSpecificDataSourcesToKillUnusedSegmentsIn()
|
||||||
);
|
);
|
||||||
Assert.assertEquals(expectedKillUnusedSegmentsInAllDataSources, config.isKillUnusedSegmentsInAllDataSources());
|
|
||||||
Assert.assertEquals(expectedKillTaskSlotRatio, config.getKillTaskSlotRatio(), 0.001);
|
Assert.assertEquals(expectedKillTaskSlotRatio, config.getKillTaskSlotRatio(), 0.001);
|
||||||
Assert.assertEquals((int) expectedMaxKillTaskSlots, config.getMaxKillTaskSlots());
|
Assert.assertEquals((int) expectedMaxKillTaskSlots, config.getMaxKillTaskSlots());
|
||||||
Assert.assertEquals(expectedMaxSegmentsInNodeLoadingQueue, config.getMaxSegmentsInNodeLoadingQueue());
|
Assert.assertEquals(expectedMaxSegmentsInNodeLoadingQueue, config.getMaxSegmentsInNodeLoadingQueue());
|
||||||
|
@ -26,7 +26,6 @@ import { getLink } from '../../links';
|
|||||||
export interface CoordinatorDynamicConfig {
|
export interface CoordinatorDynamicConfig {
|
||||||
maxSegmentsToMove?: number;
|
maxSegmentsToMove?: number;
|
||||||
balancerComputeThreads?: number;
|
balancerComputeThreads?: number;
|
||||||
killAllDataSources?: boolean;
|
|
||||||
killDataSourceWhitelist?: string[];
|
killDataSourceWhitelist?: string[];
|
||||||
killTaskSlotRatio?: number;
|
killTaskSlotRatio?: number;
|
||||||
maxKillTaskSlots?: number;
|
maxKillTaskSlots?: number;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user