import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.controller.cluster.datastore.config.PrefixShardConfiguration;
import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
}
@Override
- public void writeExternal(ObjectOutput out) throws IOException {
+ public void writeExternal(final ObjectOutput out) throws IOException {
out.writeInt(snapshot.shardList.size());
for (String shard: snapshot.shardList) {
out.writeObject(shard);
}
out.writeInt(snapshot.prefixShardConfiguration.size());
- for (Map.Entry prefixShardConfigEntry : snapshot.prefixShardConfiguration.entrySet()) {
+ for (Map.Entry<?, ?> prefixShardConfigEntry : snapshot.prefixShardConfiguration.entrySet()) {
out.writeObject(prefixShardConfigEntry.getKey());
out.writeObject(prefixShardConfigEntry.getValue());
}
}
@Override
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
int size = in.readInt();
- List<String> shardList = new ArrayList<>(size);
+ List<String> localShardList = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
- shardList.add((String) in.readObject());
+ localShardList.add((String) in.readObject());
}
size = in.readInt();
- Map<DOMDataTreeIdentifier, PrefixShardConfiguration> prefixShardConfiguration = new HashMap<>(size);
+ Map<DOMDataTreeIdentifier, PrefixShardConfiguration> localPrefixShardConfiguration = new HashMap<>(size);
for (int i = 0; i < size; i++) {
- prefixShardConfiguration.put((DOMDataTreeIdentifier) in.readObject(),
+ localPrefixShardConfiguration.put((DOMDataTreeIdentifier) in.readObject(),
(PrefixShardConfiguration) in.readObject());
}
- snapshot = new ShardManagerSnapshot(shardList, prefixShardConfiguration);
+ snapshot = new ShardManagerSnapshot(localShardList, localPrefixShardConfiguration);
}
private Object readResolve() {
private final List<String> shardList;
private final Map<DOMDataTreeIdentifier, PrefixShardConfiguration> prefixShardConfiguration;
- public ShardManagerSnapshot(@Nonnull final List<String> shardList,
+ public ShardManagerSnapshot(final @NonNull List<String> shardList,
final Map<DOMDataTreeIdentifier, PrefixShardConfiguration> prefixShardConfiguration) {
this.shardList = ImmutableList.copyOf(shardList);
this.prefixShardConfiguration = ImmutableMap.copyOf(prefixShardConfiguration);