Search in sources :

Example 6 with AMRMTokenSecretManagerState

use of org.apache.hadoop.yarn.server.resourcemanager.recovery.records.AMRMTokenSecretManagerState in project hadoop by apache.

the class FileSystemRMStateStore method storeOrUpdateAMRMTokenSecretManagerState.

@Override
public synchronized void storeOrUpdateAMRMTokenSecretManagerState(AMRMTokenSecretManagerState amrmTokenSecretManagerState, boolean isUpdate) throws Exception {
    Path nodeCreatePath = getNodePath(amrmTokenSecretManagerRoot, AMRMTOKEN_SECRET_MANAGER_NODE);
    AMRMTokenSecretManagerState data = AMRMTokenSecretManagerState.newInstance(amrmTokenSecretManagerState);
    byte[] stateData = data.getProto().toByteArray();
    if (isUpdate) {
        updateFile(nodeCreatePath, stateData, true);
    } else {
        writeFileWithRetries(nodeCreatePath, stateData, true);
    }
}
Also used : Path(org.apache.hadoop.fs.Path) AMRMTokenSecretManagerState(org.apache.hadoop.yarn.server.resourcemanager.recovery.records.AMRMTokenSecretManagerState)

Example 7 with AMRMTokenSecretManagerState

use of org.apache.hadoop.yarn.server.resourcemanager.recovery.records.AMRMTokenSecretManagerState in project hadoop by apache.

the class LeveldbRMStateStore method storeOrUpdateAMRMTokenSecretManagerState.

@Override
public void storeOrUpdateAMRMTokenSecretManagerState(AMRMTokenSecretManagerState state, boolean isUpdate) {
    AMRMTokenSecretManagerState data = AMRMTokenSecretManagerState.newInstance(state);
    byte[] stateData = data.getProto().toByteArray();
    db.put(bytes(AMRMTOKEN_SECRET_MANAGER_ROOT), stateData);
}
Also used : AMRMTokenSecretManagerState(org.apache.hadoop.yarn.server.resourcemanager.recovery.records.AMRMTokenSecretManagerState)

Aggregations

AMRMTokenSecretManagerState (org.apache.hadoop.yarn.server.resourcemanager.recovery.records.AMRMTokenSecretManagerState)7 Private (org.apache.hadoop.classification.InterfaceAudience.Private)1 Configuration (org.apache.hadoop.conf.Configuration)1 Path (org.apache.hadoop.fs.Path)1 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)1 RMContext (org.apache.hadoop.yarn.server.resourcemanager.RMContext)1 RMState (org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore.RMState)1 AMRMTokenSecretManager (org.apache.hadoop.yarn.server.resourcemanager.security.AMRMTokenSecretManager)1 MasterKeyData (org.apache.hadoop.yarn.server.security.MasterKeyData)1