gaoran10 commented on code in PR #20911:
URL: https://github.com/apache/pulsar/pull/20911#discussion_r1284351207
##########
pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarSplitManager.java:
##########
@@ -328,6 +328,9 @@ Collection<PulsarSplit> getSplitsForTopic(String
topicNamePersistenceEncoding,
splits.add(pulsarSplit);
}
return splits;
+ } catch (ManagedLedgerException exception){
+ log.error(exception, "Open cursor failed");
Review Comment:
Do you want to catch the case that the managed ledger of the topic is not
existing yet? Many exceptions extend `ManagedLedgerException`, maybe we don't
need to catch all `ManagedLedgerException`.
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java:
##########
@@ -443,7 +443,8 @@ public void asyncOpenReadOnlyManagedLedger(String
managedLedgerName,
}).exceptionally(e -> {
log.error("[{}] Failed to initialize Read-only managed ledger",
managedLedgerName, e);
- callback.openReadOnlyManagedLedgerFailed((ManagedLedgerException)
e.getCause(), ctx);
Review Comment:
Why need this change? Will this cause class cast exception?
##########
pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarSplitManager.java:
##########
@@ -328,6 +328,9 @@ Collection<PulsarSplit> getSplitsForTopic(String
topicNamePersistenceEncoding,
splits.add(pulsarSplit);
}
return splits;
+ } catch (ManagedLedgerException exception){
Review Comment:
Do you want to catch the case that the managed ledger of the topic is not
existing yet? Many exceptions extend `ManagedLedgerException`, maybe we don't
need to catch all `ManagedLedgerException`.
--
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]