-
Notifications
You must be signed in to change notification settings - Fork 523
Workaround BigTableIO to write Iterable of KV (#1057) #1112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6192241 to
0be7b86
Compare
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| class BigtableBulkWriter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add populateDisplayData where applicable.
| final Iterable<KV<ByteString, Iterable<Mutation>>> elements = c.element(); | ||
| final Iterator<KV<ByteString, Iterable<Mutation>>> iterator = elements.iterator(); | ||
|
|
||
| while (iterator.hasNext()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you do foreach here you will save one line of code.
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| class BigtableBulkWriter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are testing missing for this transform.
|
|
||
| private final int numOfShards; | ||
|
|
||
| AssignToShard(int numOfShards) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final
| */ | ||
| class BigtableWriteException extends IOException { | ||
|
|
||
| public BigtableWriteException(KV<ByteString, Iterable<Mutation>> record, Throwable cause) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final to the parameters
| @@ -0,0 +1,30 @@ | |||
| /* | |||
| * Copyright 2017 Spotify AB. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2018
| @@ -0,0 +1,212 @@ | |||
| /* | |||
| * Copyright 2017 Spotify AB. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2018
ravwojdyla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above.
445e5f8 to
834c0c3
Compare
Codecov Report
@@ Coverage Diff @@
## master #1112 +/- ##
==========================================
+ Coverage 81.82% 82.45% +0.62%
==========================================
Files 119 119
Lines 4011 3983 -28
Branches 460 437 -23
==========================================
+ Hits 3282 3284 +2
+ Misses 729 699 -30
Continue to review full report at Codecov.
|
| * Hepler to test createBulkShards. | ||
| */ | ||
| private static class TestPTransform extends | ||
| PTransform<PCollection<KV<ByteString, Iterable<Mutation>>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎨 the formatting looks weird
Rework of #1057