在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
最满意答案
您可以使用
(:)
将该项目添加到列表的前面。 对于奇数长度的情况,您可以按如下方式执行此操作:(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.
相关问答
更多-
混合Erlang和Haskell(Mixing Erlang and Haskell)[2021-10-19]
许多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列表生成(Haskell List Generation)[2023-11-12]
即使数字耗尽,它仍继续在列表中放置零。 那是因为当数字耗尽时你并没有告诉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将是更可靠的。 您可以生成不编译的表达式。 你 ...
-
Haskell:模式匹配(x:_):为什么列表头限于x?(Haskell: Pattern matching (x:_): why is the list head bounded to x?)[2022-11-13]
列表数据类型定义如下: data [a] = [] | a : [a] 这意味着s的列表要么是空的,要么是使用: ( cons )构造函数附加到tail元素的head元素。 在列表上进行模式匹配时,可以为这两种情况中的每一种定义函数。 在head'的情况下,当给出一个空列表时它就会失败,所以我们只匹配一个案例: a : [a] case。 如果你调用head' "hello" (因为它现在存在,包含类型签名)它应该失败,因为"hello"实际上是一个String - Haskell中[Char]的别名。 “ ... -
获取列表的中间数字并将它们放在起始位置 - Haskell(Get middle number(s) of a list and put them in the start positions - Haskell)[2023-09-11]
您可以使用(:)将该项目添加到列表的前面。 对于奇数长度的情况,您可以按如下方式执行此操作: (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 ...
-
和Haskell中的地图?(andmap in Haskell?)[2021-04-23]
你正在寻找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 (特别是如果您有许多可以省略的零)。 [编辑] 这是一个稍微快一点的版 ...
-
Haskell的“做”问题(Issue with Haskell's “do”)[2023-09-20]
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 ...