package crdt
- Alphabetic
- Public
- All
Type Members
-
trait
Crdt extends AnyRef
CRDT Protocol Note that while this protocol provides support for CRDTs, the data types sent across the protocol are not CRDTs themselves.
CRDT Protocol Note that while this protocol provides support for CRDTs, the data types sent across the protocol are not CRDTs themselves. It is the responsibility of the CloudState proxy to implement the CRDTs, merge functions, vector clocks etc, not the user function. The user function need only hold the current value in memory, and this protocol sends deltas to the user function to update its in memory value as necessary. These deltas have no way of dealing with conflicts, hence it important that the CloudState proxy always know what the state of the user functions in memory value is before sending a delta. If the CloudState proxy is not sure what the value is, eg because it has just sent an operation to the user function may have updated its value as a result, the proxy should wait until it gets the result of the operation back, to ensure its in memory value is in sync with the user function so that it can calculate deltas that won't conflict. The user function is expected to update its value both as the result of receiving deltas from the proxy, as well as when it sends deltas. It must not update its value in any other circumstance, updating the value in response to any other stimuli risks the value becoming out of sync with the CloudState proxy. The user function will not be sent back deltas as a result of its own changes. An invocation of handle is made for each entity being handled. It may be kept alive and used to handle multiple commands, and may subsequently be terminated if that entity becomes idle, or if the entity is deleted. Shutdown is typically done for efficiency reasons, unless the entity is explicitly deleted, a terminated handle stream does not mean the proxy has stopped tracking the state of the entity in its memory. Special care must be taken when working with maps and sets. The keys/values are google.protobuf.Any, which encodes the value as binary protobuf, however, serialized protobufs are not stable, two semantically equal objects could encode to different bytes. It is the responsibility of the user function to ensure that stable encodings are used.
- sealed trait CrdtClock extends GeneratedEnum
-
final
case class
CrdtDelete() extends GeneratedMessage with Message[CrdtDelete] with Updatable[CrdtDelete] with Product with Serializable
- Annotations
- @SerialVersionUID()
-
final
case class
CrdtDelta(delta: Delta = ...) extends GeneratedMessage with Message[CrdtDelta] with Updatable[CrdtDelta] with Product with Serializable
A CRDT delta
A CRDT delta
Deltas only carry the change in value, not the full value (unless
- Annotations
- @SerialVersionUID()
-
final
case class
CrdtInit(serviceName: String = "", entityId: String = "", state: Option[CrdtState] = _root_.scala.None) extends GeneratedMessage with Message[CrdtInit] with Updatable[CrdtInit] with Product with Serializable
- Annotations
- @SerialVersionUID()
-
final
case class
CrdtReply(commandId: Long = 0L, clientAction: Option[ClientAction] = _root_.scala.None, sideEffects: Seq[SideEffect] = _root_.scala.Seq.empty, stateAction: Option[CrdtStateAction] = _root_.scala.None, streamed: Boolean = false) extends GeneratedMessage with Message[CrdtReply] with Updatable[CrdtReply] with Product with Serializable
- streamed
If the request was streamed, setting this to true indicates that the command should be handled as a stream. Subsequently, the user function may send CrdtStreamedMessage, and a CrdtStreamCancelled message will be sent if the stream is cancelled (though not if the a CrdtStreamedMessage ends the stream first).
- Annotations
- @SerialVersionUID()
-
final
case class
CrdtState(state: State = ...) extends GeneratedMessage with Message[CrdtState] with Updatable[CrdtState] with Product with Serializable
The CRDT state.
The CRDT state. This represents the full state of a CRDT. When received, a user function should replace the current state with this, not apply it as a delta. This includes both for the top level CRDT, and embedded CRDTs, such as the values of an ORMap.
- Annotations
- @SerialVersionUID()
-
final
case class
CrdtStateAction(writeConsistency: CrdtWriteConsistency = ..., action: Action = ...) extends GeneratedMessage with Message[CrdtStateAction] with Updatable[CrdtStateAction] with Product with Serializable
- Annotations
- @SerialVersionUID()
-
final
case class
CrdtStreamCancelledResponse(commandId: Long = 0L, sideEffects: Seq[SideEffect] = _root_.scala.Seq.empty, stateAction: Option[CrdtStateAction] = _root_.scala.None) extends GeneratedMessage with Message[CrdtStreamCancelledResponse] with Updatable[CrdtStreamCancelledResponse] with Product with Serializable
- Annotations
- @SerialVersionUID()
-
final
case class
CrdtStreamIn(message: Message = ...) extends GeneratedMessage with Message[CrdtStreamIn] with Updatable[CrdtStreamIn] with Product with Serializable
Message for the Crdt handle stream in.
Message for the Crdt handle stream in.
- Annotations
- @SerialVersionUID()
-
final
case class
CrdtStreamOut(message: Message = ...) extends GeneratedMessage with Message[CrdtStreamOut] with Updatable[CrdtStreamOut] with Product with Serializable
Message for the Crdt handle stream out.
Message for the Crdt handle stream out.
- Annotations
- @SerialVersionUID()
-
final
case class
CrdtStreamedMessage(commandId: Long = 0L, clientAction: Option[ClientAction] = _root_.scala.None, sideEffects: Seq[SideEffect] = _root_.scala.Seq.empty, endStream: Boolean = false) extends GeneratedMessage with Message[CrdtStreamedMessage] with Updatable[CrdtStreamedMessage] with Product with Serializable
May be sent as often as liked if the first reply set streamed to true
May be sent as often as liked if the first reply set streamed to true
- endStream
Indicates the stream should end, no messages may be sent for this command after this.
- Annotations
- @SerialVersionUID()
- sealed trait CrdtWriteConsistency extends GeneratedEnum
-
final
case class
FlagDelta(value: Boolean = false) extends GeneratedMessage with Message[FlagDelta] with Updatable[FlagDelta] with Product with Serializable
- Annotations
- @SerialVersionUID()
-
final
case class
FlagState(value: Boolean = false) extends GeneratedMessage with Message[FlagState] with Updatable[FlagState] with Product with Serializable
A Flag
A Flag
A Flag is a boolean value, that once set to true, stays true.
- value
The current value of the flag.
- Annotations
- @SerialVersionUID()
-
final
case class
GCounterDelta(increment: Long = 0L) extends GeneratedMessage with Message[GCounterDelta] with Updatable[GCounterDelta] with Product with Serializable
- Annotations
- @SerialVersionUID()
-
final
case class
GCounterState(value: Long = 0L) extends GeneratedMessage with Message[GCounterState] with Updatable[GCounterState] with Product with Serializable
A Grow-only counter
A Grow-only counter
A G-Counter can only be incremented, it can't be decremented.
- value
The current value of the counter.
- Annotations
- @SerialVersionUID()
-
final
case class
GSetDelta(added: Seq[Any] = _root_.scala.Seq.empty) extends GeneratedMessage with Message[GSetDelta] with Updatable[GSetDelta] with Product with Serializable
- Annotations
- @SerialVersionUID()
-
final
case class
GSetState(items: Seq[Any] = _root_.scala.Seq.empty) extends GeneratedMessage with Message[GSetState] with Updatable[GSetState] with Product with Serializable
A Grow-only Set
A Grow-only Set
A G-Set can only have items added, items cannot be removed.
- items
The current items in the set.
- Annotations
- @SerialVersionUID()
-
final
case class
LWWRegisterDelta(value: Option[Any] = _root_.scala.None, clock: CrdtClock = ..., customClockValue: Long = 0L) extends GeneratedMessage with Message[LWWRegisterDelta] with Updatable[LWWRegisterDelta] with Product with Serializable
- Annotations
- @SerialVersionUID()
-
final
case class
LWWRegisterState(value: Option[Any] = _root_.scala.None, clock: CrdtClock = ..., customClockValue: Long = 0L) extends GeneratedMessage with Message[LWWRegisterState] with Updatable[LWWRegisterState] with Product with Serializable
A Last-Write-Wins Register
A Last-Write-Wins Register
A LWW-Register holds a single value, with the current value being selected based on when it was last written. The time of the last write may either be determined using the proxies clock, or may be based on a custom, domain specific value.
- value
The current value of the register.
- clock
The clock to use if this state needs to be merged with another one.
- customClockValue
The clock value if the clock in use is a custom clock.
- Annotations
- @SerialVersionUID()
-
final
case class
ORMapDelta(cleared: Boolean = false, removed: Seq[Any] = _root_.scala.Seq.empty, updated: Seq[ORMapEntryDelta] = _root_.scala.Seq.empty, added: Seq[ORMapEntry] = _root_.scala.Seq.empty) extends GeneratedMessage with Message[ORMapDelta] with Updatable[ORMapDelta] with Product with Serializable
- Annotations
- @SerialVersionUID()
-
final
case class
ORMapEntry(key: Option[Any] = _root_.scala.None, value: Option[CrdtState] = _root_.scala.None) extends GeneratedMessage with Message[ORMapEntry] with Updatable[ORMapEntry] with Product with Serializable
An OR-Map entry.
An OR-Map entry.
- key
The entry key.
- value
The value of the entry, a CRDT itself.
- Annotations
- @SerialVersionUID()
-
final
case class
ORMapEntryDelta(key: Option[Any] = _root_.scala.None, delta: Option[CrdtDelta] = _root_.scala.None) extends GeneratedMessage with Message[ORMapEntryDelta] with Updatable[ORMapEntryDelta] with Product with Serializable
- key
The entry key.
- Annotations
- @SerialVersionUID()
-
final
case class
ORMapState(entries: Seq[ORMapEntry] = _root_.scala.Seq.empty) extends GeneratedMessage with Message[ORMapState] with Updatable[ORMapState] with Product with Serializable
An Observed-Removed Map
An Observed-Removed Map
Like an OR-Set, an OR-Map may have items added and removed, with the condition that an item must be observed to be in the map before it is removed. The values of the map are CRDTs themselves. Different keys are allowed to use different CRDTs, and if an item is removed, and then replaced, the new value may be a different CRDT.
- entries
The entries of the map.
- Annotations
- @SerialVersionUID()
-
final
case class
ORSetDelta(cleared: Boolean = false, removed: Seq[Any] = _root_.scala.Seq.empty, added: Seq[Any] = _root_.scala.Seq.empty) extends GeneratedMessage with Message[ORSetDelta] with Updatable[ORSetDelta] with Product with Serializable
- cleared
If cleared is set, the set must be cleared before added is processed.
- Annotations
- @SerialVersionUID()
-
final
case class
ORSetState(items: Seq[Any] = _root_.scala.Seq.empty) extends GeneratedMessage with Message[ORSetState] with Updatable[ORSetState] with Product with Serializable
An Observed-Removed Set
An Observed-Removed Set
An OR-Set may have items added and removed, with the condition that an item must be observed to be in the set before it is removed.
- items
The current items in the set.
- Annotations
- @SerialVersionUID()
-
final
case class
PNCounterDelta(change: Long = 0L) extends GeneratedMessage with Message[PNCounterDelta] with Updatable[PNCounterDelta] with Product with Serializable
- Annotations
- @SerialVersionUID()
-
final
case class
PNCounterState(value: Long = 0L) extends GeneratedMessage with Message[PNCounterState] with Updatable[PNCounterState] with Product with Serializable
A Positve-Negative Counter
A Positve-Negative Counter
A PN-Counter can be both incremented and decremented.
- value
The current value of the counter.
- Annotations
- @SerialVersionUID()
-
final
case class
VoteDelta(selfVote: Boolean = false, votesFor: Int = 0, totalVoters: Int = 0) extends GeneratedMessage with Message[VoteDelta] with Updatable[VoteDelta] with Product with Serializable
- selfVote
Only set by the user function to change the nodes current vote.
- votesFor
Only set by the proxy to change the votes for and total voters.
- Annotations
- @SerialVersionUID()
-
final
case class
VoteState(votesFor: Int = 0, totalVoters: Int = 0, selfVote: Boolean = false) extends GeneratedMessage with Message[VoteState] with Updatable[VoteState] with Product with Serializable
A Vote.
A Vote. This allows nodes to vote on something.
- votesFor
The number of votes for
- totalVoters
The total number of voters
- selfVote
The vote of the current node, which is included in the above two numbers
- Annotations
- @SerialVersionUID()
Value Members
- object Crdt
- object CrdtClock extends GeneratedEnumCompanion[CrdtClock] with Serializable
- object CrdtDelete extends GeneratedMessageCompanion[CrdtDelete] with Serializable
- object CrdtDelta extends GeneratedMessageCompanion[CrdtDelta] with Serializable
- object CrdtHandler
- object CrdtInit extends GeneratedMessageCompanion[CrdtInit] with Serializable
- object CrdtProto extends GeneratedFileObject
- object CrdtReply extends GeneratedMessageCompanion[CrdtReply] with Serializable
- object CrdtState extends GeneratedMessageCompanion[CrdtState] with Serializable
- object CrdtStateAction extends GeneratedMessageCompanion[CrdtStateAction] with Serializable
- object CrdtStreamCancelledResponse extends GeneratedMessageCompanion[CrdtStreamCancelledResponse] with Serializable
- object CrdtStreamIn extends GeneratedMessageCompanion[CrdtStreamIn] with Serializable
- object CrdtStreamOut extends GeneratedMessageCompanion[CrdtStreamOut] with Serializable
- object CrdtStreamedMessage extends GeneratedMessageCompanion[CrdtStreamedMessage] with Serializable
- object CrdtWriteConsistency extends GeneratedEnumCompanion[CrdtWriteConsistency] with Serializable
- object FlagDelta extends GeneratedMessageCompanion[FlagDelta] with Serializable
- object FlagState extends GeneratedMessageCompanion[FlagState] with Serializable
- object GCounterDelta extends GeneratedMessageCompanion[GCounterDelta] with Serializable
- object GCounterState extends GeneratedMessageCompanion[GCounterState] with Serializable
- object GSetDelta extends GeneratedMessageCompanion[GSetDelta] with Serializable
- object GSetState extends GeneratedMessageCompanion[GSetState] with Serializable
- object LWWRegisterDelta extends GeneratedMessageCompanion[LWWRegisterDelta] with Serializable
- object LWWRegisterState extends GeneratedMessageCompanion[LWWRegisterState] with Serializable
- object ORMapDelta extends GeneratedMessageCompanion[ORMapDelta] with Serializable
- object ORMapEntry extends GeneratedMessageCompanion[ORMapEntry] with Serializable
- object ORMapEntryDelta extends GeneratedMessageCompanion[ORMapEntryDelta] with Serializable
- object ORMapState extends GeneratedMessageCompanion[ORMapState] with Serializable
- object ORSetDelta extends GeneratedMessageCompanion[ORSetDelta] with Serializable
- object ORSetState extends GeneratedMessageCompanion[ORSetState] with Serializable
- object PNCounterDelta extends GeneratedMessageCompanion[PNCounterDelta] with Serializable
- object PNCounterState extends GeneratedMessageCompanion[PNCounterState] with Serializable
- object VoteDelta extends GeneratedMessageCompanion[VoteDelta] with Serializable
- object VoteState extends GeneratedMessageCompanion[VoteState] with Serializable