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

Return ICompletableFuture from async methods in IMap API #7967

Merged
merged 2 commits into from Apr 21, 2016

Conversation

Projects
None yet
3 participants
@vbekiaris
Copy link
Contributor

commented Apr 18, 2016

IMap methods getAsync, putAsync, setAsync, removeAsync now return ICompletableFuture allowing for execution of callbacks. A new interface BaseAsyncMap has been introduced to maintain binary backwards compatibility, so code compiled against IMap API definition in version 3.6.x should continue working in 3.7.
Fixes #6999. Binary compatibility was tested with a sample client compiled against 3.6 as well as sigtest(https://wiki.openjdk.java.net/display/CodeTools/sigtest) tool which reports setAsync method was added to IMap interface (3.7-SNAPSHOT versus 3.6) but no other errors.

@@ -299,7 +299,7 @@
* @throws NullPointerException if the specified key is null.
* @see java.util.concurrent.Future
*/
Future<V> getAsync(K key);
ICompletableFuture<V> getAsync(K key);

This comment has been minimized.

Copy link
@jerrinot

jerrinot Apr 18, 2016

Contributor

shouldn't we change the examples in JavaDoc?

import java.util.concurrent.TimeUnit;

/**
* Base interface for a {@link BaseMap} providing additional {@link Future}-returning

This comment has been minimized.

Copy link
@jerrinot

jerrinot Apr 18, 2016

Contributor

could you describe why it in important to keep this?

* Base interface for a {@link BaseMap} providing additional {@link Future}-returning
* *Async methods.
*/
public interface BaseAsyncMap<K, V> extends BaseMap<K, V> {

This comment has been minimized.

Copy link
@jerrinot

jerrinot Apr 18, 2016

Contributor

maybe a name indicating the intent would be better. LegacyAsyncMap or something.

* limitations under the License.
*/

package com.hazelcast.core;

This comment has been minimized.

Copy link
@jerrinot

jerrinot Apr 18, 2016

Contributor

it belongs to impl/internal package. it's not there for end-users at all. it's just a way to force a Java compiler to generate bridge methods.

@vbekiaris

This comment has been minimized.

Copy link
Contributor Author

commented Apr 18, 2016

Base interface was renamed to LegacyAsyncMap and moved to com.hazelcast.map.impl package. Amended javadoc in IMap to describe usage of ICompletableFuture return type. Updated IMap.submitToKey to also return ICompletableFuture (was returning a j.u.c.Future previously).

@jerrinot

This comment has been minimized.

Copy link
Contributor

commented Apr 19, 2016

👍

@tombujok

This comment has been minimized.

Copy link
Contributor

commented Apr 21, 2016

👍 (just a note that I don't like our ICompletableFuture - should be changed in 4.0 IMHO. Its interface is misleading and poorly designed, but it's out of scope of this story)

@vbekiaris vbekiaris merged commit c59ad46 into hazelcast:master Apr 21, 2016

1 check passed

default 9154 tests run, 35 skipped, 0 failed.
Details

@vbekiaris vbekiaris deleted the vbekiaris:imap-compat-reversebridge branch Apr 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.