Search in sources :

Example 1 with RoutingTableLookupRequest

use of com.linkedin.pinot.routing.RoutingTableLookupRequest in project pinot by linkedin.

the class BrokerRequestHandler method findCandidateServers.

/**
   * Find the candidate servers to be queried for each set of segments from the routing table.
   *
   * @param brokerRequest broker request.
   * @return map from server to set of segments.
   */
@Nullable
private Map<ServerInstance, SegmentIdSet> findCandidateServers(@Nonnull BrokerRequest brokerRequest) {
    String tableName = brokerRequest.getQuerySource().getTableName();
    List<String> routingOptions;
    Map<String, String> debugOptions = brokerRequest.getDebugOptions();
    if (debugOptions == null || !debugOptions.containsKey("routingOptions")) {
        routingOptions = Collections.emptyList();
    } else {
        routingOptions = Splitter.on(",").omitEmptyStrings().trimResults().splitToList(debugOptions.get("routingOptions"));
    }
    RoutingTableLookupRequest routingTableLookupRequest = new RoutingTableLookupRequest(tableName, routingOptions);
    return _routingTable.findServers(routingTableLookupRequest);
}
Also used : RoutingTableLookupRequest(com.linkedin.pinot.routing.RoutingTableLookupRequest) Nullable(javax.annotation.Nullable)

Aggregations

RoutingTableLookupRequest (com.linkedin.pinot.routing.RoutingTableLookupRequest)1 Nullable (javax.annotation.Nullable)1