/** Create a new writer with an unknown number of incoming points */ public OfflinePointWriter(Directory tempDir, String tempFileNamePrefix, int packedBytesLength, boolean longOrds, String desc, long expectedCount, boolean singleValuePerDoc) throws IOException { this.out = tempDir.createTempOutput(tempFileNamePrefix, "bkd_" + desc, IOContext.DEFAULT); this.name = out.getName(); this.tempDir = tempDir; this.packedBytesLength = packedBytesLength; this.longOrds = longOrds; this.singleValuePerDoc = singleValuePerDoc; this.expectedCount = expectedCount; }
public RateLimitedIndexOutput(final RateLimiter rateLimiter, final IndexOutput delegate) { super("RateLimitedIndexOutput(" + delegate + ")", delegate.getName()); this.delegate = delegate; this.rateLimiter = rateLimiter; this.currentMinPauseCheckBytes = rateLimiter.getMinPauseCheckBytes(); }
@Override public IndexOutput createTempOutput(String prefix, String suffix, IOContext context) throws IOException { IndexOutput tempOutput = in.createTempOutput(prefix, suffix, context); createdFileNames.add(tempOutput.getName()); return tempOutput; }
@Override public IndexOutput createOutput(String name, IOContext context) throws IOException { IndexOutput output = super.createTempOutput(name, "", context); fileNames.put(name, output.getName()); return output; }
@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; } } }
@Override public Partition call() throws IOException { try (IndexOutput tempFile = dir.createTempOutput(tempFileNamePrefix, "sort", IOContext.DEFAULT); ByteSequencesWriter out = getWriter(tempFile, part.buffer.size());) { BytesRef spare; long startMS = System.currentTimeMillis(); BytesRefIterator iter = part.buffer.iterator(comparator); sortInfo.sortTimeMS.addAndGet(System.currentTimeMillis() - startMS); int count = 0; while ((spare = iter.next()) != null) { out.write(spare); count++; } assert count == part.count; CodecUtil.writeFooter(out.out); part.buffer.clear(); return new Partition(tempFile.getName(), part.count); } finally { if (partitionsInRAM != null) { partitionsInRAM.release(); } } } }
while (true) { out = first.createTempOutput(prefix, suffix, context); String name = out.getName(); toDelete.add(name); if (slowFileExists(second, name)) {
result = out.getName();
try (ByteSequencesWriter writer = getWriter(dir.createTempOutput(tempFileNamePrefix, "sort", IOContext.DEFAULT), totalCount)) { newSegmentName = writer.out.getName();
tempDir.deleteFile(tempInput.getName()); tempInput = null; } else {
public FilterIndexOutput(String resourceDescription, IndexOutput out) { super(resourceDescription, out.getName()); this.out = out; }
String name = sorter.sort(tempInput.getName());
public FilterIndexOutput(String resourceDescription, IndexOutput out) { super(resourceDescription, out.getName()); this.out = out; }
public RateLimitedIndexOutput(final RateLimiter rateLimiter, final IndexOutput delegate) { super("RateLimitedIndexOutput(" + delegate + ")", delegate.getName()); this.delegate = delegate; this.rateLimiter = rateLimiter; this.currentMinPauseCheckBytes = rateLimiter.getMinPauseCheckBytes(); }
@Override public IndexOutput createOutput(String name, IOContext context) throws IOException { IndexOutput output = super.createTempOutput(name, "", context); fileNames.put(name, output.getName()); return output; }
@Override public IndexOutput createTempOutput(String prefix, String suffix, IOContext context) throws IOException { IndexOutput tempOutput = in.createTempOutput(prefix, suffix, context); createdFileNames.add(tempOutput.getName()); return tempOutput; }
@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; } } }
@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; } } }