Java Reference
In-Depth Information
Figure 11-7. Resource utilization for the statement job
As Figure 11-7 shows, the statement job isn't a CPU-intensive process. In fact, if you look at the
memory profile, the job isn't very memory intensive either. However, you can easily change that. If you
add a small loop into the ItemProcessor used in step 4 ( PricingTiersItemProcessor ) you can quickly
make your CPU busy. Listing 11-1 shows the loop you add.
Listing 11-1. Using PricingTiersItemProcessor to Calculate Prime Numbers
package com.apress.springbatch.statement.processor;
import java.math.BigInteger;
import org.springframework.batch.item.ItemProcessor;
import com.apress.springbatch.statement.domain.AccountTransactionQuantity;
import com.apress.springbatch.statement.domain.PricingTier;
public class PricingTierItemProcessor implements
ItemProcessor<AccountTransactionQuantity, AccountTransactionQuantity> {
public AccountTransactionQuantity process(AccountTransactionQuantity atq)
throws Exception {
Search WWH ::

Custom Search