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
feat: Create Stream writer v2 - starting with core logics #867
feat: Create Stream writer v2 - starting with core logics #867
Conversation
Compared to existing StreamWriter, its locking mechanism is much simpler.
...querystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2Test.java
Show resolved
Hide resolved
...-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2.java
Outdated
Show resolved
Hide resolved
...-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2.java
Outdated
Show resolved
Hide resolved
...-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2.java
Outdated
Show resolved
Hide resolved
...-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #867 +/- ##
============================================
+ Coverage 80.03% 80.64% +0.60%
- Complexity 979 1005 +26
============================================
Files 74 76 +2
Lines 5290 5430 +140
Branches 408 420 +12
============================================
+ Hits 4234 4379 +145
- Misses 872 878 +6
+ Partials 184 173 -11
Continue to review full report at Codecov.
|
...rystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/FakeBigQueryWriteImpl.java
Show resolved
Hide resolved
...-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2.java
Show resolved
Hide resolved
...-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2.java
Show resolved
Hide resolved
...-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2.java
Show resolved
Hide resolved
...querystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2Test.java
Show resolved
Hide resolved
...-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2.java
Show resolved
Hide resolved
...-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2.java
Show resolved
Hide resolved
...-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2.java
Show resolved
Hide resolved
log.info("User closing stream: " + streamName); | ||
this.lock.lock(); | ||
try { | ||
this.userClosed = true; |
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.
adding a local var to remember the previous value, so if user closed twice, the second time will be no_op (don't call the appendThread.join() multiple times).
|
||
if (localQueue.isEmpty()) { | ||
continue; | ||
} |
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.
maybe be save a few lines of code here? it's useless according to context.
Unblocks Dataflow sink test which unblocks customer update.