public class ExecutionResult
extends java.lang.Object
This object can be referenced and "modified" by parent and child threads as well as by different instances of HystrixCommand since 1 instance could create an ExecutionResult, cache a Future that refers to it, a 2nd instance execution then retrieves a Future from cache and wants to append RESPONSE_FROM_CACHE to whatever the ExecutionResult was from the first command execution.
This being immutable forces and ensure thread-safety instead of using AtomicInteger/ConcurrentLinkedQueue and determining when it's safe to mutate the object directly versus needing to deep-copy clone to a new instance.
Modifier and Type | Class and Description |
---|---|
static class |
ExecutionResult.EventCounts |
public static ExecutionResult from(HystrixEventType... eventTypes)
public ExecutionResult setExecutionOccurred()
public ExecutionResult setExecutionLatency(int executionLatency)
public ExecutionResult setException(java.lang.Exception e)
public ExecutionResult setExecutionException(java.lang.Exception executionException)
public ExecutionResult setInvocationStartTime(long startTimestamp)
public ExecutionResult setExecutedInThread()
public ExecutionResult setNotExecutedInThread()
public ExecutionResult markCollapsed(HystrixCollapserKey collapserKey, int sizeOfBatch)
public ExecutionResult markUserThreadCompletion(long userThreadLatency)
public ExecutionResult addEvent(HystrixEventType eventType)
eventType
- event to addExecutionResult
with event addedpublic ExecutionResult addEvent(int executionLatency, HystrixEventType eventType)
public ExecutionResult.EventCounts getEventCounts()
public long getStartTimestamp()
public int getExecutionLatency()
public int getUserThreadLatency()
public long getCommandRunStartTimeInNanos()
public java.lang.Exception getException()
public java.lang.Exception getExecutionException()
public HystrixCollapserKey getCollapserKey()
public boolean isResponseSemaphoreRejected()
public boolean isResponseThreadPoolRejected()
public boolean isResponseRejected()
public java.util.List<HystrixEventType> getOrderedList()
public boolean isExecutedInThread()
public boolean executionOccurred()
public java.lang.String toString()
toString
in class java.lang.Object