public class DeltaMVMap extends DeltaBasedCRDT
| Modifier and Type | Field and Description |
|---|---|
static pt.unl.fct.di.novasys.network.ISerializer<DeltaMVMap> |
serializer
A serializer that serializes the CRDT into (and from) a ByteBuf.
|
static CRDTsTypes |
TYPE |
state| Constructor and Description |
|---|
DeltaMVMap(ReplicaID replicaID)
Creates a delta multi-value map with a given replicaID.
|
DeltaMVMap(VVState state)
Creates a delta multi-value map with a given replica state.
|
| Modifier and Type | Method and Description |
|---|---|
GenericCRDT |
copy()
Creates a copy of the CRDT.
|
DeltaMVMap |
delete(String key)
Deletes the value associated with key.
|
DeltaMVMap |
generateDelta(VersionVector vv)
Calculates a delta from a given version for the current state
|
Set<SerializableType> |
get(String key)
Gets the set of elements associated with the given key.
|
Iterator<Map.Entry<String,Set<SerializableType>>> |
iterator()
Returns an iterator of the elements in the map.
|
DeltaMVMap |
mergeDelta(DeltaBasedCRDT crdt)
Applies a delta to the current state.
|
DeltaMVMap |
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 final CRDTsTypes TYPE
public static pt.unl.fct.di.novasys.network.ISerializer<DeltaMVMap> serializer
public DeltaMVMap(ReplicaID replicaID)
replicaID - the replica identifierpublic DeltaMVMap(VVState state)
state - replica current statepublic DeltaMVMap put(String key, SerializableType value)
key - key of the valuevalue - element to be insertedpublic Set<SerializableType> get(String key)
key - key to be searchedpublic DeltaMVMap delete(String key)
key - key to be deletedpublic Iterator<Map.Entry<String,Set<SerializableType>>> iterator()
public DeltaMVMap generateDelta(VersionVector vv)
DeltaCRDTgenerateDelta in interface DeltaCRDTgenerateDelta in class DeltaBasedCRDTvv - a version version to calculate the delta frompublic DeltaMVMap 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 GenericCRDT copy()
GenericCRDTpublic 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.