Class JobLogServiceImpl
- java.lang.Object
-
- net.risedata.jdbc.service.impl.CrudServiceImpl<T,ID>
-
- net.risedata.jdbc.service.impl.AutomaticCrudService<JobLog,String>
-
- net.risesoft.api.persistence.job.impl.JobLogServiceImpl
-
- All Implemented Interfaces:
CrudService<JobLog,String>,JobLogService
@Service public class JobLogServiceImpl extends AutomaticCrudService<JobLog,String> implements JobLogService
-
-
Constructor Summary
Constructors Constructor Description JobLogServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete 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)修改状态-
Methods inherited from class net.risedata.jdbc.service.impl.AutomaticCrudService
findByIds, getDeleteExecutor, getInsertExecutor, getSearchExecutor, getT, getUpdateExecutor, searchAll
-
Methods inherited from class net.risedata.jdbc.service.impl.CrudServiceImpl
batchInsert, delete, delete, delete, deleteById, deleteById, deleteByIds, findById, findOne, findOne, findOne, getOne, hasById, insert, save, search, search, search, search, search, search, searchAllForPage, searchAllForPage, searchAllForPage, searchFieldById, searchForList, searchForList, searchForPage, searchForPage, searchForPage, searchForPage, searchForPage, update, updateById, updateById, updateById
-
-
-
-
Method Detail
-
isBlock
public boolean isBlock(Integer jobId, int timeOut, String logId)
Description copied from interface:JobLogService是否阻塞- Specified by:
isBlockin interfaceJobLogService- Parameters:
jobId- 任务idtimeOut- 超时时间logId- 当前日志id- Returns:
-
saveLog
public boolean saveLog(JobLog jobLog)
Description copied from interface:JobLogService保存日志- Specified by:
saveLogin interfaceJobLogService- Returns:
-
appendLog
public boolean appendLog(String id, String logContext)
Description copied from interface:JobLogService添加日志- Specified by:
appendLogin interfaceJobLogService- Parameters:
id- 日志idlogContext- 添加的内容- Returns:
-
updateStatus
public boolean updateStatus(String logId, Integer status, Integer ovlStatus)
Description copied from interface:JobLogService修改状态- Specified by:
updateStatusin interfaceJobLogService- Parameters:
logId- 日志idstatus- 状态ovlStatus- 之前的状态- Returns:
-
updateStatus
public boolean updateStatus(String logId, Integer status)
Description copied from interface:JobLogService修改状态- Specified by:
updateStatusin interfaceJobLogService- Parameters:
logId- 日志idstatus- 状态- Returns:
-
pollJob
public JobLog pollJob(Integer jobId, int timeOut)
Description copied from interface:JobLogService获取最早在排队的任务进行调度- Specified by:
pollJobin interfaceJobLogService- Returns:
-
endJob
public void endJob(String id, int success, String msg, String result, String environment)
Description copied from interface:JobLogService结束任务- Specified by:
endJobin interfaceJobLogService- Parameters:
id- idsuccess- 状态msg- 消息result- 返回值
-
appendSource
public void appendSource(String id, String source, String msg)
Description copied from interface:JobLogService添加调度源- Specified by:
appendSourcein interfaceJobLogService
-
findDownJob
public JobLog findDownJob(Integer id, List<String> logs)
Description copied from interface:JobLogService获取到因为掉线没执行的job- Specified by:
findDownJobin interfaceJobLogService- Returns:
-
findById
public JobLog findById(String id)
Description copied from interface:JobLogService根据id 查找- Specified by:
findByIdin interfaceJobLogService- Returns:
-
search
public net.risedata.jdbc.commons.LPage<Map<String,Object>> search(JobLog job, LPageable page, ConcurrentSecurity securityJurisdiction, String jobType, Integer[] jobIds)
Description copied from interface:JobLogService查询日志- Specified by:
searchin interfaceJobLogService- Returns:
-
findConsoleById
public String findConsoleById(String id)
- Specified by:
findConsoleByIdin interfaceJobLogService
-
clearLog
public void clearLog(Date time)
Description copied from interface:JobLogService清除日志 小于这个时间的- Specified by:
clearLogin interfaceJobLogService
-
clearTimeOutJob
public void clearTimeOutJob()
Description copied from interface:JobLogService清理掉调度超时的任务- Specified by:
clearTimeOutJobin interfaceJobLogService
-
getLogCount
public Integer getLogCount(String environment)
Description copied from interface:JobLogService获取执行任务的数量- Specified by:
getLogCountin interfaceJobLogService- Returns:
-
findDownJobs
public List<JobLog> findDownJobs(Integer id, List<String> logs)
Description copied from interface:JobLogService拿到当前job在运行中的- Specified by:
findDownJobsin interfaceJobLogService- Returns:
-
getRunableMinInstance
public org.springframework.cloud.client.ServiceInstance getRunableMinInstance(List<org.springframework.cloud.client.ServiceInstance> instanceIds)
Description copied from interface:JobLogService拿到运行任务最少的- Specified by:
getRunableMinInstancein interfaceJobLogService- Returns:
-
killAwaitJob
public boolean killAwaitJob(Integer jobId)
Description copied from interface:JobLogService删除掉正在等待的任务- Specified by:
killAwaitJobin interfaceJobLogService- Returns:
-
searchByGroup
public net.risedata.jdbc.commons.LPage<Map<String,Object>> searchByGroup(Date startDate, Date endDate, String environment, LPageable page, String jobName, ConcurrentSecurity jurisdiction)
- Specified by:
searchByGroupin interfaceJobLogService
-
searchByGroupLog
public List<Map<String,Object>> searchByGroupLog(Date startDate, Date endDate, String environment, String jobName)
- Specified by:
searchByGroupLogin interfaceJobLogService
-
getExecutedCountByStatusAndTime
public Integer getExecutedCountByStatusAndTime(List<Integer> statusList, long start, long end, List<String> jobTypes)
- Specified by:
getExecutedCountByStatusAndTimein interfaceJobLogService
-
getExecutedCountGroupByDispatchTime
public List<Map<String,Object>> getExecutedCountGroupByDispatchTime(List<Integer> statusList, long start, long end, List<String> jobTypes)
- Specified by:
getExecutedCountGroupByDispatchTimein interfaceJobLogService
-
getSchedulingInfo
public List<Map<String,Object>> getSchedulingInfo(List<Integer> statuslist, Long startTime, Long endTime, String environment, List<String> jobTypes)
- Specified by:
getSchedulingInfoin interfaceJobLogService
-
-