Skip to content

Commit

Permalink
add comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
horizonzy committed Jan 30, 2024
1 parent 09dc215 commit ec91972
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,8 @@ public void asyncBatchReadEntries(long startEntry, int maxCount, long maxSize, b
asyncBatchReadEntriesInternal(startEntry, maxCount, maxSize, new ReadCallback() {
@Override
public void readComplete(int rc, LedgerHandle lh, Enumeration<LedgerEntry> seq, Object ctx) {
//If the bookie server not support the batch read request, the bookie server will close the
// connection, then get the BookieHandleNotAvailableException.
if (rc == Code.BookieHandleNotAvailableException) {
notSupportBatch = true;
if (failbackToSingleRead) {
Expand Down Expand Up @@ -870,6 +872,8 @@ public void asyncBatchReadUnconfirmedEntries(long startEntry, int maxCount, long
asyncBatchReadEntriesInternal(startEntry, maxCount, maxSize, new ReadCallback() {
@Override
public void readComplete(int rc, LedgerHandle lh, Enumeration<LedgerEntry> seq, Object ctx) {
//If the bookie server not support the batch read request, the bookie server will close the
// connection, then get the BookieHandleNotAvailableException.
if (rc == Code.BookieHandleNotAvailableException) {
notSupportBatch = true;
if (failbackToSingleRead) {
Expand Down Expand Up @@ -951,6 +955,8 @@ public CompletableFuture<LedgerEntries> batchReadAsync(long startEntry, int maxC
batchReadEntriesInternalAsync(startEntry, maxCount, maxSize, false)
.whenComplete((entries, ex) -> {
if (ex != null) {
//If the bookie server not support the batch read request, the bookie server will close the
// connection, then get the BookieHandleNotAvailableException.
if (ex instanceof BKException.BKBookieHandleNotAvailableException) {
notSupportBatch = true;
if (failbackToSingleRead) {
Expand Down

0 comments on commit ec91972

Please sign in to comment.