Пример #1
0
 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);
   }
 }
 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());
 }