Kohei Nozaki's blog 

Decisionでフロー制御してみる


Posted on Saturday Feb 15, 2014 at 08:20PM in Technology


フロー制御は、ExitStatusでフロー制御してみるでやったようにBatchletだけでもできるけど、Chunk要素などの後続処理のフロー制御はDecision要素を使うと楽にできそうなので、試してみる

例えば先行のChunk処理でスキップが多すぎる時に、一応ジョブは正常終了しつつも警告メール的なものを送っておくとか、そういうことをやりたい時にはDecisionを使うとよいかもしれない。引数でStepExecution[]が渡ってくるので、先行処理のMetricsを取り出して調べたりすることが楽にできる。

環境・前提条件

仕様を確認する

  • [2]から引いてみる

public interface Decider

A Decider receives control as part of a decision element in a job. It is used to direct execution flow during job processing. It returns an exit status that updates the current job execution's exit status. This exit status value also directs the execution transition based on next, end, stop, fail child elements configured on the same decision element as the decider.

String decide(StepExecution[] executions) throws Exception

The decide method sets a new exit status for a job. It receives an array of StepExecution objects as input. These StepExecution objects represent the execution element that transitions to this decider as follows:

Step

When the transition is from a step, the decide method receives the StepExecution corresponding to the step as input.

Split

When the transition is from a split, the decide method receives a StepExecution from each flow defined to the split as input.

Flow

When the transition is from a flow, the decide method receives a StepExecution corresponding to the last execution element that completed in the flow. This will be a single StepExecution if the last element was a step and multiple StepExecutions if the last element was a split.

Parameters:

executions - specifies the StepExecution(s) of the preceding element.

Returns:

updated job exit status

  • とりあえず上に書かれた3パターンで試してみる

Stepからの遷移の場合

資源はこのへんにまとめて全部ある

資源

仕様

  • 第一レベルの要素は以下
    1. step1 (batchlet step)
    2. step2 (chunk oriented step)
    3. step2decision (decision)
    4. step3_NO_SKIP_FOUND (batchlet step)
    5. step4_SKIP_FOUND (batchlet step)
  • step2でスキップがなかった場合はstep3_NO_SKIP_FOUNDに遷移する
  • step2でスキップがあった場合はstep4_SKIP_FOUNDに遷移する

スキップが無い場合のテストを動かしてみる

ログ

13:53:59,614 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): executions=1
13:53:59,614 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): stepName=step2, stepExecutionId=248
13:53:59,614 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: WRITE_SKIP_COUNT=0
13:53:59,615 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: PROCESS_SKIP_COUNT=0
13:53:59,615 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: WRITE_COUNT=10
13:53:59,615 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: COMMIT_COUNT=4
13:53:59,615 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: READ_SKIP_COUNT=0
13:53:59,615 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: ROLLBACK_COUNT=0
13:53:59,615 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: FILTER_COUNT=0
13:53:59,615 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: READ_COUNT=10
13:53:59,615 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): exitStatus=SKIP_NOT_FOUND
13:53:59,617 FINE  [org.nailedtothex.jbatch.example.decision.NopBatchlet] (batch-batch - 10) step3_NO_SKIP_FOUND

Repository

job_execution
jbatch=# select * from job_execution order by jobexecutionid desc limit 1;
 jobexecutionid | jobinstanceid | version |       createtime       |       starttime        |         endtime         |     lastupdatedtime     | batchstatus |   exitstatus   |     jobparameters     | restartposition 
----------------+---------------+---------+------------------------+------------------------+-------------------------+-------------------------+-------------+----------------+-----------------------+-----------------
            188 |           176 |         | 2014-02-16 13:53:59.41 | 2014-02-16 13:53:59.41 | 2014-02-16 13:53:59.619 | 2014-02-16 13:53:59.619 | COMPLETED   | SKIP_NOT_FOUND | itemReaderFailAt = -1+| 
                |               |         |                        |                        |                         |                         |             |                | divide = 2           +| 
                |               |         |                        |                        |                         |                         |             |                |                       | 
(1 row)
step_execution
jbatch=# select * from step_execution where jobexecutionid in (188) order by jobexecutionid, stepexecutionid;
 stepexecutionid | jobexecutionid | version |      stepname       |        starttime        |         endtime         | batchstatus | exitstatus | executionexception | persistentuserdata | readcount | writecount | commitcount | rollbackcount | readskipcount | processskipcount | filtercount | writeskipcount |                                                                         readercheckpointinfo                                                                         |                                                                         writercheckpointinfo                                                                         
-----------------+----------------+---------+---------------------+-------------------------+-------------------------+-------------+------------+--------------------+--------------------+-----------+------------+-------------+---------------+---------------+------------------+-------------+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------
             247 |            188 |         | step1               | 2014-02-16 13:53:59.412 | 2014-02-16 13:53:59.453 | COMPLETED   | COMPLETED  |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                                                                                                                                                                      | 
             248 |            188 |         | step2               | 2014-02-16 13:53:59.46  | 2014-02-16 13:53:59.61  | COMPLETED   | COMPLETED  |                    |                    |        10 |         10 |           4 |             0 |             0 |                0 |           0 |              0 | \xaced0005737200116a6176612e6c616e672e496e746567657212e2a0a4f781873802000149000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b02000078700000000a | \xaced0005737200116a6176612e6c616e672e496e746567657212e2a0a4f781873802000149000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b020000787000000004
             249 |            188 |         | step3_NO_SKIP_FOUND | 2014-02-16 13:53:59.615 | 2014-02-16 13:53:59.617 | COMPLETED   | COMPLETED  |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                                                                                                                                                                      | 
(3 rows)

jbatch=# 

スキップが有る場合のテストを動かしてみる

ログ

