Skip to content

Commit d62a9d7

Browse files
Remove redundant get Stats call (#160)
* fix get stats twice * empty * empty
1 parent bc5b3d9 commit d62a9d7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/scala/org/apache/spark/sql/pulsar/PulsarHelper.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,7 @@ class PulsarAdmissionControlHelper(adminUrl: String, conf: ju.Map[String, Object
539539
val startLedgerId = getLedgerId(startMessageId)
540540
val startEntryId = getEntryId(startMessageId)
541541
val stats = pulsarAdmin.topics.getInternalStats(topicPartition)
542-
val ledgers = pulsarAdmin.topics.getInternalStats(topicPartition).ledgers.
543-
asScala.filter(_.ledgerId >= startLedgerId).sortBy(_.ledgerId)
542+
val ledgers = stats.ledgers.asScala.filter(_.ledgerId >= startLedgerId).sortBy(_.ledgerId)
544543
// The last ledger of the ledgers list doesn't have .size or .entries
545544
// properly populated, and the corresponding info is in currentLedgerSize
546545
// and currentLedgerEntries

0 commit comments

Comments
 (0)