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

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

package com.hubspot.singularity.data.history;

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

import javax.inject.Inject;

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.SingularityTaskHistory;
import com.hubspot.singularity.SingularityTaskIdHistory;
import com.hubspot.singularity.data.history.SingularityMappers.SingularityRequestIdCount;

public class NoopHistoryManager implements HistoryManager {

  @Inject
  public NoopHistoryManager() {
  }

  @Override
  public void saveRequestHistoryUpdate(SingularityRequestHistory requestHistory) {
    throw new UnsupportedOperationException("NoopHistoryManager can not save");
  }

  @Override
  public void saveTaskHistory(SingularityTaskHistory taskHistory) {
    throw new UnsupportedOperationException("NoopHistoryManager can not save");
  }

  @Override
  public void saveDeployHistory(SingularityDeployHistory deployHistory) {
    throw new UnsupportedOperationException("NoopHistoryManager can not save");
  }

  @Override
  public Optional getDeployHistory(String requestId, String deployId) {
    return Optional.absent();
  }

  @Override
  public List getDeployHistoryForRequest(String requestId, Integer limitStart, Integer limitCount) {
    return Collections.emptyList();
  }

  @Override
  public int getDeployHistoryForRequestCount(String requestId) {
    return 0;
  }

  @Override
  public 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) {
    return Collections.emptyList();
  }

  @Override
  public int getTaskIdHistoryCount(Optional requestId, Optional deployId, Optional runId, Optional host, Optional lastTaskStatus, Optional startedBefore,
        Optional startedAfter, Optional updatedBefore, Optional updatedAfter) {
    return 0;
  }

  @Override
  public Optional getTaskHistory(String taskId) {
    return Optional.absent();
  }

  @Override
  public Optional getTaskHistoryByRunId(String requestId, String runId) {
    return Optional.absent();
  }

  @Override
  public List getRequestHistory(String requestId, Optional orderDirection, Integer limitStart, Integer limitCount) {
    return Collections.emptyList();
  }

  @Override
  public int getRequestHistoryCount(String requestId) {
    return 0;
  }

  @Override
  public List getRequestHistoryLike(String requestIdLike, Integer limitStart, Integer limitCount) {
    return Collections.emptyList();
  }

  @Override
  public List getRequestIdCounts(Date before) {
    return Collections.emptyList();
  }

  @Override
  public List getRequestIdsInTaskHistory() {
    return Collections.emptyList();
  }

  @Override
  public int getUnpurgedTaskHistoryCountByRequestBefore(String requestId, Date before) {
    return 0;
  }

  @Override
  public void purgeTaskHistory(String requestId, int count, Optional limit, Optional purgeBefore, boolean deleteRowInsteadOfUpdate, Integer maxPurgeCount) {
    throw new UnsupportedOperationException("NoopHistoryManager can not update/delete");
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy