本文整理汇总了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);
}
示例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;
}
示例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);
}