Skip to content

Commit fbf268e

Browse files
committed
set max batch size
1 parent 2a7b409 commit fbf268e

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)