From e27cc9891263a87c4e02ef5fa71d80a5b4d79397 Mon Sep 17 00:00:00 2001 From: Andrew Putilov Date: Mon, 29 Jun 2020 22:19:41 +0300 Subject: [PATCH] Grpc plugin archive storage support Signed-off-by: Andrew Putilov --- examples/memstore-plugin/main.go | 9 + plugin/storage/grpc/README.md | 2 + plugin/storage/grpc/archive.go | 63 ++ plugin/storage/grpc/archive_test.go | 88 +++ plugin/storage/grpc/factory.go | 20 + plugin/storage/grpc/factory_test.go | 65 +- plugin/storage/grpc/options.go | 1 - plugin/storage/grpc/options_test.go | 3 +- plugin/storage/grpc/proto/storage.proto | 20 + plugin/storage/grpc/shared/grpc_client.go | 93 ++- .../storage/grpc/shared/grpc_client_test.go | 159 ++++- plugin/storage/grpc/shared/grpc_server.go | 31 + .../storage/grpc/shared/grpc_server_test.go | 133 +++- plugin/storage/grpc/shared/interface.go | 24 +- .../grpc/shared/mocks/ArchiveReader.go | 74 +++ .../grpc/shared/mocks/ArchiveWriter.go | 42 ++ .../mocks/ArchiveSpanReaderPluginClient.go | 78 +++ .../mocks/ArchiveSpanReaderPluginServer.go | 52 ++ ...eSpanReaderPlugin_GetArchiveTraceClient.go | 137 ++++ ...eSpanReaderPlugin_GetArchiveTraceServer.go | 108 +++ .../mocks/ArchiveSpanWriterPluginClient.go | 48 ++ .../mocks/ArchiveSpanWriterPluginServer.go | 38 ++ proto-gen/storage_v1/storage.pb.go | 619 ++++++++++++++++-- 23 files changed, 1802 insertions(+), 105 deletions(-) create mode 100644 plugin/storage/grpc/archive.go create mode 100644 plugin/storage/grpc/archive_test.go create mode 100644 plugin/storage/grpc/shared/mocks/ArchiveReader.go create mode 100644 plugin/storage/grpc/shared/mocks/ArchiveWriter.go create mode 100644 proto-gen/storage_v1/mocks/ArchiveSpanReaderPluginClient.go create mode 100644 proto-gen/storage_v1/mocks/ArchiveSpanReaderPluginServer.go create mode 100644 proto-gen/storage_v1/mocks/ArchiveSpanReaderPlugin_GetArchiveTraceClient.go create mode 100644 proto-gen/storage_v1/mocks/ArchiveSpanReaderPlugin_GetArchiveTraceServer.go create mode 100644 proto-gen/storage_v1/mocks/ArchiveSpanWriterPluginClient.go create mode 100644 proto-gen/storage_v1/mocks/ArchiveSpanWriterPluginServer.go diff --git a/examples/memstore-plugin/main.go b/examples/memstore-plugin/main.go index 494e78545ad..d15fffdf2aa 100644 --- a/examples/memstore-plugin/main.go +++ b/examples/memstore-plugin/main.go @@ -22,6 +22,7 @@ import ( "github.com/spf13/viper" "github.com/jaegertracing/jaeger/plugin/storage/grpc" + "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" "github.com/jaegertracing/jaeger/plugin/storage/memory" "github.com/jaegertracing/jaeger/storage/dependencystore" "github.com/jaegertracing/jaeger/storage/spanstore" @@ -52,6 +53,14 @@ type memoryStore struct { store *memory.Store } +func (ns *memoryStore) ArchiveSpanReader() shared.ArchiveReader { + return nil +} + +func (ns *memoryStore) ArchiveSpanWriter() shared.ArchiveWriter { + return nil +} + func (ns *memoryStore) DependencyReader() dependencystore.Reader { return ns.store } diff --git a/plugin/storage/grpc/README.md b/plugin/storage/grpc/README.md index fd8fd5da5a5..68e590614ed 100644 --- a/plugin/storage/grpc/README.md +++ b/plugin/storage/grpc/README.md @@ -62,6 +62,8 @@ A plugin must implement the StoragePlugin interface of: type StoragePlugin interface { SpanReader() spanstore.Reader SpanWriter() spanstore.Writer + ArchiveSpanReader() shared.ArchiveReader + ArchiveSpanWriter() shared.ArchiveWriter DependencyReader() dependencystore.Reader } ``` diff --git a/plugin/storage/grpc/archive.go b/plugin/storage/grpc/archive.go new file mode 100644 index 00000000000..af70cadccda --- /dev/null +++ b/plugin/storage/grpc/archive.go @@ -0,0 +1,63 @@ +// Copyright (c) 2020 The Jaeger Authors. +// +// 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 grpc + +import ( + "context" + + "github.com/jaegertracing/jaeger/model" + "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" + "github.com/jaegertracing/jaeger/storage/spanstore" +) + +// ArchiveWriter implements spanstore.Writer +type ArchiveWriter struct { + impl shared.ArchiveWriter +} + +// WriteSpan saves the span +func (w *ArchiveWriter) WriteSpan(span *model.Span) error { + return w.impl.WriteArchiveSpan(span) +} + +// ArchiveReader implements spanstore.Reader +type ArchiveReader struct { + impl shared.ArchiveReader +} + +// GetTrace takes a traceID and returns a Trace associated with that traceID +func (r *ArchiveReader) GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error) { + return r.impl.GetArchiveTrace(ctx, traceID) +} + +// GetServices is not used by archive storage +func (r *ArchiveReader) GetServices(ctx context.Context) ([]string, error) { + panic("not implemented") +} + +// GetOperations is not used by archive storage +func (r *ArchiveReader) GetOperations(ctx context.Context, query spanstore.OperationQueryParameters) ([]spanstore.Operation, error) { + panic("not implemented") +} + +// FindTraces is not used by archive storage +func (r *ArchiveReader) FindTraces(ctx context.Context, query *spanstore.TraceQueryParameters) ([]*model.Trace, error) { + panic("not implemented") +} + +// FindTraceIDs is not used by archive storage +func (r *ArchiveReader) FindTraceIDs(ctx context.Context, query *spanstore.TraceQueryParameters) ([]model.TraceID, error) { + panic("not implemented") +} diff --git a/plugin/storage/grpc/archive_test.go b/plugin/storage/grpc/archive_test.go new file mode 100644 index 00000000000..df040c8dc79 --- /dev/null +++ b/plugin/storage/grpc/archive_test.go @@ -0,0 +1,88 @@ +// Copyright (c) 2020 The Jaeger Authors. +// +// 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 grpc + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + "github.com/jaegertracing/jaeger/model" + "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared/mocks" + "github.com/jaegertracing/jaeger/storage/spanstore" +) + +var ( + mockTraceID = model.NewTraceID(0, 123456) + mockSpan = &model.Span{ + TraceID: mockTraceID, + SpanID: model.NewSpanID(1), + Process: &model.Process{}, + } +) + +func TestArchiveWriter_WriteSpan(t *testing.T) { + archiveWriter := new(mocks.ArchiveWriter) + archiveWriter.On("WriteArchiveSpan", mockSpan).Return(nil) + writer := &ArchiveWriter{impl: archiveWriter} + + err := writer.WriteSpan(mockSpan) + assert.NoError(t, err) +} + +func TestArchiveReader_GetTrace(t *testing.T) { + expected := &model.Trace{ + Spans: []*model.Span{ + mockSpan, + }, + } + archiveReader := new(mocks.ArchiveReader) + archiveReader.On("GetArchiveTrace", mock.Anything, mockTraceID).Return(expected, nil) + reader := &ArchiveReader{impl: archiveReader} + + trace, err := reader.GetTrace(context.Background(), mockTraceID) + assert.NoError(t, err) + assert.Equal(t, expected, trace) +} + +func TestArchiveReader_FindTraceIDs(t *testing.T) { + assert.Panics(t, func() { + reader := ArchiveReader{impl: &mocks.ArchiveReader{}} + _, _ = reader.FindTraceIDs(context.Background(), nil) + }) +} + +func TestArchiveReader_FindTraces(t *testing.T) { + assert.Panics(t, func() { + reader := ArchiveReader{impl: &mocks.ArchiveReader{}} + _, _ = reader.FindTraces(context.Background(), nil) + }) +} + +func TestArchiveReader_GetOperations(t *testing.T) { + assert.Panics(t, func() { + reader := ArchiveReader{impl: &mocks.ArchiveReader{}} + _, _ = reader.GetOperations(context.Background(), spanstore.OperationQueryParameters{}) + }) +} + +func TestArchiveReader_GetServices(t *testing.T) { + assert.Panics(t, func() { + reader := ArchiveReader{impl: &mocks.ArchiveReader{}} + _, _ = reader.GetServices(context.Background()) + }) +} diff --git a/plugin/storage/grpc/factory.go b/plugin/storage/grpc/factory.go index f69907f0d61..172db01ab55 100644 --- a/plugin/storage/grpc/factory.go +++ b/plugin/storage/grpc/factory.go @@ -15,6 +15,7 @@ package grpc import ( + "context" "flag" "github.com/spf13/viper" @@ -23,6 +24,7 @@ import ( "github.com/jaegertracing/jaeger/plugin/storage/grpc/config" "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" + "github.com/jaegertracing/jaeger/storage" "github.com/jaegertracing/jaeger/storage/dependencystore" "github.com/jaegertracing/jaeger/storage/spanstore" ) @@ -88,3 +90,21 @@ func (f *Factory) CreateSpanWriter() (spanstore.Writer, error) { func (f *Factory) CreateDependencyReader() (dependencystore.Reader, error) { return f.store.DependencyReader(), nil } + +// CreateArchiveSpanReader implements storage.ArchiveFactory +func (f *Factory) CreateArchiveSpanReader() (spanstore.Reader, error) { + supported, _ := f.store.ArchiveSpanReader().ArchiveSupported(context.Background()) + if !supported { + return nil, storage.ErrArchiveStorageNotSupported + } + return &ArchiveReader{impl: f.store.ArchiveSpanReader()}, nil +} + +// CreateArchiveSpanWriter implements storage.ArchiveFactory +func (f *Factory) CreateArchiveSpanWriter() (spanstore.Writer, error) { + supported, _ := f.store.ArchiveSpanReader().ArchiveSupported(context.Background()) + if !supported { + return nil, storage.ErrArchiveStorageNotSupported + } + return &ArchiveWriter{impl: f.store.ArchiveSpanWriter()}, nil +} diff --git a/plugin/storage/grpc/factory_test.go b/plugin/storage/grpc/factory_test.go index c780847d4da..23de4d2d6ad 100644 --- a/plugin/storage/grpc/factory_test.go +++ b/plugin/storage/grpc/factory_test.go @@ -20,12 +20,14 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/uber/jaeger-lib/metrics" "go.uber.org/zap" "github.com/jaegertracing/jaeger/pkg/config" grpcConfig "github.com/jaegertracing/jaeger/plugin/storage/grpc/config" "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" + "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared/mocks" "github.com/jaegertracing/jaeger/storage" "github.com/jaegertracing/jaeger/storage/dependencystore" dependencyStoreMocks "github.com/jaegertracing/jaeger/storage/dependencystore/mocks" @@ -50,9 +52,19 @@ func (b *mockPluginBuilder) Build() (shared.StoragePlugin, error) { type mockPlugin struct { spanReader spanstore.Reader spanWriter spanstore.Writer + archiveReader shared.ArchiveReader + archiveWriter shared.ArchiveWriter dependencyReader dependencystore.Reader } +func (mp *mockPlugin) ArchiveSpanReader() shared.ArchiveReader { + return mp.archiveReader +} + +func (mp *mockPlugin) ArchiveSpanWriter() shared.ArchiveWriter { + return mp.archiveWriter +} + func (mp *mockPlugin) SpanReader() spanstore.Reader { return mp.spanReader } @@ -81,6 +93,8 @@ func TestGRPCStorageFactory(t *testing.T) { plugin: &mockPlugin{ spanWriter: new(spanStoreMocks.Writer), spanReader: new(spanStoreMocks.Reader), + archiveReader: new(mocks.ArchiveReader), + archiveWriter: new(mocks.ArchiveWriter), dependencyReader: new(dependencyStoreMocks.Reader), }, } @@ -98,14 +112,63 @@ func TestGRPCStorageFactory(t *testing.T) { assert.Equal(t, f.store.DependencyReader(), depReader) } +func TestGRPCArchiveStorageFactory(t *testing.T) { + f := NewFactory() + v := viper.New() + f.InitFromViper(v) + + archiveReader := new(mocks.ArchiveReader) + archiveReader.On("ArchiveSupported", mock.Anything). + Return(true, nil) + f.builder = &mockPluginBuilder{ + plugin: &mockPlugin{ + archiveReader: archiveReader, + }, + } + assert.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) + + assert.NotNil(t, f.store) + reader, err := f.CreateArchiveSpanReader() + assert.NoError(t, err) + assert.IsType(t, &ArchiveReader{}, reader) + writer, err := f.CreateArchiveSpanWriter() + assert.NoError(t, err) + assert.IsType(t, &ArchiveWriter{}, writer) +} + +func TestGRPCArchiveStorageDisabledFactory(t *testing.T) { + f := NewFactory() + v := viper.New() + f.InitFromViper(v) + + archiveReader := new(mocks.ArchiveReader) + archiveReader.On("ArchiveSupported", mock.Anything). + Return(false, nil) + f.builder = &mockPluginBuilder{ + plugin: &mockPlugin{ + archiveReader: archiveReader, + }, + } + assert.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop())) + + assert.NotNil(t, f.store) + reader, err := f.CreateArchiveSpanReader() + assert.EqualError(t, err, storage.ErrArchiveStorageNotSupported.Error()) + assert.Nil(t, reader) + writer, err := f.CreateArchiveSpanWriter() + assert.EqualError(t, err, storage.ErrArchiveStorageNotSupported.Error()) + assert.Nil(t, writer) +} + func TestWithConfiguration(t *testing.T) { f := NewFactory() v, command := config.Viperize(f.AddFlags) - command.ParseFlags([]string{ + err := command.ParseFlags([]string{ "--grpc-storage-plugin.binary=noop-grpc-plugin", "--grpc-storage-plugin.configuration-file=config.json", "--grpc-storage-plugin.log-level=debug", }) + assert.NoError(t, err) f.InitFromViper(v) assert.Equal(t, f.options.Configuration.PluginBinary, "noop-grpc-plugin") assert.Equal(t, f.options.Configuration.PluginConfigurationFile, "config.json") diff --git a/plugin/storage/grpc/options.go b/plugin/storage/grpc/options.go index b5c6d6f805a..7938a9dde9c 100644 --- a/plugin/storage/grpc/options.go +++ b/plugin/storage/grpc/options.go @@ -47,5 +47,4 @@ func (opt *Options) InitFromViper(v *viper.Viper) { opt.Configuration.PluginBinary = v.GetString(pluginBinary) opt.Configuration.PluginConfigurationFile = v.GetString(pluginConfigurationFile) opt.Configuration.PluginLogLevel = v.GetString(pluginLogLevel) - } diff --git a/plugin/storage/grpc/options_test.go b/plugin/storage/grpc/options_test.go index be0e3611b67..5e563c5c15c 100644 --- a/plugin/storage/grpc/options_test.go +++ b/plugin/storage/grpc/options_test.go @@ -25,11 +25,12 @@ import ( func TestOptionsWithFlags(t *testing.T) { opts := &Options{} v, command := config.Viperize(opts.AddFlags) - command.ParseFlags([]string{ + err := command.ParseFlags([]string{ "--grpc-storage-plugin.binary=noop-grpc-plugin", "--grpc-storage-plugin.configuration-file=config.json", "--grpc-storage-plugin.log-level=debug", }) + assert.NoError(t, err) opts.InitFromViper(v) assert.Equal(t, opts.Configuration.PluginBinary, "noop-grpc-plugin") diff --git a/plugin/storage/grpc/proto/storage.proto b/plugin/storage/grpc/proto/storage.proto index bd85d263948..9b4cef35baa 100644 --- a/plugin/storage/grpc/proto/storage.proto +++ b/plugin/storage/grpc/proto/storage.proto @@ -134,6 +134,15 @@ message FindTraceIDsResponse { ]; } +// empty; extensible in the future +message ArchiveSupportedRequest { + +} + +message ArchiveSupportedResponse { + bool supported = 1; +} + service SpanWriterPlugin { // spanstore/Writer rpc WriteSpan(WriteSpanRequest) returns (WriteSpanResponse); @@ -148,6 +157,17 @@ service SpanReaderPlugin { rpc FindTraceIDs(FindTraceIDsRequest) returns (FindTraceIDsResponse); } +service ArchiveSpanWriterPlugin { + // spanstore/Writer + rpc WriteArchiveSpan(WriteSpanRequest) returns (WriteSpanResponse); +} + +service ArchiveSpanReaderPlugin { + // spanstore/Reader + rpc GetArchiveTrace(GetTraceRequest) returns (stream SpansResponseChunk); + rpc ArchiveSupported(ArchiveSupportedRequest) returns (ArchiveSupportedResponse); +} + service DependenciesReaderPlugin { // dependencystore/Reader rpc GetDependencies(GetDependenciesRequest) returns (GetDependenciesResponse); diff --git a/plugin/storage/grpc/shared/grpc_client.go b/plugin/storage/grpc/shared/grpc_client.go index 8f84ded370c..8b156dbbe7c 100644 --- a/plugin/storage/grpc/shared/grpc_client.go +++ b/plugin/storage/grpc/shared/grpc_client.go @@ -20,6 +20,7 @@ import ( "io" "time" + "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" @@ -31,9 +32,11 @@ import ( // grpcClient implements shared.StoragePlugin and reads/writes spans and dependencies type grpcClient struct { - readerClient storage_v1.SpanReaderPluginClient - writerClient storage_v1.SpanWriterPluginClient - depsReaderClient storage_v1.DependenciesReaderPluginClient + readerClient storage_v1.SpanReaderPluginClient + writerClient storage_v1.SpanWriterPluginClient + archiveReaderClient storage_v1.ArchiveSpanReaderPluginClient + archiveWriterClient storage_v1.ArchiveSpanWriterPluginClient + depsReaderClient storage_v1.DependenciesReaderPluginClient } // upgradeContextWithBearerToken turns the context into a gRPC outgoing context with bearer token @@ -65,6 +68,14 @@ func (c *grpcClient) SpanWriter() spanstore.Writer { return c } +func (c *grpcClient) ArchiveSpanReader() ArchiveReader { + return c +} + +func (c *grpcClient) ArchiveSpanWriter() ArchiveWriter { + return c +} + // GetTrace takes a traceID and returns a Trace associated with that traceID func (c *grpcClient) GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error) { stream, err := c.readerClient.GetTrace(upgradeContextWithBearerToken(ctx), &storage_v1.GetTraceRequest{ @@ -74,23 +85,7 @@ func (c *grpcClient) GetTrace(ctx context.Context, traceID model.TraceID) (*mode return nil, fmt.Errorf("plugin error: %w", err) } - trace := model.Trace{} - for received, err := stream.Recv(); err != io.EOF; received, err = stream.Recv() { - if err != nil { - if e, ok := status.FromError(err); !ok { - if e.Message() == spanstore.ErrTraceNotFound.Error() { - return nil, spanstore.ErrTraceNotFound - } - } - return nil, fmt.Errorf("grpc stream error: %w", err) - } - - for i := range received.Spans { - trace.Spans = append(trace.Spans, &received.Spans[i]) - } - } - - return &trace, nil + return readTrace(stream) } // GetServices returns a list of all known services @@ -153,8 +148,8 @@ func (c *grpcClient) FindTraces(ctx context.Context, query *spanstore.TraceQuery } var traces []*model.Trace - var trace *model.Trace var traceID model.TraceID + trace := &model.Trace{} for received, err := stream.Recv(); err != io.EOF; received, err = stream.Recv() { if err != nil { return nil, fmt.Errorf("stream error: %w", err) @@ -217,3 +212,59 @@ func (c *grpcClient) GetDependencies(endTs time.Time, lookback time.Duration) ([ return resp.Dependencies, nil } + +// WriteArchiveSpan saves the span in archive storage +func (c *grpcClient) WriteArchiveSpan(span *model.Span) error { + _, err := c.archiveWriterClient.WriteArchiveSpan(context.Background(), &storage_v1.WriteSpanRequest{ + Span: span, + }) + if err != nil { + return fmt.Errorf("plugin error: %w", err) + } + + return nil +} + +// GetArchiveTrace takes a traceID and returns a Trace associated with that traceID from archive storage +func (c *grpcClient) GetArchiveTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error) { + stream, err := c.archiveReaderClient.GetArchiveTrace(upgradeContextWithBearerToken(ctx), &storage_v1.GetTraceRequest{ + TraceID: traceID, + }) + if err != nil { + return nil, fmt.Errorf("plugin error: %w", err) + } + + return readTrace(stream) +} + +func readTrace(stream storage_v1.SpanReaderPlugin_GetTraceClient) (*model.Trace, error) { + trace := model.Trace{} + for received, err := stream.Recv(); err != io.EOF; received, err = stream.Recv() { + if err != nil { + if e, ok := status.FromError(err); !ok { + if e.Message() == spanstore.ErrTraceNotFound.Error() { + return nil, spanstore.ErrTraceNotFound + } + } + return nil, fmt.Errorf("grpc stream error: %w", err) + } + + for i := range received.Spans { + trace.Spans = append(trace.Spans, &received.Spans[i]) + } + } + + return &trace, nil +} + +func (c *grpcClient) ArchiveSupported(ctx context.Context) (bool, error) { + response, err := c.archiveReaderClient.ArchiveSupported(ctx, &storage_v1.ArchiveSupportedRequest{}) + if status.Code(err) == codes.Unimplemented { + return false, nil + } + if err != nil { + return false, fmt.Errorf("plugin error: %w", err) + } + + return response.Supported, nil +} diff --git a/plugin/storage/grpc/shared/grpc_client_test.go b/plugin/storage/grpc/shared/grpc_client_test.go index e31c9530a56..23f944fa812 100644 --- a/plugin/storage/grpc/shared/grpc_client_test.go +++ b/plugin/storage/grpc/shared/grpc_client_test.go @@ -23,7 +23,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" "github.com/jaegertracing/jaeger/model" "github.com/jaegertracing/jaeger/proto-gen/storage_v1" @@ -68,26 +70,34 @@ var ( ) type grpcClientTest struct { - client *grpcClient - spanReader *grpcMocks.SpanReaderPluginClient - spanWriter *grpcMocks.SpanWriterPluginClient - depsReader *grpcMocks.DependenciesReaderPluginClient + client *grpcClient + spanReader *grpcMocks.SpanReaderPluginClient + spanWriter *grpcMocks.SpanWriterPluginClient + archiveReader *grpcMocks.ArchiveSpanReaderPluginClient + archiveWriter *grpcMocks.ArchiveSpanWriterPluginClient + depsReader *grpcMocks.DependenciesReaderPluginClient } func withGRPCClient(fn func(r *grpcClientTest)) { spanReader := new(grpcMocks.SpanReaderPluginClient) + archiveReader := new(grpcMocks.ArchiveSpanReaderPluginClient) spanWriter := new(grpcMocks.SpanWriterPluginClient) + archiveWriter := new(grpcMocks.ArchiveSpanWriterPluginClient) depReader := new(grpcMocks.DependenciesReaderPluginClient) r := &grpcClientTest{ client: &grpcClient{ - readerClient: spanReader, - writerClient: spanWriter, - depsReaderClient: depReader, + readerClient: spanReader, + writerClient: spanWriter, + archiveReaderClient: archiveReader, + archiveWriterClient: archiveWriter, + depsReaderClient: depReader, }, - spanReader: spanReader, - spanWriter: spanWriter, - depsReader: depReader, + spanReader: spanReader, + spanWriter: spanWriter, + archiveReader: archiveReader, + archiveWriter: archiveWriter, + depsReader: depReader, } fn(r) } @@ -302,3 +312,132 @@ func TestGRPCClientGetDependencies(t *testing.T) { assert.Equal(t, deps, s) }) } + +func TestGrpcClientWriteArchiveSpan(t *testing.T) { + withGRPCClient(func(r *grpcClientTest) { + r.archiveWriter.On("WriteArchiveSpan", mock.Anything, &storage_v1.WriteSpanRequest{ + Span: &mockTraceSpans[0], + }).Return(&storage_v1.WriteSpanResponse{}, nil) + + err := r.client.WriteArchiveSpan(&mockTraceSpans[0]) + assert.NoError(t, err) + }) +} + +func TestGrpcClientWriteArchiveSpan_Error(t *testing.T) { + withGRPCClient(func(r *grpcClientTest) { + r.archiveWriter.On("WriteArchiveSpan", mock.Anything, &storage_v1.WriteSpanRequest{ + Span: &mockTraceSpans[0], + }).Return(nil, status.Error(codes.Internal, "internal error")) + + err := r.client.WriteArchiveSpan(&mockTraceSpans[0]) + assert.Error(t, err) + }) +} + +func TestGrpcClientGetArchiveTrace(t *testing.T) { + withGRPCClient(func(r *grpcClientTest) { + traceClient := new(grpcMocks.ArchiveSpanReaderPlugin_GetArchiveTraceClient) + traceClient.On("Recv").Return(&storage_v1.SpansResponseChunk{ + Spans: mockTraceSpans, + }, nil).Once() + traceClient.On("Recv").Return(nil, io.EOF) + r.archiveReader.On("GetArchiveTrace", mock.Anything, &storage_v1.GetTraceRequest{ + TraceID: mockTraceID, + }).Return(traceClient, nil) + + var expectedSpans []*model.Span + for i := range mockTraceSpans { + expectedSpans = append(expectedSpans, &mockTraceSpans[i]) + } + + s, err := r.client.GetArchiveTrace(context.Background(), mockTraceID) + assert.NoError(t, err) + assert.Equal(t, &model.Trace{ + Spans: expectedSpans, + }, s) + }) +} + +func TestGrpcClientGetArchiveTrace_StreamError(t *testing.T) { + withGRPCClient(func(r *grpcClientTest) { + traceClient := new(grpcMocks.ArchiveSpanReaderPlugin_GetArchiveTraceClient) + traceClient.On("Recv").Return(nil, errors.New("an error")) + r.archiveReader.On("GetArchiveTrace", mock.Anything, &storage_v1.GetTraceRequest{ + TraceID: mockTraceID, + }).Return(traceClient, nil) + + s, err := r.client.GetArchiveTrace(context.Background(), mockTraceID) + assert.Error(t, err) + assert.Nil(t, s) + }) +} + +func TestGrpcClientGetArchiveTrace_NoTrace(t *testing.T) { + withGRPCClient(func(r *grpcClientTest) { + r.archiveReader.On("GetArchiveTrace", mock.Anything, &storage_v1.GetTraceRequest{ + TraceID: mockTraceID, + }).Return(nil, spanstore.ErrTraceNotFound) + + s, err := r.client.GetArchiveTrace(context.Background(), mockTraceID) + assert.Error(t, err) + assert.Nil(t, s) + }) +} + +func TestGrpcClientGetArchiveTrace_StreamErrorTraceNotFound(t *testing.T) { + withGRPCClient(func(r *grpcClientTest) { + traceClient := new(grpcMocks.ArchiveSpanReaderPlugin_GetArchiveTraceClient) + traceClient.On("Recv").Return(nil, spanstore.ErrTraceNotFound) + r.archiveReader.On("GetArchiveTrace", mock.Anything, &storage_v1.GetTraceRequest{ + TraceID: mockTraceID, + }).Return(traceClient, nil) + + s, err := r.client.GetArchiveTrace(context.Background(), mockTraceID) + assert.Equal(t, spanstore.ErrTraceNotFound, err) + assert.Nil(t, s) + }) +} + +func TestGrpcClientArchiveSupported(t *testing.T) { + withGRPCClient(func(r *grpcClientTest) { + r.archiveReader.On("ArchiveSupported", mock.Anything, &storage_v1.ArchiveSupportedRequest{}). + Return(&storage_v1.ArchiveSupportedResponse{Supported: true}, nil) + + supported, err := r.client.ArchiveSupported(context.Background()) + assert.NoError(t, err) + assert.True(t, supported) + }) +} + +func TestGrpcClientArchiveNotSupported(t *testing.T) { + withGRPCClient(func(r *grpcClientTest) { + r.archiveReader.On("ArchiveSupported", mock.Anything, &storage_v1.ArchiveSupportedRequest{}). + Return(&storage_v1.ArchiveSupportedResponse{Supported: false}, nil) + + supported, err := r.client.ArchiveSupported(context.Background()) + assert.NoError(t, err) + assert.False(t, supported) + }) +} + +func TestGrpcClientArchiveSupported_MissingMethod(t *testing.T) { + withGRPCClient(func(r *grpcClientTest) { + r.archiveReader.On("ArchiveSupported", mock.Anything, &storage_v1.ArchiveSupportedRequest{}). + Return(nil, status.Error(codes.Unimplemented, "method not found")) + + supported, err := r.client.ArchiveSupported(context.Background()) + assert.NoError(t, err) + assert.False(t, supported) + }) +} + +func TestGrpcClientArchiveSupported_CommonGrpcError(t *testing.T) { + withGRPCClient(func(r *grpcClientTest) { + r.archiveReader.On("ArchiveSupported", mock.Anything, &storage_v1.ArchiveSupportedRequest{}). + Return(nil, status.Error(codes.Internal, "internal error")) + + _, err := r.client.ArchiveSupported(context.Background()) + assert.Error(t, err) + }) +} diff --git a/plugin/storage/grpc/shared/grpc_server.go b/plugin/storage/grpc/shared/grpc_server.go index b4137b15e88..661c79f50ce 100644 --- a/plugin/storage/grpc/shared/grpc_server.go +++ b/plugin/storage/grpc/shared/grpc_server.go @@ -160,3 +160,34 @@ func (s *grpcServer) sendSpans(spans []*model.Span, sendFn func(*storage_v1.Span return nil } + +func (s *grpcServer) ArchiveSupported(ctx context.Context, request *storage_v1.ArchiveSupportedRequest) (*storage_v1.ArchiveSupportedResponse, error) { + supported, err := s.Impl.ArchiveSpanReader().ArchiveSupported(ctx) + if err != nil { + return nil, err + } + + return &storage_v1.ArchiveSupportedResponse{Supported: supported}, nil +} + +func (s *grpcServer) GetArchiveTrace(r *storage_v1.GetTraceRequest, stream storage_v1.ArchiveSpanReaderPlugin_GetArchiveTraceServer) error { + trace, err := s.Impl.ArchiveSpanReader().GetArchiveTrace(stream.Context(), r.TraceID) + if err != nil { + return err + } + + err = s.sendSpans(trace.Spans, stream.Send) + if err != nil { + return err + } + + return nil +} + +func (s *grpcServer) WriteArchiveSpan(ctx context.Context, r *storage_v1.WriteSpanRequest) (*storage_v1.WriteSpanResponse, error) { + err := s.Impl.ArchiveSpanWriter().WriteArchiveSpan(r.Span) + if err != nil { + return nil, err + } + return &storage_v1.WriteSpanResponse{}, nil +} diff --git a/plugin/storage/grpc/shared/grpc_server_test.go b/plugin/storage/grpc/shared/grpc_server_test.go index 59fe23ee161..167adaed95a 100644 --- a/plugin/storage/grpc/shared/grpc_server_test.go +++ b/plugin/storage/grpc/shared/grpc_server_test.go @@ -16,6 +16,7 @@ package shared import ( "context" + "fmt" "testing" "time" @@ -23,6 +24,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/jaegertracing/jaeger/model" + "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared/mocks" "github.com/jaegertracing/jaeger/proto-gen/storage_v1" grpcMocks "github.com/jaegertracing/jaeger/proto-gen/storage_v1/mocks" "github.com/jaegertracing/jaeger/storage/dependencystore" @@ -32,9 +34,19 @@ import ( ) type mockStoragePlugin struct { - spanReader *spanStoreMocks.Reader - spanWriter *spanStoreMocks.Writer - depsReader *dependencyStoreMocks.Reader + spanReader *spanStoreMocks.Reader + spanWriter *spanStoreMocks.Writer + archiveReader *mocks.ArchiveReader + archiveWriter *mocks.ArchiveWriter + depsReader *dependencyStoreMocks.Reader +} + +func (plugin *mockStoragePlugin) ArchiveSpanReader() ArchiveReader { + return plugin.archiveReader +} + +func (plugin *mockStoragePlugin) ArchiveSpanWriter() ArchiveWriter { + return plugin.archiveWriter } func (plugin *mockStoragePlugin) SpanReader() spanstore.Reader { @@ -57,12 +69,16 @@ type grpcServerTest struct { func withGRPCServer(fn func(r *grpcServerTest)) { spanReader := new(spanStoreMocks.Reader) spanWriter := new(spanStoreMocks.Writer) + archiveReader := new(mocks.ArchiveReader) + archiveWriter := new(mocks.ArchiveWriter) depReader := new(dependencyStoreMocks.Reader) impl := &mockStoragePlugin{ - spanWriter: spanWriter, - spanReader: spanReader, - depsReader: depReader, + spanReader: spanReader, + spanWriter: spanWriter, + archiveReader: archiveReader, + archiveWriter: archiveWriter, + depsReader: depReader, } r := &grpcServerTest{ @@ -142,7 +158,7 @@ func TestGRPCServerFindTraces(t *testing.T) { var traces []*model.Trace var traceID model.TraceID - var trace *model.Trace + trace := &model.Trace{} for i, span := range mockTracesSpans { if span.TraceID != traceID { trace = &model.Trace{} @@ -209,3 +225,106 @@ func TestGRPCServerGetDependencies(t *testing.T) { assert.Equal(t, &storage_v1.GetDependenciesResponse{Dependencies: deps}, s) }) } + +func TestGRPCServerGetArchiveTrace(t *testing.T) { + withGRPCServer(func(r *grpcServerTest) { + traceSteam := new(grpcMocks.SpanReaderPlugin_GetTraceServer) + traceSteam.On("Context").Return(context.Background()) + traceSteam.On("Send", &storage_v1.SpansResponseChunk{Spans: mockTraceSpans}). + Return(nil) + + var traceSpans []*model.Span + for i := range mockTraceSpans { + traceSpans = append(traceSpans, &mockTraceSpans[i]) + } + r.impl.archiveReader.On("GetArchiveTrace", mock.Anything, mockTraceID). + Return(&model.Trace{Spans: traceSpans}, nil) + + err := r.server.GetArchiveTrace(&storage_v1.GetTraceRequest{ + TraceID: mockTraceID, + }, traceSteam) + assert.NoError(t, err) + }) +} + +func TestGRPCServerGetArchiveTrace_Error(t *testing.T) { + withGRPCServer(func(r *grpcServerTest) { + traceSteam := new(grpcMocks.SpanReaderPlugin_GetTraceServer) + traceSteam.On("Context").Return(context.Background()) + + r.impl.archiveReader.On("GetArchiveTrace", mock.Anything, mockTraceID). + Return(nil, fmt.Errorf("some error")) + + err := r.server.GetArchiveTrace(&storage_v1.GetTraceRequest{ + TraceID: mockTraceID, + }, traceSteam) + assert.Error(t, err) + }) +} + +func TestGRPCServerGetArchiveTrace_StreamError(t *testing.T) { + withGRPCServer(func(r *grpcServerTest) { + traceSteam := new(grpcMocks.SpanReaderPlugin_GetTraceServer) + traceSteam.On("Context").Return(context.Background()) + traceSteam.On("Send", &storage_v1.SpansResponseChunk{Spans: mockTraceSpans}). + Return(fmt.Errorf("some error")) + + var traceSpans []*model.Span + for i := range mockTraceSpans { + traceSpans = append(traceSpans, &mockTraceSpans[i]) + } + r.impl.archiveReader.On("GetArchiveTrace", mock.Anything, mockTraceID). + Return(&model.Trace{Spans: traceSpans}, nil) + + err := r.server.GetArchiveTrace(&storage_v1.GetTraceRequest{ + TraceID: mockTraceID, + }, traceSteam) + assert.Error(t, err) + }) +} + +func TestGRPCServerWriteArchiveSpan(t *testing.T) { + withGRPCServer(func(r *grpcServerTest) { + r.impl.archiveWriter.On("WriteArchiveSpan", &mockTraceSpans[0]). + Return(nil) + + s, err := r.server.WriteArchiveSpan(context.Background(), &storage_v1.WriteSpanRequest{ + Span: &mockTraceSpans[0], + }) + assert.NoError(t, err) + assert.Equal(t, &storage_v1.WriteSpanResponse{}, s) + }) +} + +func TestGRPCServerWriteArchiveSpan_Error(t *testing.T) { + withGRPCServer(func(r *grpcServerTest) { + r.impl.archiveWriter.On("WriteArchiveSpan", &mockTraceSpans[0]). + Return(fmt.Errorf("some error")) + + _, err := r.server.WriteArchiveSpan(context.Background(), &storage_v1.WriteSpanRequest{ + Span: &mockTraceSpans[0], + }) + assert.Error(t, err) + }) +} + +func TestGRPCServerArchiveSupported(t *testing.T) { + withGRPCServer(func(r *grpcServerTest) { + r.impl.archiveReader.On("ArchiveSupported", mock.Anything). + Return(true, nil) + + s, err := r.server.ArchiveSupported(context.Background(), &storage_v1.ArchiveSupportedRequest{}) + assert.NoError(t, err) + assert.Equal(t, &storage_v1.ArchiveSupportedResponse{Supported: true}, s) + }) +} + +func TestGRPCServerArchiveSupported_Error(t *testing.T) { + withGRPCServer(func(r *grpcServerTest) { + r.impl.archiveReader.On("ArchiveSupported", mock.Anything). + Return(false, fmt.Errorf("some error")) + + _, err := r.server.ArchiveSupported(context.Background(), &storage_v1.ArchiveSupportedRequest{}) + assert.Error(t, err) + }) +} diff --git a/plugin/storage/grpc/shared/interface.go b/plugin/storage/grpc/shared/interface.go index 24d62854151..3c7a8b77fa3 100644 --- a/plugin/storage/grpc/shared/interface.go +++ b/plugin/storage/grpc/shared/interface.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/go-plugin" "google.golang.org/grpc" + "github.com/jaegertracing/jaeger/model" "github.com/jaegertracing/jaeger/proto-gen/storage_v1" "github.com/jaegertracing/jaeger/storage/dependencystore" "github.com/jaegertracing/jaeger/storage/spanstore" @@ -43,9 +44,22 @@ var PluginMap = map[string]plugin.Plugin{ type StoragePlugin interface { SpanReader() spanstore.Reader SpanWriter() spanstore.Writer + ArchiveSpanReader() ArchiveReader + ArchiveSpanWriter() ArchiveWriter DependencyReader() dependencystore.Reader } +// ArchiveReader finds and loads traces and other data from storage. +type ArchiveReader interface { + GetArchiveTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error) + ArchiveSupported(ctx context.Context) (bool, error) +} + +// ArchiveWriter writes spans to archive storage. +type ArchiveWriter interface { + WriteArchiveSpan(span *model.Span) error +} + // StorageGRPCPlugin is the implementation of plugin.GRPCPlugin so we can serve/consume this. type StorageGRPCPlugin struct { plugin.Plugin @@ -59,6 +73,8 @@ func (p *StorageGRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server server := &grpcServer{Impl: p.Impl} storage_v1.RegisterSpanReaderPluginServer(s, server) storage_v1.RegisterSpanWriterPluginServer(s, server) + storage_v1.RegisterArchiveSpanReaderPluginServer(s, server) + storage_v1.RegisterArchiveSpanWriterPluginServer(s, server) storage_v1.RegisterDependenciesReaderPluginServer(s, server) return nil } @@ -66,8 +82,10 @@ func (p *StorageGRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server // GRPCClient is used by go-plugin to create a grpc plugin client func (*StorageGRPCPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error) { return &grpcClient{ - readerClient: storage_v1.NewSpanReaderPluginClient(c), - writerClient: storage_v1.NewSpanWriterPluginClient(c), - depsReaderClient: storage_v1.NewDependenciesReaderPluginClient(c), + readerClient: storage_v1.NewSpanReaderPluginClient(c), + writerClient: storage_v1.NewSpanWriterPluginClient(c), + archiveReaderClient: storage_v1.NewArchiveSpanReaderPluginClient(c), + archiveWriterClient: storage_v1.NewArchiveSpanWriterPluginClient(c), + depsReaderClient: storage_v1.NewDependenciesReaderPluginClient(c), }, nil } diff --git a/plugin/storage/grpc/shared/mocks/ArchiveReader.go b/plugin/storage/grpc/shared/mocks/ArchiveReader.go new file mode 100644 index 00000000000..7e06fdbc643 --- /dev/null +++ b/plugin/storage/grpc/shared/mocks/ArchiveReader.go @@ -0,0 +1,74 @@ +// Code generated by mockery v1.0.0. DO NOT EDIT. + +// Copyright (c) 2020 The Jaeger Authors. +// +// 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 mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + model "github.com/jaegertracing/jaeger/model" +) + +// ArchiveReader is an autogenerated mock type for the ArchiveReader type +type ArchiveReader struct { + mock.Mock +} + +// ArchiveSupported provides a mock function with given fields: ctx +func (_m *ArchiveReader) ArchiveSupported(ctx context.Context) (bool, error) { + ret := _m.Called(ctx) + + var r0 bool + if rf, ok := ret.Get(0).(func(context.Context) bool); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(bool) + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetArchiveTrace provides a mock function with given fields: ctx, traceID +func (_m *ArchiveReader) GetArchiveTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error) { + ret := _m.Called(ctx, traceID) + + var r0 *model.Trace + if rf, ok := ret.Get(0).(func(context.Context, model.TraceID) *model.Trace); ok { + r0 = rf(ctx, traceID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Trace) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, model.TraceID) error); ok { + r1 = rf(ctx, traceID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/plugin/storage/grpc/shared/mocks/ArchiveWriter.go b/plugin/storage/grpc/shared/mocks/ArchiveWriter.go new file mode 100644 index 00000000000..a25410f99fc --- /dev/null +++ b/plugin/storage/grpc/shared/mocks/ArchiveWriter.go @@ -0,0 +1,42 @@ +// Code generated by mockery v1.0.0. DO NOT EDIT. + +// Copyright (c) 2020 The Jaeger Authors. +// +// 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 mocks + +import ( + mock "github.com/stretchr/testify/mock" + + model "github.com/jaegertracing/jaeger/model" +) + +// ArchiveWriter is an autogenerated mock type for the ArchiveWriter type +type ArchiveWriter struct { + mock.Mock +} + +// WriteArchiveSpan provides a mock function with given fields: span +func (_m *ArchiveWriter) WriteArchiveSpan(span *model.Span) error { + ret := _m.Called(span) + + var r0 error + if rf, ok := ret.Get(0).(func(*model.Span) error); ok { + r0 = rf(span) + } else { + r0 = ret.Error(0) + } + + return r0 +} diff --git a/proto-gen/storage_v1/mocks/ArchiveSpanReaderPluginClient.go b/proto-gen/storage_v1/mocks/ArchiveSpanReaderPluginClient.go new file mode 100644 index 00000000000..6a7a1edf419 --- /dev/null +++ b/proto-gen/storage_v1/mocks/ArchiveSpanReaderPluginClient.go @@ -0,0 +1,78 @@ +// Code generated by mockery v1.0.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + grpc "google.golang.org/grpc" + + mock "github.com/stretchr/testify/mock" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +) + +// ArchiveSpanReaderPluginClient is an autogenerated mock type for the ArchiveSpanReaderPluginClient type +type ArchiveSpanReaderPluginClient struct { + mock.Mock +} + +// ArchiveSupported provides a mock function with given fields: ctx, in, opts +func (_m *ArchiveSpanReaderPluginClient) ArchiveSupported(ctx context.Context, in *storage_v1.ArchiveSupportedRequest, opts ...grpc.CallOption) (*storage_v1.ArchiveSupportedResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *storage_v1.ArchiveSupportedResponse + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.ArchiveSupportedRequest, ...grpc.CallOption) *storage_v1.ArchiveSupportedResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.ArchiveSupportedResponse) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.ArchiveSupportedRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetArchiveTrace provides a mock function with given fields: ctx, in, opts +func (_m *ArchiveSpanReaderPluginClient) GetArchiveTrace(ctx context.Context, in *storage_v1.GetTraceRequest, opts ...grpc.CallOption) (storage_v1.ArchiveSpanReaderPlugin_GetArchiveTraceClient, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 storage_v1.ArchiveSpanReaderPlugin_GetArchiveTraceClient + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.GetTraceRequest, ...grpc.CallOption) storage_v1.ArchiveSpanReaderPlugin_GetArchiveTraceClient); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(storage_v1.ArchiveSpanReaderPlugin_GetArchiveTraceClient) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.GetTraceRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/proto-gen/storage_v1/mocks/ArchiveSpanReaderPluginServer.go b/proto-gen/storage_v1/mocks/ArchiveSpanReaderPluginServer.go new file mode 100644 index 00000000000..1b85c0b04e0 --- /dev/null +++ b/proto-gen/storage_v1/mocks/ArchiveSpanReaderPluginServer.go @@ -0,0 +1,52 @@ +// Code generated by mockery v1.0.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" + mock "github.com/stretchr/testify/mock" +) + +// ArchiveSpanReaderPluginServer is an autogenerated mock type for the ArchiveSpanReaderPluginServer type +type ArchiveSpanReaderPluginServer struct { + mock.Mock +} + +// ArchiveSupported provides a mock function with given fields: _a0, _a1 +func (_m *ArchiveSpanReaderPluginServer) ArchiveSupported(_a0 context.Context, _a1 *storage_v1.ArchiveSupportedRequest) (*storage_v1.ArchiveSupportedResponse, error) { + ret := _m.Called(_a0, _a1) + + var r0 *storage_v1.ArchiveSupportedResponse + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.ArchiveSupportedRequest) *storage_v1.ArchiveSupportedResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.ArchiveSupportedResponse) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.ArchiveSupportedRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetArchiveTrace provides a mock function with given fields: _a0, _a1 +func (_m *ArchiveSpanReaderPluginServer) GetArchiveTrace(_a0 *storage_v1.GetTraceRequest, _a1 storage_v1.ArchiveSpanReaderPlugin_GetArchiveTraceServer) error { + ret := _m.Called(_a0, _a1) + + var r0 error + if rf, ok := ret.Get(0).(func(*storage_v1.GetTraceRequest, storage_v1.ArchiveSpanReaderPlugin_GetArchiveTraceServer) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} diff --git a/proto-gen/storage_v1/mocks/ArchiveSpanReaderPlugin_GetArchiveTraceClient.go b/proto-gen/storage_v1/mocks/ArchiveSpanReaderPlugin_GetArchiveTraceClient.go new file mode 100644 index 00000000000..b9b55519fc5 --- /dev/null +++ b/proto-gen/storage_v1/mocks/ArchiveSpanReaderPlugin_GetArchiveTraceClient.go @@ -0,0 +1,137 @@ +// Code generated by mockery v1.0.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + metadata "google.golang.org/grpc/metadata" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +) + +// ArchiveSpanReaderPlugin_GetArchiveTraceClient is an autogenerated mock type for the ArchiveSpanReaderPlugin_GetArchiveTraceClient type +type ArchiveSpanReaderPlugin_GetArchiveTraceClient struct { + mock.Mock +} + +// CloseSend provides a mock function with given fields: +func (_m *ArchiveSpanReaderPlugin_GetArchiveTraceClient) CloseSend() error { + ret := _m.Called() + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Context provides a mock function with given fields: +func (_m *ArchiveSpanReaderPlugin_GetArchiveTraceClient) Context() context.Context { + ret := _m.Called() + + var r0 context.Context + if rf, ok := ret.Get(0).(func() context.Context); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context.Context) + } + } + + return r0 +} + +// Header provides a mock function with given fields: +func (_m *ArchiveSpanReaderPlugin_GetArchiveTraceClient) Header() (metadata.MD, error) { + ret := _m.Called() + + var r0 metadata.MD + if rf, ok := ret.Get(0).(func() metadata.MD); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(metadata.MD) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Recv provides a mock function with given fields: +func (_m *ArchiveSpanReaderPlugin_GetArchiveTraceClient) Recv() (*storage_v1.SpansResponseChunk, error) { + ret := _m.Called() + + var r0 *storage_v1.SpansResponseChunk + if rf, ok := ret.Get(0).(func() *storage_v1.SpansResponseChunk); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.SpansResponseChunk) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RecvMsg provides a mock function with given fields: m +func (_m *ArchiveSpanReaderPlugin_GetArchiveTraceClient) RecvMsg(m interface{}) error { + ret := _m.Called(m) + + var r0 error + if rf, ok := ret.Get(0).(func(interface{}) error); ok { + r0 = rf(m) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// SendMsg provides a mock function with given fields: m +func (_m *ArchiveSpanReaderPlugin_GetArchiveTraceClient) SendMsg(m interface{}) error { + ret := _m.Called(m) + + var r0 error + if rf, ok := ret.Get(0).(func(interface{}) error); ok { + r0 = rf(m) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Trailer provides a mock function with given fields: +func (_m *ArchiveSpanReaderPlugin_GetArchiveTraceClient) Trailer() metadata.MD { + ret := _m.Called() + + var r0 metadata.MD + if rf, ok := ret.Get(0).(func() metadata.MD); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(metadata.MD) + } + } + + return r0 +} diff --git a/proto-gen/storage_v1/mocks/ArchiveSpanReaderPlugin_GetArchiveTraceServer.go b/proto-gen/storage_v1/mocks/ArchiveSpanReaderPlugin_GetArchiveTraceServer.go new file mode 100644 index 00000000000..7be83be16b6 --- /dev/null +++ b/proto-gen/storage_v1/mocks/ArchiveSpanReaderPlugin_GetArchiveTraceServer.go @@ -0,0 +1,108 @@ +// Code generated by mockery v1.0.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + metadata "google.golang.org/grpc/metadata" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +) + +// ArchiveSpanReaderPlugin_GetArchiveTraceServer is an autogenerated mock type for the ArchiveSpanReaderPlugin_GetArchiveTraceServer type +type ArchiveSpanReaderPlugin_GetArchiveTraceServer struct { + mock.Mock +} + +// Context provides a mock function with given fields: +func (_m *ArchiveSpanReaderPlugin_GetArchiveTraceServer) Context() context.Context { + ret := _m.Called() + + var r0 context.Context + if rf, ok := ret.Get(0).(func() context.Context); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context.Context) + } + } + + return r0 +} + +// RecvMsg provides a mock function with given fields: m +func (_m *ArchiveSpanReaderPlugin_GetArchiveTraceServer) RecvMsg(m interface{}) error { + ret := _m.Called(m) + + var r0 error + if rf, ok := ret.Get(0).(func(interface{}) error); ok { + r0 = rf(m) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Send provides a mock function with given fields: _a0 +func (_m *ArchiveSpanReaderPlugin_GetArchiveTraceServer) Send(_a0 *storage_v1.SpansResponseChunk) error { + ret := _m.Called(_a0) + + var r0 error + if rf, ok := ret.Get(0).(func(*storage_v1.SpansResponseChunk) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// SendHeader provides a mock function with given fields: _a0 +func (_m *ArchiveSpanReaderPlugin_GetArchiveTraceServer) SendHeader(_a0 metadata.MD) error { + ret := _m.Called(_a0) + + var r0 error + if rf, ok := ret.Get(0).(func(metadata.MD) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// SendMsg provides a mock function with given fields: m +func (_m *ArchiveSpanReaderPlugin_GetArchiveTraceServer) SendMsg(m interface{}) error { + ret := _m.Called(m) + + var r0 error + if rf, ok := ret.Get(0).(func(interface{}) error); ok { + r0 = rf(m) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// SetHeader provides a mock function with given fields: _a0 +func (_m *ArchiveSpanReaderPlugin_GetArchiveTraceServer) SetHeader(_a0 metadata.MD) error { + ret := _m.Called(_a0) + + var r0 error + if rf, ok := ret.Get(0).(func(metadata.MD) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// SetTrailer provides a mock function with given fields: _a0 +func (_m *ArchiveSpanReaderPlugin_GetArchiveTraceServer) SetTrailer(_a0 metadata.MD) { + _m.Called(_a0) +} diff --git a/proto-gen/storage_v1/mocks/ArchiveSpanWriterPluginClient.go b/proto-gen/storage_v1/mocks/ArchiveSpanWriterPluginClient.go new file mode 100644 index 00000000000..add833bbf4e --- /dev/null +++ b/proto-gen/storage_v1/mocks/ArchiveSpanWriterPluginClient.go @@ -0,0 +1,48 @@ +// Code generated by mockery v1.0.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + grpc "google.golang.org/grpc" + + mock "github.com/stretchr/testify/mock" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +) + +// ArchiveSpanWriterPluginClient is an autogenerated mock type for the ArchiveSpanWriterPluginClient type +type ArchiveSpanWriterPluginClient struct { + mock.Mock +} + +// WriteArchiveSpan provides a mock function with given fields: ctx, in, opts +func (_m *ArchiveSpanWriterPluginClient) WriteArchiveSpan(ctx context.Context, in *storage_v1.WriteSpanRequest, opts ...grpc.CallOption) (*storage_v1.WriteSpanResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *storage_v1.WriteSpanResponse + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.WriteSpanRequest, ...grpc.CallOption) *storage_v1.WriteSpanResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.WriteSpanResponse) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.WriteSpanRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/proto-gen/storage_v1/mocks/ArchiveSpanWriterPluginServer.go b/proto-gen/storage_v1/mocks/ArchiveSpanWriterPluginServer.go new file mode 100644 index 00000000000..73c271ca14b --- /dev/null +++ b/proto-gen/storage_v1/mocks/ArchiveSpanWriterPluginServer.go @@ -0,0 +1,38 @@ +// Code generated by mockery v1.0.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" + mock "github.com/stretchr/testify/mock" +) + +// ArchiveSpanWriterPluginServer is an autogenerated mock type for the ArchiveSpanWriterPluginServer type +type ArchiveSpanWriterPluginServer struct { + mock.Mock +} + +// WriteArchiveSpan provides a mock function with given fields: _a0, _a1 +func (_m *ArchiveSpanWriterPluginServer) WriteArchiveSpan(_a0 context.Context, _a1 *storage_v1.WriteSpanRequest) (*storage_v1.WriteSpanResponse, error) { + ret := _m.Called(_a0, _a1) + + var r0 *storage_v1.WriteSpanResponse + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.WriteSpanRequest) *storage_v1.WriteSpanResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.WriteSpanResponse) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.WriteSpanRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/proto-gen/storage_v1/storage.pb.go b/proto-gen/storage_v1/storage.pb.go index 20893a4fe29..3285acc0e90 100644 --- a/proto-gen/storage_v1/storage.pb.go +++ b/proto-gen/storage_v1/storage.pb.go @@ -796,6 +796,93 @@ func (m *FindTraceIDsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_FindTraceIDsResponse proto.InternalMessageInfo +// empty; extensible in the future +type ArchiveSupportedRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ArchiveSupportedRequest) Reset() { *m = ArchiveSupportedRequest{} } +func (m *ArchiveSupportedRequest) String() string { return proto.CompactTextString(m) } +func (*ArchiveSupportedRequest) ProtoMessage() {} +func (*ArchiveSupportedRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0d2c4ccf1453ffdb, []int{15} +} +func (m *ArchiveSupportedRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ArchiveSupportedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ArchiveSupportedRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ArchiveSupportedRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ArchiveSupportedRequest.Merge(m, src) +} +func (m *ArchiveSupportedRequest) XXX_Size() int { + return m.Size() +} +func (m *ArchiveSupportedRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ArchiveSupportedRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ArchiveSupportedRequest proto.InternalMessageInfo + +type ArchiveSupportedResponse struct { + Supported bool `protobuf:"varint,1,opt,name=supported,proto3" json:"supported,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ArchiveSupportedResponse) Reset() { *m = ArchiveSupportedResponse{} } +func (m *ArchiveSupportedResponse) String() string { return proto.CompactTextString(m) } +func (*ArchiveSupportedResponse) ProtoMessage() {} +func (*ArchiveSupportedResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0d2c4ccf1453ffdb, []int{16} +} +func (m *ArchiveSupportedResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ArchiveSupportedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ArchiveSupportedResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ArchiveSupportedResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ArchiveSupportedResponse.Merge(m, src) +} +func (m *ArchiveSupportedResponse) XXX_Size() int { + return m.Size() +} +func (m *ArchiveSupportedResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ArchiveSupportedResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ArchiveSupportedResponse proto.InternalMessageInfo + +func (m *ArchiveSupportedResponse) GetSupported() bool { + if m != nil { + return m.Supported + } + return false +} + func init() { proto.RegisterType((*GetDependenciesRequest)(nil), "jaeger.storage.v1.GetDependenciesRequest") golang_proto.RegisterType((*GetDependenciesRequest)(nil), "jaeger.storage.v1.GetDependenciesRequest") @@ -829,73 +916,83 @@ func init() { golang_proto.RegisterType((*FindTraceIDsRequest)(nil), "jaeger.storage.v1.FindTraceIDsRequest") proto.RegisterType((*FindTraceIDsResponse)(nil), "jaeger.storage.v1.FindTraceIDsResponse") golang_proto.RegisterType((*FindTraceIDsResponse)(nil), "jaeger.storage.v1.FindTraceIDsResponse") + proto.RegisterType((*ArchiveSupportedRequest)(nil), "jaeger.storage.v1.ArchiveSupportedRequest") + golang_proto.RegisterType((*ArchiveSupportedRequest)(nil), "jaeger.storage.v1.ArchiveSupportedRequest") + proto.RegisterType((*ArchiveSupportedResponse)(nil), "jaeger.storage.v1.ArchiveSupportedResponse") + golang_proto.RegisterType((*ArchiveSupportedResponse)(nil), "jaeger.storage.v1.ArchiveSupportedResponse") } func init() { proto.RegisterFile("storage.proto", fileDescriptor_0d2c4ccf1453ffdb) } func init() { golang_proto.RegisterFile("storage.proto", fileDescriptor_0d2c4ccf1453ffdb) } var fileDescriptor_0d2c4ccf1453ffdb = []byte{ - // 953 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x73, 0xdb, 0x44, - 0x18, 0x46, 0x89, 0x5d, 0xdb, 0xaf, 0x9d, 0x92, 0x6c, 0x0c, 0x08, 0xd1, 0xda, 0x41, 0x90, 0x0f, - 0x98, 0x41, 0x26, 0xe6, 0x00, 0x03, 0x65, 0x00, 0x37, 0xa9, 0x27, 0x40, 0xa1, 0xa8, 0x19, 0x3a, - 0x43, 0x19, 0x34, 0xeb, 0x68, 0x51, 0xd4, 0x44, 0x2b, 0x55, 0x5a, 0x79, 0x92, 0x03, 0x37, 0x7e, - 0x00, 0x47, 0x4e, 0x5c, 0xf9, 0x1b, 0x1c, 0x7b, 0xe4, 0xcc, 0x21, 0x30, 0xe1, 0xc8, 0x9f, 0x60, - 0xf6, 0x43, 0x8a, 0x6c, 0x6b, 0xf2, 0x35, 0xbd, 0x69, 0xdf, 0x7d, 0xde, 0xe7, 0xfd, 0xda, 0xf7, - 0xb1, 0x61, 0x21, 0x61, 0x61, 0x8c, 0x3d, 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 0x6a, 0x2e, 0x23, 0x58, 0x98, 0x50, 0x52, 0xb4, 0x5e, 0xee, 0x38, 0x23, 0xfc, 0xc6, - 0xc6, 0xc5, 0x40, 0x15, 0xe3, 0x31, 0xc0, 0xd9, 0x12, 0xa0, 0xb2, 0x1e, 0xcf, 0xec, 0xc8, 0xe5, - 0xdb, 0xe3, 0x40, 0xab, 0xf8, 0xe0, 0xd0, 0xda, 0x79, 0xf4, 0x67, 0xef, 0xdc, 0x58, 0xbf, 0x10, - 0xa7, 0xa6, 0xfd, 0xb3, 0x06, 0xfa, 0xe4, 0xbf, 0x8c, 0xc2, 0xd4, 0xf7, 0xc5, 0xcf, 0x79, 0xf1, - 0x1a, 0xbd, 0x55, 0xde, 0x97, 0x92, 0x3f, 0x52, 0xc6, 0xdb, 0x97, 0x81, 0xca, 0x34, 0x06, 0xb7, - 0x9e, 0x9d, 0x76, 0xb4, 0x3f, 0x4f, 0x3b, 0xda, 0x3f, 0xa7, 0x1d, 0xed, 0x8f, 0x7f, 0x3b, 0xda, - 0x77, 0xa0, 0xbc, 0x9c, 0xf1, 0xe6, 0xe8, 0x86, 0x50, 0xba, 0xf7, 0xfe, 0x0f, 0x00, 0x00, 0xff, - 0xff, 0x22, 0xdc, 0xa9, 0x3a, 0x3c, 0x0a, 0x00, 0x00, + // 1044 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x73, 0xdb, 0xc4, + 0x17, 0xff, 0x2a, 0x71, 0x6a, 0xeb, 0xd9, 0xe9, 0x37, 0xd9, 0x18, 0xaa, 0x8a, 0xd4, 0x0e, 0x82, + 0xfc, 0xa0, 0x0c, 0x32, 0x31, 0x07, 0x3a, 0x50, 0x06, 0xea, 0x26, 0xf5, 0x04, 0x28, 0x14, 0x25, + 0x43, 0x67, 0x28, 0xd4, 0xb3, 0xb6, 0x16, 0x45, 0x75, 0xb4, 0x52, 0x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x69, 0x31, 0x28, 0x50, 0x16, 0x18, 0x26, 0x5e, 0x36, + 0x92, 0x25, 0x7a, 0x05, 0xe4, 0x38, 0x0f, 0xbd, 0xa1, 0x4d, 0x4d, 0x76, 0xc5, 0x31, 0x9d, 0x87, + 0xe9, 0x27, 0x36, 0x35, 0xb5, 0xdb, 0x20, 0xa7, 0x5c, 0x08, 0x41, 0x89, 0x62, 0x27, 0x21, 0x60, + 0xdf, 0x67, 0x7b, 0x7f, 0x07, 0x2f, 0xe5, 0xc4, 0x88, 0x08, 0x36, 0xe0, 0xaa, 0x9b, 0x58, 0x3f, + 0xc3, 0x4e, 0x1a, 0x47, 0xce, 0x8a, 0x6e, 0x03, 0xa4, 0x96, 0x40, 0x99, 0x63, 0xf5, 0xb1, 0xaa, + 0xcf, 0x74, 0x9a, 0x9e, 0x1e, 0x61, 0x64, 0xf0, 0xda, 0xcf, 0x25, 0xa8, 0xb3, 0x4c, 0x7f, 0x11, + 0x11, 0xff, 0xf8, 0x01, 0xf6, 0xb1, 0x43, 0x42, 0xe2, 0x07, 0xe8, 0x55, 0xa8, 0x89, 0xe8, 0x7b, + 0x99, 0x80, 0xaa, 0xc2, 0x16, 0x1f, 0x8d, 0xd6, 0x33, 0x0a, 0x39, 0x88, 0x07, 0xb7, 0x38, 0xa5, + 0x10, 0xed, 0x42, 0x29, 0xc4, 0x56, 0xa0, 0xcc, 0x33, 0x69, 0xdb, 0x05, 0xd2, 0x8a, 0x04, 0xe8, + 0x07, 0xd8, 0x0a, 0x76, 0x69, 0xe8, 0x1f, 0x1b, 0xcc, 0x1d, 0x7d, 0x0c, 0x57, 0x27, 0xad, 0xda, + 0x73, 0x6c, 0xaa, 0x94, 0x9e, 0xa3, 0xd7, 0x6a, 0x69, 0xbb, 0xde, 0xb7, 0x69, 0x9e, 0x0b, 0x8f, + 0x95, 0x85, 0xcb, 0x71, 0xe1, 0x31, 0xba, 0x07, 0xb5, 0x64, 0xf8, 0x30, 0x55, 0x57, 0x18, 0xd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0x6f, 0x5e, 0x08, 0x2b, 0x02, 0xfd, 0x5e, + 0x02, 0x65, 0xfa, 0xef, 0x30, 0x13, 0xe9, 0x21, 0x8b, 0x34, 0xbb, 0x8d, 0xde, 0x28, 0x8e, 0xb4, + 0xe0, 0x07, 0x58, 0xbd, 0x79, 0x11, 0x28, 0x97, 0xd1, 0x59, 0x7d, 0x76, 0xda, 0x90, 0x7e, 0x3d, + 0x6d, 0x48, 0x7f, 0x9c, 0x36, 0xa4, 0x5f, 0xfe, 0x6c, 0x48, 0x5f, 0x81, 0xf0, 0xea, 0x8d, 0xb6, + 0xfb, 0x57, 0xd8, 0x0b, 0xf5, 0xce, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb2, 0xcf, 0xe1, 0x93, + 0xf4, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1225,6 +1322,199 @@ var _SpanReaderPlugin_serviceDesc = grpc.ServiceDesc{ Metadata: "storage.proto", } +// ArchiveSpanWriterPluginClient is the client API for ArchiveSpanWriterPlugin service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ArchiveSpanWriterPluginClient interface { + // spanstore/Writer + WriteArchiveSpan(ctx context.Context, in *WriteSpanRequest, opts ...grpc.CallOption) (*WriteSpanResponse, error) +} + +type archiveSpanWriterPluginClient struct { + cc *grpc.ClientConn +} + +func NewArchiveSpanWriterPluginClient(cc *grpc.ClientConn) ArchiveSpanWriterPluginClient { + return &archiveSpanWriterPluginClient{cc} +} + +func (c *archiveSpanWriterPluginClient) WriteArchiveSpan(ctx context.Context, in *WriteSpanRequest, opts ...grpc.CallOption) (*WriteSpanResponse, error) { + out := new(WriteSpanResponse) + err := c.cc.Invoke(ctx, "/jaeger.storage.v1.ArchiveSpanWriterPlugin/WriteArchiveSpan", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ArchiveSpanWriterPluginServer is the server API for ArchiveSpanWriterPlugin service. +type ArchiveSpanWriterPluginServer interface { + // spanstore/Writer + WriteArchiveSpan(context.Context, *WriteSpanRequest) (*WriteSpanResponse, error) +} + +func RegisterArchiveSpanWriterPluginServer(s *grpc.Server, srv ArchiveSpanWriterPluginServer) { + s.RegisterService(&_ArchiveSpanWriterPlugin_serviceDesc, srv) +} + +func _ArchiveSpanWriterPlugin_WriteArchiveSpan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WriteSpanRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ArchiveSpanWriterPluginServer).WriteArchiveSpan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jaeger.storage.v1.ArchiveSpanWriterPlugin/WriteArchiveSpan", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ArchiveSpanWriterPluginServer).WriteArchiveSpan(ctx, req.(*WriteSpanRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ArchiveSpanWriterPlugin_serviceDesc = grpc.ServiceDesc{ + ServiceName: "jaeger.storage.v1.ArchiveSpanWriterPlugin", + HandlerType: (*ArchiveSpanWriterPluginServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "WriteArchiveSpan", + Handler: _ArchiveSpanWriterPlugin_WriteArchiveSpan_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "storage.proto", +} + +// ArchiveSpanReaderPluginClient is the client API for ArchiveSpanReaderPlugin service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ArchiveSpanReaderPluginClient interface { + // spanstore/Reader + GetArchiveTrace(ctx context.Context, in *GetTraceRequest, opts ...grpc.CallOption) (ArchiveSpanReaderPlugin_GetArchiveTraceClient, error) + ArchiveSupported(ctx context.Context, in *ArchiveSupportedRequest, opts ...grpc.CallOption) (*ArchiveSupportedResponse, error) +} + +type archiveSpanReaderPluginClient struct { + cc *grpc.ClientConn +} + +func NewArchiveSpanReaderPluginClient(cc *grpc.ClientConn) ArchiveSpanReaderPluginClient { + return &archiveSpanReaderPluginClient{cc} +} + +func (c *archiveSpanReaderPluginClient) GetArchiveTrace(ctx context.Context, in *GetTraceRequest, opts ...grpc.CallOption) (ArchiveSpanReaderPlugin_GetArchiveTraceClient, error) { + stream, err := c.cc.NewStream(ctx, &_ArchiveSpanReaderPlugin_serviceDesc.Streams[0], "/jaeger.storage.v1.ArchiveSpanReaderPlugin/GetArchiveTrace", opts...) + if err != nil { + return nil, err + } + x := &archiveSpanReaderPluginGetArchiveTraceClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ArchiveSpanReaderPlugin_GetArchiveTraceClient interface { + Recv() (*SpansResponseChunk, error) + grpc.ClientStream +} + +type archiveSpanReaderPluginGetArchiveTraceClient struct { + grpc.ClientStream +} + +func (x *archiveSpanReaderPluginGetArchiveTraceClient) Recv() (*SpansResponseChunk, error) { + m := new(SpansResponseChunk) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *archiveSpanReaderPluginClient) ArchiveSupported(ctx context.Context, in *ArchiveSupportedRequest, opts ...grpc.CallOption) (*ArchiveSupportedResponse, error) { + out := new(ArchiveSupportedResponse) + err := c.cc.Invoke(ctx, "/jaeger.storage.v1.ArchiveSpanReaderPlugin/ArchiveSupported", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ArchiveSpanReaderPluginServer is the server API for ArchiveSpanReaderPlugin service. +type ArchiveSpanReaderPluginServer interface { + // spanstore/Reader + GetArchiveTrace(*GetTraceRequest, ArchiveSpanReaderPlugin_GetArchiveTraceServer) error + ArchiveSupported(context.Context, *ArchiveSupportedRequest) (*ArchiveSupportedResponse, error) +} + +func RegisterArchiveSpanReaderPluginServer(s *grpc.Server, srv ArchiveSpanReaderPluginServer) { + s.RegisterService(&_ArchiveSpanReaderPlugin_serviceDesc, srv) +} + +func _ArchiveSpanReaderPlugin_GetArchiveTrace_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetTraceRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ArchiveSpanReaderPluginServer).GetArchiveTrace(m, &archiveSpanReaderPluginGetArchiveTraceServer{stream}) +} + +type ArchiveSpanReaderPlugin_GetArchiveTraceServer interface { + Send(*SpansResponseChunk) error + grpc.ServerStream +} + +type archiveSpanReaderPluginGetArchiveTraceServer struct { + grpc.ServerStream +} + +func (x *archiveSpanReaderPluginGetArchiveTraceServer) Send(m *SpansResponseChunk) error { + return x.ServerStream.SendMsg(m) +} + +func _ArchiveSpanReaderPlugin_ArchiveSupported_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ArchiveSupportedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ArchiveSpanReaderPluginServer).ArchiveSupported(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jaeger.storage.v1.ArchiveSpanReaderPlugin/ArchiveSupported", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ArchiveSpanReaderPluginServer).ArchiveSupported(ctx, req.(*ArchiveSupportedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ArchiveSpanReaderPlugin_serviceDesc = grpc.ServiceDesc{ + ServiceName: "jaeger.storage.v1.ArchiveSpanReaderPlugin", + HandlerType: (*ArchiveSpanReaderPluginServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ArchiveSupported", + Handler: _ArchiveSpanReaderPlugin_ArchiveSupported_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "GetArchiveTrace", + Handler: _ArchiveSpanReaderPlugin_GetArchiveTrace_Handler, + ServerStreams: true, + }, + }, + Metadata: "storage.proto", +} + // DependenciesReaderPluginClient is the client API for DependenciesReaderPlugin service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. @@ -1828,6 +2118,58 @@ func (m *FindTraceIDsResponse) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *ArchiveSupportedRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ArchiveSupportedRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *ArchiveSupportedResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ArchiveSupportedResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Supported { + dAtA[i] = 0x8 + i++ + if m.Supported { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + func encodeVarintStorage(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -2114,6 +2456,33 @@ func (m *FindTraceIDsResponse) Size() (n int) { return n } +func (m *ArchiveSupportedRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ArchiveSupportedResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Supported { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func sovStorage(x uint64) (n int) { for { n++ @@ -3815,6 +4184,134 @@ func (m *FindTraceIDsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *ArchiveSupportedRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStorage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ArchiveSupportedRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ArchiveSupportedRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipStorage(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStorage + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStorage + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ArchiveSupportedResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStorage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ArchiveSupportedResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ArchiveSupportedResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Supported", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStorage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Supported = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipStorage(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStorage + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStorage + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipStorage(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0