private HostRoleStatus updateAuditlogCache(HostRoleCommandEntity commandEntity, Long requestId) {

    RequestDetails details = auditlogRequestCache.getIfPresent(requestId);
    if(details == null) {
      return null;
    }

    RequestDetails.Component component = new RequestDetails.Component(commandEntity.getRole(), commandEntity.getHostName());

    HostRoleStatus lastTaskStatus = null;
    if(details.getTasks().containsKey(component)) {
      lastTaskStatus = details.getTasks().get(component);
    }
    details.getTasks().put(component, commandEntity.getStatus());
    return lastTaskStatus;
  }
Updates auditlog cache and returns the status of the latest task for the given component on the given host.
@param commandEntity new entity with the new status. It also holds the component and the hostname
@param requestId
@return
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java