Get desktop application:
View/edit binary Protocol Buffers messages
handshake
General KV API for get, mget, list, and upsert; It is introduced to replace `WriteMsg` and `ReadMsg`. 2022-09-14: since: 0.8.35
Handle application read request. This API is not exposed to client directly, but is only used for internal request forwarding. The request will be forwarded to leader if current node is not leader. It returns a stream of `StreamItem`. - For single-reply request, the stream contains only one item, e.g. `Get`. - For multi-reply request, the stream contains multiple items, e.g. `MGet` and `List`. 2023-10-17: since 1.2.163
Export all meta data. Including raft hard state, logs and state machine. The exported data is a list of json strings in form of `(tree_name, sub_tree_prefix, key, value)`.
Export all meta data. Including raft hard state, logs and state machine. The exported data is a list of json strings in form of: `(tree_name, {"<key_space>":{"key":<key>,"value":<value>}})`. ```text ["raft_log",{"Logs":{"key":83,"value":{"log_id":{"leader_id":{"term":1,"node_id":0},"index":83},"payload":{"Normal":{"txid":null,"time_ms":1667290974891,"cmd":{"UpsertKV":{"key":"__fd_clusters/test_tenant/test_cluster/databend_query/KMZ4VvqDFVExlZFThKDzZ1","seq":{"GE":1},"value":"AsIs","value_meta":{"expire_at":1667291034}}}}}}}}] ["state_machine/0",{"Nodes":{"key":1,"value":{"name":"1","endpoint":{"addr":"localhost","port":28103},"grpc_api_advertise_address":"0.0.0.0:9191"}}}] ```
Request meta-service to export all data in a stream.
The number of lines of json string contained in a stream item. Note that too many lines in a stream item may cause "gRPC message too large" error. The default chunk_size is 32.
Add watch key stream. Whenever the watch key data updated, client will be notified across the stream.
key is the key to register for watching.
`key_end`` is the end of the range [key, key_end) to watch. If key_end is None, then watch only key. If want to watch prefix of key, use `get_start_and_end_of_prefix` to generate [key, key_end).
Whether to send current values of all watched keys when watch starts Useful for initializing client-side caches. The client: - first get a full copy of the key-values, - then update every time a key-value is changed.
Response in a watch stream from server to the client.
The event containing key-value change information or a value emitted during initial-flush. This includes the key, current value (if any), and previous value (if any).
Indicates whether this event is part of the initialization. When true: - The event represents an existing key-value record at the time the watch was established - These events are sent when initial_flush=true was specified in WatchRequest When false: - The event represents a real-time change that occurred after the watch was established - A special event with no key-value data may be sent to indicate the completion of the initial flush phase
A Transaction request sent to the databend-meta service. To provide backward compatibility, the `TxnRequest` is processed in the following order: - Loop and evaluate the condition in the `operations`, and execute the corresponding operation, if the condition is met. This will stop and return once a condition is met and one of the corresponding operations is executed. - If none of the conditions are met, the `condition` as the **last** condition will be evaluated. And the `if_then` will be executed and return. - If none operation are executed, `else_then` will be executed.
Series of conditional operations to execute. It will stop once a condition is met and one of the corresponding operations is executed
`condition` is a list of predicates. If all of them success, the `if_then` will be executed, otherwise `else_then` op will be executed.
`if_then` is a list of operations will be executed when all condition evaluates to true.
`else_then` is a list of operations will be executed when not all condition evaluates to true.
TransactionResponse represents the result of executing a transaction. `execution_path` identifies condition that is executed and is identified as: - "operation:{index}": executed operation at index - "then": `condition` field were met, and the `if_then` operation is executed. - "else": neither operations nor condition are met and `else_then` is executed. `success` is set to false only when `else_then` is executed.
Not used
Identifies which execution path was taken
Get MetaSrv member list endpoints
Get cluster status Since: 2023-10-19
Respond with the information about the client. Since: 2022-09-09 0.8.30
The address of the connected in form of "<ip>:<port>"
The timestamp when the meta-server received the request in milliseconds since 1970 . It is created with `SeqV::now_ms()` To convert it back to time with: `SystemTime::UNIX_EPOCH + Duration::from_millis(server_time)`
Forward a request to another node.
Handling internally redirected KvReadV1 request. Without checking token.
json serialized meta data, including vote and snapshot_meta. ```text (Vote, SnapshotMeta) ```
The item of snapshot chunk stream. The first item contains `rpc_meta`, including the application defined format of this snapshot data, the leader vote and snapshot-meta. Since the second item, the `rpc_meta` should be empty and will be ignored by the receiving end.
json serialized meta data, including vote and snapshot_meta. ```text (SnapshotFormat, Vote, SnapshotMeta) ```
Snapshot data chunk
V003 snapshot response
json serialized remote vote
BooleanExpression represents a tree of transaction conditions combined with logical operators. It enables complex condition checking by allowing both simple conditions and nested expressions.
Used in:
Operator determining how child expressions and conditions are combined
Nested boolean expressions, allowing tree-like structure Example: (A AND B) OR (C AND D) where A,B,C,D are conditions
Leaf-level transaction conditions These are the actual checks performed against the state.
Logical operator to combine multiple conditions, including sub compound conditions or simple conditions.
Used in:
Represents a set of operations that execute only when specified conditions are met.
Used in:
Tree of conditions that must be satisfied for operations to execute
Operations to execute when condition_tree evaluates to true These operations are executed in sequence
Used as request type in: MetaService.Export, MetaService.GetClientInfo, MetaService.GetClusterStatus
Used as response type in: RaftService.TransferLeader
(message has no fields)
Used in:
current hold current value of key(if any)
prev value of key(if any)
Data chunk for export/import meta data
Used as response type in: MetaService.Export, MetaService.ExportV1
Used in:
A quorum granted or not granted Leader.
The log id
Used in:
Status about local raft-log storage
Used in:
Used as response type in: MetaService.KvApi, RaftService.AppendEntries, RaftService.Forward, RaftService.InstallSnapshotV1, RaftService.Vote
Used as request type in: MetaService.KvApi, MetaService.KvReadV1, RaftService.AppendEntries, RaftService.Forward, RaftService.KvReadV1, RaftService.Vote
Used in:
, , , ,Used in:
Item for a Streaming read reply, e.g., for `Mget` and `List`.
Used as response type in: MetaService.KvReadV1, RaftService.KvReadV1
messages for txn
Used in:
,Compare the stored value of `key` against the given value.
Compare the stored seq of `key` against the given seq.
Compare the count of keys having the prefix `key` against the given value. Usually when using this option, append a slash `/` to the end of the prefix `key`. For example, if you want to count the keys with prefix `foo`, you should use `foo/` as the `key`.
the expected result of condition, if `expected` match the condition result, then the `if_then` op will be executed, otherwise `else_then` op will be executed.
condition result
Used in:
Delete by prefix request and response
Used in:
Used in:
Delete request and response
Used in:
if or not return the prev value Not used anymore
Delete only if the `seq` matches the specified value. Such a condition skips changed record and does not result in a transaction failure. A key use case for this feature is to support `truncate-table`: the deletion of only non-modified files from a snapshot view of copied files. A table contains associated `copied-files`. Suppose Process 1 updates the table by modifying `f-3`, removing `f-4`, and adding `f-7`. In this case, Process 2 can delete only the non-modified files: ``` Process 1 Process 2 // Add copied files // Attempt to delete copied files ------------------------------------------------------------- // 1. Initial Table-A(seq:1): f-2(seq:2) f-3(seq:3) f-4(seq:4) // 2. Acquire a snapshot view Table-A(seq:1): f-2(seq:2) f-3(seq:3) f-4(seq:4) // 3. Modify table and files Table-A(seq:7): f-2(seq:2) f-3(seq:5) // updated // removed f-4 f-7(seq:6) // added // 4. Sequence of table changed from 1 to 7 // Fetch table again Table-A(seq:7): // 5. Remove only unmodified file Table-A(seq:8): // f-2 is the only file deleted f-3(seq:5) // sequence number updated f-7(seq:6) // sequence number updated ```
Used in:
Request to get the seq and value by key
Used in:
Used in:
Used in:
,TODO add Echo to get a response
Used in:
Put request and response
Used in:
Whether or not to return the prev value Not used anymore
Absolute expire time
Time to last in milliseconds. TTL is the relative expire time, since the raft-log applied. If `ttl_ms` is set, `expire_at` is ignored.
Used in:
The vote for RequestVote etc.
Used in:
Used in:
recv all kind update event.
filter only update event.
filter only delete event.