public class ResultSetResponseProcessor extends MappingResponseProcessor implements ResponseProcessor
Modifier and Type | Field and Description |
---|---|
protected DruidResponseParser |
druidResponseParser |
protected Granularity |
granularity |
protected HttpResponseMaker |
httpResponseMaker |
protected rx.subjects.Subject<PreResponse,PreResponse> |
responseEmitter |
apiRequest, headers, mappers, objectMappers, responseContext
Constructor and Description |
---|
ResultSetResponseProcessor(DataApiRequest apiRequest,
rx.subjects.Subject<PreResponse,PreResponse> responseEmitter,
DruidResponseParser druidResponseParser,
ObjectMappersSuite objectMappers,
HttpResponseMaker httpResponseMaker)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ResultSet |
buildResultSet(com.fasterxml.jackson.databind.JsonNode json,
DruidAggregationQuery<?> druidQuery,
org.joda.time.DateTimeZone dateTimeZone)
Build a result set using the api request time grain.
|
HttpErrorCallback |
getErrorCallback(DruidAggregationQuery<?> druidQuery)
Callback for handling http errors.
|
FailureCallback |
getFailureCallback(DruidAggregationQuery<?> druidQuery)
Callback handler for unexpected failures.
|
void |
processResponse(com.fasterxml.jackson.databind.JsonNode json,
DruidAggregationQuery<?> druidQuery,
LoggingContext metadata)
Process the response json and respond to the original web request.
|
buildHeaderList, buildResultSetMapperList, getDataApiRequest, getHeaders, getMappers, getObjectMappers, getResponseContext, getStandardError, getStandardFailure, mapResultSet
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getResponseContext
protected final rx.subjects.Subject<PreResponse,PreResponse> responseEmitter
protected final Granularity granularity
protected final DruidResponseParser druidResponseParser
protected HttpResponseMaker httpResponseMaker
public ResultSetResponseProcessor(DataApiRequest apiRequest, rx.subjects.Subject<PreResponse,PreResponse> responseEmitter, DruidResponseParser druidResponseParser, ObjectMappersSuite objectMappers, HttpResponseMaker httpResponseMaker)
apiRequest
- The request for which the response is being processedresponseEmitter
- The response channel to which the response will be sentdruidResponseParser
- The parser for the Druid responseobjectMappers
- Jackson mappers to use for processing JSONhttpResponseMaker
- Helper to make the HTTP responsepublic FailureCallback getFailureCallback(DruidAggregationQuery<?> druidQuery)
ResponseProcessor
getFailureCallback
in interface ResponseProcessor
druidQuery
- The query associated with this failurepublic HttpErrorCallback getErrorCallback(DruidAggregationQuery<?> druidQuery)
ResponseProcessor
getErrorCallback
in interface ResponseProcessor
druidQuery
- The query associated with this errorpublic void processResponse(com.fasterxml.jackson.databind.JsonNode json, DruidAggregationQuery<?> druidQuery, LoggingContext metadata)
ResponseProcessor
processResponse
in interface ResponseProcessor
json
- The json representing a druid data responsedruidQuery
- The query with the schema for processing this responsemetadata
- The LoggingContext to usepublic ResultSet buildResultSet(com.fasterxml.jackson.databind.JsonNode json, DruidAggregationQuery<?> druidQuery, org.joda.time.DateTimeZone dateTimeZone)
json
- The json representing the druid response.druidQuery
- The druid query being processeddateTimeZone
- The date time zone for parsing result rowsCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.