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

Separate RequestContextAwareFuture version overrides into mrjar… #2127

Merged
merged 10 commits into from
Oct 1, 2019

Conversation

anuraaga
Copy link
Collaborator

@anuraaga anuraaga commented Sep 29, 2019

… source sets.

Now that we are using mrjar for version-specific implementations, we can use it for the recent change for completablefuture to support Java 9, and future ones to support Java 12.

Advantages

  • Can use other Java 9 APIs when implementing a Java 9 API (e.g., super.completeAsync)
  • Maybe some small performance by not needing e.g., maybeMakeContextAware, supplyAsync for completion of current future
  • Possible readability improvement by being able to use @Override and otherwise IDE-awareness of the API level

Disadvantage

  • If user shades armeria into non-mrjar and runs on newer Java, newer APIs wouldn't function correctly

I think shading is advanced enough that the disadvantage is ok but wondering what everyone thinks.

@codecov
Copy link

codecov bot commented Sep 29, 2019

Codecov Report

Merging #2127 into master will increase coverage by 0.11%.
The diff coverage is 2.22%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2127      +/-   ##
============================================
+ Coverage     73.65%   73.76%   +0.11%     
+ Complexity     9518     9498      -20     
============================================
  Files           835      834       -1     
  Lines         36691    36586     -105     
  Branches       4528     4526       -2     
============================================
- Hits          27024    26987      -37     
+ Misses         7332     7269      -63     
+ Partials       2335     2330       -5
Impacted Files Coverage Δ Complexity Δ
...linecorp/armeria/internal/JavaVersionSpecific.java 60% <0%> (-6.67%) 3 <0> (ø)
...internal/RequestContextAwareCompletableFuture.java 0% <0%> (ø) 0 <0> (?)
...inecorp/armeria/common/AbstractRequestContext.java 69.09% <100%> (-5.46%) 22 <1> (-2)
.../linecorp/armeria/internal/Http2ObjectEncoder.java 71.42% <0%> (-8.58%) 12% <0%> (-1%)
...linecorp/armeria/common/HttpRequestDuplicator.java 80.95% <0%> (-4.05%) 8% <0%> (ø)
...meria/internal/AbstractHttp2ConnectionHandler.java 93.33% <0%> (-3.34%) 13% <0%> (-1%)
...om/linecorp/armeria/server/jetty/JettyService.java 63.05% <0%> (-2.96%) 23% <0%> (-1%)
...inecorp/armeria/server/grpc/ArmeriaServerCall.java 86.61% <0%> (-1.58%) 81% <0%> (-1%)
...necorp/armeria/client/HeapBasedEventLoopState.java 92.78% <0%> (-1.04%) 31% <0%> (-1%)
... and 11 more

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 45c1633...5255f02. Read the comment docs.

Copy link
Member

@trustin trustin left a comment

Choose a reason for hiding this comment

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

Thanks, @anuraaga!

Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

Thanks! @anuraaga
I left some nits :-)

@trustin trustin added the cleanup label Oct 1, 2019
@trustin trustin added this to the 0.94.0 milestone Oct 1, 2019
@trustin trustin changed the title Separate RequestContextAwareFuture version overrides into mrjar sourc… Separate RequestContextAwareFuture version overrides into mrjar… Oct 1, 2019
@trustin trustin merged commit 1147cfd into line:master Oct 1, 2019
eugene70 pushed a commit to eugene70/armeria that referenced this pull request Oct 16, 2019
…e#2127)

… source sets.

Now that we are using mrjar for version-specific implementations, we can use it for the recent change for completablefuture to support Java 9, and future ones to support Java 12.

Advantages

- Can use other Java 9 APIs when implementing a Java 9 API (e.g., `super.completeAsync`)
- Maybe some small performance by not needing e.g., `maybeMakeContextAware`, `supplyAsync` for completion of current future
- Possible readability improvement by being able to use `@Override` and otherwise IDE-awareness of the API level

Disadvantage
- If user shades Armeria into non-mrjar and runs on newer Java, newer APIs wouldn't function correctly
fmguerreiro pushed a commit to fmguerreiro/armeria that referenced this pull request Sep 19, 2020
…e#2127)

… source sets.

Now that we are using mrjar for version-specific implementations, we can use it for the recent change for completablefuture to support Java 9, and future ones to support Java 12.

Advantages

- Can use other Java 9 APIs when implementing a Java 9 API (e.g., `super.completeAsync`)
- Maybe some small performance by not needing e.g., `maybeMakeContextAware`, `supplyAsync` for completion of current future
- Possible readability improvement by being able to use `@Override` and otherwise IDE-awareness of the API level

Disadvantage
- If user shades Armeria into non-mrjar and runs on newer Java, newer APIs wouldn't function correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants