com.dremio.exec.ops.QueryContext.getOptions()方法的使用及代码示例

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

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

QueryContext.getOptions介绍

暂无

代码示例

代码示例来源:origin: dremio/dremio-oss

PlanNormalizer(SqlHandlerConfig sqlHandlerConfig) {
 this.optionManager = sqlHandlerConfig.getContext().getOptions();
}

代码示例来源:origin: dremio/dremio-oss

public ReflectionPlanNormalizer(
  SqlHandlerConfig sqlHandlerConfig,
  ReflectionGoal goal,
  ReflectionEntry entry,
  Materialization materialization,
  NamespaceService namespace,
  SabotConfig config,
  ReflectionSettings reflectionSettings,
  MaterializationStore materializationStore) {
 this.sqlHandlerConfig = sqlHandlerConfig;
 this.goal = goal;
 this.entry = entry;
 this.materialization = materialization;
 this.namespace = namespace;
 this.config = config;
 this.reflectionSettings = reflectionSettings;
 this.materializationStore = materializationStore;
 this.optionManager = sqlHandlerConfig.getContext().getOptions();
}

代码示例来源:origin: dremio/dremio-oss

DirectBuilder(String sql, SqlNode sqlNode, boolean prepare) {
 this.sqlNode = sqlNode;
 this.prepare = prepare;
 this.sql = sql;
 final StoreQueryResultsPolicy storeQueryResultsPolicy = Optional
   .ofNullable(context.getOptions().getOption(STORE_QUERY_RESULTS.getOptionName()))
   .map(o -> StoreQueryResultsPolicy.valueOf(o.getStringVal().toUpperCase(Locale.ROOT)))
   .orElse(StoreQueryResultsPolicy.NO);
 this.storeResults = storeQueryResultsPolicy != StoreQueryResultsPolicy.NO;
}

代码示例来源:origin: dremio/dremio-oss

public SimpleParallelizer(QueryContext context, AttemptObserver observer, Collection<NodeEndpoint> activeEndpoints) {
 this.queryContext = context;
 OptionManager optionManager = context.getOptions();
 long sliceTarget = context.getPlannerSettings().getSliceTarget();
 this.parallelizationThreshold = sliceTarget > 0 ? sliceTarget : 1;
 final long configuredMaxWidthPerNode = context.getClusterResourceInformation().getAverageExecutorCores(optionManager);
 final double maxWidthFactor = context.getWorkStatsProvider().get().getMaxWidthFactor();
 this.maxWidthPerNode = (int) Math.max(1, configuredMaxWidthPerNode * maxWidthFactor);
 if (logger.isDebugEnabled() && maxWidthFactor < 1) {
  final float clusterLoad = context.getWorkStatsProvider().get().getClusterLoad();
  logger.debug("Cluster load {} exceeded cutoff, max_width_factor = {}. current max_width = {}",
   clusterLoad, maxWidthFactor, this.maxWidthPerNode);
 }
 this.executionMap = new ExecutionNodeMap(Optional.ofNullable(activeEndpoints).orElse(context.getActiveEndpoints()));
 this.maxGlobalWidth = (int) optionManager.getOption(ExecConstants.MAX_WIDTH_GLOBAL);
 this.affinityFactor = optionManager.getOption(ExecConstants.AFFINITY_FACTOR);
 this.useNewAssignmentCreator = !optionManager.getOption(ExecConstants.OLD_ASSIGNMENT_CREATOR);
 this.assignmentCreatorBalanceFactor = optionManager.getOption(ExecConstants.ASSIGNMENT_CREATOR_BALANCE_FACTOR);
 this.observer = observer;
 this.fragmentCodec = FragmentCodec.valueOf(optionManager.getOption(ExecConstants.FRAGMENT_CODEC).toUpperCase());
}

代码示例来源:origin: dremio/dremio-oss

