hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject hive git commit: HIVE-17962 : org.apache.hadoop.hive.metastore.security.MemoryTokenStore - Parameterize Logging (Beluga Behr via Aihua Xu)
Date Sun, 05 Nov 2017 17:26:32 GMT
Repository: hive
Updated Branches:
  refs/heads/master 6c8713677 -> 49f681487


HIVE-17962 : org.apache.hadoop.hive.metastore.security.MemoryTokenStore - Parameterize Logging
(Beluga Behr via Aihua Xu)

Signed-off-by: Ashutosh Chauhan <hashutosh@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/49f68148
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/49f68148
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/49f68148

Branch: refs/heads/master
Commit: 49f6814871b55b356a67f18a57a5601ef58a7633
Parents: 6c87136
Author: BELUGA BEHR <dam6923@gmail.com>
Authored: Sun Nov 5 09:25:57 2017 -0800
Committer: Ashutosh Chauhan <hashutosh@apache.org>
Committed: Sun Nov 5 09:25:57 2017 -0800

----------------------------------------------------------------------
 .../metastore/security/MemoryTokenStore.java    | 31 +++++---------------
 1 file changed, 7 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/49f68148/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/security/MemoryTokenStore.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/security/MemoryTokenStore.java
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/security/MemoryTokenStore.java
index c29dc79..c09501a 100644
--- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/security/MemoryTokenStore.java
+++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/security/MemoryTokenStore.java
@@ -57,26 +57,20 @@ public class MemoryTokenStore implements DelegationTokenStore {
   @Override
   public int addMasterKey(String s) {
     int keySeq = masterKeySeq.getAndIncrement();
-    if (LOG.isTraceEnabled()) {
-      LOG.trace("addMasterKey: s = " + s + ", keySeq = " + keySeq);
-    }
+    LOG.trace("addMasterKey: s = {}, keySeq = {}", s, keySeq);
     masterKeys.put(keySeq, s);
     return keySeq;
   }
 
   @Override
   public void updateMasterKey(int keySeq, String s) {
-    if (LOG.isTraceEnabled()) {
-      LOG.trace("updateMasterKey: s = " + s + ", keySeq = " + keySeq);
-    }
+    LOG.trace("updateMasterKey: s = {}, keySeq = {}", s, keySeq);
     masterKeys.put(keySeq, s);
   }
 
   @Override
   public boolean removeMasterKey(int keySeq) {
-    if (LOG.isTraceEnabled()) {
-      LOG.trace("removeMasterKey: keySeq = " + keySeq);
-    }
+    LOG.trace("removeMasterKey: keySeq = {}", keySeq);
     return masterKeys.remove(keySeq) != null;
   }
 
@@ -89,38 +83,27 @@ public class MemoryTokenStore implements DelegationTokenStore {
   public boolean addToken(DelegationTokenIdentifier tokenIdentifier,
     DelegationTokenInformation token) {
     DelegationTokenInformation tokenInfo = tokens.putIfAbsent(tokenIdentifier, token);
-    if (LOG.isTraceEnabled()) {
-      LOG.trace("addToken: tokenIdentifier = " + tokenIdentifier + ", added = " + (tokenInfo
== null));
-    }
+    LOG.trace("addToken: tokenIdentifier = {}, added = {}", tokenIdentifier, (tokenInfo ==
null));
     return (tokenInfo == null);
   }
 
   @Override
   public boolean removeToken(DelegationTokenIdentifier tokenIdentifier) {
     DelegationTokenInformation tokenInfo = tokens.remove(tokenIdentifier);
-    if (LOG.isTraceEnabled()) {
-      LOG.trace("removeToken: tokenIdentifier = " + tokenIdentifier + ", removed = " + (tokenInfo
!= null));
-    }
+    LOG.trace("removeToken: tokenIdentifier = {}, removed = ", tokenIdentifier, (tokenInfo
!= null));
     return tokenInfo != null;
   }
 
   @Override
   public DelegationTokenInformation getToken(DelegationTokenIdentifier tokenIdentifier) {
     DelegationTokenInformation result = tokens.get(tokenIdentifier);
-    if (LOG.isTraceEnabled()) {
-      LOG.trace("getToken: tokenIdentifier = " + tokenIdentifier + ", result = " + result);
-    }
+    LOG.trace("getToken: tokenIdentifier = {}, result = {}", tokenIdentifier, result);
     return result;
   }
 
   @Override
   public List<DelegationTokenIdentifier> getAllDelegationTokenIdentifiers() {
-    List<DelegationTokenIdentifier> result = new ArrayList<>(
-        tokens.size());
-    for (DelegationTokenIdentifier id : tokens.keySet()) {
-        result.add(id);
-    }
-    return result;
+    return new ArrayList<>(tokens.keySet());
   }
 
   @Override


Mime
View raw message