Class StatisticsProcessor
- java.lang.Object
-
- org.apache.ignite.internal.processors.query.stat.StatisticsProcessor
-
public class StatisticsProcessor extends Object
Process all tasks, related to statistics repository. Mostly - statistics collection, invalidation (due to configuration, topology or obsolescence issues) and loads. Input tasks should be scheduled throug management pool while gathering pool used to process heavy operations in parallel. Manage gathering pool and it's jobs. To guarantee gracefull shutdown: 1) Any job can be added into gatheringInProgress only in active state (check after adding) 2) State can be disactivated only after cancelling all jobs and getting busyLock block 3) Each job should do it's work in busyLock with periodically checking of it's cancellation status.
-
-
Constructor Summary
Constructors Constructor Description StatisticsProcessor(IgniteStatisticsRepository repo, IgniteThreadPoolExecutor gatherPool, Supplier<Boolean> stopping, Function<Class<?>,IgniteLogger> logSupplier)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidstart()Start gathering.voidstop()Stop gathering.voidupdateLocalStatistics(LocalStatisticsGatheringContext ctx)Update statistics for the given key to actual state.
-
-
-
Constructor Detail
-
StatisticsProcessor
public StatisticsProcessor(IgniteStatisticsRepository repo, IgniteThreadPoolExecutor gatherPool, Supplier<Boolean> stopping, Function<Class<?>,IgniteLogger> logSupplier)
Constructor.- Parameters:
repo- IgniteStatisticsRepository.gatherPool- Thread pool to gather statistics in.stopping- External stopping state supplier.logSupplier- Log supplier function.
-
-
Method Detail
-
updateLocalStatistics
public void updateLocalStatistics(LocalStatisticsGatheringContext ctx)
Update statistics for the given key to actual state. If byObsolescence and tbl is notnull- does not clear any other partitions. 1) Replace previous gathering context if exist and needed (replace byObsolescence gathering with new one or replace gathering with older configuration or topology version with new one). 2) If byObsolescence and no table awailable - clean obsolescence and partition statistics for the given key. 3) Submit tasks for each specified partition. 4) after last task finish gathering - it starts aggregation. 5) read all partitions & obsolescence from repo and if byObsolescence =true- remove unnecessary one and aggregate by specified list if byObsolescence =false- aggregate all presented in store (because it should contains only actual ones) 5) save aggregated local statistics- Parameters:
ctx- Statistics Gathering context.
-
start
public void start()
Start gathering.
-
stop
public void stop()
Stop gathering.
-
-