Skip to content

Commit

Permalink
Move resetor to reset package (cadence-workflow#3340)
Browse files Browse the repository at this point in the history
  • Loading branch information
vancexu authored Jun 16, 2020
1 parent b7f42fa commit 208c34f
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 102 deletions.
6 changes: 5 additions & 1 deletion service/history/historyEngine.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,18 @@ func NewEngineWithShardContext(
executionCache,
logger,
),
resetor: reset.NewWorkflowResetor(
shard,
executionCache,
logger,
),
publicClient: publicClient,
matchingClient: matching,
rawMatchingClient: rawMatchingClient,
queueTaskProcessor: queueTaskProcessor,
clientChecker: client.NewVersionChecker(),
failoverCoordinator: failoverCoordinator,
}
historyEngImpl.resetor = newWorkflowResetor(historyEngImpl)
historyEngImpl.decisionHandler = newDecisionHandler(historyEngImpl)

if config.TransferProcessorEnableMultiCurosrProcessor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,14 @@ func (s *resetorSuite) SetupTest() {

s.logger = s.mockShard.GetLogger()

executionCache := execution.NewCache(s.mockShard)
h := &historyEngineImpl{
currentClusterName: s.mockShard.GetClusterMetadata().GetCurrentClusterName(),
shard: s.mockShard,
clusterMetadata: s.mockClusterMetadata,
executionManager: s.mockExecutionMgr,
historyV2Mgr: s.mockHistoryV2Mgr,
executionCache: execution.NewCache(s.mockShard),
executionCache: executionCache,
logger: s.logger,
metricsClient: s.mockShard.GetMetricsClient(),
tokenSerializer: common.NewJSONTaskTokenSerializer(),
Expand All @@ -143,7 +144,8 @@ func (s *resetorSuite) SetupTest() {
timerProcessor: s.mockTimerProcessor,
}
s.mockShard.SetEngine(h)
s.resetor = newWorkflowResetor(h)
// TODO: replace depreciated workflowResetor once ndc and workflowRestter ready.
s.resetor = reset.NewWorkflowResetor(s.mockShard, executionCache, s.logger)
h.resetor = s.resetor
s.historyEngine = h
}
Expand Down
2 changes: 1 addition & 1 deletion service/history/historyReplicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func newHistoryReplicator(
)
},
}
replicator.resetor = newWorkflowResetor(historyEngine)
replicator.resetor = reset.NewWorkflowResetor(shard, executionCache, logger)

return replicator
}
Expand Down
51 changes: 0 additions & 51 deletions service/history/reset/resetor.go

This file was deleted.

Loading

0 comments on commit 208c34f

Please sign in to comment.