FederationProtocol.proto 5.7 KB

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