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<org.apache.beam.sdk.values.KV<PartitionT,PartitionT>>,JdbcIO.RowMapper<org.apache.beam.sdk.values.KV<java.lang.Long,org.apache.beam.sdk.values.KV<PartitionT,PartitionT>>>,java.io.Serializable
public interface JdbcReadWithPartitionsHelper<PartitionT> extends JdbcIO.PreparedStatementSetter<org.apache.beam.sdk.values.KV<PartitionT,PartitionT>>, JdbcIO.RowMapper<org.apache.beam.sdk.values.KV<java.lang.Long,org.apache.beam.sdk.values.KV<PartitionT,PartitionT>>>
A helper forJdbcIO.ReadWithPartitionsthat handles range calculations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Iterable<org.apache.beam.sdk.values.KV<PartitionT,PartitionT>>calculateRanges(PartitionT lowerBound, PartitionT upperBound, java.lang.Long partitions)Calculate the range of each partition from the lower and upper bound, and number of partitions.org.apache.beam.sdk.values.KV<java.lang.Long,org.apache.beam.sdk.values.KV<PartitionT,PartitionT>>mapRow(java.sql.ResultSet resultSet)voidsetParameters(org.apache.beam.sdk.values.KV<PartitionT,PartitionT> element, java.sql.PreparedStatement preparedStatement)
-
-
-
Method Detail
-
calculateRanges
java.lang.Iterable<org.apache.beam.sdk.values.KV<PartitionT,PartitionT>> calculateRanges(PartitionT lowerBound, PartitionT upperBound, java.lang.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
void setParameters(org.apache.beam.sdk.values.KV<PartitionT,PartitionT> element, java.sql.PreparedStatement preparedStatement)
- Specified by:
setParametersin interfaceJdbcIO.PreparedStatementSetter<PartitionT>
-
mapRow
org.apache.beam.sdk.values.KV<java.lang.Long,org.apache.beam.sdk.values.KV<PartitionT,PartitionT>> mapRow(java.sql.ResultSet resultSet) throws java.lang.Exception
- Specified by:
mapRowin interfaceJdbcIO.RowMapper<PartitionT>- Throws:
java.lang.Exception
-
-