org.infinispan.cacheviews
Class PendingCacheViewChanges

java.lang.Object
  extended by org.infinispan.cacheviews.PendingCacheViewChanges

public class PendingCacheViewChanges
extends Object

This class is used on the coordinator to keep track of changes since the last merge. When the coordinator changes or in case of a merge, the new coordinator recovers the last committed view from all the members and rolls back any uncommitted views, then it prepares a new view if necessary.


Constructor Summary
PendingCacheViewChanges(String cacheName)
           
 
Method Summary
 Set<Address> computeMissingJoiners(Collection<Address> newMembers)
           
 CacheView createPendingView(CacheView committedView)
          Called on the coordinator to create the view that will be prepared next.
 int getLastViewId()
           
 Set<Address> getLeavers()
           
 int getRollbackViewId()
          Called on the coordinator before a rollback to assign a unique view id to the rollback.
 boolean hasChanges()
           
 boolean isViewInstallationInProgress()
           
 void recoveredViews(Collection<Address> newMembers, Collection<Address> recoveredJoiners)
          Signal a merge
 void requestJoin(Address joiner)
          Signal a join
 Set<Address> requestLeave(Collection<Address> leavers)
          Signal a leave.
 void resetChanges(CacheView committedView)
           
 void updateLatestViewId(int viewId)
          If we recovered a view after a merge or coordinator change we need to make sure the next view id is greater than any view id that was already committed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PendingCacheViewChanges

public PendingCacheViewChanges(String cacheName)
Method Detail

createPendingView

public CacheView createPendingView(CacheView committedView)
Called on the coordinator to create the view that will be prepared next. It also sets the pendingView field, so the next call to prepareView will have no effect.


getRollbackViewId

public int getRollbackViewId()
Called on the coordinator before a rollback to assign a unique view id to the rollback.


hasChanges

public boolean hasChanges()

resetChanges

public void resetChanges(CacheView committedView)

requestJoin

public void requestJoin(Address joiner)
Signal a join


requestLeave

public Set<Address> requestLeave(Collection<Address> leavers)
Signal a leave.


recoveredViews

public void recoveredViews(Collection<Address> newMembers,
                           Collection<Address> recoveredJoiners)
Signal a merge


updateLatestViewId

public void updateLatestViewId(int viewId)
If we recovered a view after a merge or coordinator change we need to make sure the next view id is greater than any view id that was already committed.


getLeavers

public Set<Address> getLeavers()
Returns:
the nodes that left since the last resetChanges call

computeMissingJoiners

public Set<Address> computeMissingJoiners(Collection<Address> newMembers)
Returns:
The nodes that are in the joiners collection but not in the newMembers collection.

isViewInstallationInProgress

public boolean isViewInstallationInProgress()
Returns:
true if createPendingView has been called without a pair resetChanges

getLastViewId

public int getLastViewId()
Returns:
the id of the view we created last (or received via updateLatestViewId.

-->

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