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