1/**
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements.  See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership.  The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License.  You may obtain a copy of the License at
9 *
10 *     http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19// This file contains protocol buffers that are shared throughout HBase
20
21option java_package = "org.apache.hadoop.hbase.protobuf.generated";
22option java_outer_classname = "HBaseProtos";
23option java_generate_equals_and_hash = true;
24option optimize_for = SPEED;
25
26import "Cell.proto";
27
28/**
29 * Table Name
30 */
31message TableName {
32  required bytes namespace = 1;
33  required bytes qualifier = 2;
34}
35
36/**
37 * Table Schema
38 * Inspired by the rest TableSchema
39 */
40message TableSchema {
41  optional TableName table_name = 1;
42  repeated BytesBytesPair attributes = 2;
43  repeated ColumnFamilySchema column_families = 3;
44  repeated NameStringPair configuration = 4;
45}
46
47/**
48 * Column Family Schema
49 * Inspired by the rest ColumSchemaMessage
50 */
51message ColumnFamilySchema {
52  required bytes name = 1;
53  repeated BytesBytesPair attributes = 2;
54  repeated NameStringPair configuration = 3;
55}
56
57/**
58 * Protocol buffer version of HRegionInfo.
59 */
60message RegionInfo {
61  required uint64 region_id = 1;
62  required TableName table_name = 2;
63  optional bytes start_key = 3;
64  optional bytes end_key = 4;
65  optional bool offline = 5;
66  optional bool split = 6;
67  optional int32 replica_id = 7 [default = 0];
68}
69
70/**
71 * Protocol buffer for favored nodes
72 */
73message FavoredNodes {
74  repeated ServerName favored_node = 1;
75}
76
77/**
78 * Container protocol buffer to specify a region.
79 * You can specify region by region name, or the hash
80 * of the region name, which is known as encoded
81 * region name.
82 */
83message RegionSpecifier {
84  required RegionSpecifierType type = 1;
85  required bytes value = 2;
86
87  enum RegionSpecifierType {
88    // <tablename>,<startkey>,<regionId>.<encodedName>
89    REGION_NAME = 1;
90
91    // hash of <tablename>,<startkey>,<regionId>
92    ENCODED_REGION_NAME = 2;
93  }
94}
95
96/**
97 * A range of time. Both from and to are Java time
98 * stamp in milliseconds. If you don't specify a time
99 * range, it means all time.  By default, if not
100 * specified, from = 0, and to = Long.MAX_VALUE
101 */
102message TimeRange {
103  optional uint64 from = 1;
104  optional uint64 to = 2;
105}
106
107/* ColumnFamily Specific TimeRange */
108message ColumnFamilyTimeRange {
109  required bytes column_family = 1;
110  required TimeRange time_range = 2;
111}
112
113/* Comparison operators */
114enum CompareType {
115  LESS = 0;
116  LESS_OR_EQUAL = 1;
117  EQUAL = 2;
118  NOT_EQUAL = 3;
119  GREATER_OR_EQUAL = 4;
120  GREATER = 5;
121  NO_OP = 6;
122}
123
124/**
125 * Protocol buffer version of ServerName
126 */
127message ServerName {
128  required string host_name = 1;
129  optional uint32 port = 2;
130  optional uint64 start_code = 3;
131}
132
133// Comment data structures
134
135message Coprocessor {
136  required string name = 1;
137}
138
139message NameStringPair {
140  required string name = 1;
141  required string value = 2;
142}
143
144message NameBytesPair {
145  required string name = 1;
146  optional bytes value = 2;
147}
148
149message BytesBytesPair {
150  required bytes first = 1;
151  required bytes second = 2;
152}
153
154message NameInt64Pair {
155  optional string name = 1;
156  optional int64 value = 2;
157}
158
159/**
160 * Description of the snapshot to take
161 */
162message SnapshotDescription {
163  required string name = 1;
164  optional string table = 2; // not needed for delete, but checked for in taking snapshot
165  optional int64 creation_time = 3 [default = 0];
166  enum Type {
167    DISABLED = 0;
168    FLUSH = 1;
169    SKIPFLUSH = 2;
170  }
171  optional Type type = 4 [default = FLUSH];
172  optional int32 version = 5;
173  optional string owner = 6;
174}
175
176/**
177 * Description of the distributed procedure to take
178 */
179message ProcedureDescription {
180  required string signature = 1; // the unique signature of the procedure
181  optional string instance = 2; // the procedure instance name
182  optional int64 creation_time = 3 [default = 0];
183  repeated NameStringPair configuration = 4;
184}
185
186message EmptyMsg {
187}
188
189enum TimeUnit {
190  NANOSECONDS = 1;
191  MICROSECONDS = 2;
192  MILLISECONDS = 3;
193  SECONDS = 4;
194  MINUTES = 5;
195  HOURS = 6;
196  DAYS = 7;
197}
198
199message LongMsg {
200  required int64 long_msg = 1;
201}
202
203message DoubleMsg {
204  required double double_msg = 1;
205}
206
207message BigDecimalMsg {
208  required bytes bigdecimal_msg = 1;
209}
210
211message UUID {
212  required uint64 least_sig_bits = 1;
213  required uint64 most_sig_bits = 2;
214}
215
216message NamespaceDescriptor {
217  required bytes name = 1;
218  repeated NameStringPair configuration = 2;
219}
220
221// Rpc client version info proto. Included in ConnectionHeader on connection setup
222message VersionInfo {
223  required string version = 1;
224  required string url = 2;
225  required string revision = 3;
226  required string user = 4;
227  required string date = 5;
228  required string src_checksum = 6;
229}
230
231/**
232 * Description of the region server info
233 */
234message RegionServerInfo {
235  optional int32 infoPort = 1;
236  optional VersionInfo version_info = 2;
237}
238