Class LimitedConnectionsFileSystem.ConnectionLimitingSettings

  • Enclosing class:
    LimitedConnectionsFileSystem

    public static class LimitedConnectionsFileSystem.ConnectionLimitingSettings
    extends Object
    A simple configuration data object capturing the settings for limited connections.
    • Field Detail

      • limitTotal

        public final int limitTotal
        The limit for the total number of connections, or 0, if no limit.
      • limitInput

        public final int limitInput
        The limit for the number of input stream connections, or 0, if no limit.
      • limitOutput

        public final int limitOutput
        The limit for the number of output stream connections, or 0, if no limit.
      • streamOpenTimeout

        public final long streamOpenTimeout
        The stream opening timeout for a stream, in milliseconds.
      • streamInactivityTimeout

        public final long streamInactivityTimeout
        The inactivity timeout for a stream, in milliseconds.
    • Constructor Detail

      • ConnectionLimitingSettings

        public ConnectionLimitingSettings​(int limitTotal,
                                          int limitInput,
                                          int limitOutput,
                                          long streamOpenTimeout,
                                          long streamInactivityTimeout)
        Creates a new ConnectionLimitingSettings with the given parameters.
        Parameters:
        limitTotal - The limit for the total number of connections, or 0, if no limit.
        limitInput - The limit for the number of input stream connections, or 0, if no limit.
        limitOutput - The limit for the number of output stream connections, or 0, if no limit.
        streamOpenTimeout - The maximum number of milliseconds that the file system will wait when no more connections are currently permitted.
        streamInactivityTimeout - The milliseconds that a stream may spend not writing any bytes before it is closed as inactive.
    • Method Detail

      • fromConfig

        @Nullable
        public static LimitedConnectionsFileSystem.ConnectionLimitingSettings fromConfig​(Configuration config,
                                                                                         String fsScheme)
        Parses and returns the settings for connection limiting, for the file system with the given file system scheme.
        Parameters:
        config - The configuration to check.
        fsScheme - The file system scheme.
        Returns:
        The parsed configuration, or null, if no connection limiting is configured.