Skip to content

Commit

Permalink
Refactor Engine into two separate components
Browse files Browse the repository at this point in the history
Summary:
Engine logically consists of two components (HistoryService and MatchingEngine)
that need to be partitioned independently. This change is the first step toward
that goal. It defines clear service interfaces and breaks down the implementation.

Reviewers: sivakk, samar

Reviewed By: sivakk, samar

Differential Revision: https://code.uberinternal.com/D656725
  • Loading branch information
Tamer Eldeeb committed Dec 7, 2016
1 parent c00f3f5 commit 73201d1
Show file tree
Hide file tree
Showing 25 changed files with 3,073 additions and 2,635 deletions.
2 changes: 1 addition & 1 deletion cassandra
Submodule cassandra updated from 4bd446 to 9be339
Binary file added cmd/demo/demo
Binary file not shown.
11 changes: 8 additions & 3 deletions cmd/demo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (

"code.uber.internal/devexp/minions/common"
"code.uber.internal/devexp/minions/health/driver"
"code.uber.internal/devexp/minions/persistence"
"code.uber.internal/devexp/minions/workflow"
wmetrics "code.uber.internal/devexp/minions/workflow/metrics"
)
Expand Down Expand Up @@ -176,17 +177,21 @@ func main() {

if host == "127.0.0.1" {
testBase := workflow.TestBase{}
testBase.SetupWorkflowStoreWithOptions(workflow.TestBaseOptions{ClusterHost: host, KeySpace: "workflow", DropKeySpace: false})
options := workflow.TestBaseOptions{}
options.ClusterHost = host
options.KeySpace = "workflow"
options.DropKeySpace = false
testBase.SetupWorkflowStoreWithOptions(options.TestBaseOptions)
engine = workflow.NewWorkflowEngine(testBase.WorkflowMgr, testBase.TaskMgr, log.WithField("host", "workflow_host"))
} else {
executionPersistence, err2 := workflow.NewCassandraWorkflowExecutionPersistence(host, "workflow")
executionPersistence, err2 := persistence.NewCassandraWorkflowExecutionPersistence(host, "workflow")
if err2 != nil {
panic(err2)
}

executionPersistenceClient := workflow.NewWorkflowExecutionPersistenceClient(executionPersistence, m3ReporterClient)

taskPersistence, err3 := workflow.NewCassandraTaskPersistence(host, "workflow")
taskPersistence, err3 := persistence.NewCassandraTaskPersistence(host, "workflow")
if err3 != nil {
panic(err3)
}
Expand Down
10 changes: 7 additions & 3 deletions cmd/stress/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"code.uber.internal/devexp/minions/common"
s "code.uber.internal/devexp/minions/health/stress"
"code.uber.internal/devexp/minions/persistence"
"code.uber.internal/devexp/minions/workflow"
wmetrics "code.uber.internal/devexp/minions/workflow/metrics"
)
Expand Down Expand Up @@ -72,17 +73,20 @@ func main() {

if host == "127.0.0.1" {
testBase := workflow.TestBase{}
testBase.SetupWorkflowStoreWithOptions(workflow.TestBaseOptions{ClusterHost: host, DropKeySpace: true})
options := workflow.TestBaseOptions{}
options.ClusterHost = host
options.DropKeySpace = true
testBase.SetupWorkflowStoreWithOptions(options.TestBaseOptions)
engine = workflow.NewWorkflowEngine(testBase.WorkflowMgr, testBase.TaskMgr, log.WithField("host", "workflow_host"))
} else {
executionPersistence, err2 := workflow.NewCassandraWorkflowExecutionPersistence(host, "workflow")
executionPersistence, err2 := persistence.NewCassandraWorkflowExecutionPersistence(host, "workflow")
if err2 != nil {
panic(err2)
}

executionPersistenceClient := workflow.NewWorkflowExecutionPersistenceClient(executionPersistence, m3ReporterClient)

taskPersistence, err3 := workflow.NewCassandraTaskPersistence(host, "workflow")
taskPersistence, err3 := persistence.NewCassandraTaskPersistence(host, "workflow")
if err3 != nil {
panic(err3)
}
Expand Down
Loading

0 comments on commit 73201d1

Please sign in to comment.