Skip to content

Commit

Permalink
improve logs
Browse files Browse the repository at this point in the history
  • Loading branch information
coderzc committed Feb 27, 2023
1 parent 6c43792 commit 2316e13
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,6 @@ private void afterCreateImmutableBucket(Pair<ImmutableBucket, DelayedIndex> immu
DelayedIndex lastDelayedIndex = immutableBucketDelayedIndexPair.getRight();
snapshotSegmentLastIndexTable.put(lastDelayedIndex.getLedgerId(), lastDelayedIndex.getEntryId(),
immutableBucket);
if (log.isDebugEnabled()) {
log.debug("[{}] Create bucket snapshot, bucket: {}", dispatcher.getName(),
lastMutableBucket);
}
}
}

Expand Down Expand Up @@ -310,8 +306,10 @@ private synchronized CompletableFuture<Void> asyncMergeBucketSnapshot() {
}
ImmutableBucket immutableBucketA = values.get(minIndex);
ImmutableBucket immutableBucketB = values.get(minIndex + 1);
log.info("[{}] Merging bucket snapshot, bucketAKey: {}, bucketBKey: {}", dispatcher.getName(),
immutableBucketA.bucketKey(), immutableBucketB.bucketKey());
if (log.isDebugEnabled()) {
log.info("[{}] Merging bucket snapshot, bucketAKey: {}, bucketBKey: {}", dispatcher.getName(),
immutableBucketA.bucketKey(), immutableBucketB.bucketKey());
}
return asyncMergeBucketSnapshot(immutableBucketA, immutableBucketB).whenComplete((__, ex) -> {
if (ex != null) {
log.error("[{}] Failed to merge bucket snapshot, bucketAKey: {}, bucketBKey: {}",
Expand Down Expand Up @@ -410,8 +408,10 @@ public synchronized NavigableSet<PositionImpl> getScheduledMessages(int maxMessa
ImmutableBucket bucket = snapshotSegmentLastIndexTable.remove(ledgerId, entryId);
if (bucket != null && immutableBuckets.asMapOfRanges().containsValue(bucket)) {
final int lastSegmentEntryId = bucket.currentSegmentEntryId;
log.info("[{}] Loading next bucket snapshot segment, bucketKey: {}, nextSegmentEntryId: {}",
dispatcher.getName(), bucket.bucketKey(), lastSegmentEntryId + 1);
if (log.isDebugEnabled()) {
log.debug("[{}] Loading next bucket snapshot segment, bucketKey: {}, nextSegmentEntryId: {}",
dispatcher.getName(), bucket.bucketKey(), lastSegmentEntryId + 1);
}
// All message of current snapshot segment are scheduled, load next snapshot segment
// TODO make it asynchronous and not blocking this process
try {
Expand Down

0 comments on commit 2316e13

Please sign in to comment.