ddanielr commented on code in PR #4092:
URL: https://github.com/apache/accumulo/pull/4092#discussion_r1433415448


##########
core/src/test/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlannerTest.java:
##########
@@ -486,80 +485,36 @@ public Builder createPlanBuilder() {
     };
   }
 
-  private static DefaultCompactionPlanner createPlanner(boolean 
withHugeExecutor) {
-    DefaultCompactionPlanner planner = new DefaultCompactionPlanner();
-    Configuration conf = EasyMock.createMock(Configuration.class);
-    
EasyMock.expect(conf.isSet(EasyMock.anyString())).andReturn(false).anyTimes();
-
-    ServiceEnvironment senv = EasyMock.createMock(ServiceEnvironment.class);
-    EasyMock.expect(senv.getConfiguration()).andReturn(conf).anyTimes();
-
-    EasyMock.replay(conf, senv);
-
-    StringBuilder execBldr =
-        new StringBuilder("[{'name':'small','type': 
'internal','maxSize':'32M','numThreads':1},"
-            + "{'name':'medium','type': 
'internal','maxSize':'128M','numThreads':2},"
-            + "{'name':'large','type': 
'internal','maxSize':'512M','numThreads':3}");
-
-    if (withHugeExecutor) {
-      execBldr.append(",{'name':'huge','type': 'internal','numThreads':4}]");
-    } else {
-      execBldr.append("]");
-    }
-
-    String executors = execBldr.toString().replaceAll("'", "\"");
-
-    planner.init(new CompactionPlanner.InitParameters() {
+  private static CompactionPlanner.InitParameters getInitParams(Configuration 
conf,
+      String executors) {
 
-      @Override
-      public ServiceEnvironment getServiceEnvironment() {
-        return senv;
+    @SuppressWarnings("removal")
+    var deprecatedMaxOpen = Property.TSERV_MAJC_THREAD_MAXOPEN;
+    String maxOpen;
+    maxOpen =
+        conf.get(Property.TSERV_COMPACTION_SERVICE_PREFIX.getKey() + 
"cs1.planner.opts.maxOpen");
+    if (maxOpen == null) {
+      if (conf.isSet(deprecatedMaxOpen.getKey())) {
+        maxOpen = conf.get(deprecatedMaxOpen.getKey());
+      } else {
+        maxOpen = 
Property.TSERV_COMPACTION_SERVICE_DEFAULT_MAX_OPEN.getDefaultValue();

Review Comment:
   @keith-turner brought up a good point with the default compaction services 
and the use of ConfigurationCopy. 
   I'll need to make some additional changes to this PR so the default 
compaction services accept the deprecated property behavior correctly. 



-- 
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]

Reply via email to