HdfsServer.proto 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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 = "HdfsServerProtos";
  27. option java_generate_equals_and_hash = true;
  28. package hadoop.hdfs;
  29. import "hdfs.proto";
  30. import "HAServiceProtocol.proto";
  31. /**
  32. * A list of storage IDs.
  33. */
  34. message StorageUuidsProto {
  35. repeated string storageUuids = 1;
  36. }
  37. /**
  38. * Block access token information
  39. */
  40. message BlockKeyProto {
  41. required uint32 keyId = 1; // Key identifier
  42. required uint64 expiryDate = 2; // Expiry time in milliseconds
  43. optional bytes keyBytes = 3; // Key secret
  44. }
  45. /**
  46. * Current key and set of block keys at the namenode.
  47. */
  48. message ExportedBlockKeysProto {
  49. required bool isBlockTokenEnabled = 1;
  50. required uint64 keyUpdateInterval = 2;
  51. required uint64 tokenLifeTime = 3;
  52. required BlockKeyProto currentKey = 4;
  53. repeated BlockKeyProto allKeys = 5;
  54. }
  55. /**
  56. * Block and datanodes where is it located
  57. */
  58. message BlockWithLocationsProto {
  59. required BlockProto block = 1; // Block
  60. repeated string datanodeUuids = 2; // Datanodes with replicas of the block
  61. repeated string storageUuids = 3; // Storages with replicas of the block
  62. repeated StorageTypeProto storageTypes = 4;
  63. }
  64. /**
  65. * List of block with locations
  66. */
  67. message BlocksWithLocationsProto {
  68. repeated BlockWithLocationsProto blocks = 1;
  69. }
  70. /**
  71. * Editlog information with available transactions
  72. */
  73. message RemoteEditLogProto {
  74. required uint64 startTxId = 1; // Starting available edit log transaction
  75. required uint64 endTxId = 2; // Ending available edit log transaction
  76. optional bool isInProgress = 3 [default = false];
  77. }
  78. /**
  79. * Enumeration of editlogs available on a remote namenode
  80. */
  81. message RemoteEditLogManifestProto {
  82. repeated RemoteEditLogProto logs = 1;
  83. }
  84. /**
  85. * Namespace information that describes namespace on a namenode
  86. */
  87. message NamespaceInfoProto {
  88. required string buildVersion = 1; // Software revision version (e.g. an svn or git revision)
  89. required uint32 unused = 2; // Retained for backward compatibility
  90. required string blockPoolID = 3; // block pool used by the namespace
  91. required StorageInfoProto storageInfo = 4;// Node information
  92. required string softwareVersion = 5; // Software version number (e.g. 2.0.0)
  93. optional uint64 capabilities = 6 [default = 0]; // feature flags
  94. optional NNHAStatusHeartbeatProto.State state = 7;
  95. }
  96. /**
  97. * State of a block replica at a datanode
  98. */
  99. enum ReplicaStateProto {
  100. FINALIZED = 0; // State of a replica when it is not modified
  101. RBW = 1; // State of replica that is being written to
  102. RWR = 2; // State of replica that is waiting to be recovered
  103. RUR = 3; // State of replica that is under recovery
  104. TEMPORARY = 4; // State of replica that is created for replication
  105. }
  106. /**
  107. * Block that needs to be recovered with at a given location
  108. */
  109. message RecoveringBlockProto {
  110. required uint64 newGenStamp = 1; // New genstamp post recovery
  111. required LocatedBlockProto block = 2; // Block to be recovered
  112. optional BlockProto truncateBlock = 3; // New block for recovery (truncate)
  113. }
  114. /**
  115. * Unique signature to identify checkpoint transactions.
  116. */
  117. message CheckpointSignatureProto {
  118. required string blockPoolId = 1;
  119. required uint64 mostRecentCheckpointTxId = 2;
  120. required uint64 curSegmentTxId = 3;
  121. required StorageInfoProto storageInfo = 4;
  122. }
  123. /**
  124. * Command returned from primary to checkpointing namenode.
  125. * This command has checkpoint signature that identifies
  126. * checkpoint transaction and is needed for further
  127. * communication related to checkpointing.
  128. */
  129. message CheckpointCommandProto {
  130. // Unique signature to identify checkpoint transation
  131. required CheckpointSignatureProto signature = 1;
  132. // If true, return transfer image to primary upon the completion of checkpoint
  133. required bool needToReturnImage = 2;
  134. }
  135. /**
  136. * Command sent from one namenode to another namenode.
  137. */
  138. message NamenodeCommandProto {
  139. enum Type {
  140. NamenodeCommand = 0; // Base command
  141. CheckPointCommand = 1; // Check point command
  142. }
  143. required uint32 action = 1;
  144. required Type type = 2;
  145. optional CheckpointCommandProto checkpointCmd = 3;
  146. }
  147. /**
  148. * void request
  149. */
  150. message VersionRequestProto {
  151. }
  152. /**
  153. * Version response from namenode.
  154. */
  155. message VersionResponseProto {
  156. required NamespaceInfoProto info = 1;
  157. }
  158. /**
  159. * Common node information shared by all the nodes in the cluster
  160. */
  161. message StorageInfoProto {
  162. required uint32 layoutVersion = 1; // Layout version of the file system
  163. required uint32 namespceID = 2; // File system namespace ID
  164. required string clusterID = 3; // ID of the cluster
  165. required uint64 cTime = 4; // File system creation time
  166. }
  167. /**
  168. * Information sent by a namenode to identify itself to the primary namenode.
  169. */
  170. message NamenodeRegistrationProto {
  171. required string rpcAddress = 1; // host:port of the namenode RPC address
  172. required string httpAddress = 2; // host:port of the namenode http server
  173. enum NamenodeRoleProto {
  174. NAMENODE = 1;
  175. BACKUP = 2;
  176. CHECKPOINT = 3;
  177. }
  178. required StorageInfoProto storageInfo = 3; // Node information
  179. optional NamenodeRoleProto role = 4 [default = NAMENODE]; // Namenode role
  180. }
  181. /**
  182. * state - State the NN is in when returning response to the DN
  183. * txid - Highest transaction ID this NN has seen
  184. */
  185. message NNHAStatusHeartbeatProto {
  186. enum State {
  187. ACTIVE = 0;
  188. STANDBY = 1;
  189. }
  190. required State state = 1;
  191. required uint64 txid = 2;
  192. }