ClientDatanodeProtocol.proto 4.4 KB

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