public class WriteBehindStore extends AbstractMapDataStore<Data,Object>
Constructor and Description |
---|
WriteBehindStore(MapStoreWrapper store,
SerializationService serializationService,
long writeDelayTime,
int partitionId,
boolean writeCoalescing) |
Modifier and Type | Method and Description |
---|---|
Object |
add(Data key,
Object value,
long now) |
Object |
addBackup(Data key,
Object value,
long time) |
void |
addTransient(Data key,
long now) |
void |
cleanupStagingArea(long now) |
Collection |
flush() |
Object |
flush(Data key,
Object value,
long now,
boolean backup)
GOTCHA: When
writeCoalescing is true, you may see more than one write operations
to map store, e.g. |
WriteBehindQueue<DelayedEntry> |
getWriteBehindQueue() |
Object |
load(Data key) |
boolean |
loadable(Data key,
long lastUpdateTime,
long now)
* Used in
IMap.loadAll(boolean) calls. |
Map |
loadAll(Collection keys) |
int |
notFinishedOperationsCount() |
void |
remove(Data key,
long now) |
void |
removeBackup(Data key,
long time) |
void |
reset() |
void |
setWriteBehindProcessor(WriteBehindProcessor writeBehindProcessor) |
void |
setWriteBehindQueue(WriteBehindQueue<DelayedEntry> writeBehindQueue) |
convertToObjectKeys, getStore, isPostProcessingMapStore, removeAll, toData, toObject
public WriteBehindStore(MapStoreWrapper store, SerializationService serializationService, long writeDelayTime, int partitionId, boolean writeCoalescing)
public void setWriteBehindQueue(WriteBehindQueue<DelayedEntry> writeBehindQueue)
public void addTransient(Data key, long now)
public void remove(Data key, long now)
public void removeBackup(Data key, long time)
public void reset()
public Map loadAll(Collection keys)
loadAll
in interface MapDataStore<Data,Object>
loadAll
in class AbstractMapDataStore<Data,Object>
public boolean loadable(Data key, long lastUpdateTime, long now)
IMap.loadAll(boolean)
calls.
If write-behind map-store feature enabled, some things may lead possible data inconsistencies.
These are:
- calling evict/evictAll.
- calling remove.
- not yet stored write behind queue operation.
With this method we can be sure that a key can be loadable from map-store or not.key
- to query whether loadable or not.lastUpdateTime
- last update time.now
- in millstrue
if loadable, otherwise false.public int notFinishedOperationsCount()
public Object flush(Data key, Object value, long now, boolean backup)
writeCoalescing
is true, you may see more than one write operations
to map store, e.g. if a flush during eviction and StoreWorker
fetch the operation on same
key, order of operations may be reflected differently to map store.key
- key to be flushedvalue
- value to be flushednow
- now in millisbackup
- true
calling this method for backup partition, false
for owner partition.public Collection flush()
public void cleanupStagingArea(long now)
public WriteBehindQueue<DelayedEntry> getWriteBehindQueue()
public void setWriteBehindProcessor(WriteBehindProcessor writeBehindProcessor)
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.