public class WeightCheckRequestHandler extends BaseDataRequestHandler
Modifier and Type | Field and Description |
---|---|
protected DataRequestHandler |
next |
protected QueryWeightUtil |
queryWeightUtil |
protected DruidWebService |
webService |
mapper, writer
Constructor and Description |
---|
WeightCheckRequestHandler(DataRequestHandler next,
DruidWebService webService,
QueryWeightUtil queryWeightUtil,
com.fasterxml.jackson.databind.ObjectMapper mapper)
Build a weight checking request handler.
|
Modifier and Type | Method and Description |
---|---|
protected SuccessCallback |
buildSuccessCallback(RequestContext context,
DataApiRequest request,
DruidAggregationQuery<?> druidQuery,
ResponseProcessor response,
long queryRowLimit)
Build a callback which continues the original request or refuses it with an HTTP INSUFFICIENT_STORAGE (507)
status based on the cardinality of the requester 's query as measured by the weight check query.
|
boolean |
handleRequest(RequestContext context,
DataApiRequest request,
DruidAggregationQuery<?> druidQuery,
ResponseProcessor response)
Handle the response, passing the request down the chain as necessary.
|
@NotNull protected final DataRequestHandler next
@NotNull protected final DruidWebService webService
@NotNull protected final QueryWeightUtil queryWeightUtil
public WeightCheckRequestHandler(DataRequestHandler next, DruidWebService webService, QueryWeightUtil queryWeightUtil, com.fasterxml.jackson.databind.ObjectMapper mapper)
next
- The request handler to delegate the request to.webService
- The web service to use for weight checkingqueryWeightUtil
- A provider which measures estimated weight against allowed weights.mapper
- A JSON object mapper, used to parse the JSON response from the weight check.public boolean handleRequest(RequestContext context, DataApiRequest request, DruidAggregationQuery<?> druidQuery, ResponseProcessor response)
DataRequestHandler
context
- The context for the Requestrequest
- The Api Request ObjectdruidQuery
- The druid queryresponse
- The Async responseprotected SuccessCallback buildSuccessCallback(RequestContext context, DataApiRequest request, DruidAggregationQuery<?> druidQuery, ResponseProcessor response, long queryRowLimit)
context
- The context data from the request processing chainrequest
- The API request itselfdruidQuery
- The query being processedresponse
- the response handlerqueryRowLimit
- The number of aggregating lines allowedCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.