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.

97 lines
2.1 KiB

3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. syntax = "proto3";
  2. package messaging_pb;
  3. option go_package = "github.com/seaweedfs/seaweedfs/weed/pb/mq_pb";
  4. option java_package = "seaweedfs.mq";
  5. option java_outer_classname = "MessagQueueProto";
  6. //////////////////////////////////////////////////
  7. service SeaweedMessaging {
  8. // control plane
  9. rpc FindBrokerLeader (FindBrokerLeaderRequest) returns (FindBrokerLeaderResponse) {
  10. }
  11. rpc AssignSegmentBrokers (AssignSegmentBrokersRequest) returns (AssignSegmentBrokersResponse) {
  12. }
  13. rpc CheckSegmentStatus (CheckSegmentStatusRequest) returns (CheckSegmentStatusResponse) {
  14. }
  15. rpc CheckBrokerLoad (CheckBrokerLoadRequest) returns (CheckBrokerLoadResponse) {
  16. }
  17. // data plane
  18. rpc Publish (stream PublishRequest) returns (stream PublishResponse) {
  19. }
  20. }
  21. //////////////////////////////////////////////////
  22. message SegmentInfo {
  23. Segment segment = 1;
  24. int64 start_ts_ns = 2;
  25. repeated string brokers = 3;
  26. int64 stop_ts_ns = 4;
  27. repeated int32 previous_segments = 5;
  28. repeated int32 next_segments = 6;
  29. }
  30. //////////////////////////////////////////////////
  31. message FindBrokerLeaderRequest {
  32. string filer_group = 1;
  33. }
  34. message FindBrokerLeaderResponse {
  35. string broker = 1;
  36. }
  37. message Partition {
  38. int32 ring_size = 1;
  39. int32 range_start = 2;
  40. int32 range_stop = 3;
  41. }
  42. message Segment {
  43. string namespace = 1;
  44. string topic = 2;
  45. int32 id = 3;
  46. Partition partition = 4;
  47. }
  48. message AssignSegmentBrokersRequest {
  49. Segment segment = 1;
  50. }
  51. message AssignSegmentBrokersResponse {
  52. repeated string brokers = 1;
  53. }
  54. message CheckSegmentStatusRequest {
  55. Segment segment = 1;
  56. }
  57. message CheckSegmentStatusResponse {
  58. bool is_active = 1;
  59. }
  60. message CheckBrokerLoadRequest {
  61. }
  62. message CheckBrokerLoadResponse {
  63. int64 message_count = 1;
  64. int64 bytes_count = 2;
  65. }
  66. //////////////////////////////////////////////////
  67. message PublishRequest {
  68. message InitMessage {
  69. Segment segment = 1;
  70. }
  71. InitMessage init = 1;
  72. bytes message = 2;
  73. }
  74. message PublishResponse {
  75. int64 ack_sequence = 1;
  76. bool is_closed = 2;
  77. }