Search in sources :

Example 1 with DistributedMetastorageLifecycleListener

use of org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener in project ignite by apache.

the class IgniteExchangeLatchManagerDiscoHistoryTest method testProperException.

/**
 * @throws Exception If failed.
 */
@Test
@WithSystemProperty(key = IGNITE_DISCOVERY_HISTORY_SIZE, value = DISCO_HISTORY_SIZE)
public void testProperException() throws Exception {
    final IgniteEx crd = startGrid(0);
    final CountDownLatch exchangeLatch = new CountDownLatch(1);
    final CountDownLatch startSrvsLatch = new CountDownLatch(1);
    final AtomicReference<Exception> err = new AtomicReference<>();
    // Lifecycle bean that is used to register PartitionsExchangeAware listener.
    lifecycleBean = new LifecycleBean() {

        /**
         * Ignite instance.
         */
        @IgniteInstanceResource
        IgniteEx ignite;

        /**
         * {@inheritDoc}
         */
        @Override
        public void onLifecycleEvent(LifecycleEventType evt) throws IgniteException {
            if (evt == LifecycleEventType.BEFORE_NODE_START) {
                // The goal is registering PartitionsExchangeAware listener before the discovery manager is started.
                ignite.context().internalSubscriptionProcessor().registerDistributedMetastorageListener(new DistributedMetastorageLifecycleListener() {

                    @Override
                    public void onReadyForRead(ReadableDistributedMetaStorage metastorage) {
                        ignite.context().cache().context().exchange().registerExchangeAwareComponent(new PartitionsExchangeAware() {

                            /**
                             * {@inheritDoc}
                             */
                            @Override
                            public void onInitBeforeTopologyLock(GridDhtPartitionsExchangeFuture fut) {
                                try {
                                    // Let's start nodes.
                                    startSrvsLatch.countDown();
                                    // Blocks the initial exchange and waits for other nodes.
                                    exchangeLatch.await(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS);
                                } catch (Exception e) {
                                    err.compareAndSet(null, e);
                                }
                            }
                        });
                    }
                });
            }
        }
    };
    // Start server node with short topology history.
    victim = true;
    GridTestUtils.runAsync(() -> startGrid(1));
    // Waits for the initial exchange.
    startSrvsLatch.await(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS);
    victim = false;
    lifecycleBean = null;
    List<IgniteInternalFuture> srvFuts = new ArrayList<>(TOPOLOGY_HISTORY_SIZE);
    try {
        // Major topology version that is corresponding to the start of the node with short topology history.
        final long topVer = 2;
        // Starting server nodes to exhaust the topology history.
        for (int i = 2; i < 3 * TOPOLOGY_HISTORY_SIZE && !disco.isEmptyTopologyHistory(topVer); ++i) {
            final int currNodeIdx = i;
            final int joinedNodesCnt = disco.totalJoinedNodes();
            srvFuts.add(GridTestUtils.runAsync(() -> startGrid(currNodeIdx)));
            assertTrue("Failed to wait for a new server node [joinedNodesCnt=" + joinedNodesCnt + "]", GridTestUtils.waitForCondition(() -> disco.totalJoinedNodes() >= (joinedNodesCnt + 1), DEFAULT_TIMEOUT));
        }
        assertTrue("Disco cache history is not empty for the topology [majorTopVer=" + topVer + ']', disco.isEmptyTopologyHistory(topVer));
        // Let's continue the ongoing exchange.
        exchangeLatch.countDown();
        boolean failureHnd = GridTestUtils.waitForCondition(() -> cpFailureCtx.get() != null, DEFAULT_TIMEOUT);
        assertNull("Unexpected exception (probably, the topology history still exists [err=" + err + ']', err.get());
        assertTrue("Failure handler was not triggered.", failureHnd);
        // Check that IgniteException was thrown instead of NullPointerException.
        assertTrue("IgniteException must be thrown.", X.hasCause(cpFailureCtx.get().error(), IgniteException.class));
        // Check that message contains a hint to fix the issue.
        GridTestUtils.assertContains(log, cpFailureCtx.get().error().getMessage(), "Consider increasing IGNITE_DISCOVERY_HISTORY_SIZE property. Current value is " + DISCO_HISTORY_SIZE);
    } finally {
        IgnitionEx.stop(getTestIgniteInstanceName(1), true, ShutdownPolicy.IMMEDIATE, true);
        srvFuts.forEach(f -> {
            try {
                f.get(DEFAULT_TIMEOUT);
            } catch (IgniteCheckedException e) {
                err.compareAndSet(null, e);
            }
        });
    }
    assertNull("Unexpected exception [err=" + err.get() + ']', err.get());
}
Also used : ReadableDistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage) GridDhtPartitionsExchangeFuture(org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture) ArrayList(java.util.ArrayList) AtomicReference(java.util.concurrent.atomic.AtomicReference) CountDownLatch(java.util.concurrent.CountDownLatch) IgniteInternalFuture(org.apache.ignite.internal.IgniteInternalFuture) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) PartitionsExchangeAware(org.apache.ignite.internal.processors.cache.distributed.dht.preloader.PartitionsExchangeAware) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteInstanceResource(org.apache.ignite.resources.IgniteInstanceResource) IgniteException(org.apache.ignite.IgniteException) IgniteEx(org.apache.ignite.internal.IgniteEx) LifecycleBean(org.apache.ignite.lifecycle.LifecycleBean) DistributedMetastorageLifecycleListener(org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener) LifecycleEventType(org.apache.ignite.lifecycle.LifecycleEventType) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test) WithSystemProperty(org.apache.ignite.testframework.junits.WithSystemProperty)

