Package net.risesoft.api.persistence.job
Interface JobLogService
-
- All Known Implementing Classes:
JobLogServiceImpl
public interface JobLogService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanappendLog(String id, String logContext)添加日志voidappendSource(String id, String source, String msg)添加调度源voidclearLog(Date time)清除日志 小于这个时间的voidclearTimeOutJob()清理掉调度超时的任务voidendJob(String id, int success, String msg, String result, String environment)结束任务JobLogfindById(String id)根据id 查找StringfindConsoleById(String id)JobLogfindDownJob(Integer id, List<String> logs)获取到因为掉线没执行的jobList<JobLog>findDownJobs(Integer id, List<String> logs)拿到当前job在运行中的IntegergetExecutedCountByStatusAndTime(List<Integer> statusList, long start, long end, List<String> jobTypes)List<Map<String,Object>>getExecutedCountGroupByDispatchTime(List<Integer> statusList, long start, long end, List<String> jobTypes)IntegergetLogCount(String environment)获取执行任务的数量List<Map<String,Object>>getLogGroupInfo(List<Integer> statuslist, Long startTime, Long endTime, List<String> jobTypes)org.springframework.cloud.client.ServiceInstancegetRunableMinInstance(List<org.springframework.cloud.client.ServiceInstance> instanceIds)拿到运行任务最少的List<Map<String,Object>>getSchedulingInfo(List<Integer> statuslist, Long startTime, Long endTime, String environment, List<String> jobTypes)booleanisBlock(Integer jobId, int timeOut, String logId)是否阻塞booleankillAwaitJob(Integer jobId)删除掉正在等待的任务JobLogpollJob(Integer jobId, int timeOut)获取最早在排队的任务进行调度booleansaveLog(JobLog jobLog)保存日志net.risedata.jdbc.commons.LPage<Map<String,Object>>search(JobLog job, LPageable page, ConcurrentSecurity securityJurisdiction, String jobType, Integer[] jobIds)查询日志net.risedata.jdbc.commons.LPage<Map<String,Object>>searchByGroup(Date startDate, Date endDate, String environment, LPageable page, String jobName, ConcurrentSecurity jurisdiction)List<Map<String,Object>>searchByGroupLog(Date startDate, Date endDate, String environment, String jobName)booleanupdateStatus(String logId, Integer status)修改状态booleanupdateStatus(String logId, Integer status, Integer ovlStatus)修改状态
-
-
-
Method Detail
-
isBlock
boolean isBlock(Integer jobId, int timeOut, String logId)
是否阻塞- Parameters:
jobId- 任务idtimeOut- 超时时间logId- 当前日志id- Returns:
-
saveLog
boolean saveLog(JobLog jobLog)
保存日志- Parameters:
jobLog-- Returns:
-
appendLog
boolean appendLog(String id, String logContext)
添加日志- Parameters:
id- 日志idlogContext- 添加的内容- Returns:
-
updateStatus
boolean updateStatus(String logId, Integer status, Integer ovlStatus)
修改状态- Parameters:
logId- 日志idstatus- 状态ovlStatus- 之前的状态- Returns:
-
updateStatus
boolean updateStatus(String logId, Integer status)
修改状态- Parameters:
logId- 日志idstatus- 状态- Returns:
-
endJob
void endJob(String id, int success, String msg, String result, String environment)
结束任务- Parameters:
id- idsuccess- 状态msg- 消息result- 返回值
-
appendSource
void appendSource(String id, String source, String msg)
添加调度源- Parameters:
id-source-msg-
-
findDownJob
JobLog findDownJob(Integer id, List<String> logs)
获取到因为掉线没执行的job- Parameters:
id-logs-- Returns:
-
search
net.risedata.jdbc.commons.LPage<Map<String,Object>> search(JobLog job, LPageable page, ConcurrentSecurity securityJurisdiction, String jobType, Integer[] jobIds)
查询日志- Parameters:
job-page-securityJurisdiction-service-jobIds-- Returns:
-
clearLog
void clearLog(Date time)
清除日志 小于这个时间的- Parameters:
time-
-
clearTimeOutJob
void clearTimeOutJob()
清理掉调度超时的任务
-
findDownJobs
List<JobLog> findDownJobs(Integer id, List<String> logs)
拿到当前job在运行中的- Parameters:
id-logs-- Returns:
-
getRunableMinInstance
org.springframework.cloud.client.ServiceInstance getRunableMinInstance(List<org.springframework.cloud.client.ServiceInstance> instanceIds)
拿到运行任务最少的- Parameters:
instanceIds-- Returns:
-
killAwaitJob
boolean killAwaitJob(Integer jobId)
删除掉正在等待的任务- Parameters:
jobId-- Returns:
-
searchByGroup
net.risedata.jdbc.commons.LPage<Map<String,Object>> searchByGroup(Date startDate, Date endDate, String environment, LPageable page, String jobName, ConcurrentSecurity jurisdiction)
-
searchByGroupLog
List<Map<String,Object>> searchByGroupLog(Date startDate, Date endDate, String environment, String jobName)
-
getExecutedCountByStatusAndTime
Integer getExecutedCountByStatusAndTime(List<Integer> statusList, long start, long end, List<String> jobTypes)
-
getExecutedCountGroupByDispatchTime
List<Map<String,Object>> getExecutedCountGroupByDispatchTime(List<Integer> statusList, long start, long end, List<String> jobTypes)
-
getSchedulingInfo
List<Map<String,Object>> getSchedulingInfo(List<Integer> statuslist, Long startTime, Long endTime, String environment, List<String> jobTypes)
-
-