long getMinLeafBlockFP() { if (packedIndex != null) { return new ByteArrayDataInput(packedIndex).readVLong(); } else { long minFP = Long.MAX_VALUE; for(long fp : leafBlockFPs) { minFP = Math.min(minFP, fp); } return minFP; } }
@Override public TermsEnum iterator() throws IOException { TVTermsEnum termsEnum = new TVTermsEnum(); termsEnum.reset(numTerms, flags, prefixLengths, suffixLengths, termFreqs, positionIndex, positions, startOffsets, lengths, payloadIndex, payloadBytes, new ByteArrayDataInput(termBytes.bytes, termBytes.offset, termBytes.length)); return termsEnum; }
public PackedIndexTree() { int treeDepth = getTreeDepth(); leafBlockFPStack = new long[treeDepth+1]; leftNodePositions = new int[treeDepth+1]; rightNodePositions = new int[treeDepth+1]; splitValuesStack = new byte[treeDepth+1][]; splitDims = new int[treeDepth+1]; negativeDeltas = new boolean[numIndexDims*(treeDepth+1)]; in = new ByteArrayDataInput(packedIndex); splitValuesStack[0] = new byte[packedIndexBytesLength]; readNodeData(false); scratch = new BytesRef(); scratch.length = bytesPerDim; }
if (length == 0) { documentInput = new ByteArrayDataInput(); } else if (merging) { documentInput = new ByteArrayDataInput(bytes.bytes, bytes.offset + offset, length); } else if (sliced) { fieldsStream.seek(startPointer); decompressor.decompress(fieldsStream, totalLength, offset, length, bytes); assert bytes.length == length; documentInput = new ByteArrayDataInput(bytes.bytes, bytes.offset, bytes.length);
throw new RuntimeException("seek state is broken"); } else if (isSeekFrame && !f.isFloor) { final ByteArrayDataInput reader = new ByteArrayDataInput(output.bytes, output.offset, output.length); final long codeOrig = reader.readVLong(); final long code = (f.fp << BlockTreeTermsReader.OUTPUT_FLAGS_NUM_BITS) | (f.hasTerms ? BlockTreeTermsReader.OUTPUT_FLAG_HAS_TERMS:0) | (f.isFloor ? BlockTreeTermsReader.OUTPUT_FLAG_IS_FLOOR:0);
rootBlockFP = (new ByteArrayDataInput(rootCode.bytes, rootCode.offset, rootCode.length)).readVLong() >>> BlockTreeTermsReader.OUTPUT_FLAGS_NUM_BITS;
public long getStoredChecksum() { return new ByteArrayDataInput(checksum).readLong(); }
ByteArrayDataInput in = new ByteArrayDataInput(updates);
final ByteArrayDataInput in = new ByteArrayDataInput(); final BytesRef scratch = new BytesRef();
private final ByteArrayDataInput readerA = new ByteArrayDataInput(); private final ByteArrayDataInput readerB = new ByteArrayDataInput(); private final BytesRef scratchA = new BytesRef(); private final BytesRef scratchB = new BytesRef();
static ParsedScrollId parseScrollId(String scrollId) { try { byte[] bytes = Base64.getUrlDecoder().decode(scrollId); ByteArrayDataInput in = new ByteArrayDataInput(bytes); String type = in.readString(); ScrollIdForNode[] context = new ScrollIdForNode[in.readVInt()]; for (int i = 0; i < context.length; ++i) { long id = in.readLong(); String target = in.readString(); String clusterAlias; final int index = target.indexOf(RemoteClusterAware.REMOTE_CLUSTER_INDEX_SEPARATOR); if (index == -1) { clusterAlias = null; } else { clusterAlias = target.substring(0, index); target = target.substring(index+1); } context[i] = new ScrollIdForNode(clusterAlias, target, id); } if (in.getPosition() != bytes.length) { throw new IllegalArgumentException("Not all bytes were read"); } return new ParsedScrollId(scrollId, type, context); } catch (Exception e) { throw new IllegalArgumentException("Cannot parse scroll id", e); } }
/** * Constructs a new Stemmer which will use the provided Dictionary to create its stems. * * @param dictionary Dictionary that will be used to create the stems */ public Stemmer(Dictionary dictionary) { this.dictionary = dictionary; this.affixReader = new ByteArrayDataInput(dictionary.affixData); for (int level = 0; level < 3; level++) { if (dictionary.prefixes != null) { prefixArcs[level] = new FST.Arc<>(); prefixReaders[level] = dictionary.prefixes.getBytesReader(); } if (dictionary.suffixes != null) { suffixArcs[level] = new FST.Arc<>(); suffixReaders[level] = dictionary.suffixes.getBytesReader(); } } formStep = dictionary.hasStemExceptions ? 2 : 1; }
BaseTermsEnum() throws IOException { this.state = postingsReader.newTermState(); this.bytesReader = new ByteArrayDataInput(); // NOTE: metadata will only be initialized in child class }
long getMinLeafBlockFP() { if (packedIndex != null) { return new ByteArrayDataInput(packedIndex).readVLong(); } else { long minFP = Long.MAX_VALUE; for(long fp : leafBlockFPs) { minFP = Math.min(minFP, fp); } return minFP; } }
static int parseDocID(final BytesRef output, int payloadSepIndex) { assert payloadSepIndex != -1 : "payload sep index can not be -1"; ByteArrayDataInput input = new ByteArrayDataInput(output.bytes, payloadSepIndex + output.offset + 1, output.length - (payloadSepIndex + output.offset)); return input.readVInt(); }
BytesRef surface = new BytesRef(); IntsRefBuilder scratchInts = new IntsRefBuilder(); ByteArrayDataInput input = new ByteArrayDataInput();
@Override public TermsEnum iterator() throws IOException { TVTermsEnum termsEnum = new TVTermsEnum(); termsEnum.reset(numTerms, flags, prefixLengths, suffixLengths, termFreqs, positionIndex, positions, startOffsets, lengths, payloadIndex, payloadBytes, new ByteArrayDataInput(termBytes.bytes, termBytes.offset, termBytes.length)); return termsEnum; }
@Override public TermsEnum iterator() throws IOException { TVTermsEnum termsEnum = new TVTermsEnum(); termsEnum.reset(numTerms, flags, prefixLengths, suffixLengths, termFreqs, positionIndex, positions, startOffsets, lengths, payloadIndex, payloadBytes, new ByteArrayDataInput(termBytes.bytes, termBytes.offset, termBytes.length)); return termsEnum; }
@Override public TermsEnum iterator() throws IOException { final TVTermsEnum termsEnum = new TVTermsEnum(); termsEnum.reset(numTerms, flags, prefixLengths, suffixLengths, termFreqs, positionIndex, positions, startOffsets, lengths, payloadIndex, payloadBytes, new ByteArrayDataInput(termBytes.bytes, termBytes.offset, termBytes.length)); return termsEnum; }
@Override public TermsEnum iterator() throws IOException { TVTermsEnum termsEnum = new TVTermsEnum(); termsEnum.reset(numTerms, flags, prefixLengths, suffixLengths, termFreqs, positionIndex, positions, startOffsets, lengths, payloadIndex, payloadBytes, new ByteArrayDataInput(termBytes.bytes, termBytes.offset, termBytes.length)); return termsEnum; }