Skip to content

Commit

Permalink
[Persistence] Remove unused dependencies (temporalio#6398)
Browse files Browse the repository at this point in the history
## What changed?
Removed some unused dependencies. Logger was not used in any of these
objects.

## Why?
Unused code.

## How did you test it?
Compiled and ran existing tests.

## Potential risks
N/A

## Documentation
N/A

## Is hotfix candidate?
No
  • Loading branch information
gow authored Aug 13, 2024
1 parent b11df91 commit de5c361
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 30 deletions.
12 changes: 4 additions & 8 deletions common/persistence/cassandra/execution_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"context"
"time"

"go.temporal.io/server/common/log"
p "go.temporal.io/server/common/persistence"
"go.temporal.io/server/common/persistence/nosql/nosqlplugin/cassandra/gocql"
)
Expand Down Expand Up @@ -115,14 +114,11 @@ type (

var _ p.ExecutionStore = (*ExecutionStore)(nil)

func NewExecutionStore(
session gocql.Session,
logger log.Logger,
) *ExecutionStore {
func NewExecutionStore(session gocql.Session) *ExecutionStore {
return &ExecutionStore{
HistoryStore: NewHistoryStore(session, logger),
MutableStateStore: NewMutableStateStore(session, logger),
MutableStateTaskStore: NewMutableStateTaskStore(session, logger),
HistoryStore: NewHistoryStore(session),
MutableStateStore: NewMutableStateStore(session),
MutableStateTaskStore: NewMutableStateTaskStore(session),
}
}

Expand Down
2 changes: 1 addition & 1 deletion common/persistence/cassandra/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (f *Factory) NewClusterMetadataStore() (p.ClusterMetadataStore, error) {

// NewExecutionStore returns a new ExecutionStore.
func (f *Factory) NewExecutionStore() (p.ExecutionStore, error) {
return NewExecutionStore(f.session, f.logger), nil
return NewExecutionStore(f.session), nil
}

// NewQueue returns a new queue backed by cassandra
Expand Down
8 changes: 1 addition & 7 deletions common/persistence/cassandra/history_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (

commonpb "go.temporal.io/api/common/v1"
"go.temporal.io/api/serviceerror"
"go.temporal.io/server/common/log"
p "go.temporal.io/server/common/persistence"
"go.temporal.io/server/common/persistence/nosql/nosqlplugin/cassandra/gocql"
"go.temporal.io/server/common/primitives"
Expand Down Expand Up @@ -70,18 +69,13 @@ const (
type (
HistoryStore struct {
Session gocql.Session
Logger log.Logger
p.HistoryBranchUtilImpl
}
)

func NewHistoryStore(
session gocql.Session,
logger log.Logger,
) *HistoryStore {
func NewHistoryStore(session gocql.Session) *HistoryStore {
return &HistoryStore{
Session: session,
Logger: logger,
}
}

Expand Down
8 changes: 1 addition & 7 deletions common/persistence/cassandra/mutable_state_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (

enumsspb "go.temporal.io/server/api/enums/v1"
persistencespb "go.temporal.io/server/api/persistence/v1"
"go.temporal.io/server/common/log"
p "go.temporal.io/server/common/persistence"
"go.temporal.io/server/common/persistence/nosql/nosqlplugin/cassandra/gocql"
"go.temporal.io/server/common/persistence/serialization"
Expand Down Expand Up @@ -360,17 +359,12 @@ const (
type (
MutableStateStore struct {
Session gocql.Session
Logger log.Logger
}
)

func NewMutableStateStore(
session gocql.Session,
logger log.Logger,
) *MutableStateStore {
func NewMutableStateStore(session gocql.Session) *MutableStateStore {
return &MutableStateStore{
Session: session,
Logger: logger,
}
}

Expand Down
8 changes: 1 addition & 7 deletions common/persistence/cassandra/mutable_state_task_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (

"go.temporal.io/api/serviceerror"

"go.temporal.io/server/common/log"
p "go.temporal.io/server/common/persistence"
"go.temporal.io/server/common/persistence/nosql/nosqlplugin/cassandra/gocql"
"go.temporal.io/server/common/persistence/serialization"
Expand Down Expand Up @@ -189,17 +188,12 @@ const (
type (
MutableStateTaskStore struct {
Session gocql.Session
Logger log.Logger
}
)

func NewMutableStateTaskStore(
session gocql.Session,
logger log.Logger,
) *MutableStateTaskStore {
func NewMutableStateTaskStore(session gocql.Session) *MutableStateTaskStore {
return &MutableStateTaskStore{
Session: session,
Logger: logger,
}
}

Expand Down

0 comments on commit de5c361

Please sign in to comment.