use of com.hazelcast.map.impl.record.Record in project hazelcast by hazelcast.
the class PutAllBackupOperation method run.
@Override
public void run() {
boolean wanEnabled = mapContainer.isWanReplicationEnabled();
for (int i = 0; i < entries.size(); i++) {
Data dataKey = entries.getKey(i);
Data dataValue = entries.getValue(i);
Record record = recordStore.putBackup(dataKey, dataValue);
applyRecordInfo(record, recordInfos.get(i));
if (wanEnabled) {
Data dataValueAsData = mapServiceContext.toData(dataValue);
EntryView entryView = createSimpleEntryView(dataKey, dataValueAsData, record);
mapEventPublisher.publishWanReplicationUpdateBackup(name, entryView);
}
evict(dataKey);
}
}
use of com.hazelcast.map.impl.record.Record in project hazelcast by hazelcast.
the class PutBackupOperation method run.
@Override
public void run() {
ttl = recordInfo != null ? recordInfo.getTtl() : ttl;
final Record record = recordStore.putBackup(dataKey, dataValue, ttl, putTransient);
if (recordInfo != null) {
Records.applyRecordInfo(record, recordInfo);
}
if (unlockKey) {
recordStore.forceUnlock(dataKey);
}
}
use of com.hazelcast.map.impl.record.Record in project hazelcast by hazelcast.
the class AbstractMultipleEntryBackupOperation method publishWanReplicationEventBackup.
protected void publishWanReplicationEventBackup(Data key, Object value, EntryEventType eventType) {
if (mapContainer.isWanReplicationEnabled()) {
if (REMOVED.equals(eventType)) {
mapEventPublisher.publishWanReplicationRemoveBackup(name, key, getNow());
} else {
final Record record = recordStore.getRecord(key);
if (record != null) {
final Data dataValueAsData = toData(value);
final EntryView entryView = createSimpleEntryView(key, dataValueAsData, record);
mapEventPublisher.publishWanReplicationUpdateBackup(name, entryView);
}
}
}
}
use of com.hazelcast.map.impl.record.Record in project hazelcast by hazelcast.
the class AbstractMultipleEntryOperation method doPostOps.
protected void doPostOps(Data key, Object oldValue, Map.Entry entry) {
final EntryEventType eventType = pickEventTypeOrNull(entry, oldValue);
if (eventType == null) {
return;
}
Object newValue = entry.getValue();
invalidateNearCache(key);
mapServiceContext.interceptAfterPut(name, newValue);
if (isPostProcessing(recordStore)) {
Record record = recordStore.getRecord(key);
newValue = record == null ? null : record.getValue();
}
if (mapContainer.isWanReplicationEnabled()) {
newValue = toData(newValue);
publishWanReplicationEvent(key, (Data) newValue, eventType);
}
publishEntryEvent(key, newValue, oldValue, eventType);
}
use of com.hazelcast.map.impl.record.Record in project hazelcast by hazelcast.
the class AbstractMultipleEntryOperation method publishWanReplicationEvent.
protected void publishWanReplicationEvent(Data key, Data value, EntryEventType eventType) {
if (EntryEventType.REMOVED == eventType) {
mapEventPublisher.publishWanReplicationRemove(name, key, getNow());
wanEventList.add(new WanEventWrapper(key, null, EntryEventType.REMOVED));
} else {
final Record record = recordStore.getRecord(key);
if (record != null) {
final Data dataValueAsData = toData(value);
final EntryView entryView = createSimpleEntryView(key, dataValueAsData, record);
mapEventPublisher.publishWanReplicationUpdate(name, entryView);
wanEventList.add(new WanEventWrapper(key, value, EntryEventType.UPDATED));
}
}
}
Aggregations