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

com.hubspot.singularity.data.history.HistoryManager 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.SingularityRequestHistory;
import com.hubspot.singularity.SingularityTaskHistory;
import com.hubspot.singularity.SingularityTaskIdHistory;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;

public interface HistoryManager {
  void saveRequestHistoryUpdate(SingularityRequestHistory requestHistory);

  void saveTaskHistory(SingularityTaskHistory taskHistory);

  void saveDeployHistory(SingularityDeployHistory deployHistory);

  Optional getDeployHistory(String requestId, String deployId);

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

  int getDeployHistoryForRequestCount(String requestId);

  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
  );

  Optional getTaskHistory(String taskId);

  Optional getTaskHistoryByRunId(String requestId, String runId);

  List getRequestHistory(
    String requestId,
    Optional createdBefore,
    Optional createdAfter,
    Optional orderDirection,
    Integer limitStart,
    Integer limitCount
  );

  int getRequestHistoryCount(String requestId);

  List getRequestHistoryLike(
    String requestIdLike,
    Integer limitStart,
    Integer limitCount
  );

  List getRequestIdsInTaskHistory();

  int getUnpurgedTaskHistoryCountByRequestBefore(String requestId, Date before);

  void purgeTaskHistory(
    String requestId,
    int count,
    Optional limit,
    Optional purgeBefore,
    boolean deleteRowInsteadOfUpdate,
    Integer maxPurgeCount
  );

  CompletableFuture startHistoryBackfill(int batchSize);

  void purgeRequestHistory();

  void purgeDeployHistory();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy