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.7 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 leader = 3;
  34. }
  35. message VolumeInformationMessage {
  36. uint32 id = 1;
  37. uint64 size = 2;
  38. string collection = 3;
  39. uint64 file_count = 4;
  40. uint64 delete_count = 5;
  41. uint64 deleted_byte_count = 6;
  42. bool read_only = 7;
  43. uint32 replica_placement = 8;
  44. uint32 version = 9;
  45. uint32 ttl = 10;
  46. }
  47. message Empty {
  48. }
  49. message SuperBlockExtra {
  50. message ErasureCoding {
  51. uint32 data = 1;
  52. uint32 parity = 2;
  53. repeated uint32 volume_ids = 3;
  54. }
  55. ErasureCoding erasure_coding = 1;
  56. }
  57. message ClientListenRequest {
  58. string name = 1;
  59. }
  60. message VolumeLocation {
  61. string url = 1;
  62. string public_url = 2;
  63. repeated uint32 new_vids = 3;
  64. repeated uint32 deleted_vids = 4;
  65. }
  66. message LookupVolumeRequest {
  67. repeated string volume_ids = 1;
  68. string collection = 2; // optional, a bit faster if provided.
  69. }
  70. message LookupVolumeResponse {
  71. message VolumeIdLocation {
  72. string volume_id = 1;
  73. repeated Location locations = 2;
  74. string error = 3;
  75. }
  76. repeated VolumeIdLocation volume_id_locations = 1;
  77. }
  78. message Location {
  79. string url = 1;
  80. string public_url = 2;
  81. }
  82. message AssignRequest {
  83. uint64 count = 1;
  84. string replication = 2;
  85. string collection = 3;
  86. string ttl = 4;
  87. string data_center = 5;
  88. string rack = 6;
  89. string data_node = 7;
  90. }
  91. message AssignResponse {
  92. string fid = 1;
  93. string url = 2;
  94. string public_url = 3;
  95. uint64 count = 4;
  96. string error = 5;
  97. string auth = 6;
  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. }