google.bigtable.v2.rs 88 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807
  1. /// Specifies the complete (requested) contents of a single row of a table.
  2. /// Rows which exceed 256MiB in size cannot be read in full.
  3. #[derive(Clone, PartialEq, ::prost::Message)]
  4. pub struct Row {
  5. /// The unique key which identifies this row within its table. This is the same
  6. /// key that's used to identify the row in, for example, a MutateRowRequest.
  7. /// May contain any non-empty byte string up to 4KiB in length.
  8. #[prost(bytes = "vec", tag = "1")]
  9. pub key: ::prost::alloc::vec::Vec<u8>,
  10. /// May be empty, but only if the entire row is empty.
  11. /// The mutual ordering of column families is not specified.
  12. #[prost(message, repeated, tag = "2")]
  13. pub families: ::prost::alloc::vec::Vec<Family>,
  14. }
  15. /// Specifies (some of) the contents of a single row/column family intersection
  16. /// of a table.
  17. #[derive(Clone, PartialEq, ::prost::Message)]
  18. pub struct Family {
  19. /// The unique key which identifies this family within its row. This is the
  20. /// same key that's used to identify the family in, for example, a RowFilter
  21. /// which sets its "family_name_regex_filter" field.
  22. /// Must match `\[-_.a-zA-Z0-9\]+`, except that AggregatingRowProcessors may
  23. /// produce cells in a sentinel family with an empty name.
  24. /// Must be no greater than 64 characters in length.
  25. #[prost(string, tag = "1")]
  26. pub name: ::prost::alloc::string::String,
  27. /// Must not be empty. Sorted in order of increasing "qualifier".
  28. #[prost(message, repeated, tag = "2")]
  29. pub columns: ::prost::alloc::vec::Vec<Column>,
  30. }
  31. /// Specifies (some of) the contents of a single row/column intersection of a
  32. /// table.
  33. #[derive(Clone, PartialEq, ::prost::Message)]
  34. pub struct Column {
  35. /// The unique key which identifies this column within its family. This is the
  36. /// same key that's used to identify the column in, for example, a RowFilter
  37. /// which sets its `column_qualifier_regex_filter` field.
  38. /// May contain any byte string, including the empty string, up to 16kiB in
  39. /// length.
  40. #[prost(bytes = "vec", tag = "1")]
  41. pub qualifier: ::prost::alloc::vec::Vec<u8>,
  42. /// Must not be empty. Sorted in order of decreasing "timestamp_micros".
  43. #[prost(message, repeated, tag = "2")]
  44. pub cells: ::prost::alloc::vec::Vec<Cell>,
  45. }
  46. /// Specifies (some of) the contents of a single row/column/timestamp of a table.
  47. #[derive(Clone, PartialEq, ::prost::Message)]
  48. pub struct Cell {
  49. /// The cell's stored timestamp, which also uniquely identifies it within
  50. /// its column.
  51. /// Values are always expressed in microseconds, but individual tables may set
  52. /// a coarser granularity to further restrict the allowed values. For
  53. /// example, a table which specifies millisecond granularity will only allow
  54. /// values of `timestamp_micros` which are multiples of 1000.
  55. #[prost(int64, tag = "1")]
  56. pub timestamp_micros: i64,
  57. /// The value stored in the cell.
  58. /// May contain any byte string, including the empty string, up to 100MiB in
  59. /// length.
  60. #[prost(bytes = "vec", tag = "2")]
  61. pub value: ::prost::alloc::vec::Vec<u8>,
  62. /// Labels applied to the cell by a \[RowFilter][google.bigtable.v2.RowFilter\].
  63. #[prost(string, repeated, tag = "3")]
  64. pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
  65. }
  66. /// Specifies a contiguous range of rows.
  67. #[derive(Clone, PartialEq, ::prost::Message)]
  68. pub struct RowRange {
  69. /// The row key at which to start the range.
  70. /// If neither field is set, interpreted as the empty string, inclusive.
  71. #[prost(oneof = "row_range::StartKey", tags = "1, 2")]
  72. pub start_key: ::core::option::Option<row_range::StartKey>,
  73. /// The row key at which to end the range.
  74. /// If neither field is set, interpreted as the infinite row key, exclusive.
  75. #[prost(oneof = "row_range::EndKey", tags = "3, 4")]
  76. pub end_key: ::core::option::Option<row_range::EndKey>,
  77. }
  78. /// Nested message and enum types in `RowRange`.
  79. pub mod row_range {
  80. /// The row key at which to start the range.
  81. /// If neither field is set, interpreted as the empty string, inclusive.
  82. #[derive(Clone, PartialEq, ::prost::Oneof)]
  83. pub enum StartKey {
  84. /// Used when giving an inclusive lower bound for the range.
  85. #[prost(bytes, tag = "1")]
  86. StartKeyClosed(::prost::alloc::vec::Vec<u8>),
  87. /// Used when giving an exclusive lower bound for the range.
  88. #[prost(bytes, tag = "2")]
  89. StartKeyOpen(::prost::alloc::vec::Vec<u8>),
  90. }
  91. /// The row key at which to end the range.
  92. /// If neither field is set, interpreted as the infinite row key, exclusive.
  93. #[derive(Clone, PartialEq, ::prost::Oneof)]
  94. pub enum EndKey {
  95. /// Used when giving an exclusive upper bound for the range.
  96. #[prost(bytes, tag = "3")]
  97. EndKeyOpen(::prost::alloc::vec::Vec<u8>),
  98. /// Used when giving an inclusive upper bound for the range.
  99. #[prost(bytes, tag = "4")]
  100. EndKeyClosed(::prost::alloc::vec::Vec<u8>),
  101. }
  102. }
  103. /// Specifies a non-contiguous set of rows.
  104. #[derive(Clone, PartialEq, ::prost::Message)]
  105. pub struct RowSet {
  106. /// Single rows included in the set.
  107. #[prost(bytes = "vec", repeated, tag = "1")]
  108. pub row_keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
  109. /// Contiguous row ranges included in the set.
  110. #[prost(message, repeated, tag = "2")]
  111. pub row_ranges: ::prost::alloc::vec::Vec<RowRange>,
  112. }
  113. /// Specifies a contiguous range of columns within a single column family.
  114. /// The range spans from &lt;column_family&gt;:&lt;start_qualifier&gt; to
  115. /// &lt;column_family&gt;:&lt;end_qualifier&gt;, where both bounds can be either
  116. /// inclusive or exclusive.
  117. #[derive(Clone, PartialEq, ::prost::Message)]
  118. pub struct ColumnRange {
  119. /// The name of the column family within which this range falls.
  120. #[prost(string, tag = "1")]
  121. pub family_name: ::prost::alloc::string::String,
  122. /// The column qualifier at which to start the range (within `column_family`).
  123. /// If neither field is set, interpreted as the empty string, inclusive.
  124. #[prost(oneof = "column_range::StartQualifier", tags = "2, 3")]
  125. pub start_qualifier: ::core::option::Option<column_range::StartQualifier>,
  126. /// The column qualifier at which to end the range (within `column_family`).
  127. /// If neither field is set, interpreted as the infinite string, exclusive.
  128. #[prost(oneof = "column_range::EndQualifier", tags = "4, 5")]
  129. pub end_qualifier: ::core::option::Option<column_range::EndQualifier>,
  130. }
  131. /// Nested message and enum types in `ColumnRange`.
  132. pub mod column_range {
  133. /// The column qualifier at which to start the range (within `column_family`).
  134. /// If neither field is set, interpreted as the empty string, inclusive.
  135. #[derive(Clone, PartialEq, ::prost::Oneof)]
  136. pub enum StartQualifier {
  137. /// Used when giving an inclusive lower bound for the range.
  138. #[prost(bytes, tag = "2")]
  139. StartQualifierClosed(::prost::alloc::vec::Vec<u8>),
  140. /// Used when giving an exclusive lower bound for the range.
  141. #[prost(bytes, tag = "3")]
  142. StartQualifierOpen(::prost::alloc::vec::Vec<u8>),
  143. }
  144. /// The column qualifier at which to end the range (within `column_family`).
  145. /// If neither field is set, interpreted as the infinite string, exclusive.
  146. #[derive(Clone, PartialEq, ::prost::Oneof)]
  147. pub enum EndQualifier {
  148. /// Used when giving an inclusive upper bound for the range.
  149. #[prost(bytes, tag = "4")]
  150. EndQualifierClosed(::prost::alloc::vec::Vec<u8>),
  151. /// Used when giving an exclusive upper bound for the range.
  152. #[prost(bytes, tag = "5")]
  153. EndQualifierOpen(::prost::alloc::vec::Vec<u8>),
  154. }
  155. }
  156. /// Specified a contiguous range of microsecond timestamps.
  157. #[derive(Clone, PartialEq, ::prost::Message)]
  158. pub struct TimestampRange {
  159. /// Inclusive lower bound. If left empty, interpreted as 0.
  160. #[prost(int64, tag = "1")]
  161. pub start_timestamp_micros: i64,
  162. /// Exclusive upper bound. If left empty, interpreted as infinity.
  163. #[prost(int64, tag = "2")]
  164. pub end_timestamp_micros: i64,
  165. }
  166. /// Specifies a contiguous range of raw byte values.
  167. #[derive(Clone, PartialEq, ::prost::Message)]
  168. pub struct ValueRange {
  169. /// The value at which to start the range.
  170. /// If neither field is set, interpreted as the empty string, inclusive.
  171. #[prost(oneof = "value_range::StartValue", tags = "1, 2")]
  172. pub start_value: ::core::option::Option<value_range::StartValue>,
  173. /// The value at which to end the range.
  174. /// If neither field is set, interpreted as the infinite string, exclusive.
  175. #[prost(oneof = "value_range::EndValue", tags = "3, 4")]
  176. pub end_value: ::core::option::Option<value_range::EndValue>,
  177. }
  178. /// Nested message and enum types in `ValueRange`.
  179. pub mod value_range {
  180. /// The value at which to start the range.
  181. /// If neither field is set, interpreted as the empty string, inclusive.
  182. #[derive(Clone, PartialEq, ::prost::Oneof)]
  183. pub enum StartValue {
  184. /// Used when giving an inclusive lower bound for the range.
  185. #[prost(bytes, tag = "1")]
  186. StartValueClosed(::prost::alloc::vec::Vec<u8>),
  187. /// Used when giving an exclusive lower bound for the range.
  188. #[prost(bytes, tag = "2")]
  189. StartValueOpen(::prost::alloc::vec::Vec<u8>),
  190. }
  191. /// The value at which to end the range.
  192. /// If neither field is set, interpreted as the infinite string, exclusive.
  193. #[derive(Clone, PartialEq, ::prost::Oneof)]
  194. pub enum EndValue {
  195. /// Used when giving an inclusive upper bound for the range.
  196. #[prost(bytes, tag = "3")]
  197. EndValueClosed(::prost::alloc::vec::Vec<u8>),
  198. /// Used when giving an exclusive upper bound for the range.
  199. #[prost(bytes, tag = "4")]
  200. EndValueOpen(::prost::alloc::vec::Vec<u8>),
  201. }
  202. }
  203. /// Takes a row as input and produces an alternate view of the row based on
  204. /// specified rules. For example, a RowFilter might trim down a row to include
  205. /// just the cells from columns matching a given regular expression, or might
  206. /// return all the cells of a row but not their values. More complicated filters
  207. /// can be composed out of these components to express requests such as, "within
  208. /// every column of a particular family, give just the two most recent cells
  209. /// which are older than timestamp X."
  210. ///
  211. /// There are two broad categories of RowFilters (true filters and transformers),
  212. /// as well as two ways to compose simple filters into more complex ones
  213. /// (chains and interleaves). They work as follows:
  214. ///
  215. /// * True filters alter the input row by excluding some of its cells wholesale
  216. /// from the output row. An example of a true filter is the `value_regex_filter`,
  217. /// which excludes cells whose values don't match the specified pattern. All
  218. /// regex true filters use RE2 syntax (<https://github.com/google/re2/wiki/Syntax>)
  219. /// in raw byte mode (RE2::Latin1), and are evaluated as full matches. An
  220. /// important point to keep in mind is that `RE2(.)` is equivalent by default to
  221. /// `RE2(\[^\n\])`, meaning that it does not match newlines. When attempting to
  222. /// match an arbitrary byte, you should therefore use the escape sequence `\C`,
  223. /// which may need to be further escaped as `\\C` in your client language.
  224. ///
  225. /// * Transformers alter the input row by changing the values of some of its
  226. /// cells in the output, without excluding them completely. Currently, the only
  227. /// supported transformer is the `strip_value_transformer`, which replaces every
  228. /// cell's value with the empty string.
  229. ///
  230. /// * Chains and interleaves are described in more detail in the
  231. /// RowFilter.Chain and RowFilter.Interleave documentation.
  232. ///
  233. /// The total serialized size of a RowFilter message must not
  234. /// exceed 20480 bytes, and RowFilters may not be nested within each other
  235. /// (in Chains or Interleaves) to a depth of more than 20.
  236. #[derive(Clone, PartialEq, ::prost::Message)]
  237. pub struct RowFilter {
  238. /// Which of the possible RowFilter types to apply. If none are set, this
  239. /// RowFilter returns all cells in the input row.
  240. #[prost(
  241. oneof = "row_filter::Filter",
  242. tags = "1, 2, 3, 16, 17, 18, 4, 14, 5, 6, 7, 8, 9, 15, 10, 11, 12, 13, 19"
  243. )]
  244. pub filter: ::core::option::Option<row_filter::Filter>,
  245. }
  246. /// Nested message and enum types in `RowFilter`.
  247. pub mod row_filter {
  248. /// A RowFilter which sends rows through several RowFilters in sequence.
  249. #[derive(Clone, PartialEq, ::prost::Message)]
  250. pub struct Chain {
  251. /// The elements of "filters" are chained together to process the input row:
  252. /// in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row
  253. /// The full chain is executed atomically.
  254. #[prost(message, repeated, tag = "1")]
  255. pub filters: ::prost::alloc::vec::Vec<super::RowFilter>,
  256. }
  257. /// A RowFilter which sends each row to each of several component
  258. /// RowFilters and interleaves the results.
  259. #[derive(Clone, PartialEq, ::prost::Message)]
  260. pub struct Interleave {
  261. /// The elements of "filters" all process a copy of the input row, and the
  262. /// results are pooled, sorted, and combined into a single output row.
  263. /// If multiple cells are produced with the same column and timestamp,
  264. /// they will all appear in the output row in an unspecified mutual order.
  265. /// Consider the following example, with three filters:
  266. ///```ignore
  267. /// input row
  268. /// |
  269. /// -----------------------------------------------------
  270. /// | | |
  271. /// f(0) f(1) f(2)
  272. /// | | |
  273. /// 1: foo,bar,10,x foo,bar,10,z far,bar,7,a
  274. /// 2: foo,blah,11,z far,blah,5,x far,blah,5,x
  275. /// | | |
  276. /// -----------------------------------------------------
  277. /// |
  278. /// 1: foo,bar,10,z // could have switched with #2
  279. /// 2: foo,bar,10,x // could have switched with #1
  280. /// 3: foo,blah,11,z
  281. /// 4: far,bar,7,a
  282. /// 5: far,blah,5,x // identical to #6
  283. /// 6: far,blah,5,x // identical to #5
  284. ///
  285. /// All interleaved filters are executed atomically.
  286. #[prost(message, repeated, tag = "1")]
  287. pub filters: ::prost::alloc::vec::Vec<super::RowFilter>,
  288. }
  289. /// A RowFilter which evaluates one of two possible RowFilters, depending on
  290. /// whether or not a predicate RowFilter outputs any cells from the input row.
  291. ///
  292. /// IMPORTANT NOTE: The predicate filter does not execute atomically with the
  293. /// true and false filters, which may lead to inconsistent or unexpected
  294. /// results. Additionally, Condition filters have poor performance, especially
  295. /// when filters are set for the false condition.
  296. #[derive(Clone, PartialEq, ::prost::Message)]
  297. pub struct Condition {
  298. /// If `predicate_filter` outputs any cells, then `true_filter` will be
  299. /// evaluated on the input row. Otherwise, `false_filter` will be evaluated.
  300. #[prost(message, optional, boxed, tag = "1")]
  301. pub predicate_filter: ::core::option::Option<
  302. ::prost::alloc::boxed::Box<super::RowFilter>,
  303. >,
  304. /// The filter to apply to the input row if `predicate_filter` returns any
  305. /// results. If not provided, no results will be returned in the true case.
  306. #[prost(message, optional, boxed, tag = "2")]
  307. pub true_filter: ::core::option::Option<
  308. ::prost::alloc::boxed::Box<super::RowFilter>,
  309. >,
  310. /// The filter to apply to the input row if `predicate_filter` does not
  311. /// return any results. If not provided, no results will be returned in the
  312. /// false case.
  313. #[prost(message, optional, boxed, tag = "3")]
  314. pub false_filter: ::core::option::Option<
  315. ::prost::alloc::boxed::Box<super::RowFilter>,
  316. >,
  317. }
  318. /// Which of the possible RowFilter types to apply. If none are set, this
  319. /// RowFilter returns all cells in the input row.
  320. #[derive(Clone, PartialEq, ::prost::Oneof)]
  321. pub enum Filter {
  322. /// Applies several RowFilters to the data in sequence, progressively
  323. /// narrowing the results.
  324. #[prost(message, tag = "1")]
  325. Chain(Chain),
  326. /// Applies several RowFilters to the data in parallel and combines the
  327. /// results.
  328. #[prost(message, tag = "2")]
  329. Interleave(Interleave),
  330. /// Applies one of two possible RowFilters to the data based on the output of
  331. /// a predicate RowFilter.
  332. #[prost(message, tag = "3")]
  333. Condition(::prost::alloc::boxed::Box<Condition>),
  334. /// ADVANCED USE ONLY.
  335. /// Hook for introspection into the RowFilter. Outputs all cells directly to
  336. /// the output of the read rather than to any parent filter. Consider the
  337. /// following example:
  338. ///```ignore
  339. /// Chain(
  340. /// FamilyRegex("A"),
  341. /// Interleave(
  342. /// All(),
  343. /// Chain(Label("foo"), Sink())
  344. /// ),
  345. /// QualifierRegex("B")
  346. /// )
  347. ///
  348. /// A,A,1,w
  349. /// A,B,2,x
  350. /// B,B,4,z
  351. /// |
  352. /// FamilyRegex("A")
  353. /// |
  354. /// A,A,1,w
  355. /// A,B,2,x
  356. /// |
  357. /// +------------+-------------+
  358. /// | |
  359. /// All() Label(foo)
  360. /// | |
  361. /// A,A,1,w A,A,1,w,labels:\[foo\]
  362. /// A,B,2,x A,B,2,x,labels:\[foo\]
  363. /// | |
  364. /// | Sink() --------------+
  365. /// | | |
  366. /// +------------+ x------+ A,A,1,w,labels:\[foo\]
  367. /// | A,B,2,x,labels:\[foo\]
  368. /// A,A,1,w |
  369. /// A,B,2,x |
  370. /// | |
  371. /// QualifierRegex("B") |
  372. /// | |
  373. /// A,B,2,x |
  374. /// | |
  375. /// +--------------------------------+
  376. /// |
  377. /// A,A,1,w,labels:\[foo\]
  378. /// A,B,2,x,labels:\[foo\] // could be switched
  379. /// A,B,2,x // could be switched
  380. ///
  381. /// Despite being excluded by the qualifier filter, a copy of every cell
  382. /// that reaches the sink is present in the final result.
  383. ///
  384. /// As with an \[Interleave][google.bigtable.v2.RowFilter.Interleave\],
  385. /// duplicate cells are possible, and appear in an unspecified mutual order.
  386. /// In this case we have a duplicate with column "A:B" and timestamp 2,
  387. /// because one copy passed through the all filter while the other was
  388. /// passed through the label and sink. Note that one copy has label "foo",
  389. /// while the other does not.
  390. ///
  391. /// Cannot be used within the `predicate_filter`, `true_filter`, or
  392. /// `false_filter` of a \[Condition][google.bigtable.v2.RowFilter.Condition\].
  393. #[prost(bool, tag = "16")]
  394. Sink(bool),
  395. /// Matches all cells, regardless of input. Functionally equivalent to
  396. /// leaving `filter` unset, but included for completeness.
  397. #[prost(bool, tag = "17")]
  398. PassAllFilter(bool),
  399. /// Does not match any cells, regardless of input. Useful for temporarily
  400. /// disabling just part of a filter.
  401. #[prost(bool, tag = "18")]
  402. BlockAllFilter(bool),
  403. /// Matches only cells from rows whose keys satisfy the given RE2 regex. In
  404. /// other words, passes through the entire row when the key matches, and
  405. /// otherwise produces an empty row.
  406. /// Note that, since row keys can contain arbitrary bytes, the `\C` escape
  407. /// sequence must be used if a true wildcard is desired. The `.` character
  408. /// will not match the new line character `\n`, which may be present in a
  409. /// binary key.
  410. #[prost(bytes, tag = "4")]
  411. RowKeyRegexFilter(::prost::alloc::vec::Vec<u8>),
  412. /// Matches all cells from a row with probability p, and matches no cells
  413. /// from the row with probability 1-p.
  414. #[prost(double, tag = "14")]
  415. RowSampleFilter(f64),
  416. /// Matches only cells from columns whose families satisfy the given RE2
  417. /// regex. For technical reasons, the regex must not contain the `:`
  418. /// character, even if it is not being used as a literal.
  419. /// Note that, since column families cannot contain the new line character
  420. /// `\n`, it is sufficient to use `.` as a full wildcard when matching
  421. /// column family names.
  422. #[prost(string, tag = "5")]
  423. FamilyNameRegexFilter(::prost::alloc::string::String),
  424. /// Matches only cells from columns whose qualifiers satisfy the given RE2
  425. /// regex.
  426. /// Note that, since column qualifiers can contain arbitrary bytes, the `\C`
  427. /// escape sequence must be used if a true wildcard is desired. The `.`
  428. /// character will not match the new line character `\n`, which may be
  429. /// present in a binary qualifier.
  430. #[prost(bytes, tag = "6")]
  431. ColumnQualifierRegexFilter(::prost::alloc::vec::Vec<u8>),
  432. /// Matches only cells from columns within the given range.
  433. #[prost(message, tag = "7")]
  434. ColumnRangeFilter(super::ColumnRange),
  435. /// Matches only cells with timestamps within the given range.
  436. #[prost(message, tag = "8")]
  437. TimestampRangeFilter(super::TimestampRange),
  438. /// Matches only cells with values that satisfy the given regular expression.
  439. /// Note that, since cell values can contain arbitrary bytes, the `\C` escape
  440. /// sequence must be used if a true wildcard is desired. The `.` character
  441. /// will not match the new line character `\n`, which may be present in a
  442. /// binary value.
  443. #[prost(bytes, tag = "9")]
  444. ValueRegexFilter(::prost::alloc::vec::Vec<u8>),
  445. /// Matches only cells with values that fall within the given range.
  446. #[prost(message, tag = "15")]
  447. ValueRangeFilter(super::ValueRange),
  448. /// Skips the first N cells of each row, matching all subsequent cells.
  449. /// If duplicate cells are present, as is possible when using an Interleave,
  450. /// each copy of the cell is counted separately.
  451. #[prost(int32, tag = "10")]
  452. CellsPerRowOffsetFilter(i32),
  453. /// Matches only the first N cells of each row.
  454. /// If duplicate cells are present, as is possible when using an Interleave,
  455. /// each copy of the cell is counted separately.
  456. #[prost(int32, tag = "11")]
  457. CellsPerRowLimitFilter(i32),
  458. /// Matches only the most recent N cells within each column. For example,
  459. /// if N=2, this filter would match column `foo:bar` at timestamps 10 and 9,
  460. /// skip all earlier cells in `foo:bar`, and then begin matching again in
  461. /// column `foo:bar2`.
  462. /// If duplicate cells are present, as is possible when using an Interleave,
  463. /// each copy of the cell is counted separately.
  464. #[prost(int32, tag = "12")]
  465. CellsPerColumnLimitFilter(i32),
  466. /// Replaces each cell's value with the empty string.
  467. #[prost(bool, tag = "13")]
  468. StripValueTransformer(bool),
  469. /// Applies the given label to all cells in the output row. This allows
  470. /// the client to determine which results were produced from which part of
  471. /// the filter.
  472. ///
  473. /// Values must be at most 15 characters in length, and match the RE2
  474. /// pattern `\[a-z0-9\\-\]+`
  475. ///
  476. /// Due to a technical limitation, it is not currently possible to apply
  477. /// multiple labels to a cell. As a result, a Chain may have no more than
  478. /// one sub-filter which contains a `apply_label_transformer`. It is okay for
  479. /// an Interleave to contain multiple `apply_label_transformers`, as they
  480. /// will be applied to separate copies of the input. This may be relaxed in
  481. /// the future.
  482. #[prost(string, tag = "19")]
  483. ApplyLabelTransformer(::prost::alloc::string::String),
  484. }
  485. }
  486. /// Specifies a particular change to be made to the contents of a row.
  487. #[derive(Clone, PartialEq, ::prost::Message)]
  488. pub struct Mutation {
  489. /// Which of the possible Mutation types to apply.
  490. #[prost(oneof = "mutation::Mutation", tags = "1, 2, 3, 4")]
  491. pub mutation: ::core::option::Option<mutation::Mutation>,
  492. }
  493. /// Nested message and enum types in `Mutation`.
  494. pub mod mutation {
  495. /// A Mutation which sets the value of the specified cell.
  496. #[derive(Clone, PartialEq, ::prost::Message)]
  497. pub struct SetCell {
  498. /// The name of the family into which new data should be written.
  499. /// Must match `\[-_.a-zA-Z0-9\]+`
  500. #[prost(string, tag = "1")]
  501. pub family_name: ::prost::alloc::string::String,
  502. /// The qualifier of the column into which new data should be written.
  503. /// Can be any byte string, including the empty string.
  504. #[prost(bytes = "vec", tag = "2")]
  505. pub column_qualifier: ::prost::alloc::vec::Vec<u8>,
  506. /// The timestamp of the cell into which new data should be written.
  507. /// Use -1 for current Bigtable server time.
  508. /// Otherwise, the client should set this value itself, noting that the
  509. /// default value is a timestamp of zero if the field is left unspecified.
  510. /// Values must match the granularity of the table (e.g. micros, millis).
  511. #[prost(int64, tag = "3")]
  512. pub timestamp_micros: i64,
  513. /// The value to be written into the specified cell.
  514. #[prost(bytes = "vec", tag = "4")]
  515. pub value: ::prost::alloc::vec::Vec<u8>,
  516. }
  517. /// A Mutation which deletes cells from the specified column, optionally
  518. /// restricting the deletions to a given timestamp range.
  519. #[derive(Clone, PartialEq, ::prost::Message)]
  520. pub struct DeleteFromColumn {
  521. /// The name of the family from which cells should be deleted.
  522. /// Must match `\[-_.a-zA-Z0-9\]+`
  523. #[prost(string, tag = "1")]
  524. pub family_name: ::prost::alloc::string::String,
  525. /// The qualifier of the column from which cells should be deleted.
  526. /// Can be any byte string, including the empty string.
  527. #[prost(bytes = "vec", tag = "2")]
  528. pub column_qualifier: ::prost::alloc::vec::Vec<u8>,
  529. /// The range of timestamps within which cells should be deleted.
  530. #[prost(message, optional, tag = "3")]
  531. pub time_range: ::core::option::Option<super::TimestampRange>,
  532. }
  533. /// A Mutation which deletes all cells from the specified column family.
  534. #[derive(Clone, PartialEq, ::prost::Message)]
  535. pub struct DeleteFromFamily {
  536. /// The name of the family from which cells should be deleted.
  537. /// Must match `\[-_.a-zA-Z0-9\]+`
  538. #[prost(string, tag = "1")]
  539. pub family_name: ::prost::alloc::string::String,
  540. }
  541. /// A Mutation which deletes all cells from the containing row.
  542. #[derive(Clone, PartialEq, ::prost::Message)]
  543. pub struct DeleteFromRow {}
  544. /// Which of the possible Mutation types to apply.
  545. #[derive(Clone, PartialEq, ::prost::Oneof)]
  546. pub enum Mutation {
  547. /// Set a cell's value.
  548. #[prost(message, tag = "1")]
  549. SetCell(SetCell),
  550. /// Deletes cells from a column.
  551. #[prost(message, tag = "2")]
  552. DeleteFromColumn(DeleteFromColumn),
  553. /// Deletes cells from a column family.
  554. #[prost(message, tag = "3")]
  555. DeleteFromFamily(DeleteFromFamily),
  556. /// Deletes cells from the entire row.
  557. #[prost(message, tag = "4")]
  558. DeleteFromRow(DeleteFromRow),
  559. }
  560. }
  561. /// Specifies an atomic read/modify/write operation on the latest value of the
  562. /// specified column.
  563. #[derive(Clone, PartialEq, ::prost::Message)]
  564. pub struct ReadModifyWriteRule {
  565. /// The name of the family to which the read/modify/write should be applied.
  566. /// Must match `\[-_.a-zA-Z0-9\]+`
  567. #[prost(string, tag = "1")]
  568. pub family_name: ::prost::alloc::string::String,
  569. /// The qualifier of the column to which the read/modify/write should be
  570. /// applied.
  571. /// Can be any byte string, including the empty string.
  572. #[prost(bytes = "vec", tag = "2")]
  573. pub column_qualifier: ::prost::alloc::vec::Vec<u8>,
  574. /// The rule used to determine the column's new latest value from its current
  575. /// latest value.
  576. #[prost(oneof = "read_modify_write_rule::Rule", tags = "3, 4")]
  577. pub rule: ::core::option::Option<read_modify_write_rule::Rule>,
  578. }
  579. /// Nested message and enum types in `ReadModifyWriteRule`.
  580. pub mod read_modify_write_rule {
  581. /// The rule used to determine the column's new latest value from its current
  582. /// latest value.
  583. #[derive(Clone, PartialEq, ::prost::Oneof)]
  584. pub enum Rule {
  585. /// Rule specifying that `append_value` be appended to the existing value.
  586. /// If the targeted cell is unset, it will be treated as containing the
  587. /// empty string.
  588. #[prost(bytes, tag = "3")]
  589. AppendValue(::prost::alloc::vec::Vec<u8>),
  590. /// Rule specifying that `increment_amount` be added to the existing value.
  591. /// If the targeted cell is unset, it will be treated as containing a zero.
  592. /// Otherwise, the targeted cell must contain an 8-byte value (interpreted
  593. /// as a 64-bit big-endian signed integer), or the entire request will fail.
  594. #[prost(int64, tag = "4")]
  595. IncrementAmount(i64),
  596. }
  597. }
  598. /// NOTE: This API is intended to be used by Apache Beam BigtableIO.
  599. /// A partition of a change stream.
  600. #[derive(Clone, PartialEq, ::prost::Message)]
  601. pub struct StreamPartition {
  602. /// The row range covered by this partition and is specified by
  603. /// [`start_key_closed`, `end_key_open`).
  604. #[prost(message, optional, tag = "1")]
  605. pub row_range: ::core::option::Option<RowRange>,
  606. }
  607. /// NOTE: This API is intended to be used by Apache Beam BigtableIO.
  608. /// The information required to continue reading the data from multiple
  609. /// `StreamPartitions` from where a previous read left off.
  610. #[derive(Clone, PartialEq, ::prost::Message)]
  611. pub struct StreamContinuationTokens {
  612. /// List of continuation tokens.
  613. #[prost(message, repeated, tag = "1")]
  614. pub tokens: ::prost::alloc::vec::Vec<StreamContinuationToken>,
  615. }
  616. /// NOTE: This API is intended to be used by Apache Beam BigtableIO.
  617. /// The information required to continue reading the data from a
  618. /// `StreamPartition` from where a previous read left off.
  619. #[derive(Clone, PartialEq, ::prost::Message)]
  620. pub struct StreamContinuationToken {
  621. /// The partition that this token applies to.
  622. #[prost(message, optional, tag = "1")]
  623. pub partition: ::core::option::Option<StreamPartition>,
  624. /// An encoded position in the stream to restart reading from.
  625. #[prost(string, tag = "2")]
  626. pub token: ::prost::alloc::string::String,
  627. }
  628. /// ReadIterationStats captures information about the iteration of rows or cells
  629. /// over the course of a read, e.g. how many results were scanned in a read
  630. /// operation versus the results returned.
  631. #[derive(Clone, PartialEq, ::prost::Message)]
  632. pub struct ReadIterationStats {
  633. /// The rows seen (scanned) as part of the request. This includes the count of
  634. /// rows returned, as captured below.
  635. #[prost(int64, tag = "1")]
  636. pub rows_seen_count: i64,
  637. /// The rows returned as part of the request.
  638. #[prost(int64, tag = "2")]
  639. pub rows_returned_count: i64,
  640. /// The cells seen (scanned) as part of the request. This includes the count of
  641. /// cells returned, as captured below.
  642. #[prost(int64, tag = "3")]
  643. pub cells_seen_count: i64,
  644. /// The cells returned as part of the request.
  645. #[prost(int64, tag = "4")]
  646. pub cells_returned_count: i64,
  647. }
  648. /// RequestLatencyStats provides a measurement of the latency of the request as
  649. /// it interacts with different systems over its lifetime, e.g. how long the
  650. /// request took to execute within a frontend server.
  651. #[derive(Clone, PartialEq, ::prost::Message)]
  652. pub struct RequestLatencyStats {
  653. /// The latency measured by the frontend server handling this request, from
  654. /// when the request was received, to when this value is sent back in the
  655. /// response. For more context on the component that is measuring this latency,
  656. /// see: <https://cloud.google.com/bigtable/docs/overview>
  657. ///
  658. /// Note: This value may be slightly shorter than the value reported into
  659. /// aggregate latency metrics in Monitoring for this request
  660. /// (<https://cloud.google.com/bigtable/docs/monitoring-instance>) as this value
  661. /// needs to be sent in the response before the latency measurement including
  662. /// that transmission is finalized.
  663. ///
  664. /// Note: This value includes the end-to-end latency of contacting nodes in
  665. /// the targeted cluster, e.g. measuring from when the first byte arrives at
  666. /// the frontend server, to when this value is sent back as the last value in
  667. /// the response, including any latency incurred by contacting nodes, waiting
  668. /// for results from nodes, and finally sending results from nodes back to the
  669. /// caller.
  670. #[prost(message, optional, tag = "1")]
  671. pub frontend_server_latency: ::core::option::Option<::prost_types::Duration>,
  672. }
  673. /// FullReadStatsView captures all known information about a read.
  674. #[derive(Clone, PartialEq, ::prost::Message)]
  675. pub struct FullReadStatsView {
  676. /// Iteration stats describe how efficient the read is, e.g. comparing
  677. /// rows seen vs. rows returned or cells seen vs cells returned can provide an
  678. /// indication of read efficiency (the higher the ratio of seen to retuned the
  679. /// better).
  680. #[prost(message, optional, tag = "1")]
  681. pub read_iteration_stats: ::core::option::Option<ReadIterationStats>,
  682. /// Request latency stats describe the time taken to complete a request, from
  683. /// the server side.
  684. #[prost(message, optional, tag = "2")]
  685. pub request_latency_stats: ::core::option::Option<RequestLatencyStats>,
  686. }
  687. /// RequestStats is the container for additional information pertaining to a
  688. /// single request, helpful for evaluating the performance of the sent request.
  689. /// Currently, there are the following supported methods:
  690. /// * google.bigtable.v2.ReadRows
  691. #[derive(Clone, PartialEq, ::prost::Message)]
  692. pub struct RequestStats {
  693. /// Information pertaining to each request type received. The type is chosen
  694. /// based on the requested view.
  695. ///
  696. /// See the messages above for additional context.
  697. #[prost(oneof = "request_stats::StatsView", tags = "1")]
  698. pub stats_view: ::core::option::Option<request_stats::StatsView>,
  699. }
  700. /// Nested message and enum types in `RequestStats`.
  701. pub mod request_stats {
  702. /// Information pertaining to each request type received. The type is chosen
  703. /// based on the requested view.
  704. ///
  705. /// See the messages above for additional context.
  706. #[derive(Clone, PartialEq, ::prost::Oneof)]
  707. pub enum StatsView {
  708. /// Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
  709. /// view, see package google.bigtable.v2.
  710. #[prost(message, tag = "1")]
  711. FullReadStatsView(super::FullReadStatsView),
  712. }
  713. }
  714. /// Request message for Bigtable.ReadRows.
  715. #[derive(Clone, PartialEq, ::prost::Message)]
  716. pub struct ReadRowsRequest {
  717. /// Required. The unique name of the table from which to read.
  718. /// Values are of the form
  719. /// `projects/<project>/instances/<instance>/tables/<table>`.
  720. #[prost(string, tag = "1")]
  721. pub table_name: ::prost::alloc::string::String,
  722. /// This value specifies routing for replication. If not specified, the
  723. /// "default" application profile will be used.
  724. #[prost(string, tag = "5")]
  725. pub app_profile_id: ::prost::alloc::string::String,
  726. /// The row keys and/or ranges to read sequentially. If not specified, reads
  727. /// from all rows.
  728. #[prost(message, optional, tag = "2")]
  729. pub rows: ::core::option::Option<RowSet>,
  730. /// The filter to apply to the contents of the specified row(s). If unset,
  731. /// reads the entirety of each row.
  732. #[prost(message, optional, tag = "3")]
  733. pub filter: ::core::option::Option<RowFilter>,
  734. /// The read will stop after committing to N rows' worth of results. The
  735. /// default (zero) is to return all results.
  736. #[prost(int64, tag = "4")]
  737. pub rows_limit: i64,
  738. /// The view into RequestStats, as described above.
  739. #[prost(enumeration = "read_rows_request::RequestStatsView", tag = "6")]
  740. pub request_stats_view: i32,
  741. /// Experimental API - Please note that this API is currently experimental
  742. /// and can change in the future.
  743. ///
  744. /// Return rows in lexiographical descending order of the row keys. The row
  745. /// contents will not be affected by this flag.
  746. ///
  747. /// Example result set:
  748. ///```ignore
  749. /// [
  750. /// {key: "k2", "f:col1": "v1", "f:col2": "v1"},
  751. /// {key: "k1", "f:col1": "v2", "f:col2": "v2"}
  752. /// ]
  753. #[prost(bool, tag = "7")]
  754. pub reversed: bool,
  755. }
  756. /// Nested message and enum types in `ReadRowsRequest`.
  757. pub mod read_rows_request {
  758. /// The desired view into RequestStats that should be returned in the response.
  759. ///
  760. /// See also: RequestStats message.
  761. #[derive(
  762. Clone,
  763. Copy,
  764. Debug,
  765. PartialEq,
  766. Eq,
  767. Hash,
  768. PartialOrd,
  769. Ord,
  770. ::prost::Enumeration
  771. )]
  772. #[repr(i32)]
  773. pub enum RequestStatsView {
  774. /// The default / unset value. The API will default to the NONE option below.
  775. Unspecified = 0,
  776. /// Do not include any RequestStats in the response. This will leave the
  777. /// RequestStats embedded message unset in the response.
  778. RequestStatsNone = 1,
  779. /// Include the full set of available RequestStats in the response,
  780. /// applicable to this read.
  781. RequestStatsFull = 2,
  782. }
  783. impl RequestStatsView {
  784. /// String value of the enum field names used in the ProtoBuf definition.
  785. ///
  786. /// The values are not transformed in any way and thus are considered stable
  787. /// (if the ProtoBuf definition does not change) and safe for programmatic use.
  788. pub fn as_str_name(&self) -> &'static str {
  789. match self {
  790. RequestStatsView::Unspecified => "REQUEST_STATS_VIEW_UNSPECIFIED",
  791. RequestStatsView::RequestStatsNone => "REQUEST_STATS_NONE",
  792. RequestStatsView::RequestStatsFull => "REQUEST_STATS_FULL",
  793. }
  794. }
  795. /// Creates an enum from field names used in the ProtoBuf definition.
  796. pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
  797. match value {
  798. "REQUEST_STATS_VIEW_UNSPECIFIED" => Some(Self::Unspecified),
  799. "REQUEST_STATS_NONE" => Some(Self::RequestStatsNone),
  800. "REQUEST_STATS_FULL" => Some(Self::RequestStatsFull),
  801. _ => None,
  802. }
  803. }
  804. }
  805. }
  806. /// Response message for Bigtable.ReadRows.
  807. #[derive(Clone, PartialEq, ::prost::Message)]
  808. pub struct ReadRowsResponse {
  809. /// A collection of a row's contents as part of the read request.
  810. #[prost(message, repeated, tag = "1")]
  811. pub chunks: ::prost::alloc::vec::Vec<read_rows_response::CellChunk>,
  812. /// Optionally the server might return the row key of the last row it
  813. /// has scanned. The client can use this to construct a more
  814. /// efficient retry request if needed: any row keys or portions of
  815. /// ranges less than this row key can be dropped from the request.
  816. /// This is primarily useful for cases where the server has read a
  817. /// lot of data that was filtered out since the last committed row
  818. /// key, allowing the client to skip that work on a retry.
  819. #[prost(bytes = "vec", tag = "2")]
  820. pub last_scanned_row_key: ::prost::alloc::vec::Vec<u8>,
  821. ///
  822. /// If requested, provide enhanced query performance statistics. The semantics
  823. /// dictate:
  824. /// * request_stats is empty on every (streamed) response, except
  825. /// * request_stats has non-empty information after all chunks have been
  826. /// streamed, where the ReadRowsResponse message only contains
  827. /// request_stats.
  828. /// * For example, if a read request would have returned an empty
  829. /// response instead a single ReadRowsResponse is streamed with empty
  830. /// chunks and request_stats filled.
  831. ///
  832. /// Visually, response messages will stream as follows:
  833. /// ... -> {chunks: \[...\]} -> {chunks: [], request_stats: {...}}
  834. /// \______________________/ \________________________________/
  835. /// Primary response Trailer of RequestStats info
  836. ///
  837. /// Or if the read did not return any values:
  838. /// {chunks: [], request_stats: {...}}
  839. /// \________________________________/
  840. /// Trailer of RequestStats info
  841. #[prost(message, optional, tag = "3")]
  842. pub request_stats: ::core::option::Option<RequestStats>,
  843. }
  844. /// Nested message and enum types in `ReadRowsResponse`.
  845. pub mod read_rows_response {
  846. /// Specifies a piece of a row's contents returned as part of the read
  847. /// response stream.
  848. #[derive(Clone, PartialEq, ::prost::Message)]
  849. pub struct CellChunk {
  850. /// The row key for this chunk of data. If the row key is empty,
  851. /// this CellChunk is a continuation of the same row as the previous
  852. /// CellChunk in the response stream, even if that CellChunk was in a
  853. /// previous ReadRowsResponse message.
  854. #[prost(bytes = "vec", tag = "1")]
  855. pub row_key: ::prost::alloc::vec::Vec<u8>,
  856. /// The column family name for this chunk of data. If this message
  857. /// is not present this CellChunk is a continuation of the same column
  858. /// family as the previous CellChunk. The empty string can occur as a
  859. /// column family name in a response so clients must check
  860. /// explicitly for the presence of this message, not just for
  861. /// `family_name.value` being non-empty.
  862. #[prost(message, optional, tag = "2")]
  863. pub family_name: ::core::option::Option<::prost::alloc::string::String>,
  864. /// The column qualifier for this chunk of data. If this message
  865. /// is not present, this CellChunk is a continuation of the same column
  866. /// as the previous CellChunk. Column qualifiers may be empty so
  867. /// clients must check for the presence of this message, not just
  868. /// for `qualifier.value` being non-empty.
  869. #[prost(message, optional, tag = "3")]
  870. pub qualifier: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
  871. /// The cell's stored timestamp, which also uniquely identifies it
  872. /// within its column. Values are always expressed in
  873. /// microseconds, but individual tables may set a coarser
  874. /// granularity to further restrict the allowed values. For
  875. /// example, a table which specifies millisecond granularity will
  876. /// only allow values of `timestamp_micros` which are multiples of
  877. /// 1000. Timestamps are only set in the first CellChunk per cell
  878. /// (for cells split into multiple chunks).
  879. #[prost(int64, tag = "4")]
  880. pub timestamp_micros: i64,
  881. /// Labels applied to the cell by a
  882. /// \[RowFilter][google.bigtable.v2.RowFilter\]. Labels are only set
  883. /// on the first CellChunk per cell.
  884. #[prost(string, repeated, tag = "5")]
  885. pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
  886. /// The value stored in the cell. Cell values can be split across
  887. /// multiple CellChunks. In that case only the value field will be
  888. /// set in CellChunks after the first: the timestamp and labels
  889. /// will only be present in the first CellChunk, even if the first
  890. /// CellChunk came in a previous ReadRowsResponse.
  891. #[prost(bytes = "vec", tag = "6")]
  892. pub value: ::prost::alloc::vec::Vec<u8>,
  893. /// If this CellChunk is part of a chunked cell value and this is
  894. /// not the final chunk of that cell, value_size will be set to the
  895. /// total length of the cell value. The client can use this size
  896. /// to pre-allocate memory to hold the full cell value.
  897. #[prost(int32, tag = "7")]
  898. pub value_size: i32,
  899. /// Signals to the client concerning previous CellChunks received.
  900. #[prost(oneof = "cell_chunk::RowStatus", tags = "8, 9")]
  901. pub row_status: ::core::option::Option<cell_chunk::RowStatus>,
  902. }
  903. /// Nested message and enum types in `CellChunk`.
  904. pub mod cell_chunk {
  905. /// Signals to the client concerning previous CellChunks received.
  906. #[derive(Clone, PartialEq, ::prost::Oneof)]
  907. pub enum RowStatus {
  908. /// Indicates that the client should drop all previous chunks for
  909. /// `row_key`, as it will be re-read from the beginning.
  910. #[prost(bool, tag = "8")]
  911. ResetRow(bool),
  912. /// Indicates that the client can safely process all previous chunks for
  913. /// `row_key`, as its data has been fully read.
  914. #[prost(bool, tag = "9")]
  915. CommitRow(bool),
  916. }
  917. }
  918. }
  919. /// Request message for Bigtable.SampleRowKeys.
  920. #[derive(Clone, PartialEq, ::prost::Message)]
  921. pub struct SampleRowKeysRequest {
  922. /// Required. The unique name of the table from which to sample row keys.
  923. /// Values are of the form
  924. /// `projects/<project>/instances/<instance>/tables/<table>`.
  925. #[prost(string, tag = "1")]
  926. pub table_name: ::prost::alloc::string::String,
  927. /// This value specifies routing for replication. If not specified, the
  928. /// "default" application profile will be used.
  929. #[prost(string, tag = "2")]
  930. pub app_profile_id: ::prost::alloc::string::String,
  931. }
  932. /// Response message for Bigtable.SampleRowKeys.
  933. #[derive(Clone, PartialEq, ::prost::Message)]
  934. pub struct SampleRowKeysResponse {
  935. /// Sorted streamed sequence of sample row keys in the table. The table might
  936. /// have contents before the first row key in the list and after the last one,
  937. /// but a key containing the empty string indicates "end of table" and will be
  938. /// the last response given, if present.
  939. /// Note that row keys in this list may not have ever been written to or read
  940. /// from, and users should therefore not make any assumptions about the row key
  941. /// structure that are specific to their use case.
  942. #[prost(bytes = "vec", tag = "1")]
  943. pub row_key: ::prost::alloc::vec::Vec<u8>,
  944. /// Approximate total storage space used by all rows in the table which precede
  945. /// `row_key`. Buffering the contents of all rows between two subsequent
  946. /// samples would require space roughly equal to the difference in their
  947. /// `offset_bytes` fields.
  948. #[prost(int64, tag = "2")]
  949. pub offset_bytes: i64,
  950. }
  951. /// Request message for Bigtable.MutateRow.
  952. #[derive(Clone, PartialEq, ::prost::Message)]
  953. pub struct MutateRowRequest {
  954. /// Required. The unique name of the table to which the mutation should be
  955. /// applied. Values are of the form
  956. /// `projects/<project>/instances/<instance>/tables/<table>`.
  957. #[prost(string, tag = "1")]
  958. pub table_name: ::prost::alloc::string::String,
  959. /// This value specifies routing for replication. If not specified, the
  960. /// "default" application profile will be used.
  961. #[prost(string, tag = "4")]
  962. pub app_profile_id: ::prost::alloc::string::String,
  963. /// Required. The key of the row to which the mutation should be applied.
  964. #[prost(bytes = "vec", tag = "2")]
  965. pub row_key: ::prost::alloc::vec::Vec<u8>,
  966. /// Required. Changes to be atomically applied to the specified row. Entries
  967. /// are applied in order, meaning that earlier mutations can be masked by later
  968. /// ones. Must contain at least one entry and at most 100000.
  969. #[prost(message, repeated, tag = "3")]
  970. pub mutations: ::prost::alloc::vec::Vec<Mutation>,
  971. }
  972. /// Response message for Bigtable.MutateRow.
  973. #[derive(Clone, PartialEq, ::prost::Message)]
  974. pub struct MutateRowResponse {}
  975. /// Request message for BigtableService.MutateRows.
  976. #[derive(Clone, PartialEq, ::prost::Message)]
  977. pub struct MutateRowsRequest {
  978. /// Required. The unique name of the table to which the mutations should be
  979. /// applied.
  980. #[prost(string, tag = "1")]
  981. pub table_name: ::prost::alloc::string::String,
  982. /// This value specifies routing for replication. If not specified, the
  983. /// "default" application profile will be used.
  984. #[prost(string, tag = "3")]
  985. pub app_profile_id: ::prost::alloc::string::String,
  986. /// Required. The row keys and corresponding mutations to be applied in bulk.
  987. /// Each entry is applied as an atomic mutation, but the entries may be
  988. /// applied in arbitrary order (even between entries for the same row).
  989. /// At least one entry must be specified, and in total the entries can
  990. /// contain at most 100000 mutations.
  991. #[prost(message, repeated, tag = "2")]
  992. pub entries: ::prost::alloc::vec::Vec<mutate_rows_request::Entry>,
  993. }
  994. /// Nested message and enum types in `MutateRowsRequest`.
  995. pub mod mutate_rows_request {
  996. /// A mutation for a given row.
  997. #[derive(Clone, PartialEq, ::prost::Message)]
  998. pub struct Entry {
  999. /// The key of the row to which the `mutations` should be applied.
  1000. #[prost(bytes = "vec", tag = "1")]
  1001. pub row_key: ::prost::alloc::vec::Vec<u8>,
  1002. /// Required. Changes to be atomically applied to the specified row.
  1003. /// Mutations are applied in order, meaning that earlier mutations can be
  1004. /// masked by later ones. You must specify at least one mutation.
  1005. #[prost(message, repeated, tag = "2")]
  1006. pub mutations: ::prost::alloc::vec::Vec<super::Mutation>,
  1007. }
  1008. }
  1009. /// Response message for BigtableService.MutateRows.
  1010. #[derive(Clone, PartialEq, ::prost::Message)]
  1011. pub struct MutateRowsResponse {
  1012. /// One or more results for Entries from the batch request.
  1013. #[prost(message, repeated, tag = "1")]
  1014. pub entries: ::prost::alloc::vec::Vec<mutate_rows_response::Entry>,
  1015. /// Information about how client should limit the rate (QPS). Primirily used by
  1016. /// supported official Cloud Bigtable clients. If unset, the rate limit info is
  1017. /// not provided by the server.
  1018. #[prost(message, optional, tag = "3")]
  1019. pub rate_limit_info: ::core::option::Option<RateLimitInfo>,
  1020. }
  1021. /// Nested message and enum types in `MutateRowsResponse`.
  1022. pub mod mutate_rows_response {
  1023. /// The result of applying a passed mutation in the original request.
  1024. #[derive(Clone, PartialEq, ::prost::Message)]
  1025. pub struct Entry {
  1026. /// The index into the original request's `entries` list of the Entry
  1027. /// for which a result is being reported.
  1028. #[prost(int64, tag = "1")]
  1029. pub index: i64,
  1030. /// The result of the request Entry identified by `index`.
  1031. /// Depending on how requests are batched during execution, it is possible
  1032. /// for one Entry to fail due to an error with another Entry. In the event
  1033. /// that this occurs, the same error will be reported for both entries.
  1034. #[prost(message, optional, tag = "2")]
  1035. pub status: ::core::option::Option<super::super::super::rpc::Status>,
  1036. }
  1037. }
  1038. /// Information about how client should adjust the load to Bigtable.
  1039. #[derive(Clone, PartialEq, ::prost::Message)]
  1040. pub struct RateLimitInfo {
  1041. /// Time that clients should wait before adjusting the target rate again.
  1042. /// If clients adjust rate too frequently, the impact of the previous
  1043. /// adjustment may not have been taken into account and may
  1044. /// over-throttle or under-throttle. If clients adjust rate too slowly, they
  1045. /// will not be responsive to load changes on server side, and may
  1046. /// over-throttle or under-throttle.
  1047. #[prost(message, optional, tag = "1")]
  1048. pub period: ::core::option::Option<::prost_types::Duration>,
  1049. /// If it has been at least one `period` since the last load adjustment, the
  1050. /// client should multiply the current load by this value to get the new target
  1051. /// load. For example, if the current load is 100 and `factor` is 0.8, the new
  1052. /// target load should be 80. After adjusting, the client should ignore
  1053. /// `factor` until another `period` has passed.
  1054. ///
  1055. /// The client can measure its load using any unit that's comparable over time
  1056. /// For example, QPS can be used as long as each request involves a similar
  1057. /// amount of work.
  1058. #[prost(double, tag = "2")]
  1059. pub factor: f64,
  1060. }
  1061. /// Request message for Bigtable.CheckAndMutateRow.
  1062. #[derive(Clone, PartialEq, ::prost::Message)]
  1063. pub struct CheckAndMutateRowRequest {
  1064. /// Required. The unique name of the table to which the conditional mutation
  1065. /// should be applied. Values are of the form
  1066. /// `projects/<project>/instances/<instance>/tables/<table>`.
  1067. #[prost(string, tag = "1")]
  1068. pub table_name: ::prost::alloc::string::String,
  1069. /// This value specifies routing for replication. If not specified, the
  1070. /// "default" application profile will be used.
  1071. #[prost(string, tag = "7")]
  1072. pub app_profile_id: ::prost::alloc::string::String,
  1073. /// Required. The key of the row to which the conditional mutation should be
  1074. /// applied.
  1075. #[prost(bytes = "vec", tag = "2")]
  1076. pub row_key: ::prost::alloc::vec::Vec<u8>,
  1077. /// The filter to be applied to the contents of the specified row. Depending
  1078. /// on whether or not any results are yielded, either `true_mutations` or
  1079. /// `false_mutations` will be executed. If unset, checks that the row contains
  1080. /// any values at all.
  1081. #[prost(message, optional, tag = "6")]
  1082. pub predicate_filter: ::core::option::Option<RowFilter>,
  1083. /// Changes to be atomically applied to the specified row if `predicate_filter`
  1084. /// yields at least one cell when applied to `row_key`. Entries are applied in
  1085. /// order, meaning that earlier mutations can be masked by later ones.
  1086. /// Must contain at least one entry if `false_mutations` is empty, and at most
  1087. /// 100000.
  1088. #[prost(message, repeated, tag = "4")]
  1089. pub true_mutations: ::prost::alloc::vec::Vec<Mutation>,
  1090. /// Changes to be atomically applied to the specified row if `predicate_filter`
  1091. /// does not yield any cells when applied to `row_key`. Entries are applied in
  1092. /// order, meaning that earlier mutations can be masked by later ones.
  1093. /// Must contain at least one entry if `true_mutations` is empty, and at most
  1094. /// 100000.
  1095. #[prost(message, repeated, tag = "5")]
  1096. pub false_mutations: ::prost::alloc::vec::Vec<Mutation>,
  1097. }
  1098. /// Response message for Bigtable.CheckAndMutateRow.
  1099. #[derive(Clone, PartialEq, ::prost::Message)]
  1100. pub struct CheckAndMutateRowResponse {
  1101. /// Whether or not the request's `predicate_filter` yielded any results for
  1102. /// the specified row.
  1103. #[prost(bool, tag = "1")]
  1104. pub predicate_matched: bool,
  1105. }
  1106. /// Request message for client connection keep-alive and warming.
  1107. #[derive(Clone, PartialEq, ::prost::Message)]
  1108. pub struct PingAndWarmRequest {
  1109. /// Required. The unique name of the instance to check permissions for as well
  1110. /// as respond. Values are of the form
  1111. /// `projects/<project>/instances/<instance>`.
  1112. #[prost(string, tag = "1")]
  1113. pub name: ::prost::alloc::string::String,
  1114. /// This value specifies routing for replication. If not specified, the
  1115. /// "default" application profile will be used.
  1116. #[prost(string, tag = "2")]
  1117. pub app_profile_id: ::prost::alloc::string::String,
  1118. }
  1119. /// Response message for Bigtable.PingAndWarm connection keepalive and warming.
  1120. #[derive(Clone, PartialEq, ::prost::Message)]
  1121. pub struct PingAndWarmResponse {}
  1122. /// Request message for Bigtable.ReadModifyWriteRow.
  1123. #[derive(Clone, PartialEq, ::prost::Message)]
  1124. pub struct ReadModifyWriteRowRequest {
  1125. /// Required. The unique name of the table to which the read/modify/write rules
  1126. /// should be applied. Values are of the form
  1127. /// `projects/<project>/instances/<instance>/tables/<table>`.
  1128. #[prost(string, tag = "1")]
  1129. pub table_name: ::prost::alloc::string::String,
  1130. /// This value specifies routing for replication. If not specified, the
  1131. /// "default" application profile will be used.
  1132. #[prost(string, tag = "4")]
  1133. pub app_profile_id: ::prost::alloc::string::String,
  1134. /// Required. The key of the row to which the read/modify/write rules should be
  1135. /// applied.
  1136. #[prost(bytes = "vec", tag = "2")]
  1137. pub row_key: ::prost::alloc::vec::Vec<u8>,
  1138. /// Required. Rules specifying how the specified row's contents are to be
  1139. /// transformed into writes. Entries are applied in order, meaning that earlier
  1140. /// rules will affect the results of later ones.
  1141. #[prost(message, repeated, tag = "3")]
  1142. pub rules: ::prost::alloc::vec::Vec<ReadModifyWriteRule>,
  1143. }
  1144. /// Response message for Bigtable.ReadModifyWriteRow.
  1145. #[derive(Clone, PartialEq, ::prost::Message)]
  1146. pub struct ReadModifyWriteRowResponse {
  1147. /// A Row containing the new contents of all cells modified by the request.
  1148. #[prost(message, optional, tag = "1")]
  1149. pub row: ::core::option::Option<Row>,
  1150. }
  1151. /// NOTE: This API is intended to be used by Apache Beam BigtableIO.
  1152. /// Request message for Bigtable.GenerateInitialChangeStreamPartitions.
  1153. #[derive(Clone, PartialEq, ::prost::Message)]
  1154. pub struct GenerateInitialChangeStreamPartitionsRequest {
  1155. /// Required. The unique name of the table from which to get change stream
  1156. /// partitions. Values are of the form
  1157. /// `projects/<project>/instances/<instance>/tables/<table>`.
  1158. /// Change streaming must be enabled on the table.
  1159. #[prost(string, tag = "1")]
  1160. pub table_name: ::prost::alloc::string::String,
  1161. /// This value specifies routing for replication. If not specified, the
  1162. /// "default" application profile will be used.
  1163. /// Single cluster routing must be configured on the profile.
  1164. #[prost(string, tag = "2")]
  1165. pub app_profile_id: ::prost::alloc::string::String,
  1166. }
  1167. /// NOTE: This API is intended to be used by Apache Beam BigtableIO.
  1168. /// Response message for Bigtable.GenerateInitialChangeStreamPartitions.
  1169. #[derive(Clone, PartialEq, ::prost::Message)]
  1170. pub struct GenerateInitialChangeStreamPartitionsResponse {
  1171. /// A partition of the change stream.
  1172. #[prost(message, optional, tag = "1")]
  1173. pub partition: ::core::option::Option<StreamPartition>,
  1174. }
  1175. /// NOTE: This API is intended to be used by Apache Beam BigtableIO.
  1176. /// Request message for Bigtable.ReadChangeStream.
  1177. #[derive(Clone, PartialEq, ::prost::Message)]
  1178. pub struct ReadChangeStreamRequest {
  1179. /// Required. The unique name of the table from which to read a change stream.
  1180. /// Values are of the form
  1181. /// `projects/<project>/instances/<instance>/tables/<table>`.
  1182. /// Change streaming must be enabled on the table.
  1183. #[prost(string, tag = "1")]
  1184. pub table_name: ::prost::alloc::string::String,
  1185. /// This value specifies routing for replication. If not specified, the
  1186. /// "default" application profile will be used.
  1187. /// Single cluster routing must be configured on the profile.
  1188. #[prost(string, tag = "2")]
  1189. pub app_profile_id: ::prost::alloc::string::String,
  1190. /// The partition to read changes from.
  1191. #[prost(message, optional, tag = "3")]
  1192. pub partition: ::core::option::Option<StreamPartition>,
  1193. /// If specified, OK will be returned when the stream advances beyond
  1194. /// this time. Otherwise, changes will be continuously delivered on the stream.
  1195. /// This value is inclusive and will be truncated to microsecond granularity.
  1196. #[prost(message, optional, tag = "5")]
  1197. pub end_time: ::core::option::Option<::prost_types::Timestamp>,
  1198. /// If specified, the duration between `Heartbeat` messages on the stream.
  1199. /// Otherwise, defaults to 5 seconds.
  1200. #[prost(message, optional, tag = "7")]
  1201. pub heartbeat_duration: ::core::option::Option<::prost_types::Duration>,
  1202. /// Options for describing where we want to start reading from the stream.
  1203. #[prost(oneof = "read_change_stream_request::StartFrom", tags = "4, 6")]
  1204. pub start_from: ::core::option::Option<read_change_stream_request::StartFrom>,
  1205. }
  1206. /// Nested message and enum types in `ReadChangeStreamRequest`.
  1207. pub mod read_change_stream_request {
  1208. /// Options for describing where we want to start reading from the stream.
  1209. #[derive(Clone, PartialEq, ::prost::Oneof)]
  1210. pub enum StartFrom {
  1211. /// Start reading the stream at the specified timestamp. This timestamp must
  1212. /// be within the change stream retention period, less than or equal to the
  1213. /// current time, and after change stream creation, whichever is greater.
  1214. /// This value is inclusive and will be truncated to microsecond granularity.
  1215. #[prost(message, tag = "4")]
  1216. StartTime(::prost_types::Timestamp),
  1217. /// Tokens that describe how to resume reading a stream where reading
  1218. /// previously left off. If specified, changes will be read starting at the
  1219. /// the position. Tokens are delivered on the stream as part of `Heartbeat`
  1220. /// and `CloseStream` messages.
  1221. ///
  1222. /// If a single token is provided, the token’s partition must exactly match
  1223. /// the request’s partition. If multiple tokens are provided, as in the case
  1224. /// of a partition merge, the union of the token partitions must exactly
  1225. /// cover the request’s partition. Otherwise, INVALID_ARGUMENT will be
  1226. /// returned.
  1227. #[prost(message, tag = "6")]
  1228. ContinuationTokens(super::StreamContinuationTokens),
  1229. }
  1230. }
  1231. /// NOTE: This API is intended to be used by Apache Beam BigtableIO.
  1232. /// Response message for Bigtable.ReadChangeStream.
  1233. #[derive(Clone, PartialEq, ::prost::Message)]
  1234. pub struct ReadChangeStreamResponse {
  1235. /// The data or control message on the stream.
  1236. #[prost(oneof = "read_change_stream_response::StreamRecord", tags = "1, 2, 3")]
  1237. pub stream_record: ::core::option::Option<read_change_stream_response::StreamRecord>,
  1238. }
  1239. /// Nested message and enum types in `ReadChangeStreamResponse`.
  1240. pub mod read_change_stream_response {
  1241. /// A partial or complete mutation.
  1242. #[derive(Clone, PartialEq, ::prost::Message)]
  1243. pub struct MutationChunk {
  1244. /// If set, then the mutation is a `SetCell` with a chunked value across
  1245. /// multiple messages.
  1246. #[prost(message, optional, tag = "1")]
  1247. pub chunk_info: ::core::option::Option<mutation_chunk::ChunkInfo>,
  1248. /// If this is a continuation of a chunked message (`chunked_value_offset` >
  1249. /// 0), ignore all fields except the `SetCell`'s value and merge it with
  1250. /// the previous message by concatenating the value fields.
  1251. #[prost(message, optional, tag = "2")]
  1252. pub mutation: ::core::option::Option<super::Mutation>,
  1253. }
  1254. /// Nested message and enum types in `MutationChunk`.
  1255. pub mod mutation_chunk {
  1256. /// Information about the chunking of this mutation.
  1257. /// Only `SetCell` mutations can be chunked, and all chunks for a `SetCell`
  1258. /// will be delivered contiguously with no other mutation types interleaved.
  1259. #[derive(Clone, PartialEq, ::prost::Message)]
  1260. pub struct ChunkInfo {
  1261. /// The total value size of all the chunks that make up the `SetCell`.
  1262. #[prost(int32, tag = "1")]
  1263. pub chunked_value_size: i32,
  1264. /// The byte offset of this chunk into the total value size of the
  1265. /// mutation.
  1266. #[prost(int32, tag = "2")]
  1267. pub chunked_value_offset: i32,
  1268. /// When true, this is the last chunk of a chunked `SetCell`.
  1269. #[prost(bool, tag = "3")]
  1270. pub last_chunk: bool,
  1271. }
  1272. }
  1273. /// A message corresponding to one or more mutations to the partition
  1274. /// being streamed. A single logical `DataChange` message may also be split
  1275. /// across a sequence of multiple individual messages. Messages other than
  1276. /// the first in a sequence will only have the `type` and `chunks` fields
  1277. /// populated, with the final message in the sequence also containing `done`
  1278. /// set to true.
  1279. #[derive(Clone, PartialEq, ::prost::Message)]
  1280. pub struct DataChange {
  1281. /// The type of the mutation.
  1282. #[prost(enumeration = "data_change::Type", tag = "1")]
  1283. pub r#type: i32,
  1284. /// The cluster where the mutation was applied.
  1285. /// Not set when `type` is `GARBAGE_COLLECTION`.
  1286. #[prost(string, tag = "2")]
  1287. pub source_cluster_id: ::prost::alloc::string::String,
  1288. /// The row key for all mutations that are part of this `DataChange`.
  1289. /// If the `DataChange` is chunked across multiple messages, then this field
  1290. /// will only be set for the first message.
  1291. #[prost(bytes = "vec", tag = "3")]
  1292. pub row_key: ::prost::alloc::vec::Vec<u8>,
  1293. /// The timestamp at which the mutation was applied on the Bigtable server.
  1294. #[prost(message, optional, tag = "4")]
  1295. pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
  1296. /// A value that lets stream consumers reconstruct Bigtable's
  1297. /// conflict resolution semantics.
  1298. /// <https://cloud.google.com/bigtable/docs/writes#conflict-resolution>
  1299. /// In the event that the same row key, column family, column qualifier,
  1300. /// timestamp are modified on different clusters at the same
  1301. /// `commit_timestamp`, the mutation with the larger `tiebreaker` will be the
  1302. /// one chosen for the eventually consistent state of the system.
  1303. #[prost(int32, tag = "5")]
  1304. pub tiebreaker: i32,
  1305. /// The mutations associated with this change to the partition.
  1306. /// May contain complete mutations or chunks of a multi-message chunked
  1307. /// `DataChange` record.
  1308. #[prost(message, repeated, tag = "6")]
  1309. pub chunks: ::prost::alloc::vec::Vec<MutationChunk>,
  1310. /// When true, indicates that the entire `DataChange` has been read
  1311. /// and the client can safely process the message.
  1312. #[prost(bool, tag = "8")]
  1313. pub done: bool,
  1314. /// An encoded position for this stream's partition to restart reading from.
  1315. /// This token is for the StreamPartition from the request.
  1316. #[prost(string, tag = "9")]
  1317. pub token: ::prost::alloc::string::String,
  1318. /// An estimate of the commit timestamp that is usually lower than or equal
  1319. /// to any timestamp for a record that will be delivered in the future on the
  1320. /// stream. It is possible that, under particular circumstances that a future
  1321. /// record has a timestamp is lower than a previously seen timestamp. For
  1322. /// an example usage see
  1323. /// <https://beam.apache.org/documentation/basics/#watermarks>
  1324. #[prost(message, optional, tag = "10")]
  1325. pub estimated_low_watermark: ::core::option::Option<::prost_types::Timestamp>,
  1326. }
  1327. /// Nested message and enum types in `DataChange`.
  1328. pub mod data_change {
  1329. /// The type of mutation.
  1330. #[derive(
  1331. Clone,
  1332. Copy,
  1333. Debug,
  1334. PartialEq,
  1335. Eq,
  1336. Hash,
  1337. PartialOrd,
  1338. Ord,
  1339. ::prost::Enumeration
  1340. )]
  1341. #[repr(i32)]
  1342. pub enum Type {
  1343. /// The type is unspecified.
  1344. Unspecified = 0,
  1345. /// A user-initiated mutation.
  1346. User = 1,
  1347. /// A system-initiated mutation as part of garbage collection.
  1348. /// <https://cloud.google.com/bigtable/docs/garbage-collection>
  1349. GarbageCollection = 2,
  1350. /// This is a continuation of a multi-message change.
  1351. Continuation = 3,
  1352. }
  1353. impl Type {
  1354. /// String value of the enum field names used in the ProtoBuf definition.
  1355. ///
  1356. /// The values are not transformed in any way and thus are considered stable
  1357. /// (if the ProtoBuf definition does not change) and safe for programmatic use.
  1358. pub fn as_str_name(&self) -> &'static str {
  1359. match self {
  1360. Type::Unspecified => "TYPE_UNSPECIFIED",
  1361. Type::User => "USER",
  1362. Type::GarbageCollection => "GARBAGE_COLLECTION",
  1363. Type::Continuation => "CONTINUATION",
  1364. }
  1365. }
  1366. /// Creates an enum from field names used in the ProtoBuf definition.
  1367. pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
  1368. match value {
  1369. "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
  1370. "USER" => Some(Self::User),
  1371. "GARBAGE_COLLECTION" => Some(Self::GarbageCollection),
  1372. "CONTINUATION" => Some(Self::Continuation),
  1373. _ => None,
  1374. }
  1375. }
  1376. }
  1377. }
  1378. /// A periodic message with information that can be used to checkpoint
  1379. /// the state of a stream.
  1380. #[derive(Clone, PartialEq, ::prost::Message)]
  1381. pub struct Heartbeat {
  1382. /// A token that can be provided to a subsequent `ReadChangeStream` call
  1383. /// to pick up reading at the current stream position.
  1384. #[prost(message, optional, tag = "1")]
  1385. pub continuation_token: ::core::option::Option<super::StreamContinuationToken>,
  1386. /// An estimate of the commit timestamp that is usually lower than or equal
  1387. /// to any timestamp for a record that will be delivered in the future on the
  1388. /// stream. It is possible that, under particular circumstances that a future
  1389. /// record has a timestamp is lower than a previously seen timestamp. For
  1390. /// an example usage see
  1391. /// <https://beam.apache.org/documentation/basics/#watermarks>
  1392. #[prost(message, optional, tag = "2")]
  1393. pub estimated_low_watermark: ::core::option::Option<::prost_types::Timestamp>,
  1394. }
  1395. /// A message indicating that the client should stop reading from the stream.
  1396. /// If status is OK and `continuation_tokens` & `new_partitions` are empty, the
  1397. /// stream has finished (for example if there was an `end_time` specified).
  1398. /// If `continuation_tokens` & `new_partitions` are present, then a change in
  1399. /// partitioning requires the client to open a new stream for each token to
  1400. /// resume reading. Example:
  1401. /// [B, D) ends
  1402. /// |
  1403. /// v
  1404. /// new_partitions: [A, C) [C, E)
  1405. /// continuation_tokens.partitions: [B,C) [C,D)
  1406. /// ^---^ ^---^
  1407. /// ^ ^
  1408. /// | |
  1409. /// | StreamContinuationToken 2
  1410. /// |
  1411. /// StreamContinuationToken 1
  1412. /// To read the new partition [A,C), supply the continuation tokens whose
  1413. /// ranges cover the new partition, for example ContinuationToken[A,B) &
  1414. /// ContinuationToken[B,C).
  1415. #[derive(Clone, PartialEq, ::prost::Message)]
  1416. pub struct CloseStream {
  1417. /// The status of the stream.
  1418. #[prost(message, optional, tag = "1")]
  1419. pub status: ::core::option::Option<super::super::super::rpc::Status>,
  1420. /// If non-empty, contains the information needed to resume reading their
  1421. /// associated partitions.
  1422. #[prost(message, repeated, tag = "2")]
  1423. pub continuation_tokens: ::prost::alloc::vec::Vec<
  1424. super::StreamContinuationToken,
  1425. >,
  1426. /// If non-empty, contains the new partitions to start reading from, which
  1427. /// are related to but not necessarily identical to the partitions for the
  1428. /// above `continuation_tokens`.
  1429. #[prost(message, repeated, tag = "3")]
  1430. pub new_partitions: ::prost::alloc::vec::Vec<super::StreamPartition>,
  1431. }
  1432. /// The data or control message on the stream.
  1433. #[derive(Clone, PartialEq, ::prost::Oneof)]
  1434. pub enum StreamRecord {
  1435. /// A mutation to the partition.
  1436. #[prost(message, tag = "1")]
  1437. DataChange(DataChange),
  1438. /// A periodic heartbeat message.
  1439. #[prost(message, tag = "2")]
  1440. Heartbeat(Heartbeat),
  1441. /// An indication that the stream should be closed.
  1442. #[prost(message, tag = "3")]
  1443. CloseStream(CloseStream),
  1444. }
  1445. }
  1446. /// Generated client implementations.
  1447. pub mod bigtable_client {
  1448. #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
  1449. use tonic::codegen::*;
  1450. use tonic::codegen::http::Uri;
  1451. /// Service for reading from and writing to existing Bigtable tables.
  1452. #[derive(Debug, Clone)]
  1453. pub struct BigtableClient<T> {
  1454. inner: tonic::client::Grpc<T>,
  1455. }
  1456. impl BigtableClient<tonic::transport::Channel> {
  1457. /// Attempt to create a new client by connecting to a given endpoint.
  1458. pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
  1459. where
  1460. D: TryInto<tonic::transport::Endpoint>,
  1461. D::Error: Into<StdError>,
  1462. {
  1463. let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
  1464. Ok(Self::new(conn))
  1465. }
  1466. }
  1467. impl<T> BigtableClient<T>
  1468. where
  1469. T: tonic::client::GrpcService<tonic::body::BoxBody>,
  1470. T::Error: Into<StdError>,
  1471. T::ResponseBody: Body<Data = Bytes> + Send + 'static,
  1472. <T::ResponseBody as Body>::Error: Into<StdError> + Send,
  1473. {
  1474. pub fn new(inner: T) -> Self {
  1475. let inner = tonic::client::Grpc::new(inner);
  1476. Self { inner }
  1477. }
  1478. pub fn with_origin(inner: T, origin: Uri) -> Self {
  1479. let inner = tonic::client::Grpc::with_origin(inner, origin);
  1480. Self { inner }
  1481. }
  1482. pub fn with_interceptor<F>(
  1483. inner: T,
  1484. interceptor: F,
  1485. ) -> BigtableClient<InterceptedService<T, F>>
  1486. where
  1487. F: tonic::service::Interceptor,
  1488. T::ResponseBody: Default,
  1489. T: tonic::codegen::Service<
  1490. http::Request<tonic::body::BoxBody>,
  1491. Response = http::Response<
  1492. <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
  1493. >,
  1494. >,
  1495. <T as tonic::codegen::Service<
  1496. http::Request<tonic::body::BoxBody>,
  1497. >>::Error: Into<StdError> + Send + Sync,
  1498. {
  1499. BigtableClient::new(InterceptedService::new(inner, interceptor))
  1500. }
  1501. /// Compress requests with the given encoding.
  1502. ///
  1503. /// This requires the server to support it otherwise it might respond with an
  1504. /// error.
  1505. #[must_use]
  1506. pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
  1507. self.inner = self.inner.send_compressed(encoding);
  1508. self
  1509. }
  1510. /// Enable decompressing responses.
  1511. #[must_use]
  1512. pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
  1513. self.inner = self.inner.accept_compressed(encoding);
  1514. self
  1515. }
  1516. /// Limits the maximum size of a decoded message.
  1517. ///
  1518. /// Default: `4MB`
  1519. #[must_use]
  1520. pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
  1521. self.inner = self.inner.max_decoding_message_size(limit);
  1522. self
  1523. }
  1524. /// Limits the maximum size of an encoded message.
  1525. ///
  1526. /// Default: `usize::MAX`
  1527. #[must_use]
  1528. pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
  1529. self.inner = self.inner.max_encoding_message_size(limit);
  1530. self
  1531. }
  1532. /// Streams back the contents of all requested rows in key order, optionally
  1533. /// applying the same Reader filter to each. Depending on their size,
  1534. /// rows and cells may be broken up across multiple responses, but
  1535. /// atomicity of each row will still be preserved. See the
  1536. /// ReadRowsResponse documentation for details.
  1537. pub async fn read_rows(
  1538. &mut self,
  1539. request: impl tonic::IntoRequest<super::ReadRowsRequest>,
  1540. ) -> std::result::Result<
  1541. tonic::Response<tonic::codec::Streaming<super::ReadRowsResponse>>,
  1542. tonic::Status,
  1543. > {
  1544. self.inner
  1545. .ready()
  1546. .await
  1547. .map_err(|e| {
  1548. tonic::Status::new(
  1549. tonic::Code::Unknown,
  1550. format!("Service was not ready: {}", e.into()),
  1551. )
  1552. })?;
  1553. let codec = tonic::codec::ProstCodec::default();
  1554. let path = http::uri::PathAndQuery::from_static(
  1555. "/google.bigtable.v2.Bigtable/ReadRows",
  1556. );
  1557. let mut req = request.into_request();
  1558. req.extensions_mut()
  1559. .insert(GrpcMethod::new("google.bigtable.v2.Bigtable", "ReadRows"));
  1560. self.inner.server_streaming(req, path, codec).await
  1561. }
  1562. /// Returns a sample of row keys in the table. The returned row keys will
  1563. /// delimit contiguous sections of the table of approximately equal size,
  1564. /// which can be used to break up the data for distributed tasks like
  1565. /// mapreduces.
  1566. pub async fn sample_row_keys(
  1567. &mut self,
  1568. request: impl tonic::IntoRequest<super::SampleRowKeysRequest>,
  1569. ) -> std::result::Result<
  1570. tonic::Response<tonic::codec::Streaming<super::SampleRowKeysResponse>>,
  1571. tonic::Status,
  1572. > {
  1573. self.inner
  1574. .ready()
  1575. .await
  1576. .map_err(|e| {
  1577. tonic::Status::new(
  1578. tonic::Code::Unknown,
  1579. format!("Service was not ready: {}", e.into()),
  1580. )
  1581. })?;
  1582. let codec = tonic::codec::ProstCodec::default();
  1583. let path = http::uri::PathAndQuery::from_static(
  1584. "/google.bigtable.v2.Bigtable/SampleRowKeys",
  1585. );
  1586. let mut req = request.into_request();
  1587. req.extensions_mut()
  1588. .insert(GrpcMethod::new("google.bigtable.v2.Bigtable", "SampleRowKeys"));
  1589. self.inner.server_streaming(req, path, codec).await
  1590. }
  1591. /// Mutates a row atomically. Cells already present in the row are left
  1592. /// unchanged unless explicitly changed by `mutation`.
  1593. pub async fn mutate_row(
  1594. &mut self,
  1595. request: impl tonic::IntoRequest<super::MutateRowRequest>,
  1596. ) -> std::result::Result<
  1597. tonic::Response<super::MutateRowResponse>,
  1598. tonic::Status,
  1599. > {
  1600. self.inner
  1601. .ready()
  1602. .await
  1603. .map_err(|e| {
  1604. tonic::Status::new(
  1605. tonic::Code::Unknown,
  1606. format!("Service was not ready: {}", e.into()),
  1607. )
  1608. })?;
  1609. let codec = tonic::codec::ProstCodec::default();
  1610. let path = http::uri::PathAndQuery::from_static(
  1611. "/google.bigtable.v2.Bigtable/MutateRow",
  1612. );
  1613. let mut req = request.into_request();
  1614. req.extensions_mut()
  1615. .insert(GrpcMethod::new("google.bigtable.v2.Bigtable", "MutateRow"));
  1616. self.inner.unary(req, path, codec).await
  1617. }
  1618. /// Mutates multiple rows in a batch. Each individual row is mutated
  1619. /// atomically as in MutateRow, but the entire batch is not executed
  1620. /// atomically.
  1621. pub async fn mutate_rows(
  1622. &mut self,
  1623. request: impl tonic::IntoRequest<super::MutateRowsRequest>,
  1624. ) -> std::result::Result<
  1625. tonic::Response<tonic::codec::Streaming<super::MutateRowsResponse>>,
  1626. tonic::Status,
  1627. > {
  1628. self.inner
  1629. .ready()
  1630. .await
  1631. .map_err(|e| {
  1632. tonic::Status::new(
  1633. tonic::Code::Unknown,
  1634. format!("Service was not ready: {}", e.into()),
  1635. )
  1636. })?;
  1637. let codec = tonic::codec::ProstCodec::default();
  1638. let path = http::uri::PathAndQuery::from_static(
  1639. "/google.bigtable.v2.Bigtable/MutateRows",
  1640. );
  1641. let mut req = request.into_request();
  1642. req.extensions_mut()
  1643. .insert(GrpcMethod::new("google.bigtable.v2.Bigtable", "MutateRows"));
  1644. self.inner.server_streaming(req, path, codec).await
  1645. }
  1646. /// Mutates a row atomically based on the output of a predicate Reader filter.
  1647. pub async fn check_and_mutate_row(
  1648. &mut self,
  1649. request: impl tonic::IntoRequest<super::CheckAndMutateRowRequest>,
  1650. ) -> std::result::Result<
  1651. tonic::Response<super::CheckAndMutateRowResponse>,
  1652. tonic::Status,
  1653. > {
  1654. self.inner
  1655. .ready()
  1656. .await
  1657. .map_err(|e| {
  1658. tonic::Status::new(
  1659. tonic::Code::Unknown,
  1660. format!("Service was not ready: {}", e.into()),
  1661. )
  1662. })?;
  1663. let codec = tonic::codec::ProstCodec::default();
  1664. let path = http::uri::PathAndQuery::from_static(
  1665. "/google.bigtable.v2.Bigtable/CheckAndMutateRow",
  1666. );
  1667. let mut req = request.into_request();
  1668. req.extensions_mut()
  1669. .insert(
  1670. GrpcMethod::new("google.bigtable.v2.Bigtable", "CheckAndMutateRow"),
  1671. );
  1672. self.inner.unary(req, path, codec).await
  1673. }
  1674. /// Warm up associated instance metadata for this connection.
  1675. /// This call is not required but may be useful for connection keep-alive.
  1676. pub async fn ping_and_warm(
  1677. &mut self,
  1678. request: impl tonic::IntoRequest<super::PingAndWarmRequest>,
  1679. ) -> std::result::Result<
  1680. tonic::Response<super::PingAndWarmResponse>,
  1681. tonic::Status,
  1682. > {
  1683. self.inner
  1684. .ready()
  1685. .await
  1686. .map_err(|e| {
  1687. tonic::Status::new(
  1688. tonic::Code::Unknown,
  1689. format!("Service was not ready: {}", e.into()),
  1690. )
  1691. })?;
  1692. let codec = tonic::codec::ProstCodec::default();
  1693. let path = http::uri::PathAndQuery::from_static(
  1694. "/google.bigtable.v2.Bigtable/PingAndWarm",
  1695. );
  1696. let mut req = request.into_request();
  1697. req.extensions_mut()
  1698. .insert(GrpcMethod::new("google.bigtable.v2.Bigtable", "PingAndWarm"));
  1699. self.inner.unary(req, path, codec).await
  1700. }
  1701. /// Modifies a row atomically on the server. The method reads the latest
  1702. /// existing timestamp and value from the specified columns and writes a new
  1703. /// entry based on pre-defined read/modify/write rules. The new value for the
  1704. /// timestamp is the greater of the existing timestamp or the current server
  1705. /// time. The method returns the new contents of all modified cells.
  1706. pub async fn read_modify_write_row(
  1707. &mut self,
  1708. request: impl tonic::IntoRequest<super::ReadModifyWriteRowRequest>,
  1709. ) -> std::result::Result<
  1710. tonic::Response<super::ReadModifyWriteRowResponse>,
  1711. tonic::Status,
  1712. > {
  1713. self.inner
  1714. .ready()
  1715. .await
  1716. .map_err(|e| {
  1717. tonic::Status::new(
  1718. tonic::Code::Unknown,
  1719. format!("Service was not ready: {}", e.into()),
  1720. )
  1721. })?;
  1722. let codec = tonic::codec::ProstCodec::default();
  1723. let path = http::uri::PathAndQuery::from_static(
  1724. "/google.bigtable.v2.Bigtable/ReadModifyWriteRow",
  1725. );
  1726. let mut req = request.into_request();
  1727. req.extensions_mut()
  1728. .insert(
  1729. GrpcMethod::new("google.bigtable.v2.Bigtable", "ReadModifyWriteRow"),
  1730. );
  1731. self.inner.unary(req, path, codec).await
  1732. }
  1733. /// NOTE: This API is intended to be used by Apache Beam BigtableIO.
  1734. /// Returns the current list of partitions that make up the table's
  1735. /// change stream. The union of partitions will cover the entire keyspace.
  1736. /// Partitions can be read with `ReadChangeStream`.
  1737. pub async fn generate_initial_change_stream_partitions(
  1738. &mut self,
  1739. request: impl tonic::IntoRequest<
  1740. super::GenerateInitialChangeStreamPartitionsRequest,
  1741. >,
  1742. ) -> std::result::Result<
  1743. tonic::Response<
  1744. tonic::codec::Streaming<
  1745. super::GenerateInitialChangeStreamPartitionsResponse,
  1746. >,
  1747. >,
  1748. tonic::Status,
  1749. > {
  1750. self.inner
  1751. .ready()
  1752. .await
  1753. .map_err(|e| {
  1754. tonic::Status::new(
  1755. tonic::Code::Unknown,
  1756. format!("Service was not ready: {}", e.into()),
  1757. )
  1758. })?;
  1759. let codec = tonic::codec::ProstCodec::default();
  1760. let path = http::uri::PathAndQuery::from_static(
  1761. "/google.bigtable.v2.Bigtable/GenerateInitialChangeStreamPartitions",
  1762. );
  1763. let mut req = request.into_request();
  1764. req.extensions_mut()
  1765. .insert(
  1766. GrpcMethod::new(
  1767. "google.bigtable.v2.Bigtable",
  1768. "GenerateInitialChangeStreamPartitions",
  1769. ),
  1770. );
  1771. self.inner.server_streaming(req, path, codec).await
  1772. }
  1773. /// NOTE: This API is intended to be used by Apache Beam BigtableIO.
  1774. /// Reads changes from a table's change stream. Changes will
  1775. /// reflect both user-initiated mutations and mutations that are caused by
  1776. /// garbage collection.
  1777. pub async fn read_change_stream(
  1778. &mut self,
  1779. request: impl tonic::IntoRequest<super::ReadChangeStreamRequest>,
  1780. ) -> std::result::Result<
  1781. tonic::Response<
  1782. tonic::codec::Streaming<super::ReadChangeStreamResponse>,
  1783. >,
  1784. tonic::Status,
  1785. > {
  1786. self.inner
  1787. .ready()
  1788. .await
  1789. .map_err(|e| {
  1790. tonic::Status::new(
  1791. tonic::Code::Unknown,
  1792. format!("Service was not ready: {}", e.into()),
  1793. )
  1794. })?;
  1795. let codec = tonic::codec::ProstCodec::default();
  1796. let path = http::uri::PathAndQuery::from_static(
  1797. "/google.bigtable.v2.Bigtable/ReadChangeStream",
  1798. );
  1799. let mut req = request.into_request();
  1800. req.extensions_mut()
  1801. .insert(
  1802. GrpcMethod::new("google.bigtable.v2.Bigtable", "ReadChangeStream"),
  1803. );
  1804. self.inner.server_streaming(req, path, codec).await
  1805. }
  1806. }
  1807. }