public Entry accessEntry(KeyInfo keyInfo, LocalRegion localRegion) { return getEntry(keyInfo, localRegion, false); }
/** * @see InternalDataView#getEntry(Object, Object, LocalRegion, boolean) */ public Region.Entry<?, ?> getEntry(final Object key, final Object callbackArg, final LocalRegion localRegion, final boolean allowTombstones) { // creating a KeyInfo here to avoid possible multiple resolver calls // to get the bucketId final KeyInfo keyInfo = localRegion.getKeyInfo(key, callbackArg); return getEntry(keyInfo, localRegion, false, allowTombstones); }
/** * @see InternalDataView#accessEntry(Object, Object, LocalRegion) */ public Region.Entry<?, ?> accessEntry(final Object key, final Object callbackArg, final LocalRegion localRegion) { // creating a KeyInfo here to avoid possible multiple resolver calls // to get the bucketId final KeyInfo keyInfo = localRegion.getKeyInfo(key, callbackArg); return getEntry(keyInfo, localRegion, true, false); }
public Entry getEntryOnRemote(KeyInfo key, LocalRegion localRegion, boolean allowTombstones) throws DataLocationException { PartitionedRegion pr = (PartitionedRegion)localRegion; Region.Entry txval = getEntry(key, pr, allowTombstones); if(txval==null) { throw new EntryNotFoundException(LocalizedStrings.PartitionedRegionDataStore_ENTRY_NOT_FOUND.toLocalizedString()); } else { NonLocalRegionEntry nlre = new NonLocalRegionEntry(txval, localRegion); LocalRegion dataReg = localRegion.getDataRegionForRead(key); return new EntrySnapshot(nlre,dataReg,(LocalRegion)txval.getRegion(), allowTombstones); } }
public Object call() throws Exception { LocalRegion custRegion = (LocalRegion)getCache().getRegion(CUSTOMER); LocalRegion orderRegion = (LocalRegion)getCache().getRegion(ORDER); TXManagerImpl mgr = getGemfireCache().getTxManager(); TXState txState = mgr.getHostedTXState(txId2).getLocalTXState(); final TXStateInterface currentTX = mgr.getTXState(); mgr.masqueradeAs(txState); for (int index = 0; index < 10; ++index) { final CustId custId = new CustId(index); assertEquals(new Customer("customer" + index, "address" + index), txState.getEntry(new KeyInfo(custId, null, null), custRegion, false, false).getValue()); assertEquals(new Order("order" + index), txState.getEntry( new KeyInfo(new OrderId(index, custId), null, null), orderRegion, false, false).getValue()); } mgr.masqueradeAs(currentTX); return null; } });
public Object call() throws Exception { LocalRegion custRegion = (LocalRegion)getCache().getRegion(CUSTOMER); LocalRegion orderRegion = (LocalRegion)getCache().getRegion(ORDER); TXManagerImpl mgr = getGemfireCache().getTxManager(); TXState txState = mgr.getHostedTXState(txId2).getLocalTXState(); final TXStateInterface currentTX = mgr.getTXState(); mgr.masqueradeAs(txState); for (int index = 0; index < 10; ++index) { final CustId custId = new CustId(index); assertEquals(new Customer("customer" + index, "address" + index), txState.getEntry(new KeyInfo(custId, null, null), custRegion, false, false).getValue()); assertEquals(new Order("order" + index), txState.getEntry( new KeyInfo(new OrderId(index, custId), null, null), orderRegion, false, false).getValue()); } mgr.masqueradeAs(currentTX); return null; } });
public Object call() throws Exception { LocalRegion custRegion = (LocalRegion)getCache().getRegion(CUSTOMER); LocalRegion orderRegion = (LocalRegion)getCache().getRegion(ORDER); TXManagerImpl mgr = getGemfireCache().getTxManager(); TXState txState = mgr.getHostedTXState(txId).getLocalTXState(); final TXStateInterface currentTX = mgr.getTXState(); mgr.masqueradeAs(txState); for (int index = 0; index < 10; ++index) { final CustId custId = new CustId(index); assertEquals(new Customer("customer" + index, "address" + index), txState.getEntry(new KeyInfo(custId, null, null), custRegion, false, false).getValue()); assertEquals(new Order("order" + index), txState.getEntry( new KeyInfo(new OrderId(index, custId), null, null), orderRegion, false, false).getValue()); } mgr.masqueradeAs(currentTX); return null; } });
public Object call() throws Exception { LocalRegion custRegion = (LocalRegion)getCache().getRegion(CUSTOMER); LocalRegion orderRegion = (LocalRegion)getCache().getRegion(ORDER); TXManagerImpl mgr = getGemfireCache().getTxManager(); TXState txState = mgr.getHostedTXState(txId).getLocalTXState(); final TXStateInterface currentTX = mgr.getTXState(); mgr.masqueradeAs(txState); for (int index = 0; index < 10; ++index) { final CustId custId = new CustId(index); assertEquals(new Customer("customer" + index, "address" + index), txState.getEntry(new KeyInfo(custId, null, null), custRegion, false, false).getValue()); assertEquals(new Order("order" + index), txState.getEntry( new KeyInfo(new OrderId(index, custId), null, null), orderRegion, false, false).getValue()); } mgr.masqueradeAs(currentTX); return null; } });