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:
parent
795e9887b5
commit
60de4c2e31
|
@ -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 {
|
private static FileCreator createFileCreator3() throws NoSuchMethodException {
|
||||||
Method createMethod = ClientProtocol.class.getMethod("create", String.class, FsPermission.class,
|
Method createMethod = ClientProtocol.class.getMethod("create", String.class, FsPermission.class,
|
||||||
String.class, EnumSetWritable.class, boolean.class, short.class, long.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 {
|
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 {
|
try {
|
||||||
return createFileCreator3();
|
return createFileCreator3();
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException e) {
|
||||||
|
|
Loading…
Reference in New Issue