Package org.apache.activemq.store.kahadb

Examples of org.apache.activemq.store.kahadb.KahaDBStore$StoreQueueTask$InnerFutureTask


    protected void configureBroker(BrokerService answer,String uri) throws Exception {
        File dataFileDir = new File("target/test-amq-data/perfTest/amqdb");
        dataFileDir.mkdirs();
        answer.setDeleteAllMessagesOnStartup(true);
              
         KahaDBStore adaptor = new KahaDBStore();
         adaptor.setDirectory(dataFileDir);
        
       
        answer.setDataDirectoryFile(dataFileDir);
        answer.setPersistenceAdapter(adaptor);
        answer.addConnector(uri);
View Full Code Here


        return broker;
    }
   
    protected BrokerService createRestartedBroker() throws Exception {
        BrokerService broker = new BrokerService();
        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(new File("target/activemq-data/leveldb"));
        broker.setPersistenceAdapter(kaha);
        return broker;
    }
View Full Code Here

    protected void configureBroker(BrokerService answer,String uri) throws Exception {
        File dataFileDir = new File("target/test-amq-data/perfTest/amqdb");
        dataFileDir.mkdirs();
        // answer.setDeleteAllMessagesOnStartup(true);
              
         KahaDBStore adaptor = new KahaDBStore();
         adaptor.setDirectory(dataFileDir);
        
       
        answer.setDataDirectoryFile(dataFileDir);
        answer.setPersistenceAdapter(adaptor);
        answer.addConnector(uri);
View Full Code Here

        session.close();
        con.close();

        PersistenceAdapter persistenceAdapter = broker.getPersistenceAdapter();
        if( persistenceAdapter instanceof KahaDBStore) {
            final KahaDBStore store = ((KahaDBPersistenceAdapter) persistenceAdapter).getStore();
            LOG.info("Store page count: " + store.getPageFile().getPageCount());
            LOG.info("Store free page count: " + store.getPageFile().getFreePageCount());
            LOG.info("Store page in-use: " + (store.getPageFile().getPageCount() - store.getPageFile().getFreePageCount()));

            assertTrue("no leak of pages, always use just 10", Wait.waitFor(new Wait.Condition() {
                @Override
                public boolean isSatisified() throws Exception {
                    return 10 == store.getPageFile().getPageCount() -
                            store.getPageFile().getFreePageCount();
                }
            }, TimeUnit.SECONDS.toMillis(10)));
        }
    }
View Full Code Here

        return broker;
    }

    protected void configurePersistenceAdapter(BrokerService broker) throws IOException {
        File dataFileDir = new File("target/test-amq-data/kahadb/" + broker.getBrokerName());
        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(dataFileDir);
        broker.setPersistenceAdapter(kaha);
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        broker = new BrokerService();
        TransportConnector transportConnector = broker.addConnector("tcp://localhost:0");
        KahaDBStore store = new KahaDBStore();
        store.setDirectory(new File("data"));
        broker.setPersistenceAdapter(store);
        broker.start();

        brokerURL = "failover:(" + transportConnector.getPublishableConnectString() + ")";
        consumerBrokerURL = brokerURL + "?jms.prefetchPolicy.all=100";
View Full Code Here

            int indexBinSize = 1024;
            factory.setIndexMaxBinSize(indexBinSize * 2);
            factory.setIndexBinSize(indexBinSize);
            factory.setIndexPageSize(192 * 20);
        } else {
            KahaDBStore kaha = new KahaDBStore();
            kaha.setDirectory(new File("target/activemq-data/kahadb"));
            // The setEnableJournalDiskSyncs(false) setting is a little dangerous right now, as I have not verified
            // what happens if the index is updated but a journal update is lost.
            // Index is going to be in consistent, but can it be repaired?
            kaha.setEnableJournalDiskSyncs(false);
            // Using a bigger journal file size makes he take fewer spikes as it is not switching files as often.
            kaha.setJournalMaxFileLength(1024*1024*100);

            // small batch means more frequent and smaller writes
            kaha.setIndexWriteBatchSize(100);
            // do the index write in a separate thread
            kaha.setEnableIndexWriteAsync(true);

            broker.setPersistenceAdapter(kaha);
        }

        broker.addConnector("tcp://localhost:0").setName("Default");
View Full Code Here

    private BrokerService createBroker() throws Exception {
        BrokerService broker = new BrokerService();
        broker.setBrokerName(brokerName);

        KahaDBStore kaha = new KahaDBStore() {

            @Override
            public void start() throws Exception {
                LOG.info("Test KahaDB class is waiting for signal to complete its start()");
                holdStoreStart.await();
                super.start();
                LOG.info("Test KahaDB class is completed its start()");
            }
        };

        kaha.setDirectory(new File("target/activemq-data/kahadb"));
        kaha.deleteAllMessages();

        broker.setPersistenceAdapter(kaha);
        broker.setUseJmx(true);

        return broker;
View Full Code Here

        session.close();
        con.close();

        PersistenceAdapter persistenceAdapter = broker.getPersistenceAdapter();
        if( persistenceAdapter instanceof KahaDBPersistenceAdapter) {
            final KahaDBStore store = ((KahaDBPersistenceAdapter) persistenceAdapter).getStore();
            LOG.info("Store page count: " + store.getPageFile().getPageCount());
            LOG.info("Store free page count: " + store.getPageFile().getFreePageCount());
            LOG.info("Store page in-use: " + (store.getPageFile().getPageCount() - store.getPageFile().getFreePageCount()));

            assertTrue("no leak of pages, always use just 10", Wait.waitFor(new Wait.Condition() {
                @Override
                public boolean isSatisified() throws Exception {
                    return 10 == store.getPageFile().getPageCount() -
                            store.getPageFile().getFreePageCount();
                }
            }, TimeUnit.SECONDS.toMillis(10)));
        }
    }
View Full Code Here

        return answer;
    }
   
    protected void configureBroker(BrokerService answer,boolean deleteStore) throws Exception{
        answer.setDeleteAllMessagesOnStartup(deleteStore);
        KahaDBStore kaha = new KahaDBStore();
        File directory = new File("target/activemq-data/kahadb");
        if (deleteStore) {
            IOHelper.deleteChildren(directory);
        }
        kaha.setDirectory(directory);
       
        answer.setPersistenceAdapter(kaha);
        answer.addConnector(bindAddress);
        answer.setUseShutdownHook(false);
        answer.setUseJmx(false);
View Full Code Here

TOP

Related Classes of org.apache.activemq.store.kahadb.KahaDBStore$StoreQueueTask$InnerFutureTask

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.