forked from hyperledger/fabric-x-committer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquery.proto
More file actions
75 lines (59 loc) · 1.69 KB
/
Copy pathquery.proto
File metadata and controls
75 lines (59 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
syntax = "proto3";
option go_package = "github.com/hyperledger/fabric-x-committer/api/protoqueryservice";
package protoqueryservice;
import "api/protoblocktx/block_tx.proto";
import "api/protonotify/notify.proto";
import "google/protobuf/empty.proto";
service QueryService {
rpc GetRows(Query) returns (Rows) {};
rpc BeginView(ViewParameters) returns (View) {};
rpc EndView(View) returns (View) {};
rpc GetNamespacePolicies(google.protobuf.Empty) returns (protoblocktx.NamespacePolicies) {};
rpc GetConfigTransaction(google.protobuf.Empty) returns (protoblocktx.ConfigTransaction) {};
rpc GetTransactionStatus(TxStatusQuery) returns (TxStatusResponse) {};
}
message View {
string id = 1;
}
message Query {
optional View view = 1;
repeated QueryNamespace namespaces = 2;
}
message Rows {
repeated RowsNamespace namespaces = 1;
}
enum IsoLevel {
Serializable = 0;
RepeatableRead = 1;
ReadCommitted = 2;
ReadUncommitted = 3;
}
message ViewParameters {
IsoLevel iso_level = 1; // View's isolation level. Defaults to serializable.
bool nonDeferrable = 2; // Do not defer errors. Defaults deferrable.
uint64 timeout_milliseconds = 3; // View's timeout. Zero => maximal value
}
message QueryNamespace {
string ns_id = 1;
repeated bytes keys = 2;
}
message RowsNamespace {
string ns_id = 1;
repeated Row rows = 2;
}
message Row {
bytes key = 1;
bytes value = 2;
uint64 version = 3;
}
message TxStatusQuery {
optional View view = 1;
repeated string tx_ids = 2; // List of transaction IDs.
}
message TxStatusResponse {
repeated protonotify.TxStatusEvent statuses = 1;
}