Package org.datavec.api.split
Class BaseInputSplit
- java.lang.Object
-
- org.datavec.api.split.BaseInputSplit
-
- All Implemented Interfaces:
InputSplit
- Direct Known Subclasses:
CollectionInputSplit,FileSplit,TransformSplit
public abstract class BaseInputSplit extends Object implements InputSplit
Base input split- Author:
- Adam Gibson
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]iterationOrderprotected longlengthprotected List<String>uriStrings
-
Constructor Summary
Constructors Constructor Description BaseInputSplit()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddNewLocation()Add a new location with the name generated by this input split/StringaddNewLocation(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)booleancanWriteToLocation(URI location)Returns true if the given uri can be written tolonglength()Length of the splitURI[]locations()Locations of the splitsIterator<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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.datavec.api.split.InputSplit
bootStrapForWrite, needsBootstrapForWrite, openInputStreamFor, openOutputStreamFor, reset, resetSupported, updateSplitLocations
-
-
-
-
Method Detail
-
canWriteToLocation
public boolean canWriteToLocation(URI location)
Description copied from interface:InputSplitReturns true if the given uri can be written to- Specified by:
canWriteToLocationin interfaceInputSplit- Parameters:
location- the location to determine- Returns:
-
addNewLocation
public String addNewLocation()
Description copied from interface:InputSplitAdd a new location with the name generated by this input split/- Specified by:
addNewLocationin interfaceInputSplit
-
addNewLocation
public String addNewLocation(String location)
Description copied from interface:InputSplitAdd a new location to this input split (this may do anything from updating an in memory location to creating a new file)- Specified by:
addNewLocationin interfaceInputSplit- Parameters:
location- the location to add
-
locations
public URI[] locations()
Description copied from interface:InputSplitLocations of the splits- Specified by:
locationsin interfaceInputSplit- Returns:
-
locationsIterator
public Iterator<URI> locationsIterator()
- Specified by:
locationsIteratorin interfaceInputSplit- Returns:
-
locationsPathIterator
public Iterator<String> locationsPathIterator()
- Specified by:
locationsPathIteratorin interfaceInputSplit- Returns:
-
length
public long length()
Description copied from interface:InputSplitLength of the split- Specified by:
lengthin interfaceInputSplit- Returns:
-
sample
public 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.- Parameters:
pathFilter- to modify the locations in some way (null == as is)weights- to split the locations into multiple InputSplit- Returns:
- the sampled locations
-
-