[ https://issues.apache.org/jira/browse/HDFS-17735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17934564#comment-17934564 ]
ASF GitHub Bot commented on HDFS-17735: --------------------------------------- KeeProMise commented on code in PR #7422: URL: https://github.com/apache/hadoop/pull/7422#discussion_r1991722010 ########## hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/async/TestRouterAsyncRPCMultipleDestinationMountTableResolver.java: ########## @@ -84,6 +97,43 @@ public static void setUp() throws Exception { rpcServer =routerContext.getRouter().getRpcServer(); } + @Test + public void testLocalResolverGetDatanodesSubcluster() throws IOException { + String testPath = "/testLocalResolverGetDatanodesSubcluster"; + Path path = new Path(testPath); + Map<String, String> destMap = new HashMap<>(); + destMap.put("ns0", testPath); + destMap.put("ns1", testPath); + nnFs0.mkdirs(path); + nnFs1.mkdirs(path); + MountTable addEntry = + MountTable.newInstance(testPath, destMap); + addEntry.setQuota(new RouterQuotaUsage.Builder().build()); + addEntry.setDestOrder(DestinationOrder.LOCAL); + assertTrue(addMountTable(addEntry)); + + Map<String, String> datanodesSubcluster = null; + try { + MultipleDestinationMountTableResolver resolver = + (MultipleDestinationMountTableResolver) routerContext.getRouter().getSubclusterResolver(); + LocalResolver localResolver = + (LocalResolver) resolver.getOrderedResolver(DestinationOrder.LOCAL); + datanodesSubcluster = localResolver.getDatanodesSubcluster(); + } catch (Exception e) { + LOG.info("Exception occurs when testLocalResolverGetDatanodesSubcluster.", e); + } finally { + RouterClient client = routerContext.getAdminClient(); + MountTableManager mountTableManager = client.getMountTableManager(); + RemoveMountTableEntryRequest req2 = + RemoveMountTableEntryRequest.newInstance(testPath); + mountTableManager.removeMountTableEntry(req2); + nnFs0.delete(new Path(testPath), true); + nnFs1.delete(new Path(testPath), true); + } + assertNotNull(datanodesSubcluster); + assertTrue(!datanodesSubcluster.isEmpty()); Review Comment: assertFalse(datanodesSubcluster.isEmpty()) > [ARR] LocalResolver#getDatanodesSubcluster adapts to async rpc > -------------------------------------------------------------- > > Key: HDFS-17735 > URL: https://issues.apache.org/jira/browse/HDFS-17735 > Project: Hadoop HDFS > Issue Type: Sub-task > Components: rbf > Reporter: farmmamba > Assignee: farmmamba > Priority: Major > Labels: pull-request-available > > LocalResolver#getDatanodesSubcluster adapts to async rpc -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org