Class DestinationFromSwitch
java.lang.Object
org.aksw.jena_sparql_api.io.endpoint.DestinationFromSwitch
- All Implemented Interfaces:
Destination
Switching destination
If a file for a DestinationFromFileCreation finishes, it can replace itself with
a DestinationFromFile
Right now I am not sure whether this is useful: If a stream is requested, it has to
do all the preparation work anyway
If we think of a source + filter as a virtual source, then it is actually ok:
Let's not forget that a destination is a supplier for input streams
Repeatedly executing such a workflow may re-use prior generated files instead of
repeating the process again from the source file
However, the purpose of this framework is not to do full caching, but only
abstract java and system filters, but allow controlling what should happen with the files
in case they get generated.
The next level of abstraction could be thought of as treating files as stores: E.g. writing a stream to HDFS
and passing a reference to it to a system command
- Author:
- raven
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet a description of the creation status.io.reactivex.rxjava3.core.Single<DestinationFromFile>materialize(Supplier<Path> preferredPathCallback) Materialize the destination to a given file.io.reactivex.rxjava3.core.Single<InputStreamSupplier>This method requests a supplier for inputstreams.transferTo(FilterEngine engine) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aksw.jena_sparql_api.io.endpoint.Destination
cancelCreation
-
Field Details
-
destination
-
-
Constructor Details
-
DestinationFromSwitch
public DestinationFromSwitch()
-
-
Method Details
-
getDestination
-
prepareStream
Description copied from interface:DestinationThis method requests a supplier for inputstreams. For basic destinations, such as FileDestination, this process does not involve any overhead. However, if the destination represents a workflow, prepareStream may trigger a complex execution. The execution may generate a file from which streams can be obtained, or nothing gets executed at this point, and execution only occur when opening an input stream.- Specified by:
prepareStreamin interfaceDestination- Returns:
-
transferTo
- Specified by:
transferToin interfaceDestination
-
materialize
public io.reactivex.rxjava3.core.Single<DestinationFromFile> materialize(Supplier<Path> preferredPathCallback) throws IOException Description copied from interface:DestinationMaterialize the destination to a given file. If the destination is already a file it waits until it has been completed. For non-file destinations, the callback is invoked to obtain a preferred file name- Specified by:
materializein interfaceDestination- Returns:
- Throws:
IOException
-
getCreationStatus
Description copied from interface:DestinationGet a description of the creation status.- Specified by:
getCreationStatusin interfaceDestination- Returns:
-