public class FilterExecutionFromSysFunction extends Object implements FilterConfig
| Modifier and Type | Field and Description |
|---|---|
protected SysCallFn |
cmdFactory |
protected FilterMetadata |
filterMetadata |
static Path |
PROBE_PATH |
protected Destination |
source |
| Modifier | Constructor and Description |
|---|---|
protected |
FilterExecutionFromSysFunction(SysCallFn cmdFactory,
Destination source) |
| Modifier and Type | Method and Description |
|---|---|
protected Path |
allocateInputFile() |
protected Path |
allocateOutputFile() |
io.reactivex.rxjava3.core.Single<HotFile> |
awaitOrAllocateInputFileAndFilterToFile(Destination effectiveSource,
Path tgtPath) |
io.reactivex.rxjava3.core.Single<HotFile> |
awaitOrAllocateInputFileAndFilterToFileCore(io.reactivex.rxjava3.core.Single<? extends FileCreation> fileCreation,
Path tgtPath) |
io.reactivex.rxjava3.core.Single<InputStreamSupplier> |
awaitOrAllocateInputFileAndFilterToStream(Destination effectiveSource) |
io.reactivex.rxjava3.core.Single<InputStreamSupplier> |
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
|
io.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.
|
Path |
extractKnownPathFromDestination(Destination destination) |
static io.reactivex.rxjava3.core.Single<? extends FileCreation> |
forceDestinationToFile(io.reactivex.rxjava3.core.Single<InputStreamSupplier> xxx,
Path tmpFile) |
io.reactivex.rxjava3.core.Single<? extends FileCreation> |
forceInputFileCreation(Destination effectiveSource) |
Destination |
getEffectiveSource() |
FilterConfig |
ifNeedsFileInput(Supplier<Path> pathRequester,
BiConsumer<Path,FileWritingProcess> processCallback) |
FilterConfig |
ifNeedsFileOutput(Supplier<Path> pathRequester,
BiConsumer<Path,FileWritingProcess> processCallback) |
DestinationFromFileCreation |
outputToFile(Path path)
If explicit output to a file is requested, the handler set via
ifNeedsFileOutput will not be called.
|
Destination |
outputToStream()
If the execution requires the generation of an intermediate file, the
handler for ifNeedsFileOutput should be called
|
FilterConfig |
pipeInto(FilterEngine nextFilter) |
boolean |
requiresFileOutput()
Actually execute the stream and write the result to a file
|
String |
toString() |
io.reactivex.rxjava3.core.Single<? extends FileCreation> |
tryGetFileCreation(Destination destination) |
public static final Path PROBE_PATH
protected SysCallFn cmdFactory
protected FilterMetadata filterMetadata
protected Destination source
protected FilterExecutionFromSysFunction(SysCallFn cmdFactory, Destination source)
public boolean requiresFileOutput()
requiresFileOutput in interface FilterConfigpath - public Path extractKnownPathFromDestination(Destination destination)
protected Path allocateInputFile()
protected Path allocateOutputFile()
public Destination getEffectiveSource()
public io.reactivex.rxjava3.core.Single<HotFile> execToHotFile(Path tgtPath)
tgtPath - public io.reactivex.rxjava3.core.Single<? extends FileCreation> tryGetFileCreation(Destination destination)
public io.reactivex.rxjava3.core.Single<HotFile> awaitOrAllocateInputFileAndFilterToFile(Destination effectiveSource, Path tgtPath)
public static io.reactivex.rxjava3.core.Single<? extends FileCreation> forceDestinationToFile(io.reactivex.rxjava3.core.Single<InputStreamSupplier> xxx, Path tmpFile)
public io.reactivex.rxjava3.core.Single<? extends FileCreation> forceInputFileCreation(Destination effectiveSource)
public io.reactivex.rxjava3.core.Single<HotFile> awaitOrAllocateInputFileAndFilterToFileCore(io.reactivex.rxjava3.core.Single<? extends FileCreation> fileCreation, Path tgtPath)
public io.reactivex.rxjava3.core.Single<InputStreamSupplier> awaitOrAllocateInputFileAndFilterToStream(Destination effectiveSource)
public io.reactivex.rxjava3.core.Single<InputStreamSupplier> execStream()
execStream in interface FilterConfigpublic FilterConfig ifNeedsFileInput(Supplier<Path> pathRequester, BiConsumer<Path,FileWritingProcess> processCallback)
ifNeedsFileInput in interface FilterConfigpublic FilterConfig ifNeedsFileOutput(Supplier<Path> pathRequester, BiConsumer<Path,FileWritingProcess> processCallback)
ifNeedsFileOutput in interface FilterConfigpublic FilterConfig pipeInto(FilterEngine nextFilter)
pipeInto in interface FilterConfigpublic DestinationFromFileCreation outputToFile(Path path)
FilterConfigoutputToFile in interface FilterConfigpublic Destination outputToStream()
FilterConfigoutputToStream in interface FilterConfigCopyright © 2020. All rights reserved.