VMware GemFire Native C++ Reference  9.1
apache::geode::client::QueryService Class Referenceabstract

QueryService is the class obtained from a Cache. More...

Inherits apache::geode::client::SharedBase.

Public Member Functions

virtual void closeCqs ()=0
 Close all CQs, and release resources associated with executing CQs. More...
 
virtual void executeCqs ()=0
 Executes all the cqs on this client. More...
 
virtual CacheableArrayListPtr getAllDurableCqsFromServer ()=0
 Gets all the durable CQs registered by this client. More...
 
virtual CqQueryPtr getCq (const char *name)=0
 Retrieve a CqQuery by name. More...
 
virtual void getCqs (VectorOfCqQuery &vec)=0
 Retrieve all registered CQs. More...
 
virtual CqServiceStatisticsPtr getCqServiceStatistics ()=0
 Get statistics information for all CQs. More...
 
virtual CqQueryPtr newCq (const char *name, const char *querystr, CqAttributesPtr &cqAttr, bool isDurable=false)=0
 Constructs a new named continuous query, represented by an instance of CqQuery. More...
 
virtual CqQueryPtr newCq (const char *querystr, CqAttributesPtr &cqAttr, bool isDurable=false)=0
 Constructs a new named continuous query, represented by an instance of CqQuery. More...
 
virtual QueryPtr newQuery (const char *querystr)=0
 Get a new Query with the specified query string. More...
 
void preserveSB () const
 Atomically increment reference count. More...
 
int32_t refCount ()
 
void releaseSB () const
 Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero. More...
 
virtual void stopCqs ()=0
 Stops all the cqs on this client. More...
 

Detailed Description

QueryService is the class obtained from a Cache.

A Query is created from a QueryService and executed on the server returning a SelectResults which can be either a ResultSet or a StructSet.

Member Function Documentation

virtual void apache::geode::client::QueryService::closeCqs ( )
pure virtual

Close all CQs, and release resources associated with executing CQs.

virtual void apache::geode::client::QueryService::executeCqs ( )
pure virtual

Executes all the cqs on this client.

virtual CacheableArrayListPtr apache::geode::client::QueryService::getAllDurableCqsFromServer ( )
pure virtual

Gets all the durable CQs registered by this client.

Returns
List of names of registered durable CQs, empty list if no durable cqs.
virtual CqQueryPtr apache::geode::client::QueryService::getCq ( const char *  name)
pure virtual

Retrieve a CqQuery by name.

Returns
the CqQuery or NULLPTR if not found
virtual void apache::geode::client::QueryService::getCqs ( VectorOfCqQuery vec)
pure virtual

Retrieve all registered CQs.

virtual CqServiceStatisticsPtr apache::geode::client::QueryService::getCqServiceStatistics ( )
pure virtual

Get statistics information for all CQs.

Returns
the CqServiceStatistics
virtual CqQueryPtr apache::geode::client::QueryService::newCq ( const char *  name,
const char *  querystr,
CqAttributesPtr cqAttr,
bool  isDurable = false 
)
pure virtual

Constructs a new named continuous query, represented by an instance of CqQuery.

The CqQuery is not executed, however, until the execute method is invoked on the CqQuery. The name of the query will be used to identify this query in statistics archival.

Parameters
cqNamethe String name for this query
queryStringthe OQL query
cqAttributesthe CqAttributes
isDurabletrue if the CQ is durable
Returns
the newly created CqQuery object
Exceptions
CqExistsExceptionif a CQ by this name already exists on this client
IllegalArgumentExceptionif queryString is null, or cqAttr is NULLPTR
IllegalStateExceptionif this method is called from a cache server
QueryInvalidExceptionif there is a syntax error in the query
CqExceptionif failed to create cq, failure during creating managing cq metadata info.
CqInvalidExceptionif the query doesnot meet the CQ constraints. E.g.: Query string should refer only one region, join not supported. The query must be a SELECT statement. DISTINCT queries are not supported. Projections are not supported. Only one iterator in the FROM clause is supported, and it must be a region path. Bind parameters in the query are not supported for the initial release.
virtual CqQueryPtr apache::geode::client::QueryService::newCq ( const char *  querystr,
CqAttributesPtr cqAttr,
bool  isDurable = false 
)
pure virtual

Constructs a new named continuous query, represented by an instance of CqQuery.

The CqQuery is not executed, however, until the execute method is invoked on the CqQuery. The name of the query will be used to identify this query in statistics archival.

Parameters
queryStringthe OQL query
cqAttributesthe CqAttributes
isDurabletrue if the CQ is durable
Returns
the newly created CqQuery object
Exceptions
CqExistsExceptionif a CQ by this name already exists on this client
IllegalArgumentExceptionif queryString is null, or cqAttr is NULLPTR
IllegalStateExceptionif this method is called from a cache server
QueryInvalidExceptionif there is a syntax error in the query
CqExceptionif failed to create cq, failure during creating managing cq metadata info.
CqInvalidExceptionif the query doesnot meet the CQ constraints. E.g.: Query string should refer only one region, join not supported. The query must be a SELECT statement. DISTINCT queries are not supported. Projections are not supported. Only one iterator in the FROM clause is supported, and it must be a region path. Bind parameters in the query are not supported for the initial release.
virtual QueryPtr apache::geode::client::QueryService::newQuery ( const char *  querystr)
pure virtual

Get a new Query with the specified query string.

Parameters
querystrThe query string with which to create a new Query.
Returns
A smart pointer to the Query.
void apache::geode::client::SharedBase::preserveSB ( ) const
inherited

Atomically increment reference count.

int32_t apache::geode::client::SharedBase::refCount ( )
inlineinherited
Returns
the reference count
void apache::geode::client::SharedBase::releaseSB ( ) const
inherited

Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero.

virtual void apache::geode::client::QueryService::stopCqs ( )
pure virtual

Stops all the cqs on this client.


Pivotal GemFire C++ Cache API Documentation