use of org.apache.ignite.cache.store.cassandra.CassandraCacheStore in project ignite by apache.
the class CacheStoreHelper method createCacheStore.
/** */
public static CacheStore createCacheStore(String cacheName, Resource persistenceSettings, DataSource conn, CacheStoreSession session, Logger log) {
CassandraCacheStore<Integer, Integer> cacheStore = new CassandraCacheStore<>(conn, new KeyValuePersistenceSettings(persistenceSettings), Runtime.getRuntime().availableProcessors());
try {
Field sesField = CassandraCacheStore.class.getDeclaredField("storeSes");
Field logField = CassandraCacheStore.class.getDeclaredField("log");
sesField.setAccessible(true);
logField.setAccessible(true);
sesField.set(cacheStore, session != null ? session : new TestCacheSession(cacheName));
logField.set(cacheStore, new Log4JLogger(log));
} catch (Throwable e) {
throw new RuntimeException("Failed to initialize test Ignite cache store", e);
}
return cacheStore;
}
Aggregations