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 |
---|---|
String |
addNewLocation()
Add a new location with the name generated
by this input split/
|
String |
addNewLocation(String location)
Add a new location to this input split
(this may do anything from updating an in memory location
to creating a new file)
|
boolean |
canWriteToLocation(URI location)
Returns true if the given uri
can be written to
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bootStrapForWrite, needsBootstrapForWrite, openInputStreamFor, openOutputStreamFor, reset, resetSupported, updateSplitLocations
public boolean canWriteToLocation(URI location)
InputSplit
canWriteToLocation
in interface InputSplit
location
- the location to determinepublic String addNewLocation()
InputSplit
addNewLocation
in interface InputSplit
public String addNewLocation(String location)
InputSplit
addNewLocation
in interface InputSplit
location
- the location to addpublic 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 InputSplit[] sample(PathFilter pathFilter, double... weights)
pathFilter
- to modify the locations in some way (null == as is)weights
- to split the locations into multiple InputSplitCopyright © 2022. All rights reserved.