public class RunningQueryManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
SQL_QRY_HIST_VIEW |
static String |
SQL_QRY_HIST_VIEW_DESC |
static String |
SQL_QRY_VIEW |
static String |
SQL_QRY_VIEW_DESC |
static String |
SQL_USER_QUERIES_REG_NAME
Name of the MetricRegistry which metrics measure stats of queries initiated by user.
|
Constructor and Description |
---|
RunningQueryManager(GridKernalContext ctx)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel(Long qryId)
Cancel query.
|
Collection<GridRunningQueryInfo> |
longRunningQueries(long duration)
Return long running user queries.
|
Map<QueryHistoryKey,QueryHistory> |
queryHistoryMetrics()
Gets query history statistics.
|
Long |
register(String qry,
GridCacheQueryType qryType,
String schemaName,
boolean loc,
@Nullable GridQueryCancel cancel)
Register running query.
|
void |
resetQueryHistoryMetrics()
Reset query history.
|
@Nullable GridRunningQueryInfo |
runningQueryInfo(Long qryId)
Gets info about running query by their id.
|
List<GridRunningQueryInfo> |
runningSqlQueries()
Return SQL queries which executing right now.
|
void |
stop()
Cancel all executing queries and deregistering all of them.
|
String |
toString() |
void |
trackRequestId(long reqId) |
void |
unregister(Long qryId,
@Nullable Throwable failReason)
Unregister running query.
|
public static final String SQL_USER_QUERIES_REG_NAME
public static final String SQL_QRY_VIEW
public static final String SQL_QRY_VIEW_DESC
public static final String SQL_QRY_HIST_VIEW
public static final String SQL_QRY_HIST_VIEW_DESC
public RunningQueryManager(GridKernalContext ctx)
ctx
- Context.public Long register(String qry, GridCacheQueryType qryType, String schemaName, boolean loc, @Nullable @Nullable GridQueryCancel cancel)
qry
- Query text.qryType
- Query type.schemaName
- Schema name.loc
- Local query flag.cancel
- Query cancel. Should be passed in case query is cancelable, or null
otherwise.public void unregister(Long qryId, @Nullable @Nullable Throwable failReason)
qryId
- id of the query, which is given by register
method.failReason
- exception that caused query execution fail, or null
if query succeded.public void trackRequestId(long reqId)
reqId
- Request ID of query to track.public List<GridRunningQueryInfo> runningSqlQueries()
public Collection<GridRunningQueryInfo> longRunningQueries(long duration)
duration
- Duration of long query.public void cancel(Long qryId)
qryId
- Query id.public void stop()
public Map<QueryHistoryKey,QueryHistory> queryHistoryMetrics()
SqlConfiguration.setSqlQueryHistorySize(int)
@Nullable public @Nullable GridRunningQueryInfo runningQueryInfo(Long qryId)
qryId
- null
in case no running query for given id.public void resetQueryHistoryMetrics()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021