Madan Jampani
Committed by Gerrit Code Review

Removed creationTime field from AntiEntropyAdvertisement

Change-Id: I8ddd216b85786949d27a05010b11b715fb7edcba
......@@ -17,6 +17,7 @@ package org.onosproject.store.primitives.impl;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableMap;
import org.onosproject.cluster.NodeId;
import java.util.Map;
......@@ -28,7 +29,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
*/
public class AntiEntropyAdvertisement<K> {
private final long creationTime;
private final NodeId sender;
private final Map<K, MapValue.Digest> digest;
......@@ -40,21 +40,11 @@ public class AntiEntropyAdvertisement<K> {
*/
public AntiEntropyAdvertisement(NodeId sender,
Map<K, MapValue.Digest> digest) {
this.creationTime = System.currentTimeMillis();
this.sender = checkNotNull(sender);
this.digest = ImmutableMap.copyOf(checkNotNull(digest));
}
/**
* Returns the ad creation time.
*
* @return ad creation time
*/
public long creationTime() {
return creationTime;
}
/**
* Returns the sender's node ID.
*
* @return the sender's node ID
......
......@@ -581,6 +581,7 @@ public class EventuallyConsistentMapImpl<K, V>
}
private void sendAdvertisementToPeer(NodeId peer) {
long adCreationTime = System.currentTimeMillis();
AntiEntropyAdvertisement<K> ad = createAdvertisement();
clusterCommunicator.sendAndReceive(ad,
antiEntropyAdvertisementSubject,
......@@ -591,7 +592,7 @@ public class EventuallyConsistentMapImpl<K, V>
if (error != null) {
log.debug("Failed to send anti-entropy advertisement to {}", peer, error);
} else if (result == AntiEntropyResponse.PROCESSED) {
antiEntropyTimes.put(peer, ad.creationTime());
antiEntropyTimes.put(peer, adCreationTime);
}
});
}
......