This is an automated email from the ASF dual-hosted git repository.

dmollitor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 82d7a2f  HIVE-23899: Replace Base64 in llap Packages (David Mollitor, 
reviewed by Miklos Gergely)
82d7a2f is described below

commit 82d7a2fb2fbd22a4f5f1fb6e1261a2920386ce56
Author: belugabehr <12578579+belugab...@users.noreply.github.com>
AuthorDate: Fri Jul 24 09:14:13 2020 -0400

    HIVE-23899: Replace Base64 in llap Packages (David Mollitor, reviewed by 
Miklos Gergely)
---
 .../src/java/org/apache/hadoop/hive/registry/impl/TezAmInstance.java  | 4 ++--
 .../apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/llap-client/src/java/org/apache/hadoop/hive/registry/impl/TezAmInstance.java 
b/llap-client/src/java/org/apache/hadoop/hive/registry/impl/TezAmInstance.java
index a862947..b31175e 100644
--- 
a/llap-client/src/java/org/apache/hadoop/hive/registry/impl/TezAmInstance.java
+++ 
b/llap-client/src/java/org/apache/hadoop/hive/registry/impl/TezAmInstance.java
@@ -14,8 +14,8 @@
 package org.apache.hadoop.hive.registry.impl;
 
 import java.io.IOException;
+import java.util.Base64;
 
-import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.hadoop.registry.client.binding.RegistryTypeUtils;
 import org.apache.hadoop.registry.client.types.AddressTypes;
@@ -66,7 +66,7 @@ public class TezAmInstance extends ServiceInstanceBase {
     if (this.token != null) return token;
     String tokenString = 
getProperties().get(TezAmRegistryImpl.AM_PLUGIN_TOKEN);
     if (tokenString == null || tokenString.isEmpty()) return null;
-    byte[] tokenBytes = Base64.decodeBase64(tokenString);
+    byte[] tokenBytes = Base64.getDecoder().decode(tokenString);
     Token<JobTokenIdentifier> token = new Token<>();
     try {
       token.readFields(ByteStreams.newDataInput(tokenBytes));
diff --git 
a/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java
 
b/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java
index d4cc7a3..9012972 100644
--- 
a/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java
+++ 
b/llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskSchedulerService.java
@@ -30,6 +30,7 @@ import 
org.apache.hadoop.hive.registry.ServiceInstanceStateChangeListener;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Base64;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
@@ -67,7 +68,6 @@ import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
-import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.lang3.mutable.MutableInt;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hive.common.JvmPauseMonitor;
@@ -565,7 +565,7 @@ public class LlapTaskSchedulerService extends TaskScheduler 
{
       // This shouldn't really happen on a byte array.
       throw new RuntimeException(e);
     }
-    return Base64.encodeBase64String(bytes);
+    return Base64.getEncoder().withoutPadding().encodeToString(bytes);
   }
 
 

Reply via email to