Example 2 with DistributedMetastorageLifecycleListener

use of org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener in project ignite by apache.

the class PerformanceStatisticsProcessor method start.

/**
 * {@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 onReadyForWrite(DistributedMetaStorage metastorage) {
            PerformanceStatisticsProcessor.this.metastorage = metastorage;
            try {
                Boolean performanceStatsEnabled = metastorage.read(PERF_STAT_KEY);
                if (performanceStatsEnabled == null)
                    return;
                onMetastorageUpdate(performanceStatsEnabled);
            } catch (IgniteCheckedException e) {
                throw new IgniteException(e);
            }
        }
    });
    rotateProc = new DistributedProcess<>(ctx, PERFORMANCE_STATISTICS_ROTATE, req -> ctx.closure().callLocalSafe(() -> {
        rotateWriter();
        return null;
    }), (id, res, err) -> {
    });
}
Also used : ReadableDistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage) IGNITE_INTERNAL_KEY_PREFIX(org.apache.ignite.internal.processors.metastorage.DistributedMetaStorage.IGNITE_INTERNAL_KEY_PREFIX) NodeStoppingException(org.apache.ignite.internal.NodeStoppingException) PERFORMANCE_STATISTICS_ROTATE(org.apache.ignite.internal.util.distributed.DistributedProcess.DistributedProcessType.PERFORMANCE_STATISTICS_ROTATE) DistributedMetastorageLifecycleListener(org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener) DistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.DistributedMetaStorage) U(org.apache.ignite.internal.util.typedef.internal.U) IgniteFeatures(org.apache.ignite.internal.IgniteFeatures) ArrayList(java.util.ArrayList) GridKernalContext(org.apache.ignite.internal.GridKernalContext) DistributedProcess(org.apache.ignite.internal.util.distributed.DistributedProcess) IgniteFuture(org.apache.ignite.lang.IgniteFuture) GridIntList(org.apache.ignite.internal.util.GridIntList) A(org.apache.ignite.internal.util.typedef.internal.A) IgniteFeatures.allNodesSupports(org.apache.ignite.internal.IgniteFeatures.allNodesSupports) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) UUID(java.util.UUID) Serializable(java.io.Serializable) Consumer(java.util.function.Consumer) EventListener(java.util.EventListener) Nullable(org.jetbrains.annotations.Nullable) GridCacheQueryType(org.apache.ignite.internal.processors.cache.query.GridCacheQueryType) ReadableDistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage) GridPlainRunnable(org.apache.ignite.internal.util.lang.GridPlainRunnable) GridProcessorAdapter(org.apache.ignite.internal.processors.GridProcessorAdapter) IgniteUuid(org.apache.ignite.lang.IgniteUuid) DistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.DistributedMetaStorage) ReadableDistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) DistributedMetastorageLifecycleListener(org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener)

Example 3 with DistributedMetastorageLifecycleListener

use of org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener in project ignite by apache.

the class DistributedConfigurationProcessor method start.

/**
 * {@inheritDoc}
 */
@Override
public void start() throws IgniteCheckedException {
    GridInternalSubscriptionProcessor isp = ctx.internalSubscriptionProcessor();
    isp.registerDistributedMetastorageListener(new DistributedMetastorageLifecycleListener() {

        @Override
        public void onReadyForRead(ReadableDistributedMetaStorage metastorage) {
            distributedMetastorage = ctx.distributedMetastorage();
            // Listener for handling of cluster wide change of specific properties. Do local update.
            distributedMetastorage.listen((key) -> key.startsWith(DIST_CONF_PREFIX), (String key, Serializable oldVal, Serializable newVal) -> {
                DistributedChangeableProperty prop = props.get(toPropertyKey(key));
                if (prop != null)
                    prop.localUpdate(newVal);
            });
            // Switch to actualize action and actualize already registered properties.
            switchCurrentActionTo(ACTUALIZE);
            // Register and actualize properties waited for this service.
            isp.getDistributedConfigurationListeners().forEach(listener -> listener.onReadyToRegister(DistributedConfigurationProcessor.this));
        }

        @Override
        public void onReadyForWrite(DistributedMetaStorage metastorage) {
            // Switch to cluster wide update action and do it on already registered properties.
            switchCurrentActionTo(CLUSTER_WIDE_UPDATE);
            isp.getDistributedConfigurationListeners().forEach(DistributedConfigurationLifecycleListener::onReadyToWrite);
        }
    });
}
Also used : ReadableDistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage) Arrays(java.util.Arrays) GridFutureAdapter(org.apache.ignite.internal.util.future.GridFutureAdapter) DistributedMetastorageLifecycleListener(org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) DistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.DistributedMetaStorage) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Collectors(java.util.stream.Collectors) GridInternalSubscriptionProcessor(org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor) Serializable(java.io.Serializable) GridKernalContext(org.apache.ignite.internal.GridKernalContext) REGISTER(org.apache.ignite.internal.processors.configuration.distributed.DistributedConfigurationProcessor.AllowableAction.REGISTER) List(java.util.List) Map(java.util.Map) ReadableDistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage) GridProcessorAdapter(org.apache.ignite.internal.processors.GridProcessorAdapter) ACTUALIZE(org.apache.ignite.internal.processors.configuration.distributed.DistributedConfigurationProcessor.AllowableAction.ACTUALIZE) CLUSTER_WIDE_UPDATE(org.apache.ignite.internal.processors.configuration.distributed.DistributedConfigurationProcessor.AllowableAction.CLUSTER_WIDE_UPDATE) Serializable(java.io.Serializable) DistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.DistributedMetaStorage) ReadableDistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage) GridInternalSubscriptionProcessor(org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor) DistributedMetastorageLifecycleListener(org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener)

Example 4 with DistributedMetastorageLifecycleListener

use of org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener in project ignite by apache.

the class GridMetricManager method start.

/**
 * {@inheritDoc}
 */