protected void setQueueTypeFromPlan(PhysicalPlan plan) {
 final long queueThreshold = context.getOptions().getOption(BasicResourceConstants.QUEUE_THRESHOLD_SIZE);
 if (context.getQueryContextInfo().getPriority().getWorkloadClass().equals(WorkloadClass.BACKGROUND)) {
  setQueueType((plan.getCost() > queueThreshold) ? QueueType.REFLECTION_LARGE : QueueType.REFLECTION_SMALL);
 } else {
  setQueueType((plan.getCost() > queueThreshold) ? QueueType.LARGE : QueueType.SMALL);
 }
}

代码示例来源:origin: dremio/dremio-oss

public static PhysicalPlan convertToPlan(SqlHandlerConfig config, PhysicalOperator op) {
 PlanPropertiesBuilder propsBuilder = PlanProperties.builder();
 propsBuilder.type(PlanType.PHYSICAL);
 propsBuilder.version(1);
 propsBuilder.options(new JSONOptions(config.getContext().getOptions().getOptionList()));
 propsBuilder.resultMode(ResultMode.EXEC);
 propsBuilder.generator("default", "handler");
 List<PhysicalOperator> ops = Lists.newArrayList();
 PopCollector c = new PopCollector();
 op.accept(c, ops);
 return new PhysicalPlan(propsBuilder.build(), ops);
}

代码示例来源:origin: dremio/dremio-oss

protected QueryContext mockQueryContext(SabotContext dbContext) throws Exception {
 final UserSession userSession = UserSession.Builder.newBuilder().withOptionManager(dbContext.getOptionManager()).build();
 final SessionOptionManager sessionOptions = (SessionOptionManager) userSession.getOptions();
 final QueryOptionManager queryOptions = new QueryOptionManager(sessionOptions);
 final ExecutionControls executionControls = new ExecutionControls(queryOptions, NodeEndpoint.getDefaultInstance());
 final OperatorTable table = new OperatorTable(FUNCTIONS());
 final LogicalPlanPersistence lp = dbContext.getLpPersistence();
 final CatalogService registry = dbContext.getCatalogService();
 final QueryContext context = Mockito.mock(QueryContext.class);
 when(context.getSession()).thenReturn(userSession);
 when(context.getLpPersistence()).thenReturn(lp);
 when(context.getCatalogService()).thenReturn(registry);
 when(context.getFunctionRegistry()).thenReturn(FUNCTIONS());
 when(context.getSession()).thenReturn(UserSession.Builder.newBuilder().setSupportComplexTypes(true).build());
 when(context.getCurrentEndpoint()).thenReturn(NodeEndpoint.getDefaultInstance());
 when(context.getActiveEndpoints()).thenReturn(ImmutableList.of(NodeEndpoint.getDefaultInstance()));
 when(context.getPlannerSettings()).thenReturn(new PlannerSettings(dbContext.getConfig(), queryOptions, dbContext.getClusterResourceInformation()));
 when(context.getOptions()).thenReturn(queryOptions);
 when(context.getConfig()).thenReturn(DEFAULT_SABOT_CONFIG);
 when(context.getOperatorTable()).thenReturn(table);
 when(context.getAllocator()).thenReturn(allocator);
 when(context.getExecutionControls()).thenReturn(executionControls);
 when(context.getMaterializationProvider()).thenReturn(Mockito.mock(MaterializationDescriptorProvider.class));
 return context;
}

代码示例来源:origin: dremio/dremio-oss

final OptionManager options = context.getOptions();
final StoreQueryResultsPolicy storeQueryResultsPolicy = Optional
  .ofNullable(options.getOption(STORE_QUERY_RESULTS.getOptionName()))

代码示例来源:origin: dremio/dremio-oss

