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()); }
plan, queryContext.getOptions(), queryContext.getClusterResourceInformation(), planningSet, queryPerNodeFromResourceAllocator);