OplogIndex(Oplog oplog) { this.oplog = oplog; this.dsi = oplog.getParent(); }
public boolean hasNoLiveValues() { return this.totalLiveCount.get() <= 0 // if we have an unrecoveredRegion then we don't know how many liveValues we have && this.unrecoveredRegionCount.get() == 0 && !getParent().isOfflineCompacting(); }
/** * Schedule a task to create a krf asynchronously * */ protected void createKrfAsync() { getParent().executeDiskStoreTask(new Runnable() { public void run() { createKrf(false); } }); }
public boolean hasNoLiveValues() { return this.totalLiveCount.get() <= 0 // if we have an unrecoveredRegion then we don't know how many liveValues we // have && this.unrecoveredRegionCount.get() == 0 && !getParent().isOfflineCompacting(); }
/** * Write an RVV record containing all of the live disk regions. */ private void writeRVVRecord(OplogFile olf, boolean writeGCRVV) throws IOException { writeRVVRecord(olf, getParent().getAllDiskRegions(), writeGCRVV); }
/** * Write an RVV record containing all of the live disk regions. */ private void writeRVVRecord(OplogFile olf, boolean writeGCRVV) throws IOException { writeRVVRecord(olf, getParent().getAllDiskRegions(), writeGCRVV); }
public final void flushAll(boolean skipDrf, boolean doSync, boolean dofsync) { try { // if (!skipDrf) { // @todo if skipDrf then only need to do drf if crf has flushable data flush(this.drf, doSync, dofsync); // } flush(this.crf, doSync, dofsync); } catch (IOException ex) { getParent().getCancelCriterion().checkCancelInProgress(ex); throw new DiskAccessException(LocalizedStrings.Oplog_FAILED_WRITING_KEY_TO_0.toLocalizedString(this.diskFile.getPath()), ex, getParent()); } }
private void initLastModifiedTime(long lastModifiedTime) { if (lastModifiedTime == 0) { lastModifiedTime = getParent().getCache().cacheTimeMillis(); } this.lastModifiedTime = lastModifiedTime; this.lmtBytes = InternalDataSerializer .getUnsignedVLSize(lastModifiedTime); this.size += this.lmtBytes; }
private Version readProductVersionRecord(DataInput dis, File f) throws IOException { Version recoveredGFVersion; short ver = Version.readOrdinal(dis); try { recoveredGFVersion = Version.fromOrdinal(ver, false); } catch (UnsupportedVersionException e) { throw new DiskAccessException(LocalizedStrings.Oplog_UNEXPECTED_PRODUCT_VERSION_0.toLocalizedString(ver), e, getParent()); } logger.trace(LogMarker.PERSIST_RECOVERY, "version={}", recoveredGFVersion); readEndOfRecord(dis); return recoveredGFVersion; }
private synchronized VersionTag createDummyTag(DiskRecoveryStore drs) { DiskStoreID member = getParent().getDiskStoreID(); int memberid = getParent().getDiskInitFile().getOrCreateCanonicalId(member); long regionVersion = drs.getVersionForMember(member); VersionTag vt = VersionTag.create(member); vt.setEntryVersion(1); vt.setRegionVersion(regionVersion + 1); vt.setMemberID(member); vt.setVersionTimeStamp(getParent().getCache().cacheTimeMillis()); vt.setDistributedSystemId(-1); return vt; }
public void deleteCRF() { oplogSet.crfDelete(this.oplogId); DiskStoreBackup inProgressBackup = getParent().getInProgressBackup(); if(inProgressBackup == null || !inProgressBackup.deferCrfDelete(this)) { deleteCRFFileOnly(); } }
public void deleteCRF() { oplogSet.crfDelete(this.oplogId); DiskStoreBackup inProgressBackup = getParent().getInProgressBackup(); if (inProgressBackup == null || !inProgressBackup.deferCrfDelete(this)) { deleteCRFFileOnly(); } }
private Object deserializeKey(byte[] keyBytes, final Version version, final ByteArrayDataInput in) { if (!getParent().isOffline() || !PdxWriterImpl.isPdx(keyBytes)) { return EntryEventImpl.deserialize(keyBytes, version, in); } else { return new RawByteKey(keyBytes); } }
private Object deserializeKey(byte[] keyBytes, final Version version, final ByteArrayDataInput in) { if (!getParent().isOffline() || !PdxWriterImpl.isPdx(keyBytes)) { return EntryEventImpl.deserialize(keyBytes, version, in); } else { return new RawByteKey(keyBytes); } }
public void deleteDRF() { getOplogSet().drfDelete(this.oplogId); DiskStoreBackup inProgressBackup = getParent().getInProgressBackup(); if (inProgressBackup == null || !inProgressBackup.deferDrfDelete(this)) { deleteDRFFileOnly(); } }
public void copyTo(File targetDir) throws IOException { if (this.crf.f != null) { // fixes bug 43951 FileUtil.copy(this.crf.f, targetDir); } FileUtil.copy(this.drf.f, targetDir); // this krf existence check fixes 45089 if (getParent().getDiskInitFile().hasKrf(this.oplogId)) { FileUtil.copy(this.getKrfFile(), targetDir); } }
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 writeDiskStoreRecord(OplogFile olf) throws IOException { this.opState = new OpState(); this.opState.initialize(getParent().getDiskStoreID()); writeOpLogBytes(olf, false, true); // fix for bug 41928 olf.currSize += getOpStateSize(); this.dirHolder.incrementTotalOplogSize(getOpStateSize()); }
private void serializeVersionTag(int entryVersion, long regionVersion, VersionSource versionMember, long timestamp, int dsId, DataOutput out) throws IOException { int memberId = getParent().getDiskInitFile().getOrCreateCanonicalId(versionMember); InternalDataSerializer.writeSignedVL(entryVersion, out); InternalDataSerializer.writeUnsignedVL(regionVersion, out); InternalDataSerializer.writeUnsignedVL(memberId, out); InternalDataSerializer.writeUnsignedVL(timestamp, out); InternalDataSerializer.writeSignedVL(dsId, out); }
private void writeDiskStoreRecord(OplogFile olf, OPLOG_TYPE type) throws IOException { this.opState = new OpState(); this.opState.initialize(type); writeOpLogBytes(olf, false, true); olf.currSize += getOpStateSize(); this.dirHolder.incrementTotalOplogSize(getOpStateSize()); clearOpState(); this.opState.initialize(getParent().getDiskStoreID()); writeOpLogBytes(olf, false, true); // fix for bug 41928 olf.currSize += getOpStateSize(); this.dirHolder.incrementTotalOplogSize(getOpStateSize()); }