Class SessionParams.Builder
- java.lang.Object
-
- com.yahoo.vespa.http.client.config.SessionParams.Builder
-
- Enclosing class:
- SessionParams
public static final class SessionParams.Builder extends java.lang.Object
Mutable class used to instantiate aSessionParams
. A builder instance will at the very least contain cluster settings (addCluster(Cluster)
), for supporting SSL and similar transport settings, usesetConnectionParams(ConnectionParams)
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SessionParams.Builder
addCluster(Cluster cluster)
Add a Vespa installation for feeding documents into.SessionParams
build()
Instantiates aSessionParams
that can be given to aSessionFactory
.int
getClientQueueSize()
ConnectionParams
getConnectionParams()
FeedParams
getFeedParams()
int
getThrottlerMinSize()
SessionParams.Builder
setClientQueueSize(int clientQueueSize)
Sets the maximum number of document operations to hold in memory, waiting to be sent to Vespa.SessionParams.Builder
setConnectionParams(ConnectionParams connectionParams)
Transport parameters, like custom HTTP headers.SessionParams.Builder
setErrorReporter(SessionParams.ErrorReporter errorReporter)
Sets an error reporter that is invoked in case of serious errors.SessionParams.Builder
setFeedParams(FeedParams feedParams)
Set parameters used for feeding the documents in the receiving cluster.SessionParams.Builder
setThrottlerMinSize(int throttlerMinSize)
Sets the minimum queue size of the throttler.
-
-
-
Method Detail
-
addCluster
public SessionParams.Builder addCluster(Cluster cluster)
Add a Vespa installation for feeding documents into.- Returns:
- this Builder instance, to support chaining
-
setFeedParams
public SessionParams.Builder setFeedParams(FeedParams feedParams)
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
public SessionParams.Builder setConnectionParams(ConnectionParams connectionParams)
Transport parameters, like custom HTTP headers.- Returns:
- this Builder instance, to support chaining
-
setErrorReporter
public SessionParams.Builder setErrorReporter(SessionParams.ErrorReporter errorReporter)
Sets an error reporter that is invoked in case of serious errors.- Parameters:
errorReporter
- the handler- Returns:
- pointer to builder.
-
setClientQueueSize
public SessionParams.Builder setClientQueueSize(int clientQueueSize)
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, seeSession.stream(CharSequence)
.- Parameters:
clientQueueSize
- the maximum number of document operations to hold in memory.- Returns:
- pointer to builder.
-
setThrottlerMinSize
public SessionParams.Builder setThrottlerMinSize(int throttlerMinSize)
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
public SessionParams build()
Instantiates aSessionParams
that can be given to aSessionFactory
.- Returns:
- a SessionParams object with the parameters of this Builder
-
getFeedParams
public FeedParams getFeedParams()
-
getConnectionParams
public ConnectionParams getConnectionParams()
-
getClientQueueSize
public int getClientQueueSize()
-
getThrottlerMinSize
public int getThrottlerMinSize()
-
-