Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <[email protected]>
  • Loading branch information
yurishkuro committed Nov 30, 2024
1 parent 23a9b62 commit d925074
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions plugin/storage/cassandra/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func NewFactory() *Factory {
return &Factory{
tracer: otel.GetTracerProvider(),
Options: NewOptions(primaryStorageConfig, archiveStorageConfig),
sessionBuilderFn: newSession,
sessionBuilderFn: NewSession,
}
}

Expand Down Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions plugin/storage/cassandra/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -272,7 +272,7 @@ func TestNewSessionErrors(t *testing.T) {
CreateSchema: true,
},
}
_, err := newSession(cfg)
_, err := NewSession(cfg)
require.ErrorContains(t, err, "no hosts provided")
})
}
3 changes: 2 additions & 1 deletion plugin/storage/cassandra/savetracetest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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))
}
Expand Down

0 comments on commit d925074

Please sign in to comment.