/** * @return Timeout for initial map exchange before preloading. We make it {@code 4} times * bigger than network timeout by default. */ public long preloadExchangeTimeout() { long t1 = gridConfig().getNetworkTimeout() * 4; long t2 = gridConfig().getNetworkTimeout() * gridConfig().getCacheConfiguration().length * 2; long timeout = Math.max(t1, t2); return timeout < 0 ? Long.MAX_VALUE : timeout; }
/** * @param plc Communication policy. * @param topic Communication topic. * @param nodeId Node ID. * @param timeout Timeout. * @param skipOnTimeout Whether message can be skipped on timeout. * @param msg Message to add immediately. */ GridCommunicationMessageSet(GridIoPolicy plc, Object topic, UUID nodeId, long timeout, boolean skipOnTimeout, GridIoMessage msg) { assert nodeId != null; assert topic != null; assert plc != null; assert msg != null; this.plc = plc; this.nodeId = nodeId; this.topic = topic; this.timeout = timeout == 0 ? ctx.config().getNetworkTimeout() : timeout; this.skipOnTimeout = skipOnTimeout; endTime = endTime(timeout); timeoutId = GridUuid.randomUuid(); lastTs = U.currentTimeMillis(); msgs.add(F.t(msg, lastTs)); }
/** {@inheritDoc} */ @Override public void sendOrdered(@Nullable Object topic, Object msg, long timeout) throws GridException { A.notNull(msg, "msg"); guard(); try { Collection<GridNode> snapshot = prj.nodes(); if (snapshot.isEmpty()) throw U.emptyTopologyException(); if (timeout == 0) timeout = ctx.config().getNetworkTimeout(); ctx.io().sendUserMessage(snapshot, msg, topic, true, timeout); } finally { unguard(); } }
/** * Checks if future timeout happened. */ private void scheduleAtomicFutureRecheck() { final long timeout = ctx.kernalContext().config().getNetworkTimeout(); ctx.time().addTimeoutObject(new GridTimeoutObjectAdapter(timeout * 2) { @Override public void onTimeout() { boolean leave = false; try { ctx.gate().enter(); leave = true; for (GridCacheAtomicFuture fut : ctx.mvcc().atomicFutures()) fut.checkTimeout(timeout); } catch (IllegalStateException ignored) { if (log.isDebugEnabled()) log.debug("Will not check pending atomic update futures for timeout (Grid is stopping)."); } finally { if (leave) ctx.gate().leave(); } } }); }
for (SharedDeployment dep : deps) { if (!dep.undeployed() && !dep.pendingUndeploy()) { long undeployTimeout = ctx.config().getNetworkTimeout();
cctx.gridConfig().getNetworkTimeout() * cctx.gridConfig().getCacheConfiguration().length) { @Override public void onTimeout() { if (isDone())
long netTimeout = ctx.config().getNetworkTimeout();
long netTimeout = ctx.config().getNetworkTimeout();
ctx.kernalContext().task().setThreadContext(TC_TIMEOUT, gridCfg.getNetworkTimeout());
cfg.jmxRemote(g.isJmxRemoteEnabled()); cfg.restart(g.isRestartEnabled()); cfg.networkTimeout(c.getNetworkTimeout()); cfg.licenseUrl(c.getLicenseUrl()); cfg.logger(compactClass(c.getGridLogger()));
scheduleUndeploy(d, ctx.config().getNetworkTimeout()); long time = U.currentTimeMillis() - d.timestamp(); if (time < ctx.config().getNetworkTimeout()) { undeployTimeout = ctx.config().getNetworkTimeout() - time;
/** {@inheritDoc} */ @Override public void start() throws GridException { GridProtocolHandler.registerDeploymentManager(this); assertParameter(ctx.config().getDeploymentMode() != null, "ctx.config().getDeploymentMode() != null"); if (ctx.config().isPeerClassLoadingEnabled()) assertParameter(ctx.config().getNetworkTimeout() > 0, "networkTimeout > 0"); startSpi(); comm = new GridDeploymentCommunication(ctx, log); comm.start(); locStore = new GridDeploymentLocalStore(getSpi(), ctx, comm); ldrStore = new GridDeploymentPerLoaderStore(getSpi(), ctx, comm); verStore = new GridDeploymentPerVersionStore(getSpi(), ctx, comm); locStore.start(); ldrStore.start(); verStore.start(); if (log.isDebugEnabled()) { log.debug("Local deployment: " + locDep); log.debug(startInfo()); } }
partReleaseFut.get(2 * cctx.gridConfig().getNetworkTimeout(), TimeUnit.MILLISECONDS);
ackTimeout = ctx.config().getNetworkTimeout();
myCfg.setPeerClassLoadingEnabled(cfg.isPeerClassLoadingEnabled()); myCfg.setDeploymentMode(cfg.getDeploymentMode()); myCfg.setNetworkTimeout(cfg.getNetworkTimeout()); myCfg.setClockSyncSamples(cfg.getClockSyncSamples()); myCfg.setClockSyncFrequency(cfg.getClockSyncFrequency());
A.notNull(cfg.getIndexingSpi(), "cfg.getIndexingSpi()"); A.ensure(cfg.getNetworkTimeout() > 0, "cfg.getNetworkTimeout() > 0"); A.ensure(cfg.getNetworkSendRetryDelay() > 0, "cfg.getNetworkSendRetryDelay() > 0"); A.ensure(cfg.getNetworkSendRetryCount() > 0, "cfg.getNetworkSendRetryCount() > 0");
mgmtSvc = cfg.getManagementExecutorService(); mgmtSvcShutdown = cfg.getManagementExecutorServiceShutdown(); netTimeout = cfg.getNetworkTimeout(); nodeId = cfg.getNodeId(); p2pEnabled = cfg.isPeerClassLoadingEnabled();