Committed by
Gerrit Code Review
Removed creationTime field from AntiEntropyAdvertisement
Change-Id: I8ddd216b85786949d27a05010b11b715fb7edcba
Showing
2 changed files
with
3 additions
and
12 deletions
| ... | @@ -17,6 +17,7 @@ package org.onosproject.store.primitives.impl; | ... | @@ -17,6 +17,7 @@ package org.onosproject.store.primitives.impl; |
| 17 | 17 | ||
| 18 | import com.google.common.base.MoreObjects; | 18 | import com.google.common.base.MoreObjects; |
| 19 | import com.google.common.collect.ImmutableMap; | 19 | import com.google.common.collect.ImmutableMap; |
| 20 | + | ||
| 20 | import org.onosproject.cluster.NodeId; | 21 | import org.onosproject.cluster.NodeId; |
| 21 | 22 | ||
| 22 | import java.util.Map; | 23 | import java.util.Map; |
| ... | @@ -28,7 +29,6 @@ import static com.google.common.base.Preconditions.checkNotNull; | ... | @@ -28,7 +29,6 @@ import static com.google.common.base.Preconditions.checkNotNull; |
| 28 | */ | 29 | */ |
| 29 | public class AntiEntropyAdvertisement<K> { | 30 | public class AntiEntropyAdvertisement<K> { |
| 30 | 31 | ||
| 31 | - private final long creationTime; | ||
| 32 | private final NodeId sender; | 32 | private final NodeId sender; |
| 33 | private final Map<K, MapValue.Digest> digest; | 33 | private final Map<K, MapValue.Digest> digest; |
| 34 | 34 | ||
| ... | @@ -40,21 +40,11 @@ public class AntiEntropyAdvertisement<K> { | ... | @@ -40,21 +40,11 @@ public class AntiEntropyAdvertisement<K> { |
| 40 | */ | 40 | */ |
| 41 | public AntiEntropyAdvertisement(NodeId sender, | 41 | public AntiEntropyAdvertisement(NodeId sender, |
| 42 | Map<K, MapValue.Digest> digest) { | 42 | Map<K, MapValue.Digest> digest) { |
| 43 | - this.creationTime = System.currentTimeMillis(); | ||
| 44 | this.sender = checkNotNull(sender); | 43 | this.sender = checkNotNull(sender); |
| 45 | this.digest = ImmutableMap.copyOf(checkNotNull(digest)); | 44 | this.digest = ImmutableMap.copyOf(checkNotNull(digest)); |
| 46 | } | 45 | } |
| 47 | 46 | ||
| 48 | /** | 47 | /** |
| 49 | - * Returns the ad creation time. | ||
| 50 | - * | ||
| 51 | - * @return ad creation time | ||
| 52 | - */ | ||
| 53 | - public long creationTime() { | ||
| 54 | - return creationTime; | ||
| 55 | - } | ||
| 56 | - | ||
| 57 | - /** | ||
| 58 | * Returns the sender's node ID. | 48 | * Returns the sender's node ID. |
| 59 | * | 49 | * |
| 60 | * @return the sender's node ID | 50 | * @return the sender's node ID | ... | ... |
| ... | @@ -581,6 +581,7 @@ public class EventuallyConsistentMapImpl<K, V> | ... | @@ -581,6 +581,7 @@ public class EventuallyConsistentMapImpl<K, V> |
| 581 | } | 581 | } |
| 582 | 582 | ||
| 583 | private void sendAdvertisementToPeer(NodeId peer) { | 583 | private void sendAdvertisementToPeer(NodeId peer) { |
| 584 | + long adCreationTime = System.currentTimeMillis(); | ||
| 584 | AntiEntropyAdvertisement<K> ad = createAdvertisement(); | 585 | AntiEntropyAdvertisement<K> ad = createAdvertisement(); |
| 585 | clusterCommunicator.sendAndReceive(ad, | 586 | clusterCommunicator.sendAndReceive(ad, |
| 586 | antiEntropyAdvertisementSubject, | 587 | antiEntropyAdvertisementSubject, |
| ... | @@ -591,7 +592,7 @@ public class EventuallyConsistentMapImpl<K, V> | ... | @@ -591,7 +592,7 @@ public class EventuallyConsistentMapImpl<K, V> |
| 591 | if (error != null) { | 592 | if (error != null) { |
| 592 | log.debug("Failed to send anti-entropy advertisement to {}", peer, error); | 593 | log.debug("Failed to send anti-entropy advertisement to {}", peer, error); |
| 593 | } else if (result == AntiEntropyResponse.PROCESSED) { | 594 | } else if (result == AntiEntropyResponse.PROCESSED) { |
| 594 | - antiEntropyTimes.put(peer, ad.creationTime()); | 595 | + antiEntropyTimes.put(peer, adCreationTime); |
| 595 | } | 596 | } |
| 596 | }); | 597 | }); |
| 597 | } | 598 | } | ... | ... |
-
Please register or login to post a comment