@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Object ret = null; boolean isTimerStarted = false; try { try { if (!Deadline.isStarted()) { Deadline.startTimer(method.getName()); isTimerStarted = true; } } catch (MetaException e) { // Deadline was not registered yet. long timeout = HiveConf.getTimeVar(hiveConf, HiveConf.ConfVars.METASTORE_CLIENT_SOCKET_TIMEOUT, TimeUnit.MILLISECONDS); Deadline.registerIfNot(timeout); Deadline.startTimer(method.getName()); isTimerStarted = true; } ret = method.invoke(base, args); if (isTimerStarted) { Deadline.stopTimer(); } } catch (UndeclaredThrowableException e) { throw e.getCause(); } catch (InvocationTargetException e) { throw e.getCause(); } return ret; }
@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Object ret = null; boolean isTimerStarted = false; try { try { if (!Deadline.isStarted()) { Deadline.startTimer(method.getName()); isTimerStarted = true; } } catch (MetaException e) { // Deadline was not registered yet. long timeout = HiveConf.getTimeVar(hiveConf, HiveConf.ConfVars.METASTORE_CLIENT_SOCKET_TIMEOUT, TimeUnit.MILLISECONDS); Deadline.registerIfNot(timeout); Deadline.startTimer(method.getName()); isTimerStarted = true; } ret = method.invoke(base, args); if (isTimerStarted) { Deadline.stopTimer(); } } catch (UndeclaredThrowableException e) { throw e.getCause(); } catch (InvocationTargetException e) { throw e.getCause(); } return ret; }