Fix the prev commit 02b2c90 for ChronicleSet

This commit is contained in:
leventov
2015-12-26 22:27:35 +03:00
parent 02b2c90ad0
commit 2928d18d11
3 changed files with 9 additions and 2 deletions
@@ -71,9 +71,9 @@ public final class DefaultEventualConsistencyStrategy {
// lost. (This is almost a theoretical situation.) In this case, give advantage to fresh
// entry updates to the "new" node. Entries with the same id and timestamp, bootstrapped
// "back" from other nodes in the system, are discarded on this new node (this is the
// of the condition originIdentifier == thisReplica.identifier()). But those new updates
// of the condition originIdentifier == currentNodeIdentifier). But those new updates
// should win on other nodes.
return originIdentifier == ((Replica) context.hash()).identifier() ? DISCARD : ACCEPT;
return originIdentifier == context.currentNodeIdentifier() ? DISCARD : ACCEPT;
}
private DefaultEventualConsistencyStrategy() {}
@@ -29,4 +29,6 @@ public interface RemoteOperationContext<K> extends HashContext<K> {
byte remoteIdentifier();
long remoteTimestamp();
byte currentNodeIdentifier();
}
@@ -77,4 +77,9 @@ public abstract class ReplicationUpdate<K> implements RemoteOperationContext<K>
checkOnEachPublicOperation.checkOnEachPublicOperation();
return innerRemoteIdentifier;
}
@Override
public byte currentNodeIdentifier() {
return mh.m().identifier();
}
}