private RecordStore getRecordStoreOrNull() { int partitionId = getPartitionId(); if (partitionId == -1) { return null; } PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(partitionId); if (createRecordStoreOnDemand) { return partitionContainer.getRecordStore(name); } else { return partitionContainer.getExistingRecordStore(name); } }
private RecordStore getRecordStoreOrNull() { int partitionId = getPartitionId(); if (partitionId == -1) { return null; } PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(partitionId); if (createRecordStoreOnDemand) { return partitionContainer.getRecordStore(name); } else { return partitionContainer.getExistingRecordStore(name); } }
/** * This method helps to add clearing Near Cache event only from one-partition which matches partitionId of the map name. */ protected final void invalidateAllKeysInNearCaches() { if (mapContainer.hasInvalidationListener()) { int partitionId = getPartitionId(); Invalidator invalidator = getNearCacheInvalidator(); if (partitionId == getNodeEngine().getPartitionService().getPartitionId(name)) { invalidator.invalidateAllKeys(name, getCallerUuid()); } invalidator.resetPartitionMetaData(name, getPartitionId()); } }
/** * This method helps to add clearing Near Cache event only from one-partition which matches partitionId of the map name. */ protected final void invalidateAllKeysInNearCaches() { if (mapContainer.hasInvalidationListener()) { int partitionId = getPartitionId(); Invalidator invalidator = getNearCacheInvalidator(); if (partitionId == getNodeEngine().getPartitionService().getPartitionId(name)) { invalidator.invalidateAllKeys(name, getCallerUuid()); } invalidator.resetPartitionMetaData(name, getPartitionId()); } }
@SuppressWarnings("checkstyle:executablestatementcount") private EntryOperator(MapOperation mapOperation, Object processor, Predicate predicate, boolean collectWanEvents) { this.backup = mapOperation instanceof BackupOperation; setProcessor(processor); this.mapOperation = mapOperation; this.predicate = predicate; this.recordStore = mapOperation.recordStore; this.readOnly = entryProcessor instanceof ReadOnly; this.mapContainer = recordStore.getMapContainer(); this.inMemoryFormat = mapContainer.getMapConfig().getInMemoryFormat(); this.mapName = mapContainer.getName(); this.wanReplicationEnabled = mapContainer.isWanReplicationEnabled(); this.shouldClone = mapContainer.shouldCloneOnEntryProcessing(mapOperation.getPartitionId()); this.mapServiceContext = mapContainer.getMapServiceContext(); LocalMapStatsProvider localMapStatsProvider = mapServiceContext.getLocalMapStatsProvider(); this.stats = localMapStatsProvider.getLocalMapStatsImpl(mapName); NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); this.ss = ((InternalSerializationService) nodeEngine.getSerializationService()); this.partitionService = nodeEngine.getPartitionService(); EventService eventService = nodeEngine.getEventService(); this.hasEventRegistration = eventService.hasEventRegistration(SERVICE_NAME, mapName); this.mapEventPublisher = mapServiceContext.getMapEventPublisher(); this.partitionId = recordStore.getPartitionId(); this.callerAddress = mapOperation.getCallerAddress(); }
@SuppressWarnings("checkstyle:executablestatementcount") private EntryOperator(MapOperation mapOperation, Object processor, Predicate predicate, boolean collectWanEvents) { this.backup = mapOperation instanceof BackupOperation; setProcessor(processor); this.mapOperation = mapOperation; this.predicate = predicate; this.recordStore = mapOperation.recordStore; this.readOnly = entryProcessor instanceof ReadOnly; this.mapContainer = recordStore.getMapContainer(); this.inMemoryFormat = mapContainer.getMapConfig().getInMemoryFormat(); this.mapName = mapContainer.getName(); this.wanReplicationEnabled = mapContainer.isWanReplicationEnabled(); this.shouldClone = mapContainer.shouldCloneOnEntryProcessing(mapOperation.getPartitionId()); this.mapServiceContext = mapContainer.getMapServiceContext(); LocalMapStatsProvider localMapStatsProvider = mapServiceContext.getLocalMapStatsProvider(); this.stats = localMapStatsProvider.getLocalMapStatsImpl(mapName); NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); this.ss = ((InternalSerializationService) nodeEngine.getSerializationService()); this.partitionService = nodeEngine.getPartitionService(); EventService eventService = nodeEngine.getEventService(); this.hasEventRegistration = eventService.hasEventRegistration(SERVICE_NAME, mapName); this.mapEventPublisher = mapServiceContext.getMapEventPublisher(); this.partitionId = recordStore.getPartitionId(); this.callerAddress = mapOperation.getCallerAddress(); }