-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to new Bookkeeper Client API #163 #167
base: master
Are you sure you want to change the base?
Conversation
LOGGER.log(Level.SEVERE, "error while writing to ledger " + out, err); | ||
throw err; | ||
switch (err.getCode()) { | ||
case BKException.Code.LedgerClosedException: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel you can leave the original catch clause.
as you are still referencing old BKException.
exception.set(error); | ||
res.set(index, null); | ||
for (int j = 0; j < edits.size(); j++) { | ||
for (StatusEdit edit1 : edits) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is better to leave the counted loop
with this change you are using the Iterator ! this is more expensive
LOGGER.log(Level.SEVERE, "error while writing to ledger " + out, err); | ||
throw err; | ||
} catch (Exception err) { | ||
switch (err.getCode()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
config.setEnableParallelRecoveryRead(true); | ||
config.setThrottleValue(0); | ||
config.setEnableDigestTypeAutodetection(true); | ||
String zkConnString = "zk+null://" + zkAddress + zkPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is zkAddress ? is it a list of server addresses ?
server1:port1,server2:port2,server3:port3 ?
while (seq.hasMoreElements()) { | ||
LedgerEntry entry = seq.nextElement(); | ||
|
||
Iterator<LedgerEntry> entries = handle.read(start, end).iterator(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try (LedgerEntries entries = handle.read(start, end)) {
for (LedgerEntry entry : entries) {
..........
}
}
nextEntry = 0; | ||
continue; | ||
} | ||
try (LedgerEntries entries = handler.read(nextEntry, lastAddConfirmed)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
@@ -1042,12 +1074,24 @@ public void followTheLeader(LogSequenceNumber skipPast, BiConsumer<LogSequenceNu | |||
lastSequenceNumber = number.sequenceNumber; | |||
currentLedgerId = number.ledgerId; | |||
} | |||
} catch (BKException err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is better to leave off all of these refactor of exception handling
it is very dangerous and it makes the review more difficult
Description
Resolves #163
Formalities
Following this checklist to help us incorporate your
contribution quickly and easily:
mvn clean verify
to make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.