[ https://issues.apache.org/jira/browse/HUDI-6227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ethan Guo closed HUDI-6227. --------------------------- Resolution: Fixed > Improve logging in ReflectionUtils.hasConstructor > ------------------------------------------------- > > Key: HUDI-6227 > URL: https://issues.apache.org/jira/browse/HUDI-6227 > Project: Apache Hudi > Issue Type: Improvement > Reporter: Ethan Guo > Assignee: Ethan Guo > Priority: Major > Fix For: 0.14.0 > > > ReflectionUtils.hasConstructor throws warn log if the constructor does not > exist, even in cases where it's expected, confusing users. We should improve > the logging. > To be specific, there should be a flag to control whether to print/return the > error logs, because sometimes the caller wants to try calling multiple > constructors one by one through reflection to finally use the one that works, > and the ones which do not work should not throw error log. On the caller > side, only if all reflection caller fails, an error log should be thrown. > > {code:java} > 23/05/16 10:58:54 WARN ReflectionUtils: Unable to instantiate class > org.apache.hudi.sync.datahub.DataHubSyncTool > java.lang.NoSuchMethodException: > org.apache.hudi.sync.datahub.DataHubSyncTool.<init>(java.util.Properties, > org.apache.hadoop.conf.Configuration) > at java.lang.Class.getConstructor0(Class.java:3082) > at java.lang.Class.getConstructor(Class.java:1825) > at > org.apache.hudi.common.util.ReflectionUtils.hasConstructor(ReflectionUtils.java:95) > at > org.apache.hudi.sync.common.util.SyncUtilHelpers.instantiateMetaSyncTool(SyncUtilHelpers.java:83) > at > org.apache.hudi.sync.common.util.SyncUtilHelpers.runHoodieMetaSync(SyncUtilHelpers.java:58) > at > org.apache.hudi.utilities.deltastreamer.DeltaSync.runMetaSync(DeltaSync.java:808) > at > org.apache.hudi.utilities.deltastreamer.DeltaSync.writeToSink(DeltaSync.java:723) > at > org.apache.hudi.utilities.deltastreamer.DeltaSync.syncOnce(DeltaSync.java:395) > at > org.apache.hudi.utilities.deltastreamer.HoodieDeltaStreamer.lambda$sync$2(HoodieDeltaStreamer.java:215) > at org.apache.hudi.common.util.Option.ifPresent(Option.java:97) > at > org.apache.hudi.utilities.deltastreamer.HoodieDeltaStreamer.sync(HoodieDeltaStreamer.java:213) > at > org.apache.hudi.utilities.deltastreamer.HoodieDeltaStreamer.main(HoodieDeltaStreamer.java:592) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at > org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52) > at > org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:955) > at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180) > at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203) > at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90) > at > org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1043) > at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1052) > at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala){code} > > -- This message was sent by Atlassian Jira (v8.20.10#820010)