13:55:00,761 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 5) decide(): executions=1
13:55:00,761 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 5) decide(): stepName=step2, stepExecutionId=251
13:55:00,761 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 5) decide(): metric: WRITE_SKIP_COUNT=0
13:55:00,761 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 5) decide(): metric: PROCESS_SKIP_COUNT=0
13:55:00,761 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 5) decide(): metric: WRITE_COUNT=9
13:55:00,761 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 5) decide(): metric: COMMIT_COUNT=4
13:55:00,762 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 5) decide(): metric: READ_SKIP_COUNT=1
13:55:00,762 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 5) decide(): metric: ROLLBACK_COUNT=0
13:55:00,762 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 5) decide(): metric: FILTER_COUNT=0
13:55:00,762 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 5) decide(): metric: READ_COUNT=9
13:55:00,762 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 5) decide(): exitStatus=SKIP_FOUND
13:55:00,763 FINE  [org.nailedtothex.jbatch.example.decision.NopBatchlet] (batch-batch - 5) step4_SKIP_FOUND

Repository

job_execution
jbatch=# select * from job_execution order by jobexecutionid desc limit 1;
 jobexecutionid | jobinstanceid | version |       createtime        |        starttime        |         endtime         |     lastupdatedtime     | batchstatus | exitstatus |    jobparameters     | restartposition 
----------------+---------------+---------+-------------------------+-------------------------+-------------------------+-------------------------+-------------+------------+----------------------+-----------------
            189 |           177 |         | 2014-02-16 13:55:00.639 | 2014-02-16 13:55:00.639 | 2014-02-16 13:55:00.765 | 2014-02-16 13:55:00.765 | COMPLETED   | SKIP_FOUND | itemReaderFailAt = 5+| 
                |               |         |                         |                         |                         |                         |             |            | divide = 2          +| 
                |               |         |                         |                         |                         |                         |             |            |                      | 
(1 row)
step_execution
jbatch=# select * from step_execution where jobexecutionid in (189) order by jobexecutionid, stepexecutionid;
 stepexecutionid | jobexecutionid | version |     stepname     |        starttime        |         endtime         | batchstatus | exitstatus | executionexception | persistentuserdata | readcount | writecount | commitcount | rollbackcount | readskipcount | processskipcount | filtercount | writeskipcount |                                                                         readercheckpointinfo                                                                         |                                                                         writercheckpointinfo                                                                         
-----------------+----------------+---------+------------------+-------------------------+-------------------------+-------------+------------+--------------------+--------------------+-----------+------------+-------------+---------------+---------------+------------------+-------------+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------
             250 |            189 |         | step1            | 2014-02-16 13:55:00.641 | 2014-02-16 13:55:00.642 | COMPLETED   | COMPLETED  |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                                                                                                                                                                      | 
             251 |            189 |         | step2            | 2014-02-16 13:55:00.644 | 2014-02-16 13:55:00.758 | COMPLETED   | COMPLETED  |                    |                    |         9 |          9 |           4 |             0 |             1 |                0 |           0 |              0 | \xaced0005737200116a6176612e6c616e672e496e746567657212e2a0a4f781873802000149000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b02000078700000000a | \xaced0005737200116a6176612e6c616e672e496e746567657212e2a0a4f781873802000149000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b020000787000000003
             252 |            189 |         | step4_SKIP_FOUND | 2014-02-16 13:55:00.762 | 2014-02-16 13:55:00.763 | COMPLETED   | COMPLETED  |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                                                                                                                                                                      | 
(3 rows)

jbatch=# 
  • Decider#decide()に渡されるStepExecutionは、基本的に遷移元Stepのものだけのようだ

Splitからの遷移の場合

資源

仕様

  • 第一レベルの要素は以下
    1. split1 (split)
    2. split1decision (decision)
  • split1の下には同じようなflowが3つある
    • flowの下にはstep (batchlet) が2つ
  • decisionの後の分岐とスキップはもう試したので省略

テストを動かしてみる

ログ

13:42:04,217 FINE  [org.nailedtothex.jbatch.example.decision.NopBatchlet] (batch-batch - 3) flow3-step1
13:42:04,217 FINE  [org.nailedtothex.jbatch.example.decision.NopBatchlet] (batch-batch - 6) flow1-step1
13:42:04,217 FINE  [org.nailedtothex.jbatch.example.decision.NopBatchlet] (batch-batch - 2) flow2-step1
13:42:04,221 FINE  [org.nailedtothex.jbatch.example.split.SleepBatchlet] (batch-batch - 2) entering process(): stepName=flow2-step2, sleepInMills=2,000
13:42:04,221 FINE  [org.nailedtothex.jbatch.example.split.SleepBatchlet] (batch-batch - 3) entering process(): stepName=flow3-step2, sleepInMills=3,000
13:42:04,221 FINE  [org.nailedtothex.jbatch.example.split.SleepBatchlet] (batch-batch - 6) entering process(): stepName=flow1-step2, sleepInMills=1,000
13:42:05,222 FINE  [org.nailedtothex.jbatch.example.split.SleepBatchlet] (batch-batch - 6)  exiting process(): stepName=flow1-step2, sleepInMills=1,000
13:42:06,222 FINE  [org.nailedtothex.jbatch.example.split.SleepBatchlet] (batch-batch - 2)  exiting process(): stepName=flow2-step2, sleepInMills=2,000
13:42:07,222 FINE  [org.nailedtothex.jbatch.example.split.SleepBatchlet] (batch-batch - 3)  exiting process(): stepName=flow3-step2, sleepInMills=3,000
13:42:07,225 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): executions=3
13:42:07,226 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): stepName=flow1-step2, stepExecutionId=243
13:42:07,226 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: WRITE_SKIP_COUNT=0
13:42:07,226 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: PROCESS_SKIP_COUNT=0
13:42:07,226 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: WRITE_COUNT=0
13:42:07,226 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: COMMIT_COUNT=0
13:42:07,226 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: READ_SKIP_COUNT=0
13:42:07,226 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: ROLLBACK_COUNT=0
13:42:07,226 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: FILTER_COUNT=0
13:42:07,227 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: READ_COUNT=0
13:42:07,227 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): stepName=flow2-step2, stepExecutionId=242
13:42:07,227 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: WRITE_SKIP_COUNT=0
13:42:07,227 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: PROCESS_SKIP_COUNT=0
13:42:07,227 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: WRITE_COUNT=0
13:42:07,227 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: COMMIT_COUNT=0
13:42:07,227 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: READ_SKIP_COUNT=0
13:42:07,227 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: ROLLBACK_COUNT=0
13:42:07,227 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: FILTER_COUNT=0
13:42:07,227 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: READ_COUNT=0
13:42:07,227 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): stepName=flow3-step2, stepExecutionId=244
13:42:07,228 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: WRITE_SKIP_COUNT=0
13:42:07,228 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: PROCESS_SKIP_COUNT=0
13:42:07,228 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: WRITE_COUNT=0
13:42:07,228 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: COMMIT_COUNT=0
13:42:07,228 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: READ_SKIP_COUNT=0
13:42:07,228 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: ROLLBACK_COUNT=0
13:42:07,228 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: FILTER_COUNT=0
13:42:07,228 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): metric: READ_COUNT=0
13:42:07,228 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 10) decide(): exitStatus=SKIP_NOT_FOUND
  • 遷移元がSplitの場合、Splitの子Flowの数だけStepExecutionが渡される(Flowの最後の要素のStepExecution)。だから配列なのか。なるほどね

