Class StreamFactoryRequirements

java.lang.Object
org.apache.hadoop.fs.s3a.impl.streams.StreamFactoryRequirements

public class StreamFactoryRequirements extends Object
Requirements for requirements for streams from this factory, including threading and vector IO, and of the Filesystem instance itself via StreamFactoryRequirements.Requirements. The FS is expected to adapt its internal configuration based on the requirements passed back by the stream factory after its creation.
  • Constructor Details

    • StreamFactoryRequirements

      public StreamFactoryRequirements(int sharedThreads, int streamThreads, VectoredIOContext vectoredIOContext, StreamFactoryRequirements.Requirements... requirements)
      Create the thread options.
      Parameters:
      sharedThreads - Number of shared threads to included in the bounded pool.
      streamThreads - How many threads per stream, ignoring vector IO requirements.
      vectoredIOContext - vector IO settings -made immutable if not already done.
      requirements - requirement flags of the factory and stream.
  • Method Details

    • sharedThreads

      public int sharedThreads()
      Number of shared threads to included in the bounded pool.
      Returns:
      extra threads to be created in the FS thread pool.
    • streamThreads

      public int streamThreads()
      The maximum number of threads which can be used should by a single input stream.
      Returns:
      thread pool requirements.
    • requiresFuturePool

      public boolean requiresFuturePool()
      Should the future pool be created?
      Returns:
      true if the future pool is required.
    • vectoredIOContext

      public VectoredIOContext vectoredIOContext()
      The VectorIO requirements of streams.
      Returns:
      vector IO context.
    • requires

      public boolean requires(StreamFactoryRequirements.Requirements r)
      Does this factory have this requirement?
      Parameters:
      r - requirement to probe for.
      Returns:
      true if this is a requirement.
    • toString

      public String toString()
      Overrides:
      toString in class Object