throw new TezException("AM and Task out of sync" + ", responseReqId=" + response.getLastRequestId() + ", expectedReqId=" + requestId);
/** * Returns an instance of {@link TezException} */ public static TezException getRemoteException(Throwable t) { return new TezException(t); }
@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); } }
@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); } }
public VertexStatus getVertexStatus(String dagIdStr, String vertexName, Set<StatusGetOpts> statusOptions) throws TezException { VertexStatus status = getDAG(dagIdStr).getVertexStatus(vertexName, statusOptions); if (status == null) { throw new TezException("Unknown vertexName: " + vertexName); } return status; }
private String getClientInfo() throws TezException { UserGroupInformation callerUGI; try { callerUGI = UserGroupInformation.getCurrentUser(); } catch (IOException ie) { LOG.info("Error getting UGI ", ie); throw new TezException(ie); } String message = callerUGI.toString(); if(null != Server.getRemoteAddress()) { message += " at " + Server.getRemoteAddress(); } return message; }
private void waitNonSessionTillReady() throws IOException, TezException { Preconditions.checkArgument(!isSession, "It is supposed to be only called in non-session mode"); while (true) { TezAppMasterStatus status = getAppMasterStatus(); // DAGClient will handle the AM SHUTDOWN case if (status.equals(TezAppMasterStatus.RUNNING) || status.equals(TezAppMasterStatus.SHUTDOWN)) { return; } try { Thread.sleep(SLEEP_FOR_READY); } catch (InterruptedException e) { throw new TezException("TezClient is interrupted"); } } } @VisibleForTesting
public static TimelineReaderStrategy getTimelineReaderStrategy(Configuration conf, boolean useHttps, int connTimeout) throws TezException { TimelineReaderStrategy timelineReaderStrategy; if (!isTimelineClientSupported()) { throw new TezException("Reading from timeline is not supported." + " token delegation support: " + tokenDelegationSupported() + ", is secure timeline: " + UserGroupInformation.isSecurityEnabled()); } timelineReaderStrategy = getTimelineReaderStrategy(tokenDelegationSupported(), conf, useHttps, connTimeout); if (LOG.isDebugEnabled()) { LOG.debug("Using " + timelineReaderStrategy.getClass().getName() + " to read timeline data"); } return timelineReaderStrategy; }
private ApplicationId createApplication() throws TezException, IOException { try { return frameworkClient.createApplication(). getNewApplicationResponse().getApplicationId(); } catch (YarnException e) { throw new TezException(e); } }
@Override public ApplicationId submitApplication(ApplicationSubmissionContext appSubmissionContext) throws YarnException, IOException, TezException { ApplicationId appId= yarnClient.submitApplication(appSubmissionContext); ApplicationReport appReport = getApplicationReport(appId); if (appReport.getYarnApplicationState() == YarnApplicationState.FAILED){ throw new TezException("Failed to submit application to YARN" + ", applicationId=" + appId + ", diagnostics=" + appReport.getDiagnostics()); } return appId; }
@SuppressWarnings("unchecked") public void tryKillDAG(DAG dag, String message) throws TezException { try { logDAGKillRequestEvent(dag.getID(), false); } catch (IOException e) { throw new TezException(e); } dispatcher.getEventHandler().handle(new DAGEventTerminateDag(dag.getID(), DAGTerminationCause.DAG_KILL, message)); }