Package com.couchbase.client.core.env
Class AbstractServiceConfig
java.lang.Object
com.couchbase.client.core.env.AbstractServiceConfig
- Direct Known Subclasses:
AnalyticsServiceConfig
,KeyValueServiceConfig
,QueryServiceConfig
,SearchServiceConfig
,ViewServiceConfig
Defines a general config for a
Service
.- Since:
- 1.4.2
- Author:
- Michael Nitschinger
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The default idle time for pooled services.static final int
Constant to use if no idle time should be used. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractServiceConfig
(int minEndpoints, int maxEndpoints, boolean pipelined, int idleTime) Creates a new service config. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkIdleTime
(int idleTime) Helper method to check if the idle time is within proper range.int
idleTime()
The time in seconds (minimum, approx) after when idle the socket will be closed.boolean
If this service is pipelined (more than one request at the same time on the same socket).int
The maximum endpoints per node which will be established.int
The minimum endpoints per node which will always be established.toString()
-
Field Details
-
NO_IDLE_TIME
public static final int NO_IDLE_TIMEConstant to use if no idle time should be used.- See Also:
-
DEFAULT_IDLE_TIME
public static final int DEFAULT_IDLE_TIMEThe default idle time for pooled services. Note that the idle time has been reduced from 300s (5m) to 4s in order to comply with the reduced idle times in recent couchbase server versions.- See Also:
-
-
Constructor Details
-
AbstractServiceConfig
protected AbstractServiceConfig(int minEndpoints, int maxEndpoints, boolean pipelined, int idleTime) Creates a new service config.- Parameters:
minEndpoints
- minimum number of endpoints to be usedmaxEndpoints
- maximum number of endpoints to be usedpipelined
- if this is a pipelined service.idleTime
- the configured idle time
-
-
Method Details
-
checkIdleTime
protected void checkIdleTime(int idleTime) Helper method to check if the idle time is within proper range. This method is refactored out so it can be overridden in test cases.- Parameters:
idleTime
- the idle time to check.
-
minEndpoints
public int minEndpoints()The minimum endpoints per node which will always be established. -
maxEndpoints
public int maxEndpoints()The maximum endpoints per node which will be established. -
isPipelined
public boolean isPipelined()If this service is pipelined (more than one request at the same time on the same socket). -
idleTime
public int idleTime()The time in seconds (minimum, approx) after when idle the socket will be closed. -
toString
-