Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / google-proto-files / google / bigtable / admin / table / v1 / bigtable_table_data.proto
1 // Copyright 2017 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
15 syntax = "proto3";
16
17 package google.bigtable.admin.table.v1;
18
19 import "google/longrunning/operations.proto";
20 import "google/protobuf/duration.proto";
21
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";
26
27 // A collection of user data indexed by row, column, and timestamp.
28 // Each table is served using the resources of its parent cluster.
29 message Table {
30   enum TimestampGranularity { MILLIS = 0; }
31
32   // A unique identifier of the form
33   // <cluster_name>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*
34   string name = 1;
35
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;
40
41   // The column families configured for this table, mapped by column family id.
42   map<string, ColumnFamily> column_families = 3;
43
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;
48 }
49
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.
55   string name = 1;
56
57   // Garbage collection expression specified by the following grammar:
58   //   GC = EXPR
59   //      | "" ;
60   //   EXPR = EXPR, "||", EXPR              (* lowest precedence *)
61   //        | EXPR, "&&", EXPR
62   //        | "(", EXPR, ")"                (* highest precedence *)
63   //        | PROP ;
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
70   //
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)
74   //
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
78   //
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;
83
84   // Garbage collection rule specified as a protobuf.
85   // Supersedes `gc_expression`.
86   // Must serialize to at most 500 bytes.
87   //
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.
91   GcRule gc_rule = 3;
92 }
93
94 // Rule for determining which cells to delete during garbage collection.
95 message GcRule {
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;
100   }
101
102   // A GcRule which deletes cells matching any of the given rules.
103   message Union {
104     // Delete cells which would be deleted by any element of `rules`.
105     repeated GcRule rules = 1;
106   }
107
108   oneof rule {
109     // Delete all cells in a column except the most recent N.
110     int32 max_num_versions = 1;
111
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;
116
117     // Delete cells that would be deleted by every nested rule.
118     Intersection intersection = 3;
119
120     // Delete cells that would be deleted by any nested rule.
121     Union union = 4;
122   }
123 }