28 static std::string schema = R
"JSON( 30 "$schema" : "http://json-schema.org/draft-04/schema#", 31 "$id" : "bloomberg:quantum.json", 32 "title": "Quantum library settings", 35 "numCoroutineThreads": { 48 "loadBalanceSharedIoQueues": { 52 "loadBalancePollIntervalMs": { 56 "loadBalancePollIntervalBackoffPolicy": { 64 "loadBalancePollIntervalNumBackoffs": { 68 "coroQueueIdRangeForAnyLow": { 72 "coroQueueIdRangeForAnyHigh": { 77 "additionalProperties": false, 87 static std::string uri =
"bloomberg:quantum.json";
94 _numCoroutineThreads = num;
106 _pinCoroutineThreadsToCores = value;
112 _loadBalanceSharedIoQueues = value;
118 _loadBalancePollIntervalMs = interval;
124 _loadBalancePollIntervalBackoffPolicy = policy;
130 _loadBalancePollIntervalNumBackoffs = numBackoffs;
136 _coroQueueIdRangeForAny = coroQueueIdRangeForAny;
142 return _numCoroutineThreads;
148 return _numIoThreads;
154 return _pinCoroutineThreadsToCores;
160 return _loadBalanceSharedIoQueues;
166 return _loadBalancePollIntervalMs;
172 return _loadBalancePollIntervalBackoffPolicy;
178 return _loadBalancePollIntervalNumBackoffs;
184 return _coroQueueIdRangeForAny;
size_t getLoadBalancePollIntervalNumBackoffs() const
Get the number of backoffs used.
Definition: quantum_buffer_impl.h:22
void setNumIoThreads(int num)
Set the number of threads running IO tasks.
int getNumIoThreads() const
Get the number of IO threads.
std::chrono::milliseconds getLoadBalancePollIntervalMs() const
Get load balance shared queue poll interval.
void setCoroQueueIdRangeForAny(const std::pair< int, int > &coroQueueIdRangeForAny)
Sets the range of coroutine queueIds covered by IQueue::QueueId::Any when using Dispatcher::post.
bool getLoadBalanceSharedIoQueues() const
Check if IO shared queues are load balanced or not.
void setNumCoroutineThreads(int num)
Set the number of threads running coroutines.
void setPinCoroutineThreadsToCores(bool value)
Indicate if coroutine threads should be pinned to a core.
void setLoadBalancePollIntervalMs(std::chrono::milliseconds interval)
Set the interval between IO thread polls.
bool getPinCoroutineThreadsToCores() const
Check to see if coroutine threads are pinned to cores or not.
static const std::string & getJsonSchema()
Get the JSON schema corresponding to this configuration object.
void setLoadBalanceSharedIoQueues(bool value)
Load balancee the shared IO queues.
void setLoadBalancePollIntervalNumBackoffs(size_t numBackoffs)
Set the number of backoffs.
static const std::string & getJsonSchemaUri()
Get the schema URI used to resolve remote JSON references '$ref'.
BackoffPolicy getLoadBalancePollIntervalBackoffPolicy() const
Get the backoff policy in load balance mode.
int getNumCoroutineThreads() const
Get the number of coroutine threads.
BackoffPolicy
Definition: quantum_configuration.h:34
void setLoadBalancePollIntervalBackoffPolicy(BackoffPolicy policy)
Set a backoff policy for the shared queue polling interval.
const std::pair< int, int > & getCoroQueueIdRangeForAny() const
Gets the range [minQueueId, maxQueueId] of coroutine queueIds covered by IQueue::QueueId::Any by the ...