public int getEstimatedSizeInBytes() { int result = INSTANCE_SIZE; result += sizeOfObjectArray(addresses.size()); for (HostAddress address : addresses) { result += HOST_ADDRESS_INSTANCE_SIZE + address.getHostText().length() * Character.BYTES; } return result; } }
public int getEstimatedSizeInBytes() { int result = INSTANCE_SIZE; result += path.length() * Character.BYTES; result += sizeOfObjectArray(partitionKeys.size()); for (HivePartitionKey partitionKey : partitionKeys) { result += partitionKey.getEstimatedSizeInBytes(); } result += sizeOfObjectArray(blocks.size()); for (InternalHiveBlock block : blocks) { result += block.getEstimatedSizeInBytes(); } result += partitionName.length() * Character.BYTES; result += sizeOfObjectArray(columnCoercions.size()); for (HiveTypeName hiveTypeName : columnCoercions.values()) { result += INTEGER_INSTANCE_SIZE + hiveTypeName.getEstimatedSizeInBytes(); } return result; }
private void updateRetainedSize() { // increment the size only when it is the first reference retainedSizeInBytes = Page.INSTANCE_SIZE + SizeOf.sizeOfObjectArray(page.getChannelCount()); ReferenceCountMap referenceCountMap = new ReferenceCountMap(); for (int channel = 0; channel < page.getChannelCount(); channel++) { Block block = page.getBlock(channel); if (!isNotLoadedLazyBlock(block)) { block.retainedBytesForEachPart((object, size) -> { if (referenceCountMap.incrementAndGet(object) == 1) { retainedSizeInBytes += size; } }); } } for (Block previouslyComputedResult : previouslyComputedResults) { if (previouslyComputedResult != null) { previouslyComputedResult.retainedBytesForEachPart((object, size) -> { if (referenceCountMap.incrementAndGet(object) == 1) { retainedSizeInBytes += size; } }); } } memoryContext.setBytes(retainedSizeInBytes); }
public static long sizeOf(Object[] array) { return (array == null) ? 0 : sizeOfObjectArray(array.length); }
public static long sizeOf(Object[] array) { return (array == null) ? 0 : sizeOfObjectArray(array.length); }
public int getEstimatedSizeInBytes() { int result = INSTANCE_SIZE; result += sizeOfObjectArray(addresses.size()); for (HostAddress address : addresses) { result += HOST_ADDRESS_INSTANCE_SIZE + address.getHostText().length() * Character.BYTES; } return result; } }
public int getEstimatedSizeInBytes() { int result = INSTANCE_SIZE; result += path.length() * Character.BYTES; result += sizeOfObjectArray(partitionKeys.size()); for (HivePartitionKey partitionKey : partitionKeys) { result += partitionKey.getEstimatedSizeInBytes(); } result += sizeOfObjectArray(blocks.size()); for (InternalHiveBlock block : blocks) { result += block.getEstimatedSizeInBytes(); } result += partitionName.length() * Character.BYTES; result += sizeOfObjectArray(columnCoercions.size()); for (HiveTypeName hiveTypeName : columnCoercions.values()) { result += INTEGER_INSTANCE_SIZE + hiveTypeName.getEstimatedSizeInBytes(); } return result; }
private void updateRetainedSize() { // increment the size only when it is the first reference retainedSizeInBytes = Page.INSTANCE_SIZE + SizeOf.sizeOfObjectArray(page.getChannelCount()); ReferenceCountMap referenceCountMap = new ReferenceCountMap(); for (int channel = 0; channel < page.getChannelCount(); channel++) { Block block = page.getBlock(channel); if (!isNotLoadedLazyBlock(block)) { block.retainedBytesForEachPart((object, size) -> { if (referenceCountMap.incrementAndGet(object) == 1) { retainedSizeInBytes += size; } }); } } for (Block previouslyComputedResult : previouslyComputedResults) { if (previouslyComputedResult != null) { previouslyComputedResult.retainedBytesForEachPart((object, size) -> { if (referenceCountMap.incrementAndGet(object) == 1) { retainedSizeInBytes += size; } }); } } memoryContext.setBytes(retainedSizeInBytes); }
private void updateRetainedSize() { // increment the size only when it is the first reference retainedSizeInBytes = Page.INSTANCE_SIZE + SizeOf.sizeOfObjectArray(page.getChannelCount()); ReferenceCountMap referenceCountMap = new ReferenceCountMap(); for (int channel = 0; channel < page.getChannelCount(); channel++) { Block block = page.getBlock(channel); if (!isNotLoadedLazyBlock(block)) { block.retainedBytesForEachPart((object, size) -> { if (referenceCountMap.incrementAndGet(object) == 1) { retainedSizeInBytes += size; } }); } } for (Block previouslyComputedResult : previouslyComputedResults) { if (previouslyComputedResult != null) { previouslyComputedResult.retainedBytesForEachPart((object, size) -> { if (referenceCountMap.incrementAndGet(object) == 1) { retainedSizeInBytes += size; } }); } } memoryContext.setBytes(retainedSizeInBytes); }