public abstract class BaseInputSplit extends Object implements InputSplit
Modifier and Type | Field and Description |
---|---|
protected int[] |
iterationOrder |
protected long |
length |
protected List<String> |
uriStrings |
Constructor and Description |
---|
BaseInputSplit() |
Modifier and Type | Method and Description |
---|---|
WritableType |
getType() |
long |
length()
Length of the split
|
URI[] |
locations()
Locations of the splits
|
Iterator<URI> |
locationsIterator() |
Iterator<String> |
locationsPathIterator() |
InputSplit[] |
sample(PathFilter pathFilter,
double... weights)
Samples the locations based on the PathFilter and splits the result into
an array of InputSplit objects, with sizes proportional to the weights.
|
double |
toDouble()
Convert Writable to double.
|
float |
toFloat()
Convert Writable to float.
|
int |
toInt()
Convert Writable to int.
|
long |
toLong()
Convert Writable to long.
|
void |
writeType(DataOutput out)
Write the type (a single short value) to the DataOutput.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
reset
readFields, write
public URI[] locations()
InputSplit
locations
in interface InputSplit
public Iterator<URI> locationsIterator()
locationsIterator
in interface InputSplit
public Iterator<String> locationsPathIterator()
locationsPathIterator
in interface InputSplit
public long length()
InputSplit
length
in interface InputSplit
public double toDouble()
Writable
public float toFloat()
Writable
public int toInt()
Writable
public long toLong()
Writable
public void writeType(DataOutput out) throws IOException
Writable
WritableFactory
for details.writeType
in interface Writable
out
- DataOutput to write toIOException
- For errors during writingpublic InputSplit[] sample(PathFilter pathFilter, double... weights)
pathFilter
- to modify the locations in some way (null == as is)weights
- to split the locations into multiple InputSplitpublic WritableType getType()
Copyright © 2017. All rights reserved.