Class PartitionPlanImpl
- java.lang.Object
-
- jakarta.batch.api.partition.PartitionPlanImpl
-
- All Implemented Interfaces:
PartitionPlan
public class PartitionPlanImpl extends Object implements PartitionPlan
The PartitionPlanImpl class provides a basic implementation of the PartitionPlan interface.
-
-
Constructor Summary
Constructors Constructor Description PartitionPlanImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Properties[]getPartitionProperties()Gets array of Partition Properties objects for Partitions.intgetPartitions()Gets count of Partitions.booleangetPartitionsOverride()Return current value of partition override setting.intgetThreads()Gets maximum number of threads requested to use to run partitions for this step.voidsetPartitionProperties(Properties[] props)Sets array of substitution Properties objects for the set of Partitions.voidsetPartitions(int count)Set number of partitions.voidsetPartitionsOverride(boolean override)Specify whether or not to override the partition count from the previous job execution.voidsetThreads(int count)Set maximum number of threads requested to use to run partitions for this step.
-
-
-
Method Detail
-
setPartitions
public void setPartitions(int count)
Description copied from interface:PartitionPlanSet number of partitions.- Specified by:
setPartitionsin interfacePartitionPlan- Parameters:
count- specifies the partition count
-
setThreads
public void setThreads(int count)
Description copied from interface:PartitionPlanSet 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.- Specified by:
setThreadsin interfacePartitionPlan- Parameters:
count- specifies the requested thread count
-
setPartitionsOverride
public void setPartitionsOverride(boolean override)
Description copied from interface:PartitionPlanSpecify whether or not to override the partition count from the previous job execution. This applies only to step restart.When
falseis 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
trueis 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.- Specified by:
setPartitionsOverridein interfacePartitionPlan- Parameters:
override- See method description
-
getPartitionsOverride
public boolean getPartitionsOverride()
Description copied from interface:PartitionPlanReturn current value of partition override setting.- Specified by:
getPartitionsOverridein interfacePartitionPlan- Returns:
- override setting.
- See Also:
PartitionPlan.setPartitionsOverride(boolean)
-
setPartitionProperties
public void setPartitionProperties(Properties[] props)
Description copied from interface:PartitionPlanSets array of substitution Properties objects for the set of Partitions.- Specified by:
setPartitionPropertiesin interfacePartitionPlan- Parameters:
props- specifies the Properties object array- See Also:
PartitionPlan.getPartitionProperties()
-
getPartitions
public int getPartitions()
Description copied from interface:PartitionPlanGets count of Partitions.- Specified by:
getPartitionsin interfacePartitionPlan- Returns:
- Partition count
-
getThreads
public int getThreads()
Description copied from interface:PartitionPlanGets 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.- Specified by:
getThreadsin interfacePartitionPlan- Returns:
- requested thread count
-
getPartitionProperties
public Properties[] getPartitionProperties()
Description copied from interface:PartitionPlanGets 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.
- Specified by:
getPartitionPropertiesin interfacePartitionPlan- Returns:
- Partition Properties object array
-
-