public class ConcatenatedByteSource extends Object implements ByteSource
Constructor and Description |
---|
ConcatenatedByteSource(List<? extends ByteSource> sources)
Creates a data source representing the concatenation of
the specified sources.
|
Modifier and Type | Method and Description |
---|---|
ByteSource |
authorize(FileClient client)
Creates a new source with the same properties, but using the
specified authorization.
|
SplitIterator |
generateSplits(SplitOptions options)
Gets an iterator producing a set of
DataSplit objects
covering the source. |
static ByteSource |
getConcatenatedSource(List<Path> paths)
Creates a source which is the concatenation of the specified paths,
in order.
|
static ByteSource |
getConcatenatedSource(List<Path> paths,
UnreadableSourceAction onUnreadable)
Creates a source which is the concatenation of the specified paths,
in order.
|
List<ByteSource> |
getSources()
Gets the sources which comprise the combined source.
|
InputStream |
open()
Opens the source for reading.
|
ByteSource |
validate()
Performs validation of the source configuration.
|
public ConcatenatedByteSource(List<? extends ByteSource> sources)
sources
- the data sources to concatenatepublic List<ByteSource> getSources()
public ByteSource authorize(FileClient client)
ByteSource
If a source is supposed to be used with a specific authorization context, this method should be called to produce a new source to use.
authorize
in interface ByteSource
client
- the authorization context to use for accesspublic InputStream open() throws IOException
ByteSource
InputStream
.open
in interface InputStreamSupplier
open
in interface ByteSource
IOException
- if an I/O error occurs while opening the sourcepublic SplitIterator generateSplits(SplitOptions options) throws IOException
ByteSource
DataSplit
objects
covering the source. The source is split as requested
in the specified options, within the source's ability to
meet the requirements.generateSplits
in interface ByteSource
options
- configurable options to use in generating
the splitsIOException
- if an I/O error occurs while generating splitspublic ByteSource validate() throws IOException
ByteSource
validate
in interface ByteSource
IOException
- if an I/O error occurs while
validating the sourcepublic static ByteSource getConcatenatedSource(List<Path> paths)
paths
- the paths to concatenateBasicByteSource
public static ByteSource getConcatenatedSource(List<Path> paths, UnreadableSourceAction onUnreadable)
paths
- the paths to concatenateonUnreadable
- specifies the action to take for unreadable
filesBasicByteSource
Copyright © 2016 Actian Corporation. All rights reserved.