Hystrix: Latency and Fault Tolerance for Distributed Systems



com.netflix.hystrix
Class Hystrix

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

public class Hystrix
extends java.lang.Object

Lifecycle management of Hystrix.


Constructor Summary
Hystrix()
           
 
Method Summary
static HystrixCommandKey getCurrentThreadExecutingCommand()
          Allows a thread to query whether it's current point of execution is within the scope of a HystrixCommand.
static void reset()
          Reset state and release resources in use (such as thread-pools).
static void reset(long time, java.util.concurrent.TimeUnit unit)
          Reset state and release resources in use (such as threadpools) and wait for completion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hystrix

public Hystrix()
Method Detail

reset

public static void reset()
Reset state and release resources in use (such as thread-pools).

NOTE: This can result in race conditions if HystrixCommands are concurrently being executed.


reset

public static void reset(long time,
                         java.util.concurrent.TimeUnit unit)
Reset state and release resources in use (such as threadpools) and wait for completion.

NOTE: This can result in race conditions if HystrixCommands are concurrently being executed.

Parameters:
time - time to wait for thread-pools to shutdown
unit - TimeUnit for
time
to wait for thread-pools to shutdown

getCurrentThreadExecutingCommand

public static HystrixCommandKey getCurrentThreadExecutingCommand()
Allows a thread to query whether it's current point of execution is within the scope of a HystrixCommand.

When ExecutionIsolationStrategy is THREAD then this applies to the isolation (child/worker) thread not the calling thread.

When ExecutionIsolationStrategy is SEMAPHORE this applies to the calling thread.

Returns:
HystrixCommandKey of current command being executed or null if none.