OUT
- type of outputClasspublic class CassandraPojoOutputFormat<OUT> extends RichOutputFormat<OUT>
Constructor and Description |
---|
CassandraPojoOutputFormat(ClusterBuilder builder,
Class<OUT> outputClass) |
CassandraPojoOutputFormat(ClusterBuilder builder,
Class<OUT> outputClass,
MapperOptions mapperOptions) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all resources used.
|
void |
configure(Configuration parameters)
Configures this output format.
|
protected void |
onWriteFailure(Throwable t)
Callback that is invoked when failing to write to Cassandra.
|
protected void |
onWriteSuccess()
Callback that is invoked after a record is written to Cassandra successfully.
|
void |
open(int taskNumber,
int numTasks)
Opens a Session to Cassandra and initializes the prepared statement.
|
void |
writeRecord(OUT record)
Adds a record to the output.
|
getRuntimeContext, setRuntimeContext
public CassandraPojoOutputFormat(ClusterBuilder builder, Class<OUT> outputClass)
public CassandraPojoOutputFormat(ClusterBuilder builder, Class<OUT> outputClass, MapperOptions mapperOptions)
public void configure(Configuration parameters)
OutputFormat
This method is always called first on a newly instantiated output format.
parameters
- The configuration with all parameters.public void open(int taskNumber, int numTasks)
taskNumber
- The number of the parallel instance.numTasks
- The number of parallel tasks.public void writeRecord(OUT record) throws IOException
OutputFormat
When this method is called, the output format it guaranteed to be opened.
record
- The records to add to the output.IOException
- Thrown, if the records could not be added to to an I/O problem.protected void onWriteSuccess()
Subclass can override to provide its own logic.
protected void onWriteFailure(Throwable t)
Subclass can override to provide its own failure handling logic.
t
- the exceptionpublic void close()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.