Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason918 committed Nov 18, 2022
1 parent d41427d commit 9295d45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,10 @@ public void operationComplete(MLDataFormats.ManagedLedgerInfo mlInfo, Stat stat)
log.debug("[{}][{}] Source ML info:{}", name, sourceMLName, mlInfo);
}
sourceLedgersStat = stat;
// Fails if init with empty ledger. Very small chance here, since shadow topic is
// created when source topic exists.
if (mlInfo.getLedgerInfoCount() == 0) {
// Small chance here, since shadow topic is created after source topic exists.
log.warn("[{}] Source topic ledger list is empty! source={},mlInfo={},stat={}", name, sourceMLName,
mlInfo, stat);
// callback.initializeFailed(new ManagedLedgerException.ManagedLedgerSourceNotReadyException(
// "Source managed ledger " + sourceMLName + " is not ready yet."));
ShadowManagedLedgerImpl.super.initialize(callback, ctx);
return;
}
Expand Down Expand Up @@ -281,7 +278,8 @@ protected synchronized void internalAsyncAddEntry(OpAddEntry addOperation) {
private synchronized void processSourceManagedLedgerInfo(MLDataFormats.ManagedLedgerInfo mlInfo, Stat stat) {

if (log.isDebugEnabled()) {
log.debug("[{}][{}] new SourceManagedLedgerInfo:{}", name, sourceMLName, mlInfo);
log.debug("[{}][{}] new SourceManagedLedgerInfo:{}, prevStat={},stat={}", name, sourceMLName, mlInfo,
sourceLedgersStat, stat);
}

sourceLedgersStat = stat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ public TransportCnx getCnx() {
return this.cnx;
}

/**
* MessagePublishContext implements Position because that ShadowManagedLedger need to know the source position info.
*/
private static final class MessagePublishContext implements PublishContext, Runnable, Position {
/*
* To store context information built by message payload
Expand Down

0 comments on commit 9295d45

Please sign in to comment.