Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: blimp/common/proto/helium.proto

Issue 2400303002: Add LwwRegister CRDT (Closed)
Patch Set: Add LwwRegister and tests to build Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | blimp/net/BUILD.gn » ('j') | blimp/net/helium/lww_register.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Over-the-wire message definitions used for the Helium synchronization 5 // Over-the-wire message definitions used for the Helium synchronization
6 // protocol. 6 // protocol.
7 7
8 syntax = "proto3"; 8 syntax = "proto3";
9 9
10 option optimize_for = LITE_RUNTIME; 10 option optimize_for = LITE_RUNTIME;
11 11
12 package blimp.proto; 12 package blimp.proto;
13 13
14 // Vector clock that is used to get the partial order of changes. 14 // Vector clock that is used to get the partial order of changes.
15 // This class is the proto definition of 15 // This class is the proto definition of
16 // //blimp/net/helium/vector_clock.h 16 // //blimp/net/helium/vector_clock.h
17 message VectorClockMessage { 17 message VectorClockMessage {
18 uint64 local_revision = 1; 18 uint64 local_revision = 1;
19 uint64 remote_revision = 2; 19 uint64 remote_revision = 2;
20 } 20 }
21 21
22 // Sample proto for test purposes. 22 // Sample proto for test purposes.
23 message TestChangesetMessage { 23 message TestChangesetMessage {
24 int32 value1 = 1; 24 int32 value1 = 1;
25 int32 value2 = 2; 25 int32 value2 = 2;
26 } 26 }
27 27
28 message LwwRegisterChangesetMessage {
29 oneof register {
30 int32 integer_value = 1;
scf 2016/10/10 19:45:46 rename to something that convey the size: |i32_val
steimel 2016/10/11 16:39:16 Gotcha. If we end up keeping with protos instead o
31 string string_value = 2;
32 }
33 }
34
28 // A union of serializable Changeset types. There will be one for each Helium 35 // A union of serializable Changeset types. There will be one for each Helium
29 // Object that requires serialization. 36 // Object that requires serialization.
30 message ChangesetMessage { 37 message ChangesetMessage {
31 oneof payload { 38 oneof payload {
32 // Sample message for the test 39 // Sample message for the test
33 TestChangesetMessage test = 1; 40 TestChangesetMessage test = 1;
41 LwwRegisterChangesetMessage lww_register = 2;
34 }; 42 };
35 } 43 }
36 44
37 // Message that encapsulates a change for a helium object. It contains 45 // Message that encapsulates a change for a helium object. It contains
38 // information required to restore the object from the time specified in |from| 46 // information required to restore the object from the time specified in |from|
39 // until |to|. 47 // until |to|.
40 // 48 //
41 // This is the main object that will be sent in the Helium transport 49 // This is the main object that will be sent in the Helium transport
42 message HeliumMessage { 50 message HeliumMessage {
43 // Identifies the local revision that this changeset applies to (relative 51 // Identifies the local revision that this changeset applies to (relative
44 // to the sender), and the remote revision that the local side most recently 52 // to the sender), and the remote revision that the local side most recently
45 // received (i.e. an ACK, in effect). 53 // received (i.e. an ACK, in effect).
46 VectorClockMessage from = 1; 54 VectorClockMessage from = 1;
47 55
48 // Provides the local view of the vector-clock following application of 56 // Provides the local view of the vector-clock following application of
49 // the changeset. This allows a single changeset to collate changes across 57 // the changeset. This allows a single changeset to collate changes across
50 // several revisions, following a break in connectivity, rather than simply 58 // several revisions, following a break in connectivity, rather than simply
51 // re-transmitting the lost changesets. 59 // re-transmitting the lost changesets.
52 VectorClockMessage to = 2; 60 VectorClockMessage to = 2;
53 61
54 // Identifies the Object to which this changeset applies. 62 // Identifies the Object to which this changeset applies.
55 uint32 object_id = 3; 63 uint32 object_id = 3;
56 64
57 // The changeset that contain the actual changes. 65 // The changeset that contain the actual changes.
58 ChangesetMessage change = 4; 66 ChangesetMessage change = 4;
59 } 67 }
OLDNEW
« no previous file with comments | « no previous file | blimp/net/BUILD.gn » ('j') | blimp/net/helium/lww_register.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698