@@ -6,79 +6,79 @@ option java_package = "org.vss";
6
6
// Request payload to be used for `GetObject` API call to server.
7
7
message GetObjectRequest {
8
8
9
- // store_id is a keyspace identifier.
9
+ // ` store_id` is a keyspace identifier.
10
10
// Ref: https://en.wikipedia.org/wiki/Keyspace_(distributed_data_store)
11
- // All APIs operate within a single store_id.
11
+ // All APIs operate within a single ` store_id` .
12
12
// It is up to clients to use single or multiple stores for their use-case.
13
13
// This can be used for client-isolation/ rate-limiting / throttling on the server-side.
14
- // Authorization and billing can also be performed at the store_id level.
14
+ // Authorization and billing can also be performed at the ` store_id` level.
15
15
string store_id = 1 ;
16
16
17
- // Key for which the value is to be fetched.
17
+ // ` Key` for which the value is to be fetched.
18
18
//
19
19
// Consistency Guarantee:
20
- // Get(read) operations against a key are consistent reads and will reflect all previous writes,
20
+ // Get(read) operations against a ` key` are consistent reads and will reflect all previous writes,
21
21
// since Put/Write provides read-after-write and read-after-update consistency guarantees.
22
22
//
23
23
// Read Isolation:
24
- // Get/Read operations against a key are ensured to have read-committed isolation.
24
+ // Get/Read operations against a ` key` are ensured to have read-committed isolation.
25
25
// Ref: https://en.wikipedia.org/wiki/Isolation_(database_systems)#Read_committed
26
26
string key = 2 ;
27
27
}
28
28
29
29
// Server response for `GetObject` API.
30
30
message GetObjectResponse {
31
31
32
- // Fetched value and version along with the corresponding key in the request.
32
+ // Fetched ` value` and ` version` along with the corresponding ` key` in the request.
33
33
KeyValue value = 2 ;
34
34
}
35
35
36
36
// Request payload to be used for `PutObject` API call to server.
37
37
message PutObjectRequest {
38
38
39
- // store_id is a keyspace identifier.
39
+ // ` store_id` is a keyspace identifier.
40
40
// Ref: https://en.wikipedia.org/wiki/Keyspace_(distributed_data_store)
41
- // All APIs operate within a single store_id.
41
+ // All APIs operate within a single ` store_id` .
42
42
// It is up to clients to use single or multiple stores for their use-case.
43
43
// This can be used for client-isolation/ rate-limiting / throttling on the server-side.
44
- // Authorization and billing can also be performed at the store_id level.
44
+ // Authorization and billing can also be performed at the ` store_id` level.
45
45
string store_id = 1 ;
46
46
47
- // global_version is a sequence-number/version of the whole store. This can be used for versioning
47
+ // ` global_version` is a sequence-number/version of the whole store. This can be used for versioning
48
48
// and ensures that multiple updates in case of multiple devices can only be done linearly, even
49
- // if those updates did not directly conflict with each other based on keys/transaction_items.
49
+ // if those updates did not directly conflict with each other based on keys/` transaction_items` .
50
50
//
51
- // If present, the write will only succeed if the current server-side global_version against
52
- // the store_id is same as in the request.
53
- // Clients are expected to store (client-side) the global version against store_id.
54
- // The request must contain their client-side value of global_version if global versioning and
51
+ // If present, the write will only succeed if the current server-side ` global_version` against
52
+ // the ` store_id` is same as in the request.
53
+ // Clients are expected to store (client-side) the global version against ` store_id` .
54
+ // The request must contain their client-side value of ` global_version` if global versioning and
55
55
// conflict detection is desired.
56
56
//
57
57
// For the first write of the store, global version should be '0'. If the write succeeds, clients
58
58
// must increment their global version (client-side) by 1.
59
- // The server increments global_version (server-side) for every successful write, hence this
59
+ // The server increments ` global_version` (server-side) for every successful write, hence this
60
60
// client-side increment is required to ensure matching versions. This updated global version
61
61
// should be used in subsequent PutObjectRequests for the store.
62
62
//
63
63
// Requests with a conflicting version will fail with `CONFLICT_EXCEPTION` as ErrorCode.
64
64
optional int64 global_version = 2 ;
65
65
66
- // Items to be written as a result of this PutObjectRequest.
66
+ // Items to be written as a result of this ` PutObjectRequest` .
67
67
//
68
- // In an item, each key is supplied with its corresponding value and version.
68
+ // In an item, each ` key` is supplied with its corresponding ` value` and ` version` .
69
69
// Clients can choose to encrypt the keys client-side in order to obfuscate their usage patterns.
70
- // If the write is successful, the previous value corresponding to the key will be overwritten.
70
+ // If the write is successful, the previous ` value` corresponding to the ` key` will be overwritten.
71
71
//
72
- // Multiple items in transaction_items and delete_items of a single PutObjectRequest are written in
72
+ // Multiple items in ` transaction_items` and ` delete_items` of a single ` PutObjectRequest` are written in
73
73
// a database-transaction in an all-or-nothing fashion.
74
- // All Items in a single PutObjectRequest must have distinct keys.
74
+ // All Items in a single ` PutObjectRequest` must have distinct keys.
75
75
//
76
- // Clients are expected to store a version against every key.
77
- // The write will succeed if the current DB version against the key is the same as in the request.
78
- // When initiating a PutObjectRequest, the request should contain their client-side version for
76
+ // Clients are expected to store a ` version` against every ` key` .
77
+ // The write will succeed if the current DB version against the ` key` is the same as in the request.
78
+ // When initiating a ` PutObjectRequest` , the request should contain their client-side version for
79
79
// that key-value.
80
80
//
81
- // For the first write of any key, the version should be '0'. If the write succeeds, the client
81
+ // For the first write of any key, the ` version` should be '0'. If the write succeeds, the client
82
82
// must increment their corresponding key versions (client-side) by 1.
83
83
// The server increments key versions (server-side) for every successful write, hence this
84
84
// client-side increment is required to ensure matching versions. These updated key versions should
@@ -89,7 +89,7 @@ message PutObjectRequest {
89
89
// Considerations for transactions:
90
90
// Transaction writes of multiple items have a performance overhead, hence it is recommended to use
91
91
// them only if required by the client application to ensure logic/code correctness.
92
- // That is, transaction_items are not a substitute for batch-write of multiple unrelated items.
92
+ // That is, ` transaction_items` are not a substitute for batch-write of multiple unrelated items.
93
93
// When a write of multiple unrelated items is desired, it is recommended to use separate
94
94
// PutObjectRequests.
95
95
//
@@ -98,11 +98,11 @@ message PutObjectRequest {
98
98
// read-after-update consistency guarantees.
99
99
repeated KeyValue transaction_items = 3 ;
100
100
101
- // Items to be deleted as a result of this PutObjectRequest.
101
+ // Items to be deleted as a result of this ` PutObjectRequest` .
102
102
//
103
- // Each item in the `delete_items` field consists of a key and its corresponding version.
104
- // The version is used to perform a version check before deleting the item.
105
- // The delete will only succeed if the current database version against the key is the same as the version
103
+ // Each item in the `delete_items` field consists of a ` key` and its corresponding ` version` .
104
+ // The ` version` is used to perform a version check before deleting the item.
105
+ // The delete will only succeed if the current database version against the ` key` is the same as the ` version`
106
106
// specified in the request.
107
107
//
108
108
// Fails with `CONFLICT_EXCEPTION` as the ErrorCode if:
@@ -122,23 +122,23 @@ message PutObjectResponse {
122
122
123
123
// Request payload to be used for `DeleteObject` API call to server.
124
124
message DeleteObjectRequest {
125
- // store_id is a keyspace identifier.
125
+ // ` store_id` is a keyspace identifier.
126
126
// Ref: https://en.wikipedia.org/wiki/Keyspace_(distributed_data_store)
127
- // All APIs operate within a single store_id.
127
+ // All APIs operate within a single ` store_id` .
128
128
// It is up to clients to use single or multiple stores for their use-case.
129
129
// This can be used for client-isolation/ rate-limiting / throttling on the server-side.
130
- // Authorization and billing can also be performed at the store_id level.
130
+ // Authorization and billing can also be performed at the ` store_id` level.
131
131
string store_id = 1 ;
132
132
133
- // Item to be deleted as a result of this DeleteObjectRequest.
133
+ // Item to be deleted as a result of this ` DeleteObjectRequest` .
134
134
//
135
- // An item consists of a key and its corresponding version.
136
- // The item is only deleted if the current database version against the key is the same as the version
135
+ // An item consists of a ` key` and its corresponding ` version` .
136
+ // The item is only deleted if the current database version against the ` key` is the same as the ` version`
137
137
// specified in the request.
138
138
// This operation is idempotent, that is, multiple delete calls for the same item will not fail.
139
139
//
140
140
// If the requested item does not exist, this operation will not fail.
141
- // If you wish to perform stricter checks while deleting an item, consider using PutObject API.
141
+ // If you wish to perform stricter checks while deleting an item, consider using ` PutObject` API.
142
142
KeyValue key_value = 2 ;
143
143
}
144
144
@@ -149,79 +149,79 @@ message DeleteObjectResponse{
149
149
// Request payload to be used for `ListKeyVersions` API call to server.
150
150
message ListKeyVersionsRequest {
151
151
152
- // store_id is a keyspace identifier.
152
+ // ` store_id` is a keyspace identifier.
153
153
// Ref: https://en.wikipedia.org/wiki/Keyspace_(distributed_data_store)
154
- // All APIs operate within a single store_id.
154
+ // All APIs operate within a single ` store_id` .
155
155
// It is up to clients to use single or multiple stores for their use-case.
156
156
// This can be used for client-isolation/ rate-limiting / throttling on the server-side.
157
- // Authorization and billing can also be performed at the store_id level.
157
+ // Authorization and billing can also be performed at the ` store_id` level.
158
158
string store_id = 1 ;
159
159
160
- // A key_prefix is a string of characters at the beginning of the key. Prefixes can be used as
160
+ // A ` key_prefix` is a string of characters at the beginning of the key. Prefixes can be used as
161
161
// a way to organize key-values in a similar way to directories.
162
162
//
163
- // If key_prefix is specified, the response results will be limited to those keys that begin with
163
+ // If ` key_prefix` is specified, the response results will be limited to those keys that begin with
164
164
// the specified prefix.
165
165
//
166
- // If no key_prefix is specified or it is empty (""), all the keys are eligible to be returned in
166
+ // If no ` key_prefix` is specified or it is empty (""), all the keys are eligible to be returned in
167
167
// the response.
168
168
optional string key_prefix = 2 ;
169
169
170
- // page_size is used by clients to specify the maximum number of results that can be returned by
170
+ // ` page_size` is used by clients to specify the maximum number of results that can be returned by
171
171
// the server.
172
172
// The server may further constrain the maximum number of results returned in a single page.
173
- // If the page_size is 0 or not set, the server will decide the number of results to be returned.
173
+ // If the ` page_size` is 0 or not set, the server will decide the number of results to be returned.
174
174
optional int32 page_size = 3 ;
175
175
176
- // page_token is a pagination token.
176
+ // ` page_token` is a pagination token.
177
177
//
178
- // To query for the first page of ListKeyVersions, page_token must not be specified.
178
+ // To query for the first page of ` ListKeyVersions`, ` page_token` must not be specified.
179
179
//
180
180
// For subsequent pages, use the value that was returned as `next_page_token` in the previous
181
- // page's ListKeyVersionsResponse.
181
+ // page's ` ListKeyVersionsResponse` .
182
182
optional string page_token = 4 ;
183
183
}
184
184
185
185
// Server response for `ListKeyVersions` API.
186
186
message ListKeyVersionsResponse {
187
187
188
188
// Fetched keys and versions.
189
- // Even though this API reuses KeyValue struct, the value sub-field will not be set by the server.
189
+ // Even though this API reuses the ` KeyValue` struct, the ` value` sub-field will not be set by the server.
190
190
repeated KeyValue key_versions = 1 ;
191
191
192
- // next_page_token is a pagination token, used to retrieve the next page of results.
193
- // Use this value to query for next_page of paginated ListKeyVersions operation, by specifying
192
+ // ` next_page_token` is a pagination token, used to retrieve the next page of results.
193
+ // Use this value to query for next-page of paginated ` ListKeyVersions` operation, by specifying
194
194
// this value as the `page_token` in the next request.
195
195
//
196
- // If next_page_token is empty (""), then the "last page" of results has been processed and
196
+ // If ` next_page_token` is empty (""), then the "last page" of results has been processed and
197
197
// there is no more data to be retrieved.
198
198
//
199
- // If next_page_token is not empty, it does not necessarily mean that there is more data in the
199
+ // If ` next_page_token` is not empty, it does not necessarily mean that there is more data in the
200
200
// result set. The only way to know when you have reached the end of the result set is when
201
- // next_page_token is empty.
201
+ // ` next_page_token` is empty.
202
202
//
203
203
// Caution: Clients must not assume a specific number of key_versions to be present in a page for
204
204
// paginated response.
205
205
optional string next_page_token = 2 ;
206
206
207
- // global_version is a sequence-number/version of the whole store.
207
+ // ` global_version` is a sequence-number/version of the whole store.
208
208
//
209
- // global_version is only returned in response for the first page of the ListKeyVersionsResponse
209
+ // ` global_version` is only returned in response for the first page of the ` ListKeyVersionsResponse`
210
210
// and is guaranteed to be read before reading any key-versions.
211
211
//
212
212
// In case of refreshing the complete key-version view on the client-side, correct usage for
213
- // the returned global_version is as following:
214
- // 1. Read global_version from the first page of paginated response and save it as local variable.
215
- // 2. Update all the key_versions on client-side from all the pages of paginated response.
216
- // 3. Update global_version on client_side from the local variable saved in step-1.
217
- // This ensures that on client-side, all current key_versions were stored at global_version or later.
218
- // This guarantee is helpful for ensuring the versioning correctness if using the global_version
219
- // in PutObject API and can help avoid the race conditions related to it.
213
+ // the returned ` global_version` is as following:
214
+ // 1. Read ` global_version` from the first page of paginated response and save it as local variable.
215
+ // 2. Update all the ` key_versions` on client-side from all the pages of paginated response.
216
+ // 3. Update ` global_version` on client_side from the local variable saved in step-1.
217
+ // This ensures that on client-side, all current ` key_versions` were stored at ` global_version` or later.
218
+ // This guarantee is helpful for ensuring the versioning correctness if using the ` global_version`
219
+ // in ` PutObject` API and can help avoid the race conditions related to it.
220
220
optional int64 global_version = 3 ;
221
221
}
222
222
223
- // When HttpStatusCode is not ok (200), the response `content` contains a serialized ErrorResponse
224
- // with the relevant ErrorCode and message
223
+ // When HttpStatusCode is not ok (200), the response `content` contains a serialized ` ErrorResponse`
224
+ // with the relevant ` ErrorCode` and ` message`
225
225
message ErrorResponse {
226
226
227
227
// The error code uniquely identifying an error condition.
@@ -235,14 +235,14 @@ message ErrorResponse {
235
235
string message = 2 ;
236
236
}
237
237
238
- // ErrorCodes to be used in ErrorResponse
238
+ // ErrorCodes to be used in ` ErrorResponse`
239
239
enum ErrorCode {
240
240
241
- // Default protobuf Enum value. Will not be used as ErrorCode by server.
241
+ // Default protobuf Enum value. Will not be used as ` ErrorCode` by server.
242
242
UNKNOWN = 0 ;
243
243
244
244
// CONFLICT_EXCEPTION is used when the request contains mismatched version (either key or global)
245
- // in PutObjectRequest. For more info refer PutObjectRequest.
245
+ // in ` PutObjectRequest` . For more info refer ` PutObjectRequest` .
246
246
CONFLICT_EXCEPTION = 1 ;
247
247
248
248
// INVALID_REQUEST_EXCEPTION is used in the following cases:
@@ -256,18 +256,18 @@ enum ErrorCode {
256
256
INTERNAL_SERVER_EXCEPTION = 3 ;
257
257
}
258
258
259
- // Represents KeyValue pair to be stored or retrieved.
259
+ // Represents a key-value pair to be stored or retrieved.
260
260
message KeyValue {
261
261
262
262
// Key against which the value is stored.
263
263
string key = 1 ;
264
264
265
265
// Version field is used for key-level versioning.
266
- // For first write of key, version should be '0'. If the write succeeds, clients must increment
266
+ // For first write of key, ` version` should be '0'. If the write succeeds, clients must increment
267
267
// their corresponding key version (client-side) by 1.
268
268
// The server increments key version (server-side) for every successful write, hence this
269
269
// client-side increment is required to ensure matching versions. These updated key versions should
270
- // be used in subsequent PutObjectRequests for the keys.
270
+ // be used in subsequent `PutObjectRequest`s for the keys.
271
271
int64 version = 2 ;
272
272
273
273
// Object value in bytes which is stored (in put) and fetched (in get).
0 commit comments