You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ni...@apache.org on 2023/12/11 12:05:41 UTC

(ignite) branch master updated: IGNITE-14823 Affinity abbrevation (#11083)

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

nizhikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new fd5b2441297 IGNITE-14823 Affinity abbrevation (#11083)
fd5b2441297 is described below

commit fd5b2441297a4d5440de51a1ed05e003053d21e1
Author: Nikolay <ni...@apache.org>
AuthorDate: Mon Dec 11 15:05:31 2023 +0300

    IGNITE-14823 Affinity abbrevation (#11083)
---
 .../calcite/metadata/AffinityServiceImpl.java      |  4 +-
 .../query/calcite/trait/DistributionFunction.java  |  8 ++--
 .../checkstyle/src/main/resources/abbrevations.csv |  2 +-
 ...onAwarenessReconnectionAndFailoverSelfTest.java |  6 +--
 .../thin/JdbcThinPartitionAwarenessSelfTest.java   | 46 +++++++++++-----------
 .../client/impl/GridClientAbstractProjection.java  |  6 +--
 .../internal/client/impl/GridClientDataImpl.java   |  6 +--
 .../internal/client/impl/GridClientImpl.java       |  4 +-
 .../client/thin/ClientCacheAffinityMapping.java    | 10 ++---
 .../internal/client/thin/ClientIgniteSetImpl.java  |  4 +-
 .../internal/jdbc/thin/JdbcThinConnection.java     |  8 ++--
 .../management/cache/CacheListCommand.java         | 12 +++---
 .../affinity/GridAffinityAssignmentCache.java      | 10 ++---
 .../affinity/IdealAffinityAssignment.java          |  6 +--
 .../cache/CacheAffinitySharedManager.java          | 28 ++++++-------
 .../processors/cache/GridCacheProcessor.java       |  4 +-
 .../internal/processors/cache/GridCacheUtils.java  | 18 ++++-----
 .../preloader/GridDhtPartitionsExchangeFuture.java | 14 +++----
 .../processors/odbc/jdbc/JdbcResponse.java         |  4 +-
 .../client/ClientAffinityTopologyVersion.java      |  6 +--
 .../cache/ClientCachePartitionAwarenessGroup.java  |  4 +-
 .../client/cache/ClientCachePartitionsRequest.java |  8 ++--
 .../RendezvousAffinityFunctionSimpleBenchmark.java |  4 +-
 .../internal/GridAffinityNoCacheSelfTest.java      | 10 ++---
 .../affinity/GridAffinityAssignmentV2Test.java     | 28 ++++++-------
 .../cache/GridCacheAbstractFullApiSelfTest.java    |  4 +-
 .../cache/GridCacheAtomicMessageCountSelfTest.java |  4 +-
 .../cache/GridCacheLifecycleAwareSelfTest.java     |  6 +--
 .../IgniteCacheConfigVariationsFullApiTest.java    |  8 ++--
 .../cache/IgniteCacheInvokeAbstractTest.java       |  4 +-
 .../cache/IgniteCachePeekModesAbstractTest.java    |  8 ++--
 .../GridCacheClientModesAbstractSelfTest.java      |  6 +--
 .../IgniteCacheClientReconnectTest.java            |  4 +-
 ...CacheAbstractTransformWriteThroughSelfTest.java |  8 ++--
 ...GridCachePartitionedTopologyChangeSelfTest.java |  4 +-
 .../rebalancing/CacheNodeSafeAssertion.java        |  6 +--
 .../GridCacheRebalancingOrderingTest.java          | 32 +++++++--------
 ...dCacheRebalancingPartitionDistributionTest.java |  6 +--
 .../eviction/EvictionPolicyFailureHandlerTest.java | 10 ++---
 ...IgnitePdsCacheWalDisabledOnRebalancingTest.java | 12 +++---
 ...PdsPageReplacementDuringPartitionClearTest.java |  4 +-
 .../db/wal/WalRebalanceRestartTest.java            |  6 +--
 .../snapshot/AbstractSnapshotSelfTest.java         | 10 ++---
 .../query/GridCacheQueryTransformerSelfTest.java   |  4 +-
 .../AbstractTransactionIntergrityTest.java         |  6 +--
 .../TxOptimisticOnPartitionExchangeTest.java       |  4 +-
 .../query/h2/affinity/PartitionExtractor.java      | 12 +++---
 .../IgniteCacheConfigVariationsQueryTest.java      | 10 ++---
 ...niteCacheDistributedPartitionQuerySelfTest.java |  8 ++--
 .../query/IgniteSqlCreateTableTemplateTest.java    |  4 +-
 .../processors/query/RunningQueriesTest.java       | 10 ++---
 .../load/IgniteCacheRandomOperationBenchmark.java  | 10 ++---
 52 files changed, 235 insertions(+), 235 deletions(-)

diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/AffinityServiceImpl.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/AffinityServiceImpl.java
index 14719573b1d..cbe936dbff0 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/AffinityServiceImpl.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/AffinityServiceImpl.java
@@ -56,8 +56,8 @@ public class AffinityServiceImpl extends AbstractService implements AffinityServ
         if (cacheId == CU.UNDEFINED_CACHE_ID)
             return k -> k == null ? 0 : U.safeAbs(k.hashCode());
 
-        AffinityFunction affinity = cacheSharedContext.cacheContext(cacheId).group().affinityFunction();
+        AffinityFunction aff = cacheSharedContext.cacheContext(cacheId).group().affinityFunction();
 
-        return affinity::partition;
+        return aff::partition;
     }
 }
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/trait/DistributionFunction.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/trait/DistributionFunction.java
index 4191ef9083e..d5368e39d2b 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/trait/DistributionFunction.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/trait/DistributionFunction.java
@@ -261,10 +261,10 @@ public abstract class DistributionFunction {
                     assert F.isEmpty(assignment) || assignment.size() == 1;
             }
 
-            AffinityAdapter<Row> affinity = new AffinityAdapter<>(affSrvc.affinity(CU.UNDEFINED_CACHE_ID), k.toIntArray(),
+            AffinityAdapter<Row> aff = new AffinityAdapter<>(affSrvc.affinity(CU.UNDEFINED_CACHE_ID), k.toIntArray(),
                 ctx.rowHandler());
 
-            return new Partitioned<>(assignments, affinity);
+            return new Partitioned<>(assignments, aff);
         }
     }
 
@@ -312,9 +312,9 @@ public abstract class DistributionFunction {
                     assert F.isEmpty(assignment) || assignment.size() == 1;
             }
 
-            AffinityAdapter<Row> affinity = new AffinityAdapter<>(affSrvc.affinity(cacheId), k.toIntArray(), ctx.rowHandler());
+            AffinityAdapter<Row> aff = new AffinityAdapter<>(affSrvc.affinity(cacheId), k.toIntArray(), ctx.rowHandler());
 
-            return new Partitioned<>(assignments, affinity);
+            return new Partitioned<>(assignments, aff);
         }
 
         /** {@inheritDoc} */
diff --git a/modules/checkstyle/src/main/resources/abbrevations.csv b/modules/checkstyle/src/main/resources/abbrevations.csv
index 82840f6518b..8d62828d912 100644
--- a/modules/checkstyle/src/main/resources/abbrevations.csv
+++ b/modules/checkstyle/src/main/resources/abbrevations.csv
@@ -1,7 +1,7 @@
 # First word is wrong full term, other is correct abbrevations to build helpfull error message.
 address,addr
 addresses,addrs
-#affinity,aff
+affinity,aff
 #argument,arg
 array,arr
 #attribute,attr
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessReconnectionAndFailoverSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessReconnectionAndFailoverSelfTest.java
index e01e2909be3..d440561159e 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessReconnectionAndFailoverSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessReconnectionAndFailoverSelfTest.java
@@ -424,12 +424,12 @@ public class JdbcThinPartitionAwarenessReconnectionAndFailoverSelfTest extends J
             stmt.execute(sql);
             stmt.execute(sql);
 
-            AffinityCache affinityCache = GridTestUtils.getFieldValue(conn, "affinityCache");
+            AffinityCache affCache = GridTestUtils.getFieldValue(conn, "affinityCache");
 
