diff --git a/docs/_docs/persistence/native-persistence.adoc b/docs/_docs/persistence/native-persistence.adoc index f0ddbb70c7a97..4d67c2cb4f46c 100644 --- a/docs/_docs/persistence/native-persistence.adoc +++ b/docs/_docs/persistence/native-persistence.adoc @@ -197,7 +197,7 @@ If the memory-mapped file approach is disabled then the changes stay in node's i Otherwise, recent data updates may get lost in case of a process crash or other outages. | `NONE` | WAL is disabled. The changes are persisted only if you shut down the node gracefully. -Use `Ignite.active(false)` to deactivate the cluster and shut down the node. +Use `Ignite.cluster().state(ClusterState.INACTIVE)` to deactivate the cluster and shut down the node. | Data loss might occur. diff --git a/examples/src/main/java/org/apache/ignite/examples/persistentstore/PersistentStoreExample.java b/examples/src/main/java/org/apache/ignite/examples/persistentstore/PersistentStoreExample.java index e9731b9c5fcbd..18cf85f0687ac 100644 --- a/examples/src/main/java/org/apache/ignite/examples/persistentstore/PersistentStoreExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/persistentstore/PersistentStoreExample.java @@ -26,6 +26,7 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.examples.datagrid.CacheQueryExample; import org.apache.ignite.examples.model.Organization; @@ -63,7 +64,7 @@ public static void main(String[] args) throws Exception { try (Ignite ignite = Ignition.start("examples/config/persistentstore/example-persistent-store.xml")) { // Activate the cluster. Required to do if the persistent store is enabled because you might need // to wait while all the nodes, that store a subset of data on disk, join the cluster. - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); CacheConfiguration cacheCfg = new CacheConfiguration<>(ORG_CACHE); diff --git a/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jol/FileStoreHeapUtilizationJolBenchmark.java b/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jol/FileStoreHeapUtilizationJolBenchmark.java index ffc7b5037a8e4..35d7d587dcf0e 100644 --- a/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jol/FileStoreHeapUtilizationJolBenchmark.java +++ b/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jol/FileStoreHeapUtilizationJolBenchmark.java @@ -25,6 +25,7 @@ import org.apache.ignite.IgniteException; import org.apache.ignite.Ignition; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -114,7 +115,7 @@ private Map testGrid() { Ignite ignite = Ignition.start(getConfiguration(name)); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); long start = System.currentTimeMillis(); @@ -133,7 +134,7 @@ private Map testGrid() { GraphLayout layout = GraphLayout.parseInstance(ignite); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); Ignition.stop(name, true); diff --git a/modules/clients/src/test/java/org/apache/ignite/common/RunningQueryInfoCheckInitiatorTest.java b/modules/clients/src/test/java/org/apache/ignite/common/RunningQueryInfoCheckInitiatorTest.java index 88dd1b7c2c176..b8c5bc56854a5 100644 --- a/modules/clients/src/test/java/org/apache/ignite/common/RunningQueryInfoCheckInitiatorTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/common/RunningQueryInfoCheckInitiatorTest.java @@ -34,6 +34,7 @@ import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.cache.query.annotations.QuerySqlFunction; import org.apache.ignite.client.IgniteClient; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.ClientConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -78,7 +79,7 @@ public class RunningQueryInfoCheckInitiatorTest extends JdbcThinAbstractSelfTest startGrid(0); startClientGrid(1); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); } /** {@inheritDoc} */ diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/ChangeStateCommandHandlerTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/ChangeStateCommandHandlerTest.java index 93670d7376ed5..2fb7e742486de 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/ChangeStateCommandHandlerTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/ChangeStateCommandHandlerTest.java @@ -96,14 +96,14 @@ public void testActivateDeActivate() throws GridClientException { IgniteEx ig1 = grid(0); IgniteEx ig2 = grid(1); - assertFalse(ig1.active()); - assertFalse(ig2.active()); + assertFalse(ig1.cluster().state().active()); + assertFalse(ig2.cluster().state().active()); assertEquals(INACTIVE, state.state()); state.state(ACTIVE, false); - assertTrue(ig1.active()); - assertTrue(ig2.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); assertEquals(ACTIVE, state.state()); } } diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java index 76f6588e81e99..5bc4060f75b67 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java @@ -2052,7 +2052,7 @@ protected void restartGrid() throws Exception { startGrids(gridCount()); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); initCache(); } @@ -3575,7 +3575,7 @@ private void assertClusterState(boolean exp) throws Exception { JsonNode res = validateJsonResponse(ret); assertEquals(ret, exp, res.asBoolean()); - assertEquals(ret, exp, grid(0).cluster().active()); + assertEquals(ret, exp, grid(0).cluster().state().active()); } /** diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationAbstractTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationAbstractTest.java index 6ecc2e158d7b9..37ae4a6bef139 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationAbstractTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAuthenticationAbstractTest.java @@ -19,6 +19,7 @@ import java.util.concurrent.Callable; import com.fasterxml.jackson.databind.JsonNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -55,7 +56,7 @@ public abstract class JettyRestProcessorAuthenticationAbstractTest extends Jetty /** {@inheritDoc} */ @Override protected void initCache() { // We need to activate cluster. - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); super.initCache(); } diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorBaselineSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorBaselineSelfTest.java index 1700f22d68b83..f938d663929ca 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorBaselineSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorBaselineSelfTest.java @@ -23,6 +23,7 @@ import java.util.Collections; import com.fasterxml.jackson.databind.JsonNode; import org.apache.ignite.cluster.BaselineNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -48,7 +49,7 @@ public class JettyRestProcessorBaselineSelfTest extends JettyRestProcessorCommon grid(0).cluster().baselineAutoAdjustEnabled(false); // We need to activate cluster. - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); } /** {@inheritDoc} */ diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinAuthenticateConnectionSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinAuthenticateConnectionSelfTest.java index 63cef5c192066..23933d9117e2a 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinAuthenticateConnectionSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinAuthenticateConnectionSelfTest.java @@ -21,6 +21,7 @@ import java.sql.DriverManager; import java.sql.SQLException; import java.util.concurrent.Callable; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -67,7 +68,7 @@ public class JdbcThinAuthenticateConnectionSelfTest extends JdbcThinAbstractSelf startGrids(2); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); try (AutoCloseable ignored = withSecurityContextOnAllNodes(authenticate(grid(0), "ignite", "ignite"))) { grid(0).context().security().createUser("another_user", "passwd".toCharArray()); diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMissingLongArrayResultsTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMissingLongArrayResultsTest.java index 8111867e96a75..be61963138295 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMissingLongArrayResultsTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMissingLongArrayResultsTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.jetbrains.annotations.NotNull; @@ -147,7 +148,7 @@ private CacheConfiguration cacheConfiguration(@NotNull String name) throws Excep } streamer.flush(); } - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); } /** diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/MvccJdbcTransactionFinishOnDeactivatedClusterSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/MvccJdbcTransactionFinishOnDeactivatedClusterSelfTest.java index c72b97cb702b0..98609a9478510 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/MvccJdbcTransactionFinishOnDeactivatedClusterSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/MvccJdbcTransactionFinishOnDeactivatedClusterSelfTest.java @@ -22,6 +22,7 @@ import java.sql.Statement; import java.util.Collections; import java.util.concurrent.CountDownLatch; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.ConnectorConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -80,7 +81,7 @@ public void testTxRollbackAfterDeactivation() throws Exception { public void checkTxFinishAfterDeactivation(boolean commit) throws Exception { IgniteEx node0 = startGrid(0); - node0.cluster().active(true); + node0.cluster().state(ClusterState.ACTIVE); try (Connection conn = connect()) { execute(conn, "CREATE TABLE t1(a INT, b VARCHAR, PRIMARY KEY(a)) WITH \"atomicity=TRANSACTIONAL_SNAPSHOT,backups=1\""); @@ -88,7 +89,7 @@ public void checkTxFinishAfterDeactivation(boolean commit) throws Exception { final CountDownLatch enlistedLatch = new CountDownLatch(1); - assert node0.cluster().active(); + assert node0.cluster().state().active(); IgniteInternalFuture txFinishedFut = GridTestUtils.runAsync(() -> { executeTransaction(commit, enlistedLatch, () -> !node0.context().state().publicApiActiveState(true)); diff --git a/modules/compress/src/test/java/org/apache/ignite/internal/processors/compress/DiskPageCompressionConfigValidationTest.java b/modules/compress/src/test/java/org/apache/ignite/internal/processors/compress/DiskPageCompressionConfigValidationTest.java index 0e4a3486e2dc2..bad12e575e223 100644 --- a/modules/compress/src/test/java/org/apache/ignite/internal/processors/compress/DiskPageCompressionConfigValidationTest.java +++ b/modules/compress/src/test/java/org/apache/ignite/internal/processors/compress/DiskPageCompressionConfigValidationTest.java @@ -18,6 +18,7 @@ import java.util.List; import org.apache.ignite.Ignite; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -87,7 +88,7 @@ public class DiskPageCompressionConfigValidationTest extends GridCommonAbstractT public void testIncorrectDynamicCacheStartRequest() throws Exception { Ignite ig = startGrid(); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); boolean expEThrown = false; diff --git a/modules/compress/src/test/java/org/apache/ignite/internal/processors/compress/DiskPageCompressionIntegrationTest.java b/modules/compress/src/test/java/org/apache/ignite/internal/processors/compress/DiskPageCompressionIntegrationTest.java index 00a2ae2cd930e..ef04ed502c326 100644 --- a/modules/compress/src/test/java/org/apache/ignite/internal/processors/compress/DiskPageCompressionIntegrationTest.java +++ b/modules/compress/src/test/java/org/apache/ignite/internal/processors/compress/DiskPageCompressionIntegrationTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteException; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -90,7 +91,7 @@ protected FileIOFactory getFileIOFactory() { @Override protected void doTestPageCompression() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); String cacheName = "test"; @@ -187,7 +188,7 @@ protected FileIOFactory getFileIOFactory() { public void _testCompressionRatio() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); String cacheName = "test"; diff --git a/modules/compress/src/test/java/org/apache/ignite/internal/processors/compress/WalPageCompressionIntegrationTest.java b/modules/compress/src/test/java/org/apache/ignite/internal/processors/compress/WalPageCompressionIntegrationTest.java index eccb0211dfdc0..33700e4e1dc69 100644 --- a/modules/compress/src/test/java/org/apache/ignite/internal/processors/compress/WalPageCompressionIntegrationTest.java +++ b/modules/compress/src/test/java/org/apache/ignite/internal/processors/compress/WalPageCompressionIntegrationTest.java @@ -63,8 +63,8 @@ public class WalPageCompressionIntegrationTest extends AbstractPageCompressionIn // Reference ignite instance with uncompressed WAL page records. IgniteEx ignite1 = startGrid(1); - ignite0.cluster().active(true); - ignite1.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); + ignite1.cluster().state(ClusterState.ACTIVE); String cacheName = "test"; diff --git a/modules/control-utility/src/test/java/org/apache/ignite/events/BaselineEventsTest.java b/modules/control-utility/src/test/java/org/apache/ignite/events/BaselineEventsTest.java index f073c4aa891e6..135ac1b564814 100644 --- a/modules/control-utility/src/test/java/org/apache/ignite/events/BaselineEventsTest.java +++ b/modules/control-utility/src/test/java/org/apache/ignite/events/BaselineEventsTest.java @@ -21,6 +21,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.ConnectorConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -77,7 +78,7 @@ public abstract class BaselineEventsTest extends GridCommonAbstractTest { /** */ @Test public void testChangeBltWithControlUtility() throws Exception { - startGrid(0).cluster().active(true); + startGrid(0).cluster().state(ClusterState.ACTIVE); AtomicBoolean baselineChanged = new AtomicBoolean(); @@ -110,7 +111,7 @@ public void testChangeBltWithControlUtility() throws Exception { /** */ @Test public void testChangeBltWithPublicApi() throws Exception { - startGrid(0).cluster().active(true); + startGrid(0).cluster().state(ClusterState.ACTIVE); AtomicBoolean baselineChanged = new AtomicBoolean(); @@ -150,13 +151,13 @@ public void testDeactivateActivate() throws Exception { EventType.EVT_BASELINE_CHANGED ); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); assertTrue(GridTestUtils.waitForCondition(baselineChanged::get, 3_000)); baselineChanged.set(false); - ignite.cluster().active(false); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.INACTIVE); + ignite.cluster().state(ClusterState.ACTIVE); assertFalse(GridTestUtils.waitForCondition(baselineChanged::get, 3_000)); } @@ -166,7 +167,7 @@ public void testDeactivateActivate() throws Exception { public void testChangeAutoAdjustEnabled() throws Exception { IgniteClusterEx cluster = startGrids(2).cluster(); - cluster.active(true); + cluster.state(ClusterState.ACTIVE); assertFalse(cluster.isBaselineAutoAdjustEnabled()); @@ -208,7 +209,7 @@ public void testChangeAutoAdjustEnabled() throws Exception { public void testChangeAutoAdjustTimeout() throws Exception { IgniteClusterEx cluster = startGrids(2).cluster(); - cluster.active(true); + cluster.state(ClusterState.ACTIVE); AtomicLong autoAdjustTimeout = new AtomicLong(); @@ -241,7 +242,7 @@ public void testEventsDisabledByDefault() throws Exception { includedEvtTypes = new int[0]; IgniteClusterEx cluster = startGrid(0).cluster(); - cluster.active(true); + cluster.state(ClusterState.ACTIVE); AtomicInteger evtsTriggered = new AtomicInteger(); diff --git a/modules/control-utility/src/test/java/org/apache/ignite/internal/commandline/indexreader/IgniteIndexReaderTest.java b/modules/control-utility/src/test/java/org/apache/ignite/internal/commandline/indexreader/IgniteIndexReaderTest.java index 4154a185d4291..4816e4f5b36da 100644 --- a/modules/control-utility/src/test/java/org/apache/ignite/internal/commandline/indexreader/IgniteIndexReaderTest.java +++ b/modules/control-utility/src/test/java/org/apache/ignite/internal/commandline/indexreader/IgniteIndexReaderTest.java @@ -42,6 +42,7 @@ import org.apache.ignite.cache.QueryIndex; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -237,8 +238,8 @@ protected void populateData(IgniteEx node, @Nullable Boolean insert) throws Exce IgniteClusterEx cluster = node.cluster(); - if (!cluster.active()) - cluster.active(true); + if (!cluster.state().active()) + cluster.state(ClusterState.ACTIVE); IgniteCache qryCache = node.cache(QUERY_CACHE_NAME); diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerBrokenIndexTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerBrokenIndexTest.java index e4a7c441bccb6..046227e80d25a 100644 --- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerBrokenIndexTest.java +++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerBrokenIndexTest.java @@ -21,6 +21,7 @@ import java.util.List; import java.util.regex.Pattern; import org.apache.ignite.Ignite; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.cache.query.index.Index; @@ -124,7 +125,7 @@ public void testIndexFindFail() throws Exception { private void prepareGridForTest() throws Exception { Ignite ignite = startGrids(2); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); Ignite client = startGrid(CLIENT_NODE_NAME_PREFIX); diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerCheckIndexesInlineSizeTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerCheckIndexesInlineSizeTest.java index 7f24847432e09..f0e6f99539237 100644 --- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerCheckIndexesInlineSizeTest.java +++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerCheckIndexesInlineSizeTest.java @@ -22,6 +22,7 @@ import java.util.UUID; import org.apache.ignite.IgniteLogger; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.testframework.junits.WithSystemProperty; @@ -74,7 +75,7 @@ public class GridCommandHandlerCheckIndexesInlineSizeTest extends GridCommandHan assertEquals(INITIAL_PAYLOAD_SIZE, Integer.parseInt(System.getProperty(IGNITE_MAX_INDEX_PAYLOAD_SIZE))); - startGrids(NODES_CNT).cluster().active(true); + startGrids(NODES_CNT).cluster().state(ClusterState.ACTIVE); for (Map.Entry entry : getSqlStatements().entrySet()) executeSql(grid(0), entry.getKey(), entry.getValue()); diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerClusterByClassAbstractTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerClusterByClassAbstractTest.java index c624038aec818..b11e9a5e04e96 100644 --- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerClusterByClassAbstractTest.java +++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerClusterByClassAbstractTest.java @@ -20,6 +20,7 @@ import java.util.HashSet; import java.util.Set; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -51,7 +52,7 @@ public abstract class GridCommandHandlerClusterByClassAbstractTest extends GridC client = startGrid(CLIENT_NODE_NAME_PREFIX); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); } /** {@inheritDoc} */ diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexForceRebuildTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexForceRebuildTest.java index aba2cba59f69e..6015ac8312d58 100644 --- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexForceRebuildTest.java +++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexForceRebuildTest.java @@ -26,6 +26,7 @@ import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgniteInternalFuture; @@ -150,7 +151,7 @@ private void startupTestCluster() throws Exception { IgniteEx ignite = grid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); createAndFillCache(ignite, CACHE_NAME_1_1, GRP_NAME_1); createAndFillCache(ignite, CACHE_NAME_1_2, GRP_NAME_1); diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexListTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexListTest.java index d5622e00affd9..9826f8146c6eb 100644 --- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexListTest.java +++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexListTest.java @@ -22,6 +22,7 @@ import java.util.function.Predicate; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteDataStreamer; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.commandline.CommandHandler; import org.apache.ignite.internal.commandline.cache.CacheCommands; @@ -54,7 +55,7 @@ public class GridCommandHandlerIndexListTest extends GridCommandHandlerAbstractT ignite = startGrids(GRIDS_NUM); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); createAndFillSeveralCaches(ignite); } diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexRebuildStatusTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexRebuildStatusTest.java index 786c11eb5da29..df287d27d52b0 100644 --- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexRebuildStatusTest.java +++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexRebuildStatusTest.java @@ -25,6 +25,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.IgniteInterruptedCheckedException; @@ -113,7 +114,7 @@ private void startupTestCluster() throws Exception { Ignite ignite = startGrids(GRIDS_NUM); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); createAndFillCache(ignite, "cache1", "group2"); createAndFillCache(ignite, "cache2", "group1"); diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexingTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexingTest.java index 147dff301b7db..773ff1b51b278 100644 --- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexingTest.java +++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexingTest.java @@ -138,7 +138,7 @@ public void testIdleVerifyCheckFailsOnNotIdleClusterWithoutOverwriteWithoutPers( public void runIdleVerifyCheckCrcFailsOnNotIdleCluster(boolean allowOverwrite) throws Exception { IgniteEx ig = startGrids(2); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); int cntPreload = 100; diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerInterruptCommandTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerInterruptCommandTest.java index 2464897b6eb98..56db6267d7bdc 100644 --- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerInterruptCommandTest.java +++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerInterruptCommandTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.QueryIndex; import org.apache.ignite.cache.QueryIndexType; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -187,7 +188,7 @@ public void testValidateIndexesCommand() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); preloadeData(ignite); @@ -223,7 +224,7 @@ public void testIdleVerifyCommand() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); preloadeData(ignite); @@ -294,7 +295,7 @@ private void preloadeData(IgniteEx ignite) { public void testCancelValidateIndexesClosure() throws Exception { IgniteEx ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); preloadeData(ignite0); diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerSslTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerSslTest.java index 442e60220980c..ea260fa075290 100644 --- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerSslTest.java +++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerSslTest.java @@ -80,7 +80,7 @@ private void activate(String nodeCipherSuite, String utilityCipherSuite, int exp Ignite ignite = startGrids(1); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); final CommandHandler cmd = new CommandHandler(); @@ -98,9 +98,9 @@ private void activate(String nodeCipherSuite, String utilityCipherSuite, int exp assertEquals(expRes, execute(params)); if (expRes == EXIT_CODE_OK) - assertTrue(ignite.cluster().active()); + assertTrue(ignite.cluster().state().active()); else - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); assertEquals(EXIT_CODE_CONNECTION_FAILED, cmd.execute(Arrays.asList("--deactivate", "--yes"))); } diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java index ba9b972cebd12..6e7ce81374efd 100644 --- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java +++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java @@ -693,7 +693,7 @@ public void testClusterChangeTag() throws Exception { //because cluster is inactive assertTrue(out.contains("Error has occurred during tag update:")); - cl.cluster().active(true); + cl.cluster().state(ClusterState.ACTIVE); //because new tag should be non-empty string assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--change-tag", "")); @@ -713,19 +713,19 @@ public void testClusterChangeTag() throws Exception { public void testDeactivate() throws Exception { Ignite ignite = startGrids(1); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); assertEquals(INACTIVE, ignite.cluster().state()); ignite.cluster().state(ACTIVE); - assertTrue(ignite.cluster().active()); + assertTrue(ignite.cluster().state().active()); assertEquals(ACTIVE, ignite.cluster().state()); injectTestSystemOut(); assertEquals(EXIT_CODE_OK, execute("--deactivate")); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); assertEquals(INACTIVE, ignite.cluster().state()); assertContains(log, testOut.toString(), "Command deprecated. Use --set-state instead."); @@ -765,7 +765,7 @@ private void checkDeactivateNonPersistent(String... cmd) throws Exception { ignite.cluster().state(ACTIVE); - assertTrue(ignite.cluster().active()); + assertTrue(ignite.cluster().state().active()); assertEquals(ACTIVE, ignite.cluster().state()); ignite.createCache(new CacheConfiguration<>("non-persistent-cache") @@ -775,7 +775,7 @@ private void checkDeactivateNonPersistent(String... cmd) throws Exception { assertEquals(EXIT_CODE_UNEXPECTED_ERROR, execute(cmd)); - assertTrue(ignite.cluster().active()); + assertTrue(ignite.cluster().state().active()); assertEquals(ACTIVE, ignite.cluster().state()); assertContains(log, testOut.toString(), GridClusterStateProcessor.DATA_LOST_ON_DEACTIVATION_WARNING); @@ -784,7 +784,7 @@ private void checkDeactivateNonPersistent(String... cmd) throws Exception { assertEquals(EXIT_CODE_OK, execute(forceCmd)); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); assertEquals(INACTIVE, ignite.cluster().state()); } @@ -799,7 +799,7 @@ private void checkDeactivateNonPersistent(String... cmd) throws Exception { @WithSystemProperty(key = IGNITE_CLUSTER_NAME, value = "TEST_CLUSTER_NAME") public void testDeactivateWithCheckClusterNameInConfirmationBySystemProperty() throws Exception { IgniteEx igniteEx = startGrid(0); - assertFalse(igniteEx.cluster().active()); + assertFalse(igniteEx.cluster().state().active()); deactivateActiveOrNotClusterWithCheckClusterNameInConfirmation(igniteEx, "TEST_CLUSTER_NAME"); } @@ -813,7 +813,7 @@ public void testDeactivateWithCheckClusterNameInConfirmationBySystemProperty() t @Test public void testDeactivateWithCheckClusterNameInConfirmationByDefault() throws Exception { IgniteEx igniteEx = startGrid(0); - assertFalse(igniteEx.cluster().active()); + assertFalse(igniteEx.cluster().state().active()); deactivateActiveOrNotClusterWithCheckClusterNameInConfirmation( igniteEx, @@ -834,8 +834,8 @@ private void deactivateActiveOrNotClusterWithCheckClusterNameInConfirmation( ) { deactivateWithCheckClusterNameInConfirmation(igniteEx, clusterName); - igniteEx.cluster().active(true); - assertTrue(igniteEx.cluster().active()); + igniteEx.cluster().state(ACTIVE); + assertTrue(igniteEx.cluster().state().active()); deactivateWithCheckClusterNameInConfirmation(igniteEx, clusterName); } @@ -853,7 +853,7 @@ private void deactivateWithCheckClusterNameInConfirmation(IgniteEx igniteEx, Str injectTestSystemIn(CONFIRM_MSG); assertEquals(EXIT_CODE_OK, execute(DEACTIVATE.text())); - assertFalse(igniteEx.cluster().active()); + assertFalse(igniteEx.cluster().state().active()); assertContains( log, @@ -873,7 +873,7 @@ public void testState() throws Exception { Ignite ignite = startGrids(1); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); injectTestSystemOut(); @@ -889,9 +889,9 @@ public void testState() throws Exception { assertTrue(out.contains("Cluster ID: " + clId)); assertTrue(out.contains("Cluster tag: " + clTag)); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); - assertTrue(ignite.cluster().active()); + assertTrue(ignite.cluster().state().active()); assertEquals(EXIT_CODE_OK, execute("--state")); @@ -1037,9 +1037,9 @@ public void testBaselineCollect() throws Exception { hostNames.setAccessible(true); hostNames.set(ignite.cluster().node(), Arrays.asList("10.19.112.175.hostname")); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); - ignite.cluster().active(true); + ignite.cluster().state(ACTIVE); injectTestSystemOut(); @@ -1087,9 +1087,9 @@ public void testBaselineCollect() throws Exception { public void testBaselineCollectCrd() throws Exception { Ignite ignite = startGrids(2); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); injectTestSystemOut(); @@ -1197,9 +1197,9 @@ public void testBaselineAdd() throws Exception { ignite.cluster().baselineAutoAdjustEnabled(false); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--baseline", "add")); @@ -1369,9 +1369,9 @@ public void testBaselineRemove() throws Exception { Ignite other = startGrid("nodeToStop"); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); String offlineNodeConsId = consistentIds(other); @@ -1392,9 +1392,9 @@ public void testBaselineRemove() throws Exception { public void testShutdownPolicy() throws Exception { Ignite ignite = startGrids(1); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ShutdownPolicy policy = ignite.cluster().shutdownPolicy(); @@ -1416,9 +1416,9 @@ public void testShutdownPolicy() throws Exception { public void testShutdownPolicyChange() throws Exception { Ignite ignite = startGrids(1); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ShutdownPolicy policyToChange = null; @@ -1450,21 +1450,21 @@ public void testBaselineRemoveOnNotActiveCluster() throws Exception { Ignite ignite = startGrids(1); Ignite other = startGrid("nodeToStop"); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); String offlineNodeConsId = consistentIds(other); assertEquals(EXIT_CODE_UNEXPECTED_ERROR, execute("--baseline", "remove", offlineNodeConsId)); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); stopGrid("nodeToStop"); assertEquals(2, ignite.cluster().currentBaselineTopology().size()); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); injectTestSystemOut(); @@ -1484,9 +1484,9 @@ public void testBaselineSet() throws Exception { ignite.cluster().baselineAutoAdjustEnabled(false); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); Ignite other = startGrid(2); @@ -1508,9 +1508,9 @@ public void testBaselineSetWithOfflineNode() throws Exception { //It is important to set consistent id to null for force autogeneration. Ignite ignite1 = startGrid(optimize(getConfiguration(getTestIgniteInstanceName(1)).setConsistentId(null))); - assertFalse(ignite0.cluster().active()); + assertFalse(ignite0.cluster().state().active()); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); Ignite other = startGrid(2); @@ -1534,9 +1534,9 @@ public void testBaselineVersion() throws Exception { ignite.cluster().baselineAutoAdjustEnabled(false); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); startGrid(2); @@ -1556,7 +1556,7 @@ public void testBaselineVersion() throws Exception { public void testBaselineAutoAdjustmentAutoRemoveNode() throws Exception { Ignite ignite = startGrids(3); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); int timeout = 2000; @@ -1619,7 +1619,7 @@ public void testBaselineAutoAdjustmentAutoRemoveNode() throws Exception { public void testBaselineAutoAdjustmentAutoAddNode() throws Exception { Ignite ignite = startGrids(1); - ignite.cluster().active(true); + ignite.cluster().state(ACTIVE); assertEquals(EXIT_CODE_OK, execute("--baseline", "auto_adjust", "enable", "timeout", "2000")); @@ -1658,7 +1658,7 @@ public void testBaselineAutoAdjustmentAutoAddNode() throws Exception { public void testActiveTransactions() throws Exception { Ignite ignite = startGridsMultiThreaded(2); - ignite.cluster().active(true); + ignite.cluster().state(ACTIVE); Ignite client = startGrid("client"); @@ -2004,7 +2004,7 @@ public void testKillHangingRemoteTransactions() throws Exception { public void testBaselineAddOnNotActiveCluster() throws Exception { Ignite ignite = startGrid(1); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); String consistentIDs = getTestIgniteInstanceName(1); @@ -2039,7 +2039,7 @@ public void testIdleVerifyCheckCrcFailsOnNotIdleCluster() throws Exception { IgniteEx node = startGrids(2); - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); IgniteCache cache = node.getOrCreateCache(new CacheConfiguration() .setAffinity(new RendezvousAffinityFunction(false, 32)) @@ -2093,7 +2093,7 @@ public void testCacheIdleVerifyDumpWhenNodeFailing() throws Exception { Ignite unstable = startGrid("unstable"); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); createCacheAndPreload(ignite, 100); @@ -2136,7 +2136,7 @@ public void testCacheIdleVerifyDumpWhenSeveralNodesFailing() throws Exception { unstableNodes.add(ignite(i)); } - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); createCacheAndPreload(ignite, 100); @@ -2221,7 +2221,7 @@ private void corruptPartition(File partitionsDir) throws IOException { private void testCacheIdleVerifyWithCorruptedPartition(String... args) throws Exception { Ignite ignite = startGrids(2); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); createCacheAndPreload(ignite, 1000); @@ -2281,7 +2281,7 @@ public void testCacheIdleVerifyDumpForCorruptedDataOnNonePersistenceClientCache( IgniteEx ignite = startGrids(3); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.createCache(new CacheConfiguration<>() .setAffinity(new RendezvousAffinityFunction(false, parts)) @@ -2336,7 +2336,7 @@ public void testCacheIdleVerifyMovingParts() throws Exception { ignite.cluster().baselineAutoAdjustEnabled(false); - ignite.cluster().active(true); + ignite.cluster().state(ACTIVE); int parts = 32; @@ -2369,7 +2369,7 @@ public void testCacheIdleVerifyMovingParts() throws Exception { public void testCacheSequence() throws Exception { Ignite ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ACTIVE); Ignite client = startGrid("client"); @@ -2435,7 +2435,7 @@ public void testDiagnosticPageLocksTracker() throws Exception { ClusterNode node2 = nodes0.get(2); ClusterNode node3 = nodes0.get(3); - ignite.cluster().active(true); + ignite.cluster().state(ACTIVE); assertEquals( EXIT_CODE_OK, @@ -2644,7 +2644,7 @@ private static class IncrementClosure implements EntryProcessor)node -> node.attribute("some-attr") != null)); @@ -2734,7 +2734,7 @@ public void setConsistenceIdsWithOfflineBaselineNode() throws Exception { public void testCacheIdleVerifyPrintLostPartitions() throws Exception { IgniteEx ignite = startGrids(3); - ignite.cluster().active(true); + ignite.cluster().state(ACTIVE); ignite.createCache(new CacheConfiguration<>(DEFAULT_CACHE_NAME) .setAffinity(new RendezvousAffinityFunction(false, 16)) diff --git a/modules/core/src/main/java/org/apache/ignite/Ignite.java b/modules/core/src/main/java/org/apache/ignite/Ignite.java index 14567aaefe177..c75a20bdecfc0 100644 --- a/modules/core/src/main/java/org/apache/ignite/Ignite.java +++ b/modules/core/src/main/java/org/apache/ignite/Ignite.java @@ -24,6 +24,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.affinity.Affinity; import org.apache.ignite.cluster.ClusterGroup; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.AtomicConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.CollectionConfiguration; @@ -687,7 +688,7 @@ public IgniteQueue queue(String name, int cap, @Nullable CollectionConfig * Checks Ignite grid is active or not active. * * @return {@code True} if grid is active. {@code False} If grid is not active. - * @deprecated Use {@link IgniteCluster#active()} instead. + * @deprecated Use {@link IgniteCluster#state()} instead. */ @Deprecated public boolean active(); @@ -700,7 +701,7 @@ public IgniteQueue queue(String name, int cap, @Nullable CollectionConfig * * @param active If {@code True} start activation process. If {@code False} start deactivation process. * @throws IgniteException If there is an already started transaction or lock in the same thread. - * @deprecated Use {@link IgniteCluster#active(boolean)} instead. + * @deprecated Use {@link IgniteCluster#state(ClusterState)} instead. */ @Deprecated public void active(boolean active); diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/WALMode.java b/modules/core/src/main/java/org/apache/ignite/configuration/WALMode.java index 10471cff7845f..f1e2b68d487ac 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/WALMode.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/WALMode.java @@ -17,7 +17,8 @@ package org.apache.ignite.configuration; -import org.apache.ignite.Ignite; +import org.apache.ignite.IgniteCluster; +import org.apache.ignite.cluster.ClusterState; import org.jetbrains.annotations.Nullable; /** @@ -45,7 +46,7 @@ public enum WALMode { /** * WAL is disabled. Data is guaranteed to be persisted on disk only in case of graceful cluster shutdown using - * {@link Ignite#active(boolean)} method. If an Ignite node is terminated in NONE mode abruptly, it is likely + * {@link IgniteCluster#state(ClusterState)} method. If an Ignite node is terminated in NONE mode abruptly, it is likely * that the data stored on disk is corrupted and work directory will need to be cleared for a node restart. */ NONE, diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java index 58b01a21c31da..0da2c0d14e752 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java @@ -2777,7 +2777,7 @@ public IgniteInternalFuture getOrCreateCacheAsync(String cacheName, String te /** {@inheritDoc} */ @Override public void active(boolean active) { - cluster().active(active); + cluster().state(active ? ClusterState.ACTIVE : ClusterState.INACTIVE); } /** */ @@ -3109,7 +3109,7 @@ private void checkClusterState() throws IgniteException { if (!ctx.state().publicApiActiveState(true)) { throw new IgniteException("Can not perform the operation because the cluster is inactive. Note, that " + "the cluster is considered inactive by default if Ignite Persistent Store is used to let all the nodes " + - "join the cluster. To activate the cluster call Ignite.active(true)."); + "join the cluster. To activate the cluster call Ignite.cluster().state(ClusterState.ACTIVE)."); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteMXBeanImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteMXBeanImpl.java index 924fe230269fb..286f05f42169f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteMXBeanImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteMXBeanImpl.java @@ -53,7 +53,7 @@ public IgniteMXBeanImpl(IgniteKernal kernal) { /** {@inheritDoc} */ @Override public boolean active() { - return kernal.active(); + return kernal.cluster().state().active(); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java index 626acf1eb0506..cb47fe8ce42a4 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java @@ -2170,7 +2170,7 @@ private synchronized void stop0(boolean cancel, ShutdownPolicy shutdown) { } } - if (shutdown == ShutdownPolicy.GRACEFUL && !grid.context().clientNode() && grid.cluster().active()) { + if (shutdown == ShutdownPolicy.GRACEFUL && !grid.context().clientNode() && grid.cluster().state().active()) { delayedShutdown = true; if (log.isInfoEnabled()) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java index 71a8f6f8dfa6c..9611a80a8e7cd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java @@ -731,7 +731,8 @@ public void setId(UUID id) { if (!ctx.state().publicApiActiveState(true)) { throw new IgniteCheckedException( - "Can not change cluster tag on inactive cluster. To activate the cluster call Ignite.active(true)." + "Can not change cluster tag on inactive cluster. To activate the cluster call " + + "Ignite.cluster().state(ClusterState.ACTIVE)." ); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java index 01ab17de23f86..2a733d942b832 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java @@ -815,7 +815,7 @@ else if (customMsg instanceof ChangeGlobalStateMessage) { locJoin.onDone(new DiscoveryLocalJoinData(discoEvt, discoCache, transitionWaitFut, - ctx.state().clusterState().active())); + ctx.state().clusterState().state().active())); return; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GridEncryptionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GridEncryptionManager.java index 7ad3aa936f955..8e1f5be7b7ea1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GridEncryptionManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GridEncryptionManager.java @@ -677,7 +677,7 @@ void addGroupKey(int grpId, GroupKeyEncrypted key) { // WAL is unavailable for write on the inactive cluster. Master key change will not be logged and group keys // can be partially re-encrypted in case of node stop without the possibility of recovery. - if (!ctx.state().clusterState().active()) { + if (!ctx.state().clusterState().state().active()) { return new IgniteFinishedFutureImpl<>(new IgniteException("Master key change was rejected. " + "The cluster is inactive.")); } @@ -1589,7 +1589,7 @@ private IgniteInternalFuture performMasterKeyChange(MasterKeyChange if (masterKeyChangeRequest == null || !masterKeyChangeRequest.equals(req)) return new GridFinishedFuture<>(new IgniteException("Unknown master key change was rejected.")); - if (!ctx.state().clusterState().active()) { + if (!ctx.state().clusterState().state().active()) { masterKeyChangeRequest = null; return new GridFinishedFuture<>(new IgniteException("Master key change was rejected. " + diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/authentication/IgniteAuthenticationProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/authentication/IgniteAuthenticationProcessor.java index 735ee8386191a..d0df0f525263d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/authentication/IgniteAuthenticationProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/authentication/IgniteAuthenticationProcessor.java @@ -444,7 +444,7 @@ private void checkActivate() { if (!ctx.state().publicApiActiveState(true)) { throw new IgniteException("Can not perform the operation because the cluster is inactive. Note, that " + "the cluster is considered inactive by default if Ignite Persistent Store is used to let all the nodes " + - "join the cluster. To activate the cluster call Ignite.active(true)."); + "join the cluster. To activate the cluster call Ignite.cluster().state(ClusterState.ACTIVE)."); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java index fda6598653d4e..2dd1885b41a0d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java @@ -178,7 +178,7 @@ void onDiscoveryEvent(int type, if (type == EVT_NODE_JOINED && node.isLocal()) lastAffVer = null; - if ((state.transition() || !state.active()) && + if ((state.transition() || !state.state().active()) && !DiscoveryCustomEvent.requiresCentralizedAffinityAssignment(customMsg)) return; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java index 9442873978de8..7a8eb93d11840 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java @@ -614,7 +614,7 @@ public void onCacheChangeRequested(DynamicCacheChangeFailureMessage failMsg, Aff public boolean onCacheChangeRequested(DynamicCacheChangeBatch batch, AffinityTopologyVersion topVer) { DiscoveryDataClusterState state = ctx.state().clusterState(); - if (state.active() && !state.transition()) { + if (state.state().active() && !state.transition()) { Set restartIds = new HashSet<>(F.viewReadOnly( batch.requests(), DynamicCacheChangeRequest::restartId, req -> req.start() && req.restartId() != null)); @@ -2058,7 +2058,7 @@ else if (joiningNodeClient && cfg.isEncryptionEnabled()) { private void processClientReconnectData(CacheClientReconnectDiscoveryData clientData, UUID clientNodeId) { DiscoveryDataClusterState state = ctx.state().clusterState(); - if (state.active() && !state.transition()) { + if (state.state().active() && !state.transition()) { for (CacheClientReconnectDiscoveryData.CacheInfo cacheInfo : clientData.clientCaches().values()) { String cacheName = cacheInfo.config().getName(); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java index e2b8e5b22380f..68258e550ab5e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterGroup.java @@ -27,6 +27,7 @@ import org.apache.ignite.binary.BinaryRawWriter; import org.apache.ignite.cluster.ClusterMetrics; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.binary.BinaryRawReaderEx; import org.apache.ignite.internal.binary.BinaryRawWriterEx; import org.apache.ignite.internal.cluster.ClusterGroupEx; @@ -459,13 +460,13 @@ public PlatformClusterGroup(PlatformContext platformCtx, ClusterGroupEx prj) { } case OP_SET_ACTIVE: { - prj.ignite().active(val == TRUE); + prj.ignite().cluster().state(val == TRUE ? ClusterState.ACTIVE : ClusterState.INACTIVE); return TRUE; } case OP_IS_ACTIVE: { - return prj.ignite().active() ? TRUE : FALSE; + return prj.ignite().cluster().state().active() ? TRUE : FALSE; } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java index 82ecf77b9d209..3e46c80290bdd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java @@ -1104,7 +1104,7 @@ private static class MetadataJob extends ComputeJobAdapter { @Override public Collection execute() { try { if (future == null) { - if (!ignite.cluster().active()) + if (!ignite.cluster().state().active()) return Collections.emptyList(); IgniteInternalCache cache = null; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridBaselineCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridBaselineCommandHandler.java index ad9e6cba621c1..edd13f1a995b9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridBaselineCommandHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridBaselineCommandHandler.java @@ -164,7 +164,7 @@ private GridBaselineCommandResponse currentState() { Collection srvrs = cluster.forServers().nodes(); - return new GridBaselineCommandResponse(cluster.active(), cluster.topologyVersion(), currentBaseLine(), srvrs); + return new GridBaselineCommandResponse(cluster.state().active(), cluster.topologyVersion(), currentBaseLine(), srvrs); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java index d06ebff26902a..d013189acb34f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java @@ -85,7 +85,7 @@ private VisorBaselineTaskResult collect() { BaselineAutoAdjustStatus adjustStatus = cluster.baselineAutoAdjustStatus(); return new VisorBaselineTaskResult( - ignite.cluster().active(), + ignite.cluster().state().active(), cluster.topologyVersion(), F.isEmpty(baseline) ? null : baseline, srvrs, diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineViewTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineViewTask.java index 47e567ca3f025..8ae1483a5fe7c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineViewTask.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineViewTask.java @@ -66,7 +66,7 @@ private VisorBaselineViewJob(Void arg, boolean debug) { BaselineAutoAdjustStatus adjustStatus = cluster.baselineAutoAdjustStatus(); return new VisorBaselineTaskResult( - ignite.cluster().active(), + ignite.cluster().state().active(), cluster.topologyVersion(), cluster.currentBaselineTopology(), cluster.forServers().nodes(), diff --git a/modules/core/src/test/java/org/apache/ignite/cache/CircledRebalanceTest.java b/modules/core/src/test/java/org/apache/ignite/cache/CircledRebalanceTest.java index ad0da5a35d0f2..587ac90acdc50 100644 --- a/modules/core/src/test/java/org/apache/ignite/cache/CircledRebalanceTest.java +++ b/modules/core/src/test/java/org/apache/ignite/cache/CircledRebalanceTest.java @@ -25,6 +25,7 @@ import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.ShutdownPolicy; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -122,7 +123,7 @@ public void testCircledNodesRestart(int backups, int nodes) throws Exception { IgniteEx ignite0 = startGrids(nodes); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); loadData(true); diff --git a/modules/core/src/test/java/org/apache/ignite/cache/ClientCreateCacheGroupOnJoinNodeMapsTest.java b/modules/core/src/test/java/org/apache/ignite/cache/ClientCreateCacheGroupOnJoinNodeMapsTest.java index 389fd93ae72ec..8b9c2473b8efd 100644 --- a/modules/core/src/test/java/org/apache/ignite/cache/ClientCreateCacheGroupOnJoinNodeMapsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/cache/ClientCreateCacheGroupOnJoinNodeMapsTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.cache; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap; @@ -69,7 +70,7 @@ public class ClientCreateCacheGroupOnJoinNodeMapsTest extends GridCommonAbstract public void testNodeMapsVolatile() throws Exception { final IgniteEx srv = startGrids(2); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -84,6 +85,6 @@ public void testNodeMapsVolatile() throws Exception { assertEquals(2, map0.size()); assertEquals(2, map1.size()); - srv.cluster().active(false); + srv.cluster().state(ClusterState.INACTIVE); } } diff --git a/modules/core/src/test/java/org/apache/ignite/cache/NotOptimizedRebalanceTest.java b/modules/core/src/test/java/org/apache/ignite/cache/NotOptimizedRebalanceTest.java index 5bc63d5d808d5..73f688122fbab 100644 --- a/modules/core/src/test/java/org/apache/ignite/cache/NotOptimizedRebalanceTest.java +++ b/modules/core/src/test/java/org/apache/ignite/cache/NotOptimizedRebalanceTest.java @@ -22,6 +22,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -134,7 +135,7 @@ public void testRebalance(boolean persistence, boolean serverJoin) throws Except IgniteEx ignite0 = startGrids(NODES_CNT); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); ignite0.cluster().baselineAutoAdjustEnabled(false); diff --git a/modules/core/src/test/java/org/apache/ignite/cache/RebalanceAfterResettingLostPartitionTest.java b/modules/core/src/test/java/org/apache/ignite/cache/RebalanceAfterResettingLostPartitionTest.java index 2e8589052156c..e4f223743e6ea 100644 --- a/modules/core/src/test/java/org/apache/ignite/cache/RebalanceAfterResettingLostPartitionTest.java +++ b/modules/core/src/test/java/org/apache/ignite/cache/RebalanceAfterResettingLostPartitionTest.java @@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -104,7 +105,7 @@ public void after() throws Exception { public void testRebalanceAfterPartitionsWereLost() throws Exception { startGrids(2); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); for (int j = 0; j < CACHE_SIZE; j++) grid(0).cache(CACHE_NAME).put(j, "Value" + j); diff --git a/modules/core/src/test/java/org/apache/ignite/cache/RebalanceCancellationTest.java b/modules/core/src/test/java/org/apache/ignite/cache/RebalanceCancellationTest.java index 6bfb82c80fb09..f5aba5e45057b 100644 --- a/modules/core/src/test/java/org/apache/ignite/cache/RebalanceCancellationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/cache/RebalanceCancellationTest.java @@ -386,7 +386,7 @@ public void testRebalanceNoneBltNode(boolean persistence, boolean additionalRegi IgniteEx ignite0 = startGrids(NODES_CNT); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); ignite0.cluster().baselineAutoAdjustEnabled(false); @@ -455,7 +455,7 @@ public void testRebalanceFilteredNode(boolean persistence, boolean addtiotionalR IgniteEx ignite0 = startGrids(NODES_CNT); IgniteEx filteredNode = startGrid(getTestIgniteInstanceName(NODES_CNT) + FILTERED_NODE_SUFFIX); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); grid(1).close(); diff --git a/modules/core/src/test/java/org/apache/ignite/cache/RebalanceCompleteDuringExchangeTest.java b/modules/core/src/test/java/org/apache/ignite/cache/RebalanceCompleteDuringExchangeTest.java index 242a8e795f998..bcc631c29fe42 100644 --- a/modules/core/src/test/java/org/apache/ignite/cache/RebalanceCompleteDuringExchangeTest.java +++ b/modules/core/src/test/java/org/apache/ignite/cache/RebalanceCompleteDuringExchangeTest.java @@ -19,6 +19,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -55,7 +56,7 @@ public class RebalanceCompleteDuringExchangeTest extends GridCommonAbstractTest public void testRebalance() throws Exception { IgniteEx ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite0.cache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/cache/ResetLostPartitionTest.java b/modules/core/src/test/java/org/apache/ignite/cache/ResetLostPartitionTest.java index 37accba300eca..d403a5b6e06be 100644 --- a/modules/core/src/test/java/org/apache/ignite/cache/ResetLostPartitionTest.java +++ b/modules/core/src/test/java/org/apache/ignite/cache/ResetLostPartitionTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -146,7 +147,7 @@ public void testResetLostPartitions() throws Exception { private void doRebalanceAfterPartitionsWereLost(boolean reactivateGridBeforeResetPart) throws Exception { startGrids(3); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); for (String cacheName : CACHE_NAMES) { try (IgniteDataStreamer st = grid(0).dataStreamer(cacheName)) { @@ -215,8 +216,8 @@ private void doRebalanceAfterPartitionsWereLost(boolean reactivateGridBeforeRese } if (reactivateGridBeforeResetPart) { - grid(0).cluster().active(false); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.INACTIVE); + grid(0).cluster().state(ClusterState.ACTIVE); } // Try to reset lost partitions. diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/StoreArrayKeyTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/StoreArrayKeyTest.java index 52d3427a8e0e1..e1f204fc00543 100644 --- a/modules/core/src/test/java/org/apache/ignite/cache/store/StoreArrayKeyTest.java +++ b/modules/core/src/test/java/org/apache/ignite/cache/store/StoreArrayKeyTest.java @@ -24,6 +24,7 @@ import javax.cache.Cache; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheWriteSynchronizationMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -126,7 +127,7 @@ public void setUp() throws Exception { node1 = startGrid(0); node2 = startGrid(1); - node1.cluster().active(true); + node1.cluster().state(ClusterState.ACTIVE); } /** diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoWriteBehindStoreWithCoalescingTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoWriteBehindStoreWithCoalescingTest.java index 73de14b453eaa..b47bd80cc409f 100644 --- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoWriteBehindStoreWithCoalescingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoWriteBehindStoreWithCoalescingTest.java @@ -39,6 +39,7 @@ import org.apache.ignite.cache.store.jdbc.model.TestJdbcPojoDataSourceFactory; import org.apache.ignite.cache.store.jdbc.model.TestJdbcPojoStoreFactoryWithHangWriteAll; import org.apache.ignite.cache.store.jdbc.model.TestPojo; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -447,7 +448,7 @@ public void testUpdateAndReadTheSameKeyWithCoalescingHangWriteAll() throws Excep public void updateAndReadWithCoalescingSameKey() throws Exception { Ignite ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = grid(0).cache("TEST_CACHE"); @@ -524,7 +525,7 @@ public void updateAndReadWithCoalescingSameKey() throws Exception { public void readWithCoalescing() throws Exception { Ignite ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = grid(0).cache("TEST_CACHE"); @@ -601,7 +602,7 @@ public void readWithCoalescing() throws Exception { public void writeAllWithCoalescing() throws Exception { Ignite ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = grid(0).cache("TEST_CACHE"); diff --git a/modules/core/src/test/java/org/apache/ignite/events/ClusterActivationStartedEventTest.java b/modules/core/src/test/java/org/apache/ignite/events/ClusterActivationStartedEventTest.java index 7f9a862de0b17..574864ff2a5c2 100644 --- a/modules/core/src/test/java/org/apache/ignite/events/ClusterActivationStartedEventTest.java +++ b/modules/core/src/test/java/org/apache/ignite/events/ClusterActivationStartedEventTest.java @@ -84,8 +84,8 @@ public void testEventsDisabledByDefault() throws Exception { EventType.EVT_CLUSTER_STATE_CHANGE_STARTED ); - ignite.cluster().active(false); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.INACTIVE); + ignite.cluster().state(ClusterState.ACTIVE); assertEquals(0, evtsTriggered.get()); } @@ -100,7 +100,7 @@ public void testActivationDeactivationStartedLocalEvents() throws Exception { AtomicBoolean deactivationFinished = new AtomicBoolean(); IgniteEx ignite = startGrid(0); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); ignite.events().localListen( event -> { @@ -149,7 +149,7 @@ else if (clusterState == ClusterState.INACTIVE) { EventType.EVT_CLUSTER_DEACTIVATED ); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); assertTrue(activationStarted.get()); assertTrue(GridTestUtils.waitForCondition(activationFinished::get, 5_000)); @@ -158,10 +158,10 @@ else if (clusterState == ClusterState.INACTIVE) { activationStarted.set(false); activationFinished.set(false); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); assertFalse(activationStarted.get()); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); assertTrue(deactivationStarted.get()); assertTrue(GridTestUtils.waitForCondition(deactivationFinished::get, 5_000)); @@ -170,7 +170,7 @@ else if (clusterState == ClusterState.INACTIVE) { deactivationStarted.set(false); deactivationFinished.set(false); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); assertFalse(deactivationStarted.get()); } @@ -184,7 +184,7 @@ public void testActivationDeactivationStartedRemoteEvents() throws Exception { AtomicBoolean deactivationFinished = new AtomicBoolean(); IgniteEx ignite = startGrid(0); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); startGrid(1); @@ -223,7 +223,7 @@ public void testActivationDeactivationStartedRemoteEvents() throws Exception { EventType.EVT_CLUSTER_DEACTIVATED ); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); assertTrue(GridTestUtils.waitForCondition(activationStarted::get, 5_000)); assertTrue(GridTestUtils.waitForCondition(activationFinished::get, 5_000)); @@ -232,7 +232,7 @@ public void testActivationDeactivationStartedRemoteEvents() throws Exception { activationStarted.set(false); activationFinished.set(false); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); assertTrue(GridTestUtils.waitForCondition(deactivationStarted::get, 5_000)); assertTrue(GridTestUtils.waitForCondition(deactivationFinished::get, 5_000)); diff --git a/modules/core/src/test/java/org/apache/ignite/failure/FailureHandlingConfigurationTest.java b/modules/core/src/test/java/org/apache/ignite/failure/FailureHandlingConfigurationTest.java index e7e4dfe247a4d..151804ed4c587 100644 --- a/modules/core/src/test/java/org/apache/ignite/failure/FailureHandlingConfigurationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/failure/FailureHandlingConfigurationTest.java @@ -19,6 +19,7 @@ import java.util.concurrent.CountDownLatch; import org.apache.ignite.Ignite; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -110,7 +111,7 @@ public void testCfgParamsPropagation() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); WorkersRegistry reg = ignite.context().workersRegistry(); @@ -135,7 +136,7 @@ public void testPartialCfgParamsPropagation() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); WorkersRegistry reg = ignite.context().workersRegistry(); @@ -160,7 +161,7 @@ public void testNegativeParamValues() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); WorkersRegistry reg = ignite.context().workersRegistry(); @@ -187,7 +188,7 @@ public void testOverridingBySysProps() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); WorkersRegistry reg = ignite.context().workersRegistry(); @@ -216,7 +217,7 @@ public void testOverridingBySysProps() throws Exception { public void testMBeanParamsChanging() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); FailureHandlingMxBean mBean = getMBean(); diff --git a/modules/core/src/test/java/org/apache/ignite/failure/IoomFailureHandlerTest.java b/modules/core/src/test/java/org/apache/ignite/failure/IoomFailureHandlerTest.java index 09e1e65013087..1049ab5b15daf 100644 --- a/modules/core/src/test/java/org/apache/ignite/failure/IoomFailureHandlerTest.java +++ b/modules/core/src/test/java/org/apache/ignite/failure/IoomFailureHandlerTest.java @@ -20,6 +20,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -143,7 +144,7 @@ private void testIoomErrorHandling(boolean pds, boolean mvcc) throws Exception { try { if (pds) - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = ignite0.getOrCreateCache(DEFAULT_CACHE_NAME); IgniteCache cache1 = ignite1.getOrCreateCache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/ClusterBaselineNodesMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/ClusterBaselineNodesMetricsSelfTest.java index 37fa4fcafadfd..6cfa36ab68cb4 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/ClusterBaselineNodesMetricsSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/ClusterBaselineNodesMetricsSelfTest.java @@ -19,6 +19,7 @@ import java.util.Collection; import org.apache.ignite.cluster.BaselineNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -62,7 +63,7 @@ public void testBaselineNodes() throws Exception { MetricRegistry mreg = ignite0.context().metric().registry(CLUSTER_METRICS); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); // Added 2 server nodes to baseline. resetBlt(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/DiagnosticLogForPartitionStatesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/DiagnosticLogForPartitionStatesTest.java index f62a763c6151a..d2085db704d7d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/DiagnosticLogForPartitionStatesTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/DiagnosticLogForPartitionStatesTest.java @@ -30,6 +30,7 @@ import javax.cache.expiry.Duration; import javax.cache.expiry.EternalExpiryPolicy; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -165,7 +166,7 @@ private void doTest(List> cfgs, boolean msg IgniteEx node2 = startGrid(1); - node1.cluster().active(true); + node1.cluster().state(ClusterState.ACTIVE); List> caches = cfgs.stream() .map(cfg -> node1.getOrCreateCache(cfg)).collect(Collectors.toList()); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridNodeMetricsLogPdsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridNodeMetricsLogPdsSelfTest.java index 0910b101d3847..5797c6ec8e12e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/GridNodeMetricsLogPdsSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/GridNodeMetricsLogPdsSelfTest.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -51,7 +52,7 @@ public class GridNodeMetricsLogPdsSelfTest extends GridNodeMetricsLogSelfTest { super.beforeTest(); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); } /** {@inheritDoc} */ diff --git a/modules/core/src/test/java/org/apache/ignite/internal/ThreadNameValidationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/ThreadNameValidationTest.java index cac45bdb5f6f9..bb9a23bc44703 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/ThreadNameValidationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/ThreadNameValidationTest.java @@ -28,6 +28,7 @@ import java.util.stream.Collectors; import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteSystemProperties; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -156,7 +157,7 @@ public void testThreadsWithDefaultNames() throws Exception { validateThreadNames(); IgniteEx ignite = startGrids(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.createCache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/cluster/IgniteClusterIdTagTest.java b/modules/core/src/test/java/org/apache/ignite/internal/cluster/IgniteClusterIdTagTest.java index b0934e7e7970a..11ebde86312e3 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/cluster/IgniteClusterIdTagTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/cluster/IgniteClusterIdTagTest.java @@ -23,6 +23,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteCluster; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -173,7 +174,7 @@ public void testPersistentClusterId() throws Exception { IgniteEx ig0 = startGrid(0); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); UUID id0 = ig0.cluster().id(); @@ -310,7 +311,7 @@ public void testPersistentClusterTag() throws Exception { String tag1 = ig1.cluster().tag(); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); stopAllGrids(); @@ -320,7 +321,7 @@ public void testPersistentClusterTag() throws Exception { assertEquals(tag1, ig0.cluster().tag()); - ig1.cluster().active(true); + ig1.cluster().state(ClusterState.ACTIVE); IgniteEx cl0 = startGrid("client0"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/encryption/AbstractEncryptionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/encryption/AbstractEncryptionTest.java index 54740a106c083..6d2ec57195f0c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/encryption/AbstractEncryptionTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/encryption/AbstractEncryptionTest.java @@ -36,6 +36,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteDataStreamer; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -257,7 +258,7 @@ protected T2 startTestGrids(boolean clnPersDir) throws Excep IgniteEx grid1 = startGrid(GRID_1); - grid0.cluster().active(true); + grid0.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptedCacheCreateTest.java b/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptedCacheCreateTest.java index a7d3a303b0092..4951a831d1dd2 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptedCacheCreateTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptedCacheCreateTest.java @@ -23,6 +23,7 @@ import com.google.common.primitives.Bytes; import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -56,7 +57,7 @@ public class EncryptedCacheCreateTest extends AbstractEncryptionTest { startGrid(1); - igniteEx.cluster().active(true); + igniteEx.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptedCacheGroupCreateTest.java b/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptedCacheGroupCreateTest.java index 8b8d7ce2d5177..94d32f85da160 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptedCacheGroupCreateTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptedCacheGroupCreateTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal.encryption; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.managers.encryption.GridEncryptionManager; @@ -49,7 +50,7 @@ public class EncryptedCacheGroupCreateTest extends AbstractEncryptionTest { startGrid(1); - igniteEx.cluster().active(true); + igniteEx.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptedCacheNodeJoinTest.java b/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptedCacheNodeJoinTest.java index 072afffa7b907..552af12c7910a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptedCacheNodeJoinTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptedCacheNodeJoinTest.java @@ -155,7 +155,7 @@ public void testNodeCantJoinWithDifferentKeyStore() throws Exception { public void testNodeCanJoin() throws Exception { startGrid(GRID_0); - startGrid(GRID_3).cluster().active(true); + startGrid(GRID_3).cluster().state(ClusterState.ACTIVE); } /** */ @@ -164,7 +164,7 @@ public void testNodeCantJoinWithDifferentCacheKeys() throws Exception { IgniteEx grid0 = startGrid(GRID_0); startGrid(GRID_3); - grid0.cluster().active(true); + grid0.cluster().state(ClusterState.ACTIVE); stopGrid(GRID_3, false); @@ -173,7 +173,7 @@ public void testNodeCantJoinWithDifferentCacheKeys() throws Exception { stopGrid(GRID_0, false); IgniteEx grid3 = startGrid(GRID_3); - grid3.cluster().active(true); + grid3.cluster().state(ClusterState.ACTIVE); createEncryptedCache(grid3, null, cacheName(), null, false); @@ -194,7 +194,7 @@ public void testThirdNodeCanJoin() throws Exception { IgniteEx grid3 = startGrid(GRID_3); - grid3.cluster().active(true); + grid3.cluster().state(ClusterState.ACTIVE); createEncryptedCache(grid0, grid3, cacheName(), null); @@ -214,7 +214,7 @@ public void testClientNodeJoin() throws Exception { IgniteEx grid3 = startGrid(GRID_3); - grid3.cluster().active(true); + grid3.cluster().state(ClusterState.ACTIVE); IgniteEx client = startClientGrid(CLIENT); @@ -325,7 +325,7 @@ public void testNodeCantJoinWithSameNameButNotEncCache() throws Exception { IgniteEx grid0 = startGrid(GRID_0); - grid0.cluster().active(true); + grid0.cluster().state(ClusterState.ACTIVE); assertThrowsWithCause(() -> { try { @@ -344,7 +344,7 @@ public void testNodeCantJoinWithSameNameButEncCache() throws Exception { IgniteEx grid0 = startGrid(GRID_5); - grid0.cluster().active(true); + grid0.cluster().state(ClusterState.ACTIVE); assertThrowsWithCause(() -> { try { diff --git a/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptionMXBeanTest.java b/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptionMXBeanTest.java index 4e8ffa0efe1a5..d092e9f90dbe1 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptionMXBeanTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/encryption/EncryptionMXBeanTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal.encryption; import org.apache.ignite.IgniteException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.managers.encryption.EncryptionMXBeanImpl; import org.apache.ignite.internal.util.typedef.internal.CU; @@ -37,7 +38,7 @@ public class EncryptionMXBeanTest extends AbstractEncryptionTest { public void testMasterKeyChange() throws Exception { IgniteEx ignite = startGrid(GRID_0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); EncryptionMXBean mBean = getMBean(GRID_0); @@ -57,7 +58,7 @@ public void testMasterKeyChangeFromClient() throws Exception { IgniteEx client = startClientGrid(getConfiguration("client")); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); EncryptionMXBean mBean = getMBean(client.name()); @@ -75,7 +76,7 @@ public void testMasterKeyChangeFromClient() throws Exception { public void testMasterKeyChangeTheSameKeyName() throws Exception { IgniteEx ignite = startGrid(GRID_0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); EncryptionMXBean mBean = getMBean(GRID_0); @@ -95,7 +96,7 @@ public void testMasterKeyChangeTheSameKeyName() throws Exception { public void testMasterKeyChangeOnInactiveAndReadonlyCluster() throws Exception { IgniteEx grid0 = startGrid(GRID_0); - assertFalse(grid0.cluster().active()); + assertFalse(grid0.cluster().state().active()); EncryptionMXBean mBean = getMBean(GRID_0); @@ -117,7 +118,7 @@ public void testMasterKeyChangeOnInactiveAndReadonlyCluster() throws Exception { public void testCacheGroupKeyChange() throws Exception { IgniteEx ignite = startGrid(GRID_0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); createEncryptedCache(ignite, null, cacheName(), null); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/encryption/MasterKeyChangeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/encryption/MasterKeyChangeTest.java index 91dcd052b05d7..5df474911e095 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/encryption/MasterKeyChangeTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/encryption/MasterKeyChangeTest.java @@ -25,6 +25,7 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -172,7 +173,7 @@ public void testRejectCacheStartOnClientDuringRotation() throws Exception { IgniteEx client = startClientGrid(getConfiguration("client")); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -272,7 +273,7 @@ public void testRecoveryFromWalWithCacheOperations() throws Exception { IgniteEx grid0 = grids.get1(); - grid0.cluster().active(true); + grid0.cluster().state(ClusterState.ACTIVE); CacheConfiguration ccfg = new CacheConfiguration(cacheName()) .setWriteSynchronizationMode(FULL_SYNC) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerFileTransmissionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerFileTransmissionSelfTest.java index abb5fb749f901..1e2f28d52217c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerFileTransmissionSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerFileTransmissionSelfTest.java @@ -44,6 +44,7 @@ import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.IgniteException; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -176,7 +177,7 @@ public void testFileHandlerBase() throws Exception { snd = startGrid(0); rcv = startGrid(1); - snd.cluster().active(true); + snd.cluster().state(ClusterState.ACTIVE); addCacheData(snd, DEFAULT_CACHE_NAME); @@ -793,7 +794,7 @@ public void testChunkHandlerCancelTransmission() throws Exception { snd = startGrid(0); rcv = startGrid(1); - snd.cluster().active(true); + snd.cluster().state(ClusterState.ACTIVE); File fileToSend = createFileRandomData("testFile", 1024 * 1024); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/metric/IoStatisticsCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/metric/IoStatisticsCacheSelfTest.java index cee1e0238bf2e..9bf48f2cbfeb1 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/metric/IoStatisticsCacheSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/metric/IoStatisticsCacheSelfTest.java @@ -25,6 +25,7 @@ import com.google.common.collect.Sets; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -140,7 +141,7 @@ protected boolean persist() { ignite = (IgniteEx)startGrid(); if (persist()) - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); } /** {@inheritDoc} */ diff --git a/modules/core/src/test/java/org/apache/ignite/internal/metric/JmxExporterSpiTest.java b/modules/core/src/test/java/org/apache/ignite/internal/metric/JmxExporterSpiTest.java index 999b3651074fb..4d447b16870d2 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/metric/JmxExporterSpiTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/metric/JmxExporterSpiTest.java @@ -158,7 +158,7 @@ public class JmxExporterSpiTest extends AbstractExporterSpiTest { ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); } /** {@inheritDoc} */ diff --git a/modules/core/src/test/java/org/apache/ignite/internal/metric/MetricsConfigurationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/metric/MetricsConfigurationTest.java index 353a5e7549957..622bea647c3a8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/metric/MetricsConfigurationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/metric/MetricsConfigurationTest.java @@ -356,7 +356,7 @@ public void checkOnStartAndRestart(IgniteBiInClosureX afterS IgniteEx g1 = startGrid("persistent-1"); try { - g0.cluster().active(true); + g0.cluster().state(ClusterState.ACTIVE); afterStart.apply(g0, g1); @@ -366,7 +366,7 @@ public void checkOnStartAndRestart(IgniteBiInClosureX afterS g0 = startGrid("persistent-0"); g1 = startGrid("persistent-1"); - g0.cluster().active(true); + g0.cluster().state(ClusterState.ACTIVE); afterRestart.apply(g0, g1); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java index dcf236716ff28..b68fa39369c9a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java @@ -1813,7 +1813,7 @@ public void testPagesList() throws Exception { new DataRegionConfiguration().setName("dr1").setMaxSize(100L * 1024 * 1024) .setPersistenceEnabled(true) )))) { - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); GridCacheDatabaseSharedManager dbMgr = (GridCacheDatabaseSharedManager)ignite.context().cache().context() .database(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/pagemem/wal/record/WALRecordSerializationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/pagemem/wal/record/WALRecordSerializationTest.java index e83782e457beb..b0027611473e8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/pagemem/wal/record/WALRecordSerializationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/pagemem/wal/record/WALRecordSerializationTest.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -94,7 +95,7 @@ public void testAllWalRecordsSerializedAndDeserializedSuccessfully() throws Exce IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); WALRecord.RecordType[] recordTypes = WALRecord.RecordType.values(); @@ -149,7 +150,7 @@ public void testAllWalRecordsSerializedCompressedAndThenDeserializedSuccessfully IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); WALRecord.RecordType[] recordTypes = WALRecord.RecordType.values(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/DeadLockOnNodeLeftExchangeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/DeadLockOnNodeLeftExchangeTest.java index 48b0ac2db6ef2..d3af78f9183e6 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/DeadLockOnNodeLeftExchangeTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/DeadLockOnNodeLeftExchangeTest.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -83,7 +84,7 @@ public void test() throws Exception { IgniteClusterEx cluster = grid(0).cluster(); cluster.baselineAutoAdjustEnabled(false); - cluster.active(true); + cluster.state(ClusterState.ACTIVE); TestRecordingCommunicationSpi spi = TestRecordingCommunicationSpi.spi(grid(3)); spi.blockMessages(GridDhtPartitionsSingleMessage.class, getTestIgniteInstanceName(0)); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/Authentication1kUsersNodeRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/Authentication1kUsersNodeRestartTest.java index 28ba469f7a7f9..b81f81817e168 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/Authentication1kUsersNodeRestartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/Authentication1kUsersNodeRestartTest.java @@ -19,6 +19,7 @@ import java.util.stream.IntStream; import org.apache.ignite.IgniteException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -88,7 +89,7 @@ public class Authentication1kUsersNodeRestartTest extends GridCommonAbstractTest public void test1kUsersNodeRestartServer() throws Exception { startGrid(0); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); IgniteSecurity sec = grid(0).context().security(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationConfigurationClusterTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationConfigurationClusterTest.java index 92de58056cc8d..553e0f8b0f242 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationConfigurationClusterTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationConfigurationClusterTest.java @@ -20,6 +20,7 @@ import java.util.concurrent.Callable; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -149,7 +150,7 @@ private void checkNodeJoinFailed(boolean client, boolean authEnabled) throws Exc public void testDisabledAuthentication() throws Exception { startGrid(configuration(0, false, false)); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); GridTestUtils.assertThrows(log, new Callable() { @Override public Object call() throws Exception { diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationOnNotActiveClusterTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationOnNotActiveClusterTest.java index 89f63c3917b02..3a3495f65dae8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationOnNotActiveClusterTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationOnNotActiveClusterTest.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors.authentication; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -106,7 +107,7 @@ public void testNotDefaultUser() throws Exception { startClientGrid(CLI_NODE); startGrid(NODES_COUNT); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); SecurityContext secCtxDflt = authenticate(grid(0), User.DFAULT_USER_NAME, "ignite"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationProcessorNodeRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationProcessorNodeRestartTest.java index 0912718980139..d93638641abc7 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationProcessorNodeRestartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationProcessorNodeRestartTest.java @@ -20,6 +20,7 @@ import java.util.Random; import java.util.concurrent.atomic.AtomicInteger; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -92,7 +93,7 @@ public class AuthenticationProcessorNodeRestartTest extends GridCommonAbstractTe startGrids(NODES_COUNT - 1); startClientGrid(CLI_NODE); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); secCtxDflt = authenticate(grid(0), DFAULT_USER_NAME, "ignite"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationProcessorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationProcessorSelfTest.java index 533ac8943673a..c0199a53165a5 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationProcessorSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/authentication/AuthenticationProcessorSelfTest.java @@ -25,6 +25,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -113,7 +114,7 @@ private static String randomString(int len) { startGrids(NODES_COUNT - 1); startClientGrid(CLI_NODE); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); secCtxDflt = authenticate(grid(0), DFAULT_USER_NAME, "ignite"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryMetadataRegistrationInsideEntryProcessorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryMetadataRegistrationInsideEntryProcessorTest.java index 5eec803a7e3e0..b4cab4fc83517 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryMetadataRegistrationInsideEntryProcessorTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryMetadataRegistrationInsideEntryProcessorTest.java @@ -34,6 +34,7 @@ import org.apache.ignite.cache.query.ContinuousQuery; import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.cache.query.ScanQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -107,7 +108,7 @@ public void test() throws Exception { */ @Test public void testContinuousQueryAndBinaryObjectBuilder() throws Exception { - startGrids(3).cluster().active(true); + startGrids(3).cluster().state(ClusterState.ACTIVE); grid(0).createCache(new CacheConfiguration<>() .setName(CACHE_NAME) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java index 5225899e011e7..5e82fbc436c08 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java @@ -25,6 +25,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataPageEvictionMode; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -320,7 +321,7 @@ public void testWarningIfStaticCacheOverheadExceedsThreshold() throws Exception startGrid("srv1"); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); //srv0 and srv1 print warning into the log as the threshold for cache in default cache group is broken assertTrue(cacheGrpLsnr0.check()); @@ -393,7 +394,7 @@ public void testWarningIfDynamicCacheOverheadExceedsThreshold() throws Exception startGrid("srv2"); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteEx cl = startGrid("client01"); @@ -450,7 +451,7 @@ public void testWarningOnBaselineTopologyChange() throws Exception { startGrid("srv1"); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); ignite0.createCache( new CacheConfiguration<>(DEFAULT_CACHE_NAME) @@ -511,7 +512,7 @@ public void testNoWarningIfCacheConfigurationDoesntBreakThreshold() throws Excep IgniteEx ignite0 = startGrid("srv0"); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); assertFalse(cacheGrpLsnr0.check()); @@ -700,7 +701,7 @@ public void testNoFailNodeIfUnknownDataRegion() throws Exception { IgniteEx clientNode = startClientGrid(optimize(clientCfg)); - srvNode.cluster().active(true); + srvNode.cluster().state(ClusterState.ACTIVE); assertThrows(log, () -> { clientNode.getOrCreateCache( diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsTest.java index 4e355e4158d03..13ceb7cf994f1 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsTest.java @@ -373,7 +373,7 @@ public void testAllocatedPages() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); MetricRegistry mxBean0Grp1 = cacheGroupMetrics(0, "group1"); MetricRegistry mxBean0Grp2 = cacheGroupMetrics(0, "group2"); @@ -471,7 +471,7 @@ public void testInitializedLocalPartitions() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); MetricRegistry group1Metrics = cacheGroupMetrics(0, "group1"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsManageTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsManageTest.java index 53de990d014ee..525ec228324bb 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsManageTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsManageTest.java @@ -41,6 +41,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -410,7 +411,7 @@ private void testJmxStatisticsEnable(boolean persistence) throws Exception { Ignite ig1 = startGrid(1); Ignite ig2 = startGrid(2); - ig1.cluster().active(true); + ig1.cluster().state(ClusterState.ACTIVE); CacheConfiguration ccfg = ig1.cache(CACHE1).getConfiguration(CacheConfiguration.class); CacheConfiguration cacheCfg2 = new CacheConfiguration<>(ccfg); @@ -483,7 +484,7 @@ private void testJmxStatisticsEnable(boolean persistence) throws Exception { ig1 = startGrid(1); - ig1.cluster().active(true); + ig1.cluster().state(ClusterState.ACTIVE); ig1.getOrCreateCache(cacheCfg2.setStatisticsEnabled(false)); @@ -575,7 +576,7 @@ public void testTxContentionMetric() throws Exception { CountDownLatch txLatch0 = new CountDownLatch(contCnt * 2); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); client = true; @@ -709,7 +710,7 @@ public void testKeyCollisionsMetricDifferentTimeout() throws Exception { CountDownLatch txLatch = new CountDownLatch(contCnt); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); client = true; diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheValidatorMetricsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheValidatorMetricsTest.java index efbab86075a77..470771b559bcc 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheValidatorMetricsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheValidatorMetricsTest.java @@ -25,6 +25,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.PartitionLossPolicy; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.configuration.TopologyValidator; @@ -100,7 +101,7 @@ void assertCacheStatus(String cacheName, boolean validForReading, boolean validF @Test public void testCacheValidatorMetrics() throws Exception { final IgniteEx crd = startGrid(1); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); crd.cluster().baselineAutoAdjustEnabled(false); assertCacheStatus(CACHE_NAME_1, true, true); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheWithDifferentDataRegionConfigurationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheWithDifferentDataRegionConfigurationTest.java index e85d94cd2a381..f52a991a44250 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheWithDifferentDataRegionConfigurationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheWithDifferentDataRegionConfigurationTest.java @@ -22,6 +22,7 @@ import java.util.concurrent.Callable; import org.apache.ignite.IgniteCache; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -125,7 +126,7 @@ public void twoNodesHaveCommonDefaultConfigurationAcceptable() throws Exception .andCache(CACHE_2) .start(); - node1.cluster().active(true); + node1.cluster().state(ClusterState.ACTIVE); populateCache(node1, CACHE_1, 1000); populateCache(node2, CACHE_2, 350); @@ -148,7 +149,7 @@ public void firstNodeHasDefaultAndSecondDefaultWithCustomNameAcceptable() throws .andCache(CACHE_2) .start(); - node1.cluster().active(true); + node1.cluster().state(ClusterState.ACTIVE); populateCache(node1, CACHE_1, 1000); populateCache(node2, CACHE_2, 350); @@ -198,7 +199,7 @@ public void twoNodesHaveTwoNonOverlappingRegionsAcceptable() throws Exception { .andExclusiveCache(CACHE_2, REGION_4) .start(); - node1.cluster().active(true); + node1.cluster().state(ClusterState.ACTIVE); populateCache(node1, CACHE_1, 1000); populateCache(node2, CACHE_2, 350); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ClusterStateTestUtils.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ClusterStateTestUtils.java index 738b33906f8ba..02d4fce80e73a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ClusterStateTestUtils.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ClusterStateTestUtils.java @@ -91,7 +91,7 @@ public static void putSomeDataAndCheck(IgniteLogger log, List nodes, S "Can not perform the operation because the cluster is inactive. " + "Note, that the cluster is considered inactive by default " + "if Ignite Persistent Store is used to let all the nodes join the cluster. " + - "To activate the cluster call Ignite.active(true)." + "To activate the cluster call Ignite.cluster().state(ClusterState.ACTIVE)." )); break; diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartFailWithPersistenceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartFailWithPersistenceTest.java index 8643b66a19ba1..c41a3de40762d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartFailWithPersistenceTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartFailWithPersistenceTest.java @@ -19,6 +19,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteDataStreamer; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -61,7 +62,7 @@ public class IgniteDynamicCacheStartFailWithPersistenceTest extends IgniteAbstra startGrids(gridCount()); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheFSRestoreTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheFSRestoreTest.java index c523792b85400..ff7db00e47d87 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheFSRestoreTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheFSRestoreTest.java @@ -30,6 +30,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -199,7 +200,7 @@ public void testNodeStartFailsOnCorruptedStorage() throws Exception { Ignite ig = startGrids(3); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); ig.cache(DEFAULT_CACHE_NAME).put(0, new SimpleValue(0, "value0")); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/NonAffinityCoordinatorDynamicStartStopTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/NonAffinityCoordinatorDynamicStartStopTest.java index 0110aae3ec9b1..064f8f921bcf9 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/NonAffinityCoordinatorDynamicStartStopTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/NonAffinityCoordinatorDynamicStartStopTest.java @@ -21,6 +21,7 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -74,7 +75,7 @@ public class NonAffinityCoordinatorDynamicStartStopTest extends GridCommonAbstra final Ignite crd = startGrid(DUMMY_GRID_NAME); - crd.active(true); + crd.cluster().state(ClusterState.ACTIVE); startClientGrid("client"); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionsExchangeCoordinatorFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionsExchangeCoordinatorFailoverTest.java index e7fc015b271f5..7e27386d6928b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionsExchangeCoordinatorFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionsExchangeCoordinatorFailoverTest.java @@ -28,6 +28,7 @@ import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -121,7 +122,7 @@ public void testNewCoordinatorCompletedExchange() throws Exception { IgniteEx newCrd = startGrid(1); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); // 3 node join topology version. AffinityTopologyVersion joinThirdNodeVer = new AffinityTopologyVersion(3, 0); @@ -211,7 +212,7 @@ public void testDelayedFullMessageReplacedIfCoordinatorChanged() throws Exceptio IgniteEx problemNode = startGrid(2); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/RebalanceWithDifferentThreadPoolSizeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/RebalanceWithDifferentThreadPoolSizeTest.java index 623af7d23f348..823e05bd52927 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/RebalanceWithDifferentThreadPoolSizeTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/RebalanceWithDifferentThreadPoolSizeTest.java @@ -20,6 +20,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -73,7 +74,7 @@ public void shouldFinishRebalanceWhenConnectedNewNodeWithHigherThreadPoolSize() IgniteEx ex = startGrid(0); - ex.cluster().active(true); + ex.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ex.cache(CACHE_NAME); for (int i = 0; i < ENTRIES_COUNT; i++) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/WalModeChangeAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/WalModeChangeAbstractSelfTest.java index b6242b3d836c3..8d74ee05ae855 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/WalModeChangeAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/WalModeChangeAbstractSelfTest.java @@ -23,6 +23,7 @@ import org.apache.ignite.IgniteException; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.util.lang.IgniteInClosureX; @@ -63,7 +64,7 @@ protected WalModeChangeAbstractSelfTest(boolean filterOnCrd, boolean jdbc) { Ignite cli = startGrid(config(CLI, true, false)); - cli.cluster().active(true); + cli.cluster().state(ClusterState.ACTIVE); } /** diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataMoveLegacyFolderTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataMoveLegacyFolderTest.java index 41c858a3e0eed..538b3c681d136 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataMoveLegacyFolderTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataMoveLegacyFolderTest.java @@ -25,6 +25,7 @@ import org.apache.ignite.binary.BinaryObject; import org.apache.ignite.binary.BinaryObjectBuilder; import org.apache.ignite.binary.BinaryType; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -81,7 +82,7 @@ public class BinaryMetadataMoveLegacyFolderTest extends GridCommonAbstractTest { /** {@inheritDoc} */ @Override protected IgniteEx startGrid(IgniteConfiguration cfg) throws Exception { IgniteEx grid = super.startGrid(cfg); - grid.active(true); + grid.cluster().state(ClusterState.ACTIVE); return grid; } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataRemoveWithPersistenceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataRemoveWithPersistenceTest.java index 9133b1e835ac7..842c5c5fe0181 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataRemoveWithPersistenceTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataRemoveWithPersistenceTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal.processors.cache.binary; import org.apache.ignite.binary.BinaryObjectBuilder; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -46,7 +47,7 @@ public class BinaryMetadataRemoveWithPersistenceTest extends BinaryMetadataRemov @Override protected void startCluster() throws Exception { super.startCluster(); - grid("srv0").cluster().active(true); + grid("srv0").cluster().state(ClusterState.ACTIVE); } /** diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteSequenceInternalCleanupTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteSequenceInternalCleanupTest.java index fceceffed99ed..9fa58f363c308 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteSequenceInternalCleanupTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteSequenceInternalCleanupTest.java @@ -22,6 +22,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteAtomicSequence; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.AtomicConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -109,9 +110,9 @@ public void testDeactivate() throws Exception { assertEquals(1, puts); - grid(GRIDS_CNT - 1).cluster().active(false); + grid(GRIDS_CNT - 1).cluster().state(ClusterState.INACTIVE); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); long putsAfter = ignite.cache("test0").metrics().getCachePuts(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/OutOfMemoryVolatileRegionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/OutOfMemoryVolatileRegionTest.java index bce9c878f2d19..1704281429ca8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/OutOfMemoryVolatileRegionTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/OutOfMemoryVolatileRegionTest.java @@ -21,6 +21,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -133,7 +134,7 @@ public void testLoadAndClearTransactionalCache() throws Exception { * @param attempts Number of attempts to load and clear the cache. */ private void loadAndClearCache(CacheAtomicityMode mode, int attempts) { - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); failure = false; diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/Cache64kPartitionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/Cache64kPartitionsTest.java index 1c4b9689f87b5..40aa819a17dee 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/Cache64kPartitionsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/Cache64kPartitionsTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal.processors.cache.distributed; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -85,7 +86,7 @@ private void checkManyPartitions() throws Exception { try { startGrids(4); - grid(0).active(true); + grid(0).cluster().state(ClusterState.ACTIVE); } finally { stopAllGrids(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java index 89bce1439ac2d..7ef2e4cbe7a58 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java @@ -154,7 +154,7 @@ public void testRebalanceForCacheWithNodeFilter() throws Exception { IgniteEx ignite = startGrid(2); ignite.cluster().baselineAutoAdjustEnabled(false); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -229,7 +229,7 @@ public void testTopologyChangesWithFixedBaseline() throws Exception { IgniteEx ignite = grid(0); ignite.cluster().baselineAutoAdjustEnabled(false); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -382,9 +382,9 @@ public void testClusterActiveWhileBaselineChanging() throws Exception { IgniteEx ig = grid(0); ig.cluster().baselineAutoAdjustEnabled(false); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); - assertTrue(ig.cluster().active()); + assertTrue(ig.cluster().state().active()); startGrid(NODE_COUNT); @@ -399,9 +399,9 @@ public void testClusterActiveWhileBaselineChanging() throws Exception { }); while (!fut.isDone()) { - assertTrue(grid(0).cluster().active()); + assertTrue(grid(0).cluster().state().active()); assertTrue(grid(0).context().state().publicApiActiveState(false)); - assertTrue(grid(NODE_COUNT).cluster().active()); + assertTrue(grid(NODE_COUNT).cluster().state().active()); assertTrue(grid(NODE_COUNT).context().state().publicApiActiveState(false)); } @@ -424,7 +424,7 @@ private void testBaselineTopologyChanges(boolean fromClient) throws Exception { ignite = grid(0); ignite.cluster().baselineAutoAdjustEnabled(false); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -542,7 +542,7 @@ public void testPrimaryLeft() throws Exception { IgniteEx ig = grid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -630,7 +630,7 @@ public void testPrimaryLeftAndClusterRestart() throws Exception { IgniteEx ig = grid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.createCache( @@ -706,7 +706,7 @@ else if (grid(i).localNode().equals(affNodes.get(1))) { boolean activated = GridTestUtils.waitForCondition(() -> { for (int i = 0; i < NODE_COUNT; i++) { - if (!grid(i).cluster().active()) + if (!grid(i).cluster().state().active()) return false; } @@ -742,7 +742,7 @@ public void testMetadataUpdate() throws Exception { Ignite ignite3 = grid(3); - ignite3.cluster().active(true); + ignite3.cluster().state(ClusterState.ACTIVE); CacheConfiguration repCacheCfg = new CacheConfiguration<>("replicated") .setCacheMode(CacheMode.REPLICATED) @@ -762,7 +762,7 @@ public void testMetadataUpdate() throws Exception { startGrids(5); - GridTestUtils.waitForCondition(() -> grid(0).cluster().active(), getTestTimeout()); + GridTestUtils.waitForCondition(() -> grid(0).cluster().state().active(), getTestTimeout()); for (int g = 0; g < 5; g++) { for (int i = 0; i < 100; i++) @@ -779,7 +779,7 @@ public void testClusterRestoredOnRestart() throws Exception { Ignite ignite3 = grid(3); - ignite3.cluster().active(true); + ignite3.cluster().state(ClusterState.ACTIVE); stopGrid(0); @@ -802,7 +802,7 @@ public void testClusterRestoredOnRestart() throws Exception { startGrid(3); startGrid(4); - GridTestUtils.waitForCondition(() -> grid(0).cluster().active(), getTestTimeout()); + GridTestUtils.waitForCondition(() -> grid(0).cluster().state().active(), getTestTimeout()); for (int g = 0; g < 5; g++) { for (int i = 0; i < 2048; i++) @@ -817,7 +817,7 @@ public void testClusterRestoredOnRestart() throws Exception { public void testNonPersistentCachesDontIgnoreBaselineTopology() throws Exception { Ignite ig = startGrids(4); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache persistentCache = ig.createCache(CACHE_NAME); @@ -930,7 +930,7 @@ public void testAffinityAssignmentChangedAfterRestart() throws Exception { IgniteEx ig = grid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.createCache( new CacheConfiguration() @@ -963,7 +963,7 @@ public void testAffinityAssignmentChangedAfterRestart() throws Exception { ig = grid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); cache = ig.cache(cacheName); @@ -1001,7 +1001,7 @@ public void testAffinityAssignmentChangedAfterRestart() throws Exception { public void testSettingBaselineTopologyWithOfflineNode() throws Exception { Ignite ignite = startGrids(2); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite(0).createCache(defaultCacheConfiguration().setNodeFilter( (IgnitePredicate)node -> node.attribute("some-attr") != null)); @@ -1030,7 +1030,7 @@ public void testSettingBaselineTopologyWithOfflineNodeFromOldTopology() throws E ignite.cluster().baselineAutoAdjustEnabled(false); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); stopGrid(1); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBlockOnReadAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBlockOnReadAbstractTest.java index 23fc90ceb6c58..c4f5d3bf08179 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBlockOnReadAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBlockOnReadAbstractTest.java @@ -46,6 +46,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -315,7 +316,7 @@ public List clients() { baseline.add(startGrid(idx++)); // Activate cluster. - baseline.get(0).cluster().active(true); + baseline.get(0).cluster().state(ClusterState.ACTIVE); // Start server nodes in activated cluster. for (int i = 0; i < serversCount(); i++) @@ -343,7 +344,7 @@ public List clients() { clients.clear(); - grid(0).cluster().active(false); + grid(0).cluster().state(ClusterState.INACTIVE); stopAllGrids(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDataLossOnPartitionMoveTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDataLossOnPartitionMoveTest.java index cd4de7ef0a695..892506f613bd8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDataLossOnPartitionMoveTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDataLossOnPartitionMoveTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.cache.affinity.AffinityFunctionContext; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -135,7 +136,7 @@ public void testDataLossOnPartitionMove() throws Exception { Ignite ignite = startGridsMultiThreaded(GRIDS_CNT / 2, false); ignite.cluster().baselineAutoAdjustEnabled(false); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); List toCp = movingKeysAfterJoin(ignite, DEFAULT_CACHE_NAME, 1, node -> ((GridTestNode)node).setAttribute(GRP_ATTR, ODD_GRP), null); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePageWriteLockUnlockTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePageWriteLockUnlockTest.java index 29c3deee1b1f3..52b39a4b2ed5f 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePageWriteLockUnlockTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePageWriteLockUnlockTest.java @@ -23,6 +23,7 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -80,7 +81,7 @@ public void testPreloadPartition() throws Exception { try { IgniteEx grid0 = startGrid(0); - grid0.cluster().active(true); + grid0.cluster().state(ClusterState.ACTIVE); int total = 512; @@ -94,7 +95,7 @@ public void testPreloadPartition() throws Exception { grid0 = startGrid(0); - grid0.cluster().active(true); + grid0.cluster().state(ClusterState.ACTIVE); putData(grid0, total, PARTITION); // Will use pages from reuse pool. @@ -104,7 +105,7 @@ public void testPreloadPartition() throws Exception { grid0 = startGrid(0); - grid0.cluster().active(true); + grid0.cluster().state(ClusterState.ACTIVE); preloadPartition(grid0, DEFAULT_CACHE_NAME, PARTITION); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheParallelStartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheParallelStartTest.java index a542aad46ba03..3554be2a2d3b3 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheParallelStartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheParallelStartTest.java @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.Collection; import org.apache.ignite.IgniteSystemProperties; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -148,13 +149,13 @@ private void testParallelStartAndStop(boolean parallel) throws Exception { IgniteEx igniteEx2 = startGrid(1); - igniteEx.cluster().active(true); + igniteEx.cluster().state(ClusterState.ACTIVE); assertCaches(igniteEx); assertCaches(igniteEx2); - igniteEx.cluster().active(false); + igniteEx.cluster().state(ClusterState.INACTIVE); assertCachesAfterStop(igniteEx); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePartitionLossWithPersistenceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePartitionLossWithPersistenceTest.java index c154b744d6bc0..6209c057b6af5 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePartitionLossWithPersistenceTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePartitionLossWithPersistenceTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.cache.PartitionLossPolicy; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -121,12 +122,12 @@ public class CachePartitionLossWithPersistenceTest extends GridCommonAbstractTes @Test public void testResetOnLesserTopologyAfterRestart() throws Exception { IgniteEx crd = startGrids(5); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); stopAllGrids(); crd = startGrids(2); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); resetBaselineTopology(); @@ -181,7 +182,7 @@ private void doTestConsistencyAfterResettingLostPartitions(int partResetMode, bo lossPlc = READ_WRITE_SAFE; IgniteEx crd = startGrids(2); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); startGrid(2); resetBaselineTopology(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePartitionLossWithRestartsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePartitionLossWithRestartsTest.java index e8bfdcc0894f8..457370f7e7831 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePartitionLossWithRestartsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePartitionLossWithRestartsTest.java @@ -24,6 +24,7 @@ import java.util.Set; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -176,7 +177,7 @@ public static List parameters() { public void testPartitionLossDetectionOnClientTopology() throws Exception { final IgniteEx crd = startGrids(3); crd.cluster().baselineAutoAdjustEnabled(false); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); assertTrue(grid(1).cache(DEFAULT_CACHE_NAME).lostPartitions().isEmpty()); assertTrue(grid(2).cache(DEFAULT_CACHE_NAME).lostPartitions().isEmpty()); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePartitionLostAfterSupplierHasLeftTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePartitionLostAfterSupplierHasLeftTest.java index ad8005a092ba1..f823d9f98517e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePartitionLostAfterSupplierHasLeftTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePartitionLostAfterSupplierHasLeftTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.cache.PartitionLossPolicy; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -240,7 +241,7 @@ public void testPartitionConsistencyOnSupplierRestart() throws Exception { IgniteEx crd = (IgniteEx)startGridsMultiThreaded(2); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = crd.cache(DEFAULT_CACHE_NAME); @@ -313,7 +314,7 @@ public void testPartitionConsistencyOnSupplierRestart() throws Exception { private void doTestPartitionLostWhileClearing(int cnt, int mode) throws Exception { IgniteEx crd = startGrids(cnt); crd.cluster().baselineAutoAdjustEnabled(false); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); int partId = -1; int idx0 = 0; @@ -385,11 +386,11 @@ private void doTestPartitionLostWhileClearing(int cnt, int mode) throws Exceptio if (mode == 1) { crd = startGrids(cnt); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); } else if (mode == 2) { crd = startGrid(idx1); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); startGrid(idx0); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheRentingStateRepairTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheRentingStateRepairTest.java index d87bbd9401e56..f6b5c5fd98e7b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheRentingStateRepairTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheRentingStateRepairTest.java @@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -114,7 +115,7 @@ public void testRentingStateRepairAfterRestart() throws Exception { g0.cluster().baselineAutoAdjustEnabled(false); startGrid(1); - g0.cluster().active(true); + g0.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -246,7 +247,7 @@ private void testRebalanceRentingPartitionAndNodeJoin(boolean client, long delay IgniteEx g0 = startGrids(2); g0.cluster().baselineAutoAdjustEnabled(false); - g0.cluster().active(true); + g0.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheResultIsNotNullOnPartitionLossTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheResultIsNotNullOnPartitionLossTest.java index 8872465e6275c..910feda8a8bdd 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheResultIsNotNullOnPartitionLossTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheResultIsNotNullOnPartitionLossTest.java @@ -32,6 +32,7 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.PartitionLossPolicy; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.events.EventType; @@ -93,7 +94,7 @@ public class CacheResultIsNotNullOnPartitionLossTest extends GridCommonAbstractT for (Integer i : list) startGrid(i); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); grid(0).cluster().baselineAutoAdjustEnabled(false); client = startClientGrid(CLIENT_IDX); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/FailBackupOnAtomicOperationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/FailBackupOnAtomicOperationTest.java index 934b0ae3420d0..8f7c47b1ec63c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/FailBackupOnAtomicOperationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/FailBackupOnAtomicOperationTest.java @@ -23,6 +23,7 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -91,7 +92,7 @@ public void testNodeFailOnCacheReadWithoutPersistent() throws Exception { public void nodeFailOnCacheOp() throws Exception { Ignite ignite0 = startGrids(3); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); Ignite igniteClient = startClientGrid("client"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionNotLoadedEventSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionNotLoadedEventSelfTest.java index 3a7a3faac00a5..2178c95365189 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionNotLoadedEventSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionNotLoadedEventSelfTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.affinity.Affinity; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.events.CacheRebalancingEvent; @@ -108,7 +109,7 @@ public void testPrimaryAndBackupDead() throws Exception { IgniteEx crd = (IgniteEx)startGridsMultiThreaded(4); crd.cluster().baselineAutoAdjustEnabled(false); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -176,7 +177,7 @@ public void testPrimaryDead() throws Exception { startGrid(1); crd.cluster().baselineAutoAdjustEnabled(false); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); final PartitionNotFullyLoadedListener lsnr = new PartitionNotFullyLoadedListener(); @@ -211,7 +212,7 @@ public void testStableTopology() throws Exception { IgniteEx crd = startGrid(1); crd.cluster().baselineAutoAdjustEnabled(false); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); startGrid(0); @@ -251,7 +252,7 @@ public void testMapPartitioned() throws Exception { startGrid(1); crd.cluster().baselineAutoAdjustEnabled(false); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); final PartitionNotFullyLoadedListener lsnr = new PartitionNotFullyLoadedListener(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridExchangeFreeSwitchTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridExchangeFreeSwitchTest.java index 5eb6a606bf41f..dedd7b402b79e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridExchangeFreeSwitchTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridExchangeFreeSwitchTest.java @@ -677,7 +677,7 @@ public void testLateAffinityAssignmentOnBackupLeftAndJoin() throws Exception { startGrid(0); // Primary partition holder. startGrid(1); // Backup partition holder. - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); grid(1).close(); // Stopping backup partition holder. diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java index 1fdfa13ba34ef..a6eaa77b8ad36 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePartitionLossPolicySelfTest.java @@ -39,6 +39,7 @@ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.ScanQuery; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -482,7 +483,7 @@ protected List runQuery(Ignite ig, String cacheName, boolean loc, int part) { private Set prepareTopology(int nodes, boolean autoAdjust, P1 lsnr, int... stopNodes) throws Exception { final IgniteEx crd = startGrids(nodes); crd.cluster().baselineAutoAdjustEnabled(autoAdjust); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); Affinity aff = ignite(0).affinity(CACHES[0]); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheGetReadFromBackupFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheGetReadFromBackupFailoverTest.java index c16675e084d20..8424d9c905f9d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheGetReadFromBackupFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheGetReadFromBackupFailoverTest.java @@ -28,6 +28,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.IgniteIllegalStateException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.failure.AbstractFailureHandler; @@ -140,7 +141,7 @@ public int gridCount() { public void testFailover() throws Exception { Ignite ignite = ignite(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ThreadLocalRandom rnd = ThreadLocalRandom.current(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GracefulShutdownTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GracefulShutdownTest.java index b4ca9dac2141c..688aced8ca34f 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GracefulShutdownTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GracefulShutdownTest.java @@ -22,6 +22,7 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.ShutdownPolicy; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -98,7 +99,7 @@ public void testRestartWithStaticConfiguredPolicy() throws Exception { public void testTwoNodesWithDifferentConfuguration() throws Exception { Ignite ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); assertSame(ignite0.configuration().getShutdownPolicy(), ShutdownPolicy.GRACEFUL); @@ -117,7 +118,7 @@ public void testTwoNodesWithDifferentConfuguration() throws Exception { public void testRestartWithDynamicConfiguredPolicy() throws Exception { Ignite ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); assertSame(ignite0.cluster().shutdownPolicy(), ignite0.configuration().getShutdownPolicy()); @@ -160,7 +161,7 @@ public void testNotIdealOwners() throws Exception { Ignite ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); for (int i = 1; i <= 3; i++) { IgniteCache cache = ignite0.cache("cache" + i); @@ -230,7 +231,7 @@ public void tesStartCacheWhenNodeStopping() throws Exception { Ignite ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); for (int i = 1; i <= 3; i++) { IgniteCache cache = ignite0.cache("cache" + i); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java index 8f952e2d80874..c4320ece75544 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java @@ -30,6 +30,7 @@ import org.apache.ignite.cache.affinity.Affinity; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -138,7 +139,7 @@ public void testManualPreload() throws Exception { Ignite g0 = startGrid(0); if (persistenceEnabled()) - g0.cluster().active(true); + g0.cluster().state(ClusterState.ACTIVE); int cnt = KEY_CNT; @@ -228,7 +229,7 @@ public void testDelayedPreload() throws Exception { Ignite g0 = startGrid(0); if (persistenceEnabled()) - g0.cluster().active(true); + g0.cluster().state(ClusterState.ACTIVE); int cnt = KEY_CNT; @@ -311,7 +312,7 @@ public void testAutomaticPreload() throws Exception { Ignite g0 = startGrid(0); if (persistenceEnabled()) - g0.cluster().active(true); + g0.cluster().state(ClusterState.ACTIVE); int cnt = KEY_CNT; @@ -361,7 +362,7 @@ public void testAutomaticPreloadWithEmptyCache() throws Exception { if (persistenceEnabled()) { if (i == 0) - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); else resetBaselineTopology(); } @@ -414,7 +415,7 @@ public void testManualPreloadSyncMode() throws Exception { IgniteEx crd = startGrid(0); if (persistenceEnabled()) - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); } finally { stopAllGrids(); @@ -434,7 +435,7 @@ public void testPreloadManyNodes() throws Exception { startGridsMultiThreaded(cnt); if (persistenceEnabled()) - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); U.sleep(2000); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadWaitForBackupsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadWaitForBackupsTest.java index 95402365d04c0..f45649c7de1f8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadWaitForBackupsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadWaitForBackupsTest.java @@ -31,6 +31,7 @@ import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -166,7 +167,7 @@ public void testNodeForceShutdown() throws Exception { startGrids(2); if (persistenceEnabled()) - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); for (int i = 0; i < cacheSize(); i++) grid(i % 2).cache("cache" + (1 + (i >> 3) % 3)).put(i, new byte[i]); @@ -204,7 +205,7 @@ public void testReplicatedNodeLeavesImmediately() throws Exception { startGrids(1); if (persistenceEnabled()) - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); for (int i = 0; i < cacheSize(); i++) grid(0).cache("cache" + (1 + (i >> 3) % 3)).put(i, new byte[i]); @@ -253,7 +254,7 @@ public void testShutdownWithoutBackups() throws Exception { startGrids(2); if (persistenceEnabled()) - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); grid(1).cache("cache1").destroy(); grid(1).cache("cache2").destroy(); @@ -292,7 +293,7 @@ public void testThatItsNotPossibleToStopLastOwnerIfAnotherOwnerIsStopping() thro startGrids(2); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); grid(0).context().distributedMetastorage().write( DistributedMetaStorageImpl.IGNITE_INTERNAL_KEY_PREFIX + "graceful.shutdown", @@ -330,7 +331,7 @@ public void testThatItsPossibleToStopNodeIfExludedNodeListWithinMetastoreIsntEmp startGrids(3); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); grid(0).context().distributedMetastorage().write( DistributedMetaStorageImpl.IGNITE_INTERNAL_KEY_PREFIX + "graceful.shutdown", @@ -372,7 +373,7 @@ public void testThatExcludedNodeListWithinMetastoreCleanedUpAfterUpdatingFullMap startGrids(4); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); grid(0).context().distributedMetastorage().write( DistributedMetaStorageImpl.IGNITE_INTERNAL_KEY_PREFIX + "graceful.shutdown", @@ -428,7 +429,7 @@ public void testThatItsNotPossibleToStopLastNodeInBaselineIfThereAreStilNonBasel grid(0).cluster().baselineAutoAdjustEnabled(false); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); for (int i = 0; i < cacheSize(); i++) grid(0).cache("cache" + (1 + (i >> 3) % 3)).put(i, i); @@ -470,7 +471,7 @@ public void testClientNodeShouldStopImmediately() throws Exception { startClientGrid(1); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); grid(1).close(); } @@ -487,7 +488,7 @@ public void testNodeOnInactiveClusterShouldStopImmediately() throws Exception { startGrids(1); - grid(0).cluster().active(false); + grid(0).cluster().state(ClusterState.INACTIVE); grid(0).close(); } @@ -506,7 +507,7 @@ public void testRollingRestartEmulation() throws Exception { startGrids(nodesCnt); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); for (int i = 0; i < cacheSize(); i++) grid(i % 2).cache("cache" + (1 + (i >> 3) % 3)).put(i, i); @@ -540,7 +541,7 @@ public void testRollingRestartEmulationWithOnlyHalfNodesInBaseline() throws Exce ignite(0).cluster().baselineAutoAdjustEnabled(false); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); for (int i = nodesCnt / 2; i < nodesCnt; i++) startGrid(i); @@ -577,7 +578,7 @@ public void testRollingRestartEmulationReplicatedCache() throws Exception { startGrids(nodesCnt); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); for (int i = 0; i < cacheSize(); i++) grid(i % 2).cache("cache" + (1 + (i >> 3) % 3)).put(i, i); @@ -607,7 +608,7 @@ public void testSimultaneousSafeShutdown() throws Exception { startGrids(2); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); for (int i = 0; i < cacheSize(); i++) grid(i % 2).cache("cache" + (1 + (i >> 3) % 3)).put(i, i); @@ -639,7 +640,7 @@ public void testSimultaneousSafeShutdownWithReplicatedCache() throws Exception { startGrids(2); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); for (int i = 0; i < cacheSize(); i++) grid(i % 2).cache("cache" + (1 + (i >> 3) % 3)).put(i, i); @@ -666,7 +667,7 @@ private void nodeLeavesRebalanceCompletes() throws Exception { startGrids(4); if (persistenceEnabled()) - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); for (int i = 0; i < cacheSize(); i++) grid(i % 4).cache("cache" + (1 + (i >> 3) % 3)).put(i, new byte[i]); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionsStateValidationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionsStateValidationTest.java index 29a81a1bbc267..6f84a3905004a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionsStateValidationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionsStateValidationTest.java @@ -36,6 +36,7 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -99,7 +100,7 @@ public class GridCachePartitionsStateValidationTest extends GridCommonAbstractTe @Test public void testValidationIfPartitionCountersAreInconsistent() throws Exception { IgniteEx ignite = (IgniteEx)startGrids(2); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -134,7 +135,7 @@ public void testPartitionCountersConsistencyOnExchange() throws Exception { // Reopen https://issues.apache.org/jira/browse/IGNITE-10766 if starts failing with forced MVCC IgniteEx ignite = startGrids(4); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheStartWithLoadTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheStartWithLoadTest.java index 3a1d6c4b32dc0..8efd27054b64a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheStartWithLoadTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheStartWithLoadTest.java @@ -25,6 +25,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -82,7 +83,7 @@ public class IgniteCacheStartWithLoadTest extends GridCommonAbstractTest { public void testNoRebalanceDuringCacheStart() throws Exception { IgniteEx crd = (IgniteEx)startGrids(4); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); AtomicBoolean txLoadStop = new AtomicBoolean(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingPartitionCountersTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingPartitionCountersTest.java index 58f1b82e0a81c..59779563f69a7 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingPartitionCountersTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingPartitionCountersTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -107,7 +108,7 @@ private boolean contains(int[] arr, int a) { public void test() throws Exception { IgniteEx ignite = (IgniteEx)startGrids(3); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache(CACHE_NAME); @@ -119,7 +120,7 @@ public void test() throws Exception { IgniteEx node = (IgniteEx)ignite(problemNode); int[] primaryPartitions = node.affinity(CACHE_NAME).primaryPartitions(node.cluster().localNode()); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); boolean primaryRemoved = false; for (int i = 0; i < PARTITIONS_CNT; i++) { @@ -151,7 +152,7 @@ else if ("index.bin".equals(f.getName())) { assertTrue(primaryRemoved); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingWithAsyncClearingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingWithAsyncClearingTest.java index aefc1c0a0ead4..078f9d9d033e4 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingWithAsyncClearingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingWithAsyncClearingTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.PartitionLossPolicy; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -120,7 +121,7 @@ protected CacheAtomicityMode atomicityMode() { @WithSystemProperty(key = IGNITE_PDS_MAX_CHECKPOINT_MEMORY_HISTORY_SIZE, value = "1") public void testPartitionClearingNotBlockExchange() throws Exception { IgniteEx ig = (IgniteEx)startGrids(3); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); // High number of keys triggers long partition eviction. final int keysCnt = SF.applyLB(300_000, 10_000); @@ -217,7 +218,7 @@ public void testCorrectRebalancingCurrentlyRentingPartitions() throws Exception IgniteEx ignite = startGrids(3); ignite.cluster().baselineAutoAdjustEnabled(false); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); // High number of keys triggers long partition eviction. final int keysCnt = SF.applyLB(300_000, 10_000); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/IgniteRebalanceOnCachesStoppingOrDestroyingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/IgniteRebalanceOnCachesStoppingOrDestroyingTest.java index ac1b9674a68e4..bf744fd3b9d72 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/IgniteRebalanceOnCachesStoppingOrDestroyingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/IgniteRebalanceOnCachesStoppingOrDestroyingTest.java @@ -32,6 +32,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -142,10 +143,10 @@ public void testStopCachesOnDeactivationSecondGroup() throws Exception { */ private void testStopCachesOnDeactivation(String groupName) throws Exception { performTest(ig -> { - ig.cluster().active(false); + ig.cluster().state(ClusterState.INACTIVE); // Add to escape possible long waiting in awaitPartitionMapExchange due to {@link CacheAffinityChangeMessage}. - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); return null; }, groupName); @@ -213,7 +214,7 @@ private void testDestroySpecificCacheAndCacheGroup(String groupName) throws Exce private void performTest(IgniteThrowableFunction testAction, String groupName) throws Exception { IgniteEx ig0 = (IgniteEx)startGrids(2); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); stopGrid(1); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/RebalanceStatisticsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/RebalanceStatisticsTest.java index 304eea55bed4f..eb614bab253ef 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/RebalanceStatisticsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/RebalanceStatisticsTest.java @@ -30,6 +30,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -241,7 +242,7 @@ private IgniteEx createCluster(int nodeCnt) throws Exception { }; IgniteEx crd = startGrids(nodeCnt); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); populateCluster(crd, 10, ""); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionMultinodeMixedRegionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionMultinodeMixedRegionsTest.java index 5bcff9f561d67..7e90f5ff13f7e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionMultinodeMixedRegionsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/paged/PageEvictionMultinodeMixedRegionsTest.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors.cache.eviction.paged; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataPageEvictionMode; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -47,7 +48,7 @@ public class PageEvictionMultinodeMixedRegionsTest extends PageEvictionMultinode super.beforeTestsStarted(); - clientGrid().cluster().active(true); + clientGrid().cluster().state(ClusterState.ACTIVE); } /** {@inheritDoc} */ diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractBasicCoordinatorFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractBasicCoordinatorFailoverTest.java index 619a0492e22ef..42bed2a59249c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractBasicCoordinatorFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractBasicCoordinatorFailoverTest.java @@ -36,6 +36,7 @@ import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.cache.query.ScanQuery; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.cluster.ClusterTopologyException; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -763,7 +764,7 @@ private void checkCoordinatorsLeft(int num, boolean stopCrdFirst) throws Excepti Ignite nearNode = survivors.get(0); if (persistence) - nearNode.cluster().active(true); + nearNode.cluster().state(ClusterState.ACTIVE); CacheConfiguration ccfg = cacheConfiguration(cacheMode(), FULL_SYNC, DATA_NODES - 1, DFLT_PARTITION_COUNT) .setNodeFilter(new CoordinatorNodeFilter()); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccConfigurationValidationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccConfigurationValidationTest.java index 1cc0abe3efeb1..aebc120ac6014 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccConfigurationValidationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccConfigurationValidationTest.java @@ -30,6 +30,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheInterceptor; import org.apache.ignite.cache.CacheRebalanceMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -146,7 +147,7 @@ public void testNodeRestartWithCacheModeChangedTxToMvcc() throws Exception { Ignite node = startGrid(cfg); - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); CacheConfiguration ccfg1 = new CacheConfiguration("test1").setAtomicityMode(TRANSACTIONAL); @@ -195,7 +196,7 @@ public void testNodeRestartWithCacheModeChangedMvccToTx() throws Exception { Ignite node = startGrid(cfg); - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); CacheConfiguration ccfg1 = new CacheConfiguration("test1").setAtomicityMode(TRANSACTIONAL_SNAPSHOT); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccPartitionedCoordinatorFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccPartitionedCoordinatorFailoverTest.java index 7e6386640c339..eb27ce19d8b4a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccPartitionedCoordinatorFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccPartitionedCoordinatorFailoverTest.java @@ -20,6 +20,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.junit.Test; @@ -177,17 +178,17 @@ public void testActivateDeactivateCLuster() throws Exception { CacheConfiguration ccfg = cacheConfiguration(cacheMode(), FULL_SYNC, DATA_NODES - 1, DFLT_PARTITION_COUNT); - near.cluster().active(true); + near.cluster().state(ClusterState.ACTIVE); IgniteCache cache = near.createCache(ccfg); cache.put(1, 1); - near.cluster().active(false); + near.cluster().state(ClusterState.INACTIVE); stopGrid(0); - near.cluster().active(true); + near.cluster().state(ClusterState.ACTIVE); assertEquals(1, cache.get(1)); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccProcessorLazyStartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccProcessorLazyStartTest.java index a75bf95967d81..884408db3d25e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccProcessorLazyStartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccProcessorLazyStartTest.java @@ -20,6 +20,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -95,7 +96,7 @@ public void testMvccRestartedWithDynamicCache() throws Exception { assertFalse(mvccEnabled(node1)); assertFalse(mvccEnabled(node2)); - node1.cluster().active(true); + node1.cluster().state(ClusterState.ACTIVE); assertFalse(mvccEnabled(node1)); assertFalse(mvccEnabled(node2)); @@ -116,7 +117,7 @@ public void testMvccRestartedWithDynamicCache() throws Exception { node1 = startGrid(1); node2 = startGrid(2); - node1.cluster().active(true); + node1.cluster().state(ClusterState.ACTIVE); assertTrue(mvccEnabled(node1)); assertTrue(mvccEnabled(node2)); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccProcessorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccProcessorTest.java index 06ef266080a71..5b38deef66ca8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccProcessorTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccProcessorTest.java @@ -19,6 +19,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.processors.cache.mvcc.txlog.TxState; @@ -61,7 +62,7 @@ public void testTreeWithoutPersistence() throws Exception { private void checkTreeOperations() throws Exception { IgniteEx grid = startGrid(0); - grid.cluster().active(true); + grid.cluster().state(ClusterState.ACTIVE); grid.createCache(new CacheConfiguration<>("test").setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT)); @@ -86,7 +87,7 @@ private void checkTreeOperations() throws Exception { stopGrid(0, false); grid = startGrid(0); - grid.cluster().active(true); + grid.cluster().state(ClusterState.ACTIVE); mvccProcessor = mvccProcessor(grid); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTransactionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTransactionsTest.java index 8392048d209dd..112ae8626623d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTransactionsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTransactionsTest.java @@ -54,6 +54,7 @@ import org.apache.ignite.cache.affinity.Affinity; import org.apache.ignite.cache.query.ScanQuery; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.cluster.ClusterTopologyException; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -2497,7 +2498,7 @@ public void testMvccCoordinatorInfoConsistency() throws Exception { startGrid(i); if (persistence && i == 0) - ignite(i).active(true); + ignite(i).cluster().state(ClusterState.ACTIVE); checkCoordinatorsConsistency(i + 1); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTxFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTxFailoverTest.java index bc1275e8c70ce..d4c3e4b07f01a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTxFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTxFailoverTest.java @@ -23,6 +23,7 @@ import org.apache.ignite.IgniteTransactions; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -141,7 +142,7 @@ public void testSingleNodeCommitedTxRecoverFromWAL() throws Exception { public void checkSingleNodeRestart(boolean rollBack, boolean recoverFromWAL, boolean omitTxFinish) throws Exception { IgniteEx node = startGrid(0); - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); IgniteCache cache = node.getOrCreateCache(DEFAULT_CACHE_NAME); @@ -192,7 +193,7 @@ public void checkSingleNodeRestart(boolean rollBack, boolean recoverFromWAL, boo node = startGrid(0); - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); cache = node.cache(DEFAULT_CACHE_NAME); @@ -218,7 +219,7 @@ public void testLostRollbackOnBackup() throws Exception { startGrid(1); - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); final CyclicBarrier barrier = new CyclicBarrier(2); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccVacuumTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccVacuumTest.java index 6d46b539fb86c..4a8d433c5ef1d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccVacuumTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccVacuumTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.processors.cache.mvcc.txlog.TxLog; @@ -90,7 +91,7 @@ public void testStartStopVacuumPersistence() throws Exception { ensureNoVacuum(node0); ensureNoVacuum(node1); - node1.cluster().active(true); + node1.cluster().state(ClusterState.ACTIVE); ensureNoVacuum(node0); ensureNoVacuum(node1); @@ -110,12 +111,12 @@ public void testStartStopVacuumPersistence() throws Exception { ensureVacuum(node0); ensureVacuum(node1); - node1.cluster().active(false); + node1.cluster().state(ClusterState.INACTIVE); ensureNoVacuum(node0); ensureNoVacuum(node1); - node1.cluster().active(true); + node1.cluster().state(ClusterState.ACTIVE); ensureVacuum(node0); ensureVacuum(node1); @@ -133,7 +134,7 @@ public void testStartStopVacuumPersistence() throws Exception { node0 = startGrid(0); node1 = startGrid(1); - node1.cluster().active(true); + node1.cluster().state(ClusterState.ACTIVE); ensureVacuum(node0); ensureVacuum(node1); @@ -175,7 +176,7 @@ public void testVacuumNotStartedOnNonBaselineNode() throws Exception { node0.cluster().baselineAutoAdjustEnabled(false); ensureNoVacuum(node0); - node0.cluster().active(true); + node0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = node0.createCache( cacheConfiguration(PARTITIONED, CacheWriteSynchronizationMode.FULL_SYNC, 1, 16)); @@ -207,7 +208,7 @@ public void testVacuumNotStartedOnNonBaselineNode2() throws Exception { Ignite node1 = startGrid(1); node0.cluster().baselineAutoAdjustEnabled(false); - node0.cluster().active(true); + node0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = node0.createCache( cacheConfiguration(PARTITIONED, CacheWriteSynchronizationMode.FULL_SYNC, 1, 16)); @@ -250,7 +251,7 @@ public void testVacuumNotStartedOnNonAffinityNode() throws Exception { ensureNoVacuum(node0); ensureNoVacuum(node1); - node0.cluster().active(true); + node0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = node0.createCache( cacheConfiguration(PARTITIONED, CacheWriteSynchronizationMode.FULL_SYNC, 1, 16) @@ -261,7 +262,7 @@ public void testVacuumNotStartedOnNonAffinityNode() throws Exception { ensureVacuum(node0); ensureNoVacuum(node1); - node0.cluster().active(false); + node0.cluster().state(ClusterState.INACTIVE); ensureNoVacuum(node0); ensureNoVacuum(node1); @@ -271,7 +272,7 @@ public void testVacuumNotStartedOnNonAffinityNode() throws Exception { ensureNoVacuum(node0); ensureNoVacuum(node1); - node0.cluster().active(true); + node0.cluster().state(ClusterState.ACTIVE); node0.cluster().setBaselineTopology(Collections.singleton(node0.cluster().node())); ensureVacuum(node0); @@ -302,7 +303,7 @@ public void testVacuumNotStartedWithoutMvccPersistence() throws Exception { ensureNoVacuum(node); - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); ensureNoVacuum(node); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/CleanupRestoredCachesSlowTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/CleanupRestoredCachesSlowTest.java index 1ecdcdc585862..ff66625cb6e2e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/CleanupRestoredCachesSlowTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/CleanupRestoredCachesSlowTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteLogger; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -171,7 +172,7 @@ public void testCleanupSlow() throws Exception { ClusterNode cn0 = grid(0).cluster().localNode(); ClusterNode cn1 = grid(1).cluster().localNode(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.cluster().baselineAutoAdjustEnabled(false); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/CommonPoolStarvationCheckpointTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/CommonPoolStarvationCheckpointTest.java index 59051e438abbe..bbb2d2a4ea779 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/CommonPoolStarvationCheckpointTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/CommonPoolStarvationCheckpointTest.java @@ -25,6 +25,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -99,7 +100,7 @@ public class CommonPoolStarvationCheckpointTest extends GridCommonAbstractTest { public void testCommonPoolStarvation() throws Exception { IgniteEx grid = startGrid(0); - grid.cluster().active(true); + grid.cluster().state(ClusterState.ACTIVE); IgniteCache cache = grid.cache(CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteBaselineAffinityTopologyActivationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteBaselineAffinityTopologyActivationTest.java index 743dcff6b02db..9b740f6b926eb 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteBaselineAffinityTopologyActivationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteBaselineAffinityTopologyActivationTest.java @@ -31,6 +31,7 @@ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.BaselineNode; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -122,12 +123,12 @@ public class IgniteBaselineAffinityTopologyActivationTest extends GridCommonAbst public void testAutoActivationWithCompatibleOldNode() throws Exception { startGridWithConsistentId("A"); startGridWithConsistentId("B"); - startGridWithConsistentId("C").cluster().active(true); + startGridWithConsistentId("C").cluster().state(ClusterState.ACTIVE); stopAllGrids(false); startGridWithConsistentId("A"); - startGridWithConsistentId("B").cluster().active(true); + startGridWithConsistentId("B").cluster().state(ClusterState.ACTIVE); { IgniteEx nodeA = grid("A"); @@ -135,7 +136,7 @@ public void testAutoActivationWithCompatibleOldNode() throws Exception { assertNotNull(nodeA.cluster().currentBaselineTopology()); assertEquals(3, nodeA.cluster().currentBaselineTopology().size()); - assertTrue(nodeA.cluster().active()); + assertTrue(nodeA.cluster().state().active()); } stopAllGrids(false); @@ -149,7 +150,7 @@ public void testAutoActivationWithCompatibleOldNode() throws Exception { assertNotNull(nodeA.cluster().currentBaselineTopology()); assertEquals(3, nodeA.cluster().currentBaselineTopology().size()); - assertFalse(nodeA.cluster().active()); + assertFalse(nodeA.cluster().state().active()); } final Ignite nodeC = startGridWithConsistentId("C"); @@ -157,7 +158,7 @@ public void testAutoActivationWithCompatibleOldNode() throws Exception { boolean active = GridTestUtils.waitForCondition( new GridAbsPredicate() { @Override public boolean apply() { - return nodeC.cluster().active(); + return nodeC.cluster().state().active(); } }, 10_000 @@ -175,7 +176,7 @@ public void testBltChangeTopVerRemoveOnlineNodeFails() throws Exception { Ignite ignite = startGridWithConsistentId("A"); ignite.cluster().baselineAutoAdjustEnabled(false); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); long singleNodeTopVer = ignite.cluster().topologyVersion(); @@ -209,7 +210,7 @@ public void testOnlineNodesCannotBeRemovedFromBaselineTopology() throws Exceptio Ignite nodeC = startGridWithConsistentId("OnlineConsID"); nodeC.cluster().baselineAutoAdjustEnabled(false); - nodeC.cluster().active(true); + nodeC.cluster().state(ClusterState.ACTIVE); boolean expectedExceptionIsThrown = false; @@ -238,18 +239,18 @@ public void testNodeFailsToJoinWithIncompatiblePreviousBaselineTopology() throws Ignite nodeC = startGridWithConsistentId("C"); nodeC.cluster().baselineAutoAdjustEnabled(false); - nodeC.active(true); + nodeC.cluster().state(ClusterState.ACTIVE); stopAllGrids(false); Ignite nodeA = startGridWithConsistentId("A"); - startGridWithConsistentId("B").active(true); + startGridWithConsistentId("B").cluster().state(ClusterState.ACTIVE); nodeA.cluster().setBaselineTopology(baselineNodes(nodeA.cluster().forServers().nodes())); stopAllGrids(false); - startGridWithConsistentId("C").active(true); + startGridWithConsistentId("C").cluster().state(ClusterState.ACTIVE); stopGrid("C", false); @@ -285,16 +286,16 @@ public void testNodeFailsToJoinWithIncompatiblePreviousBaselineTopology() throws public void testIncompatibleBltNodeIsProhibitedToJoinCluster() throws Exception { startGridWithConsistentId("A"); startGridWithConsistentId("B"); - startGridWithConsistentId("C").cluster().active(true); + startGridWithConsistentId("C").cluster().state(ClusterState.ACTIVE); stopAllGrids(false); startGridWithConsistentId("A"); - startGridWithConsistentId("B").cluster().active(true); + startGridWithConsistentId("B").cluster().state(ClusterState.ACTIVE); stopAllGrids(false); - startGridWithConsistentId("C").cluster().active(true); + startGridWithConsistentId("C").cluster().state(ClusterState.ACTIVE); stopAllGrids(false); @@ -359,7 +360,7 @@ public void testNodeWithOldBltIsAllowedToJoinCluster() throws Exception { Ignite nodeB = startGridWithConsistentId("B"); Ignite nodeC = startGridWithConsistentId("C"); - nodeC.cluster().active(true); + nodeC.cluster().state(ClusterState.ACTIVE); verifyBaselineTopologyOnNodes(verifier1, new Ignite[] {nodeA, nodeB, nodeC}); stopAllGrids(false); @@ -367,7 +368,7 @@ public void testNodeWithOldBltIsAllowedToJoinCluster() throws Exception { nodeA = startGridWithConsistentId("A"); nodeB = startGridWithConsistentId("B"); - nodeB.cluster().active(true); + nodeB.cluster().state(ClusterState.ACTIVE); verifyBaselineTopologyOnNodes(verifier2, new Ignite[] {nodeA, nodeB}); @@ -398,7 +399,7 @@ public void testNodeJoinsDuringPartitionMapExchange() throws Exception { IgniteEx grid = grid("B"); grid.cluster().baselineAutoAdjustEnabled(false); - grid.cluster().active(true); + grid.cluster().state(ClusterState.ACTIVE); IgniteCache cache = grid.getOrCreateCache(CACHE_NAME); @@ -496,7 +497,7 @@ private void checkBaselineTopologyOnNode( public void testNodeWithBltIsNotAllowedToJoinClusterDuringFirstActivation() throws Exception { Ignite nodeC = startGridWithConsistentId("C"); - nodeC.cluster().active(true); + nodeC.cluster().state(ClusterState.ACTIVE); stopGrid("C", false); @@ -513,7 +514,7 @@ public void testNodeWithBltIsNotAllowedToJoinClusterDuringFirstActivation() thro GridTestUtils.runAsync( () -> { try { - nodeA.cluster().active(true); + nodeA.cluster().state(ClusterState.ACTIVE); } catch (Exception e) { log.warning("Exception during activation", e); @@ -550,7 +551,7 @@ public void testNewNodeJoinsToActiveCluster() throws Exception { Ignite nodeB = startGridWithConsistentId("B"); Ignite nodeC = startGridWithConsistentId("C"); - nodeC.cluster().active(true); + nodeC.cluster().state(ClusterState.ACTIVE); BaselineTopologyVerifier verifier1 = new BaselineTopologyVerifier() { @Override public void verify(BaselineTopology blt) { @@ -570,7 +571,7 @@ public void testNewNodeJoinsToActiveCluster() throws Exception { nodeD = startGridWithConsistentId("D"); - assertFalse(nodeD.cluster().active()); + assertFalse(nodeD.cluster().state().active()); verifyBaselineTopologyOnNodes(verifier1, new Ignite[] {nodeD}); } @@ -599,7 +600,7 @@ public void testRemoveNodeFromBaselineTopology() throws Exception { Ignite nodeC = startGridWithConsistentId("C"); nodeA.cluster().baselineAutoAdjustEnabled(false); - nodeC.cluster().active(true); + nodeC.cluster().state(ClusterState.ACTIVE); stopGrid("B", false); @@ -607,7 +608,7 @@ public void testRemoveNodeFromBaselineTopology() throws Exception { boolean activated = GridTestUtils.waitForCondition(new GridAbsPredicate() { @Override public boolean apply() { - return grid("A").active(); + return grid("A").cluster().state().active(); } }, 10_000); @@ -622,7 +623,7 @@ public void testRemoveNodeFromBaselineTopology() throws Exception { activated = GridTestUtils.waitForCondition(new GridAbsPredicate() { @Override public boolean apply() { - return grid("A").active(); + return grid("A").cluster().state().active(); } }, 10_000); @@ -655,7 +656,7 @@ public void testAddNodeToBaselineTopology() throws Exception { Ignite nodeC = startGridWithConsistentId("C"); nodeA.cluster().baselineAutoAdjustEnabled(false); - nodeC.cluster().active(true); + nodeC.cluster().state(ClusterState.ACTIVE); IgniteEx nodeD = (IgniteEx)startGridWithConsistentId("D"); @@ -680,7 +681,7 @@ public void testRemoveBaselineTopology() throws Exception { Ignite nodeC = startGridWithConsistentId("C"); nodeA.cluster().baselineAutoAdjustEnabled(false); - nodeA.cluster().active(true); + nodeA.cluster().state(ClusterState.ACTIVE); nodeA.cluster().setBaselineTopology(null); @@ -742,11 +743,11 @@ public void testActivationHashIsNotUpdatedOnMultipleActivationRequests() throws Ignite nodeA = startGridWithConsistentId("A"); - nodeA.cluster().active(true); + nodeA.cluster().state(ClusterState.ACTIVE); Ignite nodeB = startGridWithConsistentId("B"); - nodeA.cluster().active(true); + nodeA.cluster().state(ClusterState.ACTIVE); verifyBaselineTopologyOnNodes(verifier, new Ignite[] {nodeA, nodeB}); } @@ -769,7 +770,7 @@ public void testAutoActivationSimple() throws Exception { IgniteEx srv = grid(0); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); createAndFillCache(srv); @@ -784,7 +785,7 @@ public void testAutoActivationSimple() throws Exception { boolean clusterActive = GridTestUtils.waitForCondition( new GridAbsPredicate() { @Override public boolean apply() { - return ig.cluster().active(); + return ig.cluster().state().active(); } }, 10_000); @@ -803,21 +804,21 @@ public void testNoAutoActivationOnJoinNewNodeToInactiveCluster() throws Exceptio IgniteEx srv = grid(0); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); - assertTrue(srv.cluster().active()); + assertTrue(srv.cluster().state().active()); - srv.cluster().active(false); + srv.cluster().state(ClusterState.INACTIVE); - assertFalse(srv.cluster().active()); + assertFalse(srv.cluster().state().active()); startGrid(2); Thread.sleep(3_000); - assertFalse(srv.cluster().active()); + assertFalse(srv.cluster().state().active()); } /** @@ -829,13 +830,13 @@ public void testBaselineTopologyRemainsTheSameOnClusterDeactivation() throws Exc IgniteEx srv = grid(0); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); - assertTrue(srv.cluster().active()); + assertTrue(srv.cluster().state().active()); - srv.cluster().active(false); + srv.cluster().state(ClusterState.INACTIVE); BaselineTopology blt = getBaselineTopology(srv); @@ -878,7 +879,7 @@ public void testBaselineHistorySyncWithNewNode() throws Exception { startGridWithConsistentId("C"); nodeA.cluster().baselineAutoAdjustEnabled(false); - nodeA.cluster().active(true); + nodeA.cluster().state(ClusterState.ACTIVE); stopGrid("C", false); @@ -931,7 +932,7 @@ public void testBaselineHistorySyncWithOldNodeWithCompatibleHistory() throws Exc startGridWithConsistentId("C"); nodeA.cluster().baselineAutoAdjustEnabled(false); - nodeA.cluster().active(true); + nodeA.cluster().state(ClusterState.ACTIVE); stopGrid("C", false); @@ -960,11 +961,11 @@ public void testBaselineNotDeletedOnDeactivation() throws Exception { startGridWithConsistentId("B"); startGridWithConsistentId("C"); - nodeA.cluster().active(true); + nodeA.cluster().state(ClusterState.ACTIVE); assertNotNull(nodeA.cluster().currentBaselineTopology()); - nodeA.cluster().active(false); + nodeA.cluster().state(ClusterState.INACTIVE); stopAllGrids(); @@ -977,7 +978,7 @@ public void testBaselineNotDeletedOnDeactivation() throws Exception { boolean clusterActive = GridTestUtils.waitForCondition( new GridAbsPredicate() { @Override public boolean apply() { - return ig.cluster().active(); + return ig.cluster().state().active(); } }, 10_000); @@ -1000,7 +1001,7 @@ public void testNodeWithBltIsProhibitedToJoinNewCluster() throws Exception { Ignite nodeC = startGridWithConsistentId("C"); - nodeC.cluster().active(true); + nodeC.cluster().state(ClusterState.ACTIVE); stopGrid("C", false); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteDataStorageMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteDataStorageMetricsSelfTest.java index abe7ebd28265a..88002b9eddb9b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteDataStorageMetricsSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteDataStorageMetricsSelfTest.java @@ -38,6 +38,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -202,7 +203,7 @@ private CacheConfiguration cacheConfiguration( public void testPersistenceMetrics() throws Exception { final IgniteEx ig = startGrid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); try { IgniteCache cache = ig.cache("cache"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteLostPartitionsOnLeaveBaselineSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteLostPartitionsOnLeaveBaselineSelfTest.java index 2d1f5ce3cdfee..0e9b9a1800c05 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteLostPartitionsOnLeaveBaselineSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteLostPartitionsOnLeaveBaselineSelfTest.java @@ -21,6 +21,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.PartitionLossPolicy; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -136,7 +137,7 @@ public void testLostPartitionsOnLeaveBaseline() throws Exception { final IgniteEx gridFirst = startGrid(0); startGrid(1); - gridFirst.cluster().active(true); + gridFirst.cluster().state(ClusterState.ACTIVE); gridFirst.getOrCreateCaches(Arrays.asList( cacheConfiguration("cache-no-persistence", PARTITIONED, ATOMIC, "no-persistence"), diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataAsyncWritingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataAsyncWritingTest.java index c1d5f9e958c94..1eefddc078163 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataAsyncWritingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataAsyncWritingTest.java @@ -136,7 +136,7 @@ public void testNodeJoinIsNotBlockedByAsyncMetaWriting() throws Exception { final CountDownLatch fileWriteLatch = initSlowFileIOFactory(); Ignite ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.cache(DEFAULT_CACHE_NAME); GridTestUtils.runAsync(() -> cache.put(0, new TestAddress(0, "USA", "NYC", "Park Ave"))); @@ -159,7 +159,7 @@ public void testBinaryMetadataIsRestoredAfterDeletionOnNodeJoin() throws Excepti IgniteEx ig0 = startGrid(0); IgniteEx ig1 = startGrid(1); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig0.cache(DEFAULT_CACHE_NAME); int key = findAffinityKeyForNode(ig0.affinity(DEFAULT_CACHE_NAME), ig1.localNode()); @@ -190,7 +190,7 @@ public void testThreadRequestingUpdateBlockedTillWriteCompletion() throws Except Ignite ig = startGrid(); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.cache(DEFAULT_CACHE_NAME); @@ -212,7 +212,7 @@ public void testDiscoveryIsNotBlockedOnMetadataWrite() throws Exception { IgniteKernal ig = (IgniteKernal)startGrid(); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.cache(DEFAULT_CACHE_NAME); @@ -285,7 +285,7 @@ public void testParallelUpdatesToBinaryMetadata() throws Exception { specialFileIOFactory = null; IgniteEx ig2 = startGrid(2); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); int key0 = findAffinityKeyForNode(ig0.affinity(DEFAULT_CACHE_NAME), ig1.localNode()); int key1 = findAffinityKeyForNode(ig0.affinity(DEFAULT_CACHE_NAME), ig1.localNode(), key0); @@ -349,7 +349,7 @@ public void testPutRequestFromClientIsBlockedIfBinaryMetaWriteIsHanging() throws startGrid(2); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = cl0.createCache(testCacheCfg); int key0 = findAffinityKeyForNode(ig0.affinity(cacheName), ig0.localNode()); @@ -404,7 +404,7 @@ public void testPutRequestFromClientCompletesIfMetadataWriteHangOnBackup() throw specialFileIOFactory = null; IgniteEx ig2 = startGrid(2); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteEx cl0 = startGrid("client0"); @@ -510,7 +510,7 @@ private void putRequestFromServer(boolean expectedBlocked) throws Exception { specialFileIOFactory = null; startGrid(3); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig0.createCache(testCacheCfg); int key = 0; diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataOnClusterRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataOnClusterRestartTest.java index f5573749e5ea8..3c086b64bbe19 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataOnClusterRestartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataOnClusterRestartTest.java @@ -33,6 +33,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.affinity.AffinityKeyMapped; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -120,7 +121,7 @@ public void testUpdatedBinaryMetadataIsPreservedOnJoinToOldCoordinator() throws Ignite ignite0 = startGridInASeparateWorkDir("A"); Ignite ignite1 = startGridInASeparateWorkDir("B"); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = ignite0.cache(CACHE_NAME); @@ -175,7 +176,7 @@ public void testNewBinaryMetadataIsWrittenOnOldCoordinator() throws Exception { Ignite ignite0 = startGridInASeparateWorkDir("A"); Ignite ignite1 = startGridInASeparateWorkDir("B"); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = ignite0.cache(CACHE_NAME); @@ -233,7 +234,7 @@ public void testNewBinaryMetadataIsPropagatedToAllOutOfDataNodes() throws Except Ignite igniteC = startGridInASeparateWorkDir("C"); startGridInASeparateWorkDir("D"); - igniteA.active(true); + igniteA.cluster().state(ClusterState.ACTIVE); BinaryObject bObj0 = igniteA.binary() .builder(DYNAMIC_TYPE_NAME).setField(DYNAMIC_INT_FIELD_NAME, 10).build(); @@ -269,7 +270,7 @@ public void testNewBinaryMetadataIsPropagatedToAllOutOfDataNodes() throws Except Ignite igniteB = startGridInASeparateWorkDir("B"); - igniteB.active(true); + igniteB.cluster().state(ClusterState.ACTIVE); bObj1 = (BinaryObject)igniteB.cache(CACHE_NAME).withKeepBinary().get(1); @@ -304,7 +305,7 @@ public void testNodeWithIncompatibleMetadataIsProhibitedToJoinTheCluster() throw String bConsId = igniteB.cluster().localNode().consistentId().toString(); - igniteA.active(true); + igniteA.cluster().state(ClusterState.ACTIVE); IgniteCache cache = igniteA.cache(CACHE_NAME); @@ -319,7 +320,7 @@ public void testNodeWithIncompatibleMetadataIsProhibitedToJoinTheCluster() throw Ignite igniteC = startGridInASeparateWorkDir("C"); String cConsId = igniteC.cluster().localNode().consistentId().toString(); - igniteC.active(true); + igniteC.cluster().state(ClusterState.ACTIVE); cache = igniteC.cache(CACHE_NAME); bObj = igniteC.binary().builder(DYNAMIC_TYPE_NAME).setField(decimalFieldName, 10L).build(); @@ -390,7 +391,7 @@ public void testStaticMetadataIsRestoredOnRestart() throws Exception { Ignite ignite0 = grid(0); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = ignite0.cache(CACHE_NAME); @@ -403,7 +404,7 @@ public void testStaticMetadataIsRestoredOnRestart() throws Exception { ignite0 = grid(0); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); examineStaticMetadata(2); @@ -465,7 +466,7 @@ public void testDynamicMetadataIsRestoredOnRestart() throws Exception { Ignite ignite0 = grid(0); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = ignite0.cache(CACHE_NAME); @@ -485,7 +486,7 @@ public void testDynamicMetadataIsRestoredOnRestart() throws Exception { ignite0 = grid(0); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); examineDynamicMetadata(2, contentExaminer0, structureExaminer0); @@ -508,7 +509,7 @@ public void testDynamicMetadataIsRestoredOnRestart() throws Exception { ignite0 = grid(0); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); examineDynamicMetadata(2, contentExaminer0, contentExaminer1, structureExaminer1); @@ -528,7 +529,7 @@ public void testDynamicMetadataIsRestoredOnRestart() throws Exception { public void testBinaryEnumMetadataIsRestoredOnRestart() throws Exception { Ignite ignite0 = startGrids(2); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); BinaryObject enumBo0 = ignite0.binary().buildEnum(EnumType.class.getName(), 0); @@ -538,7 +539,7 @@ public void testBinaryEnumMetadataIsRestoredOnRestart() throws Exception { ignite0 = startGrids(2); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); startGrid(2); @@ -550,7 +551,7 @@ public void testBinaryEnumMetadataIsRestoredOnRestart() throws Exception { ignite0 = startGrids(3); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); startClientGrid(3); @@ -569,7 +570,7 @@ public void testMixedMetadataIsRestoredOnRestart() throws Exception { // Examines all objects in cache (field values and metadata). Ignite ignite0 = startGrid(0); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = ignite0.cache(CACHE_NAME); @@ -606,7 +607,7 @@ public void testMixedMetadataIsRestoredOnRestart() throws Exception { startGrids(4); - grid(0).active(true); + grid(0).cluster().state(ClusterState.ACTIVE); examineStaticMetadata(4); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinarySortObjectFieldsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinarySortObjectFieldsTest.java index bccad9dc0380f..b3d2e60a4cf15 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinarySortObjectFieldsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinarySortObjectFieldsTest.java @@ -21,6 +21,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -81,7 +82,7 @@ public class IgnitePdsBinarySortObjectFieldsTest extends GridCommonAbstractTest public void testGivenCacheWithPojoValueAndPds_WhenPut_ThenNoHangup() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); final IgniteCache cache = ignite.getOrCreateCache( new CacheConfiguration(CACHE_NAME) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheConfigurationFileConsistencyCheckTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheConfigurationFileConsistencyCheckTest.java index 05d858088acb3..8bd1ea1ccee8d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheConfigurationFileConsistencyCheckTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheConfigurationFileConsistencyCheckTest.java @@ -28,6 +28,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -100,7 +101,7 @@ public class IgnitePdsCacheConfigurationFileConsistencyCheckTest extends GridCom public void testStartDuplicatedCacheConfigurations() throws Exception { IgniteEx ig0 = (IgniteEx)startGrids(NODES); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); startCaches(ig0); @@ -128,7 +129,7 @@ public void testStartDuplicatedCacheConfigurations() throws Exception { public void testTmpCacheConfigurationsDelete() throws Exception { IgniteEx ig0 = (IgniteEx)startGrids(NODES); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); startCaches(ig0); @@ -168,7 +169,7 @@ public void testTmpCacheConfigurationsDelete() throws Exception { public void testCorruptedCacheConfigurationsValidation() throws Exception { IgniteEx ig0 = (IgniteEx)startGrids(NODES); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); startCaches(ig0); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheEntriesExpirationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheEntriesExpirationTest.java index 986c680452c99..d1437d4fba3ae 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheEntriesExpirationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheEntriesExpirationTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -128,7 +129,7 @@ public void testDeadlockBetweenCachePutAndEntryExpiration() throws Exception { IgniteEx srv0 = startGrids(2); - srv0.cluster().active(true); + srv0.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheObjectBinaryProcessorOnDiscoveryTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheObjectBinaryProcessorOnDiscoveryTest.java index d0a5822f57207..2af1ffae90cc3 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheObjectBinaryProcessorOnDiscoveryTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheObjectBinaryProcessorOnDiscoveryTest.java @@ -21,6 +21,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.binary.BinaryObject; import org.apache.ignite.binary.BinaryObjectBuilder; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -68,7 +69,7 @@ public class IgnitePdsCacheObjectBinaryProcessorOnDiscoveryTest extends GridComm public void testJoiningNodeBinaryMetaOnClient() throws Exception { IgniteEx ig0 = (IgniteEx)startGrids(2); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); addBinaryType(ig0, "test_1", new IgniteBiTuple<>("name", String.class)); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheRebalancingAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheRebalancingAbstractTest.java index 9f898d0e5846e..e64cef9186973 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheRebalancingAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheRebalancingAbstractTest.java @@ -47,6 +47,7 @@ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.ScanQuery; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -232,7 +233,7 @@ public void testRebalancingOnRestart() throws Exception { IgniteEx ignite2 = startGrid(2); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -285,7 +286,7 @@ public void testRebalancingOnRestartAfterCheckpoint() throws Exception { IgniteEx ignite2 = startGrid(2); IgniteEx ignite3 = startGrid(3); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -355,7 +356,7 @@ public void testTopologyChangesWithConstantLoad() throws Exception { Ignite ignite = startGridsMultiThreaded(4); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); try (IgniteDataStreamer ds = ignite.dataStreamer(INDEXED_CACHE)) { for (int i = 0; i < entriesCnt; i++) { @@ -563,7 +564,7 @@ private void testForceRebalance(String cacheName) throws Exception { final Ignite ig = grid(1); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -603,7 +604,7 @@ private void testForceRebalance(String cacheName) throws Exception { public void testPartitionCounterConsistencyOnUnstableTopology() throws Exception { Ignite ig = startGridsMultiThreaded(4); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); int keys = 0; @@ -694,7 +695,7 @@ public void testRebalancingWithMixedDataRegionConfigurations() throws Exception Ignite ignite0 = startGrids(2); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cachePds = ignite0.cache(INDEXED_CACHE); IgniteCache cacheInMem = ignite0.cache(INDEXED_CACHE_IN_MEMORY); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheStartStopWithFreqCheckpointTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheStartStopWithFreqCheckpointTest.java index 36096c7374f0a..b6c77577ed397 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheStartStopWithFreqCheckpointTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheStartStopWithFreqCheckpointTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.CacheRebalanceMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -118,7 +119,7 @@ private CacheConfiguration cacheConfiguration(int cacheIdx) { public void testCheckpointDeadlock() throws Exception { IgniteEx crd = startGrid(0); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); for (int cacheId = 0; cacheId < CACHES; cacheId++) { IgniteCache cache = crd.getOrCreateCache(CACHE_NAME + cacheId); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsConsistencyOnDelayedPartitionOwning.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsConsistencyOnDelayedPartitionOwning.java index 67bb330de840a..8e6c559db25af 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsConsistencyOnDelayedPartitionOwning.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsConsistencyOnDelayedPartitionOwning.java @@ -25,6 +25,7 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -113,7 +114,7 @@ public class IgnitePdsConsistencyOnDelayedPartitionOwning extends GridCommonAbst @Test public void checkConsistencyNodeLeft() throws Exception { IgniteEx crd = (IgniteEx)startGridsMultiThreaded(4); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); for (int i = 0; i < PARTS; i++) crd.cache(DEFAULT_CACHE_NAME).put(i, i); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsContinuousRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsContinuousRestartTest.java index e895d1081bbbe..5d521574703f1 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsContinuousRestartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsContinuousRestartTest.java @@ -31,6 +31,7 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.cluster.ClusterTopologyException; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -268,7 +269,7 @@ private void checkRebalancingDuringLoad( final IgniteEx load = ignite(0); - load.cluster().active(true); + load.cluster().state(ClusterState.ACTIVE); try (IgniteDataStreamer s = load.dataStreamer(CACHE_NAME)) { s.allowOverwrite(true); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCorruptedIndexTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCorruptedIndexTest.java index f8dd4bd0e68b3..31d23a201a53c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCorruptedIndexTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCorruptedIndexTest.java @@ -33,6 +33,7 @@ import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.cache.query.SqlQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -145,7 +146,7 @@ public void testCorruption() throws Exception { startGrid(2); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -177,7 +178,7 @@ public void testCorruption() throws Exception { corruptedNode = (IgniteEx)startGrid(corruptedNodeName); - corruptedNode.cluster().active(true); + corruptedNode.cluster().state(ClusterState.ACTIVE); // Not all owners have been returned, data loss is expected. assertFalse(grid(0).cache(CACHE).lostPartitions().isEmpty()); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCorruptedStoreTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCorruptedStoreTest.java index f4fc049a36e59..265e62de5f8c7 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCorruptedStoreTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCorruptedStoreTest.java @@ -32,6 +32,7 @@ import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.ConnectorConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -164,9 +165,9 @@ public void testWrongPageCRC() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); stopGrid(0); @@ -180,7 +181,7 @@ public void testWrongPageCRC() throws Exception { try { startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); } catch (Exception e) { // No-op. @@ -196,7 +197,7 @@ public void testWrongPageCRC() throws Exception { public void testMetaStorageCorruption() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); MetaStorage metaStorage = ignite.context().cache().context().database().metaStorage(); @@ -208,7 +209,7 @@ public void testMetaStorageCorruption() throws Exception { try { startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); } catch (Exception e) { // No-op. @@ -224,7 +225,7 @@ public void testMetaStorageCorruption() throws Exception { public void testCacheMetaCorruption() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteInternalCache cache = ignite.cachex(CACHE_NAME1); @@ -236,14 +237,14 @@ public void testCacheMetaCorruption() throws Exception { corruptTreeRoot(ignite, (PageMemoryEx)cache.context().dataRegion().pageMemory(), grpId, partId); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); stopGrid(0); try { startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache.put(1, 1); } @@ -308,13 +309,13 @@ public void testReadOnlyMetaStore() throws Exception { return null; }); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteInternalCache cache = ignite0.cachex(CACHE_NAME1); cache.put(1, 1); - ignite0.cluster().active(false); + ignite0.cluster().state(ClusterState.INACTIVE); FilePageStoreManager storeMgr = ((FilePageStoreManager)ignite0.context().cache().context().pageStore()); @@ -327,7 +328,7 @@ public void testReadOnlyMetaStore() throws Exception { IgniteInternalFuture fut = GridTestUtils.runAsync(new Runnable() { @Override public void run() { try { - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); } catch (Exception ignore) { // No-op. @@ -347,7 +348,7 @@ public void testReadOnlyMetaStore() throws Exception { public void testCheckpointFailure() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); forceCheckpoint(); // Trigger empty checkpoint to make sure initial checkpoint on node start will finish. @@ -409,7 +410,7 @@ public void testCheckpointFailure() throws Exception { public void testWalFsyncWriteHeaderFailure() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.cache(CACHE_NAME1).put(0, 0); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDestroyCacheAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDestroyCacheAbstractTest.java index 55e1f02e139b7..f781e34ac40a8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDestroyCacheAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDestroyCacheAbstractTest.java @@ -25,6 +25,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -118,7 +119,7 @@ protected void checkDestroyCaches(Ignite ignite) throws Exception { ignite = startGrids(NODES); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); log.warning("Grid started"); @@ -153,7 +154,7 @@ protected void checkDestroyCachesAbruptly(Ignite ignite) throws Exception { ignite = startGrids(NODES); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); log.warning("Grid started"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDestroyCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDestroyCacheTest.java index 8dbf1508f1112..276570fd7312e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDestroyCacheTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDestroyCacheTest.java @@ -69,7 +69,7 @@ public class IgnitePdsDestroyCacheTest extends IgnitePdsDestroyCacheAbstractTest public void testDestroyCaches() throws Exception { Ignite ignite = startGrids(NODES); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); startCachesDynamically(ignite); @@ -85,7 +85,7 @@ public void testDestroyCaches() throws Exception { public void testDestroyGroupCaches() throws Exception { Ignite ignite = startGrids(NODES); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); startGroupCachesDynamically(ignite); @@ -102,7 +102,7 @@ public void testDestroyGroupCaches() throws Exception { public void testDestroyCachesAbruptly() throws Exception { Ignite ignite = startGrids(NODES); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); startCachesDynamically(ignite); @@ -119,7 +119,7 @@ public void testDestroyCachesAbruptly() throws Exception { public void testDestroyGroupCachesAbruptly() throws Exception { Ignite ignite = startGrids(NODES); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); startGroupCachesDynamically(ignite); @@ -140,7 +140,7 @@ public void testDestroyCacheOperationNotBlockingCheckpointTest() throws Exceptio private void doTestDestroyCacheOperationNotBlockingCheckpointTest() throws Exception { final IgniteEx ignite = startGrids(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); startGroupCachesDynamically(ignite); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDestroyCacheWithoutCheckpointsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDestroyCacheWithoutCheckpointsTest.java index 5119af88e0a87..96a3b50fff76c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDestroyCacheWithoutCheckpointsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDestroyCacheWithoutCheckpointsTest.java @@ -19,6 +19,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.util.typedef.G; import org.junit.Test; @@ -44,7 +45,7 @@ public class IgnitePdsDestroyCacheWithoutCheckpointsTest extends IgnitePdsDestro public void testDestroyCachesAbruptlyWithoutCheckpoints() throws Exception { Ignite ignite = startGrids(NODES); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); startCachesDynamically(ignite); @@ -62,7 +63,7 @@ public void testDestroyCachesAbruptlyWithoutCheckpoints() throws Exception { public void testDestroyGroupCachesAbruptlyWithoutCheckpoints() throws Exception { Ignite ignite = startGrids(NODES); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); startGroupCachesDynamically(ignite); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDiscoDataHandlingInNewClusterTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDiscoDataHandlingInNewClusterTest.java index f5ce76d372067..2661eca7b7db9 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDiscoDataHandlingInNewClusterTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDiscoDataHandlingInNewClusterTest.java @@ -23,6 +23,7 @@ import org.apache.ignite.cache.affinity.AffinityFunction; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -134,7 +135,7 @@ public void testNewDynamicCacheDoesntStartOnOldNode() throws Exception { startGrid(NODE_CONS_ID_1); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); startDynamicCache(ig0, DYNAMIC_CACHE_NAME_0, MIXED_CACHES_GROUP_NAME_0); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDynamicCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDynamicCacheTest.java index 78f2015d498d6..eb3ed130cb145 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDynamicCacheTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDynamicCacheTest.java @@ -25,6 +25,7 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -86,7 +87,7 @@ public void testRestartAndCreate() throws Exception { Ignite ignite = ignite(0); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); CacheConfiguration ccfg1 = new CacheConfiguration(); @@ -129,7 +130,7 @@ public void testRestartAndCreate() throws Exception { ignite = ignite(0); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.getOrCreateCache(ccfg1); @@ -150,7 +151,7 @@ public void testRestartAndCreate() throws Exception { public void testDynamicCacheSavingOnNewNode() throws Exception { Ignite ignite = startGrid(0); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); @@ -178,7 +179,7 @@ public void testDynamicCacheSavingOnNewNode() throws Exception { startGrid(0); ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache = ignite.cache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsExchangeDuringCheckpointTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsExchangeDuringCheckpointTest.java index 08505deab18b2..30bb164d0163a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsExchangeDuringCheckpointTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsExchangeDuringCheckpointTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal.processors.cache.persistence; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -43,7 +44,7 @@ public void testExchangeOnNodeLeft() throws Exception { for (int i = 0; i < SF.applyLB(5, 2); i++) { startGrids(3); IgniteEx ignite = grid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -65,7 +66,7 @@ public void testExchangeOnNodeJoin() throws Exception { for (int i = 0; i < SF.applyLB(5, 2); i++) { startGrids(2); IgniteEx ignite = grid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsMarshallerMappingRestoreOnNodeStartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsMarshallerMappingRestoreOnNodeStartTest.java index 09fc575a5a43d..019d8902d3be8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsMarshallerMappingRestoreOnNodeStartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsMarshallerMappingRestoreOnNodeStartTest.java @@ -22,6 +22,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.AffinityKeyMapped; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -75,7 +76,7 @@ public void testStaticMetadataIsRestoredOnRestart() throws Exception { Ignite ignite0 = grid(0); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = ignite0.cache(DEFAULT_CACHE_NAME); @@ -87,7 +88,7 @@ public void testStaticMetadataIsRestoredOnRestart() throws Exception { ignite0 = grid(0); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); Ignite ignite1 = startGrid(1); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsNoSpaceLeftOnDeviceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsNoSpaceLeftOnDeviceTest.java index 866cf221fb062..91dbade7f4aeb 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsNoSpaceLeftOnDeviceTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsNoSpaceLeftOnDeviceTest.java @@ -23,6 +23,7 @@ import java.util.concurrent.atomic.AtomicReference; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -89,7 +90,7 @@ public void testWhileWritingBinaryMetadataFile() throws Exception { FailingFileIOFactory.setUnluckyConsistentId(ignite1.localNode().consistentId().toString()); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); final IgniteCache cache = ignite0.cache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPageSizesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPageSizesTest.java index d8750cf61bcd3..25e5de6cf8321 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPageSizesTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPageSizesTest.java @@ -23,6 +23,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -130,7 +131,7 @@ private void checkPageSize(int pageSize) throws Exception { IgniteEx ignite = startGrid(0); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); try { final IgniteCache cache = ignite.cache(cacheName); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPartitionFilesDestroyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPartitionFilesDestroyTest.java index 07b0ab40f55bf..4beaabdcbacb8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPartitionFilesDestroyTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPartitionFilesDestroyTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -149,7 +150,7 @@ public void testPartitionFileDestroyAfterCheckpoint() throws Exception { IgniteEx crd = (IgniteEx)startGrids(2); crd.cluster().baselineAutoAdjustEnabled(false); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); int keysCnt = 50_000; @@ -186,7 +187,7 @@ public void testPartitionFileDestroyAndRecreate() throws Exception { IgniteEx node = startGrid(1); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); int keysCnt = 50_000; @@ -240,7 +241,7 @@ public void testPartitionFileDestroyCrashRecovery1() throws Exception { failFileIo = false; - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); int keysCnt = 50_000; @@ -300,7 +301,7 @@ public void testPartitionFileDestroyCrashRecovery2() throws Exception { failFileIo = false; - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); int keysCnt = 50_000; @@ -360,7 +361,7 @@ public void testPartitionFileDestroyCrashRecovery2() throws Exception { public void testDestroyWhenPartitionsAreEmpty() throws Exception { IgniteEx crd = (IgniteEx)startGrids(2); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); forceCheckpoint(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPartitionsStateRecoveryTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPartitionsStateRecoveryTest.java index 40c8a985c7d19..8bf714f953751 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPartitionsStateRecoveryTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPartitionsStateRecoveryTest.java @@ -22,6 +22,7 @@ import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -103,7 +104,7 @@ public class IgnitePdsPartitionsStateRecoveryTest extends GridCommonAbstractTest public void testPartitionsStateConsistencyAfterRecovery() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache(DEFAULT_CACHE_NAME); @@ -147,7 +148,7 @@ public void testPartitionsStateConsistencyAfterRecoveryNoCheckpoints() throws Ex IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRemoveDuringRebalancingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRemoveDuringRebalancingTest.java index 12a8ff1afc9b4..b536f1360812d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRemoveDuringRebalancingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRemoveDuringRebalancingTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -93,7 +94,7 @@ public class IgnitePdsRemoveDuringRebalancingTest extends GridCommonAbstractTest public void testRemovesDuringRebalancing() throws Exception { IgniteEx ig = startGrid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); try (IgniteDataStreamer streamer = ig.dataStreamer(DEFAULT_CACHE_NAME)) { streamer.allowOverwrite(true); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRestartAfterFailedToWriteMetaPageTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRestartAfterFailedToWriteMetaPageTest.java index 6dabad9383826..8ad6295d242c9 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRestartAfterFailedToWriteMetaPageTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRestartAfterFailedToWriteMetaPageTest.java @@ -27,6 +27,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -101,7 +102,7 @@ public void test() throws Exception { startGrid(1); - grid.cluster().active(true); + grid.cluster().state(ClusterState.ACTIVE); AtomicBoolean stop = new AtomicBoolean(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsSporadicDataRecordsOnBackupTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsSporadicDataRecordsOnBackupTest.java index 96899adc2f0df..18b2dbd8b4bbc 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsSporadicDataRecordsOnBackupTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsSporadicDataRecordsOnBackupTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -116,7 +117,7 @@ public void testSporadicDataRecordsOnBackup() throws Exception { IgniteEx ig0 = startGrid(0); IgniteEx ig1 = startGrid(1); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); String nodeFolderName0 = ig0.context().pdsFolderResolver().resolveFolders().folderName(); String nodeFolderName1 = ig1.context().pdsFolderResolver().resolveFolders().folderName(); @@ -134,7 +135,7 @@ public void testSporadicDataRecordsOnBackup() throws Exception { txLoadFut.get(); - grid(0).cluster().active(false); + grid(0).cluster().state(ClusterState.INACTIVE); stopAllGrids(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsSpuriousRebalancingOnNodeJoinTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsSpuriousRebalancingOnNodeJoinTest.java index c7df91860580c..dcca834d74c5e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsSpuriousRebalancingOnNodeJoinTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsSpuriousRebalancingOnNodeJoinTest.java @@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -98,7 +99,7 @@ public void testNoSpuriousRebalancing() throws Exception { try { IgniteEx crd = startGrids(2); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); crd.cluster().baselineAutoAdjustEnabled(false); List moving = movingKeysAfterJoin(crd, DEFAULT_CACHE_NAME, 10); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsTaskCancelingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsTaskCancelingTest.java index a76282126b4d0..39263752079da 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsTaskCancelingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsTaskCancelingTest.java @@ -30,6 +30,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCountDownLatch; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -123,7 +124,7 @@ public void testFailNodesOnCanceledTask() throws Exception { try { Ignite ig0 = startGrids(4); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); Collection cancelFutures = new ArrayList<>(NUM_TASKS); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreCacheGroupsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreCacheGroupsTest.java index 5bd211c252001..e08dcbb476f4e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreCacheGroupsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreCacheGroupsTest.java @@ -33,6 +33,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.query.SqlQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -174,7 +175,7 @@ public void testClusterRestartCachesWithH2Indexes() throws Exception { Ignite node = ignite(0); - node.active(true); + node.cluster().state(ClusterState.ACTIVE); node.createCaches(Arrays.asList(ccfgs1)); @@ -189,7 +190,7 @@ public void testClusterRestartCachesWithH2Indexes() throws Exception { node = ignite(0); - node.active(true); + node.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -234,7 +235,7 @@ public void testExpiryPolicy() throws Exception { Ignite node = ignite(0); - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); node.createCaches(Arrays.asList(ccfgs1)); @@ -268,7 +269,7 @@ public void testExpiryPolicy() throws Exception { node = ignite(0); - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); for (String cacheName : caches) { IgniteCache cache = node.cache(cacheName); @@ -297,7 +298,7 @@ public void testCreateDropCache() throws Exception { Ignite ignite = startGrid(); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.cache("c1").destroy(); @@ -315,7 +316,7 @@ public void testCreateDropCache1() throws Exception { Ignite ignite = startGrid(); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.createCaches(Arrays.asList(ccfg1, ccfg2)); @@ -342,7 +343,7 @@ public void testCreateDropCache2() throws Exception { Ignite ignite = startGrid(); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.createCaches(Arrays.asList(ccfg1, ccfg2)); @@ -426,7 +427,7 @@ private void clusterRestart(int nodes, boolean staticCaches) throws Exception { Ignite node = ignite(0); - node.active(true); + node.cluster().state(ClusterState.ACTIVE); if (!staticCaches) node.createCaches(Arrays.asList(ccfgs)); @@ -447,7 +448,7 @@ private void clusterRestart(int nodes, boolean staticCaches) throws Exception { node = startGrids(nodes); - node.active(true); + node.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreDataStructuresTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreDataStructuresTest.java index 4787031040f06..a4348eec021c4 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreDataStructuresTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreDataStructuresTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.IgniteQueue; import org.apache.ignite.IgniteSemaphore; import org.apache.ignite.IgniteSet; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CollectionConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -89,7 +90,7 @@ public class IgnitePersistentStoreDataStructuresTest extends GridCommonAbstractT public void testQueue() throws Exception { Ignite ignite = startGrids(4); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteQueue queue = ignite.queue("testQueue", 100, new CollectionConfiguration()); @@ -100,7 +101,7 @@ public void testQueue() throws Exception { ignite = startGrids(4); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); queue = ignite.queue("testQueue", 0, null); @@ -115,7 +116,7 @@ public void testQueue() throws Exception { public void testAtomic() throws Exception { Ignite ignite = startGrids(4); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteAtomicLong atomicLong = ignite.atomicLong("testLong", 0, true); @@ -126,7 +127,7 @@ public void testAtomic() throws Exception { ignite = startGrids(4); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); atomicLong = ignite.atomicLong("testLong", 0, false); @@ -141,7 +142,7 @@ public void testAtomic() throws Exception { public void testSequence() throws Exception { Ignite ignite = startGrids(4); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteAtomicSequence sequence = ignite.atomicSequence("testSequence", 0, true); @@ -157,7 +158,7 @@ public void testSequence() throws Exception { ignite = startGrids(4); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); sequence = ignite.atomicSequence("testSequence", 0, false); @@ -175,7 +176,7 @@ public void testSequenceAfterAutoactivation() throws Exception { Ignite ignite = startGrids(2); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.atomicSequence(seqName, 0, true); @@ -216,7 +217,7 @@ public void testSequenceAfterAutoactivation() throws Exception { public void testSet() throws Exception { Ignite ignite = startGrids(4); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteSet set = ignite.set("testSet", new CollectionConfiguration()); @@ -229,7 +230,7 @@ public void testSet() throws Exception { ignite = startGrids(4); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); set = ignite.set("testSet", null); @@ -248,7 +249,7 @@ public void testSet() throws Exception { public void testLockVolatility() throws Exception { Ignite ignite = startGrids(4); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteLock lock = ignite.reentrantLock("test", false, true, true); @@ -258,7 +259,7 @@ public void testLockVolatility() throws Exception { ignite = startGrids(4); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); lock = ignite.reentrantLock("test", false, true, false); @@ -272,7 +273,7 @@ public void testLockVolatility() throws Exception { public void testSemaphoreVolatility() throws Exception { Ignite ignite = startGrids(4); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteSemaphore sem = ignite.semaphore("test", 10, false, true); @@ -282,7 +283,7 @@ public void testSemaphoreVolatility() throws Exception { ignite = startGrids(4); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); sem = ignite.semaphore("test", 10, false, false); @@ -296,7 +297,7 @@ public void testSemaphoreVolatility() throws Exception { public void testLatchVolatility() throws Exception { Ignite ignite = startGrids(4); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCountDownLatch latch = ignite.countDownLatch("test", 10, false, true); @@ -306,7 +307,7 @@ public void testLatchVolatility() throws Exception { ignite = startGrids(4); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); latch = ignite.countDownLatch("test", 10, false, false); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteRebalanceScheduleResendPartitionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteRebalanceScheduleResendPartitionsTest.java index 81be10a2f590b..4ab047d747e6e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteRebalanceScheduleResendPartitionsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteRebalanceScheduleResendPartitionsTest.java @@ -30,6 +30,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -110,7 +111,7 @@ public void test() throws Exception { Ignite ig0 = startGrids(3); ig0.cluster().baselineAutoAdjustEnabled(false); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); int entries = 100_000; diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/SingleNodePersistenceSslTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/SingleNodePersistenceSslTest.java index 118d57de9a45c..42f7bd03393c4 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/SingleNodePersistenceSslTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/SingleNodePersistenceSslTest.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors.cache.persistence; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -66,8 +67,8 @@ public class SingleNodePersistenceSslTest extends GridCommonAbstractTest { */ @Test public void testActivate() throws Exception { - startGrids(2).cluster().active(true); + startGrids(2).cluster().state(ClusterState.ACTIVE); - assertTrue(grid(0).cluster().active()); + assertTrue(grid(0).cluster().state().active()); } } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/WalPreloadingConcurrentTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/WalPreloadingConcurrentTest.java index 2c88acc911cfa..89789d90b1885 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/WalPreloadingConcurrentTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/WalPreloadingConcurrentTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.CacheRebalanceMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -95,7 +96,7 @@ public final void testConcurrentReserveReleaseHistoryForPreloading() throws Exce final int entryCnt = 3200; - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteInternalCache cache = ig.cachex(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/ClientAffinityAssignmentWithBaselineTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/ClientAffinityAssignmentWithBaselineTest.java index 7ca4e9ff13c74..f4e09c09b376b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/ClientAffinityAssignmentWithBaselineTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/ClientAffinityAssignmentWithBaselineTest.java @@ -40,6 +40,7 @@ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.BaselineNode; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.cluster.ClusterTopologyException; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -282,14 +283,14 @@ private void testChangingBaselineDown(String cacheName, boolean lateActivation) client2 = startClientGrid("client2"); } else - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); AtomicBoolean stopLoad = new AtomicBoolean(false); AtomicReference loadError = new AtomicReference<>(null); if (lateActivation) - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig0.cache(cacheName); @@ -344,7 +345,7 @@ public void testRejoinWithCleanLfs() throws Exception { IgniteEx ig0 = (IgniteEx)startGrids(DEFAULT_NODES_COUNT - 1); startGrid("flaky"); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); AtomicBoolean stopLoad = new AtomicBoolean(false); @@ -411,7 +412,7 @@ public void testCrossCacheTxs() throws Exception { IgniteEx ig0 = (IgniteEx)startGrids(DEFAULT_NODES_COUNT); ig0.cluster().baselineAutoAdjustEnabled(false); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); AtomicBoolean stopLoad = new AtomicBoolean(false); @@ -473,7 +474,7 @@ public void testCrossCacheTxs() throws Exception { public void testDynamicCacheLongTransactionNodeStart() throws Exception { IgniteEx ig0 = (IgniteEx)startGrids(4); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteEx client = startClientGrid("client"); @@ -546,7 +547,7 @@ public void testDynamicCacheLongTransactionNodeStart() throws Exception { public void testDynamicCacheStartNoAffinityNodes() throws Exception { IgniteEx ig0 = startGrid(0); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteEx client = startClientGrid("client"); @@ -627,7 +628,7 @@ public void testDynamicCacheStartNoAffinityNodes() throws Exception { public void testClientJoinCacheLongTransactionNodeStart() throws Exception { IgniteEx ig0 = (IgniteEx)startGrids(4); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteEx client = startClientGrid("client"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteAbsentEvictionNodeOutOfBaselineTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteAbsentEvictionNodeOutOfBaselineTest.java index 0db24aaaf4f0a..808d65084df62 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteAbsentEvictionNodeOutOfBaselineTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteAbsentEvictionNodeOutOfBaselineTest.java @@ -21,6 +21,7 @@ import java.util.List; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -88,7 +89,7 @@ public void testPartitionsRemovedIfJoiningNodeNotInBaseline() throws Exception { Ignite ignite0 = startGrids(3); ignite0.cluster().baselineAutoAdjustEnabled(false); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite0.getOrCreateCache(TEST_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteAllBaselineNodesOnlineFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteAllBaselineNodesOnlineFullApiSelfTest.java index 8365f8724b0a0..65e7be7c1c387 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteAllBaselineNodesOnlineFullApiSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteAllBaselineNodesOnlineFullApiSelfTest.java @@ -16,6 +16,8 @@ */ package org.apache.ignite.internal.processors.cache.persistence.baseline; +import org.apache.ignite.cluster.ClusterState; + /** * Full API cache tests when all online nodes in the cluster are in BaselineTopology. */ @@ -28,7 +30,7 @@ public class IgniteAllBaselineNodesOnlineFullApiSelfTest extends IgniteBaselineA startGrids(gridCount()); - grid(0).active(true); + grid(0).cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineDownCachePutAllFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineDownCachePutAllFailoverTest.java index 3b89d312ddbbb..59c694f997bff 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineDownCachePutAllFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineDownCachePutAllFailoverTest.java @@ -23,6 +23,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.apache.ignite.cluster.BaselineNode; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -70,7 +71,7 @@ public class IgniteChangingBaselineDownCachePutAllFailoverTest extends CachePutA startGrids(GRIDS_COUNT); grid(0).cluster().baselineAutoAdjustEnabled(false); - grid(0).active(true); + grid(0).cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineDownCacheRemoveFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineDownCacheRemoveFailoverTest.java index cdb2b80d4eeca..90053e831f4d3 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineDownCacheRemoveFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineDownCacheRemoveFailoverTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cluster.BaselineNode; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -94,7 +95,7 @@ public class IgniteChangingBaselineDownCacheRemoveFailoverTest extends GridCache startGrid(GRIDS_COUNT); grid(0).cluster().baselineAutoAdjustEnabled(false); - grid(0).active(true); + grid(0).cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineUpCachePutAllFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineUpCachePutAllFailoverTest.java index d29f4c9b4dbb7..9285cae1301a1 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineUpCachePutAllFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineUpCachePutAllFailoverTest.java @@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.apache.ignite.cluster.BaselineNode; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -69,7 +70,7 @@ public class IgniteChangingBaselineUpCachePutAllFailoverTest extends CachePutAll startGrids(GRIDS_COUNT); grid(0).cluster().baselineAutoAdjustEnabled(false); - grid(0).active(true); + grid(0).cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineUpCacheRemoveFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineUpCacheRemoveFailoverTest.java index bb58a99ccd297..2b7833d9c75f2 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineUpCacheRemoveFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteChangingBaselineUpCacheRemoveFailoverTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cluster.BaselineNode; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -91,7 +92,7 @@ public class IgniteChangingBaselineUpCacheRemoveFailoverTest extends GridCacheAb startGrids(GRIDS_COUNT); - grid(0).active(true); + grid(0).cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteOfflineBaselineNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteOfflineBaselineNodeFullApiSelfTest.java index 2282165d7164f..81f105d39df23 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteOfflineBaselineNodeFullApiSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteOfflineBaselineNodeFullApiSelfTest.java @@ -16,6 +16,8 @@ */ package org.apache.ignite.internal.processors.cache.persistence.baseline; +import org.apache.ignite.cluster.ClusterState; + /** * Full API cache tests with situation when there is an offline node from BaselineTopology. */ @@ -30,7 +32,7 @@ public class IgniteOfflineBaselineNodeFullApiSelfTest extends IgniteBaselineAbst startGrid("offlineBaselineNode"); - grid(0).active(true); + grid(0).cluster().state(ClusterState.ACTIVE); stopGrid("offlineBaselineNode"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteOnlineNodeOutOfBaselineFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteOnlineNodeOutOfBaselineFullApiSelfTest.java index 3bd8c0fd51f8c..5a96edb3eddec 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteOnlineNodeOutOfBaselineFullApiSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteOnlineNodeOutOfBaselineFullApiSelfTest.java @@ -16,6 +16,8 @@ */ package org.apache.ignite.internal.processors.cache.persistence.baseline; +import org.apache.ignite.cluster.ClusterState; + /** * Full API cache tests with situation when there is an online node out of BaselineTopology. */ @@ -28,7 +30,7 @@ public class IgniteOnlineNodeOutOfBaselineFullApiSelfTest extends IgniteBaseline startGrids(gridCount()); - grid(0).active(true); + grid(0).cluster().state(ClusterState.ACTIVE); startGrid("onlineOutOfBaselineNode"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteStableBaselineCachePutAllFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteStableBaselineCachePutAllFailoverTest.java index 4acaec7c8a060..4531dfee26a24 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteStableBaselineCachePutAllFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteStableBaselineCachePutAllFailoverTest.java @@ -19,6 +19,7 @@ import java.util.concurrent.Callable; import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.atomic.AtomicBoolean; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -91,7 +92,7 @@ public class IgniteStableBaselineCachePutAllFailoverTest extends CachePutAllFail startGrids(GRIDS_COUNT); - grid(0).active(true); + grid(0).cluster().state(ClusterState.ACTIVE); startGrid(OUT_OF_BASELINE_GRID_ID); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteStableBaselineCacheRemoveFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteStableBaselineCacheRemoveFailoverTest.java index 193a67ecdf36c..f55c0b6a1a652 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteStableBaselineCacheRemoveFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteStableBaselineCacheRemoveFailoverTest.java @@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicReference; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -87,7 +88,7 @@ public class IgniteStableBaselineCacheRemoveFailoverTest extends GridCacheAbstra startGrids(GRIDS_COUNT); - grid(0).active(true); + grid(0).cluster().state(ClusterState.ACTIVE); startGrid(OUT_OF_BASELINE_GRID_ID); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/CheckpointBufferDeadlockTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/CheckpointBufferDeadlockTest.java index 7218be92f65eb..16ff1fca76973 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/CheckpointBufferDeadlockTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/CheckpointBufferDeadlockTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -166,7 +167,7 @@ private void runDeadlockScenario() throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); GridCacheDatabaseSharedManager db = (GridCacheDatabaseSharedManager)ig.context().cache().context().database(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/FullHistRebalanceOnClientStopTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/FullHistRebalanceOnClientStopTest.java index 7db500ae3da01..7c84d32cacf2f 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/FullHistRebalanceOnClientStopTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/FullHistRebalanceOnClientStopTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -110,7 +111,7 @@ public void testFullRebalanceNotTriggeredWhenClientNodeStopsDuringPme() throws E IgniteEx ig0 = grid(0); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig0.cache(CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteLogicalRecoveryTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteLogicalRecoveryTest.java index a95227f3106c0..713448e49f03b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteLogicalRecoveryTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteLogicalRecoveryTest.java @@ -37,6 +37,7 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -193,7 +194,7 @@ protected CacheConfiguration cacheConfiguration( public void testRecoveryOnJoinToActiveCluster() throws Exception { IgniteEx crd = (IgniteEx)startGridsMultiThreaded(3); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); IgniteEx node = grid(2); @@ -225,7 +226,7 @@ public void testRecoveryOnJoinToActiveCluster() throws Exception { public void testRecoveryOnJoinToInactiveCluster() throws Exception { IgniteEx crd = (IgniteEx)startGridsMultiThreaded(3); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); IgniteEx node = grid(2); @@ -239,11 +240,11 @@ public void testRecoveryOnJoinToInactiveCluster() throws Exception { stopGrid(2, true); - crd.cluster().active(false); + crd.cluster().state(ClusterState.INACTIVE); node = startGrid(2); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -288,7 +289,7 @@ public void testRecoveryWithMvccCaches() throws Exception { private void doTestWithDynamicCaches(List dynamicCaches) throws Exception { IgniteEx crd = (IgniteEx)startGridsMultiThreaded(3); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); IgniteEx node = grid(2); @@ -324,7 +325,7 @@ public void testRecoveryOnJoinToDifferentBlt() throws Exception { IgniteEx crd = (IgniteEx)startGridsMultiThreaded(3); crd.cluster().baselineAutoAdjustEnabled(false); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); IgniteEx node = grid(2); @@ -359,7 +360,7 @@ public void testRecoveryOnJoinToDifferentBlt() throws Exception { public void testRecoveryOnCrushDuringCheckpointOnNodeStart() throws Exception { IgniteEx crd = (IgniteEx)startGridsMultiThreaded(3, false); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); IgniteEx node = grid(2); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsCacheRestoreTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsCacheRestoreTest.java index 8c8a89dbc373a..bf73ca4ca665c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsCacheRestoreTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsCacheRestoreTest.java @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.List; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -111,7 +112,7 @@ private void restoreAndNewCache(boolean createNew) throws Exception { startGrid(i); } - ignite(0).active(true); + ignite(0).cluster().state(ClusterState.ACTIVE); IgniteCache cache1 = ignite(2).cache("c1"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsCacheWalDisabledOnRebalancingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsCacheWalDisabledOnRebalancingTest.java index fb6ea25f5c080..4380e80e81068 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsCacheWalDisabledOnRebalancingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsCacheWalDisabledOnRebalancingTest.java @@ -37,6 +37,7 @@ import org.apache.ignite.cache.CachePeekMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -176,7 +177,7 @@ public class IgnitePdsCacheWalDisabledOnRebalancingTest extends GridCommonAbstra public void testClientJoinsLeavesDuringRebalancing() throws Exception { Ignite ig0 = startGrids(2); - ig0.active(true); + ig0.cluster().state(ClusterState.ACTIVE); for (int i = 1; i < 4; i++) fillCache(ig0.dataStreamer("cache" + i), CACHE_SIZE, GENERATING_FUNC); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsDataRegionMetricsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsDataRegionMetricsTest.java index c12b40f9346cc..3d44f23d49a35 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsDataRegionMetricsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsDataRegionMetricsTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -150,7 +151,7 @@ public void testMemoryUsageSingleNode() throws Exception { for (int iter = 0; iter < ITERATIONS; iter++) { final IgniteEx node = startGrid(0); - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); DataRegionMetrics currMetrics = getDfltRegionMetrics(node); @@ -193,7 +194,7 @@ public void testMemoryUsageMultipleNodes() throws Exception { IgniteEx node1 = startGrid(1); node0.cluster().baselineAutoAdjustEnabled(false); - node0.cluster().active(true); + node0.cluster().state(ClusterState.ACTIVE); final IgniteCache cache = node0.cache(DEFAULT_CACHE_NAME); @@ -244,7 +245,7 @@ public void testMemoryUsageMultipleNodes() throws Exception { public void testCheckpointBufferSize() throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); DataRegionMetricsImpl regionMetrics = ig.cachex(DEFAULT_CACHE_NAME) .context().group().dataRegion().metrics(); @@ -262,7 +263,7 @@ public void testCheckpointBufferSize() throws Exception { public void testUsedCheckpointBuffer() throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); final DataRegionMetricsImpl regionMetrics = ig.cachex(DEFAULT_CACHE_NAME) .context().group().dataRegion().metrics(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsMultiNodePutGetRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsMultiNodePutGetRestartTest.java index a28be6692ec91..4247160039cb6 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsMultiNodePutGetRestartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsMultiNodePutGetRestartTest.java @@ -110,7 +110,7 @@ public void testPutGetSimple() throws Exception { try { IgniteEx ig = grid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); checkPutGetSql(ig, true); } @@ -127,7 +127,7 @@ public void testPutGetSimple() throws Exception { try { IgniteEx ig = grid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); checkPutGetSql(ig, false); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionTest.java index 33b34929ae1c1..f88d58eaec2bc 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionTest.java @@ -28,6 +28,7 @@ import org.apache.ignite.cache.query.ScanQuery; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -99,7 +100,7 @@ public class IgnitePdsPageEvictionTest extends GridCommonAbstractTest { public void testPageEvictionSql() throws Exception { IgniteEx ig = grid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); try (IgniteDataStreamer streamer = ig.dataStreamer(CACHE_NAME)) { for (int i = 0; i < ENTRY_CNT; i++) { diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageReplacementDuringPartitionClearTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageReplacementDuringPartitionClearTest.java index e28e5a14ebfde..3621e5bebbf63 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageReplacementDuringPartitionClearTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageReplacementDuringPartitionClearTest.java @@ -31,6 +31,7 @@ import org.apache.ignite.cache.affinity.Affinity; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -108,7 +109,7 @@ public void testPageEvictionOnNodeStart() throws Exception { try { Ignite ig = ignite(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); ig.cluster().baselineAutoAdjustEnabled(false); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsRebalancingOnNotStableTopologyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsRebalancingOnNotStableTopologyTest.java index a31f1f6cae310..e2cf846b4af75 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsRebalancingOnNotStableTopologyTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsRebalancingOnNotStableTopologyTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.PartitionLossPolicy; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -58,7 +59,7 @@ public class IgnitePdsRebalancingOnNotStableTopologyTest extends GridCommonAbstr public void test() throws Exception { Ignite ex = startGrid(0); - ex.active(true); + ex.cluster().state(ClusterState.ACTIVE); startGrid(1); @@ -72,7 +73,7 @@ public void test() throws Exception { Thread thread = new Thread(new Runnable() { @Override public void run() { - ex1.active(true); + ex1.cluster().state(ClusterState.ACTIVE); try { checkTopology(2); @@ -135,7 +136,7 @@ public void test() throws Exception { //start cluster. it will cause memory restoration and reading WAL. ex = startGrids(CLUSTER_SIZE); - ex.active(true); + ex.cluster().state(ClusterState.ACTIVE); checkTopology(CLUSTER_SIZE); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsStartWIthEmptyArchive.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsStartWIthEmptyArchive.java index e55e036304ee5..8e25f30e25c20 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsStartWIthEmptyArchive.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsStartWIthEmptyArchive.java @@ -23,6 +23,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.apache.ignite.IgniteDataStreamer; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -120,7 +121,7 @@ public void cleanup() throws Exception { public void test() throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); FileWriteAheadLogManager walMgr = (FileWriteAheadLogManager)ig.context().cache().context().wal(); @@ -175,7 +176,7 @@ public void test() throws Exception { afterLastArchivedAbsoluteIndex >= (beforeLastArchivedAbsoluteIdx - segments)); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); FileWriteHandle fhAfter = U.field(walMgr, "currHnd"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsTransactionsHangTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsTransactionsHangTest.java index 83e047ec9eae1..a2858a00d39c8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsTransactionsHangTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsTransactionsHangTest.java @@ -31,6 +31,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -161,7 +162,7 @@ public void testTransactionsDontHang() throws Exception { try { final Ignite g = startGrids(2); - g.active(true); + g.cluster().state(ClusterState.ACTIVE); g.getOrCreateCache(getCacheConfiguration()); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsWholeClusterRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsWholeClusterRestartTest.java index c22cecf33ffd8..47548f780ea81 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsWholeClusterRestartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsWholeClusterRestartTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -98,7 +99,7 @@ public class IgnitePdsWholeClusterRestartTest extends GridCommonAbstractTest { public void testRestarts() throws Exception { startGrids(GRID_CNT); - ignite(0).active(true); + ignite(0).cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -123,7 +124,7 @@ public void testRestarts() throws Exception { startGrid(idx); try { - ignite(0).active(true); + ignite(0).cluster().state(ClusterState.ACTIVE); for (int g = 0; g < GRID_CNT; g++) { Ignite ig = ignite(g); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsWithTtlTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsWithTtlTest.java index 8287d895f4532..60539acdf12d8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsWithTtlTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsWithTtlTest.java @@ -35,6 +35,7 @@ import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -420,7 +421,7 @@ public void testStartStopAfterRebalanceWithTtlExpirable() throws Exception { srv.cluster().baselineAutoAdjustEnabled(false); startGrid(1); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); ExpiryPolicy plc = CreatedExpiryPolicy.factoryOf(Duration.ONE_DAY).create(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteSequentialNodeCrashRecoveryTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteSequentialNodeCrashRecoveryTest.java index 8c6421fe1fde3..746474a64fbe9 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteSequentialNodeCrashRecoveryTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteSequentialNodeCrashRecoveryTest.java @@ -31,6 +31,7 @@ import org.apache.ignite.ShutdownPolicy; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -141,7 +142,7 @@ public class IgniteSequentialNodeCrashRecoveryTest extends GridCommonAbstractTes public void testCrashOnCheckpointAfterLogicalRecovery() throws Exception { IgniteEx g = startGrid(0); - g.cluster().active(true); + g.cluster().state(ClusterState.ACTIVE); g.getOrCreateCache(new CacheConfiguration<>("cache") .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/SlowHistoricalRebalanceSmallHistoryTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/SlowHistoricalRebalanceSmallHistoryTest.java index e9df603cb3833..9834b59f7a1db 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/SlowHistoricalRebalanceSmallHistoryTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/SlowHistoricalRebalanceSmallHistoryTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -127,7 +128,7 @@ public void testReservation() throws Exception { IgniteEx ig = startGrid(0); ig.cluster().baselineAutoAdjustEnabled(false); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); ig.getOrCreateCache(new CacheConfiguration<>(SLOW_REBALANCE_CACHE) .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointFailBeforeWriteMarkTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointFailBeforeWriteMarkTest.java index 0178b3df632a0..fdd9615fca5f1 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointFailBeforeWriteMarkTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointFailBeforeWriteMarkTest.java @@ -24,6 +24,7 @@ import java.util.function.Predicate; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -149,7 +150,7 @@ public void testCheckpointFailBeforeMarkEntityWrite() throws Exception { //given: one node with persistence. IgniteEx ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); //It is necessary to understanding when page replacement would be started. PageMemory pageMemory = ignite0.context().cache().context().database().dataRegion("default").pageMemory(); @@ -183,7 +184,7 @@ public void testCheckpointFailBeforeMarkEntityWrite() throws Exception { //then: Data recovery after node start should be successful. ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite(0).cache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointFreeListTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointFreeListTest.java index d487e86160e46..470c482f9a232 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointFreeListTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointFreeListTest.java @@ -46,6 +46,7 @@ import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -157,7 +158,7 @@ private IgniteConfiguration getClientConfiguration(String igniteInstanceName) th public void testFreeListRestoredCorrectly() throws Exception { IgniteEx ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteEx igniteClient = startClientGrid(getClientConfiguration("client")); @@ -186,7 +187,7 @@ public void testFreeListRestoredCorrectly() throws Exception { ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); GridCacheOffheapManager offheap2 = cacheOffheapManager(); @@ -230,7 +231,7 @@ private GridCacheOffheapManager cacheOffheapManager() { @WithSystemProperty(key = IgniteSystemProperties.IGNITE_PAGES_LIST_DISABLE_ONHEAP_CACHING, value = "true") public void testRestoreFreeListCorrectlyAfterRandomStop() throws Exception { IgniteEx ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); Random random = new Random(); @@ -286,7 +287,7 @@ public void testRestoreFreeListCorrectlyAfterRandomStop() throws Exception { ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); if (entriesToRemove.isEmpty()) break; @@ -320,7 +321,7 @@ public void testRestoreFreeListCorrectlyAfterRandomStop() throws Exception { public void testFreeListUnderLoadMultipleCheckpoints() throws Throwable { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); int minValSize = 64; int maxValSize = 128; diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointListenerForRegionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointListenerForRegionTest.java index fb10775a438a0..4beaa0816d932 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointListenerForRegionTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointListenerForRegionTest.java @@ -21,6 +21,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -99,7 +100,7 @@ public void testCheckpointListenersInvokedOnlyIfRegionConfigured() throws Except //given: One started node with default cache. IgniteEx ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite0.cache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointStartLoggingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointStartLoggingTest.java index 0ecc7644220c9..0a6f8c731688b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointStartLoggingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/CheckpointStartLoggingTest.java @@ -20,6 +20,7 @@ import java.util.regex.Pattern; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -87,7 +88,7 @@ public void testCheckpointLogging() throws Exception { Ignite ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.getOrCreateCache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/IgniteCheckpointDirtyPagesForLowLoadTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/IgniteCheckpointDirtyPagesForLowLoadTest.java index 9d03bd2549486..2f3cfdba0ddcd 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/IgniteCheckpointDirtyPagesForLowLoadTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/IgniteCheckpointDirtyPagesForLowLoadTest.java @@ -26,6 +26,7 @@ import java.util.concurrent.locks.LockSupport; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -105,7 +106,7 @@ public class IgniteCheckpointDirtyPagesForLowLoadTest extends GridCommonAbstract public void testManyCachesAndNotManyPuts() throws Exception { try { IgniteEx ignite = startGrid(0); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); log.info("Saving initial data to caches"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/IgniteMassLoadSandboxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/IgniteMassLoadSandboxTest.java index f74850f413611..125b4cd9ac664 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/IgniteMassLoadSandboxTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/IgniteMassLoadSandboxTest.java @@ -41,6 +41,7 @@ import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -191,7 +192,7 @@ public void testContinuousPutMultithreaded() throws Exception { final IgniteEx ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); final IgniteCache cache = ignite.cache(CACHE_NAME); final int threads = Runtime.getRuntime().availableProcessors(); @@ -253,7 +254,7 @@ public void testDataStreamerContinuousPutMultithreaded() throws Exception { final IgniteEx ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); final int threads = 1; Runtime.getRuntime().availableProcessors(); @@ -330,7 +331,7 @@ public void testCoveredWalLogged() throws Exception { final Ignite ignite = G.start(cfg); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); final IgniteCache cache = ignite.cache(CACHE_NAME); @@ -416,7 +417,7 @@ public void testCoveredWalLogged() throws Exception { private void runVerification(int threads, final int recsPerThread) throws Exception { final Ignite restartedIgnite = startGrid(1); - restartedIgnite.active(true); + restartedIgnite.cluster().state(ClusterState.ACTIVE); final IgniteCache restartedCache = restartedIgnite.cache(CACHE_NAME); @@ -499,7 +500,7 @@ public void testPutRemoveMultithreaded() throws Exception { try { final IgniteEx ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); checkpointFrequency = 20 * 1000; final IgniteCache cache = ignite.cache(CACHE_NAME); int totalRecs = 400_000; @@ -545,7 +546,7 @@ public void testPutRemoveMultithreaded() throws Exception { final Ignite restartedIgnite = startGrid(1); - restartedIgnite.active(true); + restartedIgnite.cluster().state(ClusterState.ACTIVE); final IgniteCache restartedCache = restartedIgnite.cache(CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/LightweightCheckpointTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/LightweightCheckpointTest.java index ce08f216495a1..9044e1b208b17 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/LightweightCheckpointTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/LightweightCheckpointTest.java @@ -23,6 +23,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -125,7 +126,7 @@ public class LightweightCheckpointTest extends GridCommonAbstractTest { public void testLightCheckpointAbleToStoreOnlyGivenDataRegion() throws Exception { //given: One started node with default cache and cache which won't be checkpointed. IgniteEx ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache checkpointedCache = ignite0.cache(DEFAULT_CACHE_NAME); IgniteCache notCheckpointedCache = ignite0.cache(NOT_CHECKPOINTED_CACHE); @@ -180,7 +181,7 @@ public void testLightCheckpointAbleToStoreOnlyGivenDataRegion() throws Exception stopAllGrids(); ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); checkpointedCache = ignite0.cache(DEFAULT_CACHE_NAME); notCheckpointedCache = ignite0.cache(NOT_CHECKPOINTED_CACHE); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/DefaultPageSizeBackwardsCompatibilityTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/DefaultPageSizeBackwardsCompatibilityTest.java index 04b5852fac2ec..c3fb2a2767afd 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/DefaultPageSizeBackwardsCompatibilityTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/DefaultPageSizeBackwardsCompatibilityTest.java @@ -21,6 +21,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -102,7 +103,7 @@ public void testStartFrom16kDefaultStore() throws Exception { Ignite ig = ignite(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -121,7 +122,7 @@ public void testStartFrom16kDefaultStore() throws Exception { ig = ignite(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCacheDestroyDuringCheckpointTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCacheDestroyDuringCheckpointTest.java index e2bc4b1c57f8d..f1dadb7326e27 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCacheDestroyDuringCheckpointTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCacheDestroyDuringCheckpointTest.java @@ -22,6 +22,7 @@ import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CachePeekMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -92,7 +93,7 @@ private DataStorageConfiguration createDbConfig() { @Test public void testCacheCreatePutCheckpointDestroy() throws Exception { IgniteEx ig = startGrid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); for (int j = 0; j < NUM_ITERATIONS; j++) { Ignite client = startClientGrid(1); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCacheIntegrationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCacheIntegrationTest.java index c3ddba5ed5bf3..622e2d56fd85b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCacheIntegrationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCacheIntegrationTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -111,7 +112,7 @@ public void testPutGetSimple() throws Exception { try { IgniteEx ig = grid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); checkPutGetSql(ig, true); } @@ -128,7 +129,7 @@ public void testPutGetSimple() throws Exception { try { IgniteEx ig = grid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); checkPutGetSql(ig, false); } @@ -147,7 +148,7 @@ public void testPutMultithreaded() throws Exception { try { final IgniteEx grid = grid(0); - grid.active(true); + grid.cluster().state(ClusterState.ACTIVE); GridTestUtils.runMultiThreaded(new Callable() { @Override public Object call() throws Exception { diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCheckpointSimulationWithRealCpDisabledTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCheckpointSimulationWithRealCpDisabledTest.java index 5bca3ee34d0a1..0706a3a8e9c95 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCheckpointSimulationWithRealCpDisabledTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCheckpointSimulationWithRealCpDisabledTest.java @@ -38,6 +38,7 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheRebalanceMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -152,7 +153,7 @@ public class IgnitePdsCheckpointSimulationWithRealCpDisabledTest extends GridCom public void testCheckpointSimulationMultiThreaded() throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); GridCacheSharedContext shared = ig.context().cache().context(); @@ -190,7 +191,7 @@ public void testCheckpointSimulationMultiThreaded() throws Exception { ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); shared = ig.context().cache().context(); @@ -210,7 +211,7 @@ public void testCheckpointSimulationMultiThreaded() throws Exception { public void testGetForInitialWrite() throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); GridCacheSharedContext shared = ig.context().cache().context(); @@ -268,7 +269,7 @@ public void testGetForInitialWrite() throws Exception { ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); shared = ig.context().cache().context(); @@ -326,7 +327,7 @@ public void testMvccDataWalEntries() throws Exception { private void checkDataWalEntries(boolean mvcc) throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); GridCacheSharedContext sharedCtx = ig.context().cache().context(); GridCacheContext cctx = sharedCtx.cache().cache(mvcc ? MVCC_CACHE_NAME : CACHE_NAME).context(); @@ -375,7 +376,7 @@ private void checkDataWalEntries(boolean mvcc) throws Exception { ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); sharedCtx = ig.context().cache().context(); cctx = sharedCtx.cache().cache(mvcc ? MVCC_CACHE_NAME : CACHE_NAME).context(); @@ -449,7 +450,7 @@ private void checkDataWalEntries(boolean mvcc) throws Exception { public void testPageWalEntries() throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); GridCacheSharedContext sharedCtx = ig.context().cache().context(); int cacheId = sharedCtx.cache().cache(CACHE_NAME).context().cacheId(); @@ -496,7 +497,7 @@ public void testPageWalEntries() throws Exception { ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); sharedCtx = ig.context().cache().context(); @@ -552,7 +553,7 @@ public void testPageWalEntries() throws Exception { public void testDirtyFlag() throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); GridCacheSharedContext shared = ig.context().cache().context(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsDiskErrorsRecoveringTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsDiskErrorsRecoveringTest.java index a3697331e57ec..eabe3c83a4f19 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsDiskErrorsRecoveringTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsDiskErrorsRecoveringTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -137,7 +138,7 @@ public void testRecoveringOnCacheInitFail() throws Exception { try { IgniteEx grid = startGrid(0); - grid.cluster().active(true); + grid.cluster().state(ClusterState.ACTIVE); } catch (Exception e) { throw new RuntimeException("Failed to start node.", e); @@ -160,7 +161,7 @@ public void testRecoveringOnCacheInitFail() throws Exception { IgniteEx grid = startGrid(0); - grid.cluster().active(true); + grid.cluster().state(ClusterState.ACTIVE); } /** @@ -177,7 +178,7 @@ public void testRecoveringOnCheckpointBeginFail() throws Exception { ); final IgniteEx grid = startGrid(0); - grid.cluster().active(true); + grid.cluster().state(ClusterState.ACTIVE); for (int i = 0; i < 1000; i++) { byte payload = (byte)i; @@ -207,7 +208,7 @@ public void testRecoveringOnCheckpointBeginFail() throws Exception { ioFactory = null; IgniteEx recoveredGrid = startGrid(0); - recoveredGrid.cluster().active(true); + recoveredGrid.cluster().state(ClusterState.ACTIVE); for (int i = 0; i < 1000; i++) { byte payload = (byte)i; @@ -228,7 +229,7 @@ public void testRecoveringOnCheckpointWriteFail() throws Exception { ioFactory = new FilteringFileIOFactory(".bin", new LimitedSizeFileIOFactory(new RandomAccessFileIOFactory(), 128 * PAGE_SIZE)); final IgniteEx grid = startGrid(0); - grid.cluster().active(true); + grid.cluster().state(ClusterState.ACTIVE); for (int i = 0; i < 1000; i++) { byte payload = (byte)i; @@ -257,7 +258,7 @@ public void testRecoveringOnCheckpointWriteFail() throws Exception { ioFactory = null; IgniteEx recoveredGrid = startGrid(0); - recoveredGrid.cluster().active(true); + recoveredGrid.cluster().state(ClusterState.ACTIVE); for (int i = 0; i < 1000; i++) { byte payload = (byte)i; @@ -308,7 +309,7 @@ private void doTestRecoveringOnWALWritingFail() throws Exception { wal.setFileIOFactory(ioFactory); - grid.cluster().active(true); + grid.cluster().state(ClusterState.ACTIVE); int failedPosition = -1; @@ -342,7 +343,7 @@ private void doTestRecoveringOnWALWritingFail() throws Exception { // Grid should be successfully recovered after stopping. grid = startGrid(0); - grid.cluster().active(true); + grid.cluster().state(ClusterState.ACTIVE); for (int i = 0; i < failedPosition; i++) { byte payload = (byte)i; diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsNoActualWalHistoryTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsNoActualWalHistoryTest.java index 889b601c07da0..77dcba761319e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsNoActualWalHistoryTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsNoActualWalHistoryTest.java @@ -25,6 +25,7 @@ import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -104,7 +105,7 @@ public void testWalBig() throws Exception { try { IgniteEx ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache(CACHE_NAME); @@ -149,7 +150,7 @@ public void testWalBig() throws Exception { ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache = ignite.cache(CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsPageReplacementTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsPageReplacementTest.java index 2193f5439b79c..ef3a885190447 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsPageReplacementTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsPageReplacementTest.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.concurrent.Callable; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataPageEvictionMode; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -118,7 +119,7 @@ private DataStorageConfiguration createDbConfig() { public void testPageReplacement() throws Exception { final IgniteEx ig = startGrid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); final PageMemory memory = getMemory(ig); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/filename/IgniteUidAsConsistentIdMigrationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/filename/IgniteUidAsConsistentIdMigrationTest.java index 92408920a442b..bc8677880c45d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/filename/IgniteUidAsConsistentIdMigrationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/filename/IgniteUidAsConsistentIdMigrationTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -306,12 +307,12 @@ public void testStartNodeAfterDeactivate() throws Exception { assertPdsDirsDefaultExist(genNewStyleSubfolderName(0, ignite)); uuid = (UUID)ignite.cluster().localNode().consistentId(); - ignite.active(false); + ignite.cluster().state(ClusterState.INACTIVE); } { final Ignite igniteRestart = startActivateGrid(1); - grid(0).active(true); + grid(0).cluster().state(ClusterState.ACTIVE); final Object consIdRestart = igniteRestart.cluster().localNode().consistentId(); assertPdsDirsDefaultExist(genNewStyleSubfolderName(1, igniteRestart)); @@ -346,7 +347,7 @@ public void testStartNodeAfterDeactivate() throws Exception { @NotNull private Ignite startActivateGrid(int idx) throws Exception { final Ignite ignite = startGrid(idx); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); return ignite; } @@ -378,7 +379,7 @@ public void testNodeIndexIncremented() throws Exception { final Ignite ignite0 = startGrid(0); final Ignite ignite1 = startGrid(1); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); ignite0.getOrCreateCache(CACHE_NAME).put("hi", "there!"); ignite1.getOrCreateCache(CACHE_NAME).put("hi1", "there!"); @@ -403,7 +404,7 @@ public void testNewStyleAlwaysSmallestNodeIndexIsCreated() throws Exception { final Ignite ignite2 = startGrid(2); final Ignite ignite3 = startGrid(3); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); ignite0.getOrCreateCache(CACHE_NAME).put("hi", "there!"); ignite3.getOrCreateCache(CACHE_NAME).put("hi1", "there!"); @@ -433,7 +434,7 @@ public void testNewStyleAlwaysSmallestNodeIndexIsCreated() throws Exception { public void testNewStyleAlwaysSmallestNodeIndexIsCreatedMultithreaded() throws Exception { final Ignite ignite0 = startGridsMultiThreaded(11); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); ignite0.getOrCreateCache(CACHE_NAME).put("hi", "there!"); ignite0.getOrCreateCache(CACHE_NAME).put("hi1", "there!"); @@ -469,7 +470,7 @@ public void testStartTwoOldStyleNodes() throws Exception { this.configuredConsistentId = expDfltConsistentId2; //this is for create old node folder final Ignite ignite2 = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); final String expVal = "there is compatible mode with old style folders!"; @@ -484,7 +485,7 @@ public void testStartTwoOldStyleNodes() throws Exception { final Ignite igniteRestart = startGrid(0); final Ignite igniteRestart2 = startGrid(1); - igniteRestart2.active(true); + igniteRestart2.cluster().state(ClusterState.ACTIVE); assertEquals(expDfltConsistentId1, igniteRestart.cluster().localNode().consistentId()); assertEquals(expDfltConsistentId2, igniteRestart2.cluster().localNode().consistentId()); @@ -515,7 +516,7 @@ public void testStartOldStyleNodesByCompatibleProperty() throws Exception { final Ignite ignite1 = startGrid(0); final Ignite ignite2 = startGrid(1); - ignite1.active(true); + ignite1.cluster().state(ClusterState.ACTIVE); final String expVal = "there is compatible mode with old style folders!"; @@ -535,7 +536,7 @@ public void testStartOldStyleNodesByCompatibleProperty() throws Exception { final Ignite igniteRestart = startGrid(0); final Ignite igniteRestart2 = startGrid(1); - igniteRestart2.active(true); + igniteRestart2.cluster().state(ClusterState.ACTIVE); assertEquals(consistentId1, igniteRestart.cluster().localNode().consistentId()); assertEquals(consistentId2, igniteRestart2.cluster().localNode().consistentId()); @@ -558,7 +559,7 @@ public void testStartOldStyleNoPortsNodesByCompatibleProperty() throws Exception final Ignite ignite1 = startGrid(0); - ignite1.active(true); + ignite1.cluster().state(ClusterState.ACTIVE); final String expVal = "there is compatible mode with old style folders!"; @@ -575,7 +576,7 @@ public void testStartOldStyleNoPortsNodesByCompatibleProperty() throws Exception final Ignite igniteRestart = startGrid(0); - igniteRestart.active(true); + igniteRestart.cluster().state(ClusterState.ACTIVE); assertEquals(consistentId1, igniteRestart.cluster().localNode().consistentId()); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/FsyncWalRolloverDoesNotBlockTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/FsyncWalRolloverDoesNotBlockTest.java index 632e3cab4647c..4f5e7b95f778a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/FsyncWalRolloverDoesNotBlockTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/FsyncWalRolloverDoesNotBlockTest.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors.cache.persistence.db.wal; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -69,7 +70,7 @@ private RolloverRecord() { public void test() throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); ig.context().cache().context().database().checkpointReadLock(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/HistoricalReservationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/HistoricalReservationTest.java index 70b4202ba7f0a..5478ec6e085dc 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/HistoricalReservationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/HistoricalReservationTest.java @@ -20,6 +20,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -85,7 +86,7 @@ public class HistoricalReservationTest extends GridCommonAbstractTest { @Test public void testDeactivated() throws Exception { historicalRebalance(() -> { - G.allGrids().get(0).active(false); + G.allGrids().get(0).cluster().state(ClusterState.INACTIVE); }); } @@ -119,7 +120,7 @@ public void testRestartGrid() throws Exception { public void testDeactivateAndRestartGrid() throws Exception { historicalRebalance(() -> { try { - G.allGrids().get(0).active(false); + G.allGrids().get(0).cluster().state(ClusterState.INACTIVE); stopAllGrids(); @@ -141,13 +142,13 @@ public void testDeactivateAndRestartGrid() throws Exception { public void testDeactivateAndRestartGridActive() throws Exception { historicalRebalance(() -> { try { - G.allGrids().get(0).active(false); + G.allGrids().get(0).cluster().state(ClusterState.INACTIVE); stopAllGrids(); startGrids(CLUSTER_NODES); - G.allGrids().get(0).active(true); + G.allGrids().get(0).cluster().state(ClusterState.ACTIVE); } catch (Exception e) { fail(e.getMessage()); @@ -167,7 +168,7 @@ public void historicalRebalance(IgniteRunnable someAction) throws Exception { IgniteEx ignite0 = startGrids(CLUSTER_NODES); IgniteEx rebalancedNode = startGrid(rebalancedNodeName); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); preloadData(ignite0, 0, 100); @@ -202,7 +203,7 @@ public void historicalRebalance(IgniteRunnable someAction) throws Exception { rebalancedNode = startGrid(cfg); - rebalancedNode.cluster().active(true); + rebalancedNode.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteNodeStoppedDuringDisableWALTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteNodeStoppedDuringDisableWALTest.java index 063d9fb9dd354..bf56dffdf2eba 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteNodeStoppedDuringDisableWALTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteNodeStoppedDuringDisableWALTest.java @@ -28,6 +28,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteDataStreamer; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -184,7 +185,7 @@ private void testStopNodeWithDisableWAL(NodeStopPoint nodeStopPoint) throws Exce ig0.context().internalSubscriptionProcessor().registerMetastorageListener(walDisableContext); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); try (IgniteDataStreamer st = ig0.dataStreamer(DEFAULT_CACHE_NAME)) { st.allowOverwrite(true); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWALTailIsReachedDuringIterationOverArchiveTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWALTailIsReachedDuringIterationOverArchiveTest.java index 9d8cfaf2f9638..5681d1e17995f 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWALTailIsReachedDuringIterationOverArchiveTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWALTailIsReachedDuringIterationOverArchiveTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteDataStreamer; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -85,7 +86,7 @@ public class IgniteWALTailIsReachedDuringIterationOverArchiveTest extends GridCo Ignite ig = startGrid(); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); try (IgniteDataStreamer st = ig.dataStreamer(DEFAULT_CACHE_NAME)) { st.allowOverwrite(true); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFailoverTest.java index 27316153f0fb7..4cdd0b126a63c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushFailoverTest.java @@ -25,6 +25,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -134,7 +135,7 @@ private void flushingErrorTest() throws Exception { wal.setFileIOFactory(new FailingFileIOFactory(canFail)); try { - grid.active(true); + grid.cluster().state(ClusterState.ACTIVE); IgniteCache cache = grid.cache(TEST_CACHE); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushMultiNodeFailoverAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushMultiNodeFailoverAbstractSelfTest.java index ea598f576fb73..e73753d518ff8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushMultiNodeFailoverAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushMultiNodeFailoverAbstractSelfTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -177,7 +178,7 @@ private void failWhilePut(boolean failWhileStart) throws Exception { Ignite ig = startGrids(gridCount()); ig.cluster().baselineAutoAdjustEnabled(false); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.cache(DEFAULT_CACHE_NAME); @@ -234,7 +235,7 @@ private void failWhilePut(boolean failWhileStart) throws Exception { Ignite grid0 = startGrids(gridCount() + 1); - grid0.cluster().active(true); + grid0.cluster().state(ClusterState.ACTIVE); cache = grid0.cache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFormatFileFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFormatFileFailoverTest.java index f82a64d8f5ec4..560d6f3443053 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFormatFileFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFormatFileFailoverTest.java @@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicReference; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -145,7 +146,7 @@ private void failFormatFileOnClusterActivate() throws Exception { failMtdNameRef.set(formatFile); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); checkCause(failureHandler(0).awaitFailure(2000).error()); checkCause(failureHandler(1).awaitFailure(2000).error()); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalHistoryReservationsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalHistoryReservationsTest.java index 924f43682496c..4033eb60cbcbc 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalHistoryReservationsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalHistoryReservationsTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -136,7 +137,7 @@ public void testReservedOnExchange() throws Exception { final IgniteEx ig0 = (IgniteEx)startGrids(initGridCnt + 1); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); stopGrid(initGridCnt); @@ -292,7 +293,7 @@ public void testRemovesArePreloadedIfHistoryIsAvailable() throws Exception { IgniteEx ig0 = (IgniteEx)startGrids(2); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig0.cache("cache1"); @@ -344,7 +345,7 @@ public void testNodeIsClearedIfHistoryIsUnavailable() throws Exception { IgniteEx ig0 = (IgniteEx)startGrids(2); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig0.cache("cache1"); @@ -411,7 +412,7 @@ public void testWalHistoryPartiallyRemoved() throws Exception { IgniteEx ig0 = startGrids(2); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig0.cache("cache1"); @@ -439,7 +440,7 @@ public void testWalHistoryPartiallyRemoved() throws Exception { Ignite ig1 = startGrid(1); - ig1.cluster().active(true); + ig1.cluster().state(ClusterState.ACTIVE); } /** @@ -456,7 +457,7 @@ public void testNodeLeftDuringExchange() throws Exception { final Ignite ig0 = startGrids(initGridCnt); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig0.cache("cache1"); @@ -541,7 +542,7 @@ public void testCheckpointsNotReserveWithWalModeNone() throws Exception { IgniteEx grid = startGrids(2); - grid.cluster().active(true); + grid.cluster().state(ClusterState.ACTIVE); IgniteCache cache = grid.createCache(new CacheConfiguration<>("cache").setBackups(1)); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRebalanceLoggingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRebalanceLoggingTest.java index ee743e6acfb7d..5656482d2f8cd 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRebalanceLoggingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRebalanceLoggingTest.java @@ -20,6 +20,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -191,7 +192,7 @@ public void testFullRebalanceWithShortCpHistoryLogMsgs() throws Exception { */ private void checkFollowingPartitionsWereReservedForPotentialHistoryRebalanceMsg(LogListener... lsnrs) throws Exception { - startGridsMultiThreaded(2).cluster().active(true); + startGridsMultiThreaded(2).cluster().state(ClusterState.ACTIVE); IgniteCache cache1 = createCache("cache1", "cache_group1"); IgniteCache cache2 = createCache("cache2", "cache_group2"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRebalanceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRebalanceTest.java index 4def727aedbeb..730b725799882 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRebalanceTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRebalanceTest.java @@ -46,6 +46,7 @@ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.annotations.QuerySqlField; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -1434,7 +1435,7 @@ public void testRebalanceRestartWithNodeBlinking() throws Exception { IgniteEx crd = (IgniteEx)startGridsMultiThreaded(3); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = crd.cache(CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoveryPPCTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoveryPPCTest.java index c7f357b628565..ce2e69b9d2f1f 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoveryPPCTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoveryPPCTest.java @@ -22,6 +22,7 @@ import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -143,7 +144,7 @@ public void testWalSimple() throws Exception { try { IgniteEx ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache1 = ignite.cache(CACHE_NAME_1); IgniteCache cache2 = ignite.cache(CACHE_NAME_2); @@ -201,7 +202,7 @@ else if (i % 2 == 0) { ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache1 = ignite.cache(CACHE_NAME_1); cache2 = ignite.cache(CACHE_NAME_2); @@ -240,7 +241,7 @@ public void testDynamicallyStartedNonPersistentCache() throws Exception { try { IgniteEx ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache dynamicPersistent = ignite.getOrCreateCache( new CacheConfiguration() @@ -266,7 +267,7 @@ public void testDynamicallyStartedNonPersistentCache() throws Exception { ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); dynamicPersistent = ignite.cache("dynamicPersistent"); dynamicVolatile = ignite.cache("dynamicVolatile"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoverySeveralRestartsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoverySeveralRestartsTest.java index e941f340fe252..43bde29668759 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoverySeveralRestartsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoverySeveralRestartsTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -120,7 +121,7 @@ public void testWalRecoverySeveralRestarts() throws Exception { try { IgniteEx ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); Random locRandom = ThreadLocalRandom.current(); @@ -143,7 +144,7 @@ public void testWalRecoverySeveralRestarts() throws Exception { ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache(cacheName); @@ -179,7 +180,7 @@ public void testWalRecoveryWithDynamicCache() throws Exception { try { IgniteEx ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); CacheConfiguration dynCacheCfg = new CacheConfiguration<>(); @@ -210,7 +211,7 @@ public void testWalRecoveryWithDynamicCache() throws Exception { ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); ThreadLocalRandom locRandom = ThreadLocalRandom.current(); @@ -236,7 +237,7 @@ public void testWalRecoveryWithDynamicCacheLargeObjects() throws Exception { try { IgniteEx ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); CacheConfiguration dynCacheCfg = new CacheConfiguration<>(); @@ -273,7 +274,7 @@ public void testWalRecoveryWithDynamicCacheLargeObjects() throws Exception { ignite = startGrid(1); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); ThreadLocalRandom locRandom = ThreadLocalRandom.current(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalReplayingAfterRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalReplayingAfterRestartTest.java index 172857615f535..98289ba671a49 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalReplayingAfterRestartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalReplayingAfterRestartTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -121,7 +122,7 @@ public void afterIgniteWalReplayingAfterRestartTest() throws Exception { public void testWalRecordsAfterRestart() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.getOrCreateCache(CACHE_NAME); @@ -142,7 +143,7 @@ public void testWalRecordsAfterRestart() throws Exception { // There are no exceptions should be thrown here. ignite = startGrid(0); - ignite.cluster().active(); + ignite.cluster().state().active(); // delta records should always follow PageSnapshot records. String workDir = U.defaultWorkDirectory(); @@ -188,7 +189,7 @@ public void testFsyncWalValidationAfterRestart() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.getOrCreateCache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalSerializerVersionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalSerializerVersionTest.java index 5a7739ac287d1..c5183f71cef7c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalSerializerVersionTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalSerializerVersionTest.java @@ -22,6 +22,7 @@ import java.util.Iterator; import java.util.List; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -237,7 +238,7 @@ private void check(Checker checker) throws Exception { IgniteEx ig0 = (IgniteEx)startGrid(); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteWriteAheadLogManager wal = ig0.context().cache().context().wal(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionNoArchiverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionNoArchiverTest.java index 4c50e252fd4b5..da30f954c888a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionNoArchiverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionNoArchiverTest.java @@ -18,6 +18,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -95,7 +96,7 @@ public class WalCompactionNoArchiverTest extends GridCommonAbstractTest { @WithSystemProperty(key = "IGNITE_WAL_COMPRESSOR_WORKER_THREAD_CNT", value = "1") public void testNoCompressionErrors() throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.cache(CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionSwitchOnTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionSwitchOnTest.java index 70183ae151313..f24d75bc6ed5f 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionSwitchOnTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionSwitchOnTest.java @@ -21,6 +21,7 @@ import java.io.FileFilter; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -70,7 +71,7 @@ public class WalCompactionSwitchOnTest extends GridCommonAbstractTest { public void testWalCompactionSwitch() throws Exception { IgniteEx ex = startGrid(0); - ex.cluster().active(true); + ex.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ex.getOrCreateCache( new CacheConfiguration() @@ -108,7 +109,7 @@ public void testWalCompactionSwitch() throws Exception { ex = startGrid(0); - ex.cluster().active(true); + ex.cluster().state(ClusterState.ACTIVE); File archiveDir = U.resolveWorkDirectory( ex.configuration().getWorkDirectory(), diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionTest.java index 682ac0b1a1ae6..4fec9ef585acd 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionTest.java @@ -30,6 +30,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -163,7 +164,7 @@ private void testApplyingUpdatesFromCompactedWal(boolean switchOffCompressor) th IgniteEx ig = (IgniteEx)startGrids(3); ig.cluster().baselineAutoAdjustEnabled(false); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.cache(CACHE_NAME); @@ -258,7 +259,7 @@ else if (arr[i] != 1) { Ignite ignite = startGrids(2); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); resetBaselineTopology(); @@ -298,7 +299,7 @@ public void testOptimizedWalSegments() throws Exception { IgniteEx ig = (IgniteEx)startGrid(getTestIgniteInstanceName(0), optimize(icfg), null); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.cache(CACHE_NAME); @@ -360,7 +361,7 @@ private void testCompressorToleratesEmptyWalSegments(WALMode walMode) throws Exc compactionEnabled = false; IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.cache(CACHE_NAME); @@ -408,7 +409,7 @@ private void testCompressorToleratesEmptyWalSegments(WALMode walMode) throws Exc compactionEnabled = true; ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); // Allow compressor to compress WAL segments. assertTrue(GridTestUtils.waitForCondition(zippedWalSegment::exists, 15_000)); @@ -450,7 +451,7 @@ private void testCompressorToleratesEmptyWalSegments(WALMode walMode) throws Exc @Test public void testSeekingStartInCompactedSegment() throws Exception { IgniteEx ig = startGrids(3); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.cache(CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRebalanceRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRebalanceRestartTest.java index 4432c583527cc..88d0878bead1d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRebalanceRestartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRebalanceRestartTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -229,7 +230,7 @@ private void stopFirstFoundSupplier(IgniteEx ignite) { private void restartRebalance(RebalanceRetrigger retrigger, boolean retriggerAsHistorical) throws Exception { IgniteEx ignite0 = startGrids(4); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); try (IgniteDataStreamer streamer = ignite0.dataStreamer(DEFAULT_CACHE_NAME)) { streamer.allowOverwrite(true); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRecoveryTxLogicalRecordsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRecoveryTxLogicalRecordsTest.java index eaea64bb3dbe6..c1ba599e090e2 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRecoveryTxLogicalRecordsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRecoveryTxLogicalRecordsTest.java @@ -39,6 +39,7 @@ import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -166,7 +167,7 @@ public class WalRecoveryTxLogicalRecordsTest extends GridCommonAbstractTest { public void testWalTxSimple() throws Exception { Ignite ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); GridCacheDatabaseSharedManager dbMgr = (GridCacheDatabaseSharedManager)((IgniteEx)ignite).context() .cache().context().database(); @@ -203,7 +204,7 @@ public void testWalTxSimple() throws Exception { ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache = ignite.cache(CACHE_NAME); @@ -237,7 +238,7 @@ public void testWalTxSimple() throws Exception { public void testWalRecoveryRemoves() throws Exception { Ignite ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); GridCacheDatabaseSharedManager dbMgr = (GridCacheDatabaseSharedManager)((IgniteEx)ignite).context() .cache().context().database(); @@ -287,7 +288,7 @@ public void testWalRecoveryRemoves() throws Exception { ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache = ignite.cache(CACHE_NAME); @@ -325,7 +326,7 @@ public void testHistoricalRebalanceIterator() throws Exception { Ignite ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); GridCacheDatabaseSharedManager dbMgr = (GridCacheDatabaseSharedManager)((IgniteEx)ignite).context() .cache().context().database(); @@ -420,7 +421,7 @@ public void testHistoricalRebalanceIterator() throws Exception { // Check that iterator is valid after restart. ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); grp = ((IgniteEx)ignite).context().cache().cacheGroup(CU.cacheId(CACHE_NAME)); offh = grp.offheap(); @@ -498,7 +499,7 @@ public void testHistoricalRebalanceIterator() throws Exception { public void testWalAfterPreloading() throws Exception { Ignite ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); GridCacheDatabaseSharedManager dbMgr = (GridCacheDatabaseSharedManager)((IgniteEx)ignite).context() .cache().context().database(); @@ -521,7 +522,7 @@ public void testWalAfterPreloading() throws Exception { ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache = ignite.cache(CACHE_NAME); @@ -575,7 +576,7 @@ public void testRecoveryRandomPutRemove() throws Exception { Ignite ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); GridCacheDatabaseSharedManager dbMgr = (GridCacheDatabaseSharedManager)((IgniteEx)ignite).context() .cache().context().database(); @@ -611,7 +612,7 @@ public void testRecoveryRandomPutRemove() throws Exception { ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.cache(CACHE_NAME).put(1, new IndexedValue(0)); } @@ -651,7 +652,7 @@ public void testRecoveryNoPageLost3() throws Exception { Ignite ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); if (pages != null) { List curPags = allocatedPages(ignite, CACHE2_NAME); @@ -704,7 +705,7 @@ private void recoveryNoPageLost(boolean checkpoint) throws Exception { Ignite ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); GridCacheDatabaseSharedManager dbMgr = (GridCacheDatabaseSharedManager)((IgniteEx)ignite).context() .cache().context().database(); @@ -787,7 +788,7 @@ public void testFreeListRecovery() throws Exception { Ignite ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache1 = ignite.cache(CACHE_NAME); IgniteCache cache2 = ignite.cache(CACHE2_NAME); @@ -823,7 +824,7 @@ public void testFreeListRecovery() throws Exception { ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache1 = ignite.cache(CACHE_NAME); cache2 = ignite.cache(CACHE2_NAME); @@ -879,7 +880,7 @@ public void testRollbackRecordOverlap() { public void testWalIteratorOverPartitionWithMissingEntries() throws Exception { Ignite ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRolloverRecordLoggingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRolloverRecordLoggingTest.java index 93741fb511877..d85c82f27e4a8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRolloverRecordLoggingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRolloverRecordLoggingTest.java @@ -20,6 +20,7 @@ import java.util.concurrent.ThreadLocalRandom; import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -91,7 +92,7 @@ private RolloverRecord() { public void testAvoidInfinityWaitingOnRolloverOfSegment() throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.getOrCreateCache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRolloverTypesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRolloverTypesTest.java index 805554d1008ad..a8fd71249cae6 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRolloverTypesTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRolloverTypesTest.java @@ -19,6 +19,7 @@ import java.util.concurrent.ThreadLocalRandom; import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -146,7 +147,7 @@ private void checkCurrentSegmentType(WALMode mode, boolean disableArch) throws E IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteWriteAheadLogManager walMgr = ig.context().cache().context().wal(); @@ -169,7 +170,7 @@ private void checkNextSegmentType(WALMode mode, boolean disableArch) throws Exce IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteWriteAheadLogManager walMgr = ig.context().cache().context().wal(); @@ -218,7 +219,7 @@ private void checkNextSegmentTypeWithCacheActivity(WALMode mode, boolean disable IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.getOrCreateCache(DEFAULT_CACHE_NAME); @@ -305,7 +306,7 @@ private void checkCurrentSegmentTypeWithCacheActivity(WALMode mode, boolean disa IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.getOrCreateCache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/crc/IgniteAbstractWalIteratorInvalidCrcTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/crc/IgniteAbstractWalIteratorInvalidCrcTest.java index 4ee015b0754cc..fc4452c75c0d7 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/crc/IgniteAbstractWalIteratorInvalidCrcTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/crc/IgniteAbstractWalIteratorInvalidCrcTest.java @@ -25,6 +25,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -89,7 +90,7 @@ public abstract class IgniteAbstractWalIteratorInvalidCrcTest extends GridCommon ignite = (IgniteEx)startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache(DEFAULT_CACHE_NAME); @@ -103,7 +104,7 @@ public abstract class IgniteAbstractWalIteratorInvalidCrcTest extends GridCommon for (int i = 0; i < insertingCnt; i++) cache.put(i, val); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); } /** {@inheritDoc} */ diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/crc/IgniteWithoutArchiverWalIteratorInvalidCrcTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/crc/IgniteWithoutArchiverWalIteratorInvalidCrcTest.java index d1ea7085ed543..0360c977552be 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/crc/IgniteWithoutArchiverWalIteratorInvalidCrcTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/crc/IgniteWithoutArchiverWalIteratorInvalidCrcTest.java @@ -22,6 +22,7 @@ import java.util.Random; import java.util.stream.Collectors; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -122,7 +123,7 @@ public void nodeShouldStartIfLogicalRecordCorruptedAfterCheckpointOrWalStart() t IgniteEx ex = startGrid(0); - ex.cluster().active(true); + ex.cluster().state(ClusterState.ACTIVE); } /** @@ -193,7 +194,7 @@ public void nodeShouldNotStartIfLastCheckpointRecordCorrupted() throws Exception private void startNodeAndPopulate() throws Exception { ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java index 2b281ef4ddaca..af1c8e27f3496 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java @@ -221,7 +221,7 @@ public void testFillWalAndReadRecords() throws Exception { Ignite ignite0 = startGrid(); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); Serializable consistentId = (Serializable)ignite0.cluster().localNode().consistentId(); @@ -343,7 +343,7 @@ private boolean checkWhetherWALRelatedEventFired(int evtType) throws Exception { Ignite ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); final IgniteEvents evts = ignite.events(); @@ -455,7 +455,7 @@ public void testArchiveIncompleteSegmentAfterInactivity() throws Exception { Ignite ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteEvents evts = ignite.events(); @@ -500,7 +500,7 @@ public void testFillWalForExactSegmentsCount() throws Exception { Ignite ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); final IgniteEvents evts = ignite.events(); @@ -581,7 +581,7 @@ private boolean remove(Map m, Object key, Object val) { public void testTxFillWalAndExtractDataRecords() throws Exception { Ignite ignite0 = startGrid(); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); int cntEntries = 1000; int txCnt = 100; @@ -683,7 +683,7 @@ private void scanIterateAndCount( public void testFillWalWithDifferentTypes() throws Exception { Ignite ig = startGrid(); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache addlCache = ig.getOrCreateCache(CACHE_ADDL_NAME); @@ -885,9 +885,9 @@ public void testReadEmptyWal() throws Exception { Ignite ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); final String subfolderName = genDbSubfolderName(ignite, 0); @@ -918,7 +918,7 @@ public void testReadEmptyWal() throws Exception { public void testIteratorWithCurrentKernelContext() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); int cntEntries = 100; @@ -1027,11 +1027,11 @@ public void testRemoveOperationPresentedForDataEntryForAtomic() throws Exception private void runRemoveOperationTest(CacheAtomicityMode mode) throws Exception { Ignite ignite = startGrid(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); createCache2(ignite, mode); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); String subfolderName = genDbSubfolderName(ignite, 0); @@ -1125,7 +1125,7 @@ public void testPrimaryFlagOnTwoNodes() throws Exception { cache.putAll(map); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); String subfolderName1 = genDbSubfolderName(ignite, 0); String subfolderName2 = genDbSubfolderName(ignite1, 1); @@ -1289,7 +1289,7 @@ public void testPutAllTxIntoTwoNodes() throws Exception { Ignite ignite = startGrid("node0"); Ignite ignite1 = startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); Map map = new TreeMap<>(); @@ -1300,7 +1300,7 @@ public void testPutAllTxIntoTwoNodes() throws Exception { ignite.cache(CACHE_NAME).putAll(map); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); String subfolderName1 = genDbSubfolderName(ignite, 0); String subfolderName2 = genDbSubfolderName(ignite1, 1); @@ -1426,7 +1426,7 @@ public void testTxRecordsReadWoBinaryMeta() throws Exception { public void testCheckBoundsIterator() throws Exception { Ignite ignite = startGrid("node0"); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); try (IgniteDataStreamer st = ignite.dataStreamer(CACHE_NAME)) { st.allowOverwrite(true); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/freelist/FreeListCachingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/freelist/FreeListCachingTest.java index 47d777e60226c..a87abcead92d3 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/freelist/FreeListCachingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/freelist/FreeListCachingTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -88,7 +89,7 @@ public class FreeListCachingTest extends GridCommonAbstractTest { public void testFreeListCaching() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); int partCnt = 10; @@ -231,7 +232,7 @@ public void testFreeListCaching() throws Exception { public void testPageListCacheLimit() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.getOrCreateCache("cache1"); ignite.getOrCreateCache("cache2"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/metastorage/IgniteMetaStorageBasicTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/metastorage/IgniteMetaStorageBasicTest.java index dadabc76cedf4..c6f4f4234f746 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/metastorage/IgniteMetaStorageBasicTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/metastorage/IgniteMetaStorageBasicTest.java @@ -30,6 +30,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -87,7 +88,7 @@ public class IgniteMetaStorageBasicTest extends GridCommonAbstractTest { public void testMetaStorageMassivePutFixed() throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCacheDatabaseSharedManager db = ig.context().cache().context().database(); @@ -125,7 +126,7 @@ public void testMetaStorageMassivePutFixed() throws Exception { public void testMetaStorageMassivePutRandom() throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCacheDatabaseSharedManager db = ig.context().cache().context().database(); @@ -189,7 +190,7 @@ public void testDeletePartitionFromMetaStorageMigration() throws Exception { try { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCacheDatabaseSharedManager db = ig.context().cache().context().database(); @@ -229,7 +230,7 @@ public void testDeletePartitionFromMetaStorageMigration() throws Exception { ig = (IgniteEx)startGrid(getTestIgniteInstanceName(0), optimize(cfg), null); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); db = ig.context().cache().context().database(); @@ -252,7 +253,7 @@ public void testDeletePartitionFromMetaStorageMigration() throws Exception { ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); db = ig.context().cache().context().database(); @@ -299,7 +300,7 @@ public void testMetaStorageMigration() throws Exception { try { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCacheDatabaseSharedManager db = ig.context().cache().context().database(); @@ -323,7 +324,7 @@ public void testMetaStorageMigration() throws Exception { ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); db = ig.context().cache().context().database(); @@ -431,7 +432,7 @@ private static void compare(Iterator> it, Iterator public void testMetaStorageMassivePutUpdateRestart() throws Exception { IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); final byte KEYS_CNT = 100; final String KEY_PREFIX = "test.key."; @@ -444,7 +445,7 @@ public void testMetaStorageMassivePutUpdateRestart() throws Exception { ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); verifyKeys(ig, KEYS_CNT, KEY_PREFIX, UPDATED_VAL_PREFIX); } @@ -456,7 +457,7 @@ public void testMetaStorageMassivePutUpdateRestart() throws Exception { public void testRecoveryOfMetastorageWhenNodeNotInBaseline() throws Exception { IgniteEx ig0 = startGrid(0); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); final byte KEYS_CNT = 100; final String KEY_PREFIX = "test.key."; @@ -485,7 +486,7 @@ public void testRecoveryOfMetastorageWhenNodeNotInBaseline() throws Exception { public void testReadOnlyIterationOrder() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); MetaStorage storage = ignite.context().cache().context().database().metaStorage(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryLazyAllocationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryLazyAllocationTest.java index 24386e53c6d0f..3ba22a31e3c01 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryLazyAllocationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryLazyAllocationTest.java @@ -20,6 +20,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -221,7 +222,7 @@ protected IgniteEx[] startSrv() throws Exception { IgniteEx srv0 = startGrid(0); IgniteEx srv1 = startGrid(1); - srv0.cluster().active(true); + srv0.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryLazyAllocationWithPDSTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryLazyAllocationWithPDSTest.java index 71c1913774928..25ccb5b3b617c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryLazyAllocationWithPDSTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryLazyAllocationWithPDSTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal.processors.cache.persistence.pagemem; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.failure.StopNodeFailureHandler; @@ -76,7 +77,7 @@ public void testHugeNotUsedMemoryRegion() throws Exception { startGrid(cfgWithHugeRegion("test-server-2")); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -86,7 +87,7 @@ public void testHugeNotUsedMemoryRegion() throws Exception { startGrid(cfgWithHugeRegion("test-server-2")); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); } /** */ @@ -97,7 +98,7 @@ public void testCreateCacheFailsInHugeMemoryRegion() throws Exception { IgniteEx srv = startGrid(cfgWithHugeRegion("test-server") .setFailureHandler(new StopNodeFailureHandler())); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); } @@ -113,7 +114,7 @@ public void testCreateCacheFromClientFailsInHugeMemoryRegion() throws Exception IgniteEx clnt = startClientGrid(cfgWithHugeRegion("test-client") .setFailureHandler(new StopNodeFailureHandler())); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottleSandboxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottleSandboxTest.java index 9a890c547625c..a0dd4f0e0d6d1 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottleSandboxTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottleSandboxTest.java @@ -31,6 +31,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -110,7 +111,7 @@ public class PagesWriteThrottleSandboxTest extends GridCommonAbstractTest { */ @Test public void testThrottle() throws Exception { - startGrids(1).active(true); + startGrids(1).cluster().state(ClusterState.ACTIVE); try { final Ignite ig = ignite(0); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottleSmokeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottleSmokeTest.java index 19e74c3f1b5f9..30423759ed485 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottleSmokeTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottleSmokeTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -113,7 +114,7 @@ public class PagesWriteThrottleSmokeTest extends GridCommonAbstractTest { */ @Test public void testThrottle() throws Exception { - startGrids(2).active(true); + startGrids(2).cluster().state(ClusterState.ACTIVE); try { IgniteEx ig = ignite(0); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/UsedPagesMetricAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/UsedPagesMetricAbstractTest.java index 1a5032a20272b..96c89f3826d34 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/UsedPagesMetricAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/UsedPagesMetricAbstractTest.java @@ -19,6 +19,7 @@ import org.apache.ignite.DataRegionMetrics; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; /** @@ -51,7 +52,7 @@ protected void testFillAndRemove( ) throws Exception { Ignite node = startGrids(nodeCnt); - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); IgniteCache cache = node.getOrCreateCache(MY_CACHE); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/AbstractNodeJoinTemplate.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/AbstractNodeJoinTemplate.java index 0936244d7867b..5284bff49afdb 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/AbstractNodeJoinTemplate.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/AbstractNodeJoinTemplate.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.Map; import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -613,12 +614,12 @@ public void execute() throws Exception { IgniteEx crd = grid(nodes.get(0)); for (IgniteEx ig : grids()) - assertEquals((boolean)state, ig.active()); + assertEquals((boolean)state, ig.cluster().state().active()); if (!state) { System.out.println(">>> Activate cluster"); - crd.active(true); + crd.cluster().state(ClusterState.ACTIVE); System.out.println(">>> Check after cluster activated"); @@ -627,7 +628,7 @@ public void execute() throws Exception { else { System.out.println(">>> DeActivate cluster"); - crd.active(false); + crd.cluster().state(ClusterState.INACTIVE); System.out.println(">>> Check after cluster deActivated"); @@ -635,7 +636,7 @@ public void execute() throws Exception { System.out.println(">>> Activate cluster"); - crd.active(true); + crd.cluster().state(ClusterState.ACTIVE); } AffinityTopologyVersion next0Ver = nextMinorVersion(crd); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateAbstractTest.java index 1cbcfb132d980..ddb6d48ecf1e9 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateAbstractTest.java @@ -23,6 +23,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ThreadLocalRandom; import org.apache.ignite.Ignite; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -156,7 +157,7 @@ void startPrimaryNodes(int cnt) throws Exception { startPrimary(i); if (cnt > 0) - grid("node0" + primarySuffix).active(true); + grid("node0" + primarySuffix).cluster().state(ClusterState.ACTIVE); } /** diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateCacheTest.java index c8ae6e89f34d8..9bcfe9b7e2fc8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateCacheTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateCacheTest.java @@ -19,6 +19,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.processors.cache.GridCacheProcessor; @@ -50,7 +51,7 @@ public void testCheckValueAfterActivation() { stopAllPrimary(); - ig1B.active(true); + ig1B.cluster().state(ClusterState.ACTIVE); IgniteCache cache1B = ig1B.cache(cacheName); IgniteCache cache2B = ig2B.cache(cacheName); @@ -99,7 +100,7 @@ public void testMoreKeyValueAfterActivate() throws Exception { stopAllPrimary(); - ig1B.active(true); + ig1B.cluster().state(ClusterState.ACTIVE); IgniteCache cache1B = ig1B.cache(cacheName); IgniteCache cache2B = ig2B.cache(cacheName); @@ -134,11 +135,11 @@ public void testDeActivateAndActivateCacheValue() throws Exception { cacheExp.put("key", "value"); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); - ig2.active(false); + ig2.cluster().state(ClusterState.INACTIVE); IgniteEx ex1 = (IgniteEx)ig1; IgniteEx ex2 = (IgniteEx)ig2; @@ -152,15 +153,15 @@ public void testDeActivateAndActivateCacheValue() throws Exception { assertTrue(F.isEmpty(cache2.jcaches())); assertTrue(F.isEmpty(cache3.jcaches())); - assertTrue(!ig1.active()); - assertTrue(!ig2.active()); - assertTrue(!ig3.active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!ig3.cluster().state().active()); - ig3.active(true); + ig3.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); IgniteCache cacheAct = ig2.cache(chName); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateDataStreamerTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateDataStreamerTest.java index e34beef5d39f1..ab0356cc2c0a7 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateDataStreamerTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateDataStreamerTest.java @@ -20,6 +20,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteDataStreamer; +import org.apache.ignite.cluster.ClusterState; import org.junit.Test; /** @@ -49,13 +50,13 @@ public void testDeActivateAndActivateDataStreamer() throws Exception { Ignite ig2C = primaryClient(1); Ignite ig3C = primaryClient(2); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); - assertTrue(ig1C.active()); - assertTrue(ig2C.active()); - assertTrue(ig3C.active()); + assertTrue(ig1C.cluster().state().active()); + assertTrue(ig2C.cluster().state().active()); + assertTrue(ig3C.cluster().state().active()); String cacheName = "myStreamCache"; @@ -66,15 +67,15 @@ public void testDeActivateAndActivateDataStreamer() throws Exception { stmr.addData(i, Integer.toString(i)); } - ig2C.active(false); + ig2C.cluster().state(ClusterState.INACTIVE); - assertTrue(!ig1.active()); - assertTrue(!ig2.active()); - assertTrue(!ig3.active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!ig3.cluster().state().active()); - assertTrue(!ig1C.active()); - assertTrue(!ig2C.active()); - assertTrue(!ig3C.active()); + assertTrue(!ig1C.cluster().state().active()); + assertTrue(!ig2C.cluster().state().active()); + assertTrue(!ig3C.cluster().state().active()); boolean fail = false; @@ -90,15 +91,15 @@ public void testDeActivateAndActivateDataStreamer() throws Exception { if (!fail) fail("exception was not throw"); - ig3C.active(true); + ig3C.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); - assertTrue(ig1C.active()); - assertTrue(ig2C.active()); - assertTrue(ig3C.active()); + assertTrue(ig1C.cluster().state().active()); + assertTrue(ig2C.cluster().state().active()); + assertTrue(ig3C.cluster().state().active()); try (IgniteDataStreamer stmr2 = ig2.dataStreamer(cacheName)) { for (int i = 100; i < 200; i++) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateDataStructureTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateDataStructureTest.java index 6b7540d567d09..d28f737e21e19 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateDataStructureTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateDataStructureTest.java @@ -23,6 +23,7 @@ import org.apache.ignite.IgniteAtomicLong; import org.apache.ignite.IgniteAtomicSequence; import org.apache.ignite.IgniteCountDownLatch; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.processors.cache.GridCacheProcessor; import org.apache.ignite.internal.util.typedef.F; @@ -54,11 +55,11 @@ public void testDeActivateAndActivateAtomicLong() throws Exception { lexp.incrementAndGet(); lexp.incrementAndGet(); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); - ig2.active(false); + ig2.cluster().state(ClusterState.INACTIVE); IgniteEx ex1 = (IgniteEx)ig1; IgniteEx ex2 = (IgniteEx)ig2; @@ -72,15 +73,15 @@ public void testDeActivateAndActivateAtomicLong() throws Exception { assertTrue(F.isEmpty(cache2.jcaches())); assertTrue(F.isEmpty(cache3.jcaches())); - assertTrue(!ig1.active()); - assertTrue(!ig2.active()); - assertTrue(!ig3.active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!ig3.cluster().state().active()); - ig3.active(true); + ig3.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); IgniteAtomicLong lact1 = ig1.atomicLong(lName, 0, false); IgniteAtomicLong lact2 = ig2.atomicLong(lName, 0, false); @@ -128,11 +129,11 @@ public void testDeActivateAndActivateCountDownLatch() throws Exception { assertEquals(4, latchExp1.count()); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); - ig2.active(false); + ig2.cluster().state(ClusterState.INACTIVE); IgniteEx ex1 = (IgniteEx)ig1; IgniteEx ex2 = (IgniteEx)ig2; @@ -146,15 +147,15 @@ public void testDeActivateAndActivateCountDownLatch() throws Exception { assertTrue(F.isEmpty(cache2.jcaches())); assertTrue(F.isEmpty(cache3.jcaches())); - assertTrue(!ig1.active()); - assertTrue(!ig2.active()); - assertTrue(!ig3.active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!ig3.cluster().state().active()); - ig3.active(true); + ig3.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); final IgniteCountDownLatch latchAct1 = ig1.countDownLatch(latchName, 0, false, false); final IgniteCountDownLatch latchAct2 = ig2.countDownLatch(latchName, 0, false, false); @@ -226,11 +227,11 @@ public void testDeActivateAndActivateAtomicSequence() { seqExp2.incrementAndGet(); seqExp3.incrementAndGet(); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); - ig2.active(false); + ig2.cluster().state(ClusterState.INACTIVE); IgniteEx ex1 = (IgniteEx)ig1; IgniteEx ex2 = (IgniteEx)ig2; @@ -244,15 +245,15 @@ public void testDeActivateAndActivateAtomicSequence() { assertTrue(F.isEmpty(cache2.jcaches())); assertTrue(F.isEmpty(cache3.jcaches())); - assertTrue(!ig1.active()); - assertTrue(!ig2.active()); - assertTrue(!ig3.active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!ig3.cluster().state().active()); - ig3.active(true); + ig3.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); IgniteAtomicSequence seqAct1 = ig1.atomicSequence(seqName, 0, false); IgniteAtomicSequence seqAct2 = ig2.atomicSequence(seqName, 0, false); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java index 2f7c1b2dc2b86..537acfabb50fb 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateFailOverTest.java @@ -24,6 +24,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteInternalFuture; import org.junit.Test; @@ -64,9 +65,9 @@ public void testActivateDeActivateOnFixTopology() throws Exception { final Ignite igB2 = backUp(1); final Ignite igB3 = backUp(2); - assertTrue(!igB1.active()); - assertTrue(!igB2.active()); - assertTrue(!igB3.active()); + assertTrue(!igB1.cluster().state().active()); + assertTrue(!igB2.cluster().state().active()); + assertTrue(!igB3.cluster().state().active()); final AtomicInteger cntA = new AtomicInteger(); final AtomicInteger cntD = new AtomicInteger(); @@ -87,14 +88,14 @@ public void testActivateDeActivateOnFixTopology() throws Exception { if (canAct.get()) { long start = System.currentTimeMillis(); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); timeA.addAndGet((System.currentTimeMillis() - start)); cntA.incrementAndGet(); for (Ignite ign : allBackUpNodes()) - assertTrue(ign.active()); + assertTrue(ign.cluster().state().active()); canAct.set(false); } @@ -112,14 +113,14 @@ public void testActivateDeActivateOnFixTopology() throws Exception { if (!canAct.get()) { long start = System.currentTimeMillis(); - ig.active(false); + ig.cluster().state(ClusterState.INACTIVE); timeD.addAndGet((System.currentTimeMillis() - start)); cntD.incrementAndGet(); for (Ignite ign : allBackUpNodes()) - assertTrue(!ign.active()); + assertTrue(!ign.cluster().state().active()); canAct.set(true); } @@ -151,9 +152,9 @@ public void testActivateDeActivateOnJoiningNode() throws Exception { final Ignite igB2 = backUp(1); final Ignite igB3 = backUp(2); - assertTrue(!igB1.active()); - assertTrue(!igB2.active()); - assertTrue(!igB3.active()); + assertTrue(!igB1.cluster().state().active()); + assertTrue(!igB2.cluster().state().active()); + assertTrue(!igB3.cluster().state().active()); final AtomicInteger cntA = new AtomicInteger(); final AtomicInteger cntD = new AtomicInteger(); @@ -178,14 +179,14 @@ public void testActivateDeActivateOnJoiningNode() throws Exception { long start = System.currentTimeMillis(); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); timeA.addAndGet((System.currentTimeMillis() - start)); cntA.incrementAndGet(); for (Ignite ign : allBackUpNodes()) - assertTrue(ign.active()); + assertTrue(ign.cluster().state().active()); } finally { rwLock.readLock().unlock(); @@ -206,14 +207,14 @@ public void testActivateDeActivateOnJoiningNode() throws Exception { long start = System.currentTimeMillis(); - ig.active(false); + ig.cluster().state(ClusterState.INACTIVE); timeD.addAndGet((System.currentTimeMillis() - start)); cntD.incrementAndGet(); for (Ignite ign : allBackUpNodes()) - assertTrue(!ign.active()); + assertTrue(!ign.cluster().state().active()); } finally { rwLock.writeLock().unlock(); @@ -285,9 +286,9 @@ public void testActivateDeActivateOnFixTopologyWithPutValues() throws Exception final Ignite igB2 = backUp(1); final Ignite igB3 = backUp(2); - assertTrue(!igB1.active()); - assertTrue(!igB2.active()); - assertTrue(!igB3.active()); + assertTrue(!igB1.cluster().state().active()); + assertTrue(!igB2.cluster().state().active()); + assertTrue(!igB3.cluster().state().active()); final CacheConfiguration ccfg = new CacheConfiguration<>(); ccfg.setName("main-cache"); @@ -313,7 +314,7 @@ public void testActivateDeActivateOnFixTopologyWithPutValues() throws Exception if (canAct.get()) { long start = System.currentTimeMillis(); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.getOrCreateCache(ccfg); @@ -326,7 +327,7 @@ public void testActivateDeActivateOnFixTopologyWithPutValues() throws Exception cntA.incrementAndGet(); for (Ignite ign : allBackUpNodes()) - assertTrue(ign.active()); + assertTrue(ign.cluster().state().active()); canAct.set(false); } @@ -349,14 +350,14 @@ public void testActivateDeActivateOnFixTopologyWithPutValues() throws Exception for (int i = 0; i < cnt.get(); i++) assertEquals("value" + i, cache.get("key" + i)); - ig.active(false); + ig.cluster().state(ClusterState.INACTIVE); timeD.addAndGet((System.currentTimeMillis() - start)); cntD.incrementAndGet(); for (Ignite ign : allBackUpNodes()) - assertTrue(!ign.active()); + assertTrue(!ign.cluster().state().active()); canAct.set(true); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateServiceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateServiceTest.java index 58940b5adaa6f..dee6f19dfedda 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateServiceTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateServiceTest.java @@ -19,6 +19,7 @@ import java.util.Collection; import org.apache.ignite.Ignite; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.services.Service; @@ -69,7 +70,7 @@ public void testDeployService() throws Exception { stopAllPrimary(); - ig1B.active(true); + ig1B.cluster().state(ClusterState.ACTIVE); U.sleep(3000); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateTest.java index 946db4e2210cc..be03d76b06f96 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteServices; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.processors.cache.GridCacheProcessor; @@ -55,21 +56,21 @@ public void testStopPrimaryAndActivateFromServerNode() throws Exception { Ignite ig2B = backUp(1); Ignite ig3B = backUp(2); - assertTrue(ig1P.active()); - assertTrue(ig2P.active()); - assertTrue(ig3P.active()); + assertTrue(ig1P.cluster().state().active()); + assertTrue(ig2P.cluster().state().active()); + assertTrue(ig3P.cluster().state().active()); - assertTrue(!ig1B.active()); - assertTrue(!ig2B.active()); - assertTrue(!ig3B.active()); + assertTrue(!ig1B.cluster().state().active()); + assertTrue(!ig2B.cluster().state().active()); + assertTrue(!ig3B.cluster().state().active()); stopAllPrimary(); - ig2B.active(true); + ig2B.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1B.active()); - assertTrue(ig2B.active()); - assertTrue(ig3B.active()); + assertTrue(ig1B.cluster().state().active()); + assertTrue(ig2B.cluster().state().active()); + assertTrue(ig3B.cluster().state().active()); } /** @@ -89,29 +90,29 @@ public void testStopPrimaryAndActivateFromClientNode() throws Exception { Ignite ig2C = backUpClient(1); Ignite ig3C = backUpClient(2); - assertTrue(ig1P.active()); - assertTrue(ig2P.active()); - assertTrue(ig3P.active()); + assertTrue(ig1P.cluster().state().active()); + assertTrue(ig2P.cluster().state().active()); + assertTrue(ig3P.cluster().state().active()); - assertTrue(!ig1B.active()); - assertTrue(!ig2B.active()); - assertTrue(!ig3B.active()); + assertTrue(!ig1B.cluster().state().active()); + assertTrue(!ig2B.cluster().state().active()); + assertTrue(!ig3B.cluster().state().active()); - assertTrue(!ig1C.active()); - assertTrue(!ig2C.active()); - assertTrue(!ig3C.active()); + assertTrue(!ig1C.cluster().state().active()); + assertTrue(!ig2C.cluster().state().active()); + assertTrue(!ig3C.cluster().state().active()); stopAllPrimary(); - ig2B.active(true); + ig2B.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1B.active()); - assertTrue(ig2B.active()); - assertTrue(ig3B.active()); + assertTrue(ig1B.cluster().state().active()); + assertTrue(ig2B.cluster().state().active()); + assertTrue(ig3B.cluster().state().active()); - assertTrue(ig1C.active()); - assertTrue(ig2C.active()); - assertTrue(ig3C.active()); + assertTrue(ig1C.cluster().state().active()); + assertTrue(ig2C.cluster().state().active()); + assertTrue(ig3C.cluster().state().active()); } /** @@ -127,9 +128,9 @@ public void testConcurrentActivateFromClientNodeAndServerNode() throws Exception final Ignite ig2C = backUpClient(1); final Ignite ig3C = backUpClient(2); - assertTrue(!ig1B.active()); - assertTrue(!ig2B.active()); - assertTrue(!ig3B.active()); + assertTrue(!ig1B.cluster().state().active()); + assertTrue(!ig2B.cluster().state().active()); + assertTrue(!ig3B.cluster().state().active()); stopAllPrimary(); @@ -139,7 +140,7 @@ public void testConcurrentActivateFromClientNodeAndServerNode() throws Exception @Override public Void call() throws Exception { barrier.await(); - ig1B.active(true); + ig1B.cluster().state(ClusterState.ACTIVE); return null; } @@ -149,7 +150,7 @@ public void testConcurrentActivateFromClientNodeAndServerNode() throws Exception @Override public Void call() throws Exception { barrier.await(); - ig2B.active(true); + ig2B.cluster().state(ClusterState.ACTIVE); return null; } @@ -159,7 +160,7 @@ public void testConcurrentActivateFromClientNodeAndServerNode() throws Exception @Override public Void call() throws Exception { barrier.await(); - ig3B.active(true); + ig3B.cluster().state(ClusterState.ACTIVE); return null; } @@ -169,7 +170,7 @@ public void testConcurrentActivateFromClientNodeAndServerNode() throws Exception @Override public Void call() throws Exception { barrier.await(); - ig1C.active(true); + ig1C.cluster().state(ClusterState.ACTIVE); return null; } @@ -179,7 +180,7 @@ public void testConcurrentActivateFromClientNodeAndServerNode() throws Exception @Override public Void call() throws Exception { barrier.await(); - ig2C.active(true); + ig2C.cluster().state(ClusterState.ACTIVE); return null; } @@ -189,7 +190,7 @@ public void testConcurrentActivateFromClientNodeAndServerNode() throws Exception @Override public Void call() throws Exception { barrier.await(); - ig3C.active(true); + ig3C.cluster().state(ClusterState.ACTIVE); return null; } @@ -203,13 +204,13 @@ public void testConcurrentActivateFromClientNodeAndServerNode() throws Exception f5.get(); f6.get(); - assertTrue(ig1B.active()); - assertTrue(ig2B.active()); - assertTrue(ig3B.active()); + assertTrue(ig1B.cluster().state().active()); + assertTrue(ig2B.cluster().state().active()); + assertTrue(ig3B.cluster().state().active()); - assertTrue(ig1C.active()); - assertTrue(ig2C.active()); - assertTrue(ig3C.active()); + assertTrue(ig1C.cluster().state().active()); + assertTrue(ig2C.cluster().state().active()); + assertTrue(ig3C.cluster().state().active()); } /** @@ -221,9 +222,9 @@ public void testConcurrentActivateFromServerNode() throws Exception { final Ignite ig2B = backUp(1); final Ignite ig3B = backUp(2); - assertTrue(!ig1B.active()); - assertTrue(!ig2B.active()); - assertTrue(!ig3B.active()); + assertTrue(!ig1B.cluster().state().active()); + assertTrue(!ig2B.cluster().state().active()); + assertTrue(!ig3B.cluster().state().active()); stopAllPrimary(); @@ -233,7 +234,7 @@ public void testConcurrentActivateFromServerNode() throws Exception { @Override public Void call() throws Exception { barrier.await(); - ig1B.active(true); + ig1B.cluster().state(ClusterState.ACTIVE); return null; } @@ -243,7 +244,7 @@ public void testConcurrentActivateFromServerNode() throws Exception { @Override public Void call() throws Exception { barrier.await(); - ig2B.active(true); + ig2B.cluster().state(ClusterState.ACTIVE); return null; } @@ -253,7 +254,7 @@ public void testConcurrentActivateFromServerNode() throws Exception { @Override public Void call() throws Exception { barrier.await(); - ig3B.active(true); + ig3B.cluster().state(ClusterState.ACTIVE); return null; } @@ -263,9 +264,9 @@ public void testConcurrentActivateFromServerNode() throws Exception { act2.get(); act3.get(); - assertTrue(ig1B.active()); - assertTrue(ig2B.active()); - assertTrue(ig3B.active()); + assertTrue(ig1B.cluster().state().active()); + assertTrue(ig2B.cluster().state().active()); + assertTrue(ig3B.cluster().state().active()); } /** @@ -323,45 +324,45 @@ public void testActivateOnAlreadyActivatedCluster() throws Exception { Ignite ig2C = backUpClient(1); Ignite ig3C = backUpClient(2); - assertTrue(ig1P.active()); - assertTrue(ig2P.active()); - assertTrue(ig3P.active()); + assertTrue(ig1P.cluster().state().active()); + assertTrue(ig2P.cluster().state().active()); + assertTrue(ig3P.cluster().state().active()); - assertTrue(!ig1B.active()); - assertTrue(!ig2B.active()); - assertTrue(!ig3B.active()); + assertTrue(!ig1B.cluster().state().active()); + assertTrue(!ig2B.cluster().state().active()); + assertTrue(!ig3B.cluster().state().active()); - assertTrue(!ig1C.active()); - assertTrue(!ig2C.active()); - assertTrue(!ig3C.active()); + assertTrue(!ig1C.cluster().state().active()); + assertTrue(!ig2C.cluster().state().active()); + assertTrue(!ig3C.cluster().state().active()); stopAllPrimary(); - ig2B.active(true); + ig2B.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1B.active()); - assertTrue(ig2B.active()); - assertTrue(ig3B.active()); + assertTrue(ig1B.cluster().state().active()); + assertTrue(ig2B.cluster().state().active()); + assertTrue(ig3B.cluster().state().active()); - assertTrue(ig1C.active()); - assertTrue(ig2C.active()); - assertTrue(ig3C.active()); + assertTrue(ig1C.cluster().state().active()); + assertTrue(ig2C.cluster().state().active()); + assertTrue(ig3C.cluster().state().active()); - ig1B.active(true); - ig2B.active(true); - ig3B.active(true); + ig1B.cluster().state(ClusterState.ACTIVE); + ig2B.cluster().state(ClusterState.ACTIVE); + ig3B.cluster().state(ClusterState.ACTIVE); - ig1C.active(true); - ig2C.active(true); - ig3C.active(true); + ig1C.cluster().state(ClusterState.ACTIVE); + ig2C.cluster().state(ClusterState.ACTIVE); + ig3C.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1B.active()); - assertTrue(ig2B.active()); - assertTrue(ig3B.active()); + assertTrue(ig1B.cluster().state().active()); + assertTrue(ig2B.cluster().state().active()); + assertTrue(ig3B.cluster().state().active()); - assertTrue(ig1C.active()); - assertTrue(ig2C.active()); - assertTrue(ig3C.active()); + assertTrue(ig1C.cluster().state().active()); + assertTrue(ig2C.cluster().state().active()); + assertTrue(ig3C.cluster().state().active()); } /** @@ -377,13 +378,13 @@ public void testTryUseCacheInActiveCluster() throws Exception { Ignite ig2C = backUpClient(1); Ignite ig3C = backUpClient(2); - assertTrue(!ig1B.active()); - assertTrue(!ig2B.active()); - assertTrue(!ig3B.active()); + assertTrue(!ig1B.cluster().state().active()); + assertTrue(!ig2B.cluster().state().active()); + assertTrue(!ig3B.cluster().state().active()); - assertTrue(!ig1C.active()); - assertTrue(!ig2C.active()); - assertTrue(!ig3C.active()); + assertTrue(!ig1C.cluster().state().active()); + assertTrue(!ig2C.cluster().state().active()); + assertTrue(!ig3C.cluster().state().active()); checkExceptionTryUseCache(ig1B); checkExceptionTryUseCache(ig2B); @@ -420,13 +421,13 @@ public void testTryUseServiceInActiveCluster() throws Exception { Ignite ig2C = backUpClient(1); Ignite ig3C = backUpClient(2); - assertTrue(!ig1B.active()); - assertTrue(!ig2B.active()); - assertTrue(!ig3B.active()); + assertTrue(!ig1B.cluster().state().active()); + assertTrue(!ig2B.cluster().state().active()); + assertTrue(!ig3B.cluster().state().active()); - assertTrue(!ig1C.active()); - assertTrue(!ig2C.active()); - assertTrue(!ig3C.active()); + assertTrue(!ig1C.cluster().state().active()); + assertTrue(!ig2C.cluster().state().active()); + assertTrue(!ig3C.cluster().state().active()); checkExceptionTryUseService(ig1B); checkExceptionTryUseService(ig2B); @@ -463,13 +464,13 @@ public void testTryUseDataStructureInActiveCluster() throws Exception { Ignite ig2C = backUpClient(1); Ignite ig3C = backUpClient(2); - assertTrue(!ig1B.active()); - assertTrue(!ig2B.active()); - assertTrue(!ig3B.active()); + assertTrue(!ig1B.cluster().state().active()); + assertTrue(!ig2B.cluster().state().active()); + assertTrue(!ig3B.cluster().state().active()); - assertTrue(!ig1C.active()); - assertTrue(!ig2C.active()); - assertTrue(!ig3C.active()); + assertTrue(!ig1C.cluster().state().active()); + assertTrue(!ig2C.cluster().state().active()); + assertTrue(!ig3C.cluster().state().active()); checkExceptionTryUseDataStructure(ig1B); checkExceptionTryUseDataStructure(ig2B); @@ -511,24 +512,24 @@ public void testFailGetLock() throws Exception { final Ignite ig3C = backUpClient(2); - assertTrue(ig1P.active()); - assertTrue(ig2P.active()); - assertTrue(ig3P.active()); + assertTrue(ig1P.cluster().state().active()); + assertTrue(ig2P.cluster().state().active()); + assertTrue(ig3P.cluster().state().active()); - assertTrue(!ig1B.active()); - assertTrue(!ig2B.active()); - assertTrue(!ig3B.active()); + assertTrue(!ig1B.cluster().state().active()); + assertTrue(!ig2B.cluster().state().active()); + assertTrue(!ig3B.cluster().state().active()); - assertTrue(!ig1C.active()); - assertTrue(!ig2C.active()); - assertTrue(!ig3C.active()); + assertTrue(!ig1C.cluster().state().active()); + assertTrue(!ig2C.cluster().state().active()); + assertTrue(!ig3C.cluster().state().active()); stopPrimary(0); boolean exc = false; try { - ig3C.active(true); + ig3C.cluster().state(ClusterState.ACTIVE); } catch (IgniteException e) { exc = true; @@ -542,13 +543,13 @@ public void testFailGetLock() throws Exception { if (!exc) fail(); - assertTrue(!ig1B.active()); - assertTrue(!ig2B.active()); - assertTrue(!ig3B.active()); + assertTrue(!ig1B.cluster().state().active()); + assertTrue(!ig2B.cluster().state().active()); + assertTrue(!ig3B.cluster().state().active()); - assertTrue(!ig1C.active()); - assertTrue(!ig2C.active()); - assertTrue(!ig3C.active()); + assertTrue(!ig1C.cluster().state().active()); + assertTrue(!ig2C.cluster().state().active()); + assertTrue(!ig3C.cluster().state().active()); } /** @@ -573,22 +574,22 @@ public void testActivateAfterFailGetLock() throws Exception { Ignite ig2CB = backUpClient(1); Ignite ig3CB = backUpClient(2); - assertTrue(ig1P.active()); - assertTrue(ig2P.active()); - assertTrue(ig3P.active()); + assertTrue(ig1P.cluster().state().active()); + assertTrue(ig2P.cluster().state().active()); + assertTrue(ig3P.cluster().state().active()); - assertTrue(!ig1B.active()); - assertTrue(!ig2B.active()); - assertTrue(!ig3B.active()); + assertTrue(!ig1B.cluster().state().active()); + assertTrue(!ig2B.cluster().state().active()); + assertTrue(!ig3B.cluster().state().active()); - assertTrue(!ig1CB.active()); - assertTrue(!ig2CB.active()); - assertTrue(!ig3CB.active()); + assertTrue(!ig1CB.cluster().state().active()); + assertTrue(!ig2CB.cluster().state().active()); + assertTrue(!ig3CB.cluster().state().active()); stopPrimary(0); try { - ig3CB.active(true); + ig3CB.cluster().state(ClusterState.ACTIVE); fail("Activation should fail"); } @@ -599,32 +600,32 @@ public void testActivateAfterFailGetLock() throws Exception { assertTrue(t.getMessage().contains("can't get lock during")); } - assertTrue(!ig1B.active()); - assertTrue(!ig2B.active()); - assertTrue(!ig3B.active()); + assertTrue(!ig1B.cluster().state().active()); + assertTrue(!ig2B.cluster().state().active()); + assertTrue(!ig3B.cluster().state().active()); - assertTrue(!ig1CB.active()); - assertTrue(!ig2CB.active()); - assertTrue(!ig3CB.active()); + assertTrue(!ig1CB.cluster().state().active()); + assertTrue(!ig2CB.cluster().state().active()); + assertTrue(!ig3CB.cluster().state().active()); - assertTrue(ig2P.active()); - assertTrue(ig3P.active()); + assertTrue(ig2P.cluster().state().active()); + assertTrue(ig3P.cluster().state().active()); - assertTrue(ig1CP.active()); - assertTrue(ig2CP.active()); - assertTrue(ig3CP.active()); + assertTrue(ig1CP.cluster().state().active()); + assertTrue(ig2CP.cluster().state().active()); + assertTrue(ig3CP.cluster().state().active()); stopAllPrimary(); - ig2CB.active(true); + ig2CB.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1B.active()); - assertTrue(ig2B.active()); - assertTrue(ig3B.active()); + assertTrue(ig1B.cluster().state().active()); + assertTrue(ig2B.cluster().state().active()); + assertTrue(ig3B.cluster().state().active()); - assertTrue(ig1CB.active()); - assertTrue(ig2CB.active()); - assertTrue(ig3CB.active()); + assertTrue(ig1CB.cluster().state().active()); + assertTrue(ig2CB.cluster().state().active()); + assertTrue(ig3CB.cluster().state().active()); } /** @@ -636,15 +637,15 @@ public void testDeActivateFromServerNode() throws Exception { Ignite ig2 = primary(1); Ignite ig3 = primary(2); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); - ig1.active(false); + ig1.cluster().state(ClusterState.INACTIVE); - assertTrue(!ig1.active()); - assertTrue(!ig2.active()); - assertTrue(!ig3.active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!ig3.cluster().state().active()); } /** @@ -660,19 +661,19 @@ public void testDeActivateFromClientNode() throws Exception { Ignite ig2C = primaryClient(1); Ignite ig3C = primaryClient(2); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); - ig1C.active(false); + ig1C.cluster().state(ClusterState.INACTIVE); - assertTrue(!ig1.active()); - assertTrue(!ig2.active()); - assertTrue(!ig3.active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!ig3.cluster().state().active()); - assertTrue(!ig1C.active()); - assertTrue(!ig2C.active()); - assertTrue(!ig3C.active()); + assertTrue(!ig1C.cluster().state().active()); + assertTrue(!ig2C.cluster().state().active()); + assertTrue(!ig3C.cluster().state().active()); } /** @@ -688,15 +689,15 @@ public void testDeActivateCheckCacheDestroy() throws Exception { ig1.getOrCreateCache(chName); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); - ig1.active(false); + ig1.cluster().state(ClusterState.INACTIVE); - assertTrue(!ig1.active()); - assertTrue(!ig2.active()); - assertTrue(!ig3.active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!ig3.cluster().state().active()); IgniteEx ex = (IgniteEx)ig1; diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteNoParrallelClusterIsAllowedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteNoParrallelClusterIsAllowedTest.java index 070a1faf2e18b..974ffacfe8bed 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteNoParrallelClusterIsAllowedTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteNoParrallelClusterIsAllowedTest.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors.cache.persistence.standbycluster; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.util.typedef.internal.U; import org.junit.Test; @@ -33,15 +34,15 @@ public void testSimple() throws Exception { tryToStartBackupClusterWhatShouldFail(); - primary(0).cluster().active(true); + primary(0).cluster().state(ClusterState.ACTIVE); tryToStartBackupClusterWhatShouldFail(); - primary(0).cluster().active(false); + primary(0).cluster().state(ClusterState.INACTIVE); tryToStartBackupClusterWhatShouldFail(); - primary(0).cluster().active(true); + primary(0).cluster().state(ClusterState.ACTIVE); tryToStartBackupClusterWhatShouldFail(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteStandByClusterTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteStandByClusterTest.java index 8758340a8749b..22daaa9041232 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteStandByClusterTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteStandByClusterTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -80,15 +81,15 @@ public void testStartDynamicCachesAfterActivation() throws Exception { IgniteEx ig2 = startGrid(cfg2); IgniteEx ig3 = startClientGrid(cfg3); - assertTrue(!ig1.active()); - assertTrue(!ig2.active()); - assertTrue(!ig3.active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!ig3.cluster().state().active()); - ig3.active(true); + ig3.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); ig3.createCache(new CacheConfiguration<>(cacheName)); @@ -100,17 +101,17 @@ public void testStartDynamicCachesAfterActivation() throws Exception { assertNotNull(ig3.cache(cacheName0)); assertNotNull(ig2.cache(cacheName0)); - ig3.active(false); + ig3.cluster().state(ClusterState.INACTIVE); - assertTrue(!ig1.active()); - assertTrue(!ig2.active()); - assertTrue(!ig3.active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!ig3.cluster().state().active()); - ig3.active(true); + ig3.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); assertNotNull(ig1.cache(cacheName)); assertNotNull(ig2.cache(cacheName)); @@ -154,15 +155,15 @@ public void testStaticCacheStartAfterActivationWithCacheFilter() throws Exceptio IgniteEx ig2 = startGrid(cfg2); IgniteEx ig3 = startGrid(cfg3); - assertTrue(!ig1.active()); - assertTrue(!ig2.active()); - assertTrue(!ig3.active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!ig3.cluster().state().active()); - ig3.active(true); + ig3.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.active()); - assertTrue(ig2.active()); - assertTrue(ig3.active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(ig3.cluster().state().active()); for (IgniteEx ig : Arrays.asList(ig1, ig2, ig3)) { Map desc = U.field( @@ -201,7 +202,7 @@ public void testStaticCacheStartAfterActivationWithCacheFilter() throws Exceptio public void testSimple() throws Exception { IgniteEx ig = startGrid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = ig.getOrCreateCache("cache"); @@ -209,11 +210,11 @@ public void testSimple() throws Exception { assertEquals("1", cache0.get(1)); - ig.active(false); + ig.cluster().state(ClusterState.INACTIVE); - assertTrue(!ig.active()); + assertTrue(!ig.cluster().state().active()); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.cache("cache"); @@ -229,18 +230,18 @@ public void testRestartCluster() throws Exception { IgniteEx ig2 = startGrid(getConfiguration("node2")); IgniteEx ig3 = startGrid(getConfiguration("node3")); - assertTrue(!ig1.active()); - assertTrue(!ig2.active()); - assertTrue(!ig3.active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!ig3.cluster().state().active()); - ig2.active(true); + ig2.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig2.getOrCreateCache("cache"); for (int i = 0; i < 2048; i++) cache.put(i, String.valueOf(i)); - ig3.active(false); + ig3.cluster().state(ClusterState.INACTIVE); stopAllGrids(); @@ -248,7 +249,7 @@ public void testRestartCluster() throws Exception { ig2 = startGrid(getConfiguration("node2")); ig3 = startGrid(getConfiguration("node3")); - ig1.active(true); + ig1.cluster().state(ClusterState.ACTIVE); IgniteCache cache2 = ig1.cache("cache"); @@ -265,27 +266,27 @@ public void testActivateDeActivateCallbackForPluginProviders() throws Exception IgniteEx ig2 = startGrid(getConfiguration("node2")); IgniteEx ig3 = startGrid(getConfiguration("node3")); - assertTrue(!ig1.active()); - assertTrue(!ig2.active()); - assertTrue(!ig3.active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!ig3.cluster().state().active()); - ig1.active(true); + ig1.cluster().state(ClusterState.ACTIVE); checkPlugin(ig1, 1, 0); checkPlugin(ig2, 1, 0); checkPlugin(ig3, 1, 0); - ig2.active(false); + ig2.cluster().state(ClusterState.INACTIVE); - ig3.active(true); + ig3.cluster().state(ClusterState.ACTIVE); checkPlugin(ig1, 2, 1); checkPlugin(ig2, 2, 1); checkPlugin(ig3, 2, 1); - ig1.active(false); + ig1.cluster().state(ClusterState.INACTIVE); - ig2.active(true); + ig2.cluster().state(ClusterState.ACTIVE); checkPlugin(ig1, 3, 2); checkPlugin(ig2, 3, 2); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/extended/GridActivateExtensionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/extended/GridActivateExtensionTest.java index 4307fd45a15ca..de2247a2aedb2 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/extended/GridActivateExtensionTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/extended/GridActivateExtensionTest.java @@ -21,6 +21,7 @@ import java.util.LinkedHashMap; import java.util.Map; import org.apache.ignite.Ignite; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -122,11 +123,11 @@ public class GridActivateExtensionTest extends GridCacheAbstractFullApiSelfTest Ignite ig = grid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); log.info("activate backUp cluster"); - assertEquals(true, ig.active()); + assertEquals(true, ig.cluster().state().active()); Class c = getClass(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectTest.java index 6d589d5540ec6..dc176f3324e1e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal.processors.cache.persistence.standbycluster.reconnect; import java.util.concurrent.CountDownLatch; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.junit.Test; @@ -40,11 +41,11 @@ public void testActiveClientReconnectToActiveCluster() throws Exception { IgniteEx ig2 = grid(node2); IgniteEx client = grid(nodeClient); - assertTrue(!ig1.cluster().active()); - assertTrue(!ig2.cluster().active()); - assertTrue(!client.cluster().active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!client.cluster().state().active()); - client.cluster().active(true); + client.cluster().state(ClusterState.ACTIVE); info(">>>> activate grid"); @@ -60,9 +61,9 @@ public void testActiveClientReconnectToActiveCluster() throws Exception { info(">>>> dynamic start [" + ccfgDynamicName + ", " + ccfgDynamicWithFilterName + "]"); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); - assertTrue(client.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(client.cluster().state().active()); checkDescriptors(ig1, allCacheNames); checkDescriptors(ig2, allCacheNames); @@ -83,10 +84,10 @@ public void testActiveClientReconnectToActiveCluster() throws Exception { info(">>>> activate new servers"); - ig1.cluster().active(true); + ig1.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); activateLatch.countDown(); @@ -96,9 +97,9 @@ public void testActiveClientReconnectToActiveCluster() throws Exception { info(">>>> client reconnected"); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); - assertTrue(client.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(client.cluster().state().active()); checkDescriptors(ig1, allCacheNames); checkDescriptors(ig2, allCacheNames); @@ -122,13 +123,13 @@ public void testActiveClientReconnectToInActiveCluster() throws Exception { IgniteEx ig2 = grid(node2); IgniteEx client = grid(nodeClient); - assertTrue(!ig1.cluster().active()); - assertTrue(!ig2.cluster().active()); - assertTrue(!client.cluster().active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!client.cluster().state().active()); info(">>>> activate grid"); - client.cluster().active(true); + client.cluster().state(ClusterState.ACTIVE); checkStaticCaches(); @@ -146,9 +147,9 @@ public void testActiveClientReconnectToInActiveCluster() throws Exception { checkDescriptors(ig2, allCacheNames); checkDescriptors(client, allCacheNames); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); - assertTrue(client.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(client.cluster().state().active()); final CountDownLatch disconnectedLatch = new CountDownLatch(1); final CountDownLatch reconnectedLatch = new CountDownLatch(1); @@ -161,7 +162,7 @@ public void testActiveClientReconnectToInActiveCluster() throws Exception { disconnectedLatch.await(); - ig1.cluster().active(false); + ig1.cluster().state(ClusterState.INACTIVE); activateLatch.countDown(); @@ -171,15 +172,15 @@ public void testActiveClientReconnectToInActiveCluster() throws Exception { reconnectedLatch.await(); - assertTrue(!ig1.cluster().active()); - assertTrue(!ig2.cluster().active()); - assertTrue(!client.cluster().active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!client.cluster().state().active()); - client.cluster().active(true); + client.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); - assertTrue(client.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(client.cluster().state().active()); checkDescriptors(ig1, allCacheNames); checkDescriptors(ig2, allCacheNames); @@ -201,9 +202,9 @@ public void testInActiveClientReconnectToActiveCluster() throws Exception { IgniteEx ig2 = grid(node2); IgniteEx client = grid(nodeClient); - assertTrue(!ig1.cluster().active()); - assertTrue(!ig2.cluster().active()); - assertTrue(!client.cluster().active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!client.cluster().state().active()); final CountDownLatch disconnectedLatch = new CountDownLatch(1); final CountDownLatch reconnectedLatch = new CountDownLatch(1); @@ -216,10 +217,10 @@ public void testInActiveClientReconnectToActiveCluster() throws Exception { ig2 = startGrid(getConfiguration(node2)); - ig1.cluster().active(true); + ig1.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); checkDescriptors(ig1, staticCacheNames); checkDescriptors(ig2, staticCacheNames); @@ -228,9 +229,9 @@ public void testInActiveClientReconnectToActiveCluster() throws Exception { reconnectedLatch.await(); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); - assertTrue(client.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(client.cluster().state().active()); checkDescriptors(ig1, staticCacheNames); checkDescriptors(ig2, staticCacheNames); @@ -257,9 +258,9 @@ public void testInActiveClientReconnectToInActiveCluster() throws Exception { IgniteEx ig2 = grid(node2); IgniteEx client = grid(nodeClient); - assertTrue(!ig1.cluster().active()); - assertTrue(!ig2.cluster().active()); - assertTrue(!client.cluster().active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!client.cluster().state().active()); final CountDownLatch disconnectedLatch = new CountDownLatch(1); final CountDownLatch reconnectedLatch = new CountDownLatch(1); @@ -274,15 +275,15 @@ public void testInActiveClientReconnectToInActiveCluster() throws Exception { reconnectedLatch.await(); - assertTrue(!ig1.cluster().active()); - assertTrue(!ig2.cluster().active()); - assertTrue(!client.cluster().active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!client.cluster().state().active()); - client.cluster().active(true); + client.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); - assertTrue(client.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(client.cluster().state().active()); checkStaticCaches(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectToNewClusterTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectToNewClusterTest.java index 4a25348b70d07..e53e153a450e4 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectToNewClusterTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectToNewClusterTest.java @@ -21,6 +21,7 @@ import java.util.Set; import java.util.concurrent.CountDownLatch; import com.google.common.collect.Sets; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.junit.Test; @@ -43,13 +44,13 @@ public void testActiveClientReconnectsToActiveCluster() throws Exception { IgniteEx ig2 = grid(node2); IgniteEx client = grid(nodeClient); - assertTrue(!ig1.cluster().active()); - assertTrue(!ig2.cluster().active()); - assertTrue(!client.cluster().active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!client.cluster().state().active()); info(">>>> activate grid"); - client.cluster().active(true); + client.cluster().state(ClusterState.ACTIVE); checkDescriptors(ig1, staticCacheNames); checkDescriptors(ig2, staticCacheNames); @@ -63,9 +64,9 @@ public void testActiveClientReconnectsToActiveCluster() throws Exception { client.createCache(ccfgDynamicWithFilter); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); - assertTrue(client.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(client.cluster().state().active()); checkDescriptors(ig1, allCacheNames); checkDescriptors(ig2, allCacheNames); @@ -88,10 +89,10 @@ public void testActiveClientReconnectsToActiveCluster() throws Exception { info(">>>> activate new servers"); - ig1.cluster().active(true); + ig1.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); activateLatch.countDown(); @@ -101,9 +102,9 @@ public void testActiveClientReconnectsToActiveCluster() throws Exception { info(">>>> client reconnected"); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); - assertTrue(client.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(client.cluster().state().active()); checkAllCaches(); } @@ -121,13 +122,13 @@ public void testActiveClientReconnectsToInactiveCluster() throws Exception { IgniteEx ig2 = grid(node2); IgniteEx client = grid(nodeClient); - assertTrue(!ig1.cluster().active()); - assertTrue(!ig2.cluster().active()); - assertTrue(!client.cluster().active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!client.cluster().state().active()); info(">>>> activate grid"); - client.cluster().active(true); + client.cluster().state(ClusterState.ACTIVE); checkStaticCaches(); @@ -145,9 +146,9 @@ public void testActiveClientReconnectsToInactiveCluster() throws Exception { checkDescriptors(ig2, allCacheNames); checkDescriptors(client, allCacheNames); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); - assertTrue(client.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(client.cluster().state().active()); final CountDownLatch disconnectedLatch = new CountDownLatch(1); final CountDownLatch reconnectedLatch = new CountDownLatch(1); @@ -159,7 +160,7 @@ public void testActiveClientReconnectsToInactiveCluster() throws Exception { stopGrid(node1); stopGrid(node2); - assertTrue(client.cluster().active()); + assertTrue(client.cluster().state().active()); System.out.println("Await disconnected"); @@ -174,17 +175,17 @@ public void testActiveClientReconnectsToInactiveCluster() throws Exception { info(">>>> client reconnected"); - assertTrue(!ig1.cluster().active()); - assertTrue(!ig2.cluster().active()); - assertTrue(!client.cluster().active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!client.cluster().state().active()); info(">>>> activate new servers"); - client.cluster().active(true); + client.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); - assertTrue(client.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(client.cluster().state().active()); checkAllCaches(); } @@ -202,9 +203,9 @@ public void testInactiveClientReconnectsToActiveCluster() throws Exception { IgniteEx ig2 = grid(node2); IgniteEx client = grid(nodeClient); - assertTrue(!ig1.cluster().active()); - assertTrue(!ig2.cluster().active()); - assertTrue(!client.cluster().active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!client.cluster().state().active()); final CountDownLatch disconnectedLatch = new CountDownLatch(1); final CountDownLatch reconnectedLatch = new CountDownLatch(1); @@ -219,10 +220,10 @@ public void testInactiveClientReconnectsToActiveCluster() throws Exception { ig1 = startGrid(getConfiguration(node1)); ig2 = startGrid(getConfiguration(node2)); - ig1.cluster().active(true); + ig1.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); checkDescriptors(ig1, Collections.emptySet()); checkDescriptors(ig2, Collections.emptySet()); @@ -231,9 +232,9 @@ public void testInactiveClientReconnectsToActiveCluster() throws Exception { reconnectedLatch.await(); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); - assertTrue(client.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(client.cluster().state().active()); checkOnlySystemCaches(false); @@ -262,9 +263,9 @@ public void testInactiveClientReconnectsToInactiveCluster() throws Exception { IgniteEx ig2 = grid(node2); IgniteEx client = grid(nodeClient); - assertTrue(!ig1.cluster().active()); - assertTrue(!ig2.cluster().active()); - assertTrue(!client.cluster().active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!client.cluster().state().active()); final CountDownLatch disconnectedLatch = new CountDownLatch(1); final CountDownLatch reconnectedLatch = new CountDownLatch(1); @@ -274,7 +275,7 @@ public void testInactiveClientReconnectsToInactiveCluster() throws Exception { stopGrid(node1); stopGrid(node2); - assertTrue(!client.cluster().active()); + assertTrue(!client.cluster().state().active()); disconnectedLatch.await(); @@ -283,15 +284,15 @@ public void testInactiveClientReconnectsToInactiveCluster() throws Exception { reconnectedLatch.await(); - assertTrue(!ig1.cluster().active()); - assertTrue(!ig2.cluster().active()); - assertTrue(!client.cluster().active()); + assertTrue(!ig1.cluster().state().active()); + assertTrue(!ig2.cluster().state().active()); + assertTrue(!client.cluster().state().active()); - client.cluster().active(true); + client.cluster().state(ClusterState.ACTIVE); - assertTrue(ig1.cluster().active()); - assertTrue(ig2.cluster().active()); - assertTrue(client.cluster().active()); + assertTrue(ig1.cluster().state().active()); + assertTrue(ig2.cluster().state().active()); + assertTrue(client.cluster().state().active()); checkOnlySystemCaches(true); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/CpTriggeredWalDeltaConsistencyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/CpTriggeredWalDeltaConsistencyTest.java index 776b415053802..d8b018be4903d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/CpTriggeredWalDeltaConsistencyTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/CpTriggeredWalDeltaConsistencyTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal.processors.cache.persistence.wal; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.junit.Test; @@ -44,7 +45,7 @@ public class CpTriggeredWalDeltaConsistencyTest extends AbstractWalDeltaConsiste public final void testPutRemoveCacheDestroy() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = ignite.createCache(cacheConfiguration("cache0")); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/ExplicitWalDeltaConsistencyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/ExplicitWalDeltaConsistencyTest.java index ee904443778bb..6dade431daf24 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/ExplicitWalDeltaConsistencyTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/ExplicitWalDeltaConsistencyTest.java @@ -21,6 +21,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.processors.cache.persistence.wal.memtracker.PageMemoryTrackerPluginProvider; @@ -45,7 +46,7 @@ public class ExplicitWalDeltaConsistencyTest extends AbstractWalDeltaConsistency public final void testPutRemoveAfterCheckpoint() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.createCache(cacheConfiguration(DEFAULT_CACHE_NAME)); @@ -78,7 +79,7 @@ public final void testPutRemoveAfterCheckpoint() throws Exception { public final void testNotEmptyPds() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.createCache(cacheConfiguration(DEFAULT_CACHE_NAME)); @@ -91,7 +92,7 @@ public final void testNotEmptyPds() throws Exception { ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache = ignite.getOrCreateCache(cacheConfiguration(DEFAULT_CACHE_NAME)); @@ -111,7 +112,7 @@ public final void testNotEmptyPds() throws Exception { public void testReusePages() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); CacheConfiguration ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME); @@ -132,7 +133,7 @@ public void testReusePages() throws Exception { ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache = ignite.cache(DEFAULT_CACHE_NAME); @@ -149,7 +150,7 @@ public void testReusePages() throws Exception { public void testRecovery() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); CountDownLatch latch = new CountDownLatch(1); @@ -171,7 +172,7 @@ public void testRecovery() throws Exception { IgniteEx ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite0.cache(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/SysPropWalDeltaConsistencyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/SysPropWalDeltaConsistencyTest.java index a1f721912ebf8..66d290e0c3010 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/SysPropWalDeltaConsistencyTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/SysPropWalDeltaConsistencyTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal.processors.cache.persistence.wal; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.processors.cache.persistence.wal.memtracker.PageMemoryTrackerPluginProvider; @@ -64,7 +65,7 @@ public class SysPropWalDeltaConsistencyTest extends AbstractWalDeltaConsistencyT public final void testPutRemoveMultinode() throws Exception { IgniteEx ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = ignite0.createCache(cacheConfiguration("cache0")); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/WalEnableDisableWithNodeShutdownTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/WalEnableDisableWithNodeShutdownTest.java index 37194a32f44e9..2de8a740c6dab 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/WalEnableDisableWithNodeShutdownTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/WalEnableDisableWithNodeShutdownTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -78,7 +79,7 @@ public void testDisableWhileNodeOffline() throws Exception { for (int i = 0; i < NODES; i++) nodes.add(Ignition.start(igniteCfg(false, "server_" + i))); - nodes.getFirst().active(true); + nodes.getFirst().cluster().state(ClusterState.ACTIVE); Ignite client = Ignition.start(igniteCfg(true, "client")); @@ -138,7 +139,7 @@ public void testEnableWhileNodeOffline() throws Exception { for (int i = 0; i < NODES; i++) nodes.add(Ignition.start(igniteCfg(false, "server_" + i))); - nodes.getFirst().active(true); + nodes.getFirst().cluster().state(ClusterState.ACTIVE); Ignite client = Ignition.start(igniteCfg(true, "client")); @@ -197,7 +198,7 @@ public void testOffWhileNodeOffline() throws Exception { for (int i = 0; i < NODES; i++) nodes.add(Ignition.start(igniteCfg(false, "server_" + i))); - nodes.getFirst().active(true); + nodes.getFirst().cluster().state(ClusterState.ACTIVE); Ignite client = Ignition.start(igniteCfg(true, "client")); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/WalEnableDisableWithRestartsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/WalEnableDisableWithRestartsTest.java index 782c5bb5addf8..99016b0305b9d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/WalEnableDisableWithRestartsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/WalEnableDisableWithRestartsTest.java @@ -23,6 +23,7 @@ import org.apache.ignite.Ignition; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -71,7 +72,7 @@ public void test() throws Exception { for (int i = 0; i < NODES; i++) nodes.add(Ignition.start(igniteCfg(false, "server_" + i))); - nodes.getFirst().active(true); + nodes.getFirst().cluster().state(ClusterState.ACTIVE); Ignite client = Ignition.start(igniteCfg(true, "client")); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneWalRecordsIteratorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneWalRecordsIteratorTest.java index ba2eeb7aa7c88..2082007959ea1 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneWalRecordsIteratorTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneWalRecordsIteratorTest.java @@ -30,6 +30,7 @@ import java.util.stream.Collectors; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -107,7 +108,7 @@ private String createWalFiles(int segRecCnt) throws Exception { String archiveWalDir = getArchiveWalDirPath(ig); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCacheDatabaseSharedManager sharedMgr = ig.context().cache().context().database(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/CacheDataPageScanQueryTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/CacheDataPageScanQueryTest.java index 59cd97ee953f2..93df4beb64136 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/CacheDataPageScanQueryTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/CacheDataPageScanQueryTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.ScanQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -96,7 +97,7 @@ public class CacheDataPageScanQueryTest extends GridCommonAbstractTest { @Ignore("https://issues.apache.org/jira/browse/IGNITE-11998") public void testDataPageScanWithRestart() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteInternalCache cache = ignite.cachex(CACHE); CacheGroupMetricsImpl metrics = cache.context().group().metrics(); @@ -142,7 +143,7 @@ public void testDataPageScanWithRestart() throws Exception { stopAllGrids(true); ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); c = ignite.cache(CACHE); for (Cache.Entry e : c.query(new ScanQuery()).getAll()) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/AbstractTransactionIntergrityTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/AbstractTransactionIntergrityTest.java index b5ee0015b883c..07a8e2a2cbc6a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/AbstractTransactionIntergrityTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/AbstractTransactionIntergrityTest.java @@ -37,6 +37,7 @@ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.annotations.QuerySqlField; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -206,7 +207,7 @@ public void doTestTransferAmount(FailoverScenario failoverScenario, boolean colo IgniteEx igniteClient = startClientGrid(getConfiguration(getTestIgniteInstanceName(nodesCount()))); - igniteClient.cluster().active(true); + igniteClient.cluster().state(ClusterState.ACTIVE); int[] initAmounts = new int[txThreadsCount()]; completedTxs = new ConcurrentLinkedHashMap[txThreadsCount()]; diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/PartitionUpdateCounterTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/PartitionUpdateCounterTest.java index 5e43476d3cbbe..bb18074282cd7 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/PartitionUpdateCounterTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/PartitionUpdateCounterTest.java @@ -33,6 +33,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -386,7 +387,7 @@ private void testWithPersistentNode(CacheAtomicityMode mode) throws Exception { IgniteEx grid0 = startGrid(0); grid0.cluster().baselineAutoAdjustEnabled(false); - grid0.cluster().active(true); + grid0.cluster().state(ClusterState.ACTIVE); grid0.cluster().baselineAutoAdjustEnabled(false); grid0.cache(DEFAULT_CACHE_NAME).put(0, 0); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxCrossCachePartitionConsistencyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxCrossCachePartitionConsistencyTest.java index 826fb899cc59d..45e1863c3d5d7 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxCrossCachePartitionConsistencyTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxCrossCachePartitionConsistencyTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.cluster.ClusterTopologyException; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -142,7 +143,7 @@ private void doTestCrossCacheTxFailover(boolean persistenceEnabled) throws Excep IgniteEx crd = startGrids(NODES_CNT); if (persistenceEnabled) - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOnCachesStartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOnCachesStartTest.java index b4578b30e2cc6..e809e2ff68db6 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOnCachesStartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOnCachesStartTest.java @@ -23,6 +23,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgniteInternalFuture; @@ -64,7 +65,7 @@ public void testTransactionCloseOnCachesStartAndStop() throws Exception { IgniteEx client1 = startClientGrid(getConfiguration("client-1")); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); CountDownLatch latch = new CountDownLatch(1); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOnCachesStopTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOnCachesStopTest.java index 4d4981413fd5a..4827025447798 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOnCachesStopTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOnCachesStopTest.java @@ -32,6 +32,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -169,7 +170,7 @@ private void runTxOnCacheStop(boolean block) throws Exception { IgniteEx ig = startClientGrid("client"); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); for (TransactionConcurrency conc : TransactionConcurrency.values()) { for (TransactionIsolation iso : TransactionIsolation.values()) @@ -186,7 +187,7 @@ public void testTxOnCacheStopInMid() throws Exception { IgniteEx ig = startClientGrid("client"); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); for (TransactionConcurrency conc : TransactionConcurrency.values()) { for (TransactionIsolation iso : TransactionIsolation.values()) @@ -205,7 +206,7 @@ public void testOptimisticTxMappedOnPMETopology() throws Exception { Ignite client = startClientGrid("client"); - client.cluster().active(true); + client.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(true, true, null); @@ -350,7 +351,7 @@ public void testOptimisticTransactionsOnCacheDestroy() throws Exception { for (int ci = 0; ci < 2; ++ci) clients.add(startClientGrid("client-" + ci)); - clients.get(0).cluster().active(true); + clients.get(0).cluster().state(ClusterState.ACTIVE); for (TransactionIsolation iso : TransactionIsolation.values()) { grid(0).getOrCreateCaches(createCacheConfigurations()); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateAbstractTest.java index f956adc702d37..3c8f41abb849a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateAbstractTest.java @@ -35,6 +35,7 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -232,7 +233,7 @@ protected Map>> runOnPartition( IgniteEx crd = startGrids(nodesCnt); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); configureBaselineAutoAdjust(); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateConsistencyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateConsistencyTest.java index 6d9b5ae001294..2d409eb3616d5 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateConsistencyTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateConsistencyTest.java @@ -316,7 +316,7 @@ public void testPartitionConsistencyWithBackupsRestart() throws Exception { Ignite prim = startGrids(srvNodes); - prim.cluster().active(true); + prim.cluster().state(ClusterState.ACTIVE); IgniteCache cache = prim.cache(DEFAULT_CACHE_NAME); @@ -380,7 +380,7 @@ public void testPartitionConsistencyWithBackupRestart_ChangeBLT() throws Excepti Ignite prim = startGrids(srvNodes); - prim.cluster().active(true); + prim.cluster().state(ClusterState.ACTIVE); IgniteCache cache = prim.cache(DEFAULT_CACHE_NAME); @@ -578,7 +578,7 @@ public void testPartitionConsistencyCancelledRebalanceCoordinatorIsDemander() th Ignite crd = startGrids(SERVER_NODES); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); int[] primaryParts = crd.affinity(DEFAULT_CACHE_NAME).primaryPartitions(crd.cluster().localNode()); @@ -612,7 +612,7 @@ public void testPartitionConsistencyCancelledRebalanceCoordinatorIsDemander() th startGrid(1); startNodeWithBlockingSupplying(2); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); TestRecordingCommunicationSpi spi0 = TestRecordingCommunicationSpi.spi(crd); TestRecordingCommunicationSpi spi2 = TestRecordingCommunicationSpi.spi(ignite(2)); @@ -733,7 +733,7 @@ public void testPartitionConsistencyDuringRebalanceAndConcurrentUpdates_SameAffi Ignite crd = startGridsMultiThreaded(SERVER_NODES); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); Ignite client = startClientGrid(CLIENT_GRID_NAME); @@ -816,7 +816,7 @@ public void testPartitionConsistencyDuringRebalanceAndConcurrentUpdates_TxDuring startGrid(1); startGrid(2); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); Ignite client = startClientGrid(CLIENT_GRID_NAME); @@ -931,7 +931,7 @@ public void testPartitionConsistencyDuringRebalanceAndConcurrentUpdates_LateAffi crd.cluster().baselineAutoAdjustEnabled(false); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); // Same name pattern as in test configuration. String consistentId = "node" + getTestIgniteInstanceName(3); @@ -1096,7 +1096,7 @@ public void testPrimaryLeftUnderLoadToSwitchingPartitions_4() throws Exception { public void testLateAffinityChangeDuringExchange() throws Exception { backups = 2; Ignite crd = startGridsMultiThreaded(3); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -1249,7 +1249,7 @@ private void doTestPrimaryLeftUnderLoadToSwitchingPartitions(int backups, int no final IgniteEx crd = startGrids(nodes); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); List primaryKeys = primaryKeys(crd.cache(DEFAULT_CACHE_NAME), 1024); @@ -1288,7 +1288,7 @@ private void doTestConsistencyAfterBaselineNodeStopAndRemoval(int mode) throws E prim.cluster().baselineAutoAdjustEnabled(false); - prim.cluster().active(true); + prim.cluster().state(ClusterState.ACTIVE); for (int p = 0; p < partitions(); p++) { prim.cache(DEFAULT_CACHE_NAME).put(p, p); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateOnePrimaryTwoBackupsFailAllTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateOnePrimaryTwoBackupsFailAllTest.java index 15e9a37d6da5b..b76624f8a71bb 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateOnePrimaryTwoBackupsFailAllTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxPartitionCounterStateOnePrimaryTwoBackupsFailAllTest.java @@ -23,6 +23,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import org.apache.ignite.Ignite; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgniteInterruptedCheckedException; import org.apache.ignite.internal.NodeStoppingException; @@ -326,7 +327,7 @@ private void doTestRestartAllOwnersAfterPartialCommit( startGrid(txTop.get(PARTITION_ID).get2().get(backupsStartOrder[1]).name()); try { - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); } catch (Throwable t) { // Nodes are expected to stop during activation due to irrecoverable partition consistency. diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackAsyncTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackAsyncTest.java index fe0806aa62a2b..f9f89d92f42f4 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackAsyncTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackAsyncTest.java @@ -41,6 +41,7 @@ import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteTransactions; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -170,7 +171,7 @@ protected boolean persistenceEnabled() { startGridsMultiThreaded(1, GRID_CNT - 1); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxWithKeyContentionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxWithKeyContentionSelfTest.java index 99bab0cb7275b..ef2d4211c08ea 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxWithKeyContentionSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxWithKeyContentionSelfTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -226,7 +227,7 @@ private void runKeyCollisionsMetric(TransactionConcurrency concurrency, Transact CountDownLatch txLatch = new CountDownLatch(contCnt); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); client = true; diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxWithSmallTimeoutAndContentionOneKeyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxWithSmallTimeoutAndContentionOneKeyTest.java index 5394f80f4f891..b4e806904131b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxWithSmallTimeoutAndContentionOneKeyTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxWithSmallTimeoutAndContentionOneKeyTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.IgniteTransactions; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -158,7 +159,7 @@ public void test() throws Exception { IgniteEx igClient = startClientGrid(getConfiguration("client").setConsistentId("Client")); - igClient.cluster().active(true); + igClient.cluster().state(ClusterState.ACTIVE); AtomicBoolean stop = new AtomicBoolean(false); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cluster/BaselineAutoAdjustInMemoryTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cluster/BaselineAutoAdjustInMemoryTest.java index da8f9d60acbb0..7d9732c5fcf1a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cluster/BaselineAutoAdjustInMemoryTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cluster/BaselineAutoAdjustInMemoryTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal.processors.cluster; import java.util.UUID; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.junit.Test; @@ -69,7 +70,7 @@ public void testWithZeroTimeout() throws Exception { public void testSetBaselineManually() throws Exception { IgniteEx ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); assertEquals(1, ignite0.cluster().currentBaselineTopology().size()); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/configuration/distributed/DistributedConfigurationAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/configuration/distributed/DistributedConfigurationAbstractTest.java index 76f00e964e147..3b793b7987282 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/configuration/distributed/DistributedConfigurationAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/configuration/distributed/DistributedConfigurationAbstractTest.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors.configuration.distributed; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -82,7 +83,7 @@ public void testRegisterExistedProperty() throws Exception { IgniteEx ignite0 = startGrid(0); IgniteEx ignite1 = startGrid(1); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); DistributedProperty long0 = distr(ignite0).registerProperty(detachedLongProperty(TEST_PROP)); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/configuration/distributed/DistributedConfigurationPersistentTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/configuration/distributed/DistributedConfigurationPersistentTest.java index 84d7e94160267..5b5ea46db5f0e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/configuration/distributed/DistributedConfigurationPersistentTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/configuration/distributed/DistributedConfigurationPersistentTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal.processors.configuration.distributed; import java.util.concurrent.atomic.AtomicReference; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.junit.Test; @@ -39,7 +40,7 @@ public void testSuccessClusterWideUpdate() throws Exception { IgniteEx ignite0 = startGrid(0); IgniteEx ignite1 = startGrid(1); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); DistributedProperty long0 = distr(ignite0).registerProperty(detachedLongProperty(TEST_PROP)); DistributedProperty long1 = distr(ignite1).registerProperty(detachedLongProperty(TEST_PROP)); @@ -60,7 +61,7 @@ public void testSuccessClusterWideUpdate() throws Exception { ignite0 = startGrid(0); ignite1 = startGrid(1); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); long0 = distr(ignite0).registerProperty(detachedLongProperty(TEST_PROP)); long1 = distr(ignite1).registerProperty(detachedLongProperty(TEST_PROP)); @@ -79,7 +80,7 @@ public void testReadLocalValueOnInactiveGrid() throws Exception { IgniteEx ignite0 = startGrid(0); startGrid(1); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); DistributedProperty long0 = distr(ignite0).registerProperty(detachedLongProperty(TEST_PROP)); @@ -122,7 +123,7 @@ public void testRegisterPropertyBeforeOnReadyForReadHappened() throws Exception IgniteEx ignite0 = startGrid(0); IgniteEx ignite1 = startGrid(1); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); DistributedProperty long0 = distr(ignite0).registerProperty(detachedLongProperty(TEST_PROP)); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java index f7c3c86c0895f..c05631f71ddf2 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbAbstractTest.java @@ -21,6 +21,7 @@ import java.util.Arrays; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -184,7 +185,7 @@ protected boolean withClientNearCache() { if (log.isInfoEnabled()) log.info("BTL before activation: " + cluster.currentBaselineTopology()); - cluster.active(true); + cluster.state(ClusterState.ACTIVE); if (log.isInfoEnabled()) log.info("BTL after activation: " + cluster.currentBaselineTopology()); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbDynamicCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbDynamicCacheSelfTest.java index 012a8433de7c8..6c5e9a9cbe312 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbDynamicCacheSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbDynamicCacheSelfTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -86,7 +87,7 @@ public void testCreate() throws Exception { Ignite ignite = ignite(0); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); @@ -126,7 +127,7 @@ public void testMultipleDynamicCaches() throws Exception { Ignite ignite = ignite(0); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbPutGetWithCacheStoreTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbPutGetWithCacheStoreTest.java index f20646bb564eb..9f9a6dc6588c5 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbPutGetWithCacheStoreTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbPutGetWithCacheStoreTest.java @@ -24,6 +24,7 @@ import javax.cache.integration.CacheWriterException; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.store.CacheStoreAdapter; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -127,7 +128,7 @@ private void checkWriteThrough(CacheAtomicityMode atomicityMode) throws Exceptio IgniteEx ig = startGrid(0); try { - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); for (int i = 0; i < 2000; i++) ig.cache(CACHE_NAME).put(i, i); @@ -140,7 +141,7 @@ private void checkWriteThrough(CacheAtomicityMode atomicityMode) throws Exceptio ig = startGrid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); for (int i = 0; i < 2000; i++) assertEquals(i, ig.cache(CACHE_NAME).get(i)); @@ -160,7 +161,7 @@ private void checkReadThrough(CacheAtomicityMode atomicityMode) throws Exception IgniteEx ig = startGrid(0); try { - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); for (int i = 0; i < 2000; i++) storeMap.put(i, i); @@ -174,7 +175,7 @@ private void checkReadThrough(CacheAtomicityMode atomicityMode) throws Exception ig = startGrid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); for (int i = 0; i < 2000; i++) assertEquals(i, ig.cache(CACHE_NAME).get(i)); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java index c328491c1d361..16552ab6be9fc 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java @@ -40,6 +40,7 @@ import org.apache.ignite.cache.store.CacheStore; import org.apache.ignite.cache.store.CacheStoreAdapter; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -1131,8 +1132,8 @@ private void afterGridStarted() throws InterruptedException { G.allGrids().stream() .filter(g -> !g.cluster().node().isClient()) .findAny() - .filter(g -> !g.cluster().active()) - .ifPresent(g -> g.cluster().active(true)); + .filter(g -> !g.cluster().state().active()) + .ifPresent(g -> g.cluster().state(ClusterState.ACTIVE)); awaitPartitionMapExchange(); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/metastorage/DistributedMetaStoragePersistentTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/metastorage/DistributedMetaStoragePersistentTest.java index cabb7f7618900..ed129aa5e3177 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/metastorage/DistributedMetaStoragePersistentTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/metastorage/DistributedMetaStoragePersistentTest.java @@ -73,7 +73,7 @@ public class DistributedMetaStoragePersistentTest extends DistributedMetaStorage public void testRestart() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.context().distributedMetastorage().write("key", "value"); @@ -81,7 +81,7 @@ public void testRestart() throws Exception { ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); assertEquals("value", ignite.context().distributedMetastorage().read("key")); } @@ -95,7 +95,7 @@ public void testJoinDirtyNode() throws Exception { startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.context().distributedMetastorage().write("key1", "value1"); @@ -105,7 +105,7 @@ public void testJoinDirtyNode() throws Exception { ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.context().distributedMetastorage().write("key2", "value2"); @@ -128,7 +128,7 @@ public void testJoinDirtyNodeFullData() throws Exception { startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.context().distributedMetastorage().write("key1", "value1"); @@ -138,7 +138,7 @@ public void testJoinDirtyNodeFullData() throws Exception { ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.context().distributedMetastorage().write("key2", "value2"); @@ -164,7 +164,7 @@ public void testJoinNodeWithLongerHistory() throws Exception { startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.context().distributedMetastorage().write("key1", "value1"); @@ -197,7 +197,7 @@ public void testJoinNodeWithoutEnoughHistory() throws Exception { startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.context().distributedMetastorage().write("key1", "value1"); @@ -231,7 +231,7 @@ public void testJoinNodeWithoutEnoughHistory() throws Exception { public void testNamesCollision() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCacheDatabaseSharedManager dbSharedMgr = ignite.context().cache().context().database(); @@ -272,7 +272,7 @@ public void testWrongStartOrder1() throws Exception { startGridsMultiThreaded(cnt); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); metastorage(2).write("key1", "value1"); @@ -309,7 +309,7 @@ public void testWrongStartOrder2() throws Exception { startGridsMultiThreaded(cnt); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); metastorage(4).write("key1", "value1"); @@ -358,7 +358,7 @@ public void testWrongStartOrder3() throws Exception { startGridsMultiThreaded(cnt); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); metastorage(3).write("key1", "value1"); @@ -403,7 +403,7 @@ public void testWrongStartOrder4() throws Exception { startGridsMultiThreaded(cnt); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); metastorage(4).write("key1", "value1"); @@ -465,13 +465,13 @@ public void testInactiveClusterWrite() throws Exception { public void testDeactivateActivateRestart() throws Exception { startGrid(0); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); - grid(0).cluster().active(false); + grid(0).cluster().state(ClusterState.INACTIVE); metastorage(0).write("key", "value"); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); stopGrid(0); @@ -491,7 +491,7 @@ public void testConflictingData() throws Exception { startGrid(1); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); stopGrid(0); @@ -501,7 +501,7 @@ public void testConflictingData() throws Exception { startGrid(0); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); metastorage(0).write("key", "value2"); @@ -521,7 +521,7 @@ public void testVerFromDiscoveryClusterData() throws Exception { assumeThat(grid(0).context().config().getDiscoverySpi(), is(instanceOf(TcpDiscoverySpi.class))); - startGrid(1).cluster().active(true); + startGrid(1).cluster().state(ClusterState.ACTIVE); metastorage(0).write("key0", "value0"); metastorage(0).write("key1", "value1"); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/metastorage/DistributedMetaStorageTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/metastorage/DistributedMetaStorageTest.java index 30ce39e4c3064..63110f68c8922 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/metastorage/DistributedMetaStorageTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/metastorage/DistributedMetaStorageTest.java @@ -27,6 +27,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -127,7 +128,7 @@ public void after() throws Exception { public void testSingleNode() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); DistributedMetaStorage metastorage = ignite.context().distributedMetastorage(); @@ -208,7 +209,7 @@ public void testMultipleNodes() throws Exception { startGrids(cnt); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); for (int i = 0; i < cnt; i++) { String key = UUID.randomUUID().toString(); @@ -234,7 +235,7 @@ public void testListenersOnWrite() throws Exception { startGrids(cnt); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); AtomicInteger predCntr = new AtomicInteger(); @@ -267,7 +268,7 @@ public void testListenersOnRemove() throws Exception { startGrids(cnt); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); metastorage(0).write("key", "value"); @@ -300,7 +301,7 @@ public void testListenersOnRemove() throws Exception { public void testCas() throws Exception { startGrids(2); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); assertFalse(metastorage(0).compareAndSet("key", "expVal", "newVal")); @@ -338,7 +339,7 @@ public void testCas() throws Exception { public void testJoinCleanNode() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.context().distributedMetastorage().write("key", "value"); @@ -357,7 +358,7 @@ public void testJoinCleanNode() throws Exception { public void testJoinCleanNodeFullData() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); ignite.context().distributedMetastorage().write("key1", "value1"); @@ -380,17 +381,17 @@ public void testJoinCleanNodeFullData() throws Exception { public void testDeactivateActivate() throws Exception { startGrid(0); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); metastorage(0).write("key1", "value1"); metastorage(0).write("key2", "value2"); - grid(0).cluster().active(false); + grid(0).cluster().state(ClusterState.INACTIVE); startGrid(1); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); assertEquals("value1", metastorage(0).read("key1")); @@ -406,7 +407,7 @@ public void testDeactivateActivate() throws Exception { public void testOptimizedWriteTwice() throws Exception { IgniteEx igniteEx = startGrid(0); - igniteEx.cluster().active(true); + igniteEx.cluster().state(ClusterState.ACTIVE); metastorage(0).write("key1", "value1"); @@ -426,7 +427,7 @@ public void testOptimizedWriteTwice() throws Exception { public void testClient() throws Exception { IgniteEx igniteEx = startGrid(0); - igniteEx.cluster().active(true); + igniteEx.cluster().state(ClusterState.ACTIVE); metastorage(0).write("key0", "value0"); @@ -454,7 +455,7 @@ public void testClient() throws Exception { public void testClientReconnect() throws Exception { IgniteEx igniteEx = startGrid(0); - igniteEx.cluster().active(true); + igniteEx.cluster().state(ClusterState.ACTIVE); startClientGrid(1); @@ -466,7 +467,7 @@ public void testClientReconnect() throws Exception { stopGrid(2); - startGrid(2).cluster().active(true); + startGrid(2).cluster().state(ClusterState.ACTIVE); metastorage(2).write("key1", "value1"); @@ -495,7 +496,7 @@ public void testUnstableTopology() throws Exception { startGridsMultiThreaded(cnt); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); stopGrid(0); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/rest/RestProtocolStartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/rest/RestProtocolStartTest.java index a06c7ce81e72c..e014549c64446 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/rest/RestProtocolStartTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/rest/RestProtocolStartTest.java @@ -103,7 +103,7 @@ public void test() throws Exception { } }); - assertTrue("Is active " + ignite.cluster().active(), ignite.cluster().active()); + assertTrue("Is active " + ignite.cluster().state().active(), ignite.cluster().state().active()); GridClient gridClient = client(); @@ -120,7 +120,7 @@ public void test() throws Exception { fail("Failed to wait rebalance completed. Node has hang."); } - assertTrue("Is active " + ignite.cluster().active(), ignite.cluster().active()); + assertTrue("Is active " + ignite.cluster().state().active(), ignite.cluster().state().active()); } /** diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/security/AbstractCacheOperationPermissionCheckTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/security/AbstractCacheOperationPermissionCheckTest.java index 46c88cda503e4..c5d1297f78874 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/security/AbstractCacheOperationPermissionCheckTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/security/AbstractCacheOperationPermissionCheckTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal.processors.security; import java.util.concurrent.atomic.AtomicInteger; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.util.typedef.T2; @@ -37,7 +38,7 @@ public abstract class AbstractCacheOperationPermissionCheckTest extends Abstract /** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { - startGridAllowAll("server").cluster().active(true); + startGridAllowAll("server").cluster().state(ClusterState.ACTIVE); } /** {@inheritDoc} */ diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/security/client/AdditionalSecurityCheckTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/security/client/AdditionalSecurityCheckTest.java index e43778a9cf160..3b2e3f91b4e66 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/security/client/AdditionalSecurityCheckTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/security/client/AdditionalSecurityCheckTest.java @@ -50,7 +50,7 @@ public void testClientInfo() throws Exception { startGrid(2); assertEquals(3, ignite.cluster().topologyVersion()); - assertFalse(ignite.cluster().active()); + assertFalse(ignite.cluster().state().active()); try (GridClient client = GridClientFactory.start(getGridClientConfiguration())) { assertTrue(client.connected()); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/security/client/ThinClientSslPermissionCheckTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/security/client/ThinClientSslPermissionCheckTest.java index a6235d167229e..76f70221b1fd5 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/security/client/ThinClientSslPermissionCheckTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/security/client/ThinClientSslPermissionCheckTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.client.Config; import org.apache.ignite.client.IgniteClient; import org.apache.ignite.client.SslMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.ClientConfiguration; import org.apache.ignite.configuration.ClientConnectorConfiguration; @@ -138,7 +139,7 @@ private IgniteConfiguration getConfiguration(int idx, TestSecurityData... client ) ); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); } /** */ diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/security/compute/ComputePermissionCheckTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/security/compute/ComputePermissionCheckTest.java index 042c002511d07..1779979633f51 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/security/compute/ComputePermissionCheckTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/security/compute/ComputePermissionCheckTest.java @@ -31,6 +31,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteException; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.compute.ComputeJob; import org.apache.ignite.compute.ComputeJobResult; import org.apache.ignite.compute.ComputeJobResultPolicy; @@ -131,7 +132,7 @@ public void test() throws Exception { Ignite clntForbiddenCancel = startGrid("clnt_forbidden_cnl", permissions(TASK_EXECUTE), true); - srvAllowed.cluster().active(true); + srvAllowed.cluster().state(ClusterState.ACTIVE); operations(srvAllowed, clntAllowed).forEach(this::runOperation); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/security/sandbox/AbstractSandboxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/security/sandbox/AbstractSandboxTest.java index 943124f07c2c9..b41335a1b747f 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/security/sandbox/AbstractSandboxTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/security/sandbox/AbstractSandboxTest.java @@ -32,6 +32,7 @@ import javax.tools.JavaCompiler; import javax.tools.ToolProvider; import org.apache.ignite.Ignite; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.processors.security.AbstractSecurityTest; import org.apache.ignite.internal.util.lang.RunnableX; import org.apache.ignite.lang.IgniteCallable; @@ -110,7 +111,7 @@ protected void prepareCluster() throws Exception { startGrid(CLNT_FORBIDDEN_WRITE_PROP, ALLOW_ALL, true); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); } /** diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/security/sandbox/AccessToClassesInsideInternalPackageTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/security/sandbox/AccessToClassesInsideInternalPackageTest.java index b10f9af291cea..5d4fa97e77b4b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/security/sandbox/AccessToClassesInsideInternalPackageTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/security/sandbox/AccessToClassesInsideInternalPackageTest.java @@ -23,6 +23,7 @@ import java.security.Permissions; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCompute; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteCallable; @@ -111,7 +112,7 @@ public void testCallStaticMethod() { startGrid(FORBIDDEN, ALLOW_ALL, false); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); } /** {@inheritDoc} */ diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/security/sandbox/SecuritySubjectPermissionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/security/sandbox/SecuritySubjectPermissionsTest.java index b5935c92d2a45..8dfb63458eeab 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/security/sandbox/SecuritySubjectPermissionsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/security/sandbox/SecuritySubjectPermissionsTest.java @@ -35,6 +35,7 @@ import javax.management.MBeanTrustPermission; import javax.net.ssl.SSLPermission; import org.apache.ignite.Ignite; +import org.apache.ignite.cluster.ClusterState; import org.junit.Test; import static org.apache.ignite.plugin.security.SecurityPermissionSetBuilder.ALLOW_ALL; @@ -57,7 +58,7 @@ public void test() throws Exception { Ignite clnt = startGrid("clnt", ALLOW_ALL, perms, true); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); clnt.compute().broadcast(() -> securityManager().checkPermission(new TestPermission("common"))); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceDeploymentOnActivationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceDeploymentOnActivationTest.java index 233ff4d525e2e..e694602376a33 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceDeploymentOnActivationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceDeploymentOnActivationTest.java @@ -21,6 +21,7 @@ import java.util.concurrent.TimeUnit; import org.apache.ignite.Ignite; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.lang.IgnitePredicate; @@ -143,7 +144,7 @@ private void checkRedeployment(int srvsNum, int clientsNum, IgnitePredicate cacheCfg = new CacheConfiguration<>(CACHE_NAME); cacheCfg.setBackups(1); @@ -118,7 +119,7 @@ public void testMappingsPersistedOnJoin() throws Exception { g2 = startGrid(2); - g2.cluster().active(true); + g2.cluster().state(ClusterState.ACTIVE); c2 = g2.cache(CACHE_NAME); @@ -136,7 +137,7 @@ public void testPersistedMappingsSharedOnJoin() throws Exception { Ignite g1 = startGrid(1); startGrid(2); - g1.cluster().active(true); // Include second node into baseline topology. + g1.cluster().state(ClusterState.ACTIVE); // Include second node into baseline topology. stopGrid(2); @@ -152,7 +153,7 @@ public void testPersistedMappingsSharedOnJoin() throws Exception { Ignite g2 = startGrid(2); assertTrue("Failed to wait for automatic grid activation", - GridTestUtils.waitForCondition(() -> g2.cluster().active(), getTestTimeout())); + GridTestUtils.waitForCondition(() -> g2.cluster().state().active(), getTestTimeout())); IgniteCache c2 = g2.cache(CACHE_NAME); diff --git a/modules/core/src/test/java/org/apache/ignite/p2p/P2PScanQueryUndeployTest.java b/modules/core/src/test/java/org/apache/ignite/p2p/P2PScanQueryUndeployTest.java index 253e3df9a4439..f49c66b2c9188 100644 --- a/modules/core/src/test/java/org/apache/ignite/p2p/P2PScanQueryUndeployTest.java +++ b/modules/core/src/test/java/org/apache/ignite/p2p/P2PScanQueryUndeployTest.java @@ -28,6 +28,7 @@ import org.apache.ignite.IgniteException; import org.apache.ignite.cache.query.ScanQuery; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.managers.communication.GridIoMessage; @@ -118,7 +119,7 @@ public void testAfterClientDisconnect() throws Exception { Ignite client = startClientGrid(CLIENT_INSTANCE_NAME); - client.cluster().active(true); + client.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java index c584b0e1b1bb8..83648581f3192 100755 --- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java @@ -66,6 +66,7 @@ import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.cluster.ClusterGroup; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.cluster.ClusterTopologyException; import org.apache.ignite.compute.ComputeTask; import org.apache.ignite.compute.ComputeTaskFuture; @@ -554,8 +555,8 @@ protected final Ignite startGridsMultiThreaded(int cnt, boolean awaitPartMapExch Ignite g = super.startGridsMultiThreaded(cnt); if (awaitPartMapExchange) { - if (!g.active()) - g.active(true); + if (!g.cluster().state().active()) + g.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); } diff --git a/modules/core/src/test/java/org/apache/ignite/util/GridInternalTaskUnusedWalSegmentsTest.java b/modules/core/src/test/java/org/apache/ignite/util/GridInternalTaskUnusedWalSegmentsTest.java index 3b96ae3424cc6..b528388929c30 100644 --- a/modules/core/src/test/java/org/apache/ignite/util/GridInternalTaskUnusedWalSegmentsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/util/GridInternalTaskUnusedWalSegmentsTest.java @@ -24,6 +24,7 @@ import java.util.List; import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -93,7 +94,7 @@ public void testCorrectnessOfDeletionTaskSegments() throws Exception { try { IgniteEx ig0 = (IgniteEx)startGrids(4); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); try (IgniteDataStreamer streamer = ig0.dataStreamer(DEFAULT_CACHE_NAME)) { for (int k = 0; k < 10_000; k++) diff --git a/modules/core/src/test/java/org/apache/ignite/util/mbeans/GridMBeanBaselineTest.java b/modules/core/src/test/java/org/apache/ignite/util/mbeans/GridMBeanBaselineTest.java index 6be0a2932117b..3ee10aaac30f6 100644 --- a/modules/core/src/test/java/org/apache/ignite/util/mbeans/GridMBeanBaselineTest.java +++ b/modules/core/src/test/java/org/apache/ignite/util/mbeans/GridMBeanBaselineTest.java @@ -22,6 +22,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.Ignition; import org.apache.ignite.cluster.BaselineNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -78,7 +79,7 @@ public void testIgniteKernalNodeInBaselineTest() throws Exception { startClientGrid(CLIENT_IDX); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); checkBaselineInFromMBean(ignite0); diff --git a/modules/dev-utils/ignite-modules-test/src/test/java/org/apache/ignite/modulestest/IgniteLaunchInModularEnvTest.java b/modules/dev-utils/ignite-modules-test/src/test/java/org/apache/ignite/modulestest/IgniteLaunchInModularEnvTest.java index 1e9ad7b4b29f7..fb1edf822a7d8 100644 --- a/modules/dev-utils/ignite-modules-test/src/test/java/org/apache/ignite/modulestest/IgniteLaunchInModularEnvTest.java +++ b/modules/dev-utils/ignite-modules-test/src/test/java/org/apache/ignite/modulestest/IgniteLaunchInModularEnvTest.java @@ -65,7 +65,7 @@ public void testPdsEnabledSimpleLaunch() { Ignite ignite = Ignition.start(cfg); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); String cacheName = "CACHE"; ignite.getOrCreateCache(cacheName).put("key", "value"); diff --git a/modules/dev-utils/src/test/java/org/apache/ignite/development/utils/IgniteWalConverterSensitiveDataTest.java b/modules/dev-utils/src/test/java/org/apache/ignite/development/utils/IgniteWalConverterSensitiveDataTest.java index 00133ce676624..75ed5432fa68b 100644 --- a/modules/dev-utils/src/test/java/org/apache/ignite/development/utils/IgniteWalConverterSensitiveDataTest.java +++ b/modules/dev-utils/src/test/java/org/apache/ignite/development/utils/IgniteWalConverterSensitiveDataTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.QueryIndex; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -95,7 +96,7 @@ public class IgniteWalConverterSensitiveDataTest extends GridCommonAbstractTest int nodeId = 0; IgniteEx crd = startGrid(nodeId); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); try (Transaction tx = crd.transactions().txStart()) { IgniteCache cache = crd.cache(DEFAULT_CACHE_NAME); diff --git a/modules/dev-utils/src/test/java/org/apache/ignite/development/utils/IgniteWalConverterTest.java b/modules/dev-utils/src/test/java/org/apache/ignite/development/utils/IgniteWalConverterTest.java index 27ae527f7441f..7e182f9fd116a 100644 --- a/modules/dev-utils/src/test/java/org/apache/ignite/development/utils/IgniteWalConverterTest.java +++ b/modules/dev-utils/src/test/java/org/apache/ignite/development/utils/IgniteWalConverterTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -576,7 +577,7 @@ private String createWal( String nodeFolder; try (final IgniteEx node = startGrid(0)) { - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); nodeFolder = node.context().pdsFolderResolver().resolveFolders().folderName(); diff --git a/modules/direct-io/src/test/java/org/apache/ignite/internal/processors/cache/persistence/file/IgniteNativeIoWithNoPersistenceTest.java b/modules/direct-io/src/test/java/org/apache/ignite/internal/processors/cache/persistence/file/IgniteNativeIoWithNoPersistenceTest.java index 0be0bdfe88ff9..7905c0ce64532 100644 --- a/modules/direct-io/src/test/java/org/apache/ignite/internal/processors/cache/persistence/file/IgniteNativeIoWithNoPersistenceTest.java +++ b/modules/direct-io/src/test/java/org/apache/ignite/internal/processors/cache/persistence/file/IgniteNativeIoWithNoPersistenceTest.java @@ -19,6 +19,7 @@ import com.google.common.base.Strings; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -57,7 +58,7 @@ public class IgniteNativeIoWithNoPersistenceTest extends GridCommonAbstractTest public void testDirectIoHandlesNoPersistentGrid() throws Exception { IgniteEx ignite = startGrid(0); - ignite.active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.getOrCreateCache("cache"); diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java index 7b700a776c18d..3930e893532ae 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java @@ -977,7 +977,8 @@ private void checkClusterState(QueryParserResult parseRes) { throw new IgniteException("Can not perform the operation because the cluster is inactive. Note, " + "that the cluster is considered inactive by default if Ignite Persistent Store is used to " + - "let all the nodes join the cluster. To activate the cluster call Ignite.active(true)."); + "let all the nodes join the cluster. To activate the cluster call" + + " Ignite.cluster().state(ClusterState.ACTIVE)."); } } diff --git a/modules/indexing/src/test/java/org/apache/ignite/client/SecurityTest.java b/modules/indexing/src/test/java/org/apache/ignite/client/SecurityTest.java index 8633b1ef18920..0fe4442890d6a 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/client/SecurityTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/client/SecurityTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.Ignition; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.ClientConfiguration; import org.apache.ignite.configuration.ClientConnectorConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -234,7 +235,7 @@ private static Ignite igniteWithAuthentication(SimpleEntry... us ) ); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); for (SimpleEntry u : users) createUser(u.getKey(), u.getValue()); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinaryMetadataConcurrentUpdateWithIndexesTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinaryMetadataConcurrentUpdateWithIndexesTest.java index bfae29550f6c0..5bfa65e76c88c 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinaryMetadataConcurrentUpdateWithIndexesTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinaryMetadataConcurrentUpdateWithIndexesTest.java @@ -35,6 +35,7 @@ import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.QueryIndex; import org.apache.ignite.cache.QueryIndexType; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -176,7 +177,7 @@ public void testMissingSchemaUpdate() throws Exception { startGrid("node4"); - node0.cluster().active(true); + node0.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsWithIndexBuildFailTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsWithIndexBuildFailTest.java index cbf73eb81fc47..115b0e5309aa9 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsWithIndexBuildFailTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsWithIndexBuildFailTest.java @@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import javax.cache.Cache; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -98,7 +99,7 @@ private CacheConfiguration cacheConfiguration(String cacheName public void testIndexRebuildCountPartitionsLeft() throws Exception { IgniteEx ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); String cacheName1 = "cache1"; String cacheName2 = "cache2"; @@ -122,7 +123,7 @@ public void testIndexRebuildCountPartitionsLeft() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); MetricRegistry grpMreg = ignite.context().metric().registry(metricName(CACHE_GROUP_METRICS_PREFIX, GROUP_NAME)); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsWithIndexTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsWithIndexTest.java index ad9c99414509a..590ec2da3b397 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsWithIndexTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsWithIndexTest.java @@ -33,6 +33,7 @@ import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.QueryIndex; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.processors.metric.MetricRegistry; @@ -133,7 +134,7 @@ public void testIndexRebuildCountPartitionsLeft() throws Exception { Ignite ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache1 = ignite.cache(CACHE_NAME); @@ -148,7 +149,7 @@ public void testIndexRebuildCountPartitionsLeft() throws Exception { cache1.put(id, o.build()); } - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); File dir = U.resolveWorkDirectory(U.defaultWorkDirectory(), DFLT_STORE_DIR, false); @@ -159,7 +160,7 @@ public void testIndexRebuildCountPartitionsLeft() throws Exception { for (File indexBin : idxBinFiles) U.delete(indexBin); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); MetricRegistry metrics = cacheGroupMetrics(0, GROUP_NAME); @@ -181,7 +182,7 @@ public void testIndexCreateCountPartitionsLeft() throws Exception { Ignite ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache1 = ignite.cache(CACHE_NAME); @@ -243,7 +244,7 @@ public void testIndexRebuildCountPartitionsLeftInCluster() throws Exception { startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache1 = ignite.cache(CACHE_NAME); @@ -304,7 +305,7 @@ public void testIndexCreateCountPartitionsLeftInCluster() throws Exception { startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache1 = ignite.cache(CACHE_NAME); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CheckIndexesInlineSizeOnNodeJoinMultiJvmTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CheckIndexesInlineSizeOnNodeJoinMultiJvmTest.java index 2e85736188e77..20b592e0ad5a5 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CheckIndexesInlineSizeOnNodeJoinMultiJvmTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CheckIndexesInlineSizeOnNodeJoinMultiJvmTest.java @@ -27,6 +27,7 @@ import java.util.stream.IntStream; import java.util.stream.Stream; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -100,7 +101,7 @@ public class CheckIndexesInlineSizeOnNodeJoinMultiJvmTest extends GridCommonAbst testLog = new ListeningTestLogger(log); - startGrids(NODES_CNT).cluster().active(true); + startGrids(NODES_CNT).cluster().state(ClusterState.ACTIVE); for (Map.Entry entry : getSqlStatements().entrySet()) executeSql(grid(0), entry.getKey(), entry.getValue()); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheObjectKeyIndexingSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheObjectKeyIndexingSelfTest.java index 1401009e06c97..44c48d61e0185 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheObjectKeyIndexingSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheObjectKeyIndexingSelfTest.java @@ -31,6 +31,7 @@ import org.apache.ignite.Ignition; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -119,7 +120,7 @@ public void testObjectKeyHandlingDuringRebalance() throws Exception { Ignite ign1 = startGrid(getTestIgniteInstanceName(1), createIgniteCfg(1)); - ign1.cluster().active(true); + ign1.cluster().state(ClusterState.ACTIVE); ign1.getOrCreateCache(cacheCfg()); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicSqlRestoreTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicSqlRestoreTest.java index 10f8712c844d0..ad39429b7637c 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicSqlRestoreTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicSqlRestoreTest.java @@ -34,6 +34,7 @@ import org.apache.ignite.binary.BinaryObject; import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -104,7 +105,7 @@ public void testMergeChangedConfigOnCoordinator() throws Exception { Ignite ig = startGrid(0); startGrid(1); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.getOrCreateCache(getTestTableConfiguration()); @@ -126,7 +127,7 @@ public void testMergeChangedConfigOnCoordinator() throws Exception { IgniteEx ig = startGrid(1); startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); //and: change data try (IgniteDataStreamer s = ig.dataStreamer(TEST_CACHE_NAME)) { @@ -143,7 +144,7 @@ public void testMergeChangedConfigOnCoordinator() throws Exception { IgniteEx ig0 = startGrid(0); IgniteEx ig1 = startGrid(1); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); //then: everything is ok try (IgniteDataStreamer s = ig1.dataStreamer(TEST_CACHE_NAME)) { @@ -177,7 +178,7 @@ public void testIndexCreationWhenNodeStopped() throws Exception { Ignite srv2 = startGrid(1); Ignite cli = startClientGrid(2); - cli.cluster().active(true); + cli.cluster().state(ClusterState.ACTIVE); // Create table, add some data. int entryCnt = 50; @@ -289,7 +290,7 @@ public void testTakeConfigFromJoiningNodeOnInactiveGrid() throws Exception { Ignite ig = startGrid(0); startGrid(1); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.getOrCreateCache(getTestTableConfiguration()); @@ -309,7 +310,7 @@ public void testTakeConfigFromJoiningNodeOnInactiveGrid() throws Exception { IgniteEx ig = startGrid(1); startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); //then: config for cache was applying successful IgniteCache cache = ig.cache(TEST_CACHE_NAME); @@ -329,7 +330,7 @@ public void testResaveConfigAfterMerge() throws Exception { Ignite ig = startGrid(0); startGrid(1); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.getOrCreateCache(getTestTableConfiguration()); @@ -349,7 +350,7 @@ public void testResaveConfigAfterMerge() throws Exception { IgniteEx ig = startGrid(1); startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); stopAllGrids(); } @@ -358,7 +359,7 @@ public void testResaveConfigAfterMerge() throws Exception { //then: start only one node which originally was without index IgniteEx ig = startGrid(1); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); resetBaselineTopology(); ig.resetLostPartitions(Collections.singleton(TEST_CACHE_NAME)); @@ -380,7 +381,7 @@ public void testMergeChangedConfigOnInactiveGrid() throws Exception { Ignite ig = startGrid(0); startGrid(1); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); LinkedHashMap fields = new LinkedHashMap<>(); fields.put("A", "java.lang.Integer"); fields.put("B", "java.lang.String"); @@ -416,7 +417,7 @@ public void testMergeChangedConfigOnInactiveGrid() throws Exception { IgniteEx ig0 = startGrid(0); IgniteEx ig1 = startGrid(1); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); //then: config should be merged try (IgniteDataStreamer s = ig1.dataStreamer(TEST_CACHE_NAME)) { @@ -468,7 +469,7 @@ public void testTakeChangedConfigOnActiveGrid() throws Exception { Ignite ig = startGrid(0); startGrid(1); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.getOrCreateCache(getTestTableConfiguration()); @@ -487,7 +488,7 @@ public void testTakeChangedConfigOnActiveGrid() throws Exception { { //and: start cluster IgniteEx ig = startGrid(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); ig = startGrid(1); ig.resetLostPartitions(Collections.singleton(TEST_CACHE_NAME)); @@ -525,7 +526,7 @@ public void testFailJoiningNodeBecauseDifferentSql() throws Exception { Ignite ig = startGrid(0); startGrid(1); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.getOrCreateCache(getTestTableConfiguration()); @@ -571,7 +572,7 @@ public void testFailJoiningNodeBecauseFieldInlineSizeIsDifferent() throws Except Ignite ig = startGrid(0); startGrid(1); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.getOrCreateCache(getTestTableConfiguration()); @@ -616,7 +617,7 @@ public void testFailJoiningNodeBecauseNeedConfigUpdateOnActiveGrid() throws Exce Ignite ig = ignite(0); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig.getOrCreateCache(ccfg); @@ -632,7 +633,7 @@ public void testFailJoiningNodeBecauseNeedConfigUpdateOnActiveGrid() throws Exce { IgniteEx ig = startGrid(1); - ig.cluster().active(true); + ig.cluster().state(ClusterState.ACTIVE); try { startGrid(0); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteErrorOnRebalanceTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteErrorOnRebalanceTest.java index 3bb6eb6c787e9..166969951fa7f 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteErrorOnRebalanceTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteErrorOnRebalanceTest.java @@ -25,6 +25,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -95,7 +96,7 @@ public class IgniteErrorOnRebalanceTest extends GridCommonAbstractTest { public void testErrorOnRebalance() throws Exception { Ignite srv0 = startGrid(0); - srv0.active(true); + srv0.cluster().state(ClusterState.ACTIVE); { IgniteCache cache0 = srv0.cache(DEFAULT_CACHE_NAME); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/QueryJoinWithDifferentNodeFiltersTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/QueryJoinWithDifferentNodeFiltersTest.java index 64a7fabf56bc6..5f34012777650 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/QueryJoinWithDifferentNodeFiltersTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/QueryJoinWithDifferentNodeFiltersTest.java @@ -25,6 +25,7 @@ import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.processors.cache.index.AbstractIndexingCommonTest; @@ -94,7 +95,7 @@ public void testSize() throws Exception { Ignite client = startClientGrid("client"); - client.cluster().active(true); + client.cluster().state(ClusterState.ACTIVE); IgniteCache cache = client.cache(CACHE_NAME); IgniteCache cache2 = client.cache(CACHE_NAME_2); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/StartCachesInParallelTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/StartCachesInParallelTest.java index c882da7362a03..d149e2737db1c 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/StartCachesInParallelTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/StartCachesInParallelTest.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors.cache; import org.apache.ignite.Ignite; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -109,11 +110,11 @@ private void doTest() throws Exception { IgniteEx node = startGrid(0); - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); assertNull("Node failed with " + failureHnd.lastFailureCtx, failureHnd.lastFailureCtx); - assertTrue(node.cluster().active()); + assertTrue(node.cluster().state().active()); } /** */ diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/authentication/SqlUserCommandSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/authentication/SqlUserCommandSelfTest.java index aa1574c2e08f3..666414c3661ed 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/authentication/SqlUserCommandSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/authentication/SqlUserCommandSelfTest.java @@ -20,6 +20,7 @@ import java.util.List; import java.util.concurrent.Callable; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -72,7 +73,7 @@ public class SqlUserCommandSelfTest extends GridCommonAbstractTest { startClientGrid(NODES_COUNT - 1); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); secCtxDflt = authenticate(grid(0), DFAULT_USER_NAME, "ignite"); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteSqlQueryWithBaselineTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteSqlQueryWithBaselineTest.java index fb081f19cb22e..c927b604ff578 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteSqlQueryWithBaselineTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteSqlQueryWithBaselineTest.java @@ -22,6 +22,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.query.SqlQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -100,7 +101,7 @@ public static class C2 implements Serializable { public void testQueryWithNodeNotInBLT() throws Exception { startGrids(2); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); startGrid(2); //Start extra node. @@ -114,7 +115,7 @@ public void testQueryWithNodeNotInBLT() throws Exception { public void testQueryWithoutBLTNode() throws Exception { startGrids(2); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); startGrid(2); //Start extra node. stopGrid(1); @@ -129,7 +130,7 @@ public void testQueryWithoutBLTNode() throws Exception { public void testQueryFromNotBLTNode() throws Exception { startGrid(1); - grid(1).cluster().active(true); + grid(1).cluster().state(ClusterState.ACTIVE); startGrid(0); //Start extra node. diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ArrayIndexTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ArrayIndexTest.java index 4ba9734736a23..d7aa7af97a9c9 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ArrayIndexTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ArrayIndexTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.client.IgniteClient; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.ClientConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -98,7 +99,7 @@ public void setUp() throws Exception { public void shouldSelectAllRows() throws Exception { IgniteEx ex = startGrid(0); - ex.cluster().active(true); + ex.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ex.getOrCreateCache(DEFAULT_CACHE_NAME); @@ -130,7 +131,7 @@ public void shouldSelectAllRows() throws Exception { public void shouldSelectParticularValue() throws Exception { IgniteEx ex = startGrid(0); - ex.cluster().active(true); + ex.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ex.getOrCreateCache(DEFAULT_CACHE_NAME); @@ -158,7 +159,7 @@ public void shouldCreateTableWithBinaryKey() throws Exception { IgniteEx ex = startGrid(0); - ex.cluster().active(true); + ex.cluster().state(ClusterState.ACTIVE); executeSql(ex, "CREATE TABLE Binary_Entries (key binary(16) not null, val binary(16), PRIMARY KEY(key))"); @@ -190,7 +191,7 @@ private void checkTableExpression(boolean useTypedArrays) throws Exception { IgniteEx cli = startClientGrid(1); IgniteClient thinCli = Ignition.startClient(new ClientConfiguration().setAddresses(SERVER))) { - ex.cluster().active(true); + ex.cluster().state(ClusterState.ACTIVE); executeSql(cli, "CREATE TABLE T1 (id int not null, name varchar(1), PRIMARY KEY(id))"); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java index 3a840d4bbbf05..cbc58a02cf25a 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java @@ -510,7 +510,7 @@ private void runEqualFieldsDynamicIndexes(boolean persistEnabled) throws Excepti IgniteEx ig0 = startGrid(0); if (persistEnabled) - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); IgniteCache cache = grid(0).cache(DEFAULT_CACHE_NAME); @@ -1180,7 +1180,7 @@ public void testInlineSizeChange() throws Exception { IgniteEx ig0 = startGrid(0); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); populateCache(); @@ -1206,7 +1206,7 @@ public void testInlineSizeChange() throws Exception { ig0 = startGrid(0); - ig0.cluster().active(true); + ig0.cluster().state(ClusterState.ACTIVE); cache = ig0.cache(DEFAULT_CACHE_NAME); @@ -1335,7 +1335,7 @@ public void testNoIndexesWithPersistenceIndexRebuild() throws Exception { // Shutdown gracefully to ensure there is a checkpoint with index.bin. // Otherwise index.bin rebuilding may not work. - grid(0).cluster().active(false); + grid(0).cluster().state(ClusterState.INACTIVE); stopAllGrids(); @@ -1384,7 +1384,7 @@ public void testAllIndexesWithPersistenceIndexRebuild() throws Exception { // Shutdown gracefully to ensure there is a checkpoint with index.bin. // Otherwise index.bin rebuilding may not work. - grid(0).cluster().active(false); + grid(0).cluster().state(ClusterState.INACTIVE); stopAllGrids(); @@ -1433,7 +1433,7 @@ public void testDynamicIndexesWithPersistenceIndexRebuild() throws Exception { // Shutdown gracefully to ensure there is a checkpoint with index.bin. // Otherwise index.bin rebuilding may not work. - grid(0).cluster().active(false); + grid(0).cluster().state(ClusterState.INACTIVE); stopAllGrids(); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ClientReconnectWithSqlTableConfiguredTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ClientReconnectWithSqlTableConfiguredTest.java index 1956bb2c0dbc4..42d8bda8d9352 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ClientReconnectWithSqlTableConfiguredTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ClientReconnectWithSqlTableConfiguredTest.java @@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicReference; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cache.QueryEntity; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -114,7 +115,7 @@ private void checkClientRecconect() throws Exception { IgniteEx client1 = startClientGrid(2); IgniteEx client2 = startClientGrid(3); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); client1.getOrCreateCache(createCacheConfiguration("test-cl1")); client2.getOrCreateCache(createCacheConfiguration("test-cl2")); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2RowCachePageEvictionTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2RowCachePageEvictionTest.java index f92d276c0fd94..553fe985df358 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2RowCachePageEvictionTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2RowCachePageEvictionTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.SqlQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataPageEvictionMode; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -152,7 +153,7 @@ public void testEvictPagesWithDiskStorageSingleCacheInGroup() throws Exception { startGrid(); - grid().active(true); + grid().cluster().state(ClusterState.ACTIVE); checkRowCacheOnPageEviction(); } @@ -166,7 +167,7 @@ public void testEvictPagesWithDiskStorageWithOtherCacheInGroup() throws Exceptio startGrid(); - grid().active(true); + grid().cluster().state(ClusterState.ACTIVE); grid().getOrCreateCache(cacheConfiguration("cacheWithoutOnHeapCache", false)); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2TreeCorruptedTreeExceptionTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2TreeCorruptedTreeExceptionTest.java index 0bd0437294362..a7e1b273a610c 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2TreeCorruptedTreeExceptionTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2TreeCorruptedTreeExceptionTest.java @@ -22,6 +22,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -150,7 +151,7 @@ public class H2TreeCorruptedTreeExceptionTest extends GridCommonAbstractTest { public void testCorruptedTree() throws Exception { IgniteEx srv = startGrid(0); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); IgniteCache cache = srv.getOrCreateCache(DEFAULT_CACHE_NAME); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IndexMetricsTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IndexMetricsTest.java index 93031a6fa14ab..1d2c39bfa090f 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IndexMetricsTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IndexMetricsTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.cache.CacheMetrics; import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.QueryIndex; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -112,7 +113,7 @@ private CacheConfiguration cacheConfiguration(String cache public void testIndexRebuildingMetric() throws Exception { IgniteEx n = startGrid(0); - n.cluster().active(true); + n.cluster().state(ClusterState.ACTIVE); String cacheName1 = "cache1"; String cacheName2 = "cache2"; @@ -158,7 +159,7 @@ public void testIndexRebuildingMetric() throws Exception { CacheMetricsMXBean cacheClusterMetricsMXBean2 = cacheMetricsMXBean(n, cacheName2, CacheClusterMetricsMXBeanImpl.class); - n.cluster().active(true); + n.cluster().state(ClusterState.ACTIVE); BooleanSupplier[] idxRebuildProgressCache1 = { idxRebuildInProgress1::value, diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IoStatisticsBasicIndexSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IoStatisticsBasicIndexSelfTest.java index eb2e01e38e06c..eca70d40bb875 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IoStatisticsBasicIndexSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IoStatisticsBasicIndexSelfTest.java @@ -36,6 +36,7 @@ import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.QueryIndex; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -140,7 +141,7 @@ public void testNoIndexes() throws Exception { startGrid(); - grid().cluster().active(true); + grid().cluster().state(ClusterState.ACTIVE); populateCache(); @@ -167,7 +168,7 @@ public void testAllIndexes() throws Exception { startGrid(); - grid().cluster().active(true); + grid().cluster().state(ClusterState.ACTIVE); populateCache(); @@ -185,7 +186,7 @@ public void testMetricRegistryRemovedOnIndexDrop() throws Exception { startGrid(); - grid().cluster().active(true); + grid().cluster().state(ClusterState.ACTIVE); execute(grid(), "CREATE TABLE t(id int, name varchar, primary key (id))"); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/LongIndexNameTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/LongIndexNameTest.java index 6881b36e8b94b..e66b63fbe1132 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/LongIndexNameTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/LongIndexNameTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -105,8 +106,8 @@ public void testLongIndexNames() throws Exception { * */ @NotNull private IgniteCache insertSomeData(Ignite ignite) { - if (!ignite.active()) - ignite.active(true); + if (!ignite.cluster().state().active()) + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache("cache"); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/OptimizedMarshallerIndexNameTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/OptimizedMarshallerIndexNameTest.java index f0c04d94f6702..4a4394ce861be 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/OptimizedMarshallerIndexNameTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/OptimizedMarshallerIndexNameTest.java @@ -25,6 +25,7 @@ import java.util.UUID; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -104,7 +105,7 @@ protected static CacheConfiguration cacheConfiguration(String na U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), workSubdir(), true)); startGrid(getTestIgniteInstanceName()); - grid().active(true); + grid().cluster().state(ClusterState.ACTIVE); } /** diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/StaticCacheDdlTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/StaticCacheDdlTest.java index f412abe227a94..bb705ccb93441 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/StaticCacheDdlTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/StaticCacheDdlTest.java @@ -30,6 +30,7 @@ import org.apache.ignite.cache.query.FieldsQueryCursor; import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -93,7 +94,7 @@ public void testAddColumn() throws Exception { int size = 10; try (Ignite ignite = startGrid(0)) { - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); insertData(ignite, PERSISTENT_CACHE_NAME, size); insertData(ignite, MEMORY_CACHE_NAME, size); @@ -129,7 +130,7 @@ public void testDropColumn() throws Exception { int size = 10; try (Ignite ignite = startGrid(0)) { - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); insertData(ignite, PERSISTENT_CACHE_NAME, size); insertData(ignite, MEMORY_CACHE_NAME, size); @@ -162,7 +163,7 @@ public void testAddIndex() throws Exception { int size = 10; try (Ignite ignite = startGrid(0)) { - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); insertData(ignite, PERSISTENT_CACHE_NAME, size); insertData(ignite, MEMORY_CACHE_NAME, size); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/StopNodeOnRebuildIndexFailureTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/StopNodeOnRebuildIndexFailureTest.java index e32da50992331..0d632a2f200f8 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/StopNodeOnRebuildIndexFailureTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/StopNodeOnRebuildIndexFailureTest.java @@ -23,6 +23,7 @@ import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.client.Person; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -209,7 +210,7 @@ private void startBuildIndexAndThrowExceptionTest(Supplier IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); assertEquals(1, G.allGrids().size()); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/metric/SqlViewExporterSpiTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/metric/SqlViewExporterSpiTest.java index 1d1346e4d8e76..8402b36cd1e14 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/metric/SqlViewExporterSpiTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/metric/SqlViewExporterSpiTest.java @@ -52,6 +52,7 @@ import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.client.IgniteClient; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.ClientConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -139,7 +140,7 @@ public class SqlViewExporterSpiTest extends AbstractExporterSpiTest { ignite1 = startGrid(1); ignite0.cluster().baselineAutoAdjustEnabled(false); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); } /** {@inheritDoc} */ @@ -935,9 +936,9 @@ public void testPagesList() throws Exception { dbMgr.enableCheckpoints(true).get(); } - ignite0.cluster().active(false); + ignite0.cluster().state(ClusterState.INACTIVE); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cacheInMemory = ignite0.getOrCreateCache(new CacheConfiguration() .setName("cacheFLInMemory").setDataRegionName("in-memory")); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccSqlTxQueriesAbstractTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccSqlTxQueriesAbstractTest.java index 63746824ed74d..19e6514fef33c 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccSqlTxQueriesAbstractTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccSqlTxQueriesAbstractTest.java @@ -45,6 +45,7 @@ import org.apache.ignite.cache.query.FieldsQueryCursor; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.configuration.TransactionConfiguration; import org.apache.ignite.internal.IgniteEx; @@ -1971,7 +1972,7 @@ public void testHints() throws Exception { Ignite node = startGrid(getConfiguration("grid").setMvccVacuumFrequency(100)); - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); Ignite client = startClientGrid(getConfiguration("client")); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/RebuildIndexLogMessageTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/RebuildIndexLogMessageTest.java index 94d8de53c60bd..6b5d8d7d6d3d3 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/RebuildIndexLogMessageTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/RebuildIndexLogMessageTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -135,7 +136,7 @@ public void testRebuildIndexLogMessage() throws Exception { String gridName = ignite.name(); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cacheA = ignite.getOrCreateCache(CACHE_NAME_A); IgniteCache cacheB = ignite.getOrCreateCache(CACHE_NAME_B); @@ -166,7 +167,7 @@ public void testRebuildIndexLogMessage() throws Exception { ignite = startGrid(getConfiguration(gridName)); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); cacheA = ignite.getOrCreateCache(CACHE_NAME_A); cacheB = ignite.getOrCreateCache(CACHE_NAME_B); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteCacheGroupsWithRestartsTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteCacheGroupsWithRestartsTest.java index 04898804c9840..b03161aa16fd0 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteCacheGroupsWithRestartsTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteCacheGroupsWithRestartsTest.java @@ -37,6 +37,7 @@ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.store.CacheStore; import org.apache.ignite.cache.store.CacheStoreAdapter; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.ConnectorConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -364,7 +365,7 @@ private VisorFindAndDeleteGarbageInPersistenceTaskResult executeTask( * @param ignite Ignite instance. */ private void prepareCachesAndData(IgniteEx ignite) { - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); for (int j = 0; j < 3; j++) { for (int i = 0; i < 64 * 10; i++) { diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteTcBotInitNewPageTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteTcBotInitNewPageTest.java index 429be3d2fee76..c723e1afef4e8 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteTcBotInitNewPageTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteTcBotInitNewPageTest.java @@ -21,6 +21,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteDataStreamer; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -54,7 +55,7 @@ public class IgniteTcBotInitNewPageTest extends GridCommonAbstractTest { public void testInitNewPagePageIdConsistency() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache(CACHE); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IndexingMultithreadedLoadContinuousRestartTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IndexingMultithreadedLoadContinuousRestartTest.java index a31ea8f53cc57..fa7293dc65bed 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IndexingMultithreadedLoadContinuousRestartTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IndexingMultithreadedLoadContinuousRestartTest.java @@ -27,6 +27,7 @@ import org.apache.ignite.cache.QueryIndex; import org.apache.ignite.cache.QueryIndexType; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -151,7 +152,7 @@ public void test() throws Exception { for (int i = 0; i < RESTARTS; i++) { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); // Ensure that checkpoint isn't running - otherwise validate indexes task may fail. forceCheckpoint(); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/LongDestroyDurableBackgroundTaskTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/LongDestroyDurableBackgroundTaskTest.java index 1c24e044109c6..a5fa7dc792cf5 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/LongDestroyDurableBackgroundTaskTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/LongDestroyDurableBackgroundTaskTest.java @@ -42,6 +42,7 @@ import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.client.IgniteClient; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.ClientConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -299,7 +300,7 @@ private void testLongIndexDeletion( forceCheckpoint(aliveNode); - aliveNode.cluster().active(false); + aliveNode.cluster().state(ClusterState.INACTIVE); } ignite = startGrid(RESTARTED_NODE_NUM); @@ -309,7 +310,7 @@ private void testLongIndexDeletion( awaitPartitionMapExchange(); if (checkWhenOneNodeStopped) { - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); // If index was dropped, we need to wait it's rebuild on restarted node. if (!dropIdxWhenOneNodeStopped0) @@ -577,7 +578,7 @@ private IgniteEx prepareAndPopulateCluster(int nodeCnt, boolean multicolumn, boo public void testClusterDeactivationShouldPassWithoutErrors() throws Exception { IgniteEx ignite = startGrids(NODES_COUNT); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache("TEST"); @@ -595,7 +596,7 @@ public void testClusterDeactivationShouldPassWithoutErrors() throws Exception { testLog.registerAllListeners(lsnr, lsnr2, lsnr3); - ignite.cluster().active(false); + ignite.cluster().state(ClusterState.INACTIVE); doSleep(1_000); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoveryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoveryTest.java index a38e4921cdc20..06980a4407af3 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoveryTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoveryTest.java @@ -299,7 +299,7 @@ public class IgniteWalRecoveryTest extends GridCommonAbstractTest { public void testWalBig() throws Exception { IgniteEx ignite = startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache(CACHE_NAME); @@ -326,7 +326,7 @@ public void testWalBig() throws Exception { ignite = startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache = ignite.cache(CACHE_NAME); @@ -344,7 +344,7 @@ public void testWalBigObjectNodeCancel() throws Exception { IgniteEx ignite = startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache(CACHE_NAME); @@ -358,7 +358,7 @@ public void testWalBigObjectNodeCancel() throws Exception { ignite = startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache = ignite.cache(CACHE_NAME); @@ -384,7 +384,7 @@ public void testSwitchClassLoader() throws Exception { // CustomDiscoveryMessage will trigger service tasks startGrid(2); - igniteEx.cluster().active(true); + igniteEx.cluster().state(ClusterState.ACTIVE); IgniteCache cache = igniteEx.cache(CACHE_NAME); @@ -418,7 +418,7 @@ public void testSwitchClassLoader() throws Exception { public void testWalSimple() throws Exception { IgniteEx ignite = startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache(CACHE_NAME); @@ -459,7 +459,7 @@ else if (i % 2 == 0) ignite = startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache = ignite.cache(CACHE_NAME); @@ -491,7 +491,7 @@ else if (i % 2 == 0) public void testWalLargeValue() throws Exception { IgniteEx ignite = startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache(CACHE_NAME); @@ -510,7 +510,7 @@ public void testWalLargeValue() throws Exception { ignite = startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache = ignite.cache(CACHE_NAME); @@ -543,7 +543,7 @@ public void testBinaryRecoverBeforePMEWhenMiddleCheckpoint() throws Exception { IgniteEx ig2 = grid(2); - ig2.cluster().active(true); + ig2.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ig2.cache(CACHE_NAME); @@ -666,7 +666,7 @@ public void testHugeCheckpointRecord() throws Exception { final IgniteEx ignite = startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); for (int i = 0; i < 50; i++) { CacheConfiguration ccfg = new CacheConfiguration<>("cache-" + i); @@ -720,7 +720,7 @@ private void checkWalRolloverMultithreaded() throws Exception { IgniteEx ignite = startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); final IgniteCache cache = ignite.cache(CACHE_NAME); @@ -743,7 +743,7 @@ private void checkWalRolloverMultithreaded() throws Exception { public void testWalRenameDirSimple() throws Exception { IgniteEx ignite = startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.cache(CACHE_NAME); @@ -762,7 +762,7 @@ public void testWalRenameDirSimple() throws Exception { ignite = startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); cache = ignite.cache(RENAMED_CACHE_NAME); @@ -805,7 +805,7 @@ public void testRecoveryNoCheckpoint() throws Exception { IgniteEx cacheGrid = startGrid(1); - ctrlGrid.cluster().active(true); + ctrlGrid.cluster().state(ClusterState.ACTIVE); ctrlGrid.compute(ctrlGrid.cluster().forRemotes()).run(new LoadRunnable(false)); @@ -854,7 +854,7 @@ public void testRecoveryLargeNoCheckpoint() throws Exception { IgniteEx cacheGrid = startGrid(1); - ctrlGrid.cluster().active(true); + ctrlGrid.cluster().state(ClusterState.ACTIVE); ctrlGrid.compute(ctrlGrid.cluster().forRemotes()).run(new LargeLoadRunnable(false)); @@ -910,7 +910,7 @@ public void testRandomCrash() throws Exception { IgniteEx cacheGrid = startGrid(1); - ctrlGrid.cluster().active(true); + ctrlGrid.cluster().state(ClusterState.ACTIVE); IgniteCompute rmt = ctrlGrid.compute(ctrlGrid.cluster().forRemotes()); @@ -952,7 +952,7 @@ public void testLargeRandomCrash() throws Exception { IgniteEx cacheGrid = startGrid(1); - ctrlGrid.cluster().active(true); + ctrlGrid.cluster().state(ClusterState.ACTIVE); IgniteCompute rmt = ctrlGrid.compute(ctrlGrid.cluster().forRemotes()); @@ -998,7 +998,7 @@ private static class RemoteNodeFilter implements IgnitePredicate { public void testDestroyCache() throws Exception { IgniteEx ignite = startGrid(1); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); IgniteCache cache = ignite.getOrCreateCache("test"); @@ -1019,7 +1019,7 @@ public void testDestroyCache() throws Exception { public void testEvictPartition() throws Exception { Ignite ignite1 = startGrid("node1"); - ignite1.cluster().active(true); + ignite1.cluster().state(ClusterState.ACTIVE); IgniteCache cache1 = ignite1.cache(CACHE_NAME); @@ -1041,7 +1041,7 @@ public void testEvictPartition() throws Exception { ignite1 = startGrid("node1"); ignite2 = startGrid("node2"); - ignite1.cluster().active(true); + ignite1.cluster().state(ClusterState.ACTIVE); cache1 = ignite1.cache(CACHE_NAME); cache2 = ignite2.cache(CACHE_NAME); @@ -1062,7 +1062,7 @@ public void testMetastorage() throws Exception { IgniteEx ignite0 = (IgniteEx)startGrid("node1"); IgniteEx ignite1 = (IgniteEx)startGrid("node2"); - ignite1.cluster().active(true); + ignite1.cluster().state(ClusterState.ACTIVE); GridCacheSharedContext sharedCtx0 = ignite0.context().cache().context(); GridCacheSharedContext sharedCtx1 = ignite1.context().cache().context(); @@ -1122,7 +1122,7 @@ public void testMetastorageLargeArray() throws Exception { IgniteEx ignite = (IgniteEx)startGrid("node1"); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); GridCacheSharedContext sharedCtx = ignite.context().cache().context(); @@ -1163,7 +1163,7 @@ public void testMetastorageRemove() throws Exception { IgniteEx ignite0 = (IgniteEx)startGrid("node1"); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); GridCacheSharedContext sharedCtx0 = ignite0.context().cache().context(); @@ -1212,7 +1212,7 @@ public void testMetastorageUpdate() throws Exception { IgniteEx ignite0 = (IgniteEx)startGrid("node1"); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); GridCacheSharedContext sharedCtx0 = ignite0.context().cache().context(); @@ -1264,7 +1264,7 @@ public void testMetastorageWalRestore() throws Exception { IgniteEx ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); GridCacheSharedContext sharedCtx0 = ignite0.context().cache().context(); @@ -1293,7 +1293,7 @@ public void testMetastorageWalRestore() throws Exception { ignite0 = startGrid(0); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); sharedCtx0 = ignite0.context().cache().context(); @@ -1318,7 +1318,7 @@ public void testAbsentDeadlock_Iterator_RollOver_Archivation() throws Exception IgniteEx ignite0 = (IgniteEx)startGrid("node0"); - ignite0.active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = ignite0.cache(CACHE_NAME); @@ -1378,7 +1378,7 @@ public void testAbsentDeadlock_Iterator_RollOver_Archivation() throws Exception public void testApplyDeltaRecords() throws Exception { IgniteEx ignite0 = (IgniteEx)startGrid("node0"); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = ignite0.cache(CACHE_NAME); @@ -1731,7 +1731,7 @@ else if (rec instanceof DataRecord) { @WithSystemProperty(key = "IGNITE_DISABLE_WAL_DURING_REBALANCING", value = "false") public void testRecoveryAfterRestart_Join() throws Exception { IgniteEx crd = startGrid(1); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); for (int i = 0; i < PARTS; i++) { crd.cache(CACHE_1).put(i, i); @@ -1791,7 +1791,7 @@ public void testRecoveryAfterRestart_Join() throws Exception { @WithSystemProperty(key = IGNITE_DISABLE_WAL_DURING_REBALANCING, value = "false") public void testRecoveryAfterRestart_Activate() throws Exception { IgniteEx crd = startGrid(1); - crd.cluster().active(true); + crd.cluster().state(ClusterState.ACTIVE); for (int i = 0; i < PARTS; i++) { crd.cache(CACHE_1).put(i, i); @@ -1832,7 +1832,7 @@ public void testRecoveryAfterRestart_Activate() throws Exception { GridTestUtils.runAsync(new Runnable() { @Override public void run() { - grid(1).cluster().active(true); + grid(1).cluster().state(ClusterState.ACTIVE); } }); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbSingleNodeWithIndexingWalRestoreTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbSingleNodeWithIndexingWalRestoreTest.java index 046fd8ada596c..6ce095d3f9774 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbSingleNodeWithIndexingWalRestoreTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbSingleNodeWithIndexingWalRestoreTest.java @@ -25,6 +25,7 @@ import org.apache.ignite.binary.BinaryObjectBuilder; import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.QueryIndex; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.BinaryConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; @@ -130,7 +131,7 @@ public RegularPerson(String regName) { public void testClasslessBinaryValuesRestored() throws Exception { IgniteEx ig = startGrid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); GridCacheDatabaseSharedManager dbMgr = (GridCacheDatabaseSharedManager)ig.context().cache().context().database(); @@ -152,7 +153,7 @@ public void testClasslessBinaryValuesRestored() throws Exception { ig = startGrid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); cache = ig.cache("indexedCache").withKeepBinary(); @@ -168,7 +169,7 @@ public void testClasslessBinaryValuesRestored() throws Exception { public void testRegularClassesRestored() throws Exception { IgniteEx ig = startGrid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); GridCacheDatabaseSharedManager dbMgr = (GridCacheDatabaseSharedManager)ig.context().cache().context().database(); @@ -183,7 +184,7 @@ public void testRegularClassesRestored() throws Exception { ig = startGrid(0); - ig.active(true); + ig.cluster().state(ClusterState.ACTIVE); cache = ig.cache("indexedCache"); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreQueryWithMultipleClassesPerCacheTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreQueryWithMultipleClassesPerCacheTest.java index 685af7f82e7a7..3d34da1a12c34 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreQueryWithMultipleClassesPerCacheTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreQueryWithMultipleClassesPerCacheTest.java @@ -24,6 +24,7 @@ import org.apache.ignite.cache.CacheRebalanceMode; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -99,7 +100,7 @@ private CacheConfiguration cacheCfg(String name) { public void testSimple() throws Exception { IgniteEx ig0 = startGrid(0); - ig0.active(true); + ig0.cluster().state(ClusterState.ACTIVE); ig0.cache(CACHE_NAME).put(0, new Person(0)); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreSchemaLoadTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreSchemaLoadTest.java index f04725fb58666..a812c181d96f6 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreSchemaLoadTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgnitePersistentStoreSchemaLoadTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -142,7 +143,7 @@ public void testDynamicSchemaChangesPersistenceWithAliveCluster() throws Excepti public void testDynamicSchemaChangesPersistenceWithStaticCache() throws Exception { IgniteEx node = startGrid(getConfigurationWithStaticCache(getTestIgniteInstanceName(0))); - node.active(true); + node.cluster().state(ClusterState.ACTIVE); IgniteCache cache = node.cache(STATIC_CACHE_NAME); @@ -164,7 +165,7 @@ public void testDynamicSchemaChangesPersistenceWithStaticCache() throws Exceptio // will be ignored due to cache names duplication. node = startGrid(0); - node.active(true); + node.cluster().state(ClusterState.ACTIVE); checkDynamicSchemaChanges(node, STATIC_CACHE_NAME); } @@ -177,7 +178,7 @@ public void testDynamicSchemaChangesPersistenceWithStaticCache() throws Exceptio private void checkSchemaStateAfterNodeRestart(boolean aliveCluster) throws Exception { IgniteEx node = startGrid(0); - node.active(true); + node.cluster().state(ClusterState.ACTIVE); if (aliveCluster) startGrid(1); @@ -199,7 +200,7 @@ private void checkSchemaStateAfterNodeRestart(boolean aliveCluster) throws Excep node = startGrid(0); - node.active(true); + node.cluster().state(ClusterState.ACTIVE); checkDynamicSchemaChanges(node, SQL_CACHE_NAME); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteTwoRegionsRebuildIndexTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteTwoRegionsRebuildIndexTest.java index 5971ec0d03512..3c957f23e084c 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteTwoRegionsRebuildIndexTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/IgniteTwoRegionsRebuildIndexTest.java @@ -19,6 +19,7 @@ import org.apache.ignite.Ignite; import org.apache.ignite.IgniteDataStreamer; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -98,7 +99,7 @@ public void testRebuildIndexes() throws Exception { startGrid("server"); Ignite client = startClientGrid("client"); - client.cluster().active(true); + client.cluster().state(ClusterState.ACTIVE); populateData(client, PERSISTED_CACHE); populateData(client, INMEMORY_CACHE); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexTest.java index 8076c22bca525..f8b70040a5adf 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.cache.QueryIndex; import org.apache.ignite.cache.QueryIndexType; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -166,7 +167,7 @@ private void check(boolean msgFound) throws Exception { IgniteEx node = startGrids(2); - node.cluster().active(true); + node.cluster().state(ClusterState.ACTIVE); IgniteCache cache = node.getOrCreateCache(CACHE_NAME); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexWithHistoricalRebalanceTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexWithHistoricalRebalanceTest.java index 109a457bef7b5..d66793c57aba4 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexWithHistoricalRebalanceTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexWithHistoricalRebalanceTest.java @@ -33,6 +33,7 @@ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -205,7 +206,7 @@ public void shouldRebuldIndexForMovingPartitionWithHistoricalRebalance() throws IgniteEx node1 = startGrid(0); startGrid(1); - node1.cluster().active(true); + node1.cluster().state(ClusterState.ACTIVE); IgniteCache cache = node1.getOrCreateCache(CACHE_NAME); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteBaselineLockPartitionOnAffinityRunAtomicCacheTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteBaselineLockPartitionOnAffinityRunAtomicCacheTest.java index 1ef3dca423931..b415492b7c00a 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteBaselineLockPartitionOnAffinityRunAtomicCacheTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteBaselineLockPartitionOnAffinityRunAtomicCacheTest.java @@ -16,6 +16,7 @@ */ package org.apache.ignite.internal.processors.database.baseline; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -65,7 +66,7 @@ public class IgniteBaselineLockPartitionOnAffinityRunAtomicCacheTest extends Ign startGrids(gridCnt + 1); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); startGrid(gridCnt + 1); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteBaselineLockPartitionOnAffinityRunTxCacheTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteBaselineLockPartitionOnAffinityRunTxCacheTest.java index af4547b01edf5..b4cf33285aaf4 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteBaselineLockPartitionOnAffinityRunTxCacheTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteBaselineLockPartitionOnAffinityRunTxCacheTest.java @@ -16,6 +16,7 @@ */ package org.apache.ignite.internal.processors.database.baseline; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -55,7 +56,7 @@ public class IgniteBaselineLockPartitionOnAffinityRunTxCacheTest extends IgniteC startGrids(gridCnt + 1); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); startGrid(gridCnt + 1); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteChangingBaselineCacheQueryNodeRestartSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteChangingBaselineCacheQueryNodeRestartSelfTest.java index 2b76f65c95d2a..18f5345dcbc57 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteChangingBaselineCacheQueryNodeRestartSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteChangingBaselineCacheQueryNodeRestartSelfTest.java @@ -23,6 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.ignite.cluster.BaselineNode; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -58,7 +59,7 @@ public class IgniteChangingBaselineCacheQueryNodeRestartSelfTest extends IgniteC initStoreStrategy(); grid(0).cluster().baselineAutoAdjustEnabled(false); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteStableBaselineBinObjFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteStableBaselineBinObjFieldsQuerySelfTest.java index fd90868196025..8453f87c58316 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteStableBaselineBinObjFieldsQuerySelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteStableBaselineBinObjFieldsQuerySelfTest.java @@ -16,6 +16,7 @@ */ package org.apache.ignite.internal.processors.database.baseline; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -54,7 +55,7 @@ public class IgniteStableBaselineBinObjFieldsQuerySelfTest extends IgniteBinaryO startGrids(GRID_CNT + 1); - grid(0).active(true); + grid(0).cluster().state(ClusterState.ACTIVE); stopGrid(GRID_CNT); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteStableBaselineCacheQueryNodeRestartsSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteStableBaselineCacheQueryNodeRestartsSelfTest.java index bb4fe800b6bdb..327b901536182 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteStableBaselineCacheQueryNodeRestartsSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/baseline/IgniteStableBaselineCacheQueryNodeRestartsSelfTest.java @@ -19,6 +19,7 @@ import java.util.concurrent.Callable; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -53,7 +54,7 @@ public class IgniteStableBaselineCacheQueryNodeRestartsSelfTest extends IgniteCa initStoreStrategy(); - grid(0).cluster().active(true); + grid(0).cluster().state(ClusterState.ACTIVE); stopGrid(gridCount()); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaWithPdsEnabled.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaWithPdsEnabled.java index fe25de5f0364d..a0cb060ba4380 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaWithPdsEnabled.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaWithPdsEnabled.java @@ -20,6 +20,7 @@ import java.util.List; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -98,7 +99,7 @@ public void testSimpleRestart() throws Exception { stopGrid(0); - startGrid(0).cluster().active(true); + startGrid(0).cluster().state(ClusterState.ACTIVE); for (String schemaName : ALL_SCHEMAS) { List> act = execSql("SELECT COUNT(*) FROM " + t(q(schemaName), TABLE_NAME) @@ -137,7 +138,7 @@ private void verifyCacheInSchema(String cacheName, String expSchema) { private IgniteEx startAndActivate() throws Exception { IgniteEx ignite = startGrid(0); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); return ignite; } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LocalQueryLazyTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LocalQueryLazyTest.java index a950edfc7b336..c9aa7937263db 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LocalQueryLazyTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LocalQueryLazyTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.cache.query.FieldsQueryCursor; import org.apache.ignite.cache.query.QueryRetryException; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.failure.StopNodeFailureHandler; @@ -189,9 +190,9 @@ public void testDeactivateWithOpenCursor() throws Exception { it.next(); - grid(0).cluster().active(false); + grid(0).cluster().state(ClusterState.INACTIVE); - assertFalse(grid().cluster().active()); + assertFalse(grid().cluster().state().active()); } /** diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSystemViewsSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSystemViewsSelfTest.java index 155f2d4f7d363..196e057f7c7ed 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSystemViewsSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSystemViewsSelfTest.java @@ -341,7 +341,7 @@ public void testTableViewDuringRebuilding() throws Exception { IgniteEx srv = startGrid(getConfiguration()); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); String cacheName1 = "CACHE_1"; String cacheSqlName1 = "SQL_PUBLIC_" + cacheName1; @@ -371,7 +371,7 @@ public void testTableViewDuringRebuilding() throws Exception { srv = startGrid(getConfiguration()); - srv.cluster().active(true); + srv.cluster().state(ClusterState.ACTIVE); checkIndexRebuild(cacheName1, true); checkIndexRebuild(cacheName2, true); @@ -955,7 +955,7 @@ public void testBaselineViews() throws Exception { startGrid(getTestIgniteInstanceName(1), getPdsConfiguration("node1") .setUserAttributes(F.asMap(customAttr, "val1"))); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); List> res = execSql("SELECT CONSISTENT_ID, ONLINE FROM " + systemSchemaName() + ".BASELINE_NODES ORDER BY CONSISTENT_ID"); @@ -1130,7 +1130,7 @@ public void testSnapshotViews() throws Exception { public void testIoStatisticsViews() throws Exception { Ignite ignite = startGrid(getTestIgniteInstanceName(), getPdsConfiguration("node0")); - ignite.cluster().active(true); + ignite.cluster().state(ClusterState.ACTIVE); execSql("CREATE TABLE TST(id INTEGER PRIMARY KEY, name VARCHAR, age integer)"); @@ -1407,7 +1407,7 @@ public void testCachesViews() throws Exception { Ignite ignite1 = startGrid(getConfiguration().setDataStorageConfiguration(dsCfg).setIgniteInstanceName("node1")); - ignite0.cluster().active(true); + ignite0.cluster().state(ClusterState.ACTIVE); Ignite ignite2 = startGrid(getConfiguration().setDataStorageConfiguration(dsCfg).setIgniteInstanceName("node2")); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlTwoCachesInGroupWithSameEntryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlTwoCachesInGroupWithSameEntryTest.java index 38c6ebd5a3de3..f48ebfe469e45 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlTwoCachesInGroupWithSameEntryTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlTwoCachesInGroupWithSameEntryTest.java @@ -23,6 +23,7 @@ import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.query.FieldsQueryCursor; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -93,7 +94,7 @@ public static Iterable params() { public void test() throws Exception { IgniteEx ign = startGrid(0); - ign.cluster().active(true); + ign.cluster().state(ClusterState.ACTIVE); IgniteCache cache0 = ign.createCache(new CacheConfiguration<>("cache0") .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL) diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexRebuildSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexRebuildSelfTest.java index 73df17940c612..ccbdf765307d7 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexRebuildSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexRebuildSelfTest.java @@ -26,6 +26,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgniteInterruptedCheckedException; @@ -379,7 +380,7 @@ protected void putData(Ignite node, final boolean forConcurrentPut) throws Excep */ protected IgniteEx startServer() throws Exception { IgniteEx srvNode = startGrid(serverConfiguration(0)); - srvNode.active(true); + srvNode.cluster().state(ClusterState.ACTIVE); return srvNode; } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexRebuildTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexRebuildTest.java index 7a2d620de56e0..29534bdb7360e 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexRebuildTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexRebuildTest.java @@ -37,6 +37,7 @@ import org.apache.ignite.cache.QueryIndex; import org.apache.ignite.cache.QueryIndexType; import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -146,7 +147,7 @@ public void testFullIndexRebuild() throws Exception { IgniteEx grid1 = startGrids(4); - grid1.cluster().active(true); + grid1.cluster().state(ClusterState.ACTIVE); final int accountCnt = 2048; @@ -256,7 +257,7 @@ public void testPartialIndexRebuild() throws Exception { IgniteEx grid1 = startGrids(4); - grid1.cluster().active(true); + grid1.cluster().state(ClusterState.ACTIVE); final int accountCnt = 2048; diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/QueryDataPageScanTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/QueryDataPageScanTest.java index 0de1631149c30..771dcddcce372 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/QueryDataPageScanTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/QueryDataPageScanTest.java @@ -44,6 +44,7 @@ import org.apache.ignite.cache.query.SqlQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; import org.apache.ignite.cache.query.annotations.QuerySqlFunction; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -102,7 +103,7 @@ public void testMultipleIndexedTypes() throws Exception { final String cacheName = "test_multi_type"; IgniteEx server = startGrid(0); - server.cluster().active(true); + server.cluster().state(ClusterState.ACTIVE); CacheConfiguration ccfg = new CacheConfiguration<>(cacheName); ccfg.setAffinity(new RendezvousAffinityFunction(false, 1)); @@ -193,7 +194,7 @@ private void doTestConcurrentUpdates(boolean enableMvcc) throws Exception { final String cacheName = "test_updates"; IgniteEx server = startGrid(0); - server.cluster().active(true); + server.cluster().state(ClusterState.ACTIVE); CacheConfiguration ccfg = new CacheConfiguration<>(cacheName); ccfg.setIndexedTypes(Long.class, Long.class); @@ -311,7 +312,7 @@ public void testDataPageScan() throws Exception { GridQueryProcessor.idxCls = DirectPageScanIndexing.class; IgniteEx server = startGrid(0); - server.cluster().active(true); + server.cluster().state(ClusterState.ACTIVE); IgniteEx client = startClientGrid(1); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/oom/AbstractQueryOOMTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/oom/AbstractQueryOOMTest.java index eb31ca1948e8a..9f5b4ad74f609 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/oom/AbstractQueryOOMTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/oom/AbstractQueryOOMTest.java @@ -33,6 +33,7 @@ import org.apache.ignite.cache.QueryIndex; import org.apache.ignite.cache.query.annotations.QuerySqlField; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -125,7 +126,7 @@ public abstract class AbstractQueryOOMTest extends GridCommonAbstractTest { for (int i = 0; i < RMT_NODES_CNT; ++i) startGrid("remote-" + i); - local.cluster().active(true); + local.cluster().state(ClusterState.ACTIVE); IgniteCache c = local.cache(CACHE_NAME); @@ -152,7 +153,7 @@ public abstract class AbstractQueryOOMTest extends GridCommonAbstractTest { awaitPartitionMapExchange(true, true, null); - local.cluster().active(false); + local.cluster().state(ClusterState.INACTIVE); stopAllGrids(false); @@ -179,7 +180,7 @@ public abstract class AbstractQueryOOMTest extends GridCommonAbstractTest { for (int i = 0; i < RMT_NODES_CNT; ++i) startGrid("remote-" + i); - loc.cluster().active(true); + loc.cluster().state(ClusterState.ACTIVE); stopGrid(0, false); } diff --git a/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java b/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java index d7955b567b55e..12cf56e14e96e 100644 --- a/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java +++ b/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java @@ -25,6 +25,7 @@ import java.util.concurrent.ExecutorService; import org.apache.ignite.cache.affinity.Affinity; import org.apache.ignite.cluster.ClusterGroup; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.AtomicConfiguration; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.CollectionConfiguration; @@ -602,14 +603,14 @@ public ApplicationContext getApplicationContext() throws BeansException { @Override public boolean active() { checkIgnite(); - return g.active(); + return g.cluster().state().active(); } /** {@inheritDoc} */ @Override public void active(boolean active) { checkIgnite(); - g.active(active); + g.cluster().state(active ? ClusterState.ACTIVE : ClusterState.INACTIVE); } /** {@inheritDoc} */ diff --git a/modules/spring/src/test/java/org/apache/ignite/encryption/SpringEncryptedCacheRestartClientTest.java b/modules/spring/src/test/java/org/apache/ignite/encryption/SpringEncryptedCacheRestartClientTest.java index fa6de21838777..5ef3f5e7a388c 100644 --- a/modules/spring/src/test/java/org/apache/ignite/encryption/SpringEncryptedCacheRestartClientTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/encryption/SpringEncryptedCacheRestartClientTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.encryption; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgnitionEx; import org.apache.ignite.internal.encryption.EncryptedCacheRestartTest; @@ -51,7 +52,7 @@ public class SpringEncryptedCacheRestartClientTest extends EncryptedCacheRestart IgniteUtils.resolveIgnitePath( "modules/spring/src/test/config/enc/enc-cache-client.xml").getAbsolutePath(), "client"); - g1.cluster().active(true); + g1.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); diff --git a/modules/spring/src/test/java/org/apache/ignite/encryption/SpringEncryptedCacheRestartTest.java b/modules/spring/src/test/java/org/apache/ignite/encryption/SpringEncryptedCacheRestartTest.java index 9e2e188eca935..79ee7693e00b5 100644 --- a/modules/spring/src/test/java/org/apache/ignite/encryption/SpringEncryptedCacheRestartTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/encryption/SpringEncryptedCacheRestartTest.java @@ -21,6 +21,7 @@ import java.util.Collection; import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgnitionEx; import org.apache.ignite.internal.encryption.EncryptedCacheRestartTest; @@ -57,7 +58,7 @@ public class SpringEncryptedCacheRestartTest extends EncryptedCacheRestartTest { IgniteUtils.resolveIgnitePath( "modules/spring/src/test/config/enc/enc-cache.xml").getAbsolutePath(), "grid-1"); - g1.cluster().active(true); + g1.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -118,7 +119,7 @@ public void testCreateEncryptedCacheGroup() throws Exception { IgniteUtils.resolveIgnitePath( "modules/spring/src/test/config/enc/enc-group-2.xml").getAbsolutePath(), "grid-1"); - g1.cluster().active(true); + g1.cluster().state(ClusterState.ACTIVE); awaitPartitionMapExchange(); @@ -191,7 +192,7 @@ private void doTestDiffCfgAndPersistentFlagVal(String cfg1, String cfg2) throws IgniteEx g = (IgniteEx)IgnitionEx.start(IgniteUtils.resolveIgnitePath(cfg1).getAbsolutePath(), "grid-0"); - g.cluster().active(true); + g.cluster().state(ClusterState.ACTIVE); IgniteCache c = g.cache("encrypted"); diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteAbstractBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteAbstractBenchmark.java index ecde441223d96..ac0b31fbfa7f2 100644 --- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteAbstractBenchmark.java +++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteAbstractBenchmark.java @@ -27,6 +27,7 @@ import org.apache.ignite.IgniteState; import org.apache.ignite.Ignition; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.events.Event; @@ -103,10 +104,10 @@ private void activateCluster() { } } - if ((args.persistentStoreEnabled() || pdsInCfg) && !ignite().cluster().active()) { + if ((args.persistentStoreEnabled() || pdsInCfg) && !ignite().cluster().state().active()) { BenchmarkUtils.println("Activating cluster."); - ignite().cluster().active(true); + ignite().cluster().state(ClusterState.ACTIVE); } } diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/AbstractJdbcBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/AbstractJdbcBenchmark.java index f1b7daa7c2d55..f14e13f94d6dd 100644 --- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/AbstractJdbcBenchmark.java +++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/AbstractJdbcBenchmark.java @@ -25,6 +25,7 @@ import java.util.List; import org.apache.ignite.IgniteException; import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.jdbc.thin.JdbcThinUtils; import org.apache.ignite.internal.util.typedef.internal.U; @@ -73,7 +74,7 @@ public abstract class AbstractJdbcBenchmark extends IgniteAbstractBenchmark { super.setUp(cfg); // activate cluster if it is not auto activated - ignite().cluster().active(true); + ignite().cluster().state(ClusterState.ACTIVE); if (url == null) { if (args.jdbcUrl().startsWith(JDBC_THIN_AUTO_FIND_PREFIX)) { diff --git a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySegmentationAndConnectionRestoreTest.java b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySegmentationAndConnectionRestoreTest.java index 9a1cf48109c90..8662153568c4c 100644 --- a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySegmentationAndConnectionRestoreTest.java +++ b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySegmentationAndConnectionRestoreTest.java @@ -29,6 +29,7 @@ import org.apache.ignite.IgniteState; import org.apache.ignite.ShutdownPolicy; import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.events.DiscoveryEvent; import org.apache.ignite.events.Event; import org.apache.ignite.events.EventType; @@ -79,7 +80,7 @@ public void testStopNodeOnSegmentaion() throws Exception { startGrid(1); - node0.cluster().active(true); + node0.cluster().state(ClusterState.ACTIVE); final IgniteEx client = startClientGrid(2);