throw new TezException("AM and Task out of sync" + ", responseReqId=" + response.getLastRequestId() + ", expectedReqId=" + requestId);
} catch (TezException e) { if (LOG.isDebugEnabled()) { LOG.debug("ERROR fetching vertex data from Yarn Timeline. " + e.getMessage());
} catch (TezException e) { if (LOG.isDebugEnabled()) { LOG.info("DAGStatus fetch failed." + e.getMessage());
/** * Returns an instance of {@link TezException} */ public static TezException getRemoteException(Throwable t) { return new TezException(t); }
} catch (TezException e) { throw new TezUncheckedException("Invalid TaskLaunchCmdOpts defined for Vertex " + vertex.getName() + " : " + e.getMessage(), e);
@Override public DAGStatus waitForCompletion() throws IOException, TezException, InterruptedException { // should be used from DAGClientImpl throw new TezException("not supported"); }
@Override public void tryKillDAG() throws IOException, TezException { throw new TezException("tryKillDAG is unsupported for DAGClientTimelineImpl"); }
/** * Returns an instance of {@link TezException} */ public static TezException getRemoteException(String message) { return new TezException(message); }
/** * Currently direct input to cartesian product vertex is not supported * @param inputName * @param inputDescriptor * @param events * @throws Exception */ @Override public void onRootVertexInitialized(String inputName, InputDescriptor inputDescriptor, List<Event> events) throws Exception { throw new TezException("Direct input to cartesian product vertex is not supported yet"); }
@Override public DAGStatus waitForCompletionWithStatusUpdates(@Nullable Set<StatusGetOpts> statusGetOpts) throws IOException, TezException, InterruptedException { // should be used from DAGClientImpl throw new TezException("not supported"); }
private boolean webappHttpsOnly(Configuration conf) throws TezException { try { Class<?> yarnConfiguration = Class.forName("org.apache.hadoop.yarn.conf.YarnConfiguration"); final Method useHttps = yarnConfiguration.getMethod("useHttps", Configuration.class); return (Boolean)useHttps.invoke(null, conf); } catch (ClassNotFoundException e) { throw new TezException(e); } catch (InvocationTargetException e) { throw new TezException(e); } catch (NoSuchMethodException e) { throw new TezException(e); } catch (IllegalAccessException e) { throw new TezException(e); } }
@SuppressWarnings({ "unchecked", "rawtypes" }) void initInputFormatFromSplit(TezGroupedSplit split) throws TezException { if (wrappedInputFormat == null) { Class<? extends InputFormat> clazz = (Class<? extends InputFormat>) getClassFromName(split.wrappedInputFormatName); try { wrappedInputFormat = org.apache.hadoop.util.ReflectionUtils.newInstance(clazz, conf); } catch (Exception e) { throw new TezException(e); } } }
@SuppressWarnings({ "rawtypes", "unchecked" }) void initInputFormatFromSplit(TezGroupedSplit split) throws TezException { if (wrappedInputFormat == null) { Class<? extends InputFormat> clazz = (Class<? extends InputFormat>) getClassFromName(split.wrappedInputFormatName); try { wrappedInputFormat = org.apache.hadoop.util.ReflectionUtils.newInstance(clazz, conf); } catch (Exception e) { throw new TezException(e); } } }
@Override public DagInfo getDAGData(String dagId) throws TezException { try { parseATSZipFile(atsZipFile); linkParsedContents(); return dagInfo; } catch (IOException e) { LOG.error("Error in reading DAG ", e); throw new TezException(e); } catch (JSONException e) { LOG.error("Error in parsing DAG ", e); throw new TezException(e); } catch (InterruptedException e) { throw new TezException(e); } }
/** * Utility method that unwraps and returns appropriate exceptions. * * @param se * ServiceException * @return An instance of the actual exception, which will be a subclass of * {@link TezException} or {@link IOException} */ public static Void unwrapAndThrowNonIOException(ServiceException se) throws TezException { try { return unwrapAndThrowException(se); } catch (IOException ioe) { throw new TezException(ioe); } }
throw new TezException(ex); } catch (IOException ex) { throw new TezException(ex);
/** * Get in-memory representation of DagInfo * * @return DagInfo * @throws TezException */ public DagInfo getDAGData(String dagId) throws TezException { try { Preconditions.checkArgument(!Strings.isNullOrEmpty(dagId), "Please provide valid dagId"); dagId = dagId.trim(); parseContents(historyFile, dagId); linkParsedContents(); return dagInfo; } catch (IOException e) { LOG.error("Error in reading DAG ", e); throw new TezException(e); } catch (JSONException e) { LOG.error("Error in parsing DAG ", e); throw new TezException(e); } }
@VisibleForTesting protected InputInitializer createInitializer(final RootInputLeafOutput<InputDescriptor, InputInitializerDescriptor> input, final InputInitializerContext context) throws TezException { try { return dagUgi.doAs(new PrivilegedExceptionAction<InputInitializer>() { @Override public InputInitializer run() throws Exception { InputInitializer initializer = ReflectionUtils .createClazzInstance(input.getControllerDescriptor().getClassName(), new Class[]{InputInitializerContext.class}, new Object[]{context}); return initializer; } }); } catch (IOException e) { throw new TezException(e); } catch (InterruptedException e) { throw new TezException(e); } catch (UndeclaredThrowableException e) { if (e.getCause() instanceof TezException) { throw (TezException) e.getCause(); } else { throw e; } } }
@Override public DAGStatus getDAGStatus(@Nullable Set<StatusGetOpts> statusOptions) throws IOException, TezException { final String url = String.format("%s/%s/%s?fields=%s", baseUri, ATSConstants.TEZ_DAG_ID, dagId, FILTER_BY_FIELDS); try { DAGStatusProto.Builder statusBuilder; final JSONObject jsonRoot = getJsonRootEntity(url); statusBuilder = parseDagStatus(jsonRoot, statusOptions); if (statusBuilder == null) { throw new TezException("Failed to get DagStatus from ATS"); } return new DAGStatus(statusBuilder, DagStatusSource.TIMELINE); } catch (JSONException je) { throw new TezException("Failed to parse DagStatus json from YARN Timeline", je); } }
@VisibleForTesting protected JSONObject getJsonRootEntity(String url) throws TezException { try { WebResource wr = getCachedHttpClient().resource(url); ClientResponse response = wr.accept(MediaType.APPLICATION_JSON_TYPE) .type(MediaType.APPLICATION_JSON_TYPE) .get(ClientResponse.class); final ClientResponse.Status clientResponseStatus = response.getClientResponseStatus(); if (clientResponseStatus != ClientResponse.Status.OK) { throw new TezException("Failed to get response from YARN Timeline:" + " errorCode:" + clientResponseStatus + ", url:" + url); } return response.getEntity(JSONObject.class); } catch (ClientHandlerException e) { throw new TezException("Error processing response from YARN Timeline", e); } catch (UniformInterfaceException e) { throw new TezException("Error accessing content from YARN Timeline - unexpected response", e); } catch (IllegalArgumentException e) { throw new TezException("Error accessing content from YARN Timeline - invalid url", e); } catch (IOException e) { throw new TezException("Error failed to get http client", e); } }