private void init() { ClusterNode node = nodes.poll(); GridCacheQueryFutureAdapter<?, ?, R> fut0 = (GridCacheQueryFutureAdapter<?, ?, R>) (node.isLocal() ? qryMgr.queryLocal(bean) : qryMgr.queryDistributed(bean, Collections.singleton(node))); fut0.listen( new IgniteInClosure<IgniteInternalFuture<Collection<R>>>() { @Override public void apply(IgniteInternalFuture<Collection<R>> fut) { try { onDone(fut.get()); } catch (IgniteCheckedException e) { if (F.isEmpty(nodes)) onDone(e); else init(); } } }); fut = fut0; }
/** {@inheritDoc} */ @Override public R next() { return fut.next(); }
/** {@inheritDoc} */ @Override public boolean cancel() throws IgniteCheckedException { return fut.cancel(); }
/** {@inheritDoc} */ @Override public int available() { return fut.available(); }