org.apache.ignite.internal.processors.query.stat

## Interface IgniteStatisticsManager

All Known Implementing Classes:
  IgniteStatisticsManagerImpl

    public interface IgniteStatisticsManager

Statistics manager. Coordinate statistics collection and act as source of statistics.

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `collectStatistics(StatisticsObjectConfiguration... targets)` Gather object statistics.
`void` `dropAll()` Drop all statistics.
`void` `dropStatistics(StatisticsTarget... targets)` Clear object statistics.
`ObjectStatistics` `getGlobalStatistics(StatisticsKey key)` Get global statistics by object.
`ObjectStatistics` `getLocalStatistics(StatisticsKey key)` Get local statistics by object.
`void` `onRowUpdated(String schemaName, String objName, int partId, byte[] keyBytes)` To track statistics invalidation.
`void` `refreshStatistics(StatisticsTarget... targets)` Refresh object statistics.
`void` `stop()` Stop statistic manager.
`StatisticsUsageState` `usageState()`
`void` `usageState(StatisticsUsageState state)` Set statistics usage state.

### Method Detail

#### collectStatistics

    void collectStatistics(StatisticsObjectConfiguration... targets)
                    throws IgniteCheckedException

Gather object statistics.

Parameters:
  `targets` - Target to params map to gather statistics by.
Throws:
  `IgniteCheckedException` - Throws in case of errors.

#### dropStatistics

    void dropStatistics(StatisticsTarget... targets)
                 throws IgniteCheckedException

Clear object statistics.

Parameters:
  `targets` - Collection of target to collect statistics by (schema, obj, columns).
Throws:
  `IgniteCheckedException` - In case of errors (for example: unsupported feature)

#### refreshStatistics

    void refreshStatistics(StatisticsTarget... targets)
                    throws IgniteCheckedException

Refresh object statistics.

Parameters:
  `targets` - Target to refresh statistics by.
Throws:
  `IgniteCheckedException` - Throws in case of errors.

#### dropAll

    void dropAll()
          throws IgniteCheckedException

Drop all statistics.

Throws:
  `IgniteCheckedException`

#### getLocalStatistics

    ObjectStatistics getLocalStatistics(StatisticsKey key)

Get local statistics by object.

Parameters:
  `key` - Statistic key.
Returns:
  Object statistics or `null` if there are no available statistics by specified object.

#### getGlobalStatistics

    ObjectStatistics getGlobalStatistics(StatisticsKey key)

Get global statistics by object.

Parameters:
  `key` - Statistic key.
Returns:
  Object statistics of `null` if there are no available global statistics by specified object.

#### stop

    void stop()

Stop statistic manager.

#### usageState

    void usageState(StatisticsUsageState state)
             throws IgniteCheckedException

Set statistics usage state.

Parameters:
  `state` - Statistics state.
Throws:
  `IgniteCheckedException`

#### usageState

    StatisticsUsageState usageState()

Returns:
  Statistics usage state.

#### onRowUpdated

    void onRowUpdated(String schemaName,
                      String objName,
                      int partId,
                      byte[] keyBytes)

To track statistics invalidation. Skip value if no statistics for the given table exists.

Parameters:
  `schemaName` - Schema name.
  `objName` - Object name.
  `partId` - Partition id.
  `keyBytes` - Row key bytes.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.15.0
Release Date | : April 25 2023