FederationProtocol.proto 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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 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. option java_package = "org.apache.hadoop.hdfs.federation.protocol.proto";
  19. option java_outer_classname = "HdfsServerFederationProtos";
  20. option java_generic_services = true;
  21. option java_generate_equals_and_hash = true;
  22. package hadoop.hdfs;
  23. /////////////////////////////////////////////////
  24. // Membership
  25. /////////////////////////////////////////////////
  26. message NamenodeMembershipStatsRecordProto {
  27. optional uint64 totalSpace = 1;
  28. optional uint64 availableSpace = 2;
  29. optional uint64 numOfFiles = 10;
  30. optional uint64 numOfBlocks = 11;
  31. optional uint64 numOfBlocksMissing = 12;
  32. optional uint64 numOfBlocksPendingReplication = 13;
  33. optional uint64 numOfBlocksUnderReplicated = 14;
  34. optional uint64 numOfBlocksPendingDeletion = 15;
  35. optional uint32 numOfActiveDatanodes = 20;
  36. optional uint32 numOfDeadDatanodes = 21;
  37. optional uint32 numOfDecommissioningDatanodes = 22;
  38. optional uint32 numOfDecomActiveDatanodes = 23;
  39. optional uint32 numOfDecomDeadDatanodes = 24;
  40. }
  41. message NamenodeMembershipRecordProto {
  42. optional uint64 dateCreated = 1;
  43. optional uint64 dateModified = 2;
  44. optional uint64 lastContact = 3;
  45. optional string routerId = 4;
  46. optional string nameserviceId = 5;
  47. optional string namenodeId = 6;
  48. optional string clusterId = 7;
  49. optional string blockPoolId = 8;
  50. optional string webAddress = 9;
  51. optional string rpcAddress = 10;
  52. optional string serviceAddress = 11;
  53. optional string lifelineAddress = 12;
  54. optional string state = 13;
  55. optional bool isSafeMode = 14;
  56. optional NamenodeMembershipStatsRecordProto stats = 15;
  57. }
  58. message FederationNamespaceInfoProto {
  59. optional string blockPoolId = 1;
  60. optional string clusterId = 2;
  61. optional string nameserviceId = 3;
  62. }
  63. message GetNamenodeRegistrationsRequestProto {
  64. optional NamenodeMembershipRecordProto membership = 1;
  65. }
  66. message GetNamenodeRegistrationsResponseProto {
  67. repeated NamenodeMembershipRecordProto namenodeMemberships = 1;
  68. }
  69. message GetExpiredRegistrationsRequestProto {
  70. }
  71. message GetNamespaceInfoRequestProto {
  72. }
  73. message GetNamespaceInfoResponseProto {
  74. repeated FederationNamespaceInfoProto namespaceInfos = 1;
  75. }
  76. message UpdateNamenodeRegistrationRequestProto {
  77. optional string nameserviceId = 1;
  78. optional string namenodeId = 2;
  79. optional string state = 3;
  80. }
  81. message UpdateNamenodeRegistrationResponseProto {
  82. optional bool status = 1;
  83. }
  84. message NamenodeHeartbeatRequestProto {
  85. optional NamenodeMembershipRecordProto namenodeMembership = 1;
  86. }
  87. message NamenodeHeartbeatResponseProto {
  88. optional bool status = 1;
  89. }
  90. /////////////////////////////////////////////////
  91. // Mount table
  92. /////////////////////////////////////////////////
  93. message RemoteLocationProto {
  94. optional string nameserviceId = 1;
  95. optional string path = 2;
  96. }
  97. message MountTableRecordProto {
  98. optional string srcPath = 1;
  99. repeated RemoteLocationProto destinations = 2;
  100. optional uint64 dateCreated = 3;
  101. optional uint64 dateModified = 4;
  102. optional bool readOnly = 5 [default = false];
  103. enum DestOrder {
  104. HASH = 0;
  105. LOCAL = 1;
  106. RANDOM = 2;
  107. HASH_ALL = 3;
  108. SPACE = 4;
  109. }
  110. optional DestOrder destOrder = 6 [default = HASH];
  111. optional string ownerName = 10;
  112. optional string groupName = 11;
  113. optional int32 mode = 12;
  114. }
  115. message AddMountTableEntryRequestProto {
  116. optional MountTableRecordProto entry = 1;
  117. }
  118. message AddMountTableEntryResponseProto {
  119. optional bool status = 1;
  120. }
  121. message UpdateMountTableEntryRequestProto {
  122. optional MountTableRecordProto entry = 1;
  123. }
  124. message UpdateMountTableEntryResponseProto {
  125. optional bool status = 1;
  126. }
  127. message RemoveMountTableEntryRequestProto {
  128. optional string srcPath = 1;
  129. }
  130. message RemoveMountTableEntryResponseProto{
  131. optional bool status = 1;
  132. }
  133. message GetMountTableEntriesRequestProto {
  134. optional string srcPath = 1;
  135. }
  136. message GetMountTableEntriesResponseProto {
  137. repeated MountTableRecordProto entries = 1;
  138. optional uint64 timestamp = 2;
  139. }
  140. /////////////////////////////////////////////////
  141. // Routers
  142. /////////////////////////////////////////////////
  143. message StateStoreVersionRecordProto {
  144. optional uint64 membershipVersion = 1;
  145. optional uint64 mountTableVersion = 2;
  146. }
  147. message RouterRecordProto {
  148. optional uint64 dateCreated = 1;
  149. optional uint64 dateModified = 2;
  150. optional string address = 3;
  151. optional string status = 4;
  152. optional StateStoreVersionRecordProto stateStoreVersion = 5;
  153. optional string version = 6;
  154. optional string compileInfo = 7;
  155. optional uint64 dateStarted = 8;
  156. }
  157. message GetRouterRegistrationRequestProto {
  158. optional string routerId = 1;
  159. }
  160. message GetRouterRegistrationResponseProto {
  161. optional RouterRecordProto router = 1;
  162. }
  163. message GetRouterRegistrationsRequestProto {
  164. }
  165. message GetRouterRegistrationsResponseProto {
  166. optional uint64 timestamp = 1;
  167. repeated RouterRecordProto routers = 2;
  168. }
  169. message RouterHeartbeatRequestProto {
  170. optional RouterRecordProto router = 1;
  171. }
  172. message RouterHeartbeatResponseProto {
  173. optional bool status = 1;
  174. }
  175. /////////////////////////////////////////////////
  176. // Route State
  177. /////////////////////////////////////////////////
  178. message EnterSafeModeRequestProto {
  179. }
  180. message EnterSafeModeResponseProto {
  181. optional bool status = 1;
  182. }
  183. message LeaveSafeModeRequestProto {
  184. }
  185. message LeaveSafeModeResponseProto {
  186. optional bool status = 1;
  187. }
  188. message GetSafeModeRequestProto {
  189. }
  190. message GetSafeModeResponseProto {
  191. optional bool isInSafeMode = 1;
  192. }
  193. /////////////////////////////////////////////////
  194. // Disabled Nameservice State
  195. /////////////////////////////////////////////////
  196. message DisabledNameserviceRecordProto {
  197. optional uint64 dateCreated = 1;
  198. optional uint64 dateModified = 2;
  199. optional string nameServiceId = 3;
  200. }
  201. message DisableNameserviceRequestProto {
  202. optional string nameServiceId = 1;
  203. }
  204. message DisableNameserviceResponseProto {
  205. optional bool status = 1;
  206. }
  207. message EnableNameserviceRequestProto {
  208. optional string nameServiceId = 1;
  209. }
  210. message EnableNameserviceResponseProto {
  211. optional bool status = 1;
  212. }
  213. message GetDisabledNameservicesRequestProto {
  214. }
  215. message GetDisabledNameservicesResponseProto {
  216. repeated string nameServiceIds = 1;
  217. }