org.apache.catalina.tribes.tipis
public class LazyReplicatedMap extends AbstractReplicatedMap implements RpcCallback, ChannelListener, MembershipListener
put, putAll, remove
methods.
entrySet, entrySetFull, keySet, keySetFull, returns all non modifiable sets.put()
or remove()
the data can be distributed using two different methods:replicate(boolean)
and replicate(Object, boolean)
ReplicatedMapEntry
interface allows you to decide what objects
get replicated and how much data gets replicated each time.replicate(Object,boolean)
- replicates only the object that belongs to the keyreplicate(boolean)
- Scans the entire map for changes and replicates databoolean
value in the replicate
method used to decide
whether to only replicate objects that implement the ReplicatedMapEntry
interface
or to replicate all objects. If an object doesn't implement the ReplicatedMapEntry
interface
each time the object gets replicated the entire object gets serialized, hence a call to replicate(true)
will replicate all objects in this map that are using this node as primary.
breakdown()
or finalize()
when you are done with the map to
avoid memory leaks.Version: 1.0
UNKNOWN: implement periodic sync/transfer thread
Field Summary | |
---|---|
protected static Log | log |
Constructor Summary | |
---|---|
LazyReplicatedMap(AbstractReplicatedMap.MapOwner owner, Channel channel, long timeout, String mapContextName, int initialCapacity, float loadFactor, ClassLoader[] cls)
Creates a new map | |
LazyReplicatedMap(AbstractReplicatedMap.MapOwner owner, Channel channel, long timeout, String mapContextName, int initialCapacity, ClassLoader[] cls)
Creates a new map | |
LazyReplicatedMap(AbstractReplicatedMap.MapOwner owner, Channel channel, long timeout, String mapContextName, ClassLoader[] cls)
Creates a new map |
Method Summary | |
---|---|
protected int | getStateMessageType() |
protected Member[] | publishEntryInfo(Object key, Object value)
publish info about a map pair (key/value) to other nodes in the cluster |
Parameters: channel The channel to use for communication timeout long - timeout for RPC messags mapContextName String - unique name for this map, to allow multiple maps per channel initialCapacity int - the size of this map, see HashMap loadFactor float - load factor, see HashMap
Parameters: channel The channel to use for communication timeout long - timeout for RPC messags mapContextName String - unique name for this map, to allow multiple maps per channel initialCapacity int - the size of this map, see HashMap
Parameters: channel The channel to use for communication timeout long - timeout for RPC messags mapContextName String - unique name for this map, to allow multiple maps per channel
Parameters: key Object value Object
Returns: Member - the backup node
Throws: ChannelException