stoty commented on code in PR #6450:
URL: https://github.com/apache/hbase/pull/6450#discussion_r1833179199
##########
hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutput.java:
##########
@@ -354,10 +364,24 @@ private void setupReceiver(int timeoutMs) {
}
}
+ private static final String DUMMY_DFS_OUTPUT_STREAM_CLASS =
+ "org.apache.hadoop.hdfs.DummyDFSOutputStream";
+
+ private DFSOutputStream tryCreateDummyDFSOutputStream(EnumSet<CreateFlag>
createFlags) {
+ try {
+ return (DFSOutputStream)
Class.forName(DUMMY_DFS_OUTPUT_STREAM_CLASS).getConstructors()[0]
+ .newInstance(this, client, src, stat, createFlags, summer);
+ } catch (Exception e) {
+ LOG.debug("can not instantiate DummyDFSOutputStream, should be hadoop
2.x", e);
Review Comment:
This would log on every file open, unlike how we handle the Hadoop-version
depndent logging in other cases.
##########
hbase-asyncfs/pom.xml:
##########
@@ -194,6 +199,26 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <!--
+ We do not need this hack when building with
hadoop 2.x, so exclude it here.
Review Comment:
This is a bit misleading. The reason for the exclusion is that we cannot get
it to work otherwise.
##########
hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutput.java:
##########
@@ -354,10 +364,24 @@ private void setupReceiver(int timeoutMs) {
}
}
+ private static final String DUMMY_DFS_OUTPUT_STREAM_CLASS =
+ "org.apache.hadoop.hdfs.DummyDFSOutputStream";
+
+ private DFSOutputStream tryCreateDummyDFSOutputStream(EnumSet<CreateFlag>
createFlags) {
+ try {
+ return (DFSOutputStream)
Class.forName(DUMMY_DFS_OUTPUT_STREAM_CLASS).getConstructors()[0]
Review Comment:
Push this down to the helper, and check (and store the resolved class and
constructor handle) if the class exists when initializing the helper just like
we do for the other Hadoop-dependent cases ?
Should be faster.
--
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]