FederationProtocol.proto 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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 numOfFiles = 10;
  31. optional uint64 numOfBlocks = 11;
  32. optional uint64 numOfBlocksMissing = 12;
  33. optional uint64 numOfBlocksPendingReplication = 13;
  34. optional uint64 numOfBlocksUnderReplicated = 14;
  35. optional uint64 numOfBlocksPendingDeletion = 15;
  36. optional uint32 numOfActiveDatanodes = 20;
  37. optional uint32 numOfDeadDatanodes = 21;
  38. optional uint32 numOfDecommissioningDatanodes = 22;
  39. optional uint32 numOfDecomActiveDatanodes = 23;
  40. optional uint32 numOfDecomDeadDatanodes = 24;
  41. }
  42. message NamenodeMembershipRecordProto {
  43. optional uint64 dateCreated = 1;
  44. optional uint64 dateModified = 2;
  45. optional uint64 lastContact = 3;
  46. optional string routerId = 4;
  47. optional string nameserviceId = 5;
  48. optional string namenodeId = 6;
  49. optional string clusterId = 7;
  50. optional string blockPoolId = 8;
  51. optional string webAddress = 9;
  52. optional string rpcAddress = 10;
  53. optional string serviceAddress = 11;
  54. optional string lifelineAddress = 12;
  55. optional string state = 13;
  56. optional bool isSafeMode = 14;
  57. optional NamenodeMembershipStatsRecordProto stats = 15;
  58. }
  59. message FederationNamespaceInfoProto {
  60. optional string blockPoolId = 1;
  61. optional string clusterId = 2;
  62. optional string nameserviceId = 3;
  63. }
  64. message GetNamenodeRegistrationsRequestProto {
  65. optional NamenodeMembershipRecordProto membership = 1;
  66. }
  67. message GetNamenodeRegistrationsResponseProto {
  68. repeated NamenodeMembershipRecordProto namenodeMemberships = 1;
  69. }
  70. message GetExpiredRegistrationsRequestProto {
  71. }
  72. message GetNamespaceInfoRequestProto {
  73. }
  74. message GetNamespaceInfoResponseProto {
  75. repeated FederationNamespaceInfoProto namespaceInfos = 1;
  76. }
  77. message UpdateNamenodeRegistrationRequestProto {
  78. optional string nameserviceId = 1;
  79. optional string namenodeId = 2;
  80. optional string state = 3;
  81. }
  82. message UpdateNamenodeRegistrationResponseProto {
  83. optional bool status = 1;
  84. }
  85. message NamenodeHeartbeatRequestProto {
  86. optional NamenodeMembershipRecordProto namenodeMembership = 1;
  87. }
  88. message NamenodeHeartbeatResponseProto {
  89. optional bool status = 1;
  90. }
  91. /////////////////////////////////////////////////
  92. // Mount table
  93. /////////////////////////////////////////////////
  94. message RemoteLocationProto {
  95. optional string nameserviceId = 1;
  96. optional string path = 2;
  97. }
  98. message MountTableRecordProto {
  99. optional string srcPath = 1;
  100. repeated RemoteLocationProto destinations = 2;
  101. optional uint64 dateCreated = 3;
  102. optional uint64 dateModified = 4;
  103. optional bool readOnly = 5 [default = false];
  104. enum DestOrder {
  105. HASH = 0;
  106. LOCAL = 1;
  107. RANDOM = 2;
  108. }
  109. optional DestOrder destOrder = 6 [default = HASH];
  110. optional string ownerName = 10;
  111. optional string groupName = 11;
  112. optional int32 mode = 12;
  113. optional QuotaUsageProto quota = 13;
  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. }