@Override public Cluster getCluster() { return getOriginal().getCluster(); }
@Override public Cluster getCluster() { return getOriginal().getCluster(); }
public PartitionServiceBeanDTO(InternalPartitionService partitionService, HazelcastInstanceImpl hazelcastInstance) { Address address = hazelcastInstance.getCluster().getLocalMember().getAddress(); this.partitionCount = partitionService.getPartitionCount(); this.activePartitionCount = partitionService.getMemberPartitionsIfAssigned(address).size(); }
public PartitionServiceBeanDTO(InternalPartitionService partitionService, HazelcastInstanceImpl hazelcastInstance) { Address address = hazelcastInstance.getCluster().getLocalMember().getAddress(); this.partitionCount = partitionService.getPartitionCount(); this.activePartitionCount = partitionService.getMemberPartitionsIfAssigned(address).size(); }
@ManagedAnnotation("activePartitionCount") @ManagedDescription("Number of active partitions") public int getActivePartitionCount() { Address thisAddress = hazelcastInstance.getCluster().getLocalMember().getAddress(); return managedObject.getMemberPartitionsIfAssigned(thisAddress).size(); }
@ManagedAnnotation("activePartitionCount") @ManagedDescription("Number of active partitions") public int getActivePartitionCount() { Address thisAddress = hazelcastInstance.getCluster().getLocalMember().getAddress(); return managedObject.getMemberPartitionsIfAssigned(thisAddress).size(); }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception { JsonObject result = new JsonObject(); try { mcs.getHazelcastInstance().getCluster().promoteLocalLiteMember(); result.add("success", true); } catch (IllegalStateException e) { result.add("success", false); result.add("message", e.getMessage()); } out.add("result", result); }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception { String resultString = "SUCCESS"; try { mcs.getHazelcastInstance().getCluster().shutdown(); } catch (Exception e) { ILogger logger = mcs.getHazelcastInstance().node.nodeEngine.getLogger(getClass()); logger.warning("Cluster can not be shutdown: ", e); resultString = e.getMessage(); } JsonObject result = new JsonObject().add("result", resultString); out.add("result", result); }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception { String resultString = "SUCCESS"; try { mcs.getHazelcastInstance().getCluster().shutdown(); } catch (Exception e) { ILogger logger = mcs.getHazelcastInstance().node.nodeEngine.getLogger(getClass()); logger.warning("Cluster can not be shutdown: ", e); resultString = e.getMessage(); } JsonObject result = new JsonObject().add("result", resultString); out.add("result", result); }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception { JsonObject result = new JsonObject(); try { mcs.getHazelcastInstance().getCluster().promoteLocalLiteMember(); result.add("success", true); } catch (IllegalStateException e) { result.add("success", false); result.add("message", e.getMessage()); } out.add("result", result); }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception { String resultString = "SUCCESS"; try { Cluster cluster = mcs.getHazelcastInstance().getCluster(); cluster.changeClusterState(getClusterState(state)); } catch (Exception e) { ILogger logger = mcs.getHazelcastInstance().node.nodeEngine.getLogger(getClass()); logger.warning("Cluster state can not be changed: ", e); resultString = FAILURE + e.getMessage(); } JsonObject result = new JsonObject().add("result", resultString); out.add("result", result); }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception { String resultString = "SUCCESS"; try { Cluster cluster = mcs.getHazelcastInstance().getCluster(); cluster.changeClusterState(getClusterState(state)); } catch (Exception e) { ILogger logger = mcs.getHazelcastInstance().node.nodeEngine.getLogger(getClass()); logger.warning("Cluster state can not be changed: ", e); resultString = FAILURE + e.getMessage(); } JsonObject result = new JsonObject().add("result", resultString); out.add("result", result); }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception { ClusterState clusterState = mcs.getHazelcastInstance().getCluster().getClusterState(); JsonObject result = new JsonObject(); result.add("result", clusterState.toString()); out.add("result", result); }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception { ClusterState clusterState = mcs.getHazelcastInstance().getCluster().getClusterState(); JsonObject result = new JsonObject(); result.add("result", clusterState.toString()); out.add("result", result); }
protected InstanceMBean(HazelcastInstanceImpl hazelcastInstance, ManagementService managementService) { super(hazelcastInstance, managementService); createProperties(hazelcastInstance); this.config = hazelcastInstance.getConfig(); this.cluster = hazelcastInstance.getCluster(); Node node = hazelcastInstance.node; ExecutionService executionService = node.nodeEngine.getExecutionService(); InternalOperationService operationService = node.nodeEngine.getOperationService(); createMBeans(hazelcastInstance, managementService, node, executionService, operationService); registerMBeans(); registerWanPublisherMBeans(node.nodeEngine.getWanReplicationService()); }
protected InstanceMBean(HazelcastInstanceImpl hazelcastInstance, ManagementService managementService) { super(hazelcastInstance, managementService); createProperties(hazelcastInstance); this.config = hazelcastInstance.getConfig(); this.cluster = hazelcastInstance.getCluster(); Node node = hazelcastInstance.node; ExecutionService executionService = node.nodeEngine.getExecutionService(); InternalOperationService operationService = node.nodeEngine.getOperationService(); createMBeans(hazelcastInstance, managementService, node, executionService, operationService); registerMBeans(); registerWanPublisherMBeans(node.nodeEngine.getWanReplicationService()); }
public ManagementCenterService(HazelcastInstanceImpl instance) { this.instance = instance; this.logger = instance.node.getLogger(ManagementCenterService.class); this.managementCenterConfig = getManagementCenterConfig(); this.managementCenterUrl = getManagementCenterUrl(); this.commandHandler = new ConsoleCommandHandler(instance); this.taskPollThread = new TaskPollThread(); this.stateSendThread = new StateSendThread(); this.prepareStateThread = new PrepareStateThread(); this.eventSendThread = new EventSendThread(); this.timedMemberStateFactory = instance.node.getNodeExtension().createTimedMemberStateFactory(instance); this.connectionFactory = instance.node.getNodeExtension().getManagementCenterConnectionFactory(); if (this.managementCenterConfig.isEnabled()) { this.instance.getCluster().addMembershipListener(new ManagementCenterService.MemberListenerImpl()); start(); } }
public ManagementCenterService(HazelcastInstanceImpl instance) { this.instance = instance; this.logger = instance.node.getLogger(ManagementCenterService.class); this.managementCenterConfig = getManagementCenterConfig(); this.managementCenterUrl = getManagementCenterUrl(); this.commandHandler = new ConsoleCommandHandler(instance); this.taskPollThread = new TaskPollThread(); this.stateSendThread = new StateSendThread(); this.prepareStateThread = new PrepareStateThread(); this.eventSendThread = new EventSendThread(); this.timedMemberStateFactory = instance.node.getNodeExtension().createTimedMemberStateFactory(instance); this.connectionFactory = instance.node.getNodeExtension().getManagementCenterConnectionFactory(); if (this.managementCenterConfig.isEnabled()) { this.instance.getCluster().addMembershipListener(new ManagementCenterService.MemberListenerImpl()); start(); } }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject root) { final JsonObject result = new JsonObject(); result.add("update", update); if (update) { final Set<Member> members = mcs.getHazelcastInstance().getCluster().getMembers(); for (Member member : members) { resolveFuture(mcs.callOnMember(member, new UpdateMapConfigOperation(mapName, config.getMapConfig()))); } result.add("updateResult", "success"); } else { MapConfig cfg = (MapConfig) resolveFuture(mcs.callOnThis(new GetMapConfigOperation(mapName))); if (cfg != null) { result.add("hasMapConfig", true); result.add("mapConfig", new MapConfigDTO(cfg).toJson()); } else { result.add("hasMapConfig", false); } } root.add("result", result); }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject root) { final JsonObject result = new JsonObject(); result.add("update", update); if (update) { final Set<Member> members = mcs.getHazelcastInstance().getCluster().getMembers(); for (Member member : members) { resolveFuture(mcs.callOnMember(member, new UpdateMapConfigOperation(mapName, config.getMapConfig()))); } result.add("updateResult", "success"); } else { MapConfig cfg = (MapConfig) resolveFuture(mcs.callOnThis(new GetMapConfigOperation(mapName))); if (cfg != null) { result.add("hasMapConfig", true); result.add("mapConfig", new MapConfigDTO(cfg).toJson()); } else { result.add("hasMapConfig", false); } } root.add("result", result); }