AbstractWriteBehindProcessor(MapStoreContext mapStoreContext) { this.serializationService = mapStoreContext.getSerializationService(); this.mapStore = mapStoreContext.getMapStoreWrapper(); this.logger = mapStoreContext.getLogger(DefaultWriteBehindProcessor.class); MapStoreConfig mapStoreConfig = mapStoreContext.getMapStoreConfig(); this.writeBatchSize = mapStoreConfig.getWriteBatchSize(); this.writeCoalescing = mapStoreConfig.isWriteCoalescing(); }
AbstractWriteBehindProcessor(MapStoreContext mapStoreContext) { this.serializationService = mapStoreContext.getSerializationService(); this.mapStore = mapStoreContext.getMapStoreWrapper(); this.logger = mapStoreContext.getLogger(DefaultWriteBehindProcessor.class); MapStoreConfig mapStoreConfig = mapStoreContext.getMapStoreConfig(); this.writeBatchSize = mapStoreConfig.getWriteBatchSize(); this.writeCoalescing = mapStoreConfig.isWriteCoalescing(); }
public MapStoreConfig(MapStoreConfig config) { enabled = config.isEnabled(); className = config.getClassName(); implementation = config.getImplementation(); factoryClassName = config.getFactoryClassName(); factoryImplementation = config.getFactoryImplementation(); writeDelaySeconds = config.getWriteDelaySeconds(); writeBatchSize = config.getWriteBatchSize(); initialLoadMode = config.getInitialLoadMode(); writeCoalescing = config.isWriteCoalescing(); properties.putAll(config.getProperties()); }
public MapStoreConfig(MapStoreConfig config) { enabled = config.isEnabled(); className = config.getClassName(); implementation = config.getImplementation(); factoryClassName = config.getFactoryClassName(); factoryImplementation = config.getFactoryImplementation(); writeDelaySeconds = config.getWriteDelaySeconds(); writeBatchSize = config.getWriteBatchSize(); initialLoadMode = config.getInitialLoadMode(); writeCoalescing = config.isWriteCoalescing(); properties.putAll(config.getProperties()); }
public WriteBehindStore(MapStoreContext mapStoreContext, int partitionId, InternalSerializationService serializationService) { super(mapStoreContext.getMapStoreWrapper(), serializationService); MapStoreConfig mapStoreConfig = mapStoreContext.getMapStoreConfig(); this.partitionId = partitionId; this.inMemoryFormat = getInMemoryFormat(mapStoreContext); this.coalesce = mapStoreConfig.isWriteCoalescing(); this.mapName = mapStoreContext.getMapName(); this.nodeEngine = mapStoreContext.getMapServiceContext().getNodeEngine(); this.operationService = nodeEngine.getOperationService(); }
public WriteBehindStore(MapStoreContext mapStoreContext, int partitionId, InternalSerializationService serializationService) { super(mapStoreContext.getMapStoreWrapper(), serializationService); MapStoreConfig mapStoreConfig = mapStoreContext.getMapStoreConfig(); this.partitionId = partitionId; this.inMemoryFormat = getInMemoryFormat(mapStoreContext); this.coalesce = mapStoreConfig.isWriteCoalescing(); this.mapName = mapStoreContext.getMapName(); this.nodeEngine = mapStoreContext.getMapServiceContext().getNodeEngine(); this.operationService = nodeEngine.getOperationService(); }
/** * Creates a write behind data store. * * @param mapStoreContext context for map store operations * @param partitionId partition ID of partition * @param writeBehindProcessor the {@link WriteBehindProcessor} * @param <K> type of key to store * @param <V> type of value to store * @return new write behind store manager */ public static <K, V> MapDataStore<K, V> createWriteBehindStore(MapStoreContext mapStoreContext, int partitionId, WriteBehindProcessor writeBehindProcessor) { MapServiceContext mapServiceContext = mapStoreContext.getMapServiceContext(); NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); MapStoreConfig mapStoreConfig = mapStoreContext.getMapStoreConfig(); InternalSerializationService serializationService = ((InternalSerializationService) nodeEngine.getSerializationService()); WriteBehindStore mapDataStore = new WriteBehindStore(mapStoreContext, partitionId, serializationService); mapDataStore.setWriteBehindQueue(newWriteBehindQueue(mapServiceContext, mapStoreConfig.isWriteCoalescing())); mapDataStore.setWriteBehindProcessor(writeBehindProcessor); return (MapDataStore<K, V>) mapDataStore; }
/** * Creates a write behind data store. * * @param mapStoreContext context for map store operations * @param partitionId partition ID of partition * @param writeBehindProcessor the {@link WriteBehindProcessor} * @param <K> type of key to store * @param <V> type of value to store * @return new write behind store manager */ public static <K, V> MapDataStore<K, V> createWriteBehindStore(MapStoreContext mapStoreContext, int partitionId, WriteBehindProcessor writeBehindProcessor) { MapServiceContext mapServiceContext = mapStoreContext.getMapServiceContext(); NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); MapStoreConfig mapStoreConfig = mapStoreContext.getMapStoreConfig(); InternalSerializationService serializationService = ((InternalSerializationService) nodeEngine.getSerializationService()); WriteBehindStore mapDataStore = new WriteBehindStore(mapStoreContext, partitionId, serializationService); mapDataStore.setWriteBehindQueue(newWriteBehindQueue(mapServiceContext, mapStoreConfig.isWriteCoalescing())); mapDataStore.setWriteBehindProcessor(writeBehindProcessor); return (MapDataStore<K, V>) mapDataStore; }
public static MapStoreConfigHolder of(MapStoreConfig config, SerializationService serializationService) { if (config == null) { return null; } MapStoreConfigHolder holder = new MapStoreConfigHolder(); holder.setClassName(config.getClassName()); holder.setEnabled(config.isEnabled()); holder.setFactoryClassName(config.getFactoryClassName()); holder.setFactoryImplementation(serializationService.toData(config.getFactoryImplementation())); holder.setImplementation(serializationService.toData(config.getImplementation())); holder.setInitialLoadMode(config.getInitialLoadMode().name()); holder.setProperties(config.getProperties()); holder.setWriteBatchSize(config.getWriteBatchSize()); holder.setWriteCoalescing(config.isWriteCoalescing()); holder.setWriteDelaySeconds(config.getWriteDelaySeconds()); return holder; } }
public static MapStoreConfigHolder of(MapStoreConfig config, SerializationService serializationService) { if (config == null) { return null; } MapStoreConfigHolder holder = new MapStoreConfigHolder(); holder.setClassName(config.getClassName()); holder.setEnabled(config.isEnabled()); holder.setFactoryClassName(config.getFactoryClassName()); holder.setFactoryImplementation(serializationService.toData(config.getFactoryImplementation())); holder.setImplementation(serializationService.toData(config.getImplementation())); holder.setInitialLoadMode(config.getInitialLoadMode().name()); holder.setProperties(config.getProperties()); holder.setWriteBatchSize(config.getWriteBatchSize()); holder.setWriteCoalescing(config.isWriteCoalescing()); holder.setWriteDelaySeconds(config.getWriteDelaySeconds()); return holder; } }