public class FileSplit extends BaseInputSplit
| Modifier and Type | Field and Description |
|---|---|
protected String[] |
allowFormat |
protected Random |
random |
protected boolean |
randomize |
protected boolean |
recursive |
protected File |
rootDir |
iterationOrder, length, uriStrings| Modifier | Constructor and Description |
|---|---|
|
FileSplit(File rootDir) |
|
FileSplit(File rootDir,
Random rng) |
|
FileSplit(File rootDir,
String[] allowFormat) |
|
FileSplit(File rootDir,
String[] allowFormat,
boolean recursive) |
protected |
FileSplit(File rootDir,
String[] allowFormat,
boolean recursive,
Random random,
boolean runMain) |
|
FileSplit(File rootDir,
String[] allowFormat,
Random rng) |
| 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.
|
File |
getRootDir() |
protected void |
initialize() |
long |
length()
Length of the split
|
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.
|
canWriteToLocation, locations, locationsIterator, locationsPathIterator, sampleprotected File rootDir
protected String[] allowFormat
protected boolean recursive
protected Random random
protected boolean randomize
protected FileSplit(File rootDir, String[] allowFormat, boolean recursive, Random random, boolean runMain)
public FileSplit(File rootDir)
protected void initialize()
public String addNewLocation()
InputSplitaddNewLocation in interface InputSplitaddNewLocation in class BaseInputSplitpublic String addNewLocation(String location)
InputSplitaddNewLocation in interface InputSplitaddNewLocation in class BaseInputSplitlocation - the location to addpublic void updateSplitLocations(boolean reset)
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 topublic void bootStrapForWrite()
InputSplitRecordWriterpublic OutputStream openOutputStreamFor(String location) throws Exception
InputSplitOutputStream
for the given location.
Note that the user is responsible for closing
the associated output stream.location - 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.location - the location to open the input stream forExceptionpublic long length()
InputSplitlength in interface InputSplitlength in class BaseInputSplitpublic void reset()
InputSplitpublic boolean resetSupported()
public File getRootDir()
Copyright © 2020. All rights reserved.