Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to batch process Modern Batch and compute-intensive programming models

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article focuses on "how Modern Batch and compute-intensive programming models are processed in batches". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how Modern Batch and computing-intensive programming models are processed in batches.

How to deal with ModernBatch and computing-intensive programming models in batches

Easier to develop and maintain because the same toolset is used.

Consistency in the implementation of enterprise standards and service quality.

The solution developed by IBM provides a cohesive batch program management model. IBMWebSphereApplicationServer's ModernBatch feature (available in WebSphereApplicationServerV8, WebSphereApplicationServerV7.0FeaturePackforModernBatch, and IBMWebSphereExtendedDeploymentComputeGridV8.0) provides a batch middleware framework that provides:

Container-managed batch job execution: provides the structure and support features required by Java batch applications to help you avoid "custom middleware traps".

Job control interface: a XML file that describes the Java class files used in a batch step and the steps contained in a batch job.

Job checkpoint and restart function: the ability to create checkpoints on the basis of the number or time recorded. This allows you to restart a job from a known checkpoint.

Generic batch data flow (BDS): includes the ability to abstract data into an easily accessible record format, allowing batch programming to focus on business functions rather than basic code for reading and writing data.

Having such a framework provides a good alternative to developing custom batch middleware, allowing developers to focus on achieving core business goals. With ModernBatch, the development of batch applications can be reduced to the business logic for writing jobs. This separation of concerns between business logic and "pipeline" code is an important advantage of the batch framework. It implements a more efficient modularization of batch functions, which supports more efficient reuse and exposes batches as modular services.

How to deal with ModernBatch and computing-intensive programming models in batches

ModernBatch supports two batch programming modes:

Compute-intensive: suitable for simple jobs that perform compute-intensive work and do not require a restart of functions.

Transaction batch processing: for jobs that require a container-managed checkpoint and a restart mechanism. If interrupted due to a planned or unplanned power outage, this enables the batch job to restart from the previous checkpoint.

This article analyzes the compute-intensive model and provides a sample implementation that uses the new functionality provided in IBMRationalApplicationDeveloperv8.

A computing-intensive programming model

Compute-intensive programming consists of the following elements:

Controller bean: a stateless session bean that supports the runtime environment to control the jobs of applications. The implementation of this stateless session bean (CIControllerBean) is provided by the application server.

Job step implementation class: the job step represents the business logic that the job will execute. It is represented by an instance of a class that implements the com.ibm.websphere.ci.CIWork interface. The CIWork interface contains the following methods:

The run () method will be executed when the CI job runs.

The getProperties () and setProperties () methods are used to get the input value through the properties from the client.

Define the xJCL file.

Create a Java class that implements the CIWork interface, containing the business logic that will be executed for each job step.

Wrap CIWork appropriately as an implementation class using a stateless session bean pointing to com.ibm.ws.ci.CIControllerBean.

Before building the sample compute-intensive jobs, it is important to understand the behavior of compute-intensive applications during runtime. In summary, what happens is that the application server uses the xJCL file to find and invoke the controller bean. Bean reads the xJCL file, and for each job step in xJCL, bean does the following:

Instantiate the application CIWork object (specified by the class name element in the xJCL of the job step) using the no-argument constructor of the CIWork class.

Call the setProperties () method of the CIWork object to pass any properties defined in the xJCL of the job step.

Find the work manager defined in the deployment descriptor of the enterprise bean module and use it to call the run () method of the CIWork object asynchronously.

With this understanding of the programming model, let's look at the steps for developing compute-intensive applications.

At this point, I believe you have a deeper understanding of "how Modern Batch and computing-intensive programming models are processed in batches". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report