jerrypeng commented on a change in pull request #9413:
URL: https://github.com/apache/pulsar/pull/9413#discussion_r570455165
##########
File path:
pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/io/ConnectorUtils.java
##########
@@ -102,57 +99,47 @@ public static String getIOSinkClass(ClassLoader
classLoader) throws IOException
return conf.getSinkClass();
}
- public static ConnectorDefinition getConnectorDefinition(String narPath,
String narExtractionDirectory) throws IOException {
- try (NarClassLoader ncl = NarClassLoader.getFromArchive(new
File(narPath), Collections.emptySet(), narExtractionDirectory)) {
- return getConnectorDefinition(ncl);
- }
- }
-
- public static ConnectorDefinition getConnectorDefinition(ClassLoader
classLoader) throws IOException {
- NarClassLoader narClassLoader = (NarClassLoader) classLoader;
+ public static ConnectorDefinition getConnectorDefinition(NarClassLoader
narClassLoader) throws IOException {
String configStr =
narClassLoader.getServiceDefinition(PULSAR_IO_SERVICE_NAME);
return ObjectMapperFactory.getThreadLocalYaml().readValue(configStr,
ConnectorDefinition.class);
}
- public static List<ConfigFieldDefinition>
getConnectorConfigDefinition(String narPath,
-
String configClassName,
-
String narExtractionDirectory) throws Exception {
+ public static List<ConfigFieldDefinition>
getConnectorConfigDefinition(ClassLoader narClassLoader,
Review comment:
We don't need a NarClassLoader. A ClassLoader should suffice. I will
rename the variable
----------------------------------------------------------------
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]