From 07b39aaf0e4f59705b205f40aa616ee8f5724a58 Mon Sep 17 00:00:00 2001
From: dsyer
Date: Tue, 5 Oct 2010 15:55:03 +0000
Subject: [PATCH] BATCH-1531: add docs to user guide and javadocs
---
.../core/partition/support/PartitionNameProvider.java | 8 ++++++++
src/site/docbook/reference/scalability.xml | 11 +++++++++++
2 files changed, 19 insertions(+)
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/PartitionNameProvider.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/PartitionNameProvider.java
index fa1457302..19571d404 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/PartitionNameProvider.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/PartitionNameProvider.java
@@ -25,6 +25,14 @@ import java.util.Collection;
* interface if a partitioner extends {@link SimplePartitioner} and re-uses the
* default partition names.
*
+ *
+ * If a partitioner does implement this interface, however, on a restart the
+ * {@link Partitioner#partition(int)} method will not be called again, instead
+ * the partitions will be re-used from the last execution, and matched by name
+ * with the results of {@link PartitionNameProvider#getPartitionNames(int)}.
+ * This can be a useful performance optimisation if the partitioning process is
+ * expensive.
+ *
*
* @author Dave Syer
*
diff --git a/src/site/docbook/reference/scalability.xml b/src/site/docbook/reference/scalability.xml
index a34516490..fec314c81 100644
--- a/src/site/docbook/reference/scalability.xml
+++ b/src/site/docbook/reference/scalability.xml
@@ -340,6 +340,17 @@
Job), and the suffix is just a counter. There is
a SimplePartitioner in the framework that uses
this convention.
+
+ An optional interface
+ PartitioneNameProvider can be used to
+ provide the partition names separately from the partitions
+ themselves. If a Partitioner implements
+ this interface then on a restart only the names will be queried.
+ If partitioning is expensive this can be a useful optimisation.
+ Obviously the names provided by the
+ PartitioneNameProvider must match those
+ provided by the Partitioner.
+