Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenquan Xing committed Jun 19, 2018
1 parent 49b24d4 commit 8a8f11b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 39 deletions.
2 changes: 1 addition & 1 deletion common/service/dynamicconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type PropertyFn func() interface{}
// IntPropertyFn is a wrapper to get int property from dynamic config
type IntPropertyFn func(opts ...FilterOption) int

// IntPropertyFn is a wrapper to get int property from dynamic config with domainName as filter
// IntPropertyFnWithDomainFilter is a wrapper to get int property from dynamic config with domainName as filter
type IntPropertyFnWithDomainFilter func(domain string) int

// FloatPropertyFn is a wrapper to get float property from dynamic config
Expand Down
75 changes: 39 additions & 36 deletions common/service/dynamicconfig/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,42 +64,45 @@ var keys = map[Key]string{
MatchingMaxTaskBatchSize: "matching.maxTaskBatchSize",

// history settings
HistoryLongPollExpirationInterval: "history.longPollExpirationInterval",
HistoryCacheInitialSize: "history.cacheInitialSize",
HistoryCacheMaxSize: "history.cacheMaxSize",
HistoryCacheTTL: "history.cacheTTL",
AcquireShardInterval: "history.acquireShardInterval",
TimerTaskBatchSize: "history.timerTaskBatchSize",
TimerTaskWorkerCount: "history.timerTaskWorkerCount",
TimerTaskMaxRetryCount: "history.timerTaskMaxRetryCount",
TimerProcessorGetFailureRetryCount: "history.timerProcessorGetFailureRetryCount",
TimerProcessorCompleteTimerFailureRetryCount: "history.timerProcessorCompleteTimerFailureRetryCount",
TimerProcessorUpdateShardTaskCount: "history.timerProcessorUpdateShardTaskCount",
TimerProcessorUpdateAckInterval: "history.timerProcessorUpdateAckInterval",
TimerProcessorCompleteTimerInterval: "history.timerProcessorCompleteTimerInterval",
TimerProcessorMaxPollInterval: "history.timerProcessorMaxPollInterval",
TimerProcessorStandbyTaskDelay: "history.timerProcessorStandbyTaskDelay",
TransferTaskBatchSize: "history.transferTaskBatchSize",
TransferProcessorMaxPollRPS: "history.transferProcessorMaxPollRPS",
TransferTaskWorkerCount: "history.transferTaskWorkerCount",
TransferTaskMaxRetryCount: "history.transferTaskMaxRetryCount",
TransferProcessorCompleteTransferFailureRetryCount: "history.transferProcessorCompleteTransferFailureRetryCount",
TransferProcessorUpdateShardTaskCount: "history.transferProcessorUpdateShardTaskCount",
TransferProcessorMaxPollInterval: "history.transferProcessorMaxPollInterval",
TransferProcessorUpdateAckInterval: "history.transferProcessorUpdateAckInterval",
TransferProcessorCompleteTransferInterval: "history.transferProcessorCompleteTransferInterval",
TransferProcessorStandbyTaskDelay: "history.transferProcessorStandbyTaskDelay",
ReplicatorTaskBatchSize: "history.replicatorTaskBatchSize",
ReplicatorTaskWorkerCount: "history.replicatorTaskWorkerCount",
ReplicatorTaskMaxRetryCount: "history.replicatorTaskMaxRetryCount",
ReplicatorProcessorMaxPollRPS: "history.replicatorProcessorMaxPollRPS",
ReplicatorProcessorUpdateShardTaskCount: "history.replicatorProcessorUpdateShardTaskCount",
ReplicatorProcessorMaxPollInterval: "history.replicatorProcessorMaxPollInterval",
ReplicatorProcessorUpdateAckInterval: "history.replicatorProcessorUpdateAckInterval",
ExecutionMgrNumConns: "history.executionMgrNumConns",
HistoryMgrNumConns: "history.historyMgrNumConns",
MaximumBufferedEventsBatch: "history.maximumBufferedEventsBatch",
ShardUpdateMinInterval: "history.shardUpdateMinInterval",
HistoryLongPollExpirationInterval: "history.longPollExpirationInterval",
HistoryCacheInitialSize: "history.cacheInitialSize",
HistoryCacheMaxSize: "history.cacheMaxSize",
HistoryCacheTTL: "history.cacheTTL",
AcquireShardInterval: "history.acquireShardInterval",
TimerTaskBatchSize: "history.timerTaskBatchSize",
TimerTaskWorkerCount: "history.timerTaskWorkerCount",
TimerTaskMaxRetryCount: "history.timerTaskMaxRetryCount",
TimerProcessorGetFailureRetryCount: "history.timerProcessorGetFailureRetryCount",
TimerProcessorCompleteTimerFailureRetryCount: "history.timerProcessorCompleteTimerFailureRetryCount",
TimerProcessorUpdateShardTaskCount: "history.timerProcessorUpdateShardTaskCount",
TimerProcessorUpdateAckInterval: "history.timerProcessorUpdateAckInterval",
TimerProcessorCompleteTimerInterval: "history.timerProcessorCompleteTimerInterval",
TimerProcessorMaxPollInterval: "history.timerProcessorMaxPollInterval",
TimerProcessorMaxPollIntervalJitterCoefficient: "history.timerProcessorMaxPollIntervalJitterCoefficient",
TimerProcessorStandbyTaskDelay: "history.timerProcessorStandbyTaskDelay",
TransferTaskBatchSize: "history.transferTaskBatchSize",
TransferProcessorMaxPollRPS: "history.transferProcessorMaxPollRPS",
TransferTaskWorkerCount: "history.transferTaskWorkerCount",
TransferTaskMaxRetryCount: "history.transferTaskMaxRetryCount",
TransferProcessorCompleteTransferFailureRetryCount: "history.transferProcessorCompleteTransferFailureRetryCount",
TransferProcessorUpdateShardTaskCount: "history.transferProcessorUpdateShardTaskCount",
TransferProcessorMaxPollInterval: "history.transferProcessorMaxPollInterval",
TransferProcessorMaxPollIntervalJitterCoefficient: "history.transferProcessorMaxPollIntervalJitterCoefficient",
TransferProcessorUpdateAckInterval: "history.transferProcessorUpdateAckInterval",
TransferProcessorCompleteTransferInterval: "history.transferProcessorCompleteTransferInterval",
TransferProcessorStandbyTaskDelay: "history.transferProcessorStandbyTaskDelay",
ReplicatorTaskBatchSize: "history.replicatorTaskBatchSize",
ReplicatorTaskWorkerCount: "history.replicatorTaskWorkerCount",
ReplicatorTaskMaxRetryCount: "history.replicatorTaskMaxRetryCount",
ReplicatorProcessorMaxPollRPS: "history.replicatorProcessorMaxPollRPS",
ReplicatorProcessorUpdateShardTaskCount: "history.replicatorProcessorUpdateShardTaskCount",
ReplicatorProcessorMaxPollInterval: "history.replicatorProcessorMaxPollInterval",
ReplicatorProcessorMaxPollIntervalJitterCoefficient: "history.replicatorProcessorMaxPollIntervalJitterCoefficient",
ReplicatorProcessorUpdateAckInterval: "history.replicatorProcessorUpdateAckInterval",
ExecutionMgrNumConns: "history.executionMgrNumConns",
HistoryMgrNumConns: "history.historyMgrNumConns",
MaximumBufferedEventsBatch: "history.maximumBufferedEventsBatch",
ShardUpdateMinInterval: "history.shardUpdateMinInterval",
}

const (
Expand Down
4 changes: 2 additions & 2 deletions service/history/queueAckMgr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (s *queueAckMgrSuite) SetupTest() {
s.mockShard.config.ShardUpdateMinInterval = dynamicconfig.GetDurationPropertyFn(0 * time.Second)

s.queueAckMgr = newQueueAckMgr(s.mockShard, &QueueProcessorOptions{
UpdateShardTaskCount: func(opts ...dynamicconfig.FilterOption) int { return 1 },
UpdateShardTaskCount: dynamicconfig.GetIntPropertyFn(1),
MetricScope: metrics.ReplicatorQueueProcessorScope,
}, s.mockProcessor, 0, s.logger)
}
Expand Down Expand Up @@ -350,7 +350,7 @@ func (s *queueFailoverAckMgrSuite) SetupTest() {
s.mockShard.config.ShardUpdateMinInterval = dynamicconfig.GetDurationPropertyFn(0 * time.Second)

s.queueFailoverAckMgr = newQueueFailoverAckMgr(s.mockShard, &QueueProcessorOptions{
UpdateShardTaskCount: func(opts ...dynamicconfig.FilterOption) int { return 1 },
UpdateShardTaskCount: dynamicconfig.GetIntPropertyFn(1),
MetricScope: metrics.ReplicatorQueueProcessorScope,
}, s.mockProcessor, 0, s.logger)
}
Expand Down

0 comments on commit 8a8f11b

Please sign in to comment.