dynamicconfig

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBoolPropertyFn added in v0.3.14

func GetBoolPropertyFn(value bool) func(opts ...FilterOption) bool

GetBoolPropertyFn returns value as BoolPropertyFn

func GetDurationPropertyFn added in v0.3.14

func GetDurationPropertyFn(value time.Duration) func(opts ...FilterOption) time.Duration

GetDurationPropertyFn returns value as DurationPropertyFn

func GetDurationPropertyFnFilteredByTaskListInfo added in v0.3.14

func GetDurationPropertyFnFilteredByTaskListInfo(value time.Duration) func(domain string, taskList string, taskType int) time.Duration

GetDurationPropertyFnFilteredByTaskListInfo returns value as DurationPropertyFnWithTaskListInfoFilters

func GetFloatPropertyFn added in v0.3.14

func GetFloatPropertyFn(value float64) func(opts ...FilterOption) float64

GetFloatPropertyFn returns value as FloatPropertyFn

func GetIntPropertyFilteredByDomain added in v0.4.0

func GetIntPropertyFilteredByDomain(value int) func(domain string) int

GetIntPropertyFilteredByDomain returns values as IntPropertyFnWithDomainFilters

func GetIntPropertyFilteredByTaskListInfo added in v0.3.14

func GetIntPropertyFilteredByTaskListInfo(value int) func(domain string, taskList string, taskType int) int

GetIntPropertyFilteredByTaskListInfo returns value as IntPropertyFnWithTaskListInfoFilters

func GetIntPropertyFn added in v0.3.14

func GetIntPropertyFn(value int) func(opts ...FilterOption) int

GetIntPropertyFn returns value as IntPropertyFn

Types

type BoolPropertyFn

type BoolPropertyFn func(opts ...FilterOption) bool

BoolPropertyFn is a wrapper to get bool property from dynamic config

type BoolPropertyFnWithTaskListInfoFilters added in v0.3.14

type BoolPropertyFnWithTaskListInfoFilters func(domain string, taskList string, taskType int) bool

BoolPropertyFnWithTaskListInfoFilters is a wrapper to get bool property from dynamic config with three filters: domain, taskList, taskType

type Client

type Client interface {
	GetValue(name Key, defaultValue interface{}) (interface{}, error)
	GetValueWithFilters(name Key, filters map[Filter]interface{}, defaultValue interface{}) (interface{}, error)

	GetIntValue(name Key, filters map[Filter]interface{}, defaultValue int) (int, error)
	GetFloatValue(name Key, filters map[Filter]interface{}, defaultValue float64) (float64, error)
	GetBoolValue(name Key, filters map[Filter]interface{}, defaultValue bool) (bool, error)
	GetStringValue(name Key, filters map[Filter]interface{}, defaultValue string) (string, error)
	GetMapValue(
		name Key, filters map[Filter]interface{}, defaultValue map[string]interface{},
	) (map[string]interface{}, error)
	GetDurationValue(
		name Key, filters map[Filter]interface{}, defaultValue time.Duration,
	) (time.Duration, error)
}

Client allows fetching values from a dynamic configuration system NOTE: This does not have async options right now. In the interest of keeping it minimal, we can add when requirement arises.

func NewNopClient

func NewNopClient() Client

NewNopClient creates a nop client

type Collection

type Collection struct {
	// contains filtered or unexported fields
}

Collection wraps dynamic config client with a closure so that across the code, the config values can be directly accessed by calling the function without propagating the client everywhere in code

func NewCollection

func NewCollection(client Client, logger bark.Logger) *Collection

NewCollection creates a new collection

func NewNopCollection

func NewNopCollection() *Collection

NewNopCollection creates a new nop collection

func (*Collection) GetBoolProperty

func (c *Collection) GetBoolProperty(key Key, defaultValue bool) BoolPropertyFn

GetBoolProperty gets property and asserts that it's an bool

