You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

197 lines
4.4 KiB

7 years ago
7 years ago
7 years ago
7 years ago
  1. syntax = "proto3";
  2. package master_pb;
  3. //////////////////////////////////////////////////
  4. service Seaweed {
  5. rpc SendHeartbeat (stream Heartbeat) returns (stream HeartbeatResponse) {
  6. }
  7. rpc KeepConnected (stream ClientListenRequest) returns (stream VolumeLocation) {
  8. }
  9. rpc LookupVolume (LookupVolumeRequest) returns (LookupVolumeResponse) {
  10. }
  11. rpc Assign (AssignRequest) returns (AssignResponse) {
  12. }
  13. rpc Statistics (StatisticsRequest) returns (StatisticsResponse) {
  14. }
  15. rpc CollectionList (CollectionListRequest) returns (CollectionListResponse) {
  16. }
  17. rpc CollectionDelete (CollectionDeleteRequest) returns (CollectionDeleteResponse) {
  18. }
  19. rpc VolumeList (VolumeListRequest) returns (VolumeListResponse) {
  20. }
  21. }
  22. //////////////////////////////////////////////////
  23. message Heartbeat {
  24. string ip = 1;
  25. uint32 port = 2;
  26. string public_url = 3;
  27. uint32 max_volume_count = 4;
  28. uint64 max_file_key = 5;
  29. string data_center = 6;
  30. string rack = 7;
  31. uint32 admin_port = 8;
  32. repeated VolumeInformationMessage volumes = 9;
  33. // delta volume ids
  34. repeated uint32 new_vids = 10;
  35. repeated uint32 deleted_vids = 11;
  36. }
  37. message HeartbeatResponse {
  38. uint64 volumeSizeLimit = 1;
  39. string leader = 3;
  40. }
  41. message VolumeInformationMessage {
  42. uint32 id = 1;
  43. uint64 size = 2;
  44. string collection = 3;
  45. uint64 file_count = 4;
  46. uint64 delete_count = 5;
  47. uint64 deleted_byte_count = 6;
  48. bool read_only = 7;
  49. uint32 replica_placement = 8;
  50. uint32 version = 9;
  51. uint32 ttl = 10;
  52. uint32 compact_revision = 11;
  53. }
  54. message Empty {
  55. }
  56. message SuperBlockExtra {
  57. message ErasureCoding {
  58. uint32 data = 1;
  59. uint32 parity = 2;
  60. repeated uint32 volume_ids = 3;
  61. }
  62. ErasureCoding erasure_coding = 1;
  63. }
  64. message ClientListenRequest {
  65. string name = 1;
  66. }
  67. message VolumeLocation {
  68. string url = 1;
  69. string public_url = 2;
  70. repeated uint32 new_vids = 3;
  71. repeated uint32 deleted_vids = 4;
  72. }
  73. message LookupVolumeRequest {
  74. repeated string volume_ids = 1;
  75. string collection = 2; // optional, a bit faster if provided.
  76. }
  77. message LookupVolumeResponse {
  78. message VolumeIdLocation {
  79. string volume_id = 1;
  80. repeated Location locations = 2;
  81. string error = 3;
  82. }
  83. repeated VolumeIdLocation volume_id_locations = 1;
  84. }
  85. message Location {
  86. string url = 1;
  87. string public_url = 2;
  88. }
  89. message AssignRequest {
  90. uint64 count = 1;
  91. string replication = 2;
  92. string collection = 3;
  93. string ttl = 4;
  94. string data_center = 5;
  95. string rack = 6;
  96. string data_node = 7;
  97. }
  98. message AssignResponse {
  99. string fid = 1;
  100. string url = 2;
  101. string public_url = 3;
  102. uint64 count = 4;
  103. string error = 5;
  104. string auth = 6;
  105. }
  106. message StatisticsRequest {
  107. string replication = 1;
  108. string collection = 2;
  109. string ttl = 3;
  110. }
  111. message StatisticsResponse {
  112. string replication = 1;
  113. string collection = 2;
  114. string ttl = 3;
  115. uint64 total_size = 4;
  116. uint64 used_size = 5;
  117. uint64 file_count = 6;
  118. }
  119. //
  120. // collection related
  121. //
  122. message StorageType {
  123. string replication = 1;
  124. string ttl = 2;
  125. }
  126. message Collection {
  127. string name = 1;
  128. }
  129. message CollectionListRequest {
  130. }
  131. message CollectionListResponse {
  132. repeated Collection collections = 1;
  133. }
  134. message CollectionDeleteRequest {
  135. string name = 1;
  136. }
  137. message CollectionDeleteResponse {
  138. }
  139. //
  140. // volume related
  141. //
  142. message DataNodeInfo {
  143. string id = 1;
  144. uint64 volume_count = 2;
  145. uint64 max_volume_count = 3;
  146. uint64 free_volume_count = 4;
  147. uint64 active_volume_count = 5;
  148. repeated VolumeInformationMessage volume_infos = 6;
  149. }
  150. message RackInfo {
  151. string id = 1;
  152. uint64 volume_count = 2;
  153. uint64 max_volume_count = 3;
  154. uint64 free_volume_count = 4;
  155. uint64 active_volume_count = 5;
  156. repeated DataNodeInfo data_node_infos = 6;
  157. }
  158. message DataCenterInfo {
  159. string id = 1;
  160. uint64 volume_count = 2;
  161. uint64 max_volume_count = 3;
  162. uint64 free_volume_count = 4;
  163. uint64 active_volume_count = 5;
  164. repeated RackInfo rack_infos = 6;
  165. }
  166. message TopologyInfo {
  167. string id = 1;
  168. uint64 volume_count = 2;
  169. uint64 max_volume_count = 3;
  170. uint64 free_volume_count = 4;
  171. uint64 active_volume_count = 5;
  172. repeated DataCenterInfo data_center_infos = 6;
  173. }
  174. message VolumeListRequest {
  175. }
  176. message VolumeListResponse {
  177. TopologyInfo topology_info = 1;
  178. }