Package org.apache.bookkeeper.client

Examples of org.apache.bookkeeper.client.BookKeeperTestClient


                bs.add(server);
            }

            baseClientConf.setZkServers("127.0.0.1");
            if (numBookies > 0) {
                bkc = new BookKeeperTestClient(baseClientConf);
            }
        } catch(Exception e) {
            LOG.error("Error setting up", e);
            throw e;
        }
View Full Code Here


            // *** WRITING PART COMPLETE // READ PART BEGINS ***

            // open ledger
            bkc.close();
            bkc = new BookKeeperTestClient(baseClientConf);
            lh = bkc.openLedger(ledgerId, digestType, ledgerPassword);
            LOG.debug("Number of entries written: " + (lh.getLastAddConfirmed() + 1));
            assertTrue("Verifying number of entries written", lh.getLastAddConfirmed() == (numEntriesToWrite - 1));

            // read entries
View Full Code Here

    @Override
    @Before
    public void setUp() throws IOException, Exception {
        super.setUp();
        entry = new byte[10]; // initialize the entries list
        this.bkcReader = new BookKeeperTestClient(baseClientConf);
    }
View Full Code Here

            // *** WRITING PART COMPLETE // READ PART BEGINS ***

            // open ledger
            bkc.close();
            bkc = new BookKeeperTestClient(baseClientConf);
            lh = bkc.openLedger(ledgerId, digestType, ledgerPassword);
            LOG.debug("Number of entries written: " + (lh.getLastAddConfirmed() + 1));
            assertTrue("Verifying number of entries written", lh.getLastAddConfirmed() == (numEntriesToWrite - 1));

            // read entries
View Full Code Here

        killBookie(0);
        startNewBookie();

        // 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

     * @throws Exception
     */
    protected void startBKCluster() throws Exception {
        baseClientConf.setZkServers(zkUtil.getZooKeeperConnectString());
        if (numBookies > 0) {
            bkc = new BookKeeperTestClient(baseClientConf);
        }

        // Create Bookie Servers (B1, B2, B3)
        for (int i = 0; i < numBookies; i++) {
            startNewBookie();
View Full Code Here

     * @throws Exception
     */
    protected void startBKCluster() throws Exception {
        baseClientConf.setZkServers(zkUtil.getZooKeeperConnectString());
        if (numBookies > 0) {
            bkc = new BookKeeperTestClient(baseClientConf);
        }

        // Create Bookie Servers (B1, B2, B3)
        for (int i = 0; i < numBookies; i++) {
            startNewBookie();
View Full Code Here

            // *** WRITING PART COMPLETE // READ PART BEGINS ***

            // open ledger
            bkc.close();
            bkc = new BookKeeperTestClient(baseClientConf);
            lh = bkc.openLedger(ledgerId, digestType, ledgerPassword);
            LOG.debug("Number of entries written: " + (lh.getLastAddConfirmed() + 1));
            assertTrue("Verifying number of entries written", lh.getLastAddConfirmed() == (numEntriesToWrite - 1));

            // read entries
View Full Code Here

            // *** WRITING PART COMPLETE // READ PART BEGINS ***

            // open ledger
            bkc.close();
            bkc = new BookKeeperTestClient(baseClientConf);
            lh = bkc.openLedger(ledgerId, digestType, ledgerPassword);
            LOG.debug("Number of entries written: " + (lh.getLastAddConfirmed() + 1));
            assertTrue("Verifying number of entries written", lh.getLastAddConfirmed() == (numEntriesToWrite - 1));

            // read entries
View Full Code Here

        killBookie(0);
        startNewBookie();

        // 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

Related Classes of org.apache.bookkeeper.client.BookKeeperTestClient

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.