/** * Initializes the factory with provided a configuration under {@code springCfgPath} that is used to start up * an underlying {@link Ignite} instance. * * @param springCfgPath A path to Ignite configuration. */ public IgniteRepositoryFactory(String springCfgPath) { this.ignite = Ignition.start(springCfgPath); }
/** * Formats "TF_CLUSTER" variable to be passed into user script. * * @return Formatted "TF_CLUSTER" variable to be passed into user script. */ private String formatTfClusterVar() { return clusterSpec.format(Ignition.ignite()); }
List<Ignite> grids = Ignition.allGrids(); return; Ignition.setClientMode(true); ignite = Ignition.start(); } else { ignite = Ignition.start(configuration);
Ignition.start(config("server1", false, false)); Ignition.start(config("server2", false, false)); Ignition.start(config("client1", true, false)); Ignition.start(config("client2", true, false)); Ignition.start(config("client3", true, false)); Ignition.start(config("client4", true, true)); Ignition.stop("client1", true); Ignition.stop("client2", true); Ignition.stop("client3", true); Ignition.stop("client4", true); Ignition.stop("server1", true); Ignition.stop("server2", true);
/** * @param args Args. * @throws Exception If failed. */ public static void main(String[] args) throws Exception { Ignition.start("modules/core/src/test/config/load/dsi-49-server-production.xml"); IgniteCache<Long, Long> cache = Ignition.ignite("dsi").cache("PARTITIONED_CACHE"); stats(); for (int i = 0; i < 5000000; i++) { long t0 = System.currentTimeMillis(); cnt.incrementAndGet(); cache.get(id.incrementAndGet()); latency.addAndGet(System.currentTimeMillis() - t0); } System.out.println("Finished test."); if (t != null) { t.interrupt(); t.join(); } }
Ignition.setClientMode(Boolean.getBoolean("clientMode")); Ignite ignite = Ignition.start(System.getProperty("cfg", "default-config.xml")); System.err.println("Wormup error"); ex.printStackTrace(System.err); Ignition.stop(false); return; Ignition.stop(false);
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { startGridsMultiThreaded(3, false); Ignition.setClientMode(true); try { startGrid(CLIENT); } finally { Ignition.setClientMode(false); } }
/** {@inheritDoc} */ @Override public void close() throws IgniteException { Ignition.stop(igniteInstanceName, true); }
/** * Creates instance of the HadoopIgfsInProcWithIgniteRefsCount by IGFS name. * * @param igfsName Target IGFS name. * @param log Log. * @param userName User name. * @return HadoopIgfsInProcWithIgniteRefsCount instance. {@code null} if the IGFS not fount in the current VM. */ public static HadoopIgfsInProc create(String igfsName, Log log, String userName) { synchronized (REF_CTR_MUX) { for (Ignite ignite : Ignition.allGrids()) { HadoopIgfsInProc delegate = create0(ignite, igfsName, log, userName); if (delegate != null) return delegate; } } return null; }
/** * Starts streamer. * * @throws IgniteException If failed. */ @Override public void open(Configuration parameter) { A.notNull(igniteCfgFile, "Ignite config file"); A.notNull(cacheName, "Cache name"); try { // if an ignite instance is already started in same JVM then use it. this.ignite = Ignition.ignite(); } catch (IgniteIllegalStateException e) { this.ignite = Ignition.start(igniteCfgFile); } this.ignite.getOrCreateCache(cacheName); this.log = this.ignite.log(); this.streamer = this.ignite.dataStreamer(cacheName); this.streamer.autoFlushFrequency(autoFlushFrequency); this.streamer.allowOverwrite(allowOverwrite); stopped = false; }
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { startGridsMultiThreaded(3); try { Ignition.setClientMode(true); startGrid(); } finally { Ignition.setClientMode(false); } }
/** * Stop single instance. * * @param igniteInstanceName Ignite instance name, * @param cancel Cancel flag. * @return {@code True} if instance was found and stopped. */ public static synchronized boolean stop(@Nullable String igniteInstanceName, boolean cancel) { if (Ignition.stop(igniteInstanceName, cancel)) { PlatformProcessor old = instances.remove(igniteInstanceName); assert old != null; return true; } else return false; }
/** * Ensure index is used in plan. * * @param idxName Index name. * @param sql SQL. * @param args Arguments. */ protected static void assertIndexUsed(String idxName, String sql, Object... args) { for (Ignite node : Ignition.allGrids()) assertIndexUsed((IgniteEx)node, idxName, sql, args); }
/** * Initializes the factory with provided a configuration under {@code springCfgPath} that is used to start up * an underlying {@link Ignite} instance. * * @param springCfgPath A path to Ignite configuration. */ public IgniteRepositoryFactory(String springCfgPath) { this.ignite = Ignition.start(springCfgPath); }
public static void main(String[] args) { try (Ignite ignite = Ignition.start(defaultIgniteCfg("hello-world"))) { IgniteRunnable task = new IgniteRunnable() { private static final long serialVersionUID = 787726700536869271L; @IgniteInstanceResource private transient Ignite ignite; @Override public void run() { System.out.println("Hello Gaurav Bytes from: " + ignite.name()); } }; ignite.compute().run(task); } Ignition.stop(true); } }
private void startIgnite(IgniteConfiguration conf) { try { cacheManager = (IgniteEx) Ignition.ignite( gridName ); } catch (IgniteIllegalStateException iise) { // not found, then start conf.setIgniteInstanceName( gridName ); cacheManager = (IgniteEx) Ignition.start( conf ); if ( conf.getPersistentStoreConfiguration() != null && !conf.isClientMode() ) { cacheManager.active( true ); } stopOnExit = true; } }
/** * Formats "TF_CHIEF_SERVER" variable to be passed into user script. * * @return Formatted "TF_CHIEF_SERVER" variable to be passed into user script. */ private String formatTfChiefServerVar() { List<TensorFlowServerAddressSpec> tasks = clusterSpec.getJobs().get(TensorFlowClusterResolver.CHIEF_JOB_NAME); if (tasks == null || tasks.size() != 1) throw new IllegalStateException("TensorFlow cluster specification should contain exactly one chief task"); TensorFlowServerAddressSpec addrSpec = tasks.iterator().next(); return "grpc://" + addrSpec.format(Ignition.ignite()); }
/** {@inheritDoc} */ @Override public void init(long dataPtr) { final PlatformInputStream input = new PlatformExternalMemory(null, dataPtr).input(); Ignition.setClientMode(input.readBoolean()); processInput(input); }