mq.proto 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. }