vitess-gh/proto/binlogdata.proto

99 строки
2.3 KiB
Protocol Buffer

// This file contains all the types and servers necessary to make
// RPC calls to VtTablet for the binlog protocol, used by filtered
// replication only.
syntax = "proto3";
package binlogdata;
import "query.proto";
import "topodata.proto";
// Charset is the per-statement charset info from a QUERY_EVENT binlog entry.
message Charset {
// @@session.character_set_client
int32 client = 1;
// @@session.collation_connection
int32 conn = 2;
// @@session.collation_server
int32 server = 3;
}
// BinlogTransaction describes a transaction inside the binlogs.
// It is streamed by vttablet for filtered replication, used during resharding.
message BinlogTransaction {
message Statement {
enum Category {
BL_UNRECOGNIZED = 0;
BL_BEGIN = 1;
BL_COMMIT = 2;
BL_ROLLBACK = 3;
// BL_DML is deprecated.
BL_DML_DEPRECATED = 4;
BL_DDL = 5;
BL_SET = 6;
BL_INSERT = 7;
BL_UPDATE = 8;
BL_DELETE = 9;
}
// what type of statement is this?
Category category = 1;
// charset of this statement, if different from pre-negotiated default.
Charset charset = 2;
// the sql
bytes sql = 3;
}
// the statements in this transaction
repeated Statement statements = 1;
// DEPRECATED (replaced by event_token): the timestamp of the statements.
// int64 timestamp = 2;
reserved 2;
// DEPRECATED (replaced by event_token): the Transaction ID after
// this statement was applied.
// string transaction_id = 3;
reserved 3;
// The Event Token for this event.
query.EventToken event_token = 4;
}
// StreamKeyRangeRequest is the payload to StreamKeyRange
message StreamKeyRangeRequest {
// where to start
string position = 1;
// what to get
topodata.KeyRange key_range = 2;
// default charset on the player side
Charset charset = 3;
}
// StreamKeyRangeResponse is the response from StreamKeyRange
message StreamKeyRangeResponse{
BinlogTransaction binlog_transaction = 1;
}
// StreamTablesRequest is the payload to StreamTables
message StreamTablesRequest {
// where to start
string position = 1;
// what to get
repeated string tables = 2;
// default charset on the player side
Charset charset = 3;
}
// StreamTablesResponse is the response from StreamTables
message StreamTablesResponse {
BinlogTransaction binlog_transaction = 1;
}