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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 // This file contains protocol buffers that are used for Admin service.
22 option java_package = "org.apache.hadoop.hbase.shaded.protobuf.generated";
23 option java_outer_classname = "AdminProtos";
24 option java_generic_services = true;
25 option java_generate_equals_and_hash = true;
26 option optimize_for = SPEED;
28 import "ClusterStatus.proto";
32 message GetRegionInfoRequest {
33 required RegionSpecifier region = 1;
34 optional bool compaction_state = 2;
37 message GetRegionInfoResponse {
38 required RegionInfo region_info = 1;
39 optional CompactionState compaction_state = 2;
40 optional bool isRecovering = 3;
42 enum CompactionState {
51 * Get a list of store files for a set of column families in a particular region.
52 * If no column family is specified, get the store files for all column families.
54 message GetStoreFileRequest {
55 required RegionSpecifier region = 1;
56 repeated bytes family = 2;
59 message GetStoreFileResponse {
60 repeated string store_file = 1;
63 message GetOnlineRegionRequest {
66 message GetOnlineRegionResponse {
67 repeated RegionInfo region_info = 1;
70 message OpenRegionRequest {
71 repeated RegionOpenInfo open_info = 1;
72 // the intended server for this RPC.
73 optional uint64 serverStartCode = 2;
74 // wall clock time from master
75 optional uint64 master_system_time = 5;
77 message RegionOpenInfo {
78 required RegionInfo region = 1;
79 optional uint32 version_of_offline_node = 2;
80 repeated ServerName favored_nodes = 3;
81 // open region for distributedLogReplay
82 optional bool openForDistributedLogReplay = 4;
86 message OpenRegionResponse {
87 repeated RegionOpeningState opening_state = 1;
89 enum RegionOpeningState {
96 message WarmupRegionRequest {
98 required RegionInfo regionInfo = 1;
101 message WarmupRegionResponse {
105 * Closes the specified region and will use or not use ZK during the close
106 * according to the specified flag.
108 message CloseRegionRequest {
109 required RegionSpecifier region = 1;
110 optional uint32 version_of_closing_node = 2;
111 optional bool transition_in_ZK = 3 [default = true];
112 optional ServerName destination_server = 4;
113 // the intended server for this RPC.
114 optional uint64 serverStartCode = 5;
117 message CloseRegionResponse {
118 required bool closed = 1;
122 * Closes the specified region(s) for
125 message CloseRegionForSplitOrMergeRequest {
126 repeated RegionSpecifier region = 1;
129 message CloseRegionForSplitOrMergeResponse {
130 required bool closed = 1;
134 * Flushes the MemStore of the specified region.
136 * This method is synchronous.
138 message FlushRegionRequest {
139 required RegionSpecifier region = 1;
140 optional uint64 if_older_than_ts = 2;
141 optional bool write_flush_wal_marker = 3; // whether to write a marker to WAL even if not flushed
144 message FlushRegionResponse {
145 required uint64 last_flush_time = 1;
146 optional bool flushed = 2;
147 optional bool wrote_flush_wal_marker = 3;
151 * Splits the specified region.
153 * This method currently flushes the region and then forces a compaction which
154 * will then trigger a split. The flush is done synchronously but the
155 * compaction is asynchronous.
157 message SplitRegionRequest {
158 required RegionSpecifier region = 1;
159 optional bytes split_point = 2;
162 message SplitRegionResponse {
166 * Compacts the specified region. Performs a major compaction if specified.
168 * This method is asynchronous.
170 message CompactRegionRequest {
171 required RegionSpecifier region = 1;
172 optional bool major = 2;
173 optional bytes family = 3;
176 message CompactRegionResponse {
179 message UpdateFavoredNodesRequest {
180 repeated RegionUpdateInfo update_info = 1;
182 message RegionUpdateInfo {
183 required RegionInfo region = 1;
184 repeated ServerName favored_nodes = 2;
188 message UpdateFavoredNodesResponse {
189 optional uint32 response = 1;
192 // Protocol buffer version of WAL for replication
194 required WALKey key = 1;
195 // Following may be null if the KVs/Cells are carried along the side in a cellblock (See
196 // RPC for more on cellblocks). If Cells/KVs are in a cellblock, this next field is null
197 // and associated_cell_count has count of Cells associated w/ this WALEntry
198 repeated bytes key_value_bytes = 2;
199 // If Cell data is carried alongside in a cellblock, this is count of Cells in the cellblock.
200 optional int32 associated_cell_count = 3;
204 * Replicates the given entries. The guarantee is that the given entries
205 * will be durable on the slave cluster if this method returns without
208 message ReplicateWALEntryRequest {
209 repeated WALEntry entry = 1;
210 optional string replicationClusterId = 2;
211 optional string sourceBaseNamespaceDirPath = 3;
212 optional string sourceHFileArchiveDirPath = 4;
215 message ReplicateWALEntryResponse {
218 message RollWALWriterRequest {
222 * Roll request responses no longer include regions to flush
223 * this list will always be empty when talking to a 1.0 server
225 message RollWALWriterResponse {
226 // A list of encoded name of regions to flush
227 repeated bytes region_to_flush = 1;
230 message StopServerRequest {
231 required string reason = 1;
234 message StopServerResponse {
237 message GetServerInfoRequest {
241 required ServerName server_name = 1;
242 optional uint32 webui_port = 2;
245 message GetServerInfoResponse {
246 required ServerInfo server_info = 1;
249 message UpdateConfigurationRequest {
252 message UpdateConfigurationResponse {
255 message GetRegionLoadRequest {
256 optional TableName table_name = 1;
259 message GetRegionLoadResponse {
260 repeated RegionLoad region_loads = 1;
263 service AdminService {
264 rpc GetRegionInfo(GetRegionInfoRequest)
265 returns(GetRegionInfoResponse);
267 rpc GetStoreFile(GetStoreFileRequest)
268 returns(GetStoreFileResponse);
270 rpc GetOnlineRegion(GetOnlineRegionRequest)
271 returns(GetOnlineRegionResponse);
273 rpc OpenRegion(OpenRegionRequest)
274 returns(OpenRegionResponse);
276 rpc WarmupRegion(WarmupRegionRequest)
277 returns(WarmupRegionResponse);
279 rpc CloseRegion(CloseRegionRequest)
280 returns(CloseRegionResponse);
282 rpc CloseRegionForSplitOrMerge(CloseRegionForSplitOrMergeRequest)
283 returns(CloseRegionForSplitOrMergeResponse);
285 rpc FlushRegion(FlushRegionRequest)
286 returns(FlushRegionResponse);
288 rpc SplitRegion(SplitRegionRequest)
289 returns(SplitRegionResponse);
291 rpc CompactRegion(CompactRegionRequest)
292 returns(CompactRegionResponse);
294 rpc ReplicateWALEntry(ReplicateWALEntryRequest)
295 returns(ReplicateWALEntryResponse);
297 rpc Replay(ReplicateWALEntryRequest)
298 returns(ReplicateWALEntryResponse);
300 rpc RollWALWriter(RollWALWriterRequest)
301 returns(RollWALWriterResponse);
303 rpc GetServerInfo(GetServerInfoRequest)
304 returns(GetServerInfoResponse);
306 rpc StopServer(StopServerRequest)
307 returns(StopServerResponse);
309 rpc UpdateFavoredNodes(UpdateFavoredNodesRequest)
310 returns(UpdateFavoredNodesResponse);
312 rpc UpdateConfiguration(UpdateConfigurationRequest)
313 returns(UpdateConfigurationResponse);
315 rpc GetRegionLoad(GetRegionLoadRequest)
316 returns(GetRegionLoadResponse);