org.apache.lucene.util.BytesRefHash.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(10.7k)|赞(0)|评价(0)|浏览(90)

本文整理了Java中org.apache.lucene.util.BytesRefHash.<init>()方法的一些代码示例,展示了BytesRefHash.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BytesRefHash.<init>()方法的具体详情如下:
包路径:org.apache.lucene.util.BytesRefHash
类名称:BytesRefHash
方法名:<init>

BytesRefHash.<init>介绍

[英]Creates a new BytesRefHash with a ByteBlockPool using a DirectAllocator.
[中]使用DirectAllocator使用ByteBlockPool创建新的ByteRefHash。

代码示例

代码示例来源:origin: org.apache.lucene/lucene-core

/** streamCount: how many streams this field stores per term.
 * E.g. doc(+freq) is 1 stream, prox+offset is a second. */
public TermsHashPerField(int streamCount, FieldInvertState fieldState, TermsHash termsHash, TermsHashPerField nextPerField, FieldInfo fieldInfo) {
 intPool = termsHash.intPool;
 bytePool = termsHash.bytePool;
 termBytePool = termsHash.termBytePool;
 docState = termsHash.docState;
 this.termsHash = termsHash;
 bytesUsed = termsHash.bytesUsed;
 this.fieldState = fieldState;
 this.streamCount = streamCount;
 numPostingInt = 2*streamCount;
 this.fieldInfo = fieldInfo;
 this.nextPerField = nextPerField;
 PostingsBytesStartArray byteStarts = new PostingsBytesStartArray(this, bytesUsed);
 bytesHash = new BytesRefHash(termBytePool, HASH_INIT_SIZE, byteStarts);
}

代码示例来源:origin: org.apache.lucene/lucene-core

public SortedDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed) {
 this.fieldInfo = fieldInfo;
 this.iwBytesUsed = iwBytesUsed;
 hash = new BytesRefHash(
   new ByteBlockPool(
     new ByteBlockPool.DirectTrackingAllocator(iwBytesUsed)),
     BytesRefHash.DEFAULT_CAPACITY,
     new DirectBytesStartArray(BytesRefHash.DEFAULT_CAPACITY, iwBytesUsed));
 pending = PackedLongValues.deltaPackedBuilder(PackedInts.COMPACT);
 docsWithField = new DocsWithFieldSet();
 bytesUsed = pending.ramBytesUsed() + docsWithField.ramBytesUsed();
 iwBytesUsed.addAndGet(bytesUsed);
}

代码示例来源:origin: org.apache.lucene/lucene-core

public SortedSetDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed) {
 this.fieldInfo = fieldInfo;
 this.iwBytesUsed = iwBytesUsed;
 hash = new BytesRefHash(
   new ByteBlockPool(
     new ByteBlockPool.DirectTrackingAllocator(iwBytesUsed)),
     BytesRefHash.DEFAULT_CAPACITY,
     new DirectBytesStartArray(BytesRefHash.DEFAULT_CAPACITY, iwBytesUsed));
 pending = PackedLongValues.packedBuilder(PackedInts.COMPACT);
 pendingCounts = PackedLongValues.deltaPackedBuilder(PackedInts.COMPACT);
 docsWithField = new DocsWithFieldSet();
 bytesUsed = pending.ramBytesUsed() + pendingCounts.ramBytesUsed();
 iwBytesUsed.addAndGet(bytesUsed);
}

代码示例来源:origin: pearson-enabling-technologies/elasticsearch-approx-plugin

InternalStringTermListFacet(final String facetName) {
  super(facetName);
  _bytesRefs = new BytesRefHash();
}

代码示例来源:origin: pearson-enabling-technologies/elasticsearch-approx-plugin

InternalStringTermListFacet() {
  _bytesRefs = new BytesRefHash();
}

代码示例来源:origin: flaxsearch/luwak

