浏览代码

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

Konstantin V Shvachko 6 年之前
父节点
当前提交
2afc770443

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

@@ -286,6 +286,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();
+      }
     }
     }
 
 
     int getNumOpsExecuted() {
     int getNumOpsExecuted() {