org.apache.druid.query.Query.getContextValue()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中org.apache.druid.query.Query.getContextValue方法的一些代码示例,展示了Query.getContextValue的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getContextValue方法的具体详情如下:
包路径:org.apache.druid.query.Query
类名称:Query
方法名:getContextValue

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);

相关文章