Package org.apache.hadoop.hbase.util
Class RecoverLeaseFSUtils
java.lang.Object
org.apache.hadoop.hbase.util.RecoverLeaseFSUtils
Utility methods for recovering file lease for hdfs.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static void
checkIfCancelled
(CancelableProgressable reporter) 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.
-
Field Details
-
LOG
-
-
Constructor Details
-
RecoverLeaseFSUtils
private RecoverLeaseFSUtils()
-
-
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
- Throws:
InterruptedIOException
-