Package org.apache.beam.sdk.io.jdbc
Interface JdbcReadWithPartitionsHelper<PartitionT>
- Type Parameters:
PartitionT
- Element type of the column used for partition.
- All Superinterfaces:
JdbcIO.PreparedStatementSetter<KV<PartitionT,
,PartitionT>> JdbcIO.RowMapper<KV<Long,
,KV<PartitionT, PartitionT>>> Serializable
public interface JdbcReadWithPartitionsHelper<PartitionT>
extends JdbcIO.PreparedStatementSetter<KV<PartitionT,PartitionT>>, JdbcIO.RowMapper<KV<Long,KV<PartitionT,PartitionT>>>
A helper for
JdbcIO.ReadWithPartitions
that handles range calculations.-
Method Summary
Modifier and TypeMethodDescriptioncalculateRanges
(PartitionT lowerBound, PartitionT upperBound, Long partitions) Calculate the range of each partition from the lower and upper bound, and number of partitions.void
setParameters
(KV<PartitionT, PartitionT> element, PreparedStatement preparedStatement)
-
Method Details
-
calculateRanges
Iterable<KV<PartitionT,PartitionT>> calculateRanges(PartitionT lowerBound, PartitionT upperBound, Long partitions) Calculate the range of each partition from the lower and upper bound, and number of partitions.Return a list of pairs for each lower and upper bound within each partition.
-
setParameters
- Specified by:
setParameters
in interfaceJdbcIO.PreparedStatementSetter<PartitionT>
-
mapRow
- Specified by:
mapRow
in interfaceJdbcIO.RowMapper<PartitionT>
- Throws:
Exception
-