public abstract class ResponseContext extends Object
QueryRunners.
The context is also transferred between Druid nodes with all the data it contains.| Modifier and Type | Class and Description |
|---|---|
static interface |
ResponseContext.BaseKey
The base interface of a response context key.
|
static class |
ResponseContext.Key
Keys associated with objects in the context.
|
static class |
ResponseContext.SerializationResult
Serialization result of
ResponseContext. |
| Constructor and Description |
|---|
ResponseContext() |
| Modifier and Type | Method and Description |
|---|---|
Object |
add(ResponseContext.BaseKey key,
Object value)
Adds (merges) a new value associated with a key to an old value.
|
static ResponseContext |
createEmpty()
Create an empty DefaultResponseContext instance
|
static ResponseContext |
deserialize(String responseContext,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Deserializes a string into
ResponseContext using given ObjectMapper. |
Object |
get(ResponseContext.BaseKey key) |
protected abstract Map<ResponseContext.BaseKey,Object> |
getDelegate() |
void |
merge(ResponseContext responseContext)
Merges a response context into the current.
|
Object |
put(ResponseContext.BaseKey key,
Object value)
Associates the specified object with the specified key.
|
Object |
remove(ResponseContext.BaseKey key) |
ResponseContext.SerializationResult |
serializeWith(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
int maxCharsNumber)
Serializes the context given that the resulting string length is less than the provided limit.
|
protected abstract Map<ResponseContext.BaseKey,Object> getDelegate()
public static ResponseContext createEmpty()
public static ResponseContext deserialize(String responseContext, com.fasterxml.jackson.databind.ObjectMapper objectMapper) throws IOException
ResponseContext using given ObjectMapper.IllegalStateException - if one of the deserialized map keys has not been registered.IOExceptionpublic Object put(ResponseContext.BaseKey key, Object value)
IllegalStateException - if the key has not been registered.public Object get(ResponseContext.BaseKey key)
public Object remove(ResponseContext.BaseKey key)
public Object add(ResponseContext.BaseKey key, Object value)
IllegalStateException - if the key has not been registered.public void merge(ResponseContext responseContext)
IllegalStateException - If a key of the responseContext has not been registered.public ResponseContext.SerializationResult serializeWith(com.fasterxml.jackson.databind.ObjectMapper objectMapper, int maxCharsNumber) throws com.fasterxml.jackson.core.JsonProcessingException
ResponseContext.Key.UNCOVERED_INTERVALS
and ResponseContext.Key.MISSING_SEGMENTS) and their values are arrays.
Thus current implementation considers these arrays as equal prioritized and starts removing elements from
the array which serialized value length is the biggest.
The resulting string might be correctly deserialized to ResponseContext.com.fasterxml.jackson.core.JsonProcessingExceptionCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.