/** * @param key * @return the wrapped {@link KeyInfo} */ public KeyInfo getKeyInfo(Object key) { return new KeyInfo(key, null, null); }
/** * Returns the wrapped {@link KeyInfo}. */ public KeyInfo getKeyInfo(Object key, Object value, Object callbackArg) { return new KeyInfo(key, null, callbackArg); }
/** * @param key * @return the wrapped {@link KeyInfo} */ public KeyInfo getKeyInfo(Object key) { return new KeyInfo(key, null, null); }
public KeyInfo getKeyInfo(Object key, Object value, Object callbackArg) { return new KeyInfo(key, null, callbackArg); }
@Override public final KeyInfo getKeyInfo(Object key, Object value, Object callbackArg) { final int bucketId; if (key == null) { // key is null for putAll bucketId = KeyInfo.UNKNOWN_BUCKET; } else { bucketId = PartitionedRegionHelper.getHashKey(this, null, key, value, callbackArg); } return new KeyInfo(key, callbackArg, bucketId); }
@Retained public EntryEventImpl(Object key2) { this.keyInfo = new KeyInfo(key2, null, null); }
@Override public KeyInfo getKeyInfo(Object key, Object value, Object callbackArg) { final int bucketId; if (key == null){ // key is null for putAll bucketId = KeyInfo.UNKNOWN_BUCKET; } else { bucketId = PartitionedRegionHelper.getHashKey(this, null, key, value, callbackArg); } return new KeyInfo(key, callbackArg, bucketId); }
public void postPutAll(DistributedPutAllOperation putallOp, VersionedObjectList successfulPuts,LocalRegion region) { if(putallOp.putAllData.length==0) { return; } region.getCancelCriterion().checkCancelInProgress(null); // fix for bug #43651 Object key = null; if(putallOp.putAllData[0]!=null) { key = putallOp.putAllData[0].key; } KeyInfo ki = new KeyInfo(key,null,null); TXStateInterface tsi = getRealDeal(ki,region); tsi.postPutAll(putallOp, successfulPuts, region); } @Override
@Override public void postRemoveAll(DistributedRemoveAllOperation op, VersionedObjectList successfulOps, LocalRegion region) { if(op.removeAllData.length==0) { return; } region.getCancelCriterion().checkCancelInProgress(null); // fix for bug #43651 Object key = null; if(op.removeAllData[0]!=null) { key = op.removeAllData[0].key; } KeyInfo ki = new KeyInfo(key,null,null); TXStateInterface tsi = getRealDeal(ki,region); tsi.postRemoveAll(op, successfulOps, region); }
removeAllForBucket.addEntry(op.removeAllData[i]); KeyInfo ki = new KeyInfo(key, null, null); DistTXCoordinatorInterface tsi = (DistTXCoordinatorInterface) getRealDeal(ki, region); bucketToTxStateStubMap.put(bucketId, tsi);
putAllForBucket.addEntry(putallOp.putAllData[i]); KeyInfo ki = new KeyInfo(key, null, null); DistTXCoordinatorInterface tsi = (DistTXCoordinatorInterface) getRealDeal(ki, region); bucketToTxStateStubMap.put(bucketId, tsi);
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; } });
Object key = DataSerializer.readObject(in); Object value = DataSerializer.readObject(in); this.keyInfo = new KeyInfo(key, value, null); this.op = Operation.fromOrdinal(in.readByte()); this.eventFlags = in.readShort();
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; } });
public Object getEntryForIterator(KeyInfo curr, LocalRegion currRgn, boolean rememberReads, boolean allowTombstones) { if (currRgn instanceof PartitionedRegion) { PartitionedRegion pr = (PartitionedRegion)currRgn; if (!pr.getBucketPrimary(curr.getBucketId()).equals(pr.cache.getMyId())) { // to fix bug 47893 suspend the tx before calling nonTXGetEntry final TXManagerImpl txmgr = pr.getGemFireCache().getTXMgr(); TransactionId tid = txmgr.suspend(); try { return pr.nonTXGetEntry(curr, false, allowTombstones); } finally { txmgr.resume(tid); } } } if (! readEntryAndCheckIfDestroyed(curr, currRgn, rememberReads)) { // need to create KeyInfo since higher level iterator may reuse KeyInfo return new TXEntry(currRgn, new KeyInfo(curr.getKey(), curr.getCallbackArg(), curr.getBucketId()), proxy, rememberReads); } else { return null; } }
private EntryEventImpl createNewEvent(LocalRegion region, VersionTag tag, Object key) { EntryEventImpl updateTimeStampEvent = EntryEventImpl.createVersionTagHolder(tag); updateTimeStampEvent.setOperation(Operation.UPDATE_VERSION_STAMP); updateTimeStampEvent.setRegion(region); if (region instanceof PartitionedRegion) { updateTimeStampEvent.setKeyInfo(((PartitionedRegion)region).getKeyInfo(key)); } else { updateTimeStampEvent.setKeyInfo(new KeyInfo(key, null, 0)); } updateTimeStampEvent.setGenerateCallbacks(false); updateTimeStampEvent.distributedMember = region.getSystem().getDistributedMember(); updateTimeStampEvent.setNewEventId(region.getSystem()); return updateTimeStampEvent; }
private EntryEventImpl createNewEvent(LocalRegion region, VersionTag tag, Object key, Object value) { EntryEventImpl updateEvent = EntryEventImpl.createVersionTagHolder(tag); updateEvent.setOperation(Operation.UPDATE); updateEvent.setRegion(region); if (region instanceof PartitionedRegion) { updateEvent.setKeyInfo(((PartitionedRegion)region).getKeyInfo(key)); } else { updateEvent.setKeyInfo(new KeyInfo(key, value, null)); } updateEvent.setNewValue(value); updateEvent.setGenerateCallbacks(true); updateEvent.distributedMember = region.getSystem().getDistributedMember(); updateEvent.setNewEventId(region.getSystem()); return updateEvent; }
this.filterInfo = other.filterInfo; this.keyInfo = other.keyInfo.isDistKeyInfo() ? new DistTxKeyInfo( (DistTxKeyInfo) other.keyInfo) : new KeyInfo(other.keyInfo); if (other.getRawCallbackArgument() instanceof GatewaySenderEventCallbackArgument) { this.keyInfo