Skip to content

Commit

Permalink
Fix repl get task result bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengJie1053 committed Dec 13, 2023
1 parent f126d9a commit 1beed90
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public ExecuteResponse executeLine(EngineExecutionContext engineExecutorContext,

String message = outputStream.toString();
System.setOut(oldStream);
System.out.println(message);
engineExecutorContext.appendStdout(message);
ResultSetWriter<? extends MetaData, ? extends Record> resultSetWriter =
engineExecutorContext.createResultSetWriter(ResultSetFactory.TEXT_TYPE);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class JavaReplCompiler {
Pattern.compile("\\s+implements\\s+([\\w\\.]+)\\s*\\{\n");

private static final Pattern METHODS_PATTERN =
Pattern.compile("\n(private|public|protected)\\s+");
Pattern.compile("(?<=\\})\\s+(private|public|protected)\\s+");

private static final Pattern FIELD_PATTERN = Pattern.compile("[^\n]+=[^\n]+;");

Expand Down
37 changes: 37 additions & 0 deletions linkis-engineconn-plugins/repl/src/main/resources/repl-ec.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,43 @@ import org.apache.commons.lang3.StringUtils;
}
```

#### 1.3. Multiple methods

```text
import org.apache.commons.lang3.StringUtils;
public void sayHello() {
System.out.println("hello");
System.out.println(StringUtils.isEmpty("hello"));
}
public void sayHi() {
System.out.println("hi");
System.out.println(StringUtils.isEmpty("hi"));
}
```

```json
{
"executionContent":{
"code":"import org.apache.commons.lang3.StringUtils;\n\n public void sayHello() {\n System.out.println(\"hello\");\n System.out.println(StringUtils.isEmpty(\"hello\"));\n }\n public void sayHi() {\n System.out.println(\"hi\");\n System.out.println(StringUtils.isEmpty(\"hi\"));\n }",
"runType":"repl"
},
"params":{
"configuration":{
"runtime":{
"linkis.repl.type":"java",
"linkis.repl.method.name":"sayHi"
}
}
},
"labels":{
"engineType":"repl-1",
"userCreator":"linkis-IDE"
}
}
```


### 2. Submitting scala tasks with Restful API

```text
Expand Down

0 comments on commit 1beed90

Please sign in to comment.