/** * Return true if it is possible that compaction of this oplog will be done. */ private boolean isCompactionPossible() { return getOplogSet().isCompactionPossible(); }
/** * @return true if this Oplog could end up having a KRF file. */ private boolean couldHaveKrf() { return getOplogSet().couldHaveKrf(); }
/** * Return true if it is possible that compaction of this oplog will be done. */ private boolean isCompactionPossible() { return getOplogSet().isCompactionPossible(); }
/** * @return true if this Oplog could end up having a KRF file. */ private boolean couldHaveKrf() { return getOplogSet().couldHaveKrf(); }
private synchronized void addToBeCompacted() { if (this.added) return; this.added = true; getOplogSet().addToBeCompacted(this); if (logger.isDebugEnabled()) { logger.debug("Oplog::switchOpLog: Added the Oplog = {} for compacting.", this.oplogId); } }
/** * Return true if this oplog is the oldest one of those ready to compact */ private boolean isOldest() { long myId = getOplogId(); return getOplogSet().isOldestExistingOplog(myId); }
/** * Return true if this oplog is the oldest one of those ready to compact */ private boolean isOldest() { long myId = getOplogId(); return getOplogSet().isOldestExistingOplog(myId); }
private void handleEmptyAndOldest(boolean calledByCompactor) { if (!calledByCompactor && logger.isDebugEnabled()) { logger.debug("Deleting oplog early because it is empty. It is for disk store {} and has oplog#{}", getParent().getName(), oplogId); } destroy(); getOplogSet().destroyOldestReadyToCompact(); }
/** * This oplog will be forced to switch to a new oplog */ void forceRolling(DiskRegion dr) { if (getOplogSet().getChild() == this) { synchronized (this.lock) { if (getOplogSet().getChild() == this) { switchOpLog(dr, 0, null); } } if (LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER) { CacheObserverHolder.getInstance().afterSwitchingOplog(); } } }
private synchronized void addToBeCompacted() { if (this.added) return; this.added = true; getOplogSet().addToBeCompacted(this); if (this.logger.fineEnabled()) { this.logger.fine("Oplog::switchOpLog: Added the Oplog = " + this.oplogId + " for compacting. "); } }
/** * This oplog will be forced to switch to a new oplog */ void forceRolling(DiskRegion dr, boolean blocking) { if (getOplogSet().getChild() == this) { synchronized (this.lock) { if (getOplogSet().getChild() == this) { switchOpLog(dr, 0, null, blocking); } } if (LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER) { CacheObserverHolder.getInstance().afterSwitchingOplog(); } } }
public void deleteDRF() { getOplogSet().drfDelete(this.oplogId); DiskStoreBackup inProgressBackup = getParent().getInProgressBackup(); if (inProgressBackup == null || !inProgressBackup.deferDrfDelete(this)) { deleteDRFFileOnly(); } }
private void readVersionTagOnlyEntry(CountingDataInputStream dis, byte opcode) throws IOException { long oplogOffset = -1; long drId = DiskInitFile.readDiskRegionID(dis); DiskRecoveryStore drs = getOplogSet().getCurrentlyRecovering(drId); // read versions VersionTag tag = readVersionsFromOplog(dis); if (logger.isTraceEnabled(LogMarker.PERSIST_RECOVERY)) { logger.trace(LogMarker.PERSIST_RECOVERY, "readVersionTagOnlyEntry drId={} tag={}", drId, tag); } readEndOfRecord(dis); // Update the RVV with the new entry if (drs != null) { drs.recordRecoveredVersionTag(tag); } }
public void deleteDRF() { getOplogSet().drfDelete(this.oplogId); DiskStoreBackup inProgressBackup = getParent().getInProgressBackup(); if(inProgressBackup == null || !inProgressBackup.deferDrfDelete(this)) { deleteDRFFileOnly(); } }
public final void saveConflictVersionTag(LocalRegion region, VersionTag tag, boolean async) { if (getOplogSet().getChild() != this) { getOplogSet().getChild().saveConflictVersionTag(region, tag, async); } else { try { basicSaveConflictVersionTag(region.getDiskRegion(), tag, async); } catch (IOException ex) { region.getCancelCriterion().checkCancelInProgress(ex); throw new DiskAccessException(LocalizedStrings.Oplog_FAILED_CONFLICT_VERSION_TAG_0.toLocalizedString(this.diskFile .getPath()), ex, region.getFullPath()); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); region.getCancelCriterion().checkCancelInProgress(ie); throw new DiskAccessException(LocalizedStrings.Oplog_FAILED_CONFLICT_VERSION_TAG_0.toLocalizedString(this.diskFile .getPath()), ie, region.getFullPath()); } } }
public final void saveConflictVersionTag(LocalRegion region, VersionTag tag, boolean async) { if (getOplogSet().getChild() != this) { getOplogSet().getChild().saveConflictVersionTag(region, tag, async); } else { try { basicSaveConflictVersionTag(region.getDiskRegion(), tag, async); } catch (IOException ex) { region.getCancelCriterion().checkCancelInProgress(ex); throw new DiskAccessException(LocalizedStrings.Oplog_FAILED_CONFLICT_VERSION_TAG_0.toLocalizedString(this.diskFile.getPath()), ex, region.getFullPath()); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); region.getCancelCriterion().checkCancelInProgress(ie); throw new DiskAccessException(LocalizedStrings.Oplog_FAILED_CONFLICT_VERSION_TAG_0.toLocalizedString(this.diskFile.getPath()), ie, region.getFullPath()); } } }
private void handleEmptyAndOldest(boolean calledByCompactor) { if (!calledByCompactor) { if (logger.infoEnabled()) { logger.info(LocalizedStrings.DEBUG, "Deleting oplog early because it is empty. It is for disk store " + getParent().getName() + " and has oplog#" + oplogId); } } destroy(); getOplogSet().destroyOldestReadyToCompact(); } private void handleEmpty(boolean calledByCompactor) {
private void readVersionTagOnlyEntry(CountingDataInputStream dis, byte opcode) throws IOException { long drId = DiskInitFile.readDiskRegionID(dis); DiskRecoveryStore drs = getOplogSet().getCurrentlyRecovering(drId); // read versions VersionTag tag = readVersionsFromOplog(dis); if (DiskStoreImpl.TRACE_RECOVERY) { logger.info(LocalizedStrings.DEBUG, "TRACE_RECOVERY readVersionTagOnlyEntry " +" drId="+drId+" tag="+tag); } readEndOfRecord(dis); //Update the RVV with the new entry if(drs != null) { drs.recordRecoveredVersionTag(tag); } }
/** * The oplogId in re points to the oldOplogId. "this" oplog is the current * oplog. */ private void updateRecoveredEntry(DiskRegionView drv, DiskEntry de, DiskEntry.RecoveredEntry re) { if (getOplogId() != re.getOplogId()) { Oplog oldOplog = getOplogSet().getChild(re.getOplogId()); oldOplog.rmLive(drv, de); initRecoveredEntry(drv, de); } else { getDRI(drv).update(de); } }
/** * The oplogId in re points to the oldOplogId. * "this" oplog is the current oplog. */ private void updateRecoveredEntry(DiskRegionView drv, DiskEntry de, DiskEntry.RecoveredEntry re) { if (getOplogId() != re.getOplogId()) { Oplog oldOplog = getOplogSet().getChild(re.getOplogId()); oldOplog.rmLive(drv, de); initRecoveredEntry(drv, de); } else { getDRI(drv).update(de); } }