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

Replaces ICompletableFuture with CompletionStage #15441

Merged

Conversation

@vbekiaris
Copy link
Contributor

vbekiaris commented Aug 9, 2019

ICompletableFuture was introduced in Hazelcast 3.x as a replacement for missing JDK 8's CompletableFuture. Since Hazelcast 4.0 requires JDK 8, we remove ICompletableFuture:

  • in public APIs the return type is now CompletionStage; this allows asynchronous computation chaining and interoperability with other async APIs via CompletionStage#toCompletableFuture(), when required.
  • internally, we subclass CompletableFuture to add internally used functionality in InternalCompletableFuture.

Additionally:

  • fixes #6247 by substituting exception stack trace rewriting with wrapping.
  • fixes #13138 : operation can be now completed normally with a Throwable as completion value
  • fixes #10335
@vbekiaris vbekiaris self-assigned this Aug 9, 2019
@vbekiaris vbekiaris force-pushed the vbekiaris:enhancements/4.0/completable-future branch 6 times, most recently from 2d163e2 to a4010a5 Aug 13, 2019
@vbekiaris vbekiaris force-pushed the vbekiaris:enhancements/4.0/completable-future branch 4 times, most recently from a85430d to 42bb4f0 Aug 23, 2019
@vbekiaris vbekiaris force-pushed the vbekiaris:enhancements/4.0/completable-future branch 3 times, most recently from 0cb254b to f0d4042 Sep 5, 2019
@vbekiaris

This comment has been minimized.

Copy link
Contributor Author

vbekiaris commented Sep 9, 2019

run-lab-run

@vbekiaris vbekiaris force-pushed the vbekiaris:enhancements/4.0/completable-future branch 3 times, most recently from 7d6ea83 to 4ccaab9 Sep 9, 2019
@vbekiaris vbekiaris requested a review from hazelcast/clients as a code owner Sep 10, 2019
@vbekiaris vbekiaris force-pushed the vbekiaris:enhancements/4.0/completable-future branch 5 times, most recently from c675462 to 2080cc2 Sep 10, 2019
@vbekiaris vbekiaris force-pushed the vbekiaris:enhancements/4.0/completable-future branch 2 times, most recently from b25936b to deaf9e1 Sep 19, 2019
@taburet taburet self-requested a review Sep 24, 2019
@vbekiaris vbekiaris changed the title [WIP] CompletableFuture draft Replaces ICompletableFuture with CompletionStage Sep 27, 2019
@vbekiaris vbekiaris added this to the 4.0 milestone Sep 27, 2019
vbekiaris added 23 commits Sep 24, 2019
CallbackAwareClientDelegatingFuture and OneShotExecutionCallback are
now redundant.
Also checkstyle fixes.
Since #15574, RejectedExecutionException due to an executor not
accepting a user-supplied callback for execution is wrapped in
a proper HazelcastInstance not active exception. This behaviour
is now introduced in execution of all further computation stages.
- Errors are wrapped when thrown from get() / join(), according to
CompletableFuture spec
- New joinInternal() rethrows error wrapped in a "local" Error
instance of same class. Also, notifies OutOfMemoryErrorDispatcher
as was previously done by join()
This results in reduction of allocations from InvocationFuture's
get(), join() and joinInternal() methods.
Instead of plain CompletableFuture, return InternalCompletableFuture
Also adds missing implementations of obtrudeValue, obtrudeException and
getNumberOfDependents
PutAsyncOneShotCallback is now again executed either from user action
via blocking get/join/.. method or as callback; so when a blocking
method returns to the user, the near cache is guaranteed to contain
the new value (when using CACHE_ON_UPDATE), in line with #7167
@vbekiaris vbekiaris force-pushed the vbekiaris:enhancements/4.0/completable-future branch from 8685d63 to bf5fa0c Oct 4, 2019
@vbekiaris vbekiaris merged commit 83d814e into hazelcast:master Oct 4, 2019
1 check passed
1 check passed
default Test PASSed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.