Search in sources :

Example 1 with WanReplicationEvent

use of com.hazelcast.wan.WanReplicationEvent in project hazelcast by hazelcast.

the class DummyWanReplication method publishReplicationEvent.

@Override
public void publishReplicationEvent(String serviceName, ReplicationEventObject eventObject) {
    WanReplicationEvent replicationEvent = new WanReplicationEvent(serviceName, eventObject);
    eventQueue.add(replicationEvent);
}
Also used : WanReplicationEvent(com.hazelcast.wan.WanReplicationEvent)

Example 2 with WanReplicationEvent

use of com.hazelcast.wan.WanReplicationEvent in project hazelcast by hazelcast.

the class WanDataSerializerHookTest method testExistingTypes.

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

Example 3 with WanReplicationEvent

use of com.hazelcast.wan.WanReplicationEvent in project hazelcast by hazelcast.

the class WanReplicationTest method assertTotalQueueSize.

private void assertTotalQueueSize(final int expectedQueueSize) {
    if (impl1 == null) {
        impl1 = getWanReplicationImpl(instance1);
        impl2 = getWanReplicationImpl(instance2);
    }
    final Queue<WanReplicationEvent> eventQueue1 = impl1.eventQueue;
    final Queue<WanReplicationEvent> eventQueue2 = impl2.eventQueue;
    assertTrueEventually(new AssertTask() {

        @Override
        public void run() throws Exception {
            assertEquals(expectedQueueSize, eventQueue1.size() + eventQueue2.size());
        }
    });
}
Also used : WanReplicationEvent(com.hazelcast.wan.WanReplicationEvent) AssertTask(com.hazelcast.test.AssertTask)

Aggregations

WanReplicationEvent (com.hazelcast.wan.WanReplicationEvent)3 MapReplicationRemove (com.hazelcast.map.impl.wan.MapReplicationRemove)1 MapReplicationUpdate (com.hazelcast.map.impl.wan.MapReplicationUpdate)1 IdentifiedDataSerializable (com.hazelcast.nio.serialization.IdentifiedDataSerializable)1 AssertTask (com.hazelcast.test.AssertTask)1 ParallelTest (com.hazelcast.test.annotation.ParallelTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Test (org.junit.Test)1