code: public static boolean canBePreempted(ResourceType type) {
      // Preemption is not allowed for JOBTRACKER grants.
      switch (type) {
      case MAP:
        return true;
      case REDUCE:
        return true;
      case JOBTRACKER:
        return false;
      default:
        throw new RuntimeException("Undefined Preemption behavior for " + type);
      }
    }
docs: Tells if preemption is allowed for a resource type.
  @param type The type of the resource.
  @return Is preemption allowed for the the specified type.