FederationProtocol.proto 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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. }
  109. optional DestOrder destOrder = 6 [default = HASH];
  110. optional string ownerName = 10;
  111. optional string groupName = 11;
  112. optional int32 mode = 12;
  113. }
  114. message AddMountTableEntryRequestProto {
  115. optional MountTableRecordProto entry = 1;
  116. }
  117. message AddMountTableEntryResponseProto {
  118. optional bool status = 1;
  119. }
  120. message UpdateMountTableEntryRequestProto {
  121. optional MountTableRecordProto entry = 1;
  122. }
  123. message UpdateMountTableEntryResponseProto {
  124. optional bool status = 1;
  125. }
  126. message RemoveMountTableEntryRequestProto {
  127. optional string srcPath = 1;
  128. }
  129. message RemoveMountTableEntryResponseProto{
  130. optional bool status = 1;
  131. }
  132. message GetMountTableEntriesRequestProto {
  133. optional string srcPath = 1;
  134. }
  135. message GetMountTableEntriesResponseProto {
  136. repeated MountTableRecordProto entries = 1;
  137. optional uint64 timestamp = 2;
  138. }
  139. /////////////////////////////////////////////////
  140. // Routers
  141. /////////////////////////////////////////////////
  142. message StateStoreVersionRecordProto {
  143. optional uint64 membershipVersion = 1;
  144. optional uint64 mountTableVersion = 2;
  145. }
  146. message RouterRecordProto {
  147. optional uint64 dateCreated = 1;
  148. optional uint64 dateModified = 2;
  149. optional string address = 3;
  150. optional string status = 4;
  151. optional StateStoreVersionRecordProto stateStoreVersion = 5;
  152. optional string version = 6;
  153. optional string compileInfo = 7;
  154. optional uint64 dateStarted = 8;
  155. }
  156. message GetRouterRegistrationRequestProto {
  157. optional string routerId = 1;
  158. }
  159. message GetRouterRegistrationResponseProto {
  160. optional RouterRecordProto router = 1;
  161. }
  162. message GetRouterRegistrationsRequestProto {
  163. }
  164. message GetRouterRegistrationsResponseProto {
  165. optional uint64 timestamp = 1;
  166. repeated RouterRecordProto routers = 2;
  167. }
  168. message RouterHeartbeatRequestProto {
  169. optional RouterRecordProto router = 1;
  170. }
  171. message RouterHeartbeatResponseProto {
  172. optional bool status = 1;
  173. }
  174. /////////////////////////////////////////////////
  175. // Route State
  176. /////////////////////////////////////////////////
  177. message EnterSafeModeRequestProto {
  178. }
  179. message EnterSafeModeResponseProto {
  180. optional bool status = 1;
  181. }
  182. message LeaveSafeModeRequestProto {
  183. }
  184. message LeaveSafeModeResponseProto {
  185. optional bool status = 1;
  186. }
  187. message GetSafeModeRequestProto {
  188. }
  189. message GetSafeModeResponseProto {
  190. optional bool isInSafeMode = 1;
  191. }