PointWriter getPointWriter(long count, String desc) throws IOException { if (count <= maxPointsSortInHeap) { int size = Math.toIntExact(count); return new HeapPointWriter(size, size, packedBytesLength, longOrds, singleValuePerDoc); } else { return new OfflinePointWriter(tempDir, tempFileNamePrefix, packedBytesLength, longOrds, desc, count, singleValuePerDoc); } }
heapPointWriter = new HeapPointWriter(16, maxPointsSortInHeap, packedBytesLength, longOrds, singleValuePerDoc);
/** Pull a partition back into heap once the point count is low enough while recursing. */ private PathSlice switchToHeap(PathSlice source, List<Closeable> toCloseHeroically) throws IOException { int count = Math.toIntExact(source.count); // Not inside the try because we don't want to close it here: PointReader reader = source.writer.getSharedReader(source.start, source.count, toCloseHeroically); try (PointWriter writer = new HeapPointWriter(count, count, packedBytesLength, longOrds, singleValuePerDoc)) { for(int i=0;i<count;i++) { boolean hasNext = reader.next(); assert hasNext; writer.append(reader.packedValue(), reader.ord(), reader.docID()); } return new PathSlice(writer, 0, count); } catch (Throwable t) { throw verifyChecksum(t, source.writer); } }
} else { sorted = new HeapPointWriter((int) pointCount, (int) pointCount, packedBytesLength, longOrds, singleValuePerDoc); sorted.copyFrom(heapPointWriter);
PointWriter getPointWriter(long count, String desc) throws IOException { if (count <= maxPointsSortInHeap) { int size = Math.toIntExact(count); return new HeapPointWriter(size, size, packedBytesLength, longOrds, singleValuePerDoc); } else { return new OfflinePointWriter(tempDir, tempFileNamePrefix, packedBytesLength, longOrds, desc, count, singleValuePerDoc); } }
PointWriter getPointWriter(long count, String desc) throws IOException { if (count <= maxPointsSortInHeap) { int size = Math.toIntExact(count); return new HeapPointWriter(size, size, packedBytesLength, longOrds, singleValuePerDoc); } else { return new OfflinePointWriter(tempDir, tempFileNamePrefix, packedBytesLength, longOrds, desc, count, singleValuePerDoc); } }
heapPointWriter = new HeapPointWriter(16, maxPointsSortInHeap, packedBytesLength, longOrds, singleValuePerDoc);
/** Pull a partition back into heap once the point count is low enough while recursing. */ private PathSlice switchToHeap(PathSlice source, List<Closeable> toCloseHeroically) throws IOException { int count = Math.toIntExact(source.count); // Not inside the try because we don't want to close it here: PointReader reader = source.writer.getSharedReader(source.start, source.count, toCloseHeroically); try (PointWriter writer = new HeapPointWriter(count, count, packedBytesLength, longOrds, singleValuePerDoc)) { for(int i=0;i<count;i++) { boolean hasNext = reader.next(); assert hasNext; writer.append(reader.packedValue(), reader.ord(), reader.docID()); } return new PathSlice(writer, 0, count); } catch (Throwable t) { throw verifyChecksum(t, source.writer); } }
heapPointWriter = new HeapPointWriter(16, maxPointsSortInHeap, packedBytesLength, longOrds, singleValuePerDoc);
/** Pull a partition back into heap once the point count is low enough while recursing. */ private PathSlice switchToHeap(PathSlice source, List<Closeable> toCloseHeroically) throws IOException { int count = Math.toIntExact(source.count); // Not inside the try because we don't want to close it here: PointReader reader = source.writer.getSharedReader(source.start, source.count, toCloseHeroically); try (PointWriter writer = new HeapPointWriter(count, count, packedBytesLength, longOrds, singleValuePerDoc)) { for(int i=0;i<count;i++) { boolean hasNext = reader.next(); assert hasNext; writer.append(reader.packedValue(), reader.ord(), reader.docID()); } return new PathSlice(writer, 0, count); } catch (Throwable t) { throw verifyChecksum(t, source.writer); } }
} else { sorted = new HeapPointWriter((int) pointCount, (int) pointCount, packedBytesLength, longOrds, singleValuePerDoc); sorted.copyFrom(heapPointWriter);
} else { sorted = new HeapPointWriter((int) pointCount, (int) pointCount, packedBytesLength, longOrds, singleValuePerDoc); sorted.copyFrom(heapPointWriter);