Repository

job_execution
jbatch=# select * from job_execution order by jobexecutionid desc limit 1;
 jobexecutionid | jobinstanceid | version |       createtime        |        starttime        |         endtime         |     lastupdatedtime     | batchstatus |   exitstatus   | jobparameters | restartposition 
----------------+---------------+---------+-------------------------+-------------------------+-------------------------+-------------------------+-------------+----------------+---------------+-----------------
            186 |           174 |         | 2014-02-16 13:42:04.198 | 2014-02-16 13:42:04.198 | 2014-02-16 13:42:07.229 | 2014-02-16 13:42:07.229 | COMPLETED   | SKIP_NOT_FOUND |               | 
(1 row)

jbatch=# 
step_execution
jbatch=# select * from step_execution where jobexecutionid in (186) order by jobexecutionid, stepexecutionid;
 stepexecutionid | jobexecutionid | version |  stepname   |        starttime        |         endtime         | batchstatus | exitstatus | executionexception | persistentuserdata | readcount | writecount | commitcount | rollbackcount | readskipcount | processskipcount | filtercount | writeskipcount | readercheckpointinfo | writercheckpointinfo 
-----------------+----------------+---------+-------------+-------------------------+-------------------------+-------------+------------+--------------------+--------------------+-----------+------------+-------------+---------------+---------------+------------------+-------------+----------------+----------------------+----------------------
             239 |            186 |         | flow1-step1 | 2014-02-16 13:42:04.211 | 2014-02-16 13:42:04.217 | COMPLETED   | COMPLETED  |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                      | 
             240 |            186 |         | flow3-step1 | 2014-02-16 13:42:04.211 | 2014-02-16 13:42:04.217 | COMPLETED   | COMPLETED  |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                      | 
             241 |            186 |         | flow2-step1 | 2014-02-16 13:42:04.211 | 2014-02-16 13:42:04.217 | COMPLETED   | COMPLETED  |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                      | 
             242 |            186 |         | flow2-step2 | 2014-02-16 13:42:04.22  | 2014-02-16 13:42:06.223 | COMPLETED   | SUCCESS    |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                      | 
             243 |            186 |         | flow1-step2 | 2014-02-16 13:42:04.22  | 2014-02-16 13:42:05.223 | COMPLETED   | SUCCESS    |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                      | 
             244 |            186 |         | flow3-step2 | 2014-02-16 13:42:04.22  | 2014-02-16 13:42:07.222 | COMPLETED   | SUCCESS    |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                      | 
(6 rows)

Flowからの遷移の場合

資源

仕様

  • 第一レベルの要素は以下
    1. flow1 (flow)
    2. flowdecision (decision)
  • flow1の下にはstep (batchlet) が2つ

テストを動かしてみる

ログ

13:47:01,234 FINE  [org.nailedtothex.jbatch.example.decision.NopBatchlet] (batch-batch - 6) flow1-step1
13:47:01,237 FINE  [org.nailedtothex.jbatch.example.decision.NopBatchlet] (batch-batch - 6) flow1-step2
13:47:01,239 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 6) decide(): executions=1
13:47:01,239 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 6) decide(): stepName=flow1-step2, stepExecutionId=246
13:47:01,239 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 6) decide(): metric: WRITE_SKIP_COUNT=0
13:47:01,239 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 6) decide(): metric: PROCESS_SKIP_COUNT=0
13:47:01,239 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 6) decide(): metric: WRITE_COUNT=0
13:47:01,240 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 6) decide(): metric: COMMIT_COUNT=0
13:47:01,240 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 6) decide(): metric: READ_SKIP_COUNT=0
13:47:01,240 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 6) decide(): metric: ROLLBACK_COUNT=0
13:47:01,240 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 6) decide(): metric: FILTER_COUNT=0
13:47:01,240 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 6) decide(): metric: READ_COUNT=0
13:47:01,240 FINE  [org.nailedtothex.jbatch.example.decision.MyDecider] (batch-batch - 6) decide(): exitStatus=SKIP_NOT_FOUND

Repository

job_execution
jbatch=# select * from job_execution order by jobexecutionid desc limit 1;
 jobexecutionid | jobinstanceid | version |       createtime        |        starttime        |        endtime         |    lastupdatedtime     | batchstatus |   exitstatus   | jobparameters | restartposition 
----------------+---------------+---------+-------------------------+-------------------------+------------------------+------------------------+-------------+----------------+---------------+-----------------
            187 |           175 |         | 2014-02-16 13:47:01.231 | 2014-02-16 13:47:01.231 | 2014-02-16 13:47:01.24 | 2014-02-16 13:47:01.24 | COMPLETED   | SKIP_NOT_FOUND |               | 
