Class FeedParams.Builder
java.lang.Object
com.yahoo.vespa.http.client.config.FeedParams.Builder
- Enclosing class:
- FeedParams
Mutable class used to instantiate a
FeedParams
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Instantiates aFeedParams
.long
getClientTimeout
(TimeUnit unit) int
int
getRoute()
long
getServerTimeout
(TimeUnit unit) setClientTimeout
(long clientTimeout, TimeUnit unit) Sets the client-side timeout for each operation. If BOTH the server-side timeout AND this timeout has passed, theFeedClient
will synthesize aResult
.setDataFormat
(FeedParams.DataFormat dataFormat) Sets the data format to be used.setDenyIfBusyV3
(boolean value) If this is set to false, the gateway will block threads until messagebus can send the message.setIdlePollFrequency
(Double idlePollFrequency) Set what frequency to poll for async responses.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.setMaxChunkSizeBytes
(int maxChunkSizeBytes) Sets the maximum number of bytes of document data to send per HTTP request.setMaxInFlightRequests
(int maxInFlightRequests) Sets the maximum number of operations to be in-flight.setMaxSleepTimeMs
(long ms) When throttling the load due to transient errors on gateway, what is the most time to wait between requests per thread.setPriority
(String priority) Sets the messagebus priority.Sets a route to be used for all Clusters, unless overridden on a per-cluster basis inCluster.getRoute()
.setServerTimeout
(long serverTimeout, TimeUnit unit) Sets the server-side timeout of each operation - i.e.setSilentUpgrade
(boolean silentUpgrade) Make server not throw 4xx/5xx for situations that are normal during upgrade as this can esily mask other problems.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setSilentUpgrade
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
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
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
Sets the data format to be used.- Parameters:
dataFormat
- the data format to be used.- Returns:
- this, for chaining
- See Also:
-
setRoute
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
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)
.- Parameters:
serverTimeout
- timeout valueunit
- unit of timeout value- Returns:
- this, for chaining
-
setClientTimeout
Sets the client-side timeout for each operation. If BOTH the server-side timeout AND this timeout has passed, theFeedClient
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 which a result callback is guaranteed to be made.- Parameters:
clientTimeout
- timeout valueunit
- unit of timeout value- Returns:
- this, for chaining
-
setMaxChunkSizeBytes
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
Sets the maximum number of operations to be in-flight.- Parameters:
maxInFlightRequests
- max number of operations.- Returns:
- this, for chaining
-
setLocalQueueTimeOut
Sets the number of milliseconds until we respond with a timeout for a document operation if we still have not received a response. -
setIdlePollFrequency
Set what frequency to poll for async responses. Default is 10hz (every 0.1s), but 1000hz when using SyncFeedClient -
setPriority
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
Instantiates aFeedParams
.- Returns:
- a FeedParams object with the parameters of this Builder
-
getClientTimeout
-
getServerTimeout
-
getRoute
-
getDataFormat
-
getMaxChunkSizeBytes
public int getMaxChunkSizeBytes() -
getMaxInFlightRequests
public int getMaxInFlightRequests()
-