Google Cloud Bigtable C++ Client  1.42.0
A C++ Client Library for Google Cloud Bigtable
row_key_sample.h
Go to the documentation of this file.
1 // Copyright 2018 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ROW_KEY_SAMPLE_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ROW_KEY_SAMPLE_H
17 
18 #include "google/cloud/bigtable/row_key.h"
19 #include "google/cloud/bigtable/version.h"
20 #include <cstdint>
21 
22 namespace google {
23 namespace cloud {
24 namespace bigtable {
26 /// A simple wrapper to represent the response from `Table::SampleRowKeys()`.
27 struct RowKeySample {
28  /**
29  * A row key value strictly larger than all the rows included in this sample.
30  *
31  * Note that the service may return row keys that do not exist in the Cloud
32  * Bigtable table. This should be interpreted as "a split point for sharding
33  * a `Table::ReadRows()` call. That is calling `Table::ReadRows()` to return
34  * all the rows in the range `[previous-sample-row-key, this-sample-row-key)`
35  * is expected to produce an efficient sharding of the `Table::ReadRows()`
36  * operation.
37  */
38  RowKeyType row_key;
39 
40  /// An estimate of the table size for all the rows smaller than `row_key`.
41  std::int64_t offset_bytes;
42 };
43 
45 } // namespace bigtable
46 } // namespace cloud
47 } // namespace google
48 
49 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ROW_KEY_SAMPLE_H