public class DefaultStateTransferManager extends Object implements StateTransferManager
Modifier and Type | Field and Description |
---|---|
protected CacheSPI |
cache |
protected Configuration |
configuration |
protected StateTransferGenerator |
generator |
protected StateTransferIntegrator |
integrator |
protected static org.apache.commons.logging.Log |
log |
protected Marshaller |
marshaller |
static String |
PARTIAL_STATE_DELIMITER |
protected RegionManager |
regionManager |
protected long |
stateRetrievalTimeout |
static NodeData |
STREAMING_DELIMITER_NODE |
protected static boolean |
trace |
Constructor and Description |
---|
DefaultStateTransferManager() |
Modifier and Type | Method and Description |
---|---|
void |
getState(ObjectOutputStream out,
Fqn fqn,
long timeout,
boolean force,
boolean suppressErrors)
Writes the state for the portion of the tree named by
fqn to
the provided OutputStream. |
void |
injectDependencies(CacheSPI cache,
Marshaller marshaller,
RegionManager regionManager,
Configuration configuration,
CacheLoaderManager cacheLoaderManager,
StateTransferIntegrator integrator,
StateTransferGenerator generator) |
void |
setState(ObjectInputStream in,
Fqn targetRoot)
Set the portion of the cache rooted in
targetRoot
to match the given state. |
protected void |
setState(ObjectInputStream state,
NodeSPI targetRoot)
Set the portion of the cache rooted in
targetRoot
to match the given state. |
void |
start() |
protected static final org.apache.commons.logging.Log log
protected static final boolean trace
public static final NodeData STREAMING_DELIMITER_NODE
public static final String PARTIAL_STATE_DELIMITER
protected CacheSPI cache
protected Marshaller marshaller
protected RegionManager regionManager
protected Configuration configuration
protected long stateRetrievalTimeout
protected StateTransferIntegrator integrator
protected StateTransferGenerator generator
public void injectDependencies(CacheSPI cache, Marshaller marshaller, RegionManager regionManager, Configuration configuration, CacheLoaderManager cacheLoaderManager, StateTransferIntegrator integrator, StateTransferGenerator generator)
public void start()
public void getState(ObjectOutputStream out, Fqn fqn, long timeout, boolean force, boolean suppressErrors) throws Exception
StateTransferManager
fqn
to
the provided OutputStream.
getState
in interface StateTransferManager
out
- stream to write state tofqn
- Fqn indicating the uppermost node in the
portion of the tree whose state should be returned.timeout
- max number of millis this method should wait to acquire
any locks, if necessary, on the nodes being transferredforce
- if locks are needed and cannot be acquired after
timeout
millis, should the lock acquisition
be forced, and any existing transactions holding locks
on the nodes be rolled back?suppressErrors
- if true, all exceptions are logged but not propagated.Exception
- in event of errorpublic void setState(ObjectInputStream in, Fqn targetRoot) throws Exception
StateTransferManager
targetRoot
to match the given state. Updates the contents of targetRoot
to reflect those in new_state
.
NOTE: This method performs no locking of nodes; it
is up to the caller to lock targetRoot
before calling
this method.
This method will use any ClassLoader
needed as defined by the active Region
in the RegionManager
, pertaining to the targetRoot passed in.setState
in interface StateTransferManager
in
- an input stream containing the statetargetRoot
- fqn of the node into which the state should be integratedException
- In event of errorprotected void setState(ObjectInputStream state, NodeSPI targetRoot) throws Exception
targetRoot
to match the given state. Updates the contents of targetRoot
to reflect those in new_state
.
NOTE: This method performs no locking of nodes; it
is up to the caller to lock targetRoot
before calling
this method.state
- a serialized byte[][] array where element 0 is the
transient state (or null) , and element 1 is the
persistent state (or null)targetRoot
- node into which the state should be integratedException
Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.