public float getDAGProgress() { Progress p = dagStatus.getDAGProgress(); return p == null ? 0 : (float)p.getSucceededTaskCount() / (float)p.getTotalTaskCount(); }
private double monitorProgress(Set<String> vertexNames, double prevDagProgress, Set<StatusGetOpts> opts, DAGStatus dagStatus) throws IOException, TezException { Progress progress = dagStatus.getDAGProgress(); double dagProgress = prevDagProgress; if (progress != null) { dagProgress = getProgress(progress); boolean progressChanged = dagProgress > prevDagProgress; long currentTimeMillis = System.currentTimeMillis(); long timeSinceLastPrintStatus = currentTimeMillis - lastPrintStatusTimeMillis; boolean printIntervalExpired = timeSinceLastPrintStatus > PRINT_STATUS_INTERVAL_MILLIS; if (progressChanged || printIntervalExpired) { lastPrintStatusTimeMillis = currentTimeMillis; printDAGStatus(vertexNames, opts, dagStatus, progress); } } return dagProgress; }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("status=" + getState() + ", progress=" + getDAGProgress() + ", diagnostics=" + StringUtils.join(getDiagnostics(), LINE_SEPARATOR) + ", counters=" + (getDAGCounters() == null ? "null" : getDAGCounters().toString())); return sb.toString(); }
@Override public boolean equals(Object obj) { // Source explicitly exclude from equals if (obj instanceof DAGStatus){ DAGStatus other = (DAGStatus)obj; return getState() == other.getState() && getDiagnostics().equals(other.getDiagnostics()) && getDAGProgress().equals(other.getDAGProgress()) && getVertexProgress().equals(other.getVertexProgress()) && ((getDAGCounters() == null && other.getDAGCounters() == null) || getDAGCounters().equals(other.getDAGCounters())); } return false; }
@Override public int hashCode() { // Source explicitly exclude from hashCode final int prime = 44017; int result = 1; result = prime + getState().hashCode(); List<String> diagnostics = getDiagnostics(); Progress dagProgress = getDAGProgress(); Map<String, Progress> vProgress = getVertexProgress(); TezCounters counters = getDAGCounters(); result = prime * result + ((diagnostics == null)? 0 : diagnostics.hashCode()); result = prime * result + ((dagProgress == null)? 0 : dagProgress.hashCode()); result = prime * result + ((vProgress == null)? 0 : vProgress.hashCode()); result = prime * result + ((counters == null)? 0 : counters.hashCode()); return result; }
DAGStatus dagStatus = dagClient.getDAGStatus( (displayDAGCounters ? opts : null)); Progress progress = dagStatus.getDAGProgress(); double vProgressFloat = 0.0f; if (progress != null) {