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); } }