OUT
- public class JDBCInputFormat<OUT extends Tuple> extends RichInputFormat<OUT,InputSplit> implements NonParallelInput
Tuple
,
DriverManager
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
JDBCInputFormat.JDBCInputFormatBuilder |
Constructor and Description |
---|
JDBCInputFormat() |
Modifier and Type | Method and Description |
---|---|
static JDBCInputFormat.JDBCInputFormatBuilder |
buildJDBCInputFormat()
A builder used to set parameters to the output format's configuration in a fluent way.
|
void |
close()
Closes all resources used.
|
void |
configure(Configuration parameters)
Configures this input format.
|
InputSplit[] |
createInputSplits(int minNumSplits)
Creates the different splits of the input that can be processed in parallel.
|
InputSplitAssigner |
getInputSplitAssigner(InputSplit[] inputSplits)
Gets the type of the input splits that are processed by this input format.
|
BaseStatistics |
getStatistics(BaseStatistics cachedStatistics)
Gets the basic statistics from the input described by this format.
|
OUT |
nextRecord(OUT tuple)
Stores the next resultSet row in a tuple
|
void |
open(InputSplit ignored)
Connects to the source database and executes the query.
|
boolean |
reachedEnd()
Checks whether all data has been read.
|
getRuntimeContext, setRuntimeContext
public void configure(Configuration parameters)
InputFormat
This method is always called first on a newly instantiated input format.
configure
in interface InputFormat<OUT extends Tuple,InputSplit>
parameters
- The configuration with all parameters.public void open(InputSplit ignored) throws IOException
open
in interface InputFormat<OUT extends Tuple,InputSplit>
ignored
- IOException
public void close() throws IOException
close
in interface InputFormat<OUT extends Tuple,InputSplit>
IOException
- Indicates that a resource could not be closed.public boolean reachedEnd() throws IOException
reachedEnd
in interface InputFormat<OUT extends Tuple,InputSplit>
IOException
public OUT nextRecord(OUT tuple) throws IOException
nextRecord
in interface InputFormat<OUT extends Tuple,InputSplit>
tuple
- IOException
public BaseStatistics getStatistics(BaseStatistics cachedStatistics) throws IOException
InputFormat
When this method is called, the input format it guaranteed to be configured.
getStatistics
in interface InputFormat<OUT extends Tuple,InputSplit>
cachedStatistics
- The statistics that were cached. May be null.IOException
public InputSplit[] createInputSplits(int minNumSplits) throws IOException
InputFormat
When this method is called, the input format it guaranteed to be configured.
createInputSplits
in interface InputFormat<OUT extends Tuple,InputSplit>
createInputSplits
in interface InputSplitSource<InputSplit>
minNumSplits
- The minimum desired number of splits. If fewer are created, some parallel
instances may remain idle.IOException
- Thrown, when the creation of the splits was erroneous.public InputSplitAssigner getInputSplitAssigner(InputSplit[] inputSplits)
InputFormat
getInputSplitAssigner
in interface InputFormat<OUT extends Tuple,InputSplit>
getInputSplitAssigner
in interface InputSplitSource<InputSplit>
public static JDBCInputFormat.JDBCInputFormatBuilder buildJDBCInputFormat()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.