cameronlee314 commented on a change in pull request #1047: SAMZA-2210: Initial
majority migration for injecting classloader when doing reflection
URL: https://github.com/apache/samza/pull/1047#discussion_r290045828
##########
File path: samza-core/src/main/java/org/apache/samza/table/TableManager.java
##########
@@ -85,14 +85,14 @@ public void init(Context context) {
initialized = true;
}
- private void addTable(String tableId, Config config) {
+ private void addTable(String tableId, Config config, ClassLoader
classLoader) {
if (tableContexts.containsKey(tableId)) {
throw new SamzaException("Table " + tableId + " already exists");
}
JavaTableConfig tableConfig = new JavaTableConfig(config);
String providerFactoryClassName =
tableConfig.getTableProviderFactory(tableId);
TableProviderFactory tableProviderFactory =
- Util.getObj(providerFactoryClassName, TableProviderFactory.class);
+ ReflectionUtil.getObj(classLoader, providerFactoryClassName,
TableProviderFactory.class);
Review comment:
Samza code should generally not need to know. There is only one classloader
to be wired and used. The "framework" vs. "plugin" distinction is hidden within
the classloader.
----------------------------------------------------------------
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