Package org.apache.bookkeeper.proto

Examples of org.apache.bookkeeper.proto.BookieServer.start()


            }

            ServerConfiguration conf = newServerConfiguration(initialPort + 1,
                                                              zkUtil.getZooKeeperConnectString(), f, new File[] { f });
            server = new BookieServer(conf);
            server.start();

            Thread.sleep(10);
            Thread sendthread = null;
            threadCount = Thread.activeCount();
            threads = new Thread[threadCount*2];
 
View Full Code Here


            lh.addEntry(data);
        }

        bs.get(3).shutdown();
        BookieServer server = new BookieServer(bsConfs.get(3));
        server.start();
        bs.set(3, server);

        assertEquals(numEntries - 1 , lh.getLastAddConfirmed());
        Enumeration<LedgerEntry> entries = lh.readEntries(0, lh.getLastAddConfirmed());
View Full Code Here

            lh.addEntry(data);
        }

        bs.get(3).shutdown();
        BookieServer server = new BookieServer(bsConfs.get(3));
        server.start();
        bs.set(3, server);

        assertEquals(numEntries - 1 , lh.getLastAddConfirmed());
        Enumeration<LedgerEntry> entries = lh.readEntries(0, lh.getLastAddConfirmed());
View Full Code Here

     */
    protected BookieServer startBookie(ServerConfiguration conf)
            throws IOException, InterruptedException, KeeperException,
            BookieException, UnavailableException, CompatibilityException {
        BookieServer server = new BookieServer(conf);
        server.start();

        int port = conf.getBookiePort();
        while(bkc.getZkHandle().exists("/ledgers/available/" + InetAddress.getLocalHost().getHostAddress() + ":" + port, false) == null) {
            Thread.sleep(500);
        }
View Full Code Here

            @Override
            protected Bookie newBookie(ServerConfiguration conf) {
                return b;
            }
        };
        server.start();

        int port = conf.getBookiePort();
        while(bkc.getZkHandle().exists("/ledgers/available/" + InetAddress.getLocalHost().getHostAddress() + ":" + port, false) == null) {
            Thread.sleep(500);
        }
View Full Code Here

            }

            ServerConfiguration conf = newServerConfiguration(PortManager.nextFreePort(),
                                                              zkUtil.getZooKeeperConnectString(), f, new File[] { f });
            server = new BookieServer(conf);
            server.start();

            int secondsToWait = 5;
            while (!server.isRunning()) {
                Thread.sleep(1000);
                if (secondsToWait-- <= 0) {
View Full Code Here

        int port = 12555;
        conf.setZkServers(null).setBookiePort(port).setJournalDirName(
                tmpDir.getPath()).setLedgerDirNames(
                new String[] { tmpDir.getPath() });
        BookieServer bs1 = new BookieServer(conf);
        bs1.start();

        // starting bk server with same conf
        try {
            BookieServer bs2 = new BookieServer(conf);
            bs2.start();
View Full Code Here

        bs1.start();

        // starting bk server with same conf
        try {
            BookieServer bs2 = new BookieServer(conf);
            bs2.start();
            fail("Should throw BindException, as the bk server is already running!");
        } catch (BindException be) {
            Assert.assertTrue("BKServer allowed duplicate startups!", be
                    .getMessage().contains("Address already in use"));
        }
View Full Code Here

     *            Server Configuration Object
     *
     */
    private BookieServer startBookie(ServerConfiguration conf) throws Exception {
        BookieServer server = new TestBookieServer(conf);
        server.start();

        int port = conf.getBookiePort();
        while(zk.exists("/ledgers/available/" + InetAddress.getLocalHost().getHostAddress() + ":" + port, false) == null) {
            Thread.sleep(500);
        }
View Full Code Here

                zkc.close();
                return bookie;
            };
        };

        bkServer.start();
        bkServer.join();
        Assert.assertEquals("Failed to return ExitCode.ZK_REG_FAIL",
                ExitCode.ZK_REG_FAIL, bkServer.getExitCode());
    }
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.