erigon-pulse/ethdb/remote/kv.proto
Alex Sharov fc3cd4d5c3
Rpcdaemon: private api V2 (#1214)
* save progress

* GracefulShutdown grpc server, send to server close signal before canceling context

* GracefulShutdown json server

* GracefulShutdown json server

* fix lint

* clean

* hack hugeFreelist

* up streams limit

* up streams limit

* up streams limit

* up streams limit

* up streams limit

* up streams limit

* up streams limit

* up streams limit

* up streams limit

* save progress

* fix_race_condition_on_zstd_build

* fix_race_condition_on_zstd_build

* better close cursor

* save progress

* open read tx in all api methods

* clean

* clean
2020-10-10 13:24:56 +01:00

72 lines
1.6 KiB
Protocol Buffer

syntax = "proto3";
package remote;
option go_package = "./remote;remote";
option java_multiple_files = true;
option java_package = "io.turbo-geth.db";
option java_outer_classname = "KV";
// Provides methods to access key-value data
service KV {
// open a cursor on given position of given bucket
// if streaming requested - streams all data: stops if client's buffer is full, resumes when client read enough from buffer
// if streaming not requested - streams next data only when clients sends message to bi-directional channel
// no full consistency guarantee - server implementation can close/open underlying db transaction at any time
rpc Seek(stream SeekRequest) returns (stream Pair);
}
service KV2 {
rpc Tx(stream Cursor) returns (stream Pair2);
}
message SeekRequest {
string bucketName = 1;
bytes seekKey = 2; // streaming start from this key
bytes prefix = 3; // streaming stops when see first key without given prefix
bool startSreaming = 4;
bytes seekValue = 5; // streaming start from this value (DupSort)
}
message Pair {
bytes key = 1;
bytes value = 2;
}
enum Op {
FIRST = 0;
FIRST_DUP = 1;
SEEK = 2;
SEEK_BOTH = 3;
CURRENT = 4;
GET_MULTIPLE = 5;
LAST = 6;
LAST_DUP = 7;
NEXT = 8;
NEXT_DUP = 9;
NEXT_MULTIPLE = 10;
NEXT_NO_DUP = 11;
PREV = 12;
PREV_DUP = 13;
PREV_NO_DUP = 14;
SEEK_EXACT = 15;
SEEK_BOTH_EXACT = 16;
OPEN = 30;
CLOSE = 31;
}
message Cursor {
Op op = 1;
string bucketName = 2;
uint32 cursor = 3;
bytes k = 4;
bytes v = 5;
}
message Pair2 {
bytes k = 1;
bytes v = 2;
uint32 cursorID = 3;
}