kfaraz commented on code in PR #16810:
URL: https://github.com/apache/druid/pull/16810#discussion_r1696201261


##########
integration-tests/src/test/java/org/apache/druid/tests/coordinator/duty/ITAutoCompactionUpgradeTest.java:
##########
@@ -58,67 +56,56 @@ public void 
testUpgradeAutoCompactionConfigurationWhenConfigurationFromOlderVers
   {
     // Verify that compaction config already exist. This config was inserted 
manually into the database using SQL script.
     // This auto compaction configuration payload is from Druid 0.21.0
-    CoordinatorCompactionConfig coordinatorCompactionConfig = 
compactionResource.getCoordinatorCompactionConfigs();
-    DataSourceCompactionConfig foundDataSourceCompactionConfig = null;
-    for (DataSourceCompactionConfig dataSourceCompactionConfig : 
coordinatorCompactionConfig.getCompactionConfigs()) {
-      if 
(dataSourceCompactionConfig.getDataSource().equals(UPGRADE_DATASOURCE_NAME)) {
-        foundDataSourceCompactionConfig = dataSourceCompactionConfig;
-      }
-    }
+    DruidCompactionConfig coordinatorCompactionConfig = 
compactionResource.getCompactionConfig();
+    DataSourceCompactionConfig foundDataSourceCompactionConfig
+        = 
coordinatorCompactionConfig.findConfigForDatasource(UPGRADE_DATASOURCE_NAME).orNull();
     Assert.assertNotNull(foundDataSourceCompactionConfig);
 
     // Now submit a new auto compaction configuration
     PartitionsSpec newPartitionsSpec = new DynamicPartitionsSpec(4000, null);
     Period newSkipOffset = Period.seconds(0);
 
-    DataSourceCompactionConfig compactionConfig = new 
DataSourceCompactionConfig(
-        UPGRADE_DATASOURCE_NAME,
-        null,
-        null,
-        null,
-        newSkipOffset,
-        new UserCompactionTaskQueryTuningConfig(
-            null,
-            null,
-            null,
-            null,
-            new MaxSizeSplitHintSpec(null, 1),
-            newPartitionsSpec,
-            null,
-            null,
-            null,
-            null,
-            null,
-            1,
-            null,
-            null,
-            null,
-            null,
-            null,
-            1,
-            null
-        ),
-        new UserCompactionTaskGranularityConfig(Granularities.YEAR, null, 
null),
-        null,
-        null,
-        null,
-        new UserCompactionTaskIOConfig(true),
-        null,
-        null
-    );
+    DataSourceCompactionConfig compactionConfig = DataSourceCompactionConfig
+        .builder()
+        .forDataSource(UPGRADE_DATASOURCE_NAME)
+        .withSkipOffsetFromLatest(newSkipOffset)
+        .withTuningConfig(
+            new UserCompactionTaskQueryTuningConfig(

Review Comment:
   Yeah, it's already in the works. 😄 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to