Class JdbcOutputFormat.Builder
- java.lang.Object
-
- org.apache.flink.connector.jdbc.internal.JdbcOutputFormat.Builder
-
- Enclosing class:
- JdbcOutputFormat<In,JdbcIn,JdbcExec extends JdbcBatchStatementExecutor<JdbcIn>>
public static class JdbcOutputFormat.Builder extends Object
Builder for aJdbcOutputFormat.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JdbcOutputFormat<org.apache.flink.api.java.tuple.Tuple2<Boolean,org.apache.flink.types.Row>,org.apache.flink.types.Row,JdbcBatchStatementExecutor<org.apache.flink.types.Row>>build()Finalizes the configuration and checks validity.JdbcOutputFormat.BuildersetFieldNames(String[] fieldNames)required, field names of this jdbc sink.JdbcOutputFormat.BuildersetFieldTypes(int[] fieldTypes)required, field types of this jdbc sink.JdbcOutputFormat.BuildersetFlushIntervalMills(long flushIntervalMills)optional, flush interval mills, over this time, asynchronous threads will flush data.JdbcOutputFormat.BuildersetFlushMaxSize(int flushMaxSize)optional, flush max size (includes all append, upsert and delete records), over this number of records, will flush data.JdbcOutputFormat.BuildersetKeyFields(String[] keyFields)required, upsert unique keys.JdbcOutputFormat.BuildersetMaxRetryTimes(int maxRetryTimes)optional, max retry times for jdbc connector.JdbcOutputFormat.BuildersetOptions(InternalJdbcConnectionOptions options)required, jdbc options.
-
-
-
Method Detail
-
setOptions
public JdbcOutputFormat.Builder setOptions(InternalJdbcConnectionOptions options)
required, jdbc options.
-
setFieldNames
public JdbcOutputFormat.Builder setFieldNames(String[] fieldNames)
required, field names of this jdbc sink.
-
setKeyFields
public JdbcOutputFormat.Builder setKeyFields(String[] keyFields)
required, upsert unique keys.
-
setFieldTypes
public JdbcOutputFormat.Builder setFieldTypes(int[] fieldTypes)
required, field types of this jdbc sink.
-
setFlushMaxSize
public JdbcOutputFormat.Builder setFlushMaxSize(int flushMaxSize)
optional, flush max size (includes all append, upsert and delete records), over this number of records, will flush data.
-
setFlushIntervalMills
public JdbcOutputFormat.Builder setFlushIntervalMills(long flushIntervalMills)
optional, flush interval mills, over this time, asynchronous threads will flush data.
-
setMaxRetryTimes
public JdbcOutputFormat.Builder setMaxRetryTimes(int maxRetryTimes)
optional, max retry times for jdbc connector.
-
build
public JdbcOutputFormat<org.apache.flink.api.java.tuple.Tuple2<Boolean,org.apache.flink.types.Row>,org.apache.flink.types.Row,JdbcBatchStatementExecutor<org.apache.flink.types.Row>> build()
Finalizes the configuration and checks validity.- Returns:
- Configured JdbcUpsertOutputFormat
-
-