private boolean initialCanVectorize(PhysicalPlanCreator creator, PhysicalOperator child){
 if(!creator.getContext().getOptions().getOption(ExecConstants.ENABLE_VECTORIZED_HASHAGG)){
  return false;

代码示例来源:origin: dremio/dremio-oss

private PhysicalOperator getHashJoinPop(PhysicalPlanCreator creator, RelNode left, RelNode right,
                    List<Integer> leftKeys, List<Integer> rightKeys) throws IOException{
 final List<String> fields = getRowType().getFieldNames();
 assert isUnique(fields);
 final List<String> leftFields = left.getRowType().getFieldNames();
 final List<String> rightFields = right.getRowType().getFieldNames();
 PhysicalOperator leftPop = ((Prel)left).getPhysicalOperator(creator);
 PhysicalOperator rightPop = ((Prel)right).getPhysicalOperator(creator);
 JoinRelType jtype = this.getJoinType();
 final List<JoinCondition> conditions = Lists.newArrayList();
 buildJoinConditions(conditions, leftFields, rightFields, leftKeys, rightKeys);
 final boolean vectorize = creator.getContext().getOptions().getOption(ExecConstants.ENABLE_VECTORIZED_HASHJOIN)
   && canVectorize(creator.getContext().getFunctionRegistry(), leftPop, rightPop, conditions);
 final HashJoinPOP hjoin = new HashJoinPOP(leftPop, rightPop, conditions, jtype, vectorize);
 return creator.addMetadata(this, hjoin);
}

代码示例来源:origin: dremio/dremio-oss

private OperatorContextImpl createContext(Writer writer) {
  BufferAllocator allocator = context.getAllocator().newChildAllocator("direct-command", 0, Long.MAX_VALUE);
  final OperatorStats stats = new OperatorStats(new OpProfileDef(0,0,0), allocator);
  final OperatorContextImpl oc = new OperatorContextImpl(
    context.getConfig(),
    FragmentHandle.newBuilder().setQueryId(context.getQueryId()).setMajorFragmentId(0).setMinorFragmentId(0).build(),
    writer,
    allocator,
    allocator,
    null,
    stats,
    null,
    null,
    context.getFunctionRegistry(),
    null,
    context.getOptions(),
    context.getNamespaceService(),
    null,
    NodeDebugContextProvider.NOOP,
    60000,
    null,
    ImmutableList.of());
  return oc;
 }
}

代码示例来源:origin: dremio/dremio-oss

final long ringCount = config.getContext().getOptions().getOption(PlannerSettings.RING_COUNT);
final Rel writerDrel = new WriterRel(drel.getCluster(), drel.getCluster().traitSet().plus(Rel.LOGICAL),
 drel, config.getContext().getCatalog().createNewTable(

代码示例来源:origin: dremio/dremio-oss

OptionManager queryOptions = context.getOptions();

代码示例来源:origin: dremio/dremio-oss

this.observers = AttemptObservers.of(observer);
final OptionManager optionManager = this.queryContext.getOptions();
if(options != null){
 options.applyOptions(optionManager);

代码示例来源:origin: dremio/dremio-oss

final OptionManager options = queryContext.getOptions();
final boolean memoryControlEnabled = options.getOption(BasicResourceConstants.ENABLE_QUEUE_MEMORY_LIMIT);
final long memoryLimit = (queueType == QueueType.SMALL) ?

代码示例来源:origin: dremio/dremio-oss

PreparedPlan plan = plans.getIfPresent(handle);
if(plan != null){
 if (!context.getOptions().getOption(REUSE_PREPARE_HANDLES)) {
  plans.invalidate(handle);

代码示例来源:origin: dremio/dremio-oss

if(!context.getOptions().getOption(ExecConstants.ENABLE_WINDOW_FUNCTIONS).getBoolVal()) {

代码示例来源:origin: dremio/dremio-oss

queryContext.getOptions(),
queryContext.getClusterResourceInformation(),
planningSet,

代码示例来源:origin: dremio/dremio-oss

final BatchSchema schema = PojoRecordReader.getSchema(handler.getResultType());
final CollectingOutcomeListener listener = new CollectingOutcomeListener();
Writer writer = getWriter(context.getOptions());

代码示例来源:origin: dremio/dremio-oss

final RelNode newTblRelNode = SqlHandlerUtil.resolveNewTableRel(false, sqlCreateTable.getFieldNames(), validatedRowType, queryRelNode);
final long ringCount = config.getContext().getOptions().getOption(PlannerSettings.RING_COUNT);

相关文章