horizonzy commented on code in PR #4210:
URL: https://github.com/apache/bookkeeper/pull/4210#discussion_r1494321096
##########
bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperTest.java:
##########
@@ -610,6 +610,185 @@ public void testReadWriteWithV2WireProtocol() throws
Exception {
}
}
+ @Test
+ public void testBatchReadFailBackToSingleRead1() throws Exception {
+ ClientConfiguration conf = new ClientConfiguration();
+ conf.setMetadataServiceUri(zkUtil.getMetadataServiceUri());
+ int numEntries = 100;
+ byte[] data = "foobar".getBytes();
+ try (BookKeeper bkc = new BookKeeper(conf)) {
+ // basic read/write
+ {
+ long ledgerId;
+ try (LedgerHandle lh = bkc.createLedger(2, 2, 2,
+ digestType, "testPasswd".getBytes())) {
+ ledgerId = lh.getId();
+ for (int i = 0; i < numEntries; i++) {
+ lh.addEntry(data);
+ }
+ }
+ try (LedgerHandle lh = bkc.openLedger(ledgerId, digestType,
"testPasswd".getBytes())) {
+ assertEquals(numEntries - 1, lh.readLastConfirmed());
+ //V2 protocol not support batch read. In theory, it will
throw UnsupportedOperationException.
Review Comment:
Yes, I will correct it.
--
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]