ndimiduk commented on a change in pull request #1335: HBASE-24000 Simplify
CommonFSUtils after upgrading to hadoop 2.10.0
URL: https://github.com/apache/hbase/pull/1335#discussion_r397528874
##########
File path:
hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java
##########
@@ -759,200 +739,75 @@ public static void
checkShortCircuitReadBufferSize(final Configuration conf) {
conf.setIfUnset(dfsKey, Integer.toString(hbaseSize));
}
- private static class DfsBuilderUtility {
- static Class<?> dfsClass = null;
- static Method createMethod;
- static Method overwriteMethod;
- static Method bufferSizeMethod;
- static Method blockSizeMethod;
- static Method recursiveMethod;
- static Method replicateMethod;
- static Method replicationMethod;
- static Method buildMethod;
- static boolean allMethodsPresent = false;
+ private static final class DfsBuilderUtility {
+ private static final Class<?> BUILDER;
+ private static final Method REPLICATE;
static {
- String dfsName = "org.apache.hadoop.hdfs.DistributedFileSystem";
- String builderName = dfsName + "$HdfsDataOutputStreamBuilder";
+ String builderName =
"org.apache.hadoop.hdfs.DistributedFileSystem$HdfsDataOutputStreamBuilder";
Review comment:
`DistributedFileSystem` appears to exist since 2.10, so can this string be
built from a class reference? For example,
```java
String buildName = DistributedFileSystem.class.getName() +
"$HdfsDataOutputStreamBuilder";
```
Looks like hbase-common module doesn't depend on hadoop-hdfs-client jar, so
maybe this gets too weird for a "cleanup" patch. Would be nice though, to use
whatever static references we can...
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services