accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ivakegg <>
Subject [GitHub] accumulo pull request #253: ACCUMULO-4086 Improve volume chooser fallback
Date Thu, 27 Jul 2017 21:11:32 GMT
Github user ivakegg commented on a diff in the pull request:
    --- Diff: server/base/src/main/java/org/apache/accumulo/server/fs/
    @@ -18,61 +18,146 @@
     import java.util.concurrent.ConcurrentHashMap;
    -import org.apache.accumulo.core.client.impl.Table;
    +import org.apache.accumulo.core.client.AccumuloException;
    +import org.apache.accumulo.core.conf.AccumuloConfiguration;
     import org.apache.accumulo.core.conf.Property;
     import org.apache.accumulo.server.client.HdfsZooInstance;
     import org.apache.accumulo.server.conf.ServerConfigurationFactory;
     import org.apache.accumulo.server.conf.TableConfiguration;
    +import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    - * A {@link VolumeChooser} that delegates to another volume chooser based on the presence
of an experimental table property,
    - * {@link Property#TABLE_VOLUME_CHOOSER}. If it isn't found, defaults back to {@link
    + * A {@link VolumeChooser} that delegates to another volume chooser based on other properties:
table.custom.volume.chooser for tables, and
    + * general.custom.scoped.volume.chooser for scopes. general.custor.{scope}.volume.chooser
can override the system wide setting for
    + * general.custom.scoped.volume.chooser. At the this this was written, the only known
scope was "logger".
     public class PerTableVolumeChooser implements VolumeChooser {
    -  private final VolumeChooser fallbackVolumeChooser = new RandomVolumeChooser();
    +  private static final Logger log = LoggerFactory.getLogger(PerTableVolumeChooser.class);
       // TODO Add hint of expected size to construction, see ACCUMULO-3410
       /* Track VolumeChooser instances so they can keep state. */
    -  private final ConcurrentHashMap<Table.ID,VolumeChooser> tableSpecificChooser
= new ConcurrentHashMap<>();
    +  private final ConcurrentHashMap<String,VolumeChooser> tableSpecificChooser =
new ConcurrentHashMap<>();
    --- End diff --
    You will see that the same routine is used to add volume choosers into those maps, so
I had to use a common denominator for the class.  String works well.  However if you insist
that I use Table.ID here instead, then I will denormalize the common method.

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 or file a JIRA ticket
with INFRA.

View raw message