diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java index 80dd69b8cd9..67fc46015d6 100644 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java @@ -687,9 +687,10 @@ private static class ExternalCompactionsSnapshot { public final RunningCompactions runningCompactions; public final Map ecRunningMap; - private ExternalCompactionsSnapshot(Map ecRunningMap) { - this.ecRunningMap = Collections.unmodifiableMap(ecRunningMap); - this.runningCompactions = new RunningCompactions(ecRunningMap); + private ExternalCompactionsSnapshot(Optional> ecRunningMapOpt) { + this.ecRunningMap = + ecRunningMapOpt.map(Collections::unmodifiableMap).orElse(Collections.emptyMap()); + this.runningCompactions = new RunningCompactions(this.ecRunningMap); } } @@ -707,7 +708,7 @@ private ExternalCompactionsSnapshot computeExternalCompactionsSnapshot() { throw new IllegalStateException("Unable to get running compactions from " + ccHost, e); } - return new ExternalCompactionsSnapshot(running.getCompactions()); + return new ExternalCompactionsSnapshot(Optional.ofNullable(running.getCompactions())); } public RunningCompactions getRunnningCompactions() {