Class FilterExecutionFromSysFunction

java.lang.Object
org.aksw.jena_sparql_api.io.filter.sys.FilterExecutionFromSysFunction
All Implemented Interfaces:
FilterConfig

public class FilterExecutionFromSysFunction extends Object implements FilterConfig
  • Field Details

  • Constructor Details

    • FilterExecutionFromSysFunction

      protected FilterExecutionFromSysFunction(SysCallFn cmdFactory, Destination source)
  • Method Details

    • requiresFileOutput

      public boolean requiresFileOutput()
      Actually execute the stream and write the result to a file
      Specified by:
      requiresFileOutput in interface FilterConfig
      Parameters:
      path -
      Returns:
    • extractKnownPathFromDestination

      public Path extractKnownPathFromDestination(Destination destination)
    • allocateInputFile

      protected Path allocateInputFile()
    • allocateOutputFile

      protected Path allocateOutputFile()
    • getEffectiveSource

      public Destination getEffectiveSource()
    • execToHotFile

      public 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. 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

      public io.reactivex.rxjava3.core.Single<HotFile> awaitOrAllocateInputFileAndFilterToFileCore(io.reactivex.rxjava3.core.Single<? extends org.aksw.commons.io.endpoint.FileCreation> fileCreation, Path tgtPath)
    • awaitOrAllocateInputFileAndFilterToStream

      public io.reactivex.rxjava3.core.Single<InputStreamSupplier> awaitOrAllocateInputFileAndFilterToStream(Destination effectiveSource)
    • execStream

      public 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
      Specified by:
      execStream in interface FilterConfig
    • ifNeedsFileInput

      public FilterConfig ifNeedsFileInput(Supplier<Path> pathRequester, BiConsumer<Path,FileWritingProcess> processCallback)
      Specified by:
      ifNeedsFileInput in interface FilterConfig
    • ifNeedsFileOutput

      public FilterConfig ifNeedsFileOutput(Supplier<Path> pathRequester, BiConsumer<Path,FileWritingProcess> processCallback)
      Specified by:
      ifNeedsFileOutput in interface FilterConfig
    • pipeInto

      public FilterConfig pipeInto(FilterEngine nextFilter)
      Specified by:
      pipeInto in interface FilterConfig
    • outputToFile

      public DestinationFromFileCreation outputToFile(Path path)
      Description copied from interface: FilterConfig
      If explicit output to a file is requested, the handler set via ifNeedsFileOutput will not be called.
      Specified by:
      outputToFile in interface FilterConfig
      Returns:
    • outputToStream

      public Destination outputToStream()
      Description copied from interface: FilterConfig
      If the execution requires the generation of an intermediate file, the handler for ifNeedsFileOutput should be called
      Specified by:
      outputToStream in interface FilterConfig
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object