Infinispan Distribution 5.2.6.Final-redhat-2

org.infinispan.statetransfer
Class StateProviderImpl

java.lang.Object
  extended by org.infinispan.statetransfer.StateProviderImpl
All Implemented Interfaces:
StateProvider

public class StateProviderImpl
extends Object
implements StateProvider

StateProvider implementation.

Since:
5.2
Author:
anistor@redhat.com

Constructor Summary
StateProviderImpl()
           
 
Method Summary
 void cancelOutboundTransfer(Address destination, int topologyId, Set<Integer> segments)
          Cancel sending of cache entries that belong to the given set of segments.
 List<TransactionInfo> getTransactionsForSegments(Address destination, int requestTopologyId, Set<Integer> segments)
          Gets the list of transactions that affect keys from the given segments.
 void init(Cache cache, ExecutorService executorService, Configuration configuration, RpcManager rpcManager, CommandsFactory commandsFactory, CacheNotifier cacheNotifier, CacheLoaderManager cacheLoaderManager, DataContainer dataContainer, TransactionTable transactionTable, StateTransferLock stateTransferLock, StateConsumer stateConsumer)
           
 boolean isStateTransferInProgress()
           
 void onTopologyChange(TopologyChangedEvent<?,?> tce)
           
 void onTopologyUpdate(CacheTopology cacheTopology, boolean isRebalance)
          Receive notification of topology changes.
 void start()
           
 void startOutboundTransfer(Address destination, int requestTopologyId, Set<Integer> segments)
          Start to send cache entries that belong to the given set of segments.
 void stop()
          Cancels all outbound state transfers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateProviderImpl

public StateProviderImpl()
Method Detail

init

public void init(Cache cache,
                 ExecutorService executorService,
                 Configuration configuration,
                 RpcManager rpcManager,
                 CommandsFactory commandsFactory,
                 CacheNotifier cacheNotifier,
                 CacheLoaderManager cacheLoaderManager,
                 DataContainer dataContainer,
                 TransactionTable transactionTable,
                 StateTransferLock stateTransferLock,
                 StateConsumer stateConsumer)

isStateTransferInProgress

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

onTopologyChange

public void onTopologyChange(TopologyChangedEvent<?,?> tce)

onTopologyUpdate

public void onTopologyUpdate(CacheTopology cacheTopology,
                             boolean isRebalance)
Description copied from interface: StateProvider
Receive notification of topology changes. Cancels all outbound transfers to destinations that are no longer members. The other outbound transfers remain unaffected.

Specified by:
onTopologyUpdate in interface StateProvider

start

public void start()
Specified by:
start in interface StateProvider

stop

public void stop()
Description copied from interface: StateProvider
Cancels all outbound state transfers. This is executed when the cache is shutting down.

Specified by:
stop in interface StateProvider

getTransactionsForSegments

public List<TransactionInfo> getTransactionsForSegments(Address destination,
                                                        int requestTopologyId,
                                                        Set<Integer> segments)
                                                 throws InterruptedException
Description copied from interface: StateProvider
Gets the list of transactions that affect keys from the given segments. This is invoked in response to a StateRequestCommand of type StateRequestCommand.Type.GET_TRANSACTIONS.

Specified by:
getTransactionsForSegments in interface StateProvider
Parameters:
destination - the address of the requester
Returns:
list transactions and locks for the given segments
Throws:
InterruptedException

startOutboundTransfer

public void startOutboundTransfer(Address destination,
                                  int requestTopologyId,
                                  Set<Integer> segments)
                           throws InterruptedException
Description copied from interface: StateProvider
Start to send cache entries that belong to the given set of segments. This is invoked in response to a StateRequestCommand of type StateRequestCommand.Type.START_STATE_TRANSFER.

Specified by:
startOutboundTransfer in interface StateProvider
Parameters:
destination - the address of the requester
Throws:
InterruptedException

cancelOutboundTransfer

public void cancelOutboundTransfer(Address destination,
                                   int topologyId,
                                   Set<Integer> segments)
Description copied from interface: StateProvider
Cancel sending of cache entries that belong to the given set of segments. This is invoked in response to a StateRequestCommand of type StateRequestCommand.Type.CANCEL_STATE_TRANSFER.

Specified by:
cancelOutboundTransfer in interface StateProvider
Parameters:
destination - the address of the requester
segments - the segments that we have to cancel transfer for

Infinispan Distribution 5.2.6.Final-redhat-2

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