Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare all interfaces each factory implements #4967

Merged
merged 1 commit into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion plugin/storage/badger/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
depStore "github.com/jaegertracing/jaeger/plugin/storage/badger/dependencystore"
badgerSampling "github.com/jaegertracing/jaeger/plugin/storage/badger/samplingstore"
badgerStore "github.com/jaegertracing/jaeger/plugin/storage/badger/spanstore"
"github.com/jaegertracing/jaeger/storage"
"github.com/jaegertracing/jaeger/storage/dependencystore"
"github.com/jaegertracing/jaeger/storage/samplingstore"
"github.com/jaegertracing/jaeger/storage/spanstore"
Expand All @@ -43,9 +44,17 @@ const (
lastValueLogCleanedName = "badger_storage_valueloggc_last_run"
)

var (
var ( // interface comformance checks
_ storage.Factory = (*Factory)(nil)
_ io.Closer = (*Factory)(nil)
_ plugin.Configurable = (*Factory)(nil)

// TODO badger could implement archive storage
// _ storage.ArchiveFactory = (*Factory)(nil)

// TODO CreateLock function is missing
// Being fixed in https://github.com/jaegertracing/jaeger/pull/4966
// _ storage.SamplingStoreFactory = (*Factory)(nil)
)

// Factory implements storage.Factory for Badger backend.
Expand Down
6 changes: 6 additions & 0 deletions plugin/storage/blackhole/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ import (
"go.uber.org/zap"

"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/storage"
"github.com/jaegertracing/jaeger/storage/dependencystore"
"github.com/jaegertracing/jaeger/storage/spanstore"
)

var ( // interface comformance checks
_ storage.Factory = (*Factory)(nil)
_ storage.ArchiveFactory = (*Factory)(nil)
)

// Factory implements storage.Factory and creates blackhole storage components.
type Factory struct {
metricsFactory metrics.Factory
Expand Down
9 changes: 6 additions & 3 deletions plugin/storage/cassandra/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ const (
archiveStorageConfig = "cassandra-archive"
)

var (
_ io.Closer = (*Factory)(nil)
_ plugin.Configurable = (*Factory)(nil)
var ( // interface comformance checks
_ storage.Factory = (*Factory)(nil)
_ storage.ArchiveFactory = (*Factory)(nil)
_ storage.SamplingStoreFactory = (*Factory)(nil)
_ io.Closer = (*Factory)(nil)
_ plugin.Configurable = (*Factory)(nil)
)

// Factory implements storage.Factory for Cassandra backend.
Expand Down
6 changes: 0 additions & 6 deletions plugin/storage/cassandra/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ import (
"github.com/jaegertracing/jaeger/pkg/config"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/pkg/testutils"
"github.com/jaegertracing/jaeger/storage"
)

var (
_ storage.Factory = new(Factory)
_ storage.ArchiveFactory = new(Factory)
)

type mockSessionBuilder struct {
Expand Down
9 changes: 6 additions & 3 deletions plugin/storage/es/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
esDepStore "github.com/jaegertracing/jaeger/plugin/storage/es/dependencystore"
"github.com/jaegertracing/jaeger/plugin/storage/es/mappings"
esSpanStore "github.com/jaegertracing/jaeger/plugin/storage/es/spanstore"
"github.com/jaegertracing/jaeger/storage"
"github.com/jaegertracing/jaeger/storage/dependencystore"
"github.com/jaegertracing/jaeger/storage/spanstore"
)
Expand All @@ -47,9 +48,11 @@ const (
archiveNamespace = "es-archive"
)

var (
_ io.Closer = (*Factory)(nil)
_ plugin.Configurable = (*Factory)(nil)
var ( // interface comformance checks
_ storage.Factory = (*Factory)(nil)
_ storage.ArchiveFactory = (*Factory)(nil)
_ io.Closer = (*Factory)(nil)
_ plugin.Configurable = (*Factory)(nil)
)

// Factory implements storage.Factory for Elasticsearch backend.
Expand Down
3 changes: 0 additions & 3 deletions plugin/storage/es/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,9 @@ import (
"github.com/jaegertracing/jaeger/pkg/es/mocks"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/pkg/testutils"
"github.com/jaegertracing/jaeger/storage"
"github.com/jaegertracing/jaeger/storage/spanstore"
)

var _ storage.Factory = new(Factory)

var mockEsServerResponse = []byte(`
{
"Version": {
Expand Down
8 changes: 5 additions & 3 deletions plugin/storage/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ func AllSamplingStorageTypes() []string {
return backends
}

var (
_ io.Closer = (*Factory)(nil)
_ plugin.Configurable = (*Factory)(nil)
var ( // interface comformance checks
_ storage.Factory = (*Factory)(nil)
_ storage.ArchiveFactory = (*Factory)(nil)
_ io.Closer = (*Factory)(nil)
_ plugin.Configurable = (*Factory)(nil)
)

// Factory implements storage.Factory interface as a meta-factory for storage components.
Expand Down
5 changes: 0 additions & 5 deletions plugin/storage/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ import (
spanStoreMocks "github.com/jaegertracing/jaeger/storage/spanstore/mocks"
)

var (
_ storage.Factory = new(Factory)
_ storage.ArchiveFactory = new(Factory)
)

func defaultCfg() FactoryConfig {
return FactoryConfig{
SpanWriterTypes: []string{cassandraStorageType},
Expand Down
8 changes: 5 additions & 3 deletions plugin/storage/grpc/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ import (
"github.com/jaegertracing/jaeger/storage/spanstore"
)

var (
_ io.Closer = (*Factory)(nil)
_ plugin.Configurable = (*Factory)(nil)
var ( // interface comformance checks
_ storage.Factory = (*Factory)(nil)
_ storage.ArchiveFactory = (*Factory)(nil)
_ io.Closer = (*Factory)(nil)
_ plugin.Configurable = (*Factory)(nil)
)

// Factory implements storage.Factory and creates storage components backed by a storage plugin.
Expand Down
2 changes: 0 additions & 2 deletions plugin/storage/grpc/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ import (
spanStoreMocks "github.com/jaegertracing/jaeger/storage/spanstore/mocks"
)

var _ storage.Factory = new(Factory)

type mockPluginBuilder struct {
plugin *mockPlugin
writerType string
Expand Down
4 changes: 3 additions & 1 deletion plugin/storage/kafka/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ import (
"github.com/jaegertracing/jaeger/pkg/kafka/producer"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/plugin"
"github.com/jaegertracing/jaeger/storage"
"github.com/jaegertracing/jaeger/storage/dependencystore"
"github.com/jaegertracing/jaeger/storage/spanstore"
)

var (
var ( // interface comformance checks
_ storage.Factory = (*Factory)(nil)
_ io.Closer = (*Factory)(nil)
_ plugin.Configurable = (*Factory)(nil)
)
Expand Down
4 changes: 0 additions & 4 deletions plugin/storage/kafka/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ import (
"github.com/jaegertracing/jaeger/pkg/config"
kafkaConfig "github.com/jaegertracing/jaeger/pkg/kafka/producer"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/storage"
)

// Checks that Kafka Factory conforms to storage.Factory API
var _ storage.Factory = new(Factory)

type mockProducerBuilder struct {
kafkaConfig.Configuration
err error
Expand Down
8 changes: 7 additions & 1 deletion plugin/storage/memory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@ import (
"github.com/jaegertracing/jaeger/pkg/memory/config"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/plugin"
"github.com/jaegertracing/jaeger/storage"
"github.com/jaegertracing/jaeger/storage/dependencystore"
"github.com/jaegertracing/jaeger/storage/samplingstore"
"github.com/jaegertracing/jaeger/storage/spanstore"
)

var _ plugin.Configurable = (*Factory)(nil)
var ( // interface comformance checks
_ storage.Factory = (*Factory)(nil)
_ storage.ArchiveFactory = (*Factory)(nil)
_ storage.SamplingStoreFactory = (*Factory)(nil)
_ plugin.Configurable = (*Factory)(nil)
)

// Factory implements storage.Factory and creates storage components backed by memory store.
type Factory struct {
Expand Down
Loading