/** * Returns the tasks region entry if it "checks" out. The check is to * see if the region entry still exists. * @throws EntryNotFoundException if the task no longer has a region entry or * if the region entry it has is removed. */ protected RegionEntry getCheckedRegionEntry() throws EntryNotFoundException { RegionEntry result = this.re; if (re == null || re.isDestroyedOrRemoved()) { throw new EntryNotFoundException("expiration task no longer has access to region entry"); } return result; }
/** * Returns the tasks region entry if it "checks" out. The check is to * see if the region entry still exists. * @throws EntryNotFoundException if the task no longer has a region entry or * if the region entry it has is removed. */ protected RegionEntry getCheckedRegionEntry() throws EntryNotFoundException { RegionEntry result = this.re; if (re == null || re.isDestroyedOrRemoved()) { throw new EntryNotFoundException("expiration task no longer has access to region entry"); } return result; }
@Override public Object getValueInVM(Object key) throws EntryNotFoundException { if (this.dataStore == null) { throw new EntryNotFoundException(key.toString()); } final int bucketId = PartitionedRegionHelper.getHashKey(this, null, key, null, null); return this.dataStore.getLocalValueInVM(key, bucketId); }
@Override public Object getValueInVM(Object key) throws EntryNotFoundException { if (this.dataStore == null) { throw new EntryNotFoundException(key.toString()); } final int bucketId = PartitionedRegionHelper.getHashKey(this, null, key, null, null); return this.dataStore.getLocalValueInVM(key, bucketId); }
/** * Used internally by EntryExpiryTask. Ok for it to ignore transaction. */ long getLastModifiedTime(Object key) throws EntryNotFoundException { RegionEntry entry = this.entries.getEntry(key); if (entry == null) throw new EntryNotFoundException(key.toString()); return entry.getLastModified(); }
/** * Used internally by EntryExpiryTask. Ok for it to ignore transaction. */ long getLastModifiedTime(Object key) throws EntryNotFoundException { RegionEntry entry = this.entries.getEntry(key); if (entry == null) throw new EntryNotFoundException(key.toString()); return entry.getLastModified(); }
/** * This method is intended for testing purposes only. * DO NOT use in product code else it will break GemFireXD that has cases * where routing object is not part of only the key. */ @Override public Object getValueOnDiskOrBuffer(Object key) throws EntryNotFoundException { final int bucketId = PartitionedRegionHelper.getHashKey(this, null, key, null, null); if (this.dataStore == null) { throw new EntryNotFoundException(key.toString()); } return this.dataStore.getLocalValueOnDiskOrBuffer(key, bucketId); }
/** * Returns the entry's RegionEntry if it "checks" out. The check is to * see if the region entry still exists. * @throws EntryNotFoundException if the RegionEntry has been removed. */ private RegionEntry getCheckedRegionEntry() throws EntryNotFoundException { RegionEntry result = this.re; if (re.isDestroyedOrRemoved()) { throw new EntryNotFoundException("Entry for key " + re.getKey() + " no longer exists"); } return result; }
/** * Returns the entry's RegionEntry if it "checks" out. The check is to * see if the region entry still exists. * @throws EntryNotFoundException if the RegionEntry has been removed. */ private RegionEntry getCheckedRegionEntry() throws EntryNotFoundException { RegionEntry result = this.re; if (re.isDestroyedOrRemoved()) { throw new EntryNotFoundException("Entry for key " + re.getKey() + " no longer exists"); } return result; }
/** * This method should be called when the caller cannot locate an entry and that condition * is unexpected. This will first double check the cache and region state before throwing * an EntryNotFoundException. EntryNotFoundException should be a last resort exception. * * @param entryKey the missing entry's key. */ public void checkEntryNotFound(Object entryKey) { checkReadiness(); // Localized string for partitioned region is generic enough for general use throw new EntryNotFoundException(LocalizedStrings.PartitionedRegion_ENTRY_NOT_FOUND_FOR_KEY_0.toLocalizedString(entryKey)); }
/** * This method should be called when the caller cannot locate an entry and that condition * is unexpected. This will first double check the cache and region state before throwing * an EntryNotFoundException. EntryNotFoundException should be a last resort exception. * * @param entryKey the missing entry's key. */ public void checkEntryNotFound(Object entryKey) { checkReadiness(); // Localized string for partitioned region is generic enough for general use throw new EntryNotFoundException(LocalizedStrings.PartitionedRegion_ENTRY_NOT_FOUND_FOR_KEY_0.toLocalizedString(entryKey)); }
@Retained public final Object getValueInVM(Object key) throws EntryNotFoundException { if (!existsLocally()) { throw new EntryNotFoundException(String.valueOf(key)); } return getRetainedValueInTXOrRegion(); }
@Retained public Object getValueInVM(Object key) throws EntryNotFoundException { if (!existsLocally()) { throw new EntryNotFoundException(String.valueOf(key)); } return getNearSidePendingValue(); }
@Override public Object getValueInVM(EntryEventImpl event) throws EntryNotFoundException { final Object key = event.getKey(); if (this.dataStore == null) { throw new EntryNotFoundException(key.toString()); } final int bucketId = PartitionedRegionHelper.getHashKey(event, this, key, event.getCallbackArgument()); return this.dataStore.getLocalValueInVM(key, bucketId); }
@Override public EntryExpiryTask getEntryExpiryTask(Object key) { BucketRegion br = this.getDataStore().getLocalBucketByKey(key); if (br == null) { throw new EntryNotFoundException("Bucket for key " + key + " does not exist."); } return br.getEntryExpiryTask(key); } }
/** * Asif: If the system is sqlfabric and the event has delta, then re == null * implies update on non existent row . Throwing ENFE in that case * As returning a boolean etc has other complications in terms of PR reattempt etc */ private void throwExceptionForSqlFire(EntryEventImpl event) { if (event.hasDelta() && _getOwner().getGemFireCache().isSqlfSystem()) { throw new EntryNotFoundException( "SqlFabric::No row found for update"); } }
/** * Asif: If the system is GemFireXD and the event has delta, then re == null * implies update on non existent row . Throwing ENFE in that case * As returning a boolean etc has other complications in terms of PR reattempt etc */ private void throwExceptionForGemFireXD(EntryEventImpl event) { if (event.hasDeltaPut() && _getOwner().getGemFireCache().isGFXDSystem()) { throw new EntryNotFoundException( "GemFireXD::No row found for update"); } }
public boolean invalidate(EntryEventImpl event, boolean invokeCallbacks, boolean forceNewEntry, boolean forceCallback) throws EntryNotFoundException { if (event.getOperation().isLocal()) { throw new EntryNotFoundException(event.getKey().toString()); } this.owner.cacheWriteBeforeInvalidate(event, invokeCallbacks, forceNewEntry); this.owner.recordEvent(event); this.owner.basicInvalidatePart2(markerEntry, event, false /*Clear conflict occurred */, true); this.owner.basicInvalidatePart3(markerEntry, event, true); return true; }
public boolean invalidate(EntryEventImpl event, boolean invokeCallbacks, boolean forceNewEntry, boolean forceCallback) throws EntryNotFoundException { if (event.getOperation().isLocal()) { throw new EntryNotFoundException(event.getKey().toString()); } this.owner.cacheWriteBeforeInvalidate(event, invokeCallbacks, forceNewEntry); this.owner.recordEvent(event); this.owner.basicInvalidatePart2(markerEntry, event, false /*Clear conflict occurred */, true); this.owner.basicInvalidatePart3(markerEntry, event, true); return true; }
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); } }