public class DefaultExecutionContext extends Object implements ExecutionContext
| Constructor and Description |
|---|
DefaultExecutionContext() |
| Modifier and Type | Method and Description |
|---|---|
long |
elapsedTimeNanos()
Returns the elapsed time, in nanoseconds, between start and end of execution.
|
Optional<Object> |
getAttribute(Object key)
Retrieves an attribute stored in this context.
|
void |
setAttribute(Object key,
Object value)
Sets an attribute into this context.
|
void |
start() |
void |
stop() |
public void setAttribute(Object key, Object value)
ExecutionContextsetAttribute in interface ExecutionContextkey - the attribute key. Cannot be null.value - the attribute value. Can be null.public Optional<Object> getAttribute(Object key)
ExecutionContextgetAttribute in interface ExecutionContextkey - the attribute key. Cannot be null.Optional containing the attribute value, if present.public long elapsedTimeNanos()
ExecutionContextThe exact meaning of the value returned by this method depends on whether the context is global or local: for global contexts, this is the elapsed time for the whole statement execution; for local ones, this is the elapsed time for a single request-response cycle.
elapsedTimeNanos in interface ExecutionContextpublic void start()
public void stop()
Copyright © 2017–2021 DataStax. All rights reserved.