diff --git a/proto/greptime/v1/meta/common.proto b/proto/greptime/v1/meta/common.proto index 13f7322..0c98406 100644 --- a/proto/greptime/v1/meta/common.proto +++ b/proto/greptime/v1/meta/common.proto @@ -10,6 +10,12 @@ message RequestHeader { uint64 cluster_id = 2; // member_id is the ID of the sender server. uint64 member_id = 3; + Role role = 4; +} + +enum Role { + DATANODE = 0; + FRONTEND = 1; } message ResponseHeader { @@ -37,9 +43,9 @@ message TableName { message TimeInterval { // The unix timestamp in millis of the start of this period. - uint64 start_timestamp_millis = 1; + int64 start_timestamp_millis = 1; // The unix timestamp in millis of the end of this period. - uint64 end_timestamp_millis = 2; + int64 end_timestamp_millis = 2; } message KeyValue { diff --git a/proto/greptime/v1/meta/heartbeat.proto b/proto/greptime/v1/meta/heartbeat.proto index 41b28cd..c05220b 100644 --- a/proto/greptime/v1/meta/heartbeat.proto +++ b/proto/greptime/v1/meta/heartbeat.proto @@ -32,6 +32,7 @@ message HeartbeatRequest { repeated RegionStat region_stats = 6; // Follower nodes and stats, empty on follower nodes repeated ReplicaStat replica_stats = 7; + repeated MailboxMessage mailbox_messages = 8; } message NodeStat { @@ -80,7 +81,7 @@ message ReplicaStat { message HeartbeatResponse { ResponseHeader header = 1; - repeated bytes payload = 2; + repeated MailboxMessage mailbox_messages = 2; } message AskLeaderRequest { @@ -92,3 +93,19 @@ message AskLeaderResponse { Peer leader = 2; } + +message MailboxMessage { + // The id is used to associate request and response. + uint64 id = 1; + // The following information plays a bigger role in making messages traceable and facilitating debugging. + string subject = 2; + string from = 3; + string to = 4; + // The unix timestamp in milliseconds. + int64 timestamp_millis = 5; + + // The message body. + oneof payload { + string json = 6; + } +} diff --git a/src/v1/meta.rs b/src/v1/meta.rs index 668c9bd..ba55931 100644 --- a/src/v1/meta.rs +++ b/src/v1/meta.rs @@ -62,6 +62,7 @@ impl RequestHeader { protocol_version: PROTOCOL_VERSION, cluster_id, member_id, + role: 0, } } }