Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECM code optimization #4449

Merged
merged 8 commits into from
Apr 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
If empty skip

)
.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 + '\'' +
'}';
}*/
}