org.apache.ignite.internal.processors.query.running

## Class HeavyQueriesTracker

- java.lang.Object
- - org.apache.ignite.internal.processors.query.running.HeavyQueriesTracker

    public final class HeavyQueriesTracker
    extends Object

Class to track heavy queries (long-running or producing a big result-set).

### Nested Class Summary

Nested Classes
`static class` `HeavyQueriesTracker.ResultSetChecker` Holds result-set limit settings for the specified query.

### Field Summary

Fields
`static String` `BIG_RESULT_SET_MSG`
`static String` `LONG_QUERY_ERROR_MSG`
`static String` `LONG_QUERY_EXEC_MSG` Message about the long execution of the query.
`static String` `LONG_QUERY_FINISHED_MSG`

### Constructor Summary

Constructors
Constructor and Description
`HeavyQueriesTracker(GridKernalContext ctx)`

### Method Summary

All Methods Instance Methods Concrete Methods
`long` `getResultSetSizeThreshold()`
`int` `getResultSetSizeThresholdMultiplier()` Gets result set size threshold multiplier.
`long` `getTimeout()`
`int` `getTimeoutMultiplier()`
`HeavyQueriesTracker.ResultSetChecker` `resultSetChecker(TrackableQuery qryInfo)` Creates new result-set checker.
`void` `setResultSetSizeThreshold(long rsSizeThreshold)` Sets threshold result's row count, when count of fetched rows is bigger than the threshold warning will be printed.
`void` `setResultSetSizeThresholdMultiplier(int rsSizeThresholdMult)` Sets result set size threshold multiplier.
`void` `setTimeout(long timeout)` Sets timeout in milliseconds after which long query warning will be printed.
`void` `setTimeoutMultiplier(int timeoutMult)` Sets long query timeout multiplier.
`void` `startTracking(TrackableQuery qryInfo)`
`void` `stop()`
`void` `stopTracking(TrackableQuery qryInfo, @Nullable Throwable err)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### LONG_QUERY_EXEC_MSG

    public static final String LONG_QUERY_EXEC_MSG

Message about the long execution of the query.

See Also:
  Constant Field Values

#### LONG_QUERY_FINISHED_MSG

    public static final String LONG_QUERY_FINISHED_MSG

See Also:
  Constant Field Values

#### LONG_QUERY_ERROR_MSG

    public static final String LONG_QUERY_ERROR_MSG

See Also:
  Constant Field Values

#### BIG_RESULT_SET_MSG

    public static final String BIG_RESULT_SET_MSG

See Also:
  Constant Field Values

### Constructor Detail

#### HeavyQueriesTracker

    public HeavyQueriesTracker(GridKernalContext ctx)

Parameters:
  `ctx` - Kernal context.

### Method Detail

#### stop

    public void stop()

#### startTracking

    public void startTracking(TrackableQuery qryInfo)

Parameters:
  `qryInfo` - Query info to register.

#### stopTracking

    public void stopTracking(TrackableQuery qryInfo,
                             @Nullable
                             @Nullable Throwable err)

Parameters:
  `qryInfo` - Query info to remove.
  `err` - Exception if query executed with error.

#### resultSetChecker

    public HeavyQueriesTracker.ResultSetChecker resultSetChecker(TrackableQuery qryInfo)

Creates new result-set checker.

Parameters:
  `qryInfo` - Query info.

#### getTimeout

    public long getTimeout()

Returns:
  Timeout in milliseconds after which long query warning will be printed.

#### setTimeout

    public void setTimeout(long timeout)

Sets timeout in milliseconds after which long query warning will be printed.

Parameters:
  `timeout` - Timeout in milliseconds after which long query warning will be printed.

#### getTimeoutMultiplier

    public int getTimeoutMultiplier()

Returns:
  Long query timeout multiplier.

#### setTimeoutMultiplier

    public void setTimeoutMultiplier(int timeoutMult)

Sets long query timeout multiplier. The warning will be printed after: - timeout; - timeout * multiplier; - timeout * multiplier * multiplier; - etc... If the multiplier <= 1, the warning message is printed once.

Parameters:
  `timeoutMult` - Long query timeout multiplier.

#### getResultSetSizeThreshold

    public long getResultSetSizeThreshold()

Returns:
  Threshold result's row count, when count of fetched rows is bigger than the threshold warning will be printed.

#### setResultSetSizeThreshold

    public void setResultSetSizeThreshold(long rsSizeThreshold)

Sets threshold result's row count, when count of fetched rows is bigger than the threshold warning will be printed.

Parameters:
  `rsSizeThreshold` - Threshold result's row count, when count of fetched rows is bigger than the threshold warning will be printed.

#### getResultSetSizeThresholdMultiplier

    public int getResultSetSizeThresholdMultiplier()

Gets result set size threshold multiplier. The warning will be printed after: - size of result set > threshold; - size of result set > threshold * multiplier; - size of result set > threshold * multiplier * multiplier; - etc. If the multiplier <= 1, the warning message is printed once.

Returns:
  Result set size threshold multiplier.

#### setResultSetSizeThresholdMultiplier

    public void setResultSetSizeThresholdMultiplier(int rsSizeThresholdMult)

Sets result set size threshold multiplier.

Parameters:
  `rsSizeThresholdMult` - Result set size threshold multiplier

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.16.0
Release Date | : December 15 2023