use of com.hazelcast.core.ConsistencyLostException in project hazelcast by hazelcast.
the class AbstractPNCounterOperation method getPNCounter.
PNCounterImpl getPNCounter(VectorClock observedTimestamps) {
if (counter != null) {
return counter;
}
final PNCounterService service = getService();
if (observedTimestamps != null && !observedTimestamps.isEmpty() && !service.containsCounter(name)) {
throw new ConsistencyLostException("This replica cannot provide the session guarantees for " + "the PN counter since it's state is stale");
}
final int maxConfiguredReplicaCount = getNodeEngine().getConfig().findPNCounterConfig(name).getReplicaCount();
if (!isCRDTReplica(maxConfiguredReplicaCount)) {
throw new TargetNotReplicaException("This member is not a CRDT replica for the " + name + " + PN counter");
}
this.counter = service.getCounter(name);
return counter;
}
Aggregations