You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/06/09 08:33:11 UTC
[22/24] incubator-ignite git commit: ignite-545: merge from
ignite-sprint-6
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/core/src/main/java/org/apache/ignite/IgniteServices.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteServices.java b/modules/core/src/main/java/org/apache/ignite/IgniteServices.java
index f800085..7d1ca7c 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteServices.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteServices.java
@@ -126,10 +126,7 @@ import java.util.*;
* ...
* GridServices svcs = grid.services();
*
- * GridFuture<?> fut = svcs.deployClusterSingleton("mySingleton", new MyGridService());
- *
- * // Wait for deployment to complete.
- * fut.get();
+ * svcs.deployClusterSingleton("mySingleton", new MyGridService());
* </pre>
*/
public interface IgniteServices extends IgniteAsyncSupport {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/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 4931bdd..df6b2ee 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
@@ -175,7 +175,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
/** Eviction key buffer size. */
private int evictKeyBufSize = DFLT_EVICT_KEY_BUFFER_SIZE;
- /** Synchronous eviction timeout. */
+ /** Synchronous eviction concurrency level. */
private int evictSyncConcurrencyLvl = DFLT_EVICT_SYNCHRONIZED_CONCURRENCY_LEVEL;
/** Synchronous eviction timeout. */
@@ -417,11 +417,14 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets cache name.
*
* @param name Cache name. May be <tt>null</tt>, but may not be empty string.
+ * @return {@code this} for chaining.
*/
- public void setName(String name) {
+ public CacheConfiguration setName(String name) {
A.ensure(name == null || !name.isEmpty(), "Name cannot be null or empty.");
this.name = name;
+
+ return this;
}
/**
@@ -439,9 +442,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets cache eviction policy.
*
* @param evictPlc Cache expiration policy.
+ * @return {@code this} for chaining.
*/
- public void setEvictionPolicy(@Nullable EvictionPolicy evictPlc) {
+ public CacheConfiguration setEvictionPolicy(@Nullable EvictionPolicy evictPlc) {
this.evictPlc = evictPlc;
+
+ return this;
}
/**
@@ -453,9 +459,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
/**
* @param nearCfg Near cache configuration.
+ * @return {@code this} for chaining.
*/
- public void setNearConfiguration(NearCacheConfiguration<K, V> nearCfg) {
+ public CacheConfiguration setNearConfiguration(NearCacheConfiguration<K, V> nearCfg) {
this.nearCfg = nearCfg;
+
+ return this;
}
/**
@@ -472,9 +481,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets write synchronization mode.
*
* @param writeSync Write synchronization mode.
+ * @return {@code this} for chaining.
*/
- public void setWriteSynchronizationMode(CacheWriteSynchronizationMode writeSync) {
+ public CacheConfiguration setWriteSynchronizationMode(CacheWriteSynchronizationMode writeSync) {
this.writeSync = writeSync;
+
+ return this;
}
/**
@@ -490,9 +502,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets filter which determines on what nodes the cache should be started.
*
* @param nodeFilter Predicate specifying on which nodes the cache should be started.
+ * @return {@code this} for chaining.
*/
- public void setNodeFilter(IgnitePredicate<ClusterNode> nodeFilter) {
+ public CacheConfiguration setNodeFilter(IgnitePredicate<ClusterNode> nodeFilter) {
this.nodeFilter = nodeFilter;
+
+ return this;
}
/**
@@ -519,9 +534,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* (or the rest of the nodes for replicated cache).
*
* @param evictSync {@code true} if synchronized, {@code false} if not.
+ * @return {@code this} for chaining.
*/
- public void setEvictSynchronized(boolean evictSync) {
+ public CacheConfiguration setEvictSynchronized(boolean evictSync) {
this.evictSync = evictSync;
+
+ return this;
}
/**
@@ -539,9 +557,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets eviction key buffer size.
*
* @param evictKeyBufSize Eviction key buffer size.
+ * @return {@code this} for chaining.
*/
- public void setEvictSynchronizedKeyBufferSize(int evictKeyBufSize) {
+ public CacheConfiguration setEvictSynchronizedKeyBufferSize(int evictKeyBufSize) {
this.evictKeyBufSize = evictKeyBufSize;
+
+ return this;
}
/**
@@ -570,9 +591,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets concurrency level for synchronized evictions.
*
* @param evictSyncConcurrencyLvl Concurrency level for synchronized evictions.
+ * @return {@code this} for chaining.
*/
- public void setEvictSynchronizedConcurrencyLevel(int evictSyncConcurrencyLvl) {
+ public CacheConfiguration setEvictSynchronizedConcurrencyLevel(int evictSyncConcurrencyLvl) {
this.evictSyncConcurrencyLvl = evictSyncConcurrencyLvl;
+
+ return this;
}
/**
@@ -593,9 +617,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets timeout for synchronized evictions.
*
* @param evictSyncTimeout Timeout for synchronized evictions.
+ * @return {@code this} for chaining.
*/
- public void setEvictSynchronizedTimeout(long evictSyncTimeout) {
+ public CacheConfiguration setEvictSynchronizedTimeout(long evictSyncTimeout) {
this.evictSyncTimeout = evictSyncTimeout;
+
+ return this;
}
/**
@@ -622,9 +649,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets maximum eviction overflow ratio.
*
* @param evictMaxOverflowRatio Maximum eviction overflow ratio.
+ * @return {@code this} for chaining.
*/
- public void setEvictMaxOverflowRatio(float evictMaxOverflowRatio) {
+ public CacheConfiguration setEvictMaxOverflowRatio(float evictMaxOverflowRatio) {
this.evictMaxOverflowRatio = evictMaxOverflowRatio;
+
+ return this;
}
/**
@@ -648,9 +678,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets eviction filter.
*
* @param evictFilter Eviction filter.
+ * @return {@code this} for chaining.
*/
- public void setEvictionFilter(EvictionFilter<K, V> evictFilter) {
+ public CacheConfiguration setEvictionFilter(EvictionFilter<K, V> evictFilter) {
this.evictFilter = evictFilter;
+
+ return this;
}
/**
@@ -674,9 +707,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
*
* @param eagerTtl {@code True} if Ignite should eagerly remove expired cache entries.
* @see #isEagerTtl()
+ * @return {@code this} for chaining.
*/
- public void setEagerTtl(boolean eagerTtl) {
+ public CacheConfiguration setEagerTtl(boolean eagerTtl) {
this.eagerTtl = eagerTtl;
+
+ return this;
}
/**
@@ -693,9 +729,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Initial size for internal hash map.
*
* @param startSize Cache start size.
+ * @return {@code this} for chaining.
*/
- public void setStartSize(int startSize) {
+ public CacheConfiguration setStartSize(int startSize) {
this.startSize = startSize;
+
+ return this;
}
/**
@@ -734,9 +773,13 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* When not set, default value is {@link #DFLT_LOAD_PREV_VAL}.
*
* @param loadPrevVal Load previous value flag.
+ * @return {@code this} for chaining.
+ * @return {@code this} for chaining.
*/
- public void setLoadPreviousValue(boolean loadPrevVal) {
+ public CacheConfiguration setLoadPreviousValue(boolean loadPrevVal) {
this.loadPrevVal = loadPrevVal;
+
+ return this;
}
/**
@@ -755,8 +798,10 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* @param storeFactory Cache store factory.
*/
@SuppressWarnings("unchecked")
- public void setCacheStoreFactory(Factory<? extends CacheStore<? super K, ? super V>> storeFactory) {
+ public CacheConfiguration setCacheStoreFactory(Factory<? extends CacheStore<? super K, ? super V>> storeFactory) {
this.storeFactory = storeFactory;
+
+ return this;
}
/**
@@ -772,9 +817,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets affinity for cache keys.
*
* @param aff Cache key affinity.
+ * @return {@code this} for chaining.
*/
- public void setAffinity(AffinityFunction aff) {
+ public CacheConfiguration setAffinity(AffinityFunction aff) {
this.aff = aff;
+
+ return this;
}
/**
@@ -792,9 +840,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets caching mode.
*
* @param cacheMode Caching mode.
+ * @return {@code this} for chaining.
*/
- public void setCacheMode(CacheMode cacheMode) {
+ public CacheConfiguration setCacheMode(CacheMode cacheMode) {
this.cacheMode = cacheMode;
+
+ return this;
}
/**
@@ -812,9 +863,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets cache atomicity mode.
*
* @param atomicityMode Cache atomicity mode.
+ * @return {@code this} for chaining.
*/
- public void setAtomicityMode(CacheAtomicityMode atomicityMode) {
+ public CacheConfiguration setAtomicityMode(CacheAtomicityMode atomicityMode) {
this.atomicityMode = atomicityMode;
+
+ return this;
}
/**
@@ -832,9 +886,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* cache (for other atomicity modes it will be ignored).
*
* @param atomicWriteOrderMode Cache write ordering mode.
+ * @return {@code this} for chaining.
*/
- public void setAtomicWriteOrderMode(CacheAtomicWriteOrderMode atomicWriteOrderMode) {
+ public CacheConfiguration setAtomicWriteOrderMode(CacheAtomicWriteOrderMode atomicWriteOrderMode) {
this.atomicWriteOrderMode = atomicWriteOrderMode;
+
+ return this;
}
/**
@@ -854,9 +911,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* If not set, default value is {@link #DFLT_BACKUPS}.
*
* @param backups Number of backup nodes for one partition.
+ * @return {@code this} for chaining.
*/
- public void setBackups(int backups) {
+ public CacheConfiguration setBackups(int backups) {
this.backups = backups;
+
+ return this;
}
/**
@@ -873,9 +933,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets default lock timeout in milliseconds. By default this value is defined by {@link #DFLT_LOCK_TIMEOUT}.
*
* @param dfltLockTimeout Default lock timeout.
+ * @return {@code this} for chaining.
*/
- public void setDefaultLockTimeout(long dfltLockTimeout) {
+ public CacheConfiguration setDefaultLockTimeout(long dfltLockTimeout) {
this.dfltLockTimeout = dfltLockTimeout;
+
+ return this;
}
/**
@@ -891,9 +954,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets invalidation flag for near cache entries in this transaction. Default is {@code false}.
*
* @param invalidate Flag to set this cache into invalidation-based mode. Default value is {@code false}.
+ * @return {@code this} for chaining.
*/
- public void setInvalidate(boolean invalidate) {
+ public CacheConfiguration setInvalidate(boolean invalidate) {
this.invalidate = invalidate;
+
+ return this;
}
/**
@@ -910,18 +976,24 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
*
* @param tmLookupClsName Name of class implementing GridCacheTmLookup interface that is used to
* receive JTA transaction manager.
+ * @return {@code this} for chaining.
*/
- public void setTransactionManagerLookupClassName(String tmLookupClsName) {
+ public CacheConfiguration setTransactionManagerLookupClassName(String tmLookupClsName) {
this.tmLookupClsName = tmLookupClsName;
+
+ return this;
}
/**
* Sets cache rebalance mode.
*
* @param rebalanceMode Rebalance mode.
+ * @return {@code this} for chaining.
*/
- public void setRebalanceMode(CacheRebalanceMode rebalanceMode) {
+ public CacheConfiguration setRebalanceMode(CacheRebalanceMode rebalanceMode) {
this.rebalanceMode = rebalanceMode;
+
+ return this;
}
/**
@@ -959,9 +1031,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
*
* @param rebalanceOrder Cache rebalance order.
* @see #getRebalanceOrder()
+ * @return {@code this} for chaining.
*/
- public void setRebalanceOrder(int rebalanceOrder) {
+ public CacheConfiguration setRebalanceOrder(int rebalanceOrder) {
this.rebalanceOrder = rebalanceOrder;
+
+ return this;
}
/**
@@ -980,9 +1055,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets rebalance batch size.
*
* @param rebalanceBatchSize Rebalance batch size.
+ * @return {@code this} for chaining.
*/
- public void setRebalanceBatchSize(int rebalanceBatchSize) {
+ public CacheConfiguration setRebalanceBatchSize(int rebalanceBatchSize) {
this.rebalanceBatchSize = rebalanceBatchSize;
+
+ return this;
}
/**
@@ -999,9 +1077,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Flag indicating whether swap storage is enabled or not.
*
* @param swapEnabled {@code True} if swap storage is enabled.
+ * @return {@code this} for chaining.
*/
- public void setSwapEnabled(boolean swapEnabled) {
+ public CacheConfiguration setSwapEnabled(boolean swapEnabled) {
this.swapEnabled = swapEnabled;
+
+ return this;
}
/**
@@ -1025,9 +1106,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
*
* @param maxConcurrentAsyncOps Maximum number of concurrent asynchronous operations.
* @see #getMaxConcurrentAsyncOperations()
+ * @return {@code this} for chaining.
*/
- public void setMaxConcurrentAsyncOperations(int maxConcurrentAsyncOps) {
+ public CacheConfiguration setMaxConcurrentAsyncOperations(int maxConcurrentAsyncOps) {
this.maxConcurrentAsyncOps = maxConcurrentAsyncOps;
+
+ return this;
}
/**
@@ -1045,9 +1129,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets flag indicating whether write-behind is enabled.
*
* @param writeBehindEnabled {@code true} if write-behind is enabled.
+ * @return {@code this} for chaining.
*/
- public void setWriteBehindEnabled(boolean writeBehindEnabled) {
+ public CacheConfiguration setWriteBehindEnabled(boolean writeBehindEnabled) {
this.writeBehindEnabled = writeBehindEnabled;
+
+ return this;
}
/**
@@ -1070,9 +1157,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
*
* @param writeBehindFlushSize Write-behind cache flush size.
* @see #getWriteBehindFlushSize()
+ * @return {@code this} for chaining.
*/
- public void setWriteBehindFlushSize(int writeBehindFlushSize) {
+ public CacheConfiguration setWriteBehindFlushSize(int writeBehindFlushSize) {
this.writeBehindFlushSize = writeBehindFlushSize;
+
+ return this;
}
/**
@@ -1096,9 +1186,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
*
* @param writeBehindFlushFreq Write-behind flush frequency in milliseconds.
* @see #getWriteBehindFlushFrequency()
+ * @return {@code this} for chaining.
*/
- public void setWriteBehindFlushFrequency(long writeBehindFlushFreq) {
+ public CacheConfiguration setWriteBehindFlushFrequency(long writeBehindFlushFreq) {
this.writeBehindFlushFreq = writeBehindFlushFreq;
+
+ return this;
}
/**
@@ -1120,9 +1213,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
*
* @param writeBehindFlushThreadCnt Count of flush threads.
* @see #getWriteBehindFlushThreadCount()
+ * @return {@code this} for chaining.
*/
- public void setWriteBehindFlushThreadCount(int writeBehindFlushThreadCnt) {
+ public CacheConfiguration setWriteBehindFlushThreadCount(int writeBehindFlushThreadCnt) {
this.writeBehindFlushThreadCnt = writeBehindFlushThreadCnt;
+
+ return this;
}
/**
@@ -1144,9 +1240,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
*
* @param writeBehindBatchSize Maximum batch size.
* @see #getWriteBehindBatchSize()
+ * @return {@code this} for chaining.
*/
- public void setWriteBehindBatchSize(int writeBehindBatchSize) {
+ public CacheConfiguration setWriteBehindBatchSize(int writeBehindBatchSize) {
this.writeBehindBatchSize = writeBehindBatchSize;
+
+ return this;
}
/**
@@ -1166,9 +1265,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* for rebalancing than specified here (but never less threads).
*
* @param rebalancePoolSize Size of rebalancing thread pool.
+ * @return {@code this} for chaining.
*/
- public void setRebalanceThreadPoolSize(int rebalancePoolSize) {
+ public CacheConfiguration setRebalanceThreadPoolSize(int rebalancePoolSize) {
this.rebalancePoolSize = rebalancePoolSize;
+
+ return this;
}
/**
@@ -1186,9 +1288,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets rebalance timeout (ms).
*
* @param rebalanceTimeout Rebalance timeout (ms).
+ * @return {@code this} for chaining.
*/
- public void setRebalanceTimeout(long rebalanceTimeout) {
+ public CacheConfiguration setRebalanceTimeout(long rebalanceTimeout) {
this.rebalanceTimeout = rebalanceTimeout;
+
+ return this;
}
/**
@@ -1221,9 +1326,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets rebalance delay (see {@link #getRebalanceDelay()} for more information).
*
* @param rebalanceDelay Rebalance delay to set.
+ * @return {@code this} for chaining.
*/
- public void setRebalanceDelay(long rebalanceDelay) {
+ public CacheConfiguration setRebalanceDelay(long rebalanceDelay) {
this.rebalanceDelay = rebalanceDelay;
+
+ return this;
}
/**
@@ -1254,9 +1362,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
*
* @param rebalanceThrottle Time in milliseconds to wait between rebalance messages to avoid overloading of CPU,
* {@code 0} to disable throttling.
+ * @return {@code this} for chaining.
*/
- public void setRebalanceThrottle(long rebalanceThrottle) {
+ public CacheConfiguration setRebalanceThrottle(long rebalanceThrottle) {
this.rebalanceThrottle = rebalanceThrottle;
+
+ return this;
}
/**
@@ -1278,9 +1389,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* described in {@link AffinityKeyMapper} documentation.
*
* @param affMapper Affinity mapper.
+ * @return {@code this} for chaining.
*/
- public void setAffinityMapper(AffinityKeyMapper affMapper) {
+ public CacheConfiguration setAffinityMapper(AffinityKeyMapper affMapper) {
this.affMapper = affMapper;
+
+ return this;
}
/**
@@ -1322,9 +1436,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* off-heap space without affecting JVM performance at all.
*
* @param offHeapMaxMem Maximum memory in bytes available to off-heap memory space.
+ * @return {@code this} for chaining.
*/
- public void setOffHeapMaxMemory(long offHeapMaxMem) {
+ public CacheConfiguration setOffHeapMaxMemory(long offHeapMaxMem) {
this.offHeapMaxMem = offHeapMaxMem;
+
+ return this;
}
/**
@@ -1343,9 +1460,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets memory mode for cache.
*
* @param memMode Memory mode.
+ * @return {@code this} for chaining.
*/
- public void setMemoryMode(CacheMemoryMode memMode) {
+ public CacheConfiguration setMemoryMode(CacheMemoryMode memMode) {
this.memMode = memMode;
+
+ return this;
}
/**
@@ -1362,9 +1482,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets cache interceptor.
*
* @param interceptor Cache interceptor.
+ * @return {@code this} for chaining.
*/
- public void setInterceptor(CacheInterceptor<K, V> interceptor) {
+ public CacheConfiguration setInterceptor(CacheInterceptor<K, V> interceptor) {
this.interceptor = interceptor;
+
+ return this;
}
/**
@@ -1380,9 +1503,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets collection of type metadata objects.
*
* @param typeMeta Collection of type metadata.
+ * @return {@code this} for chaining.
*/
- public void setTypeMetadata(Collection<CacheTypeMetadata> typeMeta) {
+ public CacheConfiguration setTypeMetadata(Collection<CacheTypeMetadata> typeMeta) {
this.typeMeta = typeMeta;
+
+ return this;
}
/**
@@ -1402,9 +1528,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets read from backup flag.
*
* @param readFromBackup {@code true} to allow reads from backups.
+ * @return {@code this} for chaining.
*/
- public void setReadFromBackup(boolean readFromBackup) {
+ public CacheConfiguration setReadFromBackup(boolean readFromBackup) {
this.readFromBackup = readFromBackup;
+
+ return this;
}
/**
@@ -1423,9 +1552,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
*
* @param cpOnRead Copy on get flag.
* @see #isCopyOnRead
+ * @return {@code this} for chaining.
*/
- public void setCopyOnRead(boolean cpOnRead) {
+ public CacheConfiguration setCopyOnRead(boolean cpOnRead) {
this.cpOnRead = cpOnRead;
+
+ return this;
}
/**
@@ -1433,9 +1565,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* to be used as user-defined functions from SQL queries.
*
* @param cls One or more classes with SQL functions.
+ * @return {@code this} for chaining.
*/
- public void setSqlFunctionClasses(Class<?>... cls) {
+ public CacheConfiguration setSqlFunctionClasses(Class<?>... cls) {
this.sqlFuncCls = cls;
+
+ return this;
}
/**
@@ -1461,9 +1596,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Gets timeout in milliseconds after which long query warning will be printed.
*
* @param longQryWarnTimeout Timeout in milliseconds.
+ * @return {@code this} for chaining.
*/
- public void setLongQueryWarningTimeout(long longQryWarnTimeout) {
+ public CacheConfiguration setLongQueryWarningTimeout(long longQryWarnTimeout) {
this.longQryWarnTimeout = longQryWarnTimeout;
+
+ return this;
}
/**
@@ -1483,9 +1621,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* also allows having special characters in table and field names.
*
* @param sqlEscapeAll Flag value.
+ * @return {@code this} for chaining.
*/
- public void setSqlEscapeAll(boolean sqlEscapeAll) {
+ public CacheConfiguration setSqlEscapeAll(boolean sqlEscapeAll) {
this.sqlEscapeAll = sqlEscapeAll;
+
+ return this;
}
/**
@@ -1517,19 +1658,22 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* from package {@link org.apache.ignite.cache.query.annotations}.
*
* @param indexedTypes Key and value type pairs.
+ * @return {@code this} for chaining.
*/
- public void setIndexedTypes(Class<?>... indexedTypes) {
+ public CacheConfiguration setIndexedTypes(Class<?>... indexedTypes) {
A.ensure(indexedTypes == null || (indexedTypes.length & 1) == 0,
"Number of indexed types is expected to be even. Refer to method javadoc for details.");
this.indexedTypes = indexedTypes;
+
+ return this;
}
/**
* Number of SQL rows which will be cached onheap to avoid deserialization on each SQL index access.
* This setting only makes sense when offheap is enabled for this cache.
*
- * @return size Cache size.
+ * @return Cache size.
* @see #setOffHeapMaxMemory(long)
*/
public int getSqlOnheapRowCacheSize() {
@@ -1542,9 +1686,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
*
* @param size Cache size.
* @see #setOffHeapMaxMemory(long)
+ * @return {@code this} for chaining.
*/
- public void setSqlOnheapRowCacheSize(int size) {
+ public CacheConfiguration setSqlOnheapRowCacheSize(int size) {
this.sqlOnheapRowCacheSize = size;
+
+ return this;
}
/**
@@ -1560,9 +1707,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets cache plugin configurations.
*
* @param pluginCfgs Cache plugin configurations.
+ * @return {@code this} for chaining.
*/
- public void setPluginConfigurations(CachePluginConfiguration... pluginCfgs) {
+ public CacheConfiguration setPluginConfigurations(CachePluginConfiguration... pluginCfgs) {
this.pluginCfgs = pluginCfgs;
+
+ return this;
}
/**
@@ -1576,9 +1726,12 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
/**
* Sets topology validator.
* @param topValidator validator.
+ * @return {@code this} for chaining.
*/
- public void setTopologyValidator(TopologyValidator topValidator) {
+ public CacheConfiguration setTopologyValidator(TopologyValidator topValidator) {
this.topValidator = topValidator;
+
+ return this;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
index 76f3043..ebe2b8e 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
@@ -533,9 +533,12 @@ public class IgniteConfiguration {
* or in-memory data grid storage.
*
* @param daemon Daemon flag.
+ * @return {@code this} for chaining.
*/
- public void setDaemon(boolean daemon) {
+ public IgniteConfiguration setDaemon(boolean daemon) {
this.daemon = daemon;
+
+ return this;
}
/**
@@ -543,9 +546,12 @@ public class IgniteConfiguration {
*
* @param gridName Grid name to set. Can be {@code null}, which is default
* grid name.
+ * @return {@code this} for chaining.
*/
- public void setGridName(String gridName) {
+ public IgniteConfiguration setGridName(String gridName) {
this.gridName = gridName;
+
+ return this;
}
/**
@@ -577,9 +583,12 @@ public class IgniteConfiguration {
*
* @param userAttrs User attributes for this node.
* @see IgniteConfiguration#getUserAttributes()
+ * @return {@code this} for chaining.
*/
- public void setUserAttributes(Map<String, ?> userAttrs) {
+ public IgniteConfiguration setUserAttributes(Map<String, ?> userAttrs) {
this.userAttrs = userAttrs;
+
+ return this;
}
/**
@@ -598,9 +607,12 @@ public class IgniteConfiguration {
*
* @param log Logger to use within grid.
* @see IgniteConfiguration#getGridLogger()
+ * @return {@code this} for chaining.
*/
- public void setGridLogger(IgniteLogger log) {
+ public IgniteConfiguration setGridLogger(IgniteLogger log) {
this.log = log;
+
+ return this;
}
/**
@@ -715,9 +727,12 @@ public class IgniteConfiguration {
*
* @param poolSize Thread pool size to use within grid.
* @see IgniteConfiguration#getPublicThreadPoolSize()
+ * @return {@code this} for chaining.
*/
- public void setPublicThreadPoolSize(int poolSize) {
+ public IgniteConfiguration setPublicThreadPoolSize(int poolSize) {
pubPoolSize = poolSize;
+
+ return this;
}
/**
@@ -725,9 +740,12 @@ public class IgniteConfiguration {
*
* @param poolSize Thread pool size to use within grid.
* @see IgniteConfiguration#getSystemThreadPoolSize()
+ * @return {@code this} for chaining.
*/
- public void setSystemThreadPoolSize(int poolSize) {
+ public IgniteConfiguration setSystemThreadPoolSize(int poolSize) {
sysPoolSize = poolSize;
+
+ return this;
}
/**
@@ -735,9 +753,12 @@ public class IgniteConfiguration {
*
* @param poolSize Thread pool size to use within grid.
* @see IgniteConfiguration#getManagementThreadPoolSize()
+ * @return {@code this} for chaining.
*/
- public void setManagementThreadPoolSize(int poolSize) {
+ public IgniteConfiguration setManagementThreadPoolSize(int poolSize) {
mgmtPoolSize = poolSize;
+
+ return this;
}
/**
@@ -745,9 +766,12 @@ public class IgniteConfiguration {
*
* @param poolSize Thread pool size to use within grid.
* @see IgniteConfiguration#getPeerClassLoadingThreadPoolSize()
+ * @return {@code this} for chaining.
*/
- public void setPeerClassLoadingThreadPoolSize(int poolSize) {
+ public IgniteConfiguration setPeerClassLoadingThreadPoolSize(int poolSize) {
p2pPoolSize = poolSize;
+
+ return this;
}
/**
@@ -755,9 +779,12 @@ public class IgniteConfiguration {
*
* @param poolSize Executor service to use for outgoing IGFS messages.
* @see IgniteConfiguration#getIgfsThreadPoolSize()
+ * @return {@code this} for chaining.
*/
- public void setIgfsThreadPoolSize(int poolSize) {
+ public IgniteConfiguration setIgfsThreadPoolSize(int poolSize) {
igfsPoolSize = poolSize;
+
+ return this;
}
/**
@@ -766,9 +793,12 @@ public class IgniteConfiguration {
* @param poolSize Default executor service size to use for utility cache messages.
* @see IgniteConfiguration#getUtilityCacheThreadPoolSize()
* @see IgniteConfiguration#getUtilityCacheKeepAliveTime()
+ * @return {@code this} for chaining.
*/
- public void setUtilityCachePoolSize(int poolSize) {
+ public IgniteConfiguration setUtilityCachePoolSize(int poolSize) {
utilityCachePoolSize = poolSize;
+
+ return this;
}
/**
@@ -777,9 +807,12 @@ public class IgniteConfiguration {
* @param keepAliveTime Keep alive time of executor service to use for utility cache messages.
* @see IgniteConfiguration#getUtilityCacheThreadPoolSize()
* @see IgniteConfiguration#getUtilityCacheKeepAliveTime()
+ * @return {@code this} for chaining.
*/
- public void setUtilityCacheKeepAliveTime(long keepAliveTime) {
+ public IgniteConfiguration setUtilityCacheKeepAliveTime(long keepAliveTime) {
utilityCacheKeepAliveTime = keepAliveTime;
+
+ return this;
}
/**
@@ -788,9 +821,12 @@ public class IgniteConfiguration {
* @param poolSize Default executor service size to use for marshaller messages.
* @see IgniteConfiguration#getMarshallerCacheThreadPoolSize()
* @see IgniteConfiguration#getMarshallerCacheKeepAliveTime()
+ * @return {@code this} for chaining.
*/
- public void setMarshallerCachePoolSize(int poolSize) {
+ public IgniteConfiguration setMarshallerCachePoolSize(int poolSize) {
marshCachePoolSize = poolSize;
+
+ return this;
}
/**
@@ -799,9 +835,12 @@ public class IgniteConfiguration {
* @param keepAliveTime Keep alive time of executor service to use for marshaller messages.
* @see IgniteConfiguration#getMarshallerCacheThreadPoolSize()
* @see IgniteConfiguration#getMarshallerCacheKeepAliveTime()
+ * @return {@code this} for chaining.
*/
- public void setMarshallerCacheKeepAliveTime(long keepAliveTime) {
+ public IgniteConfiguration setMarshallerCacheKeepAliveTime(long keepAliveTime) {
marshCacheKeepAliveTime = keepAliveTime;
+
+ return this;
}
/**
@@ -824,9 +863,12 @@ public class IgniteConfiguration {
* @param ggHome {@code Ignition} installation folder.
* @see IgniteConfiguration#getIgniteHome()
* @see IgniteSystemProperties#IGNITE_HOME
+ * @return {@code this} for chaining.
*/
- public void setIgniteHome(String ggHome) {
+ public IgniteConfiguration setIgniteHome(String ggHome) {
this.ggHome = ggHome;
+
+ return this;
}
/**
@@ -849,9 +891,12 @@ public class IgniteConfiguration {
*
* @param ggWork {@code Ignite} work folder.
* @see IgniteConfiguration#getWorkDirectory()
+ * @return {@code this} for chaining.
*/
- public void setWorkDirectory(String ggWork) {
+ public IgniteConfiguration setWorkDirectory(String ggWork) {
this.ggWork = ggWork;
+
+ return this;
}
/**
@@ -869,9 +914,12 @@ public class IgniteConfiguration {
* Sets initialized and started MBean server.
*
* @param mbeanSrv Initialized and started MBean server.
+ * @return {@code this} for chaining.
*/
- public void setMBeanServer(MBeanServer mbeanSrv) {
+ public IgniteConfiguration setMBeanServer(MBeanServer mbeanSrv) {
this.mbeanSrv = mbeanSrv;
+
+ return this;
}
/**
@@ -888,9 +936,12 @@ public class IgniteConfiguration {
*
* @param nodeId Unique identifier for local node.
* @see IgniteConfiguration#getNodeId()
+ * @return {@code this} for chaining.
*/
- public void setNodeId(UUID nodeId) {
+ public IgniteConfiguration setNodeId(UUID nodeId) {
this.nodeId = nodeId;
+
+ return this;
}
/**
@@ -909,9 +960,12 @@ public class IgniteConfiguration {
*
* @param marsh Marshaller to use within grid.
* @see IgniteConfiguration#getMarshaller()
+ * @return {@code this} for chaining.
*/
- public void setMarshaller(Marshaller marsh) {
+ public IgniteConfiguration setMarshaller(Marshaller marsh) {
this.marsh = marsh;
+
+ return this;
}
@@ -949,9 +1003,12 @@ public class IgniteConfiguration {
* Sets marshal local jobs flag.
*
* @param marshLocJobs {@code True} if local jobs should be marshalled.
+ * @return {@code this} for chaining.
*/
- public void setMarshalLocalJobs(boolean marshLocJobs) {
+ public IgniteConfiguration setMarshalLocalJobs(boolean marshLocJobs) {
this.marshLocJobs = marshLocJobs;
+
+ return this;
}
/**
@@ -959,9 +1016,12 @@ public class IgniteConfiguration {
*
* @param p2pEnabled {@code true} if peer class loading is
* enabled, {@code false} otherwise.
+ * @return {@code this} for chaining.
*/
- public void setPeerClassLoadingEnabled(boolean p2pEnabled) {
+ public IgniteConfiguration setPeerClassLoadingEnabled(boolean p2pEnabled) {
this.p2pEnabled = p2pEnabled;
+
+ return this;
}
/**
@@ -983,9 +1043,12 @@ public class IgniteConfiguration {
*
* @param p2pLocClsPathExcl List of P2P loaded packages. Package
* name supports '*' at the end like in package import clause.
+ * @return {@code this} for chaining.
*/
- public void setPeerClassLoadingLocalClassPathExclude(String... p2pLocClsPathExcl) {
+ public IgniteConfiguration setPeerClassLoadingLocalClassPathExclude(String... p2pLocClsPathExcl) {
this.p2pLocClsPathExcl = p2pLocClsPathExcl;
+
+ return this;
}
/**
@@ -1007,9 +1070,12 @@ public class IgniteConfiguration {
* @param metricsHistSize Number of metrics kept in history to use for
* metric totals and averages calculations.
* @see #DFLT_METRICS_HISTORY_SIZE
+ * @return {@code this} for chaining.
*/
- public void setMetricsHistorySize(int metricsHistSize) {
+ public IgniteConfiguration setMetricsHistorySize(int metricsHistSize) {
this.metricsHistSize = metricsHistSize;
+
+ return this;
}
/**
@@ -1043,9 +1109,12 @@ public class IgniteConfiguration {
* {@link #DFLT_METRICS_UPDATE_FREQ} is used.
*
* @param metricsUpdateFreq Job metrics update frequency in milliseconds.
+ * @return {@code this} for chaining.
*/
- public void setMetricsUpdateFrequency(long metricsUpdateFreq) {
+ public IgniteConfiguration setMetricsUpdateFrequency(long metricsUpdateFreq) {
this.metricsUpdateFreq = metricsUpdateFreq;
+
+ return this;
}
/**
@@ -1066,9 +1135,12 @@ public class IgniteConfiguration {
*
* @param metricsExpTime The metricsExpTime to set.
* @see #DFLT_METRICS_EXPIRE_TIME
+ * @return {@code this} for chaining.
*/
- public void setMetricsExpireTime(long metricsExpTime) {
+ public IgniteConfiguration setMetricsExpireTime(long metricsExpTime) {
this.metricsExpTime = metricsExpTime;
+
+ return this;
}
/**
@@ -1092,9 +1164,12 @@ public class IgniteConfiguration {
*
* @param netTimeout Maximum timeout for network requests.
* @see #DFLT_NETWORK_TIMEOUT
+ * @return {@code this} for chaining.
*/
- public void setNetworkTimeout(long netTimeout) {
+ public IgniteConfiguration setNetworkTimeout(long netTimeout) {
this.netTimeout = netTimeout;
+
+ return this;
}
/**
@@ -1118,9 +1193,12 @@ public class IgniteConfiguration {
* {@link #DFLT_SEND_RETRY_DELAY} is used.
*
* @param sndRetryDelay Interval between message send retries.
+ * @return {@code this} for chaining.
*/
- public void setNetworkSendRetryDelay(long sndRetryDelay) {
+ public IgniteConfiguration setNetworkSendRetryDelay(long sndRetryDelay) {
this.sndRetryDelay = sndRetryDelay;
+
+ return this;
}
/**
@@ -1144,9 +1222,12 @@ public class IgniteConfiguration {
* {@link #DFLT_SEND_RETRY_CNT} is used.
*
* @param sndRetryCnt Message send retries count.
+ * @return {@code this} for chaining.
*/
- public void setNetworkSendRetryCount(int sndRetryCnt) {
+ public IgniteConfiguration setNetworkSendRetryCount(int sndRetryCnt) {
this.sndRetryCnt = sndRetryCnt;
+
+ return this;
}
/**
@@ -1164,9 +1245,12 @@ public class IgniteConfiguration {
* Sets number of samples used for clock synchronization.
*
* @param clockSyncSamples Number of samples.
+ * @return {@code this} for chaining.
*/
- public void setClockSyncSamples(int clockSyncSamples) {
+ public IgniteConfiguration setClockSyncSamples(int clockSyncSamples) {
this.clockSyncSamples = clockSyncSamples;
+
+ return this;
}
/**
@@ -1184,9 +1268,12 @@ public class IgniteConfiguration {
* Sets clock synchronization frequency in milliseconds.
*
* @param clockSyncFreq Clock synchronization frequency.
+ * @return {@code this} for chaining.
*/
- public void setClockSyncFrequency(long clockSyncFreq) {
+ public IgniteConfiguration setClockSyncFrequency(long clockSyncFreq) {
this.clockSyncFreq = clockSyncFreq;
+
+ return this;
}
/**
@@ -1211,9 +1298,12 @@ public class IgniteConfiguration {
*
* @param lifecycleBeans Collection of lifecycle beans.
* @see LifecycleEventType
+ * @return {@code this} for chaining.
*/
- public void setLifecycleBeans(LifecycleBean... lifecycleBeans) {
+ public IgniteConfiguration setLifecycleBeans(LifecycleBean... lifecycleBeans) {
this.lifecycleBeans = lifecycleBeans;
+
+ return this;
}
/**
@@ -1231,9 +1321,12 @@ public class IgniteConfiguration {
*
* @param evtSpi Fully configured instance of {@link EventStorageSpi}.
* @see IgniteConfiguration#getEventStorageSpi()
+ * @return {@code this} for chaining.
*/
- public void setEventStorageSpi(EventStorageSpi evtSpi) {
+ public IgniteConfiguration setEventStorageSpi(EventStorageSpi evtSpi) {
this.evtSpi = evtSpi;
+
+ return this;
}
/**
@@ -1251,9 +1344,12 @@ public class IgniteConfiguration {
*
* @param discoSpi Fully configured instance of {@link DiscoverySpi}.
* @see IgniteConfiguration#getDiscoverySpi()
+ * @return {@code this} for chaining.
*/
- public void setDiscoverySpi(DiscoverySpi discoSpi) {
+ public IgniteConfiguration setDiscoverySpi(DiscoverySpi discoSpi) {
this.discoSpi = discoSpi;
+
+ return this;
}
/**
@@ -1269,9 +1365,12 @@ public class IgniteConfiguration {
* Sets segmentation policy.
*
* @param segPlc Segmentation policy.
+ * @return {@code this} for chaining.
*/
- public void setSegmentationPolicy(SegmentationPolicy segPlc) {
+ public IgniteConfiguration setSegmentationPolicy(SegmentationPolicy segPlc) {
this.segPlc = segPlc;
+
+ return this;
}
/**
@@ -1293,9 +1392,12 @@ public class IgniteConfiguration {
* Sets wait for segment on start flag.
*
* @param waitForSegOnStart {@code True} to wait for segment on start.
+ * @return {@code this} for chaining.
*/
- public void setWaitForSegmentOnStart(boolean waitForSegOnStart) {
+ public IgniteConfiguration setWaitForSegmentOnStart(boolean waitForSegOnStart) {
this.waitForSegOnStart = waitForSegOnStart;
+
+ return this;
}
/**
@@ -1320,9 +1422,12 @@ public class IgniteConfiguration {
*
* @param allResolversPassReq {@code True} if all segmentation resolvers should
* succeed for node to be in the correct segment.
+ * @return {@code this} for chaining.
*/
- public void setAllSegmentationResolversPassRequired(boolean allResolversPassReq) {
+ public IgniteConfiguration setAllSegmentationResolversPassRequired(boolean allResolversPassReq) {
this.allResolversPassReq = allResolversPassReq;
+
+ return this;
}
/**
@@ -1341,9 +1446,12 @@ public class IgniteConfiguration {
* Sets segmentation resolve attempts count.
*
* @param segResolveAttempts Segmentation resolve attempts.
+ * @return {@code this} for chaining.
*/
- public void setSegmentationResolveAttempts(int segResolveAttempts) {
+ public IgniteConfiguration setSegmentationResolveAttempts(int segResolveAttempts) {
this.segResolveAttempts = segResolveAttempts;
+
+ return this;
}
/**
@@ -1362,9 +1470,12 @@ public class IgniteConfiguration {
* Sets segmentation resolvers.
*
* @param segResolvers Segmentation resolvers.
+ * @return {@code this} for chaining.
*/
- public void setSegmentationResolvers(SegmentationResolver... segResolvers) {
+ public IgniteConfiguration setSegmentationResolvers(SegmentationResolver... segResolvers) {
this.segResolvers = segResolvers;
+
+ return this;
}
/**
@@ -1385,9 +1496,12 @@ public class IgniteConfiguration {
* Sets network segment check frequency.
*
* @param segChkFreq Segment check frequency.
+ * @return {@code this} for chaining.
*/
- public void setSegmentCheckFrequency(long segChkFreq) {
+ public IgniteConfiguration setSegmentCheckFrequency(long segChkFreq) {
this.segChkFreq = segChkFreq;
+
+ return this;
}
/**
@@ -1405,9 +1519,12 @@ public class IgniteConfiguration {
*
* @param commSpi Fully configured instance of {@link CommunicationSpi}.
* @see IgniteConfiguration#getCommunicationSpi()
+ * @return {@code this} for chaining.
*/
- public void setCommunicationSpi(CommunicationSpi commSpi) {
+ public IgniteConfiguration setCommunicationSpi(CommunicationSpi commSpi) {
this.commSpi = commSpi;
+
+ return this;
}
/**
@@ -1430,9 +1547,12 @@ public class IgniteConfiguration {
* @param colSpi Fully configured instance of {@link CollisionSpi} or
* {@code null} if no SPI provided.
* @see IgniteConfiguration#getCollisionSpi()
+ * @return {@code this} for chaining.
*/
- public void setCollisionSpi(CollisionSpi colSpi) {
+ public IgniteConfiguration setCollisionSpi(CollisionSpi colSpi) {
this.colSpi = colSpi;
+
+ return this;
}
/**
@@ -1450,9 +1570,12 @@ public class IgniteConfiguration {
*
* @param deploySpi Fully configured instance of {@link DeploymentSpi}.
* @see IgniteConfiguration#getDeploymentSpi()
+ * @return {@code this} for chaining.
*/
- public void setDeploymentSpi(DeploymentSpi deploySpi) {
+ public IgniteConfiguration setDeploymentSpi(DeploymentSpi deploySpi) {
this.deploySpi = deploySpi;
+
+ return this;
}
/**
@@ -1470,9 +1593,12 @@ public class IgniteConfiguration {
*
* @param cpSpi Fully configured instance of {@link CheckpointSpi}.
* @see IgniteConfiguration#getCheckpointSpi()
+ * @return {@code this} for chaining.
*/
- public void setCheckpointSpi(CheckpointSpi... cpSpi) {
+ public IgniteConfiguration setCheckpointSpi(CheckpointSpi... cpSpi) {
this.cpSpi = cpSpi;
+
+ return this;
}
/**
@@ -1491,9 +1617,12 @@ public class IgniteConfiguration {
* @param failSpi Fully configured instance of {@link FailoverSpi} or
* {@code null} if no SPI provided.
* @see IgniteConfiguration#getFailoverSpi()
+ * @return {@code this} for chaining.
*/
- public void setFailoverSpi(FailoverSpi... failSpi) {
+ public IgniteConfiguration setFailoverSpi(FailoverSpi... failSpi) {
this.failSpi = failSpi;
+
+ return this;
}
/**
@@ -1533,9 +1662,12 @@ public class IgniteConfiguration {
*
* @param discoStartupDelay Time in milliseconds for when nodes
* can be out-of-sync during startup.
+ * @return {@code this} for chaining.
*/
- public void setDiscoveryStartupDelay(long discoStartupDelay) {
+ public IgniteConfiguration setDiscoveryStartupDelay(long discoStartupDelay) {
this.discoStartupDelay = discoStartupDelay;
+
+ return this;
}
/**
@@ -1544,9 +1676,12 @@ public class IgniteConfiguration {
* @param loadBalancingSpi Fully configured instance of {@link LoadBalancingSpi} or
* {@code null} if no SPI provided.
* @see IgniteConfiguration#getLoadBalancingSpi()
+ * @return {@code this} for chaining.
*/
- public void setLoadBalancingSpi(LoadBalancingSpi... loadBalancingSpi) {
+ public IgniteConfiguration setLoadBalancingSpi(LoadBalancingSpi... loadBalancingSpi) {
this.loadBalancingSpi = loadBalancingSpi;
+
+ return this;
}
/**
@@ -1555,9 +1690,12 @@ public class IgniteConfiguration {
* @param swapSpaceSpi Fully configured instances of {@link SwapSpaceSpi} or
* <tt>null</tt> if no SPI provided.
* @see IgniteConfiguration#getSwapSpaceSpi()
+ * @return {@code this} for chaining.
*/
- public void setSwapSpaceSpi(SwapSpaceSpi swapSpaceSpi) {
+ public IgniteConfiguration setSwapSpaceSpi(SwapSpaceSpi swapSpaceSpi) {
this.swapSpaceSpi = swapSpaceSpi;
+
+ return this;
}
/**
@@ -1578,9 +1716,12 @@ public class IgniteConfiguration {
*
* @param indexingSpi Fully configured instance of {@link IndexingSpi}.
* @see IgniteConfiguration#getIndexingSpi()
+ * @return {@code this} for chaining.
*/
- public void setIndexingSpi(IndexingSpi indexingSpi) {
+ public IgniteConfiguration setIndexingSpi(IndexingSpi indexingSpi) {
this.indexingSpi = indexingSpi;
+
+ return this;
}
/**
@@ -1605,18 +1746,24 @@ public class IgniteConfiguration {
* Sets address resolver for addresses mapping determination.
*
* @param addrRslvr Address resolver.
+ * @return {@code this} for chaining.
*/
- public void setAddressResolver(AddressResolver addrRslvr) {
+ public IgniteConfiguration setAddressResolver(AddressResolver addrRslvr) {
this.addrRslvr = addrRslvr;
+
+ return this;
}
/**
* Sets task classes and resources sharing mode.
*
* @param deployMode Task classes and resources sharing mode.
+ * @return {@code this} for chaining.
*/
- public void setDeploymentMode(DeploymentMode deployMode) {
+ public IgniteConfiguration setDeploymentMode(DeploymentMode deployMode) {
this.deployMode = deployMode;
+
+ return this;
}
/**
@@ -1634,9 +1781,12 @@ public class IgniteConfiguration {
* missed resources caching.
*
* @param p2pMissedCacheSize Size of missed resources cache.
+ * @return {@code this} for chaining.
*/
- public void setPeerClassLoadingMissedResourcesCacheSize(int p2pMissedCacheSize) {
+ public IgniteConfiguration setPeerClassLoadingMissedResourcesCacheSize(int p2pMissedCacheSize) {
this.p2pMissedCacheSize = p2pMissedCacheSize;
+
+ return this;
}
/**
@@ -1666,8 +1816,10 @@ public class IgniteConfiguration {
* @param cacheCfg Cache configurations.
*/
@SuppressWarnings({"ZeroLengthArrayAllocation"})
- public void setCacheConfiguration(CacheConfiguration... cacheCfg) {
+ public IgniteConfiguration setCacheConfiguration(CacheConfiguration... cacheCfg) {
this.cacheCfg = cacheCfg == null ? new CacheConfiguration[0] : cacheCfg;
+
+ return this;
}
/**
@@ -1683,9 +1835,12 @@ public class IgniteConfiguration {
* Sets client mode flag.
*
* @param clientMode Client mode flag.
+ * @return {@code this} for chaining.
*/
- public void setClientMode(boolean clientMode) {
+ public IgniteConfiguration setClientMode(boolean clientMode) {
this.clientMode = clientMode;
+
+ return this;
}
/**
@@ -1716,9 +1871,12 @@ public class IgniteConfiguration {
*
* @param cacheSanityCheckEnabled {@code True} if cache sanity check is enabled.
* @see #isCacheSanityCheckEnabled()
+ * @return {@code this} for chaining.
*/
- public void setCacheSanityCheckEnabled(boolean cacheSanityCheckEnabled) {
+ public IgniteConfiguration setCacheSanityCheckEnabled(boolean cacheSanityCheckEnabled) {
this.cacheSanityCheckEnabled = cacheSanityCheckEnabled;
+
+ return this;
}
/**
@@ -1743,9 +1901,12 @@ public class IgniteConfiguration {
* Note, that either the include event types or the exclude event types can be established.
*
* @param inclEvtTypes Include event types.
+ * @return {@code this} for chaining.
*/
- public void setIncludeEventTypes(int... inclEvtTypes) {
+ public IgniteConfiguration setIncludeEventTypes(int... inclEvtTypes) {
this.inclEvtTypes = inclEvtTypes;
+
+ return this;
}
/**
@@ -1753,9 +1914,12 @@ public class IgniteConfiguration {
* override all default local bind settings within Ignite or any of its SPIs.
*
* @param locHost Local IP address or host to bind to.
+ * @return {@code this} for chaining.
*/
- public void setLocalHost(String locHost) {
+ public IgniteConfiguration setLocalHost(String locHost) {
this.locHost = locHost;
+
+ return this;
}
/**
@@ -1791,9 +1955,12 @@ public class IgniteConfiguration {
* Sets time server port base.
*
* @param timeSrvPortBase Time server port base.
+ * @return {@code this} for chaining.
*/
- public void setTimeServerPortBase(int timeSrvPortBase) {
+ public IgniteConfiguration setTimeServerPortBase(int timeSrvPortBase) {
this.timeSrvPortBase = timeSrvPortBase;
+
+ return this;
}
/**
@@ -1809,9 +1976,12 @@ public class IgniteConfiguration {
* Sets time server port range.
*
* @param timeSrvPortRange Time server port range.
+ * @return {@code this} for chaining.
*/
- public void setTimeServerPortRange(int timeSrvPortRange) {
+ public IgniteConfiguration setTimeServerPortRange(int timeSrvPortRange) {
this.timeSrvPortRange = timeSrvPortRange;
+
+ return this;
}
/**
@@ -1832,9 +2002,12 @@ public class IgniteConfiguration {
* See {@link #getIncludeProperties()} for more info.
*
* @param includeProps Array of system or environment property names to include into node attributes.
+ * @return {@code this} for chaining.
*/
- public void setIncludeProperties(String... includeProps) {
+ public IgniteConfiguration setIncludeProperties(String... includeProps) {
this.includeProps = includeProps;
+
+ return this;
}
/**
@@ -1858,9 +2031,12 @@ public class IgniteConfiguration {
* If not provided, then default value {@link #DFLT_METRICS_LOG_FREQ} is used.
*
* @param metricsLogFreq Frequency of metrics log print out.
+ * @return {@code this} for chaining.
*/
- public void setMetricsLogFrequency(long metricsLogFreq) {
+ public IgniteConfiguration setMetricsLogFrequency(long metricsLogFreq) {
this.metricsLogFreq = metricsLogFreq;
+
+ return this;
}
/**
@@ -1876,9 +2052,12 @@ public class IgniteConfiguration {
* Sets IGFS (Ignite In-Memory File System) configurations.
*
* @param igfsCfg IGFS configurations.
+ * @return {@code this} for chaining.
*/
- public void setFileSystemConfiguration(FileSystemConfiguration... igfsCfg) {
+ public IgniteConfiguration setFileSystemConfiguration(FileSystemConfiguration... igfsCfg) {
this.igfsCfg = igfsCfg;
+
+ return this;
}
/**
@@ -1894,9 +2073,12 @@ public class IgniteConfiguration {
* Sets hadoop configuration.
*
* @param hadoopCfg Hadoop configuration.
+ * @return {@code this} for chaining.
*/
- public void setHadoopConfiguration(HadoopConfiguration hadoopCfg) {
+ public IgniteConfiguration setHadoopConfiguration(HadoopConfiguration hadoopCfg) {
this.hadoopCfg = hadoopCfg;
+
+ return this;
}
/**
@@ -1908,9 +2090,12 @@ public class IgniteConfiguration {
/**
* @param connectorCfg Connector configuration.
+ * @return {@code this} for chaining.
*/
- public void setConnectorConfiguration(ConnectorConfiguration connectorCfg) {
+ public IgniteConfiguration setConnectorConfiguration(ConnectorConfiguration connectorCfg) {
this.connectorCfg = connectorCfg;
+
+ return this;
}
/**
@@ -1926,9 +2111,12 @@ public class IgniteConfiguration {
* Sets configurations for services to be deployed on the grid.
*
* @param svcCfgs Configurations for services to be deployed on the grid.
+ * @return {@code this} for chaining.
*/
- public void setServiceConfiguration(ServiceConfiguration... svcCfgs) {
+ public IgniteConfiguration setServiceConfiguration(ServiceConfiguration... svcCfgs) {
this.svcCfgs = svcCfgs;
+
+ return this;
}
/**
@@ -1947,9 +2135,12 @@ public class IgniteConfiguration {
* Each listener is mapped to array of event types.
*
* @param lsnrs Pre-configured event listeners map.
+ * @return {@code this} for chaining.
*/
- public void setLocalEventListeners(Map<IgnitePredicate<? extends Event>, int[]> lsnrs) {
+ public IgniteConfiguration setLocalEventListeners(Map<IgnitePredicate<? extends Event>, int[]> lsnrs) {
this.lsnrs = lsnrs;
+
+ return this;
}
/**
@@ -1967,9 +2158,12 @@ public class IgniteConfiguration {
*
* @param warmupClos Warmup closure to execute.
* @see #getWarmupClosure()
+ * @return {@code this} for chaining.
*/
- public void setWarmupClosure(IgniteInClosure<IgniteConfiguration> warmupClos) {
+ public IgniteConfiguration setWarmupClosure(IgniteInClosure<IgniteConfiguration> warmupClos) {
this.warmupClos = warmupClos;
+
+ return this;
}
/**
@@ -1985,9 +2179,12 @@ public class IgniteConfiguration {
* Sets transactions configuration.
*
* @param txCfg Transactions configuration.
+ * @return {@code this} for chaining.
*/
- public void setTransactionConfiguration(TransactionConfiguration txCfg) {
+ public IgniteConfiguration setTransactionConfiguration(TransactionConfiguration txCfg) {
this.txCfg = txCfg;
+
+ return this;
}
/**
@@ -1999,9 +2196,12 @@ public class IgniteConfiguration {
/**
* @param pluginCfgs Plugin configurations.
+ * @return {@code this} for chaining.
*/
- public void setPluginConfigurations(PluginConfiguration... pluginCfgs) {
+ public IgniteConfiguration setPluginConfigurations(PluginConfiguration... pluginCfgs) {
this.pluginCfgs = pluginCfgs;
+
+ return this;
}
/**
@@ -2013,9 +2213,12 @@ public class IgniteConfiguration {
/**
* @param atomicCfg Atomic data structures configuration.
+ * @return {@code this} for chaining.
*/
- public void setAtomicConfiguration(AtomicConfiguration atomicCfg) {
+ public IgniteConfiguration setAtomicConfiguration(AtomicConfiguration atomicCfg) {
this.atomicCfg = atomicCfg;
+
+ return this;
}
/**
@@ -2024,9 +2227,12 @@ public class IgniteConfiguration {
* {@link ExpiryPolicy ExpiryPolicys}).
*
* @param classLdr Class loader.
+ * @return {@code this} for chaining.
*/
- public void setClassLoader(ClassLoader classLdr) {
+ public IgniteConfiguration setClassLoader(ClassLoader classLdr) {
this.classLdr = classLdr;
+
+ return this;
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/core/src/main/java/org/apache/ignite/internal/GridDirectCollection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridDirectCollection.java b/modules/core/src/main/java/org/apache/ignite/internal/GridDirectCollection.java
index 61144d6..58c1c29 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridDirectCollection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridDirectCollection.java
@@ -17,10 +17,13 @@
package org.apache.ignite.internal;
+import org.apache.ignite.plugin.extensions.communication.*;
+
import java.lang.annotation.*;
/**
* Annotates iterable fields.
+ * Note that for any {@link Message} implementations it is enough to set item type to {@code Message.class}.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
index c60646e..505204d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal;
import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.events.*;
+import org.apache.ignite.internal.interop.*;
import org.apache.ignite.internal.managers.deployment.*;
import org.apache.ignite.internal.managers.discovery.*;
import org.apache.ignite.internal.managers.eventstorage.*;
@@ -124,6 +125,9 @@ class GridEventConsumeHandler implements GridContinuousHandler {
if (filter != null)
ctx.resource().injectGeneric(filter);
+ if (filter instanceof InteropAwareEventFilter)
+ ((InteropAwareEventFilter)filter).initialize(ctx);
+
final boolean loc = nodeId.equals(ctx.localNodeId());
lsnr = new GridLocalEventListener() {
@@ -188,6 +192,28 @@ class GridEventConsumeHandler implements GridContinuousHandler {
if (lsnr != null)
ctx.event().removeLocalEventListener(lsnr, types);
+
+ RuntimeException err = null;
+
+ try {
+ if (filter instanceof InteropAwareEventFilter)
+ ((InteropAwareEventFilter)filter).close();
+ }
+ catch(RuntimeException ex) {
+ err = ex;
+ }
+
+ try {
+ if (cb instanceof InteropLocalEventListener)
+ ((InteropLocalEventListener)cb).close();
+ }
+ catch (RuntimeException ex) {
+ if (err == null)
+ err = ex;
+ }
+
+ if (err != null)
+ throw err;
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/core/src/main/java/org/apache/ignite/internal/GridUpdateNotifier.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridUpdateNotifier.java b/modules/core/src/main/java/org/apache/ignite/internal/GridUpdateNotifier.java
index 8210025..dc22128 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridUpdateNotifier.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridUpdateNotifier.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.internal.util.worker.*;
+import org.apache.ignite.plugin.*;
import org.jetbrains.annotations.*;
import org.w3c.dom.*;
import org.xml.sax.*;
@@ -28,6 +29,7 @@ import org.xml.sax.*;
import javax.xml.parsers.*;
import java.io.*;
import java.net.*;
+import java.util.*;
import java.util.concurrent.*;
import static java.net.URLEncoder.*;
@@ -57,6 +59,9 @@ class GridUpdateNotifier {
/** Latest version. */
private volatile String latestVer;
+ /** Download url for latest version. */
+ private volatile String downloadUrl;
+
/** HTML parsing helper. */
private final DocumentBuilder documentBuilder;
@@ -72,6 +77,8 @@ class GridUpdateNotifier {
/** System properties */
private final String vmProps;
+ private final Map<String, String> pluginVers;
+
/** Kernal gateway */
private final GridKernalGateway gw;
@@ -83,12 +90,13 @@ class GridUpdateNotifier {
*
* @param gridName gridName
* @param ver Compound Ignite version.
- * @param reportOnlyNew Whether or not to report only new version.
* @param gw Kernal gateway.
+ * @param pluginProviders Kernal gateway.
+ * @param reportOnlyNew Whether or not to report only new version.
* @throws IgniteCheckedException If failed.
*/
- GridUpdateNotifier(String gridName, String ver, GridKernalGateway gw, boolean reportOnlyNew)
- throws IgniteCheckedException {
+ GridUpdateNotifier(String gridName, String ver, GridKernalGateway gw, Collection<PluginProvider> pluginProviders,
+ boolean reportOnlyNew) throws IgniteCheckedException {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
@@ -108,9 +116,15 @@ class GridUpdateNotifier {
url = "http://tiny.cc/updater/update_status_ignite.php";
this.gridName = gridName == null ? "null" : gridName;
- this.reportOnlyNew = reportOnlyNew;
this.gw = gw;
+ pluginVers = U.newHashMap(pluginProviders.size());
+
+ for (PluginProvider provider : pluginProviders)
+ pluginVers.put(provider.name() + "-plugin-version", provider.version());
+
+ this.reportOnlyNew = reportOnlyNew;
+
vmProps = getSystemProperties();
}
catch (ParserConfigurationException e) {
@@ -197,6 +211,9 @@ class GridUpdateNotifier {
U.cancel(checker);
String latestVer = this.latestVer;
+ String downloadUrl = this.downloadUrl;
+
+ downloadUrl = downloadUrl != null ? downloadUrl : IgniteKernal.SITE;
if (latestVer != null)
if (latestVer.equals(ver)) {
@@ -204,7 +221,7 @@ class GridUpdateNotifier {
throttle(log, false, "Your version is up to date.");
}
else
- throttle(log, true, "New version is available at " + IgniteKernal.SITE + ": " + latestVer);
+ throttle(log, true, "New version is available at " + downloadUrl + ": " + latestVer);
else
if (!reportOnlyNew)
throttle(log, false, "Update status is not available.");
@@ -262,12 +279,18 @@ class GridUpdateNotifier {
try {
String stackTrace = gw != null ? gw.userStackTrace() : null;
+ SB plugins = new SB();
+
+ for (Map.Entry<String, String> p : pluginVers.entrySet())
+ plugins.a("&").a(p.getKey()).a("=").a(encode(p.getValue(), CHARSET));
+
String postParams =
"gridName=" + encode(gridName, CHARSET) +
(!F.isEmpty(UPD_STATUS_PARAMS) ? "&" + UPD_STATUS_PARAMS : "") +
(topSize > 0 ? "&topSize=" + topSize : "") +
(!F.isEmpty(stackTrace) ? "&stackTrace=" + encode(stackTrace, CHARSET) : "") +
- (!F.isEmpty(vmProps) ? "&vmProps=" + encode(vmProps, CHARSET) : "");
+ (!F.isEmpty(vmProps) ? "&vmProps=" + encode(vmProps, CHARSET) : "") +
+ plugins.toString();
URLConnection conn = new URL(url).openConnection();
@@ -311,8 +334,11 @@ class GridUpdateNotifier {
log.debug("Failed to connect to Ignite update server. " + e.getMessage());
}
- if (dom != null)
+ if (dom != null) {
latestVer = obtainVersionFrom(dom);
+
+ downloadUrl = obtainDownloadUrlFrom(dom);
+ }
}
}
catch (Exception e) {
@@ -327,7 +353,7 @@ class GridUpdateNotifier {
* @param node W3C DOM node.
* @return Version or {@code null} if one's not found.
*/
- @Nullable private String obtainVersionFrom(Node node) {
+ @Nullable private String obtainMeta(String metaName, Node node) {
assert node != null;
if (node instanceof Element && "meta".equals(node.getNodeName().toLowerCase())) {
@@ -335,7 +361,7 @@ class GridUpdateNotifier {
String name = meta.getAttribute("name");
- if (("version").equals(name)) {
+ if (metaName.equals(name)) {
String content = meta.getAttribute("content");
if (content != null && !content.isEmpty())
@@ -346,7 +372,7 @@ class GridUpdateNotifier {
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
- String ver = obtainVersionFrom(childNodes.item(i));
+ String ver = obtainMeta(metaName, childNodes.item(i));
if (ver != null)
return ver;
@@ -354,5 +380,25 @@ class GridUpdateNotifier {
return null;
}
+
+ /**
+ * Gets the version from the current {@code node}, if one exists.
+ *
+ * @param node W3C DOM node.
+ * @return Version or {@code null} if one's not found.
+ */
+ @Nullable private String obtainVersionFrom(Node node) {
+ return obtainMeta("version", node);
+ }
+
+ /**
+ * Gets the download url from the current {@code node}, if one exists.
+ *
+ * @param node W3C DOM node.
+ * @return download url or {@code null} if one's not found.
+ */
+ @Nullable private String obtainDownloadUrlFrom(Node node) {
+ return obtainMeta("downloadUrl", node);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/core/src/main/java/org/apache/ignite/internal/IgniteComponentType.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteComponentType.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteComponentType.java
index 6ed8a63..4b937b1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteComponentType.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteComponentType.java
@@ -18,6 +18,8 @@
package org.apache.ignite.internal;
import org.apache.ignite.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.plugin.extensions.communication.*;
import org.jetbrains.annotations.*;
import java.lang.reflect.*;
@@ -58,7 +60,8 @@ public enum IgniteComponentType {
INDEXING(
null,
"org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing",
- "ignite-indexing"
+ "ignite-indexing",
+ "org.apache.ignite.internal.processors.query.h2.twostep.msg.GridH2ValueMessageFactory"
),
/** Nodes starting using SSH. */
@@ -91,6 +94,9 @@ public enum IgniteComponentType {
/** Module name. */
private final String module;
+ /** Optional message factory for component. */
+ private final String msgFactoryCls;
+
/**
* Constructor.
*
@@ -99,9 +105,22 @@ public enum IgniteComponentType {
* @param module Module name.
*/
IgniteComponentType(String noOpClsName, String clsName, String module) {
+ this(noOpClsName, clsName, module, null);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param noOpClsName Class name for no-op implementation.
+ * @param clsName Class name.
+ * @param module Module name.
+ * @param msgFactoryCls {@link MessageFactory} class for the component.
+ */
+ IgniteComponentType(String noOpClsName, String clsName, String module, String msgFactoryCls) {
this.noOpClsName = noOpClsName;
this.clsName = clsName;
this.module = module;
+ this.msgFactoryCls = msgFactoryCls;
}
/**
@@ -273,6 +292,21 @@ public enum IgniteComponentType {
}
/**
+ * Creates message factory for the component.
+ *
+ * @return Message factory or {@code null} if none or the component is not in classpath.
+ * @throws IgniteCheckedException If failed.
+ */
+ @Nullable public MessageFactory messageFactory() throws IgniteCheckedException {
+ Class<?> cls;
+
+ if (msgFactoryCls == null || null == (cls = U.classForName(msgFactoryCls, null)))
+ return null;
+
+ return (MessageFactory)U.newInstance(cls);
+ }
+
+ /**
* @param err Creation error.
* @return Component creation exception.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96f0956d/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index d9d0e3d..c4b93b8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -118,7 +118,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
@GridToStringExclude
private GridKernalContextImpl ctx;
- /** */
+ /** Configuration. */
private IgniteConfiguration cfg;
/** */
@@ -221,7 +221,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
/** {@inheritDoc} */
@Override public IgniteCompute compute() {
- return ctx.cluster().get().compute();
+ return ((ClusterGroupAdapter)ctx.cluster().get().forServers()).compute();
}
/** {@inheritDoc} */
@@ -236,7 +236,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
/** {@inheritDoc} */
@Override public IgniteServices services() {
- return ctx.cluster().get().services();
+ return ((ClusterGroupAdapter)ctx.cluster().get().forServers()).services();
}
/** {@inheritDoc} */
@@ -611,22 +611,6 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
boolean notifyEnabled = IgniteSystemProperties.getBoolean(IGNITE_UPDATE_NOTIFIER, true);
- verChecker = null;
-
- if (notifyEnabled) {
- try {
- verChecker = new GridUpdateNotifier(gridName, VER_STR, gw, false);
-
- verChecker.checkForNewVersion(execSvc, log);
- }
- catch (IgniteCheckedException e) {
- if (log.isDebugEnabled())
- log.debug("Failed to create GridUpdateNotifier: " + e);
- }
- }
-
- final GridUpdateNotifier verChecker0 = verChecker;
-
// Ack 3-rd party licenses location.
if (log.isInfoEnabled() && cfg.getIgniteHome() != null)
log.info("3-rd party licenses can be found at: " + cfg.getIgniteHome() + File.separatorChar + "libs" +
@@ -696,6 +680,45 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
startProcessor(new IgnitePluginProcessor(ctx, cfg));
+ verChecker = null;
+
+ if (notifyEnabled) {
+ try {
+ verChecker = new GridUpdateNotifier(gridName, VER_STR, gw, ctx.plugins().allProviders(), false);
+
+ updateNtfTimer = new Timer("ignite-update-notifier-timer");
+
+ // Setup periodic version check.
+ updateNtfTimer.scheduleAtFixedRate(new GridTimerTask() {
+ private boolean first = true;
+
+ @Override public void safeRun() throws InterruptedException {
+ if (!first)
+ verChecker.topologySize(cluster().nodes().size());
+
+ verChecker.checkForNewVersion(execSvc, log);
+
+ // Just wait for 10 secs.
+ Thread.sleep(PERIODIC_VER_CHECK_CONN_TIMEOUT);
+
+ // Report status if one is available.
+ // No-op if status is NOT available.
+ verChecker.reportStatus(log);
+
+ if (first) {
+ first = false;
+
+ verChecker.reportOnlyNew(true);
+ }
+ }
+ }, 0, PERIODIC_VER_CHECK_DELAY);
+ }
+ catch (IgniteCheckedException e) {
+ if (log.isDebugEnabled())
+ log.debug("Failed to create GridUpdateNotifier: " + e);
+ }
+ }
+
// Off-heap processor has no dependencies.
startProcessor(new GridOffHeapProcessor(ctx));
@@ -836,34 +859,6 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
// Mark start timestamp.
startTime = U.currentTimeMillis();
- // Ack latest version information.
- if (verChecker0 != null)
- verChecker0.reportStatus(log);
-
- if (notifyEnabled) {
- assert verChecker0 != null;
-
- verChecker0.reportOnlyNew(true);
-
- updateNtfTimer = new Timer("ignite-update-notifier-timer");
-
- // Setup periodic version check.
- updateNtfTimer.scheduleAtFixedRate(new GridTimerTask() {
- @Override public void safeRun() throws InterruptedException {
- verChecker0.topologySize(cluster().nodes().size());
-
- verChecker0.checkForNewVersion(execSvc, log);
-
- // Just wait for 10 secs.
- Thread.sleep(PERIODIC_VER_CHECK_CONN_TIMEOUT);
-
- // Report status if one is available.
- // No-op if status is NOT available.
- verChecker0.reportStatus(log);
- }
- }, PERIODIC_VER_CHECK_DELAY, PERIODIC_VER_CHECK_DELAY);
- }
-
String intervalStr = IgniteSystemProperties.getString(IGNITE_STARVATION_CHECK_INTERVAL);
// Start starvation checker if enabled.
@@ -2302,7 +2297,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
guard();
try {
- ctx.cache().dynamicStartCache(cacheCfg, cacheCfg.getName(), null, false).get();
+ if (ctx.cache().cache(cacheCfg.getName()) == null)
+ ctx.cache().dynamicStartCache(cacheCfg, cacheCfg.getName(), null, false).get();
return ctx.cache().publicJCache(cacheCfg.getName());
}
@@ -2346,7 +2342,14 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
guard();
try {
- ctx.cache().dynamicStartCache(cacheCfg, cacheCfg.getName(), nearCfg, false).get();
+ IgniteInternalCache<Object, Object> cache = ctx.cache().cache(cacheCfg.getName());
+
+ if (cache == null)
+ ctx.cache().dynamicStartCache(cacheCfg, cacheCfg.getName(), nearCfg, false).get();
+ else {
+ if (cache.configuration().getNearConfiguration() == null)
+ ctx.cache().dynamicStartCache(cacheCfg, cacheCfg.getName(), nearCfg, false).get();
+ }
return ctx.cache().publicJCache(cacheCfg.getName());
}
@@ -2385,7 +2388,14 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
guard();
try {
- ctx.cache().dynamicStartCache(null, cacheName, nearCfg, false).get();
+ IgniteInternalCache<Object, Object> internalCache = ctx.cache().cache(cacheName);
+
+ if (internalCache == null)
+ ctx.cache().dynamicStartCache(null, cacheName, nearCfg, false).get();
+ else {
+ if (internalCache.configuration().getNearConfiguration() == null)
+ ctx.cache().dynamicStartCache(null, cacheName, nearCfg, false).get();
+ }
return ctx.cache().publicJCache(cacheName);
}
@@ -2423,7 +2433,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
guard();
try {
- ctx.cache().getOrCreateFromTemplate(cacheName).get();
+ if (ctx.cache().cache(cacheName) == null)
+ ctx.cache().getOrCreateFromTemplate(cacheName).get();
return ctx.cache().publicJCache(cacheName);
}