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

ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new bf4d8e4  Improve error messages in PerTableVolumeChooser (#2354)
bf4d8e4 is described below

commit bf4d8e4ad5c06e2881a8235ffd0bb293c54289e4
Author: alerman <[email protected]>
AuthorDate: Wed Nov 10 12:26:23 2021 -0500

    Improve error messages in PerTableVolumeChooser (#2354)
    
    Improve error messages in PerTableVolumeChooser by including
    fully-qualified property names as suggestions in the message
    
    This fixes #2353
---
 .../apache/accumulo/core/spi/fs/PerTableVolumeChooser.java | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git 
a/core/src/main/java/org/apache/accumulo/core/spi/fs/PerTableVolumeChooser.java 
b/core/src/main/java/org/apache/accumulo/core/spi/fs/PerTableVolumeChooser.java
index ac9ab06..39ae0e5 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/spi/fs/PerTableVolumeChooser.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/spi/fs/PerTableVolumeChooser.java
@@ -21,6 +21,7 @@ package org.apache.accumulo.core.spi.fs;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.data.TableId;
 import org.apache.accumulo.core.spi.fs.VolumeChooserEnvironment.Scope;
 import org.slf4j.Logger;
@@ -86,7 +87,8 @@ public class PerTableVolumeChooser implements VolumeChooser {
     }
 
     if (clazz == null || clazz.isEmpty()) {
-      String msg = "Property " + TABLE_CUSTOM_SUFFIX + " or " + 
DEFAULT_SCOPED_VOLUME_CHOOSER
+      String msg = "Property " + Property.TABLE_ARBITRARY_PROP_PREFIX + 
TABLE_CUSTOM_SUFFIX + " or "
+          + Property.GENERAL_ARBITRARY_PROP_PREFIX + 
DEFAULT_SCOPED_VOLUME_CHOOSER
           + " must be a valid " + VolumeChooser.class.getSimpleName() + " to 
use the "
           + getClass().getSimpleName();
       throw new RuntimeException(msg);
@@ -106,13 +108,15 @@ public class PerTableVolumeChooser implements 
VolumeChooser {
     // fall back to global default scope if this scope isn't configured (and 
not already default
     // scope)
     if ((clazz == null || clazz.isEmpty()) && scope != Scope.DEFAULT) {
-      log.debug("{} not found; using {}", property, 
DEFAULT_SCOPED_VOLUME_CHOOSER);
+      log.debug("{} not found; using {}", Property.TABLE_ARBITRARY_PROP_PREFIX 
+ property,
+          Property.GENERAL_ARBITRARY_PROP_PREFIX + 
DEFAULT_SCOPED_VOLUME_CHOOSER);
       clazz = 
env.getServiceEnv().getConfiguration().getCustom(DEFAULT_SCOPED_VOLUME_CHOOSER);
 
       if (clazz == null || clazz.isEmpty()) {
-        String msg =
-            "Property " + property + " or " + DEFAULT_SCOPED_VOLUME_CHOOSER + 
" must be a valid "
-                + VolumeChooser.class.getSimpleName() + " to use the " + 
getClass().getSimpleName();
+        String msg = "Property " + Property.TABLE_ARBITRARY_PROP_PREFIX + 
property + " or "
+            + Property.GENERAL_ARBITRARY_PROP_PREFIX + 
DEFAULT_SCOPED_VOLUME_CHOOSER
+            + " must be a valid " + VolumeChooser.class.getSimpleName() + " to 
use the "
+            + getClass().getSimpleName();
         throw new RuntimeException(msg);
       }
 

Reply via email to