This is an automated email from the ASF dual-hosted git repository.
sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new cfd0428 Misc LedgerHandle changes
cfd0428 is described below
commit cfd0428d3f5661505132a31ffcc7a68dda2115a2
Author: Samuel Just <[email protected]>
AuthorDate: Tue Dec 19 18:39:39 2017 -0800
Misc LedgerHandle changes
Adds logging for new ensembles, a getCtime call, and a check for
ReadOnlyLedgerHandle in initializeExplicitLacInterval.
Author: Samuel Just <[email protected]>
Reviewers: Sijie Guo <[email protected]>
This closes #892 from athanatos/forupstream/misc-ledgerhandle-changes
---
.../java/org/apache/bookkeeper/client/LedgerHandle.java | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
index d761530..e34ec27 100644
---
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
+++
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
@@ -219,7 +219,7 @@ public class LedgerHandle implements WriteHandle {
}
protected void initializeExplicitLacFlushPolicy() {
- if (!metadata.isClosed() && bk.getExplicitLacInterval() > 0) {
+ if (!metadata.isClosed() && !(this instanceof ReadOnlyLedgerHandle) &&
bk.getExplicitLacInterval() > 0) {
explicitLacFlushPolicy = new
ExplicitLacFlushPolicy.ExplicitLacFlushPolicyImpl(this);
} else {
explicitLacFlushPolicy =
ExplicitLacFlushPolicy.VOID_EXPLICITLAC_FLUSH_POLICY;
@@ -340,6 +340,15 @@ public class LedgerHandle implements WriteHandle {
}
/**
+ * Returns the ledger creation time.
+ *
+ * @return the ledger creation time
+ */
+ public long getCtime() {
+ return this.metadata.getCtime();
+ }
+
+ /**
* Get the Distribution Schedule.
*
* @return DistributionSchedule for the LedgerHandle
@@ -1648,6 +1657,8 @@ public class LedgerHandle implements WriteHandle {
// We've successfully changed an ensemble
ensembleChangeCounter.inc();
+ LOG.info("New Ensemble: {} for ledger: {}",
ensembleInfo.newEnsemble, ledgerId);
+
// the failed bookie has been replaced
unsetSuccessAndSendWriteRequest(ensembleInfo.replacedBookies);
}
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].