public interface ReplicableEntry
ChronicleHash
. Both HashEntry
and
HashAbsentEntry
could implement ReplicableEntry
interface.Modifier and Type | Method and Description |
---|---|
void |
doRemoveCompletely()
Completely remove the entry from the Chronicle hash, not just mark is as deleted, what
MapEntry.doRemove() does for Replicated Chronicle hash. |
void |
dropChanged()
Suppress the entry, if it was scheduled to be replicated over to remote Chronicle nodes.
|
boolean |
isChanged()
Check is the entry is scheduled to be replicated to the remote Chronicle nodes, to which
the connection is currently established.
|
byte |
originIdentifier()
The identifier, associated with this entry.
|
long |
originTimestamp()
The timestamp, associated with this entry.
|
void |
raiseChanged()
Propagate the entry, schedule it to be replicated over to remote Chronicle nodes.
|
void |
updateOrigin(byte newIdentifier,
long newTimestamp)
Overwrite the entry's associated identifier and timestamp.
|
byte originIdentifier()
ChronicleHash
node on which this entry was updated last.
When the entry is replicated, this identifier comes to remote nodes as RemoteOperationContext.remoteIdentifier()
.
On ChronicleHash
local operations with entries, like Map.put(
Object, Object)
, this identifier is overwritten to the own ChronicleHash
Replica.identifier()
. On remote operations, proxied through MapRemoteOperations
or
SetRemoteOperations
, you are free to overwrite this identifier to any value, using
updateOrigin(byte, long)
method.
long originTimestamp()
When the entry is replicated, this timestamp comes to remote nodes as RemoteOperationContext.remoteTimestamp()
.
On ChronicleHash
local operations with entries, like Map.put(
Object, Object)
, this timestamp is overwritten using the configured time provider. On remote
operations, proxied through MapRemoteOperations
or SetRemoteOperations
,
you are free to overwrite this timestamp by any value, using updateOrigin(byte, long)
method.
TimeProvider
void updateOrigin(byte newIdentifier, long newTimestamp)
originIdentifier()
returns the given newIdentifier
and originTimestamp()
returns the given newTimestamp
respectively.newIdentifier
- the new identifier for the entrynewTimestamp
- the new timestamp for the entryvoid dropChanged()
void raiseChanged()
boolean isChanged()
true
is the entry is "dirty" locally, i. e. should be replicated to remote
Chronicle nodes, false
otherwisevoid doRemoveCompletely()
MapEntry.doRemove()
does for Replicated Chronicle hash. After calling this method
the entry won't be replicated over to remote Chronicle nodes, as if dropChanged()
was called, and incoming entry replication event with the key if this entry will be
processed, as the entry have never been present in the Chronicle hash. After calling this
method any subsequent call of any method of ReplicableEntry
class throws IllegalStateException
.Copyright © 2015. All rights reserved.