func (*Collection) GetBoolPropertyFilteredByTaskListInfo added in v0.3.14

func (c *Collection) GetBoolPropertyFilteredByTaskListInfo(key Key, defaultValue bool) BoolPropertyFnWithTaskListInfoFilters

GetBoolPropertyFilteredByTaskListInfo gets property with taskListInfo as filters and asserts that it's an bool

func (*Collection) GetDurationProperty

func (c *Collection) GetDurationProperty(key Key, defaultValue time.Duration) DurationPropertyFn

GetDurationProperty gets property and asserts that it's a duration

func (*Collection) GetDurationPropertyFilteredByDomain added in v0.3.14

func (c *Collection) GetDurationPropertyFilteredByDomain(key Key, defaultValue time.Duration) DurationPropertyFnWithDomainFilter

GetDurationPropertyFilteredByDomain gets property with domain filter and asserts that it's a duration

func (*Collection) GetDurationPropertyFilteredByTaskListInfo added in v0.3.14

func (c *Collection) GetDurationPropertyFilteredByTaskListInfo(key Key, defaultValue time.Duration) DurationPropertyFnWithTaskListInfoFilters

GetDurationPropertyFilteredByTaskListInfo gets property with taskListInfo as filters and asserts that it's a duration

func (*Collection) GetFloat64Property

func (c *Collection) GetFloat64Property(key Key, defaultValue float64) FloatPropertyFn

GetFloat64Property gets property and asserts that it's a float64

func (*Collection) GetIntProperty

func (c *Collection) GetIntProperty(key Key, defaultValue int) IntPropertyFn

GetIntProperty gets property and asserts that it's an integer

func (*Collection) GetIntPropertyFilteredByDomain added in v0.3.14

func (c *Collection) GetIntPropertyFilteredByDomain(key Key, defaultValue int) IntPropertyFnWithDomainFilter

GetIntPropertyFilteredByDomain gets property with domain filter and asserts that it's an integer

func (*Collection) GetIntPropertyFilteredByTaskListInfo added in v0.3.14

func (c *Collection) GetIntPropertyFilteredByTaskListInfo(key Key, defaultValue int) IntPropertyFnWithTaskListInfoFilters

GetIntPropertyFilteredByTaskListInfo gets property with taskListInfo as filters and asserts that it's an integer

func (*Collection) GetProperty

func (c *Collection) GetProperty(key Key, defaultValue interface{}) PropertyFn

GetProperty gets a interface property and returns defaultValue if property is not found

func (*Collection) GetStringProperty added in v0.4.0

func (c *Collection) GetStringProperty(key Key, defaultValue string) StringPropertyFn

GetStringProperty gets property and asserts that it's an string

func (*Collection) GetStringPropertyFnWithDomainFilter added in v0.4.0

func (c *Collection) GetStringPropertyFnWithDomainFilter(key Key, defaultValue string) StringPropertyFnWithDomainFilter

GetStringPropertyFnWithDomainFilter gets property with domain filter and asserts that its domain

type DurationPropertyFn

type DurationPropertyFn func(opts ...FilterOption) time.Duration

DurationPropertyFn is a wrapper to get duration property from dynamic config

type DurationPropertyFnWithDomainFilter added in v0.3.14

type DurationPropertyFnWithDomainFilter func(domain string) time.Duration

DurationPropertyFnWithDomainFilter is a wrapper to get duration property from dynamic config with domain as filter

type DurationPropertyFnWithTaskListInfoFilters added in v0.3.14

type DurationPropertyFnWithTaskListInfoFilters func(domain string, taskList string, taskType int) time.Duration

DurationPropertyFnWithTaskListInfoFilters is a wrapper to get duration property from dynamic config with three filters: domain, taskList, taskType

type Filter

type Filter int

Filter represents a filter on the dynamic config key

const (

	// DomainName is the domain name
	DomainName Filter
	// TaskListName is the tasklist name
	TaskListName
	// TaskType is the task type (0:Decision, 1:Activity)
	TaskType
)

