当前位置: 首页>>代码示例>>Java>>正文


Java LogHandlerEvent类代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerEvent的典型用法代码示例。如果您正苦于以下问题:Java LogHandlerEvent类的具体用法?Java LogHandlerEvent怎么用?Java LogHandlerEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LogHandlerEvent类属于org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event包,在下文中一共展示了LogHandlerEvent类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createLogHandler

import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerEvent; //导入依赖的package包/类
@Override
protected LogHandler createLogHandler(Configuration conf,
    Context context, DeletionService deletionService) {
  return new LogHandler() {
    
    @Override
    public void handle(LogHandlerEvent event) {
      switch (event.getType()) {
        case APPLICATION_STARTED:
          break;
        case CONTAINER_FINISHED:
          break;
        case APPLICATION_FINISHED:
          break;
        default:
          // Ignore
        }
    }
  };
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:DummyContainerManager.java

示例2: handle

import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerEvent; //导入依赖的package包/类
@Override
public void handle(LogHandlerEvent event) {
  switch (event.getType()) {
    case APPLICATION_STARTED:
      LogHandlerAppStartedEvent appStartEvent =
          (LogHandlerAppStartedEvent) event;
      initApp(appStartEvent.getApplicationId(), appStartEvent.getUser(),
          appStartEvent.getCredentials(),
          appStartEvent.getLogRetentionPolicy(),
          appStartEvent.getApplicationAcls(),
          appStartEvent.getLogAggregationContext());
      break;
    case CONTAINER_FINISHED:
      LogHandlerContainerFinishedEvent containerFinishEvent =
          (LogHandlerContainerFinishedEvent) event;
      stopContainer(containerFinishEvent.getContainerId(),
          containerFinishEvent.getExitCode());
      break;
    case APPLICATION_FINISHED:
      LogHandlerAppFinishedEvent appFinishedEvent =
          (LogHandlerAppFinishedEvent) event;
      stopApp(appFinishedEvent.getApplicationId());
      break;
    default:
      ; // Ignore
  }

}
 
开发者ID:naver,项目名称:hadoop,代码行数:29,代码来源:LogAggregationService.java

示例3: handle

import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerEvent; //导入依赖的package包/类
@Override
public void handle(LogHandlerEvent event) {
  switch (event.getType()) {
    case APPLICATION_STARTED:
      LogHandlerAppStartedEvent appStartEvent =
          (LogHandlerAppStartedEvent) event;
      initApp(appStartEvent.getApplicationId(), appStartEvent.getUser(),
          appStartEvent.getCredentials(),
          appStartEvent.getApplicationAcls(),
          appStartEvent.getLogAggregationContext());
      break;
    case CONTAINER_FINISHED:
      LogHandlerContainerFinishedEvent containerFinishEvent =
          (LogHandlerContainerFinishedEvent) event;
      stopContainer(containerFinishEvent.getContainerId(),
          containerFinishEvent.getExitCode());
      break;
    case APPLICATION_FINISHED:
      LogHandlerAppFinishedEvent appFinishedEvent =
          (LogHandlerAppFinishedEvent) event;
      stopApp(appFinishedEvent.getApplicationId());
      break;
    default:
      ; // Ignore
  }

}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:28,代码来源:LogAggregationService.java

示例4: handle

import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void handle(LogHandlerEvent event) {
  switch (event.getType()) {
    case APPLICATION_STARTED:
      LogHandlerAppStartedEvent appStartedEvent =
          (LogHandlerAppStartedEvent) event;
      this.appOwners.put(appStartedEvent.getApplicationId(),
          appStartedEvent.getUser());
      this.dispatcher.getEventHandler().handle(
          new ApplicationEvent(appStartedEvent.getApplicationId(),
              ApplicationEventType.APPLICATION_LOG_HANDLING_INITED));
      break;
    case CONTAINER_FINISHED:
      // Ignore
      break;
    case APPLICATION_FINISHED:
      LogHandlerAppFinishedEvent appFinishedEvent =
          (LogHandlerAppFinishedEvent) event;
      // Schedule - so that logs are available on the UI till they're deleted.
      LOG.info("Scheduling Log Deletion for application: "
          + appFinishedEvent.getApplicationId() + ", with delay of "
          + this.deleteDelaySeconds + " seconds");
      LogDeleterRunnable logDeleter =
          new LogDeleterRunnable(appOwners.remove(appFinishedEvent
                .getApplicationId()), appFinishedEvent.getApplicationId());
      try {
        sched.schedule(logDeleter, this.deleteDelaySeconds,
            TimeUnit.SECONDS);
      } catch (RejectedExecutionException e) {
        // Handling this event in local thread before starting threads
        // or after calling sched.shutdownNow().
        logDeleter.run();
      }
      break;
    default:
      ; // Ignore
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:40,代码来源:NonAggregatingLogHandler.java

示例5: handle

import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void handle(LogHandlerEvent event) {
  switch (event.getType()) {
    case APPLICATION_STARTED:
      LogHandlerAppStartedEvent appStartedEvent =
          (LogHandlerAppStartedEvent) event;
      this.appOwners.put(appStartedEvent.getApplicationId(),
          appStartedEvent.getUser());
      this.dispatcher.getEventHandler().handle(
          new ApplicationEvent(appStartedEvent.getApplicationId(),
              ApplicationEventType.APPLICATION_LOG_HANDLING_INITED));
      break;
    case CONTAINER_FINISHED:
      // Ignore
      break;
    case APPLICATION_FINISHED:
      LogHandlerAppFinishedEvent appFinishedEvent =
          (LogHandlerAppFinishedEvent) event;
      // Schedule - so that logs are available on the UI till they're deleted.
      LOG.info("Scheduling Log Deletion for application: "
          + appFinishedEvent.getApplicationId() + ", with delay of "
          + this.deleteDelaySeconds + " seconds");
      sched.schedule(
          new LogDeleterRunnable(appOwners.remove(appFinishedEvent
              .getApplicationId()), appFinishedEvent.getApplicationId()),
          this.deleteDelaySeconds, TimeUnit.SECONDS);
      break;
    default:
      ; // Ignore
  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:33,代码来源:NonAggregatingLogHandler.java

示例6: handle

import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerEvent; //导入依赖的package包/类
@Override
public void handle(LogHandlerEvent event) {
  switch (event.getType()) {
    case APPLICATION_STARTED:
      LogHandlerAppStartedEvent appStartEvent =
          (LogHandlerAppStartedEvent) event;
      initApp(appStartEvent.getApplicationId(), appStartEvent.getUser(),
          appStartEvent.getCredentials(),
          appStartEvent.getLogRetentionPolicy(),
          appStartEvent.getApplicationAcls());
      break;
    case CONTAINER_FINISHED:
      LogHandlerContainerFinishedEvent containerFinishEvent =
          (LogHandlerContainerFinishedEvent) event;
      stopContainer(containerFinishEvent.getContainerId(),
          containerFinishEvent.getExitCode());
      break;
    case APPLICATION_FINISHED:
      LogHandlerAppFinishedEvent appFinishedEvent =
          (LogHandlerAppFinishedEvent) event;
      stopApp(appFinishedEvent.getApplicationId());
      break;
    default:
      ; // Ignore
  }

}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:28,代码来源:LogAggregationService.java

示例7: handle

import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerEvent; //导入依赖的package包/类
@Override
public void handle(LogHandlerEvent event) {
  switch (event.getType()) {
    case APPLICATION_STARTED:
      LogHandlerAppStartedEvent appStartEvent =
          (LogHandlerAppStartedEvent) event;
      initApp(appStartEvent.getApplicationId(), appStartEvent.getUser(),
          appStartEvent.getCredentials(),
          appStartEvent.getApplicationAcls(),
          appStartEvent.getLogAggregationContext(),
          appStartEvent.getUserFolder());
      break;
    case CONTAINER_FINISHED:
      LogHandlerContainerFinishedEvent containerFinishEvent =
          (LogHandlerContainerFinishedEvent) event;
      stopContainer(containerFinishEvent.getContainerId(),
          containerFinishEvent.getExitCode());
      break;
    case APPLICATION_FINISHED:
      LogHandlerAppFinishedEvent appFinishedEvent =
          (LogHandlerAppFinishedEvent) event;
      stopApp(appFinishedEvent.getApplicationId());
      break;
    default:
      ; // Ignore
  }

}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:29,代码来源:LogAggregationService.java

示例8: handle

import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerEvent; //导入依赖的package包/类
public void handle(LogHandlerEvent event); 
开发者ID:naver,项目名称:hadoop,代码行数:2,代码来源:LogHandler.java


注:本文中的org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。