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


Java ApplicationAttemptStateData类代码示例

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


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

示例1: storeApplicationAttemptStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的package包/类
@Override
public synchronized void storeApplicationAttemptStateInternal(
    ApplicationAttemptId appAttemptId,
    ApplicationAttemptStateData attemptStateDataPB)
    throws Exception {
  String appDirPath = getNodePath(rmAppRoot,
      appAttemptId.getApplicationId().toString());
  String nodeCreatePath = getNodePath(appDirPath, appAttemptId.toString());

  if (LOG.isDebugEnabled()) {
    LOG.debug("Storing info for attempt: " + appAttemptId + " at: "
        + nodeCreatePath);
  }
  byte[] attemptStateData = attemptStateDataPB.getProto().toByteArray();
  createWithRetries(nodeCreatePath, attemptStateData, zkAcl,
    CreateMode.PERSISTENT);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:ZKRMStateStore.java

示例2: updateApplicationAttemptStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的package包/类
@Override
public synchronized void updateApplicationAttemptStateInternal(
    ApplicationAttemptId appAttemptId,
    ApplicationAttemptStateData attemptStateDataPB)
    throws Exception {
  String appIdStr = appAttemptId.getApplicationId().toString();
  String appAttemptIdStr = appAttemptId.toString();
  String appDirPath = getNodePath(rmAppRoot, appIdStr);
  String nodeUpdatePath = getNodePath(appDirPath, appAttemptIdStr);
  if (LOG.isDebugEnabled()) {
    LOG.debug("Storing final state info for attempt: " + appAttemptIdStr
        + " at: " + nodeUpdatePath);
  }
  byte[] attemptStateData = attemptStateDataPB.getProto().toByteArray();

  if (existsWithRetries(nodeUpdatePath, false) != null) {
    setDataWithRetries(nodeUpdatePath, attemptStateData, -1);
  } else {
    createWithRetries(nodeUpdatePath, attemptStateData, zkAcl,
      CreateMode.PERSISTENT);
    LOG.debug(appAttemptId + " znode didn't exist. Created a new znode to"
        + " update the application attempt state.");
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:ZKRMStateStore.java

示例3: storeApplicationAttemptStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的package包/类
@Override
public synchronized void storeApplicationAttemptStateInternal(
    ApplicationAttemptId appAttemptId,
    ApplicationAttemptStateData attemptStateDataPB)
    throws Exception {
  Path appDirPath =
      getAppDir(rmAppRoot, appAttemptId.getApplicationId());
  Path nodeCreatePath = getNodePath(appDirPath, appAttemptId.toString());
  LOG.info("Storing info for attempt: " + appAttemptId + " at: "
      + nodeCreatePath);
  byte[] attemptStateData = attemptStateDataPB.getProto().toByteArray();
  try {
    // currently throw all exceptions. May need to respond differently for HA
    // based on whether we have lost the right to write to FS
    writeFileWithRetries(nodeCreatePath, attemptStateData, true);
  } catch (Exception e) {
    LOG.info("Error storing info for attempt: " + appAttemptId, e);
    throw e;
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:FileSystemRMStateStore.java

示例4: updateApplicationAttemptStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的package包/类
@Override
public synchronized void updateApplicationAttemptStateInternal(
    ApplicationAttemptId appAttemptId,
    ApplicationAttemptStateData attemptStateDataPB)
    throws Exception {
  Path appDirPath =
      getAppDir(rmAppRoot, appAttemptId.getApplicationId());
  Path nodeCreatePath = getNodePath(appDirPath, appAttemptId.toString());
  LOG.info("Updating info for attempt: " + appAttemptId + " at: "
      + nodeCreatePath);
  byte[] attemptStateData = attemptStateDataPB.getProto().toByteArray();
  try {
    // currently throw all exceptions. May need to respond differently for HA
    // based on whether we have lost the right to write to FS
    updateFile(nodeCreatePath, attemptStateData, true);
  } catch (Exception e) {
    LOG.info("Error updating info for attempt: " + appAttemptId, e);
    throw e;
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:FileSystemRMStateStore.java

示例5: transition

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的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

示例6: storeNewApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的package包/类
@SuppressWarnings("unchecked")
/**
 * Non-blocking API
 * ResourceManager services call this to store state on an application attempt
 * This does not block the dispatcher threads
 * RMAppAttemptStoredEvent will be sent on completion to notify the RMAppAttempt
 */
public synchronized void storeNewApplicationAttempt(RMAppAttempt appAttempt) {
  Credentials credentials = getCredentialsFromAppAttempt(appAttempt);

  AggregateAppResourceUsage resUsage =
      appAttempt.getRMAppAttemptMetrics().getAggregateAppResourceUsage();
  ApplicationAttemptStateData attemptState =
      ApplicationAttemptStateData.newInstance(
          appAttempt.getAppAttemptId(),
          appAttempt.getMasterContainer(),
          credentials, appAttempt.getStartTime(),
          resUsage.getMemorySeconds(),
          resUsage.getVcoreSeconds(),resUsage.getGcoreSeconds());

  dispatcher.getEventHandler().handle(
    new RMStateStoreAppAttemptEvent(attemptState));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:RMStateStore.java

示例7: storeApplicationAttemptStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的package包/类
@Override
public synchronized void storeApplicationAttemptStateInternal(
    ApplicationAttemptId appAttemptId,
    ApplicationAttemptStateData attemptStateDataPB)
    throws Exception {
  String appDirPath = getNodePath(rmAppRoot,
      appAttemptId.getApplicationId().toString());
  String nodeCreatePath = getNodePath(appDirPath, appAttemptId.toString());

  if (LOG.isDebugEnabled()) {
    LOG.debug("Storing info for attempt: " + appAttemptId + " at: "
        + nodeCreatePath);
  }
  byte[] attemptStateData = attemptStateDataPB.getProto().toByteArray();
  safeCreate(nodeCreatePath, attemptStateData, zkAcl,
      CreateMode.PERSISTENT);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:18,代码来源:ZKRMStateStore.java

示例8: updateApplicationAttemptStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的package包/类
@Override
public synchronized void updateApplicationAttemptStateInternal(
    ApplicationAttemptId appAttemptId,
    ApplicationAttemptStateData attemptStateDataPB)
    throws Exception {
  String appIdStr = appAttemptId.getApplicationId().toString();
  String appAttemptIdStr = appAttemptId.toString();
  String appDirPath = getNodePath(rmAppRoot, appIdStr);
  String nodeUpdatePath = getNodePath(appDirPath, appAttemptIdStr);
  if (LOG.isDebugEnabled()) {
    LOG.debug("Storing final state info for attempt: " + appAttemptIdStr
        + " at: " + nodeUpdatePath);
  }
  byte[] attemptStateData = attemptStateDataPB.getProto().toByteArray();

  if (exists(nodeUpdatePath)) {
    safeSetData(nodeUpdatePath, attemptStateData, -1);
  } else {
    safeCreate(nodeUpdatePath, attemptStateData, zkAcl,
        CreateMode.PERSISTENT);
    LOG.debug(appAttemptId + " znode didn't exist. Created a new znode to"
        + " update the application attempt state.");
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:25,代码来源:ZKRMStateStore.java

示例9: transition

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的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

示例10: storeNewApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的package包/类
@SuppressWarnings("unchecked")
/**
 * Non-blocking API
 * ResourceManager services call this to store state on an application attempt
 * This does not block the dispatcher threads
 * RMAppAttemptStoredEvent will be sent on completion to notify the RMAppAttempt
 */
public void storeNewApplicationAttempt(RMAppAttempt appAttempt) {
  Credentials credentials = getCredentialsFromAppAttempt(appAttempt);

  AggregateAppResourceUsage resUsage =
      appAttempt.getRMAppAttemptMetrics().getAggregateAppResourceUsage();
  ApplicationAttemptStateData attemptState =
      ApplicationAttemptStateData.newInstance(
          appAttempt.getAppAttemptId(),
          appAttempt.getMasterContainer(),
          credentials, appAttempt.getStartTime(),
          resUsage.getMemorySeconds(),
          resUsage.getVcoreSeconds());

  dispatcher.getEventHandler().handle(
    new RMStateStoreAppAttemptEvent(attemptState));
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:24,代码来源:RMStateStore.java

示例11: storeNewApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的package包/类
@SuppressWarnings("unchecked")
/**
 * Non-blocking API
 * ResourceManager services call this to store state on an application attempt
 * This does not block the dispatcher threads
 * RMAppAttemptStoredEvent will be sent on completion to notify the RMAppAttempt
 */
public synchronized void storeNewApplicationAttempt(RMAppAttempt appAttempt) {
  Credentials credentials = getCredentialsFromAppAttempt(appAttempt);

  AggregateAppResourceUsage resUsage =
      appAttempt.getRMAppAttemptMetrics().getAggregateAppResourceUsage();
  ApplicationAttemptStateData attemptState =
      ApplicationAttemptStateData.newInstance(
          appAttempt.getAppAttemptId(),
          appAttempt.getMasterContainer(),
          credentials, appAttempt.getStartTime(),
          resUsage.getMemorySeconds(),
          resUsage.getVcoreSeconds());

  dispatcher.getEventHandler().handle(
    new RMStateStoreAppAttemptEvent(attemptState));
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:24,代码来源:RMStateStore.java

示例12: updateApplicationAttemptStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的package包/类
@Override
public synchronized void updateApplicationAttemptStateInternal(
    ApplicationAttemptId appAttemptId,
    ApplicationAttemptStateData attemptStateDataPB)
    throws Exception {
  String appIdStr = appAttemptId.getApplicationId().toString();
  String appAttemptIdStr = appAttemptId.toString();
  String appDirPath = getNodePath(rmAppRoot, appIdStr);
  String nodeUpdatePath = getNodePath(appDirPath, appAttemptIdStr);
  if (LOG.isDebugEnabled()) {
    LOG.debug("Storing final state info for attempt: " + appAttemptIdStr
        + " at: " + nodeUpdatePath);
  }
  byte[] attemptStateData = attemptStateDataPB.getProto().toByteArray();

  if (existsWithRetries(nodeUpdatePath, true) != null) {
    setDataWithRetries(nodeUpdatePath, attemptStateData, -1);
  } else {
    createWithRetries(nodeUpdatePath, attemptStateData, zkAcl,
      CreateMode.PERSISTENT);
    LOG.debug(appAttemptId + " znode didn't exist. Created a new znode to"
        + " update the application attempt state.");
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:25,代码来源:ZKRMStateStore.java

示例13: storeApplicationAttemptStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的package包/类
@Override
public synchronized void storeApplicationAttemptStateInternal(
    ApplicationAttemptId appAttemptId,
    ApplicationAttemptStateData attemptStateDataPB)
    throws Exception {
  Path appDirPath =
      getAppDir(rmAppRoot, appAttemptId.getApplicationId().toString());
  Path nodeCreatePath = getNodePath(appDirPath, appAttemptId.toString());
  LOG.info("Storing info for attempt: " + appAttemptId + " at: "
      + nodeCreatePath);
  byte[] attemptStateData = attemptStateDataPB.getProto().toByteArray();
  try {
    // currently throw all exceptions. May need to respond differently for HA
    // based on whether we have lost the right to write to FS
    writeFile(nodeCreatePath, attemptStateData);
  } catch (Exception e) {
    LOG.info("Error storing info for attempt: " + appAttemptId, e);
    throw e;
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:21,代码来源:FileSystemRMStateStore.java

示例14: updateApplicationAttemptStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的package包/类
@Override
public synchronized void updateApplicationAttemptStateInternal(
    ApplicationAttemptId appAttemptId,
    ApplicationAttemptStateData attemptStateDataPB)
    throws Exception {
  Path appDirPath =
      getAppDir(rmAppRoot, appAttemptId.getApplicationId().toString());
  Path nodeCreatePath = getNodePath(appDirPath, appAttemptId.toString());
  LOG.info("Updating info for attempt: " + appAttemptId + " at: "
      + nodeCreatePath);
  byte[] attemptStateData = attemptStateDataPB.getProto().toByteArray();
  try {
    // currently throw all exceptions. May need to respond differently for HA
    // based on whether we have lost the right to write to FS
    updateFile(nodeCreatePath, attemptStateData);
  } catch (Exception e) {
    LOG.info("Error updating info for attempt: " + appAttemptId, e);
    throw e;
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:21,代码来源:FileSystemRMStateStore.java

示例15: transition

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData; //导入依赖的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


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