public interface ReplicatedMapEntry
extends java.io.Serializable
1. if ( entry.isDirty() )
try {
2. entry.lock();
3. byte[] diff = entry.getDiff();
4. entry.reset();
} finally {
5. entry.unlock();
}
}
1. ReplicatedMapEntry entry = (ReplicatedMapEntry)objectIn.readObject();
2. if ( isBackup(entry)||isPrimary(entry) ) entry.setOwner(owner);
Modifier and Type | Method and Description |
---|---|
void |
accessEntry()
Access to an existing object.
|
void |
applyDiff(byte[] diff,
int offset,
int length)
Applies a diff to an existing object.
|
byte[] |
getDiff()
Returns a diff and sets the dirty map to false
|
long |
getLastTimeReplicated()
Return the last replicate time.
|
long |
getVersion()
For accuracy checking, a serialized attribute can contain a version number
This number increases as modifications are made to the data.
|
boolean |
isAccessReplicate()
If this returns true, to replicate that an object has been accessed
|
boolean |
isDiffable()
If this returns true, the map will extract the diff using getDiff()
Otherwise it will serialize the entire object.
|
boolean |
isDirty()
Has the object changed since last replication
and is not in a locked state
|
void |
lock()
Lock during serialization
|
void |
resetDiff()
Resets the current diff state and resets the dirty flag
|
void |
setLastTimeReplicated(long lastTimeReplicated)
Set the last replicate time.
|
void |
setOwner(java.lang.Object owner)
This method is called after the object has been
created on a remote map.
|
void |
setVersion(long version)
Forces a certain version to a replicated map entry
|
void |
unlock()
Unlock after serialization
|
boolean isDirty()
boolean isDiffable()
byte[] getDiff() throws java.io.IOException
java.io.IOException
void applyDiff(byte[] diff, int offset, int length) throws java.io.IOException, java.lang.ClassNotFoundException
diff
- byte[]offset
- intlength
- intjava.io.IOException
java.lang.ClassNotFoundException
void resetDiff()
void lock()
void unlock()
void setOwner(java.lang.Object owner)
owner
- Objectlong getVersion()
void setVersion(long version)
version
- longlong getLastTimeReplicated()
void setLastTimeReplicated(long lastTimeReplicated)
lastTimeReplicated
- boolean isAccessReplicate()
void accessEntry()
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.