ScaleOut C++ Native Client API  5.1
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Pages
sosscli::LockOptions Class Reference

The LockOptions class contains options that control the blocking and retry behavior of the NamedCache::lock method. More...

#include <lock_options.h>

Public Member Functions

 LockOptions ()
 Default constructor. Creates a LockOptions class that performs up 20000 lock retries, 5 milliseconds apart.
 
 LockOptions (bool throw_on_error, int32_t max_lock_retry_count, int32_t lock_retry_interval_ms)
 Constructor. More...
 
virtual ~LockOptions ()
 Destructor.
 
bool throw_on_error () const
 Returns a boolean indicating whether a method will throw an exception derived from sosscli::exceptions::StateServerException if the ScaleOut StateServer service returns an error. More...
 
LockOptionsset_throw_on_error (bool throw_on_error)
 Sets whether a method will throw an exception derived from sosscli::exceptions::StateServerException if the ScaleOut StateServer service returns an error. More...
 
int32_t max_lock_retry_count () const
 Gets the number of retries that the lock call should perform when polling to acquire an exclusive lock on an object.
 
LockOptionsset_max_lock_retry_count (int32_t max_lock_retry_count)
 Sets the number of retries that the lock call should perform when polling to acquire an exclusive lock on an object. More...
 
int32_t lock_retry_interval_ms () const
 Gets the amount of time (in milliseconds) between polling attempts to acquire an exclusive lock on a cached object.
 
LockOptionsset_lock_retry_interval_ms (int32_t lock_retry_interval_ms)
 Sets the amount of time (in milliseconds) between polling attempts to acquire an exclusive lock on a cached object. More...
 

Static Public Attributes

static const LockOptions CACHE_DEFAULTS
 LockOptions constant that indicates that a lock() operation should use the cache's default options. More...
 

Detailed Description

The LockOptions class contains options that control the blocking and retry behavior of the NamedCache::lock method.

Constructor & Destructor Documentation

sosscli::LockOptions::LockOptions ( bool  throw_on_error,
int32_t  max_lock_retry_count,
int32_t  lock_retry_interval_ms 
)
inline

Constructor.

Parameters
throw_on_errorDetermines whether a method will throw an exception derived from sosscli::exceptions::StateServerException if the ScaleOut StateServer service returns an error. If false, error code information will be available in the returned LockResult.
max_lock_retry_countNumber of retries that the lock call should perform when polling to acquire an exclusive lock on an object.
lock_retry_interval_msAmount of time (in milliseconds) between polling attempts to acquire an exclusive lock on a cached object.

Member Function Documentation

LockOptions& sosscli::LockOptions::set_lock_retry_interval_ms ( int32_t  lock_retry_interval_ms)
inline

Sets the amount of time (in milliseconds) between polling attempts to acquire an exclusive lock on a cached object.

Parameters
lock_retry_interval_msAmount of time (in milliseconds) between polling attempts to acquire an exclusive lock on a cached object.
Returns
*this by reference to allow for chained setter method calls.
LockOptions& sosscli::LockOptions::set_max_lock_retry_count ( int32_t  max_lock_retry_count)
inline

Sets the number of retries that the lock call should perform when polling to acquire an exclusive lock on an object.

Parameters
max_lock_retry_countNumber of retries that the lock call should perform when polling to acquire an exclusive lock on an object.
Returns
*this by reference to allow for chained setter method calls.
LockOptions& sosscli::LockOptions::set_throw_on_error ( bool  throw_on_error)
inline

Sets whether a method will throw an exception derived from sosscli::exceptions::StateServerException if the ScaleOut StateServer service returns an error.

If false, error code information will be available in the returned LockResult.

Parameters
throw_on_errorDetermines whether a method will throw an exception derived from sosscli::exceptions::StateServerException if the ScaleOut StateServer service returns an error. If false, error code information will be available in the returned LockResult.
Returns
*this by reference to allow for chained setter method calls.
bool sosscli::LockOptions::throw_on_error ( ) const
inline

Returns a boolean indicating whether a method will throw an exception derived from sosscli::exceptions::StateServerException if the ScaleOut StateServer service returns an error.

If false, error code information will be available in the returned LockResult.

Member Data Documentation

const LockOptions sosscli::LockOptions::CACHE_DEFAULTS
static

LockOptions constant that indicates that a lock() operation should use the cache's default options.


The documentation for this class was generated from the following file: