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


Java RamUsageEstimator.NUM_BYTES_INT属性代码示例

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


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

示例1: writeOperations

/**
 * Writes all operations in the given iterable to the given output stream including the size of the array
 * use {@link #readOperations(StreamInput)} to read it back.
 */
public static void writeOperations(StreamOutput outStream, List<Operation> toWrite) throws IOException {
    final ReleasableBytesStreamOutput out = new ReleasableBytesStreamOutput(BigArrays.NON_RECYCLING_INSTANCE);
    try {
        outStream.writeInt(toWrite.size());
        final BufferedChecksumStreamOutput checksumStreamOutput = new BufferedChecksumStreamOutput(out);
        for (Operation op : toWrite) {
            out.reset();
            final long start = out.position();
            out.skip(RamUsageEstimator.NUM_BYTES_INT);
            writeOperationNoSize(checksumStreamOutput, op);
            long end = out.position();
            int operationSize = (int) (out.position() - RamUsageEstimator.NUM_BYTES_INT - start);
            out.seek(start);
            out.writeInt(operationSize);
            out.seek(end);
            ReleasablePagedBytesReference bytes = out.bytes();
            bytes.writeTo(outStream);
        }
    } finally {
        Releasables.close(out.bytes());
    }

}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:27,代码来源:Translog.java

示例2: CachingCollector

private CachingCollector(Collector other, double maxRAMMB, boolean cacheScores) {
  this.other = other;
  
  cachedDocs = new ArrayList<>();
  curDocs = new int[INITIAL_ARRAY_SIZE];
  cachedDocs.add(curDocs);

  int bytesPerDoc = RamUsageEstimator.NUM_BYTES_INT;
  if (cacheScores) {
    bytesPerDoc += RamUsageEstimator.NUM_BYTES_FLOAT;
  }
  maxDocsToCache = (int) ((maxRAMMB * 1024 * 1024) / bytesPerDoc);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:CachingCollector.java

示例3: ramBytesUsed

@Override
public long ramBytesUsed() {
  return 3*RamUsageEstimator.NUM_BYTES_OBJECT_REF + 
         RamUsageEstimator.NUM_BYTES_INT + 
         bytes.ramBytesUsed() + 
         termOrdToBytesOffset.ramBytesUsed() + 
         docToTermOrd.ramBytesUsed();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:FieldCacheImpl.java

示例4: bytesPerPosting

@Override
int bytesPerPosting() {
  int bytes = ParallelPostingsArray.BYTES_PER_POSTING + 2 * RamUsageEstimator.NUM_BYTES_INT;
  if (lastPositions != null) {
    bytes += RamUsageEstimator.NUM_BYTES_INT;
  }
  if (lastOffsets != null) {
    bytes += RamUsageEstimator.NUM_BYTES_INT;
  }
  if (termFreqs != null) {
    bytes += RamUsageEstimator.NUM_BYTES_INT;
  }

  return bytes;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:FreqProxTermsWriterPerField.java

示例5: bytesPerPosting

@Override
int bytesPerPosting() {
  return super.bytesPerPosting() + 3 * RamUsageEstimator.NUM_BYTES_INT;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:TermVectorsConsumerPerField.java

示例6: baseRamBytesUsed

protected long baseRamBytesUsed() {
  return RamUsageEstimator.NUM_BYTES_OBJECT_HEADER
      + RamUsageEstimator.NUM_BYTES_OBJECT_REF
      + RamUsageEstimator.NUM_BYTES_LONG
      + 3 * RamUsageEstimator.NUM_BYTES_INT;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:AbstractPagedMutable.java

示例7: ramBytesUsed

@Override
public long ramBytesUsed() {
    return RamUsageEstimator.NUM_BYTES_INT + indexedPoints.ramBytesUsed();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:4,代码来源:GeoPointArrayAtomicFieldData.java

示例8: ramBytesUsed

@Override
public long ramBytesUsed() {
    return RamUsageEstimator.NUM_BYTES_INT/*size*/ + lon.ramBytesUsed() + lat.ramBytesUsed();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:4,代码来源:GeoPointArrayLegacyAtomicFieldData.java

示例9: getHeaderLength

private static int getHeaderLength(int uuidLength) {
    return CodecUtil.headerLength(TRANSLOG_CODEC) + uuidLength  + RamUsageEstimator.NUM_BYTES_INT;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:3,代码来源:TranslogWriter.java

示例10: ramBytesUsed

@Override
public long ramBytesUsed() {
    return RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + 2 * RamUsageEstimator.NUM_BYTES_LONG + RamUsageEstimator.NUM_BYTES_INT;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:4,代码来源:Translog.java

示例11: numBytesPerElement

@Override
protected int numBytesPerElement() {
    return RamUsageEstimator.NUM_BYTES_INT;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:4,代码来源:BigObjectArray.java


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