Hystrix: Latency and Fault Tolerance for Distributed Systems



com.netflix.hystrix.strategy.properties
Class HystrixPropertiesStrategy

java.lang.Object
  extended by com.netflix.hystrix.strategy.properties.HystrixPropertiesStrategy

public abstract class HystrixPropertiesStrategy
extends java.lang.Object

Abstract class with default implementations of factory methods for properties used by various components of Hystrix.

See HystrixPlugins or the Hystrix GitHub Wiki for information on configuring plugins: https://github.com/Netflix/Hystrix/wiki/Plugins.


Constructor Summary
HystrixPropertiesStrategy()
           
 
Method Summary
 HystrixCollapserProperties getCollapserProperties(HystrixCollapserKey collapserKey, HystrixCollapserProperties.Setter builder)
          Construct an implementation of HystrixCollapserProperties for HystrixCollapser instances with HystrixCollapserKey.
 java.lang.String getCollapserPropertiesCacheKey(HystrixCollapserKey collapserKey, HystrixCollapserProperties.Setter builder)
          Cache key used for caching the retrieval of HystrixCollapserProperties implementations.
 HystrixCommandProperties getCommandProperties(HystrixCommandKey commandKey, HystrixCommandProperties.Setter builder)
          Construct an implementation of HystrixCommandProperties for HystrixCommand instances with HystrixCommandKey.
 java.lang.String getCommandPropertiesCacheKey(HystrixCommandKey commandKey, HystrixCommandProperties.Setter builder)
          Cache key used for caching the retrieval of HystrixCommandProperties implementations.
 HystrixThreadPoolProperties getThreadPoolProperties(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolProperties.Setter builder)
          Construct an implementation of HystrixThreadPoolProperties for HystrixThreadPool instances with HystrixThreadPoolKey.
 java.lang.String getThreadPoolPropertiesCacheKey(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolProperties.Setter builder)
          Cache key used for caching the retrieval of HystrixThreadPoolProperties implementations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HystrixPropertiesStrategy

public HystrixPropertiesStrategy()
Method Detail

getCommandProperties

public HystrixCommandProperties getCommandProperties(HystrixCommandKey commandKey,
                                                     HystrixCommandProperties.Setter builder)
Construct an implementation of HystrixCommandProperties for HystrixCommand instances with HystrixCommandKey.

Default Implementation

Constructs instance of HystrixPropertiesCommandDefault.

Parameters:
commandKey - HystrixCommandKey representing the name or type of HystrixCommand
builder - HystrixCommandProperties.Setter with default overrides as injected from the HystrixCommand implementation.

The builder will return NULL for each value if no override was provided.

Returns:
Implementation of HystrixCommandProperties

getCommandPropertiesCacheKey

public java.lang.String getCommandPropertiesCacheKey(HystrixCommandKey commandKey,
                                                     HystrixCommandProperties.Setter builder)
Cache key used for caching the retrieval of HystrixCommandProperties implementations.

Typically this would return HystrixCommandKey.name() but can be done differently if required.

For example, null can be returned which would cause it to not cache and invoke HystrixPropertiesStrategy.getCommandProperties(com.netflix.hystrix.HystrixCommandKey, com.netflix.hystrix.HystrixCommandProperties.Setter) for each HystrixCommand instantiation (not recommended).

Default Implementation

Returns HystrixCommandKey.name()

Parameters:
commandKey -
builder -
Returns:
String value to be used as the cache key of a HystrixCommandProperties implementation.

getThreadPoolProperties

public HystrixThreadPoolProperties getThreadPoolProperties(HystrixThreadPoolKey threadPoolKey,
                                                           HystrixThreadPoolProperties.Setter builder)
Construct an implementation of HystrixThreadPoolProperties for HystrixThreadPool instances with HystrixThreadPoolKey.

Default Implementation

Constructs instance of HystrixPropertiesThreadPoolDefault.

Parameters:
threadPoolKey - HystrixThreadPoolKey representing the name or type of HystrixThreadPool
builder - HystrixThreadPoolProperties.Setter with default overrides as injected via HystrixCommand to the HystrixThreadPool implementation.

The builder will return NULL for each value if no override was provided.

Returns:
Implementation of HystrixThreadPoolProperties

getThreadPoolPropertiesCacheKey

public java.lang.String getThreadPoolPropertiesCacheKey(HystrixThreadPoolKey threadPoolKey,
                                                        HystrixThreadPoolProperties.Setter builder)
Cache key used for caching the retrieval of HystrixThreadPoolProperties implementations.

Typically this would return HystrixThreadPoolKey.name() but can be done differently if required.

For example, null can be returned which would cause it to not cache and invoke HystrixPropertiesStrategy.getThreadPoolProperties(com.netflix.hystrix.HystrixThreadPoolKey, com.netflix.hystrix.HystrixThreadPoolProperties.Setter) for each HystrixThreadPool instantiation (not recommended).

Default Implementation

Returns HystrixThreadPoolKey.name()

Parameters:
threadPoolKey -
builder -
Returns:
String value to be used as the cache key of a HystrixThreadPoolProperties implementation.

getCollapserProperties

public HystrixCollapserProperties getCollapserProperties(HystrixCollapserKey collapserKey,
                                                         HystrixCollapserProperties.Setter builder)
Construct an implementation of HystrixCollapserProperties for HystrixCollapser instances with HystrixCollapserKey.

Default Implementation

Constructs instance of HystrixPropertiesCollapserDefault.

Parameters:
collapserKey - HystrixCollapserKey representing the name or type of HystrixCollapser
builder - HystrixCollapserProperties.Setter with default overrides as injected to the HystrixCollapser implementation.

The builder will return NULL for each value if no override was provided.

Returns:
Implementation of HystrixCollapserProperties

getCollapserPropertiesCacheKey

public java.lang.String getCollapserPropertiesCacheKey(HystrixCollapserKey collapserKey,
                                                       HystrixCollapserProperties.Setter builder)
Cache key used for caching the retrieval of HystrixCollapserProperties implementations.

Typically this would return HystrixCollapserKey.name() but can be done differently if required.

For example, null can be returned which would cause it to not cache and invoke HystrixPropertiesStrategy.getCollapserProperties(com.netflix.hystrix.HystrixCollapserKey, com.netflix.hystrix.HystrixCollapserProperties.Setter) for each HystrixCollapser instantiation (not recommended).

Default Implementation

Returns HystrixCollapserKey.name()

Parameters:
collapserKey -
builder -
Returns:
String value to be used as the cache key of a HystrixCollapserProperties implementation.