/** * To facilitate generating workunits * with the assumption that QueryContext is NOT null * it's not always going to be true, since e.g. QueryContextInfo * may change between ctor and this method * @param options * @param reader * @param rootNode * @param planningSet * @return * @throws ExecutionSetupException */ private List<PlanFragment> generateWorkUnit( OptionList options, PhysicalPlanReader reader, Fragment rootNode, PlanningSet planningSet) throws ExecutionSetupException { Preconditions.checkNotNull(queryContext); return generateWorkUnit(options, queryContext.getCurrentEndpoint(), queryContext.getQueryId(), reader, rootNode, planningSet, queryContext.getSession(), queryContext.getQueryContextInfo(), queryContext.getFunctionRegistry()); }
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); } }
CoordExecRPC.QueryContextInformation queryContextInformation = queryContext.getQueryContextInfo(); options.getOption(BasicResourceConstants.LARGE_QUEUE_MEMORY_LIMIT); if (memoryControlEnabled && memoryLimit > 0) { final long queryMaxAllocation = queryContext.getQueryContextInfo().getQueryMaxAllocation(); queryContextInformation = CoordExecRPC.QueryContextInformation.newBuilder(queryContextInformation) .setQueryMaxAllocation(Math.min(memoryLimit, queryMaxAllocation)).build();