1 // Copyright 2017 Google Inc.
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 package google.bigtable.admin.table.v1;
19 import "google/longrunning/operations.proto";
20 import "google/protobuf/duration.proto";
22 option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/table/v1;table";
23 option java_multiple_files = true;
24 option java_outer_classname = "BigtableTableDataProto";
25 option java_package = "com.google.bigtable.admin.table.v1";
27 // A collection of user data indexed by row, column, and timestamp.
28 // Each table is served using the resources of its parent cluster.
30 enum TimestampGranularity { MILLIS = 0; }
32 // A unique identifier of the form
33 // <cluster_name>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*
36 // If this Table is in the process of being created, the Operation used to
37 // track its progress. As long as this operation is present, the Table will
38 // not accept any Table Admin or Read/Write requests.
39 google.longrunning.Operation current_operation = 2;
41 // The column families configured for this table, mapped by column family id.
42 map<string, ColumnFamily> column_families = 3;
44 // The granularity (e.g. MILLIS, MICROS) at which timestamps are stored in
45 // this table. Timestamps not matching the granularity will be rejected.
46 // Cannot be changed once the table is created.
47 TimestampGranularity granularity = 4;
50 // A set of columns within a table which share a common configuration.
51 message ColumnFamily {
52 // A unique identifier of the form <table_name>/columnFamilies/[-_.a-zA-Z0-9]+
53 // The last segment is the same as the "name" field in
54 // google.bigtable.v1.Family.
57 // Garbage collection expression specified by the following grammar:
60 // EXPR = EXPR, "||", EXPR (* lowest precedence *)
62 // | "(", EXPR, ")" (* highest precedence *)
64 // PROP = "version() >", NUM32
65 // | "age() >", NUM64, [ UNIT ] ;
66 // NUM32 = non-zero-digit { digit } ; (* # NUM32 <= 2^32 - 1 *)
67 // NUM64 = non-zero-digit { digit } ; (* # NUM64 <= 2^63 - 1 *)
68 // UNIT = "d" | "h" | "m" (* d=days, h=hours, m=minutes, else micros *)
69 // GC expressions can be up to 500 characters in length
71 // The different types of PROP are defined as follows:
72 // version() - cell index, counting from most recent and starting at 1
73 // age() - age of the cell (current time minus cell timestamp)
75 // Example: "version() > 3 || (age() > 3d && version() > 1)"
76 // drop cells beyond the most recent three, and drop cells older than three
77 // days unless they're the most recent cell in the row/column
79 // Garbage collection executes opportunistically in the background, and so
80 // it's possible for reads to return a cell even if it matches the active GC
81 // expression for its family.
82 string gc_expression = 2;
84 // Garbage collection rule specified as a protobuf.
85 // Supersedes `gc_expression`.
86 // Must serialize to at most 500 bytes.
88 // NOTE: Garbage collection executes opportunistically in the background, and
89 // so it's possible for reads to return a cell even if it matches the active
90 // GC expression for its family.
94 // Rule for determining which cells to delete during garbage collection.
96 // A GcRule which deletes cells matching all of the given rules.
97 message Intersection {
98 // Only delete cells which would be deleted by every element of `rules`.
99 repeated GcRule rules = 1;
102 // A GcRule which deletes cells matching any of the given rules.
104 // Delete cells which would be deleted by any element of `rules`.
105 repeated GcRule rules = 1;
109 // Delete all cells in a column except the most recent N.
110 int32 max_num_versions = 1;
112 // Delete cells in a column older than the given age.
113 // Values must be at least one millisecond, and will be truncated to
114 // microsecond granularity.
115 google.protobuf.Duration max_age = 2;
117 // Delete cells that would be deleted by every nested rule.
118 Intersection intersection = 3;
120 // Delete cells that would be deleted by any nested rule.