Interface BackendResourceAbortable

  • All Known Implementing Classes:
    S3BackendResourceAbortableInputStream

    public interface BackendResourceAbortable
    Backend resource abstraction, such as InputStream, which can be aborted without consuming it fully for efficiency.

    Some Backend implementations such as S3Backend may return an abortable InputStream for a more optimal resource use. S3Backend internally uses Apache HttpClient library which tries to reuse HTTP connections by reading data fully to the end of an attached InputStream on InputStream.close() by default. It can be efficient from a socket pool management perspective, but possibly a significant overhead while bytes are read from S3 just to be discarded. So, a Backend implementation that retrieves an abortable resource may decide to wrap the underlying resource (e.g, InputStream) by this interface (e.g, S3BackendResourceAbortableInputStream) in order to abort the underlying resources (e.g, http request object) without having to read data fully.

    • Method Detail

      • abort

        void abort()
        Abort the underlying backend resource(s).