@Override public void destroyMapStores() { for (MapContainer mapContainer : mapContainers.values()) { MapStoreWrapper store = mapContainer.getMapStoreContext().getMapStoreWrapper(); if (store != null) { store.destroy(); } } }
@Override public void destroyMapStores() { for (MapContainer mapContainer : mapContainers.values()) { MapStoreWrapper store = mapContainer.getMapStoreContext().getMapStoreWrapper(); if (store != null) { store.destroy(); } } }
@Override public void flushMaps() { for (MapContainer mapContainer : mapContainers.values()) { mapContainer.getMapStoreContext().stop(); } for (PartitionContainer partitionContainer : partitionContainers) { for (String mapName : mapContainers.keySet()) { RecordStore recordStore = partitionContainer.getExistingRecordStore(mapName); if (recordStore != null) { MapDataStore mapDataStore = recordStore.getMapDataStore(); mapDataStore.hardFlush(); } } } }
@Override public void flushMaps() { for (MapContainer mapContainer : mapContainers.values()) { mapContainer.getMapStoreContext().stop(); } for (PartitionContainer partitionContainer : partitionContainers) { for (String mapName : mapContainers.keySet()) { RecordStore recordStore = partitionContainer.getExistingRecordStore(mapName); if (recordStore != null) { MapDataStore mapDataStore = recordStore.getMapDataStore(); mapDataStore.hardFlush(); } } } }
public MapStore getMapStore(String mapName) { MapService svc = nodeEngine.getService(MapService.SERVICE_NAME); MapContainer mc = svc.getMapServiceContext().getMapContainer(mapName); if (mc != null) { MapStoreContext msc = mc.getMapStoreContext(); if (msc != null) { MapStoreWrapper msw = msc.getMapStoreWrapper(); if (msw != null) { return (MapStore) msw.getImpl(); } } } return null; }
void prepare(PartitionContainer container, Collection<ServiceNamespace> namespaces, int replicaIndex) { int size = namespaces.size(); flushSequences = createHashMap(size); delayedEntries = createHashMap(size); for (ServiceNamespace namespace : namespaces) { ObjectNamespace mapNamespace = (ObjectNamespace) namespace; String mapName = mapNamespace.getObjectName(); RecordStore recordStore = container.getRecordStore(mapName); if (recordStore == null) { continue; } MapContainer mapContainer = recordStore.getMapContainer(); MapConfig mapConfig = mapContainer.getMapConfig(); if (mapConfig.getTotalBackupCount() < replicaIndex || !mapContainer.getMapStoreContext().isWriteBehindMapStoreEnabled()) { continue; } WriteBehindStore mapDataStore = (WriteBehindStore) recordStore.getMapDataStore(); WriteBehindQueue<DelayedEntry> writeBehindQueue = mapDataStore.getWriteBehindQueue(); List<DelayedEntry> entries = writeBehindQueue.asList(); if (entries == null || entries.isEmpty()) { continue; } delayedEntries.put(mapName, entries); flushSequences.put(mapName, new ArrayDeque<WriteBehindStore.Sequence>(mapDataStore.getFlushSequences())); } }
void prepare(PartitionContainer container, Collection<ServiceNamespace> namespaces, int replicaIndex) { int size = namespaces.size(); flushSequences = createHashMap(size); delayedEntries = createHashMap(size); for (ServiceNamespace namespace : namespaces) { ObjectNamespace mapNamespace = (ObjectNamespace) namespace; String mapName = mapNamespace.getObjectName(); RecordStore recordStore = container.getRecordStore(mapName); if (recordStore == null) { continue; } MapContainer mapContainer = recordStore.getMapContainer(); MapConfig mapConfig = mapContainer.getMapConfig(); if (mapConfig.getTotalBackupCount() < replicaIndex || !mapContainer.getMapStoreContext().isWriteBehindMapStoreEnabled()) { continue; } WriteBehindStore mapDataStore = (WriteBehindStore) recordStore.getMapDataStore(); WriteBehindQueue<DelayedEntry> writeBehindQueue = mapDataStore.getWriteBehindQueue(); List<DelayedEntry> entries = writeBehindQueue.asList(); if (entries == null || entries.isEmpty()) { continue; } delayedEntries.put(mapName, entries); flushSequences.put(mapName, new ArrayDeque<WriteBehindStore.Sequence>(mapDataStore.getFlushSequences())); } }
@Override public void destroyMap(String mapName) { // on LiteMembers we don't have a MapContainer, but we may have a Near Cache and listeners mapNearCacheManager.destroyNearCache(mapName); nodeEngine.getEventService().deregisterAllListeners(SERVICE_NAME, mapName); MapContainer mapContainer = mapContainers.get(mapName); if (mapContainer == null) { return; } nodeEngine.getWanReplicationService().removeWanEventCounters(MapService.SERVICE_NAME, mapName); mapContainer.getMapStoreContext().stop(); localMapStatsProvider.destroyLocalMapStatsImpl(mapContainer.getName()); destroyPartitionsAndMapContainer(mapContainer); }
@Override public void destroyMap(String mapName) { // on LiteMembers we don't have a MapContainer, but we may have a Near Cache and listeners mapNearCacheManager.destroyNearCache(mapName); nodeEngine.getEventService().deregisterAllListeners(SERVICE_NAME, mapName); MapContainer mapContainer = mapContainers.get(mapName); if (mapContainer == null) { return; } nodeEngine.getWanReplicationService().removeWanEventCounters(MapService.SERVICE_NAME, mapName); mapContainer.getMapStoreContext().stop(); localMapStatsProvider.destroyLocalMapStatsImpl(mapContainer.getName()); destroyPartitionsAndMapContainer(mapContainer); }
protected AbstractRecordStore(MapContainer mapContainer, int partitionId) { this.name = mapContainer.getName(); this.mapContainer = mapContainer; this.partitionId = partitionId; this.mapServiceContext = mapContainer.getMapServiceContext(); NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); this.serializationService = nodeEngine.getSerializationService(); this.inMemoryFormat = mapContainer.getMapConfig().getInMemoryFormat(); this.recordFactory = mapContainer.getRecordFactoryConstructor().createNew(null); this.valueComparator = mapServiceContext.getValueComparatorOf(inMemoryFormat); this.mapStoreContext = mapContainer.getMapStoreContext(); this.mapDataStore = mapStoreContext.getMapStoreManager().getMapDataStore(name, partitionId); this.lockStore = createLockStore(); Collection<RecordStoreMutationObserver<Record>> mutationObservers = mapServiceContext .createRecordStoreMutationObservers(getName(), partitionId); this.mutationObserver = new CompositeRecordStoreMutationObserver<Record>(mutationObservers); }
protected AbstractRecordStore(MapContainer mapContainer, int partitionId) { this.name = mapContainer.getName(); this.mapContainer = mapContainer; this.partitionId = partitionId; this.mapServiceContext = mapContainer.getMapServiceContext(); NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); this.serializationService = nodeEngine.getSerializationService(); this.inMemoryFormat = mapContainer.getMapConfig().getInMemoryFormat(); this.recordFactory = mapContainer.getRecordFactoryConstructor().createNew(null); this.valueComparator = mapServiceContext.getValueComparatorOf(inMemoryFormat); this.mapStoreContext = mapContainer.getMapStoreContext(); this.mapDataStore = mapStoreContext.getMapStoreManager().getMapDataStore(name, partitionId); this.lockStore = createLockStore(); Collection<RecordStoreMutationObserver<Record>> mutationObservers = mapServiceContext .createRecordStoreMutationObservers(getName(), partitionId); this.mutationObserver = new CompositeRecordStoreMutationObserver<Record>(mutationObservers); }