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


Java ClassSize.OBJECT属性代码示例

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


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

示例1: heapSize

/**
 * HeapSize implementation
 *
 * We do not count the bytes in the rowCache because it should be empty for a KeyValue in the
 * MemStore.
 */
@Override
public long heapSize() {
  int sum = 0;
  sum += ClassSize.OBJECT;// the KeyValue object itself
  sum += ClassSize.REFERENCE;// pointer to "bytes"
  sum += ClassSize.align(ClassSize.ARRAY);// "bytes"
  sum += ClassSize.align(length);// number of bytes of data in the "bytes" array
  sum += 2 * Bytes.SIZEOF_INT;// offset, length
  sum += Bytes.SIZEOF_LONG;// memstoreTS
  return ClassSize.align(sum);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:KeyValue.java

示例2: heapSize

@Override
public long heapSize() {
  long sum = CellUtil.estimatedHeapSizeOf(cell) - cell.getTagsLength();
  sum += ClassSize.OBJECT;// this object itself
  sum += (2 * ClassSize.REFERENCE);// pointers to cell and tags array
  if (this.tags != null) {
    sum += ClassSize.align(ClassSize.ARRAY);// "tags"
    sum += this.tags.length;
  }
  return sum;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:TagRewriteCell.java

示例3: heapSizeWithoutTags

/**
 * This is a hack that should be removed once we don't care about matching
 * up client- and server-side estimations of cell size. It needed to be
 * backwards compatible with estimations done by older clients. We need to
 * pretend that tags never exist and KeyValues aren't serialized with tag
 * length included. See HBASE-13262 and HBASE-13303
 */
@Deprecated
public long heapSizeWithoutTags() {
  int sum = 0;
  sum += ClassSize.OBJECT;// the KeyValue object itself
  sum += ClassSize.REFERENCE;// pointer to "bytes"
  sum += ClassSize.align(ClassSize.ARRAY);// "bytes"
  sum += KeyValue.KEYVALUE_INFRASTRUCTURE_SIZE;
  sum += getKeyLength();
  sum += getValueLength();
  sum += 2 * Bytes.SIZEOF_INT;// offset, length
  sum += Bytes.SIZEOF_LONG;// memstoreTS
  return ClassSize.align(sum);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:20,代码来源:KeyValue.java


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