wchevreuil commented on code in PR #8960:
URL: https://github.com/apache/hbase/pull/8960#discussion_r4799146567
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java:
##########
@@ -110,6 +112,41 @@ public final class FSUtils {
private static final String THREAD_POOLSIZE =
"hbase.client.localityCheck.threadPoolSize";
private static final int DEFAULT_THREAD_POOLSIZE = 2;
+ private enum OpenFileSupport {
+ SUPPORTED,
+ LEGACY_OPEN,
+ TRANSPARENT
+ }
+
+ private static final ClassValue<OpenFileSupport> OPEN_FILE_SUPPORT_BY_CLASS =
+ new ClassValue<OpenFileSupport>() {
+ @Override
+ protected OpenFileSupport computeValue(Class<?> type) {
+ if (!FilterFileSystem.class.isAssignableFrom(type)) {
+ return OpenFileSupport.SUPPORTED;
+ }
+ try {
+ boolean overridesOpen = type.getMethod("open", Path.class,
int.class).getDeclaringClass()
+ != FilterFileSystem.class;
+ boolean overridesOpenFile =
+ type.getMethod("openFile", Path.class).getDeclaringClass() !=
FilterFileSystem.class;
+ if (overridesOpenFile) {
+ return OpenFileSupport.SUPPORTED;
+ }
Review Comment:
This looks legit. Does it also affect the original commit being backported?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]