If a node threw an exception during PREPARE_VIEW, the coordinator will send a ROLLBACK_VIEW instead.
After a configurable amount of time the coordinator may retry to install the view, but with a different
view id (even if the members are the same; this makes it simpler to implement).
Only the coordinator keeps the information about which nodes have requested to join, so when
the coordinator changes the new coordinator will have to request state from all the members using
the RECOVER_VIEW command. This also happens after a merge, even if the new coordinator was a coordinator
in one of the partitions. For a full description of the view recovery algorithm see recoverViews()
- Since:
- 5.1
- Author:
- Dan Berindei <dan@infinispan.org>
Method Summary |
CacheView |
getCommittedView(String cacheName)
|
Set<Address> |
getLeavers(String cacheName)
|
CacheView |
getPendingView(String cacheName)
|
void |
handleCommitView(String cacheName,
int viewId)
|
void |
handlePrepareView(String cacheName,
CacheView pendingView,
CacheView committedView)
|
Map<String,CacheView> |
handleRecoverViews()
|
void |
handleRequestJoin(Address sender,
String cacheName)
Handle a join request. |
void |
handleRequestLeave(Address sender,
String cacheName)
|
void |
handleRollbackView(String cacheName,
int newViewId,
int committedViewId)
|
void |
init(CacheManagerNotifier cacheManagerNotifier,
Transport transport,
ExecutorService e,
GlobalConfiguration globalConfiguration)
|
boolean |
isRunning()
|
void |
join(String cacheName,
CacheViewListener listener)
Start the cache. |
void |
leave(String cacheName)
Stop the cache. |
void |
start()
|
void |
stop()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DUMMY_CACHE_NAME_FOR_GLOBAL_COMMANDS
public static final String DUMMY_CACHE_NAME_FOR_GLOBAL_COMMANDS
- See Also:
- Constant Field Values
CacheViewsManagerImpl
public CacheViewsManagerImpl()
init
public void init(CacheManagerNotifier cacheManagerNotifier,
Transport transport,
ExecutorService e,
GlobalConfiguration globalConfiguration)
start
public void start()
throws Exception
- Throws:
Exception
stop
public void stop()
getCommittedView
public CacheView getCommittedView(String cacheName)
- Specified by:
getCommittedView
in interface CacheViewsManager
- Returns:
- The currently installed view for the given cache.
getPendingView
public CacheView getPendingView(String cacheName)
- Specified by:
getPendingView
in interface CacheViewsManager
- Returns:
- The pending view for the given cache.
getLeavers
public Set<Address> getLeavers(String cacheName)
- Specified by:
getLeavers
in interface CacheViewsManager
- Returns:
- The members which will (should) handle commands for a given cache.
join
public void join(String cacheName,
CacheViewListener listener)
throws Exception
- Description copied from interface:
CacheViewsManager
- Start the cache.
- Specified by:
join
in interface CacheViewsManager
- Throws:
Exception
leave
public void leave(String cacheName)
- Description copied from interface:
CacheViewsManager
- Stop the cache.
- Specified by:
leave
in interface CacheViewsManager
handleRequestJoin
public void handleRequestJoin(Address sender,
String cacheName)
- Handle a join request.
Even if this node is not the coordinator this method will still be called for local caches.
- Specified by:
handleRequestJoin
in interface CacheViewsManager
handleRequestLeave
public void handleRequestLeave(Address sender,
String cacheName)
- Specified by:
handleRequestLeave
in interface CacheViewsManager
handlePrepareView
public void handlePrepareView(String cacheName,
CacheView pendingView,
CacheView committedView)
throws Exception
- Specified by:
handlePrepareView
in interface CacheViewsManager
- Throws:
Exception
handleCommitView
public void handleCommitView(String cacheName,
int viewId)
- Specified by:
handleCommitView
in interface CacheViewsManager
handleRollbackView
public void handleRollbackView(String cacheName,
int newViewId,
int committedViewId)
- Specified by:
handleRollbackView
in interface CacheViewsManager
handleRecoverViews
public Map<String,CacheView> handleRecoverViews()
- Specified by:
handleRecoverViews
in interface CacheViewsManager
- Returns:
- The last prepared view id for each cache that's running on this node.
isRunning
public boolean isRunning()
Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.