FederationProtocol.proto 7.5 KB

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