Search in sources :

Example 1 with MXBeansDTO

use of com.hazelcast.internal.management.dto.MXBeansDTO in project hazelcast by hazelcast.

the class TimedMemberStateFactoryHelper method registerJMXBeans.

static void registerJMXBeans(HazelcastInstanceImpl instance, MemberStateImpl memberState) {
    final EventService es = instance.node.nodeEngine.getEventService();
    final InternalOperationService os = instance.node.nodeEngine.getOperationService();
    final ConnectionManager cm = instance.node.connectionManager;
    final InternalPartitionService ps = instance.node.partitionService;
    final ProxyService proxyService = instance.node.nodeEngine.getProxyService();
    final ExecutionService executionService = instance.node.nodeEngine.getExecutionService();
    final MXBeansDTO beans = new MXBeansDTO();
    final EventServiceDTO esBean = new EventServiceDTO(es);
    beans.setEventServiceBean(esBean);
    final OperationServiceDTO osBean = new OperationServiceDTO(os);
    beans.setOperationServiceBean(osBean);
    final ConnectionManagerDTO cmBean = new ConnectionManagerDTO(cm);
    beans.setConnectionManagerBean(cmBean);
    final PartitionServiceBeanDTO psBean = new PartitionServiceBeanDTO(ps, instance);
    beans.setPartitionServiceBean(psBean);
    final ProxyServiceDTO proxyServiceBean = new ProxyServiceDTO(proxyService);
    beans.setProxyServiceBean(proxyServiceBean);
    final ManagedExecutorService systemExecutor = executionService.getExecutor(ExecutionService.SYSTEM_EXECUTOR);
    final ManagedExecutorService asyncExecutor = executionService.getExecutor(ExecutionService.ASYNC_EXECUTOR);
    final ManagedExecutorService scheduledExecutor = executionService.getExecutor(ExecutionService.SCHEDULED_EXECUTOR);
    final ManagedExecutorService clientExecutor = executionService.getExecutor(ExecutionService.CLIENT_EXECUTOR);
    final ManagedExecutorService queryExecutor = executionService.getExecutor(ExecutionService.QUERY_EXECUTOR);
    final ManagedExecutorService ioExecutor = executionService.getExecutor(ExecutionService.IO_EXECUTOR);
    final ManagedExecutorDTO systemExecutorDTO = new ManagedExecutorDTO(systemExecutor);
    final ManagedExecutorDTO asyncExecutorDTO = new ManagedExecutorDTO(asyncExecutor);
    final ManagedExecutorDTO scheduledExecutorDTO = new ManagedExecutorDTO(scheduledExecutor);
    final ManagedExecutorDTO clientExecutorDTO = new ManagedExecutorDTO(clientExecutor);
    final ManagedExecutorDTO queryExecutorDTO = new ManagedExecutorDTO(queryExecutor);
    final ManagedExecutorDTO ioExecutorDTO = new ManagedExecutorDTO(ioExecutor);
    beans.putManagedExecutor(ExecutionService.SYSTEM_EXECUTOR, systemExecutorDTO);
    beans.putManagedExecutor(ExecutionService.ASYNC_EXECUTOR, asyncExecutorDTO);
    beans.putManagedExecutor(ExecutionService.SCHEDULED_EXECUTOR, scheduledExecutorDTO);
    beans.putManagedExecutor(ExecutionService.CLIENT_EXECUTOR, clientExecutorDTO);
    beans.putManagedExecutor(ExecutionService.QUERY_EXECUTOR, queryExecutorDTO);
    beans.putManagedExecutor(ExecutionService.IO_EXECUTOR, ioExecutorDTO);
    memberState.setBeans(beans);
}
Also used : InternalPartitionService(com.hazelcast.internal.partition.InternalPartitionService) EventService(com.hazelcast.spi.EventService) InternalOperationService(com.hazelcast.spi.impl.operationservice.InternalOperationService) ExecutionService(com.hazelcast.spi.ExecutionService) EventServiceDTO(com.hazelcast.internal.management.dto.EventServiceDTO) MXBeansDTO(com.hazelcast.internal.management.dto.MXBeansDTO) ManagedExecutorDTO(com.hazelcast.internal.management.dto.ManagedExecutorDTO) ConnectionManagerDTO(com.hazelcast.internal.management.dto.ConnectionManagerDTO) ManagedExecutorService(com.hazelcast.util.executor.ManagedExecutorService) ConnectionManager(com.hazelcast.nio.ConnectionManager) ProxyService(com.hazelcast.spi.ProxyService) PartitionServiceBeanDTO(com.hazelcast.internal.management.dto.PartitionServiceBeanDTO) OperationServiceDTO(com.hazelcast.internal.management.dto.OperationServiceDTO) ProxyServiceDTO(com.hazelcast.internal.management.dto.ProxyServiceDTO)

Example 2 with MXBeansDTO

use of com.hazelcast.internal.management.dto.MXBeansDTO in project hazelcast by hazelcast.

the class MemberStateImpl method fromJson.

