Examples of BookKeeper


Examples of org.apache.bookkeeper.client.BookKeeper

        auxTestReadWriteAsyncSingleClient(bs.get(3));
    }
   
    @Test
    public void testBookieRecovery() throws Exception{
        bkc = new BookKeeper("127.0.0.1");
       
        //Shutdown all but 1 bookie
        bs.get(0).shutdown();
        bs.get(1).shutdown();
        bs.get(2).shutdown();
View Full Code Here

Examples of org.apache.bookkeeper.client.BookKeeper

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

            // open ledger
            bkc.halt();
            bkc = new BookKeeper("127.0.0.1");
            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

Examples of org.apache.bookkeeper.client.BookKeeper

     *
     * @throws {@link IOException}, {@link KeeperException}
     */
    @Test
    public void testStreamingClients() throws IOException, KeeperException, BKException, InterruptedException {
        bkc = new BookKeeper("127.0.0.1");
        lh = bkc.createLedger(digestType, ledgerPassword);
        // write a string so that we cna
        // create a buffer of a single bytes
        // and check for corner cases
        String toWrite = "we need to check for this string to match " + "and for the record mahadev is the best";
View Full Code Here

Examples of org.apache.bookkeeper.client.BookKeeper

    @Test
    public void testReadWriteAsyncSingleClient() throws IOException {
        try {
            // Create a BookKeeper client and a ledger
            bkc = new BookKeeper("127.0.0.1");
            lh = bkc.createLedger(digestType, ledgerPassword);
            // bkc.initMessageDigest("SHA1");
            ledgerId = lh.getId();
            LOG.info("Ledger ID: " + lh.getId());
            for (int i = 0; i < numEntriesToWrite; i++) {
View Full Code Here

Examples of org.apache.bookkeeper.client.BookKeeper

        LOG.info("TEST READ WRITE STRINGS MIXED SINGLE CLIENT");
        String charset = "utf-8";
        LOG.debug("Default charset: " + Charset.defaultCharset());
        try {
            // Create a BookKeeper client and a ledger
            bkc = new BookKeeper("127.0.0.1");
            lh = bkc.createLedger(digestType, ledgerPassword);
            // bkc.initMessageDigest("SHA1");
            ledgerId = lh.getId();
            LOG.info("Ledger ID: " + lh.getId());
            for (int i = 0; i < numEntriesToWrite; i++) {
View Full Code Here

Examples of org.apache.bookkeeper.client.BookKeeper

    @Test
    public void testReadWriteSyncSingleClient() throws IOException {
        try {
            // Create a BookKeeper client and a ledger
            bkc = new BookKeeper("127.0.0.1");
            lh = bkc.createLedger(digestType, ledgerPassword);
            // bkc.initMessageDigest("SHA1");
            ledgerId = lh.getId();
            LOG.info("Ledger ID: " + lh.getId());
            for (int i = 0; i < numEntriesToWrite; i++) {
View Full Code Here

Examples of org.apache.bookkeeper.client.BookKeeper

    @Test
    public void testReadWriteZero() throws IOException {
        try {
            // Create a BookKeeper client and a ledger
            bkc = new BookKeeper("127.0.0.1");
            lh = bkc.createLedger(digestType, ledgerPassword);
            // bkc.initMessageDigest("SHA1");
            ledgerId = lh.getId();
            LOG.info("Ledger ID: " + lh.getId());
            for (int i = 0; i < numEntriesToWrite; i++) {
View Full Code Here

Examples of org.apache.bookkeeper.client.BookKeeper

    @Test
    public void testMultiLedger() throws IOException {
        try {
            // Create a BookKeeper client and a ledger
            bkc = new BookKeeper("127.0.0.1");
            lh = bkc.createLedger(digestType, ledgerPassword);
            lh2 = bkc.createLedger(digestType, ledgerPassword);

            long ledgerId = lh.getId();
            long ledgerId2 = lh2.getId();
View Full Code Here

Examples of org.apache.bookkeeper.client.BookKeeper

   
    @Test
    public void testReadWriteAsyncLength() throws IOException {
        try {
            // Create a BookKeeper client and a ledger
            bkc = new BookKeeper("127.0.0.1");
            lh = bkc.createLedger(digestType, ledgerPassword);
            // bkc.initMessageDigest("SHA1");
            ledgerId = lh.getId();
            LOG.info("Ledger ID: " + lh.getId());
            for (int i = 0; i < numEntriesToWrite; i++) {
View Full Code Here

Examples of org.apache.bookkeeper.client.BookKeeper

            BookieServer server = new BookieServer(initialPort + i, HOSTPORT, f, new File[] { f });
            server.start();
            bs.add(server);
        }
        zkc.close();
        bkc = new BookKeeper("127.0.0.1");
        } catch(Exception e) {
            e.printStackTrace();
            throw e;
        }
    }
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.