private static MetaException newMetaException(Exception e) { if (e instanceof MetaException) { return (MetaException)e; } MetaException me = new MetaException(e.toString()); me.initCause(e); return me; }
/** * convert Exception to MetaException, which sets the cause to such exception * @param errorMessage the error message for this MetaException * @param e cause of the exception * @return the MetaException with the specified exception as the cause */ public static MetaException newMetaException(String errorMessage, Exception e) { MetaException metaException = new MetaException(errorMessage); if (e != null) { metaException.initCause(e); } return metaException; }
private MetaException metaException(HiveException e) { MetaException ex = new MetaException(e.getMessage()); ex.initCause(e); return ex; }
private MetaException metaException(HiveException e) { MetaException ex = new MetaException(e.getMessage()); ex.initCause(e); return ex; }
private RetryingHMSHandler(Configuration origConf, IHMSHandler baseHandler, boolean local) throws MetaException { this.origConf = origConf; this.baseHandler = baseHandler; if (local) { baseHandler.setConf(origConf); // tests expect configuration changes applied directly to metastore } activeConf = baseHandler.getConf(); // This has to be called before initializing the instance of HMSHandler // Using the hook on startup ensures that the hook always has priority // over settings in *.xml. The thread local conf needs to be used because at this point // it has already been initialized using hiveConf. MetaStoreInit.updateConnectionURL(origConf, getActiveConf(), null, metaStoreInitData); try { //invoking init method of baseHandler this way since it adds the retry logic //in case of transient failures in init method invoke(baseHandler, baseHandler.getClass().getDeclaredMethod("init", (Class<?>[]) null), null); } catch (Throwable e) { LOG.error("HMSHandler Fatal error: " + ExceptionUtils.getStackTrace(e)); MetaException me = new MetaException(e.getMessage()); me.initCause(e); throw me; } }
"The transaction for alter partition did not commit successfully."); if (e != null) { metaException.initCause(e);
LOG.error("HMSHandler Fatal error: " + ExceptionUtils.getStackTrace(caughtException)); MetaException me = new MetaException(caughtException.getMessage()); me.initCause(caughtException); throw me;
@Test public void testWrappedMetaExceptionRetry() throws MetaException { IHMSHandler mockBaseHandler = Mockito.mock(IHMSHandler.class); Mockito.when(mockBaseHandler.getConf()).thenReturn(conf); //JDOException wrapped in MetaException wrapped in InvocationException MetaException me = new MetaException("Dummy exception"); me.initCause(new JDOException()); InvocationTargetException ex = new InvocationTargetException(me); Mockito .doThrow(me) .doNothing() .when(mockBaseHandler).init(); RetryingHMSHandler.getProxy(conf, mockBaseHandler, false); Mockito.verify(mockBaseHandler, Mockito.times(2)).init(); } }
"The transaction for alter partition did not commit successfully."); if (e != null) { metaException.initCause(e);
MetaException metaException = new MetaException("Error checking temp table path for " + table.getTableName()); metaException.initCause(err); throw metaException;
MetaException metaException = new MetaException("Error checking temp table path for " + table.getTableName()); metaException.initCause(err); throw metaException;
LOG.error(msg, e); MetaException e1 = new MetaException(msg); e1.initCause(e); throw e1;
MetaException me = new MetaException("Error attempt to drop default database for " + "catalog " + catName); me.initCause(e); throw me;
ex = e; MetaException me = new MetaException(e.toString()); me.initCause(e); throw me; } finally {
@Override public void onCreateTable(CreateTableEvent tableEvent) throws MetaException { // Subscriber can get notification about addition of a table in HCAT // by listening on a topic named "HCAT" and message selector string // as "HCAT_EVENT = HCAT_ADD_TABLE" if (tableEvent.getStatus()) { Table tbl = tableEvent.getTable(); IHMSHandler handler = tableEvent.getIHMSHandler(); Configuration conf = handler.getConf(); Table newTbl; try { newTbl = handler.get_table_core(tbl.getCatName(), tbl.getDbName(), tbl.getTableName()) .deepCopy(); newTbl.getParameters().put( HCatConstants.HCAT_MSGBUS_TOPIC_NAME, getTopicPrefix(conf) + "." + newTbl.getDbName().toLowerCase() + "." + newTbl.getTableName().toLowerCase()); handler.alter_table(newTbl.getDbName(), newTbl.getTableName(), newTbl); } catch (TException e) { MetaException me = new MetaException(e.toString()); me.initCause(e); throw me; } String topicName = getTopicPrefix(conf) + "." + newTbl.getDbName().toLowerCase(); send(messageFactory.buildCreateTableMessage(newTbl), topicName); } }
private static MetaException newMetaException(final Exception e) { final MetaException me = new MetaException(e.toString()); me.initCause(e); return me; }
private static MetaException newMetaException(Exception e) { MetaException me = new MetaException(e.toString()); me.initCause(e); return me; }
private static MetaException newMetaException(Exception e) { if (e instanceof MetaException) { return (MetaException)e; } MetaException me = new MetaException(e.toString()); me.initCause(e); return me; }
/** * convert DeadlineException to MetaException * @param e * @return */ private static MetaException newMetaException(DeadlineException e) { MetaException metaException = new MetaException(e.getMessage()); metaException.initCause(e); return metaException; } }
/** * convert DeadlineException to MetaException * @param e * @return */ private static MetaException newMetaException(DeadlineException e) { MetaException metaException = new MetaException(e.getMessage()); metaException.initCause(e); return metaException; } }