Skip to content

Commit c1c0fa1

Browse files
IGNITE-26580 Improve code after self-review
1 parent 86da926 commit c1c0fa1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/MdcAffinityBackupFilter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ public MdcAffinityBackupFilter(int dcsNum, int backups) {
106106

107107
boolean res = false;
108108
String candidateDcId = candidate.dataCenterId();
109+
110+
if (candidateDcId == null)
111+
throw new IllegalStateException("Data center ID is not specified for the node: " + candidate);
112+
109113
Integer candDcPartsCopies = partsDistrMap.get(candidateDcId);
110114

111115
if (candDcPartsCopies == null || candDcPartsCopies == -1) {

modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/MdcAffinityBackupFilterSelfTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
import org.junit.Test;
3434

3535
/**
36-
* Verifies behaviour of {@link MdcAffinityBackupFilter} - guarantees that each DC has at least one copy of every partition,
37-
* distribution uniformity.
36+
* Verifies behaviour of {@link MdcAffinityBackupFilter} - guarantees that each DC has at least one copy of every partition.
37+
* Verified distribution uniformity in each DC separately.
3838
*/
3939
public class MdcAffinityBackupFilterSelfTest extends GridCommonAbstractTest {
4040
/** */

0 commit comments

Comments
 (0)