dlmarion commented on code in PR #3180:
URL: https://github.com/apache/accumulo/pull/3180#discussion_r1100625103


##########
core/src/main/java/org/apache/accumulo/core/conf/Property.java:
##########
@@ -120,11 +120,11 @@ public enum Property {
           + " a comma or other reserved characters in a URI use standard URI 
hex"
           + " encoding. For example replace commas with %2C.",
       "1.6.0"),
-  INSTANCE_VOLUMES_CONFIG("instance.volumes.config.", null, 
PropertyType.PREFIX,
+  INSTANCE_VOLUMES_CONFIG("instance.volume.config.", null, PropertyType.PREFIX,

Review Comment:
   Changes applied in 55fe4f3



##########
server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java:
##########
@@ -382,44 +382,37 @@ public short getDefaultReplication(Path path) {
    */
   private static Configuration 
getVolumeManagerConfiguration(AccumuloConfiguration conf,
       final Configuration hadoopConf, final String filesystemURI) {
+
     final Configuration volumeConfig = new Configuration(hadoopConf);
-    final Map<String,String> customProps =
-        
conf.getAllPropertiesWithPrefixStripped(Property.INSTANCE_VOLUMES_CONFIG);
-    customProps.forEach((key, value) -> {
-      if (key.startsWith(filesystemURI)) {
-        String property = key.substring(filesystemURI.length() + 1);
-        log.info("Overriding property {} to {} for volume {}", property, 
value, filesystemURI);
-        volumeConfig.set(property, value);
-      }
-    });
-    return volumeConfig;
-  }
 
-  private static void warnVolumeOverridesMissingVolume(AccumuloConfiguration 
conf,
-      Set<String> definedVolumes) {
-    final Map<String,String> overrideProperties = new ConcurrentHashMap<>(
-        
conf.getAllPropertiesWithPrefixStripped(Property.INSTANCE_VOLUMES_CONFIG));
+    
conf.getAllPropertiesWithPrefixStripped(Property.INSTANCE_VOLUMES_CONFIG).entrySet().stream()
+        .filter(e -> e.getKey().startsWith(filesystemURI + ".")).forEach(e -> {
+          String key = e.getKey().substring(filesystemURI.length() + 1);
+          String value = e.getValue();
+          log.info("Overriding property {} for volume {}", key, value, 
filesystemURI);
+          volumeConfig.set(key, value);
+        });
 
-    definedVolumes.forEach(vol -> {
-      log.debug("Looking for defined volume: {}", vol);
-      overrideProperties.keySet().forEach(override -> {
-        if (override.startsWith(vol)) {
-          log.debug("Found volume {}, removing property {}", vol, override);
-          overrideProperties.remove(override);
-        }
-      });
-    });
+    return volumeConfig;
+  }
 
-    overrideProperties.forEach((k, v) -> log
-        .warn("Found no matching volume for volume config override property {} 
= {}", k, v));
+  protected static List<Entry<String,String>>
+      findVolumeOverridesMissingVolume(AccumuloConfiguration conf, Set<String> 
definedVolumes) {
+    return 
conf.getAllPropertiesWithPrefixStripped(Property.INSTANCE_VOLUMES_CONFIG).entrySet()
+        .stream()
+        // log only configs where none of the volumes (with a dot) prefix its 
key
+        .filter(e -> definedVolumes.stream().noneMatch(vol -> 
e.getKey().startsWith(vol + ".")))
+        .collect(Collectors.toList());

Review Comment:
   Changes applied in 55fe4f3



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