-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add repl ec to execute Java and scala code #4937
Conversation
@@ -42,6 +42,9 @@ public class LabelCommonConfig { | |||
public static final CommonVars<String> PYTHON_ENGINE_VERSION = | |||
CommonVars.apply("wds.linkis.python.engine.version", "python2"); | |||
|
|||
public static final CommonVars<String> REPL_ENGINE_VERSION = | |||
CommonVars.apply("wds.linkis.repl.engine.version", "1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to remove wds prefix
}); | ||
|
||
thread.start(); | ||
threadCache.put(taskId, thread); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there no need to be asynchronous here? Just use the current thread and interrupt the thread when killing.
StringReader stringReader = new StringReader(code); | ||
StringWriter stringWriter = new StringWriter(); | ||
|
||
ILoop repl = new ILoop(new BufferedReader(stringReader), new PrintWriter(stringWriter)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does scala's iloop need to be set to reuse mode so that multiple executions can be reused?
|
||
/** | ||
* @Author linkis | ||
* @Date 2023/10/9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to remove author and date
```json | ||
{ | ||
"executionContent":{ | ||
"code":"package com.linkis.javassist;\n\nimport org.apache.commons.lang3.StringUtils;\n\n/**\n * @Author linkis\n * @Date 2023/10/9\n */\npublic class Test {\n public void sayHello() {\n System.out.println(\"hello\");\n System.out.println(StringUtils.isEmpty(\"hello\"));\n }\n}\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to remove author and date
<configuration status="error" monitorInterval="30"> | ||
<appenders> | ||
<Console name="Console" target="SYSTEM_OUT"> | ||
<ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be consistent with spark and hive engines
"{jdbc:\"%s\", es: \"%s\", presto:\"%s\", appconn:\"%s\", openlookeng:\"%s\", trino:\"%s\", nebula:\"%s\", hbase:\"%s\",io_file:\"root\"}", | ||
jvmUser, jvmUser, jvmUser, jvmUser, jvmUser, jvmUser, jvmUser, jvmUser); | ||
"{jdbc:\"%s\", es: \"%s\", presto:\"%s\", appconn:\"%s\", openlookeng:\"%s\", trino:\"%s\", nebula:\"%s\",repl:\"%s\", hbase:\"%s\",io_file:\"root\"}", | ||
jvmUser, jvmUser, jvmUser, jvmUser, jvmUser, jvmUser, jvmUser, jvmUser, jvmUser); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The multi-user execution function should be removed because Java and Scala have the risk of overreaching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for reviewing the code
|
||
https://github.com/apache/dubbo | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some information about REPL(Read-Evaluate-Print Loop) plugin
pom.xml
Outdated
<python.version>python2</python.version> | ||
<seatunnel.version>2.1.2</seatunnel.version> | ||
<shell.version>1</shell.version> | ||
<sqoop.version>1.4.6</sqoop.version> | ||
<elasticsearch.version>7.6.2</elasticsearch.version> | ||
|
||
<!-- javassist --> | ||
<javassist.version>3.28.0-GA</javassist.version> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just updated current dependence version? <javassist.version>3.27.0-GA</javassist.version>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for reviewing the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Add repl ec to execute Java and scala code
Java code execution result
scala code execution result