Hystrix: Latency and Fault Tolerance for Distributed Systems



com.netflix.hystrix
Class HystrixThreadPoolProperties

java.lang.Object
  extended by com.netflix.hystrix.HystrixThreadPoolProperties

public abstract class HystrixThreadPoolProperties
extends java.lang.Object

Properties for instances of HystrixThreadPool.

Default implementation of methods uses Archaius (https://github.com/Netflix/archaius)


Nested Class Summary
static class HystrixThreadPoolProperties.Setter
          Fluent interface that allows chained setting of properties that can be passed into a HystrixThreadPool via a HystrixCommand constructor to inject instance specific property overrides.
 
Constructor Summary
protected HystrixThreadPoolProperties(HystrixThreadPoolKey key)
           
protected HystrixThreadPoolProperties(HystrixThreadPoolKey key, HystrixThreadPoolProperties.Setter builder)
           
protected HystrixThreadPoolProperties(HystrixThreadPoolKey key, HystrixThreadPoolProperties.Setter builder, java.lang.String propertyPrefix)
           
 
Method Summary
 HystrixProperty<java.lang.Integer> coreSize()
          Core thread-pool size that gets passed to ThreadPoolExecutor.setCorePoolSize(int)
 HystrixProperty<java.lang.Integer> keepAliveTimeMinutes()
          Keep-alive time in minutes that gets passed to ThreadPoolExecutor.setKeepAliveTime(long, TimeUnit)
 HystrixProperty<java.lang.Integer> maxQueueSize()
          Max queue size that gets passed to BlockingQueue in HystrixConcurrencyStrategy.getBlockingQueue(int)
 HystrixProperty<java.lang.Integer> metricsRollingStatisticalWindowBuckets()
          Number of buckets the rolling statistical window is broken into.
 HystrixProperty<java.lang.Integer> metricsRollingStatisticalWindowInMilliseconds()
          Duration of statistical rolling window in milliseconds.
 HystrixProperty<java.lang.Integer> queueSizeRejectionThreshold()
          Queue size rejection threshold is an artificial "max" size at which rejections will occur even if HystrixThreadPoolProperties.maxQueueSize has not been reached.
static HystrixThreadPoolProperties.Setter Setter()
          Factory method to retrieve the default Setter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HystrixThreadPoolProperties

protected HystrixThreadPoolProperties(HystrixThreadPoolKey key)

HystrixThreadPoolProperties

protected HystrixThreadPoolProperties(HystrixThreadPoolKey key,
                                      HystrixThreadPoolProperties.Setter builder)

HystrixThreadPoolProperties

protected HystrixThreadPoolProperties(HystrixThreadPoolKey key,
                                      HystrixThreadPoolProperties.Setter builder,
                                      java.lang.String propertyPrefix)
Method Detail

coreSize

public HystrixProperty<java.lang.Integer> coreSize()
Core thread-pool size that gets passed to ThreadPoolExecutor.setCorePoolSize(int)

Returns:
HystrixProperty<Integer>

keepAliveTimeMinutes

public HystrixProperty<java.lang.Integer> keepAliveTimeMinutes()
Keep-alive time in minutes that gets passed to ThreadPoolExecutor.setKeepAliveTime(long, TimeUnit)

Returns:
HystrixProperty<Integer>

maxQueueSize

public HystrixProperty<java.lang.Integer> maxQueueSize()
Max queue size that gets passed to BlockingQueue in HystrixConcurrencyStrategy.getBlockingQueue(int)

Returns:
HystrixProperty<Integer>

queueSizeRejectionThreshold

public HystrixProperty<java.lang.Integer> queueSizeRejectionThreshold()
Queue size rejection threshold is an artificial "max" size at which rejections will occur even if HystrixThreadPoolProperties.maxQueueSize has not been reached. This is done because the HystrixThreadPoolProperties.maxQueueSize of a BlockingQueue can not be dynamically changed and we want to support dynamically changing the queue size that affects rejections.

This is used by HystrixCommand when queuing a thread for execution.

Returns:
HystrixProperty<Integer>

metricsRollingStatisticalWindowInMilliseconds

public HystrixProperty<java.lang.Integer> metricsRollingStatisticalWindowInMilliseconds()
Duration of statistical rolling window in milliseconds. This is passed into HystrixRollingNumber inside each HystrixThreadPoolMetrics instance.

Returns:
HystrixProperty<Integer>

metricsRollingStatisticalWindowBuckets

public HystrixProperty<java.lang.Integer> metricsRollingStatisticalWindowBuckets()
Number of buckets the rolling statistical window is broken into. This is passed into HystrixRollingNumber inside each HystrixThreadPoolMetrics instance.

Returns:
HystrixProperty<Integer>

Setter

public static HystrixThreadPoolProperties.Setter Setter()
Factory method to retrieve the default Setter.