Search in sources :

Example 1 with LevelDBPersistenceAdapter

use of org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter in project activemq-artemis by apache.

the class mLevelDBXARecoveryBrokerTest method configureBroker.

@Override
protected void configureBroker(BrokerService broker) throws Exception {
    super.configureBroker(broker);
    MultiKahaDBPersistenceAdapter mKahaDB = new MultiKahaDBPersistenceAdapter();
    List<FilteredKahaDBPersistenceAdapter> adapters = new LinkedList<>();
    FilteredKahaDBPersistenceAdapter defaultEntry = new FilteredKahaDBPersistenceAdapter();
    defaultEntry.setPersistenceAdapter(new LevelDBPersistenceAdapter());
    adapters.add(defaultEntry);
    FilteredKahaDBPersistenceAdapter special = new FilteredKahaDBPersistenceAdapter();
    special.setDestination(new ActiveMQQueue("special"));
    special.setPersistenceAdapter(new LevelDBPersistenceAdapter());
    adapters.add(special);
    mKahaDB.setFilteredPersistenceAdapters(adapters);
    broker.setPersistenceAdapter(mKahaDB);
}
Also used : FilteredKahaDBPersistenceAdapter(org.apache.activemq.store.kahadb.FilteredKahaDBPersistenceAdapter) LevelDBPersistenceAdapter(org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter) MultiKahaDBPersistenceAdapter(org.apache.activemq.store.kahadb.MultiKahaDBPersistenceAdapter) ActiveMQQueue(org.apache.activemq.command.ActiveMQQueue) LinkedList(java.util.LinkedList)

Example 2 with LevelDBPersistenceAdapter

use of org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter in project activemq-artemis by apache.

the class DurableSubscriptionOfflineTestListener method setPersistenceAdapter.

public PersistenceAdapter setPersistenceAdapter(BrokerService broker, PersistenceAdapterChoice choice) throws IOException {
    PersistenceAdapter adapter = null;
    switch(choice) {
        case JDBC:
            LOG.debug(">>>> setPersistenceAdapter to JDBC ");
            adapter = new JDBCPersistenceAdapter();
            break;
        case KahaDB:
            LOG.debug(">>>> setPersistenceAdapter to KahaDB ");
            adapter = new KahaDBPersistenceAdapter();
            break;
        case LevelDB:
            LOG.debug(">>>> setPersistenceAdapter to LevelDB ");
            adapter = new LevelDBPersistenceAdapter();
            break;
        case MEM:
            LOG.debug(">>>> setPersistenceAdapter to MEM ");
            adapter = new MemoryPersistenceAdapter();
            break;
    }
    broker.setPersistenceAdapter(adapter);
    return adapter;
}
Also used : JDBCPersistenceAdapter(org.apache.activemq.store.jdbc.JDBCPersistenceAdapter) MemoryPersistenceAdapter(org.apache.activemq.store.memory.MemoryPersistenceAdapter) LevelDBPersistenceAdapter(org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter) MemoryPersistenceAdapter(org.apache.activemq.store.memory.MemoryPersistenceAdapter) LevelDBPersistenceAdapter(org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter) JDBCPersistenceAdapter(org.apache.activemq.store.jdbc.JDBCPersistenceAdapter) KahaDBPersistenceAdapter(org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter) PersistenceAdapter(org.apache.activemq.store.PersistenceAdapter) KahaDBPersistenceAdapter(org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter)

Example 3 with LevelDBPersistenceAdapter

use of org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter in project activemq-artemis by apache.

the class CheckDuplicateMessagesOnDuplexTest method persistenceAdapterFactory_LevelDB.

private PersistenceAdapter persistenceAdapterFactory_LevelDB(String path) {
    LevelDBPersistenceAdapter levelDBPersistenceAdapter = new LevelDBPersistenceAdapter();
    levelDBPersistenceAdapter.setDirectory(new File(path));
    return levelDBPersistenceAdapter;
}
Also used : LevelDBPersistenceAdapter(org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter) File(java.io.File)

Example 4 with LevelDBPersistenceAdapter

use of org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter in project activemq-artemis by apache.

the class TestSupport method setPersistenceAdapter.

public static PersistenceAdapter setPersistenceAdapter(BrokerService broker, PersistenceAdapterChoice choice) throws IOException {
    PersistenceAdapter adapter = null;
    switch(choice) {
        case JDBC:
            JDBCPersistenceAdapter jdbcPersistenceAdapter = new JDBCPersistenceAdapter();
            // rollback (at shutdown) on derby can take a long time with file io etc
            jdbcPersistenceAdapter.setUseLock(false);
            adapter = jdbcPersistenceAdapter;
            break;
        case KahaDB:
            adapter = new KahaDBPersistenceAdapter();
            break;
        case LevelDB:
            adapter = new LevelDBPersistenceAdapter();
            break;
        case MEM:
            adapter = new MemoryPersistenceAdapter();
            break;
    }
    broker.setPersistenceAdapter(adapter);
    adapter.setDirectory(new File(broker.getBrokerDataDirectory(), choice.name()));
    return adapter;
}
Also used : JDBCPersistenceAdapter(org.apache.activemq.store.jdbc.JDBCPersistenceAdapter) MemoryPersistenceAdapter(org.apache.activemq.store.memory.MemoryPersistenceAdapter) LevelDBPersistenceAdapter(org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter) File(java.io.File) JDBCPersistenceAdapter(org.apache.activemq.store.jdbc.JDBCPersistenceAdapter) KahaDBPersistenceAdapter(org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter) MemoryPersistenceAdapter(org.apache.activemq.store.memory.MemoryPersistenceAdapter) LevelDBPersistenceAdapter(org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter) PersistenceAdapter(org.apache.activemq.store.PersistenceAdapter) KahaDBPersistenceAdapter(org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter)

Aggregations

LevelDBPersistenceAdapter (org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter)4 File (java.io.File)2 PersistenceAdapter (org.apache.activemq.store.PersistenceAdapter)2 JDBCPersistenceAdapter (org.apache.activemq.store.jdbc.JDBCPersistenceAdapter)2 KahaDBPersistenceAdapter (org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter)2 MemoryPersistenceAdapter (org.apache.activemq.store.memory.MemoryPersistenceAdapter)2 LinkedList (java.util.LinkedList)1 ActiveMQQueue (org.apache.activemq.command.ActiveMQQueue)1 FilteredKahaDBPersistenceAdapter (org.apache.activemq.store.kahadb.FilteredKahaDBPersistenceAdapter)1 MultiKahaDBPersistenceAdapter (org.apache.activemq.store.kahadb.MultiKahaDBPersistenceAdapter)1