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

Ignite 4584 #1592

Closed
wants to merge 117 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
b81621b
IGNITE-4580 change async API at the IgniteCompute, change examples, a…
Jan 19, 2017
310c846
IGNITE-4580 rename internal methods
Jan 20, 2017
b1918f0
IGNITE-4581: add new async public API
Jan 23, 2017
2a14d1d
IGNITE-4581: fix text cache proxy
Jan 23, 2017
02ae641
IGNITE-4581: modify examples and full API tests
Jan 23, 2017
da26d53
IGNITE-4581: javadoc
Jan 23, 2017
30b0bd5
Merge branch 'ignite-2.0' into ignite-4580
Jan 24, 2017
3e7e00f
Minors.
Jan 24, 2017
6c8fe6d
IGNITE-4581: revert IgniteAsyncSupported annotation
Jan 24, 2017
48112a2
Merge branch 'ignite-2.0' into ignite-4581
Jan 24, 2017
2160eaf
IGNITE-4581: modify PlatformCache to use new async API
Jan 24, 2017
cb5595c
IGNITE-4580: use IgniteFuture instead of ComputeTaskFuture for closures
Jan 24, 2017
dffc5f9
Merge branch 'ignite-4580' into ignite-4581
Jan 24, 2017
9f165d4
IGNITE-4581: add tests for new async methods
Jan 24, 2017
42d653a
Merge branch 'ignite-2.0' into ignite-4581
Jan 24, 2017
38e2f78
IGNITE-4582: Async API: IgniteFileSystem refactoring
Jan 25, 2017
696d003
cosmetic
Jan 25, 2017
37a8bcd
IGNITE-4581: remove currentFuture impl from PlatformCache
Jan 25, 2017
808bc36
IGNITE-4583: new async API at the IgniteCluster, IgniteEvents, Ignite…
Jan 25, 2017
f3b7c27
IGNITE-4583: add tests for new API
Jan 25, 2017
557ab87
Merge branches 'ignite-4581', 'ignite-4582' and 'ignite-4583' into ig…
Jan 25, 2017
15785c8
Merge branch 'ignite-2.0' into ignite-4581
Jan 26, 2017
b671227
IGNITE-4581: revert platform changes
Jan 26, 2017
321dc04
IGNITE-4581: fix platform cache
Jan 26, 2017
a146e80
Merge remote-tracking branch 'community/ignite-4581' into ignite-4581
Jan 26, 2017
d2984e0
IGNITE-4581: fix platform cache
Jan 26, 2017
24cd711
IGNITE-4581: use new async API instead old at the ignite
Jan 26, 2017
1039b55
Merge branch 'ignite-4580' into ignite-4581
Jan 26, 2017
2881c99
Merge branch 'ignite-2.0' into ignite-4581
Jan 27, 2017
eb246ec
Merge branch 'ignite-2.0' into ignite-4581
Jan 27, 2017
bcb5b98
IGNITE-4581: fix load cache
Jan 30, 2017
a4c4b61
Merge remote-tracking branch 'community/ignite-4581' into ignite-4581
Jan 30, 2017
9e708df
Merge branch 'ignite-2.0' into ignite-4580
Jan 30, 2017
a069628
IGNITE-4580: compilation fixed
Jan 30, 2017
0312add
Merge branch 'ignite-4580' into ignite-4581
Jan 30, 2017
93485f4
Merge branch 'ignite-2.0' into ignite-4582
Jan 30, 2017
ba352ed
Merge branch 'ignite-2.0' into ignite-4583
Jan 30, 2017
88abbb0
IGNITE-4583: fix platforms
Jan 30, 2017
082ccfd
IGNITE-4583: fix platforms
Jan 30, 2017
7241c8c
IGNITE-4580: cosmetic
Jan 30, 2017
e06ca32
IGNITE-4581: cosmetic
Jan 30, 2017
a0fe09c
Merge branch 'ignite-4580' into ignite-4581
Jan 30, 2017
d4a822f
Merge branch 'ignite-2.0' into ignite-4584
Jan 30, 2017
07d4512
Merge branches 'ignite-4581', 'ignite-4582' and 'ignite-4583' into ig…
Jan 30, 2017
159a855
javadoc
Jan 31, 2017
fbe6c1e
Merge branch 'ignite-4581' into ignite-4584
Jan 31, 2017
0bd7154
IGNITE-4584: save the progress
Jan 31, 2017
3388c65
IGNITE-4581: add deprecated annotation
Jan 31, 2017
c928472
IGNITE-4582: add deprecated annotation
Jan 31, 2017
4e05073
IGNITE-4583: add deprecated annotation
Jan 31, 2017
464ac53
Merge branches 'ignite-4581', 'ignite-4582' and 'ignite-4583' into ig…
Jan 31, 2017
e23ad87
IGNITE-4584: save the progress
Jan 31, 2017
aba8870
IGNITE-4583: fix the future type
Jan 31, 2017
40e6598
Merge branch 'ignite-4583' into ignite-4584
Jan 31, 2017
e913f5d
IGNITE-4584: save the progress
Feb 1, 2017
a5969cd
IGNITE-4580: New asyncs for Compute API.
Feb 2, 2017
4daeb30
Merge branch 'ignite-4475-async' into ignite-4583
Feb 2, 2017
5cf6dc4
IGNITE-4582: Async API: IgniteFileSystem refactoring.
Feb 2, 2017
c1e3f41
IGNITE-4583: review javadoc
Feb 2, 2017
2f0c24f
IGNITE-4583: add tests for services async API
Feb 2, 2017
ab1cb30
Merge branch 'ignite-4475-async' into ignite-4583
Feb 2, 2017
0557aa2
IGNITE-4581: review javadoc
Feb 2, 2017
715bc32
IGNITE-4583: fox transaction async API
Feb 2, 2017
278c0a2
Merge remote-tracking branch 'community/ignite-4583' into ignite-4583
Feb 2, 2017
9e3fb45
Merge branches 'ignite-4581' and 'ignite-4583' into ignite-4584
Feb 2, 2017
4c361f6
IGNITE-4584: fix tests with new transaction async API
Feb 2, 2017
f2f75d3
Merge branch 'ignite-4475-async' into ignite-4581
devozerov Feb 2, 2017
995f018
IGNITE-4581: fix platform cache
Feb 3, 2017
ef57184
Merge remote-tracking branch 'upstream/ignite-4581' into ignite-4581
Feb 3, 2017
2ae53e2
IGNITE-4583: fix platforms & code cleanup
Feb 3, 2017
6a72327
Merge branch 'ignite-2.0' into ignite-4583
Feb 3, 2017
a510706
IGNITE-4583: javadoc
Feb 3, 2017
7b370dc
Merge branch 'ignite-2.0' into ignite-4475-async
Feb 3, 2017
7e4edab
IGNITE-4583: cleanup
Feb 3, 2017
66744c9
IGNITE-4583: rollback pom
Feb 3, 2017
d85212e
Merge branches 'ignite-4475-async', 'ignite-4581' and 'ignite-4583' i…
Feb 3, 2017
11dfd9b
Merge branch 'ignite-2.0' into ignite-4581
Feb 3, 2017
bb2bee4
IGNITE-4581: minors
Feb 3, 2017
055295e
Merge branch 'master' into ignite-4475-async
Feb 6, 2017
dd4d439
Merge branch 'ignite-2.0' into ignite-4475-async
Feb 6, 2017
f773aab
Merge branch 'ignite-2.0' into ignite-4581
Feb 7, 2017
8984fbe
IGNITE-4581: supress unchecked warnings
Feb 7, 2017
8dcb503
Merge remote-tracking branch 'origin/ignite-4475-async' into ignite-4…
Feb 7, 2017
fde1f48
IGNITE-4583: new async API at the IgniteCluster, IgniteEvents, Ignite…
Feb 8, 2017
4cc91c2
Merge branch 'ignite-4475-async' into ignite-4581
Feb 8, 2017
71f9dc2
Minors.
Feb 8, 2017
657257d
Merge remote-tracking branch 'upstream/ignite-4581' into ignite-4581
Feb 8, 2017
7e93ea1
IGNITE-4581: remove PlatformAsyncTarget.currentFuture() method
Feb 8, 2017
3d5a046
IGNITE-4581: complete remove PlatformAsyncTarget
Feb 10, 2017
83fc01e
Merge branch 'ignite-2.0' into ignite-4581
Feb 10, 2017
cb98852
Merge branch 'ignite-4475-async' into ignite-4584
Feb 16, 2017
6b239d7
Merge branch 'ignite-4581' into ignite-4584
Feb 16, 2017
679ea8d
Merge branch 'ignite-2.0' into ignite-4584
Feb 16, 2017
2b8d71d
Merge branch 'ignite-2.0' into ignite-4584
Mar 3, 2017
0d02710
manual merge
Mar 3, 2017
037662c
Merge branch 'ignite-2.0' into ignite-4475-async
Mar 3, 2017
5eb01a5
Merge branch 'ignite-2.0' into ignite-4584
Mar 3, 2017
c486517
Merge branch 'ignite-4475-async' into ignite-4584
Mar 3, 2017
be708b3
Merge branch 'ignite-4581' into ignite-4475-async
Mar 3, 2017
7ab2c94
Merge branch 'ignite-2.0' into ignite-4581
Mar 3, 2017
13afffd
manual merge
Mar 3, 2017
2184b6b
merge with 4581
Mar 3, 2017
cde38e3
Merge branch 'ignite-4475-async' into ignite-4584
Mar 3, 2017
a5e244e
IGNITE-4584: minors: remove unused import
Mar 3, 2017
bb52ed6
Merge branch 'ignite-2.0' into ignite-4584
Mar 14, 2017
17f88e2
Merge branch 'ignite-2.0' into ignite-4475-async
Mar 14, 2017
b5a7ed4
IGNITE-4584: minors cleanup
Mar 14, 2017
7784cb0
Merge branch 'ignite-2.0' into ignite-4475-async
Mar 14, 2017
dd3f0ca
Merge branch 'ignite-4475-async' into ignite-4584
Mar 15, 2017
dc72971
IGNITE-4584: use new async api in the tests
Mar 15, 2017
4955c72
Merge remote-tracking branch 'community/ignite-4584' into ignite-4584
Mar 15, 2017
39d83ce
IGNITE-4584: use new async api
Mar 15, 2017
e7cd9c6
IGNITE-4584: use new async api
Mar 15, 2017
4d2ec11
Merge branch 'ignite-2.0' into ignite-4584
Mar 17, 2017
ec882c0
IGNITE-4584: fix after merge
Mar 17, 2017
228322a
Merge branch 'master' into ignite-4475-async
Mar 21, 2017
0329a68
Merge branch 'ignite-4475-async' into ignite-4584
Mar 21, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,19 @@ public static void main(String[] args) throws IgniteException {
System.out.println("Compute asynchronous example started.");

// Enable asynchronous mode.
IgniteCompute compute = ignite.compute().withAsync();
IgniteCompute compute = ignite.compute();

Collection<IgniteFuture<?>> futs = new ArrayList<>();

// Iterate through all words in the sentence and create runnable jobs.
for (final String word : "Print words using runnable".split(" ")) {
// Execute runnable on some node.
compute.run(new IgniteRunnable() {
futs.add(compute.runAsync(new IgniteRunnable() {
@Override public void run() {
System.out.println();
System.out.println(">>> Printing '" + word + "' on this node from ignite job.");
}
});

futs.add(compute.future());
}));
}

// Wait for completion of all futures.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.apache.ignite.cluster.ClusterGroup;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.compute.ComputeJobContext;
import org.apache.ignite.compute.ComputeTaskFuture;
import org.apache.ignite.examples.ExampleNodeStartup;
import org.apache.ignite.lang.IgniteClosure;
import org.apache.ignite.lang.IgniteFuture;
Expand Down Expand Up @@ -142,13 +141,12 @@ private static class ContinuationFibonacciClosure implements IgniteClosure<Long,

ClusterGroup p = ignite.cluster().forPredicate(nodeFilter);

IgniteCompute compute = ignite.compute(p).withAsync();
IgniteCompute compute = ignite.compute(p);

// If future is not cached in node-local-map, cache it.
if (fut1 == null) {
compute.apply(new ContinuationFibonacciClosure(nodeFilter), n - 1);

ComputeTaskFuture<BigInteger> futVal = compute.future();
IgniteFuture<BigInteger> futVal = compute.applyAsync(
new ContinuationFibonacciClosure(nodeFilter), n - 1);

fut1 = locMap.putIfAbsent(n - 1, futVal);

Expand All @@ -158,9 +156,8 @@ private static class ContinuationFibonacciClosure implements IgniteClosure<Long,

// If future is not cached in node-local-map, cache it.
if (fut2 == null) {
compute.apply(new ContinuationFibonacciClosure(nodeFilter), n - 2);

ComputeTaskFuture<BigInteger> futVal = compute.<BigInteger>future();
IgniteFuture<BigInteger> futVal = compute.applyAsync(
new ContinuationFibonacciClosure(nodeFilter), n - 2);

fut2 = locMap.putIfAbsent(n - 2, futVal);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,18 @@ public static void main(String[] args) throws IgniteException {

// Auto-close cache at the end of the example.
try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(CACHE_NAME)) {
// Enable asynchronous mode.
IgniteCache<Integer, String> asyncCache = cache.withAsync();

Collection<IgniteFuture<?>> futs = new ArrayList<>();

// Execute several puts asynchronously.
for (int i = 0; i < 10; i++) {
asyncCache.put(i, String.valueOf(i));

futs.add(asyncCache.future());
}
for (int i = 0; i < 10; i++)
futs.add(cache.putAsync(i, String.valueOf(i)));

// Wait for completion of all futures.
for (IgniteFuture<?> fut : futs)
fut.get();

// Execute get operation asynchronously.
asyncCache.get(1);

// Asynchronously wait for result.
asyncCache.<String>future().listen(new IgniteInClosure<IgniteFuture<String>>() {
// Execute get operation asynchronously and wait for result.
cache.getAsync(1).listen(new IgniteInClosure<IgniteFuture<String>>() {
@Override public void apply(IgniteFuture<String> fut) {
System.out.println("Get operation completed [value=" + fut.get() + ']');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ public static void main(String[] args) {

// Start consumers on all cluster nodes.
for (int i = 0; i < NUM_CONSUMERS; i++)
ignite.compute().withAsync().run(new Consumer(reentrantLockName));
ignite.compute().runAsync(new Consumer(reentrantLockName));

// Start producers on all cluster nodes.
for (int i = 0; i < NUM_PRODUCERS; i++)
ignite.compute().withAsync().run(new Producer(reentrantLockName));
ignite.compute().runAsync(new Producer(reentrantLockName));

System.out.println("Master node is waiting for all other nodes to finish...");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ public static void main(String[] args) {

// Start consumers on all cluster nodes.
for (int i = 0; i < NUM_CONSUMERS; i++)
ignite.compute().withAsync().run(new Consumer(semaphoreName));
ignite.compute().runAsync(new Consumer(semaphoreName));

// Start producers on all cluster nodes.
for (int i = 0; i < NUM_PRODUCERS; i++)
ignite.compute().withAsync().run(new Producer(semaphoreName));
ignite.compute().runAsync(new Producer(semaphoreName));

System.out.println("Master node is waiting for all other nodes to finish...");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,12 @@ class FibonacciClosure (
// Group that excludes node with id passed in constructor if others exists.
val prj = if (ignite$.cluster().nodes().size() > 1) ignite$.cluster().forOthers(excludeNode) else ignite$.cluster().forNode(excludeNode)

val comp = ignite$.compute(prj).withAsync()
val comp = ignite$.compute(prj)

// If future is not cached in node-local store, cache it.
// Note recursive execution!
if (fut1 == null) {
comp.apply(new FibonacciClosure(excludeNodeId), n - 1)

val futVal = comp.future[BigInteger]()
val futVal = comp.applyAsync(new FibonacciClosure(excludeNodeId), n - 1)

fut1 = store.putIfAbsent(n - 1, futVal)

Expand All @@ -134,9 +132,7 @@ class FibonacciClosure (

// If future is not cached in node-local store, cache it.
if (fut2 == null) {
comp.apply(new FibonacciClosure(excludeNodeId), n - 2)

val futVal = comp.future[BigInteger]()
val futVal = comp.applyAsync(new FibonacciClosure(excludeNodeId), n - 2)

fut2 = store.putIfAbsent(n - 2, futVal)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.loadtests.direct.singlesplit;

import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCompute;
import org.apache.ignite.IgniteException;
import org.apache.ignite.compute.ComputeTaskFuture;
import org.apache.ignite.configuration.IgniteConfiguration;
Expand Down Expand Up @@ -104,11 +103,8 @@ public void testLoad() throws Exception {
try {
int levels = 20;

IgniteCompute comp = ignite.compute().withAsync();

comp.execute(new SingleSplitTestTask(), levels);

ComputeTaskFuture<Integer> fut = comp.future();
ComputeTaskFuture<Integer> fut = ignite.compute().executeAsync(
new SingleSplitTestTask(), levels);

int res = fut.get();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.ignite.tests.utils;

import org.apache.ignite.IgniteException;
import org.apache.ignite.lang.IgniteAsyncSupport;
import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.lang.IgniteUuid;
Expand Down Expand Up @@ -105,6 +106,11 @@ public class TestTransaction implements Transaction {
// No-op.
}

/** {@inheritDoc} */
@Override public IgniteFuture<Void> commitAsync() throws IgniteException {
return null;
}

/** {@inheritDoc} */
@Override public void close() {
// No-op.
Expand All @@ -129,4 +135,9 @@ public class TestTransaction implements Transaction {
@Override public void rollback() {
// No-op.
}

/** {@inheritDoc} */
@Override public IgniteFuture<Void> rollbackAsync() throws IgniteException {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.Map;
import java.util.UUID;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCompute;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeJobResultPolicy;
Expand Down Expand Up @@ -159,14 +158,9 @@ public static void main(String[] args) {
private static void changeTopology(Ignite parent, int add, int rmv, String type) {
Collection<ComputeTaskFuture<?>> tasks = new ArrayList<>();

IgniteCompute comp = parent.compute().withAsync();

// Start nodes in parallel.
while (add-- > 0) {
comp.execute(ClientStartNodeTask.class, type);

tasks.add(comp.future());
}
while (add-- > 0)
tasks.add(parent.compute().executeAsync(ClientStartNodeTask.class, type));

for (ComputeTaskFuture<?> task : tasks)
task.get();
Expand Down
Loading