public Map<String, VectorClock> getLatestReplicatedVectorClock(String serviceName) {
        final HashMap<String, VectorClock> latestVectorClocks = new HashMap<String, VectorClock>();

        for (Entry<ReplicatedVectorClockId, Map<String, VectorClock>> clockEntry : replicatedVectorClocks.entrySet()) {
            final ReplicatedVectorClockId id = clockEntry.getKey();
            final Map<String, VectorClock> clock = clockEntry.getValue();

            if (id.serviceName.equals(serviceName)) {
                for (Entry<String, VectorClock> crdtReplicatedClocks : clock.entrySet()) {
                    final String crdtName = crdtReplicatedClocks.getKey();
                    final VectorClock vectorClock = crdtReplicatedClocks.getValue();
                    final VectorClock latestVectorClock = latestVectorClocks.get(crdtName);

                    if (latestVectorClock == null || vectorClock.isAfter(latestVectorClock)) {
                        latestVectorClocks.put(crdtName, vectorClock);
                    }
                }
            }
        }
        return latestVectorClocks;
    }
public Map < String , VectorClock > getLatestReplicatedVectorClock ( String serviceName ) { final HashMap < String , VectorClock > latestVectorClocks = new HashMap < String , VectorClock > ( ) ; for ( Entry < ReplicatedVectorClockId , Map < String , VectorClock > > clockEntry : replicatedVectorClocks . entrySet ( ) ) { final ReplicatedVectorClockId id = clockEntry . getKey ( ) ; final Map < String , VectorClock > clock = clockEntry . getValue ( ) ; if ( id . serviceName . equals ( serviceName ) ) { for ( Entry < String , VectorClock > crdtReplicatedClocks : clock . entrySet ( ) ) { final String crdtName = crdtReplicatedClocks . getKey ( ) ; final VectorClock vectorClock = crdtReplicatedClocks . getValue ( ) ; final VectorClock latestVectorClock = latestVectorClocks . get ( crdtName ) ; if ( latestVectorClock == null || vectorClock . isAfter ( latestVectorClock ) ) { latestVectorClocks . put ( crdtName , vectorClock ) ; } } } } return latestVectorClocks ; }
Returns the vector clock map for the given {@code serviceName}.
For each CRDT belonging to that service, the map contains the latest
successfully replicated vector clocks to any replica.

@param serviceName the CRDT service name
@return the last successfully replicated vector clock for all CRDTs for
the given {@code serviceName}
@see CRDTReplicationAwareService