func (Filter) String

func (f Filter) String() string

type FilterOption

type FilterOption func(filterMap map[Filter]interface{})

FilterOption is used to provide filters for dynamic config keys

func DomainFilter

func DomainFilter(name string) FilterOption

DomainFilter filters by domain name

func TaskListFilter

func TaskListFilter(name string) FilterOption

TaskListFilter filters by task list name

func TaskTypeFilter added in v0.3.14

func TaskTypeFilter(taskType int) FilterOption

TaskTypeFilter filters by task type

type FloatPropertyFn

type FloatPropertyFn func(opts ...FilterOption) float64

FloatPropertyFn is a wrapper to get float property from dynamic config

type IntPropertyFn

type IntPropertyFn func(opts ...FilterOption) int

IntPropertyFn is a wrapper to get int property from dynamic config

type IntPropertyFnWithDomainFilter added in v0.3.14

type IntPropertyFnWithDomainFilter func(domain string) int

IntPropertyFnWithDomainFilter is a wrapper to get int property from dynamic config with domain as filter

type IntPropertyFnWithTaskListInfoFilters added in v0.3.14

type IntPropertyFnWithTaskListInfoFilters func(domain string, taskList string, taskType int) int

IntPropertyFnWithTaskListInfoFilters is a wrapper to get int property from dynamic config with three filters: domain, taskList, taskType

type Key

type Key int

Key represents a key/property stored in dynamic config

