当前位置: 首页>>代码示例>>Java>>正文


Java TIPStatus类代码示例

本文整理汇总了Java中org.apache.hadoop.mapred.TIPStatus的典型用法代码示例。如果您正苦于以下问题:Java TIPStatus类的具体用法?Java TIPStatus怎么用?Java TIPStatus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TIPStatus类属于org.apache.hadoop.mapred包,在下文中一共展示了TIPStatus类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: write

import org.apache.hadoop.mapred.TIPStatus; //导入依赖的package包/类
public void write(DataOutput out) throws IOException {
  taskid.write(out);
  out.writeFloat(progress);
  Text.writeString(out, state);
  out.writeLong(startTime);
  out.writeLong(finishTime);
  WritableUtils.writeStringArray(out, diagnostics);
  counters.write(out);
  WritableUtils.writeEnum(out, currentStatus);
  if (currentStatus == TIPStatus.RUNNING) {
    WritableUtils.writeVInt(out, runningAttempts.size());
    TaskAttemptID t[] = new TaskAttemptID[0];
    t = runningAttempts.toArray(t);
    for (int i = 0; i < t.length; i++) {
      t[i].write(out);
    }
  } else if (currentStatus == TIPStatus.COMPLETE) {
    successfulAttempt.write(out);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:TaskReport.java

示例2: readFields

import org.apache.hadoop.mapred.TIPStatus; //导入依赖的package包/类
public void readFields(DataInput in) throws IOException {
  this.taskid.readFields(in);
  this.progress = in.readFloat();
  this.state = StringInterner.weakIntern(Text.readString(in));
  this.startTime = in.readLong(); 
  this.finishTime = in.readLong();
  
  diagnostics = WritableUtils.readStringArray(in);
  counters = new Counters();
  counters.readFields(in);
  currentStatus = WritableUtils.readEnum(in, TIPStatus.class);
  if (currentStatus == TIPStatus.RUNNING) {
    int num = WritableUtils.readVInt(in);    
    for (int i = 0; i < num; i++) {
      TaskAttemptID t = new TaskAttemptID();
      t.readFields(in);
      runningAttempts.add(t);
    }
  } else if (currentStatus == TIPStatus.COMPLETE) {
    successfulAttempt.readFields(in);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:TaskReport.java

示例3: displayTasks

import org.apache.hadoop.mapred.TIPStatus; //导入依赖的package包/类
/**
 * Display the information about a job's tasks, of a particular type and
 * in a particular state
 * 
 * @param job the job
 * @param type the type of the task (map/reduce/setup/cleanup)
 * @param state the state of the task 
 * (pending/running/completed/failed/killed)
 */
protected void displayTasks(Job job, String type, String state) 
throws IOException, InterruptedException {
  TaskReport[] reports = job.getTaskReports(TaskType.valueOf(
      org.apache.hadoop.util.StringUtils.toUpperCase(type)));
  for (TaskReport report : reports) {
    TIPStatus status = report.getCurrentStatus();
    if ((state.equalsIgnoreCase("pending") && status ==TIPStatus.PENDING) ||
        (state.equalsIgnoreCase("running") && status ==TIPStatus.RUNNING) ||
        (state.equalsIgnoreCase("completed") && status == TIPStatus.COMPLETE) ||
        (state.equalsIgnoreCase("failed") && status == TIPStatus.FAILED) ||
        (state.equalsIgnoreCase("killed") && status == TIPStatus.KILLED)) {
      printTaskAttempts(report);
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:CLI.java

示例4: displayTasks

import org.apache.hadoop.mapred.TIPStatus; //导入依赖的package包/类
/**
 * Display the information about a job's tasks, of a particular type and
 * in a particular state
 * 
 * @param job the job
 * @param type the type of the task (map/reduce/setup/cleanup)
 * @param state the state of the task 
 * (pending/running/completed/failed/killed)
 * @throws IOException when there is an error communicating with the master
 * @throws InterruptedException
 * @throws IllegalArgumentException if an invalid type/state is passed
 */
protected void displayTasks(Job job, String type, String state) 
throws IOException, InterruptedException {
 
  TaskReport[] reports=null;
  reports = job.getTaskReports(TaskType.valueOf(
      org.apache.hadoop.util.StringUtils.toUpperCase(type)));
  for (TaskReport report : reports) {
    TIPStatus status = report.getCurrentStatus();
    if ((state.equalsIgnoreCase("pending") && status ==TIPStatus.PENDING) ||
        (state.equalsIgnoreCase("running") && status ==TIPStatus.RUNNING) ||
        (state.equalsIgnoreCase("completed") && status == TIPStatus.COMPLETE) ||
        (state.equalsIgnoreCase("failed") && status == TIPStatus.FAILED) ||
        (state.equalsIgnoreCase("killed") && status == TIPStatus.KILLED)) {
      printTaskAttempts(report);
    }
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:30,代码来源:CLI.java

示例5: readFields

import org.apache.hadoop.mapred.TIPStatus; //导入依赖的package包/类
public void readFields(DataInput in) throws IOException {
  this.taskid.readFields(in);
  this.progress = in.readFloat();
  this.state = Text.readString(in);
  this.startTime = in.readLong(); 
  this.finishTime = in.readLong();
  
  diagnostics = WritableUtils.readStringArray(in);
  counters = new Counters();
  counters.readFields(in);
  currentStatus = WritableUtils.readEnum(in, TIPStatus.class);
  if (currentStatus == TIPStatus.RUNNING) {
    int num = WritableUtils.readVInt(in);    
    for (int i = 0; i < num; i++) {
      TaskAttemptID t = new TaskAttemptID();
      t.readFields(in);
      runningAttempts.add(t);
    }
  } else if (currentStatus == TIPStatus.COMPLETE) {
    successfulAttempt.readFields(in);
  }
}
 
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:23,代码来源:TaskReport.java

示例6: TaskReport

import org.apache.hadoop.mapred.TIPStatus; //导入依赖的package包/类
/**
 * Creates a new TaskReport object
 * @param taskid
 * @param progress
 * @param state
 * @param diagnostics
 * @param currentStatus
 * @param startTime
 * @param finishTime
 * @param counters
 */
public TaskReport(TaskID taskid, float progress, String state,
           String[] diagnostics, TIPStatus currentStatus, 
           long startTime, long finishTime,
           Counters counters) {
  this.taskid = taskid;
  this.progress = progress;
  this.state = state;
  this.diagnostics = diagnostics;
  this.currentStatus = currentStatus;
  this.startTime = startTime; 
  this.finishTime = finishTime;
  this.counters = counters;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:TaskReport.java

示例7: printTaskAttempts

import org.apache.hadoop.mapred.TIPStatus; //导入依赖的package包/类
private void printTaskAttempts(TaskReport report) {
  if (report.getCurrentStatus() == TIPStatus.COMPLETE) {
    System.out.println(report.getSuccessfulTaskAttemptId());
  } else if (report.getCurrentStatus() == TIPStatus.RUNNING) {
    for (TaskAttemptID t : 
      report.getRunningTaskAttemptIds()) {
      System.out.println(t);
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:CLI.java

示例8: displayTasks

import org.apache.hadoop.mapred.TIPStatus; //导入依赖的package包/类
/**
 * Display the information about a job's tasks, of a particular type and
 * in a particular state
 * 
 * @param job the job
 * @param type the type of the task (map/reduce/setup/cleanup)
 * @param state the state of the task 
 * (pending/running/completed/failed/killed)
 */
protected void displayTasks(Job job, String type, String state) 
throws IOException, InterruptedException {
  TaskReport[] reports = job.getTaskReports(TaskType.valueOf(type.toUpperCase()));
  for (TaskReport report : reports) {
    TIPStatus status = report.getCurrentStatus();
    if ((state.equalsIgnoreCase("pending") && status ==TIPStatus.PENDING) ||
        (state.equalsIgnoreCase("running") && status ==TIPStatus.RUNNING) ||
        (state.equalsIgnoreCase("completed") && status == TIPStatus.COMPLETE) ||
        (state.equalsIgnoreCase("failed") && status == TIPStatus.FAILED) ||
        (state.equalsIgnoreCase("killed") && status == TIPStatus.KILLED)) {
      printTaskAttempts(report);
    }
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:24,代码来源:CLI.java

示例9: displayTasks

import org.apache.hadoop.mapred.TIPStatus; //导入依赖的package包/类
/**
 * Display the information about a job's tasks, of a particular type and
 * in a particular state
 * 
 * @param job the job
 * @param type the type of the task (map/reduce/setup/cleanup)
 * @param state the state of the task 
 * (pending/running/completed/failed/killed)
 */
protected void displayTasks(Job job, String type, String state) 
throws IOException, InterruptedException {
  TaskReport[] reports = job.getTaskReports(TaskType.valueOf(type.toUpperCase()));
  for (TaskReport report : reports) {
    TIPStatus status = report.getCurrentStatus();
    if ((state.equals("pending") && status ==TIPStatus.PENDING) ||
        (state.equals("running") && status ==TIPStatus.RUNNING) ||
        (state.equals("completed") && status == TIPStatus.COMPLETE) ||
        (state.equals("failed") && status == TIPStatus.FAILED) ||
        (state.equals("killed") && status == TIPStatus.KILLED)) {
      printTaskAttempts(report);
    }
  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:24,代码来源:CLI.java


注:本文中的org.apache.hadoop.mapred.TIPStatus类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。