Search in sources :

Example 1 with MergePolicyConfig

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;
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) Config(com.hazelcast.config.Config) MergePolicyConfig(com.hazelcast.config.MergePolicyConfig)

Example 2 with MergePolicyConfig

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;
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) QueueStoreConfig(com.hazelcast.config.QueueStoreConfig) Config(com.hazelcast.config.Config) QueueStoreConfig(com.hazelcast.config.QueueStoreConfig) MergePolicyConfig(com.hazelcast.config.MergePolicyConfig)

Example 3 with MergePolicyConfig

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());
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) ListConfig(com.hazelcast.config.ListConfig) Test(org.junit.Test) QuickTest(com.hazelcast.test.annotation.QuickTest)

Example 4 with MergePolicyConfig

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());
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) RingbufferStoreConfig(com.hazelcast.config.RingbufferStoreConfig) Test(org.junit.Test) QuickTest(com.hazelcast.test.annotation.QuickTest)

Example 5 with MergePolicyConfig

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());
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) MultiMapConfig(com.hazelcast.config.MultiMapConfig) EntryListenerConfig(com.hazelcast.config.EntryListenerConfig) Test(org.junit.Test) QuickTest(com.hazelcast.test.annotation.QuickTest)

Aggregations

MergePolicyConfig (com.hazelcast.config.MergePolicyConfig)65 Config (com.hazelcast.config.Config)21 Test (org.junit.Test)20 ReplicatedMapConfig (com.hazelcast.config.ReplicatedMapConfig)18 MapConfig (com.hazelcast.config.MapConfig)17 MultiMapConfig (com.hazelcast.config.MultiMapConfig)17 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)16 ItemListenerConfig (com.hazelcast.config.ItemListenerConfig)16 QueueStoreConfig (com.hazelcast.config.QueueStoreConfig)15 RingbufferStoreConfig (com.hazelcast.config.RingbufferStoreConfig)15 ScheduledExecutorConfig (com.hazelcast.config.ScheduledExecutorConfig)15 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)13 EvictionConfig (com.hazelcast.config.EvictionConfig)13 ListenerConfig (com.hazelcast.config.ListenerConfig)13 QueueConfig (com.hazelcast.config.QueueConfig)13 RingbufferConfig (com.hazelcast.config.RingbufferConfig)13 EventJournalConfig (com.hazelcast.config.EventJournalConfig)12 ListConfig (com.hazelcast.config.ListConfig)12 MapPartitionLostListenerConfig (com.hazelcast.config.MapPartitionLostListenerConfig)12 SetConfig (com.hazelcast.config.SetConfig)12