Class SessionParams.Builder
java.lang.Object
com.yahoo.vespa.http.client.config.SessionParams.Builder
- Enclosing class:
- SessionParams
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCluster
(Cluster cluster) Add a Vespa installation for feeding documents into.build()
Instantiates aSessionParams
that can be given to aFeedClientFactory
.int
int
setClientQueueSize
(int clientQueueSize) Sets the maximum number of document operations to hold in memory, waiting to be sent to Vespa.setConnectionParams
(ConnectionParams connectionParams) Transport parameters, like custom HTTP headers.setErrorReporter
(SessionParams.ErrorReporter errorReporter) Sets an error reporter that is invoked in case of serious errors.setFeedParams
(FeedParams feedParams) Set parameters used for feeding the documents in the receiving cluster.setThrottlerMinSize
(int throttlerMinSize) Sets the minimum queue size of the throttler.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
addCluster
Add a Vespa installation for feeding documents into.- Returns:
- this Builder instance, to support chaining
-
setFeedParams
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
Transport parameters, like custom HTTP headers.- Returns:
- this Builder instance, to support chaining
-
setErrorReporter
Sets an error reporter that is invoked in case of serious errors.- Parameters:
errorReporter
- the handler- Returns:
- pointer to builder.
-
setClientQueueSize
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
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
Instantiates aSessionParams
that can be given to aFeedClientFactory
.- Returns:
- a SessionParams object with the parameters of this Builder
-
getFeedParams
-
getConnectionParams
-
getClientQueueSize
public int getClientQueueSize() -
getThrottlerMinSize
public int getThrottlerMinSize()
-