Amar3tto commented on code in PR #21765:
URL: https://github.com/apache/beam/pull/21765#discussion_r897894449
##########
sdks/java/io/cdap/src/main/java/org/apache/beam/sdk/io/cdap/Plugin.java:
##########
@@ -84,16 +88,34 @@ public PluginConfig getPluginConfig() {
* validating connection to the CDAP sink/source and performing initial
tuning.
*/
public void prepareRun() {
+ PluginConfig pluginConfig = getPluginConfig();
+ if (pluginConfig == null) {
+ throw new IllegalArgumentException("PluginConfig should be not null!");
+ }
if (cdapPluginObj == null) {
- InstantiatorFactory instantiatorFactory = new InstantiatorFactory(false);
- cdapPluginObj =
- (SubmitterLifecycle)
instantiatorFactory.get(TypeToken.of(getPluginClass())).create();
+ for (Constructor<?> constructor :
getPluginClass().getDeclaredConstructors()) {
Review Comment:
You're right, there is no need to grab all the constructors here.
Fixed.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]