Search in sources :

Example 1 with MemberPartitionStateImpl

use of com.hazelcast.monitor.impl.MemberPartitionStateImpl in project hazelcast by hazelcast.

the class TimedMemberStateFactory method createMemberState.

private void createMemberState(TimedMemberState timedMemberState, MemberStateImpl memberState, Collection<StatisticsAwareService> services) {
    Node node = instance.node;
    HashSet<ClientEndPointDTO> serializableClientEndPoints = new HashSet<ClientEndPointDTO>();
    for (Client client : instance.node.clientEngine.getClients()) {
        serializableClientEndPoints.add(new ClientEndPointDTO(client));
    }
    memberState.setClients(serializableClientEndPoints);
    Address thisAddress = node.getThisAddress();
    memberState.setAddress(thisAddress.getHost() + ":" + thisAddress.getPort());
    TimedMemberStateFactoryHelper.registerJMXBeans(instance, memberState);
    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.setMigrationQueueSize(partitionService.getMigrationQueueSize());
    memberPartitionState.setMemberStateSafe(memberStateSafe);
    memberState.setLocalMemoryStats(getMemoryStats());
    memberState.setOperationStats(getOperationStats());
    TimedMemberStateFactoryHelper.createRuntimeProps(memberState);
    createMemState(timedMemberState, memberState, services);
    createNodeState(memberState);
    createHotRestartState(memberState);
    createClusterHotRestartStatus(memberState);
    createWanSyncState(memberState);
}
Also used : Address(com.hazelcast.nio.Address) ClientEndPointDTO(com.hazelcast.internal.management.dto.ClientEndPointDTO) InternalPartitionService(com.hazelcast.internal.partition.InternalPartitionService) Node(com.hazelcast.instance.Node) MemberPartitionStateImpl(com.hazelcast.monitor.impl.MemberPartitionStateImpl) Client(com.hazelcast.core.Client) IPartition(com.hazelcast.spi.partition.IPartition) HashSet(java.util.HashSet)

Aggregations

Client (com.hazelcast.core.Client)1 Node (com.hazelcast.instance.Node)1 ClientEndPointDTO (com.hazelcast.internal.management.dto.ClientEndPointDTO)1 InternalPartitionService (com.hazelcast.internal.partition.InternalPartitionService)1 MemberPartitionStateImpl (com.hazelcast.monitor.impl.MemberPartitionStateImpl)1 Address (com.hazelcast.nio.Address)1 IPartition (com.hazelcast.spi.partition.IPartition)1 HashSet (java.util.HashSet)1