@@ -22,7 +22,7 @@ import com.google.bigtable.v2._
2222import com .google .cloud .bigtable .config .BigtableOptions
2323import com .google .protobuf .ByteString
2424import com .spotify .scio .ScioContext
25- import com .spotify .scio .bigtable .{BigtableRead , BigtableTypedIO , BigtableUtil , TableAdmin }
25+ import com .spotify .scio .bigtable .{BTOptions , BigtableRead , BigtableTypedIO , BigtableUtil , TableAdmin }
2626import com .spotify .scio .coders .Coder
2727import com .spotify .scio .values .SCollection
2828import magnolify .bigtable .BigtableType
@@ -40,17 +40,14 @@ object ScioContextOps {
4040final class ScioContextOps (private val self : ScioContext ) extends AnyVal {
4141 import ScioContextOps ._
4242
43- private def btOpts (projectId : String , instanceId : String ): BigtableOptions =
44- BigtableOptions .builder().setProjectId(projectId).setInstanceId(instanceId).build
45-
4643 def typedBigtable [K : Coder , T : BigtableType : Coder ](
4744 projectId : String ,
4845 instanceId : String ,
4946 tableId : String ,
5047 columnFamily : String ,
5148 keyFn : ByteString => K
5249 ): SCollection [(K , T )] =
53- typedBigtable(btOpts (projectId, instanceId), tableId, columnFamily, keyFn)
50+ typedBigtable(BTOptions (projectId, instanceId), tableId, columnFamily, keyFn)
5451
5552 def typedBigtable [K : Coder , T : BigtableType : Coder ](
5653 projectId : String ,
@@ -60,7 +57,7 @@ final class ScioContextOps(private val self: ScioContext) extends AnyVal {
6057 keyFn : ByteString => K ,
6158 keyRanges : Seq [ByteKeyRange ]
6259 ): SCollection [(K , T )] =
63- typedBigtable(btOpts (projectId, instanceId), tableId, columnFamily, keyFn, keyRanges)
60+ typedBigtable(BTOptions (projectId, instanceId), tableId, columnFamily, keyFn, keyRanges)
6461
6562 def typedBigtable [K : Coder , T : BigtableType : Coder ](
6663 projectId : String ,
@@ -71,7 +68,7 @@ final class ScioContextOps(private val self: ScioContext) extends AnyVal {
7168 keyRanges : Seq [ByteKeyRange ],
7269 rowFilter : RowFilter
7370 ): SCollection [(K , T )] =
74- typedBigtable(btOpts (projectId, instanceId), tableId, columnFamily, keyFn, keyRanges, rowFilter)
71+ typedBigtable(BTOptions (projectId, instanceId), tableId, columnFamily, keyFn, keyRanges, rowFilter)
7572
7673 def typedBigtable [K : Coder , T : BigtableType : Coder ](
7774 projectId : String ,
@@ -84,7 +81,7 @@ final class ScioContextOps(private val self: ScioContext) extends AnyVal {
8481 maxBufferElementCount : Option [Int ]
8582 ): SCollection [(K , T )] =
8683 typedBigtable(
87- btOpts (projectId, instanceId),
84+ BTOptions (projectId, instanceId),
8885 tableId,
8986 columnFamily,
9087 keyFn,
@@ -115,7 +112,7 @@ final class ScioContextOps(private val self: ScioContext) extends AnyVal {
115112 keyRange : ByteKeyRange ,
116113 rowFilter : RowFilter
117114 ): SCollection [Row ] =
118- bigtable(btOpts (projectId, instanceId), tableId, Seq (keyRange), rowFilter)
115+ bigtable(BTOptions (projectId, instanceId), tableId, Seq (keyRange), rowFilter)
119116
120117 /** Get an SCollection for a Bigtable table. */
121118 def bigtable (
@@ -127,7 +124,7 @@ final class ScioContextOps(private val self: ScioContext) extends AnyVal {
127124 maxBufferElementCount : Option [Int ]
128125 ): SCollection [Row ] =
129126 bigtable(
130- btOpts (projectId, instanceId),
127+ BTOptions (projectId, instanceId),
131128 tableId,
132129 Seq (keyRange),
133130 rowFilter,
@@ -140,7 +137,7 @@ final class ScioContextOps(private val self: ScioContext) extends AnyVal {
140137 instanceId : String ,
141138 tableId : String
142139 ): SCollection [Row ] =
143- bigtable(btOpts (projectId, instanceId), tableId)
140+ bigtable(BTOptions (projectId, instanceId), tableId)
144141
145142 /** Get an SCollection for a Bigtable table. */
146143 def bigtable (
@@ -151,7 +148,7 @@ final class ScioContextOps(private val self: ScioContext) extends AnyVal {
151148 rowFilter : RowFilter ,
152149 maxBufferElementCount : Option [Int ]
153150 ): SCollection [Row ] =
154- bigtable(btOpts (projectId, instanceId), tableId, keyRanges, rowFilter, maxBufferElementCount)
151+ bigtable(BTOptions (projectId, instanceId), tableId, keyRanges, rowFilter, maxBufferElementCount)
155152
156153 /** Get an SCollection for a Bigtable table. */
157154 def bigtable (
0 commit comments