Skip to content

Commit

Permalink
get online brokers in pinot spark connector
Browse files Browse the repository at this point in the history
  • Loading branch information
rohityadav1993 committed Jan 13, 2025
1 parent e81ba83 commit ec949a9
Showing 1 changed file with 2 additions and 2 deletions.
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"
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

0 comments on commit ec949a9

Please sign in to comment.