use of com.hazelcast.internal.management.dto.ClientEndPointDTO in project hazelcast by hazelcast.
the class MemberStateImpl method toJson.
@Override
public JsonObject toJson() {
final JsonObject root = new JsonObject();
root.add("address", address);
serializeMap(root, "mapStats", mapStats);
serializeMap(root, "multiMapStats", multiMapStats);
serializeMap(root, "replicatedMapStats", replicatedMapStats);
serializeMap(root, "queueStats", queueStats);
serializeMap(root, "topicStats", topicStats);
serializeMap(root, "executorStats", executorStats);
serializeMap(root, "cacheStats", cacheStats);
serializeMap(root, "wanStats", wanStats);
final JsonObject runtimePropsObject = new JsonObject();
for (Map.Entry<String, Long> entry : runtimeProps.entrySet()) {
runtimePropsObject.add(entry.getKey(), entry.getValue());
}
root.add("runtimeProps", runtimePropsObject);
final JsonArray clientsArray = new JsonArray();
for (ClientEndPointDTO client : clients) {
clientsArray.add(client.toJson());
}
root.add("clients", clientsArray);
root.add("beans", beans.toJson());
root.add("memoryStats", memoryStats.toJson());
root.add("operationStats", operationStats.toJson());
root.add("memberPartitionState", memberPartitionState.toJson());
root.add("nodeState", nodeState.toJson());
root.add("hotRestartState", hotRestartState.toJson());
root.add("clusterHotRestartStatus", clusterHotRestartStatus.toJson());
root.add("wanSyncState", wanSyncState.toJson());
return root;
}
use of com.hazelcast.internal.management.dto.ClientEndPointDTO in project hazelcast by hazelcast.
the class TimedMemberStateFactory method createMemberState.
private void createMemberState(MemberStateImpl memberState, Collection<StatisticsAwareService> services) {
Node node = instance.node;
final Collection<Client> clients = instance.node.clientEngine.getClients();
final Set<ClientEndPointDTO> serializableClientEndPoints = createHashSet(clients.size());
for (Client client : clients) {
serializableClientEndPoints.add(new ClientEndPointDTO(client));
}
memberState.setClients(serializableClientEndPoints);
memberState.setName(instance.getName());
memberState.setUuid(node.getThisUuid());
if (instance.getConfig().getCPSubsystemConfig().getCPMemberCount() == 0) {
memberState.setCpMemberUuid(null);
} else {
CPMember localCPMember = instance.getCPSubsystem().getLocalCPMember();
memberState.setCpMemberUuid(localCPMember != null ? localCPMember.getUuid() : null);
}
Address thisAddress = node.getThisAddress();
memberState.setAddress(thisAddress.getHost() + ":" + thisAddress.getPort());
memberState.setEndpoints(node.getLocalMember().getAddressMap());
MemberPartitionStateImpl memberPartitionState = (MemberPartitionStateImpl) memberState.getMemberPartitionState();
InternalPartitionService partitionService = node.getPartitionService();
IPartition[] partitions = partitionService.getPartitions();
List<Integer> partitionList = memberPartitionState.getPartitions();
for (IPartition partition : partitions) {
if (partition.isLocal()) {
partitionList.add(partition.getPartitionId());
}
}
memberPartitionState.setMemberStateSafe(memberStateSafe);
memberState.setOperationStats(getOperationStats());
createMemState(memberState, services);
createNodeState(memberState);
createHotRestartState(memberState);
createClusterHotRestartStatus(memberState);
memberState.setClientStats(getClientAttributes(node.getClientEngine().getClientStatistics()));
}
use of com.hazelcast.internal.management.dto.ClientEndPointDTO in project hazelcast by hazelcast.
the class MemberStateImpl method toJson.
@Override
public JsonObject toJson() {
final JsonObject root = new JsonObject();
root.add("address", address);
String uuidString = uuid != null ? uuid.toString() : null;
root.add("uuid", uuidString);
String cpMemberUuidString = cpMemberUuid != null ? cpMemberUuid.toString() : null;
root.add("cpMemberUuid", cpMemberUuidString);
root.add("name", name);
final JsonArray endpoints = new JsonArray();
for (Entry<EndpointQualifier, Address> entry : this.endpoints.entrySet()) {
JsonObject address = new JsonObject();
address.set("host", entry.getValue().getHost());
address.set("port", entry.getValue().getPort());
JsonObject endpoint = new JsonObject();
endpoint.set("protocol", entry.getKey().getType().name());
endpoint.set("address", address);
if (entry.getKey().getIdentifier() != null) {
endpoint.set("id", entry.getKey().getIdentifier());
}
endpoints.add(endpoint);
}
root.add("endpoints", endpoints);
serializeAsMap(root, "mapStats", mapsWithStats);
serializeAsMap(root, "multiMapStats", multiMapsWithStats);
serializeAsMap(root, "replicatedMapStats", replicatedMapsWithStats);
serializeAsMap(root, "queueStats", queuesWithStats);
serializeAsMap(root, "topicStats", topicsWithStats);
serializeAsMap(root, "reliableTopicStats", reliableTopicsWithStats);
serializeAsMap(root, "pnCounterStats", pnCountersWithStats);
serializeAsMap(root, "executorStats", executorsWithStats);
serializeAsMap(root, "scheduledExecutorStats", scheduledExecutorsWithStats);
serializeAsMap(root, "durableExecutorStats", durableExecutorsWithStats);
serializeAsMap(root, "cacheStats", cachesWithStats);
serializeAsMap(root, "flakeIdStats", flakeIdGeneratorsWithStats);
serializeMap(root, "wanStats", wanStats);
final JsonArray clientsArray = new JsonArray();
for (ClientEndPointDTO client : clients) {
clientsArray.add(client.toJson());
}
root.add("clients", clientsArray);
addJsonIfSerializable(root, "operationStats", operationStats);
root.add("memberPartitionState", memberPartitionState.toJson());
root.add("nodeState", nodeState.toJson());
root.add("hotRestartState", hotRestartState.toJson());
root.add("clusterHotRestartStatus", clusterHotRestartStatus.toJson());
JsonObject clientStatsObject = new JsonObject();
for (Map.Entry<UUID, String> entry : clientStats.entrySet()) {
clientStatsObject.add(entry.getKey().toString(), entry.getValue());
}
root.add("clientStats", clientStatsObject);
return root;
}
Aggregations