FederationProtocol.proto 5.5 KB

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