public void clearPartitions() { for(Task eachTask : getTasks()) { if (eachTask.getLastAttempt() != null && !eachTask.getLastAttempt().getPartitions().isEmpty()) { eachTask.getLastAttempt().getPartitions().clear(); } } }
public Set<PartitionDescProto> getPartitions() { Set<PartitionDescProto> partitions = new HashSet<>(); for(Task eachTask : getTasks()) { if (eachTask.getLastAttempt() != null && !eachTask.getLastAttempt().getPartitions().isEmpty()) { partitions.addAll(eachTask.getLastAttempt().getPartitions()); } } return partitions; }
public TaskAttemptState getLastAttemptStatus() { TaskAttempt lastAttempt = getLastAttempt(); if (lastAttempt != null) { return lastAttempt.getState(); } else { return TaskAttemptState.TA_ASSIGNED; } }
public void clearPartitions() { for(Task eachTask : getTasks()) { if (eachTask.getLastAttempt() != null && !eachTask.getLastAttempt().getPartitions().isEmpty()) { eachTask.getLastAttempt().getPartitions().clear(); } } }
public TaskAttemptState getLastAttemptStatus() { TaskAttempt lastAttempt = getLastAttempt(); if (lastAttempt != null) { return lastAttempt.getState(); } else { return TaskAttemptState.TA_ASSIGNED; } }
public Set<PartitionDescProto> getPartitions() { Set<PartitionDescProto> partitions = TUtil.newHashSet(); for(Task eachTask : getTasks()) { if (eachTask.getLastAttempt() != null && !eachTask.getLastAttempt().getPartitions().isEmpty()) { partitions.addAll(eachTask.getLastAttempt().getPartitions()); } } return partitions; }
public float getProgress() { List<Task> tempTasks = null; readLock.lock(); try { if (getState() == StageState.NEW) { return 0.0f; } else { tempTasks = new ArrayList<Task>(tasks.values()); } } finally { readLock.unlock(); } float totalProgress = 0.0f; for (Task eachTask : tempTasks) { if (eachTask.getLastAttempt() != null) { totalProgress += eachTask.getLastAttempt().getProgress(); } } if (totalProgress > 0.0f) { return (float) Math.floor((totalProgress / (float) Math.max(tempTasks.size(), 1)) * 1000.0f) / 1000.0f; } else { return 0.0f; } }
public float getProgress() { List<Task> tempTasks = null; readLock.lock(); try { if (getState() == StageState.NEW) { return 0.0f; } else { tempTasks = new ArrayList<>(tasks.values()); } } finally { readLock.unlock(); } float totalProgress = 0.0f; for (Task eachTask : tempTasks) { if (eachTask.getLastAttempt() != null) { totalProgress += eachTask.getLastAttempt().getProgress(); } } if (totalProgress > 0.0f) { return (float) Math.floor((totalProgress / (float) Math.max(tempTasks.size(), 1)) * 1000.0f) / 1000.0f; } else { return 0.0f; } }
private TableStats[] computeStatFromTasks() { List<TableStats> inputStatsList = Lists.newArrayList(); List<TableStats> resultStatsList = Lists.newArrayList(); for (Task unit : getTasks()) { resultStatsList.add(unit.getStats()); if (unit.getLastAttempt().getInputStats() != null) { inputStatsList.add(unit.getLastAttempt().getInputStats()); } } TableStats inputStats = StatisticsUtil.aggregateTableStat(inputStatsList); TableStats resultStats = StatisticsUtil.aggregateTableStat(resultStatsList); return new TableStats[]{inputStats, resultStats}; }
private TableStats[] computeStatFromTasks() { List<TableStats> inputStatsList = Lists.newArrayList(); List<TableStats> resultStatsList = Lists.newArrayList(); for (Task unit : getTasks()) { resultStatsList.add(unit.getStats()); if (unit.getLastAttempt().getInputStats() != null) { inputStatsList.add(unit.getLastAttempt().getInputStats()); } } TableStats inputStats = StatisticsUtil.aggregateTableStat(inputStatsList); TableStats resultStats = StatisticsUtil.aggregateTableStat(resultStatsList); return new TableStats[]{inputStats, resultStats}; }
private TaskHistory makeTaskHistory() { TaskHistory taskHistory = new TaskHistory(); TaskAttempt lastAttempt = getLastAttempt(); if (lastAttempt != null) { taskHistory.setId(lastAttempt.getId().toString());
private TaskHistory makeTaskHistory() { TaskHistory taskHistory = new TaskHistory(); TaskAttempt lastAttempt = getLastAttempt(); if (lastAttempt != null) { taskHistory.setId(lastAttempt.getId().toString());
} else { stage.completedTaskCount++; stage.getTaskScheduler().releaseTaskAttempt(task.getLastAttempt());
} else { stage.completedTaskCount++; stage.getTaskScheduler().releaseTaskAttempt(task.getLastAttempt());
if (eachTask.getLastAttempt() != null) { TableStats inputStats = eachTask.getLastAttempt().getInputStats(); if (inputStats != null) { totalInputBytes += inputStats.getNumBytes(); totalReadRows += inputStats.getNumRows(); TableStats outputStats = eachTask.getLastAttempt().getResultStats(); if (outputStats != null) { totalWriteBytes += outputStats.getNumBytes();
if (eachTask.getLastAttempt() != null) { TableStats inputStats = eachTask.getLastAttempt().getInputStats(); if (inputStats != null) { totalInputBytes += inputStats.getNumBytes(); totalReadRows += inputStats.getNumRows(); TableStats outputStats = eachTask.getLastAttempt().getResultStats(); if (outputStats != null) { totalWriteBytes += outputStats.getNumBytes();