use of com.hazelcast.cp.CPGroupId in project hazelcast by hazelcast.
the class MetadataRaftGroupManager method completeDestroyRaftGroup.
private void completeDestroyRaftGroup(CPGroupInfo group) {
CPGroupId groupId = group.id();
if (group.setDestroyed()) {
logger.info(groupId + " is destroyed.");
sendTerminateRaftNodeOpsForDestroyedGroup(group);
} else if (logger.isFineEnabled()) {
logger.fine(groupId + " is already destroyed.");
}
}
use of com.hazelcast.cp.CPGroupId in project hazelcast by hazelcast.
the class MetadataRaftGroupManager method addRaftGroup.
private void addRaftGroup(CPGroupInfo group) {
CPGroupId groupId = group.id();
if (groups.containsKey(groupId)) {
String msg = group + " already exists!";
if (logger.isFineEnabled()) {
logger.warning(msg);
}
throw new IllegalStateException(msg);
}
groups.put(groupId, group);
}
use of com.hazelcast.cp.CPGroupId in project hazelcast by hazelcast.
the class AtomicLongService method provideDynamicMetrics.
@Override
public void provideDynamicMetrics(MetricDescriptor descriptor, MetricsCollectionContext context) {
MetricDescriptor root = descriptor.withPrefix("cp.atomiclong");
for (AtomicLong value : atomicValues.values()) {
CPGroupId groupId = value.groupId();
MetricDescriptor desc = root.copy().withDiscriminator("id", value.name() + "@" + groupId.getName()).withTag(CP_TAG_NAME, value.name()).withTag("group", groupId.getName()).withMetric("value");
context.collect(desc, value.value());
}
}
use of com.hazelcast.cp.CPGroupId in project hazelcast by hazelcast.
the class AddAndGetMessageTask method processMessage.
@Override
protected void processMessage() {
CPGroupId groupId = parameters.groupId;
long delta = parameters.delta;
RaftOp op = new AddAndGetOp(parameters.name, delta);
if (delta == 0) {
query(groupId, op, LINEARIZABLE);
} else {
invoke(groupId, op);
}
}
use of com.hazelcast.cp.CPGroupId in project hazelcast by hazelcast.
the class AtomicRefService method provideDynamicMetrics.
@Override
public void provideDynamicMetrics(MetricDescriptor descriptor, MetricsCollectionContext context) {
MetricDescriptor root = descriptor.withPrefix("cp.atomicref");
for (AtomicRef value : atomicValues.values()) {
CPGroupId groupId = value.groupId();
MetricDescriptor desc = root.copy().withDiscriminator("id", value.name() + "@" + groupId.getName()).withTag(CP_TAG_NAME, value.name()).withTag("group", groupId.getName()).withMetric("dummy");
context.collect(desc, 0);
}
}
Aggregations