All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ikv.tikv-client-java.3.0.0.source-code.tikvpb.proto Maven / Gradle / Ivy

The newest version!
syntax = "proto3";
package tikvpb;

import "coprocessor.proto";
import "kvrpcpb.proto";
import "raft_serverpb.proto";

import "gogoproto/gogo.proto";
import "rustproto.proto";

option (gogoproto.sizer_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (rustproto.lite_runtime_all) = true;

option java_package = "org.tikv.kvproto";

// Serve as a distributed kv database.
service Tikv {
    // KV commands with mvcc/txn supported.
    rpc KvGet(kvrpcpb.GetRequest) returns (kvrpcpb.GetResponse) {}
    rpc KvScan(kvrpcpb.ScanRequest) returns (kvrpcpb.ScanResponse) {}
    rpc KvPrewrite(kvrpcpb.PrewriteRequest) returns (kvrpcpb.PrewriteResponse) {}
    rpc KvPessimisticLock(kvrpcpb.PessimisticLockRequest) returns (kvrpcpb.PessimisticLockResponse) {}
    rpc KVPessimisticRollback(kvrpcpb.PessimisticRollbackRequest) returns (kvrpcpb.PessimisticRollbackResponse) {}
    rpc KvTxnHeartBeat(kvrpcpb.TxnHeartBeatRequest) returns (kvrpcpb.TxnHeartBeatResponse) {}
    rpc KvCheckTxnStatus(kvrpcpb.CheckTxnStatusRequest) returns (kvrpcpb.CheckTxnStatusResponse) {}
    rpc KvCommit(kvrpcpb.CommitRequest) returns (kvrpcpb.CommitResponse) {}
    rpc KvImport(kvrpcpb.ImportRequest) returns (kvrpcpb.ImportResponse) {}
    rpc KvCleanup(kvrpcpb.CleanupRequest) returns (kvrpcpb.CleanupResponse) {}
    rpc KvBatchGet(kvrpcpb.BatchGetRequest) returns (kvrpcpb.BatchGetResponse) {}
    rpc KvBatchRollback(kvrpcpb.BatchRollbackRequest) returns (kvrpcpb.BatchRollbackResponse) {}
    rpc KvScanLock(kvrpcpb.ScanLockRequest) returns (kvrpcpb.ScanLockResponse) {}
    rpc KvResolveLock(kvrpcpb.ResolveLockRequest) returns (kvrpcpb.ResolveLockResponse) {}
    rpc KvGC(kvrpcpb.GCRequest) returns (kvrpcpb.GCResponse) {}
    rpc KvDeleteRange(kvrpcpb.DeleteRangeRequest) returns (kvrpcpb.DeleteRangeResponse) {}

    // RawKV commands.
    rpc RawGet(kvrpcpb.RawGetRequest) returns (kvrpcpb.RawGetResponse) {}
    rpc RawBatchGet(kvrpcpb.RawBatchGetRequest) returns (kvrpcpb.RawBatchGetResponse) {}
    rpc RawPut(kvrpcpb.RawPutRequest) returns (kvrpcpb.RawPutResponse) {}
    rpc RawBatchPut(kvrpcpb.RawBatchPutRequest) returns (kvrpcpb.RawBatchPutResponse) {}
    rpc RawDelete(kvrpcpb.RawDeleteRequest) returns (kvrpcpb.RawDeleteResponse) {}
    rpc RawBatchDelete(kvrpcpb.RawBatchDeleteRequest) returns (kvrpcpb.RawBatchDeleteResponse) {}
    rpc RawScan(kvrpcpb.RawScanRequest) returns (kvrpcpb.RawScanResponse) {}
    rpc RawDeleteRange(kvrpcpb.RawDeleteRangeRequest) returns (kvrpcpb.RawDeleteRangeResponse) {}
    rpc RawBatchScan(kvrpcpb.RawBatchScanRequest) returns (kvrpcpb.RawBatchScanResponse) {}

    // Store commands (to the whole tikv but not a certain region)
    rpc UnsafeDestroyRange(kvrpcpb.UnsafeDestroyRangeRequest) returns (kvrpcpb.UnsafeDestroyRangeResponse) {}
    rpc RegisterLockObserver(kvrpcpb.RegisterLockObserverRequest) returns (kvrpcpb.RegisterLockObserverResponse) {}
    rpc CheckLockObserver(kvrpcpb.CheckLockObserverRequest) returns (kvrpcpb.CheckLockObserverResponse) {}
    rpc RemoveLockObserver(kvrpcpb.RemoveLockObserverRequest) returns (kvrpcpb.RemoveLockObserverResponse) {}
    rpc PhysicalScanLock(kvrpcpb.PhysicalScanLockRequest) returns (kvrpcpb.PhysicalScanLockResponse) {}

    // SQL push down commands.
    rpc Coprocessor(coprocessor.Request) returns (coprocessor.Response) {}
    rpc CoprocessorStream(coprocessor.Request)  returns (stream coprocessor.Response) {}

    // Raft commands (tikv <-> tikv).
    rpc Raft(stream raft_serverpb.RaftMessage) returns (raft_serverpb.Done) {}
    rpc BatchRaft(stream BatchRaftMessage) returns (raft_serverpb.Done) {}
    rpc Snapshot(stream raft_serverpb.SnapshotChunk) returns (raft_serverpb.Done) {}

    // Region commands.
    rpc SplitRegion (kvrpcpb.SplitRegionRequest) returns (kvrpcpb.SplitRegionResponse) {}
    rpc ReadIndex(kvrpcpb.ReadIndexRequest) returns (kvrpcpb.ReadIndexResponse) {}

    // transaction debugger commands.
    rpc MvccGetByKey(kvrpcpb.MvccGetByKeyRequest) returns (kvrpcpb.MvccGetByKeyResponse) {}
    rpc MvccGetByStartTs(kvrpcpb.MvccGetByStartTsRequest) returns (kvrpcpb.MvccGetByStartTsResponse) {}

    rpc BatchCommands(stream BatchCommandsRequest) returns (stream BatchCommandsResponse) {}
}

message BatchCommandsRequest {
    repeated Request requests = 1;
    repeated uint64 request_ids = 2;

    message Request {
        oneof cmd {
            kvrpcpb.GetRequest Get = 1;
            kvrpcpb.ScanRequest Scan = 2;
            kvrpcpb.PrewriteRequest Prewrite = 3;
            kvrpcpb.CommitRequest Commit = 4;
            kvrpcpb.ImportRequest Import = 5;
            kvrpcpb.CleanupRequest Cleanup = 6;
            kvrpcpb.BatchGetRequest BatchGet = 7;
            kvrpcpb.BatchRollbackRequest BatchRollback = 8;
            kvrpcpb.ScanLockRequest ScanLock = 9;
            kvrpcpb.ResolveLockRequest ResolveLock = 10;
            kvrpcpb.GCRequest GC = 11;
            kvrpcpb.DeleteRangeRequest DeleteRange = 12;

            kvrpcpb.RawGetRequest RawGet = 13;
            kvrpcpb.RawBatchGetRequest RawBatchGet = 14;
            kvrpcpb.RawPutRequest RawPut = 15;
            kvrpcpb.RawBatchPutRequest RawBatchPut = 16;
            kvrpcpb.RawDeleteRequest RawDelete = 17;
            kvrpcpb.RawBatchDeleteRequest RawBatchDelete = 18;
            kvrpcpb.RawScanRequest RawScan = 19;
            kvrpcpb.RawDeleteRangeRequest RawDeleteRange = 20;
            kvrpcpb.RawBatchScanRequest RawBatchScan = 21;

            coprocessor.Request Coprocessor = 22;
            kvrpcpb.PessimisticLockRequest PessimisticLock = 23;
            kvrpcpb.PessimisticRollbackRequest PessimisticRollback = 24;

            kvrpcpb.CheckTxnStatusRequest CheckTxnStatus = 25;
            kvrpcpb.TxnHeartBeatRequest TxnHeartBeat = 26;

            // For some test cases.
            BatchCommandsEmptyRequest Empty = 255;
        }
    }
}

message BatchCommandsResponse {
    repeated Response responses = 1;
    repeated uint64 request_ids = 2;
    // 280 means TiKV gRPC cpu usage is 280%.
    uint64 transport_layer_load = 3;

    message Response {
        oneof cmd {
            kvrpcpb.GetResponse Get = 1;
            kvrpcpb.ScanResponse Scan = 2;
            kvrpcpb.PrewriteResponse Prewrite = 3;
            kvrpcpb.CommitResponse Commit = 4;
            kvrpcpb.ImportResponse Import = 5;
            kvrpcpb.CleanupResponse Cleanup = 6;
            kvrpcpb.BatchGetResponse BatchGet = 7;
            kvrpcpb.BatchRollbackResponse BatchRollback = 8;
            kvrpcpb.ScanLockResponse ScanLock = 9;
            kvrpcpb.ResolveLockResponse ResolveLock = 10;
            kvrpcpb.GCResponse GC = 11;
            kvrpcpb.DeleteRangeResponse DeleteRange = 12;

            kvrpcpb.RawGetResponse RawGet = 13;
            kvrpcpb.RawBatchGetResponse RawBatchGet = 14;
            kvrpcpb.RawPutResponse RawPut = 15;
            kvrpcpb.RawBatchPutResponse RawBatchPut = 16;
            kvrpcpb.RawDeleteResponse RawDelete = 17;
            kvrpcpb.RawBatchDeleteResponse RawBatchDelete = 18;
            kvrpcpb.RawScanResponse RawScan = 19;
            kvrpcpb.RawDeleteRangeResponse RawDeleteRange = 20;
            kvrpcpb.RawBatchScanResponse RawBatchScan = 21;

            coprocessor.Response Coprocessor = 22;
            kvrpcpb.PessimisticLockResponse PessimisticLock = 23;
            kvrpcpb.PessimisticRollbackResponse PessimisticRollback = 24;

            kvrpcpb.CheckTxnStatusResponse CheckTxnStatus = 25;
            kvrpcpb.TxnHeartBeatResponse TxnHeartBeat = 26;

            // For some test cases.
            BatchCommandsEmptyResponse Empty = 255;
        }
    }
}

message BatchRaftMessage {
    repeated raft_serverpb.RaftMessage msgs = 1;
}

message BatchCommandsEmptyRequest {
    // ID of the test request.
    uint64 test_id = 1;
    // TiKV needs to delay at least such a time to response the client.
    uint64 delay_time = 2;
}

message BatchCommandsEmptyResponse {
    // ID of the test request.
    uint64 test_id = 1;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy