RegionServerStatus.proto 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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 RegionServerStatusProtocol.
  19. package pb;
  20. option java_package = "org.apache.hadoop.hbase.protobuf.generated";
  21. option java_outer_classname = "RegionServerStatusProtos";
  22. option java_generic_services = true;
  23. option java_generate_equals_and_hash = true;
  24. option optimize_for = SPEED;
  25. import "HBase.proto";
  26. import "ClusterStatus.proto";
  27. message RegionServerStartupRequest {
  28. /** Port number this regionserver is up on */
  29. required uint32 port = 1;
  30. /** This servers' startcode */
  31. required uint64 server_start_code = 2;
  32. /** Current time of the region server in ms */
  33. required uint64 server_current_time = 3;
  34. /** hostname for region server, optional */
  35. optional string use_this_hostname_instead = 4;
  36. }
  37. message RegionServerStartupResponse {
  38. /**
  39. * Configuration for the regionserver to use: e.g. filesystem,
  40. * hbase rootdir, the hostname to use creating the RegionServer ServerName,
  41. * etc
  42. */
  43. repeated NameStringPair map_entries = 1;
  44. }
  45. message RegionServerReportRequest {
  46. required ServerName server = 1;
  47. /** load the server is under */
  48. optional ServerLoad load = 2;
  49. }
  50. message RegionServerReportResponse {
  51. }
  52. message ReportRSFatalErrorRequest {
  53. /** name of the server experiencing the error */
  54. required ServerName server = 1;
  55. /** informative text to expose in the master logs and UI */
  56. required string error_message = 2;
  57. }
  58. message ReportRSFatalErrorResponse {
  59. }
  60. message GetLastFlushedSequenceIdRequest {
  61. /** region name */
  62. required bytes region_name = 1;
  63. }
  64. message GetLastFlushedSequenceIdResponse {
  65. /** the last WAL sequence id flushed from MemStore to HFile for the region */
  66. required uint64 last_flushed_sequence_id = 1;
  67. /** the last WAL sequence id flushed from MemStore to HFile for stores of the region */
  68. repeated StoreSequenceId store_last_flushed_sequence_id = 2;
  69. }
  70. message RegionStateTransition {
  71. required TransitionCode transition_code = 1;
  72. /** Mutliple regions are involved during merging/splitting */
  73. repeated RegionInfo region_info = 2;
  74. /** For newly opened region, the open seq num is needed */
  75. optional uint64 open_seq_num = 3;
  76. enum TransitionCode {
  77. OPENED = 0;
  78. FAILED_OPEN = 1;
  79. /** No failed_close, in which case region server will abort */
  80. CLOSED = 2;
  81. /** Ask master for ok to split/merge region(s) */
  82. READY_TO_SPLIT = 3;
  83. READY_TO_MERGE = 4;
  84. SPLIT_PONR = 5;
  85. MERGE_PONR = 6;
  86. SPLIT = 7;
  87. MERGED = 8;
  88. SPLIT_REVERTED = 9;
  89. MERGE_REVERTED = 10;
  90. }
  91. }
  92. message ReportRegionStateTransitionRequest {
  93. /** This region server's server name */
  94. required ServerName server = 1;
  95. repeated RegionStateTransition transition = 2;
  96. }
  97. message ReportRegionStateTransitionResponse {
  98. /** Error message if failed to update the region state */
  99. optional string error_message = 1;
  100. }
  101. service RegionServerStatusService {
  102. /** Called when a region server first starts. */
  103. rpc RegionServerStartup(RegionServerStartupRequest)
  104. returns(RegionServerStartupResponse);
  105. /** Called to report the load the RegionServer is under. */
  106. rpc RegionServerReport(RegionServerReportRequest)
  107. returns(RegionServerReportResponse);
  108. /**
  109. * Called by a region server to report a fatal error that is causing it to
  110. * abort.
  111. */
  112. rpc ReportRSFatalError(ReportRSFatalErrorRequest)
  113. returns(ReportRSFatalErrorResponse);
  114. /** Called to get the sequence id of the last MemStore entry flushed to an
  115. * HFile for a specified region. Used by the region server to speed up
  116. * log splitting. */
  117. rpc GetLastFlushedSequenceId(GetLastFlushedSequenceIdRequest)
  118. returns(GetLastFlushedSequenceIdResponse);
  119. /**
  120. * Called by a region server to report the progress of a region
  121. * transition. If the request fails, the transition should
  122. * be aborted.
  123. */
  124. rpc ReportRegionStateTransition(ReportRegionStateTransitionRequest)
  125. returns(ReportRegionStateTransitionResponse);
  126. }