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.

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