ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [05/18] ignite git commit: IGNITE-4564: All setters on public configuration now return "this" instance to allow convenient chaining. This closes #1449.
Date Fri, 31 Mar 2017 16:22:39 GMT
IGNITE-4564: All setters on public configuration now return "this" instance to allow convenient chaining. This closes #1449.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/cfc88028
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/cfc88028
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/cfc88028

Branch: refs/heads/ignite-3477-master
Commit: cfc88028fb359d1ccb64ca636eccc86db0f0e61d
Parents: 44cf1d2
Author: Andrey V. Mashenkov <andrey.mashenkov@gmail.com>
Authored: Thu Mar 30 19:01:29 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Thu Mar 30 19:01:29 2017 +0300

----------------------------------------------------------------------
 .../spi/checkpoint/s3/S3CheckpointSpi.java      |  72 ++-
 .../tcp/ipfinder/s3/TcpDiscoveryS3IpFinder.java |  27 +-
 .../cloud/TcpDiscoveryCloudIpFinder.java        |  51 +-
 .../ignite/binary/BinaryBasicIdMapper.java      |   5 +-
 .../ignite/binary/BinaryBasicNameMapper.java    |   5 +-
 .../ignite/binary/BinaryTypeConfiguration.java  |  30 +-
 .../ignite/cache/CacheKeyConfiguration.java     |  10 +-
 .../org/apache/ignite/cache/QueryEntity.java    |  35 +-
 .../affinity/fair/FairAffinityFunction.java     |  21 +-
 .../rendezvous/RendezvousAffinityFunction.java  |  27 +-
 .../cache/eviction/AbstractEvictionPolicy.java  |  15 +-
 .../cache/eviction/fifo/FifoEvictionPolicy.java |  74 ++-
 .../eviction/fifo/FifoEvictionPolicyMBean.java  |   2 +
 .../igfs/IgfsPerBlockLruEvictionPolicy.java     | 131 ++++-
 .../cache/eviction/lru/LruEvictionPolicy.java   |  74 ++-
 .../eviction/sorted/SortedEvictionPolicy.java   |  74 ++-
 .../configuration/AtomicConfiguration.java      |  15 +-
 .../configuration/BinaryConfiguration.java      |  30 +-
 .../configuration/CacheConfiguration.java       |  71 ++-
 .../configuration/CollectionConfiguration.java  |  36 +-
 .../configuration/ConnectorConfiguration.java   | 100 +++-
 .../configuration/FileSystemConfiguration.java  | 151 ++++--
 .../configuration/HadoopConfiguration.java      |  31 +-
 .../configuration/NearCacheConfiguration.java   |  50 ++
 .../configuration/TransactionConfiguration.java |  45 +-
 .../igfs/IgfsGroupDataBlocksKeyMapper.java      |   5 +-
 .../igfs/IgfsIpcEndpointConfiguration.java      |  30 +-
 .../client/GridClientConfiguration.java         | 100 +++-
 .../client/GridClientDataConfiguration.java     |  15 +-
 .../client/GridClientPartitionAffinity.java     |  15 +-
 .../balancer/GridClientBalancerAdapter.java     |   5 +-
 .../router/GridTcpRouterConfiguration.java      |  50 +-
 .../internal/jdbc2/JdbcSqlFieldsQuery.java      |  57 ++
 .../processors/cache/GridCacheProcessor.java    |  39 +-
 .../dotnet/PlatformDotNetConfigurationEx.java   |  21 +-
 .../utils/PlatformConfigurationUtils.java       |   3 +-
 .../optimized/OptimizedMarshaller.java          |  15 +-
 .../apache/ignite/mxbean/IgniteMBeanAware.java  |  28 +
 .../dotnet/PlatformDotNetAffinityFunction.java  |  10 +-
 .../PlatformDotNetBinaryConfiguration.java      |  31 +-
 .../PlatformDotNetBinaryTypeConfiguration.java  |  35 +-
 .../dotnet/PlatformDotNetConfiguration.java     |  10 +-
 .../ignite/services/ServiceConfiguration.java   |  35 +-
 .../org/apache/ignite/spi/IgniteSpiAdapter.java |  50 +-
 .../ignite/spi/IgniteSpiMBeanAdapter.java       |  78 +++
 .../checkpoint/cache/CacheCheckpointSpi.java    |  40 +-
 .../spi/checkpoint/jdbc/JdbcCheckpointSpi.java  | 219 ++++++--
 .../spi/checkpoint/noop/NoopCheckpointSpi.java  |   7 +
 .../sharedfs/SharedFsCheckpointSpi.java         |  54 +-
 .../fifoqueue/FifoQueueCollisionSpi.java        | 134 ++++-
 .../fifoqueue/FifoQueueCollisionSpiMBean.java   |   2 +-
 .../jobstealing/JobStealingCollisionSpi.java    | 281 ++++++++--
 .../JobStealingCollisionSpiMBean.java           |   6 +-
 .../spi/collision/noop/NoopCollisionSpi.java    |   7 +
 .../PriorityQueueCollisionSpi.java              | 278 ++++++++--
 .../PriorityQueueCollisionSpiMBean.java         |   2 +-
 .../communication/tcp/TcpCommunicationSpi.java  | 536 ++++++++++++++++---
 .../deployment/local/LocalDeploymentSpi.java    |  24 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      | 437 ++++++++++++---
 .../ipfinder/TcpDiscoveryIpFinderAdapter.java   |   5 +-
 .../ipfinder/jdbc/TcpDiscoveryJdbcIpFinder.java |  17 +-
 .../TcpDiscoveryMulticastIpFinder.java          |  47 +-
 .../sharedfs/TcpDiscoverySharedFsIpFinder.java  |  12 +-
 .../tcp/ipfinder/vm/TcpDiscoveryVmIpFinder.java |  14 +-
 .../memory/MemoryEventStorageSpi.java           |  98 +++-
 .../spi/failover/always/AlwaysFailoverSpi.java  |  53 +-
 .../jobstealing/JobStealingFailoverSpi.java     |  68 ++-
 .../spi/failover/never/NeverFailoverSpi.java    |  30 +-
 .../spi/indexing/noop/NoopIndexingSpi.java      |   7 +
 .../adaptive/AdaptiveLoadBalancingSpi.java      |  43 +-
 .../roundrobin/RoundRobinLoadBalancingSpi.java  |  44 +-
 .../WeightedRandomLoadBalancingSpi.java         |  61 ++-
 .../spi/swapspace/file/FileSwapSpaceSpi.java    | 112 +++-
 .../spi/swapspace/noop/NoopSwapSpaceSpi.java    |   7 +
 .../gce/TcpDiscoveryGoogleStorageIpFinder.java  |  33 +-
 .../fs/IgniteHadoopIgfsSecondaryFileSystem.java |  10 +-
 .../IgniteHadoopWeightedMapReducePlanner.java   |  26 +-
 .../spi/deployment/uri/UriDeploymentSpi.java    |  80 ++-
 .../zk/TcpDiscoveryZookeeperIpFinder.java       |  37 +-
 79 files changed, 3935 insertions(+), 710 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpi.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpi.java b/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpi.java
index 3d5954f..2330ef3 100644
--- a/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpi.java
+++ b/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpi.java
@@ -51,6 +51,7 @@ import org.apache.ignite.resources.LoggerResource;
 import org.apache.ignite.spi.IgniteSpiAdapter;
 import org.apache.ignite.spi.IgniteSpiConfiguration;
 import org.apache.ignite.spi.IgniteSpiException;
+import org.apache.ignite.spi.IgniteSpiMBeanAdapter;
 import org.apache.ignite.spi.IgniteSpiMultipleInstancesSupport;
 import org.apache.ignite.spi.IgniteSpiThread;
 import org.apache.ignite.spi.checkpoint.CheckpointListener;
@@ -122,7 +123,7 @@ import org.jetbrains.annotations.Nullable;
  * @see org.apache.ignite.spi.checkpoint.CheckpointSpi
  */
 @IgniteSpiMultipleInstancesSupport(true)
