mirror of https://github.com/milvus-io/milvus.git
255 lines
7.8 KiB
Protocol Buffer
255 lines
7.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package milvus.proto.messages;
|
|
|
|
option go_package = "github.com/milvus-io/milvus/pkg/proto/messagespb";
|
|
|
|
// MessageID is the unique identifier of a message.
|
|
message MessageID {
|
|
string id = 1;
|
|
}
|
|
|
|
// Message is the basic unit of communication between publisher and consumer.
|
|
message Message {
|
|
bytes payload = 1; // message body
|
|
map<string, string> properties = 2; // message properties
|
|
}
|
|
|
|
// ImmutableMessage is the message that can not be modified anymore.
|
|
message ImmutableMessage {
|
|
MessageID id = 1;
|
|
bytes payload = 2; // message body
|
|
map<string, string> properties = 3; // message properties
|
|
}
|
|
|
|
// MessageType is the type of message.
|
|
enum MessageType {
|
|
Unknown = 0;
|
|
TimeTick = 1;
|
|
Insert = 2;
|
|
Delete = 3;
|
|
Flush = 4;
|
|
CreateCollection = 5;
|
|
DropCollection = 6;
|
|
CreatePartition = 7;
|
|
DropPartition = 8;
|
|
ManualFlush = 9;
|
|
CreateSegment = 10;
|
|
// begin transaction message is only used for transaction, once a begin
|
|
// transaction message is received, all messages combined with the
|
|
// transaction message cannot be consumed until a CommitTxn message
|
|
// is received.
|
|
BeginTxn = 900;
|
|
// commit transaction message is only used for transaction, once a commit
|
|
// transaction message is received, all messages combined with the
|
|
// transaction message can be consumed, the message combined with the
|
|
// transaction which is received after the commit transaction message will
|
|
// be drop.
|
|
CommitTxn = 901;
|
|
// rollback transaction message is only used for transaction, once a
|
|
// rollback transaction message is received, all messages combined with the
|
|
// transaction message can be discarded, the message combined with the
|
|
// transaction which is received after the rollback transaction message will
|
|
// be drop.
|
|
RollbackTxn = 902;
|
|
// txn message is a set of messages combined by multiple messages in a
|
|
// transaction. the txn properties is consist of the begin txn message and
|
|
// commit txn message.
|
|
Txn = 999;
|
|
}
|
|
|
|
///
|
|
/// Message Payload Definitions
|
|
/// Some message payload is defined at msg.proto at milvus-proto for
|
|
/// compatibility.
|
|
/// 1. InsertRequest
|
|
/// 2. DeleteRequest
|
|
/// 3. TimeTickRequest
|
|
/// 4. CreateCollectionRequest
|
|
/// 5. DropCollectionRequest
|
|
/// 6. CreatePartitionRequest
|
|
/// 7. DropPartitionRequest
|
|
///
|
|
|
|
// FlushMessageBody is the body of flush message.
|
|
message FlushMessageBody {
|
|
// indicate which the collection that segment belong to.
|
|
int64 collection_id = 1;
|
|
repeated int64 segment_id = 2; // indicate which segment to flush.
|
|
}
|
|
|
|
// ManualFlushMessageBody is the body of manual flush message.
|
|
message ManualFlushMessageBody {}
|
|
|
|
// CreateSegmentMessageBody is the body of create segment message.
|
|
message CreateSegmentMessageBody {
|
|
int64 collection_id = 1;
|
|
repeated CreateSegmentInfo segments = 2;
|
|
}
|
|
|
|
// CreateSegmentInfo is the info of create segment.
|
|
message CreateSegmentInfo {
|
|
int64 partition_id = 1;
|
|
int64 segment_id = 2;
|
|
}
|
|
|
|
// BeginTxnMessageBody is the body of begin transaction message.
|
|
// Just do nothing now.
|
|
message BeginTxnMessageBody {}
|
|
|
|
// CommitTxnMessageBody is the body of commit transaction message.
|
|
// Just do nothing now.
|
|
message CommitTxnMessageBody {}
|
|
|
|
// RollbackTxnMessageBody is the body of rollback transaction message.
|
|
// Just do nothing now.
|
|
message RollbackTxnMessageBody {}
|
|
|
|
// TxnMessageBody is the body of transaction message.
|
|
// A transaction message is combined by multiple messages.
|
|
// It's only can be seen at consume side.
|
|
// All message in a transaction message only has same timetick which is equal to
|
|
// the CommitTransationMessage.
|
|
message TxnMessageBody {
|
|
repeated Message messages = 1;
|
|
}
|
|
|
|
///
|
|
/// Message Header Definitions
|
|
/// Used to fast handling at streaming node write ahead.
|
|
/// The header should be simple and light enough to be parsed.
|
|
/// Do not put too much information in the header if unnecessary.
|
|
///
|
|
|
|
// TimeTickMessageHeader just nothing.
|
|
message TimeTickMessageHeader {}
|
|
|
|
// InsertMessageHeader is the header of insert message.
|
|
message InsertMessageHeader {
|
|
int64 collection_id = 1;
|
|
repeated PartitionSegmentAssignment partitions = 2;
|
|
}
|
|
|
|
// PartitionSegmentAssignment is the segment assignment of a partition.
|
|
message PartitionSegmentAssignment {
|
|
int64 partition_id = 1;
|
|
uint64 rows = 2;
|
|
uint64 binary_size = 3;
|
|
SegmentAssignment segment_assignment = 4;
|
|
}
|
|
|
|
// SegmentAssignment is the assignment of a segment.
|
|
message SegmentAssignment {
|
|
int64 segment_id = 1;
|
|
}
|
|
|
|
// DeleteMessageHeader
|
|
message DeleteMessageHeader {
|
|
int64 collection_id = 1;
|
|
}
|
|
|
|
// FlushMessageHeader just nothing.
|
|
message FlushMessageHeader {}
|
|
|
|
// CreateSegmentMessageHeader just nothing.
|
|
message CreateSegmentMessageHeader {}
|
|
|
|
message ManualFlushMessageHeader {
|
|
int64 collection_id = 1;
|
|
uint64 flush_ts = 2;
|
|
}
|
|
|
|
// CreateCollectionMessageHeader is the header of create collection message.
|
|
message CreateCollectionMessageHeader {
|
|
int64 collection_id = 1;
|
|
repeated int64 partition_ids = 2;
|
|
}
|
|
|
|
// DropCollectionMessageHeader is the header of drop collection message.
|
|
message DropCollectionMessageHeader {
|
|
int64 collection_id = 1;
|
|
}
|
|
|
|
// CreatePartitionMessageHeader is the header of create partition message.
|
|
message CreatePartitionMessageHeader {
|
|
int64 collection_id = 1;
|
|
int64 partition_id = 2;
|
|
}
|
|
|
|
// DropPartitionMessageHeader is the header of drop partition message.
|
|
message DropPartitionMessageHeader {
|
|
int64 collection_id = 1;
|
|
int64 partition_id = 2;
|
|
}
|
|
|
|
// BeginTxnMessageHeader is the header of begin transaction message.
|
|
// Just do nothing now.
|
|
// Add Channel info here to implement cross pchannel transaction.
|
|
message BeginTxnMessageHeader {
|
|
// the max milliseconds to keep alive of the transaction.
|
|
// the keepalive_milliseconds is never changed in a transaction by now,
|
|
int64 keepalive_milliseconds = 1;
|
|
}
|
|
|
|
// CommitTxnMessageHeader is the header of commit transaction message.
|
|
// Just do nothing now.
|
|
message CommitTxnMessageHeader {}
|
|
|
|
// RollbackTxnMessageHeader is the header of rollback transaction
|
|
// message.
|
|
// Just do nothing now.
|
|
message RollbackTxnMessageHeader {}
|
|
|
|
// TxnMessageHeader is the header of transaction message.
|
|
// Just do nothing now.
|
|
message TxnMessageHeader {}
|
|
|
|
///
|
|
/// Message Extra Response
|
|
/// Used to add extra information when response to the client.
|
|
///
|
|
///
|
|
|
|
// ManualFlushExtraResponse is the extra response of manual flush message.
|
|
message ManualFlushExtraResponse {
|
|
repeated int64 segment_ids = 1;
|
|
}
|
|
|
|
// TxnContext is the context of transaction.
|
|
// It will be carried by every message in a transaction.
|
|
message TxnContext {
|
|
// the unique id of the transaction.
|
|
// the txn_id is never changed in a transaction.
|
|
int64 txn_id = 1;
|
|
// the next keep alive timeout of the transaction.
|
|
// after the keep alive timeout, the transaction will be expired.
|
|
int64 keepalive_milliseconds = 2;
|
|
}
|
|
|
|
enum TxnState {
|
|
// should never be used.
|
|
TxnUnknown = 0;
|
|
// the transaction begin.
|
|
TxnBegin = 1;
|
|
// the transaction is in flight.
|
|
TxnInFlight = 2;
|
|
// the transaction is on commit.
|
|
TxnOnCommit = 3;
|
|
// the transaction is committed.
|
|
TxnCommitted = 4;
|
|
// the transaction is on rollback.
|
|
TxnOnRollback = 5;
|
|
// the transaction is rollbacked.
|
|
TxnRollbacked = 6;
|
|
}
|
|
|
|
// RMQMessageLayout is the layout of message for RMQ.
|
|
message RMQMessageLayout {
|
|
bytes payload = 1; // message body
|
|
map<string, string> properties = 2; // message properties
|
|
}
|
|
|
|
// VChannels is a layout to represent the virtual channels for broadcast.
|
|
message VChannels {
|
|
repeated string vchannels = 1;
|
|
} |