use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class ListSplitBrainTest method config.
@Override
protected Config config() {
MergePolicyConfig mergePolicyConfig = new MergePolicyConfig().setPolicy(mergePolicyClass.getName()).setBatchSize(10);
Config config = super.config();
config.getListConfig(listNameA).setBackupCount(1).setAsyncBackupCount(0).setMergePolicyConfig(mergePolicyConfig);
config.getListConfig(listNameB).setBackupCount(1).setAsyncBackupCount(0).setMergePolicyConfig(mergePolicyConfig);
return config;
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class QueueSplitBrainTest method config.
@Override
protected Config config() {
MergePolicyConfig mergePolicyConfig = new MergePolicyConfig().setPolicy(mergePolicyClass.getName()).setBatchSize(10);
Config config = super.config();
config.getQueueConfig(queueNameA).setMergePolicyConfig(mergePolicyConfig).setQueueStoreConfig(new QueueStoreConfig().setStoreImplementation(queueStoreA)).setBackupCount(1).setAsyncBackupCount(0);
config.getQueueConfig(queueNameB).setMergePolicyConfig(mergePolicyConfig).setQueueStoreConfig(new QueueStoreConfig().setStoreImplementation(queueStoreB)).setBackupCount(1).setAsyncBackupCount(0);
return config;
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testListConfig.
@Test
public void testListConfig() {
ListConfig testListConfig = config.getListConfig("testList");
assertNotNull(testListConfig);
assertEquals("testList", testListConfig.getName());
assertEquals(9999, testListConfig.getMaxSize());
assertEquals(1, testListConfig.getBackupCount());
assertEquals(1, testListConfig.getAsyncBackupCount());
assertFalse(testListConfig.isStatisticsEnabled());
MergePolicyConfig mergePolicyConfig = testListConfig.getMergePolicyConfig();
assertEquals("DiscardMergePolicy", mergePolicyConfig.getPolicy());
assertEquals(2342, mergePolicyConfig.getBatchSize());
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testRingbufferConfig.
@Test
public void testRingbufferConfig() {
RingbufferConfig testRingbuffer = config.getRingbufferConfig("testRingbuffer");
assertNotNull(testRingbuffer);
assertEquals("testRingbuffer", testRingbuffer.getName());
assertEquals(InMemoryFormat.OBJECT, testRingbuffer.getInMemoryFormat());
assertEquals(100, testRingbuffer.getCapacity());
assertEquals(1, testRingbuffer.getBackupCount());
assertEquals(1, testRingbuffer.getAsyncBackupCount());
assertEquals(20, testRingbuffer.getTimeToLiveSeconds());
RingbufferStoreConfig store1 = testRingbuffer.getRingbufferStoreConfig();
assertNotNull(store1);
assertEquals(DummyRingbufferStore.class.getName(), store1.getClassName());
MergePolicyConfig mergePolicyConfig = testRingbuffer.getMergePolicyConfig();
assertNotNull(mergePolicyConfig);
assertEquals("PassThroughMergePolicy", mergePolicyConfig.getPolicy());
assertEquals(2342, mergePolicyConfig.getBatchSize());
RingbufferConfig testRingbuffer2 = config.getRingbufferConfig("testRingbuffer2");
assertNotNull(testRingbuffer2);
RingbufferStoreConfig store2 = testRingbuffer2.getRingbufferStoreConfig();
assertNotNull(store2);
assertEquals(DummyRingbufferStoreFactory.class.getName(), store2.getFactoryClassName());
assertFalse(store2.getProperties().isEmpty());
assertEquals("value", store2.getProperty("dummy.property"));
assertEquals("value2", store2.getProperty("dummy.property.2"));
RingbufferConfig testRingbuffer3 = config.getRingbufferConfig("testRingbuffer3");
assertNotNull(testRingbuffer3);
RingbufferStoreConfig store3 = testRingbuffer3.getRingbufferStoreConfig();
assertNotNull(store3);
assertEquals(dummyRingbufferStore, store3.getStoreImplementation());
RingbufferConfig testRingbuffer4 = config.getRingbufferConfig("testRingbuffer4");
assertNotNull(testRingbuffer4);
RingbufferStoreConfig store4 = testRingbuffer4.getRingbufferStoreConfig();
assertNotNull(store4);
assertEquals(dummyRingbufferStoreFactory, store4.getFactoryImplementation());
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testMultimapConfig.
@Test
public void testMultimapConfig() {
MultiMapConfig testMultiMapConfig = config.getMultiMapConfig("testMultimap");
assertEquals(MultiMapConfig.ValueCollectionType.LIST, testMultiMapConfig.getValueCollectionType());
assertEquals(2, testMultiMapConfig.getEntryListenerConfigs().size());
assertFalse(testMultiMapConfig.isBinary());
assertFalse(testMultiMapConfig.isStatisticsEnabled());
for (EntryListenerConfig listener : testMultiMapConfig.getEntryListenerConfigs()) {
if (listener.getClassName() != null) {
assertNull(listener.getImplementation());
assertTrue(listener.isIncludeValue());
assertFalse(listener.isLocal());
} else {
assertNotNull(listener.getImplementation());
assertEquals(entryListener, listener.getImplementation());
assertTrue(listener.isLocal());
assertTrue(listener.isIncludeValue());
}
}
MergePolicyConfig mergePolicyConfig = testMultiMapConfig.getMergePolicyConfig();
assertEquals("PassThroughMergePolicy", mergePolicyConfig.getPolicy());
assertEquals(1234, mergePolicyConfig.getBatchSize());
}
Aggregations