Class FeedParams.Builder

  • Enclosing class:
    FeedParams

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

      • Builder

        public Builder()
    • Method Detail

      • withSilentUpgrade

        @Beta
        public FeedParams.Builder withSilentUpgrade​(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
      • setRoute

        public FeedParams.Builder setRoute​(java.lang.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
      • 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)
      • setPriority

        public FeedParams.Builder setPriority​(java.lang.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​(java.util.concurrent.TimeUnit unit)
      • getServerTimeout

        public long getServerTimeout​(java.util.concurrent.TimeUnit unit)
      • getRoute

        public java.lang.String getRoute()
      • getMaxChunkSizeBytes

        public int getMaxChunkSizeBytes()
      • getmaxInFlightRequests

        public int getmaxInFlightRequests()