diff --git a/plugin/storage/cassandra/factory.go b/plugin/storage/cassandra/factory.go index 8ee72905f3d..49c7a2a9c55 100644 --- a/plugin/storage/cassandra/factory.go +++ b/plugin/storage/cassandra/factory.go @@ -72,7 +72,7 @@ func NewFactory() *Factory { return &Factory{ tracer: otel.GetTracerProvider(), Options: NewOptions(primaryStorageConfig, archiveStorageConfig), - sessionBuilderFn: newSession, + sessionBuilderFn: NewSession, } } @@ -194,7 +194,7 @@ func newSessionPrerequisites(c *config.Configuration) error { } // NewSession creates a new Cassandra session -func newSession(c *config.Configuration) (cassandra.Session, error) { +func NewSession(c *config.Configuration) (cassandra.Session, error) { if err := newSessionPrerequisites(c); err != nil { return nil, err } diff --git a/plugin/storage/cassandra/factory_test.go b/plugin/storage/cassandra/factory_test.go index 4bb0509fa4d..d8800089a75 100644 --- a/plugin/storage/cassandra/factory_test.go +++ b/plugin/storage/cassandra/factory_test.go @@ -258,12 +258,12 @@ func TestNewSessionErrors(t *testing.T) { }, }, } - _, err := newSession(cfg) + _, err := NewSession(cfg) require.ErrorContains(t, err, "failed to load TLS config") }) t.Run("CreateSession error", func(t *testing.T) { cfg := &config.Configuration{} - _, err := newSession(cfg) + _, err := NewSession(cfg) require.ErrorContains(t, err, "no hosts provided") }) t.Run("CreateSession error with schema", func(t *testing.T) { @@ -272,7 +272,7 @@ func TestNewSessionErrors(t *testing.T) { CreateSchema: true, }, } - _, err := newSession(cfg) + _, err := NewSession(cfg) require.ErrorContains(t, err, "no hosts provided") }) } diff --git a/plugin/storage/cassandra/savetracetest/main.go b/plugin/storage/cassandra/savetracetest/main.go index d2190f5511e..d6c2b1f3fa1 100644 --- a/plugin/storage/cassandra/savetracetest/main.go +++ b/plugin/storage/cassandra/savetracetest/main.go @@ -14,6 +14,7 @@ import ( cascfg "github.com/jaegertracing/jaeger/pkg/cassandra/config" "github.com/jaegertracing/jaeger/pkg/jtracer" "github.com/jaegertracing/jaeger/pkg/metrics" + "github.com/jaegertracing/jaeger/plugin/storage/cassandra" cSpanStore "github.com/jaegertracing/jaeger/plugin/storage/cassandra/spanstore" "github.com/jaegertracing/jaeger/storage/spanstore" ) @@ -36,7 +37,7 @@ func main() { Timeout: time.Millisecond * 750, }, } - cqlSession, err := cConfig.NewSession() + cqlSession, err := cassandra.NewSession(cConfig) if err != nil { logger.Fatal("Cannot create Cassandra session", zap.Error(err)) }