stoty commented on code in PR #6342: URL: https://github.com/apache/hbase/pull/6342#discussion_r1793279071
########## hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/util/RecoverLeaseFSUtils.java: ########## @@ -81,7 +106,7 @@ public static void recoverFileLease(FileSystem fs, Path p, Configuration conf, * false, repeat starting at step 5. above. If HDFS-4525 is available, call it every second, and * we might be able to exit early. */ - private static boolean recoverDFSFileLease(final DistributedFileSystem dfs, final Path p, + private static boolean recoverDFSFileLease(final Object dfs, final Path p, Review Comment: Can't we use a more specific class here ? ########## hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/util/RecoverLeaseFSUtils.java: ########## @@ -48,18 +60,31 @@ public static void recoverFileLease(FileSystem fs, Path p, Configuration conf) } /** - * Recover the lease from HDFS, retrying multiple times. + * Recover the lease from HDFS or LeaseRecoverable fs, retrying multiple times. Review Comment: Just call it Filesystem ? or maybe HadoopFS ? ########## hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/util/RecoverLeaseFSUtils.java: ########## @@ -167,21 +192,25 @@ private static boolean checkIfTimedout(final Configuration conf, final long reco * Try to recover the lease. * @return True if dfs#recoverLease came by true. */ - private static boolean recoverLease(final DistributedFileSystem dfs, final int nbAttempt, - final Path p, final long startWaiting) throws FileNotFoundException { + private static boolean recoverLease(final Object dfs, final int nbAttempt, final Path p, + final long startWaiting) throws FileNotFoundException { boolean recovered = false; try { - recovered = dfs.recoverLease(p); + recovered = (Boolean) dfs.getClass().getMethod("recoverLease", new Class[] { Path.class }) Review Comment: Maybe move the reflection logic to FSUtils ? ########## hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/util/RecoverLeaseFSUtils.java: ########## @@ -167,21 +192,25 @@ private static boolean checkIfTimedout(final Configuration conf, final long reco * Try to recover the lease. * @return True if dfs#recoverLease came by true. */ - private static boolean recoverLease(final DistributedFileSystem dfs, final int nbAttempt, - final Path p, final long startWaiting) throws FileNotFoundException { + private static boolean recoverLease(final Object dfs, final int nbAttempt, final Path p, + final long startWaiting) throws FileNotFoundException { boolean recovered = false; try { - recovered = dfs.recoverLease(p); + recovered = (Boolean) dfs.getClass().getMethod("recoverLease", new Class[] { Path.class }) Review Comment: We usually determine the handle in a staic initializer, and use the stored handle in the calls. ########## hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/util/RecoverLeaseFSUtils.java: ########## @@ -167,21 +192,25 @@ private static boolean checkIfTimedout(final Configuration conf, final long reco * Try to recover the lease. * @return True if dfs#recoverLease came by true. */ - private static boolean recoverLease(final DistributedFileSystem dfs, final int nbAttempt, - final Path p, final long startWaiting) throws FileNotFoundException { + private static boolean recoverLease(final Object dfs, final int nbAttempt, final Path p, Review Comment: Can we use a more specific class ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org