Java Code Examples for org.apache.ignite.lang.IgniteFuture#isDone()

The following examples show how to use org.apache.ignite.lang.IgniteFuture#isDone() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SnapshotMXBeanImpl.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override public void createSnapshot(String snpName) {
    IgniteFuture<Void> fut = mgr.createSnapshot(snpName);

    if (fut.isDone())
        fut.get();
}
 
Example 2
Source File: VisorCacheClearTask.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * @param fut Future to listen.
 * @return {@code true} If future was not completed and this job should holdCC.
 */
private boolean callAsync(IgniteFuture fut) {
    if (fut.isDone())
        return false;

    jobCtx.holdcc();

    fut.listen(lsnr);

    return true;
}
 
Example 3
Source File: IgniteGetFromComputeBenchmark.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public boolean test(Map<Object, Object> ctx) throws Exception {
    IgniteFuture fut = invokeFut.get();

    if (fut == null || fut.isDone()) {
        Set<Integer> keys = new TreeSet<>();

        for (int i = 0; i < 3; i++)
            keys.add(nextRandom(args.range()));

        asyncCache.invokeAll(keys, new SlowEntryProcessor(0));

        invokeFut.set(asyncCache.future());
    }

    int key = nextRandom(args.range());

    compute.affinityCall(CACHE_NAME, key, new GetClosure(key));

    return true;
}