Browse Source

HDDS-1174. Freon tests are failing with null pointer exception.
Contributed by Shashikant Banerjee.

Anu Engineer 6 years ago
parent
commit
a5a751b418

+ 6 - 2
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java

@@ -215,7 +215,9 @@ public final class RandomKeyGenerator implements Callable<Void> {
     for (FreonOps ops : FreonOps.values()) {
       histograms.add(ops.ordinal(), new Histogram(new UniformReservoir()));
     }
-    freon.startHttpServer();
+    if (freon != null) {
+      freon.startHttpServer();
+    }
   }
 
   @Override
@@ -296,7 +298,9 @@ public final class RandomKeyGenerator implements Callable<Void> {
     Runtime.getRuntime().addShutdownHook(
         new Thread(() -> {
           printStats(System.out);
-          freon.stopHttpServer();
+          if (freon != null) {
+            freon.stopHttpServer();
+          }
         }));
   }
   /**