Skip to content

Conversation

@zwOvO
Copy link
Contributor

@zwOvO zwOvO commented Jan 18, 2024

Motivation

Start the bookie server by cmd and specify multiple journalDir
such as: docker/k8s pod

Changes

Master Issue: #4180

Support specifying multiple journalDirs for the bookie server start cmd options

@zwOvO zwOvO changed the title [improve] Support specifying multiple journalDir as bookie start command parameters [improve] Support specifying multiple journalDirs for the bookie server start cmd options Jan 19, 2024
String sJournalDir = cmdLine.getOptionValue('j');
log.info("Get cmdline journal dir: {}", sJournalDir);
conf.setJournalDirName(sJournalDir);
String[] sJournalDirs = cmdLine.getOptionValue('j');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmdLine.getOptionValues('j')?

BK_OPTS.addOption("m", "zkledgerpath", true, "Zookeeper ledgers root path");
BK_OPTS.addOption("p", "bookieport", true, "bookie port exported");
BK_OPTS.addOption("hp", "httpport", true, "bookie http port exported");
BK_OPTS.addOption("j", "journal", true, "bookie journal directory");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is a broken change? What happens if people still use BK_journalDirectory instead of BK_journalDirectories after upgrading?

We can retain the original parameters to ensure compatibility.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't break compatibility

BK_OPTS.addOption("m", "zkledgerpath", true, "Zookeeper ledgers root path");
BK_OPTS.addOption("p", "bookieport", true, "bookie port exported");
BK_OPTS.addOption("hp", "httpport", true, "bookie http port exported");
BK_OPTS.addOption("j", "journal", true, "bookie journal directory");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't break compatibility

export BK_httpServerEnabled=${BK_httpServerEnabled:-"true"}
export BK_httpServerPort=${BK_httpServerPort:-${BOOKIE_HTTP_PORT}}
export BK_journalDirectory=${BK_journalDirectory:-${BK_DATA_DIR}/journal}
export BK_journalDirectories=${BK_journalDirectories:-${BK_journalDirectory:-${BK_DATA_DIR}/journal}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BK_OPTS.addOption("p", "bookieport", true, "bookie port exported");
BK_OPTS.addOption("hp", "httpport", true, "bookie http port exported");
BK_OPTS.addOption("j", "journal", true, "bookie journal directory");
Option journalDirs = new Option ("j", "journaldirs", true, "bookie journal directories");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eolivelli I didn't break the compatibility

@eolivelli eolivelli modified the milestones: 4.17.0, 4.18.0 Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants