Adding v2.BatchingCallSettings to integrate with GCJ client#766
Adding v2.BatchingCallSettings to integrate with GCJ client#766igorbernstein2 merged 2 commits intogoogleapis:masterfrom
Conversation
|
cc: @igorbernstein2 |
igorbernstein2
left a comment
There was a problem hiding this comment.
Lgtm with a few nits
Codecov Report
@@ Coverage Diff @@
## master #766 +/- ##
============================================
+ Coverage 78.14% 78.26% +0.11%
- Complexity 1101 1106 +5
============================================
Files 198 199 +1
Lines 4832 4858 +26
Branches 383 383
============================================
+ Hits 3776 3802 +26
Misses 886 886
Partials 170 170
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #766 +/- ##
============================================
- Coverage 78.19% 78.15% -0.05%
Complexity 1100 1100
============================================
Files 197 198 +1
Lines 4825 4284 -541
Branches 380 349 -31
============================================
- Hits 3773 3348 -425
+ Misses 886 770 -116
Partials 166 166
Continue to review full report at Codecov.
|
|
@igorbernstein2 I have addressed the feedback, Please have a fresh look. |
|
@vam-google please take a look |
29d5f37 to
f87d2d3
Compare
|
@igorbernstein2 Thanks a lot for the feedback, I have just now addressed them. |
|
|
||
| /** | ||
| * A settings class to configure a {@link UnaryCallable} for calls to an API method that supports | ||
| * batching. The settings are provided using an instance of {@link BatchingSettings}. |
There was a problem hiding this comment.
This shouldn't be a blocker, but it would be nice if the docs had a bit more meat.
It would be good if this explained that the retry settings are used for the batched request
There was a problem hiding this comment.
I have added a small explanation of retry settings usage and sample settings use. Please let me know if this looks good to you?
igorbernstein2
left a comment
There was a problem hiding this comment.
LGTM, @vam-google please take a look
vam-google
left a comment
There was a problem hiding this comment.
LGTM with few minor comments/qestions
| .setRetryableCodes(retryCodes) | ||
| .setRetrySettings(retrySettings); | ||
|
|
||
| assertThat(builder.getRetryableCodes()).containsExactly(StatusCode.Code.UNAVAILABLE); |
There was a problem hiding this comment.
Why do we need this check? Isn't checking same for the built object same thing (L85)?
There was a problem hiding this comment.
I had added for checking the getters of the builders. I agree that checking with the build object would be the same. So Removing this check.
| } catch (Exception ex) { | ||
| actualEx = ex; | ||
| } | ||
| assertThat(actualEx).isInstanceOf(NullPointerException.class); |
There was a problem hiding this comment.
The fact that BatchingCallSettings.newBuilder(null) produces NullPointerException seems logical (L115), but the fact that BatchingCallSettings.newBuilder(SQUARER_BATCHING_DESC_V2).build(); produces same - does not. Maybe IllegalArgumentException or something like that?
There was a problem hiding this comment.
good point, I would vote for IllegalStateException
There was a problem hiding this comment.
Thanks for pointing it out, I have updated BatchingCallSettings to now throw IllegalStateException.
igorbernstein2
left a comment
There was a problem hiding this comment.
This needs to be rebased for the new package name from #771
This new BatchingCallSettings enables the integration with Google-cloud-bigtable batching API. - Added Javadoc to the v2.BatchingCallSettings - Updated batchingSettings check to `IllegalStateException`. - Removed repetitive checks. - Moved back to existing batching package.
435d426 to
4b7e362
Compare
|
I have rebased this with the existing batching package. Please have a look. |
| assertThat(builder.getRetryableCodes()).isEmpty(); | ||
| assertThat(builder.getRetrySettings()).isNotNull(); | ||
|
|
||
| builder.setBatchingSettings(BATCHING_SETTINGS); |
There was a problem hiding this comment.
This doesn’t really belong in a test called testEmptyBuildrr
There was a problem hiding this comment.
Have removed builder.set## from testEmptyBuilder test case.
- Added javadoc for getBatchingSettings. - Refactored junit test case.
igorbernstein2
left a comment
There was a problem hiding this comment.
LGTM.
Thanks for putting this together so quickly
This new BatchingCallSettings enables the integration with Google-cloud-bigtable batching API.