diff --git a/docs/_docs/code-snippets/dotnet/DataRebalancing.cs b/docs/_docs/code-snippets/dotnet/DataRebalancing.cs index 9fcb2e8e525f82..7eed96a7d10577 100644 --- a/docs/_docs/code-snippets/dotnet/DataRebalancing.cs +++ b/docs/_docs/code-snippets/dotnet/DataRebalancing.cs @@ -48,15 +48,9 @@ public static void RebalanceThrottle() // tag::RebalanceThrottle[] IgniteConfiguration cfg = new IgniteConfiguration { - CacheConfiguration = new[] - { - new CacheConfiguration - { - Name = "mycache", - RebalanceBatchSize = 2 * 1024 * 1024, - RebalanceThrottle = new TimeSpan(0, 0, 0, 0, 100) - } - } + RebalanceBatchSize = 2 * 1024 * 1024, + RebalanceThrottle = new TimeSpan(0, 0, 0, 0, 100), + RebalanceBatchesPrefetchCount = 3 }; // Start a node. diff --git a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/RebalancingConfiguration.java b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/RebalancingConfiguration.java index 9dc61e9da9a188..186b6efe495549 100644 --- a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/RebalancingConfiguration.java +++ b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/RebalancingConfiguration.java @@ -38,8 +38,8 @@ void configure() { cfg.setRebalanceThreadPoolSize(4); //end::pool-size[] - CacheConfiguration cacheCfg = new CacheConfiguration("mycache"); //tag::mode[] + CacheConfiguration cacheCfg = new CacheConfiguration("mycache"); cacheCfg.setRebalanceMode(CacheRebalanceMode.SYNC); @@ -47,13 +47,13 @@ void configure() { //tag::throttling[] cfg.setRebalanceBatchSize(2 * 1024 * 1024); + cfg.setRebalanceBatchesPrefetchCount(3); cfg.setRebalanceThrottle(100); //end::throttling[] - cfg.setCacheConfiguration(cacheCfg); - // Start a node. Ignite ignite = Ignition.start(cfg); + //end::ignite-config[] ignite.close(); diff --git a/docs/_docs/code-snippets/xml/rebalancing-config.xml b/docs/_docs/code-snippets/xml/rebalancing-config.xml index 44b6c329b134e6..4c42fcfa30139b 100644 --- a/docs/_docs/code-snippets/xml/rebalancing-config.xml +++ b/docs/_docs/code-snippets/xml/rebalancing-config.xml @@ -19,33 +19,34 @@ - - + - - - - - - - - + + + + + + + + + + - + diff --git a/docs/_docs/data-rebalancing.adoc b/docs/_docs/data-rebalancing.adoc index 21af78dd07fea8..49dffda35c7560 100644 --- a/docs/_docs/data-rebalancing.adoc +++ b/docs/_docs/data-rebalancing.adoc @@ -16,7 +16,7 @@ == Overview -When a new node joins the cluster, some of the partitions are relocated to the new node so that the data remains distributed equally in the cluster. This process is called _data rebalancing_. +When a new node joins the cluster, some partitions are relocated to the new node so that the data remains distributed equally in the cluster. This process is called _data rebalancing_. If an existing node permanently leaves the cluster and backups are not configured, you lose the partitions stored on this node. When backups are configured, one of the backup copies of the lost partitions becomes a primary partition and the rebalancing process is initiated. @@ -28,8 +28,6 @@ In pure in-memory clusters, the default behavior is to start rebalancing immedia In clusters with persistence, the baseline topology has to be changed manually (default behavior), or can be changed automatically when link:clustering/baseline-topology#baseline-topology-autoadjustment[automatic baseline adjustment] is enabled. ==== -Rebalancing is configured per cache. - == Configuring Rebalancing Mode Ignite supports both synchronous and asynchronous rebalancing. @@ -66,7 +64,7 @@ include::code-snippets/dotnet/DataRebalancing.cs[tag=RebalanceMode,indent=0] tab:C++[unsupported] -- -== Configuring Rebalance Thread Pool +== Configuring Rebalance Thread Pool [[threadpool]] By default, rebalancing is performed in one thread on each node. It means that at each point in time only one thread is used to transfer batches from one node to another, or to process batches coming from the remote node. @@ -127,7 +125,7 @@ tab:C++[unsupported] == Other Properties -The following table lists the properties of `CacheConfiguration` related to rebalancing: +The following table lists the properties of `IgniteConfiguration` related to rebalancing: [CAUTION] ==== @@ -137,16 +135,20 @@ The following table lists the properties of `CacheConfiguration` related to reba [cols="1,4,1",opts="header"] |=== | Property | Description | Default Value -| `rebalanceDelay` | A delay in milliseconds before the rebalancing process starts after a node joins or leaves the topology. Rebalancing delay is useful if you plan to restart nodes or start multiple nodes at once or one after another and don't want to repartition and rebalance the data until all nodes are started. -|0 (no delay) +| `rebalanceThreadPoolSize` |Rebalance thread pool size. Limit of threads used for rebalance. See <<#threadpool>> | min(4, max(1, AVAILABLE_PROC_CNT / 4)) |`rebalanceBatchSize` | The size in bytes of a single rebalance message. The rebalancing algorithm splits the data on every node into multiple batches prior to sending it to other nodes. | 512KB +|`rebalanceBatchesPrefetchCount` | Rebalance batches prefetch count. | 3 + |`rebalanceThrottle` | See <<#throttling>>.| 0 (throttling disabled) | `rebalanceOrder` | The order in which rebalancing should be done. Rebalance order can be set to a non-zero value for caches with SYNC or ASYNC rebalance modes only. Rebalancing for caches with smaller rebalance order is completed first. By default, rebalancing is not ordered. | 0 |`rebalanceTimeout` | Timeout for pending rebalancing messages when they are exchanged between the nodes. | 10 seconds + +| `rebalanceDelay` | [Deprecated] A delay in milliseconds before the rebalancing process starts after a node joins or leaves the topology. Rebalancing delay is useful if you plan to restart nodes or start multiple nodes at once or one after another and don't want to repartition and rebalance the data until all nodes are started. +| 0 (no delay) |=== diff --git a/modules/core/src/main/java/org/apache/ignite/client/ClientCacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/client/ClientCacheConfiguration.java index 17735e8eea81e0..0c1b2f1de36002 100644 --- a/modules/core/src/main/java/org/apache/ignite/client/ClientCacheConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/client/ClientCacheConfiguration.java @@ -80,7 +80,7 @@ public final class ClientCacheConfiguration implements Serializable { /** @serial Rebalance throttle. */ private long rebalanceThrottle = IgniteConfiguration.DFLT_REBALANCE_THROTTLE; - /** @serial @serial Rebalance timeout. */ + /** @serial Rebalance timeout. */ private long rebalanceTimeout = IgniteConfiguration.DFLT_REBALANCE_TIMEOUT; /** @serial Write synchronization mode. */ @@ -287,7 +287,9 @@ public ClientCacheConfiguration setGroupName(String newVal) { /** * @return Default lock acquisition timeout. {@code 0} and means that lock acquisition will never timeout. + * @deprecated Default lock timeout configuration property has no effect. */ + @Deprecated public long getDefaultLockTimeout() { return dfltLockTimeout; } @@ -295,7 +297,9 @@ public long getDefaultLockTimeout() { /** * @param dfltLockTimeout Default lock timeout. * @return {@code this} for chaining. + * @deprecated Default lock timeout configuration property has no effect. */ + @Deprecated public ClientCacheConfiguration setDefaultLockTimeout(long dfltLockTimeout) { this.dfltLockTimeout = dfltLockTimeout; @@ -342,7 +346,9 @@ public ClientCacheConfiguration setReadFromBackup(boolean readFromBackup) { * @return Size (in number bytes) to be loaded within a single rebalance message. * Rebalancing algorithm will split total data set on every node into multiple * batches prior to sending data. + * @deprecated Use {@link IgniteConfiguration#getRebalanceBatchSize()} instead. */ + @Deprecated public int getRebalanceBatchSize() { return rebalanceBatchSize; } @@ -350,7 +356,9 @@ public int getRebalanceBatchSize() { /** * @param rebalanceBatchSize Rebalance batch size. * @return {@code this} for chaining. + * @deprecated Use {@link IgniteConfiguration#setRebalanceBatchSize(int)} instead. */ + @Deprecated public ClientCacheConfiguration setRebalanceBatchSize(int rebalanceBatchSize) { this.rebalanceBatchSize = rebalanceBatchSize; @@ -363,7 +371,9 @@ public ClientCacheConfiguration setRebalanceBatchSize(int rebalanceBatchSize) { * * @return Number of batches generated by supply node at rebalancing start. * Minimum is 1. + * @deprecated Use {@link IgniteConfiguration#getRebalanceBatchesPrefetchCount()} instead */ + @Deprecated public long getRebalanceBatchesPrefetchCount() { return rebalanceBatchesPrefetchCnt; } @@ -371,7 +381,9 @@ public long getRebalanceBatchesPrefetchCount() { /** * @param rebalanceBatchesPrefetchCnt Rebalance batches prefetch count. * @return {@code this} for chaining. + * @deprecated Use {@link IgniteConfiguration#getRebalanceBatchesPrefetchCount()} instead */ + @Deprecated public ClientCacheConfiguration setRebalanceBatchesPrefetchCount(long rebalanceBatchesPrefetchCnt) { this.rebalanceBatchesPrefetchCnt = rebalanceBatchesPrefetchCnt; @@ -388,7 +400,9 @@ public ClientCacheConfiguration setRebalanceBatchesPrefetchCount(long rebalanceB * immediately upon node leaving topology. If {@code -1} is returned, then rebalancing * will only be started manually. *

