Class RecoverLeaseFSUtils

java.lang.Object
org.apache.hadoop.hbase.util.RecoverLeaseFSUtils

@Private public final class RecoverLeaseFSUtils extends Object
Utility methods for recovering file lease for hdfs.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static void
     
    private static boolean
    checkIfTimedout(org.apache.hadoop.conf.Configuration conf, long recoveryTimeout, int nbAttempt, org.apache.hadoop.fs.Path p, long startWaiting)
     
    private static String
    getLogMessageDetail(int nbAttempt, org.apache.hadoop.fs.Path p, long startWaiting)
    Returns Detail to append to any log message around lease recovering.
    private static boolean
    isFileClosed(org.apache.hadoop.hdfs.DistributedFileSystem dfs, Method m, org.apache.hadoop.fs.Path p)
    Call HDFS-4525 isFileClosed if it is available.
    private static boolean
    recoverDFSFileLease(org.apache.hadoop.hdfs.DistributedFileSystem dfs, org.apache.hadoop.fs.Path p, org.apache.hadoop.conf.Configuration conf, CancelableProgressable reporter)
     
    static void
    recoverFileLease(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path p, org.apache.hadoop.conf.Configuration conf)
     
    static void
    recoverFileLease(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path p, org.apache.hadoop.conf.Configuration conf, CancelableProgressable reporter)
    Recover the lease from HDFS, retrying multiple times.
    private static boolean
    recoverLease(org.apache.hadoop.hdfs.DistributedFileSystem dfs, int nbAttempt, org.apache.hadoop.fs.Path p, long startWaiting)
    Try to recover the lease.

    Methods inherited from class java.lang.Object

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

    • LOG

      private static final org.slf4j.Logger LOG
  • Constructor Details

  • Method Details

    • recoverFileLease

      public static void recoverFileLease(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path p, org.apache.hadoop.conf.Configuration conf) throws IOException
      Throws:
      IOException
    • recoverFileLease

      public static void recoverFileLease(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path p, org.apache.hadoop.conf.Configuration conf, CancelableProgressable reporter) throws IOException
      Recover the lease from HDFS, retrying multiple times.
      Throws:
      IOException
    • recoverDFSFileLease

      private static boolean recoverDFSFileLease(org.apache.hadoop.hdfs.DistributedFileSystem dfs, org.apache.hadoop.fs.Path p, org.apache.hadoop.conf.Configuration conf, CancelableProgressable reporter) throws IOException
      Throws:
      IOException
    • checkIfTimedout

      private static boolean checkIfTimedout(org.apache.hadoop.conf.Configuration conf, long recoveryTimeout, int nbAttempt, org.apache.hadoop.fs.Path p, long startWaiting)
    • recoverLease

      private static boolean recoverLease(org.apache.hadoop.hdfs.DistributedFileSystem dfs, int nbAttempt, org.apache.hadoop.fs.Path p, long startWaiting) throws FileNotFoundException
      Try to recover the lease.
      Returns:
      True if dfs#recoverLease came by true.
      Throws:
      FileNotFoundException
    • getLogMessageDetail

      private static String getLogMessageDetail(int nbAttempt, org.apache.hadoop.fs.Path p, long startWaiting)
      Returns Detail to append to any log message around lease recovering.
    • isFileClosed

      private static boolean isFileClosed(org.apache.hadoop.hdfs.DistributedFileSystem dfs, Method m, org.apache.hadoop.fs.Path p)
      Call HDFS-4525 isFileClosed if it is available.
      Returns:
      True if file is closed.
    • checkIfCancelled

      private static void checkIfCancelled(CancelableProgressable reporter) throws InterruptedIOException
      Throws:
      InterruptedIOException