Skip to content

Commit

Permalink
ECM code optimization (#4449)
Browse files Browse the repository at this point in the history
* ECM code optimization
  • Loading branch information
ChengJie1053 committed Apr 16, 2023
1 parent af40a99 commit c8d1512
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,16 @@ import java.nio.file.Paths

object ECPathUtils {

def getECWOrkDirPathSuffix(
user: String,
ticketId: String,
engineType: String,
timeStamp: Long = System.currentTimeMillis()
): String = {
val suffix = if (StringUtils.isBlank(engineType)) {
Paths
.get(user, DateFormatUtils.format(System.currentTimeMillis(), "yyyyMMdd"))
.toFile
.getPath
} else {
Paths
.get(user, DateFormatUtils.format(System.currentTimeMillis(), "yyyyMMdd"), engineType)
.toFile
.getPath
}
suffix + File.separator + ticketId
def getECWOrkDirPathSuffix(user: String, ticketId: String, engineType: String): String = {
Paths
.get(
user,
DateFormatUtils.format(System.currentTimeMillis(), "yyyyMMdd"),
if (StringUtils.isBlank(engineType)) "" else engineType
)
.toFile
.getPath + File.separator + ticketId

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package org.apache.linkis.governance.common.utils

import org.apache.linkis.governance.common.constant.job.JobRequestConstants

import org.apache.commons.collections.MapUtils

import java.util;

object JobUtils {
Expand All @@ -34,13 +36,7 @@ object JobUtils {
}

def getJobIdFromStringMap(map: util.Map[String, String]): String = {
if (null != map && map.containsKey(JobRequestConstants.JOB_ID)) {
val value = map.get(JobRequestConstants.JOB_ID)
if (null != value) {
return value
}
}
null
if (MapUtils.isNotEmpty(map)) map.getOrDefault(JobRequestConstants.JOB_ID, null) else null
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ class JarUDFLoadECMHook extends ECMHook with Logging {
)
}
}
// LaunchConstants.addPathToClassPath(pel.environment, udfDir + File.separator + "*")
val udfJars = fileNameSet.map(udfDir + File.separator + _)
pel.environment.put(Environment.UDF_JARS.toString, udfJars.mkString(","));
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ class BmlResourceLocalizationService extends ResourceLocalizationService with Lo
}
}

private val bmlResourceSuffix = ".zip"

private def createDirIfNotExit(noSchemaPath: String): String = {
val fsPath = new FsPath(schema + noSchemaPath)
if (!fs.exists(fsPath)) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,4 @@ public static enum BmlResourceVisibility {
Private,
Label
}

/* @Override
public String toString() {
return "{" +
"fileName='" + fileName + '\'' +
", resourceId='" + resourceId + '\'' +
", version='" + version + '\'' +
'}';
}*/
}

0 comments on commit c8d1512

Please sign in to comment.