azagrebin commented on a change in pull request #6735: [FLINK-9126] New
CassandraPojoInputFormat to output data as a custom annotated Cassandra Pojo
URL: https://github.com/apache/flink/pull/6735#discussion_r220165515
##########
File path:
flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/batch/connectors/cassandra/CassandraInputFormat.java
##########
@@ -44,90 +31,38 @@
*
* @param <OUT> type of Tuple
*/
-public class CassandraInputFormat<OUT extends Tuple> extends
RichInputFormat<OUT, InputSplit> implements NonParallelInput {
- private static final Logger LOG =
LoggerFactory.getLogger(CassandraInputFormat.class);
+public class CassandraInputFormat<OUT extends Tuple> extends
CassandraInputFormatBase<OUT> {
- private final String query;
- private final ClusterBuilder builder;
-
- private transient Cluster cluster;
- private transient Session session;
+ private static final long serialVersionUID = 3642323148032444264L;
private transient ResultSet resultSet;
public CassandraInputFormat(String query, ClusterBuilder builder) {
- Preconditions.checkArgument(!Strings.isNullOrEmpty(query),
"Query cannot be null or empty");
- Preconditions.checkArgument(builder != null, "Builder cannot be
null");
-
- this.query = query;
- this.builder = builder;
- }
-
- @Override
- public void configure(Configuration parameters) {
- this.cluster = builder.getCluster();
- }
-
- @Override
- public BaseStatistics getStatistics(BaseStatistics cachedStatistics)
throws IOException {
- return cachedStatistics;
+ super(query, builder);
}
/**
* Opens a Session and executes the query.
*
- * @param ignored
+ * @param ignored because parameter is not parallelizable.
Review comment:
the exception can also go from the doc string
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services