[ https://issues.apache.org/jira/browse/HIVE-3799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Phabricator updated HIVE-3799: ------------------------------ Attachment: HIVE-3799.D7719.1.patch navis requested code review of "HIVE-3799 [jira] Better error message if metalisteners or hookContext cannot be loaded/instantiated". Reviewers: JIRA DPAL-1949 Better error message if metalisteners or hookContext cannot be loaded/instantiated If I am not able to instantiate MetaListener or HookContext because of some dependent class missing, the only error I get is InvocationTargetException. MetaStoreUtils.getMetaListener should be changed as following: try { T listener = (T) Class.forName( listenerImpl.trim(), true, JavaUtils.getClassLoader()).getConstructor( Configuration.class).newInstance(conf); listeners.add(listener); } catch (InvocationTargetException e) { throw new MetaException("Failed to instantiate listener named: "+ listenerImpl + " reason: " + e.getCause().toString()); } catch (Exception e) { throw new MetaException("Failed to instantiate listener named: "+ listenerImpl + " reason: " + e.toString()); } Similarly Driver.getHooks should be changed to handle InvocationTargetException in a better way. TEST PLAN EMPTY REVISION DETAIL https://reviews.facebook.net/D7719 AFFECTED FILES metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java ql/src/java/org/apache/hadoop/hive/ql/Driver.java ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java MANAGE HERALD DIFFERENTIAL RULES https://reviews.facebook.net/herald/view/differential/ WHY DID I GET THIS EMAIL? https://reviews.facebook.net/herald/transcript/18513/ To: JIRA, navis > Better error message if metalisteners or hookContext cannot be > loaded/instantiated > ---------------------------------------------------------------------------------- > > Key: HIVE-3799 > URL: https://issues.apache.org/jira/browse/HIVE-3799 > Project: Hive > Issue Type: Improvement > Components: Diagnosability, Logging > Affects Versions: 0.9.0 > Reporter: Sudhanshu Arora > Priority: Trivial > Attachments: HIVE-3799.D7719.1.patch > > > If I am not able to instantiate MetaListener or HookContext because of some > dependent class missing, the only error I get is InvocationTargetException. > MetaStoreUtils.getMetaListener should be changed as following: > try { > T listener = (T) Class.forName( > listenerImpl.trim(), true, > JavaUtils.getClassLoader()).getConstructor( > Configuration.class).newInstance(conf); > listeners.add(listener); > } catch (InvocationTargetException e) { > throw new MetaException("Failed to instantiate listener named: "+ > listenerImpl + " reason: " + e.getCause().toString()); > } catch (Exception e) { > throw new MetaException("Failed to instantiate listener named: "+ > listenerImpl + " reason: " + e.toString()); > } > Similarly Driver.getHooks should be changed to handle > InvocationTargetException in a better way. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira