Class VolumeImpl

  • All Implemented Interfaces:
    Volume

    public class VolumeImpl
    extends Object
    implements Volume
    Basic Volume implementation that contains a FileSystem and a base path that should be used within that filesystem.
    • 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
        A FileSystem that Accumulo will use
        Specified by:
        getFileSystem in interface Volume
      • getBasePath

        public String getBasePath()
        Description copied from interface: Volume
        The base path which Accumulo will use within the given FileSystem
        Specified by:
        getBasePath in interface Volume
      • 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 interface Volume
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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 as file: or hdfs:), 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 interface Volume
        Parameters:
        pathString - The suffix to use
        Returns:
        A Path for this Volume with the provided suffix