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

## Class IgniteStatisticsInMemoryStoreImpl

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

All Implemented Interfaces:
  `IgniteStatisticsStore`

    public class IgniteStatisticsInMemoryStoreImpl
    extends Object
    implements IgniteStatisticsStore

Sql statistics storage in metastore. Will store all statistics related objects with prefix "stats." Store only partition level statistics.

### Constructor Summary

Constructors
`IgniteStatisticsInMemoryStoreImpl​(Function<Class<?>,​IgniteLogger> logSupplier)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `clearAllStatistics()` Clear statistics of any type for any objects;
`void` `clearLocalPartitionsStatistics​(StatisticsKey key)` Clear partition statistics for specified object.
`void` `clearLocalPartitionsStatistics​(StatisticsKey key, Collection<Integer> partIds)` Clear partitions statistics.
`void` `clearLocalPartitionStatistics​(StatisticsKey key, int partId)` Clear partition statistics.
`void` `clearObsolescenceInfo​(StatisticsKey key, Collection<Integer> partIds)` Remove obsolescence info for the given key and partitions (if specified).
`Map<StatisticsKey,​Collection<ObjectPartitionStatisticsImpl>>` `getAllLocalPartitionsStatistics​(String schema)` Get all local partition statistics.
`Collection<ObjectPartitionStatisticsImpl>` `getLocalPartitionsStatistics​(StatisticsKey key)` Get local partition statistics by specified object.
`ObjectPartitionStatisticsImpl` `getLocalPartitionStatistics​(StatisticsKey key, int partId)` Get partition statistics.
`Map<StatisticsKey,​IntMap<ObjectPartitionStatisticsObsolescence>>` `loadAllObsolescence()` Load all obsolescence info from store.
`Collection<Integer>` `loadLocalPartitionMap​(StatisticsKey key)` Load partitions map by key.
`void` `replaceLocalPartitionsStatistics​(StatisticsKey key, Collection<ObjectPartitionStatisticsImpl> statistics)` Replace all tables partition statistics with specified ones.
`void` `saveLocalPartitionStatistics​(StatisticsKey key, ObjectPartitionStatisticsImpl statistics)` Save partition statistics.
`void` `saveObsolescenceInfo​(Map<StatisticsKey,​IntMap<ObjectPartitionStatisticsObsolescence>> obsolescence)`
`void` `saveObsolescenceInfo​(StatisticsKey key, int partId, ObjectPartitionStatisticsObsolescence partObs)` Save obsolescence info.

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

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

### Constructor Detail

#### IgniteStatisticsInMemoryStoreImpl

    public IgniteStatisticsInMemoryStoreImpl​(Function<Class<?>,​IgniteLogger> logSupplier)

Constructor.

Parameters:
  `logSupplier` - Logger getting function.

### Method Detail

#### clearAllStatistics

    public void clearAllStatistics()

Clear statistics of any type for any objects;

Specified by:
  `clearAllStatistics` in interface `IgniteStatisticsStore`

#### getAllLocalPartitionsStatistics

    public Map<StatisticsKey,​Collection<ObjectPartitionStatisticsImpl>> getAllLocalPartitionsStatistics​(String schema)

Get all local partition statistics.

Specified by:
  `getAllLocalPartitionsStatistics` in interface `IgniteStatisticsStore`
Parameters:
  `schema` - Schema name, if `null` - returl local partitions statistics for all schemas.
Returns:
  Map with all local partitions statistics.

#### replaceLocalPartitionsStatistics

    public void replaceLocalPartitionsStatistics​(StatisticsKey key,
                                                 Collection<ObjectPartitionStatisticsImpl> statistics)

Replace all tables partition statistics with specified ones.

Specified by:
  `replaceLocalPartitionsStatistics` in interface `IgniteStatisticsStore`
Parameters:
  `key` - Statistics key to replace statistics by.
  `statistics` - Collection of partition level statistics.

#### getLocalPartitionsStatistics

    public Collection<ObjectPartitionStatisticsImpl> getLocalPartitionsStatistics​(StatisticsKey key)

Get local partition statistics by specified object.

Specified by:
  `getLocalPartitionsStatistics` in interface `IgniteStatisticsStore`
Parameters:
  `key` - Key to get statistics by.
Returns:
  Collection of partitions statistics.

#### clearLocalPartitionsStatistics

    public void clearLocalPartitionsStatistics​(StatisticsKey key)

Clear partition statistics for specified object.

Specified by:
  `clearLocalPartitionsStatistics` in interface `IgniteStatisticsStore`
Parameters:
  `key` - Key to clear statistics by.

#### saveLocalPartitionStatistics

    public void saveLocalPartitionStatistics​(StatisticsKey key,
                                             ObjectPartitionStatisticsImpl statistics)

Save partition statistics.

Specified by:
  `saveLocalPartitionStatistics` in interface `IgniteStatisticsStore`
Parameters:
  `key` - Object which partition statistics belongs to.
  `statistics` - Statistics to save.

#### saveObsolescenceInfo

    public void saveObsolescenceInfo​(Map<StatisticsKey,​IntMap<ObjectPartitionStatisticsObsolescence>> obsolescence)

Specified by:
  `saveObsolescenceInfo` in interface `IgniteStatisticsStore`
Parameters:
  `obsolescence` - Statistics key to partId to obsolescence info map to save.

#### saveObsolescenceInfo

    public void saveObsolescenceInfo​(StatisticsKey key,
                                     int partId,
                                     ObjectPartitionStatisticsObsolescence partObs)

Save obsolescence info.

Specified by:
  `saveObsolescenceInfo` in interface `IgniteStatisticsStore`
Parameters:
  `key` - Statistics key which it is belongs to.
  `partId` - Partition id.
  `partObs` - Info to save.

#### clearObsolescenceInfo

    public void clearObsolescenceInfo​(StatisticsKey key,
                                      Collection<Integer> partIds)

Remove obsolescence info for the given key and partitions (if specified).

Specified by:
  `clearObsolescenceInfo` in interface `IgniteStatisticsStore`
Parameters:
  `key` - Statistics key to remove obsolescense info by.
  `partIds` - Partition ids, if `null` - remove all partitions info for specified key.

#### loadAllObsolescence

    public Map<StatisticsKey,​IntMap<ObjectPartitionStatisticsObsolescence>> loadAllObsolescence()

Load all obsolescence info from store.

Specified by:
  `loadAllObsolescence` in interface `IgniteStatisticsStore`
Returns:
  StatisticsKey to partitionId to obsolescence info map.

#### getLocalPartitionStatistics

    public ObjectPartitionStatisticsImpl getLocalPartitionStatistics​(StatisticsKey key,
                                                                     int partId)

Get partition statistics.

Specified by:
  `getLocalPartitionStatistics` in interface `IgniteStatisticsStore`
Parameters:
  `key` - Key to get partition statistics by.
  `partId` - Partition id.
Returns:
  Object partition statistics or `null` if there are no statistics collected for such partition.

#### clearLocalPartitionStatistics

    public void clearLocalPartitionStatistics​(StatisticsKey key,
                                              int partId)

Clear partition statistics.

Specified by:
  `clearLocalPartitionStatistics` in interface `IgniteStatisticsStore`
Parameters:
  `key` - Object which statistics needs to be cleaned.
  `partId` - Partition id.

#### clearLocalPartitionsStatistics

    public void clearLocalPartitionsStatistics​(StatisticsKey key,
                                               Collection<Integer> partIds)

Clear partitions statistics.

Specified by:
  `clearLocalPartitionsStatistics` in interface `IgniteStatisticsStore`
Parameters:
  `key` - Object which statistics need to be cleaned.
  `partIds` - Collection of partition ids.

#### loadLocalPartitionMap

    public Collection<Integer> loadLocalPartitionMap​(StatisticsKey key)

Load partitions map by key.

Specified by:
  `loadLocalPartitionMap` in interface `IgniteStatisticsStore`
Parameters:
  `key` - Staistics key to load map by.
Returns:
  Collection of all partition ids for which there are local partitions statistics.