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


Java RMAppAttemptEventType类代码示例

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


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

示例1: initResourceManager

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
private synchronized void initResourceManager(int index, Configuration conf) {
  if (HAUtil.isHAEnabled(conf)) {
    conf.set(YarnConfiguration.RM_HA_ID, rmIds[index]);
  }
  resourceManagers[index].init(conf);
  resourceManagers[index].getRMContext().getDispatcher().register(
      RMAppAttemptEventType.class,
      new EventHandler<RMAppAttemptEvent>() {
        public void handle(RMAppAttemptEvent event) {
          if (event instanceof RMAppAttemptRegistrationEvent) {
            appMasters.put(event.getApplicationAttemptId(),
                event.getTimestamp());
          } else if (event instanceof RMAppAttemptUnregistrationEvent) {
            appMasters.remove(event.getApplicationAttemptId());
          }
        }
      });
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:MiniYARNCluster.java

示例2: transition

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
@Override
public void transition(RMStateStore store, RMStateStoreEvent event) {
  if (!(event instanceof RMStateStoreAppAttemptEvent)) {
    // should never happen
    LOG.error("Illegal event type: " + event.getClass());
    return;
  }
  ApplicationAttemptStateData attemptState =
      ((RMStateStoreAppAttemptEvent) event).getAppAttemptState();
  try {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Storing info for attempt: " + attemptState.getAttemptId());
    }
    store.storeApplicationAttemptStateInternal(attemptState.getAttemptId(),
        attemptState);
    store.notifyApplicationAttempt(new RMAppAttemptEvent
           (attemptState.getAttemptId(),
           RMAppAttemptEventType.ATTEMPT_NEW_SAVED));
  } catch (Exception e) {
    LOG.error("Error storing appAttempt: " + attemptState.getAttemptId(), e);
    store.notifyStoreOperationFailed(e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:RMStateStore.java

示例3: sendAMLaunched

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
public MockAM sendAMLaunched(ApplicationAttemptId appAttemptId)
    throws Exception {
  MockAM am = new MockAM(getRMContext(), masterService, appAttemptId);
  am.waitForState(RMAppAttemptState.ALLOCATED);
  //create and set AMRMToken
  Token<AMRMTokenIdentifier> amrmToken =
      this.rmContext.getAMRMTokenSecretManager().createAndGetAMRMToken(
        appAttemptId);
  ((RMAppAttemptImpl) this.rmContext.getRMApps()
    .get(appAttemptId.getApplicationId()).getRMAppAttempt(appAttemptId))
    .setAMRMToken(amrmToken);
  getRMContext()
      .getDispatcher()
      .getEventHandler()
      .handle(
          new RMAppAttemptEvent(appAttemptId, RMAppAttemptEventType.LAUNCHED));
  return am;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:MockRM.java

示例4: initResourceManager

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
private synchronized void initResourceManager(int index, Configuration conf) {
  Configuration newConf = resourceManagers.length > 1 ?
      new YarnConfiguration(conf) : conf;
  if (HAUtil.isHAEnabled(newConf)) {
    newConf.set(YarnConfiguration.RM_HA_ID, rmIds[index]);
  }
  resourceManagers[index].init(newConf);
  resourceManagers[index].getRMContext().getDispatcher().register(
      RMAppAttemptEventType.class,
      new EventHandler<RMAppAttemptEvent>() {
        public void handle(RMAppAttemptEvent event) {
          if (event instanceof RMAppAttemptRegistrationEvent) {
            appMasters.put(event.getApplicationAttemptId(),
                event.getTimestamp());
          } else if (event instanceof RMAppAttemptUnregistrationEvent) {
            appMasters.remove(event.getApplicationAttemptId());
          }
        }
      });
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:21,代码来源:MiniYARNCluster.java

示例5: transition

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
@Override
public RMStateStoreState transition(RMStateStore store,
    RMStateStoreEvent event) {
  if (!(event instanceof RMStateStoreAppAttemptEvent)) {
    // should never happen
    LOG.error("Illegal event type: " + event.getClass());
    return RMStateStoreState.ACTIVE;
  }
  boolean isFenced = false;
  ApplicationAttemptStateData attemptState =
      ((RMStateStoreAppAttemptEvent) event).getAppAttemptState();
  try {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Storing info for attempt: " + attemptState.getAttemptId());
    }
    store.storeApplicationAttemptStateInternal(attemptState.getAttemptId(),
        attemptState);
    store.notifyApplicationAttempt(new RMAppAttemptEvent
           (attemptState.getAttemptId(),
           RMAppAttemptEventType.ATTEMPT_NEW_SAVED));
  } catch (Exception e) {
    LOG.error("Error storing appAttempt: " + attemptState.getAttemptId(), e);
    isFenced = store.notifyStoreOperationFailedInternal(e);
  }
  return finalState(isFenced);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:27,代码来源:RMStateStore.java

示例6: transition

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
@Override
public void transition(RMStateStore store, RMStateStoreEvent event) {
  if (!(event instanceof RMStateStoreAppAttemptEvent)) {
    // should never happen
    LOG.error("Illegal event type: " + event.getClass());
    return;
  }
  ApplicationAttemptState attemptState =
      ((RMStateStoreAppAttemptEvent) event).getAppAttemptState();
  try {
    ApplicationAttemptStateData attemptStateData = 
        ApplicationAttemptStateData.newInstance(attemptState);
    if (LOG.isDebugEnabled()) {
      LOG.debug("Storing info for attempt: " + attemptState.getAttemptId());
    }
    store.storeApplicationAttemptStateInternal(attemptState.getAttemptId(),
        attemptStateData);
    store.notifyApplicationAttempt(new RMAppAttemptEvent
           (attemptState.getAttemptId(),
           RMAppAttemptEventType.ATTEMPT_NEW_SAVED));
  } catch (Exception e) {
    LOG.error("Error storing appAttempt: " + attemptState.getAttemptId(), e);
    store.notifyStoreOperationFailed(e);
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:26,代码来源:RMStateStore.java

示例7: sendAMLaunched

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
/**
 * recommend to use launchAM, or use sendAMLaunched like:
 * 1, wait RMAppAttempt scheduled
 * 2, send node heartbeat
 * 3, sendAMLaunched
 */
public MockAM sendAMLaunched(ApplicationAttemptId appAttemptId)
    throws Exception {
  MockAM am = new MockAM(getRMContext(), masterService, appAttemptId);
  am.waitForState(RMAppAttemptState.ALLOCATED);
  //create and set AMRMToken
  Token<AMRMTokenIdentifier> amrmToken =
      this.rmContext.getAMRMTokenSecretManager().createAndGetAMRMToken(
        appAttemptId);
  ((RMAppAttemptImpl) this.rmContext.getRMApps()
    .get(appAttemptId.getApplicationId()).getRMAppAttempt(appAttemptId))
    .setAMRMToken(amrmToken);
  getRMContext()
      .getDispatcher()
      .getEventHandler()
      .handle(
          new RMAppAttemptEvent(appAttemptId, RMAppAttemptEventType.LAUNCHED));
  return am;
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:25,代码来源:MockRM.java

示例8: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
private synchronized void
    addApplicationAttempt(ApplicationAttemptId appAttemptId,
        boolean transferStateFromPreviousAttempt) {
  SchedulerApplication application =
      applications.get(appAttemptId.getApplicationId());
  String user = application.getUser();
  // TODO: Fix store
  FiCaSchedulerApp schedulerApp =
      new FiCaSchedulerApp(appAttemptId, user, DEFAULT_QUEUE,
        activeUsersManager, this.rmContext);

  if (transferStateFromPreviousAttempt) {
    schedulerApp.transferStateFromPreviousAttempt(application
      .getCurrentAppAttempt());
  }
  application.setCurrentAppAttempt(schedulerApp);

  metrics.submitAppAttempt(user);
  LOG.info("Added Application Attempt " + appAttemptId
      + " to scheduler from user " + application.getUser());
  rmContext.getDispatcher().getEventHandler().handle(
      new RMAppAttemptEvent(appAttemptId,
          RMAppAttemptEventType.ATTEMPT_ADDED));
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:25,代码来源:FifoScheduler.java

示例9: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
private synchronized void addApplicationAttempt(
    ApplicationAttemptId applicationAttemptId,
    boolean transferStateFromPreviousAttempt) {
  SchedulerApplication application =
      applications.get(applicationAttemptId.getApplicationId());
  CSQueue queue = (CSQueue) application.getQueue();

  FiCaSchedulerApp attempt =
      new FiCaSchedulerApp(applicationAttemptId, application.getUser(),
        queue, queue.getActiveUsersManager(), rmContext);
  if (transferStateFromPreviousAttempt) {
    attempt.transferStateFromPreviousAttempt(application
      .getCurrentAppAttempt());
  }
  application.setCurrentAppAttempt(attempt);

  queue.submitApplicationAttempt(attempt, application.getUser());
  LOG.info("Added Application Attempt " + applicationAttemptId
      + " to scheduler from user " + application.getUser() + " in queue "
      + queue.getQueueName());
  rmContext.getDispatcher().getEventHandler() .handle(
      new RMAppAttemptEvent(applicationAttemptId,
        RMAppAttemptEventType.ATTEMPT_ADDED));
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:25,代码来源:CapacityScheduler.java

示例10: RMAppAttemptUnregistrationEvent

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
public RMAppAttemptUnregistrationEvent(ApplicationAttemptId appAttemptId,
    String trackingUrl, FinalApplicationStatus finalStatus, String diagnostics) {
  super(appAttemptId, RMAppAttemptEventType.UNREGISTERED);
  this.finalTrackingUrl = trackingUrl;
  this.finalStatus = finalStatus;
  this.diagnostics = diagnostics;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:RMAppAttemptUnregistrationEvent.java

示例11: RMAppAttemptRegistrationEvent

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
public RMAppAttemptRegistrationEvent(ApplicationAttemptId appAttemptId,
    String host, int rpcPort, String trackingUrl) {
  super(appAttemptId, RMAppAttemptEventType.REGISTERED);
  this.appAttemptId = appAttemptId;
  this.host = host;
  this.rpcport = rpcPort;
  this.trackingurl = trackingUrl;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:RMAppAttemptRegistrationEvent.java

示例12: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
@VisibleForTesting
public synchronized void
    addApplicationAttempt(ApplicationAttemptId appAttemptId,
        boolean transferStateFromPreviousAttempt,
        boolean isAttemptRecovering) {
  SchedulerApplication<FiCaSchedulerApp> application =
      applications.get(appAttemptId.getApplicationId());
  String user = application.getUser();
  // TODO: Fix store
  FiCaSchedulerApp schedulerApp =
      new FiCaSchedulerApp(appAttemptId, user, DEFAULT_QUEUE,
        activeUsersManager, this.rmContext);

  if (transferStateFromPreviousAttempt) {
    schedulerApp.transferStateFromPreviousAttempt(application
      .getCurrentAppAttempt());
  }
  application.setCurrentAppAttempt(schedulerApp);

  metrics.submitAppAttempt(user);
  LOG.info("Added Application Attempt " + appAttemptId
      + " to scheduler from user " + application.getUser());
  if (isAttemptRecovering) {
    if (LOG.isDebugEnabled()) {
      LOG.debug(appAttemptId
          + " is recovering. Skipping notifying ATTEMPT_ADDED");
    }
  } else {
    rmContext.getDispatcher().getEventHandler().handle(
      new RMAppAttemptEvent(appAttemptId,
          RMAppAttemptEventType.ATTEMPT_ADDED));
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:34,代码来源:FifoScheduler.java

示例13: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
private synchronized void addApplicationAttempt(
    ApplicationAttemptId applicationAttemptId,
    boolean transferStateFromPreviousAttempt,
    boolean isAttemptRecovering) {
  SchedulerApplication<FiCaSchedulerApp> application =
      applications.get(applicationAttemptId.getApplicationId());
  CSQueue queue = (CSQueue) application.getQueue();

  FiCaSchedulerApp attempt =
      new FiCaSchedulerApp(applicationAttemptId, application.getUser(),
        queue, queue.getActiveUsersManager(), rmContext);
  if (transferStateFromPreviousAttempt) {
    attempt.transferStateFromPreviousAttempt(application
      .getCurrentAppAttempt());
  }
  application.setCurrentAppAttempt(attempt);

  queue.submitApplicationAttempt(attempt, application.getUser());
  LOG.info("Added Application Attempt " + applicationAttemptId
      + " to scheduler from user " + application.getUser() + " in queue "
      + queue.getQueueName());
  if (isAttemptRecovering) {
    if (LOG.isDebugEnabled()) {
      LOG.debug(applicationAttemptId
          + " is recovering. Skipping notifying ATTEMPT_ADDED");
    }
  } else {
    rmContext.getDispatcher().getEventHandler().handle(
      new RMAppAttemptEvent(applicationAttemptId,
          RMAppAttemptEventType.ATTEMPT_ADDED));
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:33,代码来源:CapacityScheduler.java

示例14: transition

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
@Override
public void transition(RMAppImpl app, RMAppEvent event) {
  app.stateBeforeKilling = app.getState();
  // Forward app kill diagnostics in the event to kill app attempt.
  // These diagnostics will be returned back in ATTEMPT_KILLED event sent by
  // RMAppAttemptImpl.
  app.handler.handle(
      new RMAppAttemptEvent(app.currentAttempt.getAppAttemptId(),
          RMAppAttemptEventType.KILL, event.getDiagnosticMsg()));
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:11,代码来源:RMAppImpl.java

示例15: RMAppAttemptUnregistrationEvent

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType; //导入依赖的package包/类
public RMAppAttemptUnregistrationEvent(ApplicationAttemptId appAttemptId,
    String trackingUrl, FinalApplicationStatus finalStatus,
    String diagnostics) {
  super(appAttemptId, RMAppAttemptEventType.UNREGISTERED, diagnostics);
  this.finalTrackingUrl = trackingUrl;
  this.finalStatus = finalStatus;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:8,代码来源:RMAppAttemptUnregistrationEvent.java


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