mq_schema.proto 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. syntax = "proto3";
  2. package schema_pb;
  3. option go_package = "github.com/seaweedfs/seaweedfs/weed/pb/schema_pb";
  4. ///////////////////////////
  5. // Topic definition
  6. ///////////////////////////
  7. message Topic {
  8. string namespace = 1;
  9. string name = 2;
  10. }
  11. message Partition {
  12. int32 ring_size = 1;
  13. int32 range_start = 2;
  14. int32 range_stop = 3;
  15. int64 unix_time_ns = 4;
  16. }
  17. message Offset {
  18. Topic topic = 1;
  19. repeated PartitionOffset partition_offsets = 2;
  20. }
  21. enum PartitionOffsetStartType {
  22. EARLIEST = 0;
  23. EARLIEST_IN_MEMORY = 1;
  24. LATEST = 2;
  25. }
  26. message PartitionOffset {
  27. Partition partition = 1;
  28. int64 start_ts_ns = 2;
  29. int64 stop_ts_ns = 3;
  30. PartitionOffsetStartType start_type = 4;
  31. }
  32. ///////////////////////////
  33. // schema definition
  34. ///////////////////////////
  35. message RecordType {
  36. repeated Field fields = 1;
  37. }
  38. message Field {
  39. string name = 1;
  40. int32 field_index = 2;
  41. Type type = 3;
  42. bool is_repeated = 4;
  43. bool is_required = 5;
  44. }
  45. message Type {
  46. oneof kind {
  47. ScalarType scalar_type = 1;
  48. RecordType record_type = 2;
  49. ListType list_type = 3;
  50. }
  51. }
  52. enum ScalarType {
  53. BOOL = 0;
  54. INT32 = 1;
  55. INT64 = 3;
  56. FLOAT = 4;
  57. DOUBLE = 5;
  58. BYTES = 6;
  59. STRING = 7;
  60. }
  61. message ListType {
  62. Type element_type = 1;
  63. }
  64. ///////////////////////////
  65. // value definition
  66. ///////////////////////////
  67. message RecordValue {
  68. map<string, Value> fields = 1;
  69. }
  70. message Value {
  71. oneof kind {
  72. bool bool_value = 1;
  73. int32 int32_value = 2;
  74. int64 int64_value = 3;
  75. float float_value = 4;
  76. double double_value = 5;
  77. bytes bytes_value = 6;
  78. string string_value = 7;
  79. ListValue list_value = 14;
  80. RecordValue record_value = 15;
  81. }
  82. }
  83. message ListValue {
  84. repeated Value values = 1;
  85. }