/**
   * Get a BytesRefHash containing all terms for a particular field
   * @param field the field
   * @return a {@link BytesRefHash} containing all terms for the specified field
   */
  public BytesRefHash getTerms(String field) {
    BytesRefHash existing = termsHash.get(field);
    if (existing != null)
      return existing;

    return new BytesRefHash();
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/** streamCount: how many streams this field stores per term.
 * E.g. doc(+freq) is 1 stream, prox+offset is a second. */
public TermsHashPerField(int streamCount, FieldInvertState fieldState, TermsHash termsHash, TermsHashPerField nextPerField, FieldInfo fieldInfo) {
 intPool = termsHash.intPool;
 bytePool = termsHash.bytePool;
 termBytePool = termsHash.termBytePool;
 docState = termsHash.docState;
 this.termsHash = termsHash;
 bytesUsed = termsHash.bytesUsed;
 this.fieldState = fieldState;
 this.streamCount = streamCount;
 numPostingInt = 2*streamCount;
 this.fieldInfo = fieldInfo;
 this.nextPerField = nextPerField;
 PostingsBytesStartArray byteStarts = new PostingsBytesStartArray(this, bytesUsed);
 bytesHash = new BytesRefHash(termBytePool, HASH_INIT_SIZE, byteStarts);
}

代码示例来源:origin: harbby/presto-connectors

/** streamCount: how many streams this field stores per term.
 * E.g. doc(+freq) is 1 stream, prox+offset is a second. */
public TermsHashPerField(int streamCount, FieldInvertState fieldState, TermsHash termsHash, TermsHashPerField nextPerField, FieldInfo fieldInfo) {
 intPool = termsHash.intPool;
 bytePool = termsHash.bytePool;
 termBytePool = termsHash.termBytePool;
 docState = termsHash.docState;
 this.termsHash = termsHash;
 bytesUsed = termsHash.bytesUsed;
 this.fieldState = fieldState;
 this.streamCount = streamCount;
 numPostingInt = 2*streamCount;
 this.fieldInfo = fieldInfo;
 this.nextPerField = nextPerField;
 PostingsBytesStartArray byteStarts = new PostingsBytesStartArray(this, bytesUsed);
 bytesHash = new BytesRefHash(termBytePool, HASH_INIT_SIZE, byteStarts);
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

/** streamCount: how many streams this field stores per term.
 * E.g. doc(+freq) is 1 stream, prox+offset is a second. */
public TermsHashPerField(int streamCount, FieldInvertState fieldState, TermsHash termsHash, TermsHashPerField nextPerField, FieldInfo fieldInfo) {
 intPool = termsHash.intPool;
 bytePool = termsHash.bytePool;
 termBytePool = termsHash.termBytePool;
 docState = termsHash.docState;
 this.termsHash = termsHash;
 bytesUsed = termsHash.bytesUsed;
 this.fieldState = fieldState;
 this.streamCount = streamCount;
 numPostingInt = 2*streamCount;
 this.fieldInfo = fieldInfo;
 this.nextPerField = nextPerField;
 PostingsBytesStartArray byteStarts = new PostingsBytesStartArray(this, bytesUsed);
 bytesHash = new BytesRefHash(termBytePool, HASH_INIT_SIZE, byteStarts);
}

代码示例来源:origin: pearson-enabling-technologies/elasticsearch-approx-plugin

/**
 * Create a new count-then-estimate cardinality object with the tipping point provided.
 * After this has been reached, the provided builder will be used to create an estimator.
 * 
 * @param tippingPoint Cardinality at which exact counting gives way to estimation
 * @param builder      Factory for instantiating estimator after the tipping point is reached
 */
public CountThenEstimateBytes(final int tippingPoint, final IBuilder<ICardinality> builder) {
  _tippingPoint = tippingPoint;
  _builder = builder;
  if(tippingPoint == 0) {
    _counter = null;
    _estimator = builder.build();
    _tipped = true;
  } else {
    _counter = new BytesRefHash();
  }
}

代码示例来源:origin: org.apache.lucene/lucene-memory

private Info(FieldInfo fieldInfo, ByteBlockPool byteBlockPool) {
 this.fieldInfo = fieldInfo;
 this.sliceArray = new SliceByteStartArray(BytesRefHash.DEFAULT_CAPACITY);
 this.terms = new BytesRefHash(byteBlockPool, BytesRefHash.DEFAULT_CAPACITY, sliceArray);;
 this.binaryProducer = new BinaryDocValuesProducer();
 this.numericProducer = new NumericDocValuesProducer();
}

代码示例来源:origin: sirensolutions/siren-join

public BytesRefTermsSet(final CircuitBreaker breaker) {
 super(breaker);
 this.bytesUsed = Counter.newCounter();
 this.pool = new ByteBlockPool(new ByteBlockPool.DirectTrackingAllocator(bytesUsed));
 this.set = new BytesRefHash(pool);
}

代码示例来源:origin: sirensolutions/siren-join

@Override
public void readFrom(StreamInput in) throws IOException {
 this.setIsPruned(in.readBoolean());
 int size = in.readInt();
 bytesUsed = Counter.newCounter();
 pool = new ByteBlockPool(new ByteBlockPool.DirectTrackingAllocator(bytesUsed));
 set = new BytesRefHash(pool);
 for (long i = 0; i < size; i++) {
  set.add(in.readBytesRef());
 }
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

public SortedDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed) {
 this.fieldInfo = fieldInfo;
 this.iwBytesUsed = iwBytesUsed;
 hash = new BytesRefHash(
   new ByteBlockPool(
     new ByteBlockPool.DirectTrackingAllocator(iwBytesUsed)),
     BytesRefHash.DEFAULT_CAPACITY,
     new DirectBytesStartArray(BytesRefHash.DEFAULT_CAPACITY, iwBytesUsed));
 pending = PackedLongValues.deltaPackedBuilder(PackedInts.COMPACT);
 bytesUsed = pending.ramBytesUsed();
 iwBytesUsed.addAndGet(bytesUsed);
}

代码示例来源:origin: sirensolutions/siren-join

private void readFromBytes(BytesRef bytes) {
 // Read pruned flag
 this.setIsPruned(bytes.bytes[bytes.offset++] == 1 ? true : false);
 // Read size fo the set
 int size = Bytes.readInt(bytes);
 // Read terms
 bytesUsed = Counter.newCounter();
 pool = new ByteBlockPool(new ByteBlockPool.DirectTrackingAllocator(bytesUsed));
 set = new BytesRefHash(pool);
 BytesRef reusable = new BytesRef();
 for (int i = 0; i < size; i++) {
  Bytes.readBytesRef(bytes, reusable);
  set.add(reusable);
 }
}

代码示例来源:origin: harbby/presto-connectors

public SortedDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed) {
 this.fieldInfo = fieldInfo;
 this.iwBytesUsed = iwBytesUsed;
 hash = new BytesRefHash(
   new ByteBlockPool(
     new ByteBlockPool.DirectTrackingAllocator(iwBytesUsed)),
     BytesRefHash.DEFAULT_CAPACITY,
     new DirectBytesStartArray(BytesRefHash.DEFAULT_CAPACITY, iwBytesUsed));
 pending = PackedLongValues.deltaPackedBuilder(PackedInts.COMPACT);
 bytesUsed = pending.ramBytesUsed();
 iwBytesUsed.addAndGet(bytesUsed);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

public SortedDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed) {
 this.fieldInfo = fieldInfo;
 this.iwBytesUsed = iwBytesUsed;
 hash = new BytesRefHash(
   new ByteBlockPool(
     new ByteBlockPool.DirectTrackingAllocator(iwBytesUsed)),
     BytesRefHash.DEFAULT_CAPACITY,
     new DirectBytesStartArray(BytesRefHash.DEFAULT_CAPACITY, iwBytesUsed));
 pending = PackedLongValues.deltaPackedBuilder(PackedInts.COMPACT);
 docsWithField = new DocsWithFieldSet();
 bytesUsed = pending.ramBytesUsed() + docsWithField.ramBytesUsed();
 iwBytesUsed.addAndGet(bytesUsed);
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

public SortedSetDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed) {
 this.fieldInfo = fieldInfo;
 this.iwBytesUsed = iwBytesUsed;
 hash = new BytesRefHash(
   new ByteBlockPool(
     new ByteBlockPool.DirectTrackingAllocator(iwBytesUsed)),
     BytesRefHash.DEFAULT_CAPACITY,
     new DirectBytesStartArray(BytesRefHash.DEFAULT_CAPACITY, iwBytesUsed));
 pending = PackedLongValues.packedBuilder(PackedInts.COMPACT);
 pendingCounts = PackedLongValues.deltaPackedBuilder(PackedInts.COMPACT);
 bytesUsed = pending.ramBytesUsed() + pendingCounts.ramBytesUsed();
 iwBytesUsed.addAndGet(bytesUsed);
}

代码示例来源:origin: harbby/presto-connectors

public SortedSetDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed) {
 this.fieldInfo = fieldInfo;
 this.iwBytesUsed = iwBytesUsed;
 hash = new BytesRefHash(
   new ByteBlockPool(
     new ByteBlockPool.DirectTrackingAllocator(iwBytesUsed)),
     BytesRefHash.DEFAULT_CAPACITY,
     new DirectBytesStartArray(BytesRefHash.DEFAULT_CAPACITY, iwBytesUsed));
 pending = PackedLongValues.packedBuilder(PackedInts.COMPACT);
 pendingCounts = PackedLongValues.deltaPackedBuilder(PackedInts.COMPACT);
 bytesUsed = pending.ramBytesUsed() + pendingCounts.ramBytesUsed();
 iwBytesUsed.addAndGet(bytesUsed);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

public SortedSetDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed) {
 this.fieldInfo = fieldInfo;
 this.iwBytesUsed = iwBytesUsed;
 hash = new BytesRefHash(
   new ByteBlockPool(
     new ByteBlockPool.DirectTrackingAllocator(iwBytesUsed)),
     BytesRefHash.DEFAULT_CAPACITY,
     new DirectBytesStartArray(BytesRefHash.DEFAULT_CAPACITY, iwBytesUsed));
 pending = PackedLongValues.packedBuilder(PackedInts.COMPACT);
 pendingCounts = PackedLongValues.deltaPackedBuilder(PackedInts.COMPACT);
 docsWithField = new DocsWithFieldSet();
 bytesUsed = pending.ramBytesUsed() + pendingCounts.ramBytesUsed();
 iwBytesUsed.addAndGet(bytesUsed);
}

相关文章