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.

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