Example usage for org.apache.lucene.util.packed PackedInts copy

List of usage examples for org.apache.lucene.util.packed PackedInts copy

Introduction

In this page you can find the example usage for org.apache.lucene.util.packed PackedInts copy.

Prototype

static void copy(Reader src, int srcPos, Mutable dest, int destPos, int len, long[] buf) 

Source Link

Document

Same as #copy(Reader,int,Mutable,int,int,int) but using a pre-allocated buffer.

Usage

From source file:org.elasticsearch.index.fielddata.ordinals.SinglePackedOrdinals.java

License:Apache License

public SinglePackedOrdinals(OrdinalsBuilder builder, float acceptableOverheadRatio) {
    assert builder.getNumMultiValuesDocs() == 0;
    this.numOrds = builder.getNumOrds();
    this.maxOrd = builder.getNumOrds() + 1;
    // We don't reuse the builder as-is because it might have been built with a higher overhead ratio
    final PackedInts.Mutable reader = PackedInts.getMutable(builder.maxDoc(),
            PackedInts.bitsRequired(getNumOrds()), acceptableOverheadRatio);
    PackedInts.copy(builder.getFirstOrdinals(), 0, reader, 0, builder.maxDoc(), 8 * 1024);
    this.reader = reader;
}