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
A
VolumeChooser
that selects a volume at random from the list of provided volumes.- Since:
- 2.1.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionchoosable
(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.choose
(VolumeChooserEnvironment env, Set<String> options) Selects a volume at random from the provided set of volumes.
-
Constructor Details
-
RandomVolumeChooser
public RandomVolumeChooser()
-
-
Method Details
-
choose
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
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.
-