/** {@inheritDoc} */ @Override public IgniteConfiguration apply(IgniteConfiguration igniteCfg) { assert igniteCfg != null; IgniteConfiguration igniteCfg0 = new IgniteConfiguration(igniteCfg); apply0(igniteCfg0); return igniteCfg0; }
/** * @return Ignite configuration. */ private IgniteConfiguration configuration() { return new IgniteConfiguration(); }
/** {@inheritDoc} */ @Override public void afterSingletonsInstantiated() { if (cfg == null) cfg = new IgniteConfiguration(); try { g = IgniteSpring.start(cfg, appCtx); } catch (IgniteCheckedException e) { throw new IgniteException("Failed to start IgniteSpringBean", e); } }
/** * Create instance of {@link BinaryMarshaller} suitable for use * without starting a grid upon an empty {@link IgniteConfiguration}. * * @return Binary marshaller. * @throws IgniteCheckedException if failed. */ protected BinaryMarshaller createStandaloneBinaryMarshaller() throws IgniteCheckedException { return createStandaloneBinaryMarshaller(new IgniteConfiguration()); }
/** * @return Ignite config. */ @Override public IgniteConfiguration igniteConfiguration() { IgniteConfiguration config = new IgniteConfiguration(); config.setIgniteInstanceName("testGrid"); return config; }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration() throws Exception { IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setDiscoverySpi(new TcpDiscoverySpi()); return cfg; }
/** * @param log Logger to use in context config. */ public GridTestKernalContext(IgniteLogger log) { this(log, new IgniteConfiguration()); try { add(new IgnitePluginProcessor(this, config(), Collections.<PluginProvider>emptyList())); } catch (IgniteCheckedException e) { throw new IllegalStateException("Must not fail for empty plugins list.", e); } }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setIgniteInstanceName(igniteInstanceName); if (igniteInstanceName.equals(getTestIgniteInstanceName(1))) cfg.setClientMode(true); return cfg; }
@Override public void run() { IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setIgniteInstanceName("test1"); try { G.start(cfg); } finally { X.println("States: " + states); } } }));
private GridKernalContext newContext() throws IgniteCheckedException { IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setIgniteHome(igniteHome); cfg.setClientMode(false); return new GridTestKernalContext(rootLog.getLogger(OptimizedMarshallerEnumSelfTest.class), cfg); }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); discoSpi.setIpFinder(sharedStaticIpFinder); IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setDiscoverySpi(discoSpi); cfg.setIgniteInstanceName(igniteInstanceName); return cfg; }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration(), new NullLogger()); marsh = new BinaryMarshaller(); IgniteConfiguration iCfg = new IgniteConfiguration(); BinaryConfiguration bCfg = new BinaryConfiguration(); bCfg.setTypeConfigurations(Arrays.asList(new BinaryTypeConfiguration(TestObject.class.getName()))); bCfg.setCompactFooter(compactFooter()); iCfg.setBinaryConfiguration(bCfg); marsh.setContext(new MarshallerContextTestImpl(null)); IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg); }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration() { TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder() .setAddresses(Collections.singletonList("127.0.0.1:47500..47509")); return new IgniteConfiguration() .setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(ipFinder)) .setPeerClassLoadingEnabled(true); }
@Override public Object call() throws Exception { final CacheConfiguration cfg = cacheConfig("InSensitiveCache", true, Integer.class, Integer.class) .setSqlSchema("InsensitiveCache"); final CacheConfiguration collisionCfg = cacheConfig("InsensitiveCache", true, Integer.class, Integer.class) .setSqlSchema("Insensitivecache"); IgniteConfiguration icfg = new IgniteConfiguration() .setLocalHost("127.0.0.1") .setCacheConfiguration(cfg, collisionCfg); Ignition.start(icfg); return null; } }, IgniteException.class, "Duplicate index name");
@Override public Object call() throws Exception { final CacheConfiguration cfg = cacheConfig("cache1", true, Integer.class, Fact.class) .setSqlSchema("TEST_SCHEMA"); final CacheConfiguration collisionCfg = cacheConfig("cache2", true, Integer.class, Fact.class) .setSqlSchema("TEST_SCHEMA"); IgniteConfiguration icfg = new IgniteConfiguration() .setLocalHost("127.0.0.1") .setCacheConfiguration(cfg, collisionCfg); Ignition.start(icfg); return null; } }, IgniteException.class, "Failed to register query type");
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { innerLog = new InnerLogger(); IgniteConfiguration iCfg = new IgniteConfiguration(); iCfg.setClientMode(false); ctx = new GridTestKernalContext(innerLog, iCfg) { @Override public IgniteLogger log(Class<?> cls) { return innerLog; } }; ctx.setSystemExecutorService(Executors.newFixedThreadPool(THREADS)); ctx.add(new PoolProcessor(ctx)); ctx.add(new GridClosureProcessor(ctx)); }
/** * @throws Exception If failed. */ @Test public void testDefaultPoolSize() throws Exception { Ignite ignite = startGrid("grid", new IgniteConfiguration()); IgniteConfiguration cfg = ignite.configuration(); assertEquals(IgniteConfiguration.DFLT_PUBLIC_THREAD_CNT, cfg.getPublicThreadPoolSize()); assertEquals(IgniteConfiguration.DFLT_PUBLIC_THREAD_CNT, cfg.getServiceThreadPoolSize()); }
/** * @throws Exception If failed. */ @Test public void testCustomPoolSize() throws Exception { Ignite ignite = startGrid("grid", new IgniteConfiguration().setServiceThreadPoolSize(42)); IgniteConfiguration cfg = ignite.configuration(); assertEquals(IgniteConfiguration.DFLT_PUBLIC_THREAD_CNT, cfg.getPublicThreadPoolSize()); assertEquals(42, cfg.getServiceThreadPoolSize()); }
/** * @throws Exception If failed. */ @Test public void testInheritedPoolSize() throws Exception { Ignite ignite = startGrid("grid", new IgniteConfiguration().setPublicThreadPoolSize(42)); IgniteConfiguration cfg = ignite.configuration(); assertEquals(42, cfg.getPublicThreadPoolSize()); assertEquals(42, cfg.getServiceThreadPoolSize()); }
/** * @return Binary marshaller. * @throws IgniteCheckedException if failed. */ private BinaryMarshaller binaryMarshaller() throws IgniteCheckedException { IgniteConfiguration iCfg = new IgniteConfiguration(); BinaryConfiguration bCfg = new BinaryConfiguration(); iCfg.setBinaryConfiguration(bCfg); BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), iCfg, new NullLogger()); BinaryMarshaller marsh = new BinaryMarshaller(); marsh.setContext(new MarshallerContextTestImpl(null)); IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg); return marsh; }