Class InputStreamPipe<T>

    • Constructor Detail

      • InputStreamPipe

        public InputStreamPipe​(int bufferSizeBytes,
                               Compression compression)
        Constructor
        Parameters:
        bufferSizeBytes - The requires buffer size, if <= 0 we don't use a buffer
        compression - Compression type
    • Method Detail

      • start

        public void start()
                   throws PipeException,
                          InterruptedException
        Description copied from interface: BasePipe
        Performs pre-processing prior to item flow throw the pipe. Implementations must call the same method for all their input pipes before accessing their items. This is typically done here.
        Specified by:
        start in interface BasePipe
        Throws:
        PipeException - In case of pipe errors in this pipe or somewhere up-stream.
        InterruptedException - In case that the operation has been interrupted by another thread.
      • getInputStream

        protected InputStream getInputStream()
        Returns:
        The input stream initialized according to the ctor parameters. Subclasses may use this stream in their start method after calling super.start().
      • getInputStreamSize

        protected Long getInputStreamSize()
        Returns:
        The expected input stream size, when created. Subclasses may use this stream in their start method after calling super.start().
      • getProgress

        public float getProgress()
        Specified by:
        getProgress in interface BasePipe
        Returns:
        The pipe flow progress, as a floating number between 0.0 and 1.0. Important implementation rules: 1) Calling this method before start() call is complete isn't allowed and has an undefined behavior. 2) Implementation should do best effort to provide an estimate of the progress this pipe has made (0.0 - 1.0) 3) When the pipe is fully consumed, getProgress() should return 1.0. 4) Results must be monotonous, i.e. results of consecutive calls may never be decreasing. 5) Thread safety: progress may be maintained by some thread/s but monitoring by other threads. Implementations must be thread safe.