Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish

Arun Gupta
Arun GuptaArun Gupta
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.1
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.2
Batch Applications for the
Java Platform
Arun Gupta
Java EE & GlassFish Guy
arun.p.gupta@oracle.com
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.3
The following is intended to outline our general product direction. It is intended
for information purposes only, and may not be incorporated into any contract.
It is not a commitment to deliver any material, code, or functionality, and should
not be relied upon in making purchasing decisions. The development, release,
and timing of any features or functionality described for Oracle’s products
remains at the sole discretion of Oracle.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.4
Batch Applications for the Java Platform
§ Standardizes batch processing for Java
–  Non-interactive, bulk-oriented, long-running
–  Data or computationally intensive
–  Sequentially or in parallel
–  Ad-hoc, scheduled or on-demand execution
§ Led by IBM
§ Spring Batch, WebSphere Compute Grid (WCG), z/OS Batch
§ Part of Java EE 7, can be used in Java SE
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.5
Batch Domain Language
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.6
Batch Domain Language
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.7
Batch Domain Language
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.8
Chunked Processing
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.9
Chunked Processing: Reader, Processor, Writer
public interface ItemReader<T> {
public void open(Externalizable checkpoint);
public T readItem();
public Externalizable checkpointInfo();
public void close();
}
public interface ItemProcessor<T, R> {
public R processItem(T item);
}
public interface ItemWriter<T> {
public void open(Externalizable checkpoint);
public void writeItems(List<T> items);
public Externalizable checkpointInfo();
public void close();
}
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.10
//For a job
<step id=”sendStatements”>
<chunk reader=”accountReader”
processor=”accountProcessor”
writer=”emailWriter”
item-count=”10” />
</step>
Batch Applications for the Java Platform
Step Example using Job Specification Language (JSL)
@Named(“accountReader")
...implements ItemReader... {
public Account readItem() {
// read account using JPA
@Named(“accountProcessor")
...implements ItemProcessor... {
public Statement processItems(Account account) {
// read Account, return Statement
@Named(“emailWriter")
...implements ItemWriter... {
public void writeItems(List<Statements> statements) {
// use JavaMail to send email
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.11
Checkpointing
§ For data intensive tasks, long periods of time
–  Checkpoint/restart is a common design requirement
§ Basically saves Reader, Writer positions
–  Naturally fits into Chunk oriented steps
–  reader.checkpointInfo() and writer.checkpointInfo() are
called
–  The resulting Externalizable data is persisted
–  When the Chunk restarts, the reader and writer are initialized with the
respective Externalizable data
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.12
Chunked Processing: Checkpoint
public interface ItemReader<T> {
public void open(Externalizable checkpoint);
public T readItem();
public Externalizable checkpointInfo();
public void close();
}
public interface ItemProcessor<T, R> {
public R processItem(T item);
}
public interface ItemWriter<T> {
public void open(Externalizable checkpoint);
public void writeItems(List<T> items);
public Externalizable checkpointInfo();
public void close();
}
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.13
Handling Exceptions
<job id=...>
...
<chunk skip-limit=”5” retry-limit=”5”>
<skippable-exception-classes>
<include class="java.lang.Exception"/>
<exclude class="java.io.FileNotFoundException"/>
</skippable-exception-classes>
<retryable-exception-classes>
...
</retryable-exception-classes>
<no-rollback-exception-classes>
...
</no-rollback-exception-classes>
</chunk>
...
</job>
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.14
Partitioned Step
§ A batch step may run as a partitioned step
–  A partitioned step runs as multiple instances of the same step definition
across multiple threads, one partition per thread
<step id="step1" >
<chunk ...>
<partition>
<plan partitions=“10" threads="2"/>
<reducer .../>
</partition>
</chunk>
</step>
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.15
Partitioning – Advanced Scenarios
§ Partition Mapper
–  Dynamically decide number of partitions (partition plan)
§  Partition Reducer
–  Demarcate logical unit of work around partition processing
§  Partition Collector
–  Sends interim results from individual partition to step's partition
analyzer
§  Partition Analyzer
–  Collection point of interim results, single point of control and analysis
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.16
Flow and Split
§ Flow defines a set of steps to be executed as a unit
<flow id=”flow-1" next=“{flow, step, decision}-id” >
<step id=“flow_1_step_1”>
</step>
<step id=“flow_1_step_2”>
</step>
</flow>
§ Split defines a set of flows to be executed in parallel
<split …>
<flow …./> <!– each flow runs on a separate thread -->
<flow …./>
</split>
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.17
Batchlet
§ Task oriented unit of work
§  Not item-oriented
§ Doesn't support resume
§ Simple Batchlet interface – process(), stop()!
§ In Job XML:
<batchlet ref=”{name}”/>
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.18
Programming Model – Advanced Scenarios
§ CheckpointAlgorithm
§ Decider
§ Listeners – Job, Step, Chunk Listeners …
§ @BatchProperty

String fname = “/tmp/default.txt”!
§ @BatchContext JobContext jctxt;!
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.19
Batch Runtime Specification
§ JobOperator interface – for programmatic lifecycle control of jobs
§ Step level Metrics through the StepExecution object
§ Batch Artifact loading through CDI
§ Job XML loading through META-INF/batch-jobs/myJob.xml
§ Packaging – jar, war, ejb-jar
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.20
Example: Programmatic Invocation of Jobs
In a Servlet/EJB:
import javax.batch.runtime.BatchRuntime;
...
JobOperator jo = BatchRuntime.getJobOperator();
jo.start("myJob", new Properties());
...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.21
Where to Find Out More
§ Read the final spec and API docs at http://java.net/projects/jbatch/
§ Join public@jbatch.java.net and send questions and comments
§ RI integrated in GlassFish 4.0
–  http://glassfish.java.net/
–  http://dlc.sun.com.edgesuite.net/glassfish/4.0/promoted/
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.22
Graphic Section Divider
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.23
1 of 23

Recommended

Java API for WebSocket 1.0: Java EE 7 and GlassFish by
Java API for WebSocket 1.0: Java EE 7 and GlassFishJava API for WebSocket 1.0: Java EE 7 and GlassFish
Java API for WebSocket 1.0: Java EE 7 and GlassFishArun Gupta
23K views45 slides
CON5898 What Servlet 4.0 Means To You by
CON5898 What Servlet 4.0 Means To YouCON5898 What Servlet 4.0 Means To You
CON5898 What Servlet 4.0 Means To YouEdward Burns
31.5K views51 slides
JavaOne 2014 BOF4241 What's Next for JSF? by
JavaOne 2014 BOF4241 What's Next for JSF?JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?Edward Burns
29.8K views33 slides
What's next for Java API for WebSocket (JSR 356) by
What's next for Java API for WebSocket (JSR 356)What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)Pavel Bucek
34.1K views31 slides
Servlet 4.0 at GeekOut 2015 by
Servlet 4.0 at GeekOut 2015Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015Edward Burns
19.3K views87 slides
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015 by
HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015Edward Burns
19.2K views82 slides

More Related Content

What's hot

Reactive Java EE - Let Me Count the Ways! by
Reactive Java EE - Let Me Count the Ways!Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!Reza Rahman
104.5K views39 slides
Ed presents JSF 2.2 and WebSocket to Gameduell. by
Ed presents JSF 2.2 and WebSocket to Gameduell.Ed presents JSF 2.2 and WebSocket to Gameduell.
Ed presents JSF 2.2 and WebSocket to Gameduell.Edward Burns
3.9K views45 slides
Java EE 7 from an HTML5 Perspective, JavaLand 2015 by
Java EE 7 from an HTML5 Perspective, JavaLand 2015Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Edward Burns
3.4K views67 slides
Java EE 7 for WebLogic 12c Developers by
Java EE 7 for WebLogic 12c DevelopersJava EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersBruno Borges
4K views62 slides
Burns jsf-confess-2015 by
Burns jsf-confess-2015Burns jsf-confess-2015
Burns jsf-confess-2015Edward Burns
2.3K views37 slides
Java EE Revisits GoF Design Patterns by
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsMurat Yener
15.9K views46 slides

What's hot(19)

Reactive Java EE - Let Me Count the Ways! by Reza Rahman
Reactive Java EE - Let Me Count the Ways!Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!
Reza Rahman104.5K views
Ed presents JSF 2.2 and WebSocket to Gameduell. by Edward Burns
Ed presents JSF 2.2 and WebSocket to Gameduell.Ed presents JSF 2.2 and WebSocket to Gameduell.
Ed presents JSF 2.2 and WebSocket to Gameduell.
Edward Burns3.9K views
Java EE 7 from an HTML5 Perspective, JavaLand 2015 by Edward Burns
Java EE 7 from an HTML5 Perspective, JavaLand 2015Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Edward Burns3.4K views
Java EE 7 for WebLogic 12c Developers by Bruno Borges
Java EE 7 for WebLogic 12c DevelopersJava EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c Developers
Bruno Borges4K views
Burns jsf-confess-2015 by Edward Burns
Burns jsf-confess-2015Burns jsf-confess-2015
Burns jsf-confess-2015
Edward Burns2.3K views
Java EE Revisits GoF Design Patterns by Murat Yener
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design Patterns
Murat Yener15.9K views
WebSocket in Enterprise Applications 2015 by Pavel Bucek
WebSocket in Enterprise Applications 2015WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015
Pavel Bucek1.9K views
JavaFX and JEE 7 by Vijay Nair
JavaFX and JEE 7JavaFX and JEE 7
JavaFX and JEE 7
Vijay Nair2K views
Have You Seen Java EE Lately? by Reza Rahman
Have You Seen Java EE Lately?Have You Seen Java EE Lately?
Have You Seen Java EE Lately?
Reza Rahman37.1K views
Oracle WebLogic Server 12.2.1 Do More with Less by Ed Burns
Oracle WebLogic Server 12.2.1 Do More with LessOracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with Less
Ed Burns1.5K views
EJB and CDI - Alignment and Strategy by David Delabassee
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and Strategy
David Delabassee31.9K views
JSF 2.2 Input Output JavaLand 2015 by Edward Burns
JSF 2.2 Input Output JavaLand 2015JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015
Edward Burns1.9K views
Seven Points for Applying Java EE 7 by Hirofumi Iwasaki
Seven Points for Applying Java EE 7Seven Points for Applying Java EE 7
Seven Points for Applying Java EE 7
Hirofumi Iwasaki24.2K views
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6 by Rakuten Group, Inc.
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
Rakuten Group, Inc.21.5K views
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O... by jeckels
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
jeckels4.8K views
JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948) by Fred Rowe
JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)
JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)
Fred Rowe4.2K views

Similar to Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish

Batch Applications for the Java Platform by
Batch Applications for the Java PlatformBatch Applications for the Java Platform
Batch Applications for the Java PlatformSivakumar Thyagarajan
1.9K views25 slides
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7 by
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7Max Andersen
1K views23 slides
OTN Tour 2013: What's new in java EE 7 by
OTN Tour 2013: What's new in java EE 7OTN Tour 2013: What's new in java EE 7
OTN Tour 2013: What's new in java EE 7Bruno Borges
2.5K views41 slides
Java EE 7 in practise - OTN Hyderabad 2014 by
Java EE 7 in practise - OTN Hyderabad 2014Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014Jagadish Prasath
765 views31 slides
Why should i switch to Java SE 7 by
Why should i switch to Java SE 7Why should i switch to Java SE 7
Why should i switch to Java SE 7Vinay H G
2.5K views46 slides
Java SE 8 by
Java SE 8Java SE 8
Java SE 8Simon Ritter
2K views45 slides

Similar to Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish(20)

Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7 by Max Andersen
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Max Andersen1K views
OTN Tour 2013: What's new in java EE 7 by Bruno Borges
OTN Tour 2013: What's new in java EE 7OTN Tour 2013: What's new in java EE 7
OTN Tour 2013: What's new in java EE 7
Bruno Borges2.5K views
Java EE 7 in practise - OTN Hyderabad 2014 by Jagadish Prasath
Java EE 7 in practise - OTN Hyderabad 2014Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014
Jagadish Prasath765 views
Why should i switch to Java SE 7 by Vinay H G
Why should i switch to Java SE 7Why should i switch to Java SE 7
Why should i switch to Java SE 7
Vinay H G2.5K views
OSI_MySQL_Performance Schema by Mayank Prasad
OSI_MySQL_Performance SchemaOSI_MySQL_Performance Schema
OSI_MySQL_Performance Schema
Mayank Prasad617 views
GlassFish BOF by glassfish
GlassFish BOFGlassFish BOF
GlassFish BOF
glassfish13.7K views
Java EE7 by Jay Lee
Java EE7Java EE7
Java EE7
Jay Lee857 views
Programming-best practices( beginner) ADF_fusionapps by Berry Clemens
Programming-best practices( beginner) ADF_fusionappsProgramming-best practices( beginner) ADF_fusionapps
Programming-best practices( beginner) ADF_fusionapps
Berry Clemens5.1K views
Consuming Java EE in Desktop, Web, and Mobile Frontends by Geertjan Wielenga
Consuming Java EE in Desktop, Web, and Mobile FrontendsConsuming Java EE in Desktop, Web, and Mobile Frontends
Consuming Java EE in Desktop, Web, and Mobile Frontends
Geertjan Wielenga6.2K views
Ebs troubleshooting con9019_pdf_9019_0001 by jucaab
Ebs troubleshooting con9019_pdf_9019_0001Ebs troubleshooting con9019_pdf_9019_0001
Ebs troubleshooting con9019_pdf_9019_0001
jucaab2.3K views
GlassFish in Production Environments by Bruno Borges
GlassFish in Production EnvironmentsGlassFish in Production Environments
GlassFish in Production Environments
Bruno Borges9.7K views
Ebs performance tuning session feb 13 2013---Presented by Oracle by Akash Pramanik
Ebs performance tuning session  feb 13 2013---Presented by OracleEbs performance tuning session  feb 13 2013---Presented by Oracle
Ebs performance tuning session feb 13 2013---Presented by Oracle
Akash Pramanik3.8K views
2015 JavaOne LAD JSF 2.3 & MVC 1.0 by mnriem
2015 JavaOne LAD JSF 2.3 & MVC 1.02015 JavaOne LAD JSF 2.3 & MVC 1.0
2015 JavaOne LAD JSF 2.3 & MVC 1.0
mnriem624 views
How Scala, Wicket, and Java EE Can Improve Web Development by Bruno Borges
How Scala, Wicket, and Java EE Can Improve Web DevelopmentHow Scala, Wicket, and Java EE Can Improve Web Development
How Scala, Wicket, and Java EE Can Improve Web Development
Bruno Borges2.9K views
Con11257 schifano con11257-best practices for deploying highly scalable virtu... by Berry Clemens
Con11257 schifano con11257-best practices for deploying highly scalable virtu...Con11257 schifano con11257-best practices for deploying highly scalable virtu...
Con11257 schifano con11257-best practices for deploying highly scalable virtu...
Berry Clemens3K views
Barun_Practical_and_Efficient_SQL_Performance_Tuning by Vlado Barun
Barun_Practical_and_Efficient_SQL_Performance_TuningBarun_Practical_and_Efficient_SQL_Performance_Tuning
Barun_Practical_and_Efficient_SQL_Performance_Tuning
Vlado Barun497 views

More from Arun Gupta

5 Skills To Force Multiply Technical Talents.pdf by
5 Skills To Force Multiply Technical Talents.pdf5 Skills To Force Multiply Technical Talents.pdf
5 Skills To Force Multiply Technical Talents.pdfArun Gupta
22 views54 slides
Machine Learning using Kubernetes - AI Conclave 2019 by
Machine Learning using Kubernetes - AI Conclave 2019Machine Learning using Kubernetes - AI Conclave 2019
Machine Learning using Kubernetes - AI Conclave 2019Arun Gupta
718 views49 slides
Machine Learning using Kubeflow and Kubernetes by
Machine Learning using Kubeflow and KubernetesMachine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and KubernetesArun Gupta
2.3K views57 slides
Secure and Fast microVM for Serverless Computing using Firecracker by
Secure and Fast microVM for Serverless Computing using FirecrackerSecure and Fast microVM for Serverless Computing using Firecracker
Secure and Fast microVM for Serverless Computing using FirecrackerArun Gupta
1.3K views42 slides
Building Java in the Open - j.Day at OSCON 2019 by
Building Java in the Open - j.Day at OSCON 2019Building Java in the Open - j.Day at OSCON 2019
Building Java in the Open - j.Day at OSCON 2019Arun Gupta
780 views16 slides
Why Amazon Cares about Open Source by
Why Amazon Cares about Open SourceWhy Amazon Cares about Open Source
Why Amazon Cares about Open SourceArun Gupta
856 views5 slides

More from Arun Gupta(20)

5 Skills To Force Multiply Technical Talents.pdf by Arun Gupta
5 Skills To Force Multiply Technical Talents.pdf5 Skills To Force Multiply Technical Talents.pdf
5 Skills To Force Multiply Technical Talents.pdf
Arun Gupta22 views
Machine Learning using Kubernetes - AI Conclave 2019 by Arun Gupta
Machine Learning using Kubernetes - AI Conclave 2019Machine Learning using Kubernetes - AI Conclave 2019
Machine Learning using Kubernetes - AI Conclave 2019
Arun Gupta718 views
Machine Learning using Kubeflow and Kubernetes by Arun Gupta
Machine Learning using Kubeflow and KubernetesMachine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and Kubernetes
Arun Gupta2.3K views
Secure and Fast microVM for Serverless Computing using Firecracker by Arun Gupta
Secure and Fast microVM for Serverless Computing using FirecrackerSecure and Fast microVM for Serverless Computing using Firecracker
Secure and Fast microVM for Serverless Computing using Firecracker
Arun Gupta1.3K views
Building Java in the Open - j.Day at OSCON 2019 by Arun Gupta
Building Java in the Open - j.Day at OSCON 2019Building Java in the Open - j.Day at OSCON 2019
Building Java in the Open - j.Day at OSCON 2019
Arun Gupta780 views
Why Amazon Cares about Open Source by Arun Gupta
Why Amazon Cares about Open SourceWhy Amazon Cares about Open Source
Why Amazon Cares about Open Source
Arun Gupta856 views
Machine learning using Kubernetes by Arun Gupta
Machine learning using KubernetesMachine learning using Kubernetes
Machine learning using Kubernetes
Arun Gupta354 views
Building Cloud Native Applications by Arun Gupta
Building Cloud Native ApplicationsBuilding Cloud Native Applications
Building Cloud Native Applications
Arun Gupta458 views
Chaos Engineering with Kubernetes by Arun Gupta
Chaos Engineering with KubernetesChaos Engineering with Kubernetes
Chaos Engineering with Kubernetes
Arun Gupta2.1K views
How to be a mentor to bring more girls to STEAM by Arun Gupta
How to be a mentor to bring more girls to STEAMHow to be a mentor to bring more girls to STEAM
How to be a mentor to bring more girls to STEAM
Arun Gupta470 views
Java in a World of Containers - DockerCon 2018 by Arun Gupta
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018
Arun Gupta2.3K views
The Serverless Tidal Wave - SwampUP 2018 Keynote by Arun Gupta
The Serverless Tidal Wave - SwampUP 2018 KeynoteThe Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 Keynote
Arun Gupta345 views
Introduction to Amazon EKS - KubeCon 2018 by Arun Gupta
Introduction to Amazon EKS - KubeCon 2018Introduction to Amazon EKS - KubeCon 2018
Introduction to Amazon EKS - KubeCon 2018
Arun Gupta3.5K views
Mastering Kubernetes on AWS - Tel Aviv Summit by Arun Gupta
Mastering Kubernetes on AWS - Tel Aviv SummitMastering Kubernetes on AWS - Tel Aviv Summit
Mastering Kubernetes on AWS - Tel Aviv Summit
Arun Gupta2.4K views
Top 10 Technology Trends Changing Developer's Landscape by Arun Gupta
Top 10 Technology Trends Changing Developer's LandscapeTop 10 Technology Trends Changing Developer's Landscape
Top 10 Technology Trends Changing Developer's Landscape
Arun Gupta2.5K views
Container Landscape in 2017 by Arun Gupta
Container Landscape in 2017Container Landscape in 2017
Container Landscape in 2017
Arun Gupta1.4K views
Java EE and NoSQL using JBoss EAP 7 and OpenShift by Arun Gupta
Java EE and NoSQL using JBoss EAP 7 and OpenShiftJava EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShift
Arun Gupta1.5K views
Docker, Kubernetes, and Mesos recipes for Java developers by Arun Gupta
Docker, Kubernetes, and Mesos recipes for Java developersDocker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developers
Arun Gupta3.4K views
Thanks Managers! by Arun Gupta
Thanks Managers!Thanks Managers!
Thanks Managers!
Arun Gupta1.9K views
Migrate your traditional VM-based Clusters to Containers by Arun Gupta
Migrate your traditional VM-based Clusters to ContainersMigrate your traditional VM-based Clusters to Containers
Migrate your traditional VM-based Clusters to Containers
Arun Gupta2.9K views

Recently uploaded

GDSC GLAU Info Session.pptx by
GDSC GLAU Info Session.pptxGDSC GLAU Info Session.pptx
GDSC GLAU Info Session.pptxgauriverrma4
15 views28 slides
Netmera Presentation.pdf by
Netmera Presentation.pdfNetmera Presentation.pdf
Netmera Presentation.pdfMustafa Kuğu
22 views50 slides
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」 by
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」PC Cluster Consortium
29 views68 slides
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Moses Kemibaro
38 views38 slides
Business Analyst Series 2023 - Week 4 Session 8 by
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8DianaGray10
180 views13 slides
The Power of Generative AI in Accelerating No Code Adoption.pdf by
The Power of Generative AI in Accelerating No Code Adoption.pdfThe Power of Generative AI in Accelerating No Code Adoption.pdf
The Power of Generative AI in Accelerating No Code Adoption.pdfSaeed Al Dhaheri
44 views18 slides

Recently uploaded(20)

GDSC GLAU Info Session.pptx by gauriverrma4
GDSC GLAU Info Session.pptxGDSC GLAU Info Session.pptx
GDSC GLAU Info Session.pptx
gauriverrma415 views
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」 by PC Cluster Consortium
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by Moses Kemibaro
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Moses Kemibaro38 views
Business Analyst Series 2023 - Week 4 Session 8 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8
DianaGray10180 views
The Power of Generative AI in Accelerating No Code Adoption.pdf by Saeed Al Dhaheri
The Power of Generative AI in Accelerating No Code Adoption.pdfThe Power of Generative AI in Accelerating No Code Adoption.pdf
The Power of Generative AI in Accelerating No Code Adoption.pdf
Saeed Al Dhaheri44 views
AI + Memoori = AIM by Memoori
AI + Memoori = AIMAI + Memoori = AIM
AI + Memoori = AIM
Memoori15 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash171 views
What is Authentication Active Directory_.pptx by HeenaMehta35
What is Authentication Active Directory_.pptxWhat is Authentication Active Directory_.pptx
What is Authentication Active Directory_.pptx
HeenaMehta3515 views
AIM102-S_Cognizant_CognizantCognitive by PhilipBasford
AIM102-S_Cognizant_CognizantCognitiveAIM102-S_Cognizant_CognizantCognitive
AIM102-S_Cognizant_CognizantCognitive
PhilipBasford23 views
"Node.js Development in 2024: trends and tools", Nikita Galkin by Fwdays
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin
Fwdays37 views
The Coming AI Tsunami.pptx by johnhandby
The Coming AI Tsunami.pptxThe Coming AI Tsunami.pptx
The Coming AI Tsunami.pptx
johnhandby14 views
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... by ShapeBlue
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
ShapeBlue120 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays59 views
Initiating and Advancing Your Strategic GIS Governance Strategy by Safe Software
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance Strategy
Safe Software198 views
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」 by PC Cluster Consortium
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」

Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish

  • 1. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.1
  • 2. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.2 Batch Applications for the Java Platform Arun Gupta Java EE & GlassFish Guy arun.p.gupta@oracle.com
  • 3. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.3 The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 4. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.4 Batch Applications for the Java Platform § Standardizes batch processing for Java –  Non-interactive, bulk-oriented, long-running –  Data or computationally intensive –  Sequentially or in parallel –  Ad-hoc, scheduled or on-demand execution § Led by IBM § Spring Batch, WebSphere Compute Grid (WCG), z/OS Batch § Part of Java EE 7, can be used in Java SE
  • 5. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.5 Batch Domain Language
  • 6. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.6 Batch Domain Language
  • 7. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.7 Batch Domain Language
  • 8. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.8 Chunked Processing
  • 9. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.9 Chunked Processing: Reader, Processor, Writer public interface ItemReader<T> { public void open(Externalizable checkpoint); public T readItem(); public Externalizable checkpointInfo(); public void close(); } public interface ItemProcessor<T, R> { public R processItem(T item); } public interface ItemWriter<T> { public void open(Externalizable checkpoint); public void writeItems(List<T> items); public Externalizable checkpointInfo(); public void close(); }
  • 10. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.10 //For a job <step id=”sendStatements”> <chunk reader=”accountReader” processor=”accountProcessor” writer=”emailWriter” item-count=”10” /> </step> Batch Applications for the Java Platform Step Example using Job Specification Language (JSL) @Named(“accountReader") ...implements ItemReader... { public Account readItem() { // read account using JPA @Named(“accountProcessor") ...implements ItemProcessor... { public Statement processItems(Account account) { // read Account, return Statement @Named(“emailWriter") ...implements ItemWriter... { public void writeItems(List<Statements> statements) { // use JavaMail to send email
  • 11. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.11 Checkpointing § For data intensive tasks, long periods of time –  Checkpoint/restart is a common design requirement § Basically saves Reader, Writer positions –  Naturally fits into Chunk oriented steps –  reader.checkpointInfo() and writer.checkpointInfo() are called –  The resulting Externalizable data is persisted –  When the Chunk restarts, the reader and writer are initialized with the respective Externalizable data
  • 12. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.12 Chunked Processing: Checkpoint public interface ItemReader<T> { public void open(Externalizable checkpoint); public T readItem(); public Externalizable checkpointInfo(); public void close(); } public interface ItemProcessor<T, R> { public R processItem(T item); } public interface ItemWriter<T> { public void open(Externalizable checkpoint); public void writeItems(List<T> items); public Externalizable checkpointInfo(); public void close(); }
  • 13. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.13 Handling Exceptions <job id=...> ... <chunk skip-limit=”5” retry-limit=”5”> <skippable-exception-classes> <include class="java.lang.Exception"/> <exclude class="java.io.FileNotFoundException"/> </skippable-exception-classes> <retryable-exception-classes> ... </retryable-exception-classes> <no-rollback-exception-classes> ... </no-rollback-exception-classes> </chunk> ... </job>
  • 14. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.14 Partitioned Step § A batch step may run as a partitioned step –  A partitioned step runs as multiple instances of the same step definition across multiple threads, one partition per thread <step id="step1" > <chunk ...> <partition> <plan partitions=“10" threads="2"/> <reducer .../> </partition> </chunk> </step>
  • 15. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.15 Partitioning – Advanced Scenarios § Partition Mapper –  Dynamically decide number of partitions (partition plan) §  Partition Reducer –  Demarcate logical unit of work around partition processing §  Partition Collector –  Sends interim results from individual partition to step's partition analyzer §  Partition Analyzer –  Collection point of interim results, single point of control and analysis
  • 16. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.16 Flow and Split § Flow defines a set of steps to be executed as a unit <flow id=”flow-1" next=“{flow, step, decision}-id” > <step id=“flow_1_step_1”> </step> <step id=“flow_1_step_2”> </step> </flow> § Split defines a set of flows to be executed in parallel <split …> <flow …./> <!– each flow runs on a separate thread --> <flow …./> </split>
  • 17. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.17 Batchlet § Task oriented unit of work §  Not item-oriented § Doesn't support resume § Simple Batchlet interface – process(), stop()! § In Job XML: <batchlet ref=”{name}”/>
  • 18. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.18 Programming Model – Advanced Scenarios § CheckpointAlgorithm § Decider § Listeners – Job, Step, Chunk Listeners … § @BatchProperty
 String fname = “/tmp/default.txt”! § @BatchContext JobContext jctxt;!
  • 19. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.19 Batch Runtime Specification § JobOperator interface – for programmatic lifecycle control of jobs § Step level Metrics through the StepExecution object § Batch Artifact loading through CDI § Job XML loading through META-INF/batch-jobs/myJob.xml § Packaging – jar, war, ejb-jar
  • 20. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.20 Example: Programmatic Invocation of Jobs In a Servlet/EJB: import javax.batch.runtime.BatchRuntime; ... JobOperator jo = BatchRuntime.getJobOperator(); jo.start("myJob", new Properties()); ...
  • 21. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.21 Where to Find Out More § Read the final spec and API docs at http://java.net/projects/jbatch/ § Join public@jbatch.java.net and send questions and comments § RI integrated in GlassFish 4.0 –  http://glassfish.java.net/ –  http://dlc.sun.com.edgesuite.net/glassfish/4.0/promoted/
  • 22. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.22 Graphic Section Divider
  • 23. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.23