本文整理汇总了Java中org.apache.drill.exec.ops.FragmentContext.getOptions方法的典型用法代码示例。如果您正苦于以下问题:Java FragmentContext.getOptions方法的具体用法?Java FragmentContext.getOptions怎么用?Java FragmentContext.getOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.drill.exec.ops.FragmentContext
的用法示例。
在下文中一共展示了FragmentContext.getOptions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OptionIterator
import org.apache.drill.exec.ops.FragmentContext; //导入方法依赖的package包/类
public OptionIterator(FragmentContext context, Mode mode){
final DrillConfigIterator configOptions = new DrillConfigIterator(context.getConfig());
fragmentOptions = context.getOptions();
final Iterator<OptionValue> optionList;
switch(mode){
case BOOT:
optionList = configOptions.iterator();
break;
case SYS_SESS:
optionList = fragmentOptions.iterator();
break;
default:
optionList = Iterators.concat(configOptions.iterator(), fragmentOptions.iterator());
}
List<OptionValue> values = Lists.newArrayList(optionList);
Collections.sort(values);
mergedOptions = values.iterator();
}
示例2: PartitionSenderRootExec
import org.apache.drill.exec.ops.FragmentContext; //导入方法依赖的package包/类
public PartitionSenderRootExec(FragmentContext context,
RecordBatch incoming,
HashPartitionSender operator) throws OutOfMemoryException {
super(context, context.newOperatorContext(operator, null, false), operator);
this.incoming = incoming;
this.operator = operator;
this.context = context;
outGoingBatchCount = operator.getDestinations().size();
popConfig = operator;
remainingReceivers = new AtomicIntegerArray(outGoingBatchCount);
remaingReceiverCount = new AtomicInteger(outGoingBatchCount);
stats.setLongStat(Metric.N_RECEIVERS, outGoingBatchCount);
// Algorithm to figure out number of threads to parallelize output
// numberOfRows/sliceTarget/numReceivers/threadfactor
this.cost = operator.getChild().getCost();
final OptionManager optMgr = context.getOptions();
long sliceTarget = optMgr.getOption(ExecConstants.SLICE_TARGET).num_val;
int threadFactor = optMgr.getOption(PlannerSettings.PARTITION_SENDER_THREADS_FACTOR.getOptionName()).num_val.intValue();
int tmpParts = 1;
if ( sliceTarget != 0 && outGoingBatchCount != 0 ) {
tmpParts = (int) Math.round((((cost / (sliceTarget*1.0)) / (outGoingBatchCount*1.0)) / (threadFactor*1.0)));
if ( tmpParts < 1) {
tmpParts = 1;
}
}
final int imposedThreads = optMgr.getOption(PlannerSettings.PARTITION_SENDER_SET_THREADS.getOptionName()).num_val.intValue();
if (imposedThreads > 0 ) {
this.numberPartitions = imposedThreads;
} else {
this.numberPartitions = Math.min(tmpParts, optMgr.getOption(PlannerSettings.PARTITION_SENDER_MAX_THREADS.getOptionName()).num_val.intValue());
}
logger.info("Preliminary number of sending threads is: " + numberPartitions);
this.actualPartitions = outGoingBatchCount > numberPartitions ? numberPartitions : outGoingBatchCount;
this.stats.setLongStat(Metric.SENDING_THREADS_COUNT, actualPartitions);
this.stats.setDoubleStat(Metric.COST, this.cost);
}