瀏覽代碼

HDFS-14502. keepResults option in NNThroughputBenchmark should call saveNamespace(). Contributed by Konstantin V Shvachko.

Konstantin V Shvachko 6 年之前
父節點
當前提交
9836bac35c

+ 5 - 0
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/NNThroughputBenchmark.java

@@ -287,6 +287,11 @@ public class NNThroughputBenchmark implements Tool {
           false);
           false);
       if(!keepResults)
       if(!keepResults)
         clientProto.delete(getBaseDir(), true);
         clientProto.delete(getBaseDir(), true);
+      else {
+        clientProto.setSafeMode(HdfsConstants.SafeModeAction.SAFEMODE_ENTER,
+            true);
+        clientProto.saveNamespace(0, 0);
+      }
     }
     }
 
 
     int getNumOpsExecuted() {
     int getNumOpsExecuted() {