Examples of SlicedBytes


Examples of dovetaildb.bytes.SlicedBytes

    }
    public int getLength() {
      return prefix.getLength() + compressed.getLength() - compIndex;
    }
    public String toString() {
      return "Uncompressed(["+prefix.getAsString()+"]"+new SlicedBytes(compressed, compIndex, compressed.getLength() - compIndex)+")";
    }
View Full Code Here

Examples of dovetaildb.bytes.SlicedBytes

          if (edit.isDelete) {
            if (cmp != 0) throw new RuntimeException("Unexpected");
            cur = cur.next();
          } else {
            MemDocRec newRec = new MemDocRec(prefix,
                new SlicedBytes(edit.term,prefixLen),
                edit.docId, null, null, 0);
            result.append(newRec);
          }
          editIdx++;
        } else { // means it's a segment push
          BoundedDocRec subSegment = cur.down();
          int startIdx = editIdx;
          for(;editIdx<editLength; editIdx++) {
            edit = edits.get(editIdx);
            cmp = cur.compareTo(edit);
            if (cmp <= 0) break;
          }
          applyDocEdits(edits.subList(startIdx, editIdx), subSegment, result);
          if (edit.isDelete && cmp == 0) {
            // do not add tail
            editIdx++;
          } else {
            MemDocRec tail = new MemDocRec(cur.dr);
            tail.down = null;
            tail.downCt = 0;
            result.append(tail);
          }
          cur = cur.next();
        }
        edit = (editIdx < edits.size()) ? edits.get(editIdx) : null;
      }
    }
    while (cur != null) {
      result.append(new MemDocRec(cur.dr));
      cur = cur.next();
    }
    while (editIdx < edits.size()) {
      edit = edits.get(editIdx++);
      MemDocRec newRec = new MemDocRec(prefix,
          new SlicedBytes(edit.term,prefixLen),
          edit.docId, null, null, 0);
      result.append(newRec);
    }
  }
View Full Code Here

Examples of dovetaildb.bytes.SlicedBytes

          if (edit.isDelete) {
            if (cmp != 0) throw new RuntimeException("Unexpected");
            cur = cur.next();
          } else {
            MemDocRec newRec = new MemDocRec(prefix,
                new SlicedBytes(edit.term,prefixLen),
                edit.docId, null, null, 0);
            result.append(newRec);
          }
          editIdx++;
        } else { // means it's a segment push
          BoundedDocRec subSegment = cur.down();
          int startIdx = editIdx;
          for(;editIdx<editLength; editIdx++) {
            edit = edits.get(editIdx);
            cmp = cur.compareTo(edit);
            if (cmp <= 0) break;
          }
          applyDocEdits(edits.subList(startIdx, editIdx), subSegment, result);
          if (edit.isDelete && cmp == 0) {
            // do not add tail
            editIdx++;
          } else {
            MemDocRec tail = new MemDocRec(cur.dr);
            tail.down = null;
            tail.downCt = 0;
            result.append(tail);
          }
          cur = cur.next();
        }
        edit = (editIdx < edits.size()) ? edits.get(editIdx) : null;
      }
    }
    while (cur != null) {
      result.append(new MemDocRec(cur.dr));
      cur = cur.next();
    }
    while (editIdx < edits.size()) {
      edit = edits.get(editIdx++);
      MemDocRec newRec = new MemDocRec(prefix,
          new SlicedBytes(edit.term,prefixLen),
          edit.docId, null, null, 0);
      result.append(newRec);
    }
  }
View Full Code Here

Examples of dovetaildb.bytes.SlicedBytes

    for(int i=0; i<len; i++) {
      for(TokenRec rec : table.tokenRecs) {
        if (rec.token >= prefix.get(i)) {
          if (rec.token > prefix.get(i)) return null;
          if (rec.tokenTable==null) {
            Bytes pre = new SlicedBytes(prefix, 0, i+1);
            pre = new ArrayBytes(pre.getBytes()); // optimize
            RangeQueryNode ret = new BlueSteelPostingListQuery(pre, rec.segmentPush);
            return FilteredRangeQueryNode.make(ret, prefix, term1, term2, isExclusive1, isExclusive2);
          }
          table = rec.tokenTable;
          bos.write(rec.token);
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.