Search in sources :

Example 1 with ApplicationAttemptStateDataPBImpl

use of org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationAttemptStateDataPBImpl in project hadoop by apache.

the class LeveldbRMStateStore method createAttemptState.

private ApplicationAttemptStateData createAttemptState(String itemName, byte[] data) throws IOException {
    ApplicationAttemptId attemptId = ApplicationAttemptId.fromString(itemName);
    ApplicationAttemptStateDataPBImpl attemptState = new ApplicationAttemptStateDataPBImpl(ApplicationAttemptStateDataProto.parseFrom(data));
    if (!attemptId.equals(attemptState.getAttemptId())) {
        throw new YarnRuntimeException("The database entry for " + attemptId + " contains data for " + attemptState.getAttemptId());
    }
    return attemptState;
}
Also used : YarnRuntimeException(org.apache.hadoop.yarn.exceptions.YarnRuntimeException) ApplicationAttemptStateDataPBImpl(org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationAttemptStateDataPBImpl) ApplicationAttemptId(org.apache.hadoop.yarn.api.records.ApplicationAttemptId)

Example 2 with ApplicationAttemptStateDataPBImpl

use of org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationAttemptStateDataPBImpl in project hadoop by apache.

the class ZKRMStateStore method loadApplicationAttemptState.

private void loadApplicationAttemptState(ApplicationStateData appState, ApplicationId appId) throws Exception {
    String appPath = getNodePath(rmAppRoot, appId.toString());
    List<String> attempts = getChildren(appPath);
    for (String attemptIDStr : attempts) {
        if (attemptIDStr.startsWith(ApplicationAttemptId.appAttemptIdStrPrefix)) {
            String attemptPath = getNodePath(appPath, attemptIDStr);
            byte[] attemptData = getData(attemptPath);
            ApplicationAttemptStateDataPBImpl attemptState = new ApplicationAttemptStateDataPBImpl(ApplicationAttemptStateDataProto.parseFrom(attemptData));
            appState.attempts.put(attemptState.getAttemptId(), attemptState);
        }
    }
    LOG.debug("Done loading applications from ZK state store");
}
Also used : ApplicationAttemptStateDataPBImpl(org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationAttemptStateDataPBImpl)

Aggregations

ApplicationAttemptStateDataPBImpl (org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationAttemptStateDataPBImpl)2 ApplicationAttemptId (org.apache.hadoop.yarn.api.records.ApplicationAttemptId)1 YarnRuntimeException (org.apache.hadoop.yarn.exceptions.YarnRuntimeException)1