Skip to content

Commit

Permalink
fix(s3stream): fix potential NPE in compaction (#552)
Browse files Browse the repository at this point in the history
Signed-off-by: Shichao Nie <[email protected]>
  • Loading branch information
SCNieh authored Nov 2, 2023
1 parent 1e0bcb1 commit c82e456
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,9 @@ private void logCompactionPlans(List<CompactionPlan> compactionPlans, Set<Long>
.mapToLong(CompactedObject::size)
.sum())
.sum();
logger.info("Compaction plans: expect to generate {} StreamObject, 1 WAL object with size {} in {} iterations, objects excluded: {}",
streamObjectNum, walObjectSize, compactionPlans.size(), excludedObjectIds);
int walObjectNum = walObjectSize > 0 ? 1 : 0;
logger.info("Compaction plans: expect to generate {} Stream Object, {} WAL object with size {} in {} iterations, objects excluded: {}",
streamObjectNum, walObjectNum, walObjectSize, compactionPlans.size(), excludedObjectIds);
}

public CompletableFuture<Void> forceSplitAll() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public static List<ObjectStreamRange> buildObjectStreamRange(List<StreamDataBloc
}
}
}
objectStreamRanges.add(currObjectStreamRange);
if (currObjectStreamRange != null) {
objectStreamRanges.add(currObjectStreamRange);
}
return objectStreamRanges;
}

Expand Down

0 comments on commit c82e456

Please sign in to comment.