FederationProtocol.proto 6.9 KB

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