ClientDatanodeProtocol.proto 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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. /**
  19. * These .proto interfaces are private and stable.
  20. * Please see http://wiki.apache.org/hadoop/Compatibility
  21. * for what changes are allowed for a *stable* .proto interface.
  22. */
  23. // This file contains protocol buffers that are used throughout HDFS -- i.e.
  24. // by the client, server, and data transfer protocols.
  25. option java_package = "org.apache.hadoop.hdfs.protocol.proto";
  26. option java_outer_classname = "ClientDatanodeProtocolProtos";
  27. option java_generic_services = true;
  28. option java_generate_equals_and_hash = true;
  29. package hadoop.hdfs;
  30. import "Security.proto";
  31. import "hdfs.proto";
  32. import "ReconfigurationProtocol.proto";
  33. /**
  34. * block - block for which visible length is requested
  35. */
  36. message GetReplicaVisibleLengthRequestProto {
  37. required ExtendedBlockProto block = 1;
  38. }
  39. /**
  40. * length - visible length of the block
  41. */
  42. message GetReplicaVisibleLengthResponseProto {
  43. required uint64 length = 1;
  44. }
  45. /**
  46. * void request
  47. */
  48. message RefreshNamenodesRequestProto {
  49. }
  50. /**
  51. * void response
  52. */
  53. message RefreshNamenodesResponseProto {
  54. }
  55. /**
  56. * blockPool - block pool to be deleted
  57. * force - if false, delete the block pool only if it is empty.
  58. * if true, delete the block pool even if it has blocks.
  59. */
  60. message DeleteBlockPoolRequestProto {
  61. required string blockPool = 1;
  62. required bool force = 2;
  63. }
  64. /**
  65. * void response
  66. */
  67. message DeleteBlockPoolResponseProto {
  68. }
  69. /**
  70. * Gets the file information where block and its metadata is stored
  71. * block - block for which path information is being requested
  72. * token - block token
  73. *
  74. * This message is deprecated in favor of file descriptor passing.
  75. */
  76. message GetBlockLocalPathInfoRequestProto {
  77. required ExtendedBlockProto block = 1;
  78. required hadoop.common.TokenProto token = 2;
  79. }
  80. /**
  81. * block - block for which file path information is being returned
  82. * localPath - file path where the block data is stored
  83. * localMetaPath - file path where the block meta data is stored
  84. *
  85. * This message is deprecated in favor of file descriptor passing.
  86. */
  87. message GetBlockLocalPathInfoResponseProto {
  88. required ExtendedBlockProto block = 1;
  89. required string localPath = 2;
  90. required string localMetaPath = 3;
  91. }
  92. /**
  93. * forUpgrade - if true, clients are advised to wait for restart and quick
  94. * upgrade restart is instrumented. Otherwise, datanode does
  95. * the regular shutdown.
  96. */
  97. message ShutdownDatanodeRequestProto {
  98. required bool forUpgrade = 1;
  99. }
  100. message ShutdownDatanodeResponseProto {
  101. }
  102. /** Tell datanode to evict active clients that are writing */
  103. message EvictWritersRequestProto {
  104. }
  105. message EvictWritersResponseProto {
  106. }
  107. /**
  108. * Ping datanode for liveness and quick info
  109. */
  110. message GetDatanodeInfoRequestProto {
  111. }
  112. message GetDatanodeInfoResponseProto {
  113. required DatanodeLocalInfoProto localInfo = 1;
  114. }
  115. message TriggerBlockReportRequestProto {
  116. required bool incremental = 1;
  117. }
  118. message TriggerBlockReportResponseProto {
  119. }
  120. message GetBalancerBandwidthRequestProto {
  121. }
  122. /**
  123. * bandwidth - balancer bandwidth value of the datanode.
  124. */
  125. message GetBalancerBandwidthResponseProto {
  126. required uint64 bandwidth = 1;
  127. }
  128. /**
  129. * This message allows a client to submit a disk
  130. * balancer plan to a data node.
  131. */
  132. message SubmitDiskBalancerPlanRequestProto {
  133. required string planID = 1; // A hash of the plan like SHA512
  134. required string plan = 2; // Json String that describes the plan
  135. optional uint64 planVersion = 3; // Plan version number
  136. optional uint64 maxDiskBandwidth = 4; // optional bandwidth control.
  137. }
  138. /**
  139. * Response from the DataNode on Plan Submit request
  140. */
  141. message SubmitDiskBalancerPlanResponseProto {
  142. }
  143. /**
  144. * This message describes a request to cancel an
  145. * outstanding disk balancer plan
  146. */
  147. message CancelPlanRequestProto {
  148. required string planID = 1;
  149. }
  150. /**
  151. * This is the response for the cancellation request
  152. */
  153. message CancelPlanResponseProto {
  154. }
  155. /**
  156. * This message allows a client to query data node to see
  157. * if a disk balancer plan is executing and if so what is
  158. * the status.
  159. */
  160. message QueryPlanStatusRequestProto {
  161. }
  162. /**
  163. * This message describes a plan if it is in progress
  164. */
  165. message QueryPlanStatusResponseProto {
  166. optional uint32 result = 1;
  167. optional string planID = 2;
  168. optional string currentStatus = 3;
  169. }
  170. /**
  171. * This message sends a request to data node get a specific setting
  172. * that is used by disk balancer.
  173. */
  174. message DiskBalancerSettingRequestProto {
  175. required string key = 1;
  176. }
  177. /**
  178. * Response that describes the value of requested disk balancer setting.
  179. */
  180. message DiskBalancerSettingResponseProto {
  181. required string value = 1;
  182. }
  183. /**
  184. * Protocol used from client to the Datanode.
  185. * See the request and response for details of rpc call.
  186. */
  187. service ClientDatanodeProtocolService {
  188. /**
  189. * Returns the visible length of the replica
  190. */
  191. rpc getReplicaVisibleLength(GetReplicaVisibleLengthRequestProto)
  192. returns(GetReplicaVisibleLengthResponseProto);
  193. /**
  194. * Refresh the list of federated namenodes from updated configuration.
  195. * Adds new namenodes and stops the deleted namenodes.
  196. */
  197. rpc refreshNamenodes(RefreshNamenodesRequestProto)
  198. returns(RefreshNamenodesResponseProto);
  199. /**
  200. * Delete the block pool from the datanode.
  201. */
  202. rpc deleteBlockPool(DeleteBlockPoolRequestProto)
  203. returns(DeleteBlockPoolResponseProto);
  204. /**
  205. * Retrieves the path names of the block file and metadata file stored on the
  206. * local file system.
  207. */
  208. rpc getBlockLocalPathInfo(GetBlockLocalPathInfoRequestProto)
  209. returns(GetBlockLocalPathInfoResponseProto);
  210. rpc shutdownDatanode(ShutdownDatanodeRequestProto)
  211. returns(ShutdownDatanodeResponseProto);
  212. rpc evictWriters(EvictWritersRequestProto)
  213. returns(EvictWritersResponseProto);
  214. rpc getDatanodeInfo(GetDatanodeInfoRequestProto)
  215. returns(GetDatanodeInfoResponseProto);
  216. rpc getReconfigurationStatus(GetReconfigurationStatusRequestProto)
  217. returns(GetReconfigurationStatusResponseProto);
  218. rpc startReconfiguration(StartReconfigurationRequestProto)
  219. returns(StartReconfigurationResponseProto);
  220. rpc listReconfigurableProperties(
  221. ListReconfigurablePropertiesRequestProto)
  222. returns(ListReconfigurablePropertiesResponseProto);
  223. rpc triggerBlockReport(TriggerBlockReportRequestProto)
  224. returns(TriggerBlockReportResponseProto);
  225. /**
  226. * Returns the balancer bandwidth value of datanode.
  227. */
  228. rpc getBalancerBandwidth(GetBalancerBandwidthRequestProto)
  229. returns(GetBalancerBandwidthResponseProto);
  230. /**
  231. * Submit a disk balancer plan for execution
  232. */
  233. rpc submitDiskBalancerPlan(SubmitDiskBalancerPlanRequestProto)
  234. returns (SubmitDiskBalancerPlanResponseProto);
  235. /**
  236. * Cancel an executing plan
  237. */
  238. rpc cancelDiskBalancerPlan(CancelPlanRequestProto)
  239. returns (CancelPlanResponseProto);
  240. /**
  241. * Gets the status of an executing Plan
  242. */
  243. rpc queryDiskBalancerPlan(QueryPlanStatusRequestProto)
  244. returns (QueryPlanStatusResponseProto);
  245. /**
  246. * Gets run-time settings of Disk Balancer.
  247. */
  248. rpc getDiskBalancerSetting(DiskBalancerSettingRequestProto)
  249. returns(DiskBalancerSettingResponseProto);
  250. }