[ 
https://issues.apache.org/jira/browse/HDFS-17210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17773386#comment-17773386
 ] 

ASF GitHub Bot commented on HDFS-17210:
---------------------------------------

GuoPhilipse commented on code in PR #6113:
URL: https://github.com/apache/hadoop/pull/6113#discussion_r1350476785


##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestAvailableSpaceBlockPlacementPolicy.java:
##########
@@ -219,6 +222,77 @@ public void testChooseSimilarDataNode() {
             tolerateDataNodes[0], false) == 1);
   }
 
+
+  @Test
+  public void testCompareDataNode() {
+    DatanodeDescriptor[] tolerateDataNodes;
+    DatanodeStorageInfo[] tolerateStorages;
+    int capacity  = 5;
+    Collection<Node> allTolerateNodes = new ArrayList<>(capacity);
+    String[] ownerRackOfTolerateNodes = new String[capacity];
+    for (int i = 0; i < capacity; i++) {
+      ownerRackOfTolerateNodes[i] = "rack"+i;
+    }
+    tolerateStorages = 
DFSTestUtil.createDatanodeStorageInfos(ownerRackOfTolerateNodes);
+    tolerateDataNodes = DFSTestUtil.toDatanodeDescriptor(tolerateStorages);
+
+    Collections.addAll(allTolerateNodes, tolerateDataNodes);
+    final BlockManager bm = namenode.getNamesystem().getBlockManager();
+    AvailableSpaceBlockPlacementPolicy toleratePlacementPolicy =
+            (AvailableSpaceBlockPlacementPolicy)bm.getBlockPlacementPolicy();

Review Comment:
   Thanks @Hexiaoqiao , will fix the checkstyle soon~





> Optimize AvailableSpaceBlockPlacementPolicy
> -------------------------------------------
>
>                 Key: HDFS-17210
>                 URL: https://issues.apache.org/jira/browse/HDFS-17210
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: hdfs
>    Affects Versions: 3.3.6
>            Reporter: Fei Guo
>            Priority: Minor
>              Labels: pull-request-available
>
> for now ,we may have many nodes usage over 85%, some nodes'usage have been 
> over 90%, if we choose three nodes as nodeA-97%,nodeB-98%,nodeC-99%, actually 
> i don't want nodeC(99%) be choosen, for nodeC usage is really high , even 
> random chance ,nodeC will reach 100% soon, so we can directly choose the less 
> usage node(nodeA) if all nodes's usage are over 95%(just a example)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to