pm-datafileupload-manager: 起个定时器,每1小时执行一次(可以用FixDelay的方式),每次执行做以下动作: *产生本地PVC网元清理任务放进一个队列中,每1000个网元路径包装到一个网元清理任务中(避免任务太小,频繁领取任务) *清理过期空文件夹 *清理本地PVC Load和MidOffice目录 *清理远程FTP文件 提供一个获取清理任务接口pollCleanTask,worker调用该接口时,从队列中取出指定个数的任务;当任务队列为空时,返回0个任务 2)pm-datafileupload-worker: 起个清理线程池,从yml中读取并发度,默认单实例5并发 起一个定时器,每隔1s调用manager的pollCleanTask接口,获取1个清理任务,获取其中待清理的网元路径,提交到清理线程池中,等待线程池中任务全部执行完毕,则返回。 如获取到清理任务数为空,则休眠1min 根据以上逻辑写出todolist
时间: 2024-02-16 18:01:42 浏览: 15
下面是针对题目的todolist:
pm-datafileupload-manager:
- [ ] 实现定时器功能,每1小时执行一次
- [ ] 在定时器回调中,产生本地PVC网元清理任务放进一个队列中,每1000个网元路径包装到一个网元清理任务中
- [ ] 在定时器回调中,清理过期空文件夹
- [ ] 在定时器回调中,清理本地PVC Load和MidOffice目录
- [ ] 在定时器回调中,清理远程FTP文件
- [ ] 提供获取清理任务接口pollCleanTask,从队列中取出指定个数的任务;当任务队列为空时,返回0个任务
pm-datafileupload-worker:
- [ ] 实现清理线程池功能,从yml中读取并发度,默认单实例5并发
- [ ] 实现定时器功能,每隔1s调用manager的pollCleanTask接口,获取1个清理任务,获取其中待清理的网元路径,提交到清理线程池中,等待线程池中任务全部执行完毕,则返回
- [ ] 如果获取到清理任务数为空,则休眠1min
相关问题
yyyy-MM-dd HH:mm:ss和yyyy-MM-dd hh:mm:ss的区别
这两种时间格式的区别在于小时数的表示方式不同。
- yyyy-MM-dd HH:mm:ss:这种时间格式中,小时数使用24小时制,即从00到23表示一天中的不同时间段。例如,2021年9月1日下午3点30分20秒的表示为“2021-09-01 15:30:20”。
- yyyy-MM-dd hh:mm:ss:这种时间格式中,小时数使用12小时制,即上午时间从1到12,下午时间从1到12,而中午12点表示为“12:00:00 PM”,午夜12点表示为“12:00:00 AM”。例如,2021年9月1日下午3点30分20秒的表示为“2021-09-01 03:30:20 PM”。
因此,当使用这两种时间格式时,需要注意小时数的表示方式。如果需要使用24小时制,应该使用第一种格式;如果需要使用12小时制,应该使用第二种格式。
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm");请详细解释每一部分
Sure!
`SimpleDateFormat` is a class in Java that is used to format and parse dates in a specific pattern.
`"yyyy-MM-dd HH:mm"` is the pattern used to format the date. Let's break it down:
- `yyyy` represents the year in four digits. For example, 2022.
- `-` is a separator character.
- `MM` represents the month in two digits. For example, 01 for January and 12 for December.
- `-` is another separator character.
- `dd` represents the day in two digits. For example, 01 for the 1st of the month and 31 for the last day of the month.
- ` ` (a space) is another separator character.
- `HH` represents the hour in 24-hour format. For example, 00 for midnight and 23 for 11 PM.
- `:` is a separator character.
- `mm` represents the minute in two digits. For example, 00 for the top of the hour and 59 for the last minute of the hour.
So `SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm");` creates a new `SimpleDateFormat` object called `sdf1` with the specified date pattern. This object can be used to format dates in this pattern or parse strings into dates using this pattern.