ClientDatanodeProtocol.proto 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. // This file contains protocol buffers that are used throughout HDFS -- i.e.
  19. // by the client, server, and data transfer protocols.
  20. option java_package = "org.apache.hadoop.hdfs.protocol.proto";
  21. option java_outer_classname = "ClientDatanodeProtocolProtos";
  22. option java_generic_services = true;
  23. option java_generate_equals_and_hash = true;
  24. package hadoop.hdfs;
  25. import "hdfs.proto";
  26. /**
  27. * block - block for which visible length is requested
  28. */
  29. message GetReplicaVisibleLengthRequestProto {
  30. required ExtendedBlockProto block = 1;
  31. }
  32. /**
  33. * length - visible length of the block
  34. */
  35. message GetReplicaVisibleLengthResponseProto {
  36. required uint64 length = 1;
  37. }
  38. /**
  39. * void request
  40. */
  41. message RefreshNamenodesRequestProto {
  42. }
  43. /**
  44. * void response
  45. */
  46. message RefreshNamenodesResponseProto {
  47. }
  48. /**
  49. * blockPool - block pool to be deleted
  50. * force - if false, delete the block pool only if it is empty.
  51. * if true, delete the block pool even if it has blocks.
  52. */
  53. message DeleteBlockPoolRequestProto {
  54. required string blockPool = 1;
  55. required bool force = 2;
  56. }
  57. /**
  58. * void response
  59. */
  60. message DeleteBlockPoolResponseProto {
  61. }
  62. /**
  63. * Gets the file information where block and its metadata is stored
  64. * block - block for which path information is being requested
  65. * token - block token
  66. */
  67. message GetBlockLocalPathInfoRequestProto {
  68. required ExtendedBlockProto block = 1;
  69. required BlockTokenIdentifierProto token = 2;
  70. }
  71. /**
  72. * block - block for which file path information is being returned
  73. * localPath - file path where the block data is stored
  74. * localMetaPath - file path where the block meta data is stored
  75. */
  76. message GetBlockLocalPathInfoResponseProto {
  77. required ExtendedBlockProto block = 1;
  78. required string localPath = 2;
  79. required string localMetaPath = 3;
  80. }
  81. /**
  82. * blocks - list of ExtendedBlocks on which we are querying additional info
  83. * tokens - list of access tokens corresponding to list of ExtendedBlocks
  84. */
  85. message GetHdfsBlockLocationsRequestProto {
  86. repeated ExtendedBlockProto blocks = 1;
  87. repeated BlockTokenIdentifierProto tokens = 2;
  88. }
  89. /**
  90. * volumeIds - id of each volume, potentially multiple bytes
  91. * volumeIndexes - for each block, an index into volumeIds specifying the volume
  92. * on which it is located. If block is not present on any volume,
  93. * index is set to MAX_INT.
  94. */
  95. message GetHdfsBlockLocationsResponseProto {
  96. repeated bytes volumeIds = 1;
  97. repeated uint32 volumeIndexes = 2;
  98. }
  99. /**
  100. * Protocol used from client to the Datanode.
  101. * See the request and response for details of rpc call.
  102. */
  103. service ClientDatanodeProtocolService {
  104. /**
  105. * Returns the visible length of the replica
  106. */
  107. rpc getReplicaVisibleLength(GetReplicaVisibleLengthRequestProto)
  108. returns(GetReplicaVisibleLengthResponseProto);
  109. /**
  110. * Refresh the list of federated namenodes from updated configuration.
  111. * Adds new namenodes and stops the deleted namenodes.
  112. */
  113. rpc refreshNamenodes(RefreshNamenodesRequestProto)
  114. returns(RefreshNamenodesResponseProto);
  115. /**
  116. * Delete the block pool from the datanode.
  117. */
  118. rpc deleteBlockPool(DeleteBlockPoolRequestProto)
  119. returns(DeleteBlockPoolResponseProto);
  120. /**
  121. * Retrieves the path names of the block file and metadata file stored on the
  122. * local file system.
  123. */
  124. rpc getBlockLocalPathInfo(GetBlockLocalPathInfoRequestProto)
  125. returns(GetBlockLocalPathInfoResponseProto);
  126. /**
  127. * Retrieve additional HDFS-specific metadata about a set of blocks stored
  128. * on the local file system.
  129. */
  130. rpc getHdfsBlockLocations(GetHdfsBlockLocationsRequestProto)
  131. returns(GetHdfsBlockLocationsResponseProto);
  132. }