Class FilterExecutionFromSysFunction
java.lang.Object
org.aksw.jena_sparql_api.io.filter.sys.FilterExecutionFromSysFunction
- All Implemented Interfaces:
FilterConfig
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SysCallFnprotected FilterMetadatastatic final Pathprotected Destination -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFilterExecutionFromSysFunction(SysCallFn cmdFactory, Destination source) -
Method Summary
Modifier and TypeMethodDescriptionprotected Pathprotected Pathio.reactivex.rxjava3.core.Single<HotFile>awaitOrAllocateInputFileAndFilterToFile(Destination effectiveSource, Path tgtPath) io.reactivex.rxjava3.core.Single<HotFile>awaitOrAllocateInputFileAndFilterToFileCore(io.reactivex.rxjava3.core.Single<? extends org.aksw.commons.io.endpoint.FileCreation> fileCreation, Path tgtPath) io.reactivex.rxjava3.core.Single<InputStreamSupplier>awaitOrAllocateInputFileAndFilterToStream(Destination effectiveSource) io.reactivex.rxjava3.core.Single<InputStreamSupplier>Actually execute the filter Because we always prefer streams over files (which get passed as arguments), we check the availability and applicability of commands of the cmdFactory in the following order: - stream to stream - stream to file (we can stream the file being generated) - file to stream - file to file the 'file to stream' cases will try to reuse files under generation in the source destination Invokes ifNeedsFileInput and ifNeedsFileOutput handlers as neededio.reactivex.rxjava3.core.Single<HotFile>execToHotFile(Path tgtPath) Execute the stream and write the result to a hot file TODO What if the input is a hot file? We can wait for file completion or we can connect to its stream.extractKnownPathFromDestination(Destination destination) static io.reactivex.rxjava3.core.Single<? extends org.aksw.commons.io.endpoint.FileCreation>forceDestinationToFile(io.reactivex.rxjava3.core.Single<InputStreamSupplier> xxx, Path tmpFile) io.reactivex.rxjava3.core.Single<? extends org.aksw.commons.io.endpoint.FileCreation>forceInputFileCreation(Destination effectiveSource) ifNeedsFileInput(Supplier<Path> pathRequester, BiConsumer<Path, FileWritingProcess> processCallback) ifNeedsFileOutput(Supplier<Path> pathRequester, BiConsumer<Path, FileWritingProcess> processCallback) outputToFile(Path path) If explicit output to a file is requested, the handler set via ifNeedsFileOutput will not be called.If the execution requires the generation of an intermediate file, the handler for ifNeedsFileOutput should be calledpipeInto(FilterEngine nextFilter) booleanActually execute the stream and write the result to a filetoString()io.reactivex.rxjava3.core.Single<? extends org.aksw.commons.io.endpoint.FileCreation>tryGetFileCreation(Destination destination)
-
Field Details
-
PROBE_PATH
-
cmdFactory
-
filterMetadata
-
source
-
-
Constructor Details
-
FilterExecutionFromSysFunction
-
-
Method Details
-
requiresFileOutput
public boolean requiresFileOutput()Actually execute the stream and write the result to a file- Specified by:
requiresFileOutputin interfaceFilterConfig- Parameters:
path-- Returns:
-
extractKnownPathFromDestination
-
allocateInputFile
-
allocateOutputFile
-
getEffectiveSource
-
execToHotFile
Execute the stream and write the result to a hot file TODO What if the input is a hot file? We can wait for file completion or we can connect to its stream. We always prefer the stream, unless the file is already ready, because in that case we may be able to skip the JVM- Parameters:
tgtPath-- Returns:
-
tryGetFileCreation
public io.reactivex.rxjava3.core.Single<? extends org.aksw.commons.io.endpoint.FileCreation> tryGetFileCreation(Destination destination) -
awaitOrAllocateInputFileAndFilterToFile
public io.reactivex.rxjava3.core.Single<HotFile> awaitOrAllocateInputFileAndFilterToFile(Destination effectiveSource, Path tgtPath) -
forceDestinationToFile
public static io.reactivex.rxjava3.core.Single<? extends org.aksw.commons.io.endpoint.FileCreation> forceDestinationToFile(io.reactivex.rxjava3.core.Single<InputStreamSupplier> xxx, Path tmpFile) -
forceInputFileCreation
public io.reactivex.rxjava3.core.Single<? extends org.aksw.commons.io.endpoint.FileCreation> forceInputFileCreation(Destination effectiveSource) -
awaitOrAllocateInputFileAndFilterToFileCore
-
awaitOrAllocateInputFileAndFilterToStream
public io.reactivex.rxjava3.core.Single<InputStreamSupplier> awaitOrAllocateInputFileAndFilterToStream(Destination effectiveSource) -
execStream
Actually execute the filter Because we always prefer streams over files (which get passed as arguments), we check the availability and applicability of commands of the cmdFactory in the following order: - stream to stream - stream to file (we can stream the file being generated) - file to stream - file to file the 'file to stream' cases will try to reuse files under generation in the source destination Invokes ifNeedsFileInput and ifNeedsFileOutput handlers as needed- Specified by:
execStreamin interfaceFilterConfig
-
ifNeedsFileInput
public FilterConfig ifNeedsFileInput(Supplier<Path> pathRequester, BiConsumer<Path, FileWritingProcess> processCallback) - Specified by:
ifNeedsFileInputin interfaceFilterConfig
-
ifNeedsFileOutput
public FilterConfig ifNeedsFileOutput(Supplier<Path> pathRequester, BiConsumer<Path, FileWritingProcess> processCallback) - Specified by:
ifNeedsFileOutputin interfaceFilterConfig
-
pipeInto
- Specified by:
pipeIntoin interfaceFilterConfig
-
outputToFile
Description copied from interface:FilterConfigIf explicit output to a file is requested, the handler set via ifNeedsFileOutput will not be called.- Specified by:
outputToFilein interfaceFilterConfig- Returns:
-
outputToStream
Description copied from interface:FilterConfigIf the execution requires the generation of an intermediate file, the handler for ifNeedsFileOutput should be called- Specified by:
outputToStreamin interfaceFilterConfig- Returns:
-
toString
-