Package org.apache.bookkeeper.proto

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


        f.mkdir();

        ServerConfiguration conf = newServerConfiguration(port, HOSTPORT, f, new File[] { f });

        BookieServer server = new BookieServer(conf);
        server.start();
        bs.add(server);

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


        File tmpDir = FileUtils.createTempDirectory(
                PREFIX + (nextPort - initialPort), SUFFIX);
        ServerConfiguration conf = newServerConfiguration(
                nextPort++, hostPort, tmpDir, new File[] { tmpDir });
        BookieServer bs = new BookieServer(conf);
        bs.start();
        bookiesList.add(bs);
    }

    protected ServerConfiguration newServerConfiguration(int port, String zkServers, File journalDir, File[] ledgerDirs) {
        ServerConfiguration conf = new ServerConfiguration(baseConf);
View Full Code Here

                ServerConfiguration conf = newServerConfiguration(
                    initialPort + i, HOSTPORT, f, new File[] { f });
                bsConfs.add(conf);

                BookieServer server = new BookieServer(conf);
                server.start();
                bs.add(server);
            }

            baseClientConf.setZkServers("127.0.0.1");
            if (numBookies > 0) {
View Full Code Here

            ServerConfiguration conf = bsConfs.get(j);
            if (null != newConf) {
                conf.loadConf(newConf);
            }
            BookieServer server = new BookieServer(conf);
            server.start();
            bs.add(server);
            j++;
        }
    }
View Full Code Here

                }
            }

            ServerConfiguration conf = newServerConfiguration(initialPort + 1, HOSTPORT, 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

    bookieConf.setZkServers(zkEnsemble);
    bookieConf.setJournalDirName(tmpdir.getPath());
    bookieConf.setLedgerDirNames(new String[] { tmpdir.getPath() });

    BookieServer b = new BookieServer(bookieConf);
    b.start();
    for (int i = 0; i < 10 && !b.isRunning(); i++) {
      Thread.sleep(10000);
    }
    if (!b.isRunning()) {
      throw new IOException("Bookie would not start");
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

     *            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

     *
     */
    protected BookieServer startBookie(ServerConfiguration conf)
            throws Exception {
        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

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.