@Override
public void start() throws IgniteCheckedException {
    for (MetricExporterSpi spi : getSpis()) spi.setMetricRegistry(this);
    startSpi();
    // In case standalone kernal start.
    if (ctx.internalSubscriptionProcessor() == null)
        return;
    ctx.internalSubscriptionProcessor().registerDistributedMetastorageListener(new DistributedMetastorageLifecycleListener() {

        /**
         * {@inheritDoc}
         */
        @Override
        public void onReadyForRead(ReadableDistributedMetaStorage metastorage) {
            roMetastorage = metastorage;
            try {
                metastorage.iterate(HITRATE_CFG_PREFIX, (name, val) -> onHitRateConfigChanged(name.substring(HITRATE_CFG_PREFIX.length() + 1), (Long) val));
                metastorage.iterate(HISTOGRAM_CFG_PREFIX, (name, val) -> onHistogramConfigChanged(name.substring(HISTOGRAM_CFG_PREFIX.length() + 1), (long[]) val));
            } catch (IgniteCheckedException e) {
                throw new IgniteException(e);
            }
            metastorage.listen(n -> n.startsWith(HITRATE_CFG_PREFIX), (name, oldVal, newVal) -> onHitRateConfigChanged(name.substring(HITRATE_CFG_PREFIX.length() + 1), (Long) newVal));
            metastorage.listen(n -> n.startsWith(HISTOGRAM_CFG_PREFIX), (name, oldVal, newVal) -> onHistogramConfigChanged(name.substring(HISTOGRAM_CFG_PREFIX.length() + 1), (long[]) newVal));
        }

        /**
         * {@inheritDoc}
         */
        @Override
        public void onReadyForWrite(DistributedMetaStorage metastorage) {
            GridMetricManager.this.metastorage = metastorage;
        }
    });
}
Also used : ReadableDistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage) NodeStoppingException(org.apache.ignite.internal.NodeStoppingException) Metric(org.apache.ignite.spi.metric.Metric) DistributedMetastorageLifecycleListener(org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener) DistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.DistributedMetaStorage) GridCompoundFuture(org.apache.ignite.internal.util.future.GridCompoundFuture) U(org.apache.ignite.internal.util.typedef.internal.U) GridTimeoutProcessor(org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor) Supplier(java.util.function.Supplier) IgniteUtils.notifyListeners(org.apache.ignite.internal.util.IgniteUtils.notifyListeners) GridKernalContext(org.apache.ignite.internal.GridKernalContext) MemoryMXBean(java.lang.management.MemoryMXBean) GarbageCollectorMXBean(java.lang.management.GarbageCollectorMXBean) GridManagerAdapter(org.apache.ignite.internal.managers.GridManagerAdapter) ATTR_PHY_RAM(org.apache.ignite.internal.IgniteNodeAttributes.ATTR_PHY_RAM) AtomicLongMetric(org.apache.ignite.internal.processors.metric.impl.AtomicLongMetric) S(org.apache.ignite.internal.util.typedef.internal.S) IgniteComponentType(org.apache.ignite.internal.IgniteComponentType) MetricExporterSpi(org.apache.ignite.spi.metric.MetricExporterSpi) ManagementFactory(java.lang.management.ManagementFactory) OperatingSystemMXBean(java.lang.management.OperatingSystemMXBean) MetricUtils.metricName(org.apache.ignite.internal.processors.metric.impl.MetricUtils.metricName) MemoryUsage(java.lang.management.MemoryUsage) ReadOnlyMetricManager(org.apache.ignite.spi.metric.ReadOnlyMetricManager) MetricUtils.fromFullName(org.apache.ignite.internal.processors.metric.impl.MetricUtils.fromFullName) DoubleMetricImpl(org.apache.ignite.internal.processors.metric.impl.DoubleMetricImpl) RuntimeMXBean(java.lang.management.RuntimeMXBean) F(org.apache.ignite.internal.util.typedef.F) HistogramMetric(org.apache.ignite.spi.metric.HistogramMetric) Iterator(java.util.Iterator) A(org.apache.ignite.internal.util.typedef.internal.A) Collection(java.util.Collection) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) ThreadMXBean(java.lang.management.ThreadMXBean) Serializable(java.io.Serializable) T2(org.apache.ignite.internal.util.typedef.T2) Consumer(java.util.function.Consumer) ReadOnlyMetricRegistry(org.apache.ignite.spi.metric.ReadOnlyMetricRegistry) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) HistogramMetricImpl(org.apache.ignite.internal.processors.metric.impl.HistogramMetricImpl) ReadableDistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage) HitRateMetric(org.apache.ignite.internal.processors.metric.impl.HitRateMetric) NotNull(org.jetbrains.annotations.NotNull) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) DistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.DistributedMetaStorage) ReadableDistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) DistributedMetastorageLifecycleListener(org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener) MetricExporterSpi(org.apache.ignite.spi.metric.MetricExporterSpi)

