Package org.apache.druid.sql
Class SqlLifecycleManager
java.lang.Object
org.apache.druid.sql.SqlLifecycleManager
This class manages only authorized
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.- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(String sqlQueryId, SqlLifecycleManager.Cancelable lifecycle) Returns a snapshot of the lifecycles for the given sqlQueryId.voidremove(String sqlQueryId, SqlLifecycleManager.Cancelable lifecycle) Removes the given lifecycle of the given query ID.voidremoveAll(String sqlQueryId, List<SqlLifecycleManager.Cancelable> lifecyclesToRemove) For the given sqlQueryId, this method removes all lifecycles that match to the given list of lifecycles.
-
Constructor Details
-
SqlLifecycleManager
public SqlLifecycleManager()
-
-
Method Details
-
add
-
remove
Removes the given lifecycle of the given query ID. This method usesObject.equals(java.lang.Object)to find the lifecycle matched to the given parameter. -
removeAll
For the given sqlQueryId, this method removes all lifecycles that match to the given list of lifecycles. This method usesObject.equals(java.lang.Object)for matching lifecycles. -
getAll
Returns a snapshot of the lifecycles for the given sqlQueryId.
-