Package org.apache.accumulo.core.spi.fs
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
AVolumeChooser
that selects a volume at random from the list of provided volumes.- Since:
- 2.1.0
-
-
Constructor Summary
Constructors Constructor Description RandomVolumeChooser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
choosable(VolumeChooserEnvironment env, Set<String> options)
Return the subset of all possible volumes that could be chosen across all invocations ofVolumeChooser.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.String
choose(VolumeChooserEnvironment env, Set<String> options)
Selects a volume at random from the provided set of volumes.
-
-
-
Method Detail
-
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 interfaceVolumeChooser
- Parameters:
env
- the server environment provided by the calling frameworkoptions
- 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 ofVolumeChooser.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 interfaceVolumeChooser
- Returns:
- same set of volume options that were originally provided.
-
-