Examples of PagedGrowableWriter


Examples of org.apache.lucene.util.packed.PagedGrowableWriter

 
  public NumericDocValuesFieldUpdates(String field, int maxDoc) {
    super(field, FieldInfo.DocValuesType.NUMERIC);
    bitsPerValue = PackedInts.bitsRequired(maxDoc - 1);
    docs = new PagedMutable(1, PAGE_SIZE, bitsPerValue, PackedInts.COMPACT);
    values = new PagedGrowableWriter(1, PAGE_SIZE, 1, PackedInts.FAST);
    size = 0;
  }
View Full Code Here

Examples of org.apache.lucene.util.packed.PagedGrowableWriter

  }
 
  @Override
  public Iterator iterator() {
    final PagedMutable docs = this.docs;
    final PagedGrowableWriter values = this.values;
    new InPlaceMergeSorter() {
      @Override
      protected void swap(int i, int j) {
        long tmpDoc = docs.get(j);
        docs.set(j, docs.get(i));
        docs.set(i, tmpDoc);
       
        long tmpVal = values.get(j);
        values.set(j, values.get(i));
        values.set(i, tmpVal);
      }
     
      @Override
      protected int compare(int i, int j) {
        int x = (int) docs.get(i);
View Full Code Here

Examples of org.apache.lucene.util.packed.PagedGrowableWriter

  private final FST<T> fst;
  private final FST.Arc<T> scratchArc = new FST.Arc<>();
  private final FST.BytesReader in;

  public NodeHash(FST<T> fst, FST.BytesReader in) {
    table = new PagedGrowableWriter(16, 1<<30, 8, PackedInts.COMPACT);
    mask = 15;
    this.fst = fst;
    this.in = in;
  }
View Full Code Here

Examples of org.apache.lucene.util.packed.PagedGrowableWriter

      pos = (pos + (++c)) & mask;
    }
  }

  private void rehash() throws IOException {
    final PagedGrowableWriter oldTable = table;

    table = new PagedGrowableWriter(2*oldTable.size(), 1<<30, PackedInts.bitsRequired(count), PackedInts.COMPACT);
    mask = table.size()-1;
    for(long idx=0;idx<oldTable.size();idx++) {
      final long address = oldTable.get(idx);
      if (address != 0) {
        addNew(address);
      }
    }
  }
View Full Code Here

Examples of org.apache.lucene.util.packed.PagedGrowableWriter

 
  public BinaryDocValuesFieldUpdates(String field, int maxDoc) {
    super(field, Type.BINARY);
    docsWithField = new FixedBitSet(64);
    docs = new PagedMutable(1, 1024, PackedInts.bitsRequired(maxDoc - 1), PackedInts.COMPACT);
    offsets = new PagedGrowableWriter(1, 1024, 1, PackedInts.FAST);
    lengths = new PagedGrowableWriter(1, 1024, 1, PackedInts.FAST);
    values = new BytesRef(16); // start small
    size = 0;
  }
View Full Code Here

Examples of org.apache.lucene.util.packed.PagedGrowableWriter

  }

  @Override
  public Iterator iterator() {
    final PagedMutable docs = this.docs;
    final PagedGrowableWriter offsets = this.offsets;
    final PagedGrowableWriter lengths = this.lengths;
    final BytesRef values = this.values;
    final FixedBitSet docsWithField = this.docsWithField;
    new InPlaceMergeSorter() {
      @Override
      protected void swap(int i, int j) {
        long tmpDoc = docs.get(j);
        docs.set(j, docs.get(i));
        docs.set(i, tmpDoc);
       
        long tmpOffset = offsets.get(j);
        offsets.set(j, offsets.get(i));
        offsets.set(i, tmpOffset);

        long tmpLength = lengths.get(j);
        lengths.set(j, lengths.get(i));
        lengths.set(i, tmpLength);
       
        boolean tmpBool = docsWithField.get(j);
        if (docsWithField.get(i)) {
          docsWithField.set(j);
        } else {
View Full Code Here

Examples of org.apache.lucene.util.packed.PagedGrowableWriter

 
  public NumericDocValuesFieldUpdates(String field, int maxDoc) {
    super(field, Type.NUMERIC);
    docsWithField = new FixedBitSet(64);
    docs = new PagedMutable(1, 1024, PackedInts.bitsRequired(maxDoc - 1), PackedInts.COMPACT);
    values = new PagedGrowableWriter(1, 1024, 1, PackedInts.FAST);
    size = 0;
  }
View Full Code Here

Examples of org.apache.lucene.util.packed.PagedGrowableWriter

  }
 
  @Override
  public Iterator iterator() {
    final PagedMutable docs = this.docs;
    final PagedGrowableWriter values = this.values;
    final FixedBitSet docsWithField = this.docsWithField;
    new InPlaceMergeSorter() {
      @Override
      protected void swap(int i, int j) {
        long tmpDoc = docs.get(j);
        docs.set(j, docs.get(i));
        docs.set(i, tmpDoc);
       
        long tmpVal = values.get(j);
        values.set(j, values.get(i));
        values.set(i, tmpVal);
       
        boolean tmpBool = docsWithField.get(j);
        if (docsWithField.get(i)) {
          docsWithField.set(j);
        } else {
View Full Code Here

Examples of org.apache.lucene.util.packed.PagedGrowableWriter

        private final float acceptableOverheadRatio;

        OrdinalsStore(int maxDoc, int startBitsPerValue, float acceptableOverheadRatio) {
            this.startBitsPerValue = startBitsPerValue;
            this.acceptableOverheadRatio = acceptableOverheadRatio;
            positions = new PagedGrowableWriter(maxDoc, PAGE_SIZE, startBitsPerValue, acceptableOverheadRatio);
            firstOrdinals = new GrowableWriter(startBitsPerValue, maxDoc, acceptableOverheadRatio);
            // over allocate in order to never worry about the array sizes, 24 entries would allow to store several millions of ordinals per doc...
            ordinals = new PagedGrowableWriter[24];
            nextLevelSlices = new PagedGrowableWriter[24];
            sizes = new int[24];
View Full Code Here

Examples of org.apache.lucene.util.packed.PagedGrowableWriter

         */
        private long newSlice(int level) {
            final long newSlice = sizes[level]++;
            // Lazily allocate ordinals
            if (ordinals[level] == null) {
                ordinals[level] = new PagedGrowableWriter(8L * numSlots(level), PAGE_SIZE, startBitsPerValue, acceptableOverheadRatio);
            } else {
                ordinals[level] = ordinals[level].grow(sizes[level] * numSlots(level));
                if (nextLevelSlices[level] != null) {
                    nextLevelSlices[level] = nextLevelSlices[level].grow(sizes[level]);
                }
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.