|
GemFire 5.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface QueryService
Interface for the query service, which is used for instantiating queries,
creating and destroying indexes, creating CQs and operating on CQs.
The CQs work on the server regions, the client can use the CQ methods supported
in this class to create/operate CQs on the server. The CQ obtains the Server
connection from the corresponding local region on the client.
The implementation of this interface is obtained from the Cache
using Cache.getQueryService().
| Field Summary | |
|---|---|
static com.gemstone.gemfire.cache.query.internal.Undefined |
UNDEFINED
The undefined constant |
| Method Summary | |
|---|---|
void |
closeCqs()
Unregister all Continuous Queries. |
Index |
createIndex(String indexName,
IndexType indexType,
String indexedExpression,
String fromClause)
Create an index that can be used when executing queries. |
Index |
createIndex(String indexName,
IndexType indexType,
String indexedExpression,
String fromClause,
String imports)
Create an index that can be used when executing queries. |
void |
executeCqs()
Starts execution of all the registered continuous queries for this client. |
void |
executeCqs(String regionName)
Starts execution of all the continuous queries registered on the specified region for this client. |
CqQuery |
getCq(String cqName)
Retrieves the Continuous Query specified by the name. |
CqQuery[] |
getCqs()
Retrieve all registered Continuous Queries. |
CqQuery[] |
getCqs(String regionName)
Retrieves all the registered Continuous Queries for a given region. |
CqServiceStatistics |
getCqStatistics()
Returns CqServiceStatistics object, which provides helper methods to get CQ service related statistics for this client. |
Index |
getIndex(Region region,
String indexName)
Get the Index from the specified Region with the specified name. |
Collection |
getIndexes()
Get a collection of all the indexes in the Cache. |
Collection |
getIndexes(Region region)
Get a collection of all the indexes on the specified Region |
Collection |
getIndexes(Region region,
IndexType indexType)
Get a collection of all the indexes on the specified Region of the specified index type. |
CqQuery |
newCq(String queryString,
CqAttributes cqAttr)
Constructs a new continuous query, represented by an instance of CqQuery. |
CqQuery |
newCq(String queryString,
CqAttributes cqAttr,
boolean isDurable)
Constructs a new continuous query, represented by an instance of CqQuery. |
CqQuery |
newCq(String name,
String queryString,
CqAttributes cqAttr)
Constructs a new named continuous query, represented by an instance of CqQuery. |
CqQuery |
newCq(String name,
String queryString,
CqAttributes cqAttr,
boolean isDurable)
Constructs a new named continuous query, represented by an instance of CqQuery. |
Query |
newQuery(String queryString)
Constructs a new Query object. |
void |
removeIndex(Index index)
Remove the specified index. |
void |
removeIndexes()
Remove all the indexes from this cache. |
void |
removeIndexes(Region region)
Remove all the indexes on the specified Region |
void |
stopCqs()
Stops execution of all the continuous queries for this client to become inactive. |
void |
stopCqs(String regionName)
Stops execution of all the continuous queries registered on the specified region for this client. |
| Field Detail |
|---|
static final com.gemstone.gemfire.cache.query.internal.Undefined UNDEFINED
| Method Detail |
|---|
Query newQuery(String queryString)
Query object.
queryString - the String that is the query program
Query object.
QueryInvalidException - if the syntax of the queryString is invalid.Query
Index createIndex(String indexName,
IndexType indexType,
String indexedExpression,
String fromClause)
throws IndexInvalidException,
IndexNameConflictException,
IndexExistsException,
RegionNotFoundException,
UnsupportedOperationException
indexName - the name of this index, used for statistics collection and
to identify this index for later accessindexType - the type of indexindexedExpression - the expression to index on, a function dependent
on region entries individually; must not contain query parameters
(e.g. $1).fromClause - expression that evaluates to the collection(s) that will
be queried over, must contain one and only one region path, must
not contain query parameters. For primary key indexes, the
fromClause must be just one collection which must be a region path
only.
QueryInvalidException - if the argument query lanaguage strings have
invalid syntax
IndexInvalidException - if the arguments do not correctly specify an
index
IndexNameConflictException - if an index with this name already
exists
IndexExistsException - if an index with these parameters already
exists with a different name
RegionNotFoundException - if the region referred to in the fromClause
doesn't exist
UnsupportedOperationException - If Index is being created on a region which
overflows to disk
Index createIndex(String indexName,
IndexType indexType,
String indexedExpression,
String fromClause,
String imports)
throws IndexInvalidException,
IndexNameConflictException,
IndexExistsException,
RegionNotFoundException,
UnsupportedOperationException
indexName - the name of this index, used for statistics collection and
to identify this index for later accessindexType - the type of indexindexedExpression - the expression to index on, a function dependent
on region entries individually; must not contain query parameters
(e.g. $1).fromClause - expression that evaluates to the collection(s) that will
be queried over, must contain one and only one region path, must
not contain query parameters. For primary key indexes, the
fromClause must be just one collection which must be a region path
only.imports - string containing imports (in the query language syntax,
each import statement separated by a semicolon), providing an
import context for the indexedExpression and the fromClause.
QueryInvalidException - if the argument query language strings have
invalid syntax
IndexInvalidException - if the arguments do not correctly specify an
index
IndexNameConflictException - if an index with this name already
exists
IndexExistsException - if an index with these parameters already
exists with a different name
RegionNotFoundException - if the region referred to in the fromClause
doesn't exist
UnsupportedOperationException - If Index is being created on a region which
overflows to disk
Index getIndex(Region region,
String indexName)
region - the Region for the requested index
Collection getIndexes()
Collection getIndexes(Region region)
region - the region for the requested indexes
Collection getIndexes(Region region,
IndexType indexType)
region - the region for the requested indexesindexType - the type of indexes to get. Currently must be
Indexable.FUNCTIONAL
void removeIndex(Index index)
index - the Index to removevoid removeIndexes()
void removeIndexes(Region region)
region - the Region to remove all indexes from
CqQuery newCq(String queryString,
CqAttributes cqAttr)
throws QueryInvalidException,
CqException,
CqInvalidException
queryString - the OQL querycqAttr - the CqAttributes
IllegalArgumentException - if queryString or cqAttr is null.
IllegalStateException - if this method is called from a cache
server.
QueryInvalidException - if there is a syntax error in the query.
CqException - if failed to create CQ.
CqInvalidException - if the query does not meet the CQ constraints.
E.g.: Query string should refer to only one region.
Joins are 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 yet supported.
CqQuery newCq(String queryString,
CqAttributes cqAttr,
boolean isDurable)
throws QueryInvalidException,
CqException,
CqInvalidException
queryString - the OQL querycqAttr - the CqAttributesisDurable - true if the CQ is durable
IllegalArgumentException - if queryString or cqAttr is null.
IllegalStateException - if this method is called from a cache
server.
QueryInvalidException - if there is a syntax error in the query.
CqException - if failed to create CQ.
CqInvalidException - if the query does not meet the CQ constraints.
E.g.: Query string should refer to only one region.
Joins are 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 yet supported.
CqQuery newCq(String name,
String queryString,
CqAttributes cqAttr)
throws QueryInvalidException,
CqExistsException,
CqException,
CqInvalidException
name - the String name for this queryqueryString - the OQL querycqAttr - the CqAttributes
CqExistsException - if a CQ by this name already exists on this
client
IllegalArgumentException - if queryString or cqAttr is null.
IllegalStateException - if this method is called from a cache
server.
QueryInvalidException - if there is a syntax error in the query.
CqException - if failed to create cq.
CqInvalidException - if the query does not meet the CQ constraints.
E.g.: Query string should refer to only one region.
Joins are 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 yet supported.
CqQuery newCq(String name,
String queryString,
CqAttributes cqAttr,
boolean isDurable)
throws QueryInvalidException,
CqExistsException,
CqException,
CqInvalidException
name - the String name for this queryqueryString - the OQL querycqAttr - the CqAttributesisDurable - true if the CQ is durable
CqExistsException - if a CQ by this name already exists on this
client
IllegalArgumentException - if queryString or cqAttr is null.
IllegalStateException - if this method is called from a cache
server.
QueryInvalidException - if there is a syntax error in the query.
CqException - if failed to create cq.
CqInvalidException - if the query does not meet the CQ constraints.
E.g.: Query string should refer to only one region.
Joins are 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 yet supported.void closeCqs()
CqQuery[] getCqs()
CqQuery[] getCqs(String regionName)
throws CqException
CqException - if the region does not exist.CqQuery getCq(String cqName)
cqName - - String, name of the CQ
void executeCqs()
throws CqException
CqException - if failure to execute CQ.stopCqs()
void stopCqs()
throws CqException
CqException - if failure to execute CQ.executeCqs()
void executeCqs(String regionName)
throws CqException
CqException - if failure to stop CQs.stopCqs()
void stopCqs(String regionName)
throws CqException
CqException - if failure to execute CQs.executeCqs()CqServiceStatistics getCqStatistics()
CqServiceStatistics
|
GemFire 5.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||