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));
}
}
}
use of com.hazelcast.map.impl.record.Record in project hazelcast by hazelcast.
the class AddIndexOperation method run.
@Override
public void run() throws Exception {
Indexes indexes = mapContainer.getIndexes();
Index index = indexes.addOrGetIndex(attributeName, ordered);
final long now = getNow();
final Iterator<Record> iterator = recordStore.iterator(now, false);
SerializationService serializationService = getNodeEngine().getSerializationService();
while (iterator.hasNext()) {
final Record record = iterator.next();
Data key = record.getKey();
Object value = Records.getValueOrCachedValue(record, serializationService);
QueryableEntry queryEntry = mapContainer.newQueryEntry(key, value);
index.saveEntryIndex(queryEntry, null);
}
}
use of com.hazelcast.map.impl.record.Record in project hazelcast by hazelcast.
the class EvictorImpl method evictEntry.
private void evictEntry(RecordStore recordStore, EntryView selectedEntry) {
Record record = getRecordFromEntryView(selectedEntry);
Data key = record.getKey();
if (recordStore.isLocked(record.getKey())) {
return;
}
boolean backup = isBackup(recordStore);
recordStore.evict(key, backup);
if (!backup) {
recordStore.doPostEvictionOperations(record, backup);
}
}
Aggregations