Package org.apache.activemq.leveldb

Examples of org.apache.activemq.leveldb.CountDownFuture.await()


        master.setReplicas(2);
        CountDownFuture masterStartLatch = asyncStart(master);

        // Start the store should not complete since we don't have enough
        // replicas.
        assertFalse(masterStartLatch.await(2, TimeUnit.SECONDS));

        // Adding a slave should allow the master startup to complete.
        SlaveLevelDBStore slave = createSlave(master, slaveDir);
        slave.start();
View Full Code Here


        // Adding a slave should allow the master startup to complete.
        SlaveLevelDBStore slave = createSlave(master, slaveDir);
        slave.start();

        assertTrue(masterStartLatch.await(2, TimeUnit.SECONDS));

        // New updates should complete quickly now..
        MessageStore ms = master.createQueueMessageStore(new ActiveMQQueue("TEST"));
        CountDownFuture f = asyncAddMessage(ms, "m1");
        assertTrue(f.await(1, TimeUnit.SECONDS));
View Full Code Here

        assertTrue(masterStartLatch.await(2, TimeUnit.SECONDS));

        // New updates should complete quickly now..
        MessageStore ms = master.createQueueMessageStore(new ActiveMQQueue("TEST"));
        CountDownFuture f = asyncAddMessage(ms, "m1");
        assertTrue(f.await(1, TimeUnit.SECONDS));

        // If the slave goes offline, then updates should once again
        // not complete.
        slave.stop();
View Full Code Here

        // If the slave goes offline, then updates should once again
        // not complete.
        slave.stop();

        f = asyncAddMessage(ms, "m2");
        assertFalse(f.await(2, TimeUnit.SECONDS));

        // Restart and the op should complete.
        slave = createSlave(master, slaveDir);
        slave.start();
        assertTrue(f.await(2, TimeUnit.SECONDS));
View Full Code Here

        assertFalse(f.await(2, TimeUnit.SECONDS));

        // Restart and the op should complete.
        slave = createSlave(master, slaveDir);
        slave.start();
        assertTrue(f.await(2, TimeUnit.SECONDS));

        master.stop();
        slave.stop();

    }
View Full Code Here

            MasterLevelDBStore master = createMaster(directories.get(0));
            CountDownFuture masterStart = asyncStart(master);
            SlaveLevelDBStore slave1 = createSlave(master, directories.get(1));
            SlaveLevelDBStore slave2 = createSlave(master, directories.get(2));
            asyncStart(slave2);
            masterStart.await();

            MessageStore ms = master.createQueueMessageStore(new ActiveMQQueue("TEST"));

            LOG.info("Checking: "+master.getDirectory());
            assertEquals(expected_list, getMessages(ms));
View Full Code Here

        configureSlave(node2, node1, node2Dir);
        SlaveLevelDBStore node3 = createSlave(node1, node3Dir);

        asyncStart(node2);
        asyncStart(node3);
        masterStart.await();

        LOG.info("Adding messages...");
        String playload = createPlayload(64 * 1024);
        MessageStore ms = node1.createQueueMessageStore(new ActiveMQQueue("TEST"));
        final int TOTAL = 10;
View Full Code Here

        master.setReplicas(2);
        CountDownFuture masterStartLatch = asyncStart(master);

        // Start the store should not complete since we don't have enough
        // replicas.
        assertFalse(masterStartLatch.await(2, TimeUnit.SECONDS));

        // Adding a slave should allow the master startup to complete.
        SlaveLevelDBStore slave = createSlave(master, slaveDir);
        slave.start();
View Full Code Here

        // Adding a slave should allow the master startup to complete.
        SlaveLevelDBStore slave = createSlave(master, slaveDir);
        slave.start();

        assertTrue(masterStartLatch.await(2, TimeUnit.SECONDS));

        // New updates should complete quickly now..
        MessageStore ms = master.createQueueMessageStore(new ActiveMQQueue("TEST"));
        CountDownFuture f = asyncAddMessage(ms, "m1");
        assertTrue(f.await(1, TimeUnit.SECONDS));
View Full Code Here

        assertTrue(masterStartLatch.await(2, TimeUnit.SECONDS));

        // New updates should complete quickly now..
        MessageStore ms = master.createQueueMessageStore(new ActiveMQQueue("TEST"));
        CountDownFuture f = asyncAddMessage(ms, "m1");
        assertTrue(f.await(1, TimeUnit.SECONDS));

        // If the slave goes offline, then updates should once again
        // not complete.
        slave.stop();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.