Search in sources :

Example 6 with PNCounterConfig

use of com.hazelcast.config.PNCounterConfig in project hazelcast by hazelcast.

the class PNCounterAddMessageTask method encodeResponse.

@Override
protected ClientMessage encodeResponse(Object response) {
    final CRDTTimestampedLong resp = (CRDTTimestampedLong) response;
    final PNCounterConfig counterConfig = nodeEngine.getConfig().findPNCounterConfig(parameters.name);
    return PNCounterAddCodec.encodeResponse(resp.getValue(), resp.getVectorClock().entrySet(), counterConfig.getReplicaCount());
}
Also used : CRDTTimestampedLong(com.hazelcast.internal.crdt.pncounter.operations.CRDTTimestampedLong) PNCounterConfig(com.hazelcast.config.PNCounterConfig)

Example 7 with PNCounterConfig

use of com.hazelcast.config.PNCounterConfig in project hazelcast by hazelcast.

the class PNCounterGetMessageTask method encodeResponse.

@Override
protected ClientMessage encodeResponse(Object response) {
    final CRDTTimestampedLong resp = (CRDTTimestampedLong) response;
    final PNCounterConfig counterConfig = nodeEngine.getConfig().findPNCounterConfig(parameters.name);
    return PNCounterGetCodec.encodeResponse(resp.getValue(), resp.getVectorClock().entrySet(), counterConfig.getReplicaCount());
}
Also used : CRDTTimestampedLong(com.hazelcast.internal.crdt.pncounter.operations.CRDTTimestampedLong) PNCounterConfig(com.hazelcast.config.PNCounterConfig)

Example 8 with PNCounterConfig

use of com.hazelcast.config.PNCounterConfig in project hazelcast by hazelcast.

the class MemberDomConfigProcessor method handlePNCounter.

protected void handlePNCounter(Node node) throws Exception {
    String name = getAttribute(node, "name");
    PNCounterConfig pnCounterConfig = ConfigUtils.getByNameOrNew(config.getPNCounterConfigs(), name, PNCounterConfig.class);
    handleViaReflection(node, config, pnCounterConfig);
}
Also used : PNCounterConfig(com.hazelcast.config.PNCounterConfig)

Example 9 with PNCounterConfig

use of com.hazelcast.config.PNCounterConfig in project hazelcast by hazelcast.

the class AbstractSplitBrainProtectionTest method newPNCounterConfig.

protected static PNCounterConfig newPNCounterConfig(SplitBrainProtectionOn splitBrainProtectionOn, String splitBrainProtectionName) {
    PNCounterConfig config = new PNCounterConfig(PN_COUNTER_NAME + splitBrainProtectionOn.name());
    config.setSplitBrainProtectionName(splitBrainProtectionName);
    return config;
}
Also used : PNCounterConfig(com.hazelcast.config.PNCounterConfig)

Example 10 with PNCounterConfig

use of com.hazelcast.config.PNCounterConfig in project hazelcast by hazelcast.

the class ConfigSearchTest method testPNCounterConfig_Static.

@Test
public void testPNCounterConfig_Static() {
    TestCase<PNCounterConfig> testCase = new TestCase<PNCounterConfig>(new PNCounterConfig(STATIC_NAME), new PNCounterConfig(DYNAMIC_NAME), false) {

        @Override
        void addStaticConfig(Config config) {
            config.addPNCounterConfig(this.staticConfig);
        }

        @Override
        void addDynamicConfig(HazelcastInstance hazelcastInstance) {
            hazelcastInstance.getConfig().addPNCounterConfig(this.dynamicConfig);
        }

        @Override
        void asserts() {
            PNCounterConfig dataConfig = hazelcastInstance.getConfig().findPNCounterConfig(DYNAMIC_NAME);
            assertThat(dataConfig.getName(), equalTo(STATIC_NAME));
        }
    };
    testTemplate(testCase);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) ListConfig(com.hazelcast.config.ListConfig) SetConfig(com.hazelcast.config.SetConfig) PNCounterConfig(com.hazelcast.config.PNCounterConfig) QueueConfig(com.hazelcast.config.QueueConfig) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) MapConfig(com.hazelcast.config.MapConfig) CardinalityEstimatorConfig(com.hazelcast.config.CardinalityEstimatorConfig) MultiMapConfig(com.hazelcast.config.MultiMapConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) ExecutorConfig(com.hazelcast.config.ExecutorConfig) ScheduledExecutorConfig(com.hazelcast.config.ScheduledExecutorConfig) TopicConfig(com.hazelcast.config.TopicConfig) Config(com.hazelcast.config.Config) DurableExecutorConfig(com.hazelcast.config.DurableExecutorConfig) FlakeIdGeneratorConfig(com.hazelcast.config.FlakeIdGeneratorConfig) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig) PNCounterConfig(com.hazelcast.config.PNCounterConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

PNCounterConfig (com.hazelcast.config.PNCounterConfig)18 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)5 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)5 Config (com.hazelcast.config.Config)5 DurableExecutorConfig (com.hazelcast.config.DurableExecutorConfig)5 ExecutorConfig (com.hazelcast.config.ExecutorConfig)5 FlakeIdGeneratorConfig (com.hazelcast.config.FlakeIdGeneratorConfig)5 ListConfig (com.hazelcast.config.ListConfig)5 MapConfig (com.hazelcast.config.MapConfig)5 MultiMapConfig (com.hazelcast.config.MultiMapConfig)5 QueueConfig (com.hazelcast.config.QueueConfig)5 ReliableTopicConfig (com.hazelcast.config.ReliableTopicConfig)5 ReplicatedMapConfig (com.hazelcast.config.ReplicatedMapConfig)5 RingbufferConfig (com.hazelcast.config.RingbufferConfig)5 ScheduledExecutorConfig (com.hazelcast.config.ScheduledExecutorConfig)5 SetConfig (com.hazelcast.config.SetConfig)3 TopicConfig (com.hazelcast.config.TopicConfig)3 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)3 QuickTest (com.hazelcast.test.annotation.QuickTest)3 Test (org.junit.Test)3