public class SqlLifecycleManager extends Object
DirectStatements submitted via
HTTP, such as SqlResource. The main use case of
this class is tracking running queries so that the cancel API can identify
the statements to cancel.
This class is thread-safe as there are 2 or more threads that can access
statements at the same time for query running or query canceling.
For managing and canceling native queries, see
QueryScheduler. As its name indicates, it
also performs resource scheduling for native queries based on query lanes
QueryLaningStrategy.QueryScheduler.cancelQuery(String)| Modifier and Type | Class and Description |
|---|---|
static interface |
SqlLifecycleManager.Cancelable |
| Constructor and Description |
|---|
SqlLifecycleManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(String sqlQueryId,
SqlLifecycleManager.Cancelable lifecycle) |
List<SqlLifecycleManager.Cancelable> |
getAll(String sqlQueryId)
Returns a snapshot of the lifecycles for the given sqlQueryId.
|
void |
remove(String sqlQueryId,
SqlLifecycleManager.Cancelable lifecycle)
Removes the given lifecycle of the given query ID.
|
void |
removeAll(String sqlQueryId,
List<SqlLifecycleManager.Cancelable> lifecyclesToRemove)
For the given sqlQueryId, this method removes all lifecycles that match to the given list of lifecycles.
|
public void add(String sqlQueryId, SqlLifecycleManager.Cancelable lifecycle)
public void remove(String sqlQueryId, SqlLifecycleManager.Cancelable lifecycle)
Object.equals(java.lang.Object) to find the lifecycle matched to the given parameter.public void removeAll(String sqlQueryId, List<SqlLifecycleManager.Cancelable> lifecyclesToRemove)
Object.equals(java.lang.Object) for matching lifecycles.public List<SqlLifecycleManager.Cancelable> getAll(String sqlQueryId)
Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.