Search in sources :

Example 1 with CassandraConfig

use of org.commonjava.indy.subsys.cassandra.config.CassandraConfig in project indy by Commonjava.

the class CassandraTCKFixtureProvider method init.

protected void init() throws Exception {
    EmbeddedCassandraServerHelper.startEmbeddedCassandra();
    CassandraConfig config = new CassandraConfig();
    config.setEnabled(true);
    config.setCassandraHost("localhost");
    config.setCassandraPort(9142);
    client = new CassandraClient(config);
    IndyStoreManagerConfig storeConfig = new IndyStoreManagerConfig("noncontent", 1);
    DefaultIndyConfiguration indyConfig = new DefaultIndyConfiguration();
    indyConfig.setKeyspaceReplicas(1);
    client = new CassandraClient(config);
    CassandraStoreQuery storeQuery = new CassandraStoreQuery(client, storeConfig, indyConfig);
    dataManager = new CassandraStoreDataManager(storeQuery, new IndyObjectMapper(true));
}
Also used : IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) CassandraClient(org.commonjava.indy.subsys.cassandra.CassandraClient) IndyStoreManagerConfig(org.commonjava.indy.core.conf.IndyStoreManagerConfig) CassandraConfig(org.commonjava.indy.subsys.cassandra.config.CassandraConfig) DefaultIndyConfiguration(org.commonjava.indy.conf.DefaultIndyConfiguration)

Example 2 with CassandraConfig

use of org.commonjava.indy.subsys.cassandra.config.CassandraConfig in project indy by Commonjava.

the class CassandraStoreTest method start.

@Before
public void start() throws Exception {
    EmbeddedCassandraServerHelper.startEmbeddedCassandra();
    CassandraConfig config = new CassandraConfig();
    config.setEnabled(true);
    config.setCassandraHost("localhost");
    config.setCassandraPort(9142);
    client = new CassandraClient(config);
    IndyStoreManagerConfig storeConfig = new IndyStoreManagerConfig("noncontent", 1);
    DefaultIndyConfiguration indyConfig = new DefaultIndyConfiguration();
    indyConfig.setKeyspaceReplicas(1);
    storeQuery = new CassandraStoreQuery(client, storeConfig, indyConfig);
}
Also used : CassandraClient(org.commonjava.indy.subsys.cassandra.CassandraClient) IndyStoreManagerConfig(org.commonjava.indy.core.conf.IndyStoreManagerConfig) CassandraConfig(org.commonjava.indy.subsys.cassandra.config.CassandraConfig) DefaultIndyConfiguration(org.commonjava.indy.conf.DefaultIndyConfiguration) Before(org.junit.Before)

Example 3 with CassandraConfig

use of org.commonjava.indy.subsys.cassandra.config.CassandraConfig in project indy by Commonjava.

the class ScheduleTest method start.

@Before
public void start() throws Exception {
    EmbeddedCassandraServerHelper.startEmbeddedCassandra();
    CassandraConfig config = new CassandraConfig();
    config.setEnabled(true);
    config.setCassandraHost("localhost");
    config.setCassandraPort(9142);
    client = new CassandraClient(config);
    ScheduleDBConfig scheduleDBConfig = new ScheduleDBConfig(SCHEDULE_KEYSPACE, 1, 60 * 60 * 1000, 3);
    DefaultIndyConfiguration indyConfig = new DefaultIndyConfiguration();
    indyConfig.setKeyspaceReplicas(1);
    DefaultCacheManager cacheManager = new DefaultCacheManager(new ConfigurationBuilder().simpleCache(true).build());
    scheduleDB = new ScheduleDB(indyConfig, scheduleDBConfig, client, new CacheProducer(null, cacheManager, null));
}
Also used : DefaultCacheManager(org.infinispan.manager.DefaultCacheManager) ConfigurationBuilder(org.infinispan.configuration.cache.ConfigurationBuilder) ScheduleDBConfig(org.commonjava.indy.schedule.conf.ScheduleDBConfig) CacheProducer(org.commonjava.indy.subsys.infinispan.CacheProducer) CassandraClient(org.commonjava.indy.subsys.cassandra.CassandraClient) CassandraConfig(org.commonjava.indy.subsys.cassandra.config.CassandraConfig) DefaultIndyConfiguration(org.commonjava.indy.conf.DefaultIndyConfiguration) Before(org.junit.Before)

Aggregations

DefaultIndyConfiguration (org.commonjava.indy.conf.DefaultIndyConfiguration)3 CassandraClient (org.commonjava.indy.subsys.cassandra.CassandraClient)3 CassandraConfig (org.commonjava.indy.subsys.cassandra.config.CassandraConfig)3 IndyStoreManagerConfig (org.commonjava.indy.core.conf.IndyStoreManagerConfig)2 Before (org.junit.Before)2 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)1 ScheduleDBConfig (org.commonjava.indy.schedule.conf.ScheduleDBConfig)1 CacheProducer (org.commonjava.indy.subsys.infinispan.CacheProducer)1 ConfigurationBuilder (org.infinispan.configuration.cache.ConfigurationBuilder)1 DefaultCacheManager (org.infinispan.manager.DefaultCacheManager)1