keith-turner commented on a change in pull request #1413: add choosable() to 
VolumeChooser and VolumeManager interfaces.
URL: https://github.com/apache/accumulo/pull/1413#discussion_r343693974
 
 

 ##########
 File path: 
server/base/src/main/java/org/apache/accumulo/server/fs/VolumeChooser.java
 ##########
 @@ -44,6 +44,20 @@
    */
   String choose(VolumeChooserEnvironment env, String[] options) throws 
VolumeChooserException;
 
+  /**
+   * Return all volumes from options that are appropriate for the given 
environment.
+   *
+   * @param env
+   *          the server environment provided by the calling framework
+   * @param options
+   *          the list of volumes to choose from
+   * @return array of valid options
+   * @throws VolumeChooserException
+   *           if there is an error choosing (this is a RuntimeException); 
this does not preclude
+   *           other RuntimeExceptions from occurring
+   */
+  String[] choosable(VolumeChooserEnvironment env, String[] options) throws 
VolumeChooserException;
 
 Review comment:
   Could do :
   
   ```java
   default String[] choosable(VolumeChooserEnvironment env, String[] options) 
throws VolumeChooserException {
     throw new UnsupportedOperationException("This volume choose does not 
support a new method added in 2.1.0.  Please let the author of the chooser 
know");
   }
   ```
   
   Then in `checkWalCanSync()` could possibly do :
   
   ```java
   try{
     prefixes = fs.choosable(chooserEnv, options);
   } catch(Exception e) {
      log.warn("Unable to determine if WAL directories ({}) support sync or 
flush. Data loss may occur.", Arrays.asList(options), e);
     return;
   }
   ```
   
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to