Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public BinaryDocValues getBinary(FieldInfo field) throws IOException {
return DocValues.emptyBinary();
}

final IndexInput bytesSlice = data.slice("fixed-binary", entry.dataOffset, entry.dataLength);
final RandomAccessInput bytesSlice = data.randomAccessSlice(entry.dataOffset, entry.dataLength);

if (entry.docsWithFieldOffset == -1) {
// dense
Expand All @@ -144,8 +144,7 @@ public BinaryDocValues getBinary(FieldInfo field) throws IOException {

@Override
public BytesRef binaryValue() throws IOException {
bytesSlice.seek((long) doc * length);
bytesSlice.readBytes(bytes.bytes, 0, length);
bytesSlice.readBytes((long) doc * length, bytes.bytes, 0, length);
return bytes;
}
};
Expand All @@ -160,8 +159,7 @@ public BytesRef binaryValue() throws IOException {
public BytesRef binaryValue() throws IOException {
long startOffset = addresses.get(doc);
bytes.length = (int) (addresses.get(doc + 1L) - startOffset);
bytesSlice.seek(startOffset);
bytesSlice.readBytes(bytes.bytes, 0, bytes.length);
bytesSlice.readBytes(startOffset, bytes.bytes, 0, bytes.length);
return bytes;
}
};
Expand All @@ -184,8 +182,7 @@ public BytesRef binaryValue() throws IOException {

@Override
public BytesRef binaryValue() throws IOException {
bytesSlice.seek((long) disi.index() * length);
bytesSlice.readBytes(bytes.bytes, 0, length);
bytesSlice.readBytes((long) disi.index() * length, bytes.bytes, 0, length);
return bytes;
}
};
Expand All @@ -201,8 +198,7 @@ public BytesRef binaryValue() throws IOException {
final int index = disi.index();
long startOffset = addresses.get(index);
bytes.length = (int) (addresses.get(index + 1L) - startOffset);
bytesSlice.seek(startOffset);
bytesSlice.readBytes(bytes.bytes, 0, bytes.length);
bytesSlice.readBytes(startOffset, bytes.bytes, 0, bytes.length);
return bytes;
}
};
Expand Down Expand Up @@ -407,7 +403,7 @@ private static class TermsDict extends BaseTermsEnum {
final IndexInput bytes;
final long blockMask;
final LongValues indexAddresses;
final IndexInput indexBytes;
final RandomAccessInput indexBytes;
final BytesRef term;
long ord = -1;

Expand All @@ -427,7 +423,7 @@ private static class TermsDict extends BaseTermsEnum {
entry.termsIndexAddressesLength
);
indexAddresses = DirectMonotonicReader.getInstance(entry.termsIndexAddressesMeta, indexAddressesSlice);
indexBytes = data.slice("terms-index", entry.termsIndexOffset, entry.termsIndexLength);
indexBytes = data.randomAccessSlice(entry.termsIndexOffset, entry.termsIndexLength);
term = new BytesRef(entry.maxTermLength);

// add the max term length for the dictionary
Expand Down Expand Up @@ -485,8 +481,7 @@ private BytesRef getTermFromIndex(long index) throws IOException {
assert index >= 0 && index <= (entry.termsDictSize - 1) >>> entry.termsDictIndexShift;
final long start = indexAddresses.get(index);
term.length = (int) (indexAddresses.get(index + 1) - start);
indexBytes.seek(start);
indexBytes.readBytes(term.bytes, 0, term.length);
indexBytes.readBytes(start, term.bytes, 0, term.length);
return term;
}

Expand Down