public class QueryContext extends Object
QueryContext, that map
is effectively immutable.
The implementation uses a TreeMap so that the serialized form of a query
lists context values in a deterministic order. Jackson will call
getContext() on the query, which will call asMap() here,
which returns the sorted TreeMap.
The TreeMap is a mutable class. We'd prefer an immutable class, but
we can choose either ordering or immutability. Since the semantics of the context
is that it is immutable once it is placed in a query. Code should NEVER get the
context map from a query and modify it, even if the actual implementation
allows it.
| Constructor and Description |
|---|
QueryContext(Map<String,Object> context) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowReturnPartialResults(boolean defaultValue) |
Map<String,Object> |
asMap() |
boolean |
containsKey(String key)
Check if the given key is set.
|
static QueryContext |
empty() |
boolean |
equals(Object o) |
Object |
get(String key)
Return a value as a generic
Object, returning null if the
context value is not set. |
Boolean |
getBoolean(String key)
Return a value as an
Boolean, returning null if the
context value is not set. |
boolean |
getBoolean(String key,
boolean defaultValue)
Return a value as an
boolean, returning the default value if the
context value is not set. |
String |
getBrokerServiceName() |
long |
getDefaultTimeout() |
boolean |
getEnableJoinFilterPushDown() |
boolean |
getEnableJoinFilterRewrite() |
boolean |
getEnableJoinFilterRewriteValueColumnFilters() |
boolean |
getEnableJoinLeftScanDirect() |
boolean |
getEnableParallelMerges() |
boolean |
getEnableRewriteJoinToFilter() |
<E extends Enum<E>> |
getEnum(String key,
Class<E> clazz,
E defaultValue) |
Float |
getFloat(String key)
Return a value as an
Float, returning null if the
context value is not set. |
float |
getFloat(String key,
float defaultValue)
Return a value as an
float, returning the default value if the
context value is not set. |
Granularity |
getGranularity(String key,
com.fasterxml.jackson.databind.ObjectMapper jsonMapper) |
HumanReadableBytes |
getHumanReadableBytes(String key,
HumanReadableBytes defaultValue) |
int |
getInSubQueryThreshold() |
int |
getInSubQueryThreshold(int defaultValue) |
Integer |
getInt(String key)
Return a value as an
Integer, returning null if the
context value is not set. |
int |
getInt(String key,
int defaultValue)
Return a value as an
int, returning the default value if the
context value is not set. |
long |
getJoinFilterRewriteMaxSize() |
String |
getLane() |
Long |
getLong(String key)
Return a value as an
Long, returning null if the
context value is not set. |
long |
getLong(String key,
long defaultValue)
Return a value as an
long, returning the default value if the
context value is not set. |
long |
getMaxQueuedBytes(long defaultValue) |
long |
getMaxScatterGatherBytes() |
long |
getMaxSubqueryMemoryBytes(long defaultMemoryBytes) |
int |
getMaxSubqueryRows(int defaultSize) |
int |
getNumRetriesOnMissingSegments(int defaultValue) |
int |
getParallelMergeInitialYieldRows(int defaultValue) |
int |
getParallelMergeParallelism(int defaultValue) |
int |
getParallelMergeSmallBatchRows(int defaultValue) |
int |
getPriority() |
int |
getPriority(int defaultValue) |
String |
getString(String key)
Return a value as an
String, returning null if the
context value is not set. |
String |
getString(String key,
String defaultValue) |
long |
getTimeout() |
long |
getTimeout(long defaultTimeout) |
int |
getUncoveredIntervalsLimit() |
int |
getUncoveredIntervalsLimit(int defaultValue) |
QueryContexts.Vectorize |
getVectorize() |
QueryContexts.Vectorize |
getVectorize(QueryContexts.Vectorize defaultValue) |
QueryContexts.Vectorize |
getVectorizeVirtualColumns() |
QueryContexts.Vectorize |
getVectorizeVirtualColumns(QueryContexts.Vectorize defaultValue) |
int |
getVectorSize() |
int |
getVectorSize(int defaultSize) |
int |
hashCode() |
boolean |
hasTimeout() |
boolean |
isBySegment() |
boolean |
isBySegment(boolean defaultValue) |
boolean |
isDebug() |
boolean |
isEmpty() |
boolean |
isFinalize(boolean defaultValue) |
boolean |
isPopulateCache() |
boolean |
isPopulateCache(boolean defaultValue) |
boolean |
isPopulateResultLevelCache() |
boolean |
isPopulateResultLevelCache(boolean defaultValue) |
boolean |
isSecondaryPartitionPruningEnabled() |
boolean |
isSerializeDateTimeAsLong(boolean defaultValue) |
boolean |
isSerializeDateTimeAsLongInner(boolean defaultValue) |
boolean |
isTimeBoundaryPlanningEnabled() |
boolean |
isUseCache() |
boolean |
isUseCache(boolean defaultValue) |
boolean |
isUseNestedForUnknownTypeInSubquery(boolean defaultUseNestedForUnkownTypeInSubquery) |
boolean |
isUseResultLevelCache() |
boolean |
isUseResultLevelCache(boolean defaultValue) |
static QueryContext |
of(Map<String,Object> context) |
String |
toString() |
void |
verifyMaxQueryTimeout(long maxQueryTimeout) |
void |
verifyMaxScatterGatherBytes(long maxScatterGatherBytesLimit) |
public static QueryContext empty()
public static QueryContext of(Map<String,Object> context)
public boolean isEmpty()
public boolean containsKey(String key)
get<Type>(String key) methods instead:
they each return null if the value is not set.@Nullable public Object get(String key)
Object, returning null if the
context value is not set.@Nullable public String getString(String key)
String, returning null if the
context value is not set.BadQueryContextException - for an invalid valuepublic Boolean getBoolean(String key)
Boolean, returning null if the
context value is not set.BadQueryContextException - for an invalid valuepublic boolean getBoolean(String key, boolean defaultValue)
boolean, returning the default value if the
context value is not set.BadQueryContextException - for an invalid valuepublic Integer getInt(String key)
Integer, returning null if the
context value is not set.BadQueryContextException - for an invalid valuepublic int getInt(String key, int defaultValue)
int, returning the default value if the
context value is not set.BadQueryContextException - for an invalid valuepublic Long getLong(String key)
Long, returning null if the
context value is not set.BadQueryContextException - for an invalid valuepublic long getLong(String key, long defaultValue)
long, returning the default value if the
context value is not set.BadQueryContextException - for an invalid valuepublic Float getFloat(String key)
Float, returning null if the
context value is not set.BadQueryContextException - for an invalid valuepublic float getFloat(String key, float defaultValue)
float, returning the default value if the
context value is not set.BadQueryContextException - for an invalid valuepublic HumanReadableBytes getHumanReadableBytes(String key, HumanReadableBytes defaultValue)
public Granularity getGranularity(String key, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
public boolean isDebug()
public boolean isBySegment()
public boolean isBySegment(boolean defaultValue)
public boolean isPopulateCache()
public boolean isPopulateCache(boolean defaultValue)
public boolean isUseCache()
public boolean isUseCache(boolean defaultValue)
public boolean isPopulateResultLevelCache()
public boolean isPopulateResultLevelCache(boolean defaultValue)
public boolean isUseResultLevelCache()
public boolean isUseResultLevelCache(boolean defaultValue)
public boolean isFinalize(boolean defaultValue)
public boolean isSerializeDateTimeAsLong(boolean defaultValue)
public boolean isSerializeDateTimeAsLongInner(boolean defaultValue)
public QueryContexts.Vectorize getVectorize()
public QueryContexts.Vectorize getVectorize(QueryContexts.Vectorize defaultValue)
public QueryContexts.Vectorize getVectorizeVirtualColumns()
public QueryContexts.Vectorize getVectorizeVirtualColumns(QueryContexts.Vectorize defaultValue)
public int getVectorSize()
public int getVectorSize(int defaultSize)
public int getMaxSubqueryRows(int defaultSize)
public long getMaxSubqueryMemoryBytes(long defaultMemoryBytes)
public boolean isUseNestedForUnknownTypeInSubquery(boolean defaultUseNestedForUnkownTypeInSubquery)
public int getUncoveredIntervalsLimit()
public int getUncoveredIntervalsLimit(int defaultValue)
public int getPriority()
public int getPriority(int defaultValue)
public String getLane()
public boolean getEnableParallelMerges()
public int getParallelMergeInitialYieldRows(int defaultValue)
public int getParallelMergeSmallBatchRows(int defaultValue)
public int getParallelMergeParallelism(int defaultValue)
public long getJoinFilterRewriteMaxSize()
public boolean getEnableJoinFilterPushDown()
public boolean getEnableJoinFilterRewrite()
public boolean isSecondaryPartitionPruningEnabled()
public long getMaxQueuedBytes(long defaultValue)
public long getMaxScatterGatherBytes()
public boolean hasTimeout()
public long getTimeout()
public long getTimeout(long defaultTimeout)
public long getDefaultTimeout()
public void verifyMaxQueryTimeout(long maxQueryTimeout)
public void verifyMaxScatterGatherBytes(long maxScatterGatherBytesLimit)
public int getNumRetriesOnMissingSegments(int defaultValue)
public boolean allowReturnPartialResults(boolean defaultValue)
public boolean getEnableJoinFilterRewriteValueColumnFilters()
public boolean getEnableRewriteJoinToFilter()
public boolean getEnableJoinLeftScanDirect()
public int getInSubQueryThreshold()
public int getInSubQueryThreshold(int defaultValue)
public boolean isTimeBoundaryPlanningEnabled()
public String getBrokerServiceName()
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.