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);
}
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);
}
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());
}
});
}
Aggregations