-            Integer part = ((PartitionSingleNode)affinityCache.partitionResult(
+            Integer part = ((PartitionSingleNode)affCache.partitionResult(
                 new QualifiedSQLQuery("PUBLIC", sql)).partitionResult().tree()).value();
 
-            UUID nodeId = affinityCache.cacheDistribution(GridCacheUtils.cacheId(cacheName))[part];
+            UUID nodeId = affCache.cacheDistribution(GridCacheUtils.cacheId(cacheName))[part];
 
             int gridIdx = new Integer(Ignition.ignite(nodeId).name().substring(getTestIgniteInstanceName().length()));
             stopGrid(gridIdx);
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessSelfTest.java
index 7dfe06128e3..c2752fca632 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPartitionAwarenessSelfTest.java
@@ -368,15 +368,15 @@ public class JdbcThinPartitionAwarenessSelfTest extends JdbcThinAbstractSelfTest
 
         stmt.executeQuery(sqlQry);
 
-        AffinityCache affinityCache = GridTestUtils.getFieldValue(conn, "affinityCache");
+        AffinityCache affCache = GridTestUtils.getFieldValue(conn, "affinityCache");
 
         startGrid(3);
 
         stmt.executeQuery(sqlQry);
 
-        AffinityCache recreatedAffinityCache = GridTestUtils.getFieldValue(conn, "affinityCache");
+        AffinityCache recreatedAffCache = GridTestUtils.getFieldValue(conn, "affinityCache");
 
-        assertTrue(recreatedAffinityCache.version().compareTo(affinityCache.version()) > 0);
+        assertTrue(recreatedAffCache.version().compareTo(affCache.version()) > 0);
     }
 
     /**
@@ -392,15 +392,15 @@ public class JdbcThinPartitionAwarenessSelfTest extends JdbcThinAbstractSelfTest
         stmt.executeQuery(sqlQry);
         stmt.executeQuery(sqlQry);
 
-        AffinityCache affinityCache = GridTestUtils.getFieldValue(conn, "affinityCache");
+        AffinityCache affCache = GridTestUtils.getFieldValue(conn, "affinityCache");
 
         startGrid(4);
 
         stmt.executeQuery("select * from Person where _key = 2");
 
-        AffinityCache recreatedAffinityCache = GridTestUtils.getFieldValue(conn, "affinityCache");
+        AffinityCache recreatedAffCache = GridTestUtils.getFieldValue(conn, "affinityCache");
 
-        assertTrue(recreatedAffinityCache.version().compareTo(affinityCache.version()) > 0);
+        assertTrue(recreatedAffCache.version().compareTo(affCache.version()) > 0);
     }
 
     /**
@@ -415,15 +415,15 @@ public class JdbcThinPartitionAwarenessSelfTest extends JdbcThinAbstractSelfTest
 
         ResultSet rs = stmt.executeQuery(sqlQry);
 
-        AffinityCache affinityCache = GridTestUtils.getFieldValue(conn, "affinityCache");
+        AffinityCache affCache = GridTestUtils.getFieldValue(conn, "affinityCache");
 
         startGrid(5);
 
         rs.getMetaData();
 
-        AffinityCache recreatedAffinityCache = GridTestUtils.getFieldValue(conn, "affinityCache");
+        AffinityCache recreatedAffCache = GridTestUtils.getFieldValue(conn, "affinityCache");
 
-        assertTrue(recreatedAffinityCache.version().compareTo(affinityCache.version()) > 0);
+        assertTrue(recreatedAffCache.version().compareTo(affCache.version()) > 0);
     }
 
     /**
@@ -445,9 +445,9 @@ public class JdbcThinPartitionAwarenessSelfTest extends JdbcThinAbstractSelfTest
 
             stmt.executeQuery("select * from \"" + cacheName + "\".Person where _key = 1");
 
-            AffinityCache affinityCache = GridTestUtils.getFieldValue(conn, "affinityCache");
+            AffinityCache affCache = GridTestUtils.getFieldValue(conn, "affinityCache");
 
-            assertNull("Affinity cache is not null.", affinityCache);
+            assertNull("Affinity cache is not null.", affCache);
         }
     }
 
@@ -470,9 +470,9 @@ public class JdbcThinPartitionAwarenessSelfTest extends JdbcThinAbstractSelfTest
 
             stmt.executeQuery("select * from \"" + cacheName + "\".Person where _key = 1");
 
-            AffinityCache affinityCache = GridTestUtils.getFieldValue(conn, "affinityCache");
+            AffinityCache affCache = GridTestUtils.getFieldValue(conn, "affinityCache");
 
-            assertNull("Affinity cache is not null.", affinityCache);
+            assertNull("Affinity cache is not null.", affCache);
         }
     }
 
@@ -500,10 +500,10 @@ public class JdbcThinPartitionAwarenessSelfTest extends JdbcThinAbstractSelfTest
 
         stmt.execute("select * from \"" + cacheName.toUpperCase() + "\".Person where _key = 1");
 
-        AffinityCache affinityCache = GridTestUtils.getFieldValue(conn, "affinityCache");
+        AffinityCache affCache = GridTestUtils.getFieldValue(conn, "affinityCache");
 
         GridBoundedLinkedHashMap<QualifiedSQLQuery, JdbcThinPartitionResultDescriptor> sqlCache =
-            GridTestUtils.getFieldValue(affinityCache, "sqlCache");
+            GridTestUtils.getFieldValue(affCache, "sqlCache");
 
         Set<String> schemas = sqlCache.keySet().stream().map(QualifiedSQLQuery::schemaName).collect(Collectors.toSet());
 
@@ -534,13 +534,13 @@ public class JdbcThinPartitionAwarenessSelfTest extends JdbcThinAbstractSelfTest
         stmt.execute("select * from \"" + cacheName + "\".Person where _key = 2");
         stmt.execute("select * from \"" + cacheName + "\".Person where _key = 2");
 
-        AffinityCache affinityCache = GridTestUtils.getFieldValue(conn, "affinityCache");
+        AffinityCache affCache = GridTestUtils.getFieldValue(conn, "affinityCache");
 
         GridBoundedLinkedHashMap<QualifiedSQLQuery, JdbcThinPartitionResultDescriptor> sqlCache =
-            GridTestUtils.getFieldValue(affinityCache, "sqlCache");
+            GridTestUtils.getFieldValue(affCache, "sqlCache");
 
         GridBoundedLinkedHashMap<Integer, UUID[]> cachePartitionsDistribution =
-            GridTestUtils.getFieldValue(affinityCache, "cachePartitionsDistribution");
+            GridTestUtils.getFieldValue(affCache, "cachePartitionsDistribution");
 
         assertEquals("Sql sub-cache of affinity cache has unexpected number of elements.",
             2, sqlCache.size());
@@ -588,13 +588,13 @@ public class JdbcThinPartitionAwarenessSelfTest extends JdbcThinAbstractSelfTest
             stmt.executeQuery("select * from \"" + cacheName2 + "\".Person where _key = 1");
             stmt.executeQuery("select * from \"" + cacheName2 + "\".Person where _key = 1");
 
-            AffinityCache affinityCache = GridTestUtils.getFieldValue(conn, "affinityCache");
+            AffinityCache affCache = GridTestUtils.getFieldValue(conn, "affinityCache");
 
             GridBoundedLinkedHashMap<Integer, UUID[]> partitionsDistributionCache =
-                GridTestUtils.getFieldValue(affinityCache, "cachePartitionsDistribution");
+                GridTestUtils.getFieldValue(affCache, "cachePartitionsDistribution");
 
             GridBoundedLinkedHashMap<QualifiedSQLQuery, JdbcThinPartitionResultDescriptor> sqlCache =
-                GridTestUtils.getFieldValue(affinityCache, "sqlCache");
+                GridTestUtils.getFieldValue(affCache, "sqlCache");
 
             assertEquals("Unexpected count of partitions distributions.", 1,
                 partitionsDistributionCache.size());
@@ -650,9 +650,9 @@ public class JdbcThinPartitionAwarenessSelfTest extends JdbcThinAbstractSelfTest
 
         assertEquals("Rows counter doesn't match expected value.", expRowsCnt, rowCntr);
 
-        AffinityCache affinityCache = GridTestUtils.getFieldValue(conn, "affinityCache");
+        AffinityCache affCache = GridTestUtils.getFieldValue(conn, "affinityCache");
 
-        PartitionResult gotPartRes = affinityCache.partitionResult(
+        PartitionResult gotPartRes = affCache.partitionResult(
             new QualifiedSQLQuery("default", sqlQry)).partitionResult();
 
         assertNull("Partition result descriptor is not null.", gotPartRes);
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientAbstractProjection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientAbstractProjection.java
index 8ae8cce21b9..48c56b5448a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientAbstractProjection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientAbstractProjection.java
@@ -178,10 +178,10 @@ abstract class GridClientAbstractProjection<T extends GridClientAbstractProjecti
      */
     protected <R> GridClientFuture<R> withReconnectHandling(ClientProjectionClosure<R> c, String cacheName,
         @Nullable Object affKey) {
-        GridClientDataAffinity affinity = client.affinity(cacheName);
+        GridClientDataAffinity aff = client.affinity(cacheName);
 
         // If pinned (fixed-nodes) or no affinity provided use balancer.
-        if (nodes != null || affinity == null || affKey == null)
+        if (nodes != null || aff == null || affKey == null)
             return withReconnectHandling(c);
 
         try {
@@ -191,7 +191,7 @@ abstract class GridClientAbstractProjection<T extends GridClientAbstractProjecti
                 throw new GridServerUnreachableException("Failed to get affinity node (no nodes in topology were " +
                     "accepted by the filter): " + filter);
 
-            GridClientNode node = affinity.node(affKey, prjNodes);
+            GridClientNode node = aff.node(affKey, prjNodes);
 
             for (int i = 0; i < RETRY_CNT; i++) {
                 GridClientConnection conn = null;
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientDataImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientDataImpl.java
index 06572616635..a2eaa137766 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientDataImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientDataImpl.java
@@ -259,9 +259,9 @@ public class GridClientDataImpl extends GridClientAbstractProjection<GridClientD
     @Override public <K> UUID affinity(K key) throws GridClientException {
         A.notNull(key, "key");
 
-        GridClientDataAffinity affinity = client.affinity(cacheName);
+        GridClientDataAffinity aff = client.affinity(cacheName);
 
-        if (affinity == null)
+        if (aff == null)
             return null;
 
         Collection<? extends GridClientNode> prj = projectionNodes();
@@ -270,7 +270,7 @@ public class GridClientDataImpl extends GridClientAbstractProjection<GridClientD
             throw new GridClientException("Failed to get affinity node (projection node set for cache is empty): " +
                 cacheName());
 
-        GridClientNode node = affinity.node(key, prj);
+        GridClientNode node = aff.node(key, prj);
 
         assert node != null;
 
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientImpl.java
index 86676b3abdc..3421a850129 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientImpl.java
@@ -510,9 +510,9 @@ public class GridClientImpl implements GridClient, GridClientBeforeNodeStart {
             overallCaches.putAll(node.caches());
 
         for (Map.Entry<String, GridClientCacheMode> entry : overallCaches.entrySet()) {
-            GridClientDataAffinity affinity = affinity(entry.getKey());
+            GridClientDataAffinity aff = affinity(entry.getKey());
 
-            if (affinity instanceof GridClientPartitionAffinity && entry.getValue() !=
+            if (aff instanceof GridClientPartitionAffinity && entry.getValue() !=
                 GridClientCacheMode.PARTITIONED)
                 log.warning(GridClientPartitionAffinity.class.getSimpleName() + " is used for a cache configured " +
                     "for non-partitioned mode [cacheName=" + entry.getKey() + ", cacheMode=" + entry.getValue() + ']');
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java
index b0e47e0b594..69e2ba18b6c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientCacheAffinityMapping.java
@@ -84,17 +84,17 @@ public class ClientCacheAffinityMapping {
      * @return Affinity node id or {@code null} if affinity node can't be determined for given cache and key.
      */
     public UUID affinityNode(IgniteBinary binary, int cacheId, Object key) {
-        CacheAffinityInfo affinityInfo = cacheAffinity.get(cacheId);
+        CacheAffinityInfo affInfo = cacheAffinity.get(cacheId);
 
-        if (affinityInfo == null || affinityInfo == NOT_APPLICABLE_CACHE_AFFINITY_INFO)
+        if (affInfo == null || affInfo == NOT_APPLICABLE_CACHE_AFFINITY_INFO)
             return null;
 
         Object binaryKey = binary.toBinary(key);
 
-        if (!affinityInfo.keyCfg.isEmpty()) {
+        if (!affInfo.keyCfg.isEmpty()) {
             int typeId = binary.typeId(key.getClass().getName());
 
-            Integer fieldId = affinityInfo.keyCfg.get(typeId);
+            Integer fieldId = affInfo.keyCfg.get(typeId);
 
             if (fieldId != null) {
                 if (binaryKey instanceof BinaryObjectExImpl)
@@ -104,7 +104,7 @@ public class ClientCacheAffinityMapping {
             }
         }
 
-        return affinityInfo.nodeForKey(binaryKey);
+        return affInfo.nodeForKey(binaryKey);
     }
 
     /**
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientIgniteSetImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientIgniteSetImpl.java
index 2d451b477c1..71195d14f2b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientIgniteSetImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientIgniteSetImpl.java
@@ -140,9 +140,9 @@ class ClientIgniteSetImpl<T> implements ClientIgniteSet<T> {
         };
 
         if (colocated) {
-            Object affinityKey = name.hashCode();
+            Object affKey = name.hashCode();
 
-            return ch.affinityService(cacheId, affinityKey, ClientOperation.OP_SET_ITERATOR_START, payloadWriter, payloadReader);
+            return ch.affinityService(cacheId, affKey, ClientOperation.OP_SET_ITERATOR_START, payloadWriter, payloadReader);
         }
 
         return ch.service(ClientOperation.OP_SET_ITERATOR_START, payloadWriter, payloadReader);
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java
index 737cbebb80f..562c53a280f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java
@@ -1162,15 +1162,15 @@ public class JdbcThinConnection implements Connection {
 
         assert res.status() == ClientListenerResponse.STATUS_SUCCESS;
 
-        AffinityTopologyVersion resAffinityVer = res.affinityVersion();
+        AffinityTopologyVersion resAffVer = res.affinityVersion();
 
-        if (affinityCache.version().compareTo(resAffinityVer) < 0) {
+        if (affinityCache.version().compareTo(resAffVer) < 0) {
             affinityCache = new AffinityCache(
-                resAffinityVer,
+                resAffVer,
                 connProps.getPartitionAwarenessPartitionDistributionsCacheSize(),
                 connProps.getPartitionAwarenessSqlCacheSize());
         }
-        else if (affinityCache.version().compareTo(resAffinityVer) > 0) {
+        else if (affinityCache.version().compareTo(resAffVer) > 0) {
             // Jdbc thin affinity cache is binded to the newer affinity topology version, so we should ignore retrieved
             // partition distribution. Given situation might occur in case of concurrent race and is not
             // possible in single-threaded jdbc thin client, so it's a reserve for the future.
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/management/cache/CacheListCommand.java b/modules/core/src/main/java/org/apache/ignite/internal/management/cache/CacheListCommand.java
index 9b8f692b794..f76c4a258a6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/management/cache/CacheListCommand.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/management/cache/CacheListCommand.java
@@ -192,7 +192,7 @@ public class CacheListCommand implements LocalCommand<CacheListCommandArg, ViewC
     private static Map<String, Object> mapToPairs(CacheConfiguration cfg) {
         Map<String, Object> params = new LinkedHashMap<>();
 
-        CacheAffinityConfiguration affinityCfg = cfg.getAffinityConfiguration();
+        CacheAffinityConfiguration affCfg = cfg.getAffinityConfiguration();
         CacheNearConfiguration nearCfg = cfg.getNearConfiguration();
         CacheRebalanceConfiguration rebalanceCfg = cfg.getRebalanceConfiguration();
         CacheEvictionConfiguration evictCfg = cfg.getEvictionConfiguration();
@@ -225,11 +225,11 @@ public class CacheListCommand implements LocalCommand<CacheListCommandArg, ViewC
         params.put("Write Synchronization Mode", cfg.getWriteSynchronizationMode());
         params.put("Invalidate", cfg.isInvalidate());
 
-        params.put("Affinity Function", affinityCfg.getFunction());
-        params.put("Affinity Backups", affinityCfg.getPartitionedBackups());
-        params.put("Affinity Partitions", affinityCfg.getPartitions());
-        params.put("Affinity Exclude Neighbors", affinityCfg.isExcludeNeighbors());
-        params.put("Affinity Mapper", affinityCfg.getMapper());
+        params.put("Affinity Function", affCfg.getFunction());
+        params.put("Affinity Backups", affCfg.getPartitionedBackups());
+        params.put("Affinity Partitions", affCfg.getPartitions());
+        params.put("Affinity Exclude Neighbors", affCfg.isExcludeNeighbors());
+        params.put("Affinity Mapper", affCfg.getMapper());
 
         params.put("Rebalance Mode", rebalanceCfg.getMode());
         params.put("Rebalance Batch Size", rebalanceCfg.getBatchSize());
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index e5628392f2e..0806b7f4a75 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -367,9 +367,9 @@ public class GridAffinityAssignmentCache {
             boolean skipCalculation = true;
 
             for (DiscoveryEvent event : events.events()) {
-                boolean affinityNode = CU.affinityNode(event.eventNode(), nodeFilter);
+                boolean affNode = CU.affinityNode(event.eventNode(), nodeFilter);
 
-                if (affinityNode || event.type() == EVT_DISCOVERY_CUSTOM_EVT) {
+                if (affNode || event.type() == EVT_DISCOVERY_CUSTOM_EVT) {
                     skipCalculation = false;
 
                     break;
@@ -465,17 +465,17 @@ public class GridAffinityAssignmentCache {
         List<ClusterNode> sorted,
         BaselineTopology blt
     ) {
-        List<ClusterNode> baselineAffinityNodes = blt.createBaselineView(sorted, nodeFilter);
+        List<ClusterNode> baselineAffNodes = blt.createBaselineView(sorted, nodeFilter);
 
         List<List<ClusterNode>> calculated = aff.assignPartitions(new GridAffinityFunctionContextImpl(
-            baselineAffinityNodes,
+            baselineAffNodes,
             prevAssignment != null ? prevAssignment.assignment() : null,
             events != null ? events.lastEvent() : null,
             topVer,
             backups
         ));
 
-        baselineAssignment = IdealAffinityAssignment.create(topVer, baselineAffinityNodes, calculated);
+        baselineAssignment = IdealAffinityAssignment.create(topVer, baselineAffNodes, calculated);
     }
 
     /**
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/IdealAffinityAssignment.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/IdealAffinityAssignment.java
index 58fb3415cbd..80a2be229b5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/IdealAffinityAssignment.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/IdealAffinityAssignment.java
@@ -99,10 +99,10 @@ public class IdealAffinityAssignment {
         Map<Object, Set<Integer>> primaryPartitions = U.newHashMap(nodesSize);
 
         for (int size = assignment.size(), p = 0; p < size; p++) {
-            List<ClusterNode> affinityNodes = assignment.get(p);
+            List<ClusterNode> affNodes = assignment.get(p);
 
-            if (!affinityNodes.isEmpty()) {
-                ClusterNode primary = affinityNodes.get(0);
+            if (!affNodes.isEmpty()) {
+                ClusterNode primary = affNodes.get(0);
 
                 primaryPartitions.computeIfAbsent(primary.consistentId(),
                     id -> new HashSet<>(U.capacity(size / nodesSize * 2))).add(p);
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 ca76782b125..94e880b0755 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
@@ -1283,10 +1283,10 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
      * @param c Cache closure.
      */
     private void forAllRegisteredCacheGroups(IgniteInClosureX<CacheGroupDescriptor> c) {
-        Collection<CacheGroupDescriptor> affinityCaches = new ArrayList<>(cachesRegistry.allGroups().values());
+        Collection<CacheGroupDescriptor> affCaches = new ArrayList<>(cachesRegistry.allGroups().values());
 
         try {
-            U.doInParallel(cctx.kernalContext().pools().getSystemExecutorService(), affinityCaches, t -> {
+            U.doInParallel(cctx.kernalContext().pools().getSystemExecutorService(), affCaches, t -> {
                 c.applyx(t);
 
                 return null;
@@ -1301,12 +1301,12 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
      * @param c Closure.
      */
     private void forAllCacheGroups(IgniteInClosureX<GridAffinityAssignmentCache> c) {
-        Collection<GridAffinityAssignmentCache> affinityCaches = grpHolders.values().stream()
+        Collection<GridAffinityAssignmentCache> affCaches = grpHolders.values().stream()
             .map(CacheGroupHolder::affinity)
             .collect(Collectors.toList());
 
         try {
-            U.doInParallel(cctx.kernalContext().pools().getSystemExecutorService(), affinityCaches, t -> {
+            U.doInParallel(cctx.kernalContext().pools().getSystemExecutorService(), affCaches, t -> {
                 c.applyx(t);
 
                 return null;
@@ -1517,7 +1517,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
 
         // Such cache group may exist if cache is already destroyed on server nodes
         // and coordinator have no affinity for that group.
-        final Set<Integer> noAffinityGroups = new GridConcurrentHashSet<>();
+        final Set<Integer> noAffGroups = new GridConcurrentHashSet<>();
 
         forAllRegisteredCacheGroups(new IgniteInClosureX<CacheGroupDescriptor>() {
             @Override public void applyx(CacheGroupDescriptor desc) throws IgniteCheckedException {
@@ -1535,7 +1535,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
                     CacheGroupAffinityMessage affMsg = receivedAff.get(aff.groupId());
 
                     if (affMsg == null) {
-                        noAffinityGroups.add(aff.groupId());
+                        noAffGroups.add(aff.groupId());
 
                         // Use ideal affinity to resume cache initialize process.
                         calculateAndInit(evts, aff, evts.topologyVersion());
@@ -1573,7 +1573,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
             }
         });
 
-        return noAffinityGroups;
+        return noAffGroups;
     }
 
     /**
@@ -1988,7 +1988,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
                         assert idx >= 0 && idx < exchFuts.size() - 1 : "Invalid exchange futures state [cur=" + idx +
                             ", total=" + exchFuts.size() + ']';
 
-                        GridDhtPartitionsExchangeFuture futureToFetchAffinity = null;
+                        GridDhtPartitionsExchangeFuture futureToFetchAff = null;
 
                         for (int i = idx + 1; i < exchFuts.size(); i++) {
                             GridDhtPartitionsExchangeFuture prev = exchFuts.get(i);
@@ -1998,32 +1998,32 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
                             if (prev.isMerged())
                                 continue;
 
-                            futureToFetchAffinity = prev;
+                            futureToFetchAff = prev;
 
                             break;
                         }
 
-                        if (futureToFetchAffinity == null)
+                        if (futureToFetchAff == null)
                             throw new IgniteCheckedException("Failed to find completed exchange future to fetch affinity.");
 
                         if (log.isDebugEnabled()) {
                             log.debug("Need initialize affinity on coordinator [" +
                                 "cacheGrp=" + desc.cacheOrGroupName() +
-                                "prevAff=" + futureToFetchAffinity.topologyVersion() + ']');
+                                "prevAff=" + futureToFetchAff.topologyVersion() + ']');
                         }
 
                         GridDhtAssignmentFetchFuture fetchFut = new GridDhtAssignmentFetchFuture(
                             cctx,
                             desc.groupId(),
-                            futureToFetchAffinity.topologyVersion(),
-                            futureToFetchAffinity.events().discoveryCache()
+                            futureToFetchAff.topologyVersion(),
+                            futureToFetchAff.events().discoveryCache()
                         );
 
                         fetchFut.init(false);
 
                         final GridFutureAdapter<AffinityTopologyVersion> affFut = new GridFutureAdapter<>();
 
-                        final GridDhtPartitionsExchangeFuture futureToFetchAffinity0 = futureToFetchAffinity;
+                        final GridDhtPartitionsExchangeFuture futureToFetchAffinity0 = futureToFetchAff;
 
                         fetchFut.listen(new IgniteInClosureX<IgniteInternalFuture<GridDhtAffinityAssignmentResponse>>() {
                             @Override public void applyx(IgniteInternalFuture<GridDhtAffinityAssignmentResponse> fetchFut)
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index ce42781f796..2187b5caae3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -5492,9 +5492,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             DetachedClusterNode clusterNode = new DetachedClusterNode(consistentId, ctx.nodeAttributes());
 
             for (DynamicCacheDescriptor cacheDescriptor : persistentCaches()) {
-                boolean affinityNode = CU.affinityNode(clusterNode, cacheDescriptor.cacheConfiguration().getNodeFilter());
+                boolean affNode = CU.affinityNode(clusterNode, cacheDescriptor.cacheConfiguration().getNodeFilter());
 
-                if (!affinityNode)
+                if (!affNode)
                     continue;
 
                 startCacheInRecoveryMode(cacheDescriptor);
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index 8878d158e79..7f988d36cab 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -1637,27 +1637,27 @@ public class GridCacheUtils {
         IgniteLogger log,
         boolean fail
     ) throws IgniteCheckedException {
-        Map<String, String> rmtAffinityKeys = CU.validateKeyConfigiration(groupName, cacheName, rmtCacheKeyCfgs, log, fail);
+        Map<String, String> rmtAffKeys = CU.validateKeyConfigiration(groupName, cacheName, rmtCacheKeyCfgs, log, fail);
 
-        Map<String, String> locAffinityKey = CU.validateKeyConfigiration(groupName, cacheName, locCacheKeyCfgs, log, fail);
+        Map<String, String> locAffKey = CU.validateKeyConfigiration(groupName, cacheName, locCacheKeyCfgs, log, fail);
 
-        if (rmtAffinityKeys.size() != locAffinityKey.size()) {
+        if (rmtAffKeys.size() != locAffKey.size()) {
             throwIgniteCheckedException(log, fail, "Affinity key configuration mismatch" +
                 "[" +
                 (groupName != null ? "cacheGroup=" + groupName + ", " : "") +
                 "cacheName=" + cacheName + ", " +
-                "remote keyConfiguration.length=" + rmtAffinityKeys.size() + ", " +
-                "local keyConfiguration.length=" + locAffinityKey.size() +
+                "remote keyConfiguration.length=" + rmtAffKeys.size() + ", " +
+                "local keyConfiguration.length=" + locAffKey.size() +
                 (rmtNodeId != null ? ", rmtNodeId=" + rmtNodeId : "") +
                 ']');
         }
 
-        for (Map.Entry<String, String> rmtAffinityKey : rmtAffinityKeys.entrySet()) {
-            String rmtTypeName = rmtAffinityKey.getKey();
+        for (Map.Entry<String, String> rmtAffKey : rmtAffKeys.entrySet()) {
+            String rmtTypeName = rmtAffKey.getKey();
 
-            String rmtFieldName = rmtAffinityKey.getValue();
+            String rmtFieldName = rmtAffKey.getValue();
 
-            String locFieldName = locAffinityKey.get(rmtTypeName);
+            String locFieldName = locAffKey.get(rmtTypeName);
 
             if (!rmtFieldName.equals(locFieldName)) {
                 throwIgniteCheckedException(log, fail, "Affinity key configuration mismatch [" +
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 81687c24150..b6f2c727d44 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -2225,7 +2225,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
         }
 
         // Find any single message with affinity request. This request exists only for newly joined nodes.
-        Optional<GridDhtPartitionsSingleMessage> singleMsgWithAffinityReq = nodes.stream()
+        Optional<GridDhtPartitionsSingleMessage> singleMsgWithAffReq = nodes.stream()
             .flatMap(node -> Optional.ofNullable(msgs.get(node.id()))
                 .filter(singleMsg -> singleMsg.cacheGroupsAffinityRequest() != null)
                 .map(Stream::of)
@@ -2233,7 +2233,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
             .findAny();
 
         // Prepare full message for newly joined nodes with affinity request.
-        final GridDhtPartitionsFullMessage fullMsgWithAffinity = singleMsgWithAffinityReq
+        final GridDhtPartitionsFullMessage fullMsgWithAff = singleMsgWithAffReq
             .filter(singleMessage -> affinityForJoinedNodes != null)
             .map(singleMessage -> fullMsg.copy().joinedNodeAffinity(affinityForJoinedNodes))
             .orElse(null);
@@ -2242,7 +2242,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
         nodes.stream()
             .map(node -> {
                 // No joined nodes, just send a regular full message.
-                if (fullMsgWithAffinity == null)
+                if (fullMsgWithAff == null)
                     return new T2<>(node, fullMsg);
 
                 return new T2<>(
@@ -2250,7 +2250,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
                     // If single message contains affinity request, use special full message for such single messages.
                     Optional.ofNullable(msgs.get(node.id()))
                         .filter(singleMsg -> singleMsg.cacheGroupsAffinityRequest() != null)
-                        .map(singleMsg -> fullMsgWithAffinity)
+                        .map(singleMsg -> fullMsgWithAff)
                         .orElse(fullMsg)
                 );
             })
@@ -4676,11 +4676,11 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
                 exchCtx.events().processEvents(this);
 
                 if (localJoinExchange()) {
-                    Set<Integer> noAffinityGroups = cctx.affinity().onLocalJoin(this, msg.joinedNodeAffinity(), resTopVer);
+                    Set<Integer> noAffGroups = cctx.affinity().onLocalJoin(this, msg.joinedNodeAffinity(), resTopVer);
 
                     // Prevent cache usage by a user.
-                    if (!noAffinityGroups.isEmpty()) {
-                        List<GridCacheAdapter> closedCaches = cctx.cache().blockGateways(noAffinityGroups);
+                    if (!noAffGroups.isEmpty()) {
+                        List<GridCacheAdapter> closedCaches = cctx.cache().blockGateways(noAffGroups);
 
                         closedCaches.forEach(cache -> log.warning("Affinity for cache " + cache.context().name()
                             + " has not received from coordinator during local join. "
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcResponse.java
index 01347de710b..4a941a6ffd2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcResponse.java
@@ -159,9 +159,9 @@ public class JdbcResponse extends ClientListenerResponse implements JdbcRawBinar
         if (protoCtx.isAffinityAwarenessSupported()) {
             activeTx = reader.readBoolean();
 
-            boolean affinityVerChanged = reader.readBoolean();
+            boolean affVerChanged = reader.readBoolean();
 
-            if (affinityVerChanged) {
+            if (affVerChanged) {
                 long topVer = reader.readLong();
                 int minorTopVer = reader.readInt();
 
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientAffinityTopologyVersion.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientAffinityTopologyVersion.java
index 446238bc875..4c1587082d2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientAffinityTopologyVersion.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientAffinityTopologyVersion.java
@@ -61,10 +61,10 @@ public class ClientAffinityTopologyVersion {
      * @param writer Writer.
      */
     public void write(BinaryRawWriter writer) {
-        AffinityTopologyVersion affinityVer0 = version;
+        AffinityTopologyVersion affVer0 = version;
 
-        writer.writeLong(affinityVer0.topologyVersion());
-        writer.writeInt(affinityVer0.minorTopologyVersion());
+        writer.writeLong(affVer0.topologyVersion());
+        writer.writeInt(affVer0.minorTopologyVersion());
     }
 
     /** {@inheritDoc} */
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCachePartitionAwarenessGroup.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCachePartitionAwarenessGroup.java
index a5bc57c8c26..6ce5e43e037 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCachePartitionAwarenessGroup.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCachePartitionAwarenessGroup.java
@@ -110,10 +110,10 @@ class ClientCachePartitionAwarenessGroup {
 
         for (CacheKeyConfiguration keyCfg : keyCfgs) {
             int keyTypeId = binProc.typeId(keyCfg.getTypeName());
-            int affinityKeyFieldId = binProc.binaryContext().fieldId(keyTypeId, keyCfg.getAffinityKeyFieldName());
+            int affKeyFieldId = binProc.binaryContext().fieldId(keyTypeId, keyCfg.getAffinityKeyFieldName());
 
             writer.writeInt(keyTypeId);
-            writer.writeInt(affinityKeyFieldId);
+            writer.writeInt(affKeyFieldId);
         }
     }
 
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCachePartitionsRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCachePartitionsRequest.java
index 44c8dfe265b..228c0f32361 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCachePartitionsRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCachePartitionsRequest.java
@@ -85,7 +85,7 @@ public class ClientCachePartitionsRequest extends ClientRequest {
             return new ClientResponse(requestId(), "Cannot perform cache operation because the cluster is inactive.");
 
         Map<ClientCachePartitionAwarenessGroup, ClientCachePartitionAwarenessGroup> grps = new HashMap<>(cacheIds.length);
-        ClientAffinityTopologyVersion affinityVer = ctx.checkAffinityTopologyVersion();
+        ClientAffinityTopologyVersion affVer = ctx.checkAffinityTopologyVersion();
 
         Set<Integer> affectedGroupIds = Arrays.stream(cacheIds)
             .mapToObj(id -> ctx.kernalContext().cache().cacheDescriptor(id))
@@ -102,7 +102,7 @@ public class ClientCachePartitionsRequest extends ClientRequest {
         // As a first step, get a set of mappings that we need to return.
         // To do that, check if any of the caches listed in request can be grouped.
         for (List<DynamicCacheDescriptor> affected : F.view(allCaches, affectedGroupIds::contains).values()) {
-            ClientCachePartitionAwarenessGroup grp = processCache(ctx, affinityVer, F.first(affected), withCustomMappings);
+            ClientCachePartitionAwarenessGroup grp = processCache(ctx, affVer, F.first(affected), withCustomMappings);
 
             if (grp == null)
                 continue;
@@ -114,7 +114,7 @@ public class ClientCachePartitionsRequest extends ClientRequest {
 
         // As a second step, check all other caches and add them to groups they are compatible with.
         for (List<DynamicCacheDescriptor> descs : F.view(allCaches, new NotContainsPredicate<>(affectedGroupIds)).values()) {
-            ClientCachePartitionAwarenessGroup grp = processCache(ctx, affinityVer, F.first(descs), withCustomMappings);
+            ClientCachePartitionAwarenessGroup grp = processCache(ctx, affVer, F.first(descs), withCustomMappings);
 
             if (grp == null)
                 continue;
@@ -125,7 +125,7 @@ public class ClientCachePartitionsRequest extends ClientRequest {
                 grp0.addAll(descs);
         }
 
-        return new ClientCachePartitionsResponse(requestId(), new ArrayList<>(grps.keySet()), affinityVer);
+        return new ClientCachePartitionsResponse(requestId(), new ArrayList<>(grps.keySet()), affVer);
     }
 
     /**
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java b/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
index aacb1f79024..fde954d4515 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionSimpleBenchmark.java
@@ -549,9 +549,9 @@ public class RendezvousAffinityFunctionSimpleBenchmark extends GridCommonAbstrac
                 affPrev = affCur;
             }
 
-            double goldenChangeAffinity = (double)aff1.partitions() / nodesCnt * (backups + 1);
+            double goldenChangeAff = (double)aff1.partitions() / nodesCnt * (backups + 1);
             info(String.format("Test %d nodes. Golden: %.1f; %s: %.1f; %s: %.1f;",
-                nodesCnt, goldenChangeAffinity,
+                nodesCnt, goldenChangeAff,
                 aff0.getClass().getSimpleName(),
                 (double)diffCnt0 / (MAX_EXPERIMENTS - 1),
                 aff1.getClass().getSimpleName(),
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridAffinityNoCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridAffinityNoCacheSelfTest.java
index bd3ff5e04c2..76db1624f76 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridAffinityNoCacheSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridAffinityNoCacheSelfTest.java
@@ -72,13 +72,13 @@ public class GridAffinityNoCacheSelfTest extends GridCommonAbstractTest {
     private void checkAffinityProxyNoCache(Object key) {
         IgniteEx ignite = grid(0);
 
-        final Affinity<Object> affinity = ignite.affinity("noCache");
+        final Affinity<Object> aff = ignite.affinity("noCache");
 
-        assertFalse("Affinity proxy instance expected", affinity instanceof GridCacheAffinityImpl);
+        assertFalse("Affinity proxy instance expected", aff instanceof GridCacheAffinityImpl);
 
         final ClusterNode n = ignite.cluster().localNode();
 
-        assertAffinityMethodsException(affinity, key, n);
+        assertAffinityMethodsException(aff, key, n);
     }
 
     /**
@@ -109,9 +109,9 @@ public class GridAffinityNoCacheSelfTest extends GridCommonAbstractTest {
 
         awaitPartitionMapExchange();
 
-        Affinity<Object> affinity = grid.affinity(cacheName);
+        Affinity<Object> aff = grid.affinity(cacheName);
 
-        assertTrue(affinity instanceof GridCacheAffinityImpl);
+        assertTrue(aff instanceof GridCacheAffinityImpl);
 
         final ClusterNode n = grid.cluster().localNode();
 
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentV2Test.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentV2Test.java
index 438dc472f1b..5d8e966851c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentV2Test.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentV2Test.java
@@ -89,7 +89,7 @@ public class GridAffinityAssignmentV2Test {
      */
     @Test
     public void testPrimaryBackupPartitions() {
-        GridAffinityAssignment gridAffinityAssignment = new GridAffinityAssignment(
+        GridAffinityAssignment gridAffAssignment = new GridAffinityAssignment(
             new AffinityTopologyVersion(1, 0),
             Arrays.asList(
                 Arrays.asList(clusterNode1, clusterNode2, clusterNode3, clusterNode4),
@@ -99,7 +99,7 @@ public class GridAffinityAssignmentV2Test {
             new ArrayList<>()
         );
 
-        GridAffinityAssignmentV2 gridAffinityAssignment2 = new GridAffinityAssignmentV2(
+        GridAffinityAssignmentV2 gridAffAssignment2 = new GridAffinityAssignmentV2(
             new AffinityTopologyVersion(1, 0),
             Arrays.asList(
                 Arrays.asList(clusterNode1, clusterNode2, clusterNode3, clusterNode4),
@@ -109,17 +109,17 @@ public class GridAffinityAssignmentV2Test {
             new ArrayList<>()
         );
 
-        assertPartitions(gridAffinityAssignment);
+        assertPartitions(gridAffAssignment);
 
-        assertPartitions(gridAffinityAssignment2);
+        assertPartitions(gridAffAssignment2);
 
         if (AffinityAssignment.IGNITE_DISABLE_AFFINITY_MEMORY_OPTIMIZATION)
-            assertSame(gridAffinityAssignment2.getIds(0), gridAffinityAssignment2.getIds(0));
+            assertSame(gridAffAssignment2.getIds(0), gridAffAssignment2.getIds(0));
         else
-            assertNotSame(gridAffinityAssignment2.getIds(0), gridAffinityAssignment2.getIds(0));
+            assertNotSame(gridAffAssignment2.getIds(0), gridAffAssignment2.getIds(0));
 
         try {
-            gridAffinityAssignment2.primaryPartitions(clusterNode1.id()).add(1000);
+            gridAffAssignment2.primaryPartitions(clusterNode1.id()).add(1000);
 
             fail("Unmodifiable exception expected");
         }
@@ -128,7 +128,7 @@ public class GridAffinityAssignmentV2Test {
         }
 
         try {
-            gridAffinityAssignment2.backupPartitions(clusterNode1.id()).add(1000);
+            gridAffAssignment2.backupPartitions(clusterNode1.id()).add(1000);
 
             fail("Unmodifiable exception expected");
         }
@@ -137,7 +137,7 @@ public class GridAffinityAssignmentV2Test {
         }
 
         Set<Integer> unwrapped = U.field(
-            gridAffinityAssignment2.primaryPartitions(clusterNode1.id()),
+            gridAffAssignment2.primaryPartitions(clusterNode1.id()),
             "delegate"
         );
 
@@ -188,13 +188,13 @@ public class GridAffinityAssignmentV2Test {
         for (int i = 0; i < 10; i++)
             nodes.add(node(metrics, ver, "1" + i));
 
-        GridAffinityAssignment gridAffinityAssignment = new GridAffinityAssignment(
+        GridAffinityAssignment gridAffAssignment = new GridAffinityAssignment(
             new AffinityTopologyVersion(1, 0),
             Collections.singletonList(nodes),
             new ArrayList<>()
         );
 
-        assertSame(gridAffinityAssignment.getIds(0), gridAffinityAssignment.getIds(0));
+        assertSame(gridAffAssignment.getIds(0), gridAffAssignment.getIds(0));
     }
 
     /**
@@ -208,7 +208,7 @@ public class GridAffinityAssignmentV2Test {
         for (int i = 0; i < 10; i++)
             nodes.add(node(metrics, ver, "1" + i));
 
-        GridAffinityAssignmentV2 gridAffinityAssignment2 = new GridAffinityAssignmentV2(
+        GridAffinityAssignmentV2 gridAffAssignment2 = new GridAffinityAssignmentV2(
             new AffinityTopologyVersion(1, 0),
             Collections.singletonList(nodes),
             new ArrayList<>()
@@ -218,13 +218,13 @@ public class GridAffinityAssignmentV2Test {
 
         ObjectOutputStream outputStream = new ObjectOutputStream(byteArrOutputStream);
 
-        outputStream.writeObject(gridAffinityAssignment2);
+        outputStream.writeObject(gridAffAssignment2);
 
         ObjectInputStream inputStream = new ObjectInputStream(new ByteArrayInputStream(byteArrOutputStream.toByteArray()));
 
         GridAffinityAssignmentV2 deserialized = (GridAffinityAssignmentV2)inputStream.readObject();
 
-        assertEquals(deserialized.topologyVersion(), gridAffinityAssignment2.topologyVersion());
+        assertEquals(deserialized.topologyVersion(), gridAffAssignment2.topologyVersion());
     }
 
     /**
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 6a846dfbfef..95177ac4d7d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -6584,12 +6584,12 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         @Override public List<String> call(Ignite ignite, IgniteCache<String, Integer> cache) throws Exception {
             List<String> found = new ArrayList<>();
 
-            Affinity<Object> affinity = ignite.affinity(cache.getName());
+            Affinity<Object> aff = ignite.affinity(cache.getName());
 
             for (int i = startFrom; i < startFrom + 100_000; i++) {
                 String key = "key" + i;
 
-                if (affinity.isPrimary(ignite.cluster().localNode(), key)) {
+                if (aff.isPrimary(ignite.cluster().localNode(), key)) {
                     found.add(key);
 
                     if (found.size() == cnt)
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java
index b6598a77f94..7a8b0c83a62 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java
@@ -121,9 +121,9 @@ public class GridCacheAtomicMessageCountSelfTest extends GridCommonAbstractTest
             for (int i = 0; i < putCnt; i++) {
                 ClusterNode locNode = grid(0).localNode();
 
-                Affinity<Object> affinity = ignite(0).affinity(DEFAULT_CACHE_NAME);
+                Affinity<Object> aff = ignite(0).affinity(DEFAULT_CACHE_NAME);
 
-                if (affinity.isPrimary(locNode, i))
+                if (aff.isPrimary(locNode, i))
                     expDhtCnt++;
                 else
                     expNearSingleCnt++;
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLifecycleAwareSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLifecycleAwareSelfTest.java
index 74d2da18abc..be6510c0086 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLifecycleAwareSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLifecycleAwareSelfTest.java
@@ -290,11 +290,11 @@ public class GridCacheLifecycleAwareSelfTest extends GridAbstractLifecycleAwareS
 
         lifecycleAwares.add(store.lifecycleAware);
 
-        TestAffinityFunction affinity = new TestAffinityFunction();
+        TestAffinityFunction aff = new TestAffinityFunction();
 
-        ccfg.setAffinity(affinity);
+        ccfg.setAffinity(aff);
 
-        lifecycleAwares.add(affinity);
+        lifecycleAwares.add(aff);
 
         TestEvictionFilter evictionFilter = new TestEvictionFilter();
 
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigVariationsFullApiTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigVariationsFullApiTest.java
index fcca87b2b31..d0f01d0fe01 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigVariationsFullApiTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigVariationsFullApiTest.java
@@ -6450,12 +6450,12 @@ public class IgniteCacheConfigVariationsFullApiTest extends IgniteCacheConfigVar
         @Override public List<String> call(Ignite ignite, IgniteCache<String, Integer> cache) throws Exception {
             List<String> found = new ArrayList<>();
 
-            Affinity<Object> affinity = ignite.affinity(cache.getName());
+            Affinity<Object> aff = ignite.affinity(cache.getName());
 
             for (int i = startFrom; i < startFrom + 100_000; i++) {
                 String key = "key" + i;
 
-                if (affinity.isPrimary(ignite.cluster().localNode(), key)) {
+                if (aff.isPrimary(ignite.cluster().localNode(), key)) {
                     found.add(key);
 
                     if (found.size() == cnt)
@@ -6533,12 +6533,12 @@ public class IgniteCacheConfigVariationsFullApiTest extends IgniteCacheConfigVar
         @Override public List<Object> call(Ignite ignite, IgniteCache<Object, Object> cache) throws Exception {
             List<Object> found = new ArrayList<>();
 
-            Affinity<Object> affinity = ignite.affinity(cache.getName());
+            Affinity<Object> aff = ignite.affinity(cache.getName());
 
             for (int i = startFrom; i < startFrom + 100_000; i++) {
                 Object key = key(i, mode);
 
-                if (affinity.isPrimary(ignite.cluster().localNode(), key)) {
+                if (aff.isPrimary(ignite.cluster().localNode(), key)) {
                     found.add(key);
 
                     if (found.size() == cnt)
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInvokeAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInvokeAbstractTest.java
index 29bba069082..dd3affa32ea 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInvokeAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInvokeAbstractTest.java
@@ -316,10 +316,10 @@ public abstract class IgniteCacheInvokeAbstractTest extends IgniteCacheAbstractT
     public void testInvokeAllAppliedOnceOnBinaryTypeRegistration() {
         IgniteCache<MyKey, Integer> cache = jcache();
 
-        Affinity<Object> affinity = grid(0).affinity(cache.getName());
+        Affinity<Object> aff = grid(0).affinity(cache.getName());
 
         for (int i = 0; i < gridCount(); i++) {
-            if (!affinity.isPrimary(grid(i).localNode(), new MyKey(""))) {
+            if (!aff.isPrimary(grid(i).localNode(), new MyKey(""))) {
                 cache = jcache(i);
                 break;
             }
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
index e57aeb3e502..113f3516c27 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
@@ -729,15 +729,15 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
         //First count entries...
         int cnt = (int)offheapManager.cacheEntriesCount(ctx.cacheId(), part);
 
-        GridCacheAffinityManager affinity = ctx.affinity();
-        AffinityTopologyVersion topVer = affinity.affinityTopologyVersion();
+        GridCacheAffinityManager aff = ctx.affinity();
+        AffinityTopologyVersion topVer = aff.affinityTopologyVersion();
 
         //And then find out whether they are primary or backup ones.
         int primaryCnt = 0;
         int backupCnt = 0;
-        if (affinity.primaryByPartition(ctx.localNode(), part, topVer))
+        if (aff.primaryByPartition(ctx.localNode(), part, topVer))
             primaryCnt = cnt;
-        else if (affinity.backupByPartition(ctx.localNode(), part, topVer))
+        else if (aff.backupByPartition(ctx.localNode(), part, topVer))
             backupCnt = cnt;
         return new T2<>(primaryCnt, backupCnt);
     }
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
index 14cbf57788f..762eca37c0e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
@@ -217,7 +217,7 @@ public abstract class GridCacheClientModesAbstractSelfTest extends GridCacheAbst
             }
             else {
                 boolean foundEntry = false;
-                boolean foundAffinityNode = false;
+                boolean foundAffNode = false;
 
                 for (int k = 0; k < 10000; k++) {
                     String key = "key" + k;
@@ -226,11 +226,11 @@ public abstract class GridCacheClientModesAbstractSelfTest extends GridCacheAbst
                         foundEntry = true;
 
                     if (g.affinity(DEFAULT_CACHE_NAME).mapKeyToPrimaryAndBackups(key).contains(g.cluster().localNode()))
-                        foundAffinityNode = true;
+                        foundAffNode = true;
                 }
 
                 assertTrue("Did not found primary or backup entry for grid: " + i, foundEntry);
-                assertTrue("Did not found affinity node for grid: " + i, foundAffinityNode);
+                assertTrue("Did not found affinity node for grid: " + i, foundAffNode);
             }
         }
     }
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientReconnectTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientReconnectTest.java
index 997594a996d..67e6d566a98 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientReconnectTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientReconnectTest.java
@@ -207,10 +207,10 @@ public class IgniteCacheClientReconnectTest extends GridCommonAbstractTest {
         for (int i = 0; i < CACHES; i++) {
             cacheName = "cache-" + i;
 
-            Affinity<Object> refAffinity = refSrv.affinity(cacheName);
+            Affinity<Object> refAff = refSrv.affinity(cacheName);
 
             for (int j = 0; j < PARTITIONS_CNT; j++) {
-                ClusterNode refAffNode = refAffinity.mapPartitionToNode(j);
+                ClusterNode refAffNode = refAff.mapPartitionToNode(j);
 
                 assertNotNull("Affinity node for " + j + " partition is null", refAffNode);
 
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
index 7a2e092ef48..0e19dacd9d6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
@@ -313,18 +313,18 @@ public abstract class GridCacheAbstractTransformWriteThroughSelfTest extends Gri
         while (keys.size() < 30) {
             String key = String.valueOf(numKey);
 
-            Affinity<Object> affinity = ignite(0).affinity(DEFAULT_CACHE_NAME);
+            Affinity<Object> aff = ignite(0).affinity(DEFAULT_CACHE_NAME);
 
             if (nodeType == NEAR_NODE) {
-                if (!affinity.isPrimaryOrBackup(grid(0).localNode(), key))
+                if (!aff.isPrimaryOrBackup(grid(0).localNode(), key))
                     keys.add(key);
             }
             else if (nodeType == PRIMARY_NODE) {
-                if (affinity.isPrimary(grid(0).localNode(), key))
+                if (aff.isPrimary(grid(0).localNode(), key))
                     keys.add(key);
             }
             else if (nodeType == BACKUP_NODE) {
-                if (affinity.isBackup(grid(0).localNode(), key))
+                if (aff.isBackup(grid(0).localNode(), key))
                     keys.add(key);
             }
 
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedTopologyChangeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedTopologyChangeSelfTest.java
index 7f0b5d5c02f..5315c29ed38 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedTopologyChangeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedTopologyChangeSelfTest.java
@@ -510,9 +510,9 @@ public class GridCachePartitionedTopologyChangeSelfTest extends GridCommonAbstra
                 txFut.get(1000);
 
             for (int i = 0; i < 3; i++) {
-                Affinity affinity = grid(i).affinity(DEFAULT_CACHE_NAME);
+                Affinity aff = grid(i).affinity(DEFAULT_CACHE_NAME);
 
-                ConcurrentMap addedNodes = U.field(affinity, "addedNodes");
+                ConcurrentMap addedNodes = U.field(aff, "addedNodes");
 
                 assertFalse(addedNodes.containsKey(leftNodeId));
             }
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/CacheNodeSafeAssertion.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/CacheNodeSafeAssertion.java
index bf6b63fa763..8ac8b41dade 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/CacheNodeSafeAssertion.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/CacheNodeSafeAssertion.java
@@ -57,9 +57,9 @@ public class CacheNodeSafeAssertion implements Assertion {
 
     /** {@inheritDoc} */
     @Override public void test() throws AssertionError {
-        Affinity<?> affinity = ignite.affinity(cacheName);
+        Affinity<?> aff = ignite.affinity(cacheName);
 
-        int partCnt = affinity.partitions();
+        int partCnt = aff.partitions();
 
         boolean hostSafe = true;
 
@@ -68,7 +68,7 @@ public class CacheNodeSafeAssertion implements Assertion {
         for (int x = 0; x < partCnt; ++x) {
             // Results are returned with the primary node first and backups after. We want to ensure that there is at
             // least one backup on a different host.
-            Collection<ClusterNode> results = affinity.mapPartitionToPrimaryAndBackups(x);
+            Collection<ClusterNode> results = aff.mapPartitionToPrimaryAndBackups(x);
 
             Iterator<ClusterNode> nodes = results.iterator();
 
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingOrderingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingOrderingTest.java
index 3fbb796989f..e80b562aa6c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingOrderingTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingOrderingTest.java
@@ -213,9 +213,9 @@ public class GridCacheRebalancingOrderingTest extends GridCommonAbstractTest {
      * @return Map of partition number to randomly generated key.
      */
     private Map<Integer, IntegerKey> generateKeysForPartitions(Ignite ignite, IgniteCache<IntegerKey, Integer> cache) {
-        Affinity<IntegerKey> affinity = ignite.affinity(cache.getName());
+        Affinity<IntegerKey> aff = ignite.affinity(cache.getName());
 
-        int parts = affinity.partitions();
+        int parts = aff.partitions();
 
         Map<Integer, IntegerKey> keyMap = new HashMap<>(parts);
 
@@ -225,7 +225,7 @@ public class GridCacheRebalancingOrderingTest extends GridCommonAbstractTest {
             do {
                 IntegerKey key = new IntegerKey(RANDOM.nextInt(10000));
 
-                if (affinity.partition(key) == i) {
+                if (aff.partition(key) == i) {
                     keyMap.put(i, key);
                     found = true;
                 }
@@ -233,13 +233,13 @@ public class GridCacheRebalancingOrderingTest extends GridCommonAbstractTest {
         }
 
         // Sanity check.
-        if (keyMap.size() != affinity.partitions())
+        if (keyMap.size() != aff.partitions())
             throw new IllegalStateException("Inconsistent partition count");
 
         for (int i = 0; i < parts; i++) {
             IntegerKey key = keyMap.get(i);
 
-            if (affinity.partition(key) != i)
+            if (aff.partition(key) != i)
                 throw new IllegalStateException("Inconsistent partition");
         }
 
@@ -285,13 +285,13 @@ public class GridCacheRebalancingOrderingTest extends GridCommonAbstractTest {
 
         for (Map.Entry<Integer, IntegerKey> entry : keyMap.entrySet()) {
             Integer part = entry.getKey();
-            int affinity = entry.getValue().getKey();
+            int aff = entry.getValue().getKey();
             int cnt = RANDOM.nextInt(10) + 1;
 
             Set<IntegerKey> keys = new HashSet<>(cnt);
 
             for (int i = 0; i < cnt; i++) {
-                IntegerKey key = new IntegerKey(RANDOM.nextInt(10000), affinity);
+                IntegerKey key = new IntegerKey(RANDOM.nextInt(10000), aff);
                 keys.add(key);
                 cache.put(key, RANDOM.nextInt());
             }
@@ -306,7 +306,7 @@ public class GridCacheRebalancingOrderingTest extends GridCommonAbstractTest {
             X.println(entry.getKey() + ": " + entry.getValue());
 
         // Validate keys across all partitions.
-        Affinity<IntegerKey> affinity = ignite.affinity(cache.getName());
+        Affinity<IntegerKey> aff = ignite.affinity(cache.getName());
 
         Map<IntegerKey, KeySetValidator> validatorMap = new HashMap<>(partMap.size());
 
@@ -327,12 +327,12 @@ public class GridCacheRebalancingOrderingTest extends GridCommonAbstractTest {
             for (Map.Entry<IntegerKey, EntryProcessorResult<KeySetValidator.Result>> result : results.entrySet()) {
                 try {
                     if (result.getValue().get() == KeySetValidator.Result.RETRY)
-                        retries.add(affinity.partition(result.getKey()));
+                        retries.add(aff.partition(result.getKey()));
                 }
                 catch (Exception e) {
                     X.println("!!! " + e.getMessage());
                     e.printStackTrace();
-                    failures.add(affinity.partition(result.getKey()));
+                    failures.add(aff.partition(result.getKey()));
                 }
             }
 
@@ -383,7 +383,7 @@ public class GridCacheRebalancingOrderingTest extends GridCommonAbstractTest {
 
                 IgniteCache<IntegerKey, Integer> cache = ignite.cache(TEST_CACHE_NAME);
 
-                Affinity<IntegerKey> affinity = ignite.affinity(TEST_CACHE_NAME);
+                Affinity<IntegerKey> aff = ignite.affinity(TEST_CACHE_NAME);
 
                 Set<IntegerKey> exp = this.keys;
 
@@ -391,9 +391,9 @@ public class GridCacheRebalancingOrderingTest extends GridCommonAbstractTest {
 
                 IntegerKey key = entry.getKey();
 
-                int part = affinity.partition(key);
+                int part = aff.partition(key);
 
-                String ownership = affinity.isPrimary(ignite.cluster().localNode(), key) ? "primary" : "backup";
+                String ownership = aff.isPrimary(ignite.cluster().localNode(), key) ? "primary" : "backup";
 
                 // Wait for the local listener to sync past events.
                 if (!observer.getIgniteLocalSyncListener().isSynced()) {
@@ -522,12 +522,12 @@ public class GridCacheRebalancingOrderingTest extends GridCommonAbstractTest {
         /** {@inheritDoc} */
         @Override public String toString() {
             int val = this.val;
-            Integer affinity = this.affinity;
+            Integer aff = this.affinity;
 
-            if (val == affinity)
+            if (val == aff)
                 return String.valueOf(val);
 
-            return "IntKey [val=" + val + ", aff=" + affinity + ']';
+            return "IntKey [val=" + val + ", aff=" + aff + ']';
         }
 
         /** {@inheritDoc} */
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingPartitionDistributionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingPartitionDistributionTest.java
index 53f6fcdac08..4e0f946c515 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingPartitionDistributionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingPartitionDistributionTest.java
@@ -119,14 +119,14 @@ public class GridCacheRebalancingPartitionDistributionTest extends GridRollingRe
         @Override public void test() throws AssertionError {
             super.test();
 
-            Affinity<?> affinity = ignite().affinity(CACHE_NAME);
+            Affinity<?> aff = ignite().affinity(CACHE_NAME);
 
-            int partCnt = affinity.partitions();
+            int partCnt = aff.partitions();
 
             Map<ClusterNode, Integer> partMap = new HashMap<>(serverCount());
 
             for (int i = 0; i < partCnt; i++) {
-                ClusterNode node = affinity.mapPartitionToNode(i);
+                ClusterNode node = aff.mapPartitionToNode(i);
 
                 int cnt = partMap.containsKey(node) ? partMap.get(node) : 0;
 
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/EvictionPolicyFailureHandlerTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/EvictionPolicyFailureHandlerTest.java
index cf1a776219c..ff630f08844 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/EvictionPolicyFailureHandlerTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/EvictionPolicyFailureHandlerTest.java
@@ -171,11 +171,11 @@ public class EvictionPolicyFailureHandlerTest extends GridCommonAbstractTest {
 
         GridCacheAdapter<Object, Object> cache = ((IgniteKernal)node2).internalCache(DEFAULT_CACHE_NAME);
 
-        Affinity<Object> affinity = cache.affinity();
+        Affinity<Object> aff = cache.affinity();
 
         try {
             for (int i = 0; i < 1000; i++) {
-                if (affinity.isPrimary(node1.localNode(), i))
+                if (aff.isPrimary(node1.localNode(), i))
                     cache.put(i, 1);
             }
         }
@@ -196,15 +196,15 @@ public class EvictionPolicyFailureHandlerTest extends GridCommonAbstractTest {
 
         GridCacheAdapter<Object, Object> cache = ((IgniteKernal)node2).internalCache(DEFAULT_CACHE_NAME);
 
-        Affinity<Object> affinity = cache.affinity();
+        Affinity<Object> aff = cache.affinity();
 
         for (int i = 0; i < 1000; i++) {
-            if (affinity.isPrimary(node1.localNode(), i))
+            if (aff.isPrimary(node1.localNode(), i))
                 cache.put(i, 1);
         }
 
         for (int i = 0; i < 1000; i++) {
-            if (affinity.isPrimary(node1.localNode(), (double)i))
+            if (aff.isPrimary(node1.localNode(), (double)i))
                 cache.put((double)i, 1);
         }
 
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 4380e80e810..c5ce1b29906 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
@@ -235,18 +235,18 @@ public class IgnitePdsCacheWalDisabledOnRebalancingTest extends GridCommonAbstra
 
         fillCache(ig0.dataStreamer(CACHE3_NAME), CACHE_SIZE, GENERATING_FUNC);
 
-        List<Integer> nonAffinityKeys1 = nearKeys(grid(1).cache(CACHE3_NAME), 100, CACHE_SIZE / 2);
-        List<Integer> nonAffinityKeys2 = nearKeys(grid(2).cache(CACHE3_NAME), 100, CACHE_SIZE / 2);
+        List<Integer> nonAffKeys1 = nearKeys(grid(1).cache(CACHE3_NAME), 100, CACHE_SIZE / 2);
+        List<Integer> nonAffKeys2 = nearKeys(grid(2).cache(CACHE3_NAME), 100, CACHE_SIZE / 2);
 
         stopGrid(1);
         stopGrid(2);
 
-        Set<Integer> nonAffinityKeysSet = new HashSet<>();
+        Set<Integer> nonAffKeysSet = new HashSet<>();
 
-        nonAffinityKeysSet.addAll(nonAffinityKeys1);
-        nonAffinityKeysSet.addAll(nonAffinityKeys2);
+        nonAffKeysSet.addAll(nonAffKeys1);
+        nonAffKeysSet.addAll(nonAffKeys2);
 
-        fillCache(ig0.dataStreamer(CACHE3_NAME), nonAffinityKeysSet, GENERATING_FUNC);
+        fillCache(ig0.dataStreamer(CACHE3_NAME), nonAffKeysSet, GENERATING_FUNC);
 
         int groupId = ((IgniteEx)ig0).cachex(CACHE3_NAME).context().groupId();
 
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 3621e5bebbf..b72c251218f 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
@@ -132,9 +132,9 @@ public class IgnitePdsPageReplacementDuringPartitionClearTest extends GridCommon
 
             awaitPartitionMapExchange();
 
-            Map<ClusterNode, GridLongList> affinityAfter = allPartitions(igNew);
+            Map<ClusterNode, GridLongList> affAfter = allPartitions(igNew);
 
-            evictLsnr.waitPartitionsEvicted(igNew.cluster().localNode(), affinityAfter);
+            evictLsnr.waitPartitionsEvicted(igNew.cluster().localNode(), affAfter);
 
             stop.set(true);
 
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 88d0878bead..19f6e9f67bd 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
@@ -171,10 +171,10 @@ public class WalRebalanceRestartTest extends GridCommonAbstractTest {
      * @throws IgniteInterruptedCheckedException if failed.
      */
     private void waitForRebalanceOnLastDiscoTopology(IgniteEx ignite) throws IgniteInterruptedCheckedException {
-        AffinityTopologyVersion readyAffinity = ignite.context().cache().context().exchange().readyAffinityVersion();
+        AffinityTopologyVersion readyAff = ignite.context().cache().context().exchange().readyAffinityVersion();
 
-        assertTrue("Can not wait for rebalance topology [cur=" + rebTopVer + ", expect: " + readyAffinity + ']',
-            GridTestUtils.waitForCondition(() -> rebTopVer.equals(readyAffinity),
+        assertTrue("Can not wait for rebalance topology [cur=" + rebTopVer + ", expect: " + readyAff + ']',
+            GridTestUtils.waitForCondition(() -> rebTopVer.equals(readyAff),
                 10_000));
     }
 
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/AbstractSnapshotSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/AbstractSnapshotSelfTest.java
index 2a56d8ceb24..bc0d3b1e8c6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/AbstractSnapshotSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/AbstractSnapshotSelfTest.java
@@ -678,7 +678,7 @@ public abstract class AbstractSnapshotSelfTest extends GridCommonAbstractTest {
                 expPartCopiesInSnp = 1;
             else {
                 int backups = -1;
-                int affinityNodes = 0;
+                int affNodes = 0;
 
                 for (Ignite node: G.allGrids()) {
                     if (!filter.test(node))
@@ -690,17 +690,17 @@ public abstract class AbstractSnapshotSelfTest extends GridCommonAbstractTest {
                         backups = grpCtx.config().getBackups();
                         parts = grpCtx.affinity().partitions();
 
-                        affinityNodes++;
+                        affNodes++;
                     }
                 }
 
                 assertTrue(backups != -1);
                 assertTrue(parts != -1);
-                assertTrue(affinityNodes > 0);
+                assertTrue(affNodes > 0);
 
                 expPartCopiesInSnp = backups == Integer.MAX_VALUE
-                    ? affinityNodes
-                    : Math.min(backups + 1, affinityNodes);
+                    ? affNodes
+                    : Math.min(backups + 1, affNodes);
             }
 
             Map<Integer, Integer> cacheParts = entry.getValue();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryTransformerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryTransformerSelfTest.java
index 692066370bd..8a275b9cc07 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryTransformerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryTransformerSelfTest.java
@@ -171,13 +171,13 @@ public class GridCacheQueryTransformerSelfTest extends GridCommonAbstractTest {
     public void testGetObjectFieldPartitioned() throws Exception {
         IgniteCache<Integer, Value> cache = grid().createCache("test-cache");
 
-        Affinity<Integer> affinity = affinity(cache);
+        Affinity<Integer> aff = affinity(cache);
 
         try {
             int[] keys = new int[50];
 
             for (int i = 0, j = 0; i < keys.length; j++) {
-                if (affinity.partition(j) == 0)
+                if (aff.partition(j) == 0)
                     keys[i++] = j;
             }
 
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 07a8e2a2cbc..e00235b8014 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
@@ -539,12 +539,12 @@ public class AbstractTransactionIntergrityTest extends GridCommonAbstractTest {
                 if (accIdFrom == accIdTo)
                     continue;
 
-                Affinity<Object> affinity = ignite.affinity(cacheName);
+                Affinity<Object> aff = ignite.affinity(cacheName);
 
-                ClusterNode primaryForAccFrom = affinity.mapKeyToNode(accIdFrom);
+                ClusterNode primaryForAccFrom = aff.mapKeyToNode(accIdFrom);
                 assertNotNull(primaryForAccFrom);
 
-                ClusterNode primaryForAccTo = affinity.mapKeyToNode(accIdTo);
+                ClusterNode primaryForAccTo = aff.mapKeyToNode(accIdTo);
                 assertNotNull(primaryForAccTo);
 
                 // Allows only transaction between accounts that primary on the same node if corresponding flag is enabled.
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOptimisticOnPartitionExchangeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOptimisticOnPartitionExchangeTest.java
index f2b11b0d66f..fa88911c7e9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOptimisticOnPartitionExchangeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOptimisticOnPartitionExchangeTest.java
@@ -130,10 +130,10 @@ public class TxOptimisticOnPartitionExchangeTest extends GridCommonAbstractTest
 
         ClusterNode node = ignite(0).cluster().node();
 
-        GridCacheAffinityManager affinity = ((IgniteCacheProxy)cache).context().affinity();
+        GridCacheAffinityManager aff = ((IgniteCacheProxy)cache).context().affinity();
 
         for (int i = 0; txValues.size() < TX_SIZE; i++) {
-            if (!txInitiatorPrimary && node.equals(affinity.primaryByKey(i, NONE)))
+            if (!txInitiatorPrimary && node.equals(aff.primaryByKey(i, NONE)))
                 continue;
 
             txValues.put(i, i);
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/affinity/PartitionExtractor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/affinity/PartitionExtractor.java
index 11e6ceea4d0..b04cc863884 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/affinity/PartitionExtractor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/affinity/PartitionExtractor.java
@@ -164,7 +164,7 @@ public class PartitionExtractor {
         // Merge.
         PartitionNode tree = null;
 
-        AffinityTopologyVersion affinityTopVer = null;
+        AffinityTopologyVersion affTopVer = null;
 
         for (GridCacheSqlQuery qry : qrys) {
             PartitionResult qryRes = (PartitionResult)qry.derivedPartitions();
@@ -174,10 +174,10 @@ public class PartitionExtractor {
             else
                 tree = new PartitionCompositeNode(tree, qryRes.tree(), PartitionCompositeNodeOperator.OR);
 
-            if (affinityTopVer == null)
-                affinityTopVer = qryRes.topologyVersion();
+            if (affTopVer == null)
+                affTopVer = qryRes.topologyVersion();
             else
-                assert affinityTopVer.equals(qryRes.topologyVersion());
+                assert affTopVer.equals(qryRes.topologyVersion());
         }
 
         // Optimize.
@@ -194,9 +194,9 @@ public class PartitionExtractor {
         // Affinity topology version expected to be the same for all partition results derived from map queries.
         // TODO: 09.04.19 IGNITE-11507: SQL: Ensure that affinity topology version doesn't change
         // TODO: during PartitionResult construction/application.
-        assert affinityTopVer != null;
+        assert affTopVer != null;
         
-        return new PartitionResult(tree, aff, affinityTopVer);
+        return new PartitionResult(tree, aff, affTopVer);
     }
 
     /**
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigVariationsQueryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigVariationsQueryTest.java
index cb7f6663621..4302834585d 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigVariationsQueryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigVariationsQueryTest.java
@@ -228,7 +228,7 @@ public class IgniteCacheConfigVariationsQueryTest extends IgniteCacheConfigVaria
                     IgniteCache<Object, Object> cache = jcache();
 
                     ClusterNode locNode = testedGrid().cluster().localNode();
-                    Affinity<Object> affinity = testedGrid().affinity(cacheName());
+                    Affinity<Object> aff = testedGrid().affinity(cacheName());
 
                     Map<Object, Object> map = new HashMap<>();
 
@@ -238,7 +238,7 @@ public class IgniteCacheConfigVariationsQueryTest extends IgniteCacheConfigVaria
 
                         cache.put(key, val);
 
-                        if (!isClientMode() && (cacheMode() == REPLICATED || affinity.isPrimary(locNode, key)))
+                        if (!isClientMode() && (cacheMode() == REPLICATED || aff.isPrimary(locNode, key)))
                             map.put(key, val);
                     }
 
@@ -312,7 +312,7 @@ public class IgniteCacheConfigVariationsQueryTest extends IgniteCacheConfigVaria
             @Override public void run() throws Exception {
                 IgniteCache<Object, Object> cache = jcache();
 
-                Affinity<Object> affinity = testedGrid().affinity(cacheName());
+                Affinity<Object> aff = testedGrid().affinity(cacheName());
 
                 Map<Integer, Map<Object, Object>> partMap = new HashMap<>();
 
@@ -332,7 +332,7 @@ public class IgniteCacheConfigVariationsQueryTest extends IgniteCacheConfigVaria
                     cache.put(key, val);
 
                     if (filter.apply(key, val)) {
-                        int part = affinity.partition(key);
+                        int part = aff.partition(key);
 
                         Map<Object, Object> map = partMap.get(part);
 
@@ -343,7 +343,7 @@ public class IgniteCacheConfigVariationsQueryTest extends IgniteCacheConfigVaria
                     }
                 }
 
-                for (int part = 0; part < affinity.partitions(); part++) {
+                for (int part = 0; part < aff.partitions(); part++) {
                     try {
                         Map<Object, Object> expMap = partMap.get(part);
 
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheDistributedPartitionQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheDistributedPartitionQuerySelfTest.java
index a458e589632..8b488a7fb0b 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheDistributedPartitionQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheDistributedPartitionQuerySelfTest.java
@@ -69,9 +69,9 @@ public class IgniteCacheDistributedPartitionQuerySelfTest extends IgniteCacheDis
     /** Tests local query over partitions. */
     @Test
     public void testLocalQuery() {
-        Affinity<Object> affinity = grid(0).affinity("cl");
+        Affinity<Object> aff = grid(0).affinity("cl");
 
-        int[] parts = affinity.primaryPartitions(grid(0).localNode());
+        int[] parts = aff.primaryPartitions(grid(0).localNode());
 
         Arrays.sort(parts);
 
@@ -84,7 +84,7 @@ public class IgniteCacheDistributedPartitionQuerySelfTest extends IgniteCacheDis
         List<Cache.Entry<ClientKey, Client>> clients = cl.query(qry1).getAll();
 
         for (Cache.Entry<ClientKey, Client> client : clients)
-            assertEquals("Incorrect partition", parts[0], affinity.partition(client.getKey()));
+            assertEquals("Incorrect partition", parts[0], aff.partition(client.getKey()));
 
         SqlFieldsQuery qry2 = new SqlFieldsQuery("select cl._KEY, cl._VAL from \"cl\".Client cl");
         qry2.setLocal(true);
@@ -93,6 +93,6 @@ public class IgniteCacheDistributedPartitionQuerySelfTest extends IgniteCacheDis
         List<List<?>> rows = cl.query(qry2).getAll();
 
         for (List<?> row : rows)
-            assertEquals("Incorrect partition", parts[0], affinity.partition(row.get(0)));
+            assertEquals("Incorrect partition", parts[0], aff.partition(row.get(0)));
     }
 }
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCreateTableTemplateTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCreateTableTemplateTest.java
index 769f701dfff..eab2fe68850 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCreateTableTemplateTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCreateTableTemplateTest.java
@@ -44,9 +44,9 @@ public class IgniteSqlCreateTableTemplateTest extends AbstractIndexingCommonTest
 
         customCacheConfiguration.setName("CUSTOM_TEMPLATE*");
 
-        MockAffinityKeyMapper customAffinityMapper = new MockAffinityKeyMapper();
+        MockAffinityKeyMapper customAffMapper = new MockAffinityKeyMapper();
 
-        customCacheConfiguration.setAffinityMapper(customAffinityMapper);
+        customCacheConfiguration.setAffinityMapper(customAffMapper);
 
         configuration.setCacheConfiguration(defaultCacheConfiguration, customCacheConfiguration);
 
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/RunningQueriesTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/RunningQueriesTest.java
index fa09f8ebc33..13ca745de22 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/RunningQueriesTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/RunningQueriesTest.java
@@ -542,21 +542,21 @@ public class RunningQueriesTest extends AbstractIndexingCommonTest {
 
         int key = 0;
 
-        int[] notAffinityKey = new int[2];
+        int[] notAffKey = new int[2];
 
-        for (int i = 0; i < notAffinityKey.length; i++) {
+        for (int i = 0; i < notAffKey.length; i++) {
             while (ignite.affinity(DEFAULT_CACHE_NAME).isPrimary(ignite.localNode(), key))
                 key++;
 
-            notAffinityKey[i] = key;
+            notAffKey[i] = key;
 
             key++;
         }
 
         String[] queries = {
             "create table test(ID int primary key, NAME varchar(20))",
-            "insert into test (ID, NAME) values (" + notAffinityKey[0] + ", 'name')",
-            "insert into test (ID, NAME) values (" + notAffinityKey[1] + ", 'name')",
+            "insert into test (ID, NAME) values (" + notAffKey[0] + ", 'name')",
+            "insert into test (ID, NAME) values (" + notAffKey[1] + ", 'name')",
             "SELECT * FROM test"
         };
 
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/IgniteCacheRandomOperationBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/IgniteCacheRandomOperationBenchmark.java
index faca4daf167..81775879db1 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/IgniteCacheRandomOperationBenchmark.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/IgniteCacheRandomOperationBenchmark.java
@@ -491,20 +491,20 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
      */
     private Map<UUID, List<Integer>> personCachePartitions(String cacheName) {
         // Getting affinity for person cache.
-        Affinity<Object> affinity = ignite().affinity(cacheName);
+        Affinity<Object> aff = ignite().affinity(cacheName);
 
         // Building a list of all partitions numbers.
         List<Integer> rndParts = new ArrayList<>(10);
 
-        if (affinity.partitions() <= SCAN_QUERY_PARTITION_AMOUNT)
-            for (int i = 0; i < affinity.partitions(); i++)
+        if (aff.partitions() <= SCAN_QUERY_PARTITION_AMOUNT)
+            for (int i = 0; i < aff.partitions(); i++)
                 rndParts.add(i);
         else {
             for (int i = 0; i < SCAN_QUERY_PARTITION_AMOUNT; i++) {
                 int partNum;
 
                 do
-                    partNum = nextRandom(affinity.partitions());
+                    partNum = nextRandom(aff.partitions());
                 while (rndParts.contains(partNum));
 
                 rndParts.add(partNum);
@@ -514,7 +514,7 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
         Collections.sort(rndParts);
 
         // Getting partition to node mapping.
-        Map<Integer, ClusterNode> partPerNodes = affinity.mapPartitionsToNodes(rndParts);
+        Map<Integer, ClusterNode> partPerNodes = aff.mapPartitionsToNodes(rndParts);
 
         // Building node to partitions mapping.
         Map<UUID, List<Integer>> nodesToPart = new HashMap<>();