summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
dfbfbf7)
I had a 3 node setup with 1 node down and when I tried to access the
shard info via JConsole I saw this exception :
java.lang.NullPointerException: null value in entry:
member-3-shard-car-config=null
at
com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33)[114:com.google.guava:18.0.0]
at
com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:88)[114:com.google.guava:18.0.0]
at
com.google.common.collect.ImmutableMap.copyOf(ImmutableMap.java:294)[114:com.google.guava:18.0.0]
at
org.opendaylight.controller.cluster.raft.RaftActor.onGetOnDemandRaftStats(RaftActor.java:247)[227:org.opendaylight.controller.sal-akka-raft:1.2.0.SNAPSHOT]
The peer address in the map for the down node was null which
ImmutableMap.copyOf doesn't like. I changed it to HashMap.
Change-Id: If9e0dfb3f7f213c11c99d98a5fd9c804c0876776
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Objects;
import com.google.common.base.Optional;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Objects;
import com.google.common.base.Optional;
-import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import java.io.Serializable;
import java.util.Collection;
import com.google.common.collect.Lists;
import java.io.Serializable;
import java.util.Collection;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
.snapshotIndex(replicatedLog().getSnapshotIndex())
.snapshotTerm(replicatedLog().getSnapshotTerm())
.votedFor(context.getTermInformation().getVotedFor())
.snapshotIndex(replicatedLog().getSnapshotIndex())
.snapshotTerm(replicatedLog().getSnapshotTerm())
.votedFor(context.getTermInformation().getVotedFor())
- .peerAddresses(ImmutableMap.copyOf(context.getPeerAddresses()));
+ .peerAddresses(new HashMap<>(context.getPeerAddresses()));
ReplicatedLogEntry lastLogEntry = getLastLogEntry();
if (lastLogEntry != null) {
ReplicatedLogEntry lastLogEntry = getLastLogEntry();
if (lastLogEntry != null) {