table.proto 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // Copyright 2016 Google Inc.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.bigtable.admin.v2;
  16. import "google/api/annotations.proto";
  17. import "google/protobuf/duration.proto";
  18. option java_multiple_files = true;
  19. option java_outer_classname = "TableProto";
  20. option java_package = "com.google.bigtable.admin.v2";
  21. // A collection of user data indexed by row, column, and timestamp.
  22. // Each table is served using the resources of its parent cluster.
  23. message Table {
  24. // Possible timestamp granularities to use when keeping multiple versions
  25. // of data in a table.
  26. enum TimestampGranularity {
  27. // The user did not specify a granularity. Should not be returned.
  28. // When specified during table creation, MILLIS will be used.
  29. TIMESTAMP_GRANULARITY_UNSPECIFIED = 0;
  30. // The table keeps data versioned at a granularity of 1ms.
  31. MILLIS = 1;
  32. }
  33. // Defines a view over a table's fields.
  34. enum View {
  35. // Uses the default view for each method as documented in its request.
  36. VIEW_UNSPECIFIED = 0;
  37. // Only populates `name`.
  38. NAME_ONLY = 1;
  39. // Only populates `name` and fields related to the table's schema.
  40. SCHEMA_VIEW = 2;
  41. // Populates all fields.
  42. FULL = 4;
  43. }
  44. // The unique name of the table. Values are of the form
  45. // projects/<project>/instances/<instance>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*
  46. // Views: NAME_ONLY, SCHEMA_VIEW, REPLICATION_VIEW, FULL
  47. // @OutputOnly
  48. string name = 1;
  49. // The column families configured for this table, mapped by column family ID.
  50. // Views: SCHEMA_VIEW, FULL
  51. // @CreationOnly
  52. map<string, ColumnFamily> column_families = 3;
  53. // The granularity (e.g. MILLIS, MICROS) at which timestamps are stored in
  54. // this table. Timestamps not matching the granularity will be rejected.
  55. // If unspecified at creation time, the value will be set to MILLIS.
  56. // Views: SCHEMA_VIEW, FULL
  57. // @CreationOnly
  58. TimestampGranularity granularity = 4;
  59. }
  60. // A set of columns within a table which share a common configuration.
  61. message ColumnFamily {
  62. // Garbage collection rule specified as a protobuf.
  63. // Must serialize to at most 500 bytes.
  64. //
  65. // NOTE: Garbage collection executes opportunistically in the background, and
  66. // so it's possible for reads to return a cell even if it matches the active
  67. // GC expression for its family.
  68. GcRule gc_rule = 1;
  69. }
  70. // Rule for determining which cells to delete during garbage collection.
  71. message GcRule {
  72. // A GcRule which deletes cells matching all of the given rules.
  73. message Intersection {
  74. // Only delete cells which would be deleted by every element of `rules`.
  75. repeated GcRule rules = 1;
  76. }
  77. // A GcRule which deletes cells matching any of the given rules.
  78. message Union {
  79. // Delete cells which would be deleted by any element of `rules`.
  80. repeated GcRule rules = 1;
  81. }
  82. oneof rule {
  83. // Delete all cells in a column except the most recent N.
  84. int32 max_num_versions = 1;
  85. // Delete cells in a column older than the given age.
  86. // Values must be at least one millisecond, and will be truncated to
  87. // microsecond granularity.
  88. google.protobuf.Duration max_age = 2;
  89. // Delete cells that would be deleted by every nested rule.
  90. Intersection intersection = 3;
  91. // Delete cells that would be deleted by any nested rule.
  92. Union union = 4;
  93. }
  94. }