jerrypeng commented on a change in pull request #9413:
URL: https://github.com/apache/pulsar/pull/9413#discussion_r570458415
##########
File path:
pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionActioner.java
##########
@@ -510,39 +514,35 @@ private File getBuiltinArchive(FunctionDetails.Builder
functionDetails) throws I
throw new IOException("Could not find built in archive definition");
}
- private void fillSourceTypeClass(FunctionDetails.Builder functionDetails,
File archive, String className)
- throws IOException, ClassNotFoundException {
- try (NarClassLoader ncl = NarClassLoader.getFromArchive(archive,
Collections.emptySet(), workerConfig.getNarExtractionDirectory())) {
- String typeArg = getSourceType(className, ncl).getName();
+ private void fillSourceTypeClass(FunctionDetails.Builder functionDetails,
Review comment:
Not sure how much code we can save here because fillSourceTypeClass()
sets the typeClassName for the source and checks if a sinkSpec exists and set
the typeClassName for that as well. The logic for fillSinkTypeClass() is the
reverse.
Also, since this refactor is already large, I don't want to make more
changes in the code. If we want to refactor more, let's do it in a subsequent
PR.
----------------------------------------------------------------
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]