Forums: Open Discussion (Thread #20733)

【バッチFW】csvFileQueryDAOによるパーティションキーの取得 (2008-11-26 16:03 by Anonymous #40205)

<bean id="partitionkeyCollector" parent="fileChunkCollector">
<property name="fileQueryDao" ref="csvFileQueryDAO" />
<property name="inputFileName" value="D:/tmp/batch001/commodity3.txt" />
<property name="resultClass"><bean class="test.Commodity" /></property>
<property name="readNextLine" value="true" />
</bean>

ジョブBean定義ファイルにて、上記のようにCSVファイルからパーティションキーを取得する処理を定義した場合、分割ジョブが実行されないようです。

fileChunkCollectorでなく、listPropertyPartitionKeyCollectorの場合は、
分割ジョブは実行されます。

ジョブBean定義ファイルの設定方法に誤りがあれば、教えてください。

Reply to #40205×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】csvFileQueryDAOによるパーティションキーの取得 (2008-11-26 17:45 by Anonymous #40212)

なお、CSVファイルだけでなく、可変長/固定長ファイルについても同様に、分割ジョブが実行されないようです。
Reply to #40205

Reply to #40212×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】各種Collectorによるパーティションキーの取得 (2008-11-27 12:21 by Anonymous #40242)

stringArrayPropertyCollectorを使用した場合も、分割ジョブが実行されないようです。

機能説明書のp.89の“分割ジョブで使用できる Collector のデフォルト実装”の表によると、親ジョブでは、すべてのCollectorが使えるとあります。
ジョブBean定義ファイルの書き方を教えてください。

以下、こちらのまとめです。

【分割ジョブが実行されるCollector】
・IBatisDbPartitionKeyCollector
・listPropertyPartitionKeyCollector

【分割ジョブが実行されないCollector】
・stringArrayPropertyCollector
・fileChunkCollector(CSV/可変長/固定長すべて)
Reply to #40205

Reply to #40242×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】各種Collectorによるパーティションキーの取得 (2008-11-27 20:22 by kuramotoki #40274)

分割ジョブを行う場合には、分割キーの取得とデータ取得の2つのコレクタが必要に
なります。
DB,リストプロパティ,文字配列プロパティ、ファイルの各コレクタは、
FrameworkBean.xmlに以下のように定義されています。
<分割キー用>
・IBatisDbPartitionKeyCollector
・listPropertyPartitionKeyCollector
・stringArrayPropertyPartitionKeyCollector
・filePartitionKeyCollector
<データ取得用>
・IBatisDbChunkCollector
・listPropertyChunkCollector
・stringArrayPropertyChunkCollector
・fileChunkCollector

JobContext#getChildJobContext()をoverrideしていない場合は、
分割キー用コレクタで取得した分割キーは、partitionKeyがString型のためString型
にキャスト可能である必要があります。
String型以外を利用した場合は、ジョブコンテキストに使用する型の分割キー用
フィールドを用意し、JobContext#getChildJobContext()をoverrideして、用意した
フィールドに取得した値を設定するようにしてください。

ジョブBean定義ファイルの設定例は以下のようになります。
<!-- 分割キー用のコレクタ設定 (ファイルを利用) -->
<bean id="partitionkeyCollector" parent="filePartitionKeyCollector">
<property name="fileQueryDao" ref="csvFileQueryDAO" />
<property name="inputFileName" value="D:/tmp/batch001/commodity3.txt"/>
<property name="resultClass"><bean class="test.Commodity"/></property>
<property name="readNextLine" value="true" />
</bean>

<!-- 対象データ取得用コレクタ (DB) -->
<bean id="collector" parent="IBatisDbChunkCollector">
<property name="sql" value="test.sample001" />
</bean>

以上、よろしくお願いいたします。
Reply to #40242

Reply to #40274×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】csvFileQueryDAOによるパーティションキーの取得 (2008-12-01 19:41 by Anonymous #40351)

ありがとうございます。解決しました。

機能説明書をかなり熟読したにも関わらず、分割キー用とデータ取得用にそれぞれ別のBean定義を使うことに気がつきませんでした。

機能説明書の改善を望みます。
Reply to #40205

Reply to #40351×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】csvFileQueryDAOによるパーティションキーの取得 (2008-12-03 17:21 by kuramotoki #40410)

本件については、提供させていただいている
機能説明書の解説が不十分だと認識しておりますので、
今後改善させていただきたいと思います。
以上、よろしくお願いいたします。
Reply to #40351

Reply to #40410×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login