跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[Java] 在 JobRunr OSS 中实现作业池的思路?

发表于

我在做的一个实时性不是非常敏感但计算/ IO 密集型的功能,我们就说它是一个根据查询条件分析和导出报告的功能好了。

用户发出请求后,我会将其打包成一个作业提交给作业调度框架,我希望这种比较占用资源的作业可以在系统空闲时执行,而其他常规作业则不受影响。目前使用的调度框架是 JobRunr OSS ,思路是将高资源占用的作业打上特殊的标记,执行器在系统负载较高的情况下不要获取这些任务(先假设有一个通用的系统负载指标好了)。

看了下 JobRunr OSS 的源码,实现 org.jobrunr.server.strategy.WorkDistributionStrategy 接口可以影响执行器请求新作业的行为,然而用于取回新作业的 org.jobrunr.storage.navigation.AmountRequest 只能使用 order 和 limit 参数,不能按照标签等属性区分作业。

我认为这里需要一个作业池 / 优先级队列的概念,常规池使用默认的调度策略,而高资源占用作业池则使用定制的调度策略(等到系统空闲时),不过 JobQueue 似乎是 JobRunrPro 的功能,有办法在 JobRunr OSS 中实现这个需求吗?

因为没有搜到很多关于 Resource aware scheduler 的资料,我也有些怀疑这是否是一个值得研究的问题,或者实际上是个 X-Y 问题?

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.