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 com.hubspot.singularity.ExtendedTaskState;
import com.hubspot.singularity.OrderDirection;
import com.hubspot.singularity.SingularityDeployHistory;
import com.hubspot.singularity.SingularityRequest;
import com.hubspot.singularity.SingularityRequestHistory;
import com.hubspot.singularity.SingularityTaskHistory;
import com.hubspot.singularity.SingularityTaskIdHistory;
import com.hubspot.singularity.data.history.SingularityMappers.SingularityRequestIdCount;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import org.jdbi.v3.sqlobject.SqlObject;

public interface HistoryJDBI extends SqlObject {
  void insertRequestHistory(
    String requestId,
    SingularityRequest 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,
    SingularityDeployHistory deployHistory
  );

  void insertTaskHistory(
    String requestId,
    String taskId,
    SingularityTaskHistory taskHistory,
    Date updatedAt,
    String lastTaskStatus,
    String runId,
    String deployId,
    String host,
    Date startedAt
  );

  SingularityTaskHistory getTaskHistoryForTask(String taskId);

  SingularityTaskHistory getTaskHistoryForTaskByRunId(String requestId, String runId);

  SingularityDeployHistory getDeployHistoryForDeploy(String requestId, String deployId);

  List getDeployHistoryForRequest(
    String requestId,
    Integer limitStart,
    Integer limitCount
  );

  int getDeployHistoryForRequestCount(String requestId);

  List getRequestHistory(
    String requestId,
    Optional createdBefore,
    Optional createdAfter,
    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
  );

  @Deprecated
  byte[] getTaskHistoryBytesForTask(String taskId);

  @Deprecated
  byte[] getTaskHistoryBytesForTaskByRunId(String requestId, String runId);

  @Deprecated
  byte[] getDeployHistoryBytesForDeploy(String requestId, String deployId);

  List getTasksWithBytes(String requestId, int limit);

  void setTaskJson(String taskId, SingularityTaskHistory taskHistory);

  List getRequestsWithBytes(int limit);

  void setRequestJson(String requestId, Date createdAt, SingularityRequest request);

  List getDeploysWithBytes(String requestId, int limit);

  void setDeployJson(
    String requestId,
    String deployId,
    SingularityDeployHistory deployHistory
  );

  List getRequestIdsWithHistory();

  int purgeRequestHistory(String requestId, Date threshold, int batchSize);

  List getRequestIdsWithDeploys();

  int purgeDeployHistory(String requestId, Date threshold, int batchSize);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy