Package org.apache.lucene.util.PagedBytes

Examples of org.apache.lucene.util.PagedBytes.PagedBytesDataInput


  private static int estimatePageBits(long estSize) {
    return Math.max(Math.min(64 - BitUtil.nlz(estSize), MAX_PAGE_BITS), 4);
  }

  public void seekEnum(SegmentTermEnum enumerator, int indexOffset) throws IOException {
    PagedBytesDataInput input = (PagedBytesDataInput) dataInput.clone();
   
    input.setPosition(indexToDataOffset.get(indexOffset));

    // read the term
    int fieldId = input.readVInt();
    Term field = fields[fieldId];
    Term term = field.createTerm(input.readString());

    // read the terminfo
    TermInfo termInfo = new TermInfo();
    termInfo.docFreq = input.readVInt();
    if (termInfo.docFreq >= skipInterval) {
      termInfo.skipOffset = input.readVInt();
    } else {
      termInfo.skipOffset = 0;
    }
    termInfo.freqPointer = input.readVLong();
    termInfo.proxPointer = input.readVLong();

    long pointer = input.readVLong();

    // perform the seek
    enumerator.seek(pointer, ((long) indexOffset * totalIndexInterval) - 1, term, termInfo);
  }
View Full Code Here


   * @throws IOException
   */
  public int getIndexOffset(Term term, BytesRef termBytesRef) throws IOException {
    int lo = 0;
    int hi = indexSize - 1;
    PagedBytesDataInput input = (PagedBytesDataInput) dataInput.clone();
    BytesRef scratch = new BytesRef();
    while (hi >= lo) {
      int mid = (lo + hi) >>> 1;
      int delta = compareTo(term, termBytesRef, mid, input, scratch);
      if (delta < 0)
View Full Code Here

   *          the position to read the term from the index.
   * @return the term.
   * @throws IOException
   */
  Term getTerm(int termIndex) throws IOException {
    PagedBytesDataInput input = (PagedBytesDataInput) dataInput.clone();
    input.setPosition(indexToDataOffset.get(termIndex));

    // read the term
    int fieldId = input.readVInt();
    Term field = fields[fieldId];
    return field.createTerm(input.readString());
  }
View Full Code Here

  private static int estimatePageBits(long estSize) {
    return Math.max(Math.min(64 - Long.numberOfLeadingZeros(estSize), MAX_PAGE_BITS), 4);
  }

  void seekEnum(SegmentTermEnum enumerator, int indexOffset) throws IOException {
    PagedBytesDataInput input = dataInput.clone();
   
    input.setPosition(indexToDataOffset.get(indexOffset));

    // read the term
    int fieldId = input.readVInt();
    Term field = fields[fieldId];
    Term term = new Term(field.field(), input.readString());

    // read the terminfo
    TermInfo termInfo = new TermInfo();
    termInfo.docFreq = input.readVInt();
    if (termInfo.docFreq >= skipInterval) {
      termInfo.skipOffset = input.readVInt();
    } else {
      termInfo.skipOffset = 0;
    }
    termInfo.freqPointer = input.readVLong();
    termInfo.proxPointer = input.readVLong();

    long pointer = input.readVLong();

    // perform the seek
    enumerator.seek(pointer, ((long) indexOffset * totalIndexInterval) - 1, term, termInfo);
  }
View Full Code Here

   * @throws IOException If there is a low-level I/O error.
   */
  int getIndexOffset(Term term) throws IOException {
    int lo = 0;
    int hi = indexSize - 1;
    PagedBytesDataInput input = dataInput.clone();
    BytesRef scratch = new BytesRef();
    while (hi >= lo) {
      int mid = (lo + hi) >>> 1;
      int delta = compareTo(term, mid, input, scratch);
      if (delta < 0)
View Full Code Here

   *          the position to read the term from the index.
   * @return the term.
   * @throws IOException If there is a low-level I/O error.
   */
  Term getTerm(int termIndex) throws IOException {
    PagedBytesDataInput input = dataInput.clone();
    input.setPosition(indexToDataOffset.get(termIndex));

    // read the term
    int fieldId = input.readVInt();
    Term field = fields[fieldId];
    return new Term(field.field(), input.readString());
  }
View Full Code Here

  private static int estimatePageBits(long estSize) {
    return Math.max(Math.min(64 - Long.numberOfLeadingZeros(estSize), MAX_PAGE_BITS), 4);
  }

  void seekEnum(SegmentTermEnum enumerator, int indexOffset) throws IOException {
    PagedBytesDataInput input = dataInput.clone();
   
    input.setPosition(indexToDataOffset.get(indexOffset));

    // read the term
    int fieldId = input.readVInt();
    Term field = fields[fieldId];
    Term term = new Term(field.field(), input.readString());

    // read the terminfo
    TermInfo termInfo = new TermInfo();
    termInfo.docFreq = input.readVInt();
    if (termInfo.docFreq >= skipInterval) {
      termInfo.skipOffset = input.readVInt();
    } else {
      termInfo.skipOffset = 0;
    }
    termInfo.freqPointer = input.readVLong();
    termInfo.proxPointer = input.readVLong();

    long pointer = input.readVLong();

    // perform the seek
    enumerator.seek(pointer, ((long) indexOffset * totalIndexInterval) - 1, term, termInfo);
  }
View Full Code Here

   * @throws IOException If there is a low-level I/O error.
   */
  int getIndexOffset(Term term) throws IOException {
    int lo = 0;
    int hi = indexSize - 1;
    PagedBytesDataInput input = dataInput.clone();
    BytesRef scratch = new BytesRef();
    while (hi >= lo) {
      int mid = (lo + hi) >>> 1;
      int delta = compareTo(term, mid, input, scratch);
      if (delta < 0)
View Full Code Here

   *          the position to read the term from the index.
   * @return the term.
   * @throws IOException If there is a low-level I/O error.
   */
  Term getTerm(int termIndex) throws IOException {
    PagedBytesDataInput input = dataInput.clone();
    input.setPosition(indexToDataOffset.get(termIndex));

    // read the term
    int fieldId = input.readVInt();
    Term field = fields[fieldId];
    return new Term(field.field(), input.readString());
  }
View Full Code Here

   *          the position to read the term from the index.
   * @return the term.
   * @throws IOException If there is a low-level I/O error.
   */
  Term getTerm(int termIndex) throws IOException {
    PagedBytesDataInput input = dataInput.clone();
    input.setPosition(indexToDataOffset.get(termIndex));

    // read the term
    int fieldId = input.readVInt();
    Term field = fields[fieldId];
    return new Term(field.field(), input.readString());
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.util.PagedBytes.PagedBytesDataInput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.