/** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public Iterator<?> getLocalEntriesIterator( InternalRegionFunctionContext context, boolean primaryOnly, boolean forUpdate, boolean includeValues, final LocalRegion currRegion) { assert context == null || context.getLocalBucketSet(currRegion) == null: "unexpected bucket set for LocalRegion " + currRegion + ": " + context.getLocalBucketSet(currRegion); return currRegion.getBestLocalIterator(includeValues, 1.0, false); }
/** * Given a RegionFunctionContext {@linkplain RegionFunctionContext#getDataSet() * for a partitioned Region}, return a map of {@linkplain PartitionAttributesFactory#setColocatedWith(String) colocated Regions} * with read access limited to the context of the function. * <p> * Writes using these Region have no constraints and behave the same as a partitioned Region. * <p> * If there are no colocated regions, return an empty map. * * @param c the region function context * @throws IllegalStateException if the Region is not a {@linkplain DataPolicy#PARTITION partitioned Region} * @return an unmodifiable map of {@linkplain Region#getFullPath() region name} to {@link Region} * @since 6.0 */ public static Map<String, Region<?, ?>> getLocalColocatedRegions(final RegionFunctionContext c) { final Region r = c.getDataSet(); isPartitionedCheck(r); final InternalRegionFunctionContext rfci = (InternalRegionFunctionContext)c; Map ret = rfci.getColocatedLocalDataSets(); return ret; }
/** * gets local data of colocated regions on a particular data store * * @param partitionedRegion * @return map of region name to local colocated regions * @since 5.8Beta */ public static Map<String, Region> getAllColocatedLocalDataSets( PartitionedRegion partitionedRegion, InternalRegionFunctionContext context) { Map<String, PartitionedRegion> colocatedRegions = getAllColocationRegions(partitionedRegion); Map<String, Region> colocatedLocalRegions = new HashMap<String, Region>(); for (Iterator itr = colocatedRegions.entrySet().iterator(); itr.hasNext();) { Map.Entry me = (Entry)itr.next(); final Region pr = (Region) me.getValue(); colocatedLocalRegions.put((String)me.getKey(), context.getLocalDataSet(pr)); } return colocatedLocalRegions; }
final Set<Integer> bucketSet; if (context != null && (bucketSet = context.getLocalBucketSet(this)) != null) { return new PRLocalScanIterator(bucketSet, txState, forUpdate, includeValues, true);
/** * gets local data of colocated regions on a particular data store * * @param partitionedRegion * @return map of region name to local colocated regions * @since 5.8Beta */ public static Map<String, Region> getAllColocatedLocalDataSets( PartitionedRegion partitionedRegion, InternalRegionFunctionContext context) { Map<String, PartitionedRegion> colocatedRegions = getAllColocationRegions(partitionedRegion); Map<String, Region> colocatedLocalRegions = new HashMap<String, Region>(); for (Iterator itr = colocatedRegions.entrySet().iterator(); itr.hasNext();) { Map.Entry me = (Entry)itr.next(); final Region pr = (Region) me.getValue(); colocatedLocalRegions.put((String)me.getKey(), context.getLocalDataSet(pr)); } return colocatedLocalRegions; }
/** * Given a RegionFunctionContext {@linkplain RegionFunctionContext#getDataSet() * for a partitioned Region}, return a map of {@linkplain PartitionAttributesFactory#setColocatedWith(String) colocated Regions} * with read access limited to the context of the function. * <p> * Writes using these Region have no constraints and behave the same as a partitioned Region. * <p> * If there are no colocated regions, return an empty map. * * @param c the region function context * @throws IllegalStateException if the Region is not a {@linkplain DataPolicy#PARTITION partitioned Region} * @return an unmodifiable map of {@linkplain Region#getFullPath() region name} to {@link Region} * @since 6.0 */ public static Map<String, Region<?, ?>> getLocalColocatedRegions(final RegionFunctionContext c) { final Region r = c.getDataSet(); isPartitionedCheck(r); final InternalRegionFunctionContext rfci = (InternalRegionFunctionContext)c; Map ret = rfci.getColocatedLocalDataSets(); return ret; }
final boolean isTXView = (view instanceof TXStateInterface); @SuppressWarnings("unchecked") final Set<Integer> bucketSet = context.getLocalBucketSet(this.region); SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_CONGLOM_UPDATE, "GemFireContainer#getEntrySetIterator: Creating "
/** * Given a RegionFunctionContext * {@linkplain RegionFunctionContext#getDataSet() for a partitioned Region}, * return a Region providing read access limited to the function context.<br> * Returned Region provides only one copy of the data although * {@link PartitionAttributes#getRedundantCopies() redundantCopies} configured * is more than 0. If the invoking Function is configured to have * {@link Function#optimizeForWrite() optimizeForWrite} as true,the returned * Region will only contain primary copy of the data. * <p> * Writes using this Region have no constraints and behave the same as a * partitioned Region. * * @param c * a functions context * @throws IllegalStateException * if {@link RegionFunctionContext#getDataSet()} returns something * other than a {@linkplain DataPolicy#PARTITION partitioned Region} * @return a Region for efficient reads * @since 6.0 */ public static <K, V> Region<K, V> getLocalDataForContext(final RegionFunctionContext c) { final Region r = c.getDataSet(); isPartitionedCheck(r); InternalRegionFunctionContext rfci = (InternalRegionFunctionContext)c; return rfci.getLocalDataSet(r); }
final boolean isTXView = (view instanceof TXStateInterface); @SuppressWarnings("unchecked") final Set<Integer> bucketSet = context.getLocalBucketSet(this.region); SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_CONGLOM_UPDATE, "GemFireContainer#getEntrySetIterator: Creating "
/** * Given a RegionFunctionContext * {@linkplain RegionFunctionContext#getDataSet() for a partitioned Region}, * return a Region providing read access limited to the function context.<br> * Returned Region provides only one copy of the data although * {@link PartitionAttributes#getRedundantCopies() redundantCopies} configured * is more than 0. If the invoking Function is configured to have * {@link Function#optimizeForWrite() optimizeForWrite} as true,the returned * Region will only contain primary copy of the data. * <p> * Writes using this Region have no constraints and behave the same as a * partitioned Region. * * @param c * a functions context * @throws IllegalStateException * if {@link RegionFunctionContext#getDataSet()} returns something * other than a {@linkplain DataPolicy#PARTITION partitioned Region} * @return a Region for efficient reads * @since 6.0 */ public static <K, V> Region<K, V> getLocalDataForContext(final RegionFunctionContext c) { final Region r = c.getDataSet(); isPartitionedCheck(r); InternalRegionFunctionContext rfci = (InternalRegionFunctionContext)c; return rfci.getLocalDataSet(r); }
final boolean isTXView = (view instanceof TXStateInterface); @SuppressWarnings("unchecked") final Set<Integer> bucketSet = context.getLocalBucketSet(this.region); SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_CONGLOM_UPDATE, "GemFireContainer#getEntrySetIterator: Creating "
public static Set<Integer> getLocalBucketSet(final GemFireContainer gfc, final LocalRegion region, final Activation act, final String indexType) { try { final FunctionContext fc; if (act != null && (fc = act.getFunctionContext()) != null) { @SuppressWarnings("unchecked") final Set<Integer> localBucketSet = ((InternalRegionFunctionContext)fc) .getLocalBucketSet(region); if (GemFireXDUtils.TraceIndex) { GfxdIndexManager.traceIndex("%s the baseContainer is %s " + "and the local data set is %s, function context is %s", indexType, region.getFullPath(), localBucketSet, fc); } if (GemFireXDUtils.TraceQuery | GemFireXDUtils.TraceNCJ) { SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_QUERYDISTRIB, indexType + " scanning index: " + gfc + ", local data set is " + localBucketSet + ", and the function context: " + fc); } return localBucketSet; } if (GemFireXDUtils.TraceIndex) { GfxdIndexManager.traceIndex("%s the " + "FunctionContext is null ", indexType); } } catch (CacheClosedException ex) { // can happen if GemFireXD is still booting return null; } return null; }
public static Set<Integer> getLocalBucketSet(final GemFireContainer gfc, final LocalRegion region, final Activation act, final String indexType) { try { final FunctionContext fc; if (act != null && (fc = act.getFunctionContext()) != null) { @SuppressWarnings("unchecked") final Set<Integer> localBucketSet = ((InternalRegionFunctionContext)fc) .getLocalBucketSet(region); if (GemFireXDUtils.TraceIndex) { GfxdIndexManager.traceIndex("%s the baseContainer is %s " + "and the local data set is %s, function context is %s", indexType, region.getFullPath(), localBucketSet, fc); } if (GemFireXDUtils.TraceQuery | GemFireXDUtils.TraceNCJ) { SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_QUERYDISTRIB, indexType + " scanning index: " + gfc + ", local data set is " + localBucketSet + ", and the function context: " + fc); } return localBucketSet; } if (GemFireXDUtils.TraceIndex) { GfxdIndexManager.traceIndex("%s the " + "FunctionContext is null ", indexType); } } catch (CacheClosedException ex) { // can happen if GemFireXD is still booting return null; } return null; }
public static Set<Integer> getLocalBucketSet(final GemFireContainer gfc, final LocalRegion region, final Activation act, final String indexType) { try { final FunctionContext fc; if (act != null && (fc = act.getFunctionContext()) != null) { @SuppressWarnings("unchecked") final Set<Integer> localBucketSet = ((InternalRegionFunctionContext)fc) .getLocalBucketSet(region); if (GemFireXDUtils.TraceIndex) { GfxdIndexManager.traceIndex("%s the baseContainer is %s " + "and the local data set is %s, function context is %s", indexType, region.getFullPath(), localBucketSet, fc); } if (GemFireXDUtils.TraceQuery | GemFireXDUtils.TraceNCJ) { SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_QUERYDISTRIB, indexType + " scanning index: " + gfc + ", local data set is " + localBucketSet + ", and the function context: " + fc); } return localBucketSet; } if (GemFireXDUtils.TraceIndex) { GfxdIndexManager.traceIndex("%s the " + "FunctionContext is null ", indexType); } } catch (CacheClosedException ex) { // can happen if GemFireXD is still booting return null; } return null; }
this.bucketSet = rfc.getLocalBucketSet(region);
this.bucketSet = rfc.getLocalBucketSet(region);
this.bucketSet = rfc.getLocalBucketSet(region);