Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,21 @@ public class IoTDBConfig {

private int loadTsFileSpiltPartitionMaxSize = 10;

/**
* The threshold for splitting statement when loading multiple TsFiles. When the number of TsFiles
* exceeds this threshold, the statement will be split into multiple sub-statements for batch
* execution to limit resource consumption during statement analysis. Default value is 10, which
* means splitting will occur when there are more than 10 files.
*/
private int loadTsFileStatementSplitThreshold = 10;

/**
* The number of TsFiles that each sub-statement handles when splitting a statement. This
* parameter controls how many files are grouped together in each sub-statement during batch
* execution. Default value is 10, which means each sub-statement handles 10 files.
*/
private int loadTsFileSubStatementBatchSize = 10;

private String[] loadActiveListeningDirs =
new String[] {
IoTDBConstant.EXT_FOLDER_NAME
Expand Down Expand Up @@ -4056,6 +4071,46 @@ public void setLoadTsFileSpiltPartitionMaxSize(int loadTsFileSpiltPartitionMaxSi
this.loadTsFileSpiltPartitionMaxSize = loadTsFileSpiltPartitionMaxSize;
}

public int getLoadTsFileStatementSplitThreshold() {
return loadTsFileStatementSplitThreshold;
}

public void setLoadTsFileStatementSplitThreshold(final int loadTsFileStatementSplitThreshold) {
if (loadTsFileStatementSplitThreshold < 0) {
logger.warn(
"Invalid loadTsFileStatementSplitThreshold value: {}. Using default value: 10",
loadTsFileStatementSplitThreshold);
return;
}
if (this.loadTsFileStatementSplitThreshold != loadTsFileStatementSplitThreshold) {
logger.info(
"loadTsFileStatementSplitThreshold changed from {} to {}",
this.loadTsFileStatementSplitThreshold,
loadTsFileStatementSplitThreshold);
}
this.loadTsFileStatementSplitThreshold = loadTsFileStatementSplitThreshold;
}

public int getLoadTsFileSubStatementBatchSize() {
return loadTsFileSubStatementBatchSize;
}

public void setLoadTsFileSubStatementBatchSize(final int loadTsFileSubStatementBatchSize) {
if (loadTsFileSubStatementBatchSize <= 0) {
logger.warn(
"Invalid loadTsFileSubStatementBatchSize value: {}. Using default value: 10",
loadTsFileSubStatementBatchSize);
return;
}
if (this.loadTsFileSubStatementBatchSize != loadTsFileSubStatementBatchSize) {
logger.info(
"loadTsFileSubStatementBatchSize changed from {} to {}",
this.loadTsFileSubStatementBatchSize,
loadTsFileSubStatementBatchSize);
}
this.loadTsFileSubStatementBatchSize = loadTsFileSubStatementBatchSize;
}

public String[] getPipeReceiverFileDirs() {
return (Objects.isNull(this.pipeReceiverFileDirs) || this.pipeReceiverFileDirs.length == 0)
? new String[] {systemDir + File.separator + "pipe" + File.separator + "receiver"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2395,6 +2395,18 @@ private void loadLoadTsFileProps(TrimProperties properties) {
properties.getProperty(
"skip_failed_table_schema_check",
String.valueOf(conf.isSkipFailedTableSchemaCheck()))));

conf.setLoadTsFileStatementSplitThreshold(
Integer.parseInt(
properties.getProperty(
"load_tsfile_statement_split_threshold",
Integer.toString(conf.getLoadTsFileStatementSplitThreshold()))));

conf.setLoadTsFileSubStatementBatchSize(
Integer.parseInt(
properties.getProperty(
"load_tsfile_sub_statement_batch_size",
Integer.toString(conf.getLoadTsFileSubStatementBatchSize()))));
}

private void loadLoadTsFileHotModifiedProp(TrimProperties properties) throws IOException {
Expand Down Expand Up @@ -2443,6 +2455,18 @@ private void loadLoadTsFileHotModifiedProp(TrimProperties properties) throws IOE
"load_tsfile_split_partition_max_size",
Integer.toString(conf.getLoadTsFileSpiltPartitionMaxSize()))));

conf.setLoadTsFileStatementSplitThreshold(
Integer.parseInt(
properties.getProperty(
"load_tsfile_statement_split_threshold",
Integer.toString(conf.getLoadTsFileStatementSplitThreshold()))));

conf.setLoadTsFileSubStatementBatchSize(
Integer.parseInt(
properties.getProperty(
"load_tsfile_sub_statement_batch_size",
Integer.toString(conf.getLoadTsFileSubStatementBatchSize()))));

conf.setSkipFailedTableSchemaCheck(
Boolean.parseBoolean(
properties.getProperty(
Expand Down
Loading