(1 row)
step_execution
jbatch=# select * from step_execution where jobexecutionid in (187) order by jobexecutionid, stepexecutionid;
 stepexecutionid | jobexecutionid | version |  stepname   |        starttime        |         endtime         | batchstatus | exitstatus | executionexception | persistentuserdata | readcount | writecount | commitcount | rollbackcount | readskipcount | processskipcount | filtercount | writeskipcount | readercheckpointinfo | writercheckpointinfo 
-----------------+----------------+---------+-------------+-------------------------+-------------------------+-------------+------------+--------------------+--------------------+-----------+------------+-------------+---------------+---------------+------------------+-------------+----------------+----------------------+----------------------
             245 |            187 |         | flow1-step1 | 2014-02-16 13:47:01.232 | 2014-02-16 13:47:01.234 | COMPLETED   | COMPLETED  |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                      | 
             246 |            187 |         | flow1-step2 | 2014-02-16 13:47:01.236 | 2014-02-16 13:47:01.237 | COMPLETED   | COMPLETED  |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                      | 
(2 rows)

jbatch=# 
  • 遷移元がFlowの場合はFlowの一番最後のStepのStepExecutionだけが渡される

備考

  • Decider#decide()に渡されるStepExecutionは以下のようになる
    • 遷移元がStepの場合: 遷移元StepのStepExecution (配列の要素数は1個)
    • 遷移元がSplitの場合: 遷移元Splitの各子Flowの最後のStepのStepExecution (配列の要素数は複数個)
    • 遷移元がFlowの場合: 遷移元Flowの最後のStepのStepExecution (配列の要素数は1個)

参考文献

  1. JSR-000352 Batch Applications for the Java Platform - Final Release
  2. Decider (Java™ EE 7 Specification APIs)


Splitで並列処理してみる


Posted on Saturday Feb 15, 2014 at 08:19PM in Technology


「Partitioned Chunk Processingで遊ぶ」で使ったPartitionは一つの処理を手分けしてやる仕組みだが、splitは異なる処理を並列で行う仕組み。簡単なバッチを作って遊んでみる。

環境・前提条件

バッチを作ってみる

仕様

  • 一番高レベルの要素は2つ。順番に動く
    1. split0 (Split)
    2. nextOfSplit (Step)
  • split0にはflowが3つある
    • 全てのflowは1つのstepを持つ
    • 使っているartifactは全て同じ。単純なBatchletで、パラメータで与えられたミリ秒数だけThread.sleep()する
    • それぞれ1, 2, 3秒スリープする
  • nextOfSplitは特に何もしない。ちゃんとsplit0内のflowが全部終わってから遷移するか確かめるために置いた

資源

資源はこのへんにまとめて全部ある

動かしてみる

ログ

21:38:24,423 FINE  [org.nailedtothex.jbatch.example.split.SleepBatchlet] (batch-batch - 5) entering process(): stepName=1sec, sleepInMills=1,000
21:38:24,423 FINE  [org.nailedtothex.jbatch.example.split.SleepBatchlet] (batch-batch - 8) entering process(): stepName=3sec, sleepInMills=3,000
21:38:24,422 FINE  [org.nailedtothex.jbatch.example.split.SleepBatchlet] (batch-batch - 7) entering process(): stepName=2sec, sleepInMills=2,000
21:38:25,424 FINE  [org.nailedtothex.jbatch.example.split.SleepBatchlet] (batch-batch - 5)  exiting process(): stepName=1sec, sleepInMills=1,000
21:38:26,423 FINE  [org.nailedtothex.jbatch.example.split.SleepBatchlet] (batch-batch - 7)  exiting process(): stepName=2sec, sleepInMills=2,000
21:38:27,424 FINE  [org.nailedtothex.jbatch.example.split.SleepBatchlet] (batch-batch - 8)  exiting process(): stepName=3sec, sleepInMills=3,000
21:38:27,430 FINE  [org.nailedtothex.jbatch.example.split.SleepBatchlet] (batch-batch - 4) entering process(): stepName=nextOfSplit, sleepInMills=null
21:38:27,430 FINE  [org.nailedtothex.jbatch.example.split.SleepBatchlet] (batch-batch - 4)  exiting process(): stepName=nextOfSplit, sleepInMills=null

Repository

job_execution

jbatch=# select * from job_execution order by jobexecutionid desc limit 1;
 jobexecutionid | jobinstanceid | version |       createtime        |        starttime        |         endtime         |     lastupdatedtime     | batchstatus | exitstatus | jobparameters | restartposition 
----------------+---------------+---------+-------------------------+-------------------------+-------------------------+-------------------------+-------------+------------+---------------+-----------------
            129 |           124 |         | 2014-02-15 21:38:24.415 | 2014-02-15 21:38:24.415 | 2014-02-15 21:38:27.433 | 2014-02-15 21:38:27.433 | COMPLETED   | COMPLETED  |               | 
(1 row)

step_execution

jbatch=# select * from step_execution where jobexecutionid =129 order by stepexecutionid;
 stepexecutionid | jobexecutionid | version |  stepname   |        starttime        |         endtime         | batchstatus | exitstatus | executionexception | persistentuserdata | readcount | writecount | commitcount | rollbackcount | readskipcount | processskipcount | filtercount | writeskipcount | readercheckpointinfo | writercheckpointinfo 
-----------------+----------------+---------+-------------+-------------------------+-------------------------+-------------+------------+--------------------+--------------------+-----------+------------+-------------+---------------+---------------+------------------+-------------+----------------+----------------------+----------------------
             147 |            129 |         | 1sec        | 2014-02-15 21:38:24.42  | 2014-02-15 21:38:25.424 | COMPLETED   | SUCCESS    |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                      | 
             148 |            129 |         | 2sec        | 2014-02-15 21:38:24.42  | 2014-02-15 21:38:26.424 | COMPLETED   | SUCCESS    |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                      | 
             149 |            129 |         | 3sec        | 2014-02-15 21:38:24.42  | 2014-02-15 21:38:27.424 | COMPLETED   | SUCCESS    |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                      | 
             150 |            129 |         | nextOfSplit | 2014-02-15 21:38:27.428 | 2014-02-15 21:38:27.431 | COMPLETED   | SUCCESS    |                    |                    |         0 |          0 |           0 |             0 |             0 |                0 |           0 |              0 |                      | 
