diff --git a/plugin/storage/badger/factory.go b/plugin/storage/badger/factory.go index 6c0788864ae..40f90329c5b 100644 --- a/plugin/storage/badger/factory.go +++ b/plugin/storage/badger/factory.go @@ -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" @@ -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. diff --git a/plugin/storage/blackhole/factory.go b/plugin/storage/blackhole/factory.go index 3ddc2798faf..50cf4a9b886 100644 --- a/plugin/storage/blackhole/factory.go +++ b/plugin/storage/blackhole/factory.go @@ -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 diff --git a/plugin/storage/cassandra/factory.go b/plugin/storage/cassandra/factory.go index d8e8676dc9b..fed7bb77c85 100644 --- a/plugin/storage/cassandra/factory.go +++ b/plugin/storage/cassandra/factory.go @@ -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. diff --git a/plugin/storage/cassandra/factory_test.go b/plugin/storage/cassandra/factory_test.go index 9108ed35356..b9994c64929 100644 --- a/plugin/storage/cassandra/factory_test.go +++ b/plugin/storage/cassandra/factory_test.go @@ -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 { diff --git a/plugin/storage/es/factory.go b/plugin/storage/es/factory.go index ae3f20b96a8..c483596e047 100644 --- a/plugin/storage/es/factory.go +++ b/plugin/storage/es/factory.go @@ -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" ) @@ -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. diff --git a/plugin/storage/es/factory_test.go b/plugin/storage/es/factory_test.go index 07a32f41282..5a3972c1e11 100644 --- a/plugin/storage/es/factory_test.go +++ b/plugin/storage/es/factory_test.go @@ -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": { diff --git a/plugin/storage/factory.go b/plugin/storage/factory.go index 8b88032b0f6..c8ab75d7ec6 100644 --- a/plugin/storage/factory.go +++ b/plugin/storage/factory.go @@ -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. diff --git a/plugin/storage/factory_test.go b/plugin/storage/factory_test.go index 0dc23ad1983..8aad9e35334 100644 --- a/plugin/storage/factory_test.go +++ b/plugin/storage/factory_test.go @@ -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}, diff --git a/plugin/storage/grpc/factory.go b/plugin/storage/grpc/factory.go index 24a4712ff8d..c4656c36ab4 100644 --- a/plugin/storage/grpc/factory.go +++ b/plugin/storage/grpc/factory.go @@ -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. diff --git a/plugin/storage/grpc/factory_test.go b/plugin/storage/grpc/factory_test.go index 9525a4735aa..7a68081abc6 100644 --- a/plugin/storage/grpc/factory_test.go +++ b/plugin/storage/grpc/factory_test.go @@ -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 diff --git a/plugin/storage/kafka/factory.go b/plugin/storage/kafka/factory.go index 8eb886fd2bb..c2dee28812d 100644 --- a/plugin/storage/kafka/factory.go +++ b/plugin/storage/kafka/factory.go @@ -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) ) diff --git a/plugin/storage/kafka/factory_test.go b/plugin/storage/kafka/factory_test.go index b51cd8a52f5..e4dbbedddab 100644 --- a/plugin/storage/kafka/factory_test.go +++ b/plugin/storage/kafka/factory_test.go @@ -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 diff --git a/plugin/storage/memory/factory.go b/plugin/storage/memory/factory.go index 70bf4299afe..a16a454c9da 100644 --- a/plugin/storage/memory/factory.go +++ b/plugin/storage/memory/factory.go @@ -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 {