@Override public void clear() { this.region.clear(); }
public Object call() { for (Object key: keys) { assertTrue("expected to find an entry for "+key, TestRegion.containsKey(key)); assertTrue("expected to find entry invalid for "+key, !TestRegion.containsValue(key)); } return null; } });
public Object get(Object key, Object aCallbackArgument, boolean generateCallbacks, boolean disableCopyOnRead, boolean preferCD, ClientProxyMembershipID requestingClient, EntryEventImpl clientEvent, boolean returnTombstones, boolean allowReadFromHDFS) throws TimeoutException, CacheLoaderException { return get(key, aCallbackArgument, generateCallbacks, disableCopyOnRead, preferCD,requestingClient, clientEvent, returnTombstones, false, allowReadFromHDFS, false); }
protected long calculateEntryOverhead(RegionEntry entry) { if (entryOverHead == -1L && !this.reservedTable() && needAccounting()) { synchronized (this) { if (entryOverHead == -1L) { entryOverHead = getEntryOverhead(entry); memTrace("Entry overhead for " + getFullPath() + " = " + entryOverHead); } } } return entryOverHead; }
public final Region.Entry getEntry(Object key) { try { operationStart(); return getEntry(key, discoverJTA()); } finally { operationCompleted(); } }
public final boolean containsKey(Object key) { try { operationStart(); return containsKey(key, null); } finally { operationCompleted(); } }
public void invalidateRegion(Object aCallbackArgument) throws TimeoutException { getDataView().checkSupportsRegionInvalidate(); validateCallbackArg(aCallbackArgument); checkReadiness(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_INVALIDATE, aCallbackArgument, false, getMyId(), generateEventID()); basicInvalidateRegion(event); }
public Region.Entry getEntry(Object key) { validateKey(key); checkReadiness(); checkForNoAccess(); discoverJTA(); return getDataView().getEntry(getKeyInfo(key), this, false); }
public void run2() throws CacheException { LocalRegion region = (LocalRegion) getRootRegion().getSubregion(name); region.put("key-1", "vm1-key-1-again"); region.put("key-2", "vm1-key-2-again"); // Verify that no updates occurred to this region assertEquals(region.getEntry("key-1").getValue(), "vm1-key-1-again"); assertEquals(region.getEntry("key-2").getValue(), "vm1-key-2-again"); } });
public Set<Region<?, ?>> rootRegions() { preOp(); Set<Region<?, ?>> rRegions = new HashSet<Region<?,?>>(); Iterator<LocalRegion> it = this.cache.rootRegions().iterator(); while (it.hasNext()) { LocalRegion lr = it.next(); if (!lr.getAttributes().getDataPolicy().withStorage()) { rRegions.add(new ProxyRegion(this, lr)); } } return Collections.unmodifiableSet(rRegions); }
public void destroyRegion(Object aCallbackArgument) throws CacheWriterException, TimeoutException { getDataView().checkSupportsRegionDestroy(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_DESTROY, aCallbackArgument, false, getMyId(), generateEventID()); basicDestroyRegion(event, true); }
@Override public final void setDelayedDiskId(LocalRegion r) { DiskStoreImpl ds = r.getDiskStore(); long maxOplogSize = ds.getMaxOplogSize(); this.id = DiskId.createDiskId(maxOplogSize, false , ds.needsLinkedList()); } public final synchronized int updateEntrySize(EnableLRU capacityController) {
public void localInvalidateRegion(Object aCallbackArgument) { getDataView().checkSupportsRegionInvalidate(); checkReadiness(); checkForNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_LOCAL_INVALIDATE, aCallbackArgument, false, getMyId()); basicInvalidateRegion(event); }
/** * This implementation only checks readiness and scope */ public Lock getRegionDistributedLock() throws IllegalStateException { checkReadiness(); checkForLimitedOrNoAccess(); Scope theScope = getAttributes().getScope(); Assert.assertTrue(theScope == Scope.LOCAL); throw new IllegalStateException(LocalizedStrings.LocalRegion_ONLY_SUPPORTED_FOR_GLOBAL_SCOPE_NOT_LOCAL.toLocalizedString()); }
private void close(LocalRegion lr) { lr.close(); lr.getDiskStore().close(); lr.getGemFireCache().removeDiskStore(lr.getDiskStore()); }
private static void closeRegion(Region r) { LocalRegion lr = (LocalRegion)r; r.close(); lr.getDiskStore().close(); lr.getGemFireCache().removeDiskStore(lr.getDiskStore()); } private static void destroyRegion(Region r) {
public static void createEntries() { try { LocalRegion r1 = (LocalRegion)cache.getRegion("/" + REGION_NAME); for(int i=1 ; i<6; i++){ if (!r1.containsKey("key-"+i)) { r1.create("key-"+i, "key-"+i); } assertEquals(r1.getEntry("key-"+i).getValue(), "key-"+i); } } catch (Exception ex) { fail("failed while createEntries()", ex); } }
void applyChanges(LocalRegion r, Object key) { try { Region.Entry re = r.getEntry(key); re.setUserAttribute(this.pendingValue); } catch (CacheRuntimeException ignore) { // ignore any exceptions since we have already locked and // found no conflicts. } } }
protected boolean clearIndexes(IndexUpdater indexUpdater, boolean setIsDestroyed) { // by default need to clear indexes only if this is not the case of region // being destroyed (i.e. after GII failure) otherwise the region as well as // complete index is going to be blown away; bucket region will need to // override to clear in every case if (!setIsDestroyed) { return indexUpdater.clearIndexes(this, getDiskRegion(), true, null, KeyInfo.UNKNOWN_BUCKET); } return false; }
@Override public String toString() { return "TableQueryInfo: region=" + (this.region != null ? this.region.getFullPath() : "(null)"); }