Package org.apache.accumulo.core.spi.fs
Interface VolumeChooser
-
- All Known Implementing Classes:
DelegatingChooser
,PreferredVolumeChooser
,RandomVolumeChooser
,SpaceAwareVolumeChooser
public interface VolumeChooser
Helper used to select from a set of Volume URIs. N.B. implementations must be threadsafe. VolumeChooser.equals will be used for internal caching.Implementations may wish to store configuration in Accumulo's system configuration using the
Property.GENERAL_ARBITRARY_PROP_PREFIX
. They may also benefit from using per-table configuration usingProperty.TABLE_ARBITRARY_PROP_PREFIX
.- Since:
- 2.1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<String>
choosable(VolumeChooserEnvironment env, Set<String> options)
Return the subset of volumes that could possibly be chosen by this chooser across all invocations ofchoose(VolumeChooserEnvironment, Set)
.String
choose(VolumeChooserEnvironment env, Set<String> options)
Choose a volume from the provided options.
-
-
-
Method Detail
-
choose
String choose(VolumeChooserEnvironment env, Set<String> options)
Choose a volume from the provided options.- Parameters:
env
- the server environment provided by the calling frameworkoptions
- the list of volumes to choose from- Returns:
- one of the options
-
choosable
Set<String> choosable(VolumeChooserEnvironment env, Set<String> options)
Return the subset of volumes that could possibly be chosen by this chooser across all invocations ofchoose(VolumeChooserEnvironment, Set)
. Currently this is used to determine if all of the volumes that could be chosen for write ahead logs support the needed filesystem operations. There may be other use cases in the future.- Parameters:
env
- the server environment provided by the calling frameworkoptions
- the subset of volumes to choose from- Returns:
- array of valid options
-
-