final MapServiceContext mapServiceContext = mapService.getMapServiceContext();
if (data != null) {
for (Entry<String, Set<RecordReplicationInfo>> dataEntry : data.entrySet()) {
Set<RecordReplicationInfo> recordReplicationInfos = dataEntry.getValue();
final String mapName = dataEntry.getKey();
RecordStore recordStore = mapServiceContext.getRecordStore(getPartitionId(), mapName);
for (RecordReplicationInfo recordReplicationInfo : recordReplicationInfos) {
Data key = recordReplicationInfo.getKey();
final Data value = recordReplicationInfo.getValue();
final MapContainer mapContainer = mapServiceContext.getMapContainer(mapName);
Record newRecord = mapContainer.createRecord(key, value, -1L, Clock.currentTimeMillis());
applyRecordInfo(newRecord, recordReplicationInfo);
recordStore.putRecord(key, newRecord);
}
recordStore.setLoaded(true);
}
}
for (Entry<String, List<DelayedEntry>> entry : delayedEntries.entrySet()) {
final RecordStore recordStore = mapServiceContext.getRecordStore(getPartitionId(), entry.getKey());
final List<DelayedEntry> replicatedEntries = entry.getValue();
final WriteBehindQueue<DelayedEntry> writeBehindQueue
= ((WriteBehindStore) recordStore.getMapDataStore()).getWriteBehindQueue();
writeBehindQueue.addEnd(replicatedEntries);
}
}