in flink_sink_adbpg_datastream/src/main/java/Adb4PgTableSink.java [102:140]
public Adb4PgTableSink(
String url,
String tableName,
String userName,
String password,
AdbpgTableSchema schema,
List<String> primaryKeys,
int batchSize,
int maxRetryTime,
String driverClassName,
int connectionMaxActive,
int connectionInitialSize,
int connectionMinIdle,
boolean connectionTestWhileIdle,
int maxWait,
int removeAbandonedTimeout,
long batchWriteTimeout) {
this.url = url;
this.tableName = tableName;
this.userName = userName;
this.password = password;
this.primaryKeys = new HashSet<String>(primaryKeys);
this.batchSize = batchSize;
this.maxRetryTime = maxRetryTime;
this.driverClassName = driverClassName;
this.connectionMaxActive = connectionMaxActive;
this.connectionInitialSize = connectionInitialSize;
this.connectionMinIdle = connectionMinIdle;
this.connectionTestWhileIdle = connectionTestWhileIdle;
this.maxWait = maxWait;
this.removeAbandonedTimeout = removeAbandonedTimeout;
this.batchWriteTimeout = batchWriteTimeout;
Joiner joinerOnComma = Joiner.on(",").useForNull("null");
String[] fieldNamesStr = new String[schema.getLength()];
for (int i = 0; i < fieldNamesStr.length; i++) {
fieldNamesStr[i] = "\"" + schema.getFieldNames().get(i) + "\"";
}
this.fieldNames = joinerOnComma.join(fieldNamesStr);
}