ClientDatanodeProtocol.proto 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. /**
  33. * block - block for which visible length is requested
  34. */
  35. message GetReplicaVisibleLengthRequestProto {
  36. required ExtendedBlockProto block = 1;
  37. }
  38. /**
  39. * length - visible length of the block
  40. */
  41. message GetReplicaVisibleLengthResponseProto {
  42. required uint64 length = 1;
  43. }
  44. /**
  45. * void request
  46. */
  47. message RefreshNamenodesRequestProto {
  48. }
  49. /**
  50. * void response
  51. */
  52. message RefreshNamenodesResponseProto {
  53. }
  54. /**
  55. * blockPool - block pool to be deleted
  56. * force - if false, delete the block pool only if it is empty.
  57. * if true, delete the block pool even if it has blocks.
  58. */
  59. message DeleteBlockPoolRequestProto {
  60. required string blockPool = 1;
  61. required bool force = 2;
  62. }
  63. /**
  64. * void response
  65. */
  66. message DeleteBlockPoolResponseProto {
  67. }
  68. /**
  69. * Gets the file information where block and its metadata is stored
  70. * block - block for which path information is being requested
  71. * token - block token
  72. *
  73. * This message is deprecated in favor of file descriptor passing.
  74. */
  75. message GetBlockLocalPathInfoRequestProto {
  76. required ExtendedBlockProto block = 1;
  77. required hadoop.common.TokenProto token = 2;
  78. }
  79. /**
  80. * block - block for which file path information is being returned
  81. * localPath - file path where the block data is stored
  82. * localMetaPath - file path where the block meta data is stored
  83. *
  84. * This message is deprecated in favor of file descriptor passing.
  85. */
  86. message GetBlockLocalPathInfoResponseProto {
  87. required ExtendedBlockProto block = 1;
  88. required string localPath = 2;
  89. required string localMetaPath = 3;
  90. }
  91. /**
  92. * Query for the disk locations of a number of blocks on this DN.
  93. * blockPoolId - the pool to query
  94. * blockIds - list of block IDs to query
  95. * tokens - list of access tokens corresponding to list of block IDs
  96. */
  97. message GetHdfsBlockLocationsRequestProto {
  98. // Removed: HDFS-3969
  99. // repeated ExtendedBlockProto blocks = 1;
  100. repeated hadoop.common.TokenProto tokens = 2;
  101. required string blockPoolId = 3;
  102. repeated sfixed64 blockIds = 4 [ packed = true ];
  103. }
  104. /**
  105. * volumeIds - id of each volume, potentially multiple bytes
  106. * volumeIndexes - for each block, an index into volumeIds specifying the volume
  107. * on which it is located. If block is not present on any volume,
  108. * index is set to MAX_INT.
  109. */
  110. message GetHdfsBlockLocationsResponseProto {
  111. repeated bytes volumeIds = 1;
  112. repeated uint32 volumeIndexes = 2 [ packed = true ];
  113. }
  114. /**
  115. * forUpgrade - if true, clients are advised to wait for restart and quick
  116. * upgrade restart is instrumented. Otherwise, datanode does
  117. * the regular shutdown.
  118. */
  119. message ShutdownDatanodeRequestProto {
  120. required bool forUpgrade = 1;
  121. }
  122. message ShutdownDatanodeResponseProto {
  123. }
  124. /**
  125. * Ping datanode for liveness and quick info
  126. */
  127. message GetDatanodeInfoRequestProto {
  128. }
  129. message GetDatanodeInfoResponseProto {
  130. required DatanodeLocalInfoProto localInfo = 1;
  131. }
  132. /**
  133. * Protocol used from client to the Datanode.
  134. * See the request and response for details of rpc call.
  135. */
  136. service ClientDatanodeProtocolService {
  137. /**
  138. * Returns the visible length of the replica
  139. */
  140. rpc getReplicaVisibleLength(GetReplicaVisibleLengthRequestProto)
  141. returns(GetReplicaVisibleLengthResponseProto);
  142. /**
  143. * Refresh the list of federated namenodes from updated configuration.
  144. * Adds new namenodes and stops the deleted namenodes.
  145. */
  146. rpc refreshNamenodes(RefreshNamenodesRequestProto)
  147. returns(RefreshNamenodesResponseProto);
  148. /**
  149. * Delete the block pool from the datanode.
  150. */
  151. rpc deleteBlockPool(DeleteBlockPoolRequestProto)
  152. returns(DeleteBlockPoolResponseProto);
  153. /**
  154. * Retrieves the path names of the block file and metadata file stored on the
  155. * local file system.
  156. */
  157. rpc getBlockLocalPathInfo(GetBlockLocalPathInfoRequestProto)
  158. returns(GetBlockLocalPathInfoResponseProto);
  159. /**
  160. * Retrieve additional HDFS-specific metadata about a set of blocks stored
  161. * on the local file system.
  162. */
  163. rpc getHdfsBlockLocations(GetHdfsBlockLocationsRequestProto)
  164. returns(GetHdfsBlockLocationsResponseProto);
  165. rpc shutdownDatanode(ShutdownDatanodeRequestProto)
  166. returns(ShutdownDatanodeResponseProto);
  167. rpc getDatanodeInfo(GetDatanodeInfoRequestProto)
  168. returns(GetDatanodeInfoResponseProto);
  169. }