public class CacheV2ResponseProcessor extends Object implements ResponseProcessor
Modifier and Type | Field and Description |
---|---|
protected com.fasterxml.jackson.databind.ObjectWriter |
writer |
Constructor and Description |
---|
CacheV2ResponseProcessor(ResponseProcessor next,
String cacheKey,
TupleDataCache<String,Long,String> dataCache,
QuerySigningService<Long> querySigningService,
com.fasterxml.jackson.databind.ObjectMapper mapper)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
HttpErrorCallback |
getErrorCallback(DruidAggregationQuery<?> druidQuery)
Callback for handling http errors.
|
FailureCallback |
getFailureCallback(DruidAggregationQuery<?> druidQuery)
Callback handler for unexpected failures.
|
ResponseContext |
getResponseContext()
The response context allows state to be injected from construction and visible across response processor
layers as necessary.
|
protected boolean |
isCacheable()
A request is cacheable if it does not refer to partial data.
|
void |
processResponse(com.fasterxml.jackson.databind.JsonNode json,
DruidAggregationQuery<?> druidQuery,
LoggingContext metadata)
Process the response json and respond to the original web request.
|
public CacheV2ResponseProcessor(ResponseProcessor next, String cacheKey, TupleDataCache<String,Long,String> dataCache, QuerySigningService<Long> querySigningService, com.fasterxml.jackson.databind.ObjectMapper mapper)
next
- Next ResponseProcessor in the chaincacheKey
- Key into which to write a cache entrydataCache
- The cache into which to write a cache entryquerySigningService
- Service to use for signing the queries in the cache key with their metadatamapper
- An object mapper to use for processing Jsonpublic ResponseContext getResponseContext()
ResponseProcessor
getResponseContext
in interface ResponseProcessor
public 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 useprotected boolean isCacheable()
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.