diff --git a/SingularityService/src/main/java/com/hubspot/singularity/data/NotificationsManager.java b/SingularityService/src/main/java/com/hubspot/singularity/data/NotificationsManager.java index cae9735320..c422eed9f2 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/data/NotificationsManager.java +++ b/SingularityService/src/main/java/com/hubspot/singularity/data/NotificationsManager.java @@ -5,7 +5,6 @@ import org.apache.curator.framework.CuratorFramework; import org.apache.curator.utils.ZKPaths; -import org.jetbrains.annotations.NotNull; import com.codahale.metrics.MetricRegistry; import com.google.common.cache.CacheBuilder; @@ -49,7 +48,7 @@ public List getBlacklist() { return cache.getUnchecked(BLACKLIST_ROOT); } - @NotNull private String getEmailPath(String email) { + private String getEmailPath(String email) { return ZKPaths.makePath(BLACKLIST_ROOT, email); } } diff --git a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityLeaderCache.java b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityLeaderCache.java index 9ddfaeb013..885ebdab5c 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityLeaderCache.java +++ b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityLeaderCache.java @@ -9,6 +9,7 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import java.util.function.Function; import java.util.stream.Collectors; @@ -47,7 +48,7 @@ public class SingularityLeaderCache { private Map slaves; private Map racks; private Set pendingTaskIdsToDelete; - private Map requestUtilizations; + private ConcurrentMap requestUtilizations; private volatile boolean active; @@ -117,7 +118,7 @@ public void stop() { } public void cacheRequestUtilizations(Map requestUtilizations) { - this.requestUtilizations = new HashMap<>(requestUtilizations); + this.requestUtilizations = new ConcurrentHashMap<>(requestUtilizations); } public boolean active() {