Example 5 with DistributedMetastorageLifecycleListener

use of org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener in project ignite by apache.

the class BaselineAutoAdjustTest method testExchangeMerge.

/**
 * Tests that merging exchanges properly triggers baseline changing.
 *
 * @throws Exception If failed.
 */
@Test
public void testExchangeMerge() throws Exception {
    // Latch that waits for PME (intTopVer == 3.0)
    CountDownLatch exchangeWorkerLatch = new CountDownLatch(1);
    // Lyficycle bean is needed in order to register EVT_NODE_JOIN lister that is called
    // right after GridCachePartitionExchangeManager and before GridClusterStateProcessor.
    lifecycleBean = new LifecycleBean() {

        /**
         * Ignite instance.
         */
        @IgniteInstanceResource
        IgniteEx ignite;

        /**
         * {@inheritDoc}
         */
        @Override
        public void onLifecycleEvent(LifecycleEventType evt) throws IgniteException {
            if (evt == LifecycleEventType.BEFORE_NODE_START) {
                ignite.context().internalSubscriptionProcessor().registerDistributedMetastorageListener(new DistributedMetastorageLifecycleListener() {

                    @Override
                    public void onReadyForRead(ReadableDistributedMetaStorage metastorage) {
                        ignite.context().event().addDiscoveryEventListener((evt, disco) -> {
                            if (evt.type() == EVT_NODE_JOINED && evt.topologyVersion() == 3) {
                                try {
                                    // Let's wait for exchange worker starts PME
                                    // that related to the first node joined the cluster.
                                    exchangeWorkerLatch.await(getTestTimeout(), MILLISECONDS);
                                } catch (InterruptedException e) {
                                    throw new IgniteException("exchangeWorkerLatch has been interrupted.", e);
                                }
                            }
                        }, EVT_NODE_JOINED);
                    }
                });
            }
        }
    };
    // Start the coordinator node.
    IgniteEx crd = startGrid(0);
    // This bean is only required on the coordinator node.
    lifecycleBean = null;
    // Latch indicates that EVT_NODE_JOINED (topVer == 4.0) was processed by all listeners.
    CountDownLatch nodeJoinLatch = new CountDownLatch(1);
    // This listener is the last one in the queue of handlers.
    crd.context().event().addDiscoveryEventListener((evt, disco) -> {
        if (evt.type() == EVT_NODE_JOINED && evt.topologyVersion() == 4)
            nodeJoinLatch.countDown();
    }, EVT_NODE_JOINED);
    IgniteEx nonCrd = startGrid(1);
    crd.cluster().state(ACTIVE);
    crd.cluster().baselineAutoAdjustEnabled(true);
    crd.cluster().baselineAutoAdjustTimeout(autoAdjustTimeout);
    awaitPartitionMapExchange(false, true, null);
    TestRecordingCommunicationSpi spi1 = TestRecordingCommunicationSpi.spi(nonCrd);
    spi1.blockMessages((node, msg) -> msg instanceof GridDhtPartitionsSingleMessage);
    // Target major topology version (4 nodes)
    long targetTopVer = 4;
    // Let's block exchange process in order to merge two following exchanges (3.0 && 4.0).
    crd.context().cache().context().exchange().mergeExchangesTestWaitVersion(new AffinityTopologyVersion(targetTopVer, 0), null);
    AtomicInteger cnt = new AtomicInteger(G.allGrids().size());
    runMultiThreadedAsync(new Callable<Void>() {

        @Override
        public Void call() throws Exception {
            startGrid(cnt.getAndIncrement());
            return null;
        }
    }, 2, "async-grid-starter");
    // Make sure that PME is in progress.
    assertTrue("Failed to wait for PME [topVer=3]", spi1.waitForBlocked(1, getTestTimeout()));
    assertTrue("Failed to wait for the first started exchange.", waitForCondition(() -> {
        GridDhtPartitionsExchangeFuture fut = crd.context().cache().context().exchange().lastTopologyFuture();
        return fut.initialVersion().topologyVersion() == 3;
    }, getTestTimeout()));
    // This guarantees that BaselineAutoAdjustData listens to real GridDhtPartitionsExchangeFuture
    // instead of readyAffinityFuture.
    exchangeWorkerLatch.countDown();
    assertTrue("Failed to wait for processing node join event [topVer=3]", nodeJoinLatch.await(getTestTimeout(), MILLISECONDS));
    // Unblock PME
    spi1.stopBlock();
    assertTrue("Failed to wait for changing baseline in " + autoAdjustTimeout * 2 + " ms.", waitForCondition(() -> crd.cluster().currentBaselineTopology().size() == targetTopVer, autoAdjustTimeout * 2));
}
Also used : ReadableDistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage) GridDhtPartitionsExchangeFuture(org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture) AffinityTopologyVersion(org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion) CountDownLatch(java.util.concurrent.CountDownLatch) IgniteSpiException(org.apache.ignite.spi.IgniteSpiException) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) GridDhtPartitionsSingleMessage(org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsSingleMessage) TestRecordingCommunicationSpi(org.apache.ignite.internal.TestRecordingCommunicationSpi) IgniteInstanceResource(org.apache.ignite.resources.IgniteInstanceResource) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) IgniteException(org.apache.ignite.IgniteException) IgniteEx(org.apache.ignite.internal.IgniteEx) LifecycleBean(org.apache.ignite.lifecycle.LifecycleBean) DistributedMetastorageLifecycleListener(org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener) LifecycleEventType(org.apache.ignite.lifecycle.LifecycleEventType) GridCommonTest(org.apache.ignite.testframework.junits.common.GridCommonTest) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Aggregations

IgniteCheckedException (org.apache.ignite.IgniteCheckedException)5 DistributedMetastorageLifecycleListener (org.apache.ignite.internal.processors.metastorage.DistributedMetastorageLifecycleListener)5 ReadableDistributedMetaStorage (org.apache.ignite.internal.processors.metastorage.ReadableDistributedMetaStorage)5 IgniteException (org.apache.ignite.IgniteException)4 Serializable (java.io.Serializable)3 GridKernalContext (org.apache.ignite.internal.GridKernalContext)3 DistributedMetaStorage (org.apache.ignite.internal.processors.metastorage.DistributedMetaStorage)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 Consumer (java.util.function.Consumer)2 IgniteEx (org.apache.ignite.internal.IgniteEx)2 NodeStoppingException (org.apache.ignite.internal.NodeStoppingException)2 GridProcessorAdapter (org.apache.ignite.internal.processors.GridProcessorAdapter)2 GridDhtPartitionsExchangeFuture (org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture)2 GarbageCollectorMXBean (java.lang.management.GarbageCollectorMXBean)1 ManagementFactory (java.lang.management.ManagementFactory)1 MemoryMXBean (java.lang.management.MemoryMXBean)1 MemoryUsage (java.lang.management.MemoryUsage)1