Class RandomVolumeChooser

java.lang.Object
org.apache.accumulo.core.spi.fs.RandomVolumeChooser
All Implemented Interfaces:
VolumeChooser
Direct Known Subclasses:
PreferredVolumeChooser

public class RandomVolumeChooser extends Object implements VolumeChooser
A VolumeChooser that selects a volume at random from the list of provided volumes.
Since:
2.1.0
  • Constructor Details

    • RandomVolumeChooser

      public RandomVolumeChooser()
  • Method Details

    • choose

      public String choose(VolumeChooserEnvironment env, Set<String> options)
      Selects a volume at random from the provided set of volumes. The environment scope is not utilized.
      Specified by:
      choose in interface VolumeChooser
      Parameters:
      env - the server environment provided by the calling framework
      options - the list of volumes to choose from
      Returns:
      a volume from the list of volume options
    • choosable

      public Set<String> choosable(VolumeChooserEnvironment env, Set<String> options)
      Description copied from interface: VolumeChooser
      Return the subset of all possible volumes that could be chosen across all invocations of VolumeChooser.choose(VolumeChooserEnvironment, Set).
      This is currently used to determine if the chosen volumes can support the required filesystem operations for write ahead logs.
      There may be other use cases in the future.
      Specified by:
      choosable in interface VolumeChooser
      Returns:
      same set of volume options that were originally provided.