yaooqinn commented on a change in pull request #1015:
URL: https://github.com/apache/incubator-kyuubi/pull/1015#discussion_r701613659



##########
File path: 
kyuubi-common/src/main/scala/org/apache/kyuubi/util/KyuubiHadoopUtils.scala
##########
@@ -33,4 +35,24 @@ object KyuubiHadoopUtils {
   def getServerPrincipal(principal: String): String = {
     SecurityUtil.getServerPrincipal(principal, "0.0.0.0")
   }
+
+  def encodeCredentials(creds: Credentials): String = {

Review comment:
       ```scala
     def serialize(creds: Credentials): Array[Byte] = {
       val byteStream = new ByteArrayOutputStream
       val dataStream = new DataOutputStream(byteStream)
       creds.writeTokenStorageToStream(dataStream)
       byteStream.toByteArray
     }
   
     def deserialize(tokenBytes: Array[Byte]): Credentials = {
       val tokensBuf = new ByteArrayInputStream(tokenBytes)
   
       val creds = new Credentials()
       creds.readTokenStorageStream(new DataInputStream(tokensBuf))
       creds
     }
   
   ```
   
   the implementation in Spark side looks more elegant to me 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to