} else {
dataOldValue = mapServiceContext.toData(recordStore.put(dataKey, dataValue, -1));
}
mapServiceContext.interceptAfterPut(name, dataValue);
EntryEventType eventType = dataOldValue == null ? EntryEventType.ADDED : EntryEventType.UPDATED;
final MapEventPublisher mapEventPublisher = mapServiceContext.getMapEventPublisher();
mapEventPublisher.publishEvent(getCallerAddress(), name, eventType, dataKey, dataOldValue, dataValue);
keysToInvalidate.add(dataKey);
// check in case of an expiration.
final Record record = recordStore.getRecordOrNull(dataKey);
if (record == null) {
continue;
}
if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
final Data dataValueAsData = mapServiceContext.toData(dataValue);
final EntryView entryView = EntryViews.createSimpleEntryView(dataKey, dataValueAsData, record);
mapEventPublisher.publishWanReplicationUpdate(name, entryView);
}
backupEntrySet.add(entry);
RecordInfo replicationInfo = Records.buildRecordInfo(recordStore.getRecord(dataKey));
backupRecordInfos.add(replicationInfo);
}