feat: add specialised replicated maps#161
Conversation
| ReplicatedRegisterMap<String, String> registerMap = | ||
| (ReplicatedRegisterMap<String, String>) replicatedData; |
There was a problem hiding this comment.
I may be missing something, but why both ReplicatedCounterMap and ReplicatedRegisterMap have type parameters?
The proto definitions define the (K, V) to be (String, Long) and (String, String) respectively.
True that I still need to wrap my mind around the whole replicate entity feature and get a better view on how that will be used, but at first sight my understanding is that we are already bound to (String, Long) and (String, String)
There was a problem hiding this comment.
The key can be anything serializable — protobuf message, json, or primitive. Same for register values. The proto definitions here are just for the TCK tests, which are simplified to only string keys and string values for registers.
There was a problem hiding this comment.
I understood this was the TCK, but the map entry in the proto is defined as
message ReplicatedRegisterMapEntryUpdate {
string key = 1;
string value = 2;
}How could we send anything other then String? Are we sending the bytes encoded as base64?
There was a problem hiding this comment.
That's the protocol for the TCK — which sends messages on how the entities should be updated, and only uses strings.
The actual proxy protocol for replicated maps uses protobuf Any:
message ReplicatedMapEntryDelta {
// The entry key.
google.protobuf.Any key = 1;
ReplicatedEntityDelta delta = 2;
}
message ReplicatedRegisterDelta {
google.protobuf.Any value = 1;
ReplicatedEntityClock clock = 2;
int64 custom_clock_value = 3;
}There was a problem hiding this comment.
Oh, that explains everything. Thanks for clarifying.
c899ef3 to
4d228f0
Compare
|
Rebased and updated to framework release 0.7.0-beta.16. |
Refs #48. Test the specialised replicated maps using the new TCK tests from https://github.com/lightbend/akkaserverless-framework/pull/802 (needs to be published first, draft PR here). Support the new replicated maps from https://github.com/lightbend/akkaserverless-framework/pull/803. Resolves #49.