HBASE-22103. HDFS-13209 in Hadoop 3.3.0 breaks asyncwal. (#1284)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
Wei-Chiu Chuang 2020-03-16 23:36:56 -07:00 committed by Duo Zhang
parent 3366d64046
commit 7b2fe82be3
1 changed files with 18 additions and 0 deletions

View File

@ -221,6 +221,18 @@ public final class FanOutOneBlockAsyncDFSOutputHelper {
};
}
private static FileCreator createFileCreator3_3() throws NoSuchMethodException {
Method createMethod = ClientProtocol.class.getMethod("create", String.class, FsPermission.class,
String.class, EnumSetWritable.class, boolean.class, short.class, long.class,
CryptoProtocolVersion[].class, String.class, String.class);
return (instance, src, masked, clientName, flag, createParent, replication, blockSize,
supportedVersions) -> {
return (HdfsFileStatus) createMethod.invoke(instance, src, masked, clientName, flag,
createParent, replication, blockSize, supportedVersions, null, null);
};
}
private static FileCreator createFileCreator3() throws NoSuchMethodException {
Method createMethod = ClientProtocol.class.getMethod("create", String.class, FsPermission.class,
String.class, EnumSetWritable.class, boolean.class, short.class, long.class,
@ -246,6 +258,12 @@ public final class FanOutOneBlockAsyncDFSOutputHelper {
}
private static FileCreator createFileCreator() throws NoSuchMethodException {
try {
return createFileCreator3_3();
} catch (NoSuchMethodException e) {
LOG.debug("ClientProtocol::create wrong number of arguments, should be hadoop 3.2 or below");
}
try {
return createFileCreator3();
} catch (NoSuchMethodException e) {