(4 rows)

備考

  • ちゃんとパラで走っているみたい
  • [1]によると、いずれかのFlowが死ぬと、親のSplitも死ぬ
  • Flowは複数のStepを1つにまとめる場合に使う。うまく使うとStep間の遷移をすっきり表現できる気がする。Splitの子要素として以外でも使えるようだ

参考文献

  1. JSR-000352 Batch Applications for the Java Platform - Final Release


GitHubから取ってきたJavaの資源をビルドしてみる


Posted on Saturday Feb 15, 2014 at 01:22PM in Technology


jBeret (JSR352の実装) をGitHubから取ってきてjarファイルを作り、WildFlyに配置する手順のメモ

環境

  • Maven 3.1.1
  • Oracle JDK7u51
  • OS X 10.9.1

GitHubから取ってくる

kyle-no-MacBook:src kyle$ git clone git@github.com:jberet/jsr352.git
Cloning into 'jsr352'...
remote: Reusing existing pack: 7898, done.
remote: Counting objects: 179, done.
remote: Compressing objects: 100% (122/122), done.
remote: Total 8077 (delta 47), reused 0 (delta 0)
Receiving objects: 100% (8077/8077), 1.80 MiB | 118.00 KiB/s, done.
Resolving deltas: 100% (2712/2712), done.
Checking connectivity... done
kyle-no-MacBook:src kyle$ ls -ld jsr352
drwxr-xr-x+ 13 kyle  staff  442  2 15 08:58 jsr352
kyle-no-MacBook:src kyle$ ls -l jsr352
total 40
-rw-r--r--+  1 kyle  staff     83  2 15 08:58 README.md
drwxr-xr-x+  5 kyle  staff    170  2 15 09:03 jberet-core
drwxr-xr-x+  4 kyle  staff    136  2 15 08:58 jberet-distribution
drwxr-xr-x+  4 kyle  staff    136  2 15 08:58 jberet-jpa-repository
drwxr-xr-x+  4 kyle  staff    136  2 15 08:58 jberet-se
drwxr-xr-x+  4 kyle  staff    136  2 15 08:58 jberet-support
-rw-r--r--+  1 kyle  staff  12560  2 15 08:58 pom.xml
drwxr-xr-x+  5 kyle  staff    170  2 15 08:58 tck-porting-impl
drwxr-xr-x+ 13 kyle  staff    442  2 15 08:58 test-apps
kyle-no-MacBook:src kyle$ 

ビルド

