Package org.apache.accumulo.core.spi.fs
Class SpaceAwareVolumeChooser
- java.lang.Object
-
- org.apache.accumulo.core.spi.fs.RandomVolumeChooser
-
- org.apache.accumulo.core.spi.fs.PreferredVolumeChooser
-
- org.apache.accumulo.core.spi.fs.SpaceAwareVolumeChooser
-
- All Implemented Interfaces:
VolumeChooser
public class SpaceAwareVolumeChooser extends PreferredVolumeChooser
APreferredVolumeChooser
that takes remaining HDFS space into account when making a volume choice rather than a simpler round-robin. The list of volumes to use can be limited using the same properties asPreferredVolumeChooser
- Since:
- 2.1.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
RECOMPUTE_INTERVAL
-
Constructor Summary
Constructors Constructor Description SpaceAwareVolumeChooser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
choose(VolumeChooserEnvironment env, Set<String> options)
Selects a volume at random from the provided set of volumes.protected double
getFreeSpace(String uri)
-
Methods inherited from class org.apache.accumulo.core.spi.fs.PreferredVolumeChooser
choosable
-
-
-
-
Field Detail
-
RECOMPUTE_INTERVAL
public static final String RECOMPUTE_INTERVAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getFreeSpace
protected double getFreeSpace(String uri) throws IOException
- Throws:
IOException
-
choose
public String choose(VolumeChooserEnvironment env, Set<String> options)
Description copied from class:RandomVolumeChooser
Selects a volume at random from the provided set of volumes. The environment scope is not utilized.- Specified by:
choose
in interfaceVolumeChooser
- Overrides:
choose
in classPreferredVolumeChooser
- 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
-
-