Draft
Conversation
RustedBones
commented
Aug 13, 2024
| public abstract class BigtableDoFn<A, B> extends GuavaAsyncLookupDoFn<A, B, BigtableDataClient> { | ||
|
|
||
| private final BigtableOptions options; | ||
| private final Supplier<BigtableDataSettings> settingsSupplier; |
Contributor
Author
There was a problem hiding this comment.
Unfortunatelly BigtableDataSettings is not serializable.
RustedBones
commented
Aug 13, 2024
Comment on lines
+140
to
+141
| val sideOutput = PCollectionTuple.of(BigtableWrite.BigtableWriteResult.tupleTag, result) | ||
| (tap(()), SideOutputCollections(sideOutput, data.context)) |
Contributor
Author
There was a problem hiding this comment.
Leverage WriteResultIO to expose the BigtableWriteResult as side output
Comment on lines
-243
to
+152
| projectId: String, | ||
| instanceId: String, | ||
| tablesAndColumnFamilies: Map[String, Iterable[String]], | ||
| createDisposition: TableAdmin.CreateDisposition | ||
| ): Unit = | ||
| if (!self.isTest) { | ||
| val bigtableOptions = BigtableOptions | ||
| .builder() | ||
| .setProjectId(projectId) | ||
| .setInstanceId(instanceId) | ||
| .build | ||
| TableAdmin.ensureTables(bigtableOptions, tablesAndColumnFamilies, createDisposition) | ||
| } | ||
|
|
||
| def ensureTables( | ||
| def ensureTable( | ||
| projectId: String, | ||
| instanceId: String, | ||
| tablesAndColumnFamilies: Map[String, Iterable[String]] | ||
| ): Unit = ensureTables( | ||
| projectId, | ||
| instanceId, | ||
| tablesAndColumnFamilies, | ||
| TableAdmin.CreateDisposition.default | ||
| ) | ||
|
|
||
| /** | ||
| * Ensure that tables and column families exist. Checks for existence of tables or creates them if | ||
| * they do not exist. Also checks for existence of column families within each table and creates | ||
| * them if they do not exist. | ||
| * | ||
| * @param tablesAndColumnFamilies | ||
| * A map of tables and column families. Keys are table names. Values are a list of column family | ||
| * names. | ||
| */ | ||
| def ensureTables( | ||
| bigtableOptions: BigtableOptions, | ||
| tablesAndColumnFamilies: Map[String, Iterable[String]], | ||
| createDisposition: TableAdmin.CreateDisposition | ||
| tableId: String, |
Contributor
Author
There was a problem hiding this comment.
As underlying client is cached, simplify the API an not worry if this is called multiple times.
RustedBones
commented
Aug 13, 2024
| } | ||
| final case class WriteParam private ( | ||
| flowControl: Boolean = WriteParam.DefaultFlowControl, | ||
| errorHandler: ErrorHandler[BadRecord, _] = WriteParam.DefaultErrorHandler, |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5444 +/- ##
==========================================
+ Coverage 61.29% 61.57% +0.27%
==========================================
Files 314 314
Lines 11250 11213 -37
Branches 793 789 -4
==========================================
+ Hits 6896 6904 +8
+ Misses 4354 4309 -45 ☔ View full report in Codecov by Sentry. |
28b4139 to
931277d
Compare
fc6db20 to
8229e14
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update all bigtable APIs to use cloud v2 client.
Drop
BigtableBulkWriter. This is TBD, but it looks to me can manually shard/groupBy and flatten to normal IO if they require this feature.Change bigtable
ScioContextapi to useAdmin.TableandAdmin.Instanceobjects that cache clients instances.