Examples of openLedger()


Examples of org.apache.bookkeeper.client.BookKeeper.openLedger()

    public void testSpeculativeReadMultipleReplicasDown() throws Exception {
        long id = getLedgerToRead(5,5);
        int timeout = 5000;
        BookKeeper bkspec = createClient(timeout);

        LedgerHandle l = bkspec.openLedger(id, digestType, passwd);

        // sleep bookie 1, 2 & 4
        CountDownLatch sleepLatch = new CountDownLatch(1);
        sleepBookie(l.getLedgerMetadata().getEnsembles().get(0L).get(1), sleepLatch);
        sleepBookie(l.getLedgerMetadata().getEnsembles().get(0L).get(2), sleepLatch);
View Full Code Here

Examples of org.apache.bookkeeper.client.BookKeeper.openLedger()

    public void testSpeculativeReadFirstReadCompleteIsOk() throws Exception {
        long id = getLedgerToRead(2,2);
        int timeout = 1000;
        BookKeeper bkspec = createClient(timeout);

        LedgerHandle l = bkspec.openLedger(id, digestType, passwd);

        // sleep bookies
        CountDownLatch sleepLatch0 = new CountDownLatch(1);
        CountDownLatch sleepLatch1 = new CountDownLatch(1);
        sleepBookie(l.getLedgerMetadata().getEnsembles().get(0L).get(0), sleepLatch0);
View Full Code Here

Examples of org.apache.bookkeeper.client.BookKeeper.openLedger()

    public void testSpeculativeReadScheduling() throws Exception {
        long id = getLedgerToRead(3,2);
        int timeout = 1000;
        BookKeeper bkspec = createClient(timeout);

        LedgerHandle l = bkspec.openLedger(id, digestType, passwd);

        ArrayList<InetSocketAddress> ensemble = l.getLedgerMetadata().getEnsembles().get(0L);
        Set<InetSocketAddress> allHosts = new HashSet(ensemble);
        Set<InetSocketAddress> noHost = new HashSet();
        Set<InetSocketAddress> secondHostOnly = new HashSet();
View Full Code Here

Examples of org.apache.bookkeeper.client.BookKeeper.openLedger()

       
        /*
         * Try to open ledger.
         */
        try{
            LedgerHandle afterlh = bk.openLedger(beforelh.getId(), "".getBytes());
           
            /*
             * Check if has recovered properly.
             */
            assertTrue("Has not recovered correctly: " + afterlh.getLast(), afterlh.getLast() == 999);
View Full Code Here

Examples of org.apache.bookkeeper.client.BookKeeper.openLedger()

       
        /*
         * Try to open ledger.
         */
        try{
            LedgerHandle afterlh = bk.openLedger(beforelh.getId(), "".getBytes());
           
            /*
             * Check if has recovered properly.
             */
            assertTrue("Has not recovered correctly: " + afterlh.getLast(), afterlh.getLast() == 0);
View Full Code Here

Examples of org.apache.bookkeeper.client.BookKeeperTestClient.openLedger()

        // create new bookie client, and forcing to establish new
        // PerChannelBookieClient connections for recovery flows.
        BookKeeperTestClient bkc1 = new BookKeeperTestClient(baseClientConf);
        // try to open ledger with recovery
        LedgerHandle afterlh = bkc1.openLedger(beforelh.getId(), digestType, ""
                .getBytes());

        assertEquals("Entries got missed", beforelh.getLastAddPushed(), afterlh
                .getLastAddConfirmed());
        bkc1.close();
View Full Code Here

Examples of org.apache.bookkeeper.client.BookKeeperTestClient.openLedger()

        // create new bookie client, and forcing to establish new
        // PerChannelBookieClient connections for recovery flows.
        BookKeeperTestClient bkc1 = new BookKeeperTestClient(baseClientConf);
        // try to open ledger with recovery
        LedgerHandle afterlh = bkc1.openLedger(beforelh.getId(), digestType, ""
                .getBytes());

        assertEquals("Entries got missed", beforelh.getLastAddPushed(), afterlh
                .getLastAddConfirmed());
        bkc1.close();
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.