public class DeltaLWWMap extends DeltaBasedCRDT
| Modifier and Type | Field and Description |
|---|---|
static pt.unl.fct.di.novasys.network.ISerializer<DeltaLWWMap> |
serializer
A serializer that serializes the CRDT into (and from) a ByteBuf.
|
state| Constructor and Description |
|---|
DeltaLWWMap(ReplicaID replicaID)
Creates a delta last-writer-wins map with a given replicaID.
|
DeltaLWWMap(ReplicaID replicaID,
Map<String,SerializableType> initialValues)
Creates a delta last-writer-wins map with a given replicaID and a map of
initial values.
|
DeltaLWWMap(VVState state)
Creates a delta last-writer-wins map with a given replica state.
|
DeltaLWWMap(VVState state,
Map<String,SerializableType> initialValues)
Creates a delta last-writer-wins map with a given replica state and a map of initial valeus.
|
| Modifier and Type | Method and Description |
|---|---|
GenericCRDT |
copy()
Creates a copy of the CRDT.
|
DeltaLWWMap |
delete(String key)
Deletes the value associated with key.
|
DeltaLWWMap |
generateDelta(VersionVector vv)
Calculates a delta from a given version for the current state
|
SerializableType |
get(String key)
Gets the element associated with the given key.
|
Iterator<Map.Entry<String,SerializableType>> |
iterator()
Returns an iterator of the elements in the map.
|
DeltaLWWMap |
mergeDelta(DeltaBasedCRDT crdt)
Applies a delta to the current state.
|
DeltaLWWMap |
put(String key,
SerializableType value)
Puts a value into the map, with a given key.
|
void |
serialize(io.netty.buffer.ByteBuf in)
Serializes the CRDT into a ByteBuf
|
getReplicaID, getReplicaStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeserializeDataType, getTypepublic static pt.unl.fct.di.novasys.network.ISerializer<DeltaLWWMap> serializer
public DeltaLWWMap(ReplicaID replicaID)
replicaID - the replica identifierpublic DeltaLWWMap(VVState state)
state - replica current statepublic DeltaLWWMap(ReplicaID replicaID, Map<String,SerializableType> initialValues)
replicaID - the replica identifierinitialValues - a map of initial values for the CRDTpublic DeltaLWWMap(VVState state, Map<String,SerializableType> initialValues)
state - replica current stateinitialValues - a map of initial values for the CRDTpublic GenericCRDT copy()
GenericCRDTpublic DeltaLWWMap put(String key, SerializableType value)
key - key of the valuevalue - element to be insertedpublic SerializableType get(String key)
key - key to be searchedpublic DeltaLWWMap delete(String key)
key - key to be deletedpublic Iterator<Map.Entry<String,SerializableType>> iterator()
public DeltaLWWMap generateDelta(VersionVector vv)
DeltaCRDTgenerateDelta in interface DeltaCRDTgenerateDelta in class DeltaBasedCRDTvv - a version version to calculate the delta frompublic DeltaLWWMap mergeDelta(DeltaBasedCRDT crdt) throws CRDTNotValidException
DeltaCRDTmergeDelta in interface DeltaCRDTmergeDelta in class DeltaBasedCRDTcrdt - a crdt representing the deltaCRDTNotValidException - if the crdt passed as argument is invalidpublic void serialize(io.netty.buffer.ByteBuf in)
throws IOException
GenericCRDTin - ByteBuf to serialize the CRDT toIOException - if an error occurs while serializingCopyright © 2024. All rights reserved.