/** * @return Grid configuration. */ public IgniteConfiguration gridConfig() { return ctx.config(); }
/** {@inheritDoc} */ @Override public void onActivate(GridKernalContext kctx) throws IgniteCheckedException { if (log.isDebugEnabled()) log.debug("Activate service processor [nodeId=" + ctx.localNodeId() + " topVer=" + ctx.discovery().topologyVersionEx() + " ]"); busyLock = new GridSpinBusyLock(); depExe = Executors.newSingleThreadExecutor(new IgniteThreadFactory(ctx.igniteInstanceName(), "srvc-deploy", oomeHnd)); start(); onKernalStart0(); }
/** {@inheritDoc} */ @Override public <T> T unwrap(Class<T> cls) { if (cls.isAssignableFrom(Ignite.class)) return (T)cctx.kernalContext().grid(); else if (cls.isAssignableFrom(GridCacheContext.class)) return (T)cctx; else if (cls.isAssignableFrom(getClass())) return cls.cast(this); throw new IllegalArgumentException("Unwrapping to class is not supported: " + cls); }
/** * @param ctx Kernal context. * @param log Logger. * @param prc Mvcc processor. */ VacuumScheduler(GridKernalContext ctx, IgniteLogger log, MvccProcessorImpl prc) { super(ctx.igniteInstanceName(), "vacuum-scheduler", log); this.interval = ctx.config().getMvccVacuumFrequency(); this.prc = prc; }
/** * Handles case when all server nodes have left the grid. */ private void onAllServersLeft() { assert ctx.clientNode(); completeError(new ClusterTopologyServerNotFoundException("Failed to resolve coordinator to continue services " + "deployment process: [locId=" + ctx.localNodeId() + "client=" + ctx.clientNode() + "evt=" + evt + ']')); }
/** * * @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(']'); }
/** * @return Cache object context. */ private CacheObjectContext objectContext() { if (ctx == null) return null; return ctx.cache().internalCache(cacheName).context().cacheObjectContext(); }
/** * Constructor. */ protected FragmentizerCoordinator() { super(igfsCtx.kernalContext().igniteInstanceName(), "fragmentizer-coordinator", igfsCtx.kernalContext().log(IgfsFragmentizerManager.class)); igfsCtx.kernalContext().event().addLocalEventListener(this, EVT_NODE_LEFT, EVT_NODE_FAILED); igfsCtx.kernalContext().io().addMessageListener(topic, this); }
/** * @param mgr Database shared manager. * @throws IgniteCheckedException If failed. */ private void txLogPageStoreInit(IgniteCacheDatabaseSharedManager mgr) throws IgniteCheckedException { assert CU.isPersistenceEnabled(ctx.config()); //noinspection ConstantConditions ctx.cache().context().pageStore().initialize(TX_LOG_CACHE_ID, 1, TX_LOG_CACHE_NAME, mgr.dataRegion(TX_LOG_CACHE_NAME).memoryMetrics()); }
/** {@inheritDoc} */ @Override public void onActivate(GridKernalContext ctx) { if (log.isDebugEnabled()) log.debug("Activating data structure processor [nodeId=" + ctx.localNodeId() + " topVer=" + ctx.discovery().topologyVersionEx() + " ]"); initFailed = false; qryIdMap.clear(); ctx.event().addLocalEventListener(lsnr, EVT_NODE_LEFT, EVT_NODE_FAILED); restoreStructuresState(ctx); onKernalStart0(); }
@Override public Object call() throws Exception { grid(0).context().authentication().updateUser("test", "test"); return null; } }, IgniteException.class,
/** {@inheritDoc} */ @Override public RegisterStatus register(UUID nodeId, UUID routineId, GridKernalContext ctx) throws IgniteCheckedException { final IgniteClosure trans = getTransformer(); if (trans != null) ctx.resource().injectGeneric(trans); if (locTransLsnr != null) { ctx.resource().injectGeneric(locTransLsnr); asyncCb = U.hasAnnotation(locTransLsnr, IgniteAsyncCallback.class); } return super.register(nodeId, routineId, ctx); }
/** * Constructor. * * @param ctx Context. */ public RunningQueryManager(GridKernalContext ctx) { localNodeId = ctx.localNodeId(); histSz = ctx.config().getSqlQueryHistorySize(); qryHistTracker = new QueryHistoryTracker(histSz); }
/** * @param nodeId Node ID to send message to. * @param msg Message to send. * @throws IgniteCheckedException If send failed. */ private void send0(UUID nodeId, Object msg) throws IgniteCheckedException { ClusterNode node = ctx.kernalContext().discovery().node(nodeId); if (msg instanceof Message) ctx.kernalContext().io().sendToGridTopic(node, GridTopic.TOPIC_HADOOP_MSG, (Message)msg, GridIoPolicy.PUBLIC_POOL); else ctx.kernalContext().io().sendUserMessage(F.asList(node), msg, GridTopic.TOPIC_HADOOP, false, 0, false); }
/** {@inheritDoc} */ @Override public void stop(boolean cancel) throws IgniteCheckedException { if (ctx.config().isDaemon()) return; ctx.io().removeMessageListener(TOPIC_CONTINUOUS); for (IgniteThread thread : bufCheckThreads.values()) { U.interrupt(thread); U.join(thread); } if (log.isDebugEnabled()) log.debug("Continuous processor stopped."); }
/** * Constructor. */ OrderedBatchWorker() { super(ctx.igniteInstanceName(), "ordered-batch", OdbcRequestHandler.this.log); }
/** {@inheritDoc} */ @Override public void onDeActivate(GridKernalContext kctx) { if (log.isDebugEnabled()) log.debug("DeActivate service processor [nodeId=" + ctx.localNodeId() + " topVer=" + ctx.discovery().topologyVersionEx() + " ]"); cancelFutures(depFuts, new IgniteCheckedException("Failed to deploy service, cluster in active.")); cancelFutures(undepFuts, new IgniteCheckedException("Failed to undeploy service, cluster in active.")); onKernalStop(true); }
/** * @return Grid IO manager. */ public GridIoManager gridIO() { return kernalCtx.io(); }
/** * Constructor. */ protected FragmentizerWorker() { super(igfsCtx.kernalContext().igniteInstanceName(), "fragmentizer-worker", igfsCtx.kernalContext().log(IgfsFragmentizerManager.class)); }