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 708fa20 HIVE-22681: Replace Base64 in hcatalog-webhcat Package (David Mollitor, reviewed by Ashutosh Chauhan) 708fa20 is described below commit 708fa2037431e27c81fad8cbec82d4adecb440f4 Author: David Mollitor <dmolli...@apache.org> AuthorDate: Wed Jun 10 09:36:11 2020 -0400 HIVE-22681: Replace Base64 in hcatalog-webhcat Package (David Mollitor, reviewed by Ashutosh Chauhan) --- .../java/org/apache/hive/hcatalog/api/repl/ReplicationUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hcatalog/webhcat/java-client/src/main/java/org/apache/hive/hcatalog/api/repl/ReplicationUtils.java b/hcatalog/webhcat/java-client/src/main/java/org/apache/hive/hcatalog/api/repl/ReplicationUtils.java index 9b942f2..69e3c13 100644 --- a/hcatalog/webhcat/java-client/src/main/java/org/apache/hive/hcatalog/api/repl/ReplicationUtils.java +++ b/hcatalog/webhcat/java-client/src/main/java/org/apache/hive/hcatalog/api/repl/ReplicationUtils.java @@ -21,7 +21,6 @@ package org.apache.hive.hcatalog.api.repl; import com.google.common.base.Function; import com.google.common.base.Objects; -import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOExceptionWithCause; import org.apache.hadoop.hive.ql.parse.ReplicationSpec; import org.apache.hive.hcatalog.api.HCatDatabase; @@ -37,6 +36,7 @@ import java.io.DataInputStream; import java.io.DataOutput; import java.io.DataOutputStream; import java.io.IOException; +import java.util.Base64; import java.util.Map; public class ReplicationUtils { @@ -222,7 +222,7 @@ public class ReplicationUtils { DataOutput dataOutput = new DataOutputStream(baos); ReaderWriter.writeDatum(dataOutput,command.getClass().getName()); command.write(dataOutput); - return Base64.encodeBase64URLSafeString(baos.toByteArray()); + return Base64.getUrlEncoder().encodeToString(baos.toByteArray()); } /** @@ -234,7 +234,7 @@ public class ReplicationUtils { * given a base64 String representation of it. */ public static Command deserializeCommand(String s) throws IOException { - DataInput dataInput = new DataInputStream(new ByteArrayInputStream(Base64.decodeBase64(s))); + DataInput dataInput = new DataInputStream(new ByteArrayInputStream(Base64.getUrlDecoder().decode(s))); String clazz = (String) ReaderWriter.readDatum(dataInput); Command cmd; try {