@Override public IndexOutput createTempOutput(String prefix, String suffix, IOContext context) throws IOException { return in.createTempOutput(prefix, suffix, context); }
/** 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; }
@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 createTempOutput(String prefix, String suffix, IOContext context) throws IOException { return getDirectory("."+suffix).createTempOutput(prefix, suffix, context); }
@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(); } } } }
try { while (true) { out = first.createTempOutput(prefix, suffix, context); String name = out.getName(); toDelete.add(name);
try (ByteSequencesWriter writer = getWriter(dir.createTempOutput(tempFileNamePrefix, "sort", IOContext.DEFAULT), totalCount)) {
IndexOutput unsorted = tempDir.createTempOutput(tempFileNamePrefix, "dat", IOContext.DEFAULT); try (ByteSequencesWriter writer = new ByteSequencesWriter(unsorted)) { for (InputStream dictionary : dictionaries) {
@Override public IndexOutput createTempOutput(String prefix, String suffix, IOContext context) throws IOException { return in.createTempOutput(prefix, suffix, context); }
@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; }
/** 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; }
@Override public IndexOutput createTempOutput(String prefix, String suffix, IOContext context) throws IOException { return getDirectory("."+suffix).createTempOutput(prefix, suffix, context); }
OfflineSorter sorter = new OfflineSorter(tempDir, prefix, new AnalyzingComparator(hasPayloads)); IndexOutput tempInput = tempDir.createTempOutput(prefix, "input", IOContext.DEFAULT);
@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(); } } } }
try { while (true) { out = first.createTempOutput(prefix, suffix, context); String name = out.getName(); toDelete.add(name);
try (ByteSequencesWriter writer = getWriter(dir.createTempOutput(tempFileNamePrefix, "sort", IOContext.DEFAULT), totalCount)) {
OfflineSorter sorter = new OfflineSorter(tempDir, prefix, new AnalyzingComparator(hasPayloads)); IndexOutput tempInput = tempDir.createTempOutput(prefix, "input", IOContext.DEFAULT);
OfflineSorter sorter = new OfflineSorter(tempDir, prefix, new AnalyzingComparator(hasPayloads)); IndexOutput tempInput = tempDir.createTempOutput(prefix, "input", IOContext.DEFAULT);
OfflineSorter sorter = new OfflineSorter(tempDir, prefix, new AnalyzingComparator(hasPayloads)); IndexOutput tempInput = tempDir.createTempOutput(prefix, "input", IOContext.DEFAULT);