Skip to content

Commit

Permalink
合并开源分支代码
Browse files Browse the repository at this point in the history
  • Loading branch information
peacewong committed Dec 9, 2024
1 parent 93751ee commit 812d2b3
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 53 deletions.
2 changes: 1 addition & 1 deletion linkis-commons/linkis-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<version>${springfox.version}</version>
<exclusions>
<exclusion>
<artifactId>classgraph</artifactId>
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.linkis.entrance.interceptor.impl

import org.apache.commons.lang3.exception.ExceptionUtils
import org.apache.linkis.common.exception.ErrorException
import org.apache.linkis.common.utils.{Logging, Utils}
import org.apache.linkis.entrance.interceptor.EntranceInterceptor
Expand All @@ -41,14 +42,14 @@ class LogPathCreateInterceptor extends EntranceInterceptor with Logging {
case e: ErrorException =>
val exception: LogPathCreateException = LogPathCreateException(
20075,
"Failed to get logPath(获取logPath失败),reason: " + e.getMessage
"Failed to get logPath(获取logPath失败),reason msg: " + e.getMessage
)
exception.initCause(e)
exception
case t: Throwable =>
val exception: LogPathCreateException = LogPathCreateException(
20075,
"Failed to get logPath(获取logPath失败), reason: " + t.getCause
"Failed to get logPath(获取logPath失败), reason: " + ExceptionUtils.getStackTrace(t)
)
exception.initCause(t)
exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* limitations under the License.
*/

<<<<<<< HEAD:linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/response/KeyvalueResult.scala
package org.apache.linkis.monitor.response

import org.apache.linkis.httpclient.dws.annotation.DWSHttpMessageResult
Expand All @@ -34,23 +33,4 @@ class KeyvalueResult extends DWSResult {
@BeanProperty
var totalPage: Int = _

=======
package org.apache.linkis.engineplugin.spark.client.deployment.crds;

import io.fabric8.kubernetes.api.model.Namespaced;
import io.fabric8.kubernetes.client.CustomResource;
import io.fabric8.kubernetes.model.annotation.Group;
import io.fabric8.kubernetes.model.annotation.Kind;
import io.fabric8.kubernetes.model.annotation.Version;

@Version(SparkApplication.VERSION)
@Group(SparkApplication.GROUP)
@Kind(SparkApplication.Kind)
public class SparkApplication extends CustomResource<SparkApplicationSpec, SparkApplicationStatus>
implements Namespaced {
public static final String GROUP = "sparkoperator.k8s.io";
public static final String VERSION = "v1beta2";

public static final String Kind = "SparkApplication";
>>>>>>> origin/dev-1.9.0-webank-bak:linkis-engineconn-plugins/spark/src/main/java/org/apache/linkis/engineplugin/spark/client/deployment/crds/SparkApplication.java
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ import org.apache.linkis.governance.common.protocol.engineconn.{
import org.apache.linkis.governance.common.utils.GovernanceConstant
import org.apache.linkis.manager.common.entity.enumeration.NodeStatus
import org.apache.linkis.manager.common.protocol.node.{RequestNodeStatus, ResponseNodeStatus}
import org.apache.linkis.manager.label.entity.Label
import org.apache.linkis.manager.label.utils.LabelUtil
import org.apache.linkis.orchestrator.computation.conf.ComputationOrchestratorConf
import org.apache.linkis.orchestrator.computation.execute.{CodeExecTaskExecutor, EngineConnTaskInfo}
import org.apache.linkis.orchestrator.listener.task.{
EngineQuitedUnexpectedlyEvent,
TaskErrorResponseEvent,
TaskLogEvent,
TaskStatusEvent
Expand Down Expand Up @@ -202,25 +201,14 @@ object EngineConnMonitor extends Logging {
executors.foreach { executor =>
val execTask = executor.getExecTask
Utils.tryAndError {
val labels: Array[Label[_]] = executor.getEngineConnExecutor.getLabels()
val engineType: String = LabelUtil.getEngineTypeLabel(labels.toList.asJava).getEngineType
logger.warn(
s"Will kill task ${execTask.getIDInfo()} because the engine ${executor.getEngineConnExecutor.getServiceInstance.toString} quited unexpectedly."
)
val errLog = LogUtils.generateERROR(
s"Your job : ${execTask.getIDInfo()} was failed because the ${engineType} engine quitted unexpectedly(任务${execTask
.getIDInfo()}失败," +
s"原因是引擎意外退出,可能是复杂任务导致引擎退出,如OOM)."
)
val logEvent = TaskLogEvent(execTask, errLog)
execTask.getPhysicalContext.pushLog(logEvent)
val errorResponseEvent = TaskErrorResponseEvent(
val event = EngineQuitedUnexpectedlyEvent(
execTask,
"task failed,Engine quitted unexpectedly(任务运行失败原因是引擎意外退出,可能是复杂任务导致引擎退出,如OOM)."
executor.getEngineConnExecutor.getServiceInstance.toString
)
execTask.getPhysicalContext.broadcastSyncEvent(errorResponseEvent)
val statusEvent = TaskStatusEvent(execTask, ExecutionNodeStatus.Failed)
execTask.getPhysicalContext.broadcastSyncEvent(statusEvent)
execTask.getPhysicalContext.broadcastSyncEvent(event)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package org.apache.linkis.orchestrator.strategy.async

import org.apache.linkis.common.log.LogUtils
import org.apache.linkis.governance.common.entity.ExecutionNodeStatus
import org.apache.linkis.manager.label.utils.LabelUtil
import org.apache.linkis.orchestrator.execution.ExecTaskRunner
import org.apache.linkis.orchestrator.execution.impl.DefaultTaskManager
import org.apache.linkis.orchestrator.listener.OrchestratorSyncEvent
Expand Down Expand Up @@ -122,8 +123,12 @@ class AsyncTaskManager
)
} else {
val execTask = event.execTask
val labels = execTask.getTaskDesc.getOrigin.getASTOrchestration.getASTContext.getLabels
val engineType: String = LabelUtil.getEngineTypeLabel(labels).getEngineType
val errLog = LogUtils.generateERROR(
s"Your job : ${execTask.getIDInfo()} was failed because the engine quited unexpectedly(任务${execTask.getIDInfo()}失败,原因是引擎意外退出,可能是复杂任务导致引擎退出,如OOM)."
s"Your job : ${execTask.getIDInfo()} was failed because the ${engineType} engine quitted unexpectedly(任务${execTask
.getIDInfo()}失败," +
s"原因是引擎意外退出,可能是复杂任务导致引擎退出,如OOM)."
)
val logEvent = TaskLogEvent(execTask, errLog)
execTask.getPhysicalContext.pushLog(logEvent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ private static String getRootPath(InputStream inputStream, String folder) throws
while ((entry = tarInput.getNextTarEntry()) != null) {
if (entry.isDirectory() && entry.getName().endsWith(delimiter)) {
rootPathStr = entry.getName().replace(folder + FsPath.SEPARATOR, "");
return rootPathStr;
return rootPathStr;
}
if (entry.getName().contains(delimiter)) {
rootPathStr = entry.getName().substring(0, entry.getName().indexOf(delimiter));
return rootPathStr;
return rootPathStr;
}
}
} catch (Exception e) {
Expand Down Expand Up @@ -158,16 +158,16 @@ public static InputStream getZipInputStreamByTarInputStream(
return createZipFile(file.getInputStream(), packageName, rootPath);
} else {
throw new UdfException(
80038,
"The name directory "
+ packageName
+ " specified by PKG-INFO does not exist. Please confirm that the "
+ packageName
+ " specified by PKG-INFO in the package matches the actual folder name (PKG-INFO指定Name目录"
+ packageName
+ "不存在,请确认包中PKG-INFO指定"
+ packageName
+ "和实际文件夹名称一致)");
80038,
"The name directory "
+ packageName
+ " specified by PKG-INFO does not exist. Please confirm that the "
+ packageName
+ " specified by PKG-INFO in the package matches the actual folder name (PKG-INFO指定Name目录"
+ packageName
+ "不存在,请确认包中PKG-INFO指定"
+ packageName
+ "和实际文件夹名称一致)");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
<version>${springfox.version}</version>
<exclusions>
<exclusion>
<artifactId>classgraph</artifactId>
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand Down

0 comments on commit 812d2b3

Please sign in to comment.