本文整理汇总了Java中org.apache.tez.dag.api.client.Progress类的典型用法代码示例。如果您正苦于以下问题:Java Progress类的具体用法?Java Progress怎么用?Java Progress使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Progress类属于org.apache.tez.dag.api.client包,在下文中一共展示了Progress类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVertexProgress
import org.apache.tez.dag.api.client.Progress; //导入依赖的package包/类
public Map<String, Float> getVertexProgress() {
Map<String, Float> vertexProgress = Maps.newHashMap();
for (Map.Entry<String, Progress> entry : dagStatus.getVertexProgress().entrySet()) {
Progress p = entry.getValue();
float progress = (float)p.getSucceededTaskCount() / (float)p.getTotalTaskCount();
vertexProgress.put(entry.getKey(), progress);
}
return vertexProgress;
}
示例2: getProgress
import org.apache.tez.dag.api.client.Progress; //导入依赖的package包/类
private float getProgress(String vertexName) {
Progress progress = dagStatus.getVertexProgress().get(vertexName);
if(progress == null) {
// no such stage. return 0 like MR app currently does.
return 0;
}
float totalTasks = (float) progress.getTotalTaskCount();
if(totalTasks != 0) {
return progress.getSucceededTaskCount()/totalTasks;
}
return 0;
}
示例3: monitorProgress
import org.apache.tez.dag.api.client.Progress; //导入依赖的package包/类
private double monitorProgress(Set<String> vertexNamess, double prevDagProgress,
Set<StatusGetOpts> opts, DAGStatus dagStatus) throws IOException, TezException {
Progress progress = dagStatus.getDAGProgress();
double dagProgress = 0.0;
if (progress != null && (dagProgress = getProgress(progress)) > prevDagProgress) {
printDAGStatus(vertexNamess, opts, dagStatus, progress);
}
return dagProgress;
}
示例4: getDAGProgress
import org.apache.tez.dag.api.client.Progress; //导入依赖的package包/类
public float getDAGProgress() {
Progress p = dagStatus.getDAGProgress();
return p == null ? 0 : (float)p.getSucceededTaskCount() / (float)p.getTotalTaskCount();
}
示例5: getProgress
import org.apache.tez.dag.api.client.Progress; //导入依赖的package包/类
private double getProgress(Progress progress) {
return (progress.getTotalTaskCount() == 0 ? 0.0 : (double) (progress.getSucceededTaskCount())
/ progress.getTotalTaskCount());
}