Class SessionParams.Builder

java.lang.Object
com.yahoo.vespa.http.client.config.SessionParams.Builder
Enclosing class:
SessionParams

public static final class SessionParams.Builder extends Object
Mutable class used to instantiate a SessionParams. A builder instance will at the very least contain cluster settings ( addCluster(Cluster)), for supporting SSL and similar transport settings, use setConnectionParams(ConnectionParams).
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • addCluster

      public SessionParams.Builder addCluster(Cluster cluster)
      Add a Vespa installation for feeding documents into.
      Returns:
      this Builder instance, to support chaining
    • setFeedParams

      public SessionParams.Builder setFeedParams(FeedParams feedParams)
      Set parameters used for feeding the documents in the receiving cluster. Reasonable defaults are supplied, so setting this should not be necessary for testing.
      Returns:
      this builder instance to support chaining
    • setConnectionParams

      public SessionParams.Builder setConnectionParams(ConnectionParams connectionParams)
      Transport parameters, like custom HTTP headers.
      Returns:
      this Builder instance, to support chaining
    • setErrorReporter

      public SessionParams.Builder setErrorReporter(SessionParams.ErrorReporter errorReporter)
      Sets an error reporter that is invoked in case of serious errors.
      Parameters:
      errorReporter - the handler
      Returns:
      pointer to builder.
    • setClientQueueSize

      public SessionParams.Builder setClientQueueSize(int clientQueueSize)
      Sets the maximum number of document operations to hold in memory, waiting to be sent to Vespa. When this threshold is reached, OutputStream.close() will block.
      Parameters:
      clientQueueSize - the maximum number of document operations to hold in memory.
      Returns:
      pointer to builder.
    • setThrottlerMinSize

      public SessionParams.Builder setThrottlerMinSize(int throttlerMinSize)
      Sets the minimum queue size of the throttler. If this is zero, it means that dynamic throttling is not enabled. Otherwise it is the minimum size of the throttler for how many parallel requests that are accepted. The max size of the throttler is the clientQueueSize.
      Parameters:
      throttlerMinSize - the value of the min size.
      Returns:
      the minimum number of requests to be used in throttler or zero if throttler is static.
    • build

      public SessionParams build()
      Instantiates a SessionParams that can be given to a FeedClientFactory.
      Returns:
      a SessionParams object with the parameters of this Builder
    • getFeedParams

      public FeedParams getFeedParams()
    • getConnectionParams

      public ConnectionParams getConnectionParams()
    • getClientQueueSize

      public int getClientQueueSize()
    • getThrottlerMinSize

      public int getThrottlerMinSize()