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;
29 import "server/Quota.proto";
30 import "server/ClusterStatus.proto";
31 import "server/region/WAL.proto";
32 import "server/region/TooSlowLog.proto";
34 message GetRegionInfoRequest {
35 required RegionSpecifier region = 1;
36 optional bool compaction_state = 2;
37 optional bool best_split_row = 3;
40 message GetRegionInfoResponse {
41 required RegionInfo region_info = 1;
42 optional CompactionState compaction_state = 2;
43 // optional bool DEPRECATED_isRecovering = 3;
44 // True if region is splittable, false otherwise.
45 optional bool splittable = 4;
46 // True if region is mergeable, false otherwise.
47 optional bool mergeable = 5;
49 optional bytes best_split_row = 6;
51 enum CompactionState {
60 * Get a list of store files for a set of column families in a particular region.
61 * If no column family is specified, get the store files for all column families.
63 message GetStoreFileRequest {
64 required RegionSpecifier region = 1;
65 repeated bytes family = 2;
68 message GetStoreFileResponse {
69 repeated string store_file = 1;
72 message GetOnlineRegionRequest {
75 message GetOnlineRegionResponse {
76 repeated RegionInfo region_info = 1;
79 message OpenRegionRequest {
80 repeated RegionOpenInfo open_info = 1;
81 // the intended server for this RPC.
82 optional uint64 serverStartCode = 2;
83 // wall clock time from master
84 optional uint64 master_system_time = 5;
86 message RegionOpenInfo {
87 required RegionInfo region = 1;
88 optional uint32 version_of_offline_node = 2;
89 repeated ServerName favored_nodes = 3;
90 // open region for distributedLogReplay
91 // optional bool DEPRECATED_openForDistributedLogReplay = 4;
92 optional int64 open_proc_id = 5 [default = -1];
96 message OpenRegionResponse {
97 repeated RegionOpeningState opening_state = 1;
99 enum RegionOpeningState {
106 message WarmupRegionRequest {
107 required RegionInfo regionInfo = 1;
110 message WarmupRegionResponse {
114 * Closes the specified region and will use or not use ZK during the close
115 * according to the specified flag.
117 message CloseRegionRequest {
118 required RegionSpecifier region = 1;
119 optional uint32 version_of_closing_node = 2;
120 optional bool transition_in_ZK = 3 [default = true];
121 optional ServerName destination_server = 4;
122 // the intended server for this RPC.
123 optional uint64 serverStartCode = 5;
124 optional int64 close_proc_id = 6 [default = -1];
127 message CloseRegionResponse {
128 required bool closed = 1;
132 * Flushes the MemStore of the specified region.
134 * This method is synchronous.
136 message FlushRegionRequest {
137 required RegionSpecifier region = 1;
138 optional uint64 if_older_than_ts = 2;
139 optional bool write_flush_wal_marker = 3; // whether to write a marker to WAL even if not flushed
140 optional bytes family = 4;
143 message FlushRegionResponse {
144 required uint64 last_flush_time = 1;
145 optional bool flushed = 2;
146 optional bool wrote_flush_wal_marker = 3;
150 * Compacts the specified region. Performs a major compaction if specified.
152 * This method is asynchronous.
154 message CompactRegionRequest {
155 required RegionSpecifier region = 1;
156 optional bool major = 2;
157 optional bytes family = 3;
160 message CompactRegionResponse {
163 message CompactionSwitchRequest {
164 required bool enabled = 1;
167 message CompactionSwitchResponse {
168 required bool prev_state = 1;
171 message UpdateFavoredNodesRequest {
172 repeated RegionUpdateInfo update_info = 1;
174 message RegionUpdateInfo {
175 required RegionInfo region = 1;
176 repeated ServerName favored_nodes = 2;
180 message UpdateFavoredNodesResponse {
181 optional uint32 response = 1;
184 // Protocol buffer version of WAL for replication
186 required WALKey key = 1;
187 // Following may be null if the KVs/Cells are carried along the side in a cellblock (See
188 // RPC for more on cellblocks). If Cells/KVs are in a cellblock, this next field is null
189 // and associated_cell_count has count of Cells associated w/ this WALEntry
190 repeated bytes key_value_bytes = 2;
191 // If Cell data is carried alongside in a cellblock, this is count of Cells in the cellblock.
192 optional int32 associated_cell_count = 3;
196 * Replicates the given entries. The guarantee is that the given entries
197 * will be durable on the slave cluster if this method returns without
200 message ReplicateWALEntryRequest {
201 repeated WALEntry entry = 1;
202 optional string replicationClusterId = 2;
203 optional string sourceBaseNamespaceDirPath = 3;
204 optional string sourceHFileArchiveDirPath = 4;
207 message ReplicateWALEntryResponse {
210 message RollWALWriterRequest {
214 * Roll request responses no longer include regions to flush
215 * this list will always be empty when talking to a 1.0 server
217 message RollWALWriterResponse {
218 // A list of encoded name of regions to flush
219 repeated bytes region_to_flush = 1;
222 message StopServerRequest {
223 required string reason = 1;
226 message StopServerResponse {
229 message GetServerInfoRequest {
233 required ServerName server_name = 1;
234 optional uint32 webui_port = 2;
237 message GetServerInfoResponse {
238 required ServerInfo server_info = 1;
241 message UpdateConfigurationRequest {
244 message UpdateConfigurationResponse {
247 message GetRegionLoadRequest {
248 optional TableName table_name = 1;
251 message GetRegionLoadResponse {
252 repeated RegionLoad region_loads = 1;
255 message ClearCompactionQueuesRequest {
256 repeated string queue_name = 1;
259 message ClearCompactionQueuesResponse {
262 message ClearRegionBlockCacheRequest {
263 repeated RegionSpecifier region = 1;
266 message ClearRegionBlockCacheResponse {
267 required CacheEvictionStats stats = 1;
270 message RemoteProcedureRequest {
271 required uint64 proc_id = 1;
272 required string proc_class = 2;
273 optional bytes proc_data = 3;
276 message ExecuteProceduresRequest {
277 repeated OpenRegionRequest open_region = 1;
278 repeated CloseRegionRequest close_region = 2;
279 repeated RemoteProcedureRequest proc = 3;
282 message ExecuteProceduresResponse {
286 * Slow/Large log (LogRequest) use-case specific RPC request. This request payload will be
287 * converted in bytes and sent to generic RPC API: GetLogEntries
288 * LogRequest message has two params:
289 * 1. log_class_name: SlowLogResponseRequest (for Slow/Large log use-case)
290 * 2. log_message: SlowLogResponseRequest converted in bytes (for Slow/Large log use-case)
292 message SlowLogResponseRequest {
293 enum FilterByOperator {
303 optional string region_name = 1;
304 optional string table_name = 2;
305 optional string client_address = 3;
306 optional string user_name = 4;
307 optional uint32 limit = 5 [default = 10];
308 optional FilterByOperator filter_by_operator = 6 [default = OR];
309 optional LogType log_type = 7;
313 * Slow/Large log (LogEntry) use-case specific RPC response. This response payload will be
314 * converted in bytes by servers and sent as response to generic RPC API: GetLogEntries
315 * LogEntry message has two params:
316 * 1. log_class_name: SlowLogResponses (for Slow/Large log use-case)
317 * 2. log_message: SlowLogResponses converted in bytes (for Slow/Large log use-case)
319 message SlowLogResponses {
320 repeated SlowLogPayload slow_log_payloads = 1;
323 message ClearSlowLogResponseRequest {
327 message ClearSlowLogResponses {
328 required bool is_cleaned = 1;
331 service AdminService {
332 rpc GetRegionInfo(GetRegionInfoRequest)
333 returns(GetRegionInfoResponse);
335 rpc GetStoreFile(GetStoreFileRequest)
336 returns(GetStoreFileResponse);
338 rpc GetOnlineRegion(GetOnlineRegionRequest)
339 returns(GetOnlineRegionResponse);
341 rpc OpenRegion(OpenRegionRequest)
342 returns(OpenRegionResponse);
344 rpc WarmupRegion(WarmupRegionRequest)
345 returns(WarmupRegionResponse);
347 rpc CloseRegion(CloseRegionRequest)
348 returns(CloseRegionResponse);
350 rpc FlushRegion(FlushRegionRequest)
351 returns(FlushRegionResponse);
353 rpc CompactionSwitch(CompactionSwitchRequest)
354 returns(CompactionSwitchResponse);
356 rpc CompactRegion(CompactRegionRequest)
357 returns(CompactRegionResponse);
359 rpc ReplicateWALEntry(ReplicateWALEntryRequest)
360 returns(ReplicateWALEntryResponse);
362 rpc Replay(ReplicateWALEntryRequest)
363 returns(ReplicateWALEntryResponse) {
364 option deprecated = true;
367 rpc ReplicateToReplica(ReplicateWALEntryRequest)
368 returns(ReplicateWALEntryResponse);
370 rpc RollWALWriter(RollWALWriterRequest)
371 returns(RollWALWriterResponse);
373 rpc GetServerInfo(GetServerInfoRequest)
374 returns(GetServerInfoResponse);
376 rpc StopServer(StopServerRequest)
377 returns(StopServerResponse);
379 rpc UpdateFavoredNodes(UpdateFavoredNodesRequest)
380 returns(UpdateFavoredNodesResponse);
382 rpc UpdateConfiguration(UpdateConfigurationRequest)
383 returns(UpdateConfigurationResponse);
385 rpc GetRegionLoad(GetRegionLoadRequest)
386 returns(GetRegionLoadResponse);
388 rpc ClearCompactionQueues(ClearCompactionQueuesRequest)
389 returns(ClearCompactionQueuesResponse);
391 rpc ClearRegionBlockCache(ClearRegionBlockCacheRequest)
392 returns(ClearRegionBlockCacheResponse);
394 /** Fetches the RegionServer's view of space quotas */
395 rpc GetSpaceQuotaSnapshots(GetSpaceQuotaSnapshotsRequest)
396 returns(GetSpaceQuotaSnapshotsResponse);
398 rpc ExecuteProcedures(ExecuteProceduresRequest)
399 returns(ExecuteProceduresResponse);
401 rpc ClearSlowLogsResponses(ClearSlowLogResponseRequest)
402 returns(ClearSlowLogResponses);
404 rpc GetLogEntries(LogRequest)