首页 \ 问答 \ 在spring批处理中配置多个版本的作业(configuring multiple versions of job in spring batch)

在spring批处理中配置多个版本的作业(configuring multiple versions of job in spring batch)

SpringBatch似乎缺少数据库中作业定义的元数据。

为了在数据库中创建作业实例,它唯一考虑的是jobName和jobParamter,“ JobInstance createJobInstance(String jobName,JobParameters jobParameters);

但是,Job的对象模型足够丰富,可以考虑步骤和听众。 因此,如果我创建现有作业的新版本,通过添加一些额外的步骤,弹出批处理不会与以前的版本区分开来。 因此,如果我今天运行以前的版本并运行更新版本,则spring批处理不会运行更新版本,因为它感觉上次运行成功。 目前,似乎作业的版本号应该是名称的一部分。 这是正确的理解吗?


SpringBatch seems to be lacking the metadata for the job definition in the database.

In order to create a job instance in the database, the only thing it considers is jobName and jobParamter, "JobInstance createJobInstance(String jobName, JobParameters jobParameters);"

But,the object model of Job is rich enough to consider steps and listeners. So, if i create a new version of the existing job, by adding few additional steps, spring batch does not distinguish it from the previous version. Hence, if i ran the previous version today and run the updated version, spring batch does not run the updated version, as it feels that previous run was successful. At present, it seems like, the version number of the job, should be part of the name. Is this correct understanding ?


原文:https://stackoverflow.com/questions/38317150
更新时间:2023-07-01 15:07

最满意答案

您可以使用(:)将该项目添加到列表的前面。 对于奇数长度的情况,您可以按如下方式执行此操作:

(xs !! middleLoc):(take middleLoc xs ++ drop (middleLoc + 1) xs)
where
    middleLoc = l `quot` 2

您将不得不为偶数长度的情况修改它,您可能需要单独识别和处理(即 - 拉出并添加两个项目)。 我会留下你的补充。


You can use (:) to prepend that item to the front of the list. For the odd length case, you can do this as follows:

(xs !! middleLoc):(take middleLoc xs ++ drop (middleLoc + 1) xs)
where
    middleLoc = l `quot` 2

You will have to modify this for the even length case, which you might want to identify and deal with separately (ie- pull out and prepend two items). I'll leave that for you to add.

相关问答

更多
  • 许多Haskell和Erlang人对Erlang监督分发的模式感兴趣,而Haskell并行运行共享内存节点,执行所有的数字处理/逻辑。 开始这个是haskell-erlang图书馆: http : //hackage.haskell.org/package/erlang 我们在Ruby土地上也有类似的努力,通过Hubris: http : //github.com/mwotton/Hubris/tree/master 现在的问题是找到一个人,通过Erlang / Haskell互操作来找出棘手的问题。 A ...
  • 即使数字耗尽,它仍继续在列表中放置零。 那是因为当数字耗尽时你并没有告诉Haskell停止。 您定义递归函数。 为了编写好的(读取终止 )递归函数,您需要一个停止条件 :您停止调用递归的条件。 你可以通过使用警卫来做到这一点: numba2listInReverse :: Integer -> [Integer] numba2listInReverse x | x == 0 = [] | otherwise = lastDigit x : numba2listIn ...
  • 避免Template Haskell的一个原因是,它整体上并不是类型安全的,所以反过来就是“Haskell的精神”。 这里有一些例子: 您无法控制什么样的Haskell AST一个TH代码将生成,超出它将出现的地方; 您可以具有类型为Exp的值,但是您不知道它是否是表示[Char]或(a -> (forall b . b -> c))或其他内容的表达式。 如果可以表示一个函数只能生成某种类型的表达式,或只能生成函数声明,或者只能生成数据构造器匹配模式等,那么TH将是更可靠的。 您可以生成不编译的表达式。 你 ...
  • 列表数据类型定义如下: data [a] = [] | a : [a] 这意味着s的列表要么是空的,要么是使用: ( cons )构造函数附加到tail元素的head元素。 在列表上进行模式匹配时,可以为这两种情况中的每一种定义函数。 在head'的情况下,当给出一个空列表时它就会失败,所以我们只匹配一个案例: a : [a] case。 如果你调用head' "hello" (因为它现在存在,包含类型签名)它应该失败,因为"hello"实际上是一个String - Haskell中[Char]的别名。 “ ...
  • 您可以使用(:)将该项目添加到列表的前面。 对于奇数长度的情况,您可以按如下方式执行此操作: (xs !! middleLoc):(take middleLoc xs ++ drop (middleLoc + 1) xs) where middleLoc = l `quot` 2 您将不得不为偶数长度的情况修改它,您可能需要单独识别和处理(即 - 拉出并添加两个项目)。 我会留下你的补充。 You can use (:) to prepend that item to the front of t ...
  • 尝试这个: f :: (Num a) => [a] -> [a] f [] = [] f [x] = [x] f xs = if len `mod` 2 == 1 then flatten [xs !! half] else flatten [xs !! (half-1), xs !! half] where len = length xs half = len `div` 2 firsthalf = take (half-1) xs se ...
  • 你正在寻找all : > all (>0) [1, 2, 3] True > all (>0) [1, -2, 3] False You're looking for all: > all (>0) [1, 2, 3] True > all (>0) [1, -2, 3] False
  • list = [[0,1,0],[1,9,1],[1,1,0]] s x y = sum [list !! j !! i | i <- [x-1..x+1], j <- [y-1..y+1], i /= x || j /= y] --s 1 1 --> 5 请注意,如果坐标位于边缘,我没有纠错。 您可以通过向理解添加更多条件来实现此目的。 如果事情变大,列表列表不是最有效的数据结构。 您可以考虑向量或Map (Int,Int) Int (特别是如果您有许多可以省略的零)。 [编辑] 这是一个稍微快一点的版 ...
  • do putStrLn ((show.fact.head) list) factPrint (tail list) 实际上是另一种写作方式 putStrLn ((show.fact.head) list) >> factPrint (tail list) 这又意味着 putStrLn ((show.fact.head) list) >>= \_ -> factPrint (tail list) 这个符号是将这些monad串在一起的一种便捷方式,没有这种其他丑陋的语法。 如果你只在do有一个声明, ...
  • 我认为关于doubles如何遍历无限列表的每个元素的递归/循环部分你是正确的。 现在关于 它似乎将所有加倍的d保存到列表中以便稍后调用,该列表的名称是什么? 我在哪里确切地定义它? 这涉及在Haskell中称为Lazy Evaluation的功能。 该列表未预先计算并存储在任何位置。 相反,您可以想象列表是C ++中的一个函数对象,可以在需要时生成元素。 (您可能会看到的正常语言是表达式是按需评估的)。 所以,当你这样做 take 5 [1..] [1..]可以被视为一个函数对象,当与head , tak ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)