public Query newQuery(String queryString, ProxyCache proxyCache) { Query query = newQuery(queryString); ((DefaultQuery) query).setProxyCache(proxyCache); return query; }
public UserAttributes getUserAttributes(String cqName) { try { return getCqService().getUserAttributes(cqName); } catch (CqException ce) { return null; } }
/** * Returns the QueryService, that can be used to execute Query functions on the servers associated * with this pool. * * @return the QueryService */ @Override public QueryService getQueryService() { DefaultQueryService queryService = new DefaultQueryService(cache); queryService.setPool(this); return queryService; }
/** * Returns all the cq on a given region. */ @Override public CqQuery[] getCqs(final String regionName) throws CqException { return toArray(getCqService().getAllCqs(regionName)); }
@Override public List<String> getAllDurableCqsFromServer() throws CqException { if (!isServer()) { if (pool != null) { return getCqService().getAllDurableCqsFromServer(pool); } else { throw new UnsupportedOperationException( "GetAllDurableCQsFromServer requires a pool to be configured."); } } else { // we are a server return Collections.EMPTY_LIST; } }
query = qService.newQuery(cqQueryString); cqRegionNames = ((DefaultQuery) query).getRegionsInQuery(null); executeCQContext = authzRequest.executeCQAuthorize(cqName, cqQueryString, cqRegionNames); query = qService.newQuery(newCqQueryString); cqQueryString = newCqQueryString; cqRegionNames = executeCQContext.getRegionNames(); cqServiceForExec = qService.getCqService(); cqQuery = cqServiceForExec.executeCq(cqName, cqQueryString, cqState, id, acceptor.getCacheClientNotifier(), isDurable, false, 0, null); try { if (query == null) { query = qService.newQuery(cqQueryString); cqRegionNames = ((DefaultQuery) query).getRegionsInQuery(null);
@Override public CqQuery newCq(String cqName, String queryString, CqAttributes cqAttributes) throws QueryInvalidException, CqExistsException, CqException { preOp(true); try { if (cqName == null) { throw new IllegalArgumentException( "cqName must not be null"); } ClientCQ cq = ((DefaultQueryService) realQueryService).getCqService().newCq(cqName, queryString, cqAttributes, ((DefaultQueryService) realQueryService).getPool(), false); cq.setProxyCache(proxyCache); this.cqNames.add(cq.getName()); return cq; } finally { postOp(); } }
CqService cqService = null; try { cqService = queryService.getCqService(); } catch (CqException e) { if (logger.isDebugEnabled()) { CqQuery[] cqs = queryService.getCqs(regionName);
@Override public Index createIndex(String indexName, IndexType indexType, String indexedExpression, String fromClause) throws IndexNameConflictException, IndexExistsException, RegionNotFoundException { return createIndex(indexName, indexType, indexedExpression, fromClause, null); }
@Override public List<Index> createDefinedIndexes() throws MultiIndexCreationException { HashSet<Index> indexes = new HashSet<Index>(); boolean throwException = false; HashMap<String, Exception> exceptionsMap = new HashMap<String, Exception>(); synchronized (indexDefinitions) { for (Entry<Region, HashSet<IndexCreationData>> e : indexDefinitions.entrySet()) { Region region = e.getKey(); HashSet<IndexCreationData> icds = e.getValue(); if (region instanceof PartitionedRegion) { throwException = createDefinedIndexesForPR(indexes, (PartitionedRegion) region, icds, exceptionsMap); } else { throwException = createDefinedIndexesForReplicatedRegion(indexes, region, icds, exceptionsMap); } } } // end sync if (throwException) { throw new MultiIndexCreationException(exceptionsMap); } return new ArrayList<Index>(indexes); }
@Override public void defineIndex(String indexName, String indexedExpression, String fromClause) throws RegionNotFoundException { defineIndex(indexName, IndexType.FUNCTIONAL, indexedExpression, fromClause, null); }
region = getRegionFromPath(imports, fromClause);
@Override public QueryService getLocalQueryService() { return new DefaultQueryService(this); }
@Override public Index createHashIndex(String indexName, String indexedExpression, String fromClause) throws IndexNameConflictException, IndexExistsException, RegionNotFoundException { return createHashIndex(indexName, indexedExpression, fromClause, null); }
@Override public List<String> getAllDurableCqsFromServer() throws CqException { preOp(); try { ((DefaultQueryService) realQueryService).getAllDurableCqsFromServer(); } catch (CqException cqe) { if (logger.isDebugEnabled()) { logger.debug("Unable to get all durablec client cqs on the specified region. Error: {}", cqe.getMessage(), cqe); } } return Collections.EMPTY_LIST; }
query = qService.newQuery(cqQueryString); cqRegionNames = ((DefaultQuery) query).getRegionsInQuery(null); if (authzRequest != null) { query = qService.newQuery(newCqQueryString); cqQueryString = newCqQueryString; cqRegionNames = executeCQContext.getRegionNames(); cqServiceForExec = (CqServiceImpl) qService.getCqService(); query = qService.newQuery(cqQueryString); cqRegionNames = ((DefaultQuery) query).getRegionsInQuery(null);
@Override public CqQuery newCq(String cqName, String queryString, CqAttributes cqAttributes, boolean isDurable) throws QueryInvalidException, CqExistsException, CqException { preOp(true); try { if (cqName == null) { throw new IllegalArgumentException( "cqName must not be null"); } ClientCQ cq = ((DefaultQueryService) realQueryService).getCqService().newCq(cqName, queryString, cqAttributes, ((DefaultQueryService) realQueryService).getPool(), isDurable); cq.setProxyCache(proxyCache); this.cqNames.add(cq.getName()); return cq; } finally { postOp(); } }
/** * Retrieve all CqQuerys created by this VM. * * @return null if there are no cqs. */ @Override public CqQuery[] getCqs() { CqQuery[] cqs = null; try { return toArray(getCqService().getAllCqs()); } catch (CqException cqe) { if (logger.isDebugEnabled()) { logger.debug("Unable to getAllCqs. Error :{}", cqe.getMessage(), cqe); } } return cqs; }
@Override public Index createKeyIndex(String indexName, String indexedExpression, String fromClause) throws IndexNameConflictException, IndexExistsException, RegionNotFoundException { return createIndex(indexName, IndexType.PRIMARY_KEY, indexedExpression, fromClause, null); }
@Override public void defineHashIndex(String indexName, String indexedExpression, String fromClause) throws RegionNotFoundException { defineIndex(indexName, IndexType.HASH, indexedExpression, fromClause, null); }