Class FeedParams.Builder
- java.lang.Object
-
- com.yahoo.vespa.http.client.config.FeedParams.Builder
-
- Enclosing class:
- FeedParams
public static final class FeedParams.Builder extends java.lang.Object
Mutable class used to instantiate aFeedParams
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FeedParams
build()
Instantiates aFeedParams
.long
getClientTimeout(java.util.concurrent.TimeUnit unit)
FeedParams.DataFormat
getDataFormat()
int
getMaxChunkSizeBytes()
int
getmaxInFlightRequests()
java.lang.String
getRoute()
long
getServerTimeout(java.util.concurrent.TimeUnit unit)
FeedParams.Builder
setClientTimeout(long clientTimeout, java.util.concurrent.TimeUnit unit)
FeedParams.Builder
setDataFormat(FeedParams.DataFormat dataFormat)
Sets the data format to be used.FeedParams.Builder
setDenyIfBusyV3(boolean value)
If this is set to false, the gateway will block threads until messagebus can send the message.FeedParams.Builder
setLocalQueueTimeOut(long timeOutMs)
FeedParams.Builder
setMaxChunkSizeBytes(int maxChunkSizeBytes)
Sets the maximum number of bytes of document data to send per HTTP request.FeedParams.Builder
setMaxInFlightRequests(int maxInFlightRequests)
Sets the maximum number of operations to be in-flight.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.FeedParams.Builder
setPriority(java.lang.String priority)
Sets the messagebus priority.FeedParams.Builder
setRoute(java.lang.String route)
Sets a route to be used for all Clusters, unless overridden on a per-cluster basis inCluster.getRoute()
.FeedParams.Builder
setServerTimeout(long serverTimeout, java.util.concurrent.TimeUnit unit)
Sets the server-side timeout of each operation - i.e.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.
-
-
-
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
-
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:
FeedParams.DataFormat
-
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 inCluster.getRoute()
.- Parameters:
route
- a route to be used for all Clusters.- Returns:
- this, for chaining
-
setServerTimeout
public FeedParams.Builder setServerTimeout(long serverTimeout, java.util.concurrent.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 begetServerTimeout(java.util.concurrent.TimeUnit)
+getClientTimeout(java.util.concurrent.TimeUnit)
, after whichSession.results()
is guaranteed to produce a Result.- Parameters:
serverTimeout
- timeout valueunit
- unit of timeout value- Returns:
- this, for chaining
-
setClientTimeout
public FeedParams.Builder setClientTimeout(long clientTimeout, java.util.concurrent.TimeUnit unit)
Sets the client-side timeout for each operation. If BOTH the server-side timeout AND this timeout has passed,Session
will synthesize aResult
. Note that the TOTAL timeout of any one operation in this API would begetServerTimeout(java.util.concurrent.TimeUnit)
+getClientTimeout(java.util.concurrent.TimeUnit)
, after whichSession.results()
is guaranteed to produce a Result.- Parameters:
clientTimeout
- timeout valueunit
- 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)
-
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 aFeedParams
.- 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()
-
getDataFormat
public FeedParams.DataFormat getDataFormat()
-
getMaxChunkSizeBytes
public int getMaxChunkSizeBytes()
-
getmaxInFlightRequests
public int getmaxInFlightRequests()
-
-