Skip to content
This repository was archived by the owner on Jan 25, 2019. It is now read-only.

Commit f35f108

Browse files
author
alfredo-toledano
committed
doc(batch): add commentaries
1 parent 6eeab97 commit f35f108

5 files changed

Lines changed: 36 additions & 3 deletions

File tree

batch/phonebilling/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@
1717
* business processing part
1818
* apply business logic 1 by 1 -- TODO: How to check --
1919
* checkpoints -- TODO: How to check --
20+
* batch artifacts
21+
* Check 'phonebilling.xml'

batch/phonebilling/src/main/webapp/WEB-INF/classes/META-INF/batch-jobs/phonebilling.xml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,33 @@
55
<property name="airtime_price" value="0.08"/>
66
<property name="tax_rate" value="0.07"/>
77
</properties>
8+
9+
<!-- Chunk-oriented step -->
810
<step id="callrecords" next="bills">
11+
<!-- next define execution order of the steps -->
912
<chunk checkpoint-policy="item" item-count="10">
1013
<reader ref="CallRecordReader"></reader> <!-- input retrieval part -->
1114
<processor ref="CallRecordProcessor"></processor> <!-- business processing part -->
1215
<writer ref="CallRecordWriter"></writer> <!-- output writing part -->
1316
</chunk>
1417
</step>
18+
19+
<!-- Chunk-oriented step -->
1520
<step id="bills">
1621
<chunk checkpoint-policy="item" item-count="2">
1722
<reader ref="BillReader">
1823
<properties>
1924
<property name="firstItem" value="#{partitionPlan['firstItem']}"/>
2025
<property name="numItems" value="#{partitionPlan['numItems']}"/>
2126
</properties>
22-
</reader>
23-
<processor ref="BillProcessor"></processor>
24-
<writer ref="BillWriter"></writer>
27+
</reader> <!-- batch artifact -->
28+
<processor ref="BillProcessor"></processor> <!-- batch artifact -->
29+
<writer ref="BillWriter"></writer> <!-- batch artifact -->
2530
</chunk>
2631
<partition>
2732
<mapper ref="BillPartitionMapper"/>
2833
</partition>
2934
<end on="COMPLETED"/>
35+
<!-- end define last step of the job -->
3036
</step>
3137
</job>

batch/simple/src/main/webapp/WEB-INF/classes/META-INF/batch-jobs/simple.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@
55
<property name="input_file" value="input.txt"/>
66
<property name="output_file" value="output.txt"/>
77
</properties>
8+
9+
<!-- Chunk-oriented step -->
810
<step id="mychunk" next="mytask">
11+
<!-- next define execution order of the steps -->
912
<chunk>
1013
<reader ref="MyReader"></reader>
1114
<processor ref="MyProcessor"></processor>
1215
<writer ref="MyWriter"></writer>
1316
</chunk>
1417
</step>
18+
19+
<!-- Task-oriented step -->
1520
<step id="mytask">
1621
<batchlet ref="MyBatchlet"></batchlet>
1722
<end on="COMPLETED"/>
23+
<!-- end define last step of the job -->
1824
</step>
1925
</job>

batch/webserverlog/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Structure
2+
*
3+
4+
# How to run locally?
5+
* `mvn package`
6+
* set up a glassfish server
7+
* [Example video1](https://www.youtube.com/watch?v=AJxBg90HM4s)
8+
* [Example video2](https://www.youtube.com/watch?v=Z0fB4Mkmi3A)
9+
* run the glassfish server adding 'hello2.war'
10+
* Open in your browser 'localhost:8080' to check that it shows 'index.html'
11+
* TODO: What else?
12+
13+
# Notes

batch/webserverlog/src/main/webapp/WEB-INF/classes/META-INF/batch-jobs/webserverlog.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
<listeners>
1414
<listener ref="InfoJobListener"/>
1515
</listeners>
16+
17+
<!-- Chunk-oriented step -->
1618
<step id="mobilefilter" next="mobileanalyzer">
19+
<!-- next define execution order of the steps -->
1720
<listeners>
1821
<listener ref="InfoItemProcessListener"/>
1922
</listeners>
@@ -23,8 +26,11 @@
2326
<writer ref="LogFilteredLineWriter"></writer>
2427
</chunk>
2528
</step>
29+
30+
<!-- Task-oriented step -->
2631
<step id="mobileanalyzer">
2732
<batchlet ref="MobileBatchlet"></batchlet>
2833
<end on="COMPLETED"/>
34+
<!-- end define last step of the job -->
2935
</step>
3036
</job>

0 commit comments

Comments
 (0)