Class BrokerRequestHandlerDelegate
- java.lang.Object
-
- org.apache.pinot.broker.requesthandler.BrokerRequestHandlerDelegate
-
- All Implemented Interfaces:
BrokerRequestHandler
public class BrokerRequestHandlerDelegate extends Object implements BrokerRequestHandler
BrokerRequestHandlerDelegatedelegates the inbound broker request to one of the enabledBrokerRequestHandlerbased on the requested handle type. {@see: @CommonConstant
-
-
Constructor Summary
Constructors Constructor Description BrokerRequestHandlerDelegate(String brokerId, BrokerRequestHandler singleStageBrokerRequestHandler, BrokerRequestHandler multiStageBrokerRequestHandler, org.apache.pinot.common.metrics.BrokerMetrics brokerMetrics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancelQuery(long queryId, int timeoutMs, Executor executor, org.apache.http.conn.HttpClientConnectionManager connMgr, Map<String,Integer> serverResponses)Cancel a query as identified by the queryId.Map<Long,String>getRunningQueries()org.apache.pinot.common.response.BrokerResponsehandleRequest(com.fasterxml.jackson.databind.JsonNode request, org.apache.pinot.sql.parsers.SqlNodeAndOptions sqlNodeAndOptions, RequesterIdentity requesterIdentity, org.apache.pinot.spi.trace.RequestContext requestContext, javax.ws.rs.core.HttpHeaders httpHeaders)voidshutDown()voidstart()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pinot.broker.requesthandler.BrokerRequestHandler
handleRequest
-
-
-
-
Constructor Detail
-
BrokerRequestHandlerDelegate
public BrokerRequestHandlerDelegate(String brokerId, BrokerRequestHandler singleStageBrokerRequestHandler, @Nullable BrokerRequestHandler multiStageBrokerRequestHandler, org.apache.pinot.common.metrics.BrokerMetrics brokerMetrics)
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfaceBrokerRequestHandler
-
shutDown
public void shutDown()
- Specified by:
shutDownin interfaceBrokerRequestHandler
-
handleRequest
public org.apache.pinot.common.response.BrokerResponse handleRequest(com.fasterxml.jackson.databind.JsonNode request, @Nullable org.apache.pinot.sql.parsers.SqlNodeAndOptions sqlNodeAndOptions, @Nullable RequesterIdentity requesterIdentity, org.apache.pinot.spi.trace.RequestContext requestContext, javax.ws.rs.core.HttpHeaders httpHeaders) throws Exception- Specified by:
handleRequestin interfaceBrokerRequestHandler- Throws:
Exception
-
getRunningQueries
public Map<Long,String> getRunningQueries()
- Specified by:
getRunningQueriesin interfaceBrokerRequestHandler
-
cancelQuery
public boolean cancelQuery(long queryId, int timeoutMs, Executor executor, org.apache.http.conn.HttpClientConnectionManager connMgr, Map<String,Integer> serverResponses) throws ExceptionDescription copied from interface:BrokerRequestHandlerCancel a query as identified by the queryId. This method is non-blocking so the query may still run for a while after calling this method. This cancel method can be called multiple times.- Specified by:
cancelQueryin interfaceBrokerRequestHandler- Parameters:
queryId- the unique Id assigned to the query by the brokertimeoutMs- timeout to wait for servers to respond the cancel requestsexecutor- to send cancel requests to servers in parallelconnMgr- to provide the http connectionsserverResponses- to collect cancel responses from all servers if a map is provided- Returns:
- true if there is a running query for the given queryId.
- Throws:
Exception
-
-