static String getTaskId(Configuration hiveConf) {
    String id = Preconditions.checkNotNull(hiveConf.get("mapred.task.id", null));
    int index = id.lastIndexOf("_");
    if (index != -1) {
      return id.substring(0, index);
    }
    return id;
  }
Computes the kafka producer transaction id. The Tx id HAS to be the same across task restarts,
that is why we are excluding the attempt id by removing the last string after last `_`.
Assuming the taskId format is taskId_[m-r]_attemptId.

@param hiveConf Hive Configuration.
@return the taskId without the attempt id.
kafka-handler/src/java/org/apache/hadoop/hive/kafka/KafkaUtils.java