ferhui commented on a change in pull request #3379:
URL: https://github.com/apache/hadoop/pull/3379#discussion_r702715835
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterAdminCLI.java
##########
@@ -1740,6 +1740,15 @@ public void testErrorFaultTolerant() throws Exception {
assertEquals(0, ToolRunner.run(admin, argv));
}
+ @Test
+ public void testRefreshCallQueue() throws Exception {
+
+ System.setOut(new PrintStream(out));
+ String[] argv = new String[]{"-refreshCallQueue"};
+ assertEquals(0, ToolRunner.run(admin, argv));
+ assertTrue(out.toString().contains("Refresh call queue successful"));
Review comment:
And here.
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java
##########
@@ -1258,6 +1262,39 @@ public int genericRefresh(String[] argv, int i) throws
IOException {
}
}
+ /**
+ * Refresh Router's call Queue.
+ *
+ * @throws IOException if the operation was not successful.
+ */
+ private int refreshCallQueue() throws IOException {
+ Configuration conf = getConf();
+ String hostport = getConf().getTrimmed(
+ RBFConfigKeys.DFS_ROUTER_ADMIN_ADDRESS_KEY,
+ RBFConfigKeys.DFS_ROUTER_ADMIN_ADDRESS_DEFAULT);
+
+ // Create the client
+ Class<?> xface = RefreshCallQueueProtocolPB.class;
+ InetSocketAddress address = NetUtils.createSocketAddr(hostport);
+ UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
+
+ RPC.setProtocolEngine(conf, xface, ProtobufRpcEngine2.class);
+ RefreshCallQueueProtocolPB proxy =
(RefreshCallQueueProtocolPB)RPC.getProxy(
+ xface, RPC.getProtocolVersion(xface), address, ugi, conf,
+ NetUtils.getDefaultSocketFactory(conf), 0);
+
+ int returnCode = -1;
+ try (RefreshCallQueueProtocolClientSideTranslatorPB xlator =
+ new RefreshCallQueueProtocolClientSideTranslatorPB(proxy)) {
+ xlator.refreshCallQueue();
+ System.out.println("Refresh call queue successful for " + hostport);
Review comment:
here successfully?the bellow should be unsuccessfully?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]