Admin.proto 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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 used for Admin service.
  19. package pb;
  20. option java_package = "org.apache.hadoop.hbase.protobuf.generated";
  21. option java_outer_classname = "AdminProtos";
  22. option java_generic_services = true;
  23. option java_generate_equals_and_hash = true;
  24. option optimize_for = SPEED;
  25. //import "Client.proto";
  26. import "HBase.proto";
  27. import "WAL.proto";
  28. message GetRegionInfoRequest {
  29. required RegionSpecifier region = 1;
  30. optional bool compaction_state = 2;
  31. }
  32. message GetRegionInfoResponse {
  33. required RegionInfo region_info = 1;
  34. optional CompactionState compaction_state = 2;
  35. optional bool isRecovering = 3;
  36. enum CompactionState {
  37. NONE = 0;
  38. MINOR = 1;
  39. MAJOR = 2;
  40. MAJOR_AND_MINOR = 3;
  41. }
  42. }
  43. /**
  44. * Get a list of store files for a set of column families in a particular region.
  45. * If no column family is specified, get the store files for all column families.
  46. */
  47. message GetStoreFileRequest {
  48. required RegionSpecifier region = 1;
  49. repeated bytes family = 2;
  50. }
  51. message GetStoreFileResponse {
  52. repeated string store_file = 1;
  53. }
  54. message GetOnlineRegionRequest {
  55. }
  56. message GetOnlineRegionResponse {
  57. repeated RegionInfo region_info = 1;
  58. }
  59. message OpenRegionRequest {
  60. repeated RegionOpenInfo open_info = 1;
  61. // the intended server for this RPC.
  62. optional uint64 serverStartCode = 2;
  63. // wall clock time from master
  64. optional uint64 master_system_time = 5;
  65. message RegionOpenInfo {
  66. required RegionInfo region = 1;
  67. optional uint32 version_of_offline_node = 2;
  68. repeated ServerName favored_nodes = 3;
  69. // open region for distributedLogReplay
  70. optional bool openForDistributedLogReplay = 4;
  71. }
  72. }
  73. message OpenRegionResponse {
  74. repeated RegionOpeningState opening_state = 1;
  75. enum RegionOpeningState {
  76. OPENED = 0;
  77. ALREADY_OPENED = 1;
  78. FAILED_OPENING = 2;
  79. }
  80. }
  81. message WarmupRegionRequest {
  82. required RegionInfo regionInfo = 1;
  83. }
  84. message WarmupRegionResponse {
  85. }
  86. /**
  87. * Closes the specified region and will use or not use ZK during the close
  88. * according to the specified flag.
  89. */
  90. message CloseRegionRequest {
  91. required RegionSpecifier region = 1;
  92. optional uint32 version_of_closing_node = 2;
  93. optional bool transition_in_ZK = 3 [default = true];
  94. optional ServerName destination_server = 4;
  95. // the intended server for this RPC.
  96. optional uint64 serverStartCode = 5;
  97. }
  98. message CloseRegionResponse {
  99. required bool closed = 1;
  100. }
  101. /**
  102. * Flushes the MemStore of the specified region.
  103. * <p>
  104. * This method is synchronous.
  105. */
  106. message FlushRegionRequest {
  107. required RegionSpecifier region = 1;
  108. optional uint64 if_older_than_ts = 2;
  109. optional bool write_flush_wal_marker = 3; // whether to write a marker to WAL even if not flushed
  110. }
  111. message FlushRegionResponse {
  112. required uint64 last_flush_time = 1;
  113. optional bool flushed = 2;
  114. optional bool wrote_flush_wal_marker = 3;
  115. }
  116. /**
  117. * Splits the specified region.
  118. * <p>
  119. * This method currently flushes the region and then forces a compaction which
  120. * will then trigger a split. The flush is done synchronously but the
  121. * compaction is asynchronous.
  122. */
  123. message SplitRegionRequest {
  124. required RegionSpecifier region = 1;
  125. optional bytes split_point = 2;
  126. }
  127. message SplitRegionResponse {
  128. }
  129. /**
  130. * Compacts the specified region. Performs a major compaction if specified.
  131. * <p>
  132. * This method is asynchronous.
  133. */
  134. message CompactRegionRequest {
  135. required RegionSpecifier region = 1;
  136. optional bool major = 2;
  137. optional bytes family = 3;
  138. }
  139. message CompactRegionResponse {
  140. }
  141. message UpdateFavoredNodesRequest {
  142. repeated RegionUpdateInfo update_info = 1;
  143. message RegionUpdateInfo {
  144. required RegionInfo region = 1;
  145. repeated ServerName favored_nodes = 2;
  146. }
  147. }
  148. message UpdateFavoredNodesResponse {
  149. optional uint32 response = 1;
  150. }
  151. /**
  152. * Merges the specified regions.
  153. * <p>
  154. * This method currently closes the regions and then merges them
  155. */
  156. message MergeRegionsRequest {
  157. required RegionSpecifier region_a = 1;
  158. required RegionSpecifier region_b = 2;
  159. optional bool forcible = 3 [default = false];
  160. // wall clock time from master
  161. optional uint64 master_system_time = 4;
  162. }
  163. message MergeRegionsResponse {
  164. }
  165. // Protocol buffer version of WAL for replication
  166. message WALEntry {
  167. required WALKey key = 1;
  168. // Following may be null if the KVs/Cells are carried along the side in a cellblock (See
  169. // RPC for more on cellblocks). If Cells/KVs are in a cellblock, this next field is null
  170. // and associated_cell_count has count of Cells associated w/ this WALEntry
  171. repeated bytes key_value_bytes = 2;
  172. // If Cell data is carried alongside in a cellblock, this is count of Cells in the cellblock.
  173. optional int32 associated_cell_count = 3;
  174. }
  175. /**
  176. * Replicates the given entries. The guarantee is that the given entries
  177. * will be durable on the slave cluster if this method returns without
  178. * any exception. hbase.replication has to be set to true for this to work.
  179. */
  180. message ReplicateWALEntryRequest {
  181. repeated WALEntry entry = 1;
  182. optional string replicationClusterId = 2;
  183. optional string sourceBaseNamespaceDirPath = 3;
  184. optional string sourceHFileArchiveDirPath = 4;
  185. }
  186. message ReplicateWALEntryResponse {
  187. }
  188. message RollWALWriterRequest {
  189. }
  190. /*
  191. * Roll request responses no longer include regions to flush
  192. * this list will always be empty when talking to a 1.0 server
  193. */
  194. message RollWALWriterResponse {
  195. // A list of encoded name of regions to flush
  196. repeated bytes region_to_flush = 1;
  197. }
  198. message StopServerRequest {
  199. required string reason = 1;
  200. }
  201. message StopServerResponse {
  202. }
  203. message GetServerInfoRequest {
  204. }
  205. message ServerInfo {
  206. required ServerName server_name = 1;
  207. optional uint32 webui_port = 2;
  208. }
  209. message GetServerInfoResponse {
  210. required ServerInfo server_info = 1;
  211. }
  212. message UpdateConfigurationRequest {
  213. }
  214. message UpdateConfigurationResponse {
  215. }
  216. service AdminService {
  217. rpc GetRegionInfo(GetRegionInfoRequest)
  218. returns(GetRegionInfoResponse);
  219. rpc GetStoreFile(GetStoreFileRequest)
  220. returns(GetStoreFileResponse);
  221. rpc GetOnlineRegion(GetOnlineRegionRequest)
  222. returns(GetOnlineRegionResponse);
  223. rpc OpenRegion(OpenRegionRequest)
  224. returns(OpenRegionResponse);
  225. rpc WarmupRegion(WarmupRegionRequest)
  226. returns(WarmupRegionResponse);
  227. rpc CloseRegion(CloseRegionRequest)
  228. returns(CloseRegionResponse);
  229. rpc FlushRegion(FlushRegionRequest)
  230. returns(FlushRegionResponse);
  231. rpc SplitRegion(SplitRegionRequest)
  232. returns(SplitRegionResponse);
  233. rpc CompactRegion(CompactRegionRequest)
  234. returns(CompactRegionResponse);
  235. rpc MergeRegions(MergeRegionsRequest)
  236. returns(MergeRegionsResponse);
  237. rpc ReplicateWALEntry(ReplicateWALEntryRequest)
  238. returns(ReplicateWALEntryResponse);
  239. rpc Replay(ReplicateWALEntryRequest)
  240. returns(ReplicateWALEntryResponse);
  241. rpc RollWALWriter(RollWALWriterRequest)
  242. returns(RollWALWriterResponse);
  243. rpc GetServerInfo(GetServerInfoRequest)
  244. returns(GetServerInfoResponse);
  245. rpc StopServer(StopServerRequest)
  246. returns(StopServerResponse);
  247. rpc UpdateFavoredNodes(UpdateFavoredNodesRequest)
  248. returns(UpdateFavoredNodesResponse);
  249. rpc UpdateConfiguration(UpdateConfigurationRequest)
  250. returns(UpdateConfigurationResponse);
  251. }