HBase.proto 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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. // This file contains protocol buffers that are shared throughout HBase
  19. package pb;
  20. option java_package = "org.apache.hadoop.hbase.protobuf.generated";
  21. option java_outer_classname = "HBaseProtos";
  22. option java_generate_equals_and_hash = true;
  23. option optimize_for = SPEED;
  24. import "Cell.proto";
  25. /**
  26. * Table Name
  27. */
  28. message TableName {
  29. required bytes namespace = 1;
  30. required bytes qualifier = 2;
  31. }
  32. /**
  33. * Table Schema
  34. * Inspired by the rest TableSchema
  35. */
  36. message TableSchema {
  37. optional TableName table_name = 1;
  38. repeated BytesBytesPair attributes = 2;
  39. repeated ColumnFamilySchema column_families = 3;
  40. repeated NameStringPair configuration = 4;
  41. }
  42. /**
  43. * Column Family Schema
  44. * Inspired by the rest ColumSchemaMessage
  45. */
  46. message ColumnFamilySchema {
  47. required bytes name = 1;
  48. repeated BytesBytesPair attributes = 2;
  49. repeated NameStringPair configuration = 3;
  50. }
  51. /**
  52. * Protocol buffer version of HRegionInfo.
  53. */
  54. message RegionInfo {
  55. required uint64 region_id = 1;
  56. required TableName table_name = 2;
  57. optional bytes start_key = 3;
  58. optional bytes end_key = 4;
  59. optional bool offline = 5;
  60. optional bool split = 6;
  61. optional int32 replica_id = 7 [default = 0];
  62. }
  63. /**
  64. * Protocol buffer for favored nodes
  65. */
  66. message FavoredNodes {
  67. repeated ServerName favored_node = 1;
  68. }
  69. /**
  70. * Container protocol buffer to specify a region.
  71. * You can specify region by region name, or the hash
  72. * of the region name, which is known as encoded
  73. * region name.
  74. */
  75. message RegionSpecifier {
  76. required RegionSpecifierType type = 1;
  77. required bytes value = 2;
  78. enum RegionSpecifierType {
  79. // <tablename>,<startkey>,<regionId>.<encodedName>
  80. REGION_NAME = 1;
  81. // hash of <tablename>,<startkey>,<regionId>
  82. ENCODED_REGION_NAME = 2;
  83. }
  84. }
  85. /**
  86. * A range of time. Both from and to are Java time
  87. * stamp in milliseconds. If you don't specify a time
  88. * range, it means all time. By default, if not
  89. * specified, from = 0, and to = Long.MAX_VALUE
  90. */
  91. message TimeRange {
  92. optional uint64 from = 1;
  93. optional uint64 to = 2;
  94. }
  95. /* ColumnFamily Specific TimeRange */
  96. message ColumnFamilyTimeRange {
  97. required bytes column_family = 1;
  98. required TimeRange time_range = 2;
  99. }
  100. /* Comparison operators */
  101. enum CompareType {
  102. LESS = 0;
  103. LESS_OR_EQUAL = 1;
  104. EQUAL = 2;
  105. NOT_EQUAL = 3;
  106. GREATER_OR_EQUAL = 4;
  107. GREATER = 5;
  108. NO_OP = 6;
  109. }
  110. /**
  111. * Protocol buffer version of ServerName
  112. */
  113. message ServerName {
  114. required string host_name = 1;
  115. optional uint32 port = 2;
  116. optional uint64 start_code = 3;
  117. }
  118. // Comment data structures
  119. message Coprocessor {
  120. required string name = 1;
  121. }
  122. message NameStringPair {
  123. required string name = 1;
  124. required string value = 2;
  125. }
  126. message NameBytesPair {
  127. required string name = 1;
  128. optional bytes value = 2;
  129. }
  130. message BytesBytesPair {
  131. required bytes first = 1;
  132. required bytes second = 2;
  133. }
  134. message NameInt64Pair {
  135. optional string name = 1;
  136. optional int64 value = 2;
  137. }
  138. /**
  139. * Description of the snapshot to take
  140. */
  141. message SnapshotDescription {
  142. required string name = 1;
  143. optional string table = 2; // not needed for delete, but checked for in taking snapshot
  144. optional int64 creation_time = 3 [default = 0];
  145. enum Type {
  146. DISABLED = 0;
  147. FLUSH = 1;
  148. SKIPFLUSH = 2;
  149. }
  150. optional Type type = 4 [default = FLUSH];
  151. optional int32 version = 5;
  152. optional string owner = 6;
  153. }
  154. /**
  155. * Description of the distributed procedure to take
  156. */
  157. message ProcedureDescription {
  158. required string signature = 1; // the unique signature of the procedure
  159. optional string instance = 2; // the procedure instance name
  160. optional int64 creation_time = 3 [default = 0];
  161. repeated NameStringPair configuration = 4;
  162. }
  163. message EmptyMsg {
  164. }
  165. enum TimeUnit {
  166. NANOSECONDS = 1;
  167. MICROSECONDS = 2;
  168. MILLISECONDS = 3;
  169. SECONDS = 4;
  170. MINUTES = 5;
  171. HOURS = 6;
  172. DAYS = 7;
  173. }
  174. message LongMsg {
  175. required int64 long_msg = 1;
  176. }
  177. message DoubleMsg {
  178. required double double_msg = 1;
  179. }
  180. message BigDecimalMsg {
  181. required bytes bigdecimal_msg = 1;
  182. }
  183. message UUID {
  184. required uint64 least_sig_bits = 1;
  185. required uint64 most_sig_bits = 2;
  186. }
  187. message NamespaceDescriptor {
  188. required bytes name = 1;
  189. repeated NameStringPair configuration = 2;
  190. }
  191. // Rpc client version info proto. Included in ConnectionHeader on connection setup
  192. message VersionInfo {
  193. required string version = 1;
  194. required string url = 2;
  195. required string revision = 3;
  196. required string user = 4;
  197. required string date = 5;
  198. required string src_checksum = 6;
  199. optional uint32 version_major = 7;
  200. optional uint32 version_minor = 8;
  201. }
  202. /**
  203. * Description of the region server info
  204. */
  205. message RegionServerInfo {
  206. optional int32 infoPort = 1;
  207. optional VersionInfo version_info = 2;
  208. }