/** Read {@code count} integers and feed the result directly to {@link IntersectVisitor#visit(int)}. */ static void readInts(IndexInput in, int count, IntersectVisitor visitor) throws IOException { final int bpv = in.readByte(); switch (bpv) { case 0: readDeltaVInts(in, count, visitor); break; case 32: readInts32(in, count, visitor); break; case 24: readInts24(in, count, visitor); break; default: throw new IOException("Unsupported number of bits per value: " + bpv); } }
int readDocIDs(IndexInput in, long blockFP, int[] docIDs) throws IOException { in.seek(blockFP); // How many points are stored in this leaf cell: int count = in.readVInt(); if (version < BKDWriter.VERSION_COMPRESSED_DOC_IDS) { DocIdsWriter.readInts32(in, count, docIDs); } else { DocIdsWriter.readInts(in, count, docIDs); } return count; }
private void writeLeafBlockDocs(DataOutput out, int[] docIDs, int start, int count) throws IOException { assert count > 0: "maxPointsInLeafNode=" + maxPointsInLeafNode; out.writeVInt(count); DocIdsWriter.writeDocIds(docIDs, start, count, out); }
/** Read {@code count} integers into {@code docIDs}. */ static void readInts(IndexInput in, int count, int[] docIDs) throws IOException { final int bpv = in.readByte(); switch (bpv) { case 0: readDeltaVInts(in, count, docIDs); break; case 32: readInts32(in, count, docIDs); break; case 24: readInts24(in, count, docIDs); break; default: throw new IOException("Unsupported number of bits per value: " + bpv); } }
private void visitDocIDs(IndexInput in, long blockFP, IntersectVisitor visitor) throws IOException { // Leaf node in.seek(blockFP); // How many points are stored in this leaf cell: int count = in.readVInt(); // No need to call grow(), it has been called up-front if (version < BKDWriter.VERSION_COMPRESSED_DOC_IDS) { DocIdsWriter.readInts32(in, count, visitor); } else { DocIdsWriter.readInts(in, count, visitor); } }
private void writeLeafBlockDocs(DataOutput out, int[] docIDs, int start, int count) throws IOException { assert count > 0: "maxPointsInLeafNode=" + maxPointsInLeafNode; out.writeVInt(count); DocIdsWriter.writeDocIds(docIDs, start, count, out); }
/** Read {@code count} integers and feed the result directly to {@link IntersectVisitor#visit(int)}. */ static void readInts(IndexInput in, int count, IntersectVisitor visitor) throws IOException { final int bpv = in.readByte(); switch (bpv) { case 0: readDeltaVInts(in, count, visitor); break; case 32: readInts32(in, count, visitor); break; case 24: readInts24(in, count, visitor); break; default: throw new IOException("Unsupported number of bits per value: " + bpv); } }
private void visitDocIDs(IndexInput in, long blockFP, IntersectVisitor visitor) throws IOException { // Leaf node in.seek(blockFP); // How many points are stored in this leaf cell: int count = in.readVInt(); // No need to call grow(), it has been called up-front if (version < BKDWriter.VERSION_COMPRESSED_DOC_IDS) { DocIdsWriter.readInts32(in, count, visitor); } else { DocIdsWriter.readInts(in, count, visitor); } }
/** Read {@code count} integers into {@code docIDs}. */ static void readInts(IndexInput in, int count, int[] docIDs) throws IOException { final int bpv = in.readByte(); switch (bpv) { case 0: readDeltaVInts(in, count, docIDs); break; case 32: readInts32(in, count, docIDs); break; case 24: readInts24(in, count, docIDs); break; default: throw new IOException("Unsupported number of bits per value: " + bpv); } }
int readDocIDs(IndexInput in, long blockFP, int[] docIDs) throws IOException { in.seek(blockFP); // How many points are stored in this leaf cell: int count = in.readVInt(); if (version < BKDWriter.VERSION_COMPRESSED_DOC_IDS) { DocIdsWriter.readInts32(in, count, docIDs); } else { DocIdsWriter.readInts(in, count, docIDs); } return count; }