public void finishIncompleteBucketCreation(int bucketId) { String partitionName = null; final long startTime = PartitionedRegionStats.startTime(); if (this.prRegion.isFixedPartitionedRegion()) { FixedPartitionAttributesImpl fpa = PartitionedRegionHelper.getFixedPartitionAttributesForBucket(this.prRegion, bucketId); partitionName = fpa.getPartitionName(); } createBucketAtomically(bucketId, 0, startTime, true, partitionName); }
protected boolean nonTXContainsKey(KeyInfo keyInfo) { boolean contains = getRegionMap().containsKey(keyInfo.getKey()); if (contains && this.imageState.isClient()) { // fix for bug #40871 - concurrent RI causes containsKey for destroyed entry // to return true RegionEntry regionEntry = this.entries.getEntry(keyInfo.getKey()); if (regionEntry == null || regionEntry.isDestroyedOrRemoved()) { contains = false; } } return contains; }
@Override protected CacheOperationMessage createMessage() { if (this.event.hasClientOrigin()) { InvalidateWithContextMessage msgwithContxt = new InvalidateWithContextMessage(); msgwithContxt.context = ((EntryEventImpl) this.event).getContext(); return msgwithContxt; } else { return new InvalidateMessage(); } }
public void checkForPrimary() { final boolean isp = getBucketAdvisor().isPrimary(); if (!isp) { this.partitionedRegion.checkReadiness(); checkReadiness(); InternalDistributedMember primaryHolder = getBucketAdvisor().basicGetPrimaryMember(); throw new PrimaryBucketException( "Bucket " + getName() + " is not primary. Current primary holder is " + primaryHolder); } }
@Override public void destroyRegion(Object aCallbackArgument) throws CacheWriterException, TimeoutException { this.cache.invokeBeforeDestroyed(this); checkForColocatedChildren(); getDataView().checkSupportsRegionDestroy(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_DESTROY, aCallbackArgument, false, getMyId(), generateEventID()); basicDestroyRegion(event, true); }
@Override public boolean putEntryOnRemote(EntryEventImpl event, boolean ifNew, boolean ifOld, Object expectedOldValue, boolean requireOldValue, long lastModified, boolean overwriteDestroyed) throws DataLocationException { PartitionedRegion pr = (PartitionedRegion) event.getRegion(); return pr.getDataStore().putLocally(event.getKeyInfo().getBucketId(), event, ifNew, ifOld, expectedOldValue, requireOldValue, lastModified); }
@Override public void destroyRegion(Object aCallbackArgument) throws CacheWriterException, TimeoutException { this.cache.invokeBeforeDestroyed(this); getDataView().checkSupportsRegionDestroy(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_DESTROY, aCallbackArgument, false, getMyId(), generateEventID()); basicDestroyRegion(event, true); }
@Override public void destroyOnRemote(EntryEventImpl event, boolean cacheWrite, Object expectedOldValue) throws DataLocationException { PartitionedRegion pr = (PartitionedRegion) event.getRegion(); pr.getDataStore().destroyLocally(event.getKeyInfo().getBucketId(), event, expectedOldValue); return; }
@Override public void validateExecution(Function function, Set targetMembers) { InternalCache cache = GemFireCacheImpl.getInstance(); if (cache != null && cache.getTxManager().getTXState() != null) { TXStateProxyImpl tx = (TXStateProxyImpl) cache.getTxManager().getTXState(); tx.getRealDeal(null, region); tx.incOperationCount(); } }
private void writeDiskStoreRecord(OplogFile olf, OPLOG_TYPE type) throws IOException { this.opState = new OpState(); this.opState.initialize(type); writeOpLogBytes(olf, false, true); olf.currSize += getOpStateSize(); this.dirHolder.incrementTotalOplogSize(getOpStateSize()); clearOpState(); this.opState.initialize(getParent().getDiskStoreID()); writeOpLogBytes(olf, false, true); // fix for bug 41928 olf.currSize += getOpStateSize(); this.dirHolder.incrementTotalOplogSize(getOpStateSize()); }
@Override public Object getUserAttribute() { checkTX(); throwIfUAOperationForPR(); TXEntryUserAttrState tx = txReadUA(this.keyInfo); if (tx != null) { return tx.getPendingValue(); } else { checkEntryDestroyed(); return this.localRegion.basicGetEntryUserAttribute(this.keyInfo.getKey()); } }
protected FilterRoutingInfo getRecipientFilterRouting(Set cacheOpRecipients) { LocalRegion region = getRegion(); if (!region.isUsedForPartitionedRegionBucket()) { return null; } CacheDistributionAdvisor advisor; advisor = region.getPartitionedRegion().getCacheDistributionAdvisor(); return advisor.adviseFilterRouting(this.event, cacheOpRecipients); }
public boolean hasSeenEvent(EntryEventImpl event) { BucketRegion bucket = getLocalBucketById(event.getKeyInfo().getBucketId()); if (bucket == null) { return false; } else { return bucket.hasSeenEvent(event); } }
public void replaceIncompatibleEntry(DiskEntry old, DiskEntry repl) { acquireReadLock(); try { getOplogSet().getChild().replaceIncompatibleEntry(this, old, repl); } finally { releaseReadLock(); } }
private void txHandleWANEvent(final LocalRegion owner, EntryEventImpl callbackEvent, TXEntryState txEntryState) { owner.handleWANEvent(callbackEvent); if (txEntryState != null) { txEntryState.setTailKey(callbackEvent.getTailKey()); } }
@Override protected InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { RegionEventImpl event = createRegionEvent(rgn); if (this.filterRouting != null) { event.setLocalFilterInfo( this.filterRouting.getFilterInfo((InternalDistributedMember) rgn.getMyId())); } event.setEventID(this.eventID); return event; }
@Override protected InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { RegionEventImpl event = createRegionEvent(rgn); event.setEventID(this.eventID); if (this.filterRouting != null) { event.setLocalFilterInfo(this.filterRouting.getFilterInfo(rgn.getMyId())); } return event; }
@Override protected CacheOperationMessage createMessage() { if (this.event.hasClientOrigin()) { DestroyWithContextMessage msgwithContxt = new DestroyWithContextMessage(event); msgwithContxt.context = ((EntryEventImpl) this.event).getContext(); return msgwithContxt; } else { return new DestroyMessage(event); } }
@Override public void performPutAllEntry(EntryEventImpl event) { /* * force shared data view so that we just do the virtual op, accruing things in the put all * operation for later */ if (isTX()) { event.getPutAllOperation().addEntry(event); } else { getSharedDataView().putEntry(event, false, false, null, false, 0L, false); } }
@Override protected Set getRecipients() { CacheDistributionAdvisor advisor = getRegion().getCacheDistributionAdvisor(); return advisor.adviseDestroyRegion(); }