Class AbstractBundler.Bundle
Bundle represents a unit of optimized execution.
Inherited Members
Namespace: Tangosol.Net.Cache
Assembly: Coherence.dll
Syntax
protected abstract class AbstractBundler.Bundle
Constructors
Bundle()
Default constructor.
Declaration
protected Bundle()
Bundle(AbstractBundler)
Default constructor.
Declaration
protected Bundle(AbstractBundler bundler)
Parameters
| Type | Name | Description |
|---|---|---|
| AbstractBundler | bundler | The Bundler the bundle operates on. |
Fields
STATUS_EXCEPTION
Attempt to bundle encountered and exception; the execution has to be de-optimized and performed by individual threads.
Declaration
public const int STATUS_EXCEPTION = 3
Field Value
| Type | Description |
|---|---|
| int |
STATUS_OPEN
This Bundle accepting additional items.
Declaration
public const int STATUS_OPEN = 0
Field Value
| Type | Description |
|---|---|
| int |
STATUS_PENDING
This Bundle is closed for accepting additional items and awaiting for the execution results.
Declaration
public const int STATUS_PENDING = 1
Field Value
| Type | Description |
|---|---|
| int |
STATUS_PROCESSED
This Bundle is in process of returning the result of execution back to the client.
Declaration
public const int STATUS_PROCESSED = 2
Field Value
| Type | Description |
|---|---|
| int |
Properties
BundleSize
Bundle size. The return value should be expressed in the same units as the value returned by the SizeThreshold property.
Declaration
public int BundleSize { get; }
Property Value
| Type | Description |
|---|---|
| int |
Bundler
The bundler the operations are performed on.
Declaration
public AbstractBundler Bundler { get; set; }
Property Value
| Type | Description |
|---|---|
| AbstractBundler |
IsMaster
A flag that differentiates the "master" bundle which is responsible for all auto-adjustments. It's set to "true" for one and only one Bundle object.
Declaration
public bool IsMaster { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Lock
An object that serves as a mutex for thread synchronization.
Declaration
protected virtual object Lock { get; set; }
Property Value
| Type | Description |
|---|---|
| object | An object that serves as a mutex for thread synchronization. |
Remarks
When idle, the bundle thread is waiting for a notification on the Lock object.
See Also
SyncRoot
Gets an object that can be used to synchronize calls to a method.
Declaration
public virtual object SyncRoot { get; }
Property Value
| Type | Description |
|---|---|
| object | An object that can be used to synchronize calls to a method. |
TotalBundles
Statistics: the total number of times this Bundle has been used for bundled request processing.
Declaration
public long TotalBundles { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
TotalBurstDuration
Statistics: a total time duration this Bundle has spent in bundled request processing (burst).
Declaration
public long TotalBurstDuration { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
TotalSize
Statistics: the total size of individual requests processed by this Bundle expressed in the same units as values returned by the BundleSize method.
Declaration
public long TotalSize { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
TotalWaitDuration
Statistics: a total time duration this Bundle has spent waiting for bundle to be ready for processing.
Declaration
public long TotalWaitDuration { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
Methods
EnsureResults()
Obtain results of the bundled requests. This method should be implemented by concrete Bundle implementations using the most efficient mechanism.
Declaration
public abstract void EnsureResults()
EnsureResults(bool)
Obtain results of the bundled requests or ensure that the results have already been retrieved.
Declaration
protected bool EnsureResults(bool isBurst)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isBurst | Specifies whether or not the actual results have to be fetched on this thread; this parameter will be true for one and only one thread per bundle |
Returns
| Type | Description |
|---|---|
| bool | True if the bundling has succeeded; false if the un-bundling has to be performed as a result of a failure. |
FormatStatusName(int)
Return a human readable name for the specified status value.
Declaration
protected static string FormatStatusName(int status)
Parameters
| Type | Name | Description |
|---|---|---|
| int | status | The status value to format. |
Returns
| Type | Description |
|---|---|
| string | A human readable status name. |
IsException()
Check whether or not this bundle is in the "exception" state - bundled execution threw an exception and requests have to be un-bundled.
Declaration
protected bool IsException()
Returns
| Type | Description |
|---|---|
| bool | True iff this Bundle is in the "exception" state. |
IsOpen()
Check whether or not this bundle is open for adding request elements.
Declaration
public bool IsOpen()
Returns
| Type | Description |
|---|---|
| bool | True iff this Bundle is still open. |
IsPending()
Check whether or not this bundle is in the "pending" state - awaiting for the execution results.
Declaration
protected bool IsPending()
Returns
| Type | Description |
|---|---|
| bool | True iff this Bundle is in the "pending" state. |
IsProcessed()
Check whether or not this bundle is in the "processed" state - ready to return the result of execution back to the client.
Declaration
protected bool IsProcessed()
Returns
| Type | Description |
|---|---|
| bool | True iff this Bundle is in the "processed" state. |
ReleaseThread()
Release all bundle resources associated with the current thread.
Declaration
protected bool ReleaseThread()
Returns
| Type | Description |
|---|---|
| bool | True iff all entered threads have released. |
ResetStatistics()
Reset statistics for this Bundle.
Declaration
public void ResetStatistics()
SetStatus(int)
Change the status of this Bundle.
Declaration
protected void SetStatus(int status)
Parameters
| Type | Name | Description |
|---|---|---|
| int | status | The new status value. |
ToString()
Provide a human readable description for the Bundle object (for debugging).
Declaration
public string ToString()
Returns
| Type | Description |
|---|---|
| string | A human readable description for the Bundle object. |
WaitForResults(bool)
Wait until results of bundled requests are retrieved.
Declaration
public bool WaitForResults(bool isFirst)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isFirst | True iff this is the first thread entering the bundle |
Returns
| Type | Description |
|---|---|
| bool | True if this thread is supposed to perform an actual bundled operation (burst); false otherwise |