Skip to content

Commit 7b2fe82

Browse files
jojochuangApache9
authored andcommitted
HBASE-22103. HDFS-13209 in Hadoop 3.3.0 breaks asyncwal. (#1284)
Signed-off-by: Duo Zhang <[email protected]>
1 parent 3366d64 commit 7b2fe82

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

hbase-server/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutputHelper.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,18 @@ public void end(DFSClient client, long inodeId) {
221221
};
222222
}
223223

224+
private static FileCreator createFileCreator3_3() throws NoSuchMethodException {
225+
Method createMethod = ClientProtocol.class.getMethod("create", String.class, FsPermission.class,
226+
String.class, EnumSetWritable.class, boolean.class, short.class, long.class,
227+
CryptoProtocolVersion[].class, String.class, String.class);
228+
229+
return (instance, src, masked, clientName, flag, createParent, replication, blockSize,
230+
supportedVersions) -> {
231+
return (HdfsFileStatus) createMethod.invoke(instance, src, masked, clientName, flag,
232+
createParent, replication, blockSize, supportedVersions, null, null);
233+
};
234+
}
235+
224236
private static FileCreator createFileCreator3() throws NoSuchMethodException {
225237
Method createMethod = ClientProtocol.class.getMethod("create", String.class, FsPermission.class,
226238
String.class, EnumSetWritable.class, boolean.class, short.class, long.class,
@@ -246,6 +258,12 @@ private static FileCreator createFileCreator2() throws NoSuchMethodException {
246258
}
247259

248260
private static FileCreator createFileCreator() throws NoSuchMethodException {
261+
try {
262+
return createFileCreator3_3();
263+
} catch (NoSuchMethodException e) {
264+
LOG.debug("ClientProtocol::create wrong number of arguments, should be hadoop 3.2 or below");
265+
}
266+
249267
try {
250268
return createFileCreator3();
251269
} catch (NoSuchMethodException e) {

0 commit comments

Comments
 (0)