diff --git a/client/internal/vanus/eventlog/name_service.go b/client/internal/vanus/eventlog/name_service.go index b30abceb3..e59c43163 100644 --- a/client/internal/vanus/eventlog/name_service.go +++ b/client/internal/vanus/eventlog/name_service.go @@ -48,13 +48,13 @@ type NameService struct { tracer *tracing.Tracer } -func (ns *NameService) LookupWritableSegment(ctx context.Context, logID uint64) (*record.Segment, error) { +func (ns *NameService) LookupWritableSegment(ctx context.Context, logID uint64) ([]*record.Segment, error) { ctx, span := ns.tracer.Start(ctx, "LookupWritableSegment") defer span.End() req := &ctrlpb.GetAppendableSegmentRequest{ EventLogId: logID, - Limited: 1, + Limited: 2, } resp, err := ns.client.GetAppendableSegment(ctx, req) @@ -75,26 +75,28 @@ func (ns *NameService) LookupWritableSegment(ctx context.Context, logID uint64) if len(segments) == 0 { return nil, errors.ErrNotWritable } - return segments[0], nil + return segments, nil } func (ns *NameService) LookupReadableSegments(ctx context.Context, logID uint64) ([]*record.Segment, error) { ctx, span := ns.tracer.Start(ctx, "LookupReadableSegments") defer span.End() - req := &ctrlpb.ListSegmentRequest{ - EventLogId: logID, - StartOffset: 0, - EndOffset: math.MaxInt64, - Limited: math.MaxInt32, + req := &ctrlpb.GetReadableSegmentRequest{ + EventLogId: logID, + Limited: math.MaxInt32, } - resp, err := ns.client.ListSegment(ctx, req) + resp, err := ns.client.GetReadableSegment(ctx, req) if err != nil { return nil, err } segments := toSegments(resp.GetSegments()) + if len(segments) == 0 { + return nil, errors.ErrNotReadable + } + return segments, nil } @@ -107,9 +109,9 @@ func toSegments(pbs []*metapb.Segment) []*record.Segment { segment := toSegment(pb) segments = append(segments, segment) // only return first working segment - if segment.Writable { - break - } + // if segment.Writable { + // break + // } } return segments } @@ -123,13 +125,15 @@ func toSegment(segment *metapb.Segment) *record.Segment { } } return &record.Segment{ - ID: segment.GetId(), - StartOffset: segment.GetStartOffsetInLog(), - EndOffset: segment.GetEndOffsetInLog(), - FirstEventBornAt: time.UnixMilli(segment.FirstEventBornAtByUnixMs), - LastEventBornAt: time.UnixMilli(segment.LastEvnetBornAtByUnixMs), - Writable: segment.State == "working", // TODO: writable - Blocks: blocks, - LeaderBlockID: segment.GetLeaderBlockId(), + ID: segment.GetId(), + PreviousSegmentId: segment.GetPreviousSegmentId(), + NextSegmentId: segment.GetNextSegmentId(), + StartOffset: segment.GetStartOffsetInLog(), + EndOffset: segment.GetEndOffsetInLog(), + FirstEventBornAt: time.UnixMilli(segment.FirstEventBornAtByUnixMs), + LastEventBornAt: time.UnixMilli(segment.LastEvnetBornAtByUnixMs), + Writable: segment.State == "working", // TODO: writable + Blocks: blocks, + LeaderBlockID: segment.GetLeaderBlockId(), } } diff --git a/client/pkg/api/client.go b/client/pkg/api/client.go index f5b092c69..0e997e575 100644 --- a/client/pkg/api/client.go +++ b/client/pkg/api/client.go @@ -17,6 +17,7 @@ package api import ( "context" + ce "github.com/cloudevents/sdk-go/v2" "github.com/linkall-labs/vanus/proto/pkg/cloudevents" ) @@ -32,7 +33,7 @@ type Eventbus interface { type BusWriter interface { AppendOne(ctx context.Context, event *ce.Event, opts ...WriteOption) (eid string, err error) - AppendMany(ctx context.Context, events []*ce.Event, opts ...WriteOption) (eid string, err error) + AppendMany(ctx context.Context, events []*ce.Event, opts ...WriteOption) (err error) AppendBatch(ctx context.Context, events *cloudevents.CloudEventBatch, opts ...WriteOption) (err error) } diff --git a/client/pkg/api/mock_client.go b/client/pkg/api/mock_client.go index ffb896001..608e60735 100644 --- a/client/pkg/api/mock_client.go +++ b/client/pkg/api/mock_client.go @@ -167,16 +167,15 @@ func (mr *MockBusWriterMockRecorder) AppendBatch(ctx, events interface{}, opts . } // AppendMany mocks base method. -func (m *MockBusWriter) AppendMany(ctx context.Context, events []*v2.Event, opts ...WriteOption) (string, error) { +func (m *MockBusWriter) AppendMany(ctx context.Context, events []*v2.Event, opts ...WriteOption) error { m.ctrl.T.Helper() varargs := []interface{}{ctx, events} for _, a := range opts { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "AppendMany", varargs...) - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret0, _ := ret[0].(error) + return ret0 } // AppendMany indicates an expected call of AppendMany. diff --git a/client/pkg/eventbus/eventbus.go b/client/pkg/eventbus/eventbus.go index b42d28745..090a401a2 100644 --- a/client/pkg/eventbus/eventbus.go +++ b/client/pkg/eventbus/eventbus.go @@ -17,13 +17,12 @@ package eventbus import ( // standard libraries. "context" - "encoding/base64" - "encoding/binary" stderrors "errors" - "github.com/linkall-labs/vanus/proto/pkg/cloudevents" "io" "sync" + "github.com/linkall-labs/vanus/proto/pkg/cloudevents" + "github.com/linkall-labs/vanus/observability/tracing" "go.opentelemetry.io/otel/trace" @@ -37,7 +36,7 @@ import ( "github.com/linkall-labs/vanus/client/pkg/api" "github.com/linkall-labs/vanus/client/pkg/eventlog" "github.com/linkall-labs/vanus/client/pkg/policy" - vlog "github.com/linkall-labs/vanus/observability/log" + "github.com/linkall-labs/vanus/observability/log" "github.com/linkall-labs/vanus/pkg/errors" eb "github.com/linkall-labs/vanus/client/internal/vanus/eventbus" @@ -67,7 +66,7 @@ func NewEventbus(cfg *eb.Config) *eventbus { for { re, ok := <-ch if !ok { - vlog.Debug(context.Background(), "eventbus quits writable watcher", map[string]interface{}{ + log.Debug(context.Background(), "eventbus quits writable watcher", map[string]interface{}{ "eventbus": bus.cfg.Name, }) break @@ -89,7 +88,7 @@ func NewEventbus(cfg *eb.Config) *eventbus { for { re, ok := <-ch if !ok { - vlog.Debug(context.Background(), "eventbus quits readable watcher", map[string]interface{}{ + log.Debug(context.Background(), "eventbus quits readable watcher", map[string]interface{}{ "eventbus": bus.cfg.Name, }) break @@ -185,19 +184,31 @@ func (b *eventbus) GetLog(ctx context.Context, logID uint64, opts ...api.LogOpti } if op.Policy.AccessMode() == api.ReadOnly { + b.readableMu.RLock() + defer b.readableMu.RUnlock() if len(b.readableLogs) == 0 { - b.refreshReadableLogs(ctx) + func() { + b.readableMu.RUnlock() + defer b.readableMu.RLock() + b.refreshReadableLogs(ctx) + }() } - if log, ok := b.readableLogs[logID]; ok { - return log, nil + if l, ok := b.readableLogs[logID]; ok { + return l, nil } return nil, errors.ErrResourceNotFound.WithMessage("eventlog not found") } else if op.Policy.AccessMode() == api.ReadWrite { + b.writableMu.RLock() + defer b.writableMu.RUnlock() if len(b.writableLogs) == 0 { - b.refreshWritableLogs(ctx) + func() { + b.writableMu.RUnlock() + defer b.writableMu.RLock() + b.refreshWritableLogs(ctx) + }() } - if log, ok := b.writableLogs[logID]; ok { - return log, nil + if l, ok := b.writableLogs[logID]; ok { + return l, nil } return nil, errors.ErrResourceNotFound.WithMessage("eventlog not found") } else { @@ -216,8 +227,14 @@ func (b *eventbus) ListLog(ctx context.Context, opts ...api.LogOption) ([]api.Ev } if op.Policy.AccessMode() == api.ReadOnly { + b.readableMu.RLock() + defer b.readableMu.RUnlock() if len(b.readableLogs) == 0 { - b.refreshReadableLogs(ctx) + func() { + b.readableMu.RUnlock() + defer b.readableMu.RLock() + b.refreshReadableLogs(ctx) + }() } eventlogs := make([]api.Eventlog, 0) for _, el := range b.readableLogs { @@ -225,8 +242,14 @@ func (b *eventbus) ListLog(ctx context.Context, opts ...api.LogOption) ([]api.Ev } return eventlogs, nil } else if op.Policy.AccessMode() == api.ReadWrite { + b.writableMu.RLock() + defer b.writableMu.RUnlock() if len(b.writableLogs) == 0 { - b.refreshWritableLogs(ctx) + func() { + b.writableMu.RUnlock() + defer b.writableMu.RLock() + b.refreshWritableLogs(ctx) + }() } eventlogs := make([]api.Eventlog, 0) for _, el := range b.writableLogs { @@ -311,8 +334,8 @@ func (b *eventbus) updateWritableLogs(ctx context.Context, re *WritableLogsResul Endpoints: b.cfg.Endpoints, ID: logID, } - log := eventlog.NewEventLog(cfg) - lws[logID] = log + l := eventlog.NewEventLog(cfg) + lws[logID] = l return true }) b.setWritableLogs(s, lws) @@ -404,8 +427,8 @@ func (b *eventbus) updateReadableLogs(ctx context.Context, re *ReadableLogsResul Endpoints: b.cfg.Endpoints, ID: logID, } - log := eventlog.NewEventLog(cfg) - lws[logID] = log + l := eventlog.NewEventLog(cfg) + lws[logID] = l return true }) b.setReadableLogs(s, lws) @@ -471,7 +494,7 @@ func (w *busWriter) AppendBatch(ctx context.Context, events *cloudevents.CloudEv var _ api.BusWriter = (*busWriter)(nil) -func (w *busWriter) AppendOne(ctx context.Context, event *ce.Event, opts ...api.WriteOption) (eid string, err error) { +func (w *busWriter) AppendOne(ctx context.Context, event *ce.Event, opts ...api.WriteOption) (string, error) { _ctx, span := w.tracer.Start(ctx, "AppendOne") defer span.End() @@ -490,23 +513,17 @@ func (w *busWriter) AppendOne(ctx context.Context, event *ce.Event, opts ...api. } // 2. append the event to the eventlog - off, err := lw.Append(_ctx, event) + eid, err := lw.Append(_ctx, event) if err != nil { return "", err } - // 3. generate event ID - var buf [16]byte - binary.BigEndian.PutUint64(buf[0:8], lw.Log().ID()) - binary.BigEndian.PutUint64(buf[8:16], uint64(off)) - encoded := base64.StdEncoding.EncodeToString(buf[:]) - - return encoded, nil + return eid, nil } -func (w *busWriter) AppendMany(ctx context.Context, events []*ce.Event, opts ...api.WriteOption) (eid string, err error) { +func (w *busWriter) AppendMany(ctx context.Context, events []*ce.Event, opts ...api.WriteOption) (err error) { // TODO(jiangkai): implement this method, by jiangkai, 2022.10.24 - return "", nil + return nil } func (w *busWriter) Bus() api.Eventbus { @@ -517,17 +534,17 @@ func (w *busWriter) pickWritableLog(ctx context.Context, opts *api.WriteOptions) _ctx, span := w.tracer.Start(ctx, "pickWritableLog") defer span.End() - log, err := opts.Policy.NextLog(ctx) + l, err := opts.Policy.NextLog(ctx) if err != nil { return nil, err } - l := w.ebus.getWritableLog(_ctx, log.ID()) - if l == nil { + lw := w.ebus.getWritableLog(_ctx, l.ID()) + if lw == nil { return nil, stderrors.New("can not pick writable log") } - return l.Writer(), nil + return lw.Writer(), nil } type busReader struct { @@ -578,11 +595,11 @@ func (r *busReader) pickReadableLog(ctx context.Context, opts *api.ReadOptions) _ctx, span := r.tracer.Start(ctx, "pickReadableLog") defer span.End() - log, err := opts.Policy.NextLog(ctx) + l, err := opts.Policy.NextLog(ctx) if err != nil { return nil, err } - lr := r.ebus.getReadableLog(_ctx, log.ID()) + lr := r.ebus.getReadableLog(_ctx, l.ID()) if lr == nil { return nil, stderrors.New("can not pick readable log") } diff --git a/client/pkg/eventlog/eventlog.go b/client/pkg/eventlog/eventlog.go index f96756e19..7cb25135d 100644 --- a/client/pkg/eventlog/eventlog.go +++ b/client/pkg/eventlog/eventlog.go @@ -18,6 +18,7 @@ package eventlog import ( // standard libraries. "context" + "github.com/linkall-labs/vanus/proto/pkg/cloudevents" // third-party libraries. @@ -50,7 +51,7 @@ type LogWriter interface { Close(ctx context.Context) - Append(ctx context.Context, event *ce.Event) (off int64, err error) + Append(ctx context.Context, event *ce.Event) (eid string, err error) AppendMany(ctx context.Context, events *cloudevents.CloudEventBatch) (off int64, err error) } diff --git a/client/pkg/eventlog/eventlog_impl.go b/client/pkg/eventlog/eventlog_impl.go index c0acd5100..488de1584 100644 --- a/client/pkg/eventlog/eventlog_impl.go +++ b/client/pkg/eventlog/eventlog_impl.go @@ -17,23 +17,23 @@ package eventlog import ( // standard libraries. "context" - "github.com/linkall-labs/vanus/proto/pkg/cloudevents" + "encoding/base64" + "encoding/binary" "io" - "sort" "sync" "time" - "github.com/linkall-labs/vanus/observability/tracing" - "go.opentelemetry.io/otel/trace" - // third-party libraries. ce "github.com/cloudevents/sdk-go/v2" + "go.opentelemetry.io/otel/trace" // this project. - el "github.com/linkall-labs/vanus/client/internal/vanus/eventlog" + elns "github.com/linkall-labs/vanus/client/internal/vanus/eventlog" "github.com/linkall-labs/vanus/client/pkg/record" - vlog "github.com/linkall-labs/vanus/observability/log" + "github.com/linkall-labs/vanus/observability/log" + "github.com/linkall-labs/vanus/observability/tracing" "github.com/linkall-labs/vanus/pkg/errors" + "github.com/linkall-labs/vanus/proto/pkg/cloudevents" ) const ( @@ -42,74 +42,80 @@ const ( pollingPostSpan = 100 // in milliseconds. ) -func NewEventLog(cfg *el.Config) Eventlog { - log := &eventlog{ - cfg: cfg, - nameService: el.NewNameService(cfg.Endpoints), +func NewEventLog(cfg *elns.Config) Eventlog { + el := &eventlog{ + cfg: cfg, + nameService: elns.NewNameService(cfg.Endpoints), + writableSegments: make(map[uint64]*segment, 0), + readableSegments: make(map[uint64]*segment, 0), tracer: tracing.NewTracer("pkg.eventlog.impl", trace.SpanKindClient), } - log.writableWatcher = WatchWritableSegment(log) - log.readableWatcher = WatchReadableSegments(log) + el.writableWatcher = WatchWritableSegment(el) + el.readableWatcher = WatchReadableSegments(el) go func() { - ch := log.writableWatcher.Chan() + ch := el.writableWatcher.Chan() for { - r, ok := <-ch + rs, ok := <-ch if !ok { - vlog.Debug(context.Background(), "eventlog quits writable watcher", map[string]interface{}{ - "eventlog": log.cfg.ID, + log.Debug(context.Background(), "eventlog quits writable watcher", map[string]interface{}{ + "eventlog": el.cfg.ID, }) break } - ctx, span := log.tracer.Start(context.Background(), "updateReadableSegmentsTask") - if r != nil { - log.updateWritableSegment(ctx, r) + ctx, span := el.tracer.Start(context.Background(), "updateReadableSegmentsTask") + if rs != nil { + el.updateWritableSegment(ctx, rs) } - log.writableWatcher.Wakeup() + el.writableWatcher.Wakeup() span.End() } }() - log.writableWatcher.Start() + el.writableWatcher.Start() go func() { - ch := log.readableWatcher.Chan() + ch := el.readableWatcher.Chan() for { rs, ok := <-ch if !ok { - vlog.Debug(context.Background(), "eventlog quits readable watcher", map[string]interface{}{ - "eventlog": log.cfg.ID, + log.Debug(context.Background(), "eventlog quits readable watcher", map[string]interface{}{ + "eventlog": el.cfg.ID, }) break } - ctx, span := log.tracer.Start(context.Background(), "updateReadableSegmentsTask") + ctx, span := el.tracer.Start(context.Background(), "updateReadableSegmentsTask") if rs != nil { - log.updateReadableSegments(ctx, rs) + el.updateReadableSegments(ctx, rs) } - log.readableWatcher.Wakeup() + el.readableWatcher.Wakeup() span.End() } }() - log.readableWatcher.Start() + el.readableWatcher.Start() - return log + return el } type eventlog struct { - cfg *el.Config - nameService *el.NameService + cfg *elns.Config + nameService *elns.NameService - writableWatcher *WritableSegmentWatcher - writableSegment *segment - writableMu sync.RWMutex + writableWatcher *WritableSegmentWatcher + writableSegments map[uint64]*segment + writableMu sync.RWMutex + logWriter *logWriter + writerMu sync.RWMutex readableWatcher *ReadableSegmentsWatcher - readableSegments []*segment + readableSegments map[uint64]*segment readableMu sync.RWMutex + logReader *logReader + readerMu sync.RWMutex tracer *tracing.Tracer } @@ -123,9 +129,11 @@ func (l *eventlog) ID() uint64 { func (l *eventlog) Close(ctx context.Context) { l.writableWatcher.Close() l.readableWatcher.Close() + l.logWriter.Close(ctx) + l.logReader.Close(ctx) - if l.writableSegment != nil { - l.writableSegment.Close(ctx) + for _, segment := range l.writableSegments { + segment.Close(ctx) } for _, segment := range l.readableSegments { segment.Close(ctx) @@ -133,19 +141,41 @@ func (l *eventlog) Close(ctx context.Context) { } func (l *eventlog) Writer() LogWriter { - w := &logWriter{ + l.writerMu.RLock() + if l.logWriter != nil { + l.writerMu.RUnlock() + return l.logWriter + } + l.writerMu.RUnlock() + l.writerMu.Lock() + defer l.writerMu.Unlock() + if l.logWriter != nil { + return l.logWriter + } + l.logWriter = &logWriter{ elog: l, } - return w + return l.logWriter } func (l *eventlog) Reader(cfg ReaderConfig) LogReader { - r := &logReader{ + l.readerMu.RLock() + if l.logReader != nil { + l.readerMu.RUnlock() + return l.logReader + } + l.readerMu.RUnlock() + l.readerMu.Lock() + defer l.readerMu.Unlock() + if l.logWriter != nil { + return l.logReader + } + l.logReader = &logReader{ elog: l, pos: 0, cfg: cfg, } - return r + return l.logReader } func (l *eventlog) EarliestOffset(ctx context.Context) (int64, error) { @@ -189,47 +219,60 @@ func (l *eventlog) QueryOffsetByTime(ctx context.Context, timestamp int64) (int6 return segs[0].startOffset, nil } - if segs[len(segs)-1].lastEventBornAt.Before(t) { - // the target offset maybe in newer segment, refresh immediately - l.refreshReadableSegments(ctx) - segs = l.fetchReadableSegments(ctx) - } + // LastEntryStime + // time.UnixMilli + tailSeg := fetchTailSegment(ctx, segs) for idx := range segs { - s := segs[idx] - if !t.Before(s.firstEventBornAt) && !t.After(s.lastEventBornAt) { - target = s + seg := segs[idx] + // lastEventBornAt will be reported only when the segment is full, + // if it is equal to 0, the current segment is the latest segment. + if seg.lastEventBornAt == time.UnixMilli(0) { + target = seg + break + } + if !t.Before(seg.firstEventBornAt) && !t.After(seg.lastEventBornAt) { + target = seg break } } if target == nil { - target = segs[len(segs)-1] + target = tailSeg } return target.LookupOffset(ctx, t) } -func (l *eventlog) updateWritableSegment(ctx context.Context, r *record.Segment) { - if l.writableSegment != nil { - if l.writableSegment.ID() == r.ID { - _ = l.writableSegment.Update(ctx, r, true) - return +func (l *eventlog) updateWritableSegment(ctx context.Context, rs []*record.Segment) { + segments := make(map[uint64]*segment, len(rs)) + for _, r := range rs { + // TODO: find + segment := func() *segment { + for _, s := range l.writableSegments { + if s.ID() == r.ID { + return s + } + } + return nil + }() + var err error + if segment == nil { + segment, err = newSegment(ctx, r, false) + } else { + err = segment.Update(ctx, r, false) } - } - - segment, err := newSegment(ctx, r, true) - if err != nil { - vlog.Error(context.Background(), "new segment failed", map[string]interface{}{ - vlog.KeyError: err, - }) - return + if err != nil { + // FIXME: create or update segment failed + continue + } + segments[segment.id] = segment } l.writableMu.Lock() defer l.writableMu.Unlock() - l.writableSegment = segment + l.writableSegments = segments } func (l *eventlog) selectWritableSegment(ctx context.Context) (*segment, error) { @@ -240,11 +283,20 @@ func (l *eventlog) selectWritableSegment(ctx context.Context) (*segment, error) return segment, nil } +func (l *eventlog) nextWritableSegment(ctx context.Context, seg *segment) (*segment, error) { + l.writableMu.RLock() + defer l.writableMu.RUnlock() + if s, ok := l.writableSegments[seg.nextSegmentId]; ok { + return s, nil + } + return nil, errors.ErrResourceNotFound +} + func (l *eventlog) fetchWritableSegment(ctx context.Context) *segment { l.writableMu.RLock() defer l.writableMu.RUnlock() - if l.writableSegment == nil || !l.writableSegment.Writable() { + if len(l.writableSegments) == 0 { // refresh func() { l.writableMu.RUnlock() @@ -253,7 +305,14 @@ func (l *eventlog) fetchWritableSegment(ctx context.Context) *segment { }() } - return l.writableSegment + // fetch the front segment by previousSegmentId + for _, segment := range l.writableSegments { + if _, ok := l.writableSegments[segment.previousSegmentId]; !ok { + return segment + } + } + + return nil } func (l *eventlog) refreshWritableSegment(ctx context.Context) { @@ -261,7 +320,7 @@ func (l *eventlog) refreshWritableSegment(ctx context.Context) { } func (l *eventlog) updateReadableSegments(ctx context.Context, rs []*record.Segment) { - segments := make([]*segment, 0, len(rs)) + segments := make(map[uint64]*segment, len(rs)) for _, r := range rs { // TODO: find segment := func() *segment { @@ -282,37 +341,49 @@ func (l *eventlog) updateReadableSegments(ctx context.Context, rs []*record.Segm // FIXME: create or update segment failed continue } - segments = append(segments, segment) + segments[segment.id] = segment } - l.writableMu.Lock() - defer l.writableMu.Unlock() + l.readableMu.Lock() + defer l.readableMu.Unlock() l.readableSegments = segments } func (l *eventlog) selectReadableSegment(ctx context.Context, offset int64) (*segment, error) { - segments := l.fetchReadableSegments(ctx) - if len(segments) == 0 { + segs := l.fetchReadableSegments(ctx) + if len(segs) == 0 { return nil, errors.ErrNotReadable } - // TODO: make sure the segments are in order. - n := sort.Search(len(segments), func(i int) bool { - return segments[i].EndOffset() > offset - }) - if n < len(segments) { - return segments[n], nil - } - if offset < segments[0].StartOffset() { + var target *segment + target = fetchHeadSegment(ctx, segs) + if offset < target.StartOffset() { return nil, errors.ErrOffsetUnderflow } - if offset == segments[len(segments)-1].EndOffset() { + target = fetchTailSegment(ctx, segs) + if offset == target.EndOffset() { return nil, errors.ErrOffsetOnEnd } - return nil, errors.ErrOffsetOverflow + if offset > target.EndOffset() { + return nil, errors.ErrOffsetOverflow + } + + // look from back to front + // TODO(jiangkai): implement a better search algorithm + for { + if target.StartOffset() <= offset && target.EndOffset() > offset { + return target, nil + } else { + if _, ok := l.readableSegments[target.previousSegmentId]; !ok { + break + } + target = l.readableSegments[target.previousSegmentId] + } + } + return nil, errors.ErrNotReadable } -func (l *eventlog) fetchReadableSegments(ctx context.Context) []*segment { +func (l *eventlog) fetchReadableSegments(ctx context.Context) map[uint64]*segment { l.readableMu.RLock() defer l.readableMu.RUnlock() @@ -350,9 +421,9 @@ func (w *logWriter) AppendMany(ctx context.Context, events *cloudevents.CloudEve if err == nil { return offset, nil } - vlog.Warning(ctx, "failed to Append", map[string]interface{}{ - vlog.KeyError: err, - "offset": offset, + log.Warning(ctx, "failed to Append", map[string]interface{}{ + log.KeyError: err, + "offset": offset, }) if errors.Is(err, errors.ErrSegmentFull) { if i < retryTimes { @@ -373,43 +444,51 @@ func (w *logWriter) Close(ctx context.Context) { // TODO: by jiangkai, 2022.10.19 } -func (w *logWriter) Append(ctx context.Context, event *ce.Event) (int64, error) { +func (w *logWriter) Append(ctx context.Context, event *ce.Event) (string, error) { // TODO: async for throughput - retryTimes := defaultRetryTimes for i := 1; i <= retryTimes; i++ { - offset, err := w.doAppend(ctx, event) + eid, err := w.doAppend(ctx, event) if err == nil { - return offset, nil + return eid, nil } - vlog.Warning(ctx, "failed to Append", map[string]interface{}{ - vlog.KeyError: err, - "offset": offset, + log.Warning(ctx, "failed to append", map[string]interface{}{ + log.KeyError: err, + "retryTimes": i, }) if errors.Is(err, errors.ErrSegmentFull) { + w.switchNextWritableSegment(ctx) if i < retryTimes { continue } } - return -1, err + return "", err } - - return -1, errors.ErrUnknown + return "", errors.ErrUnknown } -func (w *logWriter) doAppend(ctx context.Context, event *ce.Event) (int64, error) { +func (w *logWriter) doAppend(ctx context.Context, event *ce.Event) (string, error) { segment, err := w.selectWritableSegment(ctx) if err != nil { - return -1, err + return "", err } offset, err := segment.Append(ctx, event) if err != nil { if errors.Is(err, errors.ErrSegmentFull) { segment.SetNotWritable() } - return -1, err + return "", err } - return offset, nil + return w.generateEventID(segment, offset), nil +} + +func (w *logWriter) generateEventID(s *segment, offset int64) string { + var buf [32]byte + binary.BigEndian.PutUint64(buf[0:8], s.id) + binary.BigEndian.PutUint64(buf[8:16], uint64(offset)) + binary.BigEndian.PutUint64(buf[16:24], w.elog.ID()) + binary.BigEndian.PutUint64(buf[24:32], uint64(offset+s.startOffset)) + return base64.StdEncoding.EncodeToString(buf[:]) } func (w *logWriter) doAppendBatch(ctx context.Context, event *cloudevents.CloudEventBatch) (int64, error) { @@ -455,6 +534,14 @@ func (w *logWriter) selectWritableSegment(ctx context.Context) (*segment, error) return segment, nil } +func (w *logWriter) switchNextWritableSegment(ctx context.Context) { + nextSeg, err := w.elog.nextWritableSegment(ctx, w.cur) + if err != nil { + return + } + w.cur = nextSeg +} + type logReader struct { elog *eventlog pos int64 @@ -537,3 +624,21 @@ func (r *logReader) Seek(ctx context.Context, offset int64, whence int) (int64, } return -1, errors.ErrInvalidArgument } + +func fetchHeadSegment(ctx context.Context, segments map[uint64]*segment) *segment { + for _, segment := range segments { + if _, ok := segments[segment.previousSegmentId]; !ok { + return segment + } + } + return nil +} + +func fetchTailSegment(ctx context.Context, segments map[uint64]*segment) *segment { + for _, segment := range segments { + if _, ok := segments[segment.nextSegmentId]; !ok { + return segment + } + } + return nil +} diff --git a/client/pkg/eventlog/log_segment.go b/client/pkg/eventlog/log_segment.go index ac73e3be9..fb4cf7af5 100644 --- a/client/pkg/eventlog/log_segment.go +++ b/client/pkg/eventlog/log_segment.go @@ -46,14 +46,16 @@ func newSegment(ctx context.Context, r *record.Segment, towrite bool) (*segment, } segment := &segment{ - id: r.ID, - startOffset: r.StartOffset, - endOffset: atomic.Int64{}, - writable: atomic.Bool{}, - firstEventBornAt: r.FirstEventBornAt, - lastEventBornAt: r.LastEventBornAt, - prefer: prefer, - tracer: tracing.NewTracer("internal.eventlog.segment", trace.SpanKindClient), + id: r.ID, + previousSegmentId: r.PreviousSegmentId, + nextSegmentId: r.NextSegmentId, + startOffset: r.StartOffset, + endOffset: atomic.Int64{}, + writable: atomic.Bool{}, + firstEventBornAt: r.FirstEventBornAt, + lastEventBornAt: r.LastEventBornAt, + prefer: prefer, + tracer: tracing.NewTracer("internal.eventlog.segment", trace.SpanKindClient), } if !r.Writable { @@ -86,12 +88,14 @@ func newBlockExt(ctx context.Context, r *record.Segment, leaderOnly bool) (*bloc } type segment struct { - id uint64 - startOffset int64 - endOffset atomic.Int64 - writable atomic.Bool - firstEventBornAt time.Time - lastEventBornAt time.Time + id uint64 + previousSegmentId uint64 + nextSegmentId uint64 + startOffset int64 + endOffset atomic.Int64 + writable atomic.Bool + firstEventBornAt time.Time + lastEventBornAt time.Time prefer *block mu sync.RWMutex @@ -169,7 +173,7 @@ func (s *segment) Append(ctx context.Context, event *ce.Event) (int64, error) { if err != nil { return -1, err } - return off + s.startOffset, nil + return off, nil } func (s *segment) AppendBatch(ctx context.Context, event *cloudevents.CloudEventBatch) (int64, error) { diff --git a/client/pkg/eventlog/lookup.go b/client/pkg/eventlog/lookup.go index c73c62129..db2c46f69 100644 --- a/client/pkg/eventlog/lookup.go +++ b/client/pkg/eventlog/lookup.go @@ -31,10 +31,10 @@ const ( type WritableSegmentWatcher struct { *primitive.Watcher - ch chan *record.Segment + ch chan []*record.Segment } -func (w *WritableSegmentWatcher) Chan() <-chan *record.Segment { +func (w *WritableSegmentWatcher) Chan() <-chan []*record.Segment { return w.ch } @@ -43,13 +43,13 @@ func (w *WritableSegmentWatcher) Start() { } func WatchWritableSegment(log *eventlog) *WritableSegmentWatcher { - ch := make(chan *record.Segment, 1) + ch := make(chan []*record.Segment, 1) w := primitive.NewWatcher(defaultWatchInterval, func() { - r, err := log.nameService.LookupWritableSegment(context.Background(), log.cfg.ID) + rs, err := log.nameService.LookupWritableSegment(context.Background(), log.cfg.ID) if err != nil { ch <- nil } else { - ch <- r + ch <- rs } }, func() { close(ch) diff --git a/client/pkg/record/record.go b/client/pkg/record/record.go index ba7f20ceb..6f538e2f8 100644 --- a/client/pkg/record/record.go +++ b/client/pkg/record/record.go @@ -83,12 +83,14 @@ func allReadable(ls []*Eventlog) bool { } type Segment struct { - ID uint64 - StartOffset int64 - EndOffset int64 - Writable bool - FirstEventBornAt time.Time - LastEventBornAt time.Time + ID uint64 + PreviousSegmentId uint64 + NextSegmentId uint64 + StartOffset int64 + EndOffset int64 + Writable bool + FirstEventBornAt time.Time + LastEventBornAt time.Time Blocks map[uint64]*Block LeaderBlockID uint64 diff --git a/go.mod b/go.mod index b576b5b96..2187f98cb 100644 --- a/go.mod +++ b/go.mod @@ -69,6 +69,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.2.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cockroachdb/datadriven v1.0.2 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.3.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/go.sum b/go.sum index 69842a208..4add34f02 100644 --- a/go.sum +++ b/go.sum @@ -75,7 +75,6 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054 h1:uH66TXeswKn5PW5zdZ39xEwfS9an067BirqA+P4QaLI= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -95,9 +94,8 @@ github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5 h1:xD/lrqdvwsc+O2bjSSi3YqY73Ke3LAiSCx49aCesA0E= -github.com/cockroachdb/errors v1.2.4 h1:Lap807SXTH5tri2TivECb/4abUkMZC9zRoLarvcKDqs= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY= +github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= +github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= @@ -124,7 +122,6 @@ github.com/fatih/set v0.2.1 h1:nn2CaJyknWE/6txyUDGwysr3G5QC6xWB/PtVjPBbeaA= github.com/fatih/set v0.2.1/go.mod h1:+RKtMCH+favT2+3YecHGxcc0b4KyVWA1QWWJUs4E0CI= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/getsentry/raven-go v0.2.0 h1:no+xWJRb5ZI7eE8TWgIq1jLulQiIoLG0IfYxv5JYMGs= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= diff --git a/internal/controller/eventbus/controller.go b/internal/controller/eventbus/controller.go index 64b56aaee..2340f1395 100644 --- a/internal/controller/eventbus/controller.go +++ b/internal/controller/eventbus/controller.go @@ -455,14 +455,12 @@ func (ctrl *controller) processHeartbeat(ctx context.Context, req *ctrlpb.Segmen ID: block.SegmentID, Capacity: info.Capacity, EventLogID: block.EventlogID, + State: eventlog.SegmentState(info.State), Size: info.Size, Number: info.EventNumber, FirstEventBornTime: time.UnixMilli(info.FirstEventBornTime), LastEventBornTime: time.UnixMilli(info.LastEventBornTime), } - if info.IsFull { - seg.State = eventlog.StateFrozen - } logArr = append(logArr, seg) segments[block.EventlogID.Key()] = logArr } @@ -478,7 +476,7 @@ func (ctrl *controller) GetAppendableSegment(ctx context.Context, } num := int(req.Limited) if num == 0 { - num = 1 + num = 2 } segInfos, err := ctrl.eventLogMgr.GetAppendableSegment(ctx, eli, num) if err != nil { @@ -487,6 +485,19 @@ func (ctrl *controller) GetAppendableSegment(ctx context.Context, return &ctrlpb.GetAppendableSegmentResponse{Segments: eventlog.Convert2ProtoSegment(ctx, segInfos...)}, nil } +func (ctrl *controller) GetReadableSegment(ctx context.Context, + req *ctrlpb.GetReadableSegmentRequest) (*ctrlpb.GetReadableSegmentResponse, error) { + eli := ctrl.eventLogMgr.GetEventLog(ctx, vanus.NewIDFromUint64(req.EventLogId)) + if eli == nil { + return nil, errors.ErrResourceNotFound.WithMessage("eventlog not found") + } + segInfos, err := ctrl.eventLogMgr.GetReadableSegment(ctx, eli) + if err != nil { + return nil, err + } + return &ctrlpb.GetReadableSegmentResponse{Segments: eventlog.Convert2ProtoSegment(ctx, segInfos...)}, nil +} + func (ctrl *controller) ReportSegmentBlockIsFull(ctx context.Context, req *ctrlpb.SegmentHeartbeatRequest) (*emptypb.Empty, error) { if err := ctrl.processHeartbeat(ctx, req); err != nil { @@ -513,12 +524,12 @@ func (ctrl *controller) isReady(ctx context.Context) bool { } func (ctrl *controller) ReportSegmentLeader(ctx context.Context, - req *ctrlpb.ReportSegmentLeaderRequest) (*emptypb.Empty, error) { - err := ctrl.eventLogMgr.UpdateSegmentReplicas(ctx, vanus.NewIDFromUint64(req.LeaderId), req.Term) + req *ctrlpb.ReportSegmentLeaderRequest) (*metapb.Segment, error) { + segment, err := ctrl.eventLogMgr.UpdateSegmentReplicas(ctx, vanus.NewIDFromUint64(req.LeaderId), req.Term) if err != nil { return nil, err } - return &emptypb.Empty{}, nil + return eventlog.Convert2ProtoSegment(ctx, segment)[0], nil } func (ctrl *controller) recordMetrics() { diff --git a/internal/controller/eventbus/eventlog/eventlog.go b/internal/controller/eventbus/eventlog/eventlog.go index 301a9e5d7..280f31729 100644 --- a/internal/controller/eventbus/eventlog/eventlog.go +++ b/internal/controller/eventbus/eventlog/eventlog.go @@ -55,11 +55,12 @@ type Manager interface { GetEventLogSegmentList(elID vanus.ID) []*Segment GetAppendableSegment(ctx context.Context, eli *metadata.Eventlog, num int) ([]*Segment, error) + GetReadableSegment(ctx context.Context, eli *metadata.Eventlog) ([]*Segment, error) UpdateSegment(ctx context.Context, m map[string][]Segment) GetSegmentByBlockID(block *metadata.Block) (*Segment, error) GetBlock(id vanus.ID) *metadata.Block GetSegment(id vanus.ID) *Segment - UpdateSegmentReplicas(ctx context.Context, segID vanus.ID, term uint64) error + UpdateSegmentReplicas(ctx context.Context, segID vanus.ID, term uint64) (*Segment, error) } var mgr = &eventlogManager{ @@ -293,6 +294,26 @@ func (mgr *eventlogManager) GetAppendableSegment(ctx context.Context, return result, nil } +func (mgr *eventlogManager) GetReadableSegment(ctx context.Context, eli *metadata.Eventlog) ([]*Segment, error) { + result := make([]*Segment, 0) + + if eli == nil { + return result, nil + } + + v, exist := mgr.eventLogMap.Load(eli.ID.Key()) + if !exist { + return nil, errors.ErrEventLogNotFound + } + + el, _ := v.(*eventlog) + segments := el.currentReadableSegments() + if segments == nil { + return nil, errors.ErrSegmentNotFound + } + return segments, nil +} + func (mgr *eventlogManager) UpdateSegment(ctx context.Context, m map[string][]Segment) { // iterate eventlog for eventlogID, segments := range m { @@ -367,19 +388,20 @@ func (mgr *eventlogManager) GetSegment(id vanus.ID) *Segment { return v.(*Segment) } -func (mgr *eventlogManager) UpdateSegmentReplicas(ctx context.Context, leaderID vanus.ID, term uint64) error { +func (mgr *eventlogManager) UpdateSegmentReplicas(ctx context.Context, + leaderID vanus.ID, term uint64) (*Segment, error) { blk := mgr.GetBlock(leaderID) if blk == nil { - return errors.ErrBlockNotFound + return nil, errors.ErrBlockNotFound } seg := mgr.GetSegment(blk.SegmentID) if seg == nil { - return errors.ErrSegmentNotFound + return nil, errors.ErrSegmentNotFound } if seg.Replicas.Term >= term { - return nil + return seg, nil } seg.Replicas.Leader = leaderID.Uint64() @@ -391,9 +413,9 @@ func (mgr *eventlogManager) UpdateSegmentReplicas(ctx context.Context, leaderID log.KeyError: err, "segment": seg.String(), }) - return errors.ErrInvalidSegment.WithMessage("update segment to etcd error").Wrap(err) + return nil, errors.ErrInvalidSegment.WithMessage("update segment to etcd error").Wrap(err) } - return nil + return seg, nil } func (mgr *eventlogManager) GetSegmentByBlockID(block *metadata.Block) (*Segment, error) { @@ -984,6 +1006,26 @@ func (el *eventlog) currentAppendableSegment() *Segment { return el.writePtr } +func (el *eventlog) currentReadableSegments() []*Segment { + segments := make([]*Segment, 0) + if el.size() == 0 { + return nil + } + + head := el.segmentList.Front() + for head != nil { + seg, _ := head.Value.(*Segment) + if seg.IsReadable() { + segments = append(segments, seg) + } + if seg.isPreFull() { + break + } + head = head.Next() + } + return segments +} + // add a segment to eventlog, the metadata of this eventlog will be updated, but the segment's metadata should be // updated after call this method. func (el *eventlog) add(ctx context.Context, seg *Segment) error { @@ -1039,7 +1081,7 @@ func (el *eventlog) markSegmentFull(ctx context.Context, seg *Segment) error { next.StartOffsetInLog = seg.StartOffsetInLog + int64(seg.Number) data, _ := json.Marshal(next) // TODO(wenfeng.wang) update block info at the same time - log.Debug(context.TODO(), "segment is full", map[string]interface{}{ + log.Debug(context.TODO(), "mark segment full", map[string]interface{}{ "data": string(data), }) if err := el.kvClient.Set(ctx, metadata.GetSegmentMetadataKey(next.ID), data); err != nil { @@ -1176,7 +1218,7 @@ func (el *eventlog) updateSegment(ctx context.Context, seg *Segment) error { if err := el.kvClient.Set(ctx, key, data); err != nil { return err } - if seg.isFull() { + if seg.isFull() || seg.isPreFull() { err := el.markSegmentFull(ctx, seg) if err != nil { return err diff --git a/internal/controller/eventbus/eventlog/eventlog_test.go b/internal/controller/eventbus/eventlog/eventlog_test.go index 57fe3b1c6..b0053f711 100644 --- a/internal/controller/eventbus/eventlog/eventlog_test.go +++ b/internal/controller/eventbus/eventlog/eventlog_test.go @@ -797,17 +797,17 @@ func TestEventlogManager_UpdateSegmentReplicas(t *testing.T) { kvCli.EXPECT().Set(ctx, filepath.Join(metadata.SegmentKeyPrefixInKVStore, seg.ID.String()), gomock.Any()).Times(1).Return(nil) - err := utMgr.UpdateSegmentReplicas(ctx, vanus.NewTestID(), 3) + _, err := utMgr.UpdateSegmentReplicas(ctx, vanus.NewTestID(), 3) So(err, ShouldEqual, errors.ErrBlockNotFound) - err = utMgr.UpdateSegmentReplicas(ctx, blk.ID, 3) + _, err = utMgr.UpdateSegmentReplicas(ctx, blk.ID, 3) So(err, ShouldEqual, errors.ErrSegmentNotFound) blk.SegmentID = seg.ID - err = utMgr.UpdateSegmentReplicas(ctx, blk.ID, 3) + _, err = utMgr.UpdateSegmentReplicas(ctx, blk.ID, 3) So(err, ShouldBeNil) - err = utMgr.UpdateSegmentReplicas(ctx, blk.ID, 4) + _, err = utMgr.UpdateSegmentReplicas(ctx, blk.ID, 4) So(err, ShouldBeNil) }) } diff --git a/internal/controller/eventbus/eventlog/mock_eventlog.go b/internal/controller/eventbus/eventlog/mock_eventlog.go index bcac927dc..dd2410b50 100644 --- a/internal/controller/eventbus/eventlog/mock_eventlog.go +++ b/internal/controller/eventbus/eventlog/mock_eventlog.go @@ -121,6 +121,21 @@ func (mr *MockManagerMockRecorder) GetEventLogSegmentList(elID interface{}) *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEventLogSegmentList", reflect.TypeOf((*MockManager)(nil).GetEventLogSegmentList), elID) } +// GetReadableSegment mocks base method. +func (m *MockManager) GetReadableSegment(ctx context.Context, eli *metadata.Eventlog) ([]*Segment, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetReadableSegment", ctx, eli) + ret0, _ := ret[0].([]*Segment) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetReadableSegment indicates an expected call of GetReadableSegment. +func (mr *MockManagerMockRecorder) GetReadableSegment(ctx, eli interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetReadableSegment", reflect.TypeOf((*MockManager)(nil).GetReadableSegment), ctx, eli) +} + // GetSegment mocks base method. func (m *MockManager) GetSegment(id vanus.ID) *Segment { m.ctrl.T.Helper() @@ -189,11 +204,12 @@ func (mr *MockManagerMockRecorder) UpdateSegment(ctx, m interface{}) *gomock.Cal } // UpdateSegmentReplicas mocks base method. -func (m *MockManager) UpdateSegmentReplicas(ctx context.Context, segID vanus.ID, term uint64) error { +func (m *MockManager) UpdateSegmentReplicas(ctx context.Context, segID vanus.ID, term uint64) (*Segment, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateSegmentReplicas", ctx, segID, term) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(*Segment) + ret1, _ := ret[1].(error) + return ret0, ret1 } // UpdateSegmentReplicas indicates an expected call of UpdateSegmentReplicas. diff --git a/internal/controller/eventbus/eventlog/segment.go b/internal/controller/eventbus/eventlog/segment.go index c9f6eb921..9e2577cdd 100644 --- a/internal/controller/eventbus/eventlog/segment.go +++ b/internal/controller/eventbus/eventlog/segment.go @@ -30,6 +30,7 @@ const ( StateCreated = SegmentState("created") StateWorking = SegmentState("working") StateFrozen = SegmentState("frozen") + StateFreezing = SegmentState("freezing") StateArchived = SegmentState("archived") StateExpired = SegmentState("expired") ) @@ -53,6 +54,10 @@ func (seg *Segment) IsAppendable() bool { return seg.isReady() && seg.State == StateWorking } +func (seg *Segment) IsReadable() bool { + return seg.isReady() +} + func (seg *Segment) GetLeaderBlock() *metadata.Block { if !seg.isReady() { return nil @@ -73,6 +78,10 @@ func (seg *Segment) isNeedUpdate(newSeg Segment) bool { if seg.ID != newSeg.ID { return false } + if newSeg.isPreFull() && seg.State != newSeg.State { + seg.State = newSeg.State + return true + } needed := false if seg.Size < newSeg.Size { seg.Size = newSeg.Size @@ -99,6 +108,10 @@ func (seg *Segment) isNeedUpdate(newSeg Segment) bool { return needed } +func (seg *Segment) isPreFull() bool { + return seg.State == StateFreezing +} + func (seg *Segment) isFull() bool { return seg.State == StateFrozen } @@ -162,6 +175,7 @@ func Convert2ProtoSegment(ctx context.Context, ins ...*Segment) []*metapb.Segmen NumberEventStored: seg.Number, Replicas: blocks, State: string(seg.State), + LeaderBlockId: seg.Replicas.Leader, FirstEventBornAtByUnixMs: seg.FirstEventBornTime.UnixMilli(), LastEvnetBornAtByUnixMs: seg.LastEventBornTime.UnixMilli(), } diff --git a/internal/store/block/raft/appender.go b/internal/store/block/raft/appender.go index 96c9e1a2a..aff8b80d8 100644 --- a/internal/store/block/raft/appender.go +++ b/internal/store/block/raft/appender.go @@ -71,6 +71,7 @@ type Appender interface { Stop(ctx context.Context) Bootstrap(ctx context.Context, blocks []Peer) error + Archive(ctx context.Context) Delete(ctx context.Context) Status() ClusterStatus } @@ -172,6 +173,22 @@ func (a *appender) Bootstrap(ctx context.Context, blocks []Peer) error { return a.node.Bootstrap(peers) } +func (a *appender) Archive(ctx context.Context) { + a.appendMu.Lock() + defer a.appendMu.Unlock() + if a.actx.Archived() { + return + } + if frag, err := a.raw.PrepareArchive(ctx, a.actx); err == nil { + data, _ := block.MarshalFragment(ctx, frag) + pds := make([]raft.ProposeData, 1) + pds[1] = raft.ProposeData{ + Data: data, + } + a.node.Propose(ctx, pds...) + } +} + func (a *appender) Delete(ctx context.Context) { span := trace.SpanFromContext(ctx) span.AddEvent("store.block.raft.appender.Delete() Start") diff --git a/internal/store/block/raw.go b/internal/store/block/raw.go index 120e49f1d..303166c23 100644 --- a/internal/store/block/raw.go +++ b/internal/store/block/raw.go @@ -57,10 +57,22 @@ type Raw interface { Delete(context.Context) error } +const ( + Working = 0 + Archived = 1 + Archiving = 2 +) + +var ( + StateWorking = uint32(Working) + StateArchived = uint32(Archived) + StateArchiving = uint32(Archiving) +) + type Statistics struct { ID vanus.ID Capacity uint64 - Archived bool + State uint32 EntryNum uint32 EntrySize uint64 // FirstEntryStime is the millisecond timestamp when the first Entry will be written to Block. diff --git a/internal/store/segment/replica.go b/internal/store/segment/replica.go index b1649a029..94b597090 100644 --- a/internal/store/segment/replica.go +++ b/internal/store/segment/replica.go @@ -94,12 +94,12 @@ func (r *replica) Status() *metapb.SegmentHealthInfo { Capacity: int64(stat.Capacity), Size: int64(stat.EntrySize), EventNumber: int32(stat.EntryNum), - IsFull: stat.Archived, + State: toSegmentState(stat.State), Leader: cs.Leader.Uint64(), Term: cs.Term, FirstEventBornTime: stat.FirstEntryStime, } - if stat.Archived { + if stat.State == block.StateArchived { info.LastEventBornTime = stat.LastEntryStime } return info diff --git a/internal/store/segment/server.go b/internal/store/segment/server.go index 93f97e527..2dde77808 100644 --- a/internal/store/segment/server.go +++ b/internal/store/segment/server.go @@ -412,13 +412,30 @@ func (s *server) runHeartbeat(_ context.Context) error { LeaderId: info.leader.Uint64(), Term: info.term, } - if _, err := s.cc.ReportSegmentLeader(context.Background(), req); err != nil { + segment, err := s.cc.ReportSegmentLeader(context.Background(), req) + if err != nil { log.Debug(ctx, "Report segment leader to controller failed.", map[string]interface{}{ "leader": info.leader, "term": info.term, log.KeyError: err, }) } + + if segment.State != "freezing" { + break + } + + value, ok := s.replicas.Load(info.leader.Uint64()) + if ok { + b, _ := value.(replica) + if b.appender.Status().Term != info.term { + break + } + if info.leader.Uint64() != segment.LeaderBlockId { + break + } + b.appender.Archive(context.Background()) + } } } }() @@ -746,10 +763,10 @@ func (s *server) onBlockArchived(stat block.Statistics) { Capacity: int64(stat.Capacity), Size: int64(stat.EntrySize), EventNumber: int32(stat.EntryNum), - IsFull: stat.Archived, + State: toSegmentState(stat.State), FirstEventBornTime: stat.FirstEntryStime, } - if stat.Archived { + if stat.State == block.StateArchived { info.LastEventBornTime = stat.LastEntryStime } @@ -889,3 +906,16 @@ func (s *server) checkState() error { } return nil } + +func toSegmentState(state uint32) string { + switch state { + case block.StateWorking: + return "working" + case block.StateArchived: + return "frozen" + case block.StateArchiving: + return "freezing" + default: + return "working" + } +} diff --git a/internal/store/vsb/block.go b/internal/store/vsb/block.go index a471145a2..9a75e8a28 100644 --- a/internal/store/vsb/block.go +++ b/internal/store/vsb/block.go @@ -38,8 +38,8 @@ type meta struct { entryLength int64 // entryNum is the number of persisted entries. entryNum int64 - // archived is the flag indicating Block is archived. - archived bool + // state is the flag indicating Block state. + state uint32 } // vsBlock is Vanus block file. @@ -97,7 +97,7 @@ func (b *vsBlock) Close(ctx context.Context) error { } // Flush metadata. - if b.fm.archived != m.archived || b.fm.entryLength != m.entryLength { + if b.fm.state != m.state || b.fm.entryLength != m.entryLength { if err := b.persistHeader(ctx, m); err != nil { return err } @@ -112,14 +112,15 @@ func (b *vsBlock) Delete(context.Context) error { } func (b *vsBlock) status() block.Statistics { - return b.stat(b.makeSnapshot()) + m, indexes := b.makeSnapshot() + return b.stat(m, indexes, m.state) } -func (b *vsBlock) stat(m meta, indexes []index.Index) block.Statistics { +func (b *vsBlock) stat(m meta, indexes []index.Index, state uint32) block.Statistics { s := block.Statistics{ ID: b.id, Capacity: uint64(b.capacity), - Archived: m.archived, + State: state, EntryNum: uint32(m.entryNum), EntrySize: uint64(m.entryLength), FirstEntryStime: -1, @@ -132,6 +133,14 @@ func (b *vsBlock) stat(m meta, indexes []index.Index) block.Statistics { return s } +func (b *vsBlock) prefull(state uint32) block.Statistics { + s := block.Statistics{ + ID: b.id, + State: state, + } + return s +} + func (b *vsBlock) full() bool { - return atomic.LoadUint32(&b.actx.archived) != 0 + return atomic.LoadUint32(&b.actx.state) != block.StateWorking } diff --git a/internal/store/vsb/block_append.go b/internal/store/vsb/block_append.go index a642b6f63..fb28c6482 100644 --- a/internal/store/vsb/block_append.go +++ b/internal/store/vsb/block_append.go @@ -40,9 +40,9 @@ var ( ) type appendContext struct { - seq int64 - offset int64 - archived uint32 + seq int64 + offset int64 + state uint32 } // Make sure appendContext implements block.AppendContext. @@ -56,8 +56,12 @@ func (c *appendContext) WriteOffset() int64 { return c.offset } +func (c *appendContext) Archiving() bool { + return c.state == block.StateArchiving +} + func (c *appendContext) Archived() bool { - return c.archived != 0 + return c.state == block.StateArchived } // Make sure vsBlock implements block.TwoPCAppender. @@ -70,9 +74,10 @@ func (b *vsBlock) NewAppendContext(last block.Fragment) block.AppendContext { actx := &appendContext{ seq: seq + 1, offset: last.EndOffset(), + state: block.StateWorking, } if ceschema.EntryType(entry) == ceschema.End { - actx.archived = 1 + actx.state = block.StateArchived } return actx } @@ -108,7 +113,12 @@ func (b *vsBlock) PrepareAppend( actx.offset += int64(frag.Size()) actx.seq += num - return seqs, frag, actx.size(b.dataOffset) >= b.capacity, nil + full := actx.size(b.dataOffset) >= b.capacity + if full && b.lis != nil { + b.lis.OnArchived(b.prefull(block.StateArchiving)) + } + + return seqs, frag, full, nil } func (b *vsBlock) PrepareArchive(ctx context.Context, appendCtx block.AppendContext) (block.Fragment, error) { @@ -123,7 +133,7 @@ func (b *vsBlock) PrepareArchive(ctx context.Context, appendCtx block.AppendCont actx.offset += int64(frag.Size()) actx.seq++ - actx.archived = 1 + actx.state = block.StateArchiving return frag, nil } @@ -184,7 +194,7 @@ func (b *vsBlock) CommitAppend(ctx context.Context, frag block.Fragment, cb bloc return } - atomic.StoreUint32(&b.actx.archived, 1) + atomic.StoreUint32(&b.actx.state, block.StateArchived) b.wg.Add(1) b.s.Append(bytes.NewReader(frag.Payload()), func(n int, err error) { @@ -212,7 +222,7 @@ func (b *vsBlock) CommitAppend(ctx context.Context, frag block.Fragment, cb bloc }) if b.lis != nil { - b.lis.OnArchived(b.stat(m, i)) + b.lis.OnArchived(b.stat(m, i, block.StateArchived)) } }) } diff --git a/internal/store/vsb/block_append_test.go b/internal/store/vsb/block_append_test.go index 444c0d444..a0be9cf13 100644 --- a/internal/store/vsb/block_append_test.go +++ b/internal/store/vsb/block_append_test.go @@ -74,7 +74,7 @@ func TestVSBlock_Append(t *testing.T) { So(actx.WriteOffset(), ShouldEqual, vsbtest.EndEntryOffset+vsbtest.EndEntrySize) So(actx.Archived(), ShouldBeTrue) - b.actx.archived = 1 + b.actx.state = block.StateArchived actx = b.NewAppendContext(nil) So(actx, ShouldNotBeNil) So(actx.WriteOffset(), ShouldEqual, headerBlockSize) @@ -102,6 +102,7 @@ func TestVSBlock_Append(t *testing.T) { dataOffset: headerBlockSize, actx: appendContext{ offset: headerBlockSize, + state: block.StateWorking, }, enc: codec.NewEncoder(), dec: dec, @@ -122,7 +123,7 @@ func TestVSBlock_Append(t *testing.T) { So(full, ShouldBeFalse) stat := b.status() - So(stat.Archived, ShouldBeFalse) + So(stat.State, ShouldEqual, block.StateWorking) So(stat.EntryNum, ShouldEqual, 0) So(stat.EntrySize, ShouldEqual, 0) @@ -132,7 +133,7 @@ func TestVSBlock_Append(t *testing.T) { <-ch stat = b.status() - So(stat.Archived, ShouldBeFalse) + So(stat.State, ShouldEqual, block.StateWorking) So(stat.EntryNum, ShouldEqual, 1) So(stat.EntrySize, ShouldEqual, vsbtest.EntrySize0) @@ -147,7 +148,7 @@ func TestVSBlock_Append(t *testing.T) { So(full, ShouldBeTrue) stat = b.status() - So(stat.Archived, ShouldBeFalse) + So(stat.State, ShouldEqual, block.StateWorking) So(stat.EntryNum, ShouldEqual, 1) So(stat.EntrySize, ShouldEqual, vsbtest.EntrySize0) @@ -157,7 +158,7 @@ func TestVSBlock_Append(t *testing.T) { <-ch stat = b.status() - So(stat.Archived, ShouldBeFalse) + So(stat.State, ShouldEqual, block.StateWorking) So(stat.EntryNum, ShouldEqual, 2) So(stat.EntrySize, ShouldEqual, vsbtest.EntrySize0+vsbtest.EntrySize1) @@ -178,7 +179,7 @@ func TestVSBlock_Append(t *testing.T) { So(full, ShouldBeTrue) stat := b.status() - So(stat.Archived, ShouldBeFalse) + So(stat.State, ShouldEqual, block.StateWorking) So(stat.EntryNum, ShouldEqual, 0) So(stat.EntrySize, ShouldEqual, 0) @@ -188,7 +189,7 @@ func TestVSBlock_Append(t *testing.T) { <-ch stat = b.status() - So(stat.Archived, ShouldBeFalse) + So(stat.State, ShouldEqual, block.StateWorking) So(stat.EntryNum, ShouldEqual, 2) So(stat.EntrySize, ShouldEqual, vsbtest.EntrySize0+vsbtest.EntrySize1) @@ -275,7 +276,6 @@ func TestVSBlock_Append(t *testing.T) { So(frag1.StartOffset(), ShouldEqual, vsbtest.EndEntryOffset) stat := b.status() - So(stat.Archived, ShouldBeFalse) So(stat.EntryNum, ShouldEqual, 0) So(stat.EntrySize, ShouldEqual, 0) @@ -289,7 +289,7 @@ func TestVSBlock_Append(t *testing.T) { <-ch stat = b.status() - So(stat.Archived, ShouldBeTrue) + So(stat.State, ShouldEqual, block.StateArchived) So(stat.EntryNum, ShouldEqual, 2) So(stat.EntrySize, ShouldEqual, vsbtest.EntrySize0+vsbtest.EntrySize1) diff --git a/internal/store/vsb/block_header.go b/internal/store/vsb/block_header.go index a188da27a..8a99d512d 100644 --- a/internal/store/vsb/block_header.go +++ b/internal/store/vsb/block_header.go @@ -21,6 +21,7 @@ import ( "hash/crc32" // this project. + "github.com/linkall-labs/vanus/internal/store/block" "github.com/linkall-labs/vanus/internal/store/block/raw" ) @@ -52,8 +53,10 @@ func (b *vsBlock) persistHeader(ctx context.Context, m meta) error { binary.LittleEndian.PutUint32(buf[flagsOffset:], 0) // flags binary.LittleEndian.PutUint32(buf[breakFlagsOffset:], 0) // break flags binary.LittleEndian.PutUint32(buf[dataOffsetOffset:], uint32(b.dataOffset)) // data offset - if m.archived { // state + if m.state == block.StateArchived { // state buf[stateOffset] = 1 + } else if m.state == block.StateArchiving { + buf[stateOffset] = 2 } binary.LittleEndian.PutUint16(buf[indexSizeOffset:], b.indexSize) // index size binary.LittleEndian.PutUint64(buf[capacityOffset:], uint64(b.capacity)) // capacity @@ -94,8 +97,15 @@ func (b *vsBlock) loadHeader(ctx context.Context) error { return errIncomplete } - b.dataOffset = int64(binary.LittleEndian.Uint32(buf[dataOffsetOffset:])) // data offset - b.fm.archived = buf[stateOffset] != 0 // state + b.dataOffset = int64(binary.LittleEndian.Uint32(buf[dataOffsetOffset:])) // data offset + switch buf[stateOffset] { // state + case block.Working: + b.fm.state = block.StateWorking + case block.Archived: + b.fm.state = block.StateArchived + case block.Archiving: + b.fm.state = block.StateArchived + } b.indexSize = binary.LittleEndian.Uint16(buf[indexSizeOffset:]) // index size b.capacity = int64(binary.LittleEndian.Uint64(buf[capacityOffset:])) // capacity b.fm.entryLength = int64(binary.LittleEndian.Uint64(buf[entryLengthOffset:])) // entry length diff --git a/internal/store/vsb/block_open.go b/internal/store/vsb/block_open.go index b08da6aa2..a897b0d9b 100644 --- a/internal/store/vsb/block_open.go +++ b/internal/store/vsb/block_open.go @@ -86,9 +86,9 @@ func (b *vsBlock) init(ctx context.Context) error { func (b *vsBlock) repairMeta() error { off := b.dataOffset + b.fm.entryLength seq := b.fm.entryNum - full := b.fm.archived var entry block.Entry + var full bool var err error var n, en int @@ -96,7 +96,7 @@ func (b *vsBlock) repairMeta() error { indexes := make([]index.Index, 0) // Note: use math.MaxInt64-off to avoid overflow. r := io.NewSectionReader(b.f, off, math.MaxInt64-off) - if full { + if b.fm.state == block.StateArchiving || b.fm.state == block.StateArchived { n, entry, err = b.dec.UnmarshalReader(r) if err != nil || ceschema.EntryType(entry) != ceschema.End { return errCorrupted @@ -161,7 +161,7 @@ SET_META: b.actx.seq = seq b.actx.offset = off if full { - b.actx.archived = 1 + b.actx.state = block.StateArchived } return nil diff --git a/internal/store/vsb/block_open_test.go b/internal/store/vsb/block_open_test.go index a653ebd75..31637d256 100644 --- a/internal/store/vsb/block_open_test.go +++ b/internal/store/vsb/block_open_test.go @@ -25,6 +25,7 @@ import ( . "github.com/smartystreets/goconvey/convey" // this project. + "github.com/linkall-labs/vanus/internal/store/block" idxtest "github.com/linkall-labs/vanus/internal/store/vsb/index/testing" vsbtest "github.com/linkall-labs/vanus/internal/store/vsb/testing" ) @@ -65,8 +66,8 @@ func TestVSBlock_Open(t *testing.T) { stat := b.status() So(stat.Capacity, ShouldEqual, vsbtest.EntrySize0+vsbtest.EntrySize1) - So(stat.Archived, ShouldBeTrue) So(stat.EntryNum, ShouldEqual, 2) + So(stat.State, ShouldEqual, block.StateArchived) So(stat.EntrySize, ShouldEqual, vsbtest.EntrySize0+vsbtest.EntrySize1) So(b.indexes, ShouldHaveLength, 2) @@ -104,7 +105,6 @@ func TestVSBlock_Open(t *testing.T) { stat := b.status() So(stat.Capacity, ShouldEqual, vsbtest.EntrySize0+vsbtest.EntrySize1) - So(stat.Archived, ShouldBeTrue) So(stat.EntryNum, ShouldEqual, 2) So(stat.EntrySize, ShouldEqual, vsbtest.EntrySize0+vsbtest.EntrySize1) @@ -133,6 +133,9 @@ func TestVSBlock_Open(t *testing.T) { So(err, ShouldBeNil) b := &vsBlock{ + actx: appendContext{ + state: block.StateWorking, + }, path: f.Name(), } @@ -140,8 +143,8 @@ func TestVSBlock_Open(t *testing.T) { So(err, ShouldBeNil) stat := b.status() + So(stat.State, ShouldEqual, block.StateWorking) So(stat.Capacity, ShouldEqual, vsbtest.EntrySize0+vsbtest.EntrySize1) - So(stat.Archived, ShouldBeFalse) So(stat.EntryNum, ShouldEqual, 2) So(stat.EntrySize, ShouldEqual, vsbtest.EntrySize0+vsbtest.EntrySize1) diff --git a/internal/store/vsb/block_read_test.go b/internal/store/vsb/block_read_test.go index e94007cdc..78423c079 100644 --- a/internal/store/vsb/block_read_test.go +++ b/internal/store/vsb/block_read_test.go @@ -91,7 +91,7 @@ func TestVSBlock_Read(t *testing.T) { So(err, ShouldBeError, block.ErrExceeded) Convey("after block is full", func() { - b.actx.archived = 1 + b.actx.state = block.StateArchived _, err = b.Read(context.Background(), 2, 1) So(err, ShouldBeError, block.ErrExceeded) diff --git a/internal/store/vsb/block_snapshot.go b/internal/store/vsb/block_snapshot.go index b67aad287..e194f2ebe 100644 --- a/internal/store/vsb/block_snapshot.go +++ b/internal/store/vsb/block_snapshot.go @@ -18,7 +18,6 @@ import ( // standard libraries. "context" "encoding/binary" - "sync/atomic" // first-party libraries. "github.com/linkall-labs/vanus/observability/log" @@ -49,7 +48,7 @@ func (b *vsBlock) makeSnapshot() (meta, []index.Index) { func makeSnapshot(actx appendContext, indexes []index.Index) (meta, []index.Index) { m := meta{ writeOffset: actx.offset, - archived: actx.Archived(), + state: actx.state, } if sz := len(indexes); sz != 0 { m.entryLength = indexes[sz-1].EndOffset() - indexes[0].StartOffset() @@ -102,7 +101,7 @@ func (b *vsBlock) ApplySnapshot(ctx context.Context, snap block.Fragment) error n, entry, _ := b.dec.Unmarshal(payload[off-headerBlockSize:]) if ceschema.EntryType(entry) == ceschema.End { - atomic.StoreUint32(&b.actx.archived, 1) + b.actx.state = block.StateArchived break } diff --git a/internal/trigger/server_test.go b/internal/trigger/server_test.go index 827dfda0f..b99b33f79 100644 --- a/internal/trigger/server_test.go +++ b/internal/trigger/server_test.go @@ -31,8 +31,11 @@ func TestServerApi(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() w := NewMockWorker(ctrl) - s := NewTriggerServer(Config{}).(*server) - s.worker = w + s := &server{ + config: Config{}, + worker: w, + state: primitive.ServerStateCreated, + } Convey("test start", func() { w.EXPECT().Start(gomock.Any()).Return(nil) _, err := s.Start(ctx, &pbtrigger.StartTriggerWorkerRequest{}) @@ -89,8 +92,11 @@ func TestServerInitAndClose(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() w := NewMockWorker(ctrl) - s := NewTriggerServer(Config{}).(*server) - s.worker = w + s := &server{ + config: Config{}, + worker: w, + state: primitive.ServerStateCreated, + } Convey("test init", func() { w.EXPECT().Init(gomock.Any()).Return(nil) w.EXPECT().Register(gomock.Any()).Return(nil) diff --git a/internal/trigger/worker_test.go b/internal/trigger/worker_test.go index 20d2890e0..aa83d3c39 100644 --- a/internal/trigger/worker_test.go +++ b/internal/trigger/worker_test.go @@ -40,7 +40,10 @@ func TestAddSubscription(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() tg := trigger.NewMockTrigger(ctrl) - m := NewWorker(Config{ControllerAddr: []string{"test"}}).(*worker) + m := &worker{ + config: Config{ControllerAddr: []string{"test"}}, + triggerMap: make(map[vanus.ID]trigger.Trigger), + } m.newTrigger = testNewTrigger(tg) Convey("add subscription", func() { id := vanus.NewTestID() @@ -84,7 +87,10 @@ func TestRemoveSubscription(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() tg := trigger.NewMockTrigger(ctrl) - m := NewWorker(Config{}).(*worker) + m := &worker{ + config: Config{}, + triggerMap: make(map[vanus.ID]trigger.Trigger), + } m.newTrigger = testNewTrigger(tg) Convey("remove no exist subscription", func() { @@ -120,7 +126,10 @@ func TestPauseStartSubscription(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() tg := trigger.NewMockTrigger(ctrl) - m := NewWorker(Config{}).(*worker) + m := &worker{ + config: Config{}, + triggerMap: make(map[vanus.ID]trigger.Trigger), + } m.newTrigger = testNewTrigger(tg) id := vanus.NewTestID() Convey("pause no exist subscription", func() { @@ -159,12 +168,17 @@ func TestPauseStartSubscription(t *testing.T) { } func TestWorker_Stop(t *testing.T) { - ctx := context.Background() + // ctx := context.Background() + ctx, cancel := context.WithCancel(context.Background()) Convey("start stop", t, func() { ctrl := gomock.NewController(t) defer ctrl.Finish() tg := trigger.NewMockTrigger(ctrl) - m := NewWorker(Config{}).(*worker) + m := &worker{ + config: Config{}, + stop: cancel, + triggerMap: make(map[vanus.ID]trigger.Trigger), + } m.newTrigger = testNewTrigger(tg) id := vanus.NewTestID() tg.EXPECT().Init(gomock.Any()).Return(nil) @@ -196,7 +210,10 @@ func TestWorker_Register(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() addr := "test" - m := NewWorker(Config{TriggerAddr: addr}).(*worker) + m := &worker{ + config: Config{TriggerAddr: addr}, + triggerMap: make(map[vanus.ID]trigger.Trigger), + } triggerClient := controller.NewMockTriggerControllerClient(ctrl) m.client = triggerClient triggerClient.EXPECT().RegisterTriggerWorker(gomock.Any(), gomock.Any()).Return(nil, nil) @@ -211,7 +228,10 @@ func TestWorker_Unregister(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() addr := "test" - m := NewWorker(Config{TriggerAddr: addr}).(*worker) + m := &worker{ + config: Config{TriggerAddr: addr}, + triggerMap: make(map[vanus.ID]trigger.Trigger), + } triggerClient := controller.NewMockTriggerControllerClient(ctrl) m.client = triggerClient triggerClient.EXPECT().UnregisterTriggerWorker(gomock.Any(), gomock.Any()).Return(nil, nil) diff --git a/pkg/cluster/raw_client/eventlog.go b/pkg/cluster/raw_client/eventlog.go index 392436b2b..5cb16d744 100644 --- a/pkg/cluster/raw_client/eventlog.go +++ b/pkg/cluster/raw_client/eventlog.go @@ -59,3 +59,13 @@ func (elc *eventlogClient) GetAppendableSegment(ctx context.Context, } return out, nil } + +func (elc *eventlogClient) GetReadableSegment(ctx context.Context, + in *ctrlpb.GetReadableSegmentRequest, opts ...grpc.CallOption) (*ctrlpb.GetReadableSegmentResponse, error) { + out := new(ctrlpb.GetReadableSegmentResponse) + err := elc.cc.invoke(ctx, "/linkall.vanus.controller.EventLogController/GetReadableSegment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} diff --git a/pkg/cluster/raw_client/segment.go b/pkg/cluster/raw_client/segment.go index 225feb8d7..a5e620df5 100644 --- a/pkg/cluster/raw_client/segment.go +++ b/pkg/cluster/raw_client/segment.go @@ -29,6 +29,7 @@ import ( "github.com/linkall-labs/vanus/pkg/errors" ctrlpb "github.com/linkall-labs/vanus/proto/pkg/controller" + "github.com/linkall-labs/vanus/proto/pkg/meta" ) var ( @@ -135,8 +136,8 @@ func (sc *segmentClient) ReportSegmentBlockIsFull(ctx context.Context, } func (sc *segmentClient) ReportSegmentLeader(ctx context.Context, - in *ctrlpb.ReportSegmentLeaderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) + in *ctrlpb.ReportSegmentLeaderRequest, opts ...grpc.CallOption) (*meta.Segment, error) { + out := new(meta.Segment) err := sc.cc.invoke(ctx, "/linkall.vanus.controller.SegmentController/ReportSegmentLeader", in, out, opts...) if err != nil { return nil, err diff --git a/proto/pkg/controller/controller.pb.go b/proto/pkg/controller/controller.pb.go index 59f3f3ad9..238e1bed5 100644 --- a/proto/pkg/controller/controller.pb.go +++ b/proto/pkg/controller/controller.pb.go @@ -15,17 +15,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.19.1 +// protoc v3.19.4 // source: controller.proto -//go:generate mockgen -source=controller.pb.go -destination=mock_controller.go -package=controller package controller import ( context "context" - reflect "reflect" - sync "sync" - meta "github.com/linkall-labs/vanus/proto/pkg/meta" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -35,6 +31,8 @@ import ( emptypb "google.golang.org/protobuf/types/known/emptypb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + reflect "reflect" + sync "sync" ) const ( @@ -1991,6 +1989,116 @@ func (x *GetAppendableSegmentResponse) GetSegments() []*meta.Segment { return nil } +type GetReadableSegmentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EventBusId uint64 `protobuf:"varint,1,opt,name=event_bus_id,json=eventBusId,proto3" json:"event_bus_id,omitempty"` + EventLogId uint64 `protobuf:"varint,2,opt,name=event_log_id,json=eventLogId,proto3" json:"event_log_id,omitempty"` + Limited int32 `protobuf:"varint,3,opt,name=limited,proto3" json:"limited,omitempty"` +} + +func (x *GetReadableSegmentRequest) Reset() { + *x = GetReadableSegmentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetReadableSegmentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetReadableSegmentRequest) ProtoMessage() {} + +func (x *GetReadableSegmentRequest) ProtoReflect() protoreflect.Message { + mi := &file_controller_proto_msgTypes[36] + 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 GetReadableSegmentRequest.ProtoReflect.Descriptor instead. +func (*GetReadableSegmentRequest) Descriptor() ([]byte, []int) { + return file_controller_proto_rawDescGZIP(), []int{36} +} + +func (x *GetReadableSegmentRequest) GetEventBusId() uint64 { + if x != nil { + return x.EventBusId + } + return 0 +} + +func (x *GetReadableSegmentRequest) GetEventLogId() uint64 { + if x != nil { + return x.EventLogId + } + return 0 +} + +func (x *GetReadableSegmentRequest) GetLimited() int32 { + if x != nil { + return x.Limited + } + return 0 +} + +type GetReadableSegmentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Segments []*meta.Segment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` +} + +func (x *GetReadableSegmentResponse) Reset() { + *x = GetReadableSegmentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_controller_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetReadableSegmentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetReadableSegmentResponse) ProtoMessage() {} + +func (x *GetReadableSegmentResponse) ProtoReflect() protoreflect.Message { + mi := &file_controller_proto_msgTypes[37] + 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 GetReadableSegmentResponse.ProtoReflect.Descriptor instead. +func (*GetReadableSegmentResponse) Descriptor() ([]byte, []int) { + return file_controller_proto_rawDescGZIP(), []int{37} +} + +func (x *GetReadableSegmentResponse) GetSegments() []*meta.Segment { + if x != nil { + return x.Segments + } + return nil +} + var File_controller_proto protoreflect.FileDescriptor var file_controller_proto_rawDesc = []byte{ @@ -2240,222 +2348,243 @@ var file_controller_proto_rawDesc = []byte{ 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x32, 0x54, 0x0a, 0x0a, 0x50, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 0x26, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, - 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x50, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xa8, 0x04, 0x0a, 0x12, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x12, 0x5f, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x42, 0x75, 0x73, 0x12, 0x2f, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, - 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, - 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x42, 0x75, 0x73, 0x12, 0x65, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x73, - 0x74, 0x65, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x2f, 0x2e, 0x6c, 0x69, - 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x42, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, - 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, - 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x46, 0x0a, 0x0e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x6c, - 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, - 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x12, 0x49, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, - 0x73, 0x12, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, - 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x1a, - 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, - 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x56, 0x0a, - 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x16, 0x2e, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x79, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x64, + 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x75, 0x73, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, + 0x75, 0x73, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x6f, + 0x67, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x4c, 0x6f, 0x67, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, + 0x22, 0x55, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x53, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, + 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x32, 0x54, 0x0a, 0x0a, 0x50, 0x69, 0x6e, 0x67, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2e, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x26, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x62, 0x75, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x2f, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, + 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xa8, 0x04, + 0x0a, 0x12, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x5f, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x2f, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, + 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, + 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x65, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x2f, 0x2e, + 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, + 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, + 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x46, 0x0a, 0x0e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x1c, + 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, + 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x12, 0x49, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x42, 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, + 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, + 0x73, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, + 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, + 0x56, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2e, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, - 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x32, 0x88, 0x02, 0x0a, 0x12, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x6a, 0x0a, - 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x2e, 0x6c, + 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x62, 0x75, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x2f, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, + 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x42, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, + 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x32, 0x89, 0x03, 0x0a, 0x12, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, + 0x6a, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2c, + 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, + 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x67, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x6c, 0x69, 0x6e, - 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x85, 0x01, 0x0a, 0x14, 0x47, 0x65, - 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x35, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, - 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, - 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, - 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, - 0x6c, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x32, 0x83, 0x06, 0x0a, 0x11, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x88, 0x01, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x36, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, - 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x85, 0x01, 0x0a, 0x14, + 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x35, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, + 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, + 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x6c, 0x69, + 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, + 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x7f, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x64, 0x61, 0x62, + 0x6c, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x33, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x10, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, - 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x31, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, - 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, - 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, + 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x64, 0x61, 0x62, 0x6c, 0x65, + 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, + 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, + 0x64, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x88, 0x06, 0x0a, 0x11, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x88, 0x01, 0x0a, 0x15, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x36, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, + 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x75, 0x74, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x6c, + 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x10, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, + 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x31, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x72, - 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, - 0x88, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x67, 0x6d, - 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x36, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, + 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x6c, + 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, + 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x28, 0x01, 0x12, 0x88, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x36, 0x2e, 0x6c, + 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, + 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8e, 0x01, + 0x0a, 0x17, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x38, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x67, - 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x37, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, - 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8e, 0x01, 0x0a, 0x17, 0x55, + 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, + 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x38, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, - 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x2e, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x67, 0x6d, - 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x39, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x18, 0x52, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x49, 0x73, 0x46, 0x75, 0x6c, 0x6c, 0x12, 0x31, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, - 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, - 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x12, 0x63, 0x0a, 0x13, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x67, 0x6d, - 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x34, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, - 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0xad, 0x0b, 0x0a, 0x11, 0x54, 0x72, 0x69, 0x67, - 0x67, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x6d, 0x0a, - 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, - 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, - 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x00, 0x12, 0x6d, 0x0a, 0x12, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, - 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, - 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x00, 0x12, 0x63, 0x0a, 0x12, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x33, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, - 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, - 0x12, 0x63, 0x0a, 0x13, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, - 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, + 0x0a, 0x18, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x73, 0x46, 0x75, 0x6c, 0x6c, 0x12, 0x31, 0x2e, 0x6c, 0x69, 0x6e, + 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, + 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x61, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x68, 0x0a, 0x13, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x34, 0x2e, 0x6c, + 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x65, + 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, + 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x32, + 0xad, 0x0b, 0x0a, 0x11, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x6d, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, 0x75, 0x62, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x67, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, 0x6c, 0x69, - 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, - 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, - 0x74, 0x61, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x00, 0x12, 0x7b, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, - 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, - 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8d, - 0x01, 0x0a, 0x16, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, - 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x37, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, + 0x1a, 0x20, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x00, 0x12, 0x6d, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x6c, 0x69, 0x6e, + 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x20, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, + 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x00, 0x12, 0x63, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, - 0x65, 0x72, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, - 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x54, 0x72, - 0x69, 0x67, 0x67, 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x48, 0x65, 0x61, 0x72, 0x74, - 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x88, - 0x01, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, - 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x36, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, - 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, - 0x67, 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x37, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, + 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x63, 0x0a, 0x13, 0x44, 0x69, 0x73, 0x61, + 0x62, 0x6c, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x34, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x61, 0x0a, + 0x12, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, + 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x52, + 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x12, 0x67, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, + 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x47, + 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, + 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x00, 0x12, 0x7b, 0x0a, 0x10, 0x4c, 0x69, 0x73, + 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x2e, + 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x32, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8d, 0x01, 0x0a, 0x16, 0x54, 0x72, 0x69, 0x67, 0x67, + 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, + 0x74, 0x12, 0x37, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, + 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x54, 0x72, 0x69, + 0x67, 0x67, 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, + 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x6c, 0x69, 0x6e, + 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x57, 0x6f, 0x72, + 0x6b, 0x65, 0x72, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x88, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, + 0x12, 0x36, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8e, 0x01, 0x0a, 0x17, 0x55, 0x6e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x57, - 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x38, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, - 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x2e, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, - 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x39, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8b, 0x01, 0x0a, 0x16, 0x52, - 0x65, 0x73, 0x65, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x54, 0x6f, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x37, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, - 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x54, 0x6f, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, - 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x4f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x54, 0x6f, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6d, 0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x2d, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, + 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, + 0x67, 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x8e, 0x01, 0x0a, 0x17, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x38, 0x2e, + 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xee, 0x01, 0x0a, 0x13, 0x53, 0x6e, 0x6f, 0x77, - 0x66, 0x6c, 0x61, 0x6b, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, - 0x49, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1a, + 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x72, 0x69, + 0x67, 0x67, 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x8b, 0x01, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x65, 0x74, 0x4f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x54, 0x6f, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x37, 0x2e, + 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x4f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x54, 0x6f, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, + 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x54, 0x6f, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x6d, 0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x12, 0x2d, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2e, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, + 0xee, 0x01, 0x0a, 0x13, 0x53, 0x6e, 0x6f, 0x77, 0x66, 0x6c, 0x61, 0x6b, 0x65, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x43, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x44, 0x0a, 0x0c, 0x52, 0x65, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x44, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, + 0x64, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x46, 0x0a, 0x0e, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x12, 0x46, 0x0a, 0x0e, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, - 0x64, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2d, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x70, 0x6b, 0x67, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, + 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x76, 0x61, 0x6e, 0x75, + 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2470,7 +2599,7 @@ func file_controller_proto_rawDescGZIP() []byte { return file_controller_proto_rawDescData } -var file_controller_proto_msgTypes = make([]protoimpl.MessageInfo, 37) +var file_controller_proto_msgTypes = make([]protoimpl.MessageInfo, 39) var file_controller_proto_goTypes = []interface{}{ (*PingResponse)(nil), // 0: linkall.vanus.controller.PingResponse (*CreateEventBusRequest)(nil), // 1: linkall.vanus.controller.CreateEventBusRequest @@ -2508,107 +2637,112 @@ var file_controller_proto_goTypes = []interface{}{ (*ListSegmentResponse)(nil), // 33: linkall.vanus.controller.ListSegmentResponse (*GetAppendableSegmentRequest)(nil), // 34: linkall.vanus.controller.GetAppendableSegmentRequest (*GetAppendableSegmentResponse)(nil), // 35: linkall.vanus.controller.GetAppendableSegmentResponse - nil, // 36: linkall.vanus.controller.RegisterSegmentServerResponse.SegmentsEntry - (*meta.EventBus)(nil), // 37: linkall.vanus.meta.EventBus - (*meta.SegmentHealthInfo)(nil), // 38: linkall.vanus.meta.SegmentHealthInfo - (*meta.SubscriptionConfig)(nil), // 39: linkall.vanus.meta.SubscriptionConfig - (*meta.Filter)(nil), // 40: linkall.vanus.meta.Filter - (*meta.SinkCredential)(nil), // 41: linkall.vanus.meta.SinkCredential - (meta.Protocol)(0), // 42: linkall.vanus.meta.Protocol - (*meta.ProtocolSetting)(nil), // 43: linkall.vanus.meta.ProtocolSetting - (*meta.Transformer)(nil), // 44: linkall.vanus.meta.Transformer - (*meta.Subscription)(nil), // 45: linkall.vanus.meta.Subscription - (*meta.SubscriptionInfo)(nil), // 46: linkall.vanus.meta.SubscriptionInfo - (*meta.OffsetInfo)(nil), // 47: linkall.vanus.meta.OffsetInfo - (*meta.Segment)(nil), // 48: linkall.vanus.meta.Segment - (*emptypb.Empty)(nil), // 49: google.protobuf.Empty - (*wrapperspb.UInt32Value)(nil), // 50: google.protobuf.UInt32Value - (*timestamppb.Timestamp)(nil), // 51: google.protobuf.Timestamp + (*GetReadableSegmentRequest)(nil), // 36: linkall.vanus.controller.GetReadableSegmentRequest + (*GetReadableSegmentResponse)(nil), // 37: linkall.vanus.controller.GetReadableSegmentResponse + nil, // 38: linkall.vanus.controller.RegisterSegmentServerResponse.SegmentsEntry + (*meta.EventBus)(nil), // 39: linkall.vanus.meta.EventBus + (*meta.SegmentHealthInfo)(nil), // 40: linkall.vanus.meta.SegmentHealthInfo + (*meta.SubscriptionConfig)(nil), // 41: linkall.vanus.meta.SubscriptionConfig + (*meta.Filter)(nil), // 42: linkall.vanus.meta.Filter + (*meta.SinkCredential)(nil), // 43: linkall.vanus.meta.SinkCredential + (meta.Protocol)(0), // 44: linkall.vanus.meta.Protocol + (*meta.ProtocolSetting)(nil), // 45: linkall.vanus.meta.ProtocolSetting + (*meta.Transformer)(nil), // 46: linkall.vanus.meta.Transformer + (*meta.Subscription)(nil), // 47: linkall.vanus.meta.Subscription + (*meta.SubscriptionInfo)(nil), // 48: linkall.vanus.meta.SubscriptionInfo + (*meta.OffsetInfo)(nil), // 49: linkall.vanus.meta.OffsetInfo + (*meta.Segment)(nil), // 50: linkall.vanus.meta.Segment + (*emptypb.Empty)(nil), // 51: google.protobuf.Empty + (*wrapperspb.UInt32Value)(nil), // 52: google.protobuf.UInt32Value + (*timestamppb.Timestamp)(nil), // 53: google.protobuf.Timestamp } var file_controller_proto_depIdxs = []int32{ - 37, // 0: linkall.vanus.controller.ListEventbusResponse.eventbus:type_name -> linkall.vanus.meta.EventBus - 38, // 1: linkall.vanus.controller.SegmentHeartbeatRequest.health_info:type_name -> linkall.vanus.meta.SegmentHealthInfo - 36, // 2: linkall.vanus.controller.RegisterSegmentServerResponse.segments:type_name -> linkall.vanus.controller.RegisterSegmentServerResponse.SegmentsEntry - 39, // 3: linkall.vanus.controller.SubscriptionRequest.config:type_name -> linkall.vanus.meta.SubscriptionConfig - 40, // 4: linkall.vanus.controller.SubscriptionRequest.filters:type_name -> linkall.vanus.meta.Filter - 41, // 5: linkall.vanus.controller.SubscriptionRequest.sink_credential:type_name -> linkall.vanus.meta.SinkCredential - 42, // 6: linkall.vanus.controller.SubscriptionRequest.protocol:type_name -> linkall.vanus.meta.Protocol - 43, // 7: linkall.vanus.controller.SubscriptionRequest.protocol_settings:type_name -> linkall.vanus.meta.ProtocolSetting - 44, // 8: linkall.vanus.controller.SubscriptionRequest.transformer:type_name -> linkall.vanus.meta.Transformer + 39, // 0: linkall.vanus.controller.ListEventbusResponse.eventbus:type_name -> linkall.vanus.meta.EventBus + 40, // 1: linkall.vanus.controller.SegmentHeartbeatRequest.health_info:type_name -> linkall.vanus.meta.SegmentHealthInfo + 38, // 2: linkall.vanus.controller.RegisterSegmentServerResponse.segments:type_name -> linkall.vanus.controller.RegisterSegmentServerResponse.SegmentsEntry + 41, // 3: linkall.vanus.controller.SubscriptionRequest.config:type_name -> linkall.vanus.meta.SubscriptionConfig + 42, // 4: linkall.vanus.controller.SubscriptionRequest.filters:type_name -> linkall.vanus.meta.Filter + 43, // 5: linkall.vanus.controller.SubscriptionRequest.sink_credential:type_name -> linkall.vanus.meta.SinkCredential + 44, // 6: linkall.vanus.controller.SubscriptionRequest.protocol:type_name -> linkall.vanus.meta.Protocol + 45, // 7: linkall.vanus.controller.SubscriptionRequest.protocol_settings:type_name -> linkall.vanus.meta.ProtocolSetting + 46, // 8: linkall.vanus.controller.SubscriptionRequest.transformer:type_name -> linkall.vanus.meta.Transformer 13, // 9: linkall.vanus.controller.CreateSubscriptionRequest.subscription:type_name -> linkall.vanus.controller.SubscriptionRequest 13, // 10: linkall.vanus.controller.UpdateSubscriptionRequest.subscription:type_name -> linkall.vanus.controller.SubscriptionRequest - 45, // 11: linkall.vanus.controller.ListSubscriptionResponse.subscription:type_name -> linkall.vanus.meta.Subscription - 46, // 12: linkall.vanus.controller.TriggerWorkerHeartbeatRequest.subscription_info:type_name -> linkall.vanus.meta.SubscriptionInfo - 47, // 13: linkall.vanus.controller.ResetOffsetToTimestampResponse.offsets:type_name -> linkall.vanus.meta.OffsetInfo - 46, // 14: linkall.vanus.controller.CommitOffsetRequest.subscription_info:type_name -> linkall.vanus.meta.SubscriptionInfo - 48, // 15: linkall.vanus.controller.ListSegmentResponse.segments:type_name -> linkall.vanus.meta.Segment - 48, // 16: linkall.vanus.controller.GetAppendableSegmentResponse.segments:type_name -> linkall.vanus.meta.Segment - 48, // 17: linkall.vanus.controller.RegisterSegmentServerResponse.SegmentsEntry.value:type_name -> linkall.vanus.meta.Segment - 49, // 18: linkall.vanus.controller.PingServer.Ping:input_type -> google.protobuf.Empty - 1, // 19: linkall.vanus.controller.EventBusController.CreateEventBus:input_type -> linkall.vanus.controller.CreateEventBusRequest - 1, // 20: linkall.vanus.controller.EventBusController.CreateSystemEventBus:input_type -> linkall.vanus.controller.CreateEventBusRequest - 37, // 21: linkall.vanus.controller.EventBusController.DeleteEventBus:input_type -> linkall.vanus.meta.EventBus - 37, // 22: linkall.vanus.controller.EventBusController.GetEventBus:input_type -> linkall.vanus.meta.EventBus - 49, // 23: linkall.vanus.controller.EventBusController.ListEventBus:input_type -> google.protobuf.Empty - 3, // 24: linkall.vanus.controller.EventBusController.UpdateEventBus:input_type -> linkall.vanus.controller.UpdateEventBusRequest - 32, // 25: linkall.vanus.controller.EventLogController.ListSegment:input_type -> linkall.vanus.controller.ListSegmentRequest - 34, // 26: linkall.vanus.controller.EventLogController.GetAppendableSegment:input_type -> linkall.vanus.controller.GetAppendableSegmentRequest - 4, // 27: linkall.vanus.controller.SegmentController.QuerySegmentRouteInfo:input_type -> linkall.vanus.controller.QuerySegmentRouteInfoRequest - 6, // 28: linkall.vanus.controller.SegmentController.SegmentHeartbeat:input_type -> linkall.vanus.controller.SegmentHeartbeatRequest - 8, // 29: linkall.vanus.controller.SegmentController.RegisterSegmentServer:input_type -> linkall.vanus.controller.RegisterSegmentServerRequest - 10, // 30: linkall.vanus.controller.SegmentController.UnregisterSegmentServer:input_type -> linkall.vanus.controller.UnregisterSegmentServerRequest - 6, // 31: linkall.vanus.controller.SegmentController.ReportSegmentBlockIsFull:input_type -> linkall.vanus.controller.SegmentHeartbeatRequest - 12, // 32: linkall.vanus.controller.SegmentController.ReportSegmentLeader:input_type -> linkall.vanus.controller.ReportSegmentLeaderRequest - 14, // 33: linkall.vanus.controller.TriggerController.CreateSubscription:input_type -> linkall.vanus.controller.CreateSubscriptionRequest - 15, // 34: linkall.vanus.controller.TriggerController.UpdateSubscription:input_type -> linkall.vanus.controller.UpdateSubscriptionRequest - 17, // 35: linkall.vanus.controller.TriggerController.DeleteSubscription:input_type -> linkall.vanus.controller.DeleteSubscriptionRequest - 18, // 36: linkall.vanus.controller.TriggerController.DisableSubscription:input_type -> linkall.vanus.controller.DisableSubscriptionRequest - 19, // 37: linkall.vanus.controller.TriggerController.ResumeSubscription:input_type -> linkall.vanus.controller.ResumeSubscriptionRequest - 16, // 38: linkall.vanus.controller.TriggerController.GetSubscription:input_type -> linkall.vanus.controller.GetSubscriptionRequest - 20, // 39: linkall.vanus.controller.TriggerController.ListSubscription:input_type -> linkall.vanus.controller.ListSubscriptionRequest - 26, // 40: linkall.vanus.controller.TriggerController.TriggerWorkerHeartbeat:input_type -> linkall.vanus.controller.TriggerWorkerHeartbeatRequest - 22, // 41: linkall.vanus.controller.TriggerController.RegisterTriggerWorker:input_type -> linkall.vanus.controller.RegisterTriggerWorkerRequest - 24, // 42: linkall.vanus.controller.TriggerController.UnregisterTriggerWorker:input_type -> linkall.vanus.controller.UnregisterTriggerWorkerRequest - 28, // 43: linkall.vanus.controller.TriggerController.ResetOffsetToTimestamp:input_type -> linkall.vanus.controller.ResetOffsetToTimestampRequest - 30, // 44: linkall.vanus.controller.TriggerController.CommitOffset:input_type -> linkall.vanus.controller.CommitOffsetRequest - 49, // 45: linkall.vanus.controller.SnowflakeController.GetClusterStartTime:input_type -> google.protobuf.Empty - 50, // 46: linkall.vanus.controller.SnowflakeController.RegisterNode:input_type -> google.protobuf.UInt32Value - 50, // 47: linkall.vanus.controller.SnowflakeController.UnregisterNode:input_type -> google.protobuf.UInt32Value - 0, // 48: linkall.vanus.controller.PingServer.Ping:output_type -> linkall.vanus.controller.PingResponse - 37, // 49: linkall.vanus.controller.EventBusController.CreateEventBus:output_type -> linkall.vanus.meta.EventBus - 37, // 50: linkall.vanus.controller.EventBusController.CreateSystemEventBus:output_type -> linkall.vanus.meta.EventBus - 49, // 51: linkall.vanus.controller.EventBusController.DeleteEventBus:output_type -> google.protobuf.Empty - 37, // 52: linkall.vanus.controller.EventBusController.GetEventBus:output_type -> linkall.vanus.meta.EventBus - 2, // 53: linkall.vanus.controller.EventBusController.ListEventBus:output_type -> linkall.vanus.controller.ListEventbusResponse - 37, // 54: linkall.vanus.controller.EventBusController.UpdateEventBus:output_type -> linkall.vanus.meta.EventBus - 33, // 55: linkall.vanus.controller.EventLogController.ListSegment:output_type -> linkall.vanus.controller.ListSegmentResponse - 35, // 56: linkall.vanus.controller.EventLogController.GetAppendableSegment:output_type -> linkall.vanus.controller.GetAppendableSegmentResponse - 5, // 57: linkall.vanus.controller.SegmentController.QuerySegmentRouteInfo:output_type -> linkall.vanus.controller.QuerySegmentRouteInfoResponse - 7, // 58: linkall.vanus.controller.SegmentController.SegmentHeartbeat:output_type -> linkall.vanus.controller.SegmentHeartbeatResponse - 9, // 59: linkall.vanus.controller.SegmentController.RegisterSegmentServer:output_type -> linkall.vanus.controller.RegisterSegmentServerResponse - 11, // 60: linkall.vanus.controller.SegmentController.UnregisterSegmentServer:output_type -> linkall.vanus.controller.UnregisterSegmentServerResponse - 49, // 61: linkall.vanus.controller.SegmentController.ReportSegmentBlockIsFull:output_type -> google.protobuf.Empty - 49, // 62: linkall.vanus.controller.SegmentController.ReportSegmentLeader:output_type -> google.protobuf.Empty - 45, // 63: linkall.vanus.controller.TriggerController.CreateSubscription:output_type -> linkall.vanus.meta.Subscription - 45, // 64: linkall.vanus.controller.TriggerController.UpdateSubscription:output_type -> linkall.vanus.meta.Subscription - 49, // 65: linkall.vanus.controller.TriggerController.DeleteSubscription:output_type -> google.protobuf.Empty - 49, // 66: linkall.vanus.controller.TriggerController.DisableSubscription:output_type -> google.protobuf.Empty - 49, // 67: linkall.vanus.controller.TriggerController.ResumeSubscription:output_type -> google.protobuf.Empty - 45, // 68: linkall.vanus.controller.TriggerController.GetSubscription:output_type -> linkall.vanus.meta.Subscription - 21, // 69: linkall.vanus.controller.TriggerController.ListSubscription:output_type -> linkall.vanus.controller.ListSubscriptionResponse - 27, // 70: linkall.vanus.controller.TriggerController.TriggerWorkerHeartbeat:output_type -> linkall.vanus.controller.TriggerWorkerHeartbeatResponse - 23, // 71: linkall.vanus.controller.TriggerController.RegisterTriggerWorker:output_type -> linkall.vanus.controller.RegisterTriggerWorkerResponse - 25, // 72: linkall.vanus.controller.TriggerController.UnregisterTriggerWorker:output_type -> linkall.vanus.controller.UnregisterTriggerWorkerResponse - 29, // 73: linkall.vanus.controller.TriggerController.ResetOffsetToTimestamp:output_type -> linkall.vanus.controller.ResetOffsetToTimestampResponse - 31, // 74: linkall.vanus.controller.TriggerController.CommitOffset:output_type -> linkall.vanus.controller.CommitOffsetResponse - 51, // 75: linkall.vanus.controller.SnowflakeController.GetClusterStartTime:output_type -> google.protobuf.Timestamp - 49, // 76: linkall.vanus.controller.SnowflakeController.RegisterNode:output_type -> google.protobuf.Empty - 49, // 77: linkall.vanus.controller.SnowflakeController.UnregisterNode:output_type -> google.protobuf.Empty - 48, // [48:78] is the sub-list for method output_type - 18, // [18:48] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name + 47, // 11: linkall.vanus.controller.ListSubscriptionResponse.subscription:type_name -> linkall.vanus.meta.Subscription + 48, // 12: linkall.vanus.controller.TriggerWorkerHeartbeatRequest.subscription_info:type_name -> linkall.vanus.meta.SubscriptionInfo + 49, // 13: linkall.vanus.controller.ResetOffsetToTimestampResponse.offsets:type_name -> linkall.vanus.meta.OffsetInfo + 48, // 14: linkall.vanus.controller.CommitOffsetRequest.subscription_info:type_name -> linkall.vanus.meta.SubscriptionInfo + 50, // 15: linkall.vanus.controller.ListSegmentResponse.segments:type_name -> linkall.vanus.meta.Segment + 50, // 16: linkall.vanus.controller.GetAppendableSegmentResponse.segments:type_name -> linkall.vanus.meta.Segment + 50, // 17: linkall.vanus.controller.GetReadableSegmentResponse.segments:type_name -> linkall.vanus.meta.Segment + 50, // 18: linkall.vanus.controller.RegisterSegmentServerResponse.SegmentsEntry.value:type_name -> linkall.vanus.meta.Segment + 51, // 19: linkall.vanus.controller.PingServer.Ping:input_type -> google.protobuf.Empty + 1, // 20: linkall.vanus.controller.EventBusController.CreateEventBus:input_type -> linkall.vanus.controller.CreateEventBusRequest + 1, // 21: linkall.vanus.controller.EventBusController.CreateSystemEventBus:input_type -> linkall.vanus.controller.CreateEventBusRequest + 39, // 22: linkall.vanus.controller.EventBusController.DeleteEventBus:input_type -> linkall.vanus.meta.EventBus + 39, // 23: linkall.vanus.controller.EventBusController.GetEventBus:input_type -> linkall.vanus.meta.EventBus + 51, // 24: linkall.vanus.controller.EventBusController.ListEventBus:input_type -> google.protobuf.Empty + 3, // 25: linkall.vanus.controller.EventBusController.UpdateEventBus:input_type -> linkall.vanus.controller.UpdateEventBusRequest + 32, // 26: linkall.vanus.controller.EventLogController.ListSegment:input_type -> linkall.vanus.controller.ListSegmentRequest + 34, // 27: linkall.vanus.controller.EventLogController.GetAppendableSegment:input_type -> linkall.vanus.controller.GetAppendableSegmentRequest + 36, // 28: linkall.vanus.controller.EventLogController.GetReadableSegment:input_type -> linkall.vanus.controller.GetReadableSegmentRequest + 4, // 29: linkall.vanus.controller.SegmentController.QuerySegmentRouteInfo:input_type -> linkall.vanus.controller.QuerySegmentRouteInfoRequest + 6, // 30: linkall.vanus.controller.SegmentController.SegmentHeartbeat:input_type -> linkall.vanus.controller.SegmentHeartbeatRequest + 8, // 31: linkall.vanus.controller.SegmentController.RegisterSegmentServer:input_type -> linkall.vanus.controller.RegisterSegmentServerRequest + 10, // 32: linkall.vanus.controller.SegmentController.UnregisterSegmentServer:input_type -> linkall.vanus.controller.UnregisterSegmentServerRequest + 6, // 33: linkall.vanus.controller.SegmentController.ReportSegmentBlockIsFull:input_type -> linkall.vanus.controller.SegmentHeartbeatRequest + 12, // 34: linkall.vanus.controller.SegmentController.ReportSegmentLeader:input_type -> linkall.vanus.controller.ReportSegmentLeaderRequest + 14, // 35: linkall.vanus.controller.TriggerController.CreateSubscription:input_type -> linkall.vanus.controller.CreateSubscriptionRequest + 15, // 36: linkall.vanus.controller.TriggerController.UpdateSubscription:input_type -> linkall.vanus.controller.UpdateSubscriptionRequest + 17, // 37: linkall.vanus.controller.TriggerController.DeleteSubscription:input_type -> linkall.vanus.controller.DeleteSubscriptionRequest + 18, // 38: linkall.vanus.controller.TriggerController.DisableSubscription:input_type -> linkall.vanus.controller.DisableSubscriptionRequest + 19, // 39: linkall.vanus.controller.TriggerController.ResumeSubscription:input_type -> linkall.vanus.controller.ResumeSubscriptionRequest + 16, // 40: linkall.vanus.controller.TriggerController.GetSubscription:input_type -> linkall.vanus.controller.GetSubscriptionRequest + 20, // 41: linkall.vanus.controller.TriggerController.ListSubscription:input_type -> linkall.vanus.controller.ListSubscriptionRequest + 26, // 42: linkall.vanus.controller.TriggerController.TriggerWorkerHeartbeat:input_type -> linkall.vanus.controller.TriggerWorkerHeartbeatRequest + 22, // 43: linkall.vanus.controller.TriggerController.RegisterTriggerWorker:input_type -> linkall.vanus.controller.RegisterTriggerWorkerRequest + 24, // 44: linkall.vanus.controller.TriggerController.UnregisterTriggerWorker:input_type -> linkall.vanus.controller.UnregisterTriggerWorkerRequest + 28, // 45: linkall.vanus.controller.TriggerController.ResetOffsetToTimestamp:input_type -> linkall.vanus.controller.ResetOffsetToTimestampRequest + 30, // 46: linkall.vanus.controller.TriggerController.CommitOffset:input_type -> linkall.vanus.controller.CommitOffsetRequest + 51, // 47: linkall.vanus.controller.SnowflakeController.GetClusterStartTime:input_type -> google.protobuf.Empty + 52, // 48: linkall.vanus.controller.SnowflakeController.RegisterNode:input_type -> google.protobuf.UInt32Value + 52, // 49: linkall.vanus.controller.SnowflakeController.UnregisterNode:input_type -> google.protobuf.UInt32Value + 0, // 50: linkall.vanus.controller.PingServer.Ping:output_type -> linkall.vanus.controller.PingResponse + 39, // 51: linkall.vanus.controller.EventBusController.CreateEventBus:output_type -> linkall.vanus.meta.EventBus + 39, // 52: linkall.vanus.controller.EventBusController.CreateSystemEventBus:output_type -> linkall.vanus.meta.EventBus + 51, // 53: linkall.vanus.controller.EventBusController.DeleteEventBus:output_type -> google.protobuf.Empty + 39, // 54: linkall.vanus.controller.EventBusController.GetEventBus:output_type -> linkall.vanus.meta.EventBus + 2, // 55: linkall.vanus.controller.EventBusController.ListEventBus:output_type -> linkall.vanus.controller.ListEventbusResponse + 39, // 56: linkall.vanus.controller.EventBusController.UpdateEventBus:output_type -> linkall.vanus.meta.EventBus + 33, // 57: linkall.vanus.controller.EventLogController.ListSegment:output_type -> linkall.vanus.controller.ListSegmentResponse + 35, // 58: linkall.vanus.controller.EventLogController.GetAppendableSegment:output_type -> linkall.vanus.controller.GetAppendableSegmentResponse + 37, // 59: linkall.vanus.controller.EventLogController.GetReadableSegment:output_type -> linkall.vanus.controller.GetReadableSegmentResponse + 5, // 60: linkall.vanus.controller.SegmentController.QuerySegmentRouteInfo:output_type -> linkall.vanus.controller.QuerySegmentRouteInfoResponse + 7, // 61: linkall.vanus.controller.SegmentController.SegmentHeartbeat:output_type -> linkall.vanus.controller.SegmentHeartbeatResponse + 9, // 62: linkall.vanus.controller.SegmentController.RegisterSegmentServer:output_type -> linkall.vanus.controller.RegisterSegmentServerResponse + 11, // 63: linkall.vanus.controller.SegmentController.UnregisterSegmentServer:output_type -> linkall.vanus.controller.UnregisterSegmentServerResponse + 51, // 64: linkall.vanus.controller.SegmentController.ReportSegmentBlockIsFull:output_type -> google.protobuf.Empty + 50, // 65: linkall.vanus.controller.SegmentController.ReportSegmentLeader:output_type -> linkall.vanus.meta.Segment + 47, // 66: linkall.vanus.controller.TriggerController.CreateSubscription:output_type -> linkall.vanus.meta.Subscription + 47, // 67: linkall.vanus.controller.TriggerController.UpdateSubscription:output_type -> linkall.vanus.meta.Subscription + 51, // 68: linkall.vanus.controller.TriggerController.DeleteSubscription:output_type -> google.protobuf.Empty + 51, // 69: linkall.vanus.controller.TriggerController.DisableSubscription:output_type -> google.protobuf.Empty + 51, // 70: linkall.vanus.controller.TriggerController.ResumeSubscription:output_type -> google.protobuf.Empty + 47, // 71: linkall.vanus.controller.TriggerController.GetSubscription:output_type -> linkall.vanus.meta.Subscription + 21, // 72: linkall.vanus.controller.TriggerController.ListSubscription:output_type -> linkall.vanus.controller.ListSubscriptionResponse + 27, // 73: linkall.vanus.controller.TriggerController.TriggerWorkerHeartbeat:output_type -> linkall.vanus.controller.TriggerWorkerHeartbeatResponse + 23, // 74: linkall.vanus.controller.TriggerController.RegisterTriggerWorker:output_type -> linkall.vanus.controller.RegisterTriggerWorkerResponse + 25, // 75: linkall.vanus.controller.TriggerController.UnregisterTriggerWorker:output_type -> linkall.vanus.controller.UnregisterTriggerWorkerResponse + 29, // 76: linkall.vanus.controller.TriggerController.ResetOffsetToTimestamp:output_type -> linkall.vanus.controller.ResetOffsetToTimestampResponse + 31, // 77: linkall.vanus.controller.TriggerController.CommitOffset:output_type -> linkall.vanus.controller.CommitOffsetResponse + 53, // 78: linkall.vanus.controller.SnowflakeController.GetClusterStartTime:output_type -> google.protobuf.Timestamp + 51, // 79: linkall.vanus.controller.SnowflakeController.RegisterNode:output_type -> google.protobuf.Empty + 51, // 80: linkall.vanus.controller.SnowflakeController.UnregisterNode:output_type -> google.protobuf.Empty + 50, // [50:81] is the sub-list for method output_type + 19, // [19:50] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name } func init() { file_controller_proto_init() } @@ -3049,6 +3183,30 @@ func file_controller_proto_init() { return nil } } + file_controller_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetReadableSegmentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_controller_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetReadableSegmentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -3056,7 +3214,7 @@ func file_controller_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_controller_proto_rawDesc, NumEnums: 0, - NumMessages: 37, + NumMessages: 39, NumExtensions: 0, NumServices: 6, }, @@ -3410,6 +3568,7 @@ var _EventBusController_serviceDesc = grpc.ServiceDesc{ type EventLogControllerClient interface { ListSegment(ctx context.Context, in *ListSegmentRequest, opts ...grpc.CallOption) (*ListSegmentResponse, error) GetAppendableSegment(ctx context.Context, in *GetAppendableSegmentRequest, opts ...grpc.CallOption) (*GetAppendableSegmentResponse, error) + GetReadableSegment(ctx context.Context, in *GetReadableSegmentRequest, opts ...grpc.CallOption) (*GetReadableSegmentResponse, error) } type eventLogControllerClient struct { @@ -3438,10 +3597,20 @@ func (c *eventLogControllerClient) GetAppendableSegment(ctx context.Context, in return out, nil } +func (c *eventLogControllerClient) GetReadableSegment(ctx context.Context, in *GetReadableSegmentRequest, opts ...grpc.CallOption) (*GetReadableSegmentResponse, error) { + out := new(GetReadableSegmentResponse) + err := c.cc.Invoke(ctx, "/linkall.vanus.controller.EventLogController/GetReadableSegment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // EventLogControllerServer is the server API for EventLogController service. type EventLogControllerServer interface { ListSegment(context.Context, *ListSegmentRequest) (*ListSegmentResponse, error) GetAppendableSegment(context.Context, *GetAppendableSegmentRequest) (*GetAppendableSegmentResponse, error) + GetReadableSegment(context.Context, *GetReadableSegmentRequest) (*GetReadableSegmentResponse, error) } // UnimplementedEventLogControllerServer can be embedded to have forward compatible implementations. @@ -3454,6 +3623,9 @@ func (*UnimplementedEventLogControllerServer) ListSegment(context.Context, *List func (*UnimplementedEventLogControllerServer) GetAppendableSegment(context.Context, *GetAppendableSegmentRequest) (*GetAppendableSegmentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAppendableSegment not implemented") } +func (*UnimplementedEventLogControllerServer) GetReadableSegment(context.Context, *GetReadableSegmentRequest) (*GetReadableSegmentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetReadableSegment not implemented") +} func RegisterEventLogControllerServer(s *grpc.Server, srv EventLogControllerServer) { s.RegisterService(&_EventLogController_serviceDesc, srv) @@ -3495,6 +3667,24 @@ func _EventLogController_GetAppendableSegment_Handler(srv interface{}, ctx conte return interceptor(ctx, in, info, handler) } +func _EventLogController_GetReadableSegment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetReadableSegmentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EventLogControllerServer).GetReadableSegment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/linkall.vanus.controller.EventLogController/GetReadableSegment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EventLogControllerServer).GetReadableSegment(ctx, req.(*GetReadableSegmentRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _EventLogController_serviceDesc = grpc.ServiceDesc{ ServiceName: "linkall.vanus.controller.EventLogController", HandlerType: (*EventLogControllerServer)(nil), @@ -3507,6 +3697,10 @@ var _EventLogController_serviceDesc = grpc.ServiceDesc{ MethodName: "GetAppendableSegment", Handler: _EventLogController_GetAppendableSegment_Handler, }, + { + MethodName: "GetReadableSegment", + Handler: _EventLogController_GetReadableSegment_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "controller.proto", @@ -3521,7 +3715,7 @@ type SegmentControllerClient interface { RegisterSegmentServer(ctx context.Context, in *RegisterSegmentServerRequest, opts ...grpc.CallOption) (*RegisterSegmentServerResponse, error) UnregisterSegmentServer(ctx context.Context, in *UnregisterSegmentServerRequest, opts ...grpc.CallOption) (*UnregisterSegmentServerResponse, error) ReportSegmentBlockIsFull(ctx context.Context, in *SegmentHeartbeatRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - ReportSegmentLeader(ctx context.Context, in *ReportSegmentLeaderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + ReportSegmentLeader(ctx context.Context, in *ReportSegmentLeaderRequest, opts ...grpc.CallOption) (*meta.Segment, error) } type segmentControllerClient struct { @@ -3602,8 +3796,8 @@ func (c *segmentControllerClient) ReportSegmentBlockIsFull(ctx context.Context, return out, nil } -func (c *segmentControllerClient) ReportSegmentLeader(ctx context.Context, in *ReportSegmentLeaderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) +func (c *segmentControllerClient) ReportSegmentLeader(ctx context.Context, in *ReportSegmentLeaderRequest, opts ...grpc.CallOption) (*meta.Segment, error) { + out := new(meta.Segment) err := c.cc.Invoke(ctx, "/linkall.vanus.controller.SegmentController/ReportSegmentLeader", in, out, opts...) if err != nil { return nil, err @@ -3618,7 +3812,7 @@ type SegmentControllerServer interface { RegisterSegmentServer(context.Context, *RegisterSegmentServerRequest) (*RegisterSegmentServerResponse, error) UnregisterSegmentServer(context.Context, *UnregisterSegmentServerRequest) (*UnregisterSegmentServerResponse, error) ReportSegmentBlockIsFull(context.Context, *SegmentHeartbeatRequest) (*emptypb.Empty, error) - ReportSegmentLeader(context.Context, *ReportSegmentLeaderRequest) (*emptypb.Empty, error) + ReportSegmentLeader(context.Context, *ReportSegmentLeaderRequest) (*meta.Segment, error) } // UnimplementedSegmentControllerServer can be embedded to have forward compatible implementations. @@ -3640,7 +3834,7 @@ func (*UnimplementedSegmentControllerServer) UnregisterSegmentServer(context.Con func (*UnimplementedSegmentControllerServer) ReportSegmentBlockIsFull(context.Context, *SegmentHeartbeatRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method ReportSegmentBlockIsFull not implemented") } -func (*UnimplementedSegmentControllerServer) ReportSegmentLeader(context.Context, *ReportSegmentLeaderRequest) (*emptypb.Empty, error) { +func (*UnimplementedSegmentControllerServer) ReportSegmentLeader(context.Context, *ReportSegmentLeaderRequest) (*meta.Segment, error) { return nil, status.Errorf(codes.Unimplemented, "method ReportSegmentLeader not implemented") } diff --git a/proto/pkg/controller/mock_controller.go b/proto/pkg/controller/mock_controller.go index 59cd3bede..e484f58d6 100644 --- a/proto/pkg/controller/mock_controller.go +++ b/proto/pkg/controller/mock_controller.go @@ -397,6 +397,26 @@ func (mr *MockEventLogControllerClientMockRecorder) GetAppendableSegment(ctx, in return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAppendableSegment", reflect.TypeOf((*MockEventLogControllerClient)(nil).GetAppendableSegment), varargs...) } +// GetReadableSegment mocks base method. +func (m *MockEventLogControllerClient) GetReadableSegment(ctx context.Context, in *GetReadableSegmentRequest, opts ...grpc.CallOption) (*GetReadableSegmentResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetReadableSegment", varargs...) + ret0, _ := ret[0].(*GetReadableSegmentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetReadableSegment indicates an expected call of GetReadableSegment. +func (mr *MockEventLogControllerClientMockRecorder) GetReadableSegment(ctx, in interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetReadableSegment", reflect.TypeOf((*MockEventLogControllerClient)(nil).GetReadableSegment), varargs...) +} + // ListSegment mocks base method. func (m *MockEventLogControllerClient) ListSegment(ctx context.Context, in *ListSegmentRequest, opts ...grpc.CallOption) (*ListSegmentResponse, error) { m.ctrl.T.Helper() @@ -455,6 +475,21 @@ func (mr *MockEventLogControllerServerMockRecorder) GetAppendableSegment(arg0, a return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAppendableSegment", reflect.TypeOf((*MockEventLogControllerServer)(nil).GetAppendableSegment), arg0, arg1) } +// GetReadableSegment mocks base method. +func (m *MockEventLogControllerServer) GetReadableSegment(arg0 context.Context, arg1 *GetReadableSegmentRequest) (*GetReadableSegmentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetReadableSegment", arg0, arg1) + ret0, _ := ret[0].(*GetReadableSegmentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetReadableSegment indicates an expected call of GetReadableSegment. +func (mr *MockEventLogControllerServerMockRecorder) GetReadableSegment(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetReadableSegment", reflect.TypeOf((*MockEventLogControllerServer)(nil).GetReadableSegment), arg0, arg1) +} + // ListSegment mocks base method. func (m *MockEventLogControllerServer) ListSegment(arg0 context.Context, arg1 *ListSegmentRequest) (*ListSegmentResponse, error) { m.ctrl.T.Helper() @@ -554,14 +589,14 @@ func (mr *MockSegmentControllerClientMockRecorder) ReportSegmentBlockIsFull(ctx, } // ReportSegmentLeader mocks base method. -func (m *MockSegmentControllerClient) ReportSegmentLeader(ctx context.Context, in *ReportSegmentLeaderRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (m *MockSegmentControllerClient) ReportSegmentLeader(ctx context.Context, in *ReportSegmentLeaderRequest, opts ...grpc.CallOption) (*meta.Segment, error) { m.ctrl.T.Helper() varargs := []interface{}{ctx, in} for _, a := range opts { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "ReportSegmentLeader", varargs...) - ret0, _ := ret[0].(*emptypb.Empty) + ret0, _ := ret[0].(*meta.Segment) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -819,10 +854,10 @@ func (mr *MockSegmentControllerServerMockRecorder) ReportSegmentBlockIsFull(arg0 } // ReportSegmentLeader mocks base method. -func (m *MockSegmentControllerServer) ReportSegmentLeader(arg0 context.Context, arg1 *ReportSegmentLeaderRequest) (*emptypb.Empty, error) { +func (m *MockSegmentControllerServer) ReportSegmentLeader(arg0 context.Context, arg1 *ReportSegmentLeaderRequest) (*meta.Segment, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ReportSegmentLeader", arg0, arg1) - ret0, _ := ret[0].(*emptypb.Empty) + ret0, _ := ret[0].(*meta.Segment) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/proto/pkg/meta/meta.pb.go b/proto/pkg/meta/meta.pb.go index 9bbd9b308..dadbbc507 100644 --- a/proto/pkg/meta/meta.pb.go +++ b/proto/pkg/meta/meta.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.19.1 +// protoc v3.19.4 // source: meta.proto package meta @@ -732,7 +732,7 @@ type SegmentHealthInfo struct { Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` EventNumber int32 `protobuf:"varint,5,opt,name=event_number,json=eventNumber,proto3" json:"event_number,omitempty"` SerializationVersion int32 `protobuf:"varint,6,opt,name=serialization_version,json=serializationVersion,proto3" json:"serialization_version,omitempty"` - IsFull bool `protobuf:"varint,7,opt,name=is_full,json=isFull,proto3" json:"is_full,omitempty"` + State string `protobuf:"bytes,7,opt,name=state,proto3" json:"state,omitempty"` Leader uint64 `protobuf:"varint,8,opt,name=leader,proto3" json:"leader,omitempty"` Term uint64 `protobuf:"varint,9,opt,name=term,proto3" json:"term,omitempty"` // Unix timestamp, unit is millisecond @@ -815,11 +815,11 @@ func (x *SegmentHealthInfo) GetSerializationVersion() int32 { return 0 } -func (x *SegmentHealthInfo) GetIsFull() bool { +func (x *SegmentHealthInfo) GetState() string { if x != nil { - return x.IsFull + return x.State } - return false + return "" } func (x *SegmentHealthInfo) GetLeader() uint64 { @@ -1837,7 +1837,7 @@ var file_meta_proto_rawDesc = []byte{ 0x79, 0x12, 0x2f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xf6, 0x02, 0x0a, 0x11, 0x53, 0x65, 0x67, 0x6d, 0x65, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xf3, 0x02, 0x0a, 0x11, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, @@ -1850,218 +1850,217 @@ var file_meta_proto_rawDesc = []byte{ 0x72, 0x12, 0x33, 0x0a, 0x15, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x66, 0x75, 0x6c, - 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x46, 0x75, 0x6c, 0x6c, 0x12, - 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x72, 0x6d, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x74, 0x65, 0x72, 0x6d, 0x12, 0x31, 0x0a, 0x15, 0x66, - 0x69, 0x72, 0x73, 0x74, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6f, 0x72, 0x6e, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x66, 0x69, 0x72, 0x73, - 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x72, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2f, - 0x0a, 0x14, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6f, 0x72, - 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x6c, 0x61, - 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x72, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, - 0xd7, 0x05, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x3e, - 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6c, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x72, 0x6d, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x04, 0x74, 0x65, 0x72, 0x6d, 0x12, 0x31, 0x0a, 0x15, 0x66, 0x69, 0x72, 0x73, + 0x74, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6f, 0x72, 0x6e, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x66, 0x69, 0x72, 0x73, 0x74, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x72, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x14, 0x6c, + 0x61, 0x73, 0x74, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6f, 0x72, 0x6e, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x72, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xd7, 0x05, 0x0a, + 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6c, 0x69, + 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, + 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x07, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, + 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, + 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x73, 0x69, 0x6e, 0x6b, 0x12, 0x4b, 0x0a, 0x0f, 0x73, 0x69, 0x6e, 0x6b, 0x5f, 0x63, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, - 0x65, 0x74, 0x61, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, - 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, - 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x6e, 0x6b, 0x12, 0x4b, 0x0a, 0x0f, 0x73, 0x69, 0x6e, 0x6b, - 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, - 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x69, 0x6e, 0x6b, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x0e, 0x73, 0x69, 0x6e, 0x6b, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x38, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, + 0x65, 0x74, 0x61, 0x2e, 0x53, 0x69, 0x6e, 0x6b, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x52, 0x0e, 0x73, 0x69, 0x6e, 0x6b, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x12, 0x38, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, + 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x50, 0x0a, 0x11, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, - 0x50, 0x0a, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x73, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6c, 0x69, 0x6e, - 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, - 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x75, 0x73, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x41, - 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, - 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, - 0x72, 0x6d, 0x65, 0x72, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, - 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, - 0x6c, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, - 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, - 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0f, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x64, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x38, 0x0a, 0x07, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x18, 0x65, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1e, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, - 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x07, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x22, 0xeb, 0x02, 0x0a, 0x0e, 0x53, 0x69, - 0x6e, 0x6b, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x5a, 0x0a, 0x0f, - 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, - 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x69, 0x6e, 0x6b, 0x43, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x70, 0x6c, 0x61, 0x69, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, - 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x6c, 0x61, - 0x69, 0x6e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x05, - 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x12, 0x36, 0x0a, 0x03, 0x61, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, - 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x41, 0x4b, 0x53, 0x4b, 0x43, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x03, 0x61, 0x77, 0x73, 0x12, 0x3e, 0x0a, - 0x06, 0x67, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1b, + 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x41, 0x0a, 0x0b, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, + 0x72, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x64, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x07, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x18, 0x65, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, - 0x74, 0x61, 0x2e, 0x47, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x06, 0x67, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x22, 0x3a, 0x0a, - 0x0e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x4c, 0x41, - 0x49, 0x4e, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x57, 0x53, 0x10, 0x02, 0x12, 0x0a, 0x0a, - 0x06, 0x47, 0x43, 0x4c, 0x4f, 0x55, 0x44, 0x10, 0x03, 0x42, 0x0c, 0x0a, 0x0a, 0x63, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x22, 0x49, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x69, 0x6e, - 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, - 0x63, 0x72, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, - 0x65, 0x74, 0x22, 0x60, 0x0a, 0x0e, 0x41, 0x4b, 0x53, 0x4b, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x12, 0x22, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, - 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x65, 0x63, 0x72, - 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x4b, 0x65, 0x79, 0x22, 0x3d, 0x0a, 0x10, 0x47, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x4a, - 0x73, 0x6f, 0x6e, 0x22, 0x99, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x4a, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, - 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x1a, 0x3a, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0xcf, 0x03, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x61, 0x74, 0x65, - 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x52, 0x0a, 0x0b, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x6c, 0x69, 0x6e, + 0x74, 0x61, 0x2e, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x22, 0xeb, 0x02, 0x0a, 0x0e, 0x53, 0x69, 0x6e, 0x6b, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x5a, 0x0a, 0x0f, 0x63, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, + 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x69, 0x6e, 0x6b, 0x43, 0x72, 0x65, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, + 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x05, 0x70, 0x6c, 0x61, + 0x69, 0x6e, 0x12, 0x36, 0x0a, 0x03, 0x61, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, + 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x41, 0x4b, 0x53, 0x4b, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x03, 0x61, 0x77, 0x73, 0x12, 0x3e, 0x0a, 0x06, 0x67, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, - 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2e, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x10, 0x6f, 0x66, 0x66, - 0x73, 0x65, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x65, 0x6c, - 0x69, 0x76, 0x65, 0x72, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x54, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x12, 0x31, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65, 0x74, 0x72, - 0x79, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, - 0x48, 0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x74, 0x72, 0x79, 0x41, 0x74, 0x74, 0x65, - 0x6d, 0x70, 0x74, 0x73, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x65, 0x61, 0x64, 0x5f, - 0x6c, 0x65, 0x74, 0x74, 0x65, 0x72, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x62, 0x75, 0x73, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x64, 0x65, 0x61, 0x64, 0x4c, 0x65, 0x74, 0x74, 0x65, - 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x62, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x72, 0x64, - 0x65, 0x72, 0x65, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0c, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x35, - 0x0a, 0x0a, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, - 0x4c, 0x41, 0x54, 0x45, 0x53, 0x54, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x41, 0x52, 0x4c, - 0x49, 0x45, 0x53, 0x54, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, - 0x41, 0x4d, 0x50, 0x10, 0x02, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x6d, - 0x61, 0x78, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, - 0x73, 0x22, 0xa3, 0x04, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x05, - 0x65, 0x78, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6c, 0x69, - 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, - 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x61, 0x63, 0x74, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x05, 0x65, 0x78, 0x61, 0x63, 0x74, 0x12, 0x3e, 0x0a, 0x06, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, - 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x75, 0x66, - 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, - 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x2c, 0x0a, 0x03, 0x6e, 0x6f, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, - 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x52, 0x03, 0x6e, 0x6f, 0x74, 0x12, 0x2c, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, - 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x2c, 0x0a, 0x03, 0x61, 0x6e, 0x79, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, - 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x03, - 0x61, 0x6e, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x71, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x73, 0x71, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x65, 0x6c, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x63, 0x65, 0x6c, 0x1a, 0x38, 0x0a, 0x0a, 0x45, 0x78, 0x61, 0x63, 0x74, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x47, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x48, 0x00, 0x52, 0x06, 0x67, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x22, 0x3a, 0x0a, 0x0e, 0x43, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, + 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x10, + 0x01, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x57, 0x53, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x43, + 0x4c, 0x4f, 0x55, 0x44, 0x10, 0x03, 0x42, 0x0c, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x61, 0x6c, 0x22, 0x49, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x43, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, + 0x60, 0x0a, 0x0e, 0x41, 0x4b, 0x53, 0x4b, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x12, 0x22, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x4b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, + 0x79, 0x22, 0x3d, 0x0a, 0x10, 0x47, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x4a, 0x73, 0x6f, 0x6e, + 0x22, 0x99, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x12, 0x4a, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, + 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x1a, 0x3a, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, - 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xcf, 0x03, 0x0a, + 0x12, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x12, 0x52, 0x0a, 0x0b, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, + 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x10, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, + 0x48, 0x00, 0x52, 0x0f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, + 0x72, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0f, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x12, 0x31, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x61, + 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, + 0x10, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x74, 0x72, 0x79, 0x41, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, + 0x73, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x65, 0x61, 0x64, 0x5f, 0x6c, 0x65, 0x74, + 0x74, 0x65, 0x72, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x62, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x12, 0x64, 0x65, 0x61, 0x64, 0x4c, 0x65, 0x74, 0x74, 0x65, 0x72, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x62, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, + 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x35, 0x0a, 0x0a, 0x4f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x41, 0x54, + 0x45, 0x53, 0x54, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x41, 0x52, 0x4c, 0x49, 0x45, 0x53, + 0x54, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, + 0x10, 0x02, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x6d, 0x61, 0x78, 0x5f, + 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x22, 0xa3, + 0x04, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x05, 0x65, 0x78, 0x61, + 0x63, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, + 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x61, 0x63, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x05, 0x65, 0x78, 0x61, 0x63, 0x74, 0x12, 0x3e, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, + 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x2e, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, + 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, + 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x2e, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, + 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x2c, 0x0a, 0x03, 0x6e, 0x6f, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, + 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, + 0x03, 0x6e, 0x6f, 0x74, 0x12, 0x2c, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, + 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x03, 0x61, + 0x6c, 0x6c, 0x12, 0x2c, 0x0a, 0x03, 0x61, 0x6e, 0x79, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, + 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x03, 0x61, 0x6e, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x73, 0x71, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, + 0x71, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x65, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x63, 0x65, 0x6c, 0x1a, 0x38, 0x0a, 0x0a, 0x45, 0x78, 0x61, 0x63, 0x74, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, + 0x0a, 0x0b, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x53, 0x75, 0x66, + 0x66, 0x69, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0x75, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x12, 0x38, 0x0a, 0x07, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, + 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x07, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x22, 0x46, 0x0a, 0x0a, 0x4f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, + 0x67, 0x49, 0x64, 0x22, 0xe1, 0x01, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, + 0x6d, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x06, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, + 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, + 0x72, 0x6d, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x06, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, + 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x08, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x1a, 0x39, 0x0a, 0x0b, + 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x75, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x27, 0x0a, 0x0f, 0x73, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x07, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, - 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x22, 0x46, - 0x0a, 0x0a, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x6f, - 0x67, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x4c, 0x6f, 0x67, 0x49, 0x64, 0x22, 0xe1, 0x01, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x06, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, - 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x06, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x70, 0x69, 0x70, 0x65, 0x6c, - 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, - 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x41, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x1a, - 0x39, 0x0a, 0x0b, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3a, 0x0a, 0x06, 0x41, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2a, 0x33, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x54, 0x69, 0x65, 0x72, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x45, 0x4d, 0x4f, 0x52, 0x59, 0x10, - 0x00, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x53, 0x44, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x48, 0x44, - 0x44, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x53, 0x33, 0x10, 0x03, 0x2a, 0x26, 0x0a, 0x11, 0x43, - 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, - 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x5a, - 0x34, 0x10, 0x01, 0x2a, 0x44, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, - 0x08, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x57, 0x53, - 0x5f, 0x4c, 0x41, 0x4d, 0x42, 0x44, 0x41, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x47, 0x43, 0x4c, - 0x4f, 0x55, 0x44, 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x10, 0x02, 0x12, - 0x08, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x10, 0x03, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2d, - 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3a, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x30, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x2a, 0x33, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x69, + 0x65, 0x72, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x45, 0x4d, 0x4f, 0x52, 0x59, 0x10, 0x00, 0x12, 0x07, + 0x0a, 0x03, 0x53, 0x53, 0x44, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x48, 0x44, 0x44, 0x10, 0x02, + 0x12, 0x06, 0x0a, 0x02, 0x53, 0x33, 0x10, 0x03, 0x2a, 0x26, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x08, 0x0a, + 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x5a, 0x34, 0x10, 0x01, + 0x2a, 0x44, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x08, 0x0a, 0x04, + 0x48, 0x54, 0x54, 0x50, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x57, 0x53, 0x5f, 0x4c, 0x41, + 0x4d, 0x42, 0x44, 0x41, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x47, 0x43, 0x4c, 0x4f, 0x55, 0x44, + 0x5f, 0x46, 0x55, 0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, + 0x47, 0x52, 0x50, 0x43, 0x10, 0x03, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2d, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x6b, + 0x67, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/proto/controller.proto b/proto/proto/controller.proto index f493b9ade..23cdba182 100644 --- a/proto/proto/controller.proto +++ b/proto/proto/controller.proto @@ -43,8 +43,8 @@ service EventBusController { service EventLogController { rpc ListSegment(ListSegmentRequest) returns (ListSegmentResponse); - rpc GetAppendableSegment(GetAppendableSegmentRequest) - returns (GetAppendableSegmentResponse); + rpc GetAppendableSegment(GetAppendableSegmentRequest) returns (GetAppendableSegmentResponse); + rpc GetReadableSegment(GetReadableSegmentRequest) returns (GetReadableSegmentResponse); } service SegmentController { @@ -59,7 +59,7 @@ service SegmentController { rpc ReportSegmentBlockIsFull(SegmentHeartbeatRequest) returns (google.protobuf.Empty); rpc ReportSegmentLeader(ReportSegmentLeaderRequest) - returns (google.protobuf.Empty); + returns (linkall.vanus.meta.Segment); } service TriggerController { @@ -270,3 +270,13 @@ message GetAppendableSegmentRequest { message GetAppendableSegmentResponse { repeated linkall.vanus.meta.Segment segments = 3; } + +message GetReadableSegmentRequest { + uint64 event_bus_id = 1; + uint64 event_log_id = 2; + int32 limited = 3; +} + +message GetReadableSegmentResponse { + repeated linkall.vanus.meta.Segment segments = 3; +} \ No newline at end of file diff --git a/proto/proto/meta.proto b/proto/proto/meta.proto index da725e2c4..ba683f3cd 100644 --- a/proto/proto/meta.proto +++ b/proto/proto/meta.proto @@ -72,7 +72,7 @@ message SegmentHealthInfo { int64 size = 4; int32 event_number = 5; int32 serialization_version = 6; - bool is_full = 7; + string state = 7; uint64 leader = 8; uint64 term = 9; // Unix timestamp, unit is millisecond diff --git a/test/e2e/read/main.go b/test/e2e/read/main.go deleted file mode 100644 index b34df20c6..000000000 --- a/test/e2e/read/main.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Linkall Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - // standard libraries. - "context" - "fmt" - - // first-party libraris. - "github.com/linkall-labs/vanus/client" -) - -func main() { - ctx := context.Background() - vrn := fmt.Sprintf("vanus://%s/eventlog/%s?namespace=vanus", "127.0.0.1:2048", "df5aff09-9242-4b47-b9df-cf07c5868e3a") - r, err := client.OpenLogReader(ctx, vrn) - if err != nil { - panic(err) - } - _, _ = r.Seek(ctx, 20, 0) - es, er := r.Read(ctx, 100) - if err != nil { - panic(er) - } - for i, v := range es { - println(i, string(v.Data())) - } -}