44// you may not use this file except in compliance with the License.
55// You may obtain a copy of the License at
66//
7- // https ://www.apache.org/licenses/LICENSE-2.0
7+ // http ://www.apache.org/licenses/LICENSE-2.0
88//
99// Unless required by applicable law or agreed to in writing, software
1010// distributed under the License is distributed on an "AS IS" BASIS,
1414
1515syntax = "proto3" ;
1616
17- package bigtable.client.test ;
17+ package google. bigtable.testproxy ;
1818
19+ import "google/api/client.proto" ;
1920import "google/bigtable/v2/bigtable.proto" ;
2021import "google/bigtable/v2/data.proto" ;
2122import "google/protobuf/duration.proto" ;
2223import "google/rpc/status.proto" ;
2324
25+ option go_package = "./testproxypb" ;
2426option java_multiple_files = true ;
2527option java_package = "com.google.cloud.bigtable.testproxy" ;
26- option go_package = "./testproxypb" ;
27-
28- // The `status` field of response messages always represents an error returned
29- // by the client binding, e.g. never a problem in either the proxy logic or
30- // test driver to proxy communication. After receiving a response from the
31- // proxy, the test driver should always check its `status` field.
32- //
33- // [test driver] <--> [test proxy <--> client binding] <--> [Cloud Bigtable]
34- // ^^^^
35- // `status` represents success or errors
36- // returned from the client binding.
37- //
38- // Status propagation design examples, assuming the C++ client:
39- //
40- // // For CloudBigtableV2TestProxy.ReadRow
41- // StatusOr<std::pair<bool, Row>> result = table.ReadRow(row_key, filter);
42- //
43- // Set RowResult.status to OK iff result.status() is OK.
44- // OK is required even if the bool is false, indicating the row wasn't found.
45- //
46- // // For CloudBigtableV2TestProxy.BulkMutateRows
47- // std::vector<FailedMutation> failed = table.BulkApply(bulk_mutation);
48- //
49- // The semantics are less obvious for BulkApply(), because some mutations
50- // failing doesn't indicate the overall RPC fails. In such case, test proxy
51- // should disambiguate between RPC failure and individual entry failure, and
52- // set MutateRowsResult.status according to the overall RPC status.
53- //
54- // The final decision regarding semantics must be documented for the
55- // CloudBigtableV2TestProxy service in this file.
5628
29+ // Request to test proxy service to create a client object.
5730message CreateClientRequest {
31+ // A unique ID associated with the client object to be created.
5832 string client_id = 1 ;
33+
5934 // The "host:port" address of the data API endpoint (i.e. the backend being
6035 // proxied to). Example: 127.0.0.1:38543. If you want to connect to a local
6136 // emulator via BIGTABLE_EMULATOR_HOST environment variable, you can use
6237 // "emulator" instead of "host:port" for this field.
6338 string data_target = 2 ;
39+
6440 // The project for all calls on this client.
6541 string project_id = 3 ;
42+
6643 // The instance for all calls on this client.
6744 string instance_id = 4 ;
45+
6846 // Optional app profile for all calls on this client.
6947 // Some client bindings allow specifying the app profile on a per-operation
7048 // basis. We don't yet support this in the proxy API, but may in the future.
7149 string app_profile_id = 5 ;
50+
7251 // If provided, a custom timeout will be set for each API call conducted by
7352 // the created client. Otherwise, the default timeout from the client library
7453 // will be used. Note that the override applies to all the methods.
7554 google.protobuf.Duration per_operation_timeout = 6 ;
7655}
7756
57+ // Response from test proxy service for CreateClientRequest.
7858message CreateClientResponse {}
7959
60+ // Request to test proxy service to close a client object.
8061message CloseClientRequest {
62+ // The ID of the target client object.
8163 string client_id = 1 ;
8264}
8365
66+ // Response from test proxy service for CloseClientRequest.
8467message CloseClientResponse {}
8568
69+ // Request to test proxy service to remove a client object.
8670message RemoveClientRequest {
71+ // The ID of the target client object.
8772 string client_id = 1 ;
8873}
8974
75+ // Response from test proxy service for RemoveClientRequest.
9076message RemoveClientResponse {}
9177
78+ // Request to test proxy service to read a row.
9279message ReadRowRequest {
80+ // The ID of the target client object.
9381 string client_id = 1 ;
82+
9483 // The unique name of the table from which to read the row.
9584 // Values are of the form
9685 // `projects/<project>/instances/<instance>/tables/<table>`.
9786 string table_name = 4 ;
87+
88+ // The row key of the target row.
9889 string row_key = 2 ;
90+
91+ // The row filter to be applied to the target row.
9992 google.bigtable.v2.RowFilter filter = 3 ;
10093}
10194
95+ // Response from test proxy service for ReadRowRequest or
96+ // ReadModifyWriteRowRequest.
10297message RowResult {
98+ // The RPC status from the client binding.
10399 google.rpc.Status status = 1 ;
100+
101+ // The contents of a single row.
104102 google.bigtable.v2.Row row = 2 ;
105103}
106104
105+ // Request to test proxy service to read rows.
107106message ReadRowsRequest {
107+ // The ID of the target client object.
108108 string client_id = 1 ;
109+
110+ // The raw request to the Bigtable server.
109111 google.bigtable.v2.ReadRowsRequest request = 2 ;
112+
110113 // The streaming read can be canceled before all items are seen.
111114 // Has no effect if non-positive.
112115 int32 cancel_after_rows = 3 ;
113116}
114117
118+ // Response from test proxy service for ReadRowsRequest.
115119message RowsResult {
120+ // The RPC status from the client binding.
116121 google.rpc.Status status = 1 ;
122+
123+ // The contents of rows.
117124 repeated google.bigtable.v2.Row row = 2 ;
118125}
119126
127+ // Request to test proxy service to mutate a row.
120128message MutateRowRequest {
129+ // The ID of the target client object.
121130 string client_id = 1 ;
131+
132+ // The raw request to the Bigtable server.
122133 google.bigtable.v2.MutateRowRequest request = 2 ;
123134}
124135
136+ // Response from test proxy service for MutateRowRequest.
125137message MutateRowResult {
138+ // The RPC status from the client binding.
126139 google.rpc.Status status = 1 ;
127140}
128141
142+ // Request to test proxy service to mutate rows.
129143message MutateRowsRequest {
144+ // The ID of the target client object.
130145 string client_id = 1 ;
146+
147+ // The raw request to the Bigtable server.
131148 google.bigtable.v2.MutateRowsRequest request = 2 ;
132149}
133150
151+ // Response from test proxy service for MutateRowsRequest.
134152message MutateRowsResult {
135- // Overall RPC status
153+ // The RPC status from the client binding, corresponding to the
154+ // whole operation.
136155 google.rpc.Status status = 1 ;
137- // To record individual entry failures
156+
157+ // The results corresponding to the failed rows.
138158 repeated google.bigtable.v2.MutateRowsResponse.Entry entry = 2 ;
139159}
140160
161+ // Request to test proxy service to check and mutate a row.
141162message CheckAndMutateRowRequest {
163+ // The ID of the target client object.
142164 string client_id = 1 ;
165+
166+ // The raw request to the Bigtable server.
143167 google.bigtable.v2.CheckAndMutateRowRequest request = 2 ;
144168}
145169
170+ // Response from test proxy service for CheckAndMutateRowRequest.
146171message CheckAndMutateRowResult {
172+ // The RPC status from the client binding.
147173 google.rpc.Status status = 1 ;
174+
175+ // The raw response from the Bigtable server.
148176 google.bigtable.v2.CheckAndMutateRowResponse result = 2 ;
149177}
150178
179+ // Request to test proxy service to sample row keys.
151180message SampleRowKeysRequest {
181+ // The ID of the target client object.
152182 string client_id = 1 ;
183+
184+ // The raw request to the Bigtable server.
153185 google.bigtable.v2.SampleRowKeysRequest request = 2 ;
154186}
155187
188+ // Response from test proxy service for SampleRowKeysRequest.
156189message SampleRowKeysResult {
190+ // The RPC status from the client binding.
157191 google.rpc.Status status = 1 ;
192+
193+ // The raw responses from the Bigtable server.
158194 repeated google.bigtable.v2.SampleRowKeysResponse sample = 2 ;
159195}
160196
197+ // Request to test proxy service to read modify write a row.
161198message ReadModifyWriteRowRequest {
199+ // The ID of the target client object.
162200 string client_id = 1 ;
201+
202+ // The raw request to the Bigtable server.
163203 google.bigtable.v2.ReadModifyWriteRowRequest request = 2 ;
164204}
165205
@@ -180,17 +220,22 @@ message ReadModifyWriteRowRequest {
180220// understand that the underlying operation will continue to be executed even
181221// after the deadline expires.
182222service CloudBigtableV2TestProxy {
223+ option (google.api.default_host ) =
224+ "bigtable-test-proxy-not-accessible.googleapis.com" ;
225+
183226 // Client management:
184227 //
185228 // Creates a client in the proxy.
186229 // Each client has its own dedicated channel(s), and can be used concurrently
187230 // and independently with other clients.
188- rpc CreateClient (CreateClientRequest ) returns (CreateClientResponse );
231+ rpc CreateClient (CreateClientRequest ) returns (CreateClientResponse ) {}
232+
189233 // Closes a client in the proxy, making it not accept new requests.
190- rpc CloseClient (CloseClientRequest ) returns (CloseClientResponse );
234+ rpc CloseClient (CloseClientRequest ) returns (CloseClientResponse ) {}
235+
191236 // Removes a client in the proxy, making it inaccessible. Client closing
192237 // should be done by CloseClient() separately.
193- rpc RemoveClient (RemoveClientRequest ) returns (RemoveClientResponse );
238+ rpc RemoveClient (RemoveClientRequest ) returns (RemoveClientResponse ) {}
194239
195240 // Bigtable operations: for each operation, you should use the synchronous or
196241 // asynchronous variant of the client method based on the `use_async_method`
@@ -200,24 +245,24 @@ service CloudBigtableV2TestProxy {
200245 // Reads a row with the client instance.
201246 // The result row may not be present in the response.
202247 // Callers should check for it (e.g. calling has_row() in C++).
203- rpc ReadRow (ReadRowRequest ) returns (RowResult );
248+ rpc ReadRow (ReadRowRequest ) returns (RowResult ) {}
204249
205250 // Reads rows with the client instance.
206- rpc ReadRows (ReadRowsRequest ) returns (RowsResult );
251+ rpc ReadRows (ReadRowsRequest ) returns (RowsResult ) {}
207252
208253 // Writes a row with the client instance.
209- rpc MutateRow (MutateRowRequest ) returns (MutateRowResult );
254+ rpc MutateRow (MutateRowRequest ) returns (MutateRowResult ) {}
210255
211256 // Writes multiple rows with the client instance.
212- rpc BulkMutateRows (MutateRowsRequest ) returns (MutateRowsResult );
257+ rpc BulkMutateRows (MutateRowsRequest ) returns (MutateRowsResult ) {}
213258
214259 // Performs a check-and-mutate-row operation with the client instance.
215260 rpc CheckAndMutateRow (CheckAndMutateRowRequest )
216- returns (CheckAndMutateRowResult );
261+ returns (CheckAndMutateRowResult ) {}
217262
218263 // Obtains a row key sampling with the client instance.
219- rpc SampleRowKeys (SampleRowKeysRequest ) returns (SampleRowKeysResult );
264+ rpc SampleRowKeys (SampleRowKeysRequest ) returns (SampleRowKeysResult ) {}
220265
221266 // Performs a read-modify-write operation with the client.
222- rpc ReadModifyWriteRow (ReadModifyWriteRowRequest ) returns (RowResult );
267+ rpc ReadModifyWriteRow (ReadModifyWriteRowRequest ) returns (RowResult ) {}
223268}
0 commit comments