Top Description Methods
javax.batch.api.partition

public Interface PartitionPlan

Known Direct Implementers
javax.batch.api.partition.PartitionPlanImpl
Imports
java.util.Properties

PartitionPlan is a helper class that carries partition processing information set by the @PartitionMapper method. A PartitionPlan contains:
  1. number of partition instances
  2. number of threads on which to execute the partitions
  3. substitution properties for each Partition (which can be referenced using the #{partitionPlan['propertyName']} syntax.

Method Summary

Modifier and TypeMethod and Description
public Properties[]

Returns:

Partition Properties object array
getPartitionProperties
()

Gets array of Partition Properties objects for Partitions.

public int

Returns:

Partition count
getPartitions
()

Gets count of Partitions.

public boolean

Returns:

override setting.
getPartitionsOverride
()

Return current value of partition override setting.

public int

Returns:

requested thread count
getThreads
()

Gets maximum number of threads requested to use to run partitions for this step.

public void
setPartitionProperties(Properties[]
specifies the Properties object array
props
)

Sets array of substitution Properties objects for the set of Partitions.

public void
setPartitions(int
specifies the partition count
count
)

Set number of partitions.

public void
setPartitionsOverride(boolean
See method description
override
)

Specify whether or not to override the partition count from the previous job execution.

public void
setThreads(int
specifies the requested thread count
count
)

Set maximum number of threads requested to use to run partitions for this step.

Method Detail

getPartitionPropertiesback to summary
public Properties[] getPartitionProperties()

Gets array of Partition Properties objects for Partitions.

These can be used in Job XML substitution using substitution expressions with the syntax: #{partitionPlan['propertyName']}

Each element of the Properties array returned can be used to resolving substitutions for a single partition. In the typical use case, each Properties element will have a similar set of property names, with a substitution potentially resolving to the corresponding value for each partition.

Returns:Properties[]

Partition Properties object array

getPartitionsback to summary
public int getPartitions()

Gets count of Partitions.

Returns:int

Partition count

getPartitionsOverrideback to summary
public boolean getPartitionsOverride()

Return current value of partition override setting.

Returns:boolean

override setting.

See Also
PartitionPlan#setPartitionsOverride(boolean)
getThreadsback to summary
public int getThreads()

Gets maximum number of threads requested to use to run partitions for this step. A value of '0' requests the batch implementation to use the partition count as the thread count. Note the batch runtime is not required to use this full number of threads; it may not have this many available, and may use less.

Returns:int

requested thread count

setPartitionPropertiesback to summary
public void setPartitionProperties(Properties[] props)

Sets array of substitution Properties objects for the set of Partitions.

Parameters
props:Properties[]

specifies the Properties object array

See Also
PartitionPlan#getPartitionProperties()
setPartitionsback to summary
public void setPartitions(int count)

Set number of partitions.

Parameters
count:int

specifies the partition count

setPartitionsOverrideback to summary
public void setPartitionsOverride(boolean override)

Specify whether or not to override the partition count from the previous job execution. This applies only to step restart.

When false is specified, the partition count from the previous job execution is used and any new value set for partition count in the current run is ignored. In addition, partition results from the previous job execution are remembered, and only incomplete partitions are reprocessed.

When true is specified, the partition count from the current run is used and all results from past partitions are discarded. Any resource cleanup or back out of work done in the previous run is the responsibility of the application. The PartitionReducer artifact's rollbackPartitionedStep method is invoked during restart before any partitions begin processing to provide a cleanup hook.

Parameters
override:boolean

See method description

setThreadsback to summary
public void setThreads(int count)

Set maximum number of threads requested to use to run partitions for this step. A value of '0' requests the batch implementation to use the partition count as the thread count. Note the batch runtime is not required to use this full number of threads; it may not have this many available, and may use less.

Parameters
count:int

specifies the requested thread count