ReplicatedMapService replicatedMapService = getService();
AbstractReplicatedRecordStore recordStorage;
recordStorage = (AbstractReplicatedRecordStore) replicatedMapService.getReplicatedRecordStore(name, true);
ReplicationPublisher replicationPublisher = recordStorage.getReplicationPublisher();
if (notYetReadyChooseSomeoneElse) {
replicationPublisher.retryWithDifferentReplicationNode(origin);
} else {
for (int i = 0; i < recordCount; i++) {
ReplicatedRecord record = replicatedRecords[i];
Object key = record.getKey();
Object value = record.getValue();
VectorClockTimestamp timestamp = record.getVectorClockTimestamp();
int updateHash = record.getLatestUpdateHash();
long ttlMillis = record.getTtlMillis();
ReplicationMessage update = new ReplicationMessage(name, key, value, timestamp, origin, updateHash, ttlMillis);
replicationPublisher.queueUpdateMessage(update);
}
if (finalChunk) {
recordStorage.finalChunkReceived();
}
}