Infinispan Distribution 5.2.6.Final-redhat-2

org.infinispan.statetransfer
Class StateConsumerImpl

java.lang.Object
  extended by org.infinispan.statetransfer.StateConsumerImpl
All Implemented Interfaces:
StateConsumer

public class StateConsumerImpl
extends Object
implements StateConsumer

StateConsumer implementation.

Since:
5.2
Author:
anistor@redhat.com

Constructor Summary
StateConsumerImpl()
           
 
Method Summary
 void addUpdatedKey(Object key)
          Receive notification of updated keys right before they are committed in DataContainer.
 void applyState(Address sender, int topologyId, Collection<StateChunk> stateChunks)
           
 CacheTopology getCacheTopology()
           
 boolean hasActiveTransfers()
           
 void init(Cache cache, ExecutorService executorService, StateTransferManager stateTransferManager, InterceptorChain interceptorChain, InvocationContextContainer icc, Configuration configuration, RpcManager rpcManager, TransactionManager transactionManager, CommandsFactory commandsFactory, CacheLoaderManager cacheLoaderManager, DataContainer dataContainer, TransactionTable transactionTable, StateTransferLock stateTransferLock, CacheNotifier cacheNotifier)
           
 boolean isKeyUpdated(Object key)
          Checks if a given key was updated by user code during state transfer (and consequently it is untouchable by state transfer).
 boolean isStateTransferInProgress()
           
 boolean isStateTransferInProgressForKey(Object key)
           
 void onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)
          Receive notification of topology changes.
 void start()
           
 void stop()
          Cancels all incoming state transfers.
 void stopApplyingState()
          Stops applying incoming state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateConsumerImpl

public StateConsumerImpl()
Method Detail

stopApplyingState

public void stopApplyingState()
Stops applying incoming state. Also stops tracking updated keys. Should be called at the end of state transfer or when a ClearCommand is committed during state transfer.

Specified by:
stopApplyingState in interface StateConsumer

addUpdatedKey

public void addUpdatedKey(Object key)
Receive notification of updated keys right before they are committed in DataContainer.

Specified by:
addUpdatedKey in interface StateConsumer
Parameters:
key - the key that is being modified

isKeyUpdated

public boolean isKeyUpdated(Object key)
Checks if a given key was updated by user code during state transfer (and consequently it is untouchable by state transfer).

Specified by:
isKeyUpdated in interface StateConsumer
Parameters:
key - the key to check
Returns:
true if the key is known to be modified, false otherwise

init

public void init(Cache cache,
                 ExecutorService executorService,
                 StateTransferManager stateTransferManager,
                 InterceptorChain interceptorChain,
                 InvocationContextContainer icc,
                 Configuration configuration,
                 RpcManager rpcManager,
                 TransactionManager transactionManager,
                 CommandsFactory commandsFactory,
                 CacheLoaderManager cacheLoaderManager,
                 DataContainer dataContainer,
                 TransactionTable transactionTable,
                 StateTransferLock stateTransferLock,
                 CacheNotifier cacheNotifier)

hasActiveTransfers

public boolean hasActiveTransfers()

isStateTransferInProgress

public boolean isStateTransferInProgress()
Specified by:
isStateTransferInProgress in interface StateConsumer

isStateTransferInProgressForKey

public boolean isStateTransferInProgressForKey(Object key)
Specified by:
isStateTransferInProgressForKey in interface StateConsumer

onTopologyUpdate

public void onTopologyUpdate(CacheTopology cacheTopology,
                             boolean isRebalance)
Description copied from interface: StateConsumer
Receive notification of topology changes. StateRequestCommands are issued for segments that are new to this member and the segments that are no longer owned are discarded.

Specified by:
onTopologyUpdate in interface StateConsumer

applyState

public void applyState(Address sender,
                       int topologyId,
                       Collection<StateChunk> stateChunks)
Specified by:
applyState in interface StateConsumer

start

public void start()

stop

public void stop()
Description copied from interface: StateConsumer
Cancels all incoming state transfers. The already received data is not discarded. This is executed when the cache is shutting down.

Specified by:
stop in interface StateConsumer

getCacheTopology

public CacheTopology getCacheTopology()
Specified by:
getCacheTopology in interface StateConsumer

Infinispan Distribution 5.2.6.Final-redhat-2

Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.