Class IgniteStatisticsConfigurationManager
- java.lang.Object
-
- org.apache.ignite.internal.processors.query.stat.IgniteStatisticsConfigurationManager
-
public class IgniteStatisticsConfigurationManager extends Object
Holds statistic configuration objects at the distributed metastore and match local statistics with target statistic configuration.
-
-
Field Summary
Fields Modifier and Type Field Description static String[]EMPTY_STRINGSEmpty strings array.
-
Constructor Summary
Constructors Constructor Description IgniteStatisticsConfigurationManager(SchemaManager schemaMgr, GridInternalSubscriptionProcessor subscriptionProcessor, GridSystemViewManager sysViewMgr, GridClusterStateProcessor cluster, StatisticsProcessor statProc, boolean persistence, IgniteThreadPoolExecutor mgmtPool, Supplier<Boolean> stopping, Function<Class<?>,IgniteLogger> logSupplier, boolean isServerNode)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterTopologyUnlock(GridDhtPartitionsExchangeFuture fut)Update statistics after topology change, if necessary.StatisticsObjectConfigurationconfig(StatisticsKey key)Read statistics object configuration by key.voiddropAll()Drop all local statistics on the cluster.voiddropStatistics(List<StatisticsTarget> targets, boolean validate)Drop local statistic for specified database objects on the cluster.IgniteInternalFuture<Boolean>dropStatisticsAsync(List<StatisticsTarget> targets, boolean validate)Drop local statistic for specified database objects on the cluster.Collection<StatisticsObjectConfiguration>getAllConfig()Get statistics configurations for all objects.voidrefreshStatistics(List<StatisticsTarget> targets)Refresh local statistic for specified database objects on the cluster.voidstart()Start tracking configuration changes and do initial loading.voidstop()Stop tracking configuration changes.voidsubscribe(Consumer<StatisticsObjectConfiguration> subscriber)Subscribe to statistics configuration changed.voidupdateAllLocalStatistics()Scan statistics configuration and update each key it contains.voidupdateStatistics(StatisticsObjectConfiguration... targets)Update local statistic for specified database objects on the cluster.
-
-
-
Field Detail
-
EMPTY_STRINGS
public static final String[] EMPTY_STRINGS
Empty strings array.
-
-
Constructor Detail
-
IgniteStatisticsConfigurationManager
public IgniteStatisticsConfigurationManager(SchemaManager schemaMgr, GridInternalSubscriptionProcessor subscriptionProcessor, GridSystemViewManager sysViewMgr, GridClusterStateProcessor cluster, StatisticsProcessor statProc, boolean persistence, IgniteThreadPoolExecutor mgmtPool, Supplier<Boolean> stopping, Function<Class<?>,IgniteLogger> logSupplier, boolean isServerNode)
Constructor.- Parameters:
schemaMgr- Schema manager.subscriptionProcessor- Subscription processor.sysViewMgr- System view manager.cluster- Cluster state processor.statProc- Staitistics processor.persistence- Persistence enabled flag.mgmtPool- Statistics management poolstopping- Stopping state supplier.logSupplier- Log supplier.isServerNode- Server node flag.
-
-
Method Detail
-
afterTopologyUnlock
public void afterTopologyUnlock(GridDhtPartitionsExchangeFuture fut)
Update statistics after topology change, if necessary.- Parameters:
fut- Topology change future.
-
getAllConfig
public Collection<StatisticsObjectConfiguration> getAllConfig() throws IgniteCheckedException
Get statistics configurations for all objects.- Returns:
- Collection of all statistics configuration.
- Throws:
IgniteCheckedException- In case of error.
-
start
public void start()
Start tracking configuration changes and do initial loading.
-
updateAllLocalStatistics
public void updateAllLocalStatistics()
Scan statistics configuration and update each key it contains.
-
stop
public void stop()
Stop tracking configuration changes.
-
updateStatistics
public void updateStatistics(StatisticsObjectConfiguration... targets)
Update local statistic for specified database objects on the cluster. Each node will scan local primary partitions to collect and update local statistic.- Parameters:
targets- DB objects to statistics update.
-
dropStatistics
public void dropStatistics(List<StatisticsTarget> targets, boolean validate)
Drop local statistic for specified database objects on the cluster. Remove local aggregated and partitioned statistics that are stored at the local metastorage.- Parameters:
targets- DB objects to update statistics by.validate- iftrue- validate statistics existence, otherwise - just try to remove.
-
dropStatisticsAsync
public IgniteInternalFuture<Boolean> dropStatisticsAsync(List<StatisticsTarget> targets, boolean validate)
Drop local statistic for specified database objects on the cluster. Remove local aggregated and partitioned statistics that are stored at the local metastorage.- Parameters:
targets- DB objects to update statistics by.validate- iftrue- validate statistics existence, otherwise - just try to remove.
-
dropAll
public void dropAll()
Drop all local statistics on the cluster.
-
refreshStatistics
public void refreshStatistics(List<StatisticsTarget> targets)
Refresh local statistic for specified database objects on the cluster.- Parameters:
targets- DB objects to statistics update.
-
config
public StatisticsObjectConfiguration config(StatisticsKey key) throws IgniteCheckedException
Read statistics object configuration by key.- Parameters:
key- Statistics key to read configuration by.- Returns:
- Statistics object configuration of
nullif there are no such configuration. - Throws:
IgniteCheckedException- In case of errors.
-
subscribe
public void subscribe(Consumer<StatisticsObjectConfiguration> subscriber)
Subscribe to statistics configuration changed.- Parameters:
subscriber- Subscriber.
-
-