接口 JobLogService

    • 方法详细资料

      • isBlock

        boolean isBlock​(Integer jobId,
                        int timeOut,
                        String logId)
        是否阻塞
        参数:
        jobId - 任务id
        timeOut - 超时时间
        logId - 当前日志id
        返回:
      • saveLog

        boolean saveLog​(JobLog jobLog)
        保存日志
        参数:
        jobLog -
        返回:
      • appendLog

        boolean appendLog​(String id,
                          String logContext)
        添加日志
        参数:
        id - 日志id
        logContext - 添加的内容
        返回:
      • updateStatus

        boolean updateStatus​(String logId,
                             Integer status,
                             Integer ovlStatus)
        修改状态
        参数:
        logId - 日志id
        status - 状态
        ovlStatus - 之前的状态
        返回:
      • updateStatus

        boolean updateStatus​(String logId,
                             Integer status)
        修改状态
        参数:
        logId - 日志id
        status - 状态
        返回:
      • pollJob

        JobLog pollJob​(Integer jobId,
                       int timeOut)
        获取最早在排队的任务进行调度
        参数:
        jobId -
        返回:
      • endJob

        void endJob​(String id,
                    int success,
                    String msg,
                    String result,
                    String environment)
        结束任务
        参数:
        id - id
        success - 状态
        msg - 消息
        result - 返回值
      • appendSource

        void appendSource​(String id,
                          String source,
                          String msg)
        添加调度源
        参数:
        id -
        source -
        msg -
      • findDownJob

        JobLog findDownJob​(Integer id,
                           List<String> logs)
        获取到因为掉线没执行的job
        参数:
        id -
        logs -
        返回:
      • findById

        JobLog findById​(String id)
        根据id 查找
        参数:
        id -
        返回:
      • clearLog

        void clearLog​(Date time)
        清除日志 小于这个时间的
        参数:
        time -
      • clearTimeOutJob

        void clearTimeOutJob()
        清理掉调度超时的任务
      • getLogCount

        Integer getLogCount​(String environment)
        获取执行任务的数量
        参数:
        environment -
        返回:
      • findDownJobs

        List<JobLog> findDownJobs​(Integer id,
                                  List<String> logs)
        拿到当前job在运行中的
        参数:
        id -
        logs -
        返回:
      • getRunableMinInstance

        org.springframework.cloud.client.ServiceInstance getRunableMinInstance​(List<org.springframework.cloud.client.ServiceInstance> instanceIds)
        拿到运行任务最少的
        参数:
        instanceIds -
        返回:
      • killAwaitJob

        boolean killAwaitJob​(Integer jobId)
        删除掉正在等待的任务
        参数:
        jobId -
        返回:
      • getExecutedCountByStatusAndTime

        Integer getExecutedCountByStatusAndTime​(List<Integer> statusList,
                                                long start,
                                                long end)
      • getExecutedCountGroupByDispatchTime

        List<Map<String,​Object>> getExecutedCountGroupByDispatchTime​(List<Integer> statusList,
                                                                           long start,
                                                                           long end)