/** {@inheritDoc} */ @Override public <K, V> IgniteCache<K, V> getOrCreateCache(CacheConfiguration<K, V> cacheCfg) { checkIgnite(); return g.getOrCreateCache(cacheCfg); }
/** {@inheritDoc} */ @Override public <K, V> IgniteCache<K, V> getOrCreateCache(String cacheName) { checkIgnite(); return g.getOrCreateCache(cacheName); }
/** {@inheritDoc} */ @Override protected Object getTargetRepository(RepositoryInformation metadata) { return getTargetRepositoryViaReflection(metadata, ignite.getOrCreateCache(repoToCache.get(metadata.getRepositoryInterface()))); }
@Override public Object call() throws Exception { int idx = cnt.getAndIncrement(); try { CacheConfiguration cfg = new CacheConfiguration(DYNAMIC_CACHE_NAME); ignite(idx).getOrCreateCache(cfg); } catch (Exception e) { err.compareAndSet(null, e); } return null; } }, nodeCount(), "starter");
@Override public Object call() throws Exception { ignite.getOrCreateCache(cacheConfiguration("NEW_CACHE")); return null; } }, IgniteException.class, EXPECTED_MSG);
@Override public void test(Factory factory, Ignite ignite) throws Exception { ignite.getOrCreateCache("test0"); ignite.getOrCreateCache("test1"); final IgniteCompute comp = ignite.compute(); for (int i = 0; i < MAX_JOB_COUNT; ++i) { IgniteRunnable job = (IgniteRunnable)factory.create(); IgniteFuture<Void> fut = comp.affinityRunAsync(Arrays.asList("test0", "test1"), 0, job); fut.get(); } } });
@Override public void test(Factory factory, Ignite ignite) throws Exception { ignite.getOrCreateCache("test0"); ignite.getOrCreateCache("test1"); final IgniteCompute comp = ignite.compute(); for (int i = 0; i < MAX_JOB_COUNT; ++i) { IgniteRunnable job = (IgniteRunnable)factory.create(); comp.affinityRun(Arrays.asList("test0", "test1"), key(0), job); } } });
@Override public void run() { srv.destroyCache(DEFAULT_CACHE_NAME); srv.getOrCreateCache(new CacheConfiguration<>(DEFAULT_CACHE_NAME)); } });
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); ignite(0).getOrCreateCache("noop"); }
@Override public void test(Factory factory, Ignite ignite) throws Exception { ignite.getOrCreateCache("test0"); ignite.getOrCreateCache("test1"); final IgniteCompute comp = ignite.compute(); for (int i = 0; i < MAX_JOB_COUNT; ++i) { IgniteRunnable job = (IgniteRunnable)factory.create(); IgniteFuture<Void> fut = comp.affinityRunAsync(Arrays.asList("test0", "test1"), key(0), job); fut.get(); } } });
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { ignite = startGridsMultiThreaded(NODES_COUNT, false); initCache = ignite.getOrCreateCache(new CacheConfiguration<>(DEFAULT_CACHE_NAME) .setSqlSchema("PUBLIC") ); }
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { ignite = startGridsMultiThreaded(NODES_COUNT, false); initCache = ignite.getOrCreateCache(new CacheConfiguration<>(DEFAULT_CACHE_NAME) .setSqlSchema("PUBLIC") ); }
/** * @param client Client. * @param cacheName Cache name. */ private void checkFineCache(Ignite client, String cacheName) { IgniteCache<Integer, String> cache = client.getOrCreateCache(cacheName); cache.put(1, "1"); assertEquals("1", cache.get(1)); }
/** */ private void createAndFillCache(Ignite srv) { IgniteCache cache = srv.getOrCreateCache(cacheConfiguration()); for (int i = 0; i < ENTRIES_COUNT; i++) cache.put(i, new TestValue(i, "str" + i)); }
@Override public Boolean call() throws Exception { Ignite node = startGrid(nodeId); log.info("Getting cache."); IgniteCache<Integer, Integer> cache = node.getOrCreateCache(cacheConfig()); log.info("Got cache."); FILLED_LATCH.await(); log.info("Got Filled."); cache.put(1, nodeId); checkCacheState(node, cache); return true; } });
/** * @param atomicityMode Atomicity mode. * @throws Exception If failed. */ public void asyncOperations(CacheAtomicityMode atomicityMode) throws Exception { try (IgniteCache<Integer, Integer> cache = ignite(1).getOrCreateCache(cacheConfiguration(atomicityMode))) { async1(cache); async2(cache); } }
/** * @param ignite Ignite. * @param name Name. */ private IgniteCache<Integer, Integer> getCache(Ignite ignite, String name) { CacheConfiguration ccfg = defaultCacheConfiguration(); ccfg.setName(name); ccfg.setCacheMode(CacheMode.PARTITIONED); ccfg.setBackups(0); ccfg.setNearConfiguration(null); return ignite.getOrCreateCache(ccfg); }
/** */ private void setUpGrids(int n, boolean indexed) throws Exception { Ignite ign = startGridsMultiThreaded(n); CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME) .setAtomicityMode(TRANSACTIONAL_SNAPSHOT); if (indexed) ccfg.setIndexedTypes(Integer.class, Integer.class); ign.getOrCreateCache(ccfg); G.setClientMode(true); client = startGrid(n); }
/** * @param ignite Ignite. * @param name Cache name. * @param expBackups Expected number of backups. */ private void checkGetOrCreate(Ignite ignite, String name, int expBackups) { IgniteCache cache = ignite.getOrCreateCache(name); assertNotNull(cache); CacheConfiguration cfg = (CacheConfiguration)cache.getConfiguration(CacheConfiguration.class); assertEquals(name, cfg.getName()); assertEquals(expBackups, cfg.getBackups()); }
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { startGridsMultiThreaded(NODES_COUNT - 1, false); clientMode = true; startGrid(NODES_COUNT); orgCache = ignite(NODES_COUNT).getOrCreateCache(new CacheConfiguration<Integer, JoinSqlTestHelper.Organization>(ORG_CACHE_NAME) .setCacheMode(CacheMode.PARTITIONED) .setQueryEntities(organizationQueryEntity()) ); awaitPartitionMapExchange(); populateDataIntoOrg(); }