本文整理汇总了Java中org.apache.tajo.master.TaskRunnerGroupEvent.EventType类的典型用法代码示例。如果您正苦于以下问题:Java EventType类的具体用法?Java EventType怎么用?Java EventType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EventType类属于org.apache.tajo.master.TaskRunnerGroupEvent包,在下文中一共展示了EventType类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transition
import org.apache.tajo.master.TaskRunnerGroupEvent.EventType; //导入依赖的package包/类
@Override
public void transition(SubQuery subQuery, SubQueryEvent event) {
try {
SubQueryContainerAllocationEvent allocationEvent =
(SubQueryContainerAllocationEvent) event;
for (Container container : allocationEvent.getAllocatedContainer()) {
ContainerId cId = container.getId();
if (subQuery.containers.containsKey(cId)) {
subQuery.eventHandler.handle(new SubQueryDiagnosticsUpdateEvent(subQuery.getId(),
"Duplicated containers are allocated: " + cId.toString()));
subQuery.eventHandler.handle(new SubQueryEvent(subQuery.getId(), SubQueryEventType.SQ_INTERNAL_ERROR));
}
subQuery.containers.put(cId, container);
}
LOG.info("SubQuery (" + subQuery.getId() + ") has " + subQuery.containers.size() + " containers!");
subQuery.eventHandler.handle(
new TaskRunnerGroupEvent(EventType.CONTAINER_REMOTE_LAUNCH,
subQuery.getId(), allocationEvent.getAllocatedContainer()));
subQuery.eventHandler.handle(new SubQueryEvent(subQuery.getId(), SubQueryEventType.SQ_START));
} catch (Throwable t) {
subQuery.eventHandler.handle(new SubQueryDiagnosticsUpdateEvent(subQuery.getId(),
ExceptionUtils.getStackTrace(t)));
subQuery.eventHandler.handle(new SubQueryEvent(subQuery.getId(), SubQueryEventType.SQ_INTERNAL_ERROR));
}
}
示例2: TaskRunnerGroupEvent
import org.apache.tajo.master.TaskRunnerGroupEvent.EventType; //导入依赖的package包/类
public TaskRunnerGroupEvent(EventType eventType,
ExecutionBlockId executionBlockId,
Collection<Container> containers) {
super(eventType);
this.executionBlockId = executionBlockId;
this.containers = containers;
}
示例3: handle
import org.apache.tajo.master.TaskRunnerGroupEvent.EventType; //导入依赖的package包/类
@Override
public void handle(TaskRunnerGroupEvent event) {
if (event.getType() == EventType.CONTAINER_REMOTE_LAUNCH) {
launchTaskRunners(event.executionBlockId, event.getContainers());
} else if (event.getType() == EventType.CONTAINER_REMOTE_CLEANUP) {
stopTaskRunners(event.getContainers());
}
}
示例4: releaseContainers
import org.apache.tajo.master.TaskRunnerGroupEvent.EventType; //导入依赖的package包/类
private void releaseContainers() {
// If there are still live TaskRunners, try to kill the containers.
eventHandler.handle(new TaskRunnerGroupEvent(EventType.CONTAINER_REMOTE_CLEANUP, getId(), containers.values()));
}
示例5: releaseContainer
import org.apache.tajo.master.TaskRunnerGroupEvent.EventType; //导入依赖的package包/类
public void releaseContainer(ContainerId containerId) {
// try to kill the container.
ArrayList<Container> list = new ArrayList<Container>();
list.add(containers.get(containerId));
eventHandler.handle(new TaskRunnerGroupEvent(EventType.CONTAINER_REMOTE_CLEANUP, getId(), list));
}
示例6: scheduleFragment
import org.apache.tajo.master.TaskRunnerGroupEvent.EventType; //导入依赖的package包/类
public static void scheduleFragment(SubQuery subQuery, FileFragment fragment) {
subQuery.taskScheduler.handle(new FragmentScheduleEvent(TaskSchedulerEvent.EventType.T_SCHEDULE,
subQuery.getId(), fragment));
}
示例7: scheduleFetches
import org.apache.tajo.master.TaskRunnerGroupEvent.EventType; //导入依赖的package包/类
public static void scheduleFetches(SubQuery subQuery, Map<String, List<URI>> fetches) {
subQuery.taskScheduler.handle(new FetchScheduleEvent(TaskSchedulerEvent.EventType.T_SCHEDULE,
subQuery.getId(), fetches));
}