Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change cadence config to dynamic #851

Merged
merged 26 commits into from
Jun 14, 2018
Merged

Change cadence config to dynamic #851

merged 26 commits into from
Jun 14, 2018

Conversation

vancexu
Copy link
Contributor

@vancexu vancexu commented Jun 13, 2018

No description provided.

_matchingDomainTaskListRoot + "enableSyncMatch",
_matchingDomainTaskListRoot + "updateAckInterval",
_matchingDomainTaskListRoot + "idleTasklistCheckInterval",
"testGetPropertyKey",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having keys as a flat array, can we make it a map of service to list of configs?
I think it will be much cleaner if we separate them out per service.
Another thing is I don't like we rely on the ordering of how keys are defined. Can we convert them into a map too, otherwise it will be very error prone.
Basically the keys definition would look something like:
map[serviceIdx]map[int]string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

if getRequest.GetMaximumPageSize() == 0 {
getRequest.MaximumPageSize = common.Int32Ptr(wh.config.DefaultHistoryMaxPageSize)
if getRequest.GetMaximumPageSize() <= 0 {
domainFilter := dynamicconfig.DomainFilter(getRequest.GetDomain())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we define a strongly typed helper function on config which takes the domain when reading any config which supports filter on domain. Then we can have the code to create filter in one location and have a straightforward API for rest of the code to load the config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add GetIntPropertyWithDomainFilter

Copy link
Contributor

@samarabbas samarabbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest looks good. Let's make changes to address the comments I have made and then I can approve this request.

ExecutionMgrNumConns: "history.executionMgrNumConns",
HistoryMgrNumConns: "history.historyMgrNumConns",
MaximumBufferedEventsBatch: "history.maximumBufferedEventsBatch",
ShardUpdateMinInterval: "history.shardUpdateMinInterval",
}

const (
// The order of constants is important. It should match the order in the keys array above.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably this comment is not relevant anymore. Delete this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch done

if getRequest.GetMaximumPageSize() == 0 {
getRequest.MaximumPageSize = common.Int32Ptr(wh.config.DefaultHistoryMaxPageSize)
if getRequest.GetMaximumPageSize() <= 0 {
getRequest.MaximumPageSize = common.Int32Ptr(int32(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still too verbose. Can we have a strongly typed API on config like:
GetHistoryMaxPageSize(domain)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored

@vancexu vancexu merged commit 1733b61 into master Jun 14, 2018
@vancexu vancexu deleted the dynamicConfig branch June 14, 2018 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants