All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hubspot.singularity.data.history.HistoryJDBI Maven / Gradle / Ivy

package com.hubspot.singularity.data.history;

import java.util.Date;
import java.util.List;

import com.google.common.base.Optional;
import com.hubspot.singularity.ExtendedTaskState;
import com.hubspot.singularity.OrderDirection;
import com.hubspot.singularity.SingularityDeployHistory;
import com.hubspot.singularity.SingularityRequestHistory;
import com.hubspot.singularity.SingularityTaskIdHistory;
import com.hubspot.singularity.data.history.SingularityMappers.SingularityRequestIdCount;

import org.skife.jdbi.v2.sqlobject.mixins.GetHandle;

public interface HistoryJDBI extends GetHandle {

  void insertRequestHistory(String requestId,byte[] request, Date createdAt, String requestState, String user, String message);
  void insertDeployHistory(String requestId,String deployId, Date createdAt, String user, String message, Date deployStateAt, String deployState, byte[] bytes);
  void insertTaskHistory(String requestId,String taskId, byte[] bytes,Date updatedAt,
                         String lastTaskStatus, String runId,String deployId, String host,
                         Date startedAt);

  byte[] getTaskHistoryForTask(String taskId);
  byte[] getTaskHistoryForTaskByRunId(String requestId, String runId);

  byte[] getDeployHistoryForDeploy(String requestId, String deployId);
  List getDeployHistoryForRequest(String requestId, Integer limitStart, Integer limitCount);
  int getDeployHistoryForRequestCount(String requestId);

  List getRequestHistory(String requestId, String orderDirection, Integer limitStart, Integer limitCount);
  int getRequestHistoryCount(String requestId);
  List getRequestHistoryLike(String requestIdLike, Integer limitStart,Integer limitCount);
  List getRequestIdCounts(Date updatedAt);

  Date getMinUpdatedAtWithLimitForRequest(String requestId, Integer limit);

  void updateTaskHistoryNullBytesForRequestBefore(String requestId, Date updatedAtBefore, Integer purgeLimitPerQuery);
  void deleteTaskHistoryForRequestBefore(String requestId,Date updatedAtBefore, Integer purgeLimitPerQuery);
  List getRequestIdsInTaskHistory();
  int getUnpurgedTaskHistoryCountByRequestBefore(String requestId, Date updatedAtBefore);

  void close();

  List getTaskIdHistory(Optional requestId, Optional deployId, Optional runId, Optional host,
                                                  Optional lastTaskStatus, Optional startedBefore, Optional startedAfter, Optional updatedBefore,
                                                  Optional updatedAfter, Optional orderDirection, Optional limitStart, Integer limitCount);
  int getTaskIdHistoryCount(Optional requestId, Optional deployId, Optional runId, Optional host,
                            Optional lastTaskStatus, Optional startedBefore, Optional startedAfter, Optional updatedBefore,
                            Optional updatedAfter);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy