@Override public void close() throws IOException { dataOut.close(); } }
@Override public void close() throws IOException { fieldsIndexOut.close(); }
/** * Closes the provided {@link IndexOutput}. */ @Override public void close() throws IOException { out.close(); } }
@Override public void close() throws IOException { delegate.close(); }
@Override public void close() throws IOException { if (closed == false) { assert sharedReader == null; try { CodecUtil.writeFooter(out); } finally { out.close(); closed = true; } } }
@Override public void close() throws IOException { if (tempInput != null) { // NOTE: this should only happen on exception, e.g. caller calls close w/o calling finish: try { tempInput.close(); } finally { tempDir.deleteFile(tempInput.getName()); tempInput = null; } } }
toDelete.add(name); if (slowFileExists(second, name)) { out.close(); } else { toDelete.remove(name);
private void write(Directory directory) throws IOException { long nextGeneration = getNextPendingGeneration(); String segmentFileName = IndexFileNames.fileNameFromGeneration(IndexFileNames.PENDING_SEGMENTS, "", nextGeneration); // Always advance the generation on write: generation = nextGeneration; IndexOutput segnOutput = null; boolean success = false; try { segnOutput = directory.createOutput(segmentFileName, IOContext.DEFAULT); write(directory, segnOutput); segnOutput.close(); directory.sync(Collections.singleton(segmentFileName)); success = true; } finally { if (success) { pendingCommit = true; } else { // We hit an exception above; try to close the file // but suppress any exception: IOUtils.closeWhileHandlingException(segnOutput); // Try not to leave a truncated segments_N file in // the index: IOUtils.deleteFilesIgnoringExceptions(directory, segmentFileName); } } }
@Override public void close() throws IOException { out.close(); } }
@Override public void close() throws IOException { out.close(); }
sorter.reset(docs, offsets); sorter.sort(0, upto); out.close(); this.postingInput = new RAMInputStream("", file);
@Override protected void closeInternal() { try { // clean open index outputs Iterator<Entry<String, IndexOutput>> iterator = openIndexOutputs.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry<String, IndexOutput> entry = iterator.next(); logger.trace("closing IndexOutput file [{}]", entry.getValue()); try { entry.getValue().close(); } catch (Exception e) { logger.debug(() -> new ParameterizedMessage("error while closing recovery output [{}]", entry.getValue()), e); } iterator.remove(); } // trash temporary files for (String file : tempFileNames.keySet()) { logger.trace("cleaning temporary file [{}]", file); store.deleteQuiet(file); } } finally { // free store. increment happens in constructor store.decRef(); indexShard.recoveryStats().decCurrentAsTarget(); closedLatch.countDown(); } }
indexOutput.close(); store.directory().sync(Collections.singleton(fileInfo.physicalName())); success = true;
} finally { indexOutput.close();
@Override public void close() throws IOException { delegate.close(); openOutputs.remove( IndexOutputDelegate.this ); }
@Override public void close() throws IOException { if (tempInput != null) { // NOTE: this should only happen on exception, e.g. caller calls close w/o calling finish: try { tempInput.close(); } finally { tempDir.deleteFile(tempInput.getName()); tempInput = null; } } }
public void close() throws IOException { ramIndexOutput.close(); ramIndexOutput.writeTo(origIndexOutput); origIndexOutput.close(); } }
private int createFile(Directory dir, String fileName) throws IOException { int size = rnd.nextInt(1000) + 1; byte[] data = randomBytes(size); IndexOutput o = dir.createOutput(fileName, IOContext.DEFAULT); o.writeBytes(data, data.length); o.close(); return size; }
private void addFiles(Directory dir) throws IOException { for (int i = 0; i < 100; i++) { byte[] data = randomBytes(); IndexOutput out = dir.createOutput("file-" + i, IOContext.DEFAULT); out.writeBytes(data, data.length); out.close(); } }
private void createFile(final String fileName, final Directory dir) throws IOException { IndexOutput io = null; try { io = dir.createOutput(fileName, IOContext.DEFAULT); io.writeByte((byte) 66); io.writeByte((byte) 69); } finally { io.close(); } }