You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2021/01/11 16:28:37 UTC

[GitHub] [accumulo] keith-turner commented on a change in pull request #1861: Fixes #1665 use old compaction thread pool config if set

keith-turner commented on a change in pull request #1861:
URL: https://github.com/apache/accumulo/pull/1861#discussion_r555176597



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/CompactionManager.java
##########
@@ -78,10 +81,82 @@ private static long getDefaultThroughput(AccumuloConfiguration aconf) {
           .getMemoryAsBytes(Property.TSERV_COMPACTION_SERVICE_DEFAULT_RATE_LIMIT.getDefaultValue());
     }
 
-    Config(AccumuloConfiguration aconf) {
+    @SuppressWarnings("removal")
+    private Map<String,String> getConfiguration(AccumuloConfiguration aconf) {
+
       Map<String,String> configs =
           aconf.getAllPropertiesWithPrefix(Property.TSERV_COMPACTION_SERVICE_PREFIX);
 
+      // check if deprecated properties for compaction executor are set
+      if (aconf.isPropertySet(Property.TSERV_MAJC_MAXCONCURRENT, true)) {
+
+        String defaultServicePrefix =
+            Property.TSERV_COMPACTION_SERVICE_PREFIX.getKey() + DEFAULT_SERVICE.canonical() + ".";
+        boolean defaultServicePropsSet = false;
+
+        // check if any properties for the default compaction service are set
+        for (String key : configs.keySet()) {
+          if (key.startsWith(defaultServicePrefix)) {
+            Property prop = Property.getPropertyByKey(key);
+            if (prop == null || aconf.isPropertySet(prop, true)) {
+              defaultServicePropsSet = true;
+              break;
+            }
+          }
+        }

Review comment:
       I made that change and it worked out quite nicely.  Before merging I will manually test again to make sure I didn't mess anything up replacing the loop with a stream.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org