Package org.apache.accumulo.core.volume
Class VolumeImpl
- java.lang.Object
-
- org.apache.accumulo.core.volume.VolumeImpl
-
-
Constructor Summary
Constructors Constructor Description VolumeImpl(org.apache.hadoop.fs.FileSystem fs, String basePath)
VolumeImpl(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration hadoopConf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsPath(org.apache.hadoop.fs.Path path)
Determine if the Path is contained in Volume.boolean
equals(Object o)
String
getBasePath()
The base path which Accumulo will use within the givenFileSystem
org.apache.hadoop.fs.FileSystem
getFileSystem()
AFileSystem
that Accumulo will useint
hashCode()
org.apache.hadoop.fs.Path
prefixChild(String pathString)
Convert the given child path into a Path that is relative to the base path for this Volume.String
toString()
-
-
-
Constructor Detail
-
VolumeImpl
public VolumeImpl(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration hadoopConf) throws IOException
- Throws:
IOException
-
VolumeImpl
public VolumeImpl(org.apache.hadoop.fs.FileSystem fs, String basePath)
-
-
Method Detail
-
getFileSystem
public org.apache.hadoop.fs.FileSystem getFileSystem()
Description copied from interface:Volume
AFileSystem
that Accumulo will use- Specified by:
getFileSystem
in interfaceVolume
-
getBasePath
public String getBasePath()
Description copied from interface:Volume
The base path which Accumulo will use within the givenFileSystem
- Specified by:
getBasePath
in interfaceVolume
-
containsPath
public boolean containsPath(org.apache.hadoop.fs.Path path)
Description copied from interface:Volume
Determine if the Path is contained in Volume. A Path is considered contained if refers to a location within the base path for this Volume on the same FileSystem. It can be located at the base path, or within any sub-directory. Unqualified paths (those without a file system scheme) will resolve to using the configured Hadoop default file system before comparison. Paths are not considered "contained" within this Volume if they have any relative path "breakout" patterns, such as../
.- Specified by:
containsPath
in interfaceVolume
-
prefixChild
public org.apache.hadoop.fs.Path prefixChild(String pathString)
Description copied from interface:Volume
Convert the given child path into a Path that is relative to the base path for this Volume. The supplied path should not include any scheme (such asfile:
orhdfs:
), and should not contain any relative path "breakout" patterns, such as../
. If the path begins with a single slash, it will be preserved while prefixing this volume. If it does not begin with a single slash, one will be inserted.- Specified by:
prefixChild
in interfaceVolume
- Parameters:
pathString
- The suffix to use- Returns:
- A Path for this Volume with the provided suffix
-
-