forked from cadence-workflow/cadence
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This changes the history service client to be aware of the number of shards and use the service resolver to identify which host should serve a given request, based on the workflowID in the request. It also makes the numberOfShards a parameter, not a constant. Test Plan: UT, integration test Reviewers: sivakk, maxim, samar Reviewed By: samar Subscribers: jenkins Differential Revision: https://code.uberinternal.com/D721011
- Loading branch information
Tamer Eldeeb
committed
Feb 1, 2017
1 parent
01f7b1e
commit e467ee4
Showing
17 changed files
with
239 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package client | ||
|
||
import ( | ||
"code.uber.internal/devexp/minions/client/history" | ||
"code.uber.internal/devexp/minions/client/matching" | ||
"code.uber.internal/devexp/minions/common/membership" | ||
"code.uber.internal/devexp/minions/common/metrics" | ||
tchannel "github.com/uber/tchannel-go" | ||
) | ||
|
||
// Factory can be used to create RPC clients for cadence services | ||
type Factory interface { | ||
NewHistoryClient() (history.Client, error) | ||
NewMatchingClient() (matching.Client, error) | ||
} | ||
|
||
type tchannelClientFactory struct { | ||
ch *tchannel.Channel | ||
monitor membership.Monitor | ||
metricsClient metrics.Client | ||
numberOfHistoryShards int | ||
} | ||
|
||
// NewTChannelClientFactory creates an instance of client factory using tchannel | ||
func NewTChannelClientFactory(ch *tchannel.Channel, | ||
monitor membership.Monitor, metricsClient metrics.Client, numberOfHistoryShards int) Factory { | ||
return &tchannelClientFactory{ | ||
ch: ch, | ||
monitor: monitor, | ||
metricsClient: metricsClient, | ||
numberOfHistoryShards: numberOfHistoryShards, | ||
} | ||
} | ||
|
||
func (cf *tchannelClientFactory) NewHistoryClient() (history.Client, error) { | ||
return history.NewClient(cf.ch, cf.monitor, cf.numberOfHistoryShards) | ||
} | ||
|
||
func (cf *tchannelClientFactory) NewMatchingClient() (matching.Client, error) { | ||
return matching.NewClient(cf.ch, cf.monitor) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
common/jsonTaskTokenSerializer.go → common/util/jsonTaskTokenSerializer.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package common | ||
package util | ||
|
||
import "encoding/json" | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
common/taskTokenSerializerInterfaces.go → common/util/taskTokenSerializerInterfaces.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package common | ||
package util | ||
|
||
type ( | ||
// TaskTokenSerializer serializes task tokens | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.