NamenodeProtocol.proto 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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. syntax = "proto2";
  26. option java_package = "org.apache.hadoop.hdfs.protocol.proto";
  27. option java_outer_classname = "NamenodeProtocolProtos";
  28. option java_generic_services = true;
  29. option java_generate_equals_and_hash = true;
  30. package hadoop.hdfs.namenode;
  31. import "hdfs.proto";
  32. import "HdfsServer.proto";
  33. /**
  34. * Get list of blocks for a given datanode with the total length
  35. * of adding up to given size
  36. * datanode - Datanode ID to get list of block from
  37. * size - size to which the block lengths must add up to
  38. */
  39. message GetBlocksRequestProto {
  40. required DatanodeIDProto datanode = 1; // Datanode ID
  41. required uint64 size = 2; // Size in bytes
  42. }
  43. /**
  44. * blocks - List of returned blocks
  45. */
  46. message GetBlocksResponseProto {
  47. required BlocksWithLocationsProto blocks = 1; // List of blocks
  48. }
  49. /**
  50. * void request
  51. */
  52. message GetBlockKeysRequestProto {
  53. }
  54. /**
  55. * keys - Information about block keys at the active namenode
  56. */
  57. message GetBlockKeysResponseProto {
  58. optional ExportedBlockKeysProto keys = 1;
  59. }
  60. /**
  61. * void request
  62. */
  63. message GetTransactionIdRequestProto {
  64. }
  65. /**
  66. * txId - Transaction ID of the most recently persisted edit log record
  67. */
  68. message GetTransactionIdResponseProto {
  69. required uint64 txId = 1; // Transaction ID
  70. }
  71. /**
  72. * void request
  73. */
  74. message RollEditLogRequestProto {
  75. }
  76. /**
  77. * signature - A unique token to identify checkpoint transaction
  78. */
  79. message RollEditLogResponseProto {
  80. required CheckpointSignatureProto signature = 1;
  81. }
  82. /**
  83. * void request
  84. */
  85. message GetMostRecentCheckpointTxIdRequestProto {
  86. }
  87. message GetMostRecentCheckpointTxIdResponseProto{
  88. required uint64 txId = 1;
  89. }
  90. /**
  91. * registration - Namenode reporting the error
  92. * errorCode - error code indicating the error
  93. * msg - Free text description of the error
  94. */
  95. message ErrorReportRequestProto {
  96. required NamenodeRegistrationProto registration = 1; // Registration info
  97. required uint32 errorCode = 2; // Error code
  98. required string msg = 3; // Error message
  99. }
  100. /**
  101. * void response
  102. */
  103. message ErrorReportResponseProto {
  104. }
  105. /**
  106. * registration - Information of the namenode registering with primary namenode
  107. */
  108. message RegisterRequestProto {
  109. required NamenodeRegistrationProto registration = 1; // Registration info
  110. }
  111. /**
  112. * registration - Updated registration information of the newly registered
  113. * datanode.
  114. */
  115. message RegisterResponseProto {
  116. required NamenodeRegistrationProto registration = 1; // Registration info
  117. }
  118. /**
  119. * Start checkpoint request
  120. * registration - Namenode that is starting the checkpoint
  121. */
  122. message StartCheckpointRequestProto {
  123. required NamenodeRegistrationProto registration = 1; // Registration info
  124. }
  125. /**
  126. * command - Command returned by the active namenode to be
  127. * be handled by the caller.
  128. */
  129. message StartCheckpointResponseProto {
  130. required NamenodeCommandProto command = 1;
  131. }
  132. /**
  133. * End or finalize the previously started checkpoint
  134. * registration - Namenode that is ending the checkpoint
  135. * signature - unique token to identify checkpoint transaction,
  136. * that was received when checkpoint was started.
  137. */
  138. message EndCheckpointRequestProto {
  139. required NamenodeRegistrationProto registration = 1; // Registration info
  140. required CheckpointSignatureProto signature = 2;
  141. }
  142. /**
  143. * void response
  144. */
  145. message EndCheckpointResponseProto {
  146. }
  147. /**
  148. * sinceTxId - return the editlog information for transactions >= sinceTxId
  149. */
  150. message GetEditLogManifestRequestProto {
  151. required uint64 sinceTxId = 1; // Transaction ID
  152. }
  153. /**
  154. * manifest - Enumeration of editlogs from namenode for
  155. * logs >= sinceTxId in the request
  156. */
  157. message GetEditLogManifestResponseProto {
  158. required RemoteEditLogManifestProto manifest = 1;
  159. }
  160. /**
  161. * void request
  162. */
  163. message IsUpgradeFinalizedRequestProto {
  164. }
  165. message IsUpgradeFinalizedResponseProto {
  166. required bool isUpgradeFinalized = 1;
  167. }
  168. /**
  169. * void request
  170. */
  171. message IsRollingUpgradeRequestProto {
  172. }
  173. message IsRollingUpgradeResponseProto {
  174. required bool isRollingUpgrade = 1;
  175. }
  176. /**
  177. * Protocol used by the sub-ordinate namenode to send requests
  178. * the active/primary namenode.
  179. *
  180. * See the request and response for details of rpc call.
  181. */
  182. service NamenodeProtocolService {
  183. /**
  184. * Get list of blocks for a given datanode with length
  185. * of blocks adding up to given size.
  186. */
  187. rpc getBlocks(GetBlocksRequestProto) returns(GetBlocksResponseProto);
  188. /**
  189. * Get the current block keys
  190. */
  191. rpc getBlockKeys(GetBlockKeysRequestProto) returns(GetBlockKeysResponseProto);
  192. /**
  193. * Get the transaction ID of the most recently persisted editlog record
  194. */
  195. rpc getTransactionId(GetTransactionIdRequestProto)
  196. returns(GetTransactionIdResponseProto);
  197. /**
  198. * Get the transaction ID of the most recently persisted editlog record
  199. */
  200. rpc getMostRecentCheckpointTxId(GetMostRecentCheckpointTxIdRequestProto)
  201. returns(GetMostRecentCheckpointTxIdResponseProto);
  202. /**
  203. * Close the current editlog and open a new one for checkpointing purposes
  204. */
  205. rpc rollEditLog(RollEditLogRequestProto) returns(RollEditLogResponseProto);
  206. /**
  207. * Request info about the version running on this NameNode
  208. */
  209. rpc versionRequest(VersionRequestProto) returns(VersionResponseProto);
  210. /**
  211. * Report from a sub-ordinate namenode of an error to the active namenode.
  212. * Active namenode may decide to unregister the reporting namenode
  213. * depending on the error.
  214. */
  215. rpc errorReport(ErrorReportRequestProto) returns(ErrorReportResponseProto);
  216. /**
  217. * Request to register a sub-ordinate namenode
  218. */
  219. rpc registerSubordinateNamenode(RegisterRequestProto) returns(RegisterResponseProto);
  220. /**
  221. * Request to start a checkpoint.
  222. */
  223. rpc startCheckpoint(StartCheckpointRequestProto)
  224. returns(StartCheckpointResponseProto);
  225. /**
  226. * End of finalize the previously started checkpoint
  227. */
  228. rpc endCheckpoint(EndCheckpointRequestProto)
  229. returns(EndCheckpointResponseProto);
  230. /**
  231. * Get editlog manifests from the active namenode for all the editlogs
  232. */
  233. rpc getEditLogManifest(GetEditLogManifestRequestProto)
  234. returns(GetEditLogManifestResponseProto);
  235. /**
  236. * Return whether the NameNode is in upgrade state (false) or not (true)
  237. */
  238. rpc isUpgradeFinalized(IsUpgradeFinalizedRequestProto)
  239. returns (IsUpgradeFinalizedResponseProto);
  240. /**
  241. * Return whether the NameNode is in rolling upgrade (true) or not (false).
  242. */
  243. rpc isRollingUpgrade(IsRollingUpgradeRequestProto)
  244. returns (IsRollingUpgradeResponseProto);
  245. }