/**
 * Autogenerated by Thrift Compiler (0.9.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.hadoop.thriftfs.jobtracker.api;


import java.util.Map;
import java.util.HashMap;
import org.apache.thrift.TEnum;

public enum ThriftTaskState implements org.apache.thrift.TEnum {
  RUNNING(0),
  SUCCEEDED(1),
  FAILED(2),
  UNASSIGNED(3),
  KILLED(4),
  COMMIT_PENDING(5),
  FAILED_UNCLEAN(6),
  KILLED_UNCLEAN(7);

  private final int value;

  private ThriftTaskState(int value) {
    this.value = value;
  }

  /**
   * Get the integer value of this enum value, as defined in the Thrift IDL.
   */
  public int getValue() {
    return value;
  }

  /**
   * Find a the enum type by its integer value, as defined in the Thrift IDL.
   * @return null if the value is not found.
   */
  public static ThriftTaskState findByValue(int value) { 
    switch (value) {
      case 0:
        return RUNNING;
      case 1:
        return SUCCEEDED;
      case 2:
        return FAILED;
      case 3:
        return UNASSIGNED;
      case 4:
        return KILLED;
      case 5:
        return COMMIT_PENDING;
      case 6:
        return FAILED_UNCLEAN;
      case 7:
        return KILLED_UNCLEAN;
      default:
        return null;
    }
  }
}