//CHECKSTYLE:OFF
@Override
public void fromJson(JsonObject json) {
    address = getString(json, "address");
    for (JsonObject.Member next : getObject(json, "mapStats")) {
        LocalMapStatsImpl stats = new LocalMapStatsImpl();
        stats.fromJson(next.getValue().asObject());
        mapStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "multiMapStats")) {
        LocalMultiMapStatsImpl stats = new LocalMultiMapStatsImpl();
        stats.fromJson(next.getValue().asObject());
        multiMapStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "replicatedMapStats", new JsonObject())) {
        LocalReplicatedMapStats stats = new LocalReplicatedMapStatsImpl();
        stats.fromJson(next.getValue().asObject());
        replicatedMapStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "queueStats")) {
        LocalQueueStatsImpl stats = new LocalQueueStatsImpl();
        stats.fromJson(next.getValue().asObject());
        queueStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "topicStats")) {
        LocalTopicStatsImpl stats = new LocalTopicStatsImpl();
        stats.fromJson(next.getValue().asObject());
        topicStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "executorStats")) {
        LocalExecutorStatsImpl stats = new LocalExecutorStatsImpl();
        stats.fromJson(next.getValue().asObject());
        executorStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "cacheStats", new JsonObject())) {
        LocalCacheStats stats = new LocalCacheStatsImpl();
        stats.fromJson(next.getValue().asObject());
        cacheStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "wanStats", new JsonObject())) {
        LocalWanStats stats = new LocalWanStatsImpl();
        stats.fromJson(next.getValue().asObject());
        wanStats.put(next.getName(), stats);
    }
    for (JsonObject.Member next : getObject(json, "runtimeProps")) {
        runtimeProps.put(next.getName(), next.getValue().asLong());
    }
    final JsonArray jsonClients = getArray(json, "clients");
    for (JsonValue jsonClient : jsonClients) {
        final ClientEndPointDTO client = new ClientEndPointDTO();
        client.fromJson(jsonClient.asObject());
        clients.add(client);
    }
    beans = new MXBeansDTO();
    beans.fromJson(getObject(json, "beans"));
    JsonObject jsonMemoryStats = getObject(json, "memoryStats", null);
    if (jsonMemoryStats != null) {
        memoryStats.fromJson(jsonMemoryStats);
    }
    JsonObject jsonOperationStats = getObject(json, "operationStats", null);
    if (jsonOperationStats != null) {
        operationStats.fromJson(jsonOperationStats);
    }
    JsonObject jsonMemberPartitionState = getObject(json, "memberPartitionState", null);
    if (jsonMemberPartitionState != null) {
        memberPartitionState = new MemberPartitionStateImpl();
        memberPartitionState.fromJson(jsonMemberPartitionState);
    }
    JsonObject jsonNodeState = getObject(json, "nodeState", null);
    if (jsonNodeState != null) {
        nodeState = new NodeStateImpl();
        nodeState.fromJson(jsonNodeState);
    }
    JsonObject jsonHotRestartState = getObject(json, "hotRestartState", null);
    if (jsonHotRestartState != null) {
        hotRestartState = new HotRestartStateImpl();
        hotRestartState.fromJson(jsonHotRestartState);
    }
    JsonObject jsonClusterHotRestartStatus = getObject(json, "clusterHotRestartStatus", null);
    if (jsonClusterHotRestartStatus != null) {
        clusterHotRestartStatus = new ClusterHotRestartStatusDTO();
        clusterHotRestartStatus.fromJson(jsonClusterHotRestartStatus);
    }
    JsonObject jsonWanSyncState = getObject(json, "wanSyncState", null);
    if (jsonWanSyncState != null) {
        wanSyncState = new WanSyncStateImpl();
        wanSyncState.fromJson(jsonWanSyncState);
    }
}
Also used : LocalCacheStats(com.hazelcast.monitor.LocalCacheStats) ClientEndPointDTO(com.hazelcast.internal.management.dto.ClientEndPointDTO) JsonValue(com.eclipsesource.json.JsonValue) JsonObject(com.eclipsesource.json.JsonObject) MXBeansDTO(com.hazelcast.internal.management.dto.MXBeansDTO) JsonArray(com.eclipsesource.json.JsonArray) LocalWanStats(com.hazelcast.monitor.LocalWanStats) ClusterHotRestartStatusDTO(com.hazelcast.internal.management.dto.ClusterHotRestartStatusDTO) LocalReplicatedMapStats(com.hazelcast.monitor.LocalReplicatedMapStats)

Aggregations

MXBeansDTO (com.hazelcast.internal.management.dto.MXBeansDTO)2 JsonArray (com.eclipsesource.json.JsonArray)1 JsonObject (com.eclipsesource.json.JsonObject)1 JsonValue (com.eclipsesource.json.JsonValue)1 ClientEndPointDTO (com.hazelcast.internal.management.dto.ClientEndPointDTO)1 ClusterHotRestartStatusDTO (com.hazelcast.internal.management.dto.ClusterHotRestartStatusDTO)1 ConnectionManagerDTO (com.hazelcast.internal.management.dto.ConnectionManagerDTO)1 EventServiceDTO (com.hazelcast.internal.management.dto.EventServiceDTO)1 ManagedExecutorDTO (com.hazelcast.internal.management.dto.ManagedExecutorDTO)1 OperationServiceDTO (com.hazelcast.internal.management.dto.OperationServiceDTO)1 PartitionServiceBeanDTO (com.hazelcast.internal.management.dto.PartitionServiceBeanDTO)1 ProxyServiceDTO (com.hazelcast.internal.management.dto.ProxyServiceDTO)1 InternalPartitionService (com.hazelcast.internal.partition.InternalPartitionService)1 LocalCacheStats (com.hazelcast.monitor.LocalCacheStats)1 LocalReplicatedMapStats (com.hazelcast.monitor.LocalReplicatedMapStats)1 LocalWanStats (com.hazelcast.monitor.LocalWanStats)1 ConnectionManager (com.hazelcast.nio.ConnectionManager)1 EventService (com.hazelcast.spi.EventService)1 ExecutionService (com.hazelcast.spi.ExecutionService)1 ProxyService (com.hazelcast.spi.ProxyService)1