nizhikov commented on a change in pull request #8928:
URL: https://github.com/apache/ignite/pull/8928#discussion_r611662287
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
##########
@@ -70,45 +70,50 @@
private final ArrayList<PerformanceStatisticsStateListener> lsnrs = new
ArrayList<>();
/** Rotate performance statistics process. */
- private final DistributedProcess<Serializable, Serializable> rotateProc;
+ private DistributedProcess<Serializable, Serializable> rotateProc;
/** @param ctx Kernal context. */
public PerformanceStatisticsProcessor(GridKernalContext ctx) {
super(ctx);
+ registerStateListener(() -> {
+ if (U.isLocalNodeCoordinator(ctx.discovery()))
+ ctx.cache().cacheDescriptors().values().forEach(desc ->
cacheStart(desc.cacheId(), desc.cacheName()));
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public void start() throws IgniteCheckedException {
+ super.start();
+
ctx.internalSubscriptionProcessor().registerDistributedMetastorageListener(
new DistributedMetastorageLifecycleListener() {
- @Override public void
onReadyForRead(ReadableDistributedMetaStorage metastorage) {
- metastorage.listen(PERF_STAT_KEY::equals, (key, oldVal,
newVal) -> {
- // Skip history on local join.
- if (!ctx.discovery().localJoinFuture().isDone())
- return;
-
- onMetastorageUpdate((boolean)newVal);
- });
- }
+ @Override public void
onReadyForRead(ReadableDistributedMetaStorage metastorage) {
Review comment:
Why this change?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]