@Override public void flush() { storeCurrentBuffer(false); }
public void flush() { storeCurrentBuffer(false); }
public void flush() { storeCurrentBuffer(false); }
private void newChunk() { storeCurrentBuffer(false);// save data first currentChunkNumber++; // check if we have to create new chunk, or get already existing in cache for modification buffer = getChunkById(fileKey, currentChunkNumber, bufferSize); positionInBuffer = 0; }
private void newChunk() { storeCurrentBuffer(false);// save data first currentChunkNumber++; // check if we have to create new chunk, or get already existing in cache for modification buffer = getChunkById(fileKey, currentChunkNumber, bufferSize); positionInBuffer = 0; }
private void newChunk() { storeCurrentBuffer(false);// save data first currentChunkNumber++; // check if we have to create new chunk, or get already existing in cache for modification buffer = getChunkById(fileKey, currentChunkNumber, bufferSize); positionInBuffer = 0; }
public void close() { if (currentChunkNumber==0) { //store current chunk, possibly resizing it storeCurrentBuffer(true); } else { //no need to resize first chunk, just store it: storeBufferAsChunk(this.firstChunkBuffer, 0); storeCurrentBuffer(true); } buffer = null; firstChunkBuffer = null; // override existing file header with updated accesstime metadataCache.withFlags(Flag.IGNORE_RETURN_VALUES).put(fileKey, file); fileOps.addFileName(this.fileKey.getFileName()); if (trace) { log.tracef("Closed IndexOutput for %s", fileKey); } }
public void close() { if (currentChunkNumber==0) { //store current chunk, possibly resizing it storeCurrentBuffer(true); } else { //no need to resize first chunk, just store it: storeBufferAsChunk(this.firstChunkBuffer, 0); storeCurrentBuffer(true); } buffer = null; firstChunkBuffer = null; // override existing file header with updated accesstime metadataCache.withFlags(Flag.IGNORE_RETURN_VALUES).put(fileKey, file); fileOps.addFileName(this.fileKey.getFileName()); if (trace) { log.tracef("Closed IndexOutput for %s", fileKey); } }
@Override public void close() { if (currentChunkNumber==0) { //store current chunk, possibly resizing it storeCurrentBuffer(true); } else { //no need to resize first chunk, just store it: storeBufferAsChunk(this.firstChunkBuffer, 0); storeCurrentBuffer(true); } buffer = null; firstChunkBuffer = null; // override existing file header with updated accesstime file.touch(); metadataCache.withFlags(Flag.IGNORE_RETURN_VALUES).put(fileKey, file); fileOps.addFileName(this.fileKey.getFileName()); if (trace) { log.tracef("Closed IndexOutput for %s", fileKey); } }
@Override public void seek(final long pos) throws IOException { final int requestedChunkNumber = getChunkNumberFromPosition(pos, bufferSize); if (pos > file.getSize()) { resizeFileIfNeeded(); if (pos > file.getSize()) // check again, might be fixed by the resize throw new IOException(fileKey.getFileName() + ": seeking past end of file"); } if (requestedChunkNumber != currentChunkNumber) { storeCurrentBuffer(false); if (requestedChunkNumber != 0) { buffer = getChunkById(fileKey, requestedChunkNumber, bufferSize); } else { buffer = firstChunkBuffer; } currentChunkNumber = requestedChunkNumber; } positionInBuffer = getPositionInBuffer(pos, bufferSize); filePosition = pos; }
public void seek(final long pos) throws IOException { final int requestedChunkNumber = getChunkNumberFromPosition(pos, bufferSize); if (pos > file.getSize()) { resizeFileIfNeeded(); if (pos > file.getSize()) // check again, might be fixed by the resize throw new IOException(fileKey.getFileName() + ": seeking past end of file"); } if (requestedChunkNumber != currentChunkNumber) { storeCurrentBuffer(false); if (requestedChunkNumber != 0) { buffer = getChunkById(fileKey, requestedChunkNumber, bufferSize); } else { buffer = firstChunkBuffer; } currentChunkNumber = requestedChunkNumber; } positionInBuffer = getPositionInBuffer(pos, bufferSize); filePosition = pos; }
public void seek(final long pos) throws IOException { final int requestedChunkNumber = getChunkNumberFromPosition(pos, bufferSize); if (pos > file.getSize()) { resizeFileIfNeeded(); if (pos > file.getSize()) // check again, might be fixed by the resize throw new IOException(fileKey.getFileName() + ": seeking past end of file"); } if (requestedChunkNumber != currentChunkNumber) { storeCurrentBuffer(false); if (requestedChunkNumber != 0) { buffer = getChunkById(fileKey, requestedChunkNumber, bufferSize); } else { buffer = firstChunkBuffer; } currentChunkNumber = requestedChunkNumber; } positionInBuffer = getPositionInBuffer(pos, bufferSize); filePosition = pos; }