本文整理汇总了Java中org.apache.tajo.engine.query.QueryUnitRequest.getFetches方法的典型用法代码示例。如果您正苦于以下问题:Java QueryUnitRequest.getFetches方法的具体用法?Java QueryUnitRequest.getFetches怎么用?Java QueryUnitRequest.getFetches使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tajo.engine.query.QueryUnitRequest
的用法示例。
在下文中一共展示了QueryUnitRequest.getFetches方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Task
import org.apache.tajo.engine.query.QueryUnitRequest; //导入方法依赖的package包/类
public Task(QueryUnitAttemptId taskId,
final TaskRunner.TaskRunnerContext worker,
final QueryMasterProtocolService.Interface masterProxy,
final QueryUnitRequest request) throws IOException {
this.request = request;
this.taskId = taskId;
this.systemConf = worker.getConf();
this.queryContext = request.getQueryContext();
this.taskRunnerContext = worker;
this.masterProxy = masterProxy;
this.localFS = worker.getLocalFS();
this.lDirAllocator = worker.getLocalDirAllocator();
this.taskDir = StorageUtil.concatPath(taskRunnerContext.getBaseDir(),
taskId.getQueryUnitId().getId() + "_" + taskId.getId());
this.context = new TaskAttemptContext(systemConf, taskId,
request.getFragments().toArray(new FragmentProto[request.getFragments().size()]), taskDir);
this.context.setDataChannel(request.getDataChannel());
this.context.setEnforcer(request.getEnforcer());
this.inputStats = new TableStats();
this.reporter = new Reporter(taskId, masterProxy);
this.reporter.startCommunicationThread();
plan = CoreGsonHelper.fromJson(request.getSerializedData(), LogicalNode.class);
LogicalNode [] scanNode = PlannerUtil.findAllNodes(plan, NodeType.SCAN);
for (LogicalNode node : scanNode) {
ScanNode scan = (ScanNode)node;
descs.put(scan.getCanonicalName(), scan.getTableDesc());
}
interQuery = request.getProto().getInterQuery();
if (interQuery) {
context.setInterQuery();
this.shuffleType = context.getDataChannel().getShuffleType();
if (shuffleType == ShuffleType.RANGE_SHUFFLE) {
SortNode sortNode = PlannerUtil.findTopNode(plan, NodeType.SORT);
this.finalSchema = PlannerUtil.sortSpecsToSchema(sortNode.getSortKeys());
this.sortComp = new TupleComparator(finalSchema, sortNode.getSortKeys());
}
} else {
// The final result of a task will be written in a file named part-ss-nnnnnnn,
// where ss is the subquery id associated with this task, and nnnnnn is the task id.
Path outFilePath = StorageUtil.concatPath(queryContext.getStagingDir(), TajoConstants.RESULT_DIR_NAME,
OUTPUT_FILE_PREFIX +
OUTPUT_FILE_FORMAT_SUBQUERY.get().format(taskId.getQueryUnitId().getExecutionBlockId().getId()) + "-" +
OUTPUT_FILE_FORMAT_TASK.get().format(taskId.getQueryUnitId().getId()));
LOG.info("Output File Path: " + outFilePath);
context.setOutputPath(outFilePath);
}
context.setState(TaskAttemptState.TA_PENDING);
LOG.info("==================================");
LOG.info("* Subquery " + request.getId() + " is initialized");
LOG.info("* InterQuery: " + interQuery
+ (interQuery ? ", Use " + this.shuffleType + " shuffle":""));
LOG.info("* Fragments (num: " + request.getFragments().size() + ")");
LOG.info("* Fetches (total:" + request.getFetches().size() + ") :");
for (Fetch f : request.getFetches()) {
LOG.info("Table Id: " + f.getName() + ", url: " + f.getUrls());
}
LOG.info("* Local task dir: " + taskDir);
if(LOG.isDebugEnabled()) {
LOG.debug("* plan:\n");
LOG.debug(plan.toString());
}
LOG.info("==================================");
}