com.hazelcast.map.impl.mapstore.writebehind
Class WriteBehindStore

java.lang.Object
  extended by com.hazelcast.map.impl.mapstore.AbstractMapDataStore<Data,Object>
      extended by com.hazelcast.map.impl.mapstore.writebehind.WriteBehindStore
All Implemented Interfaces:
MapDataStore<Data,Object>

public class WriteBehindStore
extends AbstractMapDataStore<Data,Object>

TODO Holds current write behind state and should be included in migrations. Write behind map data store implementation. Created per every record-store. So only called from one-thread.


Constructor Summary
WriteBehindStore(MapStoreWrapper store, SerializationService serializationService, long writeDelayTime, int partitionId)
           
 
Method Summary
 Object add(Data key, Object value, long now)
           
 Object addBackup(Data key, Object value, long time)
           
 void addTransient(Data key, long now)
           
 void clear()
          Clears resources of this map-data-store.
 Collection<Data> flush()
          Flushes all keys in this map-store.
 Object flush(Data key, Object value, long now, boolean backup)
          Flushes the supplied key to the map-store.
 AtomicInteger getFlushCounter()
           
 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 removeFromStagingArea(Data key)
           
 void removeFromStagingArea(Data key, Object value)
           
 void removeFromWaitingDeletions(Data key)
           
 void setWriteBehindProcessor(WriteBehindProcessor writeBehindProcessor)
           
 void setWriteBehindQueue(WriteBehindQueue<DelayedEntry> writeBehindQueue)
           
 
Methods inherited from class com.hazelcast.map.impl.mapstore.AbstractMapDataStore
convertToObjectKeys, getStore, isPostProcessingMapStore, removeAll, toData, toObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WriteBehindStore

public WriteBehindStore(MapStoreWrapper store,
                        SerializationService serializationService,
                        long writeDelayTime,
                        int partitionId)
Method Detail

setWriteBehindQueue

public void setWriteBehindQueue(WriteBehindQueue<DelayedEntry> writeBehindQueue)

add

public Object add(Data key,
                  Object value,
                  long now)

addTransient

public void addTransient(Data key,
                         long now)

addBackup

public Object addBackup(Data key,
                        Object value,
                        long time)

remove

public void remove(Data key,
                   long now)

removeBackup

public void removeBackup(Data key,
                         long time)

clear

public void clear()
Description copied from interface: MapDataStore
Clears resources of this map-data-store.


load

public Object load(Data key)

loadAll

public Map loadAll(Collection keys)
Specified by:
loadAll in interface MapDataStore<Data,Object>
Overrides:
loadAll in class AbstractMapDataStore<Data,Object>

loadable

public boolean loadable(Data key,
                        long lastUpdateTime,
                        long now)
* Used in 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.

Parameters:
key - to query whether loadable or not.
lastUpdateTime - last update time.
now - in mills
Returns:
true if loadable, otherwise false.

notFinishedOperationsCount

public int notFinishedOperationsCount()

flush

public Object flush(Data key,
                    Object value,
                    long now,
                    boolean backup)
Description copied from interface: MapDataStore
Flushes the supplied key to the map-store.

Parameters:
key - key to be flushed
value - value to be flushed
now - now in millis
backup - true calling this method for backup partition, false for owner partition.
Returns:
flushed value.

flush

public Collection<Data> flush()
Description copied from interface: MapDataStore
Flushes all keys in this map-store.

Returns:
flushed Data keys list.

removeFromWaitingDeletions

public void removeFromWaitingDeletions(Data key)

removeFromStagingArea

public void removeFromStagingArea(Data key,
                                  Object value)

removeFromStagingArea

public void removeFromStagingArea(Data key)

getWriteBehindQueue

public WriteBehindQueue<DelayedEntry> getWriteBehindQueue()

setWriteBehindProcessor

public void setWriteBehindProcessor(WriteBehindProcessor writeBehindProcessor)

getFlushCounter

public AtomicInteger getFlushCounter()


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.