Skip to content

Commit 970af35

Browse files
committed
Merge remote-tracking branch 'upstream/2.1' into 3.1
2 parents 0be5178 + 0de01c3 commit 970af35

File tree

1 file changed

+5
-4
lines changed
  • server/monitor/src/main/java/org/apache/accumulo/monitor

1 file changed

+5
-4
lines changed

server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -607,9 +607,10 @@ private static class ExternalCompactionsSnapshot {
607607
public final RunningCompactions runningCompactions;
608608
public final Map<String,TExternalCompaction> ecRunningMap;
609609

610-
private ExternalCompactionsSnapshot(Map<String,TExternalCompaction> ecRunningMap) {
611-
this.ecRunningMap = Collections.unmodifiableMap(ecRunningMap);
612-
this.runningCompactions = new RunningCompactions(ecRunningMap);
610+
private ExternalCompactionsSnapshot(Optional<Map<String,TExternalCompaction>> ecRunningMapOpt) {
611+
this.ecRunningMap =
612+
ecRunningMapOpt.map(Collections::unmodifiableMap).orElse(Collections.emptyMap());
613+
this.runningCompactions = new RunningCompactions(this.ecRunningMap);
613614
}
614615
}
615616

@@ -627,7 +628,7 @@ private ExternalCompactionsSnapshot computeExternalCompactionsSnapshot() {
627628
throw new IllegalStateException("Unable to get running compactions from " + ccHost, e);
628629
}
629630

630-
return new ExternalCompactionsSnapshot(running.getCompactions());
631+
return new ExternalCompactionsSnapshot(Optional.ofNullable(running.getCompactions()));
631632
}
632633

633634
public RunningCompactions getRunnningCompactions() {

0 commit comments

Comments
 (0)