YARN-5663. Small refactor in ZKRMStateStore. Contributed by Oleksii Dymytrov.
(cherry picked from commit14a696f369
) (cherry picked from commit74f2df16a9
)
This commit is contained in:
parent
4c2b20ca3e
commit
ece3ca0cba
|
@ -761,17 +761,14 @@ public class ZKRMStateStore extends RMStateStore {
|
|||
String nodeCreatePath =
|
||||
getNodePath(dtMasterKeysRootPath, DELEGATION_KEY_PREFIX
|
||||
+ delegationKey.getKeyId());
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
DataOutputStream fsOut = new DataOutputStream(os);
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Storing RMDelegationKey_" + delegationKey.getKeyId());
|
||||
}
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
try(DataOutputStream fsOut = new DataOutputStream(os)) {
|
||||
delegationKey.write(fsOut);
|
||||
try {
|
||||
safeCreate(nodeCreatePath, os.toByteArray(), zkAcl,
|
||||
CreateMode.PERSISTENT);
|
||||
} finally {
|
||||
os.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue