本文整理了Java中org.apache.hadoop.yarn.event.Dispatcher.getEventHandler()
方法的一些代码示例,展示了Dispatcher.getEventHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dispatcher.getEventHandler()
方法的具体详情如下:
包路径:org.apache.hadoop.yarn.event.Dispatcher
类名称:Dispatcher
方法名:getEventHandler
暂无
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager
@Override
public void transition(ApplicationImpl app, ApplicationEvent event) {
LOG.warn("Log Aggregation service failed to initialize, there will " +
"be no logs for this application");
app.dispatcher.getEventHandler().handle(
new ApplicationLocalizationEvent(
LocalizationEventType.INIT_APPLICATION_RESOURCES, app));
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager
@Override
public void transition(ContainerImpl container, ContainerEvent event) {
// Container was PAUSED so tell the scheduler
container.dispatcher.getEventHandler().handle(
new ContainerSchedulerEvent(container,
ContainerSchedulerEventType.CONTAINER_PAUSED));
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager
@Override
@SuppressWarnings("unchecked") // dispatcher not typed
public void run() {
dispatcher.getEventHandler().handle(
new LocalizationEvent(LocalizationEventType.CACHE_CLEANUP));
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager
@SuppressWarnings("unchecked") // dispatcher not typed
@Override
public void sendKillEvent(int exitStatus, String description) {
this.isMarkeForKilling = true;
dispatcher.getEventHandler().handle(
new ContainerKillEvent(containerId, exitStatus, description));
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager
@SuppressWarnings("unchecked") // dispatcher not typed
@Override
public void sendPauseEvent(String description) {
dispatcher.getEventHandler().handle(
new ContainerPauseEvent(containerId, description));
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager
@SuppressWarnings("unchecked") // dispatcher not typed
private void sendRelaunchEvent() {
ContainersLauncherEventType launcherEvent =
ContainersLauncherEventType.RELAUNCH_CONTAINER;
dispatcher.getEventHandler().handle(
new ContainersLauncherEvent(this, launcherEvent));
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager
@Override
public void transition(ContainerImpl container, ContainerEvent event) {
// Pause the process/process-grp if it is supported by the container
container.dispatcher.getEventHandler().handle(
new ContainersLauncherEvent(container,
ContainersLauncherEventType.RESUME_CONTAINER));
ContainerResumeEvent resumeEvent = (ContainerResumeEvent) event;
container.addDiagnostics(resumeEvent.getDiagnostic() + "\n");
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager
@Override
public void transition(ContainerImpl container, ContainerEvent event) {
// Pause the process/process-grp if it is supported by the container
container.dispatcher.getEventHandler().handle(
new ContainersLauncherEvent(container,
ContainersLauncherEventType.PAUSE_CONTAINER));
ContainerPauseEvent pauseEvent = (ContainerPauseEvent) event;
container.addDiagnostics(pauseEvent.getDiagnostic() + "\n");
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
/**
* To be used to release a container via a Scheduler Event rather than
* in the same thread.
* @param container Container.
*/
public void asyncContainerRelease(RMContainer container) {
this.rmContext.getDispatcher().getEventHandler().handle(
new ReleaseContainerEvent(container));
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager
@SuppressWarnings("unchecked")
@Override
public void transition(ContainerImpl container, ContainerEvent event) {
// Kill the process/process-grp
container.setIsReInitializing(false);
container.dispatcher.getEventHandler().handle(
new ContainersLauncherEvent(container,
ContainersLauncherEventType.CLEANUP_CONTAINER));
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-nodemanager
@Override
public void transition(LocalizedResource rsrc, ResourceEvent event) {
// notify waiting containers
ResourceRequestEvent reqEvent = (ResourceRequestEvent) event;
ContainerId container = reqEvent.getContext().getContainerId();
rsrc.ref.add(container);
rsrc.dispatcher.getEventHandler().handle(
new ContainerResourceLocalizedEvent(
container, rsrc.rsrc, rsrc.localPath));
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager
@Override
public void transition(LocalizedResource rsrc, ResourceEvent event) {
ResourceFailedLocalizationEvent failedEvent =
(ResourceFailedLocalizationEvent) event;
Queue<ContainerId> containers = rsrc.ref;
for (ContainerId container : containers) {
rsrc.dispatcher.getEventHandler().handle(
new ContainerResourceFailedEvent(container, failedEvent
.getLocalResourceRequest(), failedEvent.getDiagnosticMessage()));
}
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@SuppressWarnings(value = "unchecked")
@Override
public void notifyFatalError(String errorMessage) {
rm.getRMContext().getDispatcher().getEventHandler().handle(
new RMFatalEvent(RMFatalEventType.EMBEDDED_ELECTOR_FAILED,
errorMessage));
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager
@Override
public void transition(LocalizedResource rsrc, ResourceEvent event) {
ResourceRequestEvent req = (ResourceRequestEvent) event;
LocalizerContext ctxt = req.getContext();
ContainerId container = ctxt.getContainerId();
rsrc.ref.add(container);
rsrc.dispatcher.getEventHandler().handle(
new LocalizerResourceRequestEvent(rsrc, req.getVisibility(), ctxt,
req.getLocalResourceRequest().getPattern()));
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager
@Override
public void transition(ApplicationImpl app, ApplicationEvent event) {
// Inform the logService
app.dispatcher.getEventHandler().handle(
new LogHandlerAppFinishedEvent(app.appId));
app.context.getNMTokenSecretManager().appFinished(app.getAppId());
updateCollectorStatus(app);
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
@SuppressWarnings("unchecked")
public void containerFinished(RMContainer container, long finishedTime) {
if (publishSystemMetrics) {
dispatcher.getEventHandler().handle(
new ContainerFinishedEvent(
container.getContainerId(),
container.getDiagnosticsInfo(),
container.getContainerExitStatus(),
container.getContainerState(),
finishedTime, container.getAllocatedNode()));
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@SuppressWarnings("unchecked")
public void containerStarted(RMContainer container) {
if (historyServiceEnabled) {
dispatcher.getEventHandler().handle(
new WritingContainerStartEvent(container.getContainerId(),
ContainerStartData.newInstance(container.getContainerId(),
container.getAllocatedResource(), container.getAllocatedNode(),
container.getAllocatedPriority(), container.getCreationTime())));
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
@SuppressWarnings("unchecked")
public void containerStarted(RMContainer container) {
if (historyServiceEnabled) {
dispatcher.getEventHandler().handle(
new WritingContainerStartEvent(container.getContainerId(),
ContainerStartData.newInstance(container.getContainerId(),
container.getAllocatedResource(), container.getAllocatedNode(),
container.getAllocatedPriority(), container.getCreationTime())));
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
@SuppressWarnings("unchecked")
public void applicationStarted(RMApp app) {
if (historyServiceEnabled) {
dispatcher.getEventHandler().handle(
new WritingApplicationStartEvent(app.getApplicationId(),
ApplicationStartData.newInstance(app.getApplicationId(), app.getName(),
app.getApplicationType(), app.getQueue(), app.getUser(),
app.getSubmitTime(), app.getStartTime())));
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
public void sendAMLaunchFailed(ApplicationAttemptId appAttemptId)
throws Exception {
MockAM am = new MockAM(getRMContext(), masterService, appAttemptId);
waitForState(am.getApplicationAttemptId(), RMAppAttemptState.ALLOCATED);
getRMContext().getDispatcher().getEventHandler()
.handle(new RMAppAttemptEvent(appAttemptId,
RMAppAttemptEventType.LAUNCH_FAILED, "Failed"));
drainEventsImplicitly();
}
内容来源于网络,如有侵权,请联系作者删除!