本文整理汇总了Java中org.apache.tajo.engine.query.QueryUnitRequest.setInterQuery方法的典型用法代码示例。如果您正苦于以下问题:Java QueryUnitRequest.setInterQuery方法的具体用法?Java QueryUnitRequest.setInterQuery怎么用?Java QueryUnitRequest.setInterQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tajo.engine.query.QueryUnitRequest
的用法示例。
在下文中一共展示了QueryUnitRequest.setInterQuery方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assignTask
import org.apache.tajo.engine.query.QueryUnitRequest; //导入方法依赖的package包/类
private void assignTask(QueryUnitAttemptScheduleContext attemptContext, QueryUnitAttempt taskAttempt) {
QueryUnitAttemptId attemptId = taskAttempt.getId();
ContainerProxy containerProxy = context.getMasterContext().getResourceAllocator().
getContainer(attemptContext.getContainerId());
QueryUnitRequest taskAssign = new QueryUnitRequestImpl(
attemptId,
new ArrayList<FragmentProto>(taskAttempt.getQueryUnit().getAllFragments()),
"",
false,
taskAttempt.getQueryUnit().getLogicalPlan().toJson(),
context.getMasterContext().getQueryContext(),
subQuery.getDataChannel(), subQuery.getBlock().getEnforcer());
if (checkIfInterQuery(subQuery.getMasterPlan(), subQuery.getBlock())) {
taskAssign.setInterQuery();
}
if (!context.isLeafQuery()) {
Map<String, List<URI>> fetch = scheduledFetches.getNextFetch();
scheduledFetches.popNextFetch();
for (Entry<String, List<URI>> fetchEntry : fetch.entrySet()) {
for (URI eachValue : fetchEntry.getValue()) {
taskAssign.addFetch(fetchEntry.getKey(), eachValue);
}
}
}
context.getMasterContext().getEventHandler().handle(new TaskAttemptAssignedEvent(attemptId,
attemptContext.getContainerId(), attemptContext.getHost(), containerProxy.getTaskPort()));
totalAssigned++;
attemptContext.getCallback().run(taskAssign.getProto());
if (context.isLeafQuery()) {
LOG.debug("DiskLocalAssigned / Total: " + diskLocalAssigned + " / " + totalAssigned);
LOG.debug("HostLocalAssigned / Total: " + hostLocalAssigned + " / " + totalAssigned);
LOG.debug("RackLocalAssigned: " + rackLocalAssigned + " / " + totalAssigned);
}
}
示例2: assignToNonLeafTasks
import org.apache.tajo.engine.query.QueryUnitRequest; //导入方法依赖的package包/类
public void assignToNonLeafTasks(LinkedList<TaskRequestEvent> taskRequests) {
Collections.shuffle(taskRequests);
TaskRequestEvent taskRequest;
while (!taskRequests.isEmpty()) {
taskRequest = taskRequests.pollFirst();
LOG.debug("assignToNonLeafTasks: " + taskRequest.getExecutionBlockId());
QueryUnitAttemptId attemptId;
// random allocation
if (nonLeafTasks.size() > 0) {
synchronized (nonLeafTasks){
attemptId = nonLeafTasks.iterator().next();
nonLeafTasks.remove(attemptId);
}
LOG.debug("Assigned based on * match");
QueryUnit task;
task = subQuery.getQueryUnit(attemptId.getQueryUnitId());
QueryUnitRequest taskAssign = new QueryUnitRequestImpl(
attemptId,
Lists.newArrayList(task.getAllFragments()),
"",
false,
task.getLogicalPlan().toJson(),
context.getMasterContext().getQueryContext(),
subQuery.getDataChannel(),
subQuery.getBlock().getEnforcer());
if (checkIfInterQuery(subQuery.getMasterPlan(), subQuery.getBlock())) {
taskAssign.setInterQuery();
}
for (ScanNode scan : task.getScanNodes()) {
Collection<URI> fetches = task.getFetch(scan);
if (fetches != null) {
for (URI fetch : fetches) {
taskAssign.addFetch(scan.getTableName(), fetch);
}
}
}
ContainerProxy container = context.getMasterContext().getResourceAllocator().getContainer(
taskRequest.getContainerId());
context.getMasterContext().getEventHandler().handle(new TaskAttemptAssignedEvent(attemptId,
taskRequest.getContainerId(), container.getTaskHostName(), container.getTaskPort()));
taskRequest.getCallback().run(taskAssign.getProto());
totalAssigned++;
scheduledObjectNum--;
}
}
}