Oracle® Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47891-01

AbstractBundler::Bundle Class Reference

#include <coherence/net/cache/AbstractBundler.hpp>

Inherits Object.

Inherited by AbstractKeyBundler::Bundle.

List of all members.


Detailed Description

Bundle represents a unit of optimized execution.

Public Types

typedef spec::Handle Handle
 Bundle Handle definition.
typedef spec::View View
 Bundle View definition.
typedef spec::Holder Holder
 Bundle Holder definition.

Public Member Functions

virtual bool isOpen () const
 Check whether or not this bundle is open for adding request elements.
virtual
AbstractBundler::Handle 
getBundler ()
 Return the Bundler.
virtual bool waitForResults (bool fFirst)
 Wait until results of bundled requests are retrieved.
virtual void resetStatistics ()
 Reset statistics for this Bundle.

Static Public Attributes

static const int32_t status_open
 This Bundle accepting additional items.
static const int32_t status_pending
 This Bundle is closed for accepting additional items and awaiting for the execution results.
static const int32_t status_processed
 This Bundle is in process of returning the result of execution back to the client.
static const int32_t status_exception
 Attempt to bundle encountered and exception; the execution has to be de-optimized and performed by individual threads.

Protected Member Functions

 Bundle (AbstractBundler::Handle hBundler)
 Default constructor.
virtual bool isPending () const
 Check whether or not this bundle is in the "pending" state - awaiting for the execution results.
virtual bool isProcessed () const
 Check whether or not this bundle is in the "processed" state - ready to return the result of execution back to the client.
virtual bool isException () const
 Check whether or not this bundle is in the "exception" state - bundled execution threw an exception and requests have to be un-bundled.
virtual void setStatus (int32_t iStatus)
 Change the status of this Bundle.
virtual int32_t getBundleSize () const
 Obtain this bundle size.
virtual bool isMaster () const
 Check whether or not this is a "master" Bundle.
virtual void setMaster ()
 Designate this Bundle as a "master" bundle.
virtual void ensureResults ()=0
 Obtain results of the bundled requests.
virtual bool ensureResults (bool fBurst)
 Obtain results of the bundled requests or ensure that the results have already been retrieved.
virtual bool releaseThread ()
 Release all bundle resources associated with the current thread.
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);

Parameters:
out the stream used to output the description

virtual String::View formatStatusName (int32_t iStatus) const
 Return a human readable name for the specified status value.

Protected Attributes

Volatile< int64_t > m_cTotalBundles
 Statistics: the total number of times this Bundle has been used for bundled request processing.
Volatile< int64_t > m_cTotalSize
 Statistics: the total size of individual requests processed by this Bundle expressed in the same units as values returned by the Bundle::getBundleSize() method.
int64_t m_ldtStart
 Statistics: a timestamp of the first thread entering the bundle.
Volatile< int64_t > m_cTotalBurstDuration
 Statistics: a total time duration this Bundle has spent in bundled request processing (burst).
Volatile< int64_t > m_cTotalWaitDuration
 Statistics: a total time duration this Bundle has spent waiting for bundle to be ready for processing.

Constructor & Destructor Documentation

Bundle ( AbstractBundler::Handle  hBundler  )  [protected]

Default constructor.

Parameters:
hBundler the AbstructBundler

Reimplemented in AbstractKeyBundler::Bundle.


Member Function Documentation

virtual bool isOpen (  )  const [virtual]

Check whether or not this bundle is open for adding request elements.

Returns:
true if this Bundle is still open

virtual AbstractBundler::Handle getBundler (  )  [virtual]

Return the Bundler.

Returns:
the Bundler

virtual bool isPending (  )  const [protected, virtual]

Check whether or not this bundle is in the "pending" state - awaiting for the execution results.

Returns:
true if this Bundle is in the "pending" state

virtual bool isProcessed (  )  const [protected, virtual]

Check whether or not this bundle is in the "processed" state - ready to return the result of execution back to the client.

Returns:
true if this Bundle is in the "processed" state

virtual bool isException (  )  const [protected, virtual]

Check whether or not this bundle is in the "exception" state - bundled execution threw an exception and requests have to be un-bundled.

Returns:
true if this Bundle is in the "exception" state

virtual void setStatus ( int32_t  iStatus  )  [protected, virtual]

Change the status of this Bundle.

Parameters:
iStatus the new status value

virtual int32_t getBundleSize (  )  const [protected, virtual]

Obtain this bundle size.

The return value should be expressed in the same units as the value returned by the getSizeThreshold method.

Returns:
the bundle size

Reimplemented in AbstractKeyBundler::Bundle.

virtual bool isMaster (  )  const [protected, virtual]

Check whether or not this is a "master" Bundle.

Returns:
true if this Bundle is a designated "master" Bundle

virtual bool waitForResults ( bool  fFirst  )  [virtual]

Wait until results of bundled requests are retrieved.

Note that calls to this method must be externally synchronized.

Parameters:
fFirst true if this is the first thread entering the bundle
Returns:
true if this thread is supposed to perform an actual bundled operation (burst); false otherwise

virtual void ensureResults (  )  [protected, pure virtual]

Obtain results of the bundled requests.

This method should be implemented by concrete Bundle implementations using the most efficient mechanism.

Implemented in AbstractKeyBundler::Bundle.

virtual bool ensureResults ( bool  fBurst  )  [protected, virtual]

Obtain results of the bundled requests or ensure that the results have already been retrieved.

Parameters:
fBurst 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:
true if the bundling has succeeded; false if the un-bundling has to be performed as a result of a failure

virtual bool releaseThread (  )  [protected, virtual]

Release all bundle resources associated with the current thread.

Returns:
true if all entered threads have released

Reimplemented in AbstractKeyBundler::Bundle.

virtual String::View formatStatusName ( int32_t  iStatus  )  const [protected, virtual]

Return a human readable name for the specified status value.

Parameters:
iStatus the status value to format
Returns:
a human readable status name


The documentation for this class was generated from the following file:
Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.