/** * 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; }
e1.printStackTrace(); fail("Failed:" + e1.toString());
fail("Failed:" + e1.toString());
logger.debug("{}: operateOnRegion caught EntryNotFoundException {}", getClass().getName(), eee.getMessage(), eee);
/** * 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; }
/** * Used by unit tests to get access to the EntryExpiryTask * of the given key. Returns null if the entry exists but * does not have an expiry task. * @throws EntryNotFoundException if no entry exists key. */ public EntryExpiryTask getEntryExpiryTask(Object key) { RegionEntry re = this.getRegionEntry(key); if (re == null) { throw new EntryNotFoundException("Entry for key " + key + " does not exist."); } return this.entryExpiryTasks.get(re); } /**
@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); }
/** * Gets the value from VM, if present, otherwise from disk without fault in. * * @param key * @return Object * @throws EntryNotFoundException */ public Object getValueInVMOrDiskWithoutFaultIn(Object key) throws EntryNotFoundException { RegionEntry re = this.entries.getEntry(key); if (re == null) { throw new EntryNotFoundException(key.toString()); } return re.getValueInVMOrDiskWithoutFaultIn(this); }
/** * This method is intended for testing purposes only. * DO NOT use in product code else it will break SQLFabric that has cases * where routing object is not part of only the key. */ @Override public Object getValueOnDisk(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.getLocalValueOnDisk(key, bucketId); }
/** * This method is intended for testing purposes only. * DO NOT use in product code else it will break SQLFabric 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); }
private void checkExpectedOldValue(Object val, final Object expectedOldValue, final TXRegionState txr, final LocalRegion localRegion) { if (val instanceof CachedDeserializable) { val = ((CachedDeserializable)val).getDeserializedForReading(); } else if (val instanceof Token) { val = null; } if (!expectedOldValue.equals(val)) { throw new EntryNotFoundException(LocalizedStrings .AbstractRegionMap_THE_CURRENT_VALUE_WAS_NOT_EQUAL_TO_EXPECTED_VALUE .toLocalizedString()); } }
/** * 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 getValueOnDisk(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.getLocalValueOnDisk(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; }
/** * Used internally by EntryExpiryTask. Ok for it to ignore transaction. * * @return 0 if statistics not available */ long getLastAccessedTime(Object key) throws EntryNotFoundException { RegionEntry entry = this.entries.getEntry(key); if (entry == null) throw new EntryNotFoundException(key.toString()); try { return entry.getLastAccessed(); } catch (InternalStatisticsDisabledException e) { return 0; } }
/** * 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)); }