kyle-no-MacBook:jberet-core kyle$ mvn clean compile jar:jar
Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building jberet-core 1.0.1.Beta-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jberet-core ---
[INFO] 
[INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-java-version) @ jberet-core ---
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-10/doxia-sink-api-1.0-alpha-10.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.jar
[WARNING] Checksum validation failed, no checksums available from the repository for http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.jar
Downloaded: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.jar (10 KB at 5.1 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-10/doxia-sink-api-1.0-alpha-10.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-10/doxia-sink-api-1.0-alpha-10.jar (10 KB at 11.7 KB/sec)
[INFO] 
[INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-maven-version) @ jberet-core ---
[INFO] 
[INFO] --- buildnumber-maven-plugin:1.2:create-timestamp (get-build-timestamp) @ jberet-core ---
Downloading: http://repository.jboss.org/nexus/content/groups/public/junit/junit/4.10/junit-4.10.pom
[WARNING] Checksum validation failed, no checksums available from the repository for http://repository.jboss.org/nexus/content/groups/public/junit/junit/4.10/junit-4.10.pom
Downloaded: http://repository.jboss.org/nexus/content/groups/public/junit/junit/4.10/junit-4.10.pom (3 KB at 2.1 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.pom
[WARNING] Checksum validation failed, no checksums available from the repository for http://repository.jboss.org/nexus/content/groups/public/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.pom
Downloaded: http://repository.jboss.org/nexus/content/groups/public/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.pom (481 B at 0.4 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/maven-plugin-api/2.0.1/maven-plugin-api-2.0.1.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.1/maven-plugin-api-2.0.1.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.1/maven-plugin-api-2.0.1.pom (643 B at 2.3 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/maven/2.0.1/maven-2.0.1.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0.1/maven-2.0.1.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0.1/maven-2.0.1.pom (12 KB at 38.9 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-api/1.8/maven-scm-api-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-api/1.8/maven-scm-api-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-api/1.8/maven-scm-api-1.8.pom (2 KB at 5.5 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm/1.8/maven-scm-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm/1.8/maven-scm-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm/1.8/maven-scm-1.8.pom (21 KB at 54.2 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.0.3/plexus-utils-3.0.3.pom
Downloaded: http://repository.jboss.org/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.0.3/plexus-utils-3.0.3.pom (3 KB at 3.6 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-manager-plexus/1.8/maven-scm-manager-plexus-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-manager-plexus/1.8/maven-scm-manager-plexus-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-manager-plexus/1.8/maven-scm-manager-plexus-1.8.pom (3 KB at 8.3 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-managers/1.8/maven-scm-managers-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-managers/1.8/maven-scm-managers-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-managers/1.8/maven-scm-managers-1.8.pom (2 KB at 5.8 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-bazaar/1.8/maven-scm-provider-bazaar-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-bazaar/1.8/maven-scm-provider-bazaar-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-bazaar/1.8/maven-scm-provider-bazaar-1.8.pom (3 KB at 8.0 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-providers/1.8/maven-scm-providers-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-providers/1.8/maven-scm-providers-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-providers/1.8/maven-scm-providers-1.8.pom (4 KB at 14.4 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/regexp/regexp/1.3/regexp-1.3.pom
[WARNING] Checksum validation failed, no checksums available from the repository for http://repository.jboss.org/nexus/content/groups/public/regexp/regexp/1.3/regexp-1.3.pom
Downloaded: http://repository.jboss.org/nexus/content/groups/public/regexp/regexp/1.3/regexp-1.3.pom (145 B at 0.1 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-svnexe/1.8/maven-scm-provider-svnexe-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-svnexe/1.8/maven-scm-provider-svnexe-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-svnexe/1.8/maven-scm-provider-svnexe-1.8.pom (3 KB at 9.4 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-providers-svn/1.8/maven-scm-providers-svn-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-providers-svn/1.8/maven-scm-providers-svn-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-providers-svn/1.8/maven-scm-providers-svn-1.8.pom (3 KB at 6.9 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-svn-commons/1.8/maven-scm-provider-svn-commons-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-svn-commons/1.8/maven-scm-provider-svn-commons-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-svn-commons/1.8/maven-scm-provider-svn-commons-1.8.pom (3 KB at 10.3 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-gitexe/1.8/maven-scm-provider-gitexe-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-gitexe/1.8/maven-scm-provider-gitexe-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-gitexe/1.8/maven-scm-provider-gitexe-1.8.pom (3 KB at 8.7 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-providers-git/1.8/maven-scm-providers-git-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-providers-git/1.8/maven-scm-providers-git-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-providers-git/1.8/maven-scm-providers-git-1.8.pom (3 KB at 8.5 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-git-commons/1.8/maven-scm-provider-git-commons-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-git-commons/1.8/maven-scm-provider-git-commons-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-git-commons/1.8/maven-scm-provider-git-commons-1.8.pom (3 KB at 7.3 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-cvsexe/1.8/maven-scm-provider-cvsexe-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-cvsexe/1.8/maven-scm-provider-cvsexe-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-cvsexe/1.8/maven-scm-provider-cvsexe-1.8.pom (3 KB at 8.3 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-providers-cvs/1.8/maven-scm-providers-cvs-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-providers-cvs/1.8/maven-scm-providers-cvs-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-providers-cvs/1.8/maven-scm-providers-cvs-1.8.pom (2 KB at 6.6 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-cvs-commons/1.8/maven-scm-provider-cvs-commons-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-cvs-commons/1.8/maven-scm-provider-cvs-commons-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-cvs-commons/1.8/maven-scm-provider-cvs-commons-1.8.pom (3 KB at 8.2 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-starteam/1.8/maven-scm-provider-starteam-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-starteam/1.8/maven-scm-provider-starteam-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-starteam/1.8/maven-scm-provider-starteam-1.8.pom (3 KB at 8.5 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-clearcase/1.8/maven-scm-provider-clearcase-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-clearcase/1.8/maven-scm-provider-clearcase-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-clearcase/1.8/maven-scm-provider-clearcase-1.8.pom (3 KB at 9.6 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-perforce/1.8/maven-scm-provider-perforce-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-perforce/1.8/maven-scm-provider-perforce-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-perforce/1.8/maven-scm-provider-perforce-1.8.pom (3 KB at 9.6 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-hg/1.8/maven-scm-provider-hg-1.8.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-hg/1.8/maven-scm-provider-hg-1.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-hg/1.8/maven-scm-provider-hg-1.8.pom (3 KB at 8.6 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/com/google/code/maven-scm-provider-svnjava/maven-scm-provider-svnjava/1.13/maven-scm-provider-svnjava-1.13.pom
Downloading: http://repo.maven.apache.org/maven2/com/google/code/maven-scm-provider-svnjava/maven-scm-provider-svnjava/1.13/maven-scm-provider-svnjava-1.13.pom
Downloaded: http://repo.maven.apache.org/maven2/com/google/code/maven-scm-provider-svnjava/maven-scm-provider-svnjava/1.13/maven-scm-provider-svnjava-1.13.pom (10 KB at 31.4 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/sonatype/oss/oss-parent/5/oss-parent-5.pom
Downloaded: http://repository.jboss.org/nexus/content/groups/public/org/sonatype/oss/oss-parent/5/oss-parent-5.pom (4 KB at 4.6 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-svn-commons/1.5/maven-scm-provider-svn-commons-1.5.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-svn-commons/1.5/maven-scm-provider-svn-commons-1.5.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-svn-commons/1.5/maven-scm-provider-svn-commons-1.5.pom (3 KB at 7.9 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-providers-svn/1.5/maven-scm-providers-svn-1.5.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-providers-svn/1.5/maven-scm-providers-svn-1.5.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-providers-svn/1.5/maven-scm-providers-svn-1.5.pom (3 KB at 8.0 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-providers/1.5/maven-scm-providers-1.5.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-providers/1.5/maven-scm-providers-1.5.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-providers/1.5/maven-scm-providers-1.5.pom (4 KB at 13.9 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm/1.5/maven-scm-1.5.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm/1.5/maven-scm-1.5.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm/1.5/maven-scm-1.5.pom (15 KB at 56.5 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-api/1.5/maven-scm-api-1.5.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-api/1.5/maven-scm-api-1.5.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-api/1.5/maven-scm-api-1.5.pom (2 KB at 5.4 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/net/java/dev/jna/jna/3.2.2/jna-3.2.2.pom
Downloading: http://repo.maven.apache.org/maven2/net/java/dev/jna/jna/3.2.2/jna-3.2.2.pom
Downloaded: http://repo.maven.apache.org/maven2/net/java/dev/jna/jna/3.2.2/jna-3.2.2.pom (2 KB at 5.7 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/tmatesoft/svnkit/svnkit/1.3.5/svnkit-1.3.5.pom
Downloading: http://repo.maven.apache.org/maven2/org/tmatesoft/svnkit/svnkit/1.3.5/svnkit-1.3.5.pom
Downloaded: http://repo.maven.apache.org/maven2/org/tmatesoft/svnkit/svnkit/1.3.5/svnkit-1.3.5.pom (2 KB at 4.2 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/tmatesoft/svnkit/trilead-ssh2/build213-svnkit-1.3-patch/trilead-ssh2-build213-svnkit-1.3-patch.pom
Downloading: http://repo.maven.apache.org/maven2/org/tmatesoft/svnkit/trilead-ssh2/build213-svnkit-1.3-patch/trilead-ssh2-build213-svnkit-1.3-patch.pom
Downloaded: http://repo.maven.apache.org/maven2/org/tmatesoft/svnkit/trilead-ssh2/build213-svnkit-1.3-patch/trilead-ssh2-build213-svnkit-1.3-patch.pom (725 B at 2.5 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/tmatesoft/sqljet/sqljet/1.0.4/sqljet-1.0.4.pom
Downloading: http://repo.maven.apache.org/maven2/org/tmatesoft/sqljet/sqljet/1.0.4/sqljet-1.0.4.pom
Downloaded: http://repo.maven.apache.org/maven2/org/tmatesoft/sqljet/sqljet/1.0.4/sqljet-1.0.4.pom (771 B at 2.5 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/antlr/antlr-runtime/3.1.3/antlr-runtime-3.1.3.pom
Downloading: http://repo.maven.apache.org/maven2/org/antlr/antlr-runtime/3.1.3/antlr-runtime-3.1.3.pom
Downloaded: http://repo.maven.apache.org/maven2/org/antlr/antlr-runtime/3.1.3/antlr-runtime-3.1.3.pom (4 KB at 13.4 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/antlr/antlr-master/3.1.3/antlr-master-3.1.3.pom
Downloading: http://repo.maven.apache.org/maven2/org/antlr/antlr-master/3.1.3/antlr-master-3.1.3.pom
Downloaded: http://repo.maven.apache.org/maven2/org/antlr/antlr-master/3.1.3/antlr-master-3.1.3.pom (9 KB at 32.4 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/antlr/stringtemplate/3.2/stringtemplate-3.2.pom
Downloading: http://repo.maven.apache.org/maven2/org/antlr/stringtemplate/3.2/stringtemplate-3.2.pom
Downloaded: http://repo.maven.apache.org/maven2/org/antlr/stringtemplate/3.2/stringtemplate-3.2.pom (2 KB at 7.0 KB/sec)
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-api/1.8/maven-scm-api-1.8.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-manager-plexus/1.8/maven-scm-manager-plexus-1.8.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-bazaar/1.8/maven-scm-provider-bazaar-1.8.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/regexp/regexp/1.3/regexp-1.3.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-svnexe/1.8/maven-scm-provider-svnexe-1.8.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-gitexe/1.8/maven-scm-provider-gitexe-1.8.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-git-commons/1.8/maven-scm-provider-git-commons-1.8.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-svn-commons/1.8/maven-scm-provider-svn-commons-1.8.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-cvsexe/1.8/maven-scm-provider-cvsexe-1.8.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-cvs-commons/1.8/maven-scm-provider-cvs-commons-1.8.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-starteam/1.8/maven-scm-provider-starteam-1.8.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-clearcase/1.8/maven-scm-provider-clearcase-1.8.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-perforce/1.8/maven-scm-provider-perforce-1.8.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/scm/maven-scm-provider-hg/1.8/maven-scm-provider-hg-1.8.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/com/google/code/maven-scm-provider-svnjava/maven-scm-provider-svnjava/1.13/maven-scm-provider-svnjava-1.13.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/tmatesoft/svnkit/svnkit/1.3.5/svnkit-1.3.5.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/tmatesoft/svnkit/trilead-ssh2/build213-svnkit-1.3-patch/trilead-ssh2-build213-svnkit-1.3-patch.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/tmatesoft/sqljet/sqljet/1.0.4/sqljet-1.0.4.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/antlr/antlr-runtime/3.1.3/antlr-runtime-3.1.3.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/org/antlr/stringtemplate/3.2/stringtemplate-3.2.jar
Downloading: http://repository.jboss.org/nexus/content/groups/public/net/java/dev/jna/jna/3.2.2/jna-3.2.2.jar
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-api/1.8/maven-scm-api-1.8.jar
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-manager-plexus/1.8/maven-scm-manager-plexus-1.8.jar
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-bazaar/1.8/maven-scm-provider-bazaar-1.8.jar
Downloading: http://repo.maven.apache.org/maven2/regexp/regexp/1.3/regexp-1.3.jar
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-svnexe/1.8/maven-scm-provider-svnexe-1.8.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-api/1.8/maven-scm-api-1.8.jar (103 KB at 151.7 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-gitexe/1.8/maven-scm-provider-gitexe-1.8.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-manager-plexus/1.8/maven-scm-manager-plexus-1.8.jar (11 KB at 12.2 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-git-commons/1.8/maven-scm-provider-git-commons-1.8.jar
Downloaded: http://repo.maven.apache.org/maven2/regexp/regexp/1.3/regexp-1.3.jar (25 KB at 25.1 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-svn-commons/1.8/maven-scm-provider-svn-commons-1.8.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-gitexe/1.8/maven-scm-provider-gitexe-1.8.jar (62 KB at 149.8 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-cvsexe/1.8/maven-scm-provider-cvsexe-1.8.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-svnexe/1.8/maven-scm-provider-svnexe-1.8.jar (75 KB at 61.6 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-cvs-commons/1.8/maven-scm-provider-cvs-commons-1.8.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-bazaar/1.8/maven-scm-provider-bazaar-1.8.jar (54 KB at 42.2 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-starteam/1.8/maven-scm-provider-starteam-1.8.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-cvsexe/1.8/maven-scm-provider-cvsexe-1.8.jar (30 KB at 99.1 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-clearcase/1.8/maven-scm-provider-clearcase-1.8.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-git-commons/1.8/maven-scm-provider-git-commons-1.8.jar (37 KB at 61.4 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-svn-commons/1.8/maven-scm-provider-svn-commons-1.8.jar (40 KB at 86.1 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-perforce/1.8/maven-scm-provider-perforce-1.8.jar
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-hg/1.8/maven-scm-provider-hg-1.8.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-cvs-commons/1.8/maven-scm-provider-cvs-commons-1.8.jar (79 KB at 141.8 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/com/google/code/maven-scm-provider-svnjava/maven-scm-provider-svnjava/1.13/maven-scm-provider-svnjava-1.13.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-clearcase/1.8/maven-scm-provider-clearcase-1.8.jar (70 KB at 163.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/tmatesoft/svnkit/svnkit/1.3.5/svnkit-1.3.5.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-starteam/1.8/maven-scm-provider-starteam-1.8.jar (73 KB at 122.2 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/tmatesoft/svnkit/trilead-ssh2/build213-svnkit-1.3-patch/trilead-ssh2-build213-svnkit-1.3-patch.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-perforce/1.8/maven-scm-provider-perforce-1.8.jar (80 KB at 120.8 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/tmatesoft/sqljet/sqljet/1.0.4/sqljet-1.0.4.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/scm/maven-scm-provider-hg/1.8/maven-scm-provider-hg-1.8.jar (65 KB at 97.7 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/antlr/antlr-runtime/3.1.3/antlr-runtime-3.1.3.jar
Downloaded: http://repo.maven.apache.org/maven2/com/google/code/maven-scm-provider-svnjava/maven-scm-provider-svnjava/1.13/maven-scm-provider-svnjava-1.13.jar (51 KB at 114.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/antlr/stringtemplate/3.2/stringtemplate-3.2.jar
Downloaded: http://repo.maven.apache.org/maven2/org/tmatesoft/svnkit/trilead-ssh2/build213-svnkit-1.3-patch/trilead-ssh2-build213-svnkit-1.3-patch.jar (246 KB at 262.5 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/net/java/dev/jna/jna/3.2.2/jna-3.2.2.jar
Downloaded: http://repo.maven.apache.org/maven2/org/antlr/antlr-runtime/3.1.3/antlr-runtime-3.1.3.jar (148 KB at 191.0 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/antlr/stringtemplate/3.2/stringtemplate-3.2.jar (168 KB at 236.3 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/net/java/dev/jna/jna/3.2.2/jna-3.2.2.jar (839 KB at 450.2 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/tmatesoft/svnkit/svnkit/1.3.5/svnkit-1.3.5.jar (1845 KB at 414.9 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/tmatesoft/sqljet/sqljet/1.0.4/sqljet-1.0.4.jar (727 KB at 166.2 KB/sec)
[INFO] 
[INFO] --- buildnumber-maven-plugin:1.2:create (get-scm-revision) @ jberet-core ---
[INFO] Checking for local modifications: skipped.
[INFO] Updating project files from SCM: skipped.
[INFO] Executing: /bin/sh -c cd /Users/kyle/src/jsr352/jberet-core && git rev-parse --verify HEAD
[INFO] Working directory: /Users/kyle/src/jsr352/jberet-core
[INFO] Storing buildNumber: 70bfa6de5c01f000de0ca1772f7639f956289c76 at timestamp: 1392422639073
[INFO] Executing: /bin/sh -c cd /Users/kyle/src/jsr352/jberet-core && git rev-parse --verify HEAD
[INFO] Working directory: /Users/kyle/src/jsr352/jberet-core
[INFO] Storing buildScmBranch: UNKNOWN
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jberet-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 14 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ jberet-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 61 source files to /Users/kyle/src/jsr352/jberet-core/target/classes
[WARNING] ブートストラップ・クラスパスが-source 1.6と一緒に設定されていません
[WARNING] 次のオプションはどのプロセッサでも認識されませんでした: '[org.jboss.logging.tools.level]'
[WARNING] /Users/kyle/src/jsr352/jberet-core/src/main/java/org/jberet/runtime/runner/JobExecutionRunner.java:[74,38] 最終パラメータの不正確な引数型を持った可変引数メソッドの非可変引数呼出し。
  可変引数呼出しに関してはjava.lang.Objectにキャストします。
  非可変引数呼出しに関してはjava.lang.Object[]にキャストしてこの警告を出さないようにします
[WARNING] /Users/kyle/src/jsr352/jberet-core/src/main/java/org/jberet/runtime/context/JobContextImpl.java: 入力ファイルの操作のうち、未チェックまたは安全ではないものがあります。
[WARNING] /Users/kyle/src/jsr352/jberet-core/src/main/java/org/jberet/runtime/context/JobContextImpl.java: 詳細は、-Xlint:uncheckedオプションを指定して再コンパイルしてください。
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-cli) @ jberet-core ---
[INFO] Building jar: /Users/kyle/src/jsr352/jberet-core/target/jberet-core-1.0.1.Beta-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 54.764s
[INFO] Finished at: Sat Feb 15 09:04:02 JST 2014
[INFO] Final Memory: 19M/310M
[INFO] ------------------------------------------------------------------------
kyle-no-MacBook:main kyle$ ls -l  /Users/kyle/src/jsr352/jberet-core/target/jberet-core-1.0.1.Beta-SNAPSHOT.jar
-rw-r--r--+ 1 kyle  staff  185155  2 15 09:04 /Users/kyle/src/jsr352/jberet-core/target/jberet-core-1.0.1.Beta-SNAPSHOT.jar
kyle-no-MacBook:main kyle$ 

よくわからないけどMavenが自動的に依存関係のあるライブラリを集めてきてくれて、ビルドが走りめでたくjarファイルができました

然るべき場所に配置

  1. $WILDFLY_HOME/modules/system/layers/base/org/jberet/jberet-core/mainにjarファイルを配置
  2. 同じディレクトリにあるmodule.xmlを書き換える。こんな感じ。書き換えたら再起動
<module xmlns="urn:jboss:module:1.1" name="org.jberet.jberet-core">
    <properties>
        <property name="jboss.api" value="private"/>
    </properties>

    <resources>
        <resource-root path="jberet-core-1.0.1.Beta-SNAPSHOT.jar"/>
        <!-- Insert resources here -->
    </resources>

    <dependencies>
        <module name="javax.api"/>
        <module name="javaee.api"/>
        <module name="javax.transaction.api"/>
        <module name="org.jboss.jts"/>
        <module name="org.jboss.marshalling"/>
        <module name="org.jboss.logging"/>
        <module name="com.h2database.h2" optional="true"/>
        <module name="com.google.guava"/>
    </dependencies>
</module>