@Override
    public Set<Resource> fetchTaskAttemptDetails(Set<String> requestedIds,
        String clusterName, String workflowId, String jobId,
        String taskAttemptId) {
      Set<Resource> taskAttempts = new HashSet<>();
      ResultSet rs = null;
      try {
        rs = getResultSet(requestedIds, workflowId, jobId, taskAttemptId);
        while (rs.next()) {
          Resource resource = new ResourceImpl(Resource.Type.TaskAttempt);
          setResourceProperty(resource, TASK_ATTEMPT_CLUSTER_NAME_PROPERTY_ID,
              clusterName, requestedIds);
          setResourceProperty(resource, TASK_ATTEMPT_WORKFLOW_ID_PROPERTY_ID,
              workflowId, requestedIds);
          setString(resource, TASK_ATTEMPT_JOB_ID_PROPERTY_ID, rs, requestedIds);
          setString(resource, TASK_ATTEMPT_ID_PROPERTY_ID, rs, requestedIds);
          setString(resource, TASK_ATTEMPT_TYPE_PROPERTY_ID, rs, requestedIds);
          setLong(resource, TASK_ATTEMPT_START_TIME_PROPERTY_ID, rs,
              requestedIds);
          setLong(resource, TASK_ATTEMPT_FINISH_TIME_PROPERTY_ID, rs,
              requestedIds);
          setLong(resource, TASK_ATTEMPT_MAP_FINISH_TIME_PROPERTY_ID, rs,
              requestedIds);
          setLong(resource, TASK_ATTEMPT_SHUFFLE_FINISH_TIME_PROPERTY_ID, rs,
              requestedIds);
          setLong(resource, TASK_ATTEMPT_SORT_FINISH_TIME_PROPERTY_ID, rs,
              requestedIds);
          setLong(resource, TASK_ATTEMPT_INPUT_BYTES_PROPERTY_ID, rs,
              requestedIds);
          setLong(resource, TASK_ATTEMPT_OUTPUT_BYTES_PROPERTY_ID, rs,
              requestedIds);
          setString(resource, TASK_ATTEMPT_STATUS_PROPERTY_ID, rs, requestedIds);
          setString(resource, TASK_ATTEMPT_LOCALITY_PROPERTY_ID, rs,
              requestedIds);
          taskAttempts.add(resource);
        }
      } catch (SQLException e) {
        if (LOG.isDebugEnabled())
          LOG.debug("Caught exception getting resource.", e);
        return Collections.emptySet();
      } finally {
        if (rs != null)
          try {
            rs.close();
          } catch (SQLException e) {
            LOG.error("Exception while closing ResultSet", e);
          }

        close();
      }
      return taskAttempts;
    }
Create a postgres task attempt fetcher that uses a given connection
factory.

@param connectionFactory
         a connection factory
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/TaskAttemptResourceProvider.java