OUT
- type of inputClasspublic abstract class CassandraInputFormatBase<OUT> extends RichInputFormat<OUT,InputSplit> implements NonParallelInput
RichInputFormat
to read data from Apache Cassandra and generate a custom
Cassandra annotated object.Modifier and Type | Field and Description |
---|---|
protected com.datastax.driver.core.Cluster |
cluster |
protected org.slf4j.Logger |
logger |
protected String |
query |
protected com.datastax.driver.core.Session |
session |
Constructor and Description |
---|
CassandraInputFormatBase(String query,
ClusterBuilder builder) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all resources used.
|
void |
configure(Configuration parameters)
Configures this input format.
|
InputSplit[] |
createInputSplits(int minNumSplits)
Computes the input splits.
|
InputSplitAssigner |
getInputSplitAssigner(InputSplit[] inputSplits)
Returns the assigner for the input splits.
|
BaseStatistics |
getStatistics(BaseStatistics cachedStatistics)
Gets the basic statistics from the input described by this format.
|
closeInputFormat, getRuntimeContext, openInputFormat, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
nextRecord, open, reachedEnd
protected final org.slf4j.Logger logger
protected final String query
protected transient com.datastax.driver.core.Cluster cluster
protected transient com.datastax.driver.core.Session session
public CassandraInputFormatBase(String query, ClusterBuilder builder)
public void configure(Configuration parameters)
InputFormat
This method is always called first on a newly instantiated input format.
configure
in interface InputFormat<OUT,InputSplit>
parameters
- The configuration with all parameters (note: not the Flink config but the
TaskConfig).public BaseStatistics getStatistics(BaseStatistics cachedStatistics)
InputFormat
When this method is called, the input format is guaranteed to be configured.
getStatistics
in interface InputFormat<OUT,InputSplit>
cachedStatistics
- The statistics that were cached. May be null.public InputSplit[] createInputSplits(int minNumSplits)
InputSplitSource
createInputSplits
in interface InputFormat<OUT,InputSplit>
createInputSplits
in interface InputSplitSource<InputSplit>
minNumSplits
- Number of minimal input splits, as a hint.public InputSplitAssigner getInputSplitAssigner(InputSplit[] inputSplits)
InputSplitSource
getInputSplitAssigner
in interface InputFormat<OUT,InputSplit>
getInputSplitAssigner
in interface InputSplitSource<InputSplit>
public void close()
close
in interface InputFormat<OUT,InputSplit>
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.