@Override public Object evaluate(ExecutionContext context) { if (!context.isBindArgsSet()) { return null; } Object obj = context.getBindArgument(this.index); // check for BucketRegion substitution if (obj instanceof Region) { PartitionedRegion pr = context.getPartitionedRegion(); if (pr != null) { if (pr.getFullPath().equals(((Region) obj).getFullPath())) { obj = context.getBucketRegion(); } } } return obj; }
@Override public Object evaluate(ExecutionContext context) throws FunctionDomainException, TypeMismatchException, NameResolutionException, QueryInvocationTargetException { CompiledValue v = context.resolve(getId()); Object obj = v.evaluate(context); // check for BucketRegion substitution PartitionedRegion pr = context.getPartitionedRegion(); if (pr != null && (obj instanceof Region)) { if (pr.getFullPath().equals(((Region) obj).getFullPath())) { obj = context.getBucketRegion(); } } return obj; }
/** * Returns the size of region iterator for count(*) on a region without whereclause. * * @since GemFire 6.6.2 */ private int getRegionIteratorSize(ExecutionContext context, CompiledValue collExpr) throws RegionNotFoundException { Region region; String regionPath = ((CompiledRegion) collExpr).getRegionPath(); if (context.getBucketRegion() == null) { region = context.getCache().getRegion(regionPath); } else { region = context.getBucketRegion(); } if (region != null) { return region.size(); } else { // if we couldn't find the region because the cache is closed, throw // a CacheClosedException Cache cache = context.getCache(); if (cache.isClosed()) { throw new CacheClosedException(); } throw new RegionNotFoundException( String.format("Region not found: %s", regionPath)); } }
rgn = context.getBucketRegion(); } else if (pr != null) { BucketRegion br = context.getBucketRegion(); int bucketID = br.getId();
if (pr != null && (result instanceof Region)) { if (pr.getFullPath().equals(((Region) result).getFullPath())) { result = context.getBucketRegion();
if (pr != null && (obj instanceof Region)) { if (pr.getFullPath().equals(((Region) obj).getFullPath())) { obj = context.getBucketRegion();