/** * Returns if the task completed. * * @return {@code true} if the task completed, otherwise {@code false}. */ protected boolean isCompleted() { return completeStateFut.isDone(); }
/** * @return {@code true} If the loader is closed. */ boolean isClosed() { return fut.isDone(); }
/** * @return {@code true} if latch is completed. */ boolean isCompleted() { return complete.isDone(); }
/** */ public boolean finished() { return cpFinishFut.isDone(); } }
/** {@inheritDoc} */ @Override public boolean isDone() { return isDone(state); }
/** */ public boolean started() { return cpBeginFut.isDone(); }
/** * Gets actual topology snapshot for thread lock span. * * @return Topology snapshot or {@code null} if candidate list is empty. */ @Nullable public AffinityTopologyVersion topologyVersion() { return releaseFut.isDone() ? null : topVer; }
/** */ private void onTxDone(Long txCntr, boolean increaseCommittedCntr) { assert initFut.isDone(); synchronized (this) { activeTxs.remove(txCntr); if (increaseCommittedCntr) committedCntr.setIfGreater(txCntr); } }
/** * @param nodeId Sender node ID. * @param metaData Meta data. * @param data Page data. * @param err Error. * @param finished Finished or not. */ public void onPage(@Nullable UUID nodeId, @Nullable List<GridQueryFieldMetadata> metaData, @Nullable Collection<Map<String, Object>> data, @Nullable Throwable err, boolean finished) { if (!metaFut.isDone() && metaData != null) metaFut.onDone(metaData); onPage(nodeId, data, err, finished); }
/** * @param nodeId Sender node ID. * @param metaData Meta data. * @param data Page data. * @param err Error. * @param finished Finished or not. */ public void onPage(@Nullable UUID nodeId, @Nullable List<GridQueryFieldMetadata> metaData, @Nullable Collection<?> data, @Nullable Throwable err, boolean finished) { onPage(nodeId, data, err, finished); if (!metaFut.isDone()) metaFut.onDone(metaData); }
/** {@inheritDoc} */ @Override public boolean onDone(@Nullable Collection<List<Object>> res, @Nullable Throwable err) { if (!metaFut.isDone()) metaFut.onDone(); return super.onDone(res, err); }
/** * Perform initialization routine. * * @return This instance. */ public SchemaOperationWorker start() { if (startGuard.compareAndSet(false, true)) { if (!fut.isDone()) new IgniteThread(this).start(); } return this; }
/** {@inheritDoc} */ @Override public boolean onCancelled() { if (!metaFut.isDone()) metaFut.onDone(); return super.onCancelled(); }
/** * Resets future for subsequent reuse. */ public void reset() { final Object oldState = state; if (oldState == INIT) return; if (!isDone(oldState)) throw new IgniteException("Illegal state"); compareAndSetState(oldState, INIT); }
/** * @param e Error. */ private void onSegmented(Exception e) { rtState.errForClose = e; if (rtState.joined || joinFut.isDone()) { synchronized (stateMux) { connState = ConnectionState.STOPPED; } notifySegmented(); } else joinFut.onDone(e); }
/** {@inheritDoc} */ @Override public MvccSnapshot requestReadSnapshotLocal() { if (!currentCoordinator().local() || !initFut.isDone()) return null; return activeQueries.assignQueryCounter(ctx.localNodeId(), 0L); }
/** {@inheritDoc} */ @Override public void onKernalStop0(boolean cancel) { startLatch.countDown(); // Stop segment check worker. if (segChkWrk != null) { segChkWrk.cancel(); U.join(segChkThread, log); } if (!locJoin.isDone()) locJoin.onDone(new NodeStoppingException("Failed to wait for local node joined event (grid is stopping).")); }
/** {@inheritDoc} */ @Override public MvccSnapshot requestWriteSnapshotLocal() { if (!currentCoordinator().local() || !initFut.isDone()) return null; return assignTxSnapshot(0L, ctx.localNodeId(), false); }