@@ -1121,6 +1121,21 @@ public class IoTDBConfig {
11211121
11221122 private int loadTsFileSpiltPartitionMaxSize = 10 ;
11231123
1124+ /**
1125+ * The threshold for splitting statement when loading multiple TsFiles. When the number of TsFiles
1126+ * exceeds this threshold, the statement will be split into multiple sub-statements for batch
1127+ * execution to limit resource consumption during statement analysis. Default value is 10, which
1128+ * means splitting will occur when there are more than 10 files.
1129+ */
1130+ private int loadTsFileStatementSplitThreshold = 10 ;
1131+
1132+ /**
1133+ * The number of TsFiles that each sub-statement handles when splitting a statement. This
1134+ * parameter controls how many files are grouped together in each sub-statement during batch
1135+ * execution. Default value is 10, which means each sub-statement handles 10 files.
1136+ */
1137+ private int loadTsFileSubStatementBatchSize = 10 ;
1138+
11241139 private String [] loadActiveListeningDirs =
11251140 new String [] {
11261141 IoTDBConstant .EXT_FOLDER_NAME
@@ -4056,6 +4071,46 @@ public void setLoadTsFileSpiltPartitionMaxSize(int loadTsFileSpiltPartitionMaxSi
40564071 this .loadTsFileSpiltPartitionMaxSize = loadTsFileSpiltPartitionMaxSize ;
40574072 }
40584073
4074+ public int getLoadTsFileStatementSplitThreshold () {
4075+ return loadTsFileStatementSplitThreshold ;
4076+ }
4077+
4078+ public void setLoadTsFileStatementSplitThreshold (final int loadTsFileStatementSplitThreshold ) {
4079+ if (loadTsFileStatementSplitThreshold < 0 ) {
4080+ logger .warn (
4081+ "Invalid loadTsFileStatementSplitThreshold value: {}. Using default value: 10" ,
4082+ loadTsFileStatementSplitThreshold );
4083+ return ;
4084+ }
4085+ if (this .loadTsFileStatementSplitThreshold != loadTsFileStatementSplitThreshold ) {
4086+ logger .info (
4087+ "loadTsFileStatementSplitThreshold changed from {} to {}" ,
4088+ this .loadTsFileStatementSplitThreshold ,
4089+ loadTsFileStatementSplitThreshold );
4090+ }
4091+ this .loadTsFileStatementSplitThreshold = loadTsFileStatementSplitThreshold ;
4092+ }
4093+
4094+ public int getLoadTsFileSubStatementBatchSize () {
4095+ return loadTsFileSubStatementBatchSize ;
4096+ }
4097+
4098+ public void setLoadTsFileSubStatementBatchSize (final int loadTsFileSubStatementBatchSize ) {
4099+ if (loadTsFileSubStatementBatchSize <= 0 ) {
4100+ logger .warn (
4101+ "Invalid loadTsFileSubStatementBatchSize value: {}. Using default value: 10" ,
4102+ loadTsFileSubStatementBatchSize );
4103+ return ;
4104+ }
4105+ if (this .loadTsFileSubStatementBatchSize != loadTsFileSubStatementBatchSize ) {
4106+ logger .info (
4107+ "loadTsFileSubStatementBatchSize changed from {} to {}" ,
4108+ this .loadTsFileSubStatementBatchSize ,
4109+ loadTsFileSubStatementBatchSize );
4110+ }
4111+ this .loadTsFileSubStatementBatchSize = loadTsFileSubStatementBatchSize ;
4112+ }
4113+
40594114 public String [] getPipeReceiverFileDirs () {
40604115 return (Objects .isNull (this .pipeReceiverFileDirs ) || this .pipeReceiverFileDirs .length == 0 )
40614116 ? new String [] {systemDir + File .separator + "pipe" + File .separator + "receiver" }
0 commit comments