Class HotFileFromProcess

java.lang.Object
org.aksw.jena_sparql_api.io.filter.sys.HotFileFromProcess
All Implemented Interfaces:
org.aksw.commons.io.endpoint.FileCreation, HotFile

public class HotFileFromProcess extends Object implements HotFile
  • Field Details

    • path

      protected Path path
    • writeChannel

      protected Channel writeChannel
    • disposable

      protected io.reactivex.rxjava3.disposables.Disposable disposable
    • resultFuture

      protected CompletableFuture<Path> resultFuture
  • Constructor Details

    • HotFileFromProcess

      public HotFileFromProcess(Path path, io.reactivex.rxjava3.core.Single<Integer> processSingle)
  • Method Details

    • createStarted

      public static HotFileFromProcess createStarted(Path hotFile, io.reactivex.rxjava3.core.Single<Integer> processSingle)
      Calling this method will subscribe to the single (on Schedulers.io()) and thus start its attached process
      Parameters:
      hotFile - The file being written to
      processSingle - The single capturing the process
      Returns:
    • abort

      public void abort()
      Specified by:
      abort in interface org.aksw.commons.io.endpoint.FileCreation
    • init

      public void init(Path path, io.reactivex.rxjava3.core.Single<Integer> processSingle)
      Parameters:
      path - The path being written to by the process
      processSingle - A cold single wrapping the process and yielding its exit code
    • future

      public CompletableFuture<Path> future()
      Specified by:
      future in interface org.aksw.commons.io.endpoint.FileCreation
    • newInputStream

      public InputStream newInputStream() throws IOException
      Description copied from interface: HotFile
      Open a new stream to the hot file The input stream delivery may be delayed until after the file creation is complete. TODO Add a flag to hint the methods behavior
      Specified by:
      newInputStream in interface HotFile
      Returns:
      Throws:
      IOException
    • main

      public static void main(String[] args) throws InterruptedException, IOException
      Throws:
      InterruptedException
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object