Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

[gax-java] chore: generalize ExecutorService for transport layers #1098

Merged
merged 8 commits into from Jun 5, 2020

Conversation

miraleung
Copy link
Contributor

No description provided.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 2, 2020
@codecov
Copy link

codecov bot commented Jun 2, 2020

Codecov Report

Merging #1098 into master will increase coverage by 0.02%.
The diff coverage is 61.11%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1098      +/-   ##
============================================
+ Coverage     78.72%   78.74%   +0.02%     
- Complexity     1169     1191      +22     
============================================
  Files           204      204              
  Lines          5184     5213      +29     
  Branches        416      419       +3     
============================================
+ Hits           4081     4105      +24     
- Misses          928      932       +4     
- Partials        175      176       +1     
Impacted Files Coverage Δ Complexity Δ
...gle/api/gax/rpc/FixedTransportChannelProvider.java 94.44% <0.00%> (-5.56%) 15.00 <0.00> (ø)
...api/gax/grpc/InstantiatingGrpcChannelProvider.java 77.83% <57.14%> (-0.93%) 33.00 <2.00> (ø)
...httpjson/InstantiatingHttpJsonChannelProvider.java 69.84% <66.66%> (-1.13%) 20.00 <4.00> (+1.00) ⬇️
...ain/java/com/google/api/gax/rpc/ClientContext.java 80.88% <100.00%> (ø) 9.00 <0.00> (ø)
.../com/google/api/gax/rpc/FixedWatchdogProvider.java 100.00% <0.00%> (ø) 18.00% <0.00%> (+8.00%)
...gle/api/gax/rpc/InstantiatingWatchdogProvider.java 92.10% <0.00%> (+1.19%) 29.00% <0.00%> (+13.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update acf1fec...60bfa7b. Read the comment docs.

Copy link
Contributor

@igorbernstein2 igorbernstein2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to some explicit typecasts to avoid calling the deprecated version of withExecutor. Please see my pr for examples

@miraleung
Copy link
Contributor Author

Done.

@miraleung
Copy link
Contributor Author

Note that the new method is a direct 1:1 replacement for the deprecated one, so semantically there shouldn't be coverage changes.

Copy link
Contributor

@igorbernstein2 igorbernstein2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but someone from the gax team should approve

@miraleung
Copy link
Contributor Author

Thanks @igorbernstein2, could you please resolve the "changes requested" if no others are needed? Will wait until another gax reviewer approves.

return this;
}

/** @deprecated. Please use {@link #setExecutor(Executor)}. */
@Deprecated
public Builder setExecutor(ScheduledExecutorService executor) {
Copy link
Contributor

@vam-google vam-google Jun 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be called setExecutorProvider and accept ExecutorProvider as an argument (i.e. put back the old method and deprecate it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

return this;
}

/** @deprecated. Please use {@link #setExecutor(Executor)}. */
@Deprecated
public Builder setExecutor(ScheduledExecutorService executor) {
Copy link
Contributor

@vam-google vam-google Jun 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be called setExecutorProvider and accept ExecutorProvider as an argument (i.e. put back the old method and deprecate it).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

@vam-google vam-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@miraleung miraleung merged commit cf1bce8 into master Jun 5, 2020
@miraleung miraleung deleted the fixit/transport branch June 5, 2020 20:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InstantiatingGrpcChannelProvider requires ScheduledExecutorService for no good reason
4 participants