switching ConcurrentHashSet in mcastdata to ConcurrentHashMap due to serialization issues.
Change-Id: Ic38a82353fe8ab0dce03e5643090c08df1e53146
diff --git a/incubator/store/src/main/java/org/onosproject/incubator/store/mcast/impl/MulticastData.java b/incubator/store/src/main/java/org/onosproject/incubator/store/mcast/impl/MulticastData.java
index 11741b5..21674a8 100644
--- a/incubator/store/src/main/java/org/onosproject/incubator/store/mcast/impl/MulticastData.java
+++ b/incubator/store/src/main/java/org/onosproject/incubator/store/mcast/impl/MulticastData.java
@@ -16,9 +16,10 @@
package org.onosproject.incubator.store.mcast.impl;
import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Maps;
import org.onosproject.net.ConnectPoint;
-import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
@@ -33,20 +34,17 @@
private final AtomicReference<ConnectPoint> source =
new AtomicReference<>();
- private final Set<ConnectPoint> sinks;
+ private final Map<ConnectPoint, Boolean> sinks;
private final AtomicBoolean isEmpty = new AtomicBoolean();
private MulticastData() {
- // FIXME we have major problems trying to serialize these sets
- //this.sinks = Sets.newConcurrentHashSet();
- this.sinks = new HashSet<>();
+ this.sinks = Maps.newConcurrentMap();
isEmpty.set(true);
}
public MulticastData(ConnectPoint source) {
this.source.set(checkNotNull(source, "Multicast source cannot be null."));
- //this.sinks = Sets.newConcurrentHashSet();
- this.sinks = new HashSet<>();
+ this.sinks = Maps.newConcurrentMap();
isEmpty.set(false);
}
@@ -55,7 +53,7 @@
}
public Set<ConnectPoint> sinks() {
- return ImmutableSet.copyOf(sinks);
+ return ImmutableSet.copyOf(sinks.keySet());
}
public void setSource(ConnectPoint source) {
@@ -65,7 +63,7 @@
public void appendSink(ConnectPoint sink) {
checkNotNull(sink);
- sinks.add(sink);
+ sinks.put(sink, true);
}
public boolean removeSink(ConnectPoint sink) {