databroker: add options for maximum capacity (#2095)

* databroker: add options

* implement redis

* add trace for enforce options
This commit is contained in:
Caleb Doxsey 2021-04-26 17:14:54 -06:00 committed by GitHub
parent b3216ae854
commit 636b3d6846
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 1085 additions and 419 deletions

View file

@ -169,6 +169,56 @@ func (x *Versions) GetLatestRecordVersion() uint64 {
return 0
}
// Options are the options for a type stored in the databroker.
type Options struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// capacity sets a maximum size for the given type. Once the capacity is
// reached the oldest records will be removed.
Capacity *uint64 `protobuf:"varint,1,opt,name=capacity,proto3,oneof" json:"capacity,omitempty"`
}
func (x *Options) Reset() {
*x = Options{}
if protoimpl.UnsafeEnabled {
mi := &file_databroker_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Options) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Options) ProtoMessage() {}
func (x *Options) ProtoReflect() protoreflect.Message {
mi := &file_databroker_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Options.ProtoReflect.Descriptor instead.
func (*Options) Descriptor() ([]byte, []int) {
return file_databroker_proto_rawDescGZIP(), []int{2}
}
func (x *Options) GetCapacity() uint64 {
if x != nil && x.Capacity != nil {
return *x.Capacity
}
return 0
}
type GetRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -181,7 +231,7 @@ type GetRequest struct {
func (x *GetRequest) Reset() {
*x = GetRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_databroker_proto_msgTypes[2]
mi := &file_databroker_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -194,7 +244,7 @@ func (x *GetRequest) String() string {
func (*GetRequest) ProtoMessage() {}
func (x *GetRequest) ProtoReflect() protoreflect.Message {
mi := &file_databroker_proto_msgTypes[2]
mi := &file_databroker_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -207,7 +257,7 @@ func (x *GetRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) Descriptor() ([]byte, []int) {
return file_databroker_proto_rawDescGZIP(), []int{2}
return file_databroker_proto_rawDescGZIP(), []int{3}
}
func (x *GetRequest) GetType() string {
@ -236,7 +286,7 @@ type GetResponse struct {
func (x *GetResponse) Reset() {
*x = GetResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_databroker_proto_msgTypes[3]
mi := &file_databroker_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -249,7 +299,7 @@ func (x *GetResponse) String() string {
func (*GetResponse) ProtoMessage() {}
func (x *GetResponse) ProtoReflect() protoreflect.Message {
mi := &file_databroker_proto_msgTypes[3]
mi := &file_databroker_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -262,7 +312,7 @@ func (x *GetResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
func (*GetResponse) Descriptor() ([]byte, []int) {
return file_databroker_proto_rawDescGZIP(), []int{3}
return file_databroker_proto_rawDescGZIP(), []int{4}
}
func (x *GetResponse) GetRecord() *Record {
@ -293,7 +343,7 @@ type QueryRequest struct {
func (x *QueryRequest) Reset() {
*x = QueryRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_databroker_proto_msgTypes[4]
mi := &file_databroker_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -306,7 +356,7 @@ func (x *QueryRequest) String() string {
func (*QueryRequest) ProtoMessage() {}
func (x *QueryRequest) ProtoReflect() protoreflect.Message {
mi := &file_databroker_proto_msgTypes[4]
mi := &file_databroker_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -319,7 +369,7 @@ func (x *QueryRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.
func (*QueryRequest) Descriptor() ([]byte, []int) {
return file_databroker_proto_rawDescGZIP(), []int{4}
return file_databroker_proto_rawDescGZIP(), []int{5}
}
func (x *QueryRequest) GetType() string {
@ -362,7 +412,7 @@ type QueryResponse struct {
func (x *QueryResponse) Reset() {
*x = QueryResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_databroker_proto_msgTypes[5]
mi := &file_databroker_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -375,7 +425,7 @@ func (x *QueryResponse) String() string {
func (*QueryResponse) ProtoMessage() {}
func (x *QueryResponse) ProtoReflect() protoreflect.Message {
mi := &file_databroker_proto_msgTypes[5]
mi := &file_databroker_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -388,7 +438,7 @@ func (x *QueryResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.
func (*QueryResponse) Descriptor() ([]byte, []int) {
return file_databroker_proto_rawDescGZIP(), []int{5}
return file_databroker_proto_rawDescGZIP(), []int{6}
}
func (x *QueryResponse) GetRecords() []*Record {
@ -416,7 +466,7 @@ type PutRequest struct {
func (x *PutRequest) Reset() {
*x = PutRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_databroker_proto_msgTypes[6]
mi := &file_databroker_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -429,7 +479,7 @@ func (x *PutRequest) String() string {
func (*PutRequest) ProtoMessage() {}
func (x *PutRequest) ProtoReflect() protoreflect.Message {
mi := &file_databroker_proto_msgTypes[6]
mi := &file_databroker_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -442,7 +492,7 @@ func (x *PutRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use PutRequest.ProtoReflect.Descriptor instead.
func (*PutRequest) Descriptor() ([]byte, []int) {
return file_databroker_proto_rawDescGZIP(), []int{6}
return file_databroker_proto_rawDescGZIP(), []int{7}
}
func (x *PutRequest) GetRecord() *Record {
@ -464,7 +514,7 @@ type PutResponse struct {
func (x *PutResponse) Reset() {
*x = PutResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_databroker_proto_msgTypes[7]
mi := &file_databroker_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -477,7 +527,7 @@ func (x *PutResponse) String() string {
func (*PutResponse) ProtoMessage() {}
func (x *PutResponse) ProtoReflect() protoreflect.Message {
mi := &file_databroker_proto_msgTypes[7]
mi := &file_databroker_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -490,7 +540,7 @@ func (x *PutResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use PutResponse.ProtoReflect.Descriptor instead.
func (*PutResponse) Descriptor() ([]byte, []int) {
return file_databroker_proto_rawDescGZIP(), []int{7}
return file_databroker_proto_rawDescGZIP(), []int{8}
}
func (x *PutResponse) GetServerVersion() uint64 {
@ -507,6 +557,108 @@ func (x *PutResponse) GetRecord() *Record {
return nil
}
type SetOptionsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
Options *Options `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
}
func (x *SetOptionsRequest) Reset() {
*x = SetOptionsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_databroker_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SetOptionsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SetOptionsRequest) ProtoMessage() {}
func (x *SetOptionsRequest) ProtoReflect() protoreflect.Message {
mi := &file_databroker_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SetOptionsRequest.ProtoReflect.Descriptor instead.
func (*SetOptionsRequest) Descriptor() ([]byte, []int) {
return file_databroker_proto_rawDescGZIP(), []int{9}
}
func (x *SetOptionsRequest) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *SetOptionsRequest) GetOptions() *Options {
if x != nil {
return x.Options
}
return nil
}
type SetOptionsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Options *Options `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"`
}
func (x *SetOptionsResponse) Reset() {
*x = SetOptionsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_databroker_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SetOptionsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SetOptionsResponse) ProtoMessage() {}
func (x *SetOptionsResponse) ProtoReflect() protoreflect.Message {
mi := &file_databroker_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SetOptionsResponse.ProtoReflect.Descriptor instead.
func (*SetOptionsResponse) Descriptor() ([]byte, []int) {
return file_databroker_proto_rawDescGZIP(), []int{10}
}
func (x *SetOptionsResponse) GetOptions() *Options {
if x != nil {
return x.Options
}
return nil
}
type SyncRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -519,7 +671,7 @@ type SyncRequest struct {
func (x *SyncRequest) Reset() {
*x = SyncRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_databroker_proto_msgTypes[8]
mi := &file_databroker_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -532,7 +684,7 @@ func (x *SyncRequest) String() string {
func (*SyncRequest) ProtoMessage() {}
func (x *SyncRequest) ProtoReflect() protoreflect.Message {
mi := &file_databroker_proto_msgTypes[8]
mi := &file_databroker_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -545,7 +697,7 @@ func (x *SyncRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SyncRequest.ProtoReflect.Descriptor instead.
func (*SyncRequest) Descriptor() ([]byte, []int) {
return file_databroker_proto_rawDescGZIP(), []int{8}
return file_databroker_proto_rawDescGZIP(), []int{11}
}
func (x *SyncRequest) GetServerVersion() uint64 {
@ -574,7 +726,7 @@ type SyncResponse struct {
func (x *SyncResponse) Reset() {
*x = SyncResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_databroker_proto_msgTypes[9]
mi := &file_databroker_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -587,7 +739,7 @@ func (x *SyncResponse) String() string {
func (*SyncResponse) ProtoMessage() {}
func (x *SyncResponse) ProtoReflect() protoreflect.Message {
mi := &file_databroker_proto_msgTypes[9]
mi := &file_databroker_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -600,7 +752,7 @@ func (x *SyncResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use SyncResponse.ProtoReflect.Descriptor instead.
func (*SyncResponse) Descriptor() ([]byte, []int) {
return file_databroker_proto_rawDescGZIP(), []int{9}
return file_databroker_proto_rawDescGZIP(), []int{12}
}
func (x *SyncResponse) GetServerVersion() uint64 {
@ -628,7 +780,7 @@ type SyncLatestRequest struct {
func (x *SyncLatestRequest) Reset() {
*x = SyncLatestRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_databroker_proto_msgTypes[10]
mi := &file_databroker_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -641,7 +793,7 @@ func (x *SyncLatestRequest) String() string {
func (*SyncLatestRequest) ProtoMessage() {}
func (x *SyncLatestRequest) ProtoReflect() protoreflect.Message {
mi := &file_databroker_proto_msgTypes[10]
mi := &file_databroker_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -654,7 +806,7 @@ func (x *SyncLatestRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SyncLatestRequest.ProtoReflect.Descriptor instead.
func (*SyncLatestRequest) Descriptor() ([]byte, []int) {
return file_databroker_proto_rawDescGZIP(), []int{10}
return file_databroker_proto_rawDescGZIP(), []int{13}
}
func (x *SyncLatestRequest) GetType() string {
@ -678,7 +830,7 @@ type SyncLatestResponse struct {
func (x *SyncLatestResponse) Reset() {
*x = SyncLatestResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_databroker_proto_msgTypes[11]
mi := &file_databroker_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -691,7 +843,7 @@ func (x *SyncLatestResponse) String() string {
func (*SyncLatestResponse) ProtoMessage() {}
func (x *SyncLatestResponse) ProtoReflect() protoreflect.Message {
mi := &file_databroker_proto_msgTypes[11]
mi := &file_databroker_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -704,7 +856,7 @@ func (x *SyncLatestResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use SyncLatestResponse.ProtoReflect.Descriptor instead.
func (*SyncLatestResponse) Descriptor() ([]byte, []int) {
return file_databroker_proto_rawDescGZIP(), []int{11}
return file_databroker_proto_rawDescGZIP(), []int{14}
}
func (m *SyncLatestResponse) GetResponse() isSyncLatestResponse_Response {
@ -773,86 +925,105 @@ var file_databroker_proto_rawDesc = []byte{
0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x15, 0x6c, 0x61, 0x74, 0x65,
0x73, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52,
0x65, 0x63, 0x6f, 0x72, 0x64, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x30, 0x0a, 0x0a,
0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79,
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x60,
0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a,
0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e,
0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72,
0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
0x04, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x22, 0x66, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66,
0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73,
0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28,
0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x5e, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72,
0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x63,
0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x61, 0x74,
0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07,
0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c,
0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f,
0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x38, 0x0a, 0x0a, 0x50, 0x75, 0x74, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64,
0x65, 0x63, 0x6f, 0x72, 0x64, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x37, 0x0a, 0x07,
0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x08, 0x63, 0x61, 0x70, 0x61, 0x63,
0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x08, 0x63, 0x61, 0x70,
0x61, 0x63, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x63, 0x61, 0x70,
0x61, 0x63, 0x69, 0x74, 0x79, 0x22, 0x30, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x60, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f,
0x6b, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f,
0x72, 0x64, 0x22, 0x60, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f,
0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62,
0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65,
0x63, 0x6f, 0x72, 0x64, 0x22, 0x5b, 0x0a, 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x76, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65,
0x63, 0x6f, 0x72, 0x64, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01,
0x28, 0x04, 0x52, 0x0d, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x22, 0x61, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f,
0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62,
0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65,
0x63, 0x6f, 0x72, 0x64, 0x22, 0x27, 0x0a, 0x11, 0x53, 0x79, 0x6e, 0x63, 0x4c, 0x61, 0x74, 0x65,
0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x82, 0x01,
0x0a, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65,
0x72, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f,
0x72, 0x64, 0x12, 0x32, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65,
0x72, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x08, 0x76, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x32, 0xcd, 0x02, 0x0a, 0x11, 0x44, 0x61, 0x74, 0x61, 0x42, 0x72, 0x6f, 0x6b, 0x65,
0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12,
0x16, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72,
0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x36, 0x0a, 0x03, 0x50, 0x75, 0x74, 0x12, 0x16, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72,
0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x17, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72,
0x79, 0x12, 0x18, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x51,
0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x64, 0x61,
0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x17,
0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x53, 0x79, 0x6e, 0x63,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72,
0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x30, 0x01, 0x12, 0x4d, 0x0a, 0x0a, 0x53, 0x79, 0x6e, 0x63, 0x4c, 0x61, 0x74, 0x65, 0x73,
0x74, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x53,
0x79, 0x6e, 0x63, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x1e, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x53, 0x79,
0x6e, 0x63, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x30, 0x01, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x70, 0x6f, 0x6d, 0x65, 0x72, 0x69, 0x75, 0x6d, 0x2f, 0x70, 0x6f, 0x6d, 0x65, 0x72, 0x69,
0x75, 0x6d, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x61, 0x74, 0x61,
0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x72, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72,
0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x66, 0x0a, 0x0c, 0x51, 0x75, 0x65,
0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a,
0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75,
0x65, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20,
0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c,
0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69,
0x74, 0x22, 0x5e, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72,
0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73,
0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e,
0x74, 0x22, 0x38, 0x0a, 0x0a, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x2a, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x12, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x63,
0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x60, 0x0a, 0x0b, 0x50,
0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65,
0x72, 0x76, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01,
0x28, 0x04, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x12, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x52,
0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x56, 0x0a,
0x11, 0x53, 0x65, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72,
0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x43, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x4f, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x6f,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64,
0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x5b, 0x0a, 0x0b, 0x53, 0x79,
0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x04, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69,
0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64,
0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x61, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52,
0x0d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2a,
0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12,
0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x63, 0x6f,
0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x27, 0x0a, 0x11, 0x53, 0x79,
0x6e, 0x63, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74,
0x79, 0x70, 0x65, 0x22, 0x82, 0x01, 0x0a, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x4c, 0x61, 0x74, 0x65,
0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x72, 0x65,
0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x61, 0x74,
0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00,
0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x32, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x61, 0x74,
0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73,
0x48, 0x00, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0a, 0x0a, 0x08,
0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x9a, 0x03, 0x0a, 0x11, 0x44, 0x61, 0x74,
0x61, 0x42, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x36,
0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x16, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b,
0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e,
0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x03, 0x50, 0x75, 0x74, 0x12, 0x16, 0x2e,
0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b,
0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c,
0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x18, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72,
0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x19, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x51,
0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0a,
0x53, 0x65, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x74,
0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x64, 0x61, 0x74, 0x61,
0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x79, 0x6e,
0x63, 0x12, 0x17, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x53,
0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x64, 0x61, 0x74,
0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x4d, 0x0a, 0x0a, 0x53, 0x79, 0x6e, 0x63, 0x4c, 0x61,
0x74, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65,
0x72, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72,
0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6f, 0x6d, 0x65, 0x72, 0x69, 0x75, 0x6d, 0x2f, 0x70, 0x6f, 0x6d,
0x65, 0x72, 0x69, 0x75, 0x6d, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x64,
0x61, 0x74, 0x61, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
@ -867,49 +1038,56 @@ func file_databroker_proto_rawDescGZIP() []byte {
return file_databroker_proto_rawDescData
}
var file_databroker_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_databroker_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_databroker_proto_goTypes = []interface{}{
(*Record)(nil), // 0: databroker.Record
(*Versions)(nil), // 1: databroker.Versions
(*GetRequest)(nil), // 2: databroker.GetRequest
(*GetResponse)(nil), // 3: databroker.GetResponse
(*QueryRequest)(nil), // 4: databroker.QueryRequest
(*QueryResponse)(nil), // 5: databroker.QueryResponse
(*PutRequest)(nil), // 6: databroker.PutRequest
(*PutResponse)(nil), // 7: databroker.PutResponse
(*SyncRequest)(nil), // 8: databroker.SyncRequest
(*SyncResponse)(nil), // 9: databroker.SyncResponse
(*SyncLatestRequest)(nil), // 10: databroker.SyncLatestRequest
(*SyncLatestResponse)(nil), // 11: databroker.SyncLatestResponse
(*anypb.Any)(nil), // 12: google.protobuf.Any
(*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp
(*Options)(nil), // 2: databroker.Options
(*GetRequest)(nil), // 3: databroker.GetRequest
(*GetResponse)(nil), // 4: databroker.GetResponse
(*QueryRequest)(nil), // 5: databroker.QueryRequest
(*QueryResponse)(nil), // 6: databroker.QueryResponse
(*PutRequest)(nil), // 7: databroker.PutRequest
(*PutResponse)(nil), // 8: databroker.PutResponse
(*SetOptionsRequest)(nil), // 9: databroker.SetOptionsRequest
(*SetOptionsResponse)(nil), // 10: databroker.SetOptionsResponse
(*SyncRequest)(nil), // 11: databroker.SyncRequest
(*SyncResponse)(nil), // 12: databroker.SyncResponse
(*SyncLatestRequest)(nil), // 13: databroker.SyncLatestRequest
(*SyncLatestResponse)(nil), // 14: databroker.SyncLatestResponse
(*anypb.Any)(nil), // 15: google.protobuf.Any
(*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp
}
var file_databroker_proto_depIdxs = []int32{
12, // 0: databroker.Record.data:type_name -> google.protobuf.Any
13, // 1: databroker.Record.modified_at:type_name -> google.protobuf.Timestamp
13, // 2: databroker.Record.deleted_at:type_name -> google.protobuf.Timestamp
15, // 0: databroker.Record.data:type_name -> google.protobuf.Any
16, // 1: databroker.Record.modified_at:type_name -> google.protobuf.Timestamp
16, // 2: databroker.Record.deleted_at:type_name -> google.protobuf.Timestamp
0, // 3: databroker.GetResponse.record:type_name -> databroker.Record
0, // 4: databroker.QueryResponse.records:type_name -> databroker.Record
0, // 5: databroker.PutRequest.record:type_name -> databroker.Record
0, // 6: databroker.PutResponse.record:type_name -> databroker.Record
0, // 7: databroker.SyncResponse.record:type_name -> databroker.Record
0, // 8: databroker.SyncLatestResponse.record:type_name -> databroker.Record
1, // 9: databroker.SyncLatestResponse.versions:type_name -> databroker.Versions
2, // 10: databroker.DataBrokerService.Get:input_type -> databroker.GetRequest
6, // 11: databroker.DataBrokerService.Put:input_type -> databroker.PutRequest
4, // 12: databroker.DataBrokerService.Query:input_type -> databroker.QueryRequest
8, // 13: databroker.DataBrokerService.Sync:input_type -> databroker.SyncRequest
10, // 14: databroker.DataBrokerService.SyncLatest:input_type -> databroker.SyncLatestRequest
3, // 15: databroker.DataBrokerService.Get:output_type -> databroker.GetResponse
7, // 16: databroker.DataBrokerService.Put:output_type -> databroker.PutResponse
5, // 17: databroker.DataBrokerService.Query:output_type -> databroker.QueryResponse
9, // 18: databroker.DataBrokerService.Sync:output_type -> databroker.SyncResponse
11, // 19: databroker.DataBrokerService.SyncLatest:output_type -> databroker.SyncLatestResponse
15, // [15:20] is the sub-list for method output_type
10, // [10:15] is the sub-list for method input_type
10, // [10:10] is the sub-list for extension type_name
10, // [10:10] is the sub-list for extension extendee
0, // [0:10] is the sub-list for field type_name
2, // 7: databroker.SetOptionsRequest.options:type_name -> databroker.Options
2, // 8: databroker.SetOptionsResponse.options:type_name -> databroker.Options
0, // 9: databroker.SyncResponse.record:type_name -> databroker.Record
0, // 10: databroker.SyncLatestResponse.record:type_name -> databroker.Record
1, // 11: databroker.SyncLatestResponse.versions:type_name -> databroker.Versions
3, // 12: databroker.DataBrokerService.Get:input_type -> databroker.GetRequest
7, // 13: databroker.DataBrokerService.Put:input_type -> databroker.PutRequest
5, // 14: databroker.DataBrokerService.Query:input_type -> databroker.QueryRequest
9, // 15: databroker.DataBrokerService.SetOptions:input_type -> databroker.SetOptionsRequest
11, // 16: databroker.DataBrokerService.Sync:input_type -> databroker.SyncRequest
13, // 17: databroker.DataBrokerService.SyncLatest:input_type -> databroker.SyncLatestRequest
4, // 18: databroker.DataBrokerService.Get:output_type -> databroker.GetResponse
8, // 19: databroker.DataBrokerService.Put:output_type -> databroker.PutResponse
6, // 20: databroker.DataBrokerService.Query:output_type -> databroker.QueryResponse
10, // 21: databroker.DataBrokerService.SetOptions:output_type -> databroker.SetOptionsResponse
12, // 22: databroker.DataBrokerService.Sync:output_type -> databroker.SyncResponse
14, // 23: databroker.DataBrokerService.SyncLatest:output_type -> databroker.SyncLatestResponse
18, // [18:24] is the sub-list for method output_type
12, // [12:18] is the sub-list for method input_type
12, // [12:12] is the sub-list for extension type_name
12, // [12:12] is the sub-list for extension extendee
0, // [0:12] is the sub-list for field type_name
}
func init() { file_databroker_proto_init() }
@ -943,7 +1121,7 @@ func file_databroker_proto_init() {
}
}
file_databroker_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetRequest); i {
switch v := v.(*Options); i {
case 0:
return &v.state
case 1:
@ -955,7 +1133,7 @@ func file_databroker_proto_init() {
}
}
file_databroker_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetResponse); i {
switch v := v.(*GetRequest); i {
case 0:
return &v.state
case 1:
@ -967,7 +1145,7 @@ func file_databroker_proto_init() {
}
}
file_databroker_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*QueryRequest); i {
switch v := v.(*GetResponse); i {
case 0:
return &v.state
case 1:
@ -979,7 +1157,7 @@ func file_databroker_proto_init() {
}
}
file_databroker_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*QueryResponse); i {
switch v := v.(*QueryRequest); i {
case 0:
return &v.state
case 1:
@ -991,7 +1169,7 @@ func file_databroker_proto_init() {
}
}
file_databroker_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PutRequest); i {
switch v := v.(*QueryResponse); i {
case 0:
return &v.state
case 1:
@ -1003,7 +1181,7 @@ func file_databroker_proto_init() {
}
}
file_databroker_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PutResponse); i {
switch v := v.(*PutRequest); i {
case 0:
return &v.state
case 1:
@ -1015,7 +1193,7 @@ func file_databroker_proto_init() {
}
}
file_databroker_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncRequest); i {
switch v := v.(*PutResponse); i {
case 0:
return &v.state
case 1:
@ -1027,7 +1205,7 @@ func file_databroker_proto_init() {
}
}
file_databroker_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncResponse); i {
switch v := v.(*SetOptionsRequest); i {
case 0:
return &v.state
case 1:
@ -1039,7 +1217,7 @@ func file_databroker_proto_init() {
}
}
file_databroker_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncLatestRequest); i {
switch v := v.(*SetOptionsResponse); i {
case 0:
return &v.state
case 1:
@ -1051,6 +1229,42 @@ func file_databroker_proto_init() {
}
}
file_databroker_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_databroker_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_databroker_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncLatestRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_databroker_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncLatestResponse); i {
case 0:
return &v.state
@ -1063,7 +1277,8 @@ func file_databroker_proto_init() {
}
}
}
file_databroker_proto_msgTypes[11].OneofWrappers = []interface{}{
file_databroker_proto_msgTypes[2].OneofWrappers = []interface{}{}
file_databroker_proto_msgTypes[14].OneofWrappers = []interface{}{
(*SyncLatestResponse_Record)(nil),
(*SyncLatestResponse_Versions)(nil),
}
@ -1073,7 +1288,7 @@ func file_databroker_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_databroker_proto_rawDesc,
NumEnums: 0,
NumMessages: 12,
NumMessages: 15,
NumExtensions: 0,
NumServices: 1,
},
@ -1105,6 +1320,8 @@ type DataBrokerServiceClient interface {
Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
// Query queries for records.
Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error)
// SetOptions sets the options for a type in the databroker.
SetOptions(ctx context.Context, in *SetOptionsRequest, opts ...grpc.CallOption) (*SetOptionsResponse, error)
// Sync streams changes to records after the specified version.
Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (DataBrokerService_SyncClient, error)
// SyncLatest streams the latest version of every record.
@ -1146,6 +1363,15 @@ func (c *dataBrokerServiceClient) Query(ctx context.Context, in *QueryRequest, o
return out, nil
}
func (c *dataBrokerServiceClient) SetOptions(ctx context.Context, in *SetOptionsRequest, opts ...grpc.CallOption) (*SetOptionsResponse, error) {
out := new(SetOptionsResponse)
err := c.cc.Invoke(ctx, "/databroker.DataBrokerService/SetOptions", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *dataBrokerServiceClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (DataBrokerService_SyncClient, error) {
stream, err := c.cc.NewStream(ctx, &_DataBrokerService_serviceDesc.Streams[0], "/databroker.DataBrokerService/Sync", opts...)
if err != nil {
@ -1218,6 +1444,8 @@ type DataBrokerServiceServer interface {
Put(context.Context, *PutRequest) (*PutResponse, error)
// Query queries for records.
Query(context.Context, *QueryRequest) (*QueryResponse, error)
// SetOptions sets the options for a type in the databroker.
SetOptions(context.Context, *SetOptionsRequest) (*SetOptionsResponse, error)
// Sync streams changes to records after the specified version.
Sync(*SyncRequest, DataBrokerService_SyncServer) error
// SyncLatest streams the latest version of every record.
@ -1237,6 +1465,9 @@ func (*UnimplementedDataBrokerServiceServer) Put(context.Context, *PutRequest) (
func (*UnimplementedDataBrokerServiceServer) Query(context.Context, *QueryRequest) (*QueryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Query not implemented")
}
func (*UnimplementedDataBrokerServiceServer) SetOptions(context.Context, *SetOptionsRequest) (*SetOptionsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetOptions not implemented")
}
func (*UnimplementedDataBrokerServiceServer) Sync(*SyncRequest, DataBrokerService_SyncServer) error {
return status.Errorf(codes.Unimplemented, "method Sync not implemented")
}
@ -1302,6 +1533,24 @@ func _DataBrokerService_Query_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler)
}
func _DataBrokerService_SetOptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetOptionsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DataBrokerServiceServer).SetOptions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/databroker.DataBrokerService/SetOptions",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DataBrokerServiceServer).SetOptions(ctx, req.(*SetOptionsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DataBrokerService_Sync_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(SyncRequest)
if err := stream.RecvMsg(m); err != nil {
@ -1360,6 +1609,10 @@ var _DataBrokerService_serviceDesc = grpc.ServiceDesc{
MethodName: "Query",
Handler: _DataBrokerService_Query_Handler,
},
{
MethodName: "SetOptions",
Handler: _DataBrokerService_SetOptions_Handler,
},
},
Streams: []grpc.StreamDesc{
{

View file

@ -20,6 +20,13 @@ message Versions {
uint64 latest_record_version = 2;
}
// Options are the options for a type stored in the databroker.
message Options {
// capacity sets a maximum size for the given type. Once the capacity is
// reached the oldest records will be removed.
optional uint64 capacity = 1;
}
message GetRequest {
string type = 1;
string id = 2;
@ -46,6 +53,14 @@ message PutResponse {
Record record = 2;
}
message SetOptionsRequest {
string type = 1;
Options options = 2;
}
message SetOptionsResponse {
Options options = 1;
}
message SyncRequest {
uint64 server_version = 1;
uint64 record_version = 2;
@ -71,6 +86,8 @@ service DataBrokerService {
rpc Put(PutRequest) returns (PutResponse);
// Query queries for records.
rpc Query(QueryRequest) returns (QueryResponse);
// SetOptions sets the options for a type in the databroker.
rpc SetOptions(SetOptionsRequest) returns (SetOptionsResponse);
// Sync streams changes to records after the specified version.
rpc Sync(SyncRequest) returns (stream SyncResponse);
// SyncLatest streams the latest version of every record.