You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/11/23 13:01:13 UTC
[GitHub] ivankelly commented on a change in pull request #1831: Make
LedgerMetadata fields for closing immutable
ivankelly commented on a change in pull request #1831: Make LedgerMetadata fields for closing immutable
URL: https://github.com/apache/bookkeeper/pull/1831#discussion_r235934148
##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerMetadataBuilder.java
##########
@@ -73,14 +73,9 @@ public static LedgerMetadataBuilder from(LedgerMetadata other) {
builder.ackQuorumSize = other.getAckQuorumSize();
builder.state = other.getState();
-
- long lastEntryId = other.getLastEntryId();
- if (lastEntryId != LedgerHandle.INVALID_ENTRY_ID) {
- builder.lastEntryId = Optional.of(lastEntryId);
- }
- long length = other.getLength();
- if (length > 0) {
- builder.length = Optional.of(length);
+ if (builder.state == LedgerMetadataFormat.State.CLOSED) {
Review comment:
The previous behaviour was incorrect. length should never be set if the state is anything but closed. I don't think it needs a comment. the intent is clear.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services