Inherited by AbstractEntryBundler, and AbstractKeyBundler.
List of all members.
Assume that we receive a continuous and concurrent stream of individual operations on multiple threads in parallel. Let's also assume those individual operations have relatively high latency (network or database-related) and there are functionally analogous [bulk] operations that take a collection of arguments instead of a single one without causing the latency to grow linearly, as a function of the collection size. Examples of operations and topologies that satisfy these assumptions are:
Under these assumptions, it's quite clear that the bundler could achieve a better utilization of system resources and better throughput if slightly delays the individual execution requests with a purpose of "bundling" them together and passing int32_to a corresponding bulk operation. Additionally, the "bundled" request should be triggered if a bundle reaches a "preferred bundle size" threshold, eliminating a need to wait till a bundle timeout is reached.
Note: we assume that all bundle-able operations are idempotent and could be repeated if un-bundling is necessary due to a bundled operation failure.
|AbstractBundler Handle definition. |
|AbstractBundler View definition. |
|AbstractBundler Holder definition. |
|Object Handle definition. |
|Object View definition. |
|Object Holder definition. |
Public Member Functions
|virtual int32_t||getSizeThreshold () const|
|Obtain the bundle size threshold value. |
|virtual void||setSizeThreshold (int32_t cSize)|
|Specify the bundle size threshold value. |
|virtual int32_t||getThreadThreshold () const|
|Obtains the minimum number of threads that will trigger the bundler to switch from a pass through to a bundled mode. |
|virtual void||setThreadThreshold (int32_t cThreads)|
|Specify the minimum number of threads that will trigger the bundler to switch from a pass through to a bundled mode. |
|virtual int64_t||getDelayMillis () const|
|Obtain the timeout delay value. |
|virtual void||setDelayMillis (int64_t lDelay)|
|Specify the timeout delay value. |
|virtual bool||isAllowAutoAdjust () const|
|Check whether or not auto-adjustment is allowed. |
|virtual void||setAllowAutoAdjust (bool fAutoAdjust)|
|Specify whether or not auto-adjustment is allowed. |
|virtual void||resetStatistics ()|
|Reset this Bundler statistics. |
|virtual void||adjust ()|
|Adjust this Bundler's parameters according to the available statistical information. |
|virtual void||toStream (std::ostream &out) const|
|Output a human-readable description of this Object to the given stream.|
coherence::lang::operator<<(std::ostream, Object::View) is defined and will call into the toStream method, to output Objects. If a managed String object is desired, the COH_TO_STRING macro can be used to build up a String from streamable contents.
Object::View vKey = ... Object::View vValue = ... std::cout << vKey << " = " << vValue << std::endl; String::Handle hs = COH_TO_STRING(vKey << " = " << vValue);
Static Public Attributes
|static const int32_t||adjustment_frequency|
|Frequency of the adjustment attempts. |
Protected Member Functions
|Construct the bundler. |
|virtual void||updateStatistics ()|
|Update the statistics for this Bundle. |
|virtual void||init (Bundle::Handle hBundle)|
|Initialize the bundler. |
|virtual Bundle::Handle||getOpenBundle ()|
|Retrieve any Bundle that is currently in the open state. |
|virtual Bundle::Handle||instantiateBundle ()=0|
|Instantiate a new Bundle object. |
|Indicate whether this is a first time adjustment. |
|The previous bundle size threshold value. |
|FinalHandle< List >||f_hListBundle|
|A pool of Bundle objects. |
< AtomicCounter >
|A counter for the total number of threads that have started any bundle related execution. |
|Bundle represents a unit of optimized execution. More...|
|Statistics class contains the latest bundler statistics. More...|
Construct the bundler.
By default, the timeout delay value is set to one millisecond and the auto-adjustment feature is turned on.
|virtual int32_t getSizeThreshold||(||)|| const
Obtain the bundle size threshold value.
|virtual void setSizeThreshold||(||int32_t||cSize||)||
Specify the bundle size threshold value.
|cSize||the bundle size threshold value; must be positive value expressed in the same units as the value returned by the Bundle::getBundleSize() method|
|virtual int32_t getThreadThreshold||(||)|| const
Obtains the minimum number of threads that will trigger the bundler to switch from a pass through to a bundled mode.
|virtual void setThreadThreshold||(||int32_t||cThreads||)||
Specify the minimum number of threads that will trigger the bundler to switch from a pass through to a bundled mode.
|cThreads||the number of threads threshold|
|virtual int64_t getDelayMillis||(||)|| const
Obtain the timeout delay value.
|virtual void setDelayMillis||(||int64_t||lDelay||)||
Specify the timeout delay value.
|lDelay||the timeout delay value in milliseconds|
|virtual bool isAllowAutoAdjust||(||)|| const
Check whether or not auto-adjustment is allowed.
|virtual void setAllowAutoAdjust||(||bool||fAutoAdjust||)||
Specify whether or not auto-adjustment is allowed.
|fAutoAdjust||true if auto-adjustment should be allowed; false otherwise|
|virtual void init||(||Bundle::Handle||hBundle||)||
Initialize the bundler.
|hBundle||specifies the bundle for this bundler|
|virtual Bundle::Handle getOpenBundle||(||)||
|virtual Bundle::Handle instantiateBundle||(||)||
|const int32_t adjustment_frequency
Frequency of the adjustment attempts.
This number represents a number of iterations of the master bundle usage after which an adjustment attempt will be performed.
A pool of Bundle objects.
Note that this list never shrinks.
A counter for the total number of threads that have started any bundle related execution.
This counter is used by subclasses to reduce an impact of bundled execution for lightly loaded environments.