use of com.linkedin.pinot.core.query.reduce.BrokerReduceService in project pinot by linkedin.
the class BaseQueriesTest method getBrokerResponseForQuery.
/**
* Run query on multiple index segments.
* <p>Use this to test the whole flow from server to broker.
* <p>The result should be equivalent to querying 4 identical index segments.
*
* @param query PQL query.
* @return broker response.
*/
protected BrokerResponseNative getBrokerResponseForQuery(String query) {
BrokerRequest brokerRequest = COMPILER.compileToBrokerRequest(query);
// Server side.
Plan plan = PLAN_MAKER.makeInterSegmentPlan(getSegmentDataManagers(), brokerRequest, EXECUTOR_SERVICE, 10_000);
plan.execute();
DataTable instanceResponse = plan.getInstanceResponse();
// Broker side.
BrokerReduceService brokerReduceService = new BrokerReduceService();
Map<ServerInstance, DataTable> dataTableMap = new HashMap<>();
dataTableMap.put(new ServerInstance("localhost:0000"), instanceResponse);
dataTableMap.put(new ServerInstance("localhost:1111"), instanceResponse);
return brokerReduceService.reduceOnDataTable(brokerRequest, dataTableMap);
}
use of com.linkedin.pinot.core.query.reduce.BrokerReduceService in project pinot by linkedin.
the class BrokerServerBuilder method buildReduceServiceRegistry.
/**
* Build the reduce service registry for each broker response.
*/
private ReduceServiceRegistry buildReduceServiceRegistry() {
ReduceServiceRegistry reduceServiceRegistry = new ReduceServiceRegistry();
BrokerReduceService reduceService = new BrokerReduceService();
reduceServiceRegistry.register(BrokerResponseFactory.ResponseType.BROKER_RESPONSE_TYPE_NATIVE, reduceService);
reduceServiceRegistry.registerDefault(reduceService);
return reduceServiceRegistry;
}
Aggregations