public abstract class AbstractJdbcOutputFormat<T> extends RichOutputFormat<T> implements Flushable
Modifier and Type | Field and Description |
---|---|
protected JdbcConnectionProvider |
connectionProvider |
static long |
DEFAULT_FLUSH_INTERVAL_MILLS |
static int |
DEFAULT_FLUSH_MAX_SIZE |
Constructor and Description |
---|
AbstractJdbcOutputFormat(JdbcConnectionProvider connectionProvider) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Method that marks the end of the life-cycle of parallel output instance.
|
void |
configure(Configuration parameters)
Configures this output format.
|
void |
flush() |
Connection |
getConnection() |
void |
open(int taskNumber,
int numTasks)
Opens a parallel instance of the output format to store the result of its parallel instance.
|
getRuntimeContext, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
writeRecord
public static final int DEFAULT_FLUSH_MAX_SIZE
public static final long DEFAULT_FLUSH_INTERVAL_MILLS
protected final JdbcConnectionProvider connectionProvider
public AbstractJdbcOutputFormat(JdbcConnectionProvider connectionProvider)
public void configure(Configuration parameters)
OutputFormat
This method is always called first on a newly instantiated output format.
configure
in interface OutputFormat<T>
parameters
- The configuration with all parameters.public void open(int taskNumber, int numTasks) throws IOException
OutputFormat
When this method is called, the output format it guaranteed to be configured.
open
in interface OutputFormat<T>
taskNumber
- The number of the parallel instance.numTasks
- The number of parallel tasks.IOException
- Thrown, if the output could not be opened due to an I/O problem.public void close()
OutputFormat
When this method is called, the output format it guaranteed to be opened.
close
in interface OutputFormat<T>
public void flush() throws IOException
flush
in interface Flushable
IOException
@VisibleForTesting public Connection getConnection()
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.