From 56f042c48f15586eba6ca371e90253e57614ec8b Mon Sep 17 00:00:00 2001 From: Xiaoyu Yao Date: Mon, 16 Sep 2019 16:58:10 +0200 Subject: [PATCH] HDDS-2078. Get/Renew DelegationToken NPE after HDDS-1909 Closes #1444 --- .../om/request/security/OMGetDelegationTokenRequest.java | 4 ++-- .../om/request/security/OMRenewDelegationTokenRequest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMGetDelegationTokenRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMGetDelegationTokenRequest.java index 77d16d575e..be88b43df4 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMGetDelegationTokenRequest.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMGetDelegationTokenRequest.java @@ -147,8 +147,8 @@ public class OMGetDelegationTokenRequest extends OMClientRequest { OMMetadataManager omMetadataManager = ozoneManager.getMetadataManager(); try { - OzoneTokenIdentifier ozoneTokenIdentifier = - ozoneTokenIdentifierToken.decodeIdentifier(); + OzoneTokenIdentifier ozoneTokenIdentifier = OzoneTokenIdentifier. + readProtoBuf(ozoneTokenIdentifierToken.getIdentifier()); // Update in memory map of token. long renewTime = ozoneManager.getDelegationTokenMgr() diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMRenewDelegationTokenRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMRenewDelegationTokenRequest.java index 49cc72495c..11c0c82b52 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMRenewDelegationTokenRequest.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMRenewDelegationTokenRequest.java @@ -123,8 +123,8 @@ public class OMRenewDelegationTokenRequest extends OMClientRequest { .setSuccess(true); try { - OzoneTokenIdentifier ozoneTokenIdentifier = - ozoneTokenIdentifierToken.decodeIdentifier(); + OzoneTokenIdentifier ozoneTokenIdentifier = OzoneTokenIdentifier. + readProtoBuf(ozoneTokenIdentifierToken.getIdentifier()); // Update in memory map of token. ozoneManager.getDelegationTokenMgr()