Package org.apache.bookkeeper.conf

Examples of org.apache.bookkeeper.conf.ServerConfiguration


        return server;
    }

    protected ServerConfiguration newServerConfiguration(int port, String zkServers, File journalDir, File[] ledgerDirs) {
        ServerConfiguration conf = new ServerConfiguration(baseConf);
        conf.setAllowLoopback(true);
        conf.setBookiePort(port);
        conf.setZkServers(zkServers);
        conf.setJournalDirName(journalDir.getPath());
        String[] ledgerDirNames = new String[ledgerDirs.length];
        for (int i=0; i<ledgerDirs.length; i++) {
            ledgerDirNames[i] = ledgerDirs[i].getPath();
        }
        conf.setLedgerDirNames(ledgerDirNames);
        return conf;
    }
View Full Code Here


        @Override
        int runCmd(CommandLine cmdLine) throws Exception {
            boolean interactive = (!cmdLine.hasOption("n"));
            boolean force = cmdLine.hasOption("f");

            ServerConfiguration conf = new ServerConfiguration(bkConf);
            boolean result = Bookie.format(conf, interactive, force);
            return (result) ? 0 : 1;
        }
View Full Code Here

        Bookie.checkDirectoryStructure(Bookie.getCurrentDirectory(ledgerDir));

        writePreV2Journal(Bookie.getCurrentDirectory(journalDir), 100);
        writeIndexFileForLedger(Bookie.getCurrentDirectory(ledgerDir), 1, "testPasswd".getBytes());

        ServerConfiguration conf = new ServerConfiguration()
            .setAllowLoopback(true)
            .setZkServers(null)
            .setJournalDirName(journalDir.getPath())
            .setLedgerDirNames(new String[] { ledgerDir.getPath() });
View Full Code Here

        ledgerDir.mkdir();
        Bookie.checkDirectoryStructure(Bookie.getCurrentDirectory(ledgerDir));

        writeJunkJournal(Bookie.getCurrentDirectory(journalDir));

        ServerConfiguration conf = new ServerConfiguration()
            .setAllowLoopback(true)
            .setZkServers(null)
            .setJournalDirName(journalDir.getPath())
            .setLedgerDirNames(new String[] { ledgerDir.getPath() });
        Bookie b = null;
View Full Code Here

        ledgerDir.mkdir();
        Bookie.checkDirectoryStructure(Bookie.getCurrentDirectory(ledgerDir));

        writePreV2Journal(Bookie.getCurrentDirectory(journalDir), 0);

        ServerConfiguration conf = new ServerConfiguration()
            .setAllowLoopback(true)
            .setZkServers(null)
            .setJournalDirName(journalDir.getPath())
            .setLedgerDirNames(new String[] { ledgerDir.getPath() });
View Full Code Here

        ledgerDir.mkdir();
        Bookie.checkDirectoryStructure(Bookie.getCurrentDirectory(ledgerDir));

        writePostV2Journal(Bookie.getCurrentDirectory(journalDir), 0);

        ServerConfiguration conf = new ServerConfiguration()
            .setAllowLoopback(true)
            .setZkServers(null)
            .setJournalDirName(journalDir.getPath())
            .setLedgerDirNames(new String[] { ledgerDir.getPath() });
View Full Code Here

     * then a failure/crash in the autorecovery daemon will not take down the
     * bookie also.
     */
    @Test(timeout=30000)
    public void testAutorecoveryFailureDoesntKillBookie() throws Exception {
        ServerConfiguration conf = newServerConfiguration().setAutoRecoveryDaemonEnabled(true);
        BookieServer bs = startBookie(conf);

        assertNotNull("Autorecovery daemon should exist", bs.autoRecoveryMain);
        assertTrue("Bookie should be running", bs.isBookieRunning());
        bs.autoRecoveryMain.shutdown();
        Thread.sleep(conf.getDeathWatchInterval()*2); // give deathwatcher time to run
        assertTrue("Bookie should be running", bs.isBookieRunning());
        bs.shutdown();
    }
View Full Code Here

        jc.getBufferedChannel().write(ByteBuffer.wrap("JunkJunkJunk".getBytes()));
        jc.getBufferedChannel().flush(true);

        writeIndexFileForLedger(ledgerDir, 1, "testPasswd".getBytes());

        ServerConfiguration conf = new ServerConfiguration()
            .setAllowLoopback(true)
            .setZkServers(null)
            .setJournalDirName(journalDir.getPath())
            .setLedgerDirNames(new String[] { ledgerDir.getPath() });
View Full Code Here

        jc.fc.force(false);

        writeIndexFileForLedger(Bookie.getCurrentDirectory(ledgerDir),
                                1, "testPasswd".getBytes());

        ServerConfiguration conf = new ServerConfiguration()
            .setAllowLoopback(true)
            .setZkServers(null)
            .setJournalDirName(journalDir.getPath())
            .setLedgerDirNames(new String[] { ledgerDir.getPath() });
View Full Code Here

        jc.fc.force(false);

        writeIndexFileForLedger(Bookie.getCurrentDirectory(ledgerDir),
                                1, "testPasswd".getBytes());

        ServerConfiguration conf = new ServerConfiguration()
            .setAllowLoopback(true)
            .setZkServers(null)
            .setJournalDirName(journalDir.getPath())
            .setLedgerDirNames(new String[] { ledgerDir.getPath() });
View Full Code Here

TOP

Related Classes of org.apache.bookkeeper.conf.ServerConfiguration

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.