/** {@inheritDoc} */ @Override public String gridName() { return cfg.getGridName(); }
/** * */ TimeoutWorker() { super(ctx.config().getGridName(), "grid-timeout-worker", log); }
/** @throws GridException If registration failed. */ private void registerKernalMBean() throws GridException { try { kernalMBean = U.registerMBean( cfg.getMBeanServer(), cfg.getGridName(), "Kernal", getClass().getSimpleName(), this, GridKernalMBean.class); if (log.isDebugEnabled()) log.debug("Registered kernal MBean: " + kernalMBean); } catch (JMException e) { kernalMBean = null; throw new GridException("Failed to register kernal MBean.", e); } }
/** * @param ctx Kernal context. */ public GridTimeoutProcessor(GridKernalContext ctx) { super(ctx); timeoutWorker = new GridThread(ctx.config().getGridName(), "grid-timeout-worker", new TimeoutWorker()); }
/** * Starts all grids specified within given Spring XML configuration file. If grid with given name * is already started, then exception is thrown. In this case all instances that may * have been started so far will be stopped too. * <p> * Usually Spring XML configuration file will contain only one Grid definition. Note that * Grid configuration bean(s) is retrieved form configuration file by type, so the name of * the Grid configuration bean is ignored. * * @param springCfgPath Spring XML configuration file path or URL. * @param gridName Grid name that will override default. * @return Started grid. If Spring configuration contains multiple grid instances, * then the 1st found instance is returned. * @throws GridException If grid could not be started or configuration * read. This exception will be thrown also if grid with given name has already * been started or Spring XML configuration file is invalid. */ public static Grid start(@Nullable String springCfgPath, @Nullable String gridName) throws GridException { if (springCfgPath == null) { GridConfiguration cfg = new GridConfiguration(); if (cfg.getGridName() == null && !F.isEmpty(gridName)) cfg.setGridName(gridName); return start(cfg); } else return start(springCfgPath, gridName, null); }
/** @throws GridException If registration failed. */ private void registerLocalNodeMBean() throws GridException { GridNodeMetricsMBean mbean = new GridLocalNodeMetrics(ctx.discovery().localNode()); try { locNodeMBean = U.registerMBean( cfg.getMBeanServer(), cfg.getGridName(), "Kernal", mbean.getClass().getSimpleName(), mbean, GridNodeMetricsMBean.class); if (log.isDebugEnabled()) log.debug("Registered local node MBean: " + locNodeMBean); } catch (JMException e) { locNodeMBean = null; throw new GridException("Failed to register local node MBean.", e); } }
@Nullable Map<GridTaskThreadContextKey, Object> thCtx, UUID subjId) { super(ctx.config().getGridName(), "grid-task-worker", ctx.config().getGridLogger());
/** * @param exec Executor service to register. * @param name Property name for executor. * @return Name for created MBean. * @throws GridException If registration failed. */ private ObjectName registerExecutorMBean(ExecutorService exec, String name) throws GridException { assert exec != null; try { ObjectName res = U.registerMBean( cfg.getMBeanServer(), cfg.getGridName(), "Thread Pools", name, new GridExecutorServiceMBeanAdapter(exec), GridExecutorServiceMBean.class); if (log.isDebugEnabled()) log.debug("Registered executor service MBean: " + res); return res; } catch (JMException e) { throw new GridException("Failed to register executor service MBean [name=" + name + ", exec=" + exec + ']', e); } }
assert cfg != null; if (cfg.getGridName() == null && !F.isEmpty(gridName)) cfg.setGridName(gridName);
assert startCtx != null; String name = startCtx.config().getGridName();
VisorBasicConfig cfg = new VisorBasicConfig(); cfg.gridName(c.getGridName()); cfg.ggHome(getProperty(GG_HOME, c.getGridGainHome())); cfg.localHost(getProperty(GG_LOCAL_HOST, c.getLocalHost()));
assert F.eq(name, cfg.getGridName()); myCfg.setGridName(cfg.getGridName()); "pub-" + cfg.getGridName(), DFLT_PUBLIC_CORE_THREAD_CNT, DFLT_PUBLIC_MAX_THREAD_CNT, "sys-" + cfg.getGridName(), DFLT_SYSTEM_CORE_THREAD_CNT, DFLT_SYSTEM_MAX_THREAD_CNT, "mgmt-" + cfg.getGridName(), DFLT_MGMT_THREAD_CNT, DFLT_MGMT_THREAD_CNT, "p2p-" + cfg.getGridName(), DFLT_P2P_THREAD_CNT, DFLT_P2P_THREAD_CNT, "ggfs-" + cfg.getGridName(), procCnt, procCnt, "dr-" + cfg.getGridName(), DFLT_PUBLIC_CORE_THREAD_CNT, DFLT_PUBLIC_MAX_THREAD_CNT, "rest-" + cfg.getGridName(),
/** * Creates resources processor. * * @param ctx Kernal context. */ public GridResourceProcessor(GridKernalContext ctx) { super(ctx); gridInjector = new GridResourceBasicInjector<>(ctx.grid()); ggHomeInjector = new GridResourceBasicInjector<>(ctx.config().getGridGainHome()); ggNameInjector = new GridResourceBasicInjector<>(ctx.config().getGridName()); locHostInjector = new GridResourceBasicInjector<>(ctx.config().getLocalHost()); mbeanSrvInjector = new GridResourceBasicInjector<>(ctx.config().getMBeanServer()); marshInjector = new GridResourceBasicInjector<>(ctx.config().getMarshaller()); execInjector = new GridResourceBasicInjector<Executor>(ctx.config().getExecutorService()); nodeIdInjector = new GridResourceBasicInjector<>(ctx.config().getNodeId()); logInjector = new GridResourceLoggerInjector(ctx.config().getGridLogger()); srvcInjector = new GridResourceServiceInjector(ctx.grid()); addrsRslvrInjector = new GridResourceBasicInjector<>(ctx.config().getAddressResolver()); }
public void start(final GridConfiguration cfg, @Nullable ExecutorService utilityCachePool, GridAbsClosure errHnd) throws GridException { gw.compareAndSet(null, new GridKernalGatewayImpl(cfg.getGridName())); gridName = cfg.getGridName();
ggHome = cfg.getGridGainHome(); ggWork = cfg.getWorkDirectory(); gridName = cfg.getGridName(); ggfsCfg = cfg.getGgfsConfiguration(); ggfsSvc = cfg.getGgfsExecutorService();