Skip to content
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

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

Merged
merged 8 commits into from Jun 5, 2020

Conversation

miraleung
Copy link
Contributor

@miraleung miraleung commented Jun 2, 2020

No description provided.

@googlebot googlebot added the cla: yes label Jun 2, 2020
@codecov
Copy link

@codecov 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
Collaborator

@igorbernstein2 igorbernstein2 left a comment

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

@miraleung miraleung commented Jun 3, 2020

Done.

@miraleung
Copy link
Contributor Author

@miraleung miraleung commented Jun 4, 2020

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
Collaborator

@igorbernstein2 igorbernstein2 left a comment

LGTM, but someone from the gax team should approve

@miraleung
Copy link
Contributor Author

@miraleung miraleung commented Jun 4, 2020

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

@miraleung miraleung Jun 5, 2020

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

@miraleung miraleung Jun 5, 2020

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

LGTM

@miraleung miraleung merged commit cf1bce8 into master Jun 5, 2020
8 of 9 checks passed
@miraleung miraleung deleted the fixit/transport branch Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants