use of org.apache.ignite.client.ClientCacheConfiguration in project ignite by apache.
the class CacheAsyncTest method testGetOrCreateCacheAsyncByNameCreatesCacheWhenNotExists.
/**
* Tests async cache creation.
*/
@Test
public void testGetOrCreateCacheAsyncByNameCreatesCacheWhenNotExists() throws Exception {
ClientCacheConfiguration cfg = new ClientCacheConfiguration().setName(TMP_CACHE_NAME).setBackups(5);
assertTrue(client.getOrCreateCacheAsync(cfg).thenApply(x -> client.cacheNames().contains(TMP_CACHE_NAME)).toCompletableFuture().get());
ClientCacheConfiguration resCfg = client.cache(TMP_CACHE_NAME).getConfiguration();
assertEquals(5, resCfg.getBackups());
}
use of org.apache.ignite.client.ClientCacheConfiguration in project ignite by apache.
the class WrongQueryEntityFieldTypeTest method withThinClient.
/**
* Perform action with Thin client.
*/
private void withThinClient(BiConsumer<IgniteClient, ClientCache<Integer, Object>> consumer) throws Exception {
startGrids(gridCnt);
try (IgniteClient cli = Ignition.startClient(new ClientConfiguration().setAddresses("127.0.0.1:10800"))) {
ClientCache<Integer, Object> cache = cli.createCache(new ClientCacheConfiguration().setName("TEST").setAtomicityMode(mode).setBackups(backups).setQueryEntities(queryEntity()));
consumer.accept(cli, cache);
assertFalse(sysThreadFail);
}
}
Aggregations