public class OutputStreamInputSplit extends Object implements InputSplit
| Constructor and Description |
|---|
OutputStreamInputSplit(OutputStream outputStream) |
| 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.
|
public OutputStreamInputSplit(OutputStream outputStream)
public boolean canWriteToLocation(URI location)
InputSplitcanWriteToLocation in interface InputSplitlocation - the location to determinepublic String addNewLocation()
InputSplitaddNewLocation in interface InputSplitpublic String addNewLocation(String location)
InputSplitaddNewLocation in interface InputSplitlocation - the location to addpublic void updateSplitLocations(boolean reset)
InputSplitupdateSplitLocations in interface InputSplitpublic boolean needsBootstrapForWrite()
InputSplitInputSplit
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 toneedsBootstrapForWrite in interface InputSplitpublic void bootStrapForWrite()
InputSplitRecordWriterbootStrapForWrite in interface InputSplitpublic OutputStream openOutputStreamFor(String location) throws Exception
InputSplitOutputStream
for the given location.
Note that the user is responsible for closing
the associated output stream.openOutputStreamFor in interface InputSplitlocation - the location to open the output stream forExceptionpublic InputStream openInputStreamFor(String location) throws Exception
InputSplitInputStream
for the given location.
Note that the user is responsible for closing
the associated input stream.openInputStreamFor in interface InputSplitlocation - the location to open the input stream forExceptionpublic long length()
InputSplitlength in interface InputSplitpublic URI[] locations()
InputSplitlocations in interface InputSplitpublic Iterator<URI> locationsIterator()
locationsIterator in interface InputSplitpublic Iterator<String> locationsPathIterator()
locationsPathIterator in interface InputSplitpublic void reset()
InputSplitreset in interface InputSplitpublic boolean resetSupported()
resetSupported in interface InputSplitCopyright © 2020. All rights reserved.