wolfstudy commented on a change in pull request #4174: [go function] support
localrun and cluster mode for go function
URL: https://github.com/apache/pulsar/pull/4174#discussion_r279614378
##########
File path:
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
##########
@@ -501,13 +511,13 @@ protected void validateFunctionConfigs(FunctionConfig
functionConfig) {
org.apache.pulsar.common.functions.Utils.inferMissingNamespace(functionConfig);
}
- if (isNotBlank(functionConfig.getJar()) &&
isNotBlank(functionConfig.getPy())) {
- throw new ParameterException("Either a Java jar or a Python
file needs to"
+ if (isNotBlank(functionConfig.getJar()) &&
isNotBlank(functionConfig.getPy()) && isNotBlank(functionConfig.getGo())) {
+ throw new ParameterException("Either a Java jar or a Python
file or a Go file needs to"
Review comment:
yes, in here, we uploaded a source files suffixed with `.go`.
in
[getGoInstanceCmd()](https://github.com/apache/pulsar/pull/4174/files#diff-092ae104654a1e712a083dacc1ee5308R233)
```
args.add("go");
args.add("run");
args.add(originalCodeFileName);
```
We use `go run` to run this go file, `go run` can be divided into two steps:
1. build `.go` file is an executable binary
2. run this executable binary
In this way, the user only needs to upload the `.go` file, and it is not
necessary to upload a compiled binary file.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services