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

## Class IgniteGlobalStatisticsManager

- java.lang.Object
- - org.apache.ignite.internal.processors.query.stat.IgniteGlobalStatisticsManager

All Implemented Interfaces:
  `EventListener`, `GridMessageListener`

    public class IgniteGlobalStatisticsManager
    extends Object
    implements GridMessageListener

Global statistics manager. Cache global statistics and collect it.

### Constructor Summary

Constructors
`IgniteGlobalStatisticsManager​(IgniteStatisticsManagerImpl statMgr, GridSystemViewManager sysViewMgr, IgniteThreadPoolExecutor mgmtPool, GridDiscoveryManager discoMgr, GridClusterStateProcessor cluster, GridCachePartitionExchangeManager<?,​?> exchange, IgniteStatisticsHelper helper, GridIoManager ioMgr, Function<Class<?>,​IgniteLogger> logSupplier)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `clearGlobalStatistics​(StatisticsKey key, Set<String> colNames)` Clear global object statistics.
`ObjectStatisticsImpl` `getGlobalStatistics​(StatisticsKey key)` Get global statistics for the given key.

`void`

`onConfigChanged​(StatisticsObjectConfiguration cfg)`

Process statistics configuration changes: 1) Remove all outbound activity by specified key, inbound may be suspended due to lack of requested configuration. 2) Remove all inbound activity by changed key if reqiest col cfg versions lower than configuration col cfg versions. 3.1) If there are no live column's config - remove cached global statistics. 3.2) If there are some live columns config and global statistics cache contains statistics for the given key - start to collect it again.

`void` `onLocalStatisticsAggregated​(StatisticsKey key, ObjectStatisticsImpl statistics, AffinityTopologyVersion topVer)` After collecting local statistics - check if there are some pending request for it and send responces.
`void` `onMessage​(UUID nodeId, Object msg, byte plc)` Notification for received messages.
`void` `start()` Start operations.
`void` `stop()` Stop operations.

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

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

### Constructor Detail

#### IgniteGlobalStatisticsManager

    public IgniteGlobalStatisticsManager​(IgniteStatisticsManagerImpl statMgr,
                                         GridSystemViewManager sysViewMgr,
                                         IgniteThreadPoolExecutor mgmtPool,
                                         GridDiscoveryManager discoMgr,
                                         GridClusterStateProcessor cluster,
                                         GridCachePartitionExchangeManager<?,​?> exchange,
                                         IgniteStatisticsHelper helper,
                                         GridIoManager ioMgr,
                                         Function<Class<?>,​IgniteLogger> logSupplier)

Constructor.

Parameters:
  `statMgr` - Statistics manager.
  `sysViewMgr` - System view manager.
  `mgmtPool` - Statistics management pool.
  `discoMgr` - Grid discovery manager.
  `cluster` - Cluster state processor.
  `exchange` - Partition exchange manager.
  `helper` - Statistics helper.
  `ioMgr` - Communication manager.
  `logSupplier` - Log supplier.

### Method Detail

#### start

    public void start()

Start operations. Shouldn't be called twice.

#### stop

    public void stop()

Stop operations. Shouldn't be called twice.

#### getGlobalStatistics

    public ObjectStatisticsImpl getGlobalStatistics​(StatisticsKey key)

Get global statistics for the given key. If there is no cached statistics, but there is cache record with empty object - no additional collection will be started.

Parameters:
  `key` - Statistics key.
Returns:
  Global object statistics or `null` if there is no global statistics available.

#### onMessage

    public void onMessage​(UUID nodeId,
                          Object msg,
                          byte plc)

Notification for received messages.

Specified by:
  `onMessage` in interface `GridMessageListener`
Parameters:
  `nodeId` - ID of node that sent the message. Note that may have already left topology by the time this message is received.
  `msg` - Message received.
  `plc` - Message policy (pool).

#### onConfigChanged

    public void onConfigChanged​(StatisticsObjectConfiguration cfg)

Process statistics configuration changes: 1) Remove all outbound activity by specified key, inbound may be suspended due to lack of requested configuration. 2) Remove all inbound activity by changed key if reqiest col cfg versions lower than configuration col cfg versions. 3.1) If there are no live column's config - remove cached global statistics. 3.2) If there are some live columns config and global statistics cache contains statistics for the given key - start to collect it again.

#### clearGlobalStatistics

    public void clearGlobalStatistics​(StatisticsKey key,
                                      Set<String> colNames)

Clear global object statistics.

Parameters:
  `key` - Object key to clear global statistics by.
  `colNames` - Only statistics by specified columns will be cleared.

#### onLocalStatisticsAggregated

    public void onLocalStatisticsAggregated​(StatisticsKey key,
                                            ObjectStatisticsImpl statistics,
                                            AffinityTopologyVersion topVer)

After collecting local statistics - check if there are some pending request for it and send responces.

Parameters:
  `key` - Statistics key on which local statistics was aggregated.
  `statistics` - Collected statistics by key.
  `topVer` - Topology version which aggregated statistics stands for.