/** * Adds given amount of bytes to the sent bytes counter. * <p> * Note that this method is designed to be called in one thread only. * * @param cnt Number of bytes sent. */ public void bytesSent(int cnt) { bytesSent += cnt; bytesSent0 += cnt; lastSndTime = U.currentTimeMillis(); }
/** * Update last ring message received timestamp. */ private void ringMessageReceived() { lastRingMsgReceivedTime = U.currentTimeMillis(); }
/** * @param metrics New current client metrics. */ void metrics(ClusterMetrics metrics) { lastMetricsUpdateMsgTime = U.currentTimeMillis(); this.metrics = metrics; }
/** {@inheritDoc} */ @Override public long duration() { long endTime = this.endTime; return endTime == 0 ? U.currentTimeMillis() - startTime : endTime - startTime; }
/** * @param writeEntries Write entries. */ public DataRecord(List<DataEntry> writeEntries) { this(writeEntries, U.currentTimeMillis()); }
/** * @param id Timeout ID. * @param timeout Timeout for this object. */ protected GridTimeoutObjectAdapter(IgniteUuid id, long timeout) { this.id = id; long endTime = timeout >= 0 ? U.currentTimeMillis() + timeout : Long.MAX_VALUE; this.endTime = endTime >= 0 ? endTime : Long.MAX_VALUE; }
/** * @param writeEntries Write entries. */ public MvccDataRecord(List<DataEntry> writeEntries) { this(writeEntries, U.currentTimeMillis()); }
/** * @param timeout Timeout. */ MetricsUpdateTimeoutObject(long timeout) { this.timeout = timeout; endTime = U.currentTimeMillis() + timeout; }
/** * Adds given amount ob bytes to the received bytes counter. * <p> * Note that this method is designed to be called in one thread only. * * @param cnt Number of bytes received. */ public void bytesReceived(int cnt) { bytesRcvd += cnt; bytesRcvd0 += cnt; lastRcvTime = U.currentTimeMillis(); }
/** * @param cursor Cursor. * @param iter Iterator. */ Cursor(QueryCursor<List<?>> cursor, Iterator<List<?>> iter) { this.cursor = cursor; this.iter = iter; this.lastAccessTime = U.currentTimeMillis(); }
/** * @param msg Message to add. * @param msgC Message closure (may be {@code null}). */ void add( GridIoMessage msg, @Nullable IgniteRunnable msgC ) { msgs.add(F.t(msg, U.currentTimeMillis(), msgC)); }
/** * */ CrossRingMessageSendState() { failTime = spi.getEffectiveConnectionRecoveryTimeout() + U.currentTimeMillis(); }
/** {@inheritDoc} */ @Override protected boolean onDone(@Nullable R res, @Nullable Throwable err, boolean cancel) { if(super.onDone(res, err, cancel)){ endTime = U.currentTimeMillis(); return true; } return false; } }
/** * Called periodically to clean up the statement cache. */ private void cleanupStatements() { long now = U.currentTimeMillis(); threadConns.values().forEach(set -> set.keySet().forEach(c ->{ if (now - c.statementCache().lastUsage() > stmtTimeout) c.clearStatementCache(); })); } }
/** * * @param sb String builder. * @param ctx Context. */ static void dumpNodeBasicInfo(StringBuilder sb, GridKernalContext ctx) { sb.append("General node info [id=").append(ctx.localNodeId()) .append(", client=").append(ctx.clientNode()) .append(", discoTopVer=").append(ctx.discovery().topologyVersionEx()) .append(", time=").append(formatTime(U.currentTimeMillis())).append(']'); }
/** {@inheritDoc} */ @Override public void run() { updateMetrics(); endTime = U.currentTimeMillis() + timeout; ctx.timeout().addTimeoutObject(this); }
/** {@inheritDoc} */ @Override public long getEstimatedRebalancingFinishTime() { long rate = rebalancingKeysRate.getRate(); return rate <= 0 ? -1L : ((getKeysToRebalanceLeft() / rate) * REBALANCE_RATE_INTERVAL) + U.currentTimeMillis(); }
/** * Gets remaining allowed transaction time. * * @return Remaining transaction time. {@code 0} if timeout isn't specified. {@code -1} if time is out. */ @Override public long remainingTime() { if (timeout() <= 0) return 0; long timeLeft = timeout() - (U.currentTimeMillis() - startTime()); return timeLeft <= 0 ? -1 : timeLeft; }
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); long seed = U.currentTimeMillis(); rnd.setSeed(seed); log.info("Random seed: " + seed); }
/** {@inheritDoc} */ @Override protected void body() { assert job != null; startTime = U.currentTimeMillis(); isStarted = true; // Event notification. evtLsnr.onJobStarted(this); if (!internal && ctx.event().isRecordable(EVT_JOB_STARTED)) recordEvent(EVT_JOB_STARTED, /*no message for success*/null); execute0(true); }