private TaskStatusUpdateEvent getStatusUpdateEvent(boolean sendCounters, boolean isLast) {
      TezCounters counters = null;
      TaskStatistics stats = null;
      float progress = 0;
      if (task.hasInitialized()) {
        progress = task.getProgress();
        // TODO HIVE-12449. Make use of progress notifications once Hive starts sending them out.
        // progressNotified = task.getAndClearProgressNotification();
        if (sendCounters) {
          // send these potentially large objects at longer intervals to avoid overloading the AM
          counters = task.getCounters();
          if (wmCounters != null && counters != null) {
            wmCounters.dumpToTezCounters(counters, isLast);
          }
          stats = task.getTaskStatistics();
        }
      }
      return new TaskStatusUpdateEvent(counters, progress, stats, true);
    }
Sends out final events for task success.
@param taskAttemptID
@return
@throws IOException
          indicates an RPC communication failure.
@throws TezException
          indicates an exception somewhere in the AM.
llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTaskReporter.java