@Override public void acquireReadLock() { getDiskStore().acquireReadLock(this); }
public boolean forceCompaction(DiskRegion dr) { if (!dr.isBackup()) return false; acquireReadLock(dr); try { return basicForceCompaction(dr); } finally { releaseReadLock(dr); } }
acquireReadLock(dr); try { int count = 0;
/** * @since GemFire 5.1 */ public void forceRolling(DiskRegion dr) { if (!dr.isBackup()) return; if (!dr.isSync() && this.maxAsyncItems == 0 && getTimeInterval() == 0) { forceFlush(); } acquireReadLock(dr); try { PersistentOplogSet oplogSet = getPersistentOplogSet(dr); oplogSet.forceRoll(dr); } finally { releaseReadLock(dr); } }
/** * Asif: THIS SHOULD ONLY BE USED FOR TESTING PURPOSES AS IT IS NOT THREAD SAFE * * Returns the object stored on disk with the given id. This method is used for testing purposes * only. As such, it bypasses the buffer and goes directly to the disk. This is not a thread safe * function , in the sense, it is possible that by the time the OpLog is queried , data might move * HTree with the oplog being destroyed * * @return null if entry has nothing stored on disk (id == INVALID_ID) * @throws IllegalArgumentException If {@code id} is less than zero, no action is taken. */ public Object getNoBuffer(DiskRegion dr, DiskId id) { BytesAndBits bb = null; acquireReadLock(dr); try { long opId = id.getOplogId(); if (opId != -1) { OplogSet oplogSet = getOplogSet(dr); bb = oplogSet.getChild(opId).getNoBuffer(dr, id); return convertBytesAndBitsIntoObject(bb, getCache()); } else { return null; } } finally { releaseReadLock(dr); } }
public void writeRVV(DiskRegion dr, LocalRegion region, Boolean isRVVTrusted) { acquireReadLock(dr); try { if (dr.isRegionClosed()) { dr.getCancelCriterion().checkCancelInProgress(null); throw new RegionDestroyedException( "The DiskRegion has been closed or destroyed", dr.getName()); } RegionVersionVector inMemoryRVV = (region == null) ? null : region.getVersionVector(); // persist the new GC RVV information for this region to the CRF PersistentOplogSet oplogSet = getPersistentOplogSet(dr); // use current dr.rvvTrust oplogSet.getChild().writeRVV(dr, inMemoryRVV, isRVVTrusted); } finally { releaseReadLock(dr); } }
/** * @since GemFire 3.2.1 */ byte getBits(DiskRegion dr, DiskId id) { acquireReadLock(dr); try { if (dr.isRegionClosed()) { throw new RegionDestroyedException( "The DiskRegion has been closed or destroyed", dr.getName()); } if (dr.didClearCountChange()) { // value not present on disk as it has been cleared. Return invalid // userbit return EntryBits.setInvalid((byte) 0, true); } // TODO:Asif : Fault In? BytesAndBits bb = getBytesAndBitsWithoutLock(dr, id, true, true /* * Get only user bit */); if (bb == CLEAR_BB) { return EntryBits.setInvalid((byte) 0, true); } return bb.getBits(); } finally { releaseReadLock(dr); } }
BytesAndBits getBytesAndBits(DiskRegion dr, DiskId id, boolean faultingIn) { acquireReadLock(dr); try { if (dr.isRegionClosed()) { throw new RegionDestroyedException( "The DiskRegion has been closed or destroyed", dr.getName()); } if (dr.didClearCountChange()) { throw new DiskAccessException( "Entry has been cleared and is not present on disk", dr.getName()); } BytesAndBits bb = getBytesAndBitsWithoutLock(dr, id, faultingIn, false /* * Get only user bit */); if (bb == CLEAR_BB) { throw new DiskAccessException( "Entry has been cleared and is not present on disk", dr.getName()); } return bb; } finally { releaseReadLock(dr); } }
public void writeRVVGC(DiskRegion dr, LocalRegion region) { acquireReadLock(dr); try { if (dr.isRegionClosed()) {
DiskRegion dr = region.getDiskRegion(); if (!async) { acquireReadLock(dr);
public void putVersionTagOnly(InternalRegion region, VersionTag tag, boolean async) { DiskRegion dr = region.getDiskRegion(); // this method will only be called by backup oplog assert dr.isBackup(); if (!async) { acquireReadLock(dr); } try { if (dr.isRegionClosed()) { region.getCancelCriterion().checkCancelInProgress(null); throw new RegionDestroyedException( "The DiskRegion has been closed or destroyed", dr.getName()); } if (dr.getRegionVersionVector().contains(tag.getMemberID(), tag.getRegionVersion())) { // No need to write the conflicting tag to disk if the disk RVV already // contains this tag. return; } PersistentOplogSet oplogSet = getPersistentOplogSet(dr); oplogSet.getChild().saveConflictVersionTag(region, tag, async); } finally { if (!async) { releaseReadLock(dr); } } }