/** {@inheritDoc} */ @Override public C call() throws Exception { return cache().getConfiguration(clazz); } }
/** * @param cache Cache. * @return {@code True} if cache is replicated. */ private boolean replicated(IgniteCache<?, ?> cache) { return cache.getConfiguration(CacheConfiguration.class).getCacheMode() == REPLICATED; }
/** * @param cache Ignite cache. * @return CacheAtomicityMode for given cache. */ public static CacheAtomicityMode atomicityMode(IgniteCache cache) { return ((CacheConfiguration)cache.getConfiguration(CacheConfiguration.class)).getAtomicityMode(); }
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public ClientResponse process(ClientConnectionContext ctx) { CacheConfiguration cfg = ((IgniteCache<Object, Object>) rawCache(ctx)) .getConfiguration(CacheConfiguration.class); return new ClientCacheGetConfigurationResponse(requestId(), cfg, ver); } }
/** * @param cache Cache. * @return {@code True} if cache is replicated. */ private boolean replicated(IgniteCache<?, ?> cache) { return cache.getConfiguration(CacheConfiguration.class).getCacheMode() == REPLICATED; }
/** * @param c Cache. * @return {@code True} if synchronoous preloading. */ private boolean isSync(IgniteCache<?, ?> c) { return c.getConfiguration(CacheConfiguration.class).getRebalanceMode() == SYNC; }
/** * @param cache Cache. * @return Name of the table contained by this cache. */ @SuppressWarnings("unchecked") private static String tableName(IgniteCache<?, ?> cache) { return ((Collection<QueryEntity>)cache.getConfiguration(CacheConfiguration.class).getQueryEntities()) .iterator().next().getTableName(); }
/** * @param c Cache proxy. */ protected void printPartitionState(IgniteCache<?, ?> c) { printPartitionState(c.getConfiguration(CacheConfiguration.class).getName(), 0); }
/** */ protected boolean isLocalAtomic() { CacheConfiguration cfg = cache.getConfiguration(CacheConfiguration.class); return cfg.getCacheMode() == CacheMode.LOCAL && cfg.getAtomicityMode() == CacheAtomicityMode.ATOMIC; }
/** * @param i Grid index. * @return Policy. */ @SuppressWarnings({"unchecked"}) protected T policy(int i) { return (T)grid(i).cache(DEFAULT_CACHE_NAME).getConfiguration(CacheConfiguration.class).getEvictionPolicy(); }
/** @return Policy. */ @SuppressWarnings({"unchecked"}) protected T policy() { return (T)grid().cache(DEFAULT_CACHE_NAME).getConfiguration(CacheConfiguration.class).getEvictionPolicy(); }
@Test public void testWronglySetAffinityFunctionForLocalCache() { Ignite node = ignite(NODE_CNT - 1); CacheConfiguration ccf = node.cache(CACHE1).getConfiguration(CacheConfiguration.class); assertEquals("org.apache.ignite.internal.processors.cache.GridCacheProcessor$LocalAffinityFunction", ccf.getAffinity().getClass().getName()); }
/** * @param i Grid index. * @return Policy. */ @SuppressWarnings({"unchecked"}) protected T nearPolicy(int i) { CacheConfiguration cfg = grid(i).cache(DEFAULT_CACHE_NAME).getConfiguration(CacheConfiguration.class); NearCacheConfiguration nearCfg = cfg.getNearConfiguration(); return (T)(nearCfg == null ? null : nearCfg.getNearEvictionPolicy()); }
/** * @throws Exception If failed. */ @Test public void testNullCacheMode() throws Exception { // Grid with null cache mode. // This is a legal case. The default cache mode should be used. cacheEnabled = true; cacheName = "myCache"; cacheMode = null; depMode = SHARED; assert startGrid(1).cache("myCache").getConfiguration(CacheConfiguration.class).getCacheMode() == CacheConfiguration.DFLT_CACHE_MODE; }
/** * @throws Exception If failed. */ @Test public void testNonTxEvictions() throws Exception { if (grid(0).cache(DEFAULT_CACHE_NAME).getConfiguration(CacheConfiguration.class).getAtomicityMode() == CacheAtomicityMode.ATOMIC) checkTtl(false); }
/** * @param ignite Ignite. * @param cacheName Cache name. */ private void checkDefaultTemplate(final Ignite ignite, final String cacheName) { checkGetOrCreate(ignite, cacheName, 0); IgniteCache cache = ignite.getOrCreateCache(cacheName); assertNotNull(cache); CacheConfiguration cfg = (CacheConfiguration)cache.getConfiguration(CacheConfiguration.class); assertEquals(CacheConfiguration.DFLT_CACHE_ATOMICITY_MODE, cfg.getAtomicityMode()); }
/** * @throws Exception If failed. */ @Test public void testTxEvictions() throws Exception { if (grid(0).cache(DEFAULT_CACHE_NAME).getConfiguration(CacheConfiguration.class).getAtomicityMode() != CacheAtomicityMode.ATOMIC) checkTtl(true); }
/** * @param ignite Ignite. * @param name Cache name. * @param expBackups Expected number of backups. */ private void checkCreate(final Ignite ignite, final String name, int expBackups) { IgniteCache cache = ignite.createCache(name); assertNotNull(cache); CacheConfiguration cfg = (CacheConfiguration)cache.getConfiguration(CacheConfiguration.class); assertEquals(name, cfg.getName()); assertEquals(expBackups, cfg.getBackups()); }
/** * @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()); }
/** * @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()); } }