public abstract class AbstractPartitioner
extends java.lang.Object
implements org.springframework.batch.core.partition.support.Partitioner
Partitioner
.Constructor and Description |
---|
AbstractPartitioner() |
Modifier and Type | Method and Description |
---|---|
protected org.springframework.batch.item.ExecutionContext |
createExecutionContext(org.apache.hadoop.fs.Path path,
Split split)
Creates the execution context.
|
protected org.springframework.batch.item.ExecutionContext |
createExecutionContext(org.springframework.core.io.Resource resource,
Split split)
Creates the execution context.
|
protected abstract java.util.Map<java.lang.String,org.springframework.batch.item.ExecutionContext> |
createPartitions()
Creates the
ExecutionContext s for partitions. |
org.apache.hadoop.conf.Configuration |
getConfiguration()
Gets the hadoop configuration.
|
java.lang.String |
getKeyFileName()
Gets the key for a file name.
|
java.lang.String |
getKeySplitLength()
Gets the key for split length.
|
java.lang.String |
getKeySplitLocations()
Gets the key for split locations.
|
java.lang.String |
getKeySplitStart()
Gets the key for split start.
|
java.lang.String |
getPartitionBaseIdentifier()
Gets the partition base identifier.
|
java.util.Map<java.lang.String,org.springframework.batch.item.ExecutionContext> |
partition(int gridSize) |
void |
setConfiguration(org.apache.hadoop.conf.Configuration configuration)
Sets the hadoop configuration.
|
void |
setKeyFileName(java.lang.String keyFileName)
The name of the key for the file name in each
ExecutionContext . |
void |
setKeySplitLength(java.lang.String keySplitLength)
The name of the key for the file split length in each
ExecutionContext . |
void |
setKeySplitLocations(java.lang.String keySplitLocations)
The name of the key for the split locations in each
ExecutionContext . |
void |
setKeySplitStart(java.lang.String keySplitStart)
The name of the key for the file split start in each
ExecutionContext . |
void |
setPartitionBaseIdentifier(java.lang.String keyPartition)
The name of the base key for identifying partition's
ExecutionContext . |
public java.util.Map<java.lang.String,org.springframework.batch.item.ExecutionContext> partition(int gridSize)
partition
in interface org.springframework.batch.core.partition.support.Partitioner
public void setPartitionBaseIdentifier(java.lang.String keyPartition)
ExecutionContext
.
Defaults to "partition".keyPartition
- the value of the keypublic java.lang.String getPartitionBaseIdentifier()
public void setKeyFileName(java.lang.String keyFileName)
ExecutionContext
.
Defaults to "fileName".keyFileName
- the value of the keypublic java.lang.String getKeyFileName()
public void setKeySplitStart(java.lang.String keySplitStart)
ExecutionContext
.
Defaults to "splitStart".keySplitStart
- the value of the keypublic java.lang.String getKeySplitStart()
public void setKeySplitLength(java.lang.String keySplitLength)
ExecutionContext
.
Defaults to "splitLength".keySplitLength
- the value of the keypublic java.lang.String getKeySplitLength()
public void setKeySplitLocations(java.lang.String keySplitLocations)
ExecutionContext
.
Defaults to "splitLocations".keySplitLocations
- the value of the keypublic java.lang.String getKeySplitLocations()
@Autowired(required=false) public void setConfiguration(org.apache.hadoop.conf.Configuration configuration)
configuration
- the new hadoop configurationpublic org.apache.hadoop.conf.Configuration getConfiguration()
protected abstract java.util.Map<java.lang.String,org.springframework.batch.item.ExecutionContext> createPartitions()
ExecutionContext
s for partitions.ExecutionContext
s for partitionsprotected org.springframework.batch.item.ExecutionContext createExecutionContext(org.springframework.core.io.Resource resource, Split split) throws java.io.IOException
resource
- the resourcesplit
- the splitjava.io.IOException
- Signals that an I/O exception has occurred.protected org.springframework.batch.item.ExecutionContext createExecutionContext(org.apache.hadoop.fs.Path path, Split split) throws java.io.IOException
path
- the pathsplit
- the splitjava.io.IOException
- Signals that an I/O exception has occurred.