final case class JdbcShardedReadOptions[T, S](connectionOptions: JdbcConnectionOptions, tableName: String, shardColumn: String, shard: Shard[S], rowMapper: (ResultSet) => T, fetchSize: Int = JdbcShardedReadOptions.DefaultFetchSize, numShards: Int = JdbcShardedReadOptions.DefaultNumShards) extends Product with Serializable
A bag of options for the JDBC sharded read.
- connectionOptions
Connection options
- tableName
Name of a table or materialized view to read from
- shardColumn
Column to shard by. Should ideally have evenly distributed values. Column type must have a corresponding com.spotify.scio.jdbc.sharded.Shard implementation.
- shard
An implementation of the com.spotify.scio.jdbc.sharded.Shard trait which knows how to shard a column of a type S. Example of sharding by a column of type Long:
sc.jdbcShardedSelect(getShardedReadOptions(opts), Shard.range[Long])
- rowMapper
Function to map from a SQL java.sql.ResultSet to
T
- fetchSize
Amount of rows fetched per java.sql.ResultSet. Default value is 100000. To apply an unbounded fetch size set this parameter to -1
- numShards
Number of shards to split the table into for reading. There is no guarantee that Beam will actually execute reads in parallel. It is up to Beam auto scaler to decide the level of parallelism to use (number of workers and threads per worker). But the behavior could be controlled with maxNumWorkers and numberOfWorkerHarnessThreads parameters (see more details about these parameters here). Defaults to 4
- Alphabetic
- By Inheritance
- JdbcShardedReadOptions
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new JdbcShardedReadOptions(connectionOptions: JdbcConnectionOptions, tableName: String, shardColumn: String, shard: Shard[S], rowMapper: (ResultSet) => T, fetchSize: Int = JdbcShardedReadOptions.DefaultFetchSize, numShards: Int = JdbcShardedReadOptions.DefaultNumShards)
- connectionOptions
Connection options
- tableName
Name of a table or materialized view to read from
- shardColumn
Column to shard by. Should ideally have evenly distributed values. Column type must have a corresponding com.spotify.scio.jdbc.sharded.Shard implementation.
- shard
An implementation of the com.spotify.scio.jdbc.sharded.Shard trait which knows how to shard a column of a type S. Example of sharding by a column of type Long:
sc.jdbcShardedSelect(getShardedReadOptions(opts), Shard.range[Long])
- rowMapper
Function to map from a SQL java.sql.ResultSet to
T
- fetchSize
Amount of rows fetched per java.sql.ResultSet. Default value is 100000. To apply an unbounded fetch size set this parameter to -1
- numShards
Number of shards to split the table into for reading. There is no guarantee that Beam will actually execute reads in parallel. It is up to Beam auto scaler to decide the level of parallelism to use (number of workers and threads per worker). But the behavior could be controlled with maxNumWorkers and numberOfWorkerHarnessThreads parameters (see more details about these parameters here). Defaults to 4
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- val connectionOptions: JdbcConnectionOptions
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val fetchSize: Int
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val numShards: Int
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val rowMapper: (ResultSet) => T
- val shard: Shard[S]
- val shardColumn: String
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val tableName: String
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()