1
0

ClientDatanodeProtocol.proto 8.2 KB

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