public interface InputSplit
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)
|
void |
bootStrapForWrite()
Bootstrap this input split for writing.
|
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() |
boolean |
needsBootstrapForWrite()
Returns true if this
InputSplit
needs bootstrapping for writing. |
InputStream |
openInputStreamFor(String location)
Open an
InputStream
for the given location. |
OutputStream |
openOutputStreamFor(String location)
Open an
OutputStream
for the given location. |
void |
reset()
Reset the InputSplit without reinitializing it from scratch.
|
boolean |
resetSupported() |
void |
updateSplitLocations(boolean reset)
Refreshes the split locations
if needed in memory.
|
boolean canWriteToLocation(URI location)
location
- the location to determineString addNewLocation()
String addNewLocation(String location)
location
- the location to addvoid updateSplitLocations(boolean reset)
reset
- boolean needsBootstrapForWrite()
InputSplit
needs bootstrapping for writing.
A simple example of needing bootstrapping is for
FileSplit
where there is only a directory
existing, but no file to write tovoid bootStrapForWrite()
RecordWriter
OutputStream openOutputStreamFor(String location) throws Exception
OutputStream
for the given location.
Note that the user is responsible for closing
the associated output stream.location
- the location to open the output stream forException
InputStream openInputStreamFor(String location) throws Exception
InputStream
for the given location.
Note that the user is responsible for closing
the associated input stream.location
- the location to open the input stream forException
long length()
URI[] locations()
void reset()
boolean resetSupported()
Copyright © 2022. All rights reserved.