JackieTien97 commented on code in PR #15685:
URL: https://github.com/apache/iotdb/pull/15685#discussion_r2230377047
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/TableIntoOperator.java:
##########
@@ -75,6 +72,9 @@ public TableIntoOperator(
inputColumnCategories,
isAligned,
maxRowNumberInStatement);
+ // Build the sample TsBlock which contains only one row.
+ TsBlock tsBlock = constructResultTsBlock();
+ this.maxReturnSize = tsBlock.getRetainedSizeInBytes();
Review Comment:
I think it should be a constant value, and can be calculated only once.
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/AbstractTreeIntoOperator.java:
##########
@@ -47,6 +51,7 @@ protected AbstractTreeIntoOperator(
ExecutorService intoOperationExecutor,
long statementSizePerLine) {
super(operatorContext, child, inputColumnTypes, intoOperationExecutor,
statementSizePerLine);
+ this.maxReturnSize = DEFAULT_MAX_TSBLOCK_SIZE_IN_BYTES;
Review Comment:
```suggestion
this.maxReturnSize =
TSFileDescriptor.getInstance().getConfig().getMaxTsBlockSizeInBytes();
```
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/InsertTabletStatementGenerator.java:
##########
@@ -265,6 +256,20 @@ protected void processColumn(
}
}
+ protected long sizeOf(Object[] arr, Class<?> clazz) {
+ if (arr == null) {
+ return 0;
+ }
+ long size = RamUsageEstimator.shallowSizeOf(arr);
+ for (Object s : arr) {
+ if (s == null) {
+ continue;
+ }
+ size += RamUsageEstimator.shallowSizeOfInstance(clazz);
Review Comment:
may be better to put RamUsageEstimator.shallowSizeOfInstance(clazz) out if
for-loop
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/AbstractTreeIntoOperator.java:
##########
@@ -38,6 +39,9 @@
import java.util.concurrent.ExecutorService;
public abstract class AbstractTreeIntoOperator extends AbstractIntoOperator {
+ private static final int DEFAULT_MAX_TSBLOCK_SIZE_IN_BYTES =
Review Comment:
```suggestion
private final int DEFAULT_MAX_TSBLOCK_SIZE_IN_BYTES =
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]