+ * @deprecated Use baseline topology feature instead. Please, be aware this API will be removed in the next releases. */ + @Deprecated public long getRebalanceDelay() { return rebalanceDelay; } @@ -396,7 +410,9 @@ public long getRebalanceDelay() { /** * @param rebalanceDelay Rebalance delay. * @return {@code this} for chaining. + * @deprecated Use baseline topology feature instead. Please, be aware this API will be removed in the next releases. */ + @Deprecated public ClientCacheConfiguration setRebalanceDelay(long rebalanceDelay) { this.rebalanceDelay = rebalanceDelay; @@ -458,7 +474,9 @@ public ClientCacheConfiguration setRebalanceOrder(int rebalanceOrder) { *

* Default value of {@code 0} means that throttling is disabled. *

+ * @deprecated Use {@link IgniteConfiguration#getRebalanceThrottle()} instead. */ + @Deprecated public long getRebalanceThrottle() { return rebalanceThrottle; } @@ -466,7 +484,9 @@ public long getRebalanceThrottle() { /** * @param newVal Rebalance throttle. * @return {@code this} for chaining. + * @deprecated Use {@link IgniteConfiguration#setRebalanceThrottle(long)} instead. */ + @Deprecated public ClientCacheConfiguration setRebalanceThrottle(long newVal) { rebalanceThrottle = newVal; @@ -475,7 +495,9 @@ public ClientCacheConfiguration setRebalanceThrottle(long newVal) { /** * @return Rebalance timeout (ms). + * @deprecated Use {@link IgniteConfiguration#getRebalanceTimeout()} instead. */ + @Deprecated public long getRebalanceTimeout() { return rebalanceTimeout; } @@ -483,7 +505,9 @@ public long getRebalanceTimeout() { /** * @param newVal Rebalance timeout. * @return {@code this} for chaining. + * @deprecated Use {@link IgniteConfiguration#getRebalanceTimeout()} instead. */ + @Deprecated public ClientCacheConfiguration setRebalanceTimeout(long newVal) { rebalanceTimeout = newVal;