public abstract static class ChannelPoolSettings.BuilderConstructors
Builder()
public Builder()Methods
build()
public ChannelPoolSettings build()| Returns | |
|---|---|
| Type | Description |
ChannelPoolSettings |
|
setInitialChannelCount(int count)
public abstract ChannelPoolSettings.Builder setInitialChannelCount(int count)Sets the initial number of channels in the pool.
| Parameter | |
|---|---|
| Name | Description |
count |
int |
| Returns | |
|---|---|
| Type | Description |
ChannelPoolSettings.Builder |
|
setMaxChannelCount(int count)
public abstract ChannelPoolSettings.Builder setMaxChannelCount(int count)Sets the maximum number of channels the pool can expand to.
When resizing, if the calculated resize bounds exceed this maximum configuration, the bounds will be clamped to this value. This ensures the pool never expands above this absolute maximum, even under very high load.
| Parameter | |
|---|---|
| Name | Description |
count |
int |
| Returns | |
|---|---|
| Type | Description |
ChannelPoolSettings.Builder |
|
setMaxResizeDelta(int count)
public abstract ChannelPoolSettings.Builder setMaxResizeDelta(int count)Sets the maximum number of channels that can be added or removed in a single resize cycle. This acts as a rate limiter to prevent wild fluctuations. The pool resizes periodically according to #RESIZE_INTERVAL (default 1 minute). During resizing, this value is effectively capped by the bound configured via #setMaxChannelCount.
Warning: Higher values for resize delta may still result in performance degradation during spikes due to rapid scaling.
| Parameter | |
|---|---|
| Name | Description |
count |
int |
| Returns | |
|---|---|
| Type | Description |
ChannelPoolSettings.Builder |
|
setMaxRpcsPerChannel(int count)
public abstract ChannelPoolSettings.Builder setMaxRpcsPerChannel(int count)Sets the maximum desired number of concurrent RPCs per channel.
This ensures channels do not become overloaded. If the average load per channel exceeds this value, the pool attempts to expand. The resulting target channel count is a dynamic value determined by load and is bounded by #setMinChannelCount and #setMaxChannelCount.
| Parameter | |
|---|---|
| Name | Description |
count |
int |
| Returns | |
|---|---|
| Type | Description |
ChannelPoolSettings.Builder |
|
setMinChannelCount(int count)
public abstract ChannelPoolSettings.Builder setMinChannelCount(int count)Sets the minimum number of channels the pool can shrink to.
When resizing, if the calculated resize bounds fall below this minimum configuration, the bounds will be clamped to this value. This ensures the pool never shrinks below this absolute minimum, even under very low load.
| Parameter | |
|---|---|
| Name | Description |
count |
int |
| Returns | |
|---|---|
| Type | Description |
ChannelPoolSettings.Builder |
|
setMinRpcsPerChannel(int count)
public abstract ChannelPoolSettings.Builder setMinRpcsPerChannel(int count)Sets the minimum desired number of concurrent RPCs per channel.
This ensures channels are adequately utilized. If the average load per channel falls below this value, the pool attempts to shrink. The resulting target channel count is a dynamic value determined by load and is bounded by #setMinChannelCount and #setMaxChannelCount.
| Parameter | |
|---|---|
| Name | Description |
count |
int |
| Returns | |
|---|---|
| Type | Description |
ChannelPoolSettings.Builder |
|
setPreemptiveRefreshEnabled(boolean enabled)
public abstract ChannelPoolSettings.Builder setPreemptiveRefreshEnabled(boolean enabled)Sets whether preemptive channel refresh is enabled to prevent channels from becoming idle.
| Parameter | |
|---|---|
| Name | Description |
enabled |
boolean |
| Returns | |
|---|---|
| Type | Description |
ChannelPoolSettings.Builder |
|