use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.
the class EntryBackupOperation method publishWanReplicationEvent.
private void publishWanReplicationEvent(EntryEventType eventType) {
final MapContainer mapContainer = this.mapContainer;
if (!mapContainer.isWanReplicationEnabled()) {
return;
}
final MapEventPublisher mapEventPublisher = mapContainer.getMapServiceContext().getMapEventPublisher();
final Data key = dataKey;
if (EntryEventType.REMOVED == eventType) {
mapEventPublisher.publishWanReplicationRemoveBackup(name, key, Clock.currentTimeMillis());
} else {
final Record record = recordStore.getRecord(key);
if (record != null) {
dataValue = mapContainer.getMapServiceContext().toData(dataValue);
final EntryView entryView = createSimpleEntryView(key, dataValue, record);
mapEventPublisher.publishWanReplicationUpdateBackup(name, entryView);
}
}
}
use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.
the class EntryOperation method publishWanReplicationEvent.
private void publishWanReplicationEvent() {
final MapContainer mapContainer = this.mapContainer;
if (mapContainer.getWanReplicationPublisher() == null && mapContainer.getWanMergePolicy() == null) {
return;
}
final Data key = dataKey;
if (REMOVED.equals(eventType)) {
mapEventPublisher.publishWanReplicationRemove(name, key, getNow());
} else {
final Record record = recordStore.getRecord(key);
if (record != null) {
dataValue = toData(dataValue);
final EntryView entryView = createSimpleEntryView(key, dataValue, record);
mapEventPublisher.publishWanReplicationUpdate(name, entryView);
}
}
}
use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.
the class AbstractMapMergePolicyTest method merge_draw_mergingWins.
@Test
public void merge_draw_mergingWins() {
EntryView existing = entryWithGivenPropertyAndValue(1, EXISTING);
EntryView merging = entryWithGivenPropertyAndValue(1, MERGING);
assertEquals(MERGING, policy.merge("map", merging, existing));
}
use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.
the class PassThroughMapMergePolicyTest method merge_mergingNull.
@Test
public void merge_mergingNull() {
EntryView existing = entryWithGivenValue(EXISTING);
EntryView merging = null;
assertEquals(EXISTING, policy.merge("map", merging, existing));
}
use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.
the class PutIfAbsentMapMergePolicyTest method merge_bothValuesNull.
@Test
public void merge_bothValuesNull() {
EntryView existing = entryWithGivenValue(null);
EntryView merging = entryWithGivenValue(null);
assertNull(policy.merge("map", merging, existing));
}
Aggregations