Vanlightly commented on a change in pull request #2936:
URL: https://github.com/apache/bookkeeper/pull/2936#discussion_r772939852
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
##########
@@ -1013,4 +1077,91 @@ public void diskJustWritable(File disk) {
}
};
}
+
+ @Override
+ public void setLimboState(long ledgerId) throws IOException {
+ if (log.isDebugEnabled()) {
+ log.debug("setLimboState. ledger: {}", ledgerId);
+ }
+ ledgerIndex.setLimbo(ledgerId);
+ }
+
+ @Override
+ public boolean hasLimboState(long ledgerId) throws IOException {
+ if (log.isDebugEnabled()) {
+ log.debug("hasLimboState. ledger: {}", ledgerId);
+ }
+ return ledgerIndex.get(ledgerId).getLimbo();
+ }
+
+ @Override
+ public void clearLimboState(long ledgerId) throws IOException {
+ if (log.isDebugEnabled()) {
+ log.debug("clearLimboState. ledger: {}", ledgerId);
+ }
+ ledgerIndex.clearLimbo(ledgerId);
+ }
+
+ private void throwIfLimbo(long ledgerId) throws IOException,
BookieException {
Review comment:
I used a subclass of BookieException as I try to follow the existing
approaches to things. So I guess the question is why do we have a
BookieException with subclasses? Is there a guideline for how to use it
correctly or is the use of BookieException in general something we need to
start refactoring out?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]