コード例 #1
0
 private void createMemberState(MemberStateImpl memberState) {
   final Node node = factory.node;
   memberState.setAddress(node.getThisAddress());
   memberState.getMemberHealthStats().setOutOfMemory(node.isOutOfMemory());
   memberState.getMemberHealthStats().setActive(node.isActive());
   memberState
       .getMemberHealthStats()
       .setServiceThreadStats(node.getCpuUtilization().serviceThread);
   memberState.getMemberHealthStats().setOutThreadStats(node.getCpuUtilization().outThread);
   memberState.getMemberHealthStats().setInThreadStats(node.getCpuUtilization().inThread);
   PartitionService partitionService = factory.getPartitionService();
   Set<Partition> partitions = partitionService.getPartitions();
   memberState.clearPartitions();
   for (Partition partition : partitions) {
     if (partition.getOwner() != null && partition.getOwner().localMember()) {
       memberState.addPartition(partition.getPartitionId());
     }
   }
   Collection<HazelcastInstanceAwareInstance> proxyObjects =
       new ArrayList<HazelcastInstanceAwareInstance>(factory.getProxies());
   createMemState(memberState, proxyObjects.iterator(), InstanceType.MAP);
   createMemState(memberState, proxyObjects.iterator(), InstanceType.QUEUE);
   createMemState(memberState, proxyObjects.iterator(), InstanceType.TOPIC);
   createRuntimeProps(memberState);
   // uncomment when client changes are made
   // createMemState(memberState, proxyObjects.iterator(), InstanceType.ATOMIC_LONG);
   // createMemState(memberState, proxyObjects.iterator(), InstanceType.COUNT_DOWN_LATCH);
   // createMemState(memberState, proxyObjects.iterator(), InstanceType.SEMAPHORE);
 }
コード例 #2
0
 private Set<String> getLongInstanceNames() {
   Set<String> setLongInstanceNames = new HashSet<String>(maxVisibleInstanceCount);
   Collection<HazelcastInstanceAwareInstance> proxyObjects =
       new ArrayList<HazelcastInstanceAwareInstance>(factory.getProxies());
   collectInstanceNames(setLongInstanceNames, proxyObjects.iterator(), InstanceType.MAP);
   collectInstanceNames(setLongInstanceNames, proxyObjects.iterator(), InstanceType.QUEUE);
   collectInstanceNames(setLongInstanceNames, proxyObjects.iterator(), InstanceType.TOPIC);
   // uncomment when client changes are made
   // collectInstanceNames(setLongInstanceNames, proxyObjects.iterator(),
   // InstanceType.ATOMIC_NUMBER);
   // collectInstanceNames(setLongInstanceNames, proxyObjects.iterator(),
   // InstanceType.COUNT_DOWN_LATCH);
   // collectInstanceNames(setLongInstanceNames, proxyObjects.iterator(), InstanceType.SEMAPHORE);
   return setLongInstanceNames;
 }