Search in sources :

Example 1 with LocalMapStatsProvider

use of com.hazelcast.map.impl.LocalMapStatsProvider in project hazelcast by hazelcast.

the class EntryOperation method getLocalMapStats.

private LocalMapStatsImpl getLocalMapStats() {
    final MapServiceContext mapServiceContext = mapService.getMapServiceContext();
    final LocalMapStatsProvider localMapStatsProvider = mapServiceContext.getLocalMapStatsProvider();
    return localMapStatsProvider.getLocalMapStatsImpl(name);
}
Also used : LocalMapStatsProvider(com.hazelcast.map.impl.LocalMapStatsProvider) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Example 2 with LocalMapStatsProvider

use of com.hazelcast.map.impl.LocalMapStatsProvider in project hazelcast by hazelcast.

the class ContainsValueOperation method run.

@Override
public void run() {
    contains = recordStore.containsValue(testValue);
    if (mapContainer.getMapConfig().isStatisticsEnabled()) {
        LocalMapStatsProvider localMapStatsProvider = mapServiceContext.getLocalMapStatsProvider();
        localMapStatsProvider.getLocalMapStatsImpl(name).incrementOtherOperations();
    }
}
Also used : LocalMapStatsProvider(com.hazelcast.map.impl.LocalMapStatsProvider)

Example 3 with LocalMapStatsProvider

use of com.hazelcast.map.impl.LocalMapStatsProvider in project hazelcast by hazelcast.

the class MapSizeOperation method run.

@Override
public void run() {
    recordStore.checkIfLoaded();
    size = recordStore.size();
    if (mapContainer.getMapConfig().isStatisticsEnabled()) {
        LocalMapStatsProvider localMapStatsProvider = mapServiceContext.getLocalMapStatsProvider();
        LocalMapStatsImpl localMapStatsImpl = localMapStatsProvider.getLocalMapStatsImpl(name);
        localMapStatsImpl.incrementOtherOperations();
    }
}
Also used : LocalMapStatsImpl(com.hazelcast.monitor.impl.LocalMapStatsImpl) LocalMapStatsProvider(com.hazelcast.map.impl.LocalMapStatsProvider)

Example 4 with LocalMapStatsProvider

use of com.hazelcast.map.impl.LocalMapStatsProvider in project hazelcast by hazelcast.

the class MapClearMessageTask method reduce.

@Override
protected Object reduce(Map<Integer, Object> map) {
    int clearedTotal = 0;
    for (Object affectedEntries : map.values()) {
        clearedTotal += (Integer) affectedEntries;
    }
    MapService service = getService(MapService.SERVICE_NAME);
    MapServiceContext mapServiceContext = service.getMapServiceContext();
    if (clearedTotal > 0) {
        Address thisAddress = nodeEngine.getThisAddress();
        MapEventPublisher mapEventPublisher = mapServiceContext.getMapEventPublisher();
        mapEventPublisher.publishMapEvent(thisAddress, parameters, CLEAR_ALL, clearedTotal);
    }
    final MapService mapService = getService(MapService.SERVICE_NAME);
    MapContainer mapContainer = mapService.getMapServiceContext().getMapContainer(parameters);
    if (mapContainer.getMapConfig().isStatisticsEnabled()) {
        LocalMapStatsProvider localMapStatsProvider = mapServiceContext.getLocalMapStatsProvider();
        localMapStatsProvider.getLocalMapStatsImpl(parameters).incrementOtherOperations();
    }
    return null;
}
Also used : Address(com.hazelcast.cluster.Address) LocalMapStatsProvider(com.hazelcast.map.impl.LocalMapStatsProvider) MapService(com.hazelcast.map.impl.MapService) MapServiceContext(com.hazelcast.map.impl.MapServiceContext) MapContainer(com.hazelcast.map.impl.MapContainer) MapEventPublisher(com.hazelcast.map.impl.event.MapEventPublisher)

Example 5 with LocalMapStatsProvider

use of com.hazelcast.map.impl.LocalMapStatsProvider in project hazelcast by hazelcast.

the class MapContainsKeyMessageTask method processResponseBeforeSending.

@Override
protected Object processResponseBeforeSending(Object response) {
    MapService mapService = getService(MapService.SERVICE_NAME);
    MapContainer mapContainer = mapService.getMapServiceContext().getMapContainer(parameters.name);
    if (mapContainer.getMapConfig().isStatisticsEnabled()) {
        LocalMapStatsProvider localMapStatsProvider = mapService.getMapServiceContext().getLocalMapStatsProvider();
        localMapStatsProvider.getLocalMapStatsImpl(parameters.name).incrementOtherOperations();
    }
    return super.processResponseBeforeSending(response);
}
Also used : LocalMapStatsProvider(com.hazelcast.map.impl.LocalMapStatsProvider) MapService(com.hazelcast.map.impl.MapService) MapContainer(com.hazelcast.map.impl.MapContainer)

Aggregations

LocalMapStatsProvider (com.hazelcast.map.impl.LocalMapStatsProvider)5 MapContainer (com.hazelcast.map.impl.MapContainer)2 MapService (com.hazelcast.map.impl.MapService)2 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)2 Address (com.hazelcast.cluster.Address)1 MapEventPublisher (com.hazelcast.map.impl.event.MapEventPublisher)1 LocalMapStatsImpl (com.hazelcast.monitor.impl.LocalMapStatsImpl)1