Package org.apache.bookkeeper.client

Examples of org.apache.bookkeeper.client.LedgerHandle.addEntry()


            throws Exception {
        LedgerHandle lh = bkc.createLedger(3, 3, BookKeeper.DigestType.CRC32,
                TESTPASSWD);

        for (int i = 0; i < 10; i++) {
            lh.addEntry(data);
        }
        InetSocketAddress replicaToKill = LedgerHandleAdapter
                .getLedgerMetadata(lh).getEnsembles().get(0L).get(0);

        LOG.info("Killing Bookie", replicaToKill);
View Full Code Here


            throws Exception {
        LedgerHandle lh = bkc.createLedger(3, 3, BookKeeper.DigestType.CRC32,
                TESTPASSWD);

        for (int i = 0; i < 10; i++) {
            lh.addEntry(data);
        }
        InetSocketAddress replicaToKill = LedgerHandleAdapter
                .getLedgerMetadata(lh).getEnsembles().get(0L).get(0);

        LOG.info("Killing Bookie", replicaToKill);
View Full Code Here

        int startNewBookie = startNewBookie();

        // Reform ensemble...Making sure that last fragment is not in
        // under-replication
        for (int i = 0; i < 10; i++) {
            lh.addEntry(data);
        }

        InetSocketAddress newBkAddr = new InetSocketAddress(InetAddress
                .getLocalHost().getHostAddress(), startNewBookie);
        LOG.info("New Bookie addr :" + newBkAddr);
View Full Code Here

    @Test(timeout = 20000)
    public void testRWShutdownOnLocalBookieReadonlyTransition() throws Exception {
        LedgerHandle lh = bkc.createLedger(3, 3, BookKeeper.DigestType.CRC32, TESTPASSWD);

        for (int i = 0; i < 10; i++) {
            lh.addEntry(data);
        }
        InetSocketAddress replicaToKill = LedgerHandleAdapter.getLedgerMetadata(lh).getEnsembles().get(0L).get(0);

        LOG.info("Killing Bookie", replicaToKill);
        killBookie(replicaToKill);
View Full Code Here

        LOG.info("Killing Bookie", replicaToKill);
        killBookie(replicaToKill);

        int newBkPort = startNewBookie();
        for (int i = 0; i < 10; i++) {
            lh.addEntry(data);
        }

        InetSocketAddress newBkAddr = new InetSocketAddress(InetAddress.getLocalHost().getHostAddress(), newBkPort);
        LOG.info("New Bookie addr :" + newBkAddr);
View Full Code Here

                ledgerDirs.length);
        Bookie bookie = bs.get(1).getBookie();
        LedgerDirsManager ledgerDirsManager = bookie.getLedgerDirsManager();

        for (int i = 0; i < 10; i++) {
            ledger.addEntry("data".getBytes());
        }

        // Now add the current ledger dir to filled dirs list
        ledgerDirsManager.addToFilledDirs(new File(ledgerDirs[0], "current"));
View Full Code Here

        // Now add the current ledger dir to filled dirs list
        ledgerDirsManager.addToFilledDirs(new File(ledgerDirs[0], "current"));

        try {
            ledger.addEntry("data".getBytes());
        } catch (BKException.BKNotEnoughBookiesException e) {
            // Expected
        }

        assertTrue("Bookie should be running and converted to readonly mode",
View Full Code Here

        LedgerHandle ledger = bkc.createLedger(2, 2, DigestType.MAC,
                "".getBytes());
        LedgerDirsManager ledgerDirsManager = bookie.getLedgerDirsManager();

        for (int i = 0; i < 10; i++) {
            ledger.addEntry("data".getBytes());
        }

        // Now add the current ledger dir to filled dirs list
        ledgerDirsManager.addToFilledDirs(new File(ledgerDirs[0], "current"));
View Full Code Here

        // Now add the current ledger dir to filled dirs list
        ledgerDirsManager.addToFilledDirs(new File(ledgerDirs[0], "current"));

        try {
            ledger.addEntry("data".getBytes());
        } catch (BKException.BKNotEnoughBookiesException e) {
            // Expected
        }

        // wait for up to 10 seconds for bookie to shut down
View Full Code Here

        LedgerHandle ledger = bkc.createLedger(2, 2, DigestType.MAC,
                "".getBytes());
        LedgerDirsManager ledgerDirsManager = bookie.getLedgerDirsManager();

        for (int i = 0; i < 10; i++) {
            ledger.addEntry("data".getBytes());
        }

        // Now add the current ledger dir to filled dirs list
        ledgerDirsManager.addToFilledDirs(new File(ledgerDirs[0], "current"));
        for (int i = 0; i < 10; i++) {
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.