Github user ctubbsii commented on a diff in the pull request:
https://github.com/apache/accumulo/pull/253#discussion_r129917588
--- Diff:
server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
---
@@ -464,16 +472,22 @@ public ContentSummary getContentSummary(Path dir)
throws IOException {
return getVolumeByPath(dir).getFileSystem().getContentSummary(dir);
}
- // Only used as a fall back if the configured chooser misbehaves.
- private final VolumeChooser failsafeChooser = new RandomVolumeChooser();
-
@Override
public String choose(VolumeChooserEnvironment env, String[] options) {
- final String choice = chooser.choose(env, options);
- if (!(ArrayUtils.contains(options, choice))) {
- log.error("The configured volume chooser, '" + chooser.getClass() +
"', or one of its delegates returned a volume not in the set of options
provided; "
- + "will continue by relying on a RandomVolumeChooser. You should
investigate and correct the named chooser.");
- return failsafeChooser.choose(env, options);
+ final String choice;
+ try {
+ choice = chooser.choose(env, options);
+
+ if (!(ArrayUtils.contains(options, choice))) {
+ // we may want to go with random if they chooser was not overridden
+ String msg = "The configured volume chooser, '" +
chooser.getClass()
+ + "', or one of its delegates returned a volume not in the set
of options provided";
+ log.error(msg);
--- End diff --
Should probably not log and throw. We should log or throw, and if we throw,
leave logging to the caller. This avoids spammy redundant logs.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---