public abstract class AbstractSplitter extends Object implements Splitter
Splitter implementations.| Constructor and Description |
|---|
AbstractSplitter()
Instantiates a new abstract splitter.
|
AbstractSplitter(Configuration configuration)
Instantiates a new abstract splitter.
|
| Modifier and Type | Method and Description |
|---|---|
protected Split |
buildSplit(long start,
long length,
String[] hosts)
Builds the split.
|
protected long |
computeSplitSize(long blockSize,
long minSize,
long maxSize)
Compute split size.
|
protected int |
getBlockIndex(BlockLocation[] blocks,
long offset)
Gets the block index.
|
Configuration |
getConfiguration()
Gets the hadoop configuration.
|
abstract List<Split> |
getSplits(Path path)
Gets the input splits for a
Path. |
void |
setConfiguration(Configuration configuration)
Sets the configuration.
|
public AbstractSplitter()
public AbstractSplitter(Configuration configuration)
configuration - the configurationpublic abstract List<Split> getSplits(Path path) throws IOException
SplitterPath. A path needs to
be a resource which can be split into a list of splits. Actual
implementation will define if split is enforced to be a single
file or a collection of files.getSplits in interface Splitterpath - the pathIOException - Signals that an I/O exception has occurred.public Configuration getConfiguration()
@Autowired(required=false) public void setConfiguration(Configuration configuration)
configuration - the new configurationprotected long computeSplitSize(long blockSize,
long minSize,
long maxSize)
blockSize - the block sizeminSize - the min sizemaxSize - the max sizeprotected int getBlockIndex(BlockLocation[] blocks, long offset)
blocks - the blk locationsoffset - the offsetIllegalArgumentException - if offset is outside of blocks