Class PreferredVolumeChooser

  • All Implemented Interfaces:
    VolumeChooser
    Direct Known Subclasses:
    SpaceAwareVolumeChooser

    public class PreferredVolumeChooser
    extends RandomVolumeChooser
    A RandomVolumeChooser that selects preferred volumes to use from the provided volume options. Preferred Volumes are set on either the per-table, per-scope, or default configuration level. Configuration details are overridden based on the top-down "Default","Site","System" scopes.

    Defaults to selecting a volume at random from the provided volume options.

    Property Details:

    Preferred volumes can be set on a per-table basis via the custom property volume.preferred.

    This property should contain a comma separated list of Volume URIs. Since this is a custom property, it can be accessed under the prefix table.custom.
    The volume.preferred property can be set at various configuration levels depending on the scope. Note: Both the property name and the format of its value are specific to this particular implementation.

    Scope Property Lookups and Defaults locations
    Scope Property Value Lookup Default Property Lookup
    Scope.DEFAULT general.custom.volume.preferred.default Throws RuntimeException if not set
    Scope.INIT general.custom.volume.preferred.init general.custom.volume.preferred.default
    Scope.LOGGER general.custom.volume.preferred.logger general.custom.volume.preferred.default
    Scope.TABLE table.custom.volume.preferred general.custom.volume.preferred.default

    Examples of expected usage:

    • Separate metadata table and write ahead logs from general data location.
       
       // Set list of volumes
       instance.volumes=hdfs://namenode_A/accumulo,hdfs://namenode_B/general
       // Enable the preferred volume chooser
       general.volume.chooser=org.apache.accumulo.core.spi.fs.PreferredVolumeChooser
       // Set default preferred volume
       general.custom.volume.preferred.default=hdfs://namenode_B/general
       // Set write-ahead log preferred volume
       general.custom.volume.preferred.logger=hdfs://namenode_A/accumulo
       // Initialize and start accumulo
       // Once accumulo is up, open the shell and configure the metadata table to use a preferred volume
       config -t accumulo.metadata -s table.custom.volume.preferred=hdfs://namenode_A/accumulo
       
       
    • Allow general data to use all volumes, but limit a specific table to a preferred volume
       
       // Set list of volumes
       instance.volumes=hdfs://namenode/accumulo,hdfs://namenode/accumulo_select
       // Enable the preferred volume chooser
       general.volume.chooser=org.apache.accumulo.core.spi.fs.PreferredVolumeChooser
       // Set default preferred volumes
       general.custom.volume.preferred.default=hdfs://namenode/accumulo,hdfs://namenode/accumulo_select
       // Initialize and start accumulo
       // Once accumulo is up, open the shell and configure the metadata table to use a preferred volume
       config -t accumulo.metadata -s table.custom.volume.preferred=hdfs://namenode/accumulo_select
       
       
    Since:
    2.1.0