本文整理了Java中org.apache.druid.query.Query.getContextValue
方法的一些代码示例,展示了Query.getContextValue
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getContextValue
方法的具体详情如下:
包路径:org.apache.druid.query.Query
类名称:Query
方法名:getContextValue
暂无
代码示例来源:origin: apache/incubator-druid
@Override
public <ContextType> ContextType getContextValue(String key, ContextType defaultValue)
{
return (ContextType) query.getContextValue(key, defaultValue);
}
代码示例来源:origin: apache/incubator-druid
@Override
public <ContextType> ContextType getContextValue(String key)
{
return (ContextType) query.getContextValue(key);
}
代码示例来源:origin: apache/incubator-druid
@Deprecated
public static <T> String getChunkPeriod(Query<T> query)
{
return query.getContextValue(CHUNK_PERIOD_KEY, "P0D");
}
代码示例来源:origin: apache/incubator-druid
static <T> int parseInt(Query<T> query, String key, int defaultValue)
{
final Object val = query.getContextValue(key);
return val == null ? defaultValue : Numbers.parseInt(val);
}
代码示例来源:origin: apache/incubator-druid
static <T> long parseLong(Query<T> query, String key, long defaultValue)
{
final Object val = query.getContextValue(key);
return val == null ? defaultValue : Numbers.parseLong(val);
}
代码示例来源:origin: apache/incubator-druid
static <T> boolean parseBoolean(Query<T> query, String key, boolean defaultValue)
{
final Object val = query.getContextValue(key);
return val == null ? defaultValue : Numbers.parseBoolean(val);
}
代码示例来源:origin: apache/incubator-druid
public static <T> Query<T> withMaxScatterGatherBytes(Query<T> query, long maxScatterGatherBytesLimit)
{
Object obj = query.getContextValue(MAX_SCATTER_GATHER_BYTES_KEY);
if (obj == null) {
return query.withOverriddenContext(ImmutableMap.of(MAX_SCATTER_GATHER_BYTES_KEY, maxScatterGatherBytesLimit));
} else {
long curr = ((Number) obj).longValue();
if (curr > maxScatterGatherBytesLimit) {
throw new IAE(
"configured [%s = %s] is more than enforced limit of [%s].",
MAX_SCATTER_GATHER_BYTES_KEY,
curr,
maxScatterGatherBytesLimit
);
} else {
return query;
}
}
}
代码示例来源:origin: apache/incubator-druid
final long timeoutAt = query.getContextValue(QUERY_FAIL_TIME);
final long maxScatterGatherBytes = QueryContexts.getMaxScatterGatherBytes(query);
final AtomicLong totalBytesGathered = (AtomicLong) context.get(QUERY_TOTAL_BYTES_GATHERED);
代码示例来源:origin: apache/incubator-druid
query.<String>getContextValue("postProcessing"),
new TypeReference<PostProcessingOperator<T>>()
代码示例来源:origin: apache/incubator-druid
);
Assert.assertEquals(1, serdeQuery.getContextValue(QueryContexts.PRIORITY_KEY));
Assert.assertEquals(true, serdeQuery.getContextValue("useCache"));
Assert.assertEquals("true", serdeQuery.getContextValue("populateCache"));
Assert.assertEquals(true, serdeQuery.getContextValue("finalize"));
Assert.assertEquals(true, serdeQuery.getContextBoolean("useCache", false));
Assert.assertEquals(true, serdeQuery.getContextBoolean("populateCache", false));
代码示例来源:origin: apache/incubator-druid
Query capturedQuery = capturedQueryPlus.getQuery();
if (expectBySegment) {
Assert.assertEquals(true, capturedQuery.getContextValue("bySegment"));
} else {
Assert.assertTrue(
capturedQuery.getContextValue("bySegment") == null ||
capturedQuery.getContextValue("bySegment").equals(false)
);
代码示例来源:origin: apache/incubator-druid
final boolean skipIncrementalSegment = query.getContextValue(CONTEXT_SKIP_INCREMENTAL_SEGMENT, false);
final AtomicLong cpuTimeAccumulator = new AtomicLong(0L);
代码示例来源:origin: org.apache.druid/druid-processing
public static <T> String getChunkPeriod(Query<T> query)
{
return query.getContextValue(CHUNK_PERIOD_KEY, "P0D");
}
代码示例来源:origin: org.apache.druid/druid-processing
static <T> int parseInt(Query<T> query, String key, int defaultValue)
{
final Object val = query.getContextValue(key);
return val == null ? defaultValue : Numbers.parseInt(val);
}
代码示例来源:origin: org.apache.druid/druid-processing
static <T> boolean parseBoolean(Query<T> query, String key, boolean defaultValue)
{
final Object val = query.getContextValue(key);
return val == null ? defaultValue : Numbers.parseBoolean(val);
}
代码示例来源:origin: org.apache.druid/druid-processing
static <T> long parseLong(Query<T> query, String key, long defaultValue)
{
final Object val = query.getContextValue(key);
return val == null ? defaultValue : Numbers.parseLong(val);
}
代码示例来源:origin: org.apache.druid/druid-processing
public static <T> Query<T> withMaxScatterGatherBytes(Query<T> query, long maxScatterGatherBytesLimit)
{
Object obj = query.getContextValue(MAX_SCATTER_GATHER_BYTES_KEY);
if (obj == null) {
return query.withOverriddenContext(ImmutableMap.of(MAX_SCATTER_GATHER_BYTES_KEY, maxScatterGatherBytesLimit));
} else {
long curr = ((Number) obj).longValue();
if (curr > maxScatterGatherBytesLimit) {
throw new IAE(
"configured [%s = %s] is more than enforced limit of [%s].",
MAX_SCATTER_GATHER_BYTES_KEY,
curr,
maxScatterGatherBytesLimit
);
} else {
return query;
}
}
}
代码示例来源:origin: org.apache.druid/druid-server
final long timeoutAt = query.getContextValue(QUERY_FAIL_TIME);
final long maxScatterGatherBytes = QueryContexts.getMaxScatterGatherBytes(query);
final AtomicLong totalBytesGathered = (AtomicLong) context.get(QUERY_TOTAL_BYTES_GATHERED);
代码示例来源:origin: org.apache.druid/druid-server
query.<String>getContextValue("postProcessing"),
new TypeReference<PostProcessingOperator<T>>()
代码示例来源:origin: org.apache.druid/druid-server
final boolean skipIncrementalSegment = query.getContextValue(CONTEXT_SKIP_INCREMENTAL_SEGMENT, false);
final AtomicLong cpuTimeAccumulator = new AtomicLong(0L);
内容来源于网络,如有侵权,请联系作者删除!