package com.ruoyi.platform.service;

import com.ruoyi.platform.domain.ResourceOccupy;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

import java.util.Date;
import java.util.Map;

public interface ResourceOccupyService {

    Boolean haveResource(Integer computingResourceId, Integer replicas) throws Exception;

    void startDeduce(Integer computingResourceId, Integer replicas, String taskType, Long taskId, Long taskInsId, Long workflowId, String taskName, String nodeId, Integer state);

    void endDeduce(String taskType, Long taskId, Long taskInsId, String nodeId, Date nodeStartTime);

    void deducing(String taskType, Long taskId, Long taskInsId, String nodeId, Date nodeStartTime);

    Page<ResourceOccupy> queryByPage(PageRequest pageRequest);

    Map<String, Double> queryCredit();

    void update(String taskType, Long taskId, Long taskInsId, Integer computingResourceId, Integer replicas, String taskName);

    void deleteTaskState(String taskType, Long taskId, Long taskInsId);
}
