Pivotal GemFire Native C++ Reference  10.1.3
apache::geode::client::QueryService Class Referenceabstract

Public Member Functions

virtual void closeCqs ()=0
 Close all CQs, and release resources associated with executing CQs. More...
 
virtual void executeCqs ()=0
 @nativeclient Executes all the cqs on this client. More...
 
virtual std::shared_ptr< CacheableArrayListgetAllDurableCqsFromServer () const =0
 Gets all the durable CQs registered by this client. More...
 
virtual std::shared_ptr< CqQuerygetCq (const std::string &name) const =0
 Retrieve a CqQuery by name. More...
 
virtual query_container_type getCqs () const =0
 @nativeclient Retrieve all registered CQs @endnativeclient More...
 
virtual std::shared_ptr< CqServiceStatisticsgetCqServiceStatistics () const =0
 @nativeclient Get statistics information for all CQs More...
 
virtual std::shared_ptr< CqQuerynewCq (std::string name, std::string querystr, const std::shared_ptr< CqAttributes > &cqAttr, bool isDurable=false)=0
 Constructs a new named continuous query, represented by an instance of CqQuery. More...
 
virtual std::shared_ptr< CqQuerynewCq (std::string querystr, const std::shared_ptr< CqAttributes > &cqAttr, bool isDurable=false)=0
 @nativeclient Constructs a new named continuous query, represented by an instance of CqQuery. More...
 
virtual std::shared_ptr< QuerynewQuery (std::string querystr)=0
 Get a new Query with the specified query string. 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

◆ closeCqs()

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

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

◆ executeCqs()

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

@nativeclient Executes all the cqs on this client.

@endnativeclient

◆ getAllDurableCqsFromServer()

virtual std::shared_ptr<CacheableArrayList> apache::geode::client::QueryService::getAllDurableCqsFromServer ( ) const
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.

◆ getCq()

virtual std::shared_ptr<CqQuery> apache::geode::client::QueryService::getCq ( const std::string &  name) const
pure virtual

Retrieve a CqQuery by name.

Returns
the CqQuery or nullptr if not found

◆ getCqs()

virtual query_container_type apache::geode::client::QueryService::getCqs ( ) const
pure virtual

@nativeclient Retrieve all registered CQs @endnativeclient

◆ getCqServiceStatistics()

virtual std::shared_ptr<CqServiceStatistics> apache::geode::client::QueryService::getCqServiceStatistics ( ) const
pure virtual

@nativeclient Get statistics information for all CQs

Returns
the CqServiceStatistics @endnativeclient

◆ newCq() [1/2]

virtual std::shared_ptr<CqQuery> apache::geode::client::QueryService::newCq ( std::string  name,
std::string  querystr,
const std::shared_ptr< CqAttributes > &  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.

◆ newCq() [2/2]

virtual std::shared_ptr<CqQuery> apache::geode::client::QueryService::newCq ( std::string  querystr,
const std::shared_ptr< CqAttributes > &  cqAttr,
bool  isDurable = false 
)
pure virtual

@nativeclient 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.

@endnativeclient

◆ newQuery()

virtual std::shared_ptr<Query> apache::geode::client::QueryService::newQuery ( std::string  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.

◆ stopCqs()

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

Stops all the cqs on this client.


Apache Geode C++ Cache API Documentation