This is an automated email from the ASF dual-hosted git repository.
KeeProMise pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 8157ff70669 HDFS-17889: [ARR] Enable the router asynchronous RPC
feature to handle getHAServiceState. (#8297). Contributed by dParikesit.
8157ff70669 is described below
commit 8157ff70669cc4dbeeeca497b136d214f3207375
Author: Dimas Shidqi Parikesit <[email protected]>
AuthorDate: Fri May 15 04:38:38 2026 -0400
HDFS-17889: [ARR] Enable the router asynchronous RPC feature to handle
getHAServiceState. (#8297). Contributed by dParikesit.
Reviewed-by: Jian Zhang <[email protected]>
---
.../router/async/RouterAsyncClientProtocol.java | 7 +++++++
.../federation/router/async/TestRouterAsyncRpc.java | 17 +++++++++++++++++
2 files changed, 24 insertions(+)
diff --git
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/async/RouterAsyncClientProtocol.java
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/async/RouterAsyncClientProtocol.java
index b421c8f39eb..78b6f8641c7 100644
---
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/async/RouterAsyncClientProtocol.java
+++
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/async/RouterAsyncClientProtocol.java
@@ -71,6 +71,7 @@
import org.apache.hadoop.util.Time;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.apache.hadoop.ha.HAServiceProtocol;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -1214,4 +1215,10 @@ public void
cancelDelegationToken(Token<DelegationTokenIdentifier> token)
asyncComplete(null);
}
+ @Override
+ public HAServiceProtocol.HAServiceState getHAServiceState() {
+ asyncComplete(super.getHAServiceState());
+ return asyncReturn(HAServiceProtocol.HAServiceState.class);
+ }
+
}
diff --git
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/async/TestRouterAsyncRpc.java
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/async/TestRouterAsyncRpc.java
index aa0e2c5cd6c..50193cd5322 100644
---
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/async/TestRouterAsyncRpc.java
+++
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/async/TestRouterAsyncRpc.java
@@ -28,8 +28,18 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
+import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedEntries;
+import org.apache.hadoop.fs.FSDataOutputStream;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hdfs.protocol.ClientProtocol;
+import org.apache.hadoop.hdfs.protocol.LocatedBlock;
+import org.apache.hadoop.hdfs.protocol.OpenFilesIterator;
import java.util.concurrent.TimeUnit;
+import org.apache.hadoop.ha.HAServiceProtocol.HAServiceState;
+import org.apache.hadoop.ipc.RemoteException;
+import java.lang.reflect.Method;
+import java.util.EnumSet;
import static
org.apache.hadoop.hdfs.server.federation.router.RBFConfigKeys.DFS_ROUTER_ASYNC_RPC_ENABLE_KEY;
import static
org.apache.hadoop.hdfs.server.federation.router.RBFConfigKeys.DFS_ROUTER_ASYNC_RPC_HANDLER_COUNT_KEY;
@@ -38,6 +48,7 @@
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
/**
* Testing the asynchronous RPC functionality of the router.
@@ -98,4 +109,10 @@ public void testGetDelegationTokenAsyncRpc() throws
Exception {
rndRouter.getFileSystem().getDelegationToken(ugi.getShortUserName());
});
}
+
+ @Test
+ public void testProxyGetHAServiceStateAsync() throws Exception {
+ HAServiceState state = getRouterProtocol().getHAServiceState();
+ assertNotNull(state);
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]