Embed presentation
Download as PDF, PPTX




















![OP: Memory Overload Protection
incoming jobs
… job
•Protection against
job job
over-scheduling jobs to an application
server
Room for next job?
running jobs
•Batch Container monitors job memory
demand against available JVM heap
job job job job space
•Prevents Java OutOfMemoryError
free space
•Automatic real time job memory
JVM Heap estimation with declarative xJCL
override
xJCL: <job name=… [memory=N] … >](https://image.slidesharecdn.com/con4105sudarsan-121012104910-phpapp01/75/Java-Batch-for-Cost-Optimized-Efficiency-21-2048.jpg)






![JSR 352 – Programing Model - Chunk
Chunk
Package: javax.batch.annotation
@ItemReader @Named[("<id>")]
@Open void <method-name>(Externalizable checkpoint) throws Exception
@Close void <method-name>() throws Exception
@ReadItem <item-type> <method-name> () throws Exception
@CheckpointInfo Externalizable <method-name> () throws Exception
@ItemProcessor @Named[("<id>")]
@ProcessItem <output-item-type> <method-name>(<item-type> item) throws Exception
@ItemWriter @Named[("<id>")]
@Open void <method-name>(Externalizable checkpoint) throws Exception
@Close void <method-name>() throws Exception
@WriteItems void <method-name> (List<item-type> items) throws Exception
@CheckpointInfo Externalizable <method-name> () throws Exception
@CheckpointAlgorithm @Named[("<id>")]
@CheckpointTimeout int <method-name> (int timeout) throws Exception
@BeginCheckpoint void <method-name> () throws Exception
@IsReadyToCheckpoint boolean <method-name> () throws Exception
@EndCheckpoint void <method-name> () throws Exception](https://image.slidesharecdn.com/con4105sudarsan-121012104910-phpapp01/75/Java-Batch-for-Cost-Optimized-Efficiency-28-2048.jpg)
![JSR 352 – Programming Model - Batchlet
Package: javax.batch.annotation
Batchlet
@Batchlet @Named[("<id>")]
@Process String <method-name> () throws Exception
@Stop void <method-name> () throws Exception](https://image.slidesharecdn.com/con4105sudarsan-121012104910-phpapp01/75/Java-Batch-for-Cost-Optimized-Efficiency-29-2048.jpg)
![JSR 352 – Programming Model - Listeners
Listeners
@ JobListener @Named[("<id>")]
Package: javax.batch.annotation.joblistener
@BeforeJob void <method-name> () throws Exception
@AfterJob void <method-name> () throws Exception
@ StepListener @Named[("<id>")]
Package: javax.batch.annotation.steplistener
@BeforeStep void <method-name> () throws Exception
@AfterStep void <method-name> () throws Exception
@ CheckpointListener @Named[("<id>")]
Package: javax.batch.annotation.checkpointlistener
@BeforeCheckpoint void <method-name> () throws Exception
@AfterCheckpoint void <method-name> () throws Exception
Other listeners
ItemReaderListener
ItemProcessorListener
ItemWriterListener
SkipListener
RetryListener](https://image.slidesharecdn.com/con4105sudarsan-121012104910-phpapp01/75/Java-Batch-for-Cost-Optimized-Efficiency-30-2048.jpg)
![JSR 352 – Programming Model - Parallelization
@PartitionMapper @Named[("<id>")]
@CalculatePartitions PartitionPlan <method-name>( ) throws Exception
@PartitionReducer @Named[("<id>")]
package: javax.batch.annotation.partitionreducer
@Begin void <method-name>() throws Exception
@BeforeCompletion void <method-name>() throws Exception
@Rollback void <method-name>() throws Exception
@AfterCompletion void <method-name>(String status) throws Exception
@PartitionCollector @Named[("<id>")]
package: javax.batch.annotation.partitioncollector
@CollectPartitionData Externalizable <method-name>() throws Exception
@PartitionAnalyzer @Named[("<id>")]
package: javax.batch.annotation.partitionanalyzer
@AnalyzeCollectorData void <method-name>(Externalizable data) throws Exception
@AnalyzeExitStatus void <method-name>(String exitStatus) throws Exception](https://image.slidesharecdn.com/con4105sudarsan-121012104910-phpapp01/75/Java-Batch-for-Cost-Optimized-Efficiency-31-2048.jpg)

This document provides an overview of Java Batch and how it can be used for cost optimized efficiency. It discusses why batch processing is important, how the Java Batch specification (JSR 352) defines a standard programming model, and how IBM's Java Batch offerings can help achieve business efficiency through a balanced blend of batch and online processing. Key concepts covered include the Java Batch programming model of readers, processors, writers and chunks, job parallelization, checkpointing, and best practices for designing batch applications. Customer examples demonstrate how Java Batch has been used for modernizing legacy batch jobs and optimizing batch windows.




















![OP: Memory Overload Protection
incoming jobs
… job
•Protection against
job job
over-scheduling jobs to an application
server
Room for next job?
running jobs
•Batch Container monitors job memory
demand against available JVM heap
job job job job space
•Prevents Java OutOfMemoryError
free space
•Automatic real time job memory
JVM Heap estimation with declarative xJCL
override
xJCL: <job name=… [memory=N] … >](https://image.slidesharecdn.com/con4105sudarsan-121012104910-phpapp01/75/Java-Batch-for-Cost-Optimized-Efficiency-21-2048.jpg)






![JSR 352 – Programing Model - Chunk
Chunk
Package: javax.batch.annotation
@ItemReader @Named[("<id>")]
@Open void <method-name>(Externalizable checkpoint) throws Exception
@Close void <method-name>() throws Exception
@ReadItem <item-type> <method-name> () throws Exception
@CheckpointInfo Externalizable <method-name> () throws Exception
@ItemProcessor @Named[("<id>")]
@ProcessItem <output-item-type> <method-name>(<item-type> item) throws Exception
@ItemWriter @Named[("<id>")]
@Open void <method-name>(Externalizable checkpoint) throws Exception
@Close void <method-name>() throws Exception
@WriteItems void <method-name> (List<item-type> items) throws Exception
@CheckpointInfo Externalizable <method-name> () throws Exception
@CheckpointAlgorithm @Named[("<id>")]
@CheckpointTimeout int <method-name> (int timeout) throws Exception
@BeginCheckpoint void <method-name> () throws Exception
@IsReadyToCheckpoint boolean <method-name> () throws Exception
@EndCheckpoint void <method-name> () throws Exception](https://image.slidesharecdn.com/con4105sudarsan-121012104910-phpapp01/75/Java-Batch-for-Cost-Optimized-Efficiency-28-2048.jpg)
![JSR 352 – Programming Model - Batchlet
Package: javax.batch.annotation
Batchlet
@Batchlet @Named[("<id>")]
@Process String <method-name> () throws Exception
@Stop void <method-name> () throws Exception](https://image.slidesharecdn.com/con4105sudarsan-121012104910-phpapp01/75/Java-Batch-for-Cost-Optimized-Efficiency-29-2048.jpg)
![JSR 352 – Programming Model - Listeners
Listeners
@ JobListener @Named[("<id>")]
Package: javax.batch.annotation.joblistener
@BeforeJob void <method-name> () throws Exception
@AfterJob void <method-name> () throws Exception
@ StepListener @Named[("<id>")]
Package: javax.batch.annotation.steplistener
@BeforeStep void <method-name> () throws Exception
@AfterStep void <method-name> () throws Exception
@ CheckpointListener @Named[("<id>")]
Package: javax.batch.annotation.checkpointlistener
@BeforeCheckpoint void <method-name> () throws Exception
@AfterCheckpoint void <method-name> () throws Exception
Other listeners
ItemReaderListener
ItemProcessorListener
ItemWriterListener
SkipListener
RetryListener](https://image.slidesharecdn.com/con4105sudarsan-121012104910-phpapp01/75/Java-Batch-for-Cost-Optimized-Efficiency-30-2048.jpg)
![JSR 352 – Programming Model - Parallelization
@PartitionMapper @Named[("<id>")]
@CalculatePartitions PartitionPlan <method-name>( ) throws Exception
@PartitionReducer @Named[("<id>")]
package: javax.batch.annotation.partitionreducer
@Begin void <method-name>() throws Exception
@BeforeCompletion void <method-name>() throws Exception
@Rollback void <method-name>() throws Exception
@AfterCompletion void <method-name>(String status) throws Exception
@PartitionCollector @Named[("<id>")]
package: javax.batch.annotation.partitioncollector
@CollectPartitionData Externalizable <method-name>() throws Exception
@PartitionAnalyzer @Named[("<id>")]
package: javax.batch.annotation.partitionanalyzer
@AnalyzeCollectorData void <method-name>(Externalizable data) throws Exception
@AnalyzeExitStatus void <method-name>(String exitStatus) throws Exception](https://image.slidesharecdn.com/con4105sudarsan-121012104910-phpapp01/75/Java-Batch-for-Cost-Optimized-Efficiency-31-2048.jpg)
