@Override public int getSyncBackupCount() { if (asyncBackup) { return 0; } MapContainer mapContainer = mapServiceContext.getMapContainer(name); return mapContainer.getBackupCount(); }
/** * Creates {@link MapOperationProvider} instance and wraps it into a {@link WANAwareOperationProvider} * * @param name Name of the requested {@link com.hazelcast.core.IMap} * @return {@link DefaultMapOperationProvider} or {@link WANAwareOperationProvider} depending on the WAN replication * config of the requested map instance. */ public MapOperationProvider getOperationProvider(String name) { MapContainer mapContainer = mapServiceContext.getMapContainer(name); return mapContainer.isWanReplicationEnabled() ? wanAwareProvider : defaultProvider; }
public void innerBeforeRun() throws Exception { recordStore = getRecordStoreOrNull(); if (recordStore == null) { mapContainer = mapServiceContext.getMapContainer(name); } else { mapContainer = recordStore.getMapContainer(); } }
@Override public ObjectNamespace getServiceNamespace() { MapContainer container = mapContainer; if (container == null) { MapService service = getService(); container = service.getMapServiceContext().getMapContainer(name); } return container.getObjectNamespace(); }
@Override public ObjectNamespace getServiceNamespace() { MapContainer container = mapContainer; if (container == null) { MapService service = getService(); container = service.getMapServiceContext().getMapContainer(name); } return container.getObjectNamespace(); }
@Override public void run() { mapService = getService(); MapServiceContext mapServiceContext = mapService.getMapServiceContext(); MapContainer mapContainer = mapServiceContext.getMapContainer(mapName); mapContainer.getInterceptorRegistry().deregister(id); }
@Override public void onRegister(Object service, String serviceName, String topic, EventRegistration registration) { EventFilter filter = registration.getFilter(); if (!(filter instanceof EventListenerFilter) || !filter.eval(INVALIDATION.getType())) { return; } MapContainer mapContainer = mapServiceContext.getMapContainer(topic); mapContainer.increaseInvalidationListenerCount(); }
@Override public void onDeregister(Object service, String serviceName, String topic, EventRegistration registration) { EventFilter filter = registration.getFilter(); if (!(filter instanceof EventListenerFilter) || !filter.eval(INVALIDATION.getType())) { return; } MapContainer mapContainer = mapServiceContext.getMapContainer(topic); mapContainer.decreaseInvalidationListenerCount(); }
@Override public void run() { mapService = getService(); MapContainer mapContainer = mapService.getMapServiceContext().getMapContainer(mapName); mapContainer.getInterceptorRegistry().register(id, mapInterceptor); }
@Override protected void beforeResponse() { final long latencyNanos = System.nanoTime() - startTimeNanos; final MapService mapService = getService(MapService.SERVICE_NAME); MapContainer mapContainer = mapService.getMapServiceContext().getMapContainer(parameters.name); if (mapContainer.getMapConfig().isStatisticsEnabled()) { mapService.getMapServiceContext().getLocalMapStatsProvider().getLocalMapStatsImpl(parameters.name) .incrementGetLatencyNanos(parameters.keys.size(), latencyNanos); } }
@Override protected void beforeResponse() { final long latencyNanos = System.nanoTime() - startTimeNanos; final MapService mapService = getService(MapService.SERVICE_NAME); MapContainer mapContainer = mapService.getMapServiceContext().getMapContainer(parameters.name); if (mapContainer.getMapConfig().isStatisticsEnabled()) { mapService.getMapServiceContext().getLocalMapStatsProvider().getLocalMapStatsImpl(parameters.name) .incrementPutLatencyNanos(parameters.entries.size(), latencyNanos); } }
private void incrementEventStatsInternal(String mapName) { MapContainer mapContainer = mapServiceContext.getMapContainer(mapName); if (mapContainer.getMapConfig().isStatisticsEnabled()) { mapServiceContext.getLocalMapStatsProvider() .getLocalMapStatsImpl(mapName).incrementReceivedEvents(); } }
@Override protected void beforeResponse() { final long latencyNanos = System.nanoTime() - startTimeNanos; final MapService mapService = getService(MapService.SERVICE_NAME); MapContainer mapContainer = mapService.getMapServiceContext().getMapContainer(parameters.name); if (mapContainer.getMapConfig().isStatisticsEnabled()) { mapService.getMapServiceContext().getLocalMapStatsProvider().getLocalMapStatsImpl(parameters.name) .incrementGetLatencyNanos(latencyNanos); } }
Result runPartitionScanQueryOnGivenOwnedPartition(Query query, int partitionId) { MapContainer mapContainer = mapServiceContext.getMapContainer(query.getMapName()); Predicate predicate = queryOptimizer.optimize(query.getPredicate(), mapContainer.getIndexes(partitionId)); Collection<Integer> partitions = singletonList(partitionId); Result result = createResult(query, partitions); partitionScanExecutor.execute(query.getMapName(), predicate, partitions, result); result.completeConstruction(partitions); return result; }
@Override protected void beforeResponse() { final long latencyNanos = System.nanoTime() - startTimeNanos; final MapService mapService = getService(MapService.SERVICE_NAME); MapContainer mapContainer = mapService.getMapServiceContext().getMapContainer(parameters.name); if (mapContainer.getMapConfig().isStatisticsEnabled()) { mapService.getMapServiceContext().getLocalMapStatsProvider().getLocalMapStatsImpl(parameters.name) .incrementRemoveLatencyNanos(latencyNanos); } }
private void clearNonGlobalIndexes(PartitionMigrationEvent event) { final PartitionContainer container = mapServiceContext.getPartitionContainer(event.getPartitionId()); for (RecordStore recordStore : container.getMaps().values()) { final MapContainer mapContainer = mapServiceContext.getMapContainer(recordStore.getName()); final Indexes indexes = mapContainer.getIndexes(event.getPartitionId()); if (!indexes.haveAtLeastOneIndex() || indexes.isGlobal()) { // no indexes to work with continue; } indexes.clearAll(); } }
@Override protected void beforeResponse() { final long latencyNanos = System.nanoTime() - startTimeNanos; final MapService mapService = getService(MapService.SERVICE_NAME); MapContainer mapContainer = mapService.getMapServiceContext().getMapContainer(getDistributedObjectName()); if (mapContainer.getMapConfig().isStatisticsEnabled()) { mapService.getMapServiceContext().getLocalMapStatsProvider().getLocalMapStatsImpl(getDistributedObjectName()) .incrementPutLatencyNanos(latencyNanos); } }
@Override protected void afterResponse() { final 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(); } }
@Override public void run() throws Exception { QueryRunner queryRunner = mapServiceContext.getMapQueryRunner(getName()); // partition scan only, since we can't run partition queries on global indexes result = queryRunner.runPartitionScanQueryOnGivenOwnedPartition(query, getPartitionId()); // we have to increment query count here manually since we are not even // trying to use indexes Indexes indexes = mapServiceContext.getMapContainer(getName()).getIndexes(); indexes.getIndexesStats().incrementQueryCount(); }
@Override public RingbufferConfig toRingbufferConfig(EventJournalConfig config, ObjectNamespace namespace) { MapContainer mapContainer = mapServiceContext.getMapContainer(namespace.getObjectName()); int partitionCount = nodeEngine.getPartitionService().getPartitionCount(); return new RingbufferConfig() .setAsyncBackupCount(mapContainer.getAsyncBackupCount()) .setBackupCount(mapContainer.getBackupCount()) .setInMemoryFormat(InMemoryFormat.OBJECT) .setCapacity(config.getCapacity() / partitionCount) .setTimeToLiveSeconds(config.getTimeToLiveSeconds()); }