Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better sequence number filtering in checkCursor #641

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@

package org.apache.spark.eventhubs.client

import com.microsoft.azure.eventhubs

import java.time.Duration
import java.util.concurrent._

import com.microsoft.azure.eventhubs._
import org.apache.spark.SparkEnv
import org.apache.spark.eventhubs.utils.MetricPlugin
Expand Down Expand Up @@ -108,12 +109,13 @@ private[client] class CachedEventHubsReceiver private (ehConf: EventHubsConf,
receiverOptions.setReceiverRuntimeMetricEnabled(true)
receiverOptions.setPrefetchCount(ehConf.prefetchCount.getOrElse(DefaultPrefetchCount))
receiverOptions.setIdentifier(s"spark-${SparkEnv.get.executorId}-$taskId")
// Avoid to filter on the last sequence number: https://github.com/Azure/azure-sdk-for-java/issues/29502
val consumer = retryJava(
EventHubsUtils.createReceiverInner(client,
ehConf.useExclusiveReceiver,
consumerGroup,
nAndP.partitionId.toString,
EventPosition.fromSequenceNumber(seqNo).convert,
eventhubs.EventPosition.fromSequenceNumber(seqNo-1, false),
receiverOptions),
"CachedReceiver creation."
)
Expand Down