org.infinispan.distribution
Class RehashTask

java.lang.Object
  extended by org.infinispan.distribution.RehashTask
All Implemented Interfaces:
Callable<Void>
Direct Known Subclasses:
InvertedLeaveTask, JoinTask

public abstract class RehashTask
extends Object
implements Callable<Void>

A task that handles the rehashing of data in the cache system wheh nodes join or leave the cluster. This abstract class contains common functionality. Subclasses will specify different behavior for nodes joining and leaving.

Since:
4.0
Author:
Manik Surtani

Nested Class Summary
protected  class RehashTask.StateGrabber
           
 
Field Summary
protected  CommandsFactory cf
           
protected  Configuration configuration
           
protected  DataContainer dataContainer
           
protected  DistributionManager distributionManager
           
protected  Log log
           
protected  RpcManager rpcManager
           
protected  Address self
           
protected  ExecutorService statePullExecutor
           
protected  boolean trace
           
 
Constructor Summary
protected RehashTask(DistributionManagerImpl distributionManager, RpcManager rpcManager, Configuration configuration, CommandsFactory cf, DataContainer dataContainer)
           
 
Method Summary
 Void call()
           
protected  Collection<Address> coordinator()
           
protected  Collection<Address> getInvalidHolders(Object key, ConsistentHash chOld, ConsistentHash chNew)
           
protected  void invalidateInvalidHolders(ConsistentHash chOld, ConsistentHash chNew)
           
protected  void invalidateInvalidHolders(List<Address> doNotInvalidate, ConsistentHash chOld, ConsistentHash chNew)
           
protected abstract  void performRehash()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

distributionManager

protected DistributionManager distributionManager

rpcManager

protected RpcManager rpcManager

configuration

protected Configuration configuration

cf

protected CommandsFactory cf

dataContainer

protected DataContainer dataContainer

self

protected final Address self

log

protected final Log log

trace

protected final boolean trace

statePullExecutor

protected final ExecutorService statePullExecutor
Constructor Detail

RehashTask

protected RehashTask(DistributionManagerImpl distributionManager,
                     RpcManager rpcManager,
                     Configuration configuration,
                     CommandsFactory cf,
                     DataContainer dataContainer)
Method Detail

call

public Void call()
          throws Exception
Specified by:
call in interface Callable<Void>
Throws:
Exception

performRehash

protected abstract void performRehash()
                               throws Exception
Throws:
Exception

coordinator

protected Collection<Address> coordinator()

invalidateInvalidHolders

protected void invalidateInvalidHolders(List<Address> doNotInvalidate,
                                        ConsistentHash chOld,
                                        ConsistentHash chNew)
                                 throws ExecutionException,
                                        InterruptedException
Throws:
ExecutionException
InterruptedException

invalidateInvalidHolders

protected void invalidateInvalidHolders(ConsistentHash chOld,
                                        ConsistentHash chNew)
                                 throws ExecutionException,
                                        InterruptedException
Throws:
ExecutionException
InterruptedException

getInvalidHolders

protected Collection<Address> getInvalidHolders(Object key,
                                                ConsistentHash chOld,
                                                ConsistentHash chNew)


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