Skip to content

Commit

Permalink
1. fixed a small bug
Browse files Browse the repository at this point in the history
2. support '-' in hostname

closes #953
  • Loading branch information
Fuu3214 committed Aug 12, 2021
1 parent 5816180 commit 45f961b
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,6 @@ class TaskExecutionServiceImpl extends TaskExecutionService with Logging with Re
val runTask = new Runnable {
override def run(): Unit = Utils.tryAndWarn {
LogHelper.dropAllRemainLogs()
val response = computationExecutor.execute(task)
response match {
case ErrorExecuteResponse(message, throwable) =>
sendToEntrance(task, ResponseTaskError(task.getTaskId, message))
error(message, throwable)
LogHelper.pushAllRemainLogs()
computationExecutor.transformTaskStatus(task, ExecutionNodeStatus.Failed)
case _ =>
}
clearCache(task.getTaskId)
executeTask(task, computationExecutor)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,9 @@ public class LabelCommonConfig {
public final static CommonVars<String> FLINK_ENGINE_VERSION = CommonVars.apply("wds.linkis.flink.engine.version", "1.12.2");

public final static CommonVars<String> PERMANENT_LABEL = CommonVars.apply("wds.linkis.am.permanent.label", "tenant");

public final static CommonVars<String> ENGINE_CONN_MANAGER_SPRING_NAME = CommonVars.apply("wds.linkis.engineconn.manager.name", "linkis-cg-engineconnmanager");

public final static CommonVars<String> ENGINE_CONN_SPRING_NAME = CommonVars.apply("wds.linkis.engineconn.name", "linkis-cg-engineconn");
}

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.webank.wedatasphere.linkis.manager.label.entity.em;

import com.webank.wedatasphere.linkis.common.ServiceInstance;
import com.webank.wedatasphere.linkis.manager.label.conf.LabelCommonConfig;
import com.webank.wedatasphere.linkis.manager.label.constant.LabelKeyConstant;
import com.webank.wedatasphere.linkis.manager.label.entity.EMNodeLabel;
import com.webank.wedatasphere.linkis.manager.label.entity.EngineNodeLabel;
Expand Down Expand Up @@ -73,8 +74,8 @@ public ServiceInstance getServiceInstance(){

@Override
protected void setStringValue(String stringValue){
String instance = stringValue.substring(stringValue.lastIndexOf('-') + 1, stringValue.length());
String serviceName = stringValue.substring(0, stringValue.lastIndexOf('-'));
String instance = stringValue.replace(LabelCommonConfig.ENGINE_CONN_MANAGER_SPRING_NAME.getValue() + "-", "");
String serviceName = LabelCommonConfig.ENGINE_CONN_MANAGER_SPRING_NAME.getValue();
setInstance(instance);
setServiceName(serviceName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.webank.wedatasphere.linkis.manager.label.entity.engine;

import com.webank.wedatasphere.linkis.common.ServiceInstance;
import com.webank.wedatasphere.linkis.manager.label.conf.LabelCommonConfig;
import com.webank.wedatasphere.linkis.manager.label.constant.LabelKeyConstant;
import com.webank.wedatasphere.linkis.manager.label.entity.EngineNodeLabel;
import com.webank.wedatasphere.linkis.manager.label.entity.GenericLabel;
Expand Down Expand Up @@ -69,4 +70,12 @@ public String getServiceName() {
public ServiceInstance getServiceInstance() {
return ServiceInstance.apply(getServiceName(), getInstance());
}

@Override
protected void setStringValue(String stringValue){
String instance = stringValue.replace(LabelCommonConfig.ENGINE_CONN_SPRING_NAME.getValue() + "-", "");
String serviceName = LabelCommonConfig.ENGINE_CONN_SPRING_NAME.getValue();
setInstance(instance);
setServiceName(serviceName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package com.webank.wedatasphere.linkis.manager.am.conf

import com.webank.wedatasphere.linkis.common.conf.{CommonVars, TimeType}
import com.webank.wedatasphere.linkis.common.utils.Utils


object AMConfiguration {
Expand Down Expand Up @@ -52,9 +53,17 @@ object AMConfiguration {

val MULTI_USER_ENGINE_TYPES = CommonVars("wds.linkis.multi.user.engine.types", "jdbc,es,presto,io_file,appconn")

val MULTI_USER_ENGINE_USER = CommonVars("wds.linkis.multi.user.engine.user", "{jdbc:\"hadoop\", es: \"hadoop\", presto:\"hadoop\",io_file:\"root\",appconn:\"hadoop\"}")
val DEFAULT_ENGINECONN_USER = Utils.getJvmUser

val MULTI_USER_ENGINE_USER = CommonVars("wds.linkis.multi.user.engine.user", getDefaultMultiEngineUser)

val MONITOR_SWITCH_ON = CommonVars("wds.linkis.manager.am.monitor.switch.on", true)

val ENGINE_LOCKER_MAX_TIME = CommonVars("wds.linkis.manager.am.engine.locker.max.time", 1000*60*5)

private def getDefaultMultiEngineUser(): String = {
val jvmUser = Utils.getJvmUser
s""" {jdbc:"$jvmUser", es: "$jvmUser", presto:"$jvmUser",appconn:"$jvmUser", io_file:"root"}"""
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import com.webank.wedatasphere.linkis.storage.utils.StorageConfiguration

class JDBCProcessEngineConnLaunchBuilder extends JavaProcessEngineConnLaunchBuilder {

override def getEngineStartUser(label: UserCreatorLabel): String = {
StorageConfiguration.HDFS_ROOT_USER.getValue
}
// override def getEngineStartUser(label: UserCreatorLabel): String = {
// StorageConfiguration.HDFS_ROOT_USER.getValue
// }

}

0 comments on commit 45f961b

Please sign in to comment.