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

get online brokers in pinot spark connector #14802

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import scala.util.{Failure, Success, Try}
*/
private[pinot] object PinotClusterClient extends Logging {
private val TABLE_SCHEMA_TEMPLATE = "http://%s/tables/%s/schema"
private val TABLE_BROKER_INSTANCES_TEMPLATE = "http://%s/v2/brokers/tables/%s"
private val LIVE_BROKERS_TEMPLATE = "http://%s/tables/livebrokers?tables=%s"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usage is incorrect. table goes in the path

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API with path param was deprecated in favour of this one in #12201

private val TIME_BOUNDARY_TEMPLATE = "http://%s/debug/timeBoundary/%s"
private val ROUTING_TABLE_TEMPLATE = "http://%s/debug/routingTable/sql?query=%s"
private val INSTANCES_API_TEMPLATE = "http://%s/instances/%s"
Expand Down Expand Up @@ -62,7 +62,7 @@ private[pinot] object PinotClusterClient extends Logging {
*/
def getBrokerInstances(controllerUrl: String, tableName: String): List[String] = {
Try {
val uri = new URI(String.format(TABLE_BROKER_INSTANCES_TEMPLATE, controllerUrl, tableName))
val uri = new URI(String.format(LIVE_BROKERS_TEMPLATE, controllerUrl, tableName))
val response = HttpUtils.sendGetRequest(uri)
implicit val decodeIntOrString: Decoder[Either[Int, String]] =
Decoder[Int].map(Left(_)).or(Decoder[String].map(Right(_)))
Expand Down
Loading