sijie commented on a change in pull request #9671:
URL: https://github.com/apache/pulsar/pull/9671#discussion_r589766315
##########
File path:
pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionRuntimeManager.java
##########
@@ -452,25 +444,43 @@ public synchronized void restartFunctionInstances(String
tenant, String namespac
}
continue;
}
-
- ComponentType componentType =
assignment.getInstance().getFunctionMetaData().getFunctionDetails().getComponentType();
-
- if (ComponentType.SOURCE == componentType) {
- this.functionAdmin.sources().restartSource(tenant,
namespace, functionName,
- assignment.getInstance().getInstanceId());
- } else if (ComponentType.SINK == componentType) {
- this.functionAdmin.sinks().restartSink(tenant,
namespace, functionName,
- assignment.getInstance().getInstanceId());
- } else {
- this.functionAdmin.functions().restartFunction(tenant,
namespace, functionName,
- assignment.getInstance().getInstanceId());
- }
+ restartFunctionUsingPulsarAdmin(assignment, tenant,
namespace, functionName, false);
}
}
}
return;
}
+ /**
+ * Restart the entire function or restart a single instance of the function
+ */
+ private void restartFunctionUsingPulsarAdmin(Assignment assignment, String
tenant, String namespace,
Review comment:
@jerrypeng Do you want to check @golden-yang comment?
----------------------------------------------------------------
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]