当前位置: 首页>>代码示例>>Java>>正文


Java PackedInts.COMPACT属性代码示例

本文整理汇总了Java中org.apache.lucene.util.packed.PackedInts.COMPACT属性的典型用法代码示例。如果您正苦于以下问题:Java PackedInts.COMPACT属性的具体用法?Java PackedInts.COMPACT怎么用?Java PackedInts.COMPACT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.lucene.util.packed.PackedInts的用法示例。


在下文中一共展示了PackedInts.COMPACT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TermsWriter

TermsWriter(FieldInfo fieldInfo) {
  this.fieldInfo = fieldInfo;

  noOutputs = NoOutputs.getSingleton();

  // This Builder is just used transiently to fragment
  // terms into "good" blocks; we don't save the
  // resulting FST:
  blockBuilder = new Builder<Object>(FST.INPUT_TYPE.BYTE1,
                                     0, 0, true,
                                     true, Integer.MAX_VALUE,
                                     noOutputs,
                                     new FindBlocks(), false,
                                     PackedInts.COMPACT,
                                     true, 15);

  this.longsSize = postingsWriter.setField(fieldInfo);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:18,代码来源:BlockTreeTermsWriter.java

示例2: BinaryDocValuesFieldUpdates

public BinaryDocValuesFieldUpdates(String field, int maxDoc) {
  super(field, FieldInfo.DocValuesType.BINARY);
  bitsPerValue = PackedInts.bitsRequired(maxDoc - 1);
  docs = new PagedMutable(1, PAGE_SIZE, bitsPerValue, PackedInts.COMPACT);
  offsets = new PagedGrowableWriter(1, PAGE_SIZE, 1, PackedInts.FAST);
  lengths = new PagedGrowableWriter(1, PAGE_SIZE, 1, PackedInts.FAST);
  values = new BytesRefBuilder();
  size = 0;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:BinaryDocValuesFieldUpdates.java

示例3: NumericDocValuesFieldUpdates

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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:NumericDocValuesFieldUpdates.java

示例4: BinaryDocValuesWriter

public BinaryDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed) {
  this.fieldInfo = fieldInfo;
  this.bytes = new PagedBytes(BLOCK_BITS);
  this.bytesOut = bytes.getDataOutput();
  this.lengths = new AppendingDeltaPackedLongBuffer(PackedInts.COMPACT);
  this.iwBytesUsed = iwBytesUsed;
  this.docsWithField = new FixedBitSet(64);
  this.bytesUsed = docsWithFieldBytesUsed();
  iwBytesUsed.addAndGet(bytesUsed);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:10,代码来源:BinaryDocValuesWriter.java

示例5: SortedDocValuesWriter

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 = new AppendingDeltaPackedLongBuffer(PackedInts.COMPACT);
  bytesUsed = pending.ramBytesUsed();
  iwBytesUsed.addAndGet(bytesUsed);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:12,代码来源:SortedDocValuesWriter.java

示例6: NumericDocValuesWriter

public NumericDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed, boolean trackDocsWithField) {
  pending = new AppendingDeltaPackedLongBuffer(PackedInts.COMPACT);
  docsWithField = trackDocsWithField ? new FixedBitSet(64) : null;
  bytesUsed = pending.ramBytesUsed() + docsWithFieldBytesUsed();
  this.fieldInfo = fieldInfo;
  this.iwBytesUsed = iwBytesUsed;
  iwBytesUsed.addAndGet(bytesUsed);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:8,代码来源:NumericDocValuesWriter.java

示例7: SortedSetDocValuesWriter

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 = new AppendingPackedLongBuffer(PackedInts.COMPACT);
  pendingCounts = new AppendingDeltaPackedLongBuffer(PackedInts.COMPACT);
  bytesUsed = pending.ramBytesUsed() + pendingCounts.ramBytesUsed();
  iwBytesUsed.addAndGet(bytesUsed);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:13,代码来源:SortedSetDocValuesWriter.java

示例8: Lucene41PostingsWriter

/** Creates a postings writer with <code>PackedInts.COMPACT</code> */
public Lucene41PostingsWriter(SegmentWriteState state) throws IOException {
  this(state, PackedInts.COMPACT);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:Lucene41PostingsWriter.java

示例9: NodeHash

public NodeHash(FST<T> fst, FST.BytesReader in) {
  table = new PagedGrowableWriter(16, 1<<27, 8, PackedInts.COMPACT);
  mask = 15;
  this.fst = fst;
  this.in = in;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:NodeHash.java

示例10: OrdinalMap

/** 
 * Creates an ordinal map that allows mapping ords to/from a merged
 * space from <code>subs</code>.
 * @param owner a cache key
 * @param subs TermsEnums that support {@link TermsEnum#ord()}. They need
 *             not be dense (e.g. can be FilteredTermsEnums}.
 * @throws IOException if an I/O error occurred.
 */
public OrdinalMap(Object owner, TermsEnum subs[]) throws IOException {
  // create the ordinal mappings by pulling a termsenum over each sub's 
  // unique terms, and walking a multitermsenum over those
  this.owner = owner;
  globalOrdDeltas = new MonotonicAppendingLongBuffer(PackedInts.COMPACT);
  firstSegments = new AppendingPackedLongBuffer(PackedInts.COMPACT);
  ordDeltas = new MonotonicAppendingLongBuffer[subs.length];
  for (int i = 0; i < ordDeltas.length; i++) {
    ordDeltas[i] = new MonotonicAppendingLongBuffer();
  }
  long segmentOrds[] = new long[subs.length];
  ReaderSlice slices[] = new ReaderSlice[subs.length];
  TermsEnumIndex indexes[] = new TermsEnumIndex[slices.length];
  for (int i = 0; i < slices.length; i++) {
    slices[i] = new ReaderSlice(0, 0, i);
    indexes[i] = new TermsEnumIndex(subs[i], i);
  }
  MultiTermsEnum mte = new MultiTermsEnum(slices);
  mte.reset(indexes);
  long globalOrd = 0;
  while (mte.next() != null) {        
    TermsEnumWithSlice matches[] = mte.getMatchArray();
    for (int i = 0; i < mte.getMatchCount(); i++) {
      int segmentIndex = matches[i].index;
      long segmentOrd = matches[i].terms.ord();
      long delta = globalOrd - segmentOrd;
      // for each unique term, just mark the first segment index/delta where it occurs
      if (i == 0) {
        firstSegments.add(segmentIndex);
        globalOrdDeltas.add(delta);
      }
      // for each per-segment ord, map it back to the global term.
      while (segmentOrds[segmentIndex] <= segmentOrd) {
        ordDeltas[segmentIndex].add(delta);
        segmentOrds[segmentIndex]++;
      }
    }
    globalOrd++;
  }
  firstSegments.freeze();
  globalOrdDeltas.freeze();
  for (int i = 0; i < ordDeltas.length; ++i) {
    ordDeltas[i].freeze();
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:53,代码来源:MultiDocValues.java

示例11: NodeHash

public NodeHash(FST<T> fst, FST.BytesReader in) {
  table = new GrowableWriter(8, 16, PackedInts.COMPACT);
  mask = 15;
  this.fst = fst;
  this.in = in;
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:6,代码来源:NodeHash.java

示例12: LucurePostingsWriter

/** Creates a postings writer with <code>PackedInts.COMPACT</code> */
public LucurePostingsWriter(SegmentWriteState state) throws IOException {
  this(state, PackedInts.COMPACT);
}
 
开发者ID:roshanp,项目名称:lucure-core,代码行数:4,代码来源:LucurePostingsWriter.java

示例13: PackedNumericFieldUpdates

public PackedNumericFieldUpdates(int maxDoc) {
  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;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:6,代码来源:NumericFieldUpdates.java

示例14: NodeHash

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;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:6,代码来源:NodeHash.java

示例15: Builder

/**
 * Instantiates an FST/FSA builder without any pruning. A shortcut
 * to {@link #Builder(FST.INPUT_TYPE, int, int, boolean,
 * boolean, int, Outputs, boolean, float,
 * boolean, int)} with pruning options turned off.
 */
public Builder(FST.INPUT_TYPE inputType, Outputs<T> outputs) {
  this(inputType, 0, 0, true, true, Integer.MAX_VALUE, outputs, false, PackedInts.COMPACT, true, 15);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:Builder.java


注:本文中的org.apache.lucene.util.packed.PackedInts.COMPACT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。