Search in sources :

Example 1 with WanMapAddOrUpdateEvent

use of com.hazelcast.map.impl.wan.WanMapAddOrUpdateEvent in project hazelcast by hazelcast.

the class MapEventPublisherImpl method publishWanUpdate.

@Override
public void publishWanUpdate(@Nonnull String mapName, @Nonnull WanMapEntryView<Object, Object> entryView, boolean hasLoadProvenance) {
    if (!isOwnedPartition(entryView.getDataKey())) {
        return;
    }
    MapContainer mapContainer = mapServiceContext.getMapContainer(mapName);
    SplitBrainMergePolicy wanMergePolicy = mapContainer.getWanMergePolicy();
    WanMapAddOrUpdateEvent event = new WanMapAddOrUpdateEvent(mapName, wanMergePolicy, entryView);
    publishWanEvent(mapName, event);
}
Also used : SplitBrainMergePolicy(com.hazelcast.spi.merge.SplitBrainMergePolicy) WanMapAddOrUpdateEvent(com.hazelcast.map.impl.wan.WanMapAddOrUpdateEvent) MapContainer(com.hazelcast.map.impl.MapContainer)

Example 2 with WanMapAddOrUpdateEvent

use of com.hazelcast.map.impl.wan.WanMapAddOrUpdateEvent in project hazelcast by hazelcast.

the class WanDataSerializerHookTest method testExistingTypes.

@Test
public void testExistingTypes() {
    WanDataSerializerHook hook = new WanDataSerializerHook();
    IdentifiedDataSerializable mapUpdate = hook.createFactory().create(WanDataSerializerHook.MAP_REPLICATION_UPDATE);
    assertTrue(mapUpdate instanceof WanMapAddOrUpdateEvent);
    IdentifiedDataSerializable mapRemove = hook.createFactory().create(WanDataSerializerHook.MAP_REPLICATION_REMOVE);
    assertTrue(mapRemove instanceof WanMapRemoveEvent);
}
Also used : IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) WanMapAddOrUpdateEvent(com.hazelcast.map.impl.wan.WanMapAddOrUpdateEvent) WanMapRemoveEvent(com.hazelcast.map.impl.wan.WanMapRemoveEvent) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

WanMapAddOrUpdateEvent (com.hazelcast.map.impl.wan.WanMapAddOrUpdateEvent)2 MapContainer (com.hazelcast.map.impl.MapContainer)1 WanMapRemoveEvent (com.hazelcast.map.impl.wan.WanMapRemoveEvent)1 IdentifiedDataSerializable (com.hazelcast.nio.serialization.IdentifiedDataSerializable)1 SplitBrainMergePolicy (com.hazelcast.spi.merge.SplitBrainMergePolicy)1 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Test (org.junit.Test)1