Search in sources :

Example 1 with WriteThroughStore

use of com.hazelcast.map.impl.mapstore.writethrough.WriteThroughStore in project hazelcast by hazelcast.

the class MapDataStores method createWriteThroughStore.

/**
     * Creates a write through data store.
     *
     * @param mapStoreContext context for map store operations.
     * @param <K>             type of key to store.
     * @param <V>             type of value to store.
     * @return new write through store manager.
     */
public static <K, V> MapDataStore<K, V> createWriteThroughStore(MapStoreContext mapStoreContext) {
    final MapStoreWrapper store = mapStoreContext.getMapStoreWrapper();
    final MapServiceContext mapServiceContext = mapStoreContext.getMapServiceContext();
    final NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
    final SerializationService serializationService = nodeEngine.getSerializationService();
    return (MapDataStore<K, V>) new WriteThroughStore(store, serializationService);
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) MapStoreWrapper(com.hazelcast.map.impl.MapStoreWrapper) WriteThroughStore(com.hazelcast.map.impl.mapstore.writethrough.WriteThroughStore) SerializationService(com.hazelcast.spi.serialization.SerializationService) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Aggregations

MapServiceContext (com.hazelcast.map.impl.MapServiceContext)1 MapStoreWrapper (com.hazelcast.map.impl.MapStoreWrapper)1 WriteThroughStore (com.hazelcast.map.impl.mapstore.writethrough.WriteThroughStore)1 NodeEngine (com.hazelcast.spi.NodeEngine)1 SerializationService (com.hazelcast.spi.serialization.SerializationService)1