Package org.apache.lucene.facet.encoding

Examples of org.apache.lucene.facet.encoding.IntDecoder.decode()


      for (int docID = 0; docID < maxDoc; docID++) {
        offsets[docID] = totOrds;
        dv.get(docID, buf);
        if (buf.length > 0) {
          // this document has facets
          decoder.decode(buf, values);
          if (totOrds + values.length >= ords.length) {
            ords = ArrayUtil.grow(ords, totOrds + values.length + 1);
          }
          for (int i = 0; i < values.length; i++) {
            ords[totOrds++] = values.ints[i];
View Full Code Here


    int encodedSize = bytes.length;
    IntDecoder decoder = encoder.createMatchingDecoder();
   
    // -- Looping 100 times as a warm up --------------------------
    for (int i = 100; i != 0; --i) {
      decoder.decode(bytes, decoded);
    }
    // -----------------------------------------------------------

    long decodeTime = 0;
    for (int i = loopFactor; i > 0; --i) {
View Full Code Here

    // -----------------------------------------------------------

    long decodeTime = 0;
    for (int i = loopFactor; i > 0; --i) {
      long start = System.currentTimeMillis();
      decoder.decode(bytes, decoded);
      decodeTime += System.currentTimeMillis() - start;
    }
   
    if (decoded.length != values.length) {
      throw new RuntimeException("wrong num values. expected=" + values.length + " actual=" + decoded.length +
View Full Code Here

    values.ints[values.length++] = -1;
    enc.encode(values, bytes);
   
    IntDecoder dec = enc.createMatchingDecoder();
    values.length = 0;
    dec.decode(bytes, values);
    assertEquals(1, values.length);
    assertEquals(-1, values.ints[0]);
  }
 
  @Test
View Full Code Here

      for (int docID = 0; docID < maxDoc; docID++) {
        offsets[docID] = totOrds;
        dv.get(docID, buf);
        if (buf.length > 0) {
          // this document has facets
          decoder.decode(buf, values);
          if (totOrds + values.length >= ords.length) {
            ords = ArrayUtil.grow(ords, totOrds + values.length + 1);
          }
          for (int i = 0; i < values.length; i++) {
            ords[totOrds++] = values.ints[i];
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.