-public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi, S3CheckpointSpiMBean {
+public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi {
     /** Logger. */
     @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"})
     @LoggerResource
@@ -169,7 +170,7 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi,
      *
      * @return S3 bucket name to use.
      */
-    @Override public String getBucketName() {
+    public String getBucketName() {
         return bucketName;
     }
 
@@ -178,7 +179,7 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi,
      *
      * @return S3 access key.
      */
-    @Override public String getAccessKey() {
+    public String getAccessKey() {
         return cred.getAWSAccessKeyId();
     }
 
@@ -196,7 +197,7 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi,
      *
      * @return HTTP proxy host.
      */
-    @Override public String getProxyHost() {
+    public String getProxyHost() {
         return cfg.getProxyHost();
     }
 
@@ -205,7 +206,7 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi,
      *
      * @return HTTP proxy port.
      */
-    @Override public int getProxyPort() {
+    public int getProxyPort() {
         return cfg.getProxyPort();
     }
 
@@ -214,7 +215,7 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi,
      *
      * @return HTTP proxy user name.
      */
-    @Override public String getProxyUsername() {
+    public String getProxyUsername() {
         return cfg.getProxyUsername();
     }
 
@@ -231,10 +232,13 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi,
      * Sets bucket name suffix.
      *
      * @param bucketNameSuffix Bucket name suffix.
+     * @return {@code this} for chaining.
      */
     @IgniteSpiConfiguration(optional = true)
-    public void setBucketNameSuffix(String bucketNameSuffix) {
+    public S3CheckpointSpi setBucketNameSuffix(String bucketNameSuffix) {
         this.bucketNameSuffix = bucketNameSuffix;
+
+        return this;
     }
 
     /**
@@ -243,10 +247,13 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi,
      * For details refer to Amazon S3 API reference.
      *
      * @param cfg Amazon client configuration.
+     * @return {@code this} for chaining.
      */
     @IgniteSpiConfiguration(optional = true)
-    public void setClientConfiguration(ClientConfiguration cfg) {
+    public S3CheckpointSpi setClientConfiguration(ClientConfiguration cfg) {
         this.cfg = cfg;
+
+        return this;
     }
 
     /**
@@ -255,10 +262,13 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi,
      * For details refer to Amazon S3 API reference.
      *
      * @param cred AWS credentials.
+     * @return {@code this} for chaining.
      */
     @IgniteSpiConfiguration(optional = false)
-    public void setAwsCredentials(AWSCredentials cred) {
+    public S3CheckpointSpi setAwsCredentials(AWSCredentials cred) {
         this.cred = cred;
+
+        return this;
     }
 
     /** {@inheritDoc} */
@@ -351,7 +361,7 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi,
 
         timeoutWrk.start();
 
-        registerMBean(igniteInstanceName, this, S3CheckpointSpiMBean.class);
+        registerMBean(igniteInstanceName, new S3CheckpointSpiMBeanImpl(this), S3CheckpointSpiMBean.class);
 
         // Ack ok start.
         if (log.isDebugEnabled())
@@ -570,6 +580,13 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi,
     }
 
     /** {@inheritDoc} */
+    @Override public S3CheckpointSpi setName(String name) {
+        super.setName(name);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(S3CheckpointSpi.class, this);
     }
@@ -702,4 +719,39 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi,
             return S.toString(S3TimeoutWorker.class, this);
         }
     }
+
+    /**
+     * MBean implementation for S3CheckpointSpi.
+     */
+    private class S3CheckpointSpiMBeanImpl extends IgniteSpiMBeanAdapter implements S3CheckpointSpiMBean {
+        /** {@inheritDoc} */
+        S3CheckpointSpiMBeanImpl(IgniteSpiAdapter spiAdapter) {
+            super(spiAdapter);
+        }
+
+        /** {@inheritDoc} */
+        @Override public String getBucketName() {
+            return S3CheckpointSpi.this.getBucketName();
+        }
+
+        /** {@inheritDoc} */
+        @Override public String getAccessKey() {
+            return S3CheckpointSpi.this.getAccessKey();
+        }
+
+        /** {@inheritDoc} */
+        @Override public String getProxyHost() {
+            return S3CheckpointSpi.this.getProxyHost();
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getProxyPort() {
+            return S3CheckpointSpi.this.getProxyPort();
+        }
+
+        /** {@inheritDoc} */
+        @Override public String getProxyUsername() {
+            return S3CheckpointSpi.this.getProxyUsername();
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/aws/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinder.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinder.java b/modules/aws/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinder.java
index d9f50c2..2307a66 100644
--- a/modules/aws/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinder.java
+++ b/modules/aws/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinder.java
@@ -308,10 +308,13 @@ public class TcpDiscoveryS3IpFinder extends TcpDiscoveryIpFinderAdapter {
      * Sets bucket name for IP finder.
      *
      * @param bucketName Bucket name.
+     * @return {@code this} for chaining.
      */
     @IgniteSpiConfiguration(optional = false)
-    public void setBucketName(String bucketName) {
+    public TcpDiscoveryS3IpFinder setBucketName(String bucketName) {
         this.bucketName = bucketName;
+
+        return this;
     }
 
     /**
@@ -320,10 +323,13 @@ public class TcpDiscoveryS3IpFinder extends TcpDiscoveryIpFinderAdapter {
      * For details refer to Amazon S3 API reference.
      *
      * @param cfg Amazon client configuration.
+     * @return {@code this} for chaining.
      */
     @IgniteSpiConfiguration(optional = true)
-    public void setClientConfiguration(ClientConfiguration cfg) {
+    public TcpDiscoveryS3IpFinder setClientConfiguration(ClientConfiguration cfg) {
         this.cfg = cfg;
+
+        return this;
     }
 
     /**
@@ -332,10 +338,13 @@ public class TcpDiscoveryS3IpFinder extends TcpDiscoveryIpFinderAdapter {
      * For details refer to Amazon S3 API reference.
      *
      * @param cred AWS credentials.
+     * @return {@code this} for chaining.
      */
     @IgniteSpiConfiguration(optional = false)
-    public void setAwsCredentials(AWSCredentials cred) {
+    public TcpDiscoveryS3IpFinder setAwsCredentials(AWSCredentials cred) {
         this.cred = cred;
+
+        return this;
     }
 
     /**
@@ -344,10 +353,20 @@ public class TcpDiscoveryS3IpFinder extends TcpDiscoveryIpFinderAdapter {
      * For details refer to Amazon S3 API reference.
      *
      * @param credProvider AWS credentials provider.
+     * @return {@code this} for chaining.
      */
     @IgniteSpiConfiguration(optional = false)
-    public void setAwsCredentialsProvider(AWSCredentialsProvider credProvider) {
+    public TcpDiscoveryS3IpFinder setAwsCredentialsProvider(AWSCredentialsProvider credProvider) {
         this.credProvider = credProvider;
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public TcpDiscoveryS3IpFinder setShared(boolean shared) {
+        super.setShared(shared);
+
+        return this;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
----------------------------------------------------------------------
diff --git a/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java b/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
index 2c03557..1aa3790 100644
--- a/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
+++ b/modules/cloud/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/cloud/TcpDiscoveryCloudIpFinder.java
@@ -36,6 +36,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.spi.IgniteSpiConfiguration;
 import org.apache.ignite.spi.IgniteSpiException;
@@ -230,10 +231,13 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
      * ComputeService section contains names of all supported providers.
      *
      * @param provider Provider name.
+     * @return {@code this} for chaining.
      */
     @IgniteSpiConfiguration(optional = false)
-    public void setProvider(String provider) {
+    public TcpDiscoveryCloudIpFinder setProvider(String provider) {
         this.provider = provider;
+
+        return this;
     }
 
     /**
@@ -244,10 +248,13 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
      * what is used as an identity for a particular cloud platform.
      *
      * @param identity Identity to use during authentication on the cloud.
+     * @return {@code this} for chaining.
      */
     @IgniteSpiConfiguration(optional = false)
-    public void setIdentity(String identity) {
+    public TcpDiscoveryCloudIpFinder setIdentity(String identity) {
         this.identity = identity;
+
+        return this;
     }
 
     /**
@@ -258,10 +265,13 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
      * what is used as an credential for a particular cloud platform.
      *
      * @param credential Credential to use during authentication on the cloud.
+     * @return {@code this} for chaining.
      */
     @IgniteSpiConfiguration(optional = true)
-    public void setCredential(String credential) {
+    public TcpDiscoveryCloudIpFinder setCredential(String credential) {
         this.credential = credential;
+
+        return this;
     }
 
     /**
@@ -275,10 +285,13 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
      * what is used as an credential for a particular cloud platform.
      *
      * @param credentialPath Path to the credential to use during authentication on the cloud.
+     * @return {@code this} for chaining.
      */
     @IgniteSpiConfiguration(optional = true)
-    public void setCredentialPath(String credentialPath) {
+    public TcpDiscoveryCloudIpFinder setCredentialPath(String credentialPath) {
         this.credentialPath = credentialPath;
+
+        return this;
     }
 
     /**
@@ -291,13 +304,14 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
      * providers a call to this method is redundant.
      *
      * @param zones Zones where VMs are located or null if to take every zone into account.
+     * @return {@code this} for chaining.
      */
     @IgniteSpiConfiguration(optional = true)
-    public void setZones(Collection<String> zones) {
-        if (F.isEmpty(zones))
-            return;
+    public TcpDiscoveryCloudIpFinder setZones(Collection<String> zones) {
+        if (!F.isEmpty(zones))
+            this.zones = new TreeSet<>(zones);
 
-        this.zones = new TreeSet<>(zones);
+        return this;
     }
 
     /**
@@ -310,13 +324,14 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
      * providers a call to this method is redundant.
      *
      * @param regions Regions where VMs are located or null if to check every region a provider has.
+     * @return {@code this} for chaining.
      */
     @IgniteSpiConfiguration(optional = true)
-    public void setRegions(Collection<String> regions) {
-        if (F.isEmpty(regions))
-            return;
+    public TcpDiscoveryCloudIpFinder setRegions(Collection<String> regions) {
+        if (!F.isEmpty(regions))
+            this.regions = new TreeSet<>(regions);
 
-        this.regions = new TreeSet<>(regions);
+        return this;
     }
 
     /**
@@ -452,4 +467,16 @@ public class TcpDiscoveryCloudIpFinder extends TcpDiscoveryIpFinderAdapter {
 
         return builder.toString();
     }
+
+    /** {@inheritDoc} */
+    @Override public TcpDiscoveryCloudIpFinder setShared(boolean shared) {
+        super.setShared(shared);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(TcpDiscoveryCloudIpFinder.class, this);
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/binary/BinaryBasicIdMapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryBasicIdMapper.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryBasicIdMapper.java
index da31751..53ad9b6 100644
--- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryBasicIdMapper.java
+++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryBasicIdMapper.java
@@ -114,9 +114,12 @@ public class BinaryBasicIdMapper implements BinaryIdMapper {
      * Sets whether to use strings in lower case or not.
      *
      * @param isLowerCase Whether to use strings in lower case or not.
+     * @return {@code this} for chaining.
      */
-    public void setLowerCase(boolean isLowerCase) {
+    public BinaryBasicIdMapper setLowerCase(boolean isLowerCase) {
         this.isLowerCase = isLowerCase;
+
+        return this;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/binary/BinaryBasicNameMapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryBasicNameMapper.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryBasicNameMapper.java
index 42d6b5b..bc338b4 100644
--- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryBasicNameMapper.java
+++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryBasicNameMapper.java
@@ -58,9 +58,12 @@ public class BinaryBasicNameMapper implements BinaryNameMapper {
      * Sets whether to use simple name of class or not.
      *
      * @param isSimpleName Whether to use simple name of class or not.
+     * @return {@code this} for chaining.
      */
-    public void setSimpleName(boolean isSimpleName) {
+    public BinaryBasicNameMapper setSimpleName(boolean isSimpleName) {
         this.isSimpleName = isSimpleName;
+
+        return this;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java
index d95e0ae..1b2d828 100644
--- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryTypeConfiguration.java
@@ -91,9 +91,12 @@ public class BinaryTypeConfiguration {
      * Sets type name.
      *
      * @param typeName Type name.
+     * @return {@code this} for chaining.
      */
-    public void setTypeName(String typeName) {
+    public BinaryTypeConfiguration setTypeName(String typeName) {
         this.typeName = typeName;
+
+        return this;
     }
 
     /**
@@ -109,9 +112,12 @@ public class BinaryTypeConfiguration {
      * Sets ID mapper.
      *
      * @param idMapper ID mapper.
+     * @return {@code this} for chaining.
      */
-    public void setIdMapper(BinaryIdMapper idMapper) {
+    public BinaryTypeConfiguration setIdMapper(BinaryIdMapper idMapper) {
         this.idMapper = idMapper;
+
+        return this;
     }
 
     /**
@@ -127,9 +133,12 @@ public class BinaryTypeConfiguration {
      * Sets name mapper.
      *
      * @param nameMapper Name mapper.
+     * @return {@code this} for chaining.
      */
-    public void setNameMapper(BinaryNameMapper nameMapper) {
+    public BinaryTypeConfiguration setNameMapper(BinaryNameMapper nameMapper) {
         this.nameMapper = nameMapper;
+
+        return this;
     }
 
     /**
@@ -145,9 +154,12 @@ public class BinaryTypeConfiguration {
      * Sets serializer.
      *
      * @param serializer Serializer.
+     * @return {@code this} for chaining.
      */
-    public void setSerializer(BinarySerializer serializer) {
+    public BinaryTypeConfiguration setSerializer(BinarySerializer serializer) {
         this.serializer = serializer;
+
+        return this;
     }
 
     /**
@@ -163,9 +175,12 @@ public class BinaryTypeConfiguration {
      * Sets identity resolver.
      *
      * @param identityRslvr Identity resolver.
+     * @return {@code this} for chaining.
      */
-    public void setIdentityResolver(@Nullable BinaryIdentityResolver identityRslvr) {
+    public BinaryTypeConfiguration setIdentityResolver(@Nullable BinaryIdentityResolver identityRslvr) {
         this.identityRslvr = identityRslvr;
+
+        return this;
     }
 
     /**
@@ -181,9 +196,12 @@ public class BinaryTypeConfiguration {
      * Sets whether this is enum type.
      *
      * @param isEnum {@code True} if enum.
+     * @return {@code this} for chaining.
      */
-    public void setEnum(boolean isEnum) {
+    public BinaryTypeConfiguration setEnum(boolean isEnum) {
         this.isEnum = isEnum;
+
+        return this;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/cache/CacheKeyConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheKeyConfiguration.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheKeyConfiguration.java
index f117847..33e5881 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheKeyConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheKeyConfiguration.java
@@ -81,9 +81,12 @@ public class CacheKeyConfiguration implements Serializable {
 
     /**
      * @param typeName Type name for which affinity field name is being defined.
+     * @return {@code this} for chaining.
      */
-    public void setTypeName(String typeName) {
+    public CacheKeyConfiguration setTypeName(String typeName) {
         this.typeName = typeName;
+
+        return this;
     }
 
     /**
@@ -99,9 +102,12 @@ public class CacheKeyConfiguration implements Serializable {
      * Sets affinity key field name.
      *
      * @param affKeyFieldName Affinity key field name.
+     * @return {@code this} for chaining.
      */
-    public void setAffinityKeyFieldName(String affKeyFieldName) {
+    public CacheKeyConfiguration setAffinityKeyFieldName(String affKeyFieldName) {
         this.affKeyFieldName = affKeyFieldName;
+
+        return this;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java b/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
index 48cdae5..f791c1c 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
@@ -86,9 +86,12 @@ public class QueryEntity implements Serializable {
      * Sets key type for this query pair.
      *
      * @param keyType Key type.
+     * @return {@code this} for chaining.
      */
-    public void setKeyType(String keyType) {
+    public QueryEntity setKeyType(String keyType) {
         this.keyType = keyType;
+
+        return this;
     }
 
     /**
@@ -104,9 +107,12 @@ public class QueryEntity implements Serializable {
      * Sets value type for this query pair.
      *
      * @param valType Value type.
+     * @return {@code this} for chaining.
      */
-    public void setValueType(String valType) {
+    public QueryEntity setValueType(String valType) {
         this.valType = valType;
+
+        return this;
     }
 
     /**
@@ -124,9 +130,12 @@ public class QueryEntity implements Serializable {
      * order of columns returned by the 'select *' queries.
      *
      * @param fields Field-to-type map.
+     * @return {@code this} for chaining.
      */
-    public void setFields(LinkedHashMap<String, String> fields) {
+    public QueryEntity setFields(LinkedHashMap<String, String> fields) {
         this.fields = fields;
+
+        return this;
     }
 
     /**
@@ -146,9 +155,12 @@ public class QueryEntity implements Serializable {
      * Thus, setting this parameter in XML is not mandatory and should be based on particular use case.
      *
      * @param keyFields Set of names of key fields.
+     * @return {@code this} for chaining.
      */
-    public void setKeyFields(Set<String> keyFields) {
+    public QueryEntity setKeyFields(Set<String> keyFields) {
         this.keyFields = keyFields;
+
+        return this;
     }
 
     /**
@@ -174,17 +186,21 @@ public class QueryEntity implements Serializable {
      * Example: {"parent.name" -> "parentName"}.
      *
      * @param aliases Aliases map.
+     * @return {@code this} for chaining.
      */
-    public void setAliases(Map<String, String> aliases) {
+    public QueryEntity setAliases(Map<String, String> aliases) {
         this.aliases = aliases;
+
+        return this;
     }
 
     /**
      * Sets a collection of index entities.
      *
      * @param idxs Collection of index entities.
+     * @return {@code this} for chaining.
      */
-    public void setIndexes(Collection<QueryIndex> idxs) {
+    public QueryEntity setIndexes(Collection<QueryIndex> idxs) {
         for (QueryIndex idx : idxs) {
             if (!F.isEmpty(idx.getFields())) {
                 if (idx.getName() == null)
@@ -199,6 +215,8 @@ public class QueryEntity implements Serializable {
                     throw new IllegalArgumentException("Duplicate index name: " + idx.getName());
             }
         }
+
+        return this;
     }
 
     /**
@@ -220,8 +238,9 @@ public class QueryEntity implements Serializable {
 
     /**
      * Utility method for building query entities programmatically.
+     * @return {@code this} for chaining.
      */
-    public void addQueryField(String fullName, String type, String alias) {
+    public QueryEntity addQueryField(String fullName, String type, String alias) {
         A.notNull(fullName, "fullName");
         A.notNull(type, "type");
 
@@ -229,6 +248,8 @@ public class QueryEntity implements Serializable {
 
         if (alias != null)
             aliases.put(fullName, alias);
+
+        return this;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java
index 7acb5b4..c406ba6 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java
@@ -196,11 +196,14 @@ public class FairAffinityFunction implements AffinityFunction {
      * Sets total number of partitions.
      *
      * @param parts Total number of partitions.
+     * @return {@code this} for chaining.
      */
-    public void setPartitions(int parts) {
+    public FairAffinityFunction setPartitions(int parts) {
         A.ensure(parts <= CacheConfiguration.MAX_PARTITIONS_COUNT, "parts <= " + CacheConfiguration.MAX_PARTITIONS_COUNT);
 
         this.parts = parts;
+
+        return this;
     }
 
 
@@ -226,10 +229,13 @@ public class FairAffinityFunction implements AffinityFunction {
      *
      * @param backupFilter Optional backup filter.
      * @deprecated Use {@code affinityBackupFilter} instead.
+     * @return {@code this} for chaining.
      */
     @Deprecated
-    public void setBackupFilter(@Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
+    public FairAffinityFunction setBackupFilter(@Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
         this.backupFilter = backupFilter;
+
+        return this;
     }
 
     /**
@@ -253,9 +259,13 @@ public class FairAffinityFunction implements AffinityFunction {
      * Note that {@code affinityBackupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
      *
      * @param affinityBackupFilter Optional backup filter.
+     * @return {@code this} for chaining.
      */
-    public void setAffinityBackupFilter(@Nullable IgniteBiPredicate<ClusterNode, List<ClusterNode>> affinityBackupFilter) {
+    public FairAffinityFunction setAffinityBackupFilter(
+        @Nullable IgniteBiPredicate<ClusterNode, List<ClusterNode>> affinityBackupFilter) {
         this.affinityBackupFilter = affinityBackupFilter;
+
+        return this;
     }
 
     /**
@@ -275,9 +285,12 @@ public class FairAffinityFunction implements AffinityFunction {
      * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
      *
      * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups of each other.
+     * @return {@code this} for chaining.
      */
-    public void setExcludeNeighbors(boolean exclNeighbors) {
+    public FairAffinityFunction setExcludeNeighbors(boolean exclNeighbors) {
         this.exclNeighbors = exclNeighbors;
+
+        return this;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
index 3d21dd5..0fee1af 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
@@ -219,11 +219,14 @@ public class RendezvousAffinityFunction implements AffinityFunction, Externaliza
      * Sets total number of partitions.
      *
      * @param parts Total number of partitions.
+     * @return {@code this} for chaining.
      */
-    public void setPartitions(int parts) {
+    public RendezvousAffinityFunction setPartitions(int parts) {
         A.ensure(parts <= CacheConfiguration.MAX_PARTITIONS_COUNT, "parts <= " + CacheConfiguration.MAX_PARTITIONS_COUNT);
 
         this.parts = parts;
+
+        return this;
     }
 
     /**
@@ -256,10 +259,13 @@ public class RendezvousAffinityFunction implements AffinityFunction, Externaliza
      * @param hashIdRslvr Hash ID resolver.
      *
      * @deprecated Use {@link IgniteConfiguration#setConsistentId(Serializable)} instead.
+     * @return {@code this} for chaining.
      */
     @Deprecated
-    public void setHashIdResolver(AffinityNodeHashResolver hashIdRslvr) {
+    public RendezvousAffinityFunction setHashIdResolver(AffinityNodeHashResolver hashIdRslvr) {
         this.hashIdRslvr = hashIdRslvr;
+
+        return this;
     }
 
     /**
@@ -284,10 +290,14 @@ public class RendezvousAffinityFunction implements AffinityFunction, Externaliza
      *
      * @param backupFilter Optional backup filter.
      * @deprecated Use {@code affinityBackupFilter} instead.
+     * @return {@code this} for chaining.
      */
     @Deprecated
-    public void setBackupFilter(@Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
+    public RendezvousAffinityFunction setBackupFilter(
+        @Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
         this.backupFilter = backupFilter;
+
+        return this;
     }
 
     /**
@@ -311,9 +321,13 @@ public class RendezvousAffinityFunction implements AffinityFunction, Externaliza
      * Note that {@code affinityBackupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
      *
      * @param affinityBackupFilter Optional backup filter.
+     * @return {@code this} for chaining.
      */
-    public void setAffinityBackupFilter(@Nullable IgniteBiPredicate<ClusterNode, List<ClusterNode>> affinityBackupFilter) {
+    public RendezvousAffinityFunction setAffinityBackupFilter(
+        @Nullable IgniteBiPredicate<ClusterNode, List<ClusterNode>> affinityBackupFilter) {
         this.affinityBackupFilter = affinityBackupFilter;
+
+        return this;
     }
 
     /**
@@ -333,9 +347,12 @@ public class RendezvousAffinityFunction implements AffinityFunction, Externaliza
      * Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
      *
      * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups of each other.
+     * @return {@code this} for chaining.
      */
-    public void setExcludeNeighbors(boolean exclNeighbors) {
+    public RendezvousAffinityFunction setExcludeNeighbors(boolean exclNeighbors) {
         this.exclNeighbors = exclNeighbors;
+
+        return this;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/cache/eviction/AbstractEvictionPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/AbstractEvictionPolicy.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/AbstractEvictionPolicy.java
index cf0aa1f..d282f27 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/AbstractEvictionPolicy.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/AbstractEvictionPolicy.java
@@ -122,11 +122,14 @@ public abstract class AbstractEvictionPolicy<K, V> implements EvictionPolicy<K,
 
     /**
      * Sets maximum allowed cache size in bytes.
+     * @return {@code this} for chaining.
      */
-    public void setMaxMemorySize(long maxMemSize) {
+    public AbstractEvictionPolicy<K, V> setMaxMemorySize(long maxMemSize) {
         A.ensure(maxMemSize >= 0, "maxMemSize >= 0");
 
         this.maxMemSize = maxMemSize;
+
+        return this;
     }
 
     /**
@@ -151,11 +154,14 @@ public abstract class AbstractEvictionPolicy<K, V> implements EvictionPolicy<K,
      * Sets maximum allowed size of cache before entry will start getting evicted.
      *
      * @param max Maximum allowed size of cache before entry will start getting evicted.
+     * @return {@code this} for chaining.
      */
-    public void setMaxSize(int max) {
+    public AbstractEvictionPolicy<K, V>  setMaxSize(int max) {
         A.ensure(max >= 0, "max >= 0");
 
         this.max = max;
+
+        return this;
     }
 
     /**
@@ -171,11 +177,14 @@ public abstract class AbstractEvictionPolicy<K, V> implements EvictionPolicy<K,
      * Sets batch size.
      *
      * @param batchSize Batch size.
+     * @return {@code this} for chaining.
      */
-    public void setBatchSize(int batchSize) {
+    public AbstractEvictionPolicy<K, V>  setBatchSize(int batchSize) {
         A.ensure(batchSize > 0, "batchSize > 0");
 
         this.batchSize = batchSize;
+
+        return this;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicy.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicy.java
index f95a588..68495db 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicy.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicy.java
@@ -22,6 +22,7 @@ import java.util.Collections;
 import org.apache.ignite.cache.eviction.AbstractEvictionPolicy;
 import org.apache.ignite.cache.eviction.EvictableEntry;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.mxbean.IgniteMBeanAware;
 import org.jsr166.ConcurrentLinkedDeque8;
 import org.jsr166.ConcurrentLinkedDeque8.Node;
 
@@ -43,7 +44,7 @@ import org.jsr166.ConcurrentLinkedDeque8.Node;
  * table-like data structures. The {@code FIFO} ordering information is
  * maintained by attaching ordering metadata to cache entries.
  */
-public class FifoEvictionPolicy<K, V> extends AbstractEvictionPolicy<K, V> implements FifoEvictionPolicyMBean {
+public class FifoEvictionPolicy<K, V> extends AbstractEvictionPolicy<K, V> implements IgniteMBeanAware {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -83,6 +84,27 @@ public class FifoEvictionPolicy<K, V> extends AbstractEvictionPolicy<K, V> imple
         return queue.sizex();
     }
 
+    /** {@inheritDoc} */
+    @Override public FifoEvictionPolicy<K, V> setMaxMemorySize(long maxMemSize) {
+        super.setMaxMemorySize(maxMemSize);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public FifoEvictionPolicy<K, V> setMaxSize(int max) {
+        super.setMaxSize(max);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public FifoEvictionPolicy<K, V> setBatchSize(int batchSize) {
+        super.setBatchSize(batchSize);
+
+        return this;
+    }
+
     /**
      * Gets read-only view on internal {@code FIFO} queue in proper order.
      *
@@ -167,7 +189,57 @@ public class FifoEvictionPolicy<K, V> extends AbstractEvictionPolicy<K, V> imple
     }
 
     /** {@inheritDoc} */
+    @Override public Object getMBean() {
+        return new FifoEvictionPolicyMBeanImpl();
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(FifoEvictionPolicy.class, this);
     }
+
+    /**
+     * MBean implementation for FifoEvictionPolicy.
+     */
+    private class FifoEvictionPolicyMBeanImpl implements FifoEvictionPolicyMBean {
+        /** {@inheritDoc} */
+        @Override public long getCurrentMemorySize() {
+            return FifoEvictionPolicy.this.getCurrentMemorySize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getCurrentSize() {
+            return FifoEvictionPolicy.this.getCurrentSize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getMaxSize() {
+            return FifoEvictionPolicy.this.getMaxSize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setMaxSize(int max) {
+            FifoEvictionPolicy.this.setMaxSize(max);
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getBatchSize() {
+            return FifoEvictionPolicy.this.getBatchSize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setBatchSize(int batchSize) {
+            FifoEvictionPolicy.this.setBatchSize(batchSize);
+        }
+
+        /** {@inheritDoc} */
+        @Override public long getMaxMemorySize() {
+            return FifoEvictionPolicy.this.getMaxMemorySize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setMaxMemorySize(long maxMemSize) {
+            FifoEvictionPolicy.this.setMaxMemorySize(maxMemSize);
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicyMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicyMBean.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicyMBean.java
index 2615bbf..06f281f 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicyMBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/fifo/FifoEvictionPolicyMBean.java
@@ -74,6 +74,8 @@ public interface FifoEvictionPolicyMBean {
 
     /**
      * Sets maximum allowed cache size in bytes.
+     *
+     * @param maxMemSize Maximum memory size.
      */
     @MXBeanDescription("Set maximum allowed cache size in bytes.")
     public void setMaxMemorySize(long maxMemSize);

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/IgfsPerBlockLruEvictionPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/IgfsPerBlockLruEvictionPolicy.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/IgfsPerBlockLruEvictionPolicy.java
index a82d541..df3c73f 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/IgfsPerBlockLruEvictionPolicy.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/IgfsPerBlockLruEvictionPolicy.java
@@ -33,6 +33,7 @@ import org.apache.ignite.cache.eviction.EvictionPolicy;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.processors.cache.CacheEvictableEntryImpl;
 import org.apache.ignite.internal.processors.igfs.IgfsBlockKey;
+import org.apache.ignite.mxbean.IgniteMBeanAware;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentLinkedDeque8;
 import org.jsr166.ConcurrentLinkedDeque8.Node;
@@ -41,8 +42,8 @@ import org.jsr166.LongAdder8;
 /**
  * IGFS eviction policy which evicts particular blocks.
  */
-public class IgfsPerBlockLruEvictionPolicy implements EvictionPolicy<IgfsBlockKey, byte[]>,
-    IgfsPerBlockLruEvictionPolicyMXBean, Externalizable {
+public class IgfsPerBlockLruEvictionPolicy implements EvictionPolicy<IgfsBlockKey, byte[]>, IgniteMBeanAware,
+    Externalizable {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -237,49 +238,98 @@ public class IgfsPerBlockLruEvictionPolicy implements EvictionPolicy<IgfsBlockKe
             curSize.add(delta);
     }
 
-    /** {@inheritDoc} */
-    @Override public long getMaxSize() {
+    /**
+     * Gets maximum allowed size of all blocks in bytes.
+     *
+     * @return Maximum allowed size of all blocks in bytes.
+     */
+    public long getMaxSize() {
         return maxSize;
     }
 
-    /** {@inheritDoc} */
-    @Override public void setMaxSize(long maxSize) {
+    /**
+     * Sets maximum allowed size of data in all blocks in bytes.
+     *
+     * @param maxSize Maximum allowed size of data in all blocks in bytes.
+     *
+     * @return {@code this} for chaining.
+     */
+    public IgfsPerBlockLruEvictionPolicy setMaxSize(long maxSize) {
         this.maxSize = maxSize;
+
+        return this;
     }
 
-    /** {@inheritDoc} */
-    @Override public int getMaxBlocks() {
+    /**
+     * Gets maximum allowed amount of blocks.
+     *
+     * @return Maximum allowed amount of blocks.
+     */
+    public int getMaxBlocks() {
         return maxBlocks;
     }
 
-    /** {@inheritDoc} */
-    @Override public void setMaxBlocks(int maxBlocks) {
+    /**
+     * Sets maximum allowed amount of blocks.
+     *
+     * @param maxBlocks Maximum allowed amount of blocks.
+     *
+     * @return {@code this} for chaining.
+     */
+    public IgfsPerBlockLruEvictionPolicy setMaxBlocks(int maxBlocks) {
         this.maxBlocks = maxBlocks;
+
+        return this;
     }
 
-    /** {@inheritDoc} */
-    @Override public Collection<String> getExcludePaths() {
+    /**
+     * Gets collection of regex for paths whose blocks must not be evicted.
+     *
+     * @return Collection of regex for paths whose blocks must not be evicted.
+     */
+    public Collection<String> getExcludePaths() {
         return Collections.unmodifiableCollection(excludePaths);
     }
 
-    /** {@inheritDoc} */
-    @Override public void setExcludePaths(@Nullable Collection<String> excludePaths) {
+    /**
+     * Sets collection of regex for paths whose blocks must not be evicted.
+     *
+     * @param excludePaths Collection of regex for paths whose blocks must not be evicted.
+     *
+     * @return {@code this} for chaining.
+     */
+    public IgfsPerBlockLruEvictionPolicy setExcludePaths(@Nullable Collection<String> excludePaths) {
         this.excludePaths = excludePaths;
 
         excludeRecompile.set(true);
+
+        return this;
     }
 
-    /** {@inheritDoc} */
-    @Override public long getCurrentSize() {
+    /**
+     * Gets current size of data in all blocks.
+     *
+     * @return Current size of data in all blocks.
+     */
+    public long getCurrentSize() {
         return curSize.longValue();
     }
 
-    /** {@inheritDoc} */
-    @Override public int getCurrentBlocks() {
+    /**
+     * Gets current amount of blocks.
+     *
+     * @return Current amount of blocks.
+     */
+    public int getCurrentBlocks() {
         return queue.size();
     }
 
     /** {@inheritDoc} */
+    @Override public Object getMBean() {
+        return new IgfsPerBlockLruEvictionPolicyMXBeanImpl();
+    }
+
+    /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         out.writeLong(maxSize);
         out.writeInt(maxBlocks);
@@ -381,4 +431,49 @@ public class IgfsPerBlockLruEvictionPolicy implements EvictionPolicy<IgfsBlockKe
             return size;
         }
     }
+
+    /**
+     * MBean implementation for IgfsPerBlockLruEvictionPolicy.
+     */
+    private class IgfsPerBlockLruEvictionPolicyMXBeanImpl implements IgfsPerBlockLruEvictionPolicyMXBean {
+        /** {@inheritDoc} */
+        @Override public long getMaxSize() {
+            return IgfsPerBlockLruEvictionPolicy.this.getMaxSize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setMaxSize(long maxSize) {
+            IgfsPerBlockLruEvictionPolicy.this.setMaxSize(maxSize);
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getMaxBlocks() {
+            return IgfsPerBlockLruEvictionPolicy.this.getMaxBlocks();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setMaxBlocks(int maxBlocks) {
+            IgfsPerBlockLruEvictionPolicy.this.setMaxBlocks(maxBlocks);
+        }
+
+        /** {@inheritDoc} */
+        @Nullable @Override public Collection<String> getExcludePaths() {
+            return IgfsPerBlockLruEvictionPolicy.this.getExcludePaths();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setExcludePaths(@Nullable Collection<String> excludePaths) {
+            IgfsPerBlockLruEvictionPolicy.this.setExcludePaths(excludePaths);
+        }
+
+        /** {@inheritDoc} */
+        @Override public long getCurrentSize() {
+            return IgfsPerBlockLruEvictionPolicy.this.getCurrentSize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getCurrentBlocks() {
+            return IgfsPerBlockLruEvictionPolicy.this.getCurrentBlocks();
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/cache/eviction/lru/LruEvictionPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/lru/LruEvictionPolicy.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/lru/LruEvictionPolicy.java
index 17835f1..d571e8c 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/lru/LruEvictionPolicy.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/lru/LruEvictionPolicy.java
@@ -22,6 +22,7 @@ import java.util.Collections;
 import org.apache.ignite.cache.eviction.AbstractEvictionPolicy;
 import org.apache.ignite.cache.eviction.EvictableEntry;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.mxbean.IgniteMBeanAware;
 import org.jsr166.ConcurrentLinkedDeque8;
 import org.jsr166.ConcurrentLinkedDeque8.Node;
 
@@ -42,7 +43,7 @@ import org.jsr166.ConcurrentLinkedDeque8.Node;
  * This implementation is very efficient since it is lock-free and does not create any additional table-like
  * data structures. The {@code LRU} ordering information is maintained by attaching ordering metadata to cache entries.
  */
-public class LruEvictionPolicy<K, V> extends AbstractEvictionPolicy<K, V> implements LruEvictionPolicyMBean {
+public class LruEvictionPolicy<K, V> extends AbstractEvictionPolicy<K, V> implements IgniteMBeanAware {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -71,6 +72,27 @@ public class LruEvictionPolicy<K, V> extends AbstractEvictionPolicy<K, V> implem
         return queue.sizex();
     }
 
+    /** {@inheritDoc} */
+    @Override public LruEvictionPolicy<K, V> setMaxMemorySize(long maxMemSize) {
+        super.setMaxMemorySize(maxMemSize);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public LruEvictionPolicy<K, V> setMaxSize(int max) {
+        super.setMaxSize(max);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public LruEvictionPolicy<K, V> setBatchSize(int batchSize) {
+        super.setBatchSize(batchSize);
+
+        return this;
+    }
+
     /**
      * Gets read-only view on internal {@code FIFO} queue in proper order.
      *
@@ -163,7 +185,57 @@ public class LruEvictionPolicy<K, V> extends AbstractEvictionPolicy<K, V> implem
     }
 
     /** {@inheritDoc} */
+    @Override public Object getMBean() {
+        return new LruEvictionPolicyMBeanImpl();
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(LruEvictionPolicy.class, this, "size", getCurrentSize());
     }
+
+    /**
+     * MBean implementation for LruEvictionPolicy.
+     */
+    private class LruEvictionPolicyMBeanImpl implements LruEvictionPolicyMBean {
+        /** {@inheritDoc} */
+        @Override public long getCurrentMemorySize() {
+            return LruEvictionPolicy.this.getCurrentMemorySize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getCurrentSize() {
+            return LruEvictionPolicy.this.getCurrentSize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getMaxSize() {
+            return LruEvictionPolicy.this.getMaxSize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setMaxSize(int max) {
+            LruEvictionPolicy.this.setMaxSize(max);
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getBatchSize() {
+            return LruEvictionPolicy.this.getBatchSize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setBatchSize(int batchSize) {
+            LruEvictionPolicy.this.setBatchSize(batchSize);
+        }
+
+        /** {@inheritDoc} */
+        @Override public long getMaxMemorySize() {
+            return LruEvictionPolicy.this.getMaxMemorySize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setMaxMemorySize(long maxMemSize) {
+            LruEvictionPolicy.this.setMaxMemorySize(maxMemSize);
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/cache/eviction/sorted/SortedEvictionPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/sorted/SortedEvictionPolicy.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/sorted/SortedEvictionPolicy.java
index d0cc975..4b8ac2b 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/sorted/SortedEvictionPolicy.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/sorted/SortedEvictionPolicy.java
@@ -32,6 +32,7 @@ import org.apache.ignite.cache.eviction.AbstractEvictionPolicy;
 import org.apache.ignite.cache.eviction.EvictableEntry;
 import org.apache.ignite.internal.util.GridConcurrentSkipListSet;
 import org.apache.ignite.internal.util.typedef.internal.A;
+import org.apache.ignite.mxbean.IgniteMBeanAware;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.LongAdder8;
 
@@ -58,7 +59,7 @@ import static org.apache.ignite.configuration.CacheConfiguration.DFLT_CACHE_SIZE
  * <p>
  * User defined comparator should implement {@link Serializable} interface.
  */
-public class SortedEvictionPolicy<K, V> extends AbstractEvictionPolicy<K, V> implements SortedEvictionPolicyMBean {
+public class SortedEvictionPolicy<K, V> extends AbstractEvictionPolicy<K, V> implements IgniteMBeanAware {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -122,6 +123,27 @@ public class SortedEvictionPolicy<K, V> extends AbstractEvictionPolicy<K, V> imp
         this.set = new GridConcurrentSkipListSetEx<>(this.comp);
     }
 
+    /** {@inheritDoc} */
+    @Override public SortedEvictionPolicy<K, V> setMaxMemorySize(long maxMemSize) {
+        super.setMaxMemorySize(maxMemSize);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public SortedEvictionPolicy<K, V> setMaxSize(int max) {
+        super.setMaxSize(max);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public SortedEvictionPolicy<K, V> setBatchSize(int batchSize) {
+        super.setBatchSize(batchSize);
+
+        return this;
+    }
+
     /**
      * Gets read-only view of backed queue in proper order.
      *
@@ -210,6 +232,11 @@ public class SortedEvictionPolicy<K, V> extends AbstractEvictionPolicy<K, V> imp
     }
 
     /** {@inheritDoc} */
+    @Override public Object getMBean() {
+        return new SortedEvictionPolicyMBeanImpl();
+    }
+
+    /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         super.writeExternal(out);
 
@@ -401,4 +428,49 @@ public class SortedEvictionPolicy<K, V> extends AbstractEvictionPolicy<K, V> imp
             return e;
         }
     }
+
+    /**
+     * MBean implementation for SortedEvictionPolicy.
+     */
+    private class SortedEvictionPolicyMBeanImpl implements SortedEvictionPolicyMBean {
+        /** {@inheritDoc} */
+        @Override public long getCurrentMemorySize() {
+            return SortedEvictionPolicy.this.getCurrentMemorySize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getCurrentSize() {
+            return SortedEvictionPolicy.this.getCurrentSize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getMaxSize() {
+            return SortedEvictionPolicy.this.getMaxSize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setMaxSize(int max) {
+            SortedEvictionPolicy.this.setMaxSize(max);
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getBatchSize() {
+            return SortedEvictionPolicy.this.getBatchSize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setBatchSize(int batchSize) {
+            SortedEvictionPolicy.this.setBatchSize(batchSize);
+        }
+
+        /** {@inheritDoc} */
+        @Override public long getMaxMemorySize() {
+            return SortedEvictionPolicy.this.getMaxMemorySize();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setMaxMemorySize(long maxMemSize) {
+            SortedEvictionPolicy.this.setMaxMemorySize(maxMemSize);
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/configuration/AtomicConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/AtomicConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/AtomicConfiguration.java
index 6649b5e..573e803 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/AtomicConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/AtomicConfiguration.java
@@ -54,9 +54,12 @@ public class AtomicConfiguration {
 
     /**
      * @param backups Number of backup nodes.
+     * @return {@code this} for chaining.
      */
-    public void setBackups(int backups) {
+    public AtomicConfiguration setBackups(int backups) {
         this.backups = backups;
+
+        return this;
     }
 
     /**
@@ -68,9 +71,12 @@ public class AtomicConfiguration {
 
     /**
      * @param cacheMode Cache mode.
+     * @return {@code this} for chaining.
      */
-    public void setCacheMode(CacheMode cacheMode) {
+    public AtomicConfiguration setCacheMode(CacheMode cacheMode) {
         this.cacheMode = cacheMode;
+
+        return this;
     }
 
     /**
@@ -93,9 +99,12 @@ public class AtomicConfiguration {
      *
      * @param seqReserveSize Atomic sequence reservation size.
      * @see #getAtomicSequenceReserveSize()
+     * @return {@code this} for chaining.
      */
-    public void setAtomicSequenceReserveSize(int seqReserveSize) {
+    public AtomicConfiguration setAtomicSequenceReserveSize(int seqReserveSize) {
         this.seqReserveSize = seqReserveSize;
+
+        return this;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java
index 30d77de..54bfc40 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java
@@ -52,13 +52,16 @@ public class BinaryConfiguration {
      * Sets class names of binary objects explicitly.
      *
      * @param clsNames Class names.
+     * @return {@code this} for chaining.
      */
-    public void setClassNames(Collection<String> clsNames) {
+    public BinaryConfiguration setClassNames(Collection<String> clsNames) {
         if (typeCfgs == null)
             typeCfgs = new ArrayList<>(clsNames.size());
 
         for (String clsName : clsNames)
             typeCfgs.add(new BinaryTypeConfiguration(clsName));
+
+        return this;
     }
 
     /**
@@ -74,9 +77,12 @@ public class BinaryConfiguration {
      * Sets ID mapper.
      *
      * @param idMapper ID mapper.
+     * @return {@code this} for chaining.
      */
-    public void setIdMapper(BinaryIdMapper idMapper) {
+    public BinaryConfiguration setIdMapper(BinaryIdMapper idMapper) {
         this.idMapper = idMapper;
+
+        return this;
     }
 
     /**
@@ -92,9 +98,12 @@ public class BinaryConfiguration {
      * Sets name mapper.
      *
      * @param nameMapper Name mapper.
+     * @return {@code this} for chaining.
      */
-    public void setNameMapper(BinaryNameMapper nameMapper) {
+    public BinaryConfiguration setNameMapper(BinaryNameMapper nameMapper) {
         this.nameMapper = nameMapper;
+
+        return this;
     }
 
     /**
@@ -110,9 +119,12 @@ public class BinaryConfiguration {
      * Sets serializer.
      *
      * @param serializer Serializer.
+     * @return {@code this} for chaining.
      */
-    public void setSerializer(BinarySerializer serializer) {
+    public BinaryConfiguration setSerializer(BinarySerializer serializer) {
         this.serializer = serializer;
+
+        return this;
     }
 
     /**
@@ -128,9 +140,12 @@ public class BinaryConfiguration {
      * Sets type configurations.
      *
      * @param typeCfgs Type configurations.
+     * @return {@code this} for chaining.
      */
-    public void setTypeConfigurations(Collection<BinaryTypeConfiguration> typeCfgs) {
+    public BinaryConfiguration setTypeConfigurations(Collection<BinaryTypeConfiguration> typeCfgs) {
         this.typeCfgs = typeCfgs;
+
+        return this;
     }
 
     /**
@@ -155,9 +170,12 @@ public class BinaryConfiguration {
      * Set whether to write footers in compact form. See {@link #isCompactFooter()} for more info.
      *
      * @param compactFooter Whether to write footers in compact form.
+     * @return {@code this} for chaining.
      */
-    public void setCompactFooter(boolean compactFooter) {
+    public BinaryConfiguration setCompactFooter(boolean compactFooter) {
         this.compactFooter = compactFooter;
+
+        return this;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index a47f07c..c4fc98b 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -40,6 +40,8 @@ import javax.cache.configuration.CompleteConfiguration;
 import javax.cache.configuration.Factory;
 import javax.cache.configuration.MutableConfiguration;
 import javax.cache.expiry.ExpiryPolicy;
+import javax.cache.integration.CacheLoader;
+import javax.cache.integration.CacheWriter;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.CacheAtomicWriteOrderMode;
@@ -940,9 +942,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
      * Sets keep binary in store flag.
      *
      * @param storeKeepBinary Keep binary in store flag.
+     * @return {@code this} for chaining.
      */
-    public void setStoreKeepBinary(boolean storeKeepBinary) {
+    public CacheConfiguration<K, V> setStoreKeepBinary(boolean storeKeepBinary) {
         this.storeKeepBinary = storeKeepBinary;
+
+        return this;
     }
 
     /**
@@ -2474,6 +2479,70 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
     }
 
     /** {@inheritDoc} */
+    @Override public CacheConfiguration<K, V> setStatisticsEnabled(boolean enabled) {
+        super.setStatisticsEnabled(enabled);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheConfiguration<K, V> setManagementEnabled(boolean enabled) {
+        super.setManagementEnabled(enabled);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheConfiguration<K, V> setCacheLoaderFactory(Factory<? extends CacheLoader<K, V>> factory) {
+        super.setCacheLoaderFactory(factory);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheConfiguration<K, V> setCacheWriterFactory(
+        Factory<? extends CacheWriter<? super K, ? super V>> factory) {
+        super.setCacheWriterFactory(factory);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheConfiguration<K, V> setExpiryPolicyFactory(Factory<? extends ExpiryPolicy> factory) {
+        super.setExpiryPolicyFactory(factory);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheConfiguration<K, V> setTypes(Class<K> keyType, Class<V> valueType) {
+        super.setTypes(keyType, valueType);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheConfiguration<K, V> setReadThrough(boolean isReadThrough) {
+        super.setReadThrough(isReadThrough);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheConfiguration<K, V> setWriteThrough(boolean isWriteThrough) {
+        super.setWriteThrough(isWriteThrough);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheConfiguration<K, V> setStoreByValue(boolean isStoreByValue) {
+        super.setStoreByValue(isStoreByValue);
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(CacheConfiguration.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java
index 5ea5074..7b79c58 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java
@@ -68,9 +68,13 @@ public class CollectionConfiguration implements Serializable {
      * @param collocated If {@code true} then all items within the same collection will be collocated on the same node.
      *      Otherwise elements of the same set maybe be cached on different nodes. This parameter works only
      *      collections stored in {@link CacheMode#PARTITIONED} cache.
+     *
+     * @return {@code this} for chaining.
      */
-    public void setCollocated(boolean collocated) {
+    public CollectionConfiguration setCollocated(boolean collocated) {
         this.collocated = collocated;
+
+        return this;
     }
 
     /**
@@ -82,9 +86,12 @@ public class CollectionConfiguration implements Serializable {
 
     /**
      * @param atomicityMode Cache atomicity mode.
+     * @return {@code this} for chaining.
      */
-    public void setAtomicityMode(CacheAtomicityMode atomicityMode) {
+    public CollectionConfiguration setAtomicityMode(CacheAtomicityMode atomicityMode) {
         this.atomicityMode = atomicityMode;
+
+        return this;
     }
 
     /**
@@ -96,9 +103,12 @@ public class CollectionConfiguration implements Serializable {
 
     /**
      * @param cacheMode Cache mode.
+     * @return {@code this} for chaining.
      */
-    public void setCacheMode(CacheMode cacheMode) {
+    public CollectionConfiguration setCacheMode(CacheMode cacheMode) {
         this.cacheMode = cacheMode;
+
+        return this;
     }
 
     /**
@@ -110,9 +120,12 @@ public class CollectionConfiguration implements Serializable {
 
     /**
      * @param memoryMode Memory mode.
+     * @return {@code this} for chaining.
      */
-    public void setMemoryMode(CacheMemoryMode memoryMode) {
+    public CollectionConfiguration setMemoryMode(CacheMemoryMode memoryMode) {
         this.memoryMode = memoryMode;
+
+        return this;
     }
 
     /**
@@ -124,9 +137,12 @@ public class CollectionConfiguration implements Serializable {
 
     /**
      * @param nodeFilter Predicate specifying on which nodes the cache should be started.
+     * @return {@code this} for chaining.
      */
-    public void setNodeFilter(IgnitePredicate<ClusterNode> nodeFilter) {
+    public CollectionConfiguration setNodeFilter(IgnitePredicate<ClusterNode> nodeFilter) {
         this.nodeFilter = nodeFilter;
+
+        return this;
     }
 
     /**
@@ -138,9 +154,12 @@ public class CollectionConfiguration implements Serializable {
 
     /**
      * @param backups Cache number of backups.
+     * @return {@code this} for chaining.
      */
-    public void setBackups(int backups) {
+    public CollectionConfiguration setBackups(int backups) {
         this.backups = backups;
+
+        return this;
     }
 
     /**
@@ -152,9 +171,12 @@ public class CollectionConfiguration implements Serializable {
 
     /**
      * @param offHeapMaxMemory Off-heap memory size.
+     * @return {@code this} for chaining.
      */
-    public void setOffHeapMaxMemory(long offHeapMaxMemory) {
+    public CollectionConfiguration setOffHeapMaxMemory(long offHeapMaxMemory) {
         this.offHeapMaxMem = offHeapMaxMemory;
+
+        return this;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cfc88028/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java
index 6e33b9c..0ee1388 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java
@@ -169,9 +169,12 @@ public class ConnectorConfiguration {
      * accessing Ignite APIs remotely.
      *
      * @param jettyPath Path to {@code JETTY} XML configuration file.
+     * @return {@code this} for chaining.
      */
-    public void setJettyPath(String jettyPath) {
+    public ConnectorConfiguration setJettyPath(String jettyPath) {
         this.jettyPath = jettyPath;
+
+        return this;
     }
 
     /**
@@ -195,9 +198,12 @@ public class ConnectorConfiguration {
      * Sets secret key to authenticate REST requests. If key is {@code null} or empty authentication is disabled.
      *
      * @param secretKey REST secret key.
+     * @return {@code this} for chaining.
      */
-    public void setSecretKey(@Nullable String secretKey) {
+    public ConnectorConfiguration setSecretKey(@Nullable String secretKey) {
         this.secretKey = secretKey;
+
+        return this;
     }
 
     /**
@@ -231,9 +237,12 @@ public class ConnectorConfiguration {
      * Sets host for TCP binary protocol server.
      *
      * @param host TCP host.
+     * @return {@code this} for chaining.
      */
-    public void setHost(String host) {
+    public ConnectorConfiguration setHost(String host) {
         this.host = host;
+
+        return this;
     }
 
     /**
@@ -251,9 +260,12 @@ public class ConnectorConfiguration {
      * Sets port for TCP binary protocol server.
      *
      * @param port TCP port.
+     * @return {@code this} for chaining.
      */
-    public void setPort(int port) {
+    public ConnectorConfiguration setPort(int port) {
         this.port = port;
+
+        return this;
     }
 
     /**
@@ -274,9 +286,12 @@ public class ConnectorConfiguration {
      *
      * @param noDelay {@code True} if option should be enabled.
      * @see #isNoDelay()
+     * @return {@code this} for chaining.
      */
-    public void setNoDelay(boolean noDelay) {
+    public ConnectorConfiguration setNoDelay(boolean noDelay) {
         this.noDelay = noDelay;
+
+        return this;
     }
 
     /**
@@ -296,9 +311,12 @@ public class ConnectorConfiguration {
      *
      * @param directBuf {@code True} if option should be enabled.
      * @see #isDirectBuffer()
+     * @return {@code this} for chaining.
      */
-    public void setDirectBuffer(boolean directBuf) {
+    public ConnectorConfiguration setDirectBuffer(boolean directBuf) {
         this.directBuf = directBuf;
+
+        return this;
     }
 
     /**
@@ -315,9 +333,12 @@ public class ConnectorConfiguration {
      *
      * @param sndBufSize Send buffer size.
      * @see #getSendBufferSize()
+     * @return {@code this} for chaining.
      */
-    public void setSendBufferSize(int sndBufSize) {
+    public ConnectorConfiguration setSendBufferSize(int sndBufSize) {
         this.sndBufSize = sndBufSize;
+
+        return this;
     }
 
     /**
@@ -334,9 +355,12 @@ public class ConnectorConfiguration {
      *
      * @param rcvBufSize Receive buffer size.
      * @see #getReceiveBufferSize()
+     * @return {@code this} for chaining.
      */
-    public void setReceiveBufferSize(int rcvBufSize) {
+    public ConnectorConfiguration setReceiveBufferSize(int rcvBufSize) {
         this.rcvBufSize = rcvBufSize;
+
+        return this;
     }
 
     /**
@@ -354,9 +378,12 @@ public class ConnectorConfiguration {
      *
      * @param sndQueueLimit REST TCP server send queue limit (0 for unlimited).
      * @see #getSendQueueLimit()
+     * @return {@code this} for chaining.
      */
-    public void setSendQueueLimit(int sndQueueLimit) {
+    public ConnectorConfiguration setSendQueueLimit(int sndQueueLimit) {
         this.sndQueueLimit = sndQueueLimit;
+
+        return this;
     }
 
     /**
@@ -374,9 +401,12 @@ public class ConnectorConfiguration {
      *
      * @param selectorCnt Number of selector threads for REST TCP server.
      * @see #getSelectorCount()
+     * @return {@code this} for chaining.
      */
-    public void setSelectorCount(int selectorCnt) {
+    public ConnectorConfiguration setSelectorCount(int selectorCnt) {
         this.selectorCnt = selectorCnt;
+
+        return this;
     }
 
     /**
@@ -396,9 +426,12 @@ public class ConnectorConfiguration {
      *
      * @param idleTimeout Idle timeout in milliseconds.
      * @see #getIdleTimeout()
+     * @return {@code this} for chaining.
      */
-    public void setIdleTimeout(long idleTimeout) {
+    public ConnectorConfiguration setIdleTimeout(long idleTimeout) {
         this.idleTimeout = idleTimeout;
+
+        return this;
     }
 
     /**
@@ -420,9 +453,12 @@ public class ConnectorConfiguration {
      * should be provided in {@link IgniteConfiguration}. Otherwise, TCP binary protocol will fail to start.
      *
      * @param sslEnabled {@code True} if SSL should be enabled.
+     * @return {@code this} for chaining.
      */
-    public void setSslEnabled(boolean sslEnabled) {
+    public ConnectorConfiguration setSslEnabled(boolean sslEnabled) {
         this.sslEnabled = sslEnabled;
+
+        return this;
     }
 
     /**
@@ -439,9 +475,12 @@ public class ConnectorConfiguration {
      * Sets flag indicating whether or not SSL client authentication is required.
      *
      * @param sslClientAuth Whether or not client authentication is required.
+     * @return {@code this} for chaining.
      */
-    public void setSslClientAuth(boolean sslClientAuth) {
+    public ConnectorConfiguration setSslClientAuth(boolean sslClientAuth) {
         this.sslClientAuth = sslClientAuth;
+
+        return this;
     }
 
     /**
@@ -463,10 +502,13 @@ public class ConnectorConfiguration {
      *
      * @param sslCtxFactory Instance of {@link GridSslContextFactory}
      * @deprecated Use {@link #setSslFactory(Factory)} instead.
+     * @return {@code this} for chaining.
      */
     @Deprecated
-    public void setSslContextFactory(GridSslContextFactory sslCtxFactory) {
+    public ConnectorConfiguration setSslContextFactory(GridSslContextFactory sslCtxFactory) {
         this.sslCtxFactory = sslCtxFactory;
+
+        return this;
     }
 
     /**
@@ -485,9 +527,12 @@ public class ConnectorConfiguration {
      * {@link #setSslEnabled(boolean)} is set to {@code true}.
      *
      * @param sslFactory Instance of {@link Factory}
+     * @return {@code this} for chaining.
      */
-    public void setSslFactory(Factory<SSLContext> sslFactory) {
+    public ConnectorConfiguration setSslFactory(Factory<SSLContext> sslFactory) {
         this.sslFactory = sslFactory;
+
+        return this;
     }
 
     /**
@@ -506,9 +551,12 @@ public class ConnectorConfiguration {
      * Sets number of ports to try if configured one is in use.
      *
      * @param portRange Port range.
+     * @return {@code this} for chaining.
      */
-    public void setPortRange(int portRange) {
+    public ConnectorConfiguration setPortRange(int portRange) {
         this.portRange = portRange;
+
+        return this;
     }
 
     /**
@@ -527,9 +575,12 @@ public class ConnectorConfiguration {
      *
      * @param threadPoolSize Thread pool size to use for processing of client messages.
      * @see #getThreadPoolSize()
+     * @return {@code this} for chaining.
      */
-    public void setThreadPoolSize(int threadPoolSize) {
+    public ConnectorConfiguration setThreadPoolSize(int threadPoolSize) {
         this.threadPoolSize = threadPoolSize;
+
+        return this;
     }
 
     /**
@@ -559,9 +610,12 @@ public class ConnectorConfiguration {
      * access them from java code directly.
      *
      * @param interceptor Interceptor.
+     * @return {@code this} for chaining.
      */
-    public void setMessageInterceptor(ConnectorMessageInterceptor interceptor) {
+    public ConnectorConfiguration setMessageInterceptor(ConnectorMessageInterceptor interceptor) {
         msgInterceptor = interceptor;
+
+        return this;
     }
 
     /**
@@ -569,9 +623,12 @@ public class ConnectorConfiguration {
      *
      * @param idleQryCurTimeout Idle query cursors timeout in milliseconds.
      * @see #getIdleQueryCursorTimeout()
+     * @return {@code this} for chaining.
      */
-    public void setIdleQueryCursorTimeout(long idleQryCurTimeout) {
+    public ConnectorConfiguration setIdleQueryCursorTimeout(long idleQryCurTimeout) {
         this.idleQryCurTimeout = idleQryCurTimeout;
+
+        return this;
     }
 
     /**
@@ -592,9 +649,12 @@ public class ConnectorConfiguration {
      *
      * @param idleQryCurCheckFreq Idle query check frequency in milliseconds.
      * @see #getIdleQueryCursorCheckFrequency()
+     * @return {@code this} for chaining.
      */
-    public void setIdleQueryCursorCheckFrequency(long idleQryCurCheckFreq) {
+    public ConnectorConfiguration setIdleQueryCursorCheckFrequency(long idleQryCurCheckFreq) {
         this.idleQryCurCheckFreq = idleQryCurCheckFreq;
+
+        return this;
     }
 
     /**


Mime
View raw message