const (

	// EnableGlobalDomain is key for enable global domain
	EnableGlobalDomain Key
	// EnableNewKafkaClient is key for using New Kafka client
	EnableNewKafkaClient
	// EnableVisibilitySampling is key for enable visibility sampling
	EnableVisibilitySampling

	// FrontendPersistenceMaxQPS is the max qps frontend host can query DB
	FrontendPersistenceMaxQPS
	// FrontendVisibilityMaxPageSize is default max size for ListWorkflowExecutions in one page
	FrontendVisibilityMaxPageSize
	// FrontendHistoryMaxPageSize is default max size for GetWorkflowExecutionHistory in one page
	FrontendHistoryMaxPageSize
	// FrontendRPS is workflow rate limit per second
	FrontendRPS
	// FrontendHistoryMgrNumConns is for persistence cluster.NumConns
	FrontendHistoryMgrNumConns
	// MaxDecisionStartToCloseTimeout is max decision timeout in seconds
	MaxDecisionStartToCloseTimeout

	// MatchingRPS is request rate per second for each matching host
	MatchingRPS
	// MatchingPersistenceMaxQPS is the max qps matching host can query DB
	MatchingPersistenceMaxQPS
	// MatchingMinTaskThrottlingBurstSize is the minimum burst size for task list throttling
	MatchingMinTaskThrottlingBurstSize
	// MatchingGetTasksBatchSize is the maximum batch size to fetch from the task buffer
	MatchingGetTasksBatchSize
	// MatchingLongPollExpirationInterval is the long poll expiration interval in the matching service
	MatchingLongPollExpirationInterval
	// MatchingEnableSyncMatch is to enable sync match
	MatchingEnableSyncMatch
	// MatchingUpdateAckInterval is the interval for update ack
	MatchingUpdateAckInterval
	// MatchingIdleTasklistCheckInterval is the IdleTasklistCheckInterval
	MatchingIdleTasklistCheckInterval
	// MaxTasklistIdleTime is the max time tasklist being idle
	MaxTasklistIdleTime
	// MatchingOutstandingTaskAppendsThreshold is the threshold for outstanding task appends
	MatchingOutstandingTaskAppendsThreshold
	// MatchingMaxTaskBatchSize is max batch size for task writer
	MatchingMaxTaskBatchSize

	// EnableSyncActivityHeartbeat whether enable sending out sync activity heartbeat replication task
	EnableSyncActivityHeartbeat
	// HistoryRPS is request rate per second for each history host
	HistoryRPS
	// HistoryPersistenceMaxQPS is the max qps history host can query DB
	HistoryPersistenceMaxQPS
	// HistoryVisibilityOpenMaxQPS is max qps one history host can query visibility open_executions
	HistoryVisibilityOpenMaxQPS
	// HistoryVisibilityClosedMaxQPS is max qps one history host can query visibility closed_executions
	HistoryVisibilityClosedMaxQPS
	// HistoryLongPollExpirationInterval is the long poll expiration interval in the history service
	HistoryLongPollExpirationInterval
	// HistoryCacheInitialSize is initial size of history cache
	HistoryCacheInitialSize
	// HistoryCacheMaxSize is max size of history cache
	HistoryCacheMaxSize
	// HistoryCacheTTL is TTL of history cache
	HistoryCacheTTL
	// AcquireShardInterval is interval that timer used to acquire shard
	AcquireShardInterval
	// StandbyClusterDelay is the atrificial delay added to standby cluster's view of active cluster's time
	StandbyClusterDelay
	// TimerTaskBatchSize is batch size for timer processor to process tasks
	TimerTaskBatchSize
	// TimerTaskWorkerCount is number of task workers for timer processor
	TimerTaskWorkerCount
	// TimerTaskMaxRetryCount is max retry count for timer processor
	TimerTaskMaxRetryCount
	// TimerProcessorStartDelay is the start delay
	TimerProcessorStartDelay
	// TimerProcessorFailoverStartDelay is the failover start delay
	TimerProcessorFailoverStartDelay
	// TimerProcessorGetFailureRetryCount is retry count for timer processor get failure operation
	TimerProcessorGetFailureRetryCount
	// TimerProcessorCompleteTimerFailureRetryCount is retry count for timer processor complete timer operation
	TimerProcessorCompleteTimerFailureRetryCount
	// TimerProcessorUpdateShardTaskCount is update shard count for timer processor
	TimerProcessorUpdateShardTaskCount
	// TimerProcessorUpdateAckInterval is update interval for timer processor
	TimerProcessorUpdateAckInterval
	// TimerProcessorUpdateAckIntervalJitterCoefficient is the update interval jitter coefficient
	TimerProcessorUpdateAckIntervalJitterCoefficient
	// TimerProcessorCompleteTimerInterval is complete timer interval for timer processor
	TimerProcessorCompleteTimerInterval
	// TimerProcessorFailoverMaxPollRPS is max poll rate per second for timer processor
	TimerProcessorFailoverMaxPollRPS
	// TimerProcessorMaxPollRPS is max poll rate per second for timer processor
	TimerProcessorMaxPollRPS
	// TimerProcessorMaxPollInterval is max poll interval for timer processor
	TimerProcessorMaxPollInterval
	// TimerProcessorMaxPollIntervalJitterCoefficient is the max poll interval jitter coefficient
	TimerProcessorMaxPollIntervalJitterCoefficient
	// TimerProcessorMaxTimeShift is the max shift timer processor can have
	TimerProcessorMaxTimeShift
	// TransferTaskBatchSize is batch size for transferQueueProcessor
	TransferTaskBatchSize
	// TransferProcessorFailoverMaxPollRPS is max poll rate per second for transferQueueProcessor
	TransferProcessorFailoverMaxPollRPS
	// TransferProcessorMaxPollRPS is max poll rate per second for transferQueueProcessor
	TransferProcessorMaxPollRPS
	// TransferTaskWorkerCount is number of worker for transferQueueProcessor
	TransferTaskWorkerCount
	// TransferTaskMaxRetryCount is max times of retry for transferQueueProcessor
	TransferTaskMaxRetryCount
	// TransferProcessorStartDelay is the start delay
	TransferProcessorStartDelay
	// TransferProcessorFailoverStartDelay is the failover start delay
	TransferProcessorFailoverStartDelay
	// TransferProcessorCompleteTransferFailureRetryCount is times of retry for failure
	TransferProcessorCompleteTransferFailureRetryCount
	// TransferProcessorUpdateShardTaskCount is update shard count for transferQueueProcessor
	TransferProcessorUpdateShardTaskCount
	// TransferProcessorMaxPollInterval max poll interval for transferQueueProcessor
	TransferProcessorMaxPollInterval
	// TransferProcessorMaxPollIntervalJitterCoefficient is the max poll interval jitter coefficient
	TransferProcessorMaxPollIntervalJitterCoefficient
	// TransferProcessorUpdateAckInterval is update interval for transferQueueProcessor
	TransferProcessorUpdateAckInterval
	// TransferProcessorUpdateAckIntervalJitterCoefficient is the update interval jitter coefficient
	TransferProcessorUpdateAckIntervalJitterCoefficient
	// TransferProcessorCompleteTransferInterval is complete timer interval for transferQueueProcessor
	TransferProcessorCompleteTransferInterval
	// ReplicatorTaskBatchSize is batch size for ReplicatorProcessor
	ReplicatorTaskBatchSize
	// ReplicatorTaskWorkerCount is number of worker for ReplicatorProcessor
	ReplicatorTaskWorkerCount
	// ReplicatorTaskMaxRetryCount is max times of retry for ReplicatorProcessor
	ReplicatorTaskMaxRetryCount
	// ReplicatorProcessorStartDelay is the start delay
	ReplicatorProcessorStartDelay
	// ReplicatorProcessorMaxPollRPS is max poll rate per second for ReplicatorProcessor
	ReplicatorProcessorMaxPollRPS
	// ReplicatorProcessorUpdateShardTaskCount is update shard count for ReplicatorProcessor
	ReplicatorProcessorUpdateShardTaskCount
	// ReplicatorProcessorMaxPollInterval is max poll interval for ReplicatorProcessor
	ReplicatorProcessorMaxPollInterval
	// ReplicatorProcessorMaxPollIntervalJitterCoefficient is the max poll interval jitter coefficient
	ReplicatorProcessorMaxPollIntervalJitterCoefficient
	// ReplicatorProcessorUpdateAckInterval is update interval for ReplicatorProcessor
	ReplicatorProcessorUpdateAckInterval
	// ReplicatorProcessorUpdateAckIntervalJitterCoefficient is the update interval jitter coefficient
	ReplicatorProcessorUpdateAckIntervalJitterCoefficient
	// ExecutionMgrNumConns is persistence connections number for ExecutionManager
	ExecutionMgrNumConns
	// HistoryMgrNumConns is persistence connections number for HistoryManager
	HistoryMgrNumConns
	// MaximumBufferedEventsBatch is max number of buffer event in mutable state
	MaximumBufferedEventsBatch
	// ShardUpdateMinInterval is the minimal time interval which the shard info can be updated
	ShardUpdateMinInterval
	// ShardSyncMinInterval is the minimal time interval which the shard info should be sync to remote
	ShardSyncMinInterval
	// DefaultEventEncoding is the encoding type for history events
	DefaultEventEncoding

	// EnableAdminProtection is whether to enable admin checking
	EnableAdminProtection
	// AdminOperationToken is the token to pass admin checking
	AdminOperationToken

	// WorkerPersistenceMaxQPS is the max qps worker host can query DB
	WorkerPersistenceMaxQPS
)

func (Key) String

func (k Key) String() string

type PropertyFn

type PropertyFn func() interface{}

PropertyFn is a wrapper to get property from dynamic config

type StringPropertyFn added in v0.4.0

type StringPropertyFn func(opts ...FilterOption) string

StringPropertyFn is a wrapper to get string property from dynamic config

type StringPropertyFnWithDomainFilter added in v0.4.0

type StringPropertyFnWithDomainFilter func(domain string) string

StringPropertyFnWithDomainFilter is a wrapper to get string property from dynamic config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL