use of com.hazelcast.internal.monitor.impl.MemberPartitionStateImpl 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()));
}
Aggregations