You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/04/04 04:13:32 UTC

[GitHub] [hadoop] singer-bin commented on a diff in pull request #4069: HDFS-16457.Make fs.getspaceused.classname reconfigurable

singer-bin commented on code in PR #4069:
URL: https://github.com/apache/hadoop/pull/4069#discussion_r841353288


##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeReconfiguration.java:
##########
@@ -756,4 +759,33 @@ public void testDfsUsageParameters() throws ReconfigurationException {
       }
     }
   }
+
+  public static class DummyCachingGetSpaceUsed extends CachingGetSpaceUsed {
+    public DummyCachingGetSpaceUsed(Builder builder) throws IOException {
+      super(builder.setInterval(1000).setJitter(0L));
+    }
+
+    @Override
+    protected void refresh() {
+      counter++;
+    }
+  }
+
+  @Test
+  public void testDfsUsageKlass() throws IOException, ReconfigurationException,
+          InterruptedException {
+
+    long lastCounter = counter;
+    Thread.sleep(5000);
+    assertTrue(counter > lastCounter);
+
+    for (int i = 0; i < NUM_DATA_NODE; i++) {
+      DataNode dn = cluster.getDataNodes().get(i);
+      dn.reconfigurePropertyImpl(FS_GETSPACEUSED_CLASSNAME, null);
+    }
+
+    lastCounter = counter;
+    Thread.sleep(5000);
+    assertEquals(lastCounter, counter);
+ }

Review Comment:
   Thank you very much for your comment, I will consider it. @tasanuma 



-- 
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: dev-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: dev-help@hadoop.apache.org