use of com.hazelcast.map.impl.mapstore.MapDataStore in project hazelcast by hazelcast.
the class MapServiceContextImpl method flushMaps.
@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();
}
}
}
}
use of com.hazelcast.map.impl.mapstore.MapDataStore in project hazelcast by hazelcast.
the class AwaitMapFlushOperation method innerBeforeRun.
@Override
public void innerBeforeRun() throws Exception {
super.innerBeforeRun();
MapDataStore mapDataStore = recordStore.getMapDataStore();
if (!(mapDataStore instanceof WriteBehindStore)) {
return;
}
store = (WriteBehindStore) mapDataStore;
}
use of com.hazelcast.map.impl.mapstore.MapDataStore in project hazelcast by hazelcast.
the class StoreWorker method hasEntryInWriteBehindQueue.
private boolean hasEntryInWriteBehindQueue(RecordStore recordStore) {
if (recordStore == null) {
return false;
}
MapDataStore mapDataStore = recordStore.getMapDataStore();
WriteBehindStore dataStore = (WriteBehindStore) mapDataStore;
WriteBehindQueue<DelayedEntry> writeBehindQueue = dataStore.getWriteBehindQueue();
return writeBehindQueue.size() != 0;
}
use of com.hazelcast.map.impl.mapstore.MapDataStore in project hazelcast by hazelcast.
the class MapStoreWriteBehindTest method writeBehindQueueSize.
private int writeBehindQueueSize(HazelcastInstance node, String mapName) {
int size = 0;
final NodeEngineImpl nodeEngine = getNode(node).getNodeEngine();
MapService mapService = nodeEngine.getService(MapService.SERVICE_NAME);
final MapServiceContext mapServiceContext = mapService.getMapServiceContext();
final int partitionCount = nodeEngine.getPartitionService().getPartitionCount();
for (int i = 0; i < partitionCount; i++) {
final RecordStore recordStore = mapServiceContext.getExistingRecordStore(i, mapName);
if (recordStore == null) {
continue;
}
final MapDataStore mapDataStore = recordStore.getMapDataStore();
size += ((WriteBehindStore) mapDataStore).getWriteBehindQueue().size();
}
return size;
}
use of com.hazelcast.map.impl.mapstore.MapDataStore in project hazelcast by hazelcast.
the class WriteBehindOnBackupsTest method writeBehindQueueSize.
public static int writeBehindQueueSize(HazelcastInstance node, String mapName) {
int size = 0;
final NodeEngineImpl nodeEngine = getNode(node).getNodeEngine();
MapService mapService = nodeEngine.getService(MapService.SERVICE_NAME);
final MapServiceContext mapServiceContext = mapService.getMapServiceContext();
final int partitionCount = nodeEngine.getPartitionService().getPartitionCount();
for (int i = 0; i < partitionCount; i++) {
final RecordStore recordStore = mapServiceContext.getExistingRecordStore(i, mapName);
if (recordStore == null) {
continue;
}
final MapDataStore mapDataStore = recordStore.getMapDataStore();
if (mapDataStore instanceof WriteBehindStore) {
size += ((WriteBehindStore) mapDataStore).getWriteBehindQueue().size();
}
}
return size;
}
Aggregations