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.

126 lines
2.8 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. }
  16. //////////////////////////////////////////////////
  17. message Heartbeat {
  18. string ip = 1;
  19. uint32 port = 2;
  20. string public_url = 3;
  21. uint32 max_volume_count = 4;
  22. uint64 max_file_key = 5;
  23. string data_center = 6;
  24. string rack = 7;
  25. uint32 admin_port = 8;
  26. repeated VolumeInformationMessage volumes = 9;
  27. // delta volume ids
  28. repeated uint32 new_vids = 10;
  29. repeated uint32 deleted_vids = 11;
  30. }
  31. message HeartbeatResponse {
  32. uint64 volumeSizeLimit = 1;
  33. string secretKey = 2;
  34. string leader = 3;
  35. }
  36. message VolumeInformationMessage {
  37. uint32 id = 1;
  38. uint64 size = 2;
  39. string collection = 3;
  40. uint64 file_count = 4;
  41. uint64 delete_count = 5;
  42. uint64 deleted_byte_count = 6;
  43. bool read_only = 7;
  44. uint32 replica_placement = 8;
  45. uint32 version = 9;
  46. uint32 ttl = 10;
  47. }
  48. message Empty {
  49. }
  50. message SuperBlockExtra {
  51. message ErasureCoding {
  52. uint32 data = 1;
  53. uint32 parity = 2;
  54. repeated uint32 volume_ids = 3;
  55. }
  56. ErasureCoding erasure_coding = 1;
  57. }
  58. message ClientListenRequest {
  59. string name = 1;
  60. }
  61. message VolumeLocation {
  62. string url = 1;
  63. string public_url = 2;
  64. repeated uint32 new_vids = 3;
  65. repeated uint32 deleted_vids = 4;
  66. }
  67. message LookupVolumeRequest {
  68. repeated string volume_ids = 1;
  69. string collection = 2; // optional, a bit faster if provided.
  70. }
  71. message LookupVolumeResponse {
  72. message VolumeIdLocation {
  73. string volume_id = 1;
  74. repeated Location locations = 2;
  75. string error = 3;
  76. }
  77. repeated VolumeIdLocation volume_id_locations = 1;
  78. }
  79. message Location {
  80. string url = 1;
  81. string public_url = 2;
  82. }
  83. message AssignRequest {
  84. uint64 count = 1;
  85. string replication = 2;
  86. string collection = 3;
  87. string ttl = 4;
  88. string data_center = 5;
  89. string rack = 6;
  90. string data_node = 7;
  91. }
  92. message AssignResponse {
  93. string fid = 1;
  94. string url = 2;
  95. string public_url = 3;
  96. uint64 count = 4;
  97. string error = 5;
  98. }
  99. message StatisticsRequest {
  100. string replication = 1;
  101. string collection = 2;
  102. string ttl = 3;
  103. }
  104. message StatisticsResponse {
  105. string replication = 1;
  106. string collection = 2;
  107. string ttl = 3;
  108. uint64 total_size = 4;
  109. uint64 used_size = 5;
  110. uint64 file_count = 6;
  111. }