Skip to content

Commit

Permalink
HBASE-22103. HDFS-13209 in Hadoop 3.3.0 breaks asyncwal. (#1284)
Browse files Browse the repository at this point in the history
Signed-off-by: Duo Zhang <[email protected]>
  • Loading branch information
jojochuang authored Mar 17, 2020
1 parent 795e988 commit 60de4c2
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,18 @@ public void end(DFSClient client, long inodeId) {
};
}

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,
Expand All @@ -246,6 +258,12 @@ private static FileCreator createFileCreator2() 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 {
return createFileCreator3();
} catch (NoSuchMethodException e) {
Expand Down

0 comments on commit 60de4c2

Please sign in to comment.