diff --git a/client/src/main/java/com/metamx/druid/client/DruidServer.java b/client/src/main/java/com/metamx/druid/client/DruidServer.java index a71d8a15ac7..ff565e04fce 100644 --- a/client/src/main/java/com/metamx/druid/client/DruidServer.java +++ b/client/src/main/java/com/metamx/druid/client/DruidServer.java @@ -24,8 +24,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableMap; import com.metamx.common.logger.Logger; - - import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -41,7 +39,7 @@ public class DruidServer implements Comparable private final String name; private final ConcurrentMap dataSources; - private final Map segments; + private final ConcurrentMap segments; private final String host; private final long maxSize; @@ -80,7 +78,7 @@ public class DruidServer implements Comparable this.tier = tier; this.dataSources = new ConcurrentHashMap(); - this.segments = new HashMap(); + this.segments = new ConcurrentHashMap(); } public String getName() @@ -132,7 +130,7 @@ public class DruidServer implements Comparable @JsonProperty public Map getSegments() { - return segments; + return ImmutableMap.copyOf(segments); } public DataSegment getSegment(String segmentName) diff --git a/merger/src/main/java/com/metamx/druid/merger/worker/WorkerTaskMonitor.java b/merger/src/main/java/com/metamx/druid/merger/worker/WorkerTaskMonitor.java index db7d71b6206..62c07fef236 100644 --- a/merger/src/main/java/com/metamx/druid/merger/worker/WorkerTaskMonitor.java +++ b/merger/src/main/java/com/metamx/druid/merger/worker/WorkerTaskMonitor.java @@ -161,7 +161,7 @@ public class WorkerTaskMonitor private boolean isTaskRunning(final Task task) { for (final Task runningTask : running) { - if (runningTask.equals(task.getId())) { + if (runningTask.getId().equals(task.getId())) { return true; } }