This is an automated email from the ASF dual-hosted git repository.

kfaraz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 2a638d77d93 Remove stale references to coordinator dynamic config 
killAllDataSources. (#16387)
2a638d77d93 is described below

commit 2a638d77d933b543e35640a8c221e42a8e2fe049
Author: Abhishek Radhakrishnan <[email protected]>
AuthorDate: Sat May 4 20:18:56 2024 -0700

    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.
---
 .../coordinator/CoordinatorDynamicConfig.java      |  6 ---
 .../server/http/CoordinatorDynamicConfigTest.java  | 60 +---------------------
 .../coordinator-dynamic-config.tsx                 |  1 -
 3 files changed, 1 insertion(+), 66 deletions(-)

diff --git 
a/server/src/main/java/org/apache/druid/server/coordinator/CoordinatorDynamicConfig.java
 
b/server/src/main/java/org/apache/druid/server/coordinator/CoordinatorDynamicConfig.java
index f10f7df8b13..e834c7b1fd3 100644
--- 
a/server/src/main/java/org/apache/druid/server/coordinator/CoordinatorDynamicConfig.java
+++ 
b/server/src/main/java/org/apache/druid/server/coordinator/CoordinatorDynamicConfig.java
@@ -266,12 +266,6 @@ public class CoordinatorDynamicConfig
     return maxKillTaskSlots;
   }
 
-  @JsonIgnore
-  public boolean isKillUnusedSegmentsInAllDataSources()
-  {
-    return specificDataSourcesToKillUnusedSegmentsIn.isEmpty();
-  }
-
   @JsonProperty("killPendingSegmentsSkipList")
   public Set<String> getDataSourcesToNotKillStalePendingSegmentsIn()
   {
diff --git 
a/server/src/test/java/org/apache/druid/server/http/CoordinatorDynamicConfigTest.java
 
b/server/src/test/java/org/apache/druid/server/http/CoordinatorDynamicConfigTest.java
index ba2cc10fe24..a97160ed27b 100644
--- 
a/server/src/test/java/org/apache/druid/server/http/CoordinatorDynamicConfigTest.java
+++ 
b/server/src/test/java/org/apache/druid/server/http/CoordinatorDynamicConfigTest.java
@@ -263,7 +263,6 @@ public class CoordinatorDynamicConfigTest
         false,
         null
     );
-    Assert.assertTrue(config.isKillUnusedSegmentsInAllDataSources());
     
Assert.assertTrue(config.getSpecificDataSourcesToKillUnusedSegmentsIn().isEmpty());
   }
 
@@ -290,7 +289,6 @@ public class CoordinatorDynamicConfigTest
         false,
         null
     );
-    Assert.assertFalse(config.isKillUnusedSegmentsInAllDataSources());
     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
   public void testDeserializeWithoutMaxSegmentsInNodeLoadingQueue() throws 
Exception
   {
@@ -532,8 +476,7 @@ public class CoordinatorDynamicConfigTest
                      + "  \"maxSegmentsToMove\": 1,\n"
                      + "  \"replicantLifetime\": 1,\n"
                      + "  \"replicationThrottleLimit\": 1,\n"
-                     + "  \"balancerComputeThreads\": 2, \n"
-                     + "  \"killAllDataSources\": true\n"
+                     + "  \"balancerComputeThreads\": 2\n"
                      + "}\n";
 
     CoordinatorDynamicConfig actual = mapper.readValue(
@@ -691,7 +634,6 @@ public class CoordinatorDynamicConfigTest
         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());
diff --git 
a/web-console/src/druid-models/coordinator-dynamic-config/coordinator-dynamic-config.tsx
 
b/web-console/src/druid-models/coordinator-dynamic-config/coordinator-dynamic-config.tsx
index eaf29a51e2e..1d5a696e943 100644
--- 
a/web-console/src/druid-models/coordinator-dynamic-config/coordinator-dynamic-config.tsx
+++ 
b/web-console/src/druid-models/coordinator-dynamic-config/coordinator-dynamic-config.tsx
@@ -26,7 +26,6 @@ import { getLink } from '../../links';
 export interface CoordinatorDynamicConfig {
   maxSegmentsToMove?: number;
   balancerComputeThreads?: number;
-  killAllDataSources?: boolean;
   killDataSourceWhitelist?: string[];
   killTaskSlotRatio?: number;
   maxKillTaskSlots?: number;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to