This is an automated email from the ASF dual-hosted git repository.
mmerli 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 e6a3aa7 y
e6a3aa7 is described below
commit e6a3aa7e488b87a6d0d08c5bae8564a944815ad7
Author: Ivan Kelly <[email protected]>
AuthorDate: Thu Apr 5 14:40:55 2018 -0700
y
Previously it was not duplicating, so the underlying ByteBuf was being
returned to the client, and this was having its reader index modified,
which meant that if it was read again, the data could not be read.
By calling duplicate() on the LedgerEntryImpl, the underlying ByteBuf
is sliced and retained, so it has a new set of indices. The retention
does nothing, as the buffer is unpooled.
Author: Ivan Kelly <[email protected]>
Reviewers: Enrico Olivelli <[email protected]>, Matteo Merli
<[email protected]>
This closes #1318 from ivankelly/dup-mock
---
.../src/test/java/org/apache/bookkeeper/client/MockLedgerHandle.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MockLedgerHandle.java
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MockLedgerHandle.java
index 6b4bea4..838ed5b 100644
---
a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MockLedgerHandle.java
+++
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MockLedgerHandle.java
@@ -108,7 +108,7 @@ public class MockLedgerHandle extends LedgerHandle {
final Queue<LedgerEntry> seq = new ArrayDeque<LedgerEntry>();
long entryId = firstEntry;
while (entryId <= lastEntry && entryId < entries.size()) {
- seq.add(new LedgerEntry(entries.get((int) entryId++)));
+ seq.add(new LedgerEntry(entries.get((int)
entryId++).duplicate()));
}
log.debug("Entries read: {}", seq);
--
To stop receiving notification emails like this one, please contact
[email protected].