1
0

ClientDatanodeProtocol.proto 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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 GetVolumeReportRequestProto {
  116. }
  117. message GetVolumeReportResponseProto {
  118. repeated DatanodeVolumeInfoProto volumeInfo = 1;
  119. }
  120. message TriggerBlockReportRequestProto {
  121. required bool incremental = 1;
  122. }
  123. message TriggerBlockReportResponseProto {
  124. }
  125. message GetBalancerBandwidthRequestProto {
  126. }
  127. /**
  128. * bandwidth - balancer bandwidth value of the datanode.
  129. */
  130. message GetBalancerBandwidthResponseProto {
  131. required uint64 bandwidth = 1;
  132. }
  133. /**
  134. * This message allows a client to submit a disk
  135. * balancer plan to a data node.
  136. */
  137. message SubmitDiskBalancerPlanRequestProto {
  138. required string planID = 1; // A hash of the plan like SHA-1
  139. required string plan = 2; // Plan file data in Json format
  140. optional uint64 planVersion = 3; // Plan version number
  141. optional bool ignoreDateCheck = 4; // Ignore date checks on this plan.
  142. required string planFile = 5; // Plan file path
  143. }
  144. /**
  145. * Response from the DataNode on Plan Submit request
  146. */
  147. message SubmitDiskBalancerPlanResponseProto {
  148. }
  149. /**
  150. * This message describes a request to cancel an
  151. * outstanding disk balancer plan
  152. */
  153. message CancelPlanRequestProto {
  154. required string planID = 1;
  155. }
  156. /**
  157. * This is the response for the cancellation request
  158. */
  159. message CancelPlanResponseProto {
  160. }
  161. /**
  162. * This message allows a client to query data node to see
  163. * if a disk balancer plan is executing and if so what is
  164. * the status.
  165. */
  166. message QueryPlanStatusRequestProto {
  167. }
  168. /**
  169. * This message describes a plan if it is in progress
  170. */
  171. message QueryPlanStatusResponseProto {
  172. optional uint32 result = 1;
  173. optional string planID = 2;
  174. optional string currentStatus = 3;
  175. optional string planFile = 4;
  176. }
  177. /**
  178. * This message sends a request to data node get a specific setting
  179. * that is used by disk balancer.
  180. */
  181. message DiskBalancerSettingRequestProto {
  182. required string key = 1;
  183. }
  184. /**
  185. * Response that describes the value of requested disk balancer setting.
  186. */
  187. message DiskBalancerSettingResponseProto {
  188. required string value = 1;
  189. }
  190. /**
  191. * Protocol used from client to the Datanode.
  192. * See the request and response for details of rpc call.
  193. */
  194. service ClientDatanodeProtocolService {
  195. /**
  196. * Returns the visible length of the replica
  197. */
  198. rpc getReplicaVisibleLength(GetReplicaVisibleLengthRequestProto)
  199. returns(GetReplicaVisibleLengthResponseProto);
  200. /**
  201. * Refresh the list of federated namenodes from updated configuration.
  202. * Adds new namenodes and stops the deleted namenodes.
  203. */
  204. rpc refreshNamenodes(RefreshNamenodesRequestProto)
  205. returns(RefreshNamenodesResponseProto);
  206. /**
  207. * Delete the block pool from the datanode.
  208. */
  209. rpc deleteBlockPool(DeleteBlockPoolRequestProto)
  210. returns(DeleteBlockPoolResponseProto);
  211. /**
  212. * Retrieves the path names of the block file and metadata file stored on the
  213. * local file system.
  214. */
  215. rpc getBlockLocalPathInfo(GetBlockLocalPathInfoRequestProto)
  216. returns(GetBlockLocalPathInfoResponseProto);
  217. rpc shutdownDatanode(ShutdownDatanodeRequestProto)
  218. returns(ShutdownDatanodeResponseProto);
  219. rpc evictWriters(EvictWritersRequestProto)
  220. returns(EvictWritersResponseProto);
  221. rpc getDatanodeInfo(GetDatanodeInfoRequestProto)
  222. returns(GetDatanodeInfoResponseProto);
  223. rpc getVolumeReport(GetVolumeReportRequestProto)
  224. returns(GetVolumeReportResponseProto);
  225. rpc getReconfigurationStatus(GetReconfigurationStatusRequestProto)
  226. returns(GetReconfigurationStatusResponseProto);
  227. rpc startReconfiguration(StartReconfigurationRequestProto)
  228. returns(StartReconfigurationResponseProto);
  229. rpc listReconfigurableProperties(
  230. ListReconfigurablePropertiesRequestProto)
  231. returns(ListReconfigurablePropertiesResponseProto);
  232. rpc triggerBlockReport(TriggerBlockReportRequestProto)
  233. returns(TriggerBlockReportResponseProto);
  234. /**
  235. * Returns the balancer bandwidth value of datanode.
  236. */
  237. rpc getBalancerBandwidth(GetBalancerBandwidthRequestProto)
  238. returns(GetBalancerBandwidthResponseProto);
  239. /**
  240. * Submit a disk balancer plan for execution
  241. */
  242. rpc submitDiskBalancerPlan(SubmitDiskBalancerPlanRequestProto)
  243. returns (SubmitDiskBalancerPlanResponseProto);
  244. /**
  245. * Cancel an executing plan
  246. */
  247. rpc cancelDiskBalancerPlan(CancelPlanRequestProto)
  248. returns (CancelPlanResponseProto);
  249. /**
  250. * Gets the status of an executing Plan
  251. */
  252. rpc queryDiskBalancerPlan(QueryPlanStatusRequestProto)
  253. returns (QueryPlanStatusResponseProto);
  254. /**
  255. * Gets run-time settings of Disk Balancer.
  256. */
  257. rpc getDiskBalancerSetting(DiskBalancerSettingRequestProto)
  258. returns(DiskBalancerSettingResponseProto);
  259. }