Skip to content

Commit 3915dbf

Browse files
committed
Merge branch 'hotfix_1.8_batchSizeOOM_22787' into 'test_3.10.x_oom'
设置batchSize上限 See merge request !255
2 parents 0dbf0d4 + fbf268e commit 3915dbf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rdb/rdb-sink/src/main/java/com/dtstack/flink/sql/sink/rdb/table/RdbTableInfo.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
*/
3030
public class RdbTableInfo extends TargetTableInfo {
3131

32+
public static final int MAX_BATCH_SIZE = 10000;
33+
3234
public static final String URL_KEY = "url";
3335

3436
public static final String TABLE_NAME_KEY = "tableName";
@@ -144,6 +146,10 @@ public boolean check() {
144146
Preconditions.checkNotNull(tableName, "rdb field of tableName is required");
145147
Preconditions.checkNotNull(userName, "rdb field of userName is required");
146148
Preconditions.checkNotNull(password, "rdb field of password is required");
149+
150+
if (null != batchSize) {
151+
Preconditions.checkArgument(batchSize <= MAX_BATCH_SIZE, "batchSize must be less than " + MAX_BATCH_SIZE);
152+
}
147153
return true;
148154
}
149155

0 commit comments

Comments
 (0)