/** * Loads all grid configurations specified within given Spring XML configuration file. * <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 springCfgUrl Spring XML configuration file path or URL. This cannot be {@code null}. * @return Tuple containing all loaded configurations and Spring context used to load them. * @throws IgniteCheckedException 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 IgniteBiTuple<Collection<IgniteConfiguration>, ? extends GridSpringResourceContext> loadConfigurations(URL springCfgUrl) throws IgniteCheckedException { IgniteSpringHelper spring = SPRING.create(false); return spring.loadConfigurations(springCfgUrl); }
/** * @param ctx Kernal context. */ public GridQueryProcessor(GridKernalContext ctx) throws IgniteCheckedException { super(ctx); if (idxCls != null) { idx = U.newInstance(idxCls); idxCls = null; } else idx = INDEXING.inClassPath() ? U.<GridQueryIndexing>newInstance(INDEXING.className()) : null; valCtx = new CacheQueryObjectValueContext(ctx); ioLsnr = new GridMessageListener() { @Override public void onMessage(UUID nodeId, Object msg, byte plc) { if (msg instanceof SchemaOperationStatusMessage) { SchemaOperationStatusMessage msg0 = (SchemaOperationStatusMessage)msg; msg0.senderNodeId(nodeId); processStatusMessage(msg0); } else U.warn(log, "Unsupported IO message: " + msg); } }; }
/** * Creates component. * * @param ctx Kernal context. * @param mandatory If the component is mandatory. * @return Created component. * @throws IgniteCheckedException If failed. */ public <T> T createIfInClassPath(GridKernalContext ctx, boolean mandatory) throws IgniteCheckedException { String cls = clsName; try { Class.forName(cls); } catch (ClassNotFoundException e) { if (mandatory) throw componentException(e); cls = noOpClsName; } return create0(ctx, cls); }
"(set IgniteConfiguration.peerClassLoadingEnabled to \"false\")."); HadoopProcessorAdapter res = IgniteComponentType.HADOOP.createIfInClassPath(ctx, true); cmp = IgniteComponentType.HADOOP.createIfInClassPath(ctx, false); cmp = IgniteComponentType.HADOOP.create(ctx, true);
for (IgniteComponentType compType : IgniteComponentType.values()) { MessageFactory f = compType.messageFactory();
/** * Initialize internal cache names */ private void initializeInternalCacheNames() { FileSystemConfiguration[] igfsCfgs = ctx.grid().configuration().getFileSystemConfiguration(); if (igfsCfgs != null) { for (FileSystemConfiguration igfsCfg : igfsCfgs) { internalCaches.add(igfsCfg.getMetaCacheConfiguration().getName()); internalCaches.add(igfsCfg.getDataCacheConfiguration().getName()); } } if (IgniteComponentType.HADOOP.inClassPath()) internalCaches.add(CU.SYS_CACHE_HADOOP_MR); }
/** * Creates component. * * @param noOp No-op flag. * @return Created component. * @throws IgniteCheckedException If failed. */ public <T> T create(boolean noOp) throws IgniteCheckedException { return create0(null, noOp ? noOpClsName : clsName); }
/** * First tries to find main component class, if it is not found creates no-op implementation. * * @param ctx Kernal context. * @return Created component or no-op implementation. * @throws IgniteCheckedException If failed. */ public <T> T createOptional(GridKernalContext ctx) throws IgniteCheckedException { return createOptional0(ctx); }
/** * Creates component instance. * * @param ctx Kernal context. * @param clsName Component class name. * @return Component instance. * @throws IgniteCheckedException If failed. */ private <T> T create0(@Nullable GridKernalContext ctx, String clsName) throws IgniteCheckedException { try { Class<?> cls = Class.forName(clsName); if (ctx == null) { Constructor<?> ctor = cls.getConstructor(); return (T)ctor.newInstance(); } else { Constructor<?> ctor = cls.getConstructor(GridKernalContext.class); return (T)ctor.newInstance(ctx); } } catch (Throwable e) { throw componentException(e); } }
PartitionsEvictManager evict = new PartitionsEvictManager(); CacheJtaManagerAdapter jta = JTA.createOptional();
"(set IgniteConfiguration.peerClassLoadingEnabled to \"false\")."); HadoopProcessorAdapter res = IgniteComponentType.HADOOP.createIfInClassPath(ctx, true); cmp = IgniteComponentType.HADOOP.createIfInClassPath(ctx, false); cmp = IgniteComponentType.HADOOP.create(ctx, true);
for (IgniteComponentType compType : IgniteComponentType.values()) { MessageFactory f = compType.messageFactory();
if (IgniteComponentType.HADOOP.inClassPath()) cacheCfgs.add(CU.hadoopSystemCache());
/** * Creates component. * * @param ctx Kernal context. * @param noOp No-op flag. * @return Created component. * @throws IgniteCheckedException If failed. */ public <T> T create(GridKernalContext ctx, boolean noOp) throws IgniteCheckedException { return create0(ctx, noOp ? noOpClsName : clsName); }
/** * First tries to find main component class, if it is not found creates no-op implementation. * * @return Created component or no-op implementation. * @throws IgniteCheckedException If failed. */ public <T> T createOptional() throws IgniteCheckedException { return createOptional0(null); }
throw componentException(e);
PartitionsEvictManager evict = new PartitionsEvictManager(); CacheJtaManagerAdapter jta = JTA.createOptional();
/** * Loads all grid configurations specified within given input stream. * <p> * Usually Spring XML input stream will contain only one Grid definition. Note that * Grid configuration bean(s) is retrieved form configuration input stream by type, so the name of * the Grid configuration bean is ignored. * * @param springCfgStream Input stream contained Spring XML configuration. This cannot be {@code null}. * @return Tuple containing all loaded configurations and Spring context used to load them. * @throws IgniteCheckedException 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 IgniteBiTuple<Collection<IgniteConfiguration>, ? extends GridSpringResourceContext> loadConfigurations(InputStream springCfgStream) throws IgniteCheckedException { IgniteSpringHelper spring = SPRING.create(false); return spring.loadConfigurations(springCfgStream); }
/** * Creates component. * * @param ctx Kernal context. * @param mandatory If the component is mandatory. * @return Created component. * @throws IgniteCheckedException If failed. */ public <T> T createIfInClassPath(GridKernalContext ctx, boolean mandatory) throws IgniteCheckedException { String cls = clsName; try { Class.forName(cls); } catch (ClassNotFoundException e) { if (mandatory) throw componentException(e); cls = noOpClsName; } return create0(ctx, cls); }
/** * @param ctx Kernal context. */ public GridQueryProcessor(GridKernalContext ctx) throws IgniteCheckedException { super(ctx); if (idxCls != null) { idx = U.newInstance(idxCls); idxCls = null; } else idx = INDEXING.inClassPath() ? U.<GridQueryIndexing>newInstance(INDEXING.className()) : null; valCtx = new CacheQueryObjectValueContext(ctx); ioLsnr = new GridMessageListener() { @Override public void onMessage(UUID nodeId, Object msg, byte plc) { if (msg instanceof SchemaOperationStatusMessage) { SchemaOperationStatusMessage msg0 = (SchemaOperationStatusMessage)msg; msg0.senderNodeId(nodeId); processStatusMessage(msg0); } else U.warn(log, "Unsupported IO message: " + msg); } }; }