Skip to content

Commit

Permalink
Remove domain cache from history/workflow (uber#4846)
Browse files Browse the repository at this point in the history
  • Loading branch information
mantas-sidlauskas authored May 26, 2022
1 parent 471e6d1 commit 3a813e8
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 21 deletions.
4 changes: 0 additions & 4 deletions service/history/execution/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"context"
"fmt"

"github.com/uber/cadence/common/cache"
"github.com/uber/cadence/common/cluster"
"github.com/uber/cadence/common/persistence"
"github.com/uber/cadence/common/types"
Expand Down Expand Up @@ -55,7 +54,6 @@ type (
}

workflowImpl struct {
domainCache cache.DomainCache
clusterMetadata cluster.Metadata

ctx context.Context
Expand All @@ -68,7 +66,6 @@ type (
// NewWorkflow creates a new NDC workflow
func NewWorkflow(
ctx context.Context,
domainCache cache.DomainCache,
clusterMetadata cluster.Metadata,
context Context,
mutableState MutableState,
Expand All @@ -77,7 +74,6 @@ func NewWorkflow(

return &workflowImpl{
ctx: ctx,
domainCache: domainCache,
clusterMetadata: clusterMetadata,

context: context,
Expand Down
2 changes: 0 additions & 2 deletions service/history/historyEngine.go
Original file line number Diff line number Diff line change
Expand Up @@ -2784,7 +2784,6 @@ func (e *historyEngineImpl) ResetWorkflowExecution(
request.GetRequestID(),
execution.NewWorkflow(
ctx,
e.shard.GetDomainCache(),
e.shard.GetClusterMetadata(),
currentContext,
currentMutableState,
Expand Down Expand Up @@ -3295,7 +3294,6 @@ func (e *historyEngineImpl) ReapplyEvents(
uuid.New(),
execution.NewWorkflow(
ctx,
e.shard.GetDomainCache(),
e.shard.GetClusterMetadata(),
wfContext,
mutableState,
Expand Down
4 changes: 0 additions & 4 deletions service/history/ndc/branch_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/pborman/uuid"

"github.com/uber/cadence/common"
"github.com/uber/cadence/common/cache"
"github.com/uber/cadence/common/cluster"
"github.com/uber/cadence/common/log"
"github.com/uber/cadence/common/persistence"
Expand All @@ -53,7 +52,6 @@ type (

branchManagerImpl struct {
shard shard.Context
domainCache cache.DomainCache
clusterMetadata cluster.Metadata
historyV2Mgr persistence.HistoryManager

Expand All @@ -74,7 +72,6 @@ func newBranchManager(

return &branchManagerImpl{
shard: shard,
domainCache: shard.GetDomainCache(),
clusterMetadata: shard.GetService().GetClusterMetadata(),
historyV2Mgr: shard.GetHistoryManager(),

Expand Down Expand Up @@ -172,7 +169,6 @@ func (r *branchManagerImpl) flushBufferedEvents(

targetWorkflow := execution.NewWorkflow(
ctx,
r.domainCache,
r.clusterMetadata,
r.context,
r.mutableState,
Expand Down
5 changes: 0 additions & 5 deletions service/history/ndc/history_replicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ func (r *historyReplicatorImpl) applyStartEvents(
task.getEventTime(),
execution.NewWorkflow(
ctx,
r.domainCache,
r.clusterMetadata,
context,
mutableState,
Expand Down Expand Up @@ -410,7 +409,6 @@ func (r *historyReplicatorImpl) applyNonStartEventsToCurrentBranch(

targetWorkflow := execution.NewWorkflow(
ctx,
r.domainCache,
r.clusterMetadata,
context,
mutableState,
Expand All @@ -433,7 +431,6 @@ func (r *historyReplicatorImpl) applyNonStartEventsToCurrentBranch(

newWorkflow = execution.NewWorkflow(
ctx,
r.domainCache,
r.clusterMetadata,
newContext,
newMutableState,
Expand Down Expand Up @@ -517,7 +514,6 @@ func (r *historyReplicatorImpl) applyNonStartEventsToNoneCurrentBranchWithoutCon
task.getEventTime(),
execution.NewWorkflow(
ctx,
r.domainCache,
r.clusterMetadata,
context,
mutableState,
Expand Down Expand Up @@ -664,7 +660,6 @@ func (r *historyReplicatorImpl) applyNonStartEventsResetWorkflow(

targetWorkflow := execution.NewWorkflow(
ctx,
r.domainCache,
r.clusterMetadata,
context,
mutableState,
Expand Down
5 changes: 1 addition & 4 deletions service/history/ndc/transaction_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"github.com/pborman/uuid"

"github.com/uber/cadence/common"
"github.com/uber/cadence/common/cache"
"github.com/uber/cadence/common/cluster"
"github.com/uber/cadence/common/log"
"github.com/uber/cadence/common/log/tag"
Expand Down Expand Up @@ -146,7 +145,6 @@ type (

transactionManagerImpl struct {
shard shard.Context
domainCache cache.DomainCache
executionCache *execution.Cache
clusterMetadata cluster.Metadata
historyV2Manager persistence.HistoryManager
Expand All @@ -172,7 +170,6 @@ func newTransactionManager(

transactionManager := &transactionManagerImpl{
shard: shard,
domainCache: shard.GetDomainCache(),
executionCache: executionCache,
clusterMetadata: shard.GetClusterMetadata(),
historyV2Manager: shard.GetHistoryManager(),
Expand Down Expand Up @@ -457,7 +454,7 @@ func (r *transactionManagerImpl) loadNDCWorkflow(
release(err)
return nil, err
}
return execution.NewWorkflow(ctx, r.domainCache, r.clusterMetadata, context, msBuilder, release), nil
return execution.NewWorkflow(ctx, r.clusterMetadata, context, msBuilder, release), nil
}

func (r *transactionManagerImpl) isWorkflowCurrent(
Expand Down
1 change: 0 additions & 1 deletion service/history/reset/resetter.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ func (r *workflowResetterImpl) replayResetWorkflow(
resetContext.SetHistorySize(resetHistorySize)
return execution.NewWorkflow(
ctx,
r.domainCache,
r.clusterMetadata,
resetContext,
resetMutableState,
Expand Down
1 change: 0 additions & 1 deletion service/history/task/transfer_active_task_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,6 @@ func (t *transferActiveTaskExecutor) resetWorkflow(
uuid.New(),
execution.NewWorkflow(
resetCtx,
t.shard.GetDomainCache(),
t.shard.GetClusterMetadata(),
currentContext,
currentMutableState,
Expand Down

0 comments on commit 3a813e8

Please sign in to comment.