You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vp...@apache.org on 2023/12/28 09:20:59 UTC

(ignite) branch ignite-21170 updated: Code style

This is an automated email from the ASF dual-hosted git repository.

vpyatkov pushed a commit to branch ignite-21170
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/ignite-21170 by this push:
     new 70dc45c2ae5 Code style
70dc45c2ae5 is described below

commit 70dc45c2ae512a95dfa14e2e69b280606dc74b02
Author: Vladislav Pyatkov <vl...@gmail.com>
AuthorDate: Thu Dec 28 12:20:13 2023 +0300

    Code style
---
 .../dht/topology/GridDhtPartitionTopologyImpl.java | 18 +++----
 ...tionCacheConsistencyOnUnstableTopologyTest.java | 58 +++++++++++++++++++---
 2 files changed, 61 insertions(+), 15 deletions(-)

diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
index 394707e4f12..b6b0136bc97 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
@@ -1971,19 +1971,19 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
                         }
                     }
 
-                        // Remove obsolete mappings.
-                        if (cur != null) {
-                            for (Integer p : F.view(cur.keySet(), F0.notIn(parts.keySet()))) {
-                                Set<UUID> ids = diffFromAffinity.get(p);
+                    // Remove obsolete mappings.
+                    if (cur != null) {
+                        for (Integer p : F.view(cur.keySet(), F0.notIn(parts.keySet()))) {
+                            Set<UUID> ids = diffFromAffinity.get(p);
 
-                                if (ids != null && ids.remove(parts.nodeId())) {
-                                    changed = true;
+                            if (ids != null && ids.remove(parts.nodeId())) {
+                                changed = true;
 
-                                    if (ids.isEmpty())
-                                        diffFromAffinity.remove(p);
-                                }
+                                if (ids.isEmpty())
+                                    diffFromAffinity.remove(p);
                             }
                         }
+                    }
 
                     diffFromAffinityVer = readyTopVer;
                 }
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/ReplicationCacheConsistencyOnUnstableTopologyTest.java b/modules/core/src/test/java/org/apache/ignite/cache/ReplicationCacheConsistencyOnUnstableTopologyTest.java
index 12e5bb539f7..5a6d171c044 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/ReplicationCacheConsistencyOnUnstableTopologyTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/ReplicationCacheConsistencyOnUnstableTopologyTest.java
@@ -1,11 +1,12 @@
 /*
- * Copyright 2023 GridGain Systems, Inc. and Contributors.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the GridGain Community Edition License (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://www.gridgain.com/products/software/community-edition/gridgain-community-edition-license
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -63,6 +64,9 @@ public class ReplicationCacheConsistencyOnUnstableTopologyTest extends GridCommo
      */
     private boolean readFromBackup;
 
+    /**
+     * {@inheritDoc}
+     */
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
         return super.getConfiguration(igniteInstanceName)
             .setConsistentId(igniteInstanceName)
@@ -80,12 +84,18 @@ public class ReplicationCacheConsistencyOnUnstableTopologyTest extends GridCommo
                 .setReadFromBackup(readFromBackup));
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override protected void beforeTest() throws Exception {
         super.beforeTest();
 
         cleanPersistenceDir();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override protected void afterTest() throws Exception {
         stopAllGrids();
 
@@ -94,61 +104,97 @@ public class ReplicationCacheConsistencyOnUnstableTopologyTest extends GridCommo
         super.afterTest();
     }
 
+    /**
+     * @throws Exception If fail.
+     */
     @Test
     public void testReplicatedFullSync() throws Exception {
         process(CacheMode.REPLICATED, CacheWriteSynchronizationMode.FULL_SYNC, false);
     }
 
+    /**
+     * @throws Exception If fail.
+     */
     @Test
     public void testReplicatedFullSyncReadFromBackup() throws Exception {
         process(CacheMode.REPLICATED, CacheWriteSynchronizationMode.FULL_SYNC, true);
     }
 
+    /**
+     * @throws Exception If fail.
+     */
     @Test
     public void testReplicatedPrimarySync() throws Exception {
         process(CacheMode.REPLICATED, CacheWriteSynchronizationMode.PRIMARY_SYNC, false);
     }
 
+    /**
+     * @throws Exception If fail.
+     */
     @Test
     public void testReplicatedPrimarySyncReadFromBackup() throws Exception {
         process(CacheMode.REPLICATED, CacheWriteSynchronizationMode.PRIMARY_SYNC, true);
     }
 
+    /**
+     * @throws Exception If fail.
+     */
     @Test
     public void testReplicatedFullAsync() throws Exception {
         process(CacheMode.REPLICATED, CacheWriteSynchronizationMode.FULL_ASYNC, false);
     }
 
+    /**
+     * @throws Exception If fail.
+     */
     @Test
     public void testReplicatedFullAsyncReadFromBackup() throws Exception {
         process(CacheMode.REPLICATED, CacheWriteSynchronizationMode.FULL_ASYNC, true);
     }
 
+    /**
+     * @throws Exception If fail.
+     */
     @Test
     public void testPartitionedFullSync() throws Exception {
         process(CacheMode.PARTITIONED, CacheWriteSynchronizationMode.FULL_SYNC, false);
     }
 
+    /**
+     * @throws Exception If fail.
+     */
     @Test
     public void testPartitionedFullSyncReadFromBackup() throws Exception {
         process(CacheMode.PARTITIONED, CacheWriteSynchronizationMode.FULL_SYNC, true);
     }
 
+    /**
+     * @throws Exception If fail.
+     */
     @Test
     public void testPartitionedPrimarySync() throws Exception {
         process(CacheMode.PARTITIONED, CacheWriteSynchronizationMode.PRIMARY_SYNC, false);
     }
 
+    /**
+     * @throws Exception If fail.
+     */
     @Test
     public void testPartitionedPrimarySyncReadFromBackup() throws Exception {
         process(CacheMode.PARTITIONED, CacheWriteSynchronizationMode.PRIMARY_SYNC, true);
     }
 
+    /**
+     * @throws Exception If fail.
+     */
     @Test
     public void testPartitionedFullAsync() throws Exception {
         process(CacheMode.PARTITIONED, CacheWriteSynchronizationMode.FULL_ASYNC, false);
     }
 
+    /**
+     * @throws Exception If fail.
+     */
     @Test
     public void testPartitionedFullAsyncReadFromBackup() throws Exception {
         process(CacheMode.PARTITIONED, CacheWriteSynchronizationMode.FULL_ASYNC, true);