Class FeedParams.Builder

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

public static final class FeedParams.Builder extends Object
Mutable class used to instantiate a FeedParams.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setSilentUpgrade

      public FeedParams.Builder setSilentUpgrade(boolean silentUpgrade)
      Make server not throw 4xx/5xx for situations that are normal during upgrade as this can esily mask other problems. This feature need to be supported on server side to work, but it is still safe to enable it, even if server does not yet support it. As of Nov 22 2016 it is not yet implemented on the server side.
      Parameters:
      silentUpgrade - true for reducing "false" 4xx/5xx.
      Returns:
      this, for chaining
    • setMaxSleepTimeMs

      public FeedParams.Builder setMaxSleepTimeMs(long ms)
      When throttling the load due to transient errors on gateway, what is the most time to wait between requests per thread. Only active for V3 protocol.
      Parameters:
      ms - max with time
      Returns:
      this, for chaining
    • setDenyIfBusyV3

      public FeedParams.Builder setDenyIfBusyV3(boolean value)
      If this is set to false, the gateway will block threads until messagebus can send the message. If true, the gateway will exit and fail the request early if there are many threads already blocked.
      Parameters:
      value - true to reduce number of blocked threads in gateway.
      Returns:
      this, for chaining
    • setDataFormat

      public FeedParams.Builder setDataFormat(FeedParams.DataFormat dataFormat)
      Sets the data format to be used.
      Parameters:
      dataFormat - the data format to be used.
      Returns:
      this, for chaining
      See Also:
    • setRoute

      public FeedParams.Builder setRoute(String route)
      Sets a route to be used for all Clusters, unless overridden on a per-cluster basis in Cluster.getRoute().
      Parameters:
      route - a route to be used for all Clusters.
      Returns:
      this, for chaining
    • setServerTimeout

      public FeedParams.Builder setServerTimeout(long serverTimeout, TimeUnit unit)
      Sets the server-side timeout of each operation - i.e. the timeout used by the server endpoint for operations going over the message bus protocol into Vespa. Note that the TOTAL timeout of any one operation in this API would be getServerTimeout(java.util.concurrent.TimeUnit) + getClientTimeout(java.util.concurrent.TimeUnit).
      Parameters:
      serverTimeout - timeout value
      unit - unit of timeout value
      Returns:
      this, for chaining
    • setClientTimeout

      public FeedParams.Builder setClientTimeout(long clientTimeout, TimeUnit unit)
      Sets the client-side timeout for each operation. If BOTH the server-side timeout AND this timeout has passed, the FeedClient will synthesize a Result. Note that the TOTAL timeout of any one operation in this API would be getServerTimeout(java.util.concurrent.TimeUnit) + getClientTimeout(java.util.concurrent.TimeUnit), after which a result callback is guaranteed to be made.
      Parameters:
      clientTimeout - timeout value
      unit - unit of timeout value
      Returns:
      this, for chaining
    • setMaxChunkSizeBytes

      public FeedParams.Builder setMaxChunkSizeBytes(int maxChunkSizeBytes)
      Sets the maximum number of bytes of document data to send per HTTP request.
      Parameters:
      maxChunkSizeBytes - max number of bytes per HTTP request.
      Returns:
      this, for chaining
    • setMaxInFlightRequests

      public FeedParams.Builder setMaxInFlightRequests(int maxInFlightRequests)
      Sets the maximum number of operations to be in-flight.
      Parameters:
      maxInFlightRequests - max number of operations.
      Returns:
      this, for chaining
    • setLocalQueueTimeOut

      public FeedParams.Builder setLocalQueueTimeOut(long timeOutMs)
      Sets the number of milliseconds until we respond with a timeout for a document operation if we still have not received a response.
    • setIdlePollFrequency

      public FeedParams.Builder setIdlePollFrequency(Double idlePollFrequency)
      Set what frequency to poll for async responses. Default is 10hz (every 0.1s), but 1000hz when using SyncFeedClient
    • setPriority

      public FeedParams.Builder setPriority(String priority)
      Sets the messagebus priority. The allowed values are HIGHEST, VERY_HIGH, HIGH_[1-3], NORMAL_[1-6], LOW_[1-3], VERY_LOW, and LOWEST..
      Parameters:
      priority - messagebus priority of this message.
      Returns:
      this, for chaining
    • build

      public FeedParams build()
      Instantiates a FeedParams.
      Returns:
      a FeedParams object with the parameters of this Builder
    • getClientTimeout

      public long getClientTimeout(TimeUnit unit)
    • getServerTimeout

      public long getServerTimeout(TimeUnit unit)
    • getRoute

      public String getRoute()
    • getDataFormat

      public FeedParams.DataFormat getDataFormat()
    • getMaxChunkSizeBytes

      public int getMaxChunkSizeBytes()
    • getMaxInFlightRequests

      public int getMaxInFlightRequests()