use of org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.AMRMTokenSecretManagerStatePBImpl in project hadoop by apache.
the class FileSystemRMStateStore method loadAMRMTokenSecretManagerState.
private void loadAMRMTokenSecretManagerState(RMState rmState) throws Exception {
checkAndResumeUpdateOperation(amrmTokenSecretManagerRoot);
Path amrmTokenSecretManagerStateDataDir = new Path(amrmTokenSecretManagerRoot, AMRMTOKEN_SECRET_MANAGER_NODE);
FileStatus status = getFileStatusWithRetries(amrmTokenSecretManagerStateDataDir);
if (status == null) {
return;
}
assert status.isFile();
byte[] data = readFileWithRetries(amrmTokenSecretManagerStateDataDir, status.getLen());
AMRMTokenSecretManagerStatePBImpl stateData = new AMRMTokenSecretManagerStatePBImpl(AMRMTokenSecretManagerStateProto.parseFrom(data));
rmState.amrmTokenSecretManagerState = AMRMTokenSecretManagerState.newInstance(stateData.getCurrentMasterKey(), stateData.getNextMasterKey());
}
use of org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.AMRMTokenSecretManagerStatePBImpl in project hadoop by apache.
the class LeveldbRMStateStore method loadAMRMTokenSecretManagerState.
private void loadAMRMTokenSecretManagerState(RMState rmState) throws IOException {
try {
byte[] data = db.get(bytes(AMRMTOKEN_SECRET_MANAGER_ROOT));
if (data != null) {
AMRMTokenSecretManagerStatePBImpl stateData = new AMRMTokenSecretManagerStatePBImpl(AMRMTokenSecretManagerStateProto.parseFrom(data));
rmState.amrmTokenSecretManagerState = AMRMTokenSecretManagerState.newInstance(stateData.getCurrentMasterKey(), stateData.getNextMasterKey());
}
} catch (DBException e) {
throw new IOException(e);
}
}
use of org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.AMRMTokenSecretManagerStatePBImpl in project hadoop by apache.
the class ZKRMStateStore method loadAMRMTokenSecretManagerState.
private void loadAMRMTokenSecretManagerState(RMState rmState) throws Exception {
byte[] data = getData(amrmTokenSecretManagerRoot);
if (data == null) {
LOG.warn("There is no data saved");
} else {
AMRMTokenSecretManagerStatePBImpl stateData = new AMRMTokenSecretManagerStatePBImpl(AMRMTokenSecretManagerStateProto.parseFrom(data));
rmState.amrmTokenSecretManagerState = AMRMTokenSecretManagerState.newInstance(stateData.getCurrentMasterKey(), stateData.getNextMasterKey());
}
}
Aggregations