/** * Creates the drf oplog file * * @throws IOException */ private void createDrf(OplogFile prevOlf) throws IOException { File f = new File(this.diskFile.getPath() + DRF_FILE_EXT); this.drf.f = f; if (logger.isDebugEnabled()) { logger.debug("Creating operation log file {}", f); } preblow(this.drf, getMaxDrfSize()); this.drf.raf = new UninterruptibleRandomAccessFile(f, SYNC_WRITES ? "rwd" : "rw"); this.drf.RAFClosed = false; this.oplogSet.drfCreate(this.oplogId); this.drf.writeBuf = allocateWriteBuf(prevOlf); logger.info(LocalizedMessage.create(LocalizedStrings.Oplog_CREATE_0_1_2, new Object[] { toString(), getFileType(this.drf), getParent().getName() })); this.drf.channel = this.drf.raf.getChannel(); writeDiskStoreRecord(this.drf, OPLOG_TYPE.DRF); writeGemfireVersionRecord(this.drf); writeRVVRecord(this.drf, true); }
unpreblow(this.drf, getMaxDrfSize()); if (!this.drf.RAFClosed) { final OplogFile.FileChannelOutputStream stream = this.drf.outputStream;
logger.fine("Creating operation log file " + f); preblow(this.drf, getMaxDrfSize()); this.drf.raf = new RandomAccessFile(f, getParent().getSyncWrites() ? "rwd" : "rw");
this.drf.RAFClosed = false; this.drf.channel = this.drf.raf.getChannel(); unpreblow(this.drf, getMaxDrfSize()); } finally { this.drf.raf.close();
unpreblow(this.drf, getMaxDrfSize()); if (!this.drf.RAFClosed) { try {
this.drf.RAFClosed = false; this.drf.channel = this.drf.raf.getChannel(); unpreblow(this.drf, getMaxDrfSize()); } finally { this.drf.raf.close();
if (getOplogSet().getChild() != this) { useNextOplog = true; } else if ((this.drf.currSize + MAX_DELETE_ENTRY_RECORD_BYTES) > getMaxDrfSize() && !isFirstRecord()) { switchOpLog(dr, MAX_DELETE_ENTRY_RECORD_BYTES, entry); useNextOplog = true;
useNextOplog = true; } else if ((this.drf.currSize + MAX_DELETE_ENTRY_RECORD_BYTES) > getMaxDrfSize() && !isFirstRecord()) { switchOpLog(dr, MAX_DELETE_ENTRY_RECORD_BYTES, entry, false); useNextOplog = true;