Skip to content

Implement a method to get all the Bookies#2117

Merged
eolivelli merged 3 commits intoapache:masterfrom
mino181295:allbookies
Jul 12, 2019
Merged

Implement a method to get all the Bookies#2117
eolivelli merged 3 commits intoapache:masterfrom
mino181295:allbookies

Conversation

@mino181295
Copy link
Contributor

In this PR I'm adding a BokKeeperAdmin#getAllBookies to retrive all the bookies (cookie) retriving them from the RegistrationClient

This is still a work in progress, I'm adding some tests in the next commit.

@mino181295 mino181295 changed the title Implement a method to get all the Bookies #2114 Implement a method to get all the Bookies Jun 27, 2019
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

Looks good to me.
Please add tests then from my point of view we are good to go

@sijie @ivankelly

@eolivelli
Copy link
Contributor

Please add tests and check CI failures

@jvrao
Copy link
Contributor

jvrao commented Jul 2, 2019

Looks fine to me and it really doesn't intercept what we are doing. I guess tests are needed

Code.NONODE.intValue(), null, null);

try {
result(zkRegistrationClient.getReadOnlyBookies());
Copy link
Contributor

Choose a reason for hiding this comment

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

getAllBookies ?

private final String cookiePath;
// registration paths
protected final String bookieRegistrationPath;
protected final String bookieFaultyRegistrationPath;
Copy link
Contributor

Choose a reason for hiding this comment

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

This variable seems useless

.apply(same(shell.bkConf), same(mockListBookiesFlags));
verify(mockListBookiesFlags, times(1)).readonly(true);
verify(mockListBookiesFlags, times(1)).readwrite(false);
verify(mockListBookiesFlags, times(1)).all(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this test passing? I would expect 'false' here

@mino181295 mino181295 marked this pull request as ready for review July 11, 2019 17:40
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

Looks good to me

@jvrao @sijie @reddycharan can you take a look?

@eolivelli
Copy link
Contributor

eolivelli commented Jul 16, 2019

@mino181295
I am seeing this error on CI (#2106) on a precommit job, can you please check and send a fix ?

2019-07-16 12:06:26,599 - ERROR - [main:DiscoveryCommand@61] - Fail to process command 'list'
java.lang.NullPointerException
	at org.apache.bookkeeper.common.concurrent.FutureUtils.result(FutureUtils.java:72)
	at org.apache.bookkeeper.common.concurrent.FutureUtils.result(FutureUtils.java:61)
	at org.apache.bookkeeper.tools.cli.commands.bookies.ListBookiesCommand.run(ListBookiesCommand.java:103)
	at org.apache.bookkeeper.tools.cli.commands.bookies.ListBookiesCommand.run(ListBookiesCommand.java:39)
	at org.apache.bookkeeper.tools.cli.helpers.DiscoveryCommand.apply(DiscoveryCommand.java:57)
	at org.apache.bookkeeper.tools.cli.helpers.ClientCommand.apply(ClientCommand.java:54)
	at org.apache.bookkeeper.tools.common.BKCommand.apply(BKCommand.java:94)
	at org.apache.bookkeeper.tools.common.BKCommand.lambda$apply$0(BKCommand.java:49)
	at org.apache.bookkeeper.tools.framework.Cli.run(Cli.java:224)
	at org.apache.bookkeeper.tools.framework.Cli.runCli(Cli.java:244)
	at org.apache.bookkeeper.tools.common.BKCommand.apply(BKCommand.java:51)
	at org.apache.bookkeeper.tools.cli.commands.bookies.ListBookiesCommandTest.testCommand(ListBookiesCommandTest.java:157)
	at org.apache.bookkeeper.tools.cli.commands.bookies.ListBookiesCommandTest.testListNoArgs(ListBookiesCommandTest.java:135)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

@mino181295 mino181295 deleted the allbookies branch July 18, 2019 08:29
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