use of com.hazelcast.internal.services.StatisticsAwareService in project hazelcast by hazelcast.
the class TimedMemberStateFactory method createMemState.
private void createMemState(MemberStateImpl memberState, Collection<StatisticsAwareService> services) {
Config config = instance.getConfig();
for (StatisticsAwareService service : services) {
if (service instanceof MapService) {
handleMap(memberState, ((MapService) service).getStats());
} else if (service instanceof MultiMapService) {
handleMultiMap(memberState, ((MultiMapService) service).getStats());
} else if (service instanceof QueueService) {
handleQueue(memberState, ((QueueService) service).getStats());
} else if (service instanceof TopicService) {
handleTopic(memberState, ((TopicService) service).getStats());
} else if (service instanceof ReliableTopicService) {
handleReliableTopic(memberState, ((ReliableTopicService) service).getStats());
} else if (service instanceof DistributedExecutorService) {
handleExecutorService(memberState, config, ((DistributedExecutorService) service).getStats());
} else if (service instanceof DistributedScheduledExecutorService) {
handleScheduledExecutorService(memberState, config, ((DistributedScheduledExecutorService) service).getStats());
} else if (service instanceof DistributedDurableExecutorService) {
handleDurableExecutorService(memberState, config, ((DistributedDurableExecutorService) service).getStats());
} else if (service instanceof ReplicatedMapService) {
handleReplicatedMap(memberState, config, ((ReplicatedMapService) service).getStats());
} else if (service instanceof PNCounterService) {
handlePNCounter(memberState, config, ((PNCounterService) service).getStats());
} else if (service instanceof FlakeIdGeneratorService) {
handleFlakeIdGenerator(memberState, config, ((FlakeIdGeneratorService) service).getStats());
} else if (service instanceof CacheService) {
handleCache(memberState, (CacheService) service);
}
}
WanReplicationService wanReplicationService = instance.node.nodeEngine.getWanReplicationService();
Map<String, LocalWanStats> wanStats = wanReplicationService.getStats();
if (wanStats != null) {
handleWan(memberState, wanStats);
}
}
use of com.hazelcast.internal.services.StatisticsAwareService in project hazelcast by hazelcast.
the class TimedMemberStateFactory method createTimedMemberState.
@Nonnull
public TimedMemberState createTimedMemberState() {
MemberStateImpl memberState = new MemberStateImpl();
Collection<StatisticsAwareService> services = instance.node.nodeEngine.getServices(StatisticsAwareService.class);
TimedMemberState timedMemberState = new TimedMemberState();
createMemberState(memberState, services);
timedMemberState.setMaster(instance.node.isMaster());
timedMemberState.setMemberList(new ArrayList<>());
Set<Member> memberSet = instance.getCluster().getMembers();
for (Member member : memberSet) {
MemberImpl memberImpl = (MemberImpl) member;
Address address = memberImpl.getAddress();
timedMemberState.getMemberList().add(address.getHost() + ":" + address.getPort());
}
timedMemberState.setMemberState(memberState);
timedMemberState.setClusterName(instance.getConfig().getClusterName());
SSLConfig sslConfig = getActiveMemberNetworkConfig(instance.getConfig()).getSSLConfig();
timedMemberState.setSslEnabled(sslConfig != null && sslConfig.isEnabled());
timedMemberState.setLite(instance.node.isLiteMember());
SocketInterceptorConfig interceptorConfig = getActiveMemberNetworkConfig(instance.getConfig()).getSocketInterceptorConfig();
timedMemberState.setSocketInterceptorEnabled(interceptorConfig != null && interceptorConfig.isEnabled());
ManagementCenterConfig managementCenterConfig = instance.node.getConfig().getManagementCenterConfig();
timedMemberState.setScriptingEnabled(managementCenterConfig.isScriptingEnabled());
timedMemberState.setConsoleEnabled(managementCenterConfig.isConsoleEnabled());
timedMemberState.setMcDataAccessEnabled(managementCenterConfig.isDataAccessEnabled());
return timedMemberState;
}
use of com.hazelcast.internal.services.StatisticsAwareService in project hazelcast by hazelcast.
the class AbstractMapServiceFactory method createMapService.
/**
* Returns a {@link MapService} object by populating it with required
* auxiliary services.
*
* @return {@link MapService} object
*/
@Override
public MapService createMapService() {
NodeEngine nodeEngine = getNodeEngine();
MapServiceContext mapServiceContext = getMapServiceContext();
ManagedService managedService = createManagedService();
CountingMigrationAwareService migrationAwareService = createMigrationAwareService();
TransactionalService transactionalService = createTransactionalService();
RemoteService remoteService = createRemoteService();
EventPublishingService eventPublishingService = createEventPublishingService();
PostJoinAwareService postJoinAwareService = createPostJoinAwareService();
SplitBrainHandlerService splitBrainHandlerService = createSplitBrainHandlerService();
WanSupportingService wanSupportingService = createReplicationSupportingService();
StatisticsAwareService statisticsAwareService = createStatisticsAwareService();
PartitionAwareService partitionAwareService = createPartitionAwareService();
MapSplitBrainProtectionAwareService splitBrainProtectionAwareService = createSplitBrainProtectionAwareService();
ClientAwareService clientAwareService = createClientAwareService();
checkNotNull(nodeEngine, "nodeEngine should not be null");
checkNotNull(mapServiceContext, "mapServiceContext should not be null");
checkNotNull(managedService, "managedService should not be null");
checkNotNull(migrationAwareService, "migrationAwareService should not be null");
checkNotNull(transactionalService, "transactionalService should not be null");
checkNotNull(remoteService, "remoteService should not be null");
checkNotNull(eventPublishingService, "eventPublishingService should not be null");
checkNotNull(postJoinAwareService, "postJoinAwareService should not be null");
checkNotNull(splitBrainHandlerService, "splitBrainHandlerService should not be null");
checkNotNull(wanSupportingService, "replicationSupportingService should not be null");
checkNotNull(statisticsAwareService, "statisticsAwareService should not be null");
checkNotNull(partitionAwareService, "partitionAwareService should not be null");
checkNotNull(splitBrainProtectionAwareService, "splitBrainProtectionAwareService should not be null");
checkNotNull(clientAwareService, "clientAwareService should not be null");
MapService mapService = new MapService();
mapService.managedService = managedService;
mapService.migrationAwareService = migrationAwareService;
mapService.transactionalService = transactionalService;
mapService.remoteService = remoteService;
mapService.eventPublishingService = eventPublishingService;
mapService.postJoinAwareService = postJoinAwareService;
mapService.splitBrainHandlerService = splitBrainHandlerService;
mapService.wanSupportingService = wanSupportingService;
mapService.statisticsAwareService = statisticsAwareService;
mapService.mapServiceContext = mapServiceContext;
mapService.partitionAwareService = partitionAwareService;
mapService.splitBrainProtectionAwareService = splitBrainProtectionAwareService;
mapService.clientAwareService = clientAwareService;
mapServiceContext.setService(mapService);
return mapService;
}
use of com.hazelcast.internal.services.StatisticsAwareService in project hazelcast by hazelcast.
the class LocalMapStatsUnderOnGoingClientUpdateTest method stats_generated_when_member_restarted_under_ongoing_client_update.
@Test
public void stats_generated_when_member_restarted_under_ongoing_client_update() throws Exception {
IMap map = client.getMap(mapName);
member.shutdown();
member = factory.newHazelcastInstance();
map.put(1, 1);
map.put(2, 2);
// get internal StatisticsAwareService.
MapService mapService = getNodeEngineImpl(member).getService(SERVICE_NAME);
Map<String, LocalMapStats> stats = ((StatisticsAwareService) mapService).getStats();
LocalMapStats localMapStats = stats.get(mapName);
// StatisticsAwareService should give right stats.
assertNotNull("there should be 1 LocalMapStats object", localMapStats);
assertEquals("Owned entry count should be 2", 2, localMapStats.getOwnedEntryCount());
}
Aggregations