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. } } }
private Object getValueForCallback(LocalRegion r, Object k) { Region.Entry<?,?> e = r.getEntry(k); return (e != null) ? e.getValue() : null; }
private Object getValueForCallback(LocalRegion r, Object k) { Region.Entry<?,?> e = r.getEntry(k); return (e != null) ? e.getValue() : null; }
/** internally we often need to get an entry whether it is a tombstone or not */ public final Region.Entry getEntry(Object key, boolean allowTombstones) { return getEntry(key, discoverJTA(), allowTombstones); }
public void run2() throws CacheException { LocalRegion region = (LocalRegion) getRootRegion().getSubregion(name); // Verify that 'key-1' was updated, but 'key-2' was not // and contains the original value assertEquals(region.getEntry("key-2").getValue(), "vm1-key-2"); assertEquals(region.getEntry("key-1").getValue(), "vm2-key-1"); //assertNull(region.getEntry("key-1").getValue()); } });
public void run2() throws CacheException { LocalRegion region = (LocalRegion) getRootRegion().getSubregion(name); // Verify that 'key-1' was updated assertEquals(region.getEntry("key-1").getValue(), "vm2-key-1"); // Verify that 'key-6' was not invalidated assertEquals(region.getEntry("key-6").getValue(), "key-6"); } });
public void run2() throws CacheException { LocalRegion region = (LocalRegion) getRootRegion().getSubregion(name); // Verify that 'key-2' was updated, but 'key-1' was not // and contains the original value assertEquals(region.getEntry("key-1").getValue(), "key-1"); assertEquals(region.getEntry("key-2").getValue(), "vm1-key-2"); //assertNull(region.getEntry("key-2").getValue()); } });
public void run2() throws CacheException { LocalRegion region = (LocalRegion) getRootRegion().getSubregion(name); // Verify that neither 'key-1' 'key-2' was updated // and contain the original value assertEquals(region.getEntry("key-1").getValue(), "vm2-key-1"); assertEquals(region.getEntry("key-2").getValue(), "vm2-key-2"); } });
public void run2() throws CacheException { LocalRegion region = (LocalRegion) getRootRegion().getSubregion(name); // Verify that neither 'key-1' 'key-2' was updated // and contain the original value assertEquals(region.getEntry("key-1").getValue(), "vm1-key-1-again"); assertEquals(region.getEntry("key-2").getValue(), "vm1-key-2-again"); } });
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 void run2() throws CacheException { LocalRegion region = (LocalRegion) getRootRegion().getSubregion(name); region.put("key-1", "vm2-key-1-again"); region.put("key-2", "vm2-key-2-again"); // Verify that no updates occurred to this region assertEquals(region.getEntry("key-1").getValue(), "vm2-key-1-again"); assertEquals(region.getEntry("key-2").getValue(), "vm2-key-2-again"); } });
public void run2() throws CacheException { LocalRegion region = (LocalRegion) getRootRegion().getSubregion(name); region.put("key-1", "vm2-key-1"); region.put("key-2", "vm2-key-2"); // Verify that no updates occurred to this region assertEquals(region.getEntry("key-1").getValue(), "vm2-key-1"); assertEquals(region.getEntry("key-2").getValue(), "vm2-key-2"); } });
public void run2() throws CacheException { LocalRegion region = (LocalRegion) getRootRegion().getSubregion(name); region.put("key-1", "vm2-key-1"); region.put("key-6", "vm2-key-6"); // Verify that no updates occurred to this region assertEquals(region.getEntry("key-1").getValue(), "vm2-key-1"); assertEquals(region.getEntry("key-6").getValue(), "vm2-key-6"); } });
public void run2() throws CacheException { LocalRegion region = (LocalRegion) getRootRegion().getSubregion(name); region.put("key-1", "vm1-key-1"); region.put("key-2", "vm1-key-2"); // Verify that no invalidates occurred to this region assertEquals(region.getEntry("key-1").getValue(), "vm1-key-1"); assertEquals(region.getEntry("key-2").getValue(), "vm1-key-2"); } });
public final Region.Entry getEntry(Object key) { try { operationStart(); return getEntry(key, discoverJTA()); } finally { operationCompleted(); } }
public Object call() throws Exception { LocalRegion custRegion = (LocalRegion)getCache().getRegion(CUSTOMER); LocalRegion orderRegion = (LocalRegion)getCache().getRegion(ORDER); for (int index = 0; index < 10; ++index) { final CustId custId = new CustId(index); assertEquals(new Customer("customer" + index, "address" + index), custRegion.get(custId)); assertEquals(new Order("order" + index), orderRegion.getEntry(new OrderId(index, custId)).getValue()); } return null; } });
public Object call() throws Exception { LocalRegion custRegion = (LocalRegion)getCache().getRegion(CUSTOMER); LocalRegion orderRegion = (LocalRegion)getCache().getRegion(ORDER); for (int index = 0; index < 10; ++index) { final CustId custId = new CustId(index); assertEquals(new Customer("customer" + index, "address" + index), custRegion.getEntry(custId).getValue()); assertEquals(new Order("order" + index), orderRegion.get(new OrderId(index, custId))); } return null; } });
public Object call() throws Exception { LocalRegion custRegion = (LocalRegion)getCache().getRegion(CUSTOMER); LocalRegion orderRegion = (LocalRegion)getCache().getRegion(ORDER); for (int index = 0; index < 10; ++index) { final CustId custId = new CustId(index); assertEquals(new Customer("customer" + index, "address" + index), custRegion.get(custId)); assertEquals(new Order("order" + index), orderRegion.getEntry(new OrderId(index, custId)).getValue()); } return null; } });
public static void verifyTimestampAfterOp(long timestamp, int memberid) { Region region = cache.getRegion("repRegion"); assertEquals(0, region.size()); Region.Entry entry = ((LocalRegion)region).getEntry("testKey", null, true); RegionEntry re = ((EntrySnapshot)entry).getRegionEntry(); assertTrue(re.getValueInVM((LocalRegion) region) instanceof Tombstone); VersionTag tag = re.getVersionStamp().asVersionTag(); assertEquals(timestamp, tag.getVersionTimeStamp()); assertEquals(memberid, tag.getDistributedSystemId()); } }
public static long getVersionTimestampAfterOp() { Region region = cache.getRegion("repRegion"); assertEquals(1, region.size()); region.destroy("testKey"); Region.Entry entry = ((LocalRegion)region).getEntry("testKey", null, true); RegionEntry re = ((EntrySnapshot)entry).getRegionEntry(); getLogWriter().fine("RegionEntry for testKey: " + re.getKey() + " " + re.getValueInVM((LocalRegion) region)); assertTrue(re.getValueInVM((LocalRegion) region) instanceof Tombstone); VersionTag tag = re.getVersionStamp().asVersionTag(); return tag.getVersionTimeStamp(); }