ClientDatanodeProtocol.proto 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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. 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. * Query for the disk locations of a number of blocks on this DN.
  95. * blockPoolId - the pool to query
  96. * blockIds - list of block IDs to query
  97. * tokens - list of access tokens corresponding to list of block IDs
  98. */
  99. message GetHdfsBlockLocationsRequestProto {
  100. // Removed: HDFS-3969
  101. // repeated ExtendedBlockProto blocks = 1;
  102. repeated hadoop.common.TokenProto tokens = 2;
  103. required string blockPoolId = 3;
  104. repeated sfixed64 blockIds = 4 [ packed = true ];
  105. }
  106. /**
  107. * volumeIds - id of each volume, potentially multiple bytes
  108. * volumeIndexes - for each block, an index into volumeIds specifying the volume
  109. * on which it is located. If block is not present on any volume,
  110. * index is set to MAX_INT.
  111. */
  112. message GetHdfsBlockLocationsResponseProto {
  113. repeated bytes volumeIds = 1;
  114. repeated uint32 volumeIndexes = 2 [ packed = true ];
  115. }
  116. /**
  117. * forUpgrade - if true, clients are advised to wait for restart and quick
  118. * upgrade restart is instrumented. Otherwise, datanode does
  119. * the regular shutdown.
  120. */
  121. message ShutdownDatanodeRequestProto {
  122. required bool forUpgrade = 1;
  123. }
  124. message ShutdownDatanodeResponseProto {
  125. }
  126. /** Tell datanode to evict active clients that are writing */
  127. message EvictWritersRequestProto {
  128. }
  129. message EvictWritersResponseProto {
  130. }
  131. /**
  132. * Ping datanode for liveness and quick info
  133. */
  134. message GetDatanodeInfoRequestProto {
  135. }
  136. message GetDatanodeInfoResponseProto {
  137. required DatanodeLocalInfoProto localInfo = 1;
  138. }
  139. message GetVolumeReportRequestProto {
  140. }
  141. message GetVolumeReportResponseProto {
  142. repeated DatanodeVolumeInfoProto volumeInfo = 1;
  143. }
  144. message TriggerBlockReportRequestProto {
  145. required bool incremental = 1;
  146. }
  147. message TriggerBlockReportResponseProto {
  148. }
  149. message GetBalancerBandwidthRequestProto {
  150. }
  151. /**
  152. * bandwidth - balancer bandwidth value of the datanode.
  153. */
  154. message GetBalancerBandwidthResponseProto {
  155. required uint64 bandwidth = 1;
  156. }
  157. /**
  158. * Protocol used from client to the Datanode.
  159. * See the request and response for details of rpc call.
  160. */
  161. service ClientDatanodeProtocolService {
  162. /**
  163. * Returns the visible length of the replica
  164. */
  165. rpc getReplicaVisibleLength(GetReplicaVisibleLengthRequestProto)
  166. returns(GetReplicaVisibleLengthResponseProto);
  167. /**
  168. * Refresh the list of federated namenodes from updated configuration.
  169. * Adds new namenodes and stops the deleted namenodes.
  170. */
  171. rpc refreshNamenodes(RefreshNamenodesRequestProto)
  172. returns(RefreshNamenodesResponseProto);
  173. /**
  174. * Delete the block pool from the datanode.
  175. */
  176. rpc deleteBlockPool(DeleteBlockPoolRequestProto)
  177. returns(DeleteBlockPoolResponseProto);
  178. /**
  179. * Retrieves the path names of the block file and metadata file stored on the
  180. * local file system.
  181. */
  182. rpc getBlockLocalPathInfo(GetBlockLocalPathInfoRequestProto)
  183. returns(GetBlockLocalPathInfoResponseProto);
  184. /**
  185. * Retrieve additional HDFS-specific metadata about a set of blocks stored
  186. * on the local file system.
  187. */
  188. rpc getHdfsBlockLocations(GetHdfsBlockLocationsRequestProto)
  189. returns(GetHdfsBlockLocationsResponseProto);
  190. rpc shutdownDatanode(ShutdownDatanodeRequestProto)
  191. returns(ShutdownDatanodeResponseProto);
  192. rpc evictWriters(EvictWritersRequestProto)
  193. returns(EvictWritersResponseProto);
  194. rpc getDatanodeInfo(GetDatanodeInfoRequestProto)
  195. returns(GetDatanodeInfoResponseProto);
  196. rpc getVolumeReport(GetVolumeReportRequestProto)
  197. returns(GetVolumeReportResponseProto);
  198. rpc getReconfigurationStatus(GetReconfigurationStatusRequestProto)
  199. returns(GetReconfigurationStatusResponseProto);
  200. rpc startReconfiguration(StartReconfigurationRequestProto)
  201. returns(StartReconfigurationResponseProto);
  202. rpc listReconfigurableProperties(
  203. ListReconfigurablePropertiesRequestProto)
  204. returns(ListReconfigurablePropertiesResponseProto);
  205. rpc triggerBlockReport(TriggerBlockReportRequestProto)
  206. returns(TriggerBlockReportResponseProto);
  207. /**
  208. * Returns the balancer bandwidth value of datanode.
  209. */
  210. rpc getBalancerBandwidth(GetBalancerBandwidthRequestProto)
  211. returns(GetBalancerBandwidthResponseProto);
  212. }