You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/10/02 04:25:56 UTC
[GitHub] srkukarni closed pull request #2693: Process mode covers
function_details in quotes. We need to remove that
srkukarni closed pull request #2693: Process mode covers function_details in quotes. We need to remove that
URL: https://github.com/apache/pulsar/pull/2693
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/pulsar-functions/instance/src/main/python/python_instance_main.py b/pulsar-functions/instance/src/main/python/python_instance_main.py
index 3012e6db03..6ef74c2fba 100644
--- a/pulsar-functions/instance/src/main/python/python_instance_main.py
+++ b/pulsar-functions/instance/src/main/python/python_instance_main.py
@@ -74,6 +74,11 @@ def main():
args = parser.parse_args()
function_details = Function_pb2.FunctionDetails()
+ args.function_details = str(args.function_details)
+ if args.function_details[0] == '\'':
+ args.function_details = args.function_details[1:]
+ if args.function_details[-1] == '\'':
+ args.function_details = args.function_details[:-1]
json_format.Parse(args.function_details, function_details)
if os.path.splitext(str(args.py))[1] == '.whl':
diff --git a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/JavaInstanceMain.java b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/JavaInstanceMain.java
index affa1198cc..1551f6f345 100644
--- a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/JavaInstanceMain.java
+++ b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/JavaInstanceMain.java
@@ -111,6 +111,12 @@ public void start() throws Exception {
instanceConfig.setInstanceId(instanceId);
instanceConfig.setMaxBufferedTuples(maxBufferedTuples);
FunctionDetails.Builder functionDetailsBuilder = FunctionDetails.newBuilder();
+ if (functionDetailsJsonString.charAt(0) == '\'') {
+ functionDetailsJsonString = functionDetailsJsonString.substring(1);
+ }
+ if (functionDetailsJsonString.charAt(functionDetailsJsonString.length() - 1) == '\'') {
+ functionDetailsJsonString = functionDetailsJsonString.substring(0, functionDetailsJsonString.length() - 1);
+ }
JsonFormat.parser().merge(functionDetailsJsonString, functionDetailsBuilder);
FunctionDetails functionDetails = functionDetailsBuilder.build();
instanceConfig.setFunctionDetails(functionDetails);
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services