You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2022/08/31 10:18:31 UTC

[incubator-linkis] branch dev-1.3.1 updated: [linkis-udf-client] Modification of scala file floating red (#3155)

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

peacewong pushed a commit to branch dev-1.3.1
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git


The following commit(s) were added to refs/heads/dev-1.3.1 by this push:
     new c86615a72 [linkis-udf-client] Modification of scala file floating red (#3155)
c86615a72 is described below

commit c86615a723a0860a0de46d6d2d06d8d1d1ad62e1
Author: 成彬彬 <10...@users.noreply.github.com>
AuthorDate: Wed Aug 31 18:18:25 2022 +0800

    [linkis-udf-client] Modification of scala file floating red (#3155)
---
 .../main/scala/org/apache/linkis/udf/UDFClient.scala | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/linkis-public-enhancements/linkis-udf/linkis-udf-client/src/main/scala/org/apache/linkis/udf/UDFClient.scala b/linkis-public-enhancements/linkis-udf/linkis-udf-client/src/main/scala/org/apache/linkis/udf/UDFClient.scala
index 4aa2aeffc..4f9b69e79 100644
--- a/linkis-public-enhancements/linkis-udf/linkis-udf-client/src/main/scala/org/apache/linkis/udf/UDFClient.scala
+++ b/linkis-public-enhancements/linkis-udf/linkis-udf-client/src/main/scala/org/apache/linkis/udf/UDFClient.scala
@@ -25,13 +25,12 @@ import org.apache.linkis.udf.vo.UDFInfoVo
 
 import org.apache.commons.collections.CollectionUtils
 
-import scala.collection.JavaConversions._
-import scala.collection.mutable
+import scala.collection.JavaConverters._
 import scala.collection.mutable.ArrayBuffer
 
 object UDFClient {
 
-  @Deprecated
+  @deprecated
   def getUdfInfos(userName: String, category: String): ArrayBuffer[UDFInfoVo] = {
     val udfInfoBuilder = new ArrayBuffer[UDFInfoVo]
     val udfTree = queryUdfRpc(userName, category)
@@ -46,8 +45,9 @@ object UDFClient {
   ): ArrayBuffer[UDFInfoVo] = {
     val udfInfoBuilder = new ArrayBuffer[UDFInfoVo]
     val udfTree = queryUdfRpc(userName, category)
-    if (null != udfTree)
+    if (null != udfTree) {
       extractUdfInfosByUdfType(udfInfoBuilder, udfTree, userName, category, udfType)
+    }
     udfInfoBuilder
   }
 
@@ -78,12 +78,12 @@ object UDFClient {
       category: String
   ): Unit = {
     if (CollectionUtils.isNotEmpty(udfTree.getUdfInfos)) {
-      udfTree.getUdfInfos.foreach { udfInfo: UDFInfoVo =>
+      udfTree.getUdfInfos.asScala.foreach { udfInfo: UDFInfoVo =>
         udfInfoBuilder.append(udfInfo)
       }
     }
     if (CollectionUtils.isNotEmpty(udfTree.getChildrens)) {
-      udfTree.getChildrens.foreach { child: UDFTree =>
+      udfTree.getChildrens.asScala.foreach { child: UDFTree =>
         var childInfo = child
         if (ConstantVar.specialTypes.contains(child.getUserName)) {
           childInfo = queryUdfRpc(userName, category, child.getId, child.getUserName)
@@ -103,12 +103,12 @@ object UDFClient {
       udfType: BigInt
   ): Unit = {
     if (CollectionUtils.isNotEmpty(udfTree.getUdfInfos)) {
-      udfTree.getUdfInfos
+      udfTree.getUdfInfos.asScala
         .filter(infoVo => infoVo.getUdfType == udfType && infoVo.getLoad == true)
         .foreach(infoVo => udfInfoBuilder.append(infoVo))
     }
     if (CollectionUtils.isNotEmpty(udfTree.getChildrens)) {
-      udfTree.getChildrens.foreach { child: UDFTree =>
+      udfTree.getChildrens.asScala.foreach { child: UDFTree =>
         val childInfo = if (ConstantVar.SYS_USER.equalsIgnoreCase(child.getUserName)) {
           null
         } else if (ConstantVar.specialTypes.contains(child.getUserName)) {
@@ -116,8 +116,9 @@ object UDFClient {
         } else {
           queryUdfRpc(userName, category, child.getId, ConstantVar.SELF_USER)
         }
-        if (null != childInfo)
+        if (null != childInfo) {
           extractUdfInfosByUdfType(udfInfoBuilder, childInfo, userName, category, udfType)
+        }
       }
     }
   }
@@ -133,7 +134,6 @@ object UDFClient {
       .ask(RequestUdfTree(userName, treeType, treeId, category))
       .asInstanceOf[ResponseUdfTree]
       .udfTree
-    // info("got udf tree:" + new ObjectMapper().writer().withDefaultPrettyPrinter().writeValueAsString(udfTree))
     udfTree
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org