public static String taskSymbol(TaskType type) { switch (type) { case MAP: return "m"; case REDUCE: return "r"; } throw new YarnRuntimeException("Unknown task type: "+ type.toString()); }
public static TaskTypeProto convertToProtoFormat(TaskType e) { return TaskTypeProto.valueOf(e.name()); } public static TaskType convertFromProtoFormat(TaskTypeProto e) {
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + getId(); result = prime * result + getJobId().hashCode(); result = prime * result + getTaskType().hashCode(); return result; }
public static TaskType convertFromProtoFormat(TaskTypeProto e) { return TaskType.valueOf(e.name()); } }
@Override public int compareTo(TaskId other) { int jobIdComp = this.getJobId().compareTo(other.getJobId()); if (jobIdComp == 0) { if (this.getTaskType() == other.getTaskType()) { return this.getId() - other.getId(); } else { return this.getTaskType().compareTo(other.getTaskType()); } } else { return jobIdComp; } } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + getId(); result = prime * result + getJobId().hashCode(); result = prime * result + getTaskType().hashCode(); return result; }
public static TaskType convertFromProtoFormat(TaskTypeProto e) { return TaskType.valueOf(e.name()); } }
@Override public int compareTo(TaskId other) { int jobIdComp = this.getJobId().compareTo(other.getJobId()); if (jobIdComp == 0) { if (this.getTaskType() == other.getTaskType()) { return this.getId() - other.getId(); } else { return this.getTaskType().compareTo(other.getTaskType()); } } else { return jobIdComp; } } }
@Override public Map<TaskId, Task> getTasks(TaskType taskType) { loadAllTasks(); if (TaskType.MAP.equals(taskType)) { return mapTasks; } else {//we have only two types of tasks return reduceTasks; } }
public static String taskSymbol(TaskType type) { switch (type) { case MAP: return "m"; case REDUCE: return "r"; } throw new YarnRuntimeException("Unknown task type: "+ type.toString()); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + getId(); result = prime * result + getJobId().hashCode(); result = prime * result + getTaskType().hashCode(); return result; }
public static TaskTypeProto convertToProtoFormat(TaskType e) { return TaskTypeProto.valueOf(e.name()); } public static TaskType convertFromProtoFormat(TaskTypeProto e) {
public static TaskType convertFromProtoFormat(TaskTypeProto e) { return TaskType.valueOf(e.name()); } }
@Override public int compareTo(TaskId other) { int jobIdComp = this.getJobId().compareTo(other.getJobId()); if (jobIdComp == 0) { if (this.getTaskType() == other.getTaskType()) { return this.getId() - other.getId(); } else { return this.getTaskType().compareTo(other.getTaskType()); } } else { return jobIdComp; } } }
@Override public Map<TaskId, Task> getTasks(TaskType taskType) { loadAllTasks(); if (TaskType.MAP.equals(taskType)) { return mapTasks; } else {//we have only two types of tasks return reduceTasks; } }
public static String taskSymbol(TaskType type) { switch (type) { case MAP: return "m"; case REDUCE: return "r"; } throw new YarnRuntimeException("Unknown task type: "+ type.toString()); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + getId(); result = prime * result + getJobId().hashCode(); result = prime * result + getTaskType().hashCode(); return result; }
public static TaskTypeProto convertToProtoFormat(TaskType e) { return TaskTypeProto.valueOf(e.name()); } public static TaskType convertFromProtoFormat(TaskTypeProto e) {
public static TaskType convertFromProtoFormat(TaskTypeProto e) { return TaskType.valueOf(e.name()); } }