public interface ByteSource extends InputStreamSupplier
ByteSource
objects
represent entities existing outside of a logical graph,
such as files and sockets, which can be read as a stream
of bytes. These can then be used in conjunction with
DataFormat
objects to produce records which then
flow through the dataflow graph, the most common reason
being loading persisted data from disk.
Generally, it is not necessarily to implement or even
directly use ByteSource
objects. Most read operators
provide a more convenient interface which obscures
the object; see AbstractReader
as an example.
By default, sources use OS-level authorization inherited from the execution environment, but can be configured to use use more complex authentication mechanisms to provide an authorization context.
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. |
InputStream |
open()
Opens the source for reading.
|
ByteSource |
validate()
Performs validation of the source configuration.
|
ByteSource authorize(FileClient client)
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.
client
- the authorization context to use for accessByteSource validate() throws IOException
IOException
- if an I/O error occurs while
validating the sourceInputStream open() throws IOException
InputStream
.open
in interface InputStreamSupplier
IOException
- if an I/O error occurs while opening the sourceSplitIterator generateSplits(SplitOptions options) throws IOException
DataSplit
objects
covering the source. The source is split as requested
in the specified options, within the source's ability to
meet the requirements.options
- configurable options to use in generating
the splitsIOException
- if an I/O error occurs while generating splitsCopyright © 2016 Actian Corporation. All rights reserved.