Class HFileArchiver.File

java.lang.Object
org.apache.hadoop.hbase.backup.HFileArchiver.File
Direct Known Subclasses:
HFileArchiver.FileablePath, HFileArchiver.FileableStoreFile
Enclosing class:
HFileArchiver

private abstract static class HFileArchiver.File extends Object
Wrapper to handle file operations uniformly
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.apache.hadoop.fs.FileSystem
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    File(org.apache.hadoop.fs.FileSystem fs)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) abstract void
    close any outside readers of the file
    (package private) abstract void
    Delete the file
    (package private) abstract Collection<HFileArchiver.File>
     
    org.apache.hadoop.fs.FileSystem
    Returns the FileSystem on which this file resides
    (package private) abstract String
    Returns the name of the file (not the full fs path, just the individual file name)
    (package private) abstract org.apache.hadoop.fs.Path
    Returns the path to this file
    (package private) abstract boolean
    Check to see if this is a file or a directory
    boolean
    moveAndClose(org.apache.hadoop.fs.Path dest)
    Move the file to the given destination
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • fs

      protected final org.apache.hadoop.fs.FileSystem fs
  • Constructor Details

    • File

      public File(org.apache.hadoop.fs.FileSystem fs)
  • Method Details

    • delete

      abstract void delete() throws IOException
      Delete the file
      Throws:
      IOException - on failure
    • isFile

      abstract boolean isFile() throws IOException
      Check to see if this is a file or a directory
      Returns:
      true if it is a file, false otherwise
      Throws:
      IOException - on FileSystem connection error
    • getChildren

      Returns:
      if this is a directory, returns all the children in the directory, otherwise returns an empty list
      Throws:
      IOException
    • close

      abstract void close() throws IOException
      close any outside readers of the file
      Throws:
      IOException
    • getName

      abstract String getName()
      Returns the name of the file (not the full fs path, just the individual file name)
    • getPath

      abstract org.apache.hadoop.fs.Path getPath()
      Returns the path to this file
    • moveAndClose

      public boolean moveAndClose(org.apache.hadoop.fs.Path dest) throws IOException
      Move the file to the given destination
      Returns:
      true on success
      Throws:
      IOException
    • getFileSystem

      public org.apache.hadoop.fs.FileSystem getFileSystem()
      Returns the FileSystem on which this file resides
    • toString

      public String toString()
      Overrides:
      toString in class Object