public void acquireReadLock() { getDiskStore().acquireReadLock(this); } public void releaseReadLock() {
public void acquireReadLock() { getDiskStore().acquireReadLock(this); } public void releaseReadLock() {
public boolean forceCompaction(DiskRegion dr) { if (!dr.isBackup()) return false; acquireReadLock(dr); try { return basicForceCompaction(dr); } finally { releaseReadLock(dr); } }
public boolean forceCompaction(DiskRegion dr) { if (!dr.isBackup()) return false; acquireReadLock(dr); try { return basicForceCompaction(dr); } finally { releaseReadLock(dr); } }
/** * @since 3.2.1 */ final byte getBits(DiskRegion dr, DiskId id) { acquireReadLock(dr); try { // 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); } }
final BytesAndBits getBytesAndBits(DiskRegion dr, DiskId id, boolean faultingIn) { acquireReadLock(dr); try { BytesAndBits bb = getBytesAndBitsWithoutLock(dr, id, faultingIn, false /* * Get * only * user * bit */); if (bb == CLEAR_BB) { throw new DiskAccessException( LocalizedStrings.DiskRegion_ENTRY_HAS_BEEN_CLEARED_AND_IS_NOT_PRESENT_ON_DISK .toLocalizedString(), dr.getName()); } return bb; } finally { releaseReadLock(dr); } }
/** * @since 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); } }
acquireReadLock(dr); try { int count = 0;
/** * @since 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</code> is less than zero, no action is taken. */ public final 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); } else { return null; } } 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</code> is less than zero, no action is taken. */ public final 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); } 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( LocalizedStrings.DiskRegion_THE_DISKREGION_HAS_BEEN_CLOSED_OR_DESTROYED .toLocalizedString(), 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); } }
acquireReadLock(dr); try { if (dr.isRegionClosed()) {
public void writeRVV(DiskRegion dr, LocalRegion region, Boolean isRVVTrusted) { if (region != null && !region.getConcurrencyChecksEnabled()) { return; } acquireReadLock(dr); try { if (dr.isRegionClosed()) { dr.getCancelCriterion().checkCancelInProgress(null); throw new RegionDestroyedException( LocalizedStrings.DiskRegion_THE_DISKREGION_HAS_BEEN_CLOSED_OR_DESTROYED .toLocalizedString(), 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); } }
public void writeRVVGC(DiskRegion dr, LocalRegion region) { acquireReadLock(dr); try { if (dr.isRegionClosed()) {
return; acquireReadLock(dr); try { if (dr.isRegionClosed()) {
final BytesAndBits getBytesAndBits(DiskRegion dr, DiskId id, boolean faultingIn) { acquireReadLock(dr); try { if (dr.isRegionClosed()) { throw new RegionDestroyedException( LocalizedStrings.DiskRegion_THE_DISKREGION_HAS_BEEN_CLOSED_OR_DESTROYED .toLocalizedString(), dr.getName()); } if (dr.didClearCountChange()) { throw new DiskAccessException( LocalizedStrings.DiskRegion_ENTRY_HAS_BEEN_CLEARED_AND_IS_NOT_PRESENT_ON_DISK .toLocalizedString(), dr.getName()); } BytesAndBits bb = getBytesAndBitsWithoutLock(dr, id, faultingIn, false /* * Get * only * user * bit */); if (bb == CLEAR_BB) { throw new DiskAccessException( LocalizedStrings.DiskRegion_ENTRY_HAS_BEEN_CLEARED_AND_IS_NOT_PRESENT_ON_DISK .toLocalizedString(), dr.getName()); } return bb; } finally { releaseReadLock(dr); } }
final void putVersionTagOnly(LocalRegion 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( LocalizedStrings.DiskRegion_THE_DISKREGION_HAS_BEEN_CLOSED_OR_DESTROYED .toLocalizedString(), 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); } } }
final void putVersionTagOnly(LocalRegion 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( LocalizedStrings.DiskRegion_THE_DISKREGION_HAS_BEEN_CLOSED_OR_DESTROYED .toLocalizedString(), 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); } } }
DiskRegion dr = region.getDiskRegion(); if (!async) { acquireReadLock(dr);