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

## Class StatisticsObjectConfiguration

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

All Implemented Interfaces:
  Serializable, Comparable<StatisticsObjectConfiguration>

    public class StatisticsObjectConfiguration
    extends Object
    implements Serializable, Comparable<StatisticsObjectConfiguration>

Describe configuration of the statistic for a database object (e.g. TABLE).

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `StatisticsObjectConfiguration.Diff` Difference between current and target configuration.

### Field Summary

Fields
`static byte` `DEFAULT_OBSOLESCENCE_MAX_PERCENT` Rows limit to renew partition statistics in percent.

### Constructor Summary

Constructors
Constructor and Description
`StatisticsObjectConfiguration(StatisticsKey key)` Constructor.
`StatisticsObjectConfiguration(StatisticsKey key, Collection<StatisticsColumnConfiguration> cols, byte maxPartitionObsolescencePercent)` Constructor.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`Map<String,StatisticsColumnConfiguration>` `columns()` Get active (non tombstone) columns statistics configuration.
`Map<String,StatisticsColumnConfiguration>` `columnsAll()` Get configurations of all statistic columns includes tombstone configuration objects (dropped columns).
`int` `compareTo(@NotNull StatisticsObjectConfiguration o)` Compare only configuration from the same branch.
`static StatisticsObjectConfiguration.Diff` `diff(StatisticsObjectConfiguration oldCfg, StatisticsObjectConfiguration newCfg)` Calculate diff between two configuration.
`StatisticsObjectConfiguration` `dropColumns(Set<String> dropColNames)` Creates new configuration object for drop specified columns from current configuration.
`boolean` `equals(Object o)`
`int` `hashCode()`
`StatisticsKey` `key()` Get database object key (schema and name).
`byte` `maxPartitionObsolescencePercent()`
`static StatisticsObjectConfiguration` `merge(@NotNull StatisticsObjectConfiguration oldCfg, @NotNull StatisticsObjectConfiguration newCfg)` Merge configuration changes with existing configuration.
`StatisticsObjectConfiguration` `refresh(Set<String> refreshCols)` Creates new configuration object to refresh statistic with current configuration.
`String` `toString()`

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

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Field Detail

#### DEFAULT_OBSOLESCENCE_MAX_PERCENT

    public static final byte DEFAULT_OBSOLESCENCE_MAX_PERCENT

Rows limit to renew partition statistics in percent.

See Also:
  Constant Field Values

### Constructor Detail

#### StatisticsObjectConfiguration

    public StatisticsObjectConfiguration(StatisticsKey key,
                                         Collection<StatisticsColumnConfiguration> cols,
                                         byte maxPartitionObsolescencePercent)

Constructor.

Parameters:
  `key` - Statistics key.
  `cols` - Column statistics configuration.
  `maxPartitionObsolescencePercent` - Maximum number of changed rows per partition.

#### StatisticsObjectConfiguration

    public StatisticsObjectConfiguration(StatisticsKey key)

Constructor.

Parameters:
  `key` - Statistics key.

### Method Detail

#### merge

    public static StatisticsObjectConfiguration merge(@NotNull
                                                      @NotNull StatisticsObjectConfiguration oldCfg,
                                                      @NotNull
                                                      @NotNull StatisticsObjectConfiguration newCfg)

Merge configuration changes with existing configuration.

Parameters:
  `oldCfg` - Previous configuration.
  `newCfg` - Contains target configuration changes.
Returns:
  merged configuration.

#### dropColumns

    public StatisticsObjectConfiguration dropColumns(Set<String> dropColNames)

Creates new configuration object for drop specified columns from current configuration. Marks dropped columns as tombstone.

Parameters:
  `dropColNames` - Set of dropped columns.
Returns:
  Result configuration object.

#### refresh

    public StatisticsObjectConfiguration refresh(Set<String> refreshCols)

Creates new configuration object to refresh statistic with current configuration.

Parameters:
  `refreshCols` - Set of columns to refresh, if `null` or empty - all columns will be refreshed.
Returns:
  Result configuration object.

#### diff

    public static StatisticsObjectConfiguration.Diff diff(StatisticsObjectConfiguration oldCfg,
                                                          StatisticsObjectConfiguration newCfg)

Calculate diff between two configuration.

Parameters:
  `oldCfg` - Current configuration.
  `newCfg` - Target configuration.
Returns:
  Configurations differences.

#### key

    public StatisticsKey key()

Get database object key (schema and name).

Returns:
  statistic key.

#### columnsAll

    public Map<String,StatisticsColumnConfiguration> columnsAll()

Get configurations of all statistic columns includes tombstone configuration objects (dropped columns).

Returns:
  statistic key.

#### columns

    public Map<String,StatisticsColumnConfiguration> columns()

Get active (non tombstone) columns statistics configuration.

Returns:
  Map column name to column statistics configuration.

#### maxPartitionObsolescencePercent

    public byte maxPartitionObsolescencePercent()

Returns:
  Maximum number of changed rows per partition.

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### compareTo

    public int compareTo(@NotNull
                         @NotNull StatisticsObjectConfiguration o)

Compare only configuration from the same branch. I.e. can't correctly compare Cfg(A=v1,B=v3) vs Cfg(A=v2,B=v1) Cfg(A=v1,B=v3) vs Cfg(A=v1,C=v2) because there is no changes chain to get one from another.

Specified by:
  `compareTo` in interface `Comparable<StatisticsObjectConfiguration>`
Parameters:
  `o` - Other configuration to compare.
Returns:
  Comparison result.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

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