You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by se...@apache.org on 2015/06/12 16:24:51 UTC
[01/50] [abbrv] incubator-ignite git commit: [IGNITE-633]: Test
HadoopMapReduceEmbeddedSelfTest.testWholeMapReduceExecution sometimes hangs
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-484-1 a7229dcba -> d8825fd71
[IGNITE-633]: Test HadoopMapReduceEmbeddedSelfTest.testWholeMapReduceExecution sometimes hangs
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/593d8620
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/593d8620
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/593d8620
Branch: refs/heads/ignite-484-1
Commit: 593d8620e0482befceafcf9ce8014ed9adb09326
Parents: 8018af4
Author: iveselovskiy <iv...@gridgain.com>
Authored: Wed Jun 10 15:34:03 2015 +0300
Committer: iveselovskiy <iv...@gridgain.com>
Committed: Wed Jun 10 15:34:03 2015 +0300
----------------------------------------------------------------------
.../processors/hadoop/HadoopMapReduceTest.java | 21 ++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/593d8620/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java
index a1ef7ba..66c14b5 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java
@@ -132,9 +132,14 @@ public class HadoopMapReduceTest extends HadoopAbstractWordCountTest {
IgfsPath inFile = new IgfsPath(inDir, HadoopWordCount2.class.getSimpleName() + "-input");
- generateTestFile(inFile.toString(), "red", 100000, "blue", 200000, "green", 150000, "yellow", 70000 );
+ final int red = 10_000;
+ final int blue = 20_000;
+ final int green = 15_000;
+ final int yellow = 7_000;
- for (int i = 0; i < 8; i++) {
+ generateTestFile(inFile.toString(), "red", red, "blue", blue, "green", green, "yellow", yellow );
+
+ for (int i = 0; i < 3; i++) {
igfs.delete(new IgfsPath(PATH_OUTPUT), true);
boolean useNewMapper = (i & 1) == 0;
@@ -185,13 +190,13 @@ public class HadoopMapReduceTest extends HadoopAbstractWordCountTest {
checkOwner(new IgfsPath(outFile));
assertEquals("Use new mapper: " + useNewMapper + ", new combiner: " + useNewCombiner + ", new reducer: " +
- useNewReducer,
- "blue\t200000\n" +
- "green\t150000\n" +
- "red\t100000\n" +
- "yellow\t70000\n",
+ useNewReducer,
+ "blue\t" + blue + "\n" +
+ "green\t" + green + "\n" +
+ "red\t" + red + "\n" +
+ "yellow\t" + yellow + "\n",
readAndSortFile(outFile)
- );
+ );
}
}
[17/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: merge
from ignite-sprint-5
Posted by se...@apache.org.
ignite-sprint-6: merge from ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a5d007e3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a5d007e3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a5d007e3
Branch: refs/heads/ignite-484-1
Commit: a5d007e323af2d6619c11fb698992c8020d5eefa
Parents: d4b9731
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu Jun 11 12:34:49 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu Jun 11 12:34:49 2015 +0300
----------------------------------------------------------------------
DEVNOTES.txt | 6 +
assembly/dependencies-fabric.xml | 1 +
examples/pom.xml | 34 ++
modules/core/pom.xml | 1 -
.../apache/ignite/IgniteSystemProperties.java | 3 +
.../apache/ignite/cache/query/ScanQuery.java | 45 +-
.../configuration/CacheConfiguration.java | 1 -
.../affinity/GridAffinityAssignmentCache.java | 5 +-
.../processors/cache/GridCacheAdapter.java | 15 +-
.../GridCachePartitionExchangeManager.java | 2 +-
.../processors/cache/GridCacheProcessor.java | 30 +-
.../processors/cache/GridCacheSwapManager.java | 55 ++-
.../processors/cache/IgniteCacheProxy.java | 11 +-
.../processors/cache/QueryCursorImpl.java | 23 +-
.../distributed/dht/GridDhtLocalPartition.java | 7 +
.../processors/cache/query/CacheQuery.java | 2 +-
.../query/GridCacheDistributedQueryManager.java | 3 +
.../cache/query/GridCacheQueryAdapter.java | 147 ++++++-
.../cache/query/GridCacheQueryManager.java | 209 ++++++----
.../cache/query/GridCacheQueryRequest.java | 47 ++-
.../processors/cache/query/QueryCursorEx.java | 8 +
.../datastructures/GridCacheSetImpl.java | 4 +-
.../processors/query/GridQueryIndexing.java | 4 +-
.../processors/query/GridQueryProcessor.java | 18 +-
.../service/GridServiceProcessor.java | 2 +-
.../ignite/internal/util/GridJavaProcess.java | 2 +-
.../ignite/internal/util/IgniteUtils.java | 4 +-
.../shmem/IpcSharedMemoryClientEndpoint.java | 2 +-
.../ipc/shmem/IpcSharedMemoryNativeLoader.java | 151 ++++++-
.../shmem/IpcSharedMemoryServerEndpoint.java | 2 +-
.../util/nio/GridShmemCommunicationClient.java | 146 +++++++
.../communication/tcp/TcpCommunicationSpi.java | 415 ++++++++++++++++++-
.../tcp/TcpCommunicationSpiMBean.java | 8 +
.../cache/GridCacheAbstractFullApiSelfTest.java | 15 +
.../cache/IgniteDynamicCacheStartSelfTest.java | 19 +
.../distributed/IgniteCacheManyClientsTest.java | 169 ++++++++
.../IgniteCacheMessageRecoveryAbstractTest.java | 1 +
...achePartitionedPreloadLifecycleSelfTest.java | 2 +-
...CacheReplicatedPreloadLifecycleSelfTest.java | 6 +-
.../GridCacheSwapScanQueryAbstractSelfTest.java | 112 +++--
.../ipc/shmem/IgfsSharedMemoryTestServer.java | 2 +
.../IpcSharedMemoryCrashDetectionSelfTest.java | 2 +-
.../ipc/shmem/IpcSharedMemorySpaceSelfTest.java | 2 +-
.../ipc/shmem/IpcSharedMemoryUtilsSelfTest.java | 2 +-
.../LoadWithCorruptedLibFileTestRunner.java | 2 +-
.../IpcSharedMemoryBenchmarkReader.java | 2 +-
.../IpcSharedMemoryBenchmarkWriter.java | 2 +-
.../communication/GridIoManagerBenchmark0.java | 1 +
.../spi/GridTcpSpiForwardingSelfTest.java | 1 +
.../GridTcpCommunicationSpiAbstractTest.java | 13 +
...mmunicationSpiConcurrentConnectSelfTest.java | 4 +-
...cpCommunicationSpiMultithreadedSelfTest.java | 21 +-
...pCommunicationSpiMultithreadedShmemTest.java | 28 ++
...dTcpCommunicationSpiRecoveryAckSelfTest.java | 1 +
...GridTcpCommunicationSpiRecoverySelfTest.java | 1 +
.../GridTcpCommunicationSpiShmemSelfTest.java | 38 ++
.../tcp/GridTcpCommunicationSpiTcpSelfTest.java | 7 +
.../testsuites/IgniteCacheTestSuite4.java | 2 +
.../IgniteSpiCommunicationSelfTestSuite.java | 2 +
modules/hadoop/pom.xml | 1 +
.../HadoopIgfs20FileSystemAbstractSelfTest.java | 13 +
...oopSecondaryFileSystemConfigurationTest.java | 14 +
...IgniteHadoopFileSystemHandshakeSelfTest.java | 7 +
.../IgniteHadoopFileSystemIpcCacheSelfTest.java | 7 +
.../hadoop/HadoopAbstractSelfTest.java | 7 +
.../processors/query/h2/IgniteH2Indexing.java | 44 +-
.../h2/twostep/GridReduceQueryExecutor.java | 8 +-
...CacheScanPartitionQueryFallbackSelfTest.java | 408 ++++++++++++++++++
.../cache/GridCacheCrossCacheQuerySelfTest.java | 12 +-
.../cache/IgniteCacheAbstractQuerySelfTest.java | 77 +++-
.../IgniteCacheQuerySelfTestSuite.java | 2 +
modules/scalar-2.10/README.txt | 4 +
modules/scalar-2.10/licenses/apache-2.0.txt | 202 +++++++++
.../scalar-2.10/licenses/scala-bsd-license.txt | 18 +
modules/scalar-2.10/pom.xml | 197 +++++++++
modules/spark-2.10/README.txt | 4 +
modules/spark-2.10/licenses/apache-2.0.txt | 202 +++++++++
.../spark-2.10/licenses/scala-bsd-license.txt | 18 +
modules/spark-2.10/pom.xml | 120 ++++++
modules/spark/README.txt | 8 +
modules/spark/licenses/apache-2.0.txt | 202 +++++++++
modules/spark/licenses/scala-bsd-license.txt | 18 +
modules/spark/pom.xml | 114 +++++
.../org/apache/ignite/spark/IgniteContext.scala | 119 ++++++
.../org/apache/ignite/spark/IgniteRDD.scala | 244 +++++++++++
.../apache/ignite/spark/JavaIgniteContext.scala | 63 +++
.../org/apache/ignite/spark/JavaIgniteRDD.scala | 99 +++++
.../ignite/spark/impl/IgniteAbstractRDD.scala | 39 ++
.../ignite/spark/impl/IgnitePartition.scala | 24 ++
.../ignite/spark/impl/IgniteQueryIterator.scala | 27 ++
.../apache/ignite/spark/impl/IgniteSqlRDD.scala | 41 ++
.../spark/impl/JavaIgniteAbstractRDD.scala | 34 ++
.../ignite/spark/JavaIgniteRDDSelfTest.java | 298 +++++++++++++
.../scala/org/apache/ignite/spark/Entity.scala | 28 ++
.../org/apache/ignite/spark/IgniteRddSpec.scala | 231 +++++++++++
modules/visor-console-2.10/README.txt | 4 +
modules/visor-console-2.10/pom.xml | 174 ++++++++
parent/pom.xml | 4 +
pom.xml | 20 +-
99 files changed, 4773 insertions(+), 253 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/DEVNOTES.txt
----------------------------------------------------------------------
diff --git a/DEVNOTES.txt b/DEVNOTES.txt
index cd72418..d02e6ba 100644
--- a/DEVNOTES.txt
+++ b/DEVNOTES.txt
@@ -3,9 +3,15 @@ Ignite Fabric Maven Build Instructions
Without LGPL dependencies (default):
mvn clean package -DskipTests
+Without LGPL dependencies and Scala 2.10:
+ mvn clean package -DskipTests -Dscala-2.10
+
With LGPL dependencies:
mvn clean package -DskipTests -Prelease,lgpl
+With LGPL dependencies and Scala 2.10:
+ mvn clean package -DskipTests -Prelease,lgpl -Dscala-2.10
+
Look for incubator-ignite-<version>-bin.zip in ./target/bin directory.
NOTE: JDK version should be 1.7.0-* or >= 1.8.0-u40.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/assembly/dependencies-fabric.xml
----------------------------------------------------------------------
diff --git a/assembly/dependencies-fabric.xml b/assembly/dependencies-fabric.xml
index a294243..c6668f6 100644
--- a/assembly/dependencies-fabric.xml
+++ b/assembly/dependencies-fabric.xml
@@ -113,6 +113,7 @@
<exclude>org.apache.ignite:ignite-examples</exclude>
<exclude>org.apache.ignite:ignite-indexing</exclude>
<exclude>org.apache.ignite:ignite-visor-console</exclude>
+ <exclude>org.apache.ignite:ignite-visor-console_2.10</exclude>
<exclude>org.apache.ignite:ignite-visor-plugins</exclude>
<exclude>org.apache.ignite:ignite-visor-trial</exclude>
<exclude>org.apache.ignite:ignite-hadoop</exclude>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 78c5852..a775987 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -173,6 +173,40 @@
</profile>
<profile>
+ <id>scala-2.10</id>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-scalar_2.10</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.scalatest</groupId>
+ <artifactId>scalatest_2.10</artifactId>
+ <version>2.2.2</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>net.alchim31.maven</groupId>
+ <artifactId>scala-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
<id>java8-examples</id>
<activation>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 0460b46..47ed9cb 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -129,7 +129,6 @@
<groupId>org.gridgain</groupId>
<artifactId>ignite-shmem</artifactId>
<version>1.0.0</version>
- <scope>test</scope>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
index 439ea2d..b166f39 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -337,6 +337,9 @@ public final class IgniteSystemProperties {
*/
public static final String IGNITE_SQL_MERGE_TABLE_MAX_SIZE = "IGNITE_SQL_MERGE_TABLE_MAX_SIZE";
+ /** Maximum size for affinity assignment history. */
+ public static final String IGNITE_AFFINITY_HISTORY_SIZE = "IGNITE_AFFINITY_HISTORY_SIZE";
+
/**
* Enforces singleton.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java b/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
index 688eb2e..e6b69bc 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
@@ -36,11 +36,23 @@ public final class ScanQuery<K, V> extends Query<Cache.Entry<K, V>> {
/** */
private IgniteBiPredicate<K, V> filter;
+ /** */
+ private Integer part;
+
/**
* Create scan query returning all entries.
*/
public ScanQuery() {
- this(null);
+ this(null, null);
+ }
+
+ /**
+ * Creates partition scan query returning all entries for given partition.
+ *
+ * @param part Partition.
+ */
+ public ScanQuery(int part) {
+ this(part, null);
}
/**
@@ -49,6 +61,17 @@ public final class ScanQuery<K, V> extends Query<Cache.Entry<K, V>> {
* @param filter Filter. If {@code null} then all entries will be returned.
*/
public ScanQuery(@Nullable IgniteBiPredicate<K, V> filter) {
+ this(null, filter);
+ }
+
+ /**
+ * Create scan query with filter.
+ *
+ * @param part Partition.
+ * @param filter Filter. If {@code null} then all entries will be returned.
+ */
+ public ScanQuery(@Nullable Integer part, @Nullable IgniteBiPredicate<K, V> filter) {
+ setPartition(part);
setFilter(filter);
}
@@ -73,6 +96,26 @@ public final class ScanQuery<K, V> extends Query<Cache.Entry<K, V>> {
return this;
}
+ /**
+ * Gets partition number over which this query should iterate. Will return {@code null} if partition was not
+ * set. In this case query will iterate over all partitions in the cache.
+ *
+ * @return Partition number or {@code null}.
+ */
+ @Nullable public Integer getPartition() {
+ return part;
+ }
+
+ /**
+ * Sets partition number over which this query should iterate. If {@code null}, query will iterate over
+ * all partitions in the cache. Must be in the range [0, N) where N is partition number in the cache.
+ *
+ * @param part Partition number over which this query should iterate.
+ */
+ public void setPartition(@Nullable Integer part) {
+ this.part = part;
+ }
+
/** {@inheritDoc} */
@Override public ScanQuery<K, V> setPageSize(int pageSize) {
return (ScanQuery<K, V>)super.setPageSize(pageSize);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/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 1aa4fd6..a16438c 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
@@ -774,7 +774,6 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
*
* @param loadPrevVal Load previous value flag.
* @return {@code this} for chaining.
- * @return {@code this} for chaining.
*/
public CacheConfiguration setLoadPreviousValue(boolean loadPrevVal) {
this.loadPrevVal = loadPrevVal;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index 47f222e..6989385 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -408,9 +408,10 @@ public class GridAffinityAssignmentCache {
throw new IllegalStateException("Getting affinity for topology version earlier than affinity is " +
"calculated [locNodeId=" + ctx.localNodeId() +
", cache=" + cacheName +
- ", history=" + affCache.keySet() +
", topVer=" + topVer +
- ", head=" + head.get().topologyVersion() + ']');
+ ", head=" + head.get().topologyVersion() +
+ ", history=" + affCache.keySet() +
+ ']');
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index d8d029e..2ca7687 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -1337,8 +1337,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
final Collection<KeyCacheObject> loadedKeys = new GridConcurrentHashSet<>();
- IgniteInternalFuture<Object> readFut =
- readThroughAllAsync(absentKeys, true, skipVals, null, subjId, taskName, new CI2<KeyCacheObject, Object>() {
+ IgniteInternalFuture<Object> readFut = readThroughAllAsync(absentKeys, true, skipVals, null,
+ subjId, taskName, new CI2<KeyCacheObject, Object>() {
/** Version for all loaded entries. */
private GridCacheVersion nextVer = ctx.versions().next();
@@ -1968,7 +1968,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
* @param filter Optional filter.
* @return Put operation future.
*/
- public IgniteInternalFuture<V> getAndPutAsync0(final K key, final V val, @Nullable final CacheEntryPredicate... filter) {
+ public IgniteInternalFuture<V> getAndPutAsync0(final K key, final V val,
+ @Nullable final CacheEntryPredicate... filter) {
A.notNull(key, "key", val, "val");
if (keyCheck)
@@ -3137,7 +3138,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
- @Override public boolean lockAll(@Nullable Collection<? extends K> keys, long timeout) throws IgniteCheckedException {
+ @Override public boolean lockAll(@Nullable Collection<? extends K> keys, long timeout)
+ throws IgniteCheckedException {
if (F.isEmpty(keys))
return true;
@@ -3711,7 +3713,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
if (!ctx0.isSwapOrOffheapEnabled() && ctx0.kernalContext().discovery().size() == 1)
return localIteratorHonorExpirePolicy(opCtx);
- CacheQueryFuture<Map.Entry<K, V>> fut = ctx0.queries().createScanQuery(null, ctx.keepPortable())
+ CacheQueryFuture<Map.Entry<K, V>> fut = ctx0.queries().createScanQuery(null, null, ctx.keepPortable())
.keepAll(false)
.execute();
@@ -3944,7 +3946,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
return t;
}
- catch (IgniteInterruptedCheckedException | IgniteTxHeuristicCheckedException | IgniteTxRollbackCheckedException e) {
+ catch (IgniteInterruptedCheckedException | IgniteTxHeuristicCheckedException |
+ IgniteTxRollbackCheckedException e) {
throw e;
}
catch (IgniteCheckedException e) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 3236bb5..3df45cb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -59,7 +59,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
private static final int EXCHANGE_HISTORY_SIZE = 1000;
/** Cleanup history size. */
- public static final int EXCH_FUT_CLEANUP_HISTORY_SIZE = 10;
+ public static final int EXCH_FUT_CLEANUP_HISTORY_SIZE = getInteger(IGNITE_AFFINITY_HISTORY_SIZE, 100);
/** Atomic reference for pending timeout object. */
private AtomicReference<ResendTimeoutObject> pendingResend = new AtomicReference<>();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 871cd77..5582ba7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -1962,7 +1962,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
req.cacheType(cacheType);
- return F.first(initiateCacheChanges(F.asList(req)));
+ return F.first(initiateCacheChanges(F.asList(req), failIfExists));
}
/**
@@ -1972,14 +1972,16 @@ public class GridCacheProcessor extends GridProcessorAdapter {
public IgniteInternalFuture<?> dynamicStopCache(String cacheName) {
DynamicCacheChangeRequest t = new DynamicCacheChangeRequest(cacheName, ctx.localNodeId(), true);
- return F.first(initiateCacheChanges(F.asList(t)));
+ return F.first(initiateCacheChanges(F.asList(t), false));
}
/**
* @param reqs Requests.
* @return Collection of futures.
*/
- public Collection<DynamicCacheStartFuture> initiateCacheChanges(Collection<DynamicCacheChangeRequest> reqs) {
+ @SuppressWarnings("TypeMayBeWeakened")
+ private Collection<DynamicCacheStartFuture> initiateCacheChanges(Collection<DynamicCacheChangeRequest> reqs,
+ boolean failIfExists) {
Collection<DynamicCacheStartFuture> res = new ArrayList<>(reqs.size());
Collection<DynamicCacheChangeRequest> sndReqs = new ArrayList<>(reqs.size());
@@ -2012,9 +2014,23 @@ public class GridCacheProcessor extends GridProcessorAdapter {
maskNull(req.cacheName()), fut);
if (old != null) {
- if (req.start() && !req.clientStartOnly()) {
- fut.onDone(new CacheExistsException("Failed to start cache " +
- "(a cache with the same name is already being started or stopped): " + req.cacheName()));
+ if (req.start()) {
+ if (!req.clientStartOnly()) {
+ if (failIfExists)
+ fut.onDone(new CacheExistsException("Failed to start cache " +
+ "(a cache with the same name is already being started or stopped): " +
+ req.cacheName()));
+ else {
+ fut = old;
+
+ continue;
+ }
+ }
+ else {
+ fut = old;
+
+ continue;
+ }
}
else {
fut = old;
@@ -2664,7 +2680,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
req.clientStartOnly(true);
- F.first(initiateCacheChanges(F.asList(req))).get();
+ F.first(initiateCacheChanges(F.asList(req), false)).get();
IgniteCacheProxy cache = jCacheProxies.get(masked);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
index 772e849..d0d9049 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
@@ -1251,7 +1251,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
checkIteratorQueue();
if (offHeapEnabled() && !swapEnabled())
- return rawOffHeapIterator(true, true);
+ return rawOffHeapIterator(null, true, true);
if (swapEnabled() && !offHeapEnabled())
return rawSwapIterator(true, true);
@@ -1267,7 +1267,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
private Map.Entry<byte[], byte[]> cur;
{
- it = rawOffHeapIterator(true, true);
+ it = rawOffHeapIterator(null, true, true);
advance();
}
@@ -1598,11 +1598,13 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
/**
* @param c Key/value closure.
+ * @param part Partition.
* @param primary Include primaries.
* @param backup Include backups.
* @return Off-heap iterator.
*/
public <T> GridCloseableIterator<T> rawOffHeapIterator(final CX2<T2<Long, Integer>, T2<Long, Integer>, T> c,
+ Integer part,
boolean primary,
boolean backup)
{
@@ -1618,24 +1620,31 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
AffinityTopologyVersion ver = cctx.affinity().affinityTopologyVersion();
- Set<Integer> parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), ver) :
- cctx.affinity().backupPartitions(cctx.localNodeId(), ver);
+ Set<Integer> parts;
+
+ if (part == null)
+ parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), ver) :
+ cctx.affinity().backupPartitions(cctx.localNodeId(), ver);
+ else
+ parts = Collections.singleton(part);
return new CloseablePartitionsIterator<T, T>(parts) {
@Override protected GridCloseableIterator<T> partitionIterator(int part)
- throws IgniteCheckedException
- {
+ throws IgniteCheckedException {
return offheap.iterator(spaceName, c, part);
}
};
}
/**
+ *
+ * @param part Partition.
* @param primary Include primaries.
* @param backup Include backups.
* @return Raw off-heap iterator.
*/
- public GridCloseableIterator<Map.Entry<byte[], byte[]>> rawOffHeapIterator(final boolean primary,
+ public GridCloseableIterator<Map.Entry<byte[], byte[]>> rawOffHeapIterator(@Nullable Integer part,
+ final boolean primary,
final boolean backup)
{
if (!offheapEnabled || (!primary && !backup))
@@ -1673,8 +1682,13 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
AffinityTopologyVersion ver = cctx.affinity().affinityTopologyVersion();
- Set<Integer> parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), ver) :
- cctx.affinity().backupPartitions(cctx.localNodeId(), ver);
+ Set<Integer> parts;
+
+ if (part == null)
+ parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), ver) :
+ cctx.affinity().backupPartitions(cctx.localNodeId(), ver);
+ else
+ parts = Collections.singleton(part);
return new CloseablePartitionsIterator<Map.Entry<byte[], byte[]>, IgniteBiTuple<byte[], byte[]>>(parts) {
private Map.Entry<byte[], byte[]> cur;
@@ -1751,6 +1765,29 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
}
/**
+ * @param part Partition.
+ * @return Raw off-heap iterator.
+ * @throws IgniteCheckedException If failed.
+ */
+ public GridCloseableIterator<Map.Entry<byte[], byte[]>> rawSwapIterator(int part)
+ throws IgniteCheckedException
+ {
+ if (!swapEnabled)
+ return new GridEmptyCloseableIterator<>();
+
+ checkIteratorQueue();
+
+ return new CloseablePartitionsIterator<Map.Entry<byte[], byte[]>, Map.Entry<byte[], byte[]>>(
+ Collections.singleton(part)) {
+ @Override protected GridCloseableIterator<Map.Entry<byte[], byte[]>> partitionIterator(int part)
+ throws IgniteCheckedException
+ {
+ return swapMgr.rawIterator(spaceName, part);
+ }
+ };
+ }
+
+ /**
* @param primary If {@code true} includes primary entries.
* @param backup If {@code true} includes backup entries.
* @param topVer Topology version.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 4390993..69ce7b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -353,7 +353,8 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
if (filter instanceof ScanQuery) {
IgniteBiPredicate<K, V> p = ((ScanQuery)filter).getFilter();
- qry = ctx.queries().createScanQuery(p != null ? p : ACCEPT_ALL, isKeepPortable);
+ qry = ctx.queries().createScanQuery(p != null ? p : ACCEPT_ALL, ((ScanQuery)filter).getPartition(),
+ isKeepPortable);
if (grp != null)
qry.projection(grp);
@@ -496,10 +497,14 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
return (QueryCursor<R>)queryContinuous((ContinuousQuery<K, V>)qry, qry.isLocal());
if (qry instanceof SqlQuery) {
- SqlQuery p = (SqlQuery)qry;
+ final SqlQuery p = (SqlQuery)qry;
if (isReplicatedDataNode() || ctx.isLocal() || qry.isLocal())
- return (QueryCursor<R>)new QueryCursorImpl<>(ctx.kernalContext().query().<K, V>queryLocal(ctx, p));
+ return (QueryCursor<R>)new QueryCursorImpl<>(new Iterable<Cache.Entry<K, V>>() {
+ @Override public Iterator<Cache.Entry<K, V>> iterator() {
+ return ctx.kernalContext().query().<K, V>queryLocal(ctx, p);
+ }
+ });
return (QueryCursor<R>)ctx.kernalContext().query().queryTwoStep(ctx, p);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/QueryCursorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/QueryCursorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/QueryCursorImpl.java
index 7cb9efc..d68c377 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/QueryCursorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/QueryCursorImpl.java
@@ -27,6 +27,9 @@ import java.util.*;
* Query cursor implementation.
*/
public class QueryCursorImpl<T> implements QueryCursorEx<T> {
+ /** Query executor. */
+ private Iterable<T> iterExec;
+
/** */
private Iterator<T> iter;
@@ -34,18 +37,18 @@ public class QueryCursorImpl<T> implements QueryCursorEx<T> {
private boolean iterTaken;
/** */
- private Collection<GridQueryFieldMetadata> fieldsMeta;
+ private List<GridQueryFieldMetadata> fieldsMeta;
/**
- * @param iter Iterator.
+ * @param iterExec Query executor.
*/
- public QueryCursorImpl(Iterator<T> iter) {
- this.iter = iter;
+ public QueryCursorImpl(Iterable<T> iterExec) {
+ this.iterExec = iterExec;
}
/** {@inheritDoc} */
@Override public Iterator<T> iterator() {
- if (iter == null)
+ if (iter == null && iterTaken)
throw new IgniteException("Cursor is closed.");
if (iterTaken)
@@ -53,12 +56,16 @@ public class QueryCursorImpl<T> implements QueryCursorEx<T> {
iterTaken = true;
+ iter = iterExec.iterator();
+
+ assert iter != null;
+
return iter;
}
/** {@inheritDoc} */
@Override public List<T> getAll() {
- ArrayList<T> all = new ArrayList<>();
+ List<T> all = new ArrayList<>();
try {
for (T t : this) // Implicitly calls iterator() to do all checks.
@@ -103,14 +110,14 @@ public class QueryCursorImpl<T> implements QueryCursorEx<T> {
/**
* @param fieldsMeta SQL Fields query result metadata.
*/
- public void fieldsMeta(Collection<GridQueryFieldMetadata> fieldsMeta) {
+ public void fieldsMeta(List<GridQueryFieldMetadata> fieldsMeta) {
this.fieldsMeta = fieldsMeta;
}
/**
* @return SQL Fields query result metadata.
*/
- public Collection<GridQueryFieldMetadata> fieldsMeta() {
+ @Override public List<GridQueryFieldMetadata> fieldsMeta() {
return fieldsMeta;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index 0749f66..8ac3809 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -149,6 +149,13 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>
}
/**
+ * @return Keys belonging to partition.
+ */
+ public Set<KeyCacheObject> keySet() {
+ return map.keySet();
+ }
+
+ /**
* @return Entries belonging to partition.
*/
public Collection<GridDhtCacheEntry> entries() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java
index 0658828..2d2db1b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java
@@ -76,7 +76,7 @@ import org.jetbrains.annotations.*;
* </li>
* <li>
* Joins will work correctly only if joined objects are stored in
- * collocated mode or at least one side of the join is stored in
+ * colocated mode or at least one side of the join is stored in
* {@link org.apache.ignite.cache.CacheMode#REPLICATED} cache. Refer to
* {@link AffinityKey} javadoc for more information about colocation.
* </li>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
index a579aab..2b93144 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
@@ -229,6 +229,7 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
false,
null,
req.keyValueFilter(),
+ req.partition(),
req.className(),
req.clause(),
req.includeMetaData(),
@@ -518,6 +519,7 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
qry.query().clause(),
clsName,
qry.query().scanFilter(),
+ qry.query().partition(),
qry.reducer(),
qry.transform(),
qry.query().pageSize(),
@@ -626,6 +628,7 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
qry.query().clause(),
null,
null,
+ null,
qry.reducer(),
qry.transform(),
qry.query().pageSize(),
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
index 7f0a5ec..5b82c34 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
@@ -21,13 +21,17 @@ import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.query.*;
import org.apache.ignite.cluster.*;
+import org.apache.ignite.internal.*;
import org.apache.ignite.internal.cluster.*;
+import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.query.*;
+import org.apache.ignite.internal.util.future.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.plugin.security.*;
+
import org.jetbrains.annotations.*;
import java.util.*;
@@ -38,6 +42,13 @@ import static org.apache.ignite.internal.processors.cache.query.GridCacheQueryTy
* Query adapter.
*/
public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
+ /** Is local node predicate. */
+ private static final IgnitePredicate<ClusterNode> IS_LOC_NODE = new IgnitePredicate<ClusterNode>() {
+ @Override public boolean apply(ClusterNode n) {
+ return n.isLocal();
+ }
+ };
+
/** */
private final GridCacheContext<?, ?> cctx;
@@ -56,6 +67,9 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
/** */
private final IgniteBiPredicate<Object, Object> filter;
+ /** Partition. */
+ private Integer part;
+
/** */
private final boolean incMeta;
@@ -95,6 +109,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
* @param clsName Class name.
* @param clause Clause.
* @param filter Scan filter.
+ * @param part Partition.
* @param incMeta Include metadata flag.
* @param keepPortable Keep portable flag.
*/
@@ -103,16 +118,19 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
@Nullable String clsName,
@Nullable String clause,
@Nullable IgniteBiPredicate<Object, Object> filter,
+ @Nullable Integer part,
boolean incMeta,
boolean keepPortable) {
assert cctx != null;
assert type != null;
+ assert part == null || part >= 0;
this.cctx = cctx;
this.type = type;
this.clsName = clsName;
this.clause = clause;
this.filter = filter;
+ this.part = part;
this.incMeta = incMeta;
this.keepPortable = keepPortable;
@@ -132,6 +150,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
* @param dedup Enable dedup flag.
* @param prj Grid projection.
* @param filter Key-value filter.
+ * @param part Partition.
* @param clsName Class name.
* @param clause Clause.
* @param incMeta Include metadata flag.
@@ -149,6 +168,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
boolean dedup,
ClusterGroup prj,
IgniteBiPredicate<Object, Object> filter,
+ @Nullable Integer part,
@Nullable String clsName,
String clause,
boolean incMeta,
@@ -165,6 +185,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
this.dedup = dedup;
this.prj = prj;
this.filter = filter;
+ this.part = part;
this.clsName = clsName;
this.clause = clause;
this.incMeta = incMeta;
@@ -334,6 +355,13 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
}
/**
+ * @return Partition.
+ */
+ @Nullable public Integer partition() {
+ return part;
+ }
+
+ /**
* @throws IgniteCheckedException If query is invalid.
*/
public void validate() throws IgniteCheckedException {
@@ -410,16 +438,18 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
taskHash = cctx.kernalContext().job().currentTaskNameHash();
- GridCacheQueryBean bean = new GridCacheQueryBean(this, (IgniteReducer<Object, Object>)rmtReducer,
+ final GridCacheQueryBean bean = new GridCacheQueryBean(this, (IgniteReducer<Object, Object>)rmtReducer,
(IgniteClosure<Object, Object>)rmtTransform, args);
- GridCacheQueryManager qryMgr = cctx.queries();
+ final GridCacheQueryManager qryMgr = cctx.queries();
boolean loc = nodes.size() == 1 && F.first(nodes).id().equals(cctx.localNodeId());
if (type == SQL_FIELDS || type == SPI)
return (CacheQueryFuture<R>)(loc ? qryMgr.queryFieldsLocal(bean) :
qryMgr.queryFieldsDistributed(bean, nodes));
+ else if (type == SCAN && part != null && nodes.size() > 1)
+ return new CacheQueryFallbackFuture<>(nodes, bean, qryMgr);
else
return (CacheQueryFuture<R>)(loc ? qryMgr.queryLocal(bean) : qryMgr.queryDistributed(bean, nodes));
}
@@ -439,15 +469,15 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
return Collections.singletonList(cctx.localNode());
case REPLICATED:
- if (prj != null)
- return nodes(cctx, prj);
+ if (prj != null || partition() != null)
+ return nodes(cctx, prj, partition());
return cctx.affinityNode() ?
Collections.singletonList(cctx.localNode()) :
- Collections.singletonList(F.rand(nodes(cctx, null)));
+ Collections.singletonList(F.rand(nodes(cctx, null, partition())));
case PARTITIONED:
- return nodes(cctx, prj);
+ return nodes(cctx, prj, partition());
default:
throw new IllegalStateException("Unknown cache distribution mode: " + cacheMode);
@@ -459,17 +489,26 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
* @param prj Projection (optional).
* @return Collection of data nodes in provided projection (if any).
*/
- private static Collection<ClusterNode> nodes(final GridCacheContext<?, ?> cctx, @Nullable final ClusterGroup prj) {
+ private static Collection<ClusterNode> nodes(final GridCacheContext<?, ?> cctx,
+ @Nullable final ClusterGroup prj, @Nullable final Integer part) {
assert cctx != null;
+ final AffinityTopologyVersion topVer = cctx.affinity().affinityTopologyVersion();
+
Collection<ClusterNode> affNodes = CU.affinityNodes(cctx);
- if (prj == null)
+ if (prj == null && part == null)
return affNodes;
+ final Set<ClusterNode> owners =
+ part == null ? Collections.<ClusterNode>emptySet() : new HashSet<>(cctx.topology().owners(part, topVer));
+
return F.view(affNodes, new P1<ClusterNode>() {
@Override public boolean apply(ClusterNode n) {
- return prj.node(n.id()) != null;
+
+ return cctx.discovery().cacheAffinityNode(n, cctx.name()) &&
+ (prj == null || prj.node(n.id()) != null) &&
+ (part == null || owners.contains(n));
}
});
}
@@ -478,4 +517,94 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
@Override public String toString() {
return S.toString(GridCacheQueryAdapter.class, this);
}
+
+ /**
+ * Wrapper for queries with fallback.
+ */
+ private static class CacheQueryFallbackFuture<R> extends GridFutureAdapter<Collection<R>>
+ implements CacheQueryFuture<R> {
+ /** Query future. */
+ private volatile GridCacheQueryFutureAdapter<?, ?, R> fut;
+
+ /** Backups. */
+ private final Queue<ClusterNode> nodes;
+
+ /** Bean. */
+ private final GridCacheQueryBean bean;
+
+ /** Query manager. */
+ private final GridCacheQueryManager qryMgr;
+
+ /**
+ * @param nodes Backups.
+ * @param bean Bean.
+ * @param qryMgr Query manager.
+ */
+ public CacheQueryFallbackFuture(Collection<ClusterNode> nodes, GridCacheQueryBean bean,
+ GridCacheQueryManager qryMgr) {
+ this.nodes = fallbacks(nodes);
+ this.bean = bean;
+ this.qryMgr = qryMgr;
+
+ init();
+ }
+
+ /**
+ * @param nodes Nodes.
+ */
+ private Queue<ClusterNode> fallbacks(Collection<ClusterNode> nodes) {
+ Queue<ClusterNode> fallbacks = new LinkedList<>();
+
+ ClusterNode node = F.first(F.view(nodes, IS_LOC_NODE));
+
+ if (node != null)
+ fallbacks.add(node);
+
+ fallbacks.addAll(node != null ? F.view(nodes, F.not(IS_LOC_NODE)) : nodes);
+
+ return fallbacks;
+ }
+
+ /**
+ *
+ */
+ private void init() {
+ ClusterNode node = nodes.poll();
+
+ GridCacheQueryFutureAdapter<?, ?, R> fut0 =
+ (GridCacheQueryFutureAdapter<?, ?, R>)(node.isLocal() ? qryMgr.queryLocal(bean) :
+ qryMgr.queryDistributed(bean, Collections.singleton(node)));
+
+ fut0.listen(new IgniteInClosure<IgniteInternalFuture<Collection<R>>>() {
+ @Override public void apply(IgniteInternalFuture<Collection<R>> fut) {
+ try {
+ onDone(fut.get());
+ }
+ catch (IgniteCheckedException e) {
+ if (F.isEmpty(nodes))
+ onDone(e);
+ else
+ init();
+ }
+ }
+ });
+
+ fut = fut0;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int available() {
+ return fut.available();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean cancel() throws IgniteCheckedException {
+ return fut.cancel();
+ }
+
+ /** {@inheritDoc} */
+ @Override public R next() {
+ return fut.next();
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 32e9d63..6e71ba7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -52,6 +52,8 @@ import java.util.concurrent.*;
import static org.apache.ignite.cache.CacheMode.*;
import static org.apache.ignite.events.EventType.*;
import static org.apache.ignite.internal.GridClosureCallMode.*;
+import static org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion.*;
+import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.*;
import static org.apache.ignite.internal.processors.cache.query.GridCacheQueryType.*;
/**
@@ -111,8 +113,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
final Object recipient = recipient(nodeId, entry.getKey());
entry.getValue().listen(new CIX1<IgniteInternalFuture<QueryResult<K, V>>>() {
- @Override
- public void applyx(IgniteInternalFuture<QueryResult<K, V>> f)
+ @Override public void applyx(IgniteInternalFuture<QueryResult<K, V>> f)
throws IgniteCheckedException {
f.get().closeIfNotShared(recipient);
}
@@ -768,98 +769,138 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
final boolean backups = qry.includeBackups() || cctx.isReplicated();
- final GridCloseableIteratorAdapter<IgniteBiTuple<K, V>> heapIt = new GridCloseableIteratorAdapter<IgniteBiTuple<K, V>>() {
- private IgniteBiTuple<K, V> next;
+ final GridCloseableIteratorAdapter<IgniteBiTuple<K, V>> heapIt =
+ new GridCloseableIteratorAdapter<IgniteBiTuple<K, V>>() {
+ private IgniteBiTuple<K, V> next;
- private IgniteCacheExpiryPolicy expiryPlc = cctx.cache().expiryPolicy(plc);
+ private IgniteCacheExpiryPolicy expiryPlc = cctx.cache().expiryPolicy(plc);
- private Iterator<K> iter = backups ? prj.keySetx().iterator() : prj.primaryKeySet().iterator();
+ private Iterator<K> iter;
- {
- advance();
- }
+ private GridDhtLocalPartition locPart;
- @Override public boolean onHasNext() {
- return next != null;
- }
+ {
+ Integer part = qry.partition();
- @Override public IgniteBiTuple<K, V> onNext() {
- if (next == null)
- throw new NoSuchElementException();
+ if (part == null || dht == null)
+ iter = backups ? prj.keySetx().iterator() : prj.primaryKeySet().iterator();
+ else if (part < 0 || part >= cctx.affinity().partitions())
+ iter = F.emptyIterator();
+ else {
+ AffinityTopologyVersion topVer = cctx.affinity().affinityTopologyVersion();
- IgniteBiTuple<K, V> next0 = next;
+ locPart = dht.topology().localPartition(part, topVer, false);
- advance();
+ if (locPart == null || (locPart.state() != OWNING && locPart.state() != RENTING) ||
+ !locPart.reserve())
+ throw new GridDhtInvalidPartitionException(part, "Partition can't be reserved");
- return next0;
- }
+ iter = new Iterator<K>() {
+ private Iterator<KeyCacheObject> iter0 = locPart.keySet().iterator();
- private void advance() {
- IgniteBiTuple<K, V> next0 = null;
-
- while (iter.hasNext()) {
- next0 = null;
+ @Override public boolean hasNext() {
+ return iter0.hasNext();
+ }
- K key = iter.next();
+ @Override public K next() {
+ KeyCacheObject key = iter0.next();
- V val;
+ return key.value(cctx.cacheObjectContext(), false);
+ }
- try {
- val = prj.localPeek(key, CachePeekModes.ONHEAP_ONLY, expiryPlc);
+ @Override public void remove() {
+ iter0.remove();
+ }
+ };
}
- catch (IgniteCheckedException e) {
- if (log.isDebugEnabled())
- log.debug("Failed to peek value: " + e);
- val = null;
- }
+ advance();
+ }
- if (dht != null && expiryPlc != null && expiryPlc.readyToFlush(100)) {
- dht.sendTtlUpdateRequest(expiryPlc);
+ @Override public boolean onHasNext() {
+ return next != null;
+ }
- expiryPlc = cctx.cache().expiryPolicy(plc);
- }
+ @Override public IgniteBiTuple<K, V> onNext() {
+ if (next == null)
+ throw new NoSuchElementException();
- if (val != null) {
- next0 = F.t(key, val);
+ IgniteBiTuple<K, V> next0 = next;
- if (checkPredicate(next0))
- break;
- else
- next0 = null;
- }
+ advance();
+
+ return next0;
}
- next = next0 != null ?
- new IgniteBiTuple<>(next0.getKey(), next0.getValue()) :
- null;
+ private void advance() {
+ IgniteBiTuple<K, V> next0 = null;
- if (next == null)
- sendTtlUpdate();
- }
+ while (iter.hasNext()) {
+ next0 = null;
- @Override protected void onClose() {
- sendTtlUpdate();
- }
+ K key = iter.next();
+
+ V val;
- private void sendTtlUpdate() {
- if (dht != null && expiryPlc != null) {
- dht.sendTtlUpdateRequest(expiryPlc);
+ try {
+ val = prj.localPeek(key, CachePeekModes.ONHEAP_ONLY, expiryPlc);
+ }
+ catch (IgniteCheckedException e) {
+ if (log.isDebugEnabled())
+ log.debug("Failed to peek value: " + e);
+
+ val = null;
+ }
- expiryPlc = null;
+ if (dht != null && expiryPlc != null && expiryPlc.readyToFlush(100)) {
+ dht.sendTtlUpdateRequest(expiryPlc);
+
+ expiryPlc = cctx.cache().expiryPolicy(plc);
+ }
+
+ if (val != null) {
+ next0 = F.t(key, val);
+
+ if (checkPredicate(next0))
+ break;
+ else
+ next0 = null;
+ }
+ }
+
+ next = next0 != null ?
+ new IgniteBiTuple<>(next0.getKey(), next0.getValue()) :
+ null;
+
+ if (next == null)
+ sendTtlUpdate();
}
- }
- private boolean checkPredicate(Map.Entry<K, V> e) {
- if (keyValFilter != null) {
- Map.Entry<K, V> e0 = (Map.Entry<K, V>)cctx.unwrapPortableIfNeeded(e, qry.keepPortable());
+ @Override protected void onClose() {
+ sendTtlUpdate();
- return keyValFilter.apply(e0.getKey(), e0.getValue());
+ if (locPart != null)
+ locPart.release();
}
- return true;
- }
- };
+ private void sendTtlUpdate() {
+ if (dht != null && expiryPlc != null) {
+ dht.sendTtlUpdateRequest(expiryPlc);
+
+ expiryPlc = null;
+ }
+ }
+
+ private boolean checkPredicate(Map.Entry<K, V> e) {
+ if (keyValFilter != null) {
+ Map.Entry<K, V> e0 = (Map.Entry<K, V>)cctx.unwrapPortableIfNeeded(e, qry.keepPortable());
+
+ return keyValFilter.apply(e0.getKey(), e0.getValue());
+ }
+
+ return true;
+ }
+ };
final GridIterator<IgniteBiTuple<K, V>> it;
@@ -914,7 +955,10 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
throws IgniteCheckedException {
IgniteBiPredicate<K, V> filter = qry.scanFilter();
- Iterator<Map.Entry<byte[], byte[]>> it = cctx.swap().rawSwapIterator(true, backups);
+ Integer part = qry.partition();
+
+ Iterator<Map.Entry<byte[], byte[]>> it = part == null ? cctx.swap().rawSwapIterator(true, backups) :
+ cctx.swap().rawSwapIterator(part);
return scanIterator(it, filter, qry.keepPortable());
}
@@ -930,10 +974,10 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
if (cctx.offheapTiered() && filter != null) {
OffheapIteratorClosure c = new OffheapIteratorClosure(filter, qry.keepPortable());
- return cctx.swap().rawOffHeapIterator(c, true, backups);
+ return cctx.swap().rawOffHeapIterator(c, qry.partition(), true, backups);
}
else {
- Iterator<Map.Entry<byte[], byte[]>> it = cctx.swap().rawOffHeapIterator(true, backups);
+ Iterator<Map.Entry<byte[], byte[]>> it = cctx.swap().rawOffHeapIterator(qry.partition(), true, backups);
return scanIterator(it, filter, qry.keepPortable());
}
@@ -1222,7 +1266,9 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
try {
// Preparing query closures.
- IgniteClosure<Map.Entry<K, V>, Object> trans = (IgniteClosure<Map.Entry<K, V>, Object>)qryInfo.transformer();
+ IgniteClosure<Map.Entry<K, V>, Object> trans =
+ (IgniteClosure<Map.Entry<K, V>, Object>)qryInfo.transformer();
+
IgniteReducer<Map.Entry<K, V>, Object> rdc = (IgniteReducer<Map.Entry<K, V>, Object>)qryInfo.reducer();
injectResources(trans);
@@ -1282,9 +1328,11 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
K key = row.getKey();
- // Filter backups for SCAN queries. Other types are filtered in indexing manager.
- if (!cctx.isReplicated() && cctx.config().getCacheMode() != LOCAL && qry.type() == SCAN &&
- !incBackups && !cctx.affinity().primary(cctx.localNode(), key, topVer)) {
+ // Filter backups for SCAN queries, if it isn't partition scan.
+ // Other types are filtered in indexing manager.
+ if (!cctx.isReplicated() && qry.type() == SCAN && qry.partition() == null &&
+ cctx.config().getCacheMode() != LOCAL && !incBackups &&
+ !cctx.affinity().primary(cctx.localNode(), key, topVer)) {
if (log.isDebugEnabled())
log.debug("Ignoring backup element [row=" + row +
", cacheMode=" + cctx.config().getCacheMode() + ", incBackups=" + incBackups +
@@ -1529,11 +1577,6 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
fut.onDone(executeQuery(qryInfo.query(), qryInfo.arguments(), false,
qryInfo.query().subjectId(), taskName, recipient(qryInfo.senderId(), qryInfo.requestId())));
}
- catch (Error e) {
- fut.onDone(e);
-
- throw e;
- }
catch (Throwable e) {
fut.onDone(e);
@@ -1843,7 +1886,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
return new IgniteBiPredicate<K, V>() {
@Override public boolean apply(K k, V v) {
- return cache.context().affinity().primary(ctx.discovery().localNode(), k, AffinityTopologyVersion.NONE);
+ return cache.context().affinity().primary(ctx.discovery().localNode(), k, NONE);
}
};
}
@@ -2920,6 +2963,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
null,
null,
null,
+ null,
false,
keepPortable);
}
@@ -2928,17 +2972,19 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
* Creates user's predicate based scan query.
*
* @param filter Scan filter.
+ * @param part Partition.
* @param keepPortable Keep portable flag.
* @return Created query.
*/
- @SuppressWarnings("unchecked")
public CacheQuery<Map.Entry<K, V>> createScanQuery(@Nullable IgniteBiPredicate<K, V> filter,
- boolean keepPortable) {
+ @Nullable Integer part, boolean keepPortable) {
+
return new GridCacheQueryAdapter<>(cctx,
SCAN,
null,
null,
(IgniteBiPredicate<Object, Object>)filter,
+ part,
false,
keepPortable);
}
@@ -2962,6 +3008,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
clsName,
search,
null,
+ null,
false,
keepPortable);
}
@@ -2982,6 +3029,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
null,
qry,
null,
+ null,
false,
keepPortable);
}
@@ -3002,6 +3050,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
null,
qry,
null,
+ null,
incMeta,
keepPortable);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java
index 845077f..2113e7a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java
@@ -26,6 +26,8 @@ import org.apache.ignite.lang.*;
import org.apache.ignite.marshaller.*;
import org.apache.ignite.plugin.extensions.communication.*;
+import org.jetbrains.annotations.*;
+
import java.io.*;
import java.nio.*;
import java.util.*;
@@ -109,6 +111,9 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
/** */
private int taskHash;
+ /** Partition. */
+ private int part;
+
/**
* Required by {@link Externalizable}
*/
@@ -173,6 +178,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
* @param clause Query clause.
* @param clsName Query class name.
* @param keyValFilter Key-value filter.
+ * @param part Partition.
* @param rdc Reducer.
* @param trans Transformer.
* @param pageSize Page size.
@@ -189,6 +195,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
String clause,
String clsName,
IgniteBiPredicate<Object, Object> keyValFilter,
+ @Nullable Integer part,
IgniteReducer<Object, Object> rdc,
IgniteClosure<Object, Object> trans,
int pageSize,
@@ -211,6 +218,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
this.clause = clause;
this.clsName = clsName;
this.keyValFilter = keyValFilter;
+ this.part = part == null ? -1 : part;
this.rdc = rdc;
this.trans = trans;
this.pageSize = pageSize;
@@ -414,6 +422,13 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
return taskHash;
}
+ /**
+ * @return partition.
+ */
+ @Nullable public Integer partition() {
+ return part == -1 ? null : part;
+ }
+
/** {@inheritDoc} */
@Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
writer.setBuffer(buf);
@@ -508,30 +523,36 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
writer.incrementState();
case 16:
- if (!writer.writeByteArray("rdcBytes", rdcBytes))
+ if (!writer.writeInt("part", part))
return false;
writer.incrementState();
case 17:
- if (!writer.writeUuid("subjId", subjId))
+ if (!writer.writeByteArray("rdcBytes", rdcBytes))
return false;
writer.incrementState();
case 18:
- if (!writer.writeInt("taskHash", taskHash))
+ if (!writer.writeUuid("subjId", subjId))
return false;
writer.incrementState();
case 19:
- if (!writer.writeByteArray("transBytes", transBytes))
+ if (!writer.writeInt("taskHash", taskHash))
return false;
writer.incrementState();
case 20:
+ if (!writer.writeByteArray("transBytes", transBytes))
+ return false;
+
+ writer.incrementState();
+
+ case 21:
if (!writer.writeByte("type", type != null ? (byte)type.ordinal() : -1))
return false;
@@ -658,7 +679,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
reader.incrementState();
case 16:
- rdcBytes = reader.readByteArray("rdcBytes");
+ part = reader.readInt("part");
if (!reader.isLastRead())
return false;
@@ -666,7 +687,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
reader.incrementState();
case 17:
- subjId = reader.readUuid("subjId");
+ rdcBytes = reader.readByteArray("rdcBytes");
if (!reader.isLastRead())
return false;
@@ -674,7 +695,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
reader.incrementState();
case 18:
- taskHash = reader.readInt("taskHash");
+ subjId = reader.readUuid("subjId");
if (!reader.isLastRead())
return false;
@@ -682,7 +703,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
reader.incrementState();
case 19:
- transBytes = reader.readByteArray("transBytes");
+ taskHash = reader.readInt("taskHash");
if (!reader.isLastRead())
return false;
@@ -690,6 +711,14 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
reader.incrementState();
case 20:
+ transBytes = reader.readByteArray("transBytes");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
+ case 21:
byte typeOrd;
typeOrd = reader.readByte("type");
@@ -713,7 +742,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 21;
+ return 22;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryCursorEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryCursorEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryCursorEx.java
index bf1d4ea..5e19b99 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryCursorEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/QueryCursorEx.java
@@ -19,6 +19,9 @@ package org.apache.ignite.internal.processors.cache.query;
import org.apache.ignite.*;
import org.apache.ignite.cache.query.*;
+import org.apache.ignite.internal.processors.query.*;
+
+import java.util.*;
/**
* Extended query cursor interface allowing for "getAll" to output data into destination other than Collection.
@@ -32,6 +35,11 @@ public interface QueryCursorEx<T> extends QueryCursor<T> {
public void getAll(Consumer<T> c) throws IgniteCheckedException;
/**
+ * @return Query metadata.
+ */
+ public List<GridQueryFieldMetadata> fieldsMeta();
+
+ /**
* Query value consumer.
*/
public static interface Consumer<T> {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java
index f516968..f74fe95 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java
@@ -114,7 +114,7 @@ public class GridCacheSetImpl<T> extends AbstractCollection<T> implements Ignite
}
CacheQuery qry = new GridCacheQueryAdapter<>(ctx, SET, null, null,
- new GridSetQueryPredicate<>(id, collocated), false, false);
+ new GridSetQueryPredicate<>(id, collocated), null, false, false);
Collection<ClusterNode> nodes = dataNodes(ctx.affinity().affinityTopologyVersion());
@@ -345,7 +345,7 @@ public class GridCacheSetImpl<T> extends AbstractCollection<T> implements Ignite
private GridCloseableIterator<T> iterator0() {
try {
CacheQuery qry = new GridCacheQueryAdapter<>(ctx, SET, null, null,
- new GridSetQueryPredicate<>(id, collocated), false, false);
+ new GridSetQueryPredicate<>(id, collocated), null, false, false);
Collection<ClusterNode> nodes = dataNodes(ctx.affinity().affinityTopologyVersion());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
index 0bb820d..7fcc284 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
@@ -58,9 +58,11 @@ public interface GridQueryIndexing {
*
* @param cctx Cache context.
* @param qry Query.
+ * @param keepCacheObjects If {@code true}, cache objects representation will be preserved.
* @return Cursor.
*/
- public QueryCursor<List<?>> queryTwoStep(GridCacheContext<?,?> cctx, GridCacheTwoStepQuery qry);
+ public Iterable<List<?>> queryTwoStep(GridCacheContext<?,?> cctx, GridCacheTwoStepQuery qry,
+ boolean keepCacheObjects);
/**
* Parses SQL query into two step query and executes it.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index ed8e1e2..e187713 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -539,16 +539,19 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @param qry Query.
* @return Cursor.
*/
- public QueryCursor<List<?>> queryTwoStep(String space, GridCacheTwoStepQuery qry) {
+ public Iterable<List<?>> queryTwoStep(String space, GridCacheTwoStepQuery qry) {
checkxEnabled();
if (!busyLock.enterBusy())
throw new IllegalStateException("Failed to execute query (grid is stopping).");
try {
+ GridCacheContext<Object, Object> cacheCtx = ctx.cache().internalCache(space).context();
+
return idx.queryTwoStep(
- ctx.cache().internalCache(space).context(),
- qry);
+ cacheCtx,
+ qry,
+ cacheCtx.keepPortable());
}
finally {
busyLock.leaveBusy();
@@ -715,12 +718,15 @@ public class GridQueryProcessor extends GridProcessorAdapter {
String sql = qry.getSql();
Object[] args = qry.getArgs();
- GridQueryFieldsResult res = idx.queryFields(space, sql, F.asList(args), idx.backupFilter());
+ final GridQueryFieldsResult res = idx.queryFields(space, sql, F.asList(args), idx.backupFilter());
sendQueryExecutedEvent(sql, args);
- QueryCursorImpl<List<?>> cursor = new QueryCursorImpl<>(
- new GridQueryCacheObjectsIterator(res.iterator(), cctx, cctx.keepPortable()));
+ QueryCursorImpl<List<?>> cursor = new QueryCursorImpl<>(new Iterable<List<?>>() {
+ @Override public Iterator<List<?>> iterator() {
+ return new GridQueryCacheObjectsIterator(res.iterator(), cctx, cctx.keepPortable());
+ }
+ });
cursor.fieldsMeta(res.metaData());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
index 64eb1c1..bb451c7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
@@ -934,7 +934,7 @@ public class GridServiceProcessor extends GridProcessorAdapter {
GridCacheQueryManager qryMgr = cache.context().queries();
- CacheQuery<Map.Entry<Object, Object>> qry = qryMgr.createScanQuery(p, false);
+ CacheQuery<Map.Entry<Object, Object>> qry = qryMgr.createScanQuery(p, null, false);
qry.keepAll(false);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/util/GridJavaProcess.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridJavaProcess.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridJavaProcess.java
index 42fe089..4946eb2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridJavaProcess.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridJavaProcess.java
@@ -138,7 +138,7 @@ public final class GridJavaProcess {
procCommands.add(javaBin);
procCommands.addAll(jvmArgs == null ? U.jvmArgs() : jvmArgs);
- if (!jvmArgs.contains("-cp") && !jvmArgs.contains("-classpath")) {
+ if (jvmArgs == null || (!jvmArgs.contains("-cp") && !jvmArgs.contains("-classpath"))) {
String classpath = System.getProperty("java.class.path");
String sfcp = System.getProperty("surefire.test.class.path");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 0932212..9016b10 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -9025,11 +9025,11 @@ public abstract class IgniteUtils {
hasShmem = false;
else {
try {
- IpcSharedMemoryNativeLoader.load();
+ IpcSharedMemoryNativeLoader.load(null);
hasShmem = true;
}
- catch (IgniteCheckedException e) {
+ catch (IgniteCheckedException ignore) {
hasShmem = false;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryClientEndpoint.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryClientEndpoint.java b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryClientEndpoint.java
index 27a234f..c935c4a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryClientEndpoint.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryClientEndpoint.java
@@ -112,7 +112,7 @@ public class IpcSharedMemoryClientEndpoint implements IpcEndpoint {
boolean clear = true;
try {
- IpcSharedMemoryNativeLoader.load();
+ IpcSharedMemoryNativeLoader.load(log);
sock.connect(new InetSocketAddress("127.0.0.1", port), timeout);
[09/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: revert
changes in concurrent map
Posted by se...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8203caf7/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java b/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
index 727db4c..041130b 100644
--- a/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
+++ b/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
@@ -5,22 +5,20 @@
*/
/*
- * The latest version of the file corresponds to the following CVS commit:
- * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jdk7/java/util/concurrent/ConcurrentHashMap.java?pathrev=1.43
+ * The latest version of the file was copied from the following CVS repository:
+ * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/
*
- * Note, that the repository above is JDK 7 based that is kept up-to-date too.
- * The main repository (JDK 8 based) uses JDK 8 features significantly that unavailable in JDK 7.
+ * Corresponding commit version in CVS repository is unknown (lost in our side).
+ * On the other hand we can't simply synch the latest version from CVS here, because Ignite uses functionality that
+ * is no longer supported.
*/
-
package org.jsr166;
import java.io.*;
import java.util.*;
import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
import java.util.concurrent.locks.*;
-import java.lang.reflect.*;
/**
* A hash table supporting full concurrency of retrievals and
@@ -74,15 +72,21 @@ import java.lang.reflect.*;
* expected {@code concurrencyLevel} as an additional hint for
* internal sizing. Note that using many keys with exactly the same
* {@code hashCode()} is a sure way to slow down performance of any
- * hash table. To ameliorate impact, when keys are {@link Comparable},
- * this class may use comparison order among keys to help break ties.
+ * hash table.
*
- * <p>A {@link Set} projection of a ConcurrentHashMap may be created
+ * <p>A {@link Set} projection of a ConcurrentHashMapV8 may be created
* (using {@link #newKeySet()} or {@link #newKeySet(int)}), or viewed
* (using {@link #keySet(Object)} when only keys are of interest, and the
* mapped values are (perhaps transiently) not used or all take the
* same mapping value.
*
+ * <p>A ConcurrentHashMapV8 can be used as scalable frequency map (a
+ * form of histogram or multiset) by using {@link LongAdder8} values
+ * and initializing via {@link #computeIfAbsent}. For example, to add
+ * a count to a {@code ConcurrentHashMapV8<String,LongAdder8> freqs}, you
+ * can use {@code freqs.computeIfAbsent(k -> new
+ * LongAdder8()).increment();}
+ *
* <p>This class and its views and iterators implement all of the
* <em>optional</em> methods of the {@link Map} and {@link Iterator}
* interfaces.
@@ -90,9 +94,90 @@ import java.lang.reflect.*;
* <p>Like {@link Hashtable} but unlike {@link HashMap}, this class
* does <em>not</em> allow {@code null} to be used as a key or value.
*
- * <p>This class is a member of the
- * <a href="{@docRoot}/../technotes/guides/collections/index.html">
- * Java Collections Framework</a>.
+ * <ul>
+ * <li> forEach: Perform a given action on each element.
+ * A variant form applies a given transformation on each element
+ * before performing the action.</li>
+ *
+ * <li> search: Return the first available non-null result of
+ * applying a given function on each element; skipping further
+ * search when a result is found.</li>
+ *
+ * <li> reduce: Accumulate each element. The supplied reduction
+ * function cannot rely on ordering (more formally, it should be
+ * both associative and commutative). There are five variants:
+ *
+ * <ul>
+ *
+ * <li> Plain reductions. (There is not a form of this method for
+ * (key, value) function arguments since there is no corresponding
+ * return type.)</li>
+ *
+ * <li> Mapped reductions that accumulate the results of a given
+ * function applied to each element.</li>
+ *
+ * <li> Reductions to scalar doubles, longs, and ints, using a
+ * given basis value.</li>
+ *
+ * </li>
+ * </ul>
+ * </ul>
+ *
+ * <p>The concurrency properties of bulk operations follow
+ * from those of ConcurrentHashMapV8: Any non-null result returned
+ * from {@code get(key)} and related access methods bears a
+ * happens-before relation with the associated insertion or
+ * update. The result of any bulk operation reflects the
+ * composition of these per-element relations (but is not
+ * necessarily atomic with respect to the map as a whole unless it
+ * is somehow known to be quiescent). Conversely, because keys
+ * and values in the map are never null, null serves as a reliable
+ * atomic indicator of the current lack of any result. To
+ * maintain this property, null serves as an implicit basis for
+ * all non-scalar reduction operations. For the double, long, and
+ * int versions, the basis should be one that, when combined with
+ * any other value, returns that other value (more formally, it
+ * should be the identity element for the reduction). Most common
+ * reductions have these properties; for example, computing a sum
+ * with basis 0 or a minimum with basis MAX_VALUE.
+ *
+ * <p>Search and transformation functions provided as arguments
+ * should similarly return null to indicate the lack of any result
+ * (in which case it is not used). In the case of mapped
+ * reductions, this also enables transformations to serve as
+ * filters, returning null (or, in the case of primitive
+ * specializations, the identity basis) if the element should not
+ * be combined. You can create compound transformations and
+ * filterings by composing them yourself under this "null means
+ * there is nothing there now" rule before using them in search or
+ * reduce operations.
+ *
+ * <p>Methods accepting and/or returning Entry arguments maintain
+ * key-value associations. They may be useful for example when
+ * finding the key for the greatest value. Note that "plain" Entry
+ * arguments can be supplied using {@code new
+ * AbstractMap.SimpleEntry(k,v)}.
+ *
+ * <p>Bulk operations may complete abruptly, throwing an
+ * exception encountered in the application of a supplied
+ * function. Bear in mind when handling such exceptions that other
+ * concurrently executing functions could also have thrown
+ * exceptions, or would have done so if the first exception had
+ * not occurred.
+ *
+ * <p>Parallel speedups for bulk operations compared to sequential
+ * processing are common but not guaranteed. Operations involving
+ * brief functions on small maps may execute more slowly than
+ * sequential loops if the underlying work to parallelize the
+ * computation is more expensive than the computation itself.
+ * Similarly, parallelization may not lead to much actual parallelism
+ * if all processors are busy performing unrelated tasks.
+ *
+ * <p>All arguments to all task methods must be non-null.
+ *
+ * <p><em>jsr166e note: During transition, this class
+ * uses nested functional interfaces with different names but the
+ * same forms as those expected for JDK8.</em>
*
* @since 1.5
* @author Doug Lea
@@ -100,9 +185,80 @@ import java.lang.reflect.*;
* @param <V> the type of mapped values
*/
@SuppressWarnings("ALL")
-public class ConcurrentHashMap8<K,V> implements ConcurrentMap<K,V>, Serializable {
+public class ConcurrentHashMap8<K, V>
+ implements ConcurrentMap<K, V>, Serializable {
private static final long serialVersionUID = 7249069246763182397L;
+ /**
+ * A partitionable iterator. A Spliterator can be traversed
+ * directly, but can also be partitioned (before traversal) by
+ * creating another Spliterator that covers a non-overlapping
+ * portion of the elements, and so may be amenable to parallel
+ * execution.
+ *
+ * <p>This interface exports a subset of expected JDK8
+ * functionality.
+ *
+ * <p>Sample usage: Here is one (of the several) ways to compute
+ * the sum of the values held in a map using the ForkJoin
+ * framework. As illustrated here, Spliterators are well suited to
+ * designs in which a task repeatedly splits off half its work
+ * into forked subtasks until small enough to process directly,
+ * and then joins these subtasks. Variants of this style can also
+ * be used in completion-based designs.
+ *
+ * <pre>
+ * {@code ConcurrentHashMapV8<String, Long> m = ...
+ * // split as if have 8 * parallelism, for load balance
+ * int n = m.size();
+ * int p = aForkJoinPool.getParallelism() * 8;
+ * int split = (n < p)? n : p;
+ * long sum = aForkJoinPool.invoke(new SumValues(m.valueSpliterator(), split, null));
+ * // ...
+ * static class SumValues extends RecursiveTask<Long> {
+ * final Spliterator<Long> s;
+ * final int split; // split while > 1
+ * final SumValues nextJoin; // records forked subtasks to join
+ * SumValues(Spliterator<Long> s, int depth, SumValues nextJoin) {
+ * this.s = s; this.depth = depth; this.nextJoin = nextJoin;
+ * }
+ * public Long compute() {
+ * long sum = 0;
+ * SumValues subtasks = null; // fork subtasks
+ * for (int s = split >>> 1; s > 0; s >>>= 1)
+ * (subtasks = new SumValues(s.split(), s, subtasks)).fork();
+ * while (s.hasNext()) // directly process remaining elements
+ * sum += s.next();
+ * for (SumValues t = subtasks; t != null; t = t.nextJoin)
+ * sum += t.join(); // collect subtask results
+ * return sum;
+ * }
+ * }
+ * }</pre>
+ */
+ public static interface Spliterator<T> extends Iterator<T> {
+ /**
+ * Returns a Spliterator covering approximately half of the
+ * elements, guaranteed not to overlap with those subsequently
+ * returned by this Spliterator. After invoking this method,
+ * the current Spliterator will <em>not</em> produce any of
+ * the elements of the returned Spliterator, but the two
+ * Spliterators together will produce all of the elements that
+ * would have been produced by this Spliterator had this
+ * method not been called. The exact number of elements
+ * produced by the returned Spliterator is not guaranteed, and
+ * may be zero (i.e., with {@code hasNext()} reporting {@code
+ * false}) if this Spliterator cannot be further split.
+ *
+ * @return a Spliterator covering approximately half of the
+ * elements
+ * @throws IllegalStateException if this Spliterator has
+ * already commenced traversing elements
+ */
+ Spliterator<T> split();
+ }
+
+
/*
* Overview:
*
@@ -113,21 +269,18 @@ public class ConcurrentHashMap8<K,V> implements ConcurrentMap<K,V>, Serializable
* the same or better than java.util.HashMap, and to support high
* initial insertion rates on an empty table by many threads.
*
- * This map usually acts as a binned (bucketed) hash table. Each
- * key-value mapping is held in a Node. Most nodes are instances
- * of the basic Node class with hash, key, value, and next
- * fields. However, various subclasses exist: TreeNodes are
- * arranged in balanced trees, not lists. TreeBins hold the roots
- * of sets of TreeNodes. ForwardingNodes are placed at the heads
- * of bins during resizing. ReservationNodes are used as
- * placeholders while establishing values in computeIfAbsent and
- * related methods. The types TreeBin, ForwardingNode, and
- * ReservationNode do not hold normal user keys, values, or
- * hashes, and are readily distinguishable during search etc
- * because they have negative hash fields and null key and value
- * fields. (These special nodes are either uncommon or transient,
- * so the impact of carrying around some unused fields is
- * insignificant.)
+ * Each key-value mapping is held in a Node. Because Node fields
+ * can contain special values, they are defined using plain Object
+ * types. Similarly in turn, all internal methods that use them
+ * work off Object types. And similarly, so do the internal
+ * methods of auxiliary iterator and view classes. All public
+ * generic typed methods relay in/out of these internal methods,
+ * supplying null-checks and casts as needed. This also allows
+ * many of the public methods to be factored into a smaller number
+ * of internal methods (although sadly not so for the five
+ * variants of put-related operations). The validation-based
+ * approach explained below leads to a lot of code sprawl because
+ * retry-control precludes factoring into smaller methods.
*
* The table is lazily initialized to a power-of-two size upon the
* first insertion. Each bin in the table normally contains a
@@ -135,12 +288,24 @@ public class ConcurrentHashMap8<K,V> implements ConcurrentMap<K,V>, Serializable
* Table accesses require volatile/atomic reads, writes, and
* CASes. Because there is no other way to arrange this without
* adding further indirections, we use intrinsics
- * (sun.misc.Unsafe) operations.
+ * (sun.misc.Unsafe) operations. The lists of nodes within bins
+ * are always accurately traversable under volatile reads, so long
+ * as lookups check hash code and non-nullness of value before
+ * checking key equality.
*
- * We use the top (sign) bit of Node hash fields for control
- * purposes -- it is available anyway because of addressing
- * constraints. Nodes with negative hash fields are specially
- * handled or ignored in map methods.
+ * We use the top two bits of Node hash fields for control
+ * purposes -- they are available anyway because of addressing
+ * constraints. As explained further below, these top bits are
+ * used as follows:
+ * 00 - Normal
+ * 01 - Locked
+ * 11 - Locked and may have a thread waiting for lock
+ * 10 - Node is a forwarding node
+ *
+ * The lower 30 bits of each Node's hash field contain a
+ * transformation of the key's hash code, except for forwarding
+ * nodes, for which the lower bits are zero (and so always have
+ * hash field == MOVED).
*
* Insertion (via put or its variants) of the first node in an
* empty bin is performed by just CASing it to the bin. This is
@@ -149,15 +314,22 @@ public class ConcurrentHashMap8<K,V> implements ConcurrentMap<K,V>, Serializable
* delete, and replace) require locks. We do not want to waste
* the space required to associate a distinct lock object with
* each bin, so instead use the first node of a bin list itself as
- * a lock. Locking support for these locks relies on builtin
- * "synchronized" monitors.
+ * a lock. Blocking support for these locks relies on the builtin
+ * "synchronized" monitors. However, we also need a tryLock
+ * construction, so we overlay these by using bits of the Node
+ * hash field for lock control (see above), and so normally use
+ * builtin monitors only for blocking and signalling using
+ * wait/notifyAll constructions. See Node.tryAwaitLock.
*
* Using the first node of a list as a lock does not by itself
* suffice though: When a node is locked, any update must first
* validate that it is still the first node after locking it, and
* retry if not. Because new nodes are always appended to lists,
* once a node is first in a bin, it remains first until deleted
- * or the bin becomes invalidated (upon resizing).
+ * or the bin becomes invalidated (upon resizing). However,
+ * operations that only conditionally update may inspect nodes
+ * until the point of update. This is a converse of sorts to the
+ * lazy locking technique described by Herlihy & Shavit.
*
* The main disadvantage of per-bin locks is that other update
* operations on other nodes in a bin list protected by the same
@@ -190,12 +362,15 @@ public class ConcurrentHashMap8<K,V> implements ConcurrentMap<K,V>, Serializable
* sometimes deviate significantly from uniform randomness. This
* includes the case when N > (1<<30), so some keys MUST collide.
* Similarly for dumb or hostile usages in which multiple keys are
- * designed to have identical hash codes or ones that differs only
- * in masked-out high bits. So we use a secondary strategy that
- * applies when the number of nodes in a bin exceeds a
- * threshold. These TreeBins use a balanced tree to hold nodes (a
- * specialized form of red-black trees), bounding search time to
- * O(log N). Each search step in a TreeBin is at least twice as
+ * designed to have identical hash codes. Also, although we guard
+ * against the worst effects of this (see method spread), sets of
+ * hashes may differ only in bits that do not impact their bin
+ * index for a given power-of-two mask. So we use a secondary
+ * strategy that applies when the number of nodes in a bin exceeds
+ * a threshold, and at least one of the keys implements
+ * Comparable. These TreeBins use a balanced tree to hold nodes
+ * (a specialized form of red-black trees), bounding search time
+ * to O(log N). Each search step in a TreeBin is around twice as
* slow as in a regular list, but given that N cannot exceed
* (1<<64) (before running out of addresses) this bounds search
* steps, lock hold times, etc, to reasonable constants (roughly
@@ -206,50 +381,43 @@ public class ConcurrentHashMap8<K,V> implements ConcurrentMap<K,V>, Serializable
* iterators in the same way.
*
* The table is resized when occupancy exceeds a percentage
- * threshold (nominally, 0.75, but see below). Any thread
- * noticing an overfull bin may assist in resizing after the
- * initiating thread allocates and sets up the replacement array.
- * However, rather than stalling, these other threads may proceed
- * with insertions etc. The use of TreeBins shields us from the
- * worst case effects of overfilling while resizes are in
- * progress. Resizing proceeds by transferring bins, one by one,
- * from the table to the next table. However, threads claim small
- * blocks of indices to transfer (via field transferIndex) before
- * doing so, reducing contention. A generation stamp in field
- * sizeCtl ensures that resizings do not overlap. Because we are
- * using power-of-two expansion, the elements from each bin must
- * either stay at same index, or move with a power of two
- * offset. We eliminate unnecessary node creation by catching
- * cases where old nodes can be reused because their next fields
- * won't change. On average, only about one-sixth of them need
- * cloning when a table doubles. The nodes they replace will be
- * garbage collectable as soon as they are no longer referenced by
- * any reader thread that may be in the midst of concurrently
- * traversing table. Upon transfer, the old table bin contains
- * only a special forwarding node (with hash field "MOVED") that
- * contains the next table as its key. On encountering a
- * forwarding node, access and update operations restart, using
- * the new table.
- *
- * Each bin transfer requires its bin lock, which can stall
- * waiting for locks while resizing. However, because other
- * threads can join in and help resize rather than contend for
- * locks, average aggregate waits become shorter as resizing
- * progresses. The transfer operation must also ensure that all
- * accessible bins in both the old and new table are usable by any
- * traversal. This is arranged in part by proceeding from the
- * last bin (table.length - 1) up towards the first. Upon seeing
- * a forwarding node, traversals (see class Traverser) arrange to
- * move to the new table without revisiting nodes. To ensure that
- * no intervening nodes are skipped even when moved out of order,
- * a stack (see class TableStack) is created on first encounter of
- * a forwarding node during a traversal, to maintain its place if
- * later processing the current table. The need for these
- * save/restore mechanics is relatively rare, but when one
- * forwarding node is encountered, typically many more will be.
- * So Traversers use a simple caching scheme to avoid creating so
- * many new TableStack nodes. (Thanks to Peter Levart for
- * suggesting use of a stack here.)
+ * threshold (nominally, 0.75, but see below). Only a single
+ * thread performs the resize (using field "sizeCtl", to arrange
+ * exclusion), but the table otherwise remains usable for reads
+ * and updates. Resizing proceeds by transferring bins, one by
+ * one, from the table to the next table. Because we are using
+ * power-of-two expansion, the elements from each bin must either
+ * stay at same index, or move with a power of two offset. We
+ * eliminate unnecessary node creation by catching cases where old
+ * nodes can be reused because their next fields won't change. On
+ * average, only about one-sixth of them need cloning when a table
+ * doubles. The nodes they replace will be garbage collectable as
+ * soon as they are no longer referenced by any reader thread that
+ * may be in the midst of concurrently traversing table. Upon
+ * transfer, the old table bin contains only a special forwarding
+ * node (with hash field "MOVED") that contains the next table as
+ * its key. On encountering a forwarding node, access and update
+ * operations restart, using the new table.
+ *
+ * Each bin transfer requires its bin lock. However, unlike other
+ * cases, a transfer can skip a bin if it fails to acquire its
+ * lock, and revisit it later (unless it is a TreeBin). Method
+ * rebuild maintains a buffer of TRANSFER_BUFFER_SIZE bins that
+ * have been skipped because of failure to acquire a lock, and
+ * blocks only if none are available (i.e., only very rarely).
+ * The transfer operation must also ensure that all accessible
+ * bins in both the old and new table are usable by any traversal.
+ * When there are no lock acquisition failures, this is arranged
+ * simply by proceeding from the last bin (table.length - 1) up
+ * towards the first. Upon seeing a forwarding node, traversals
+ * (see class Iter) arrange to move to the new table
+ * without revisiting nodes. However, when any node is skipped
+ * during a transfer, all earlier table bins may have become
+ * visible, so are initialized with a reverse-forwarding node back
+ * to the old table until the new ones are established. (This
+ * sometimes requires transiently locking a forwarding node, which
+ * is possible under the above encoding.) These more expensive
+ * mechanics trigger only when necessary.
*
* The traversal scheme also applies to partial traversals of
* ranges of bins (via an alternate Traverser constructor)
@@ -264,54 +432,20 @@ public class ConcurrentHashMap8<K,V> implements ConcurrentMap<K,V>, Serializable
* These cases attempt to override the initial capacity settings,
* but harmlessly fail to take effect in cases of races.
*
- * The element count is maintained using a specialization of
- * LongAdder. We need to incorporate a specialization rather than
- * just use a LongAdder in order to access implicit
- * contention-sensing that leads to creation of multiple
- * CounterCells. The counter mechanics avoid contention on
- * updates but can encounter cache thrashing if read too
- * frequently during concurrent access. To avoid reading so often,
- * resizing under contention is attempted only upon adding to a
- * bin already holding two or more nodes. Under uniform hash
- * distributions, the probability of this occurring at threshold
- * is around 13%, meaning that only about 1 in 8 puts check
- * threshold (and after resizing, many fewer do so).
- *
- * TreeBins use a special form of comparison for search and
- * related operations (which is the main reason we cannot use
- * existing collections such as TreeMaps). TreeBins contain
- * Comparable elements, but may contain others, as well as
- * elements that are Comparable but not necessarily Comparable for
- * the same T, so we cannot invoke compareTo among them. To handle
- * this, the tree is ordered primarily by hash value, then by
- * Comparable.compareTo order if applicable. On lookup at a node,
- * if elements are not comparable or compare as 0 then both left
- * and right children may need to be searched in the case of tied
- * hash values. (This corresponds to the full list search that
- * would be necessary if all elements were non-Comparable and had
- * tied hashes.) On insertion, to keep a total ordering (or as
- * close as is required here) across rebalancings, we compare
- * classes and identityHashCodes as tie-breakers. The red-black
- * balancing code is updated from pre-jdk-collections
- * (http://gee.cs.oswego.edu/dl/classes/collections/RBCell.java)
- * based in turn on Cormen, Leiserson, and Rivest "Introduction to
- * Algorithms" (CLR).
- *
- * TreeBins also require an additional locking mechanism. While
- * list traversal is always possible by readers even during
- * updates, tree traversal is not, mainly because of tree-rotations
- * that may change the root node and/or its linkages. TreeBins
- * include a simple read-write lock mechanism parasitic on the
- * main bin-synchronization strategy: Structural adjustments
- * associated with an insertion or removal are already bin-locked
- * (and so cannot conflict with other writers) but must wait for
- * ongoing readers to finish. Since there can be only one such
- * waiter, we use a simple scheme using a single "waiter" field to
- * block writers. However, readers need never block. If the root
- * lock is held, they proceed along the slow traversal path (via
- * next-pointers) until the lock becomes available or the list is
- * exhausted, whichever comes first. These cases are not fast, but
- * maximize aggregate expected throughput.
+ * The element count is maintained using a LongAdder8, which avoids
+ * contention on updates but can encounter cache thrashing if read
+ * too frequently during concurrent access. To avoid reading so
+ * often, resizing is attempted either when a bin lock is
+ * contended, or upon adding to a bin already holding two or more
+ * nodes (checked before adding in the xIfAbsent methods, after
+ * adding in others). Under uniform hash distributions, the
+ * probability of this occurring at threshold is around 13%,
+ * meaning that only about 1 in 8 puts check threshold (and after
+ * resizing, many fewer do so). But this approximation has high
+ * variance for small table sizes, so we check on any collision
+ * for sizes <= 64. The bulk putAll operation further reduces
+ * contention by only committing count updates upon these size
+ * checks.
*
* Maintaining API and serialization compatibility with previous
* versions of this class introduces several oddities. Mainly: We
@@ -321,20 +455,8 @@ public class ConcurrentHashMap8<K,V> implements ConcurrentMap<K,V>, Serializable
* time that we can guarantee to honor it.) We also declare an
* unused "Segment" class that is instantiated in minimal form
* only when serializing.
- *
- * Also, solely for compatibility with previous versions of this
- * class, it extends AbstractMap, even though all of its methods
- * are overridden, so it is just useless baggage.
- *
- * This file is organized to make things a little easier to follow
- * while reading than they might otherwise: First the main static
- * declarations and utilities, then fields, then main public
- * methods (with a few factorings of multiple public methods into
- * internal ones), then sizing methods, trees, traversers, and
- * bulk operations.
*/
-
/* ---------------- Constants -------------- */
/**
@@ -374,2362 +496,2737 @@ public class ConcurrentHashMap8<K,V> implements ConcurrentMap<K,V>, Serializable
private static final float LOAD_FACTOR = 0.75f;
/**
- * The bin count threshold for using a tree rather than list for a
- * bin. Bins are converted to trees when adding an element to a
- * bin with at least this many nodes. The value must be greater
- * than 2, and should be at least 8 to mesh with assumptions in
- * tree removal about conversion back to plain bins upon
- * shrinkage.
+ * The buffer size for skipped bins during transfers. The
+ * value is arbitrary but should be large enough to avoid
+ * most locking stalls during resizes.
*/
- static final int TREEIFY_THRESHOLD = 8;
+ private static final int TRANSFER_BUFFER_SIZE = 32;
/**
- * The bin count threshold for untreeifying a (split) bin during a
- * resize operation. Should be less than TREEIFY_THRESHOLD, and at
- * most 6 to mesh with shrinkage detection under removal.
+ * The bin count threshold for using a tree rather than list for a
+ * bin. The value reflects the approximate break-even point for
+ * using tree-based operations.
*/
- static final int UNTREEIFY_THRESHOLD = 6;
+ private static final int TREE_THRESHOLD = 8;
- /**
- * The smallest table capacity for which bins may be treeified.
- * (Otherwise the table is resized if too many nodes in a bin.)
- * The value should be at least 4 * TREEIFY_THRESHOLD to avoid
- * conflicts between resizing and treeification thresholds.
+ /*
+ * Encodings for special uses of Node hash fields. See above for
+ * explanation.
*/
- static final int MIN_TREEIFY_CAPACITY = 64;
+ static final int MOVED = 0x80000000; // hash field for forwarding nodes
+ static final int LOCKED = 0x40000000; // set/tested only as a bit
+ static final int WAITING = 0xc0000000; // both bits set/tested together
+ static final int HASH_BITS = 0x3fffffff; // usable bits of normal node hash
- /**
- * Minimum number of rebinnings per transfer step. Ranges are
- * subdivided to allow multiple resizer threads. This value
- * serves as a lower bound to avoid resizers encountering
- * excessive memory contention. The value should be at least
- * DEFAULT_CAPACITY.
- */
- private static final int MIN_TRANSFER_STRIDE = 16;
+ /* ---------------- Fields -------------- */
/**
- * The number of bits used for generation stamp in sizeCtl.
- * Must be at least 6 for 32bit arrays.
+ * The array of bins. Lazily initialized upon first insertion.
+ * Size is always a power of two. Accessed directly by iterators.
*/
- private static int RESIZE_STAMP_BITS = 16;
+ transient volatile Node[] table;
/**
- * The maximum number of threads that can help resize.
- * Must fit in 32 - RESIZE_STAMP_BITS bits.
+ * The counter maintaining number of elements.
*/
- private static final int MAX_RESIZERS = (1 << (32 - RESIZE_STAMP_BITS)) - 1;
+ private transient final LongAdder8 counter;
/**
- * The bit shift for recording size stamp in sizeCtl.
+ * Table initialization and resizing control. When negative, the
+ * table is being initialized or resized. Otherwise, when table is
+ * null, holds the initial table size to use upon creation, or 0
+ * for default. After initialization, holds the next element count
+ * value upon which to resize the table.
*/
- private static final int RESIZE_STAMP_SHIFT = 32 - RESIZE_STAMP_BITS;
+ private transient volatile int sizeCtl;
+
+ // views
+ private transient KeySetView<K,V> keySet;
+ private transient ValuesView<K,V> values;
+ private transient EntrySetView<K,V> entrySet;
+
+ /** For serialization compatibility. Null unless serialized; see below */
+ private Segment<K,V>[] segments;
+
+ /* ---------------- Table element access -------------- */
/*
- * Encodings for Node hash fields. See above for explanation.
+ * Volatile access methods are used for table elements as well as
+ * elements of in-progress next table while resizing. Uses are
+ * null checked by callers, and implicitly bounds-checked, relying
+ * on the invariants that tab arrays have non-zero size, and all
+ * indices are masked with (tab.length - 1) which is never
+ * negative and always less than length. Note that, to be correct
+ * wrt arbitrary concurrency errors by users, bounds checks must
+ * operate on local variables, which accounts for some odd-looking
+ * inline assignments below.
*/
- static final int MOVED = 0x8fffffff; // (-1) hash for forwarding nodes
- static final int TREEBIN = 0x80000000; // hash for roots of trees
- static final int RESERVED = 0x80000001; // hash for transient reservations
- static final int HASH_BITS = 0x7fffffff; // usable bits of normal node hash
- /** Number of CPUS, to place bounds on some sizings */
- static final int NCPU = Runtime.getRuntime().availableProcessors();
+ static final Node tabAt(Node[] tab, int i) { // used by Iter
+ return (Node)UNSAFE.getObjectVolatile(tab, ((long)i<<ASHIFT)+ABASE);
+ }
+
+ private static final boolean casTabAt(Node[] tab, int i, Node c, Node v) {
+ return UNSAFE.compareAndSwapObject(tab, ((long)i<<ASHIFT)+ABASE, c, v);
+ }
- /** For serialization compatibility. */
- private static final ObjectStreamField[] serialPersistentFields = {
- new ObjectStreamField("segments", Segment[].class),
- new ObjectStreamField("segmentMask", Integer.TYPE),
- new ObjectStreamField("segmentShift", Integer.TYPE)
- };
+ private static final void setTabAt(Node[] tab, int i, Node v) {
+ UNSAFE.putObjectVolatile(tab, ((long)i<<ASHIFT)+ABASE, v);
+ }
/* ---------------- Nodes -------------- */
/**
- * Key-value entry. This class is never exported out as a
- * user-mutable Map.Entry (i.e., one supporting setValue; see
- * MapEntry below), but can be used for read-only traversals used
- * in bulk tasks. Subclasses of Node with a negative hash field
- * are special, and contain null keys and values (but are never
- * exported). Otherwise, keys and vals are never null.
+ * Key-value entry. Note that this is never exported out as a
+ * user-visible Map.Entry (see MapEntry below). Nodes with a hash
+ * field of MOVED are special, and do not contain user keys or
+ * values. Otherwise, keys are never null, and null val fields
+ * indicate that a node is in the process of being deleted or
+ * created. For purposes of read-only access, a key may be read
+ * before a val, but can only be used after checking val to be
+ * non-null.
*/
- static class Node<K,V> implements Map.Entry<K,V> {
- final int hash;
- final K key;
- volatile V val;
- Node<K,V> next;
+ static class Node {
+ volatile int hash;
+ final Object key;
+ volatile Object val;
+ volatile Node next;
- Node(int hash, K key, V val, Node<K,V> next) {
+ Node(int hash, Object key, Object val, Node next) {
this.hash = hash;
this.key = key;
this.val = val;
this.next = next;
}
- public final K getKey() { return key; }
- public final V getValue() { return val; }
- public final int hashCode() { return key.hashCode() ^ val.hashCode(); }
- public final String toString(){ return key + "=" + val; }
- public final V setValue(V value) {
- throw new UnsupportedOperationException();
+ /** CompareAndSet the hash field */
+ final boolean casHash(int cmp, int val) {
+ return UNSAFE.compareAndSwapInt(this, hashOffset, cmp, val);
}
- public final boolean equals(Object o) {
- Object k, v, u; Map.Entry<?,?> e;
- return ((o instanceof Map.Entry) &&
- (k = (e = (Map.Entry<?,?>)o).getKey()) != null &&
- (v = e.getValue()) != null &&
- (k == key || k.equals(key)) &&
- (v == (u = val) || v.equals(u)));
- }
+ /** The number of spins before blocking for a lock */
+ static final int MAX_SPINS =
+ Runtime.getRuntime().availableProcessors() > 1 ? 64 : 1;
/**
- * Virtualized support for map.get(); overridden in subclasses.
+ * Spins a while if LOCKED bit set and this node is the first
+ * of its bin, and then sets WAITING bits on hash field and
+ * blocks (once) if they are still set. It is OK for this
+ * method to return even if lock is not available upon exit,
+ * which enables these simple single-wait mechanics.
+ *
+ * The corresponding signalling operation is performed within
+ * callers: Upon detecting that WAITING has been set when
+ * unlocking lock (via a failed CAS from non-waiting LOCKED
+ * state), unlockers acquire the sync lock and perform a
+ * notifyAll.
+ *
+ * The initial sanity check on tab and bounds is not currently
+ * necessary in the only usages of this method, but enables
+ * use in other future contexts.
*/
- Node<K,V> find(int h, Object k) {
- Node<K,V> e = this;
- if (k != null) {
- do {
- K ek;
- if (e.hash == h &&
- ((ek = e.key) == k || (ek != null && k.equals(ek))))
- return e;
- } while ((e = e.next) != null);
+ final void tryAwaitLock(Node[] tab, int i) {
+ if (tab != null && i >= 0 && i < tab.length) { // sanity check
+ int r = ThreadLocalRandom8.current().nextInt(); // randomize spins
+ int spins = MAX_SPINS, h;
+ while (tabAt(tab, i) == this && ((h = hash) & LOCKED) != 0) {
+ if (spins >= 0) {
+ r ^= r << 1; r ^= r >>> 3; r ^= r << 10; // xorshift
+ if (r >= 0 && --spins == 0)
+ Thread.yield(); // yield before block
+ }
+ else if (casHash(h, h | WAITING)) {
+ synchronized (this) {
+ if (tabAt(tab, i) == this &&
+ (hash & WAITING) == WAITING) {
+ try {
+ wait();
+ } catch (InterruptedException ie) {
+ try {
+ Thread.currentThread().interrupt();
+ } catch (SecurityException ignore) {
+ }
+ }
+ }
+ else
+ notifyAll(); // possibly won race vs signaller
+ }
+ break;
+ }
+ }
}
- return null;
}
- }
- /* ---------------- Static utilities -------------- */
-
- /**
- * Spreads (XORs) higher bits of hash to lower and also forces top
- * bit to 0. Because the table uses power-of-two masking, sets of
- * hashes that vary only in bits above the current mask will
- * always collide. (Among known examples are sets of Float keys
- * holding consecutive whole numbers in small tables.) So we
- * apply a transform that spreads the impact of higher bits
- * downward. There is a tradeoff between speed, utility, and
- * quality of bit-spreading. Because many common sets of hashes
- * are already reasonably distributed (so don't benefit from
- * spreading), and because we use trees to handle large sets of
- * collisions in bins, we just XOR some shifted bits in the
- * cheapest possible way to reduce systematic lossage, as well as
- * to incorporate impact of the highest bits that would otherwise
- * never be used in index calculations because of table bounds.
- */
- static final int spread(int h) {
- return (h ^ (h >>> 16)) & HASH_BITS;
- }
+ // Unsafe mechanics for casHash
+ private static final sun.misc.Unsafe UNSAFE;
+ private static final long hashOffset;
- /**
- * Returns a power of two table size for the given desired capacity.
- * See Hackers Delight, sec 3.2
- */
- private static final int tableSizeFor(int c) {
- int n = c - 1;
- n |= n >>> 1;
- n |= n >>> 2;
- n |= n >>> 4;
- n |= n >>> 8;
- n |= n >>> 16;
- return (n < 0) ? 1 : (n >= MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : n + 1;
- }
-
- /**
- * Returns x's Class if it is of the form "class C implements
- * Comparable<C>", else null.
- */
- static Class<?> comparableClassFor(Object x) {
- if (x instanceof Comparable) {
- Class<?> c; Type[] ts, as; Type t; ParameterizedType p;
- if ((c = x.getClass()) == String.class) // bypass checks
- return c;
- if ((ts = c.getGenericInterfaces()) != null) {
- for (int i = 0; i < ts.length; ++i) {
- if (((t = ts[i]) instanceof ParameterizedType) &&
- ((p = (ParameterizedType)t).getRawType() ==
- Comparable.class) &&
- (as = p.getActualTypeArguments()) != null &&
- as.length == 1 && as[0] == c) // type arg is c
- return c;
- }
+ static {
+ try {
+ UNSAFE = getUnsafe();
+ Class<?> k = Node.class;
+ hashOffset = UNSAFE.objectFieldOffset
+ (k.getDeclaredField("hash"));
+ } catch (Exception e) {
+ throw new Error(e);
}
}
- return null;
- }
-
- /**
- * Returns k.compareTo(x) if x matches kc (k's screened comparable
- * class), else 0.
- */
- @SuppressWarnings({"rawtypes","unchecked"}) // for cast to Comparable
- static int compareComparables(Class<?> kc, Object k, Object x) {
- return (x == null || x.getClass() != kc ? 0 :
- ((Comparable)k).compareTo(x));
- }
-
- /* ---------------- Table element access -------------- */
-
- /*
- * Volatile access methods are used for table elements as well as
- * elements of in-progress next table while resizing. All uses of
- * the tab arguments must be null checked by callers. All callers
- * also paranoically precheck that tab's length is not zero (or an
- * equivalent check), thus ensuring that any index argument taking
- * the form of a hash value anded with (length - 1) is a valid
- * index. Note that, to be correct wrt arbitrary concurrency
- * errors by users, these checks must operate on local variables,
- * which accounts for some odd-looking inline assignments below.
- * Note that calls to setTabAt always occur within locked regions,
- * and so do not need full volatile semantics, but still require
- * ordering to maintain concurrent readability.
- */
-
- @SuppressWarnings("unchecked")
- static final <K,V> Node<K,V> tabAt(Node<K,V>[] tab, int i) {
- return (Node<K,V>)U.getObjectVolatile(tab, ((long)i << ASHIFT) + ABASE);
- }
-
- static final <K,V> boolean casTabAt(Node<K,V>[] tab, int i,
- Node<K,V> c, Node<K,V> v) {
- return U.compareAndSwapObject(tab, ((long)i << ASHIFT) + ABASE, c, v);
}
- static final <K,V> void setTabAt(Node<K,V>[] tab, int i, Node<K,V> v) {
- U.putOrderedObject(tab, ((long)i << ASHIFT) + ABASE, v);
- }
-
- /* ---------------- Fields -------------- */
-
- /**
- * The array of bins. Lazily initialized upon first insertion.
- * Size is always a power of two. Accessed directly by iterators.
- */
- transient volatile Node<K,V>[] table;
+ /* ---------------- TreeBins -------------- */
/**
- * The next table to use; non-null only while resizing.
+ * Nodes for use in TreeBins
*/
- private transient volatile Node<K,V>[] nextTable;
+ static final class TreeNode extends Node {
+ TreeNode parent; // red-black tree links
+ TreeNode left;
+ TreeNode right;
+ TreeNode prev; // needed to unlink next upon deletion
+ boolean red;
- /**
- * Base counter value, used mainly when there is no contention,
- * but also as a fallback during table initialization
- * races. Updated via CAS.
- */
- private transient volatile long baseCount;
+ TreeNode(int hash, Object key, Object val, Node next, TreeNode parent) {
+ super(hash, key, val, next);
+ this.parent = parent;
+ }
+ }
/**
- * Table initialization and resizing control. When negative, the
- * table is being initialized or resized: -1 for initialization,
- * else -(1 + the number of active resizing threads). Otherwise,
- * when table is null, holds the initial table size to use upon
- * creation, or 0 for default. After initialization, holds the
- * next element count value upon which to resize the table.
- */
- private transient volatile int sizeCtl;
+ * A specialized form of red-black tree for use in bins
+ * whose size exceeds a threshold.
+ *
+ * TreeBins use a special form of comparison for search and
+ * related operations (which is the main reason we cannot use
+ * existing collections such as TreeMaps). TreeBins contain
+ * Comparable elements, but may contain others, as well as
+ * elements that are Comparable but not necessarily Comparable<T>
+ * for the same T, so we cannot invoke compareTo among them. To
+ * handle this, the tree is ordered primarily by hash value, then
+ * by getClass().getName() order, and then by Comparator order
+ * among elements of the same class. On lookup at a node, if
+ * elements are not comparable or compare as 0, both left and
+ * right children may need to be searched in the case of tied hash
+ * values. (This corresponds to the full list search that would be
+ * necessary if all elements were non-Comparable and had tied
+ * hashes.) The red-black balancing code is updated from
+ * pre-jdk-collections
+ * (http://gee.cs.oswego.edu/dl/classes/collections/RBCell.java)
+ * based in turn on Cormen, Leiserson, and Rivest "Introduction to
+ * Algorithms" (CLR).
+ *
+ * TreeBins also maintain a separate locking discipline than
+ * regular bins. Because they are forwarded via special MOVED
+ * nodes at bin heads (which can never change once established),
+ * we cannot use those nodes as locks. Instead, TreeBin
+ * extends AbstractQueuedSynchronizer to support a simple form of
+ * read-write lock. For update operations and table validation,
+ * the exclusive form of lock behaves in the same way as bin-head
+ * locks. However, lookups use shared read-lock mechanics to allow
+ * multiple readers in the absence of writers. Additionally,
+ * these lookups do not ever block: While the lock is not
+ * available, they proceed along the slow traversal path (via
+ * next-pointers) until the lock becomes available or the list is
+ * exhausted, whichever comes first. (These cases are not fast,
+ * but maximize aggregate expected throughput.) The AQS mechanics
+ * for doing this are straightforward. The lock state is held as
+ * AQS getState(). Read counts are negative; the write count (1)
+ * is positive. There are no signalling preferences among readers
+ * and writers. Since we don't need to export full Lock API, we
+ * just override the minimal AQS methods and use them directly.
+ */
+ static final class TreeBin extends AbstractQueuedSynchronizer {
+ private static final long serialVersionUID = 2249069246763182397L;
+ transient TreeNode root; // root of tree
+ transient TreeNode first; // head of next-pointer list
+
+ /* AQS overrides */
+ public final boolean isHeldExclusively() { return getState() > 0; }
+ public final boolean tryAcquire(int ignore) {
+ if (compareAndSetState(0, 1)) {
+ setExclusiveOwnerThread(Thread.currentThread());
+ return true;
+ }
+ return false;
+ }
+ public final boolean tryRelease(int ignore) {
+ setExclusiveOwnerThread(null);
+ setState(0);
+ return true;
+ }
+ public final int tryAcquireShared(int ignore) {
+ for (int c;;) {
+ if ((c = getState()) > 0)
+ return -1;
+ if (compareAndSetState(c, c -1))
+ return 1;
+ }
+ }
+ public final boolean tryReleaseShared(int ignore) {
+ int c;
+ do {} while (!compareAndSetState(c = getState(), c + 1));
+ return c == -1;
+ }
- /**
- * The next table index (plus one) to split while resizing.
- */
- private transient volatile int transferIndex;
+ /** From CLR */
+ private void rotateLeft(TreeNode p) {
+ if (p != null) {
+ TreeNode r = p.right, pp, rl;
+ if ((rl = p.right = r.left) != null)
+ rl.parent = p;
+ if ((pp = r.parent = p.parent) == null)
+ root = r;
+ else if (pp.left == p)
+ pp.left = r;
+ else
+ pp.right = r;
+ r.left = p;
+ p.parent = r;
+ }
+ }
- /**
- * Spinlock (locked via CAS) used when resizing and/or creating CounterCells.
- */
- private transient volatile int cellsBusy;
+ /** From CLR */
+ private void rotateRight(TreeNode p) {
+ if (p != null) {
+ TreeNode l = p.left, pp, lr;
+ if ((lr = p.left = l.right) != null)
+ lr.parent = p;
+ if ((pp = l.parent = p.parent) == null)
+ root = l;
+ else if (pp.right == p)
+ pp.right = l;
+ else
+ pp.left = l;
+ l.right = p;
+ p.parent = l;
+ }
+ }
- /**
- * Table of counter cells. When non-null, size is a power of 2.
- */
- private transient volatile CounterCell[] counterCells;
+ /**
+ * Returns the TreeNode (or null if not found) for the given key
+ * starting at given root.
+ */
+ @SuppressWarnings("unchecked") final TreeNode getTreeNode
+ (int h, Object k, TreeNode p) {
+ Class<?> c = k.getClass();
+ while (p != null) {
+ int dir, ph; Object pk; Class<?> pc;
+ if ((ph = p.hash) == h) {
+ if ((pk = p.key) == k || k.equals(pk))
+ return p;
+ if (c != (pc = pk.getClass()) ||
+ !(k instanceof Comparable) ||
+ (dir = ((Comparable)k).compareTo((Comparable)pk)) == 0) {
+ dir = (c == pc) ? 0 : c.getName().compareTo(pc.getName());
+ TreeNode r = null, s = null, pl, pr;
+ if (dir >= 0) {
+ if ((pl = p.left) != null && h <= pl.hash)
+ s = pl;
+ }
+ else if ((pr = p.right) != null && h >= pr.hash)
+ s = pr;
+ if (s != null && (r = getTreeNode(h, k, s)) != null)
+ return r;
+ }
+ }
+ else
+ dir = (h < ph) ? -1 : 1;
+ p = (dir > 0) ? p.right : p.left;
+ }
+ return null;
+ }
- // views
- private transient KeySetView<K,V> keySet;
- private transient ValuesView<K,V> values;
- private transient EntrySetView<K,V> entrySet;
+ /**
+ * Wrapper for getTreeNode used by CHM.get. Tries to obtain
+ * read-lock to call getTreeNode, but during failure to get
+ * lock, searches along next links.
+ */
+ final Object getValue(int h, Object k) {
+ Node r = null;
+ int c = getState(); // Must read lock state first
+ for (Node e = first; e != null; e = e.next) {
+ if (c <= 0 && compareAndSetState(c, c - 1)) {
+ try {
+ r = getTreeNode(h, k, root);
+ } finally {
+ releaseShared(0);
+ }
+ break;
+ }
+ else if ((e.hash & HASH_BITS) == h && k.equals(e.key)) {
+ r = e;
+ break;
+ }
+ else
+ c = getState();
+ }
+ return r == null ? null : r.val;
+ }
+ /**
+ * Finds or adds a node.
+ * @return null if added
+ */
+ @SuppressWarnings("unchecked") final TreeNode putTreeNode
+ (int h, Object k, Object v) {
+ Class<?> c = k.getClass();
+ TreeNode pp = root, p = null;
+ int dir = 0;
+ while (pp != null) { // find existing node or leaf to insert at
+ int ph; Object pk; Class<?> pc;
+ p = pp;
+ if ((ph = p.hash) == h) {
+ if ((pk = p.key) == k || k.equals(pk))
+ return p;
+ if (c != (pc = pk.getClass()) ||
+ !(k instanceof Comparable) ||
+ (dir = ((Comparable)k).compareTo((Comparable)pk)) == 0) {
+ dir = (c == pc) ? 0 : c.getName().compareTo(pc.getName());
+ TreeNode r = null, s = null, pl, pr;
+ if (dir >= 0) {
+ if ((pl = p.left) != null && h <= pl.hash)
+ s = pl;
+ }
+ else if ((pr = p.right) != null && h >= pr.hash)
+ s = pr;
+ if (s != null && (r = getTreeNode(h, k, s)) != null)
+ return r;
+ }
+ }
+ else
+ dir = (h < ph) ? -1 : 1;
+ pp = (dir > 0) ? p.right : p.left;
+ }
- /* ---------------- Public operations -------------- */
+ TreeNode f = first;
+ TreeNode x = first = new TreeNode(h, k, v, f, p);
+ if (p == null)
+ root = x;
+ else { // attach and rebalance; adapted from CLR
+ TreeNode xp, xpp;
+ if (f != null)
+ f.prev = x;
+ if (dir <= 0)
+ p.left = x;
+ else
+ p.right = x;
+ x.red = true;
+ while (x != null && (xp = x.parent) != null && xp.red &&
+ (xpp = xp.parent) != null) {
+ TreeNode xppl = xpp.left;
+ if (xp == xppl) {
+ TreeNode y = xpp.right;
+ if (y != null && y.red) {
+ y.red = false;
+ xp.red = false;
+ xpp.red = true;
+ x = xpp;
+ }
+ else {
+ if (x == xp.right) {
+ rotateLeft(x = xp);
+ xpp = (xp = x.parent) == null ? null : xp.parent;
+ }
+ if (xp != null) {
+ xp.red = false;
+ if (xpp != null) {
+ xpp.red = true;
+ rotateRight(xpp);
+ }
+ }
+ }
+ }
+ else {
+ TreeNode y = xppl;
+ if (y != null && y.red) {
+ y.red = false;
+ xp.red = false;
+ xpp.red = true;
+ x = xpp;
+ }
+ else {
+ if (x == xp.left) {
+ rotateRight(x = xp);
+ xpp = (xp = x.parent) == null ? null : xp.parent;
+ }
+ if (xp != null) {
+ xp.red = false;
+ if (xpp != null) {
+ xpp.red = true;
+ rotateLeft(xpp);
+ }
+ }
+ }
+ }
+ }
+ TreeNode r = root;
+ if (r != null && r.red)
+ r.red = false;
+ }
+ return null;
+ }
- /**
- * Creates a new, empty map with the default initial table size (16).
- */
- public ConcurrentHashMap8() {
- }
-
- /**
- * Creates a new, empty map with an initial table size
- * accommodating the specified number of elements without the need
- * to dynamically resize.
- *
- * @param initialCapacity The implementation performs internal
- * sizing to accommodate this many elements.
- * @throws IllegalArgumentException if the initial capacity of
- * elements is negative
- */
- public ConcurrentHashMap8(int initialCapacity) {
- if (initialCapacity < 0)
- throw new IllegalArgumentException();
- int cap = ((initialCapacity >= (MAXIMUM_CAPACITY >>> 1)) ?
- MAXIMUM_CAPACITY :
- tableSizeFor(initialCapacity + (initialCapacity >>> 1) + 1));
- this.sizeCtl = cap;
- }
-
- /**
- * Creates a new map with the same mappings as the given map.
- *
- * @param m the map
- */
- public ConcurrentHashMap8(Map<? extends K, ? extends V> m) {
- this.sizeCtl = DEFAULT_CAPACITY;
- putAll(m);
+ /**
+ * Removes the given node, that must be present before this
+ * call. This is messier than typical red-black deletion code
+ * because we cannot swap the contents of an interior node
+ * with a leaf successor that is pinned by "next" pointers
+ * that are accessible independently of lock. So instead we
+ * swap the tree linkages.
+ */
+ final void deleteTreeNode(TreeNode p) {
+ TreeNode next = (TreeNode)p.next; // unlink traversal pointers
+ TreeNode pred = p.prev;
+ if (pred == null)
+ first = next;
+ else
+ pred.next = next;
+ if (next != null)
+ next.prev = pred;
+ TreeNode replacement;
+ TreeNode pl = p.left;
+ TreeNode pr = p.right;
+ if (pl != null && pr != null) {
+ TreeNode s = pr, sl;
+ while ((sl = s.left) != null) // find successor
+ s = sl;
+ boolean c = s.red; s.red = p.red; p.red = c; // swap colors
+ TreeNode sr = s.right;
+ TreeNode pp = p.parent;
+ if (s == pr) { // p was s's direct parent
+ p.parent = s;
+ s.right = p;
+ }
+ else {
+ TreeNode sp = s.parent;
+ if ((p.parent = sp) != null) {
+ if (s == sp.left)
+ sp.left = p;
+ else
+ sp.right = p;
+ }
+ if ((s.right = pr) != null)
+ pr.parent = s;
+ }
+ p.left = null;
+ if ((p.right = sr) != null)
+ sr.parent = p;
+ if ((s.left = pl) != null)
+ pl.parent = s;
+ if ((s.parent = pp) == null)
+ root = s;
+ else if (p == pp.left)
+ pp.left = s;
+ else
+ pp.right = s;
+ replacement = sr;
+ }
+ else
+ replacement = (pl != null) ? pl : pr;
+ TreeNode pp = p.parent;
+ if (replacement == null) {
+ if (pp == null) {
+ root = null;
+ return;
+ }
+ replacement = p;
+ }
+ else {
+ replacement.parent = pp;
+ if (pp == null)
+ root = replacement;
+ else if (p == pp.left)
+ pp.left = replacement;
+ else
+ pp.right = replacement;
+ p.left = p.right = p.parent = null;
+ }
+ if (!p.red) { // rebalance, from CLR
+ TreeNode x = replacement;
+ while (x != null) {
+ TreeNode xp, xpl;
+ if (x.red || (xp = x.parent) == null) {
+ x.red = false;
+ break;
+ }
+ if (x == (xpl = xp.left)) {
+ TreeNode sib = xp.right;
+ if (sib != null && sib.red) {
+ sib.red = false;
+ xp.red = true;
+ rotateLeft(xp);
+ sib = (xp = x.parent) == null ? null : xp.right;
+ }
+ if (sib == null)
+ x = xp;
+ else {
+ TreeNode sl = sib.left, sr = sib.right;
+ if ((sr == null || !sr.red) &&
+ (sl == null || !sl.red)) {
+ sib.red = true;
+ x = xp;
+ }
+ else {
+ if (sr == null || !sr.red) {
+ if (sl != null)
+ sl.red = false;
+ sib.red = true;
+ rotateRight(sib);
+ sib = (xp = x.parent) == null ? null : xp.right;
+ }
+ if (sib != null) {
+ sib.red = (xp == null) ? false : xp.red;
+ if ((sr = sib.right) != null)
+ sr.red = false;
+ }
+ if (xp != null) {
+ xp.red = false;
+ rotateLeft(xp);
+ }
+ x = root;
+ }
+ }
+ }
+ else { // symmetric
+ TreeNode sib = xpl;
+ if (sib != null && sib.red) {
+ sib.red = false;
+ xp.red = true;
+ rotateRight(xp);
+ sib = (xp = x.parent) == null ? null : xp.left;
+ }
+ if (sib == null)
+ x = xp;
+ else {
+ TreeNode sl = sib.left, sr = sib.right;
+ if ((sl == null || !sl.red) &&
+ (sr == null || !sr.red)) {
+ sib.red = true;
+ x = xp;
+ }
+ else {
+ if (sl == null || !sl.red) {
+ if (sr != null)
+ sr.red = false;
+ sib.red = true;
+ rotateLeft(sib);
+ sib = (xp = x.parent) == null ? null : xp.left;
+ }
+ if (sib != null) {
+ sib.red = (xp == null) ? false : xp.red;
+ if ((sl = sib.left) != null)
+ sl.red = false;
+ }
+ if (xp != null) {
+ xp.red = false;
+ rotateRight(xp);
+ }
+ x = root;
+ }
+ }
+ }
+ }
+ }
+ if (p == replacement && (pp = p.parent) != null) {
+ if (p == pp.left) // detach pointers
+ pp.left = null;
+ else if (p == pp.right)
+ pp.right = null;
+ p.parent = null;
+ }
+ }
}
- /**
- * Creates a new, empty map with an initial table size based on
- * the given number of elements ({@code initialCapacity}) and
- * initial table density ({@code loadFactor}).
- *
- * @param initialCapacity the initial capacity. The implementation
- * performs internal sizing to accommodate this many elements,
- * given the specified load factor.
- * @param loadFactor the load factor (table density) for
- * establishing the initial table size
- * @throws IllegalArgumentException if the initial capacity of
- * elements is negative or the load factor is nonpositive
- *
- * @since 1.6
- */
- public ConcurrentHashMap8(int initialCapacity, float loadFactor) {
- this(initialCapacity, loadFactor, 1);
- }
+ /* ---------------- Collision reduction methods -------------- */
/**
- * Creates a new, empty map with an initial table size based on
- * the given number of elements ({@code initialCapacity}), table
- * density ({@code loadFactor}), and number of concurrently
- * updating threads ({@code concurrencyLevel}).
- *
- * @param initialCapacity the initial capacity. The implementation
- * performs internal sizing to accommodate this many elements,
- * given the specified load factor.
- * @param loadFactor the load factor (table density) for
- * establishing the initial table size
- * @param concurrencyLevel the estimated number of concurrently
- * updating threads. The implementation may use this value as
- * a sizing hint.
- * @throws IllegalArgumentException if the initial capacity is
- * negative or the load factor or concurrencyLevel are
- * nonpositive
+ * Spreads higher bits to lower, and also forces top 2 bits to 0.
+ * Because the table uses power-of-two masking, sets of hashes
+ * that vary only in bits above the current mask will always
+ * collide. (Among known examples are sets of Float keys holding
+ * consecutive whole numbers in small tables.) To counter this,
+ * we apply a transform that spreads the impact of higher bits
+ * downward. There is a tradeoff between speed, utility, and
+ * quality of bit-spreading. Because many common sets of hashes
+ * are already reasonably distributed across bits (so don't benefit
+ * from spreading), and because we use trees to handle large sets
+ * of collisions in bins, we don't need excessively high quality.
*/
- public ConcurrentHashMap8(int initialCapacity,
- float loadFactor, int concurrencyLevel) {
- if (!(loadFactor > 0.0f) || initialCapacity < 0 || concurrencyLevel <= 0)
- throw new IllegalArgumentException();
- if (initialCapacity < concurrencyLevel) // Use at least as many bins
- initialCapacity = concurrencyLevel; // as estimated threads
- long size = (long)(1.0 + (long)initialCapacity / loadFactor);
- int cap = (size >= (long)MAXIMUM_CAPACITY) ?
- MAXIMUM_CAPACITY : tableSizeFor((int)size);
- this.sizeCtl = cap;
+ private static final int spread(int h) {
+ h ^= (h >>> 18) ^ (h >>> 12);
+ return (h ^ (h >>> 10)) & HASH_BITS;
}
- // Original (since JDK1.2) Map methods
-
/**
- * {@inheritDoc}
+ * Replaces a list bin with a tree bin. Call only when locked.
+ * Fails to replace if the given key is non-comparable or table
+ * is, or needs, resizing.
*/
- public int size() {
- long n = sumCount();
- return ((n < 0L) ? 0 :
- (n > (long)Integer.MAX_VALUE) ? Integer.MAX_VALUE :
- (int)n);
+ private final void replaceWithTreeBin(Node[] tab, int index, Object key) {
+ if ((key instanceof Comparable) &&
+ (tab.length >= MAXIMUM_CAPACITY || counter.sum() < (long)sizeCtl)) {
+ TreeBin t = new TreeBin();
+ for (Node e = tabAt(tab, index); e != null; e = e.next)
+ t.putTreeNode(e.hash & HASH_BITS, e.key, e.val);
+ setTabAt(tab, index, new Node(MOVED, t, null, null));
+ }
}
- /**
- * {@inheritDoc}
- */
- public boolean isEmpty() {
- return sumCount() <= 0L; // ignore transient negative values
- }
+ /* ---------------- Internal access and update methods -------------- */
- /**
- * Returns the value to which the specified key is mapped,
- * or {@code null} if this map contains no mapping for the key.
- *
- * <p>More formally, if this map contains a mapping from a key
- * {@code k} to a value {@code v} such that {@code key.equals(k)},
- * then this method returns {@code v}; otherwise it returns
- * {@code null}. (There can be at most one such mapping.)
- *
- * @throws NullPointerException if the specified key is null
- */
- public V get(Object key) {
- Node<K,V>[] tab; Node<K,V> e, p; int n, eh; K ek;
- int h = spread(key.hashCode());
- if ((tab = table) != null && (n = tab.length) > 0 &&
- (e = tabAt(tab, (n - 1) & h)) != null) {
- if ((eh = e.hash) == h) {
- if ((ek = e.key) == key || (ek != null && key.equals(ek)))
- return e.val;
- }
- else if (eh < 0)
- return (p = e.find(h, key)) != null ? p.val : null;
- while ((e = e.next) != null) {
- if (e.hash == h &&
- ((ek = e.key) == key || (ek != null && key.equals(ek))))
- return e.val;
+ /** Implementation for get and containsKey */
+ private final Object internalGet(Object k) {
+ int h = spread(k.hashCode());
+ retry: for (Node[] tab = table; tab != null;) {
+ Node e, p; Object ek, ev; int eh; // locals to read fields once
+ for (e = tabAt(tab, (tab.length - 1) & h); e != null; e = e.next) {
+ if ((eh = e.hash) == MOVED) {
+ if ((ek = e.key) instanceof TreeBin) // search TreeBin
+ return ((TreeBin)ek).getValue(h, k);
+ else { // restart with new table
+ tab = (Node[])ek;
+ continue retry;
+ }
+ }
+ else if ((eh & HASH_BITS) == h && (ev = e.val) != null &&
+ ((ek = e.key) == k || k.equals(ek)))
+ return ev;
}
+ break;
}
return null;
}
/**
- * Tests if the specified object is a key in this table.
- *
- * @param key possible key
- * @return {@code true} if and only if the specified object
- * is a key in this table, as determined by the
- * {@code equals} method; {@code false} otherwise
- * @throws NullPointerException if the specified key is null
- */
- public boolean containsKey(Object key) {
- return get(key) != null;
- }
-
- /**
- * Returns {@code true} if this map maps one or more keys to the
- * specified value. Note: This method may require a full traversal
- * of the map, and is much slower than method {@code containsKey}.
- *
- * @param value value whose presence in this map is to be tested
- * @return {@code true} if this map maps one or more keys to the
- * specified value
- * @throws NullPointerException if the specified value is null
+ * Implementation for the four public remove/replace methods:
+ * Replaces node value with v, conditional upon match of cv if
+ * non-null. If resulting value is null, delete.
*/
- public boolean containsValue(Object value) {
- if (value == null)
- throw new NullPointerException();
- Node<K,V>[] t;
- if ((t = table) != null) {
- Traverser<K,V> it = new Traverser<K,V>(t, t.length, 0, t.length);
- for (Node<K,V> p; (p = it.advance()) != null; ) {
- V v;
- if ((v = p.val) == value || (v != null && value.equals(v)))
- return true;
+ private final Object internalReplace(Object k, Object v, Object cv) {
+ int h = spread(k.hashCode());
+ Object oldVal = null;
+ for (Node[] tab = table;;) {
+ Node f; int i, fh; Object fk;
+ if (tab == null ||
+ (f = tabAt(tab, i = (tab.length - 1) & h)) == null)
+ break;
+ else if ((fh = f.hash) == MOVED) {
+ if ((fk = f.key) instanceof TreeBin) {
+ TreeBin t = (TreeBin)fk;
+ boolean validated = false;
+ boolean deleted = false;
+ t.acquire(0);
+ try {
+ if (tabAt(tab, i) == f) {
+ validated = true;
+ TreeNode p = t.getTreeNode(h, k, t.root);
+ if (p != null) {
+ Object pv = p.val;
+ if (cv == null || cv == pv || cv.equals(pv)) {
+ oldVal = pv;
+ if ((p.val = v) == null) {
+ deleted = true;
+ t.deleteTreeNode(p);
+ }
+ }
+ }
+ }
+ } finally {
+ t.release(0);
+ }
+ if (validated) {
+ if (deleted)
+ counter.add(-1L);
+ break;
+ }
+ }
+ else
+ tab = (Node[])fk;
+ }
+ else if ((fh & HASH_BITS) != h && f.next == null) // precheck
+ break; // rules out possible existence
+ else if ((fh & LOCKED) != 0) {
+ checkForResize(); // try resizing if can't get lock
+ f.tryAwaitLock(tab, i);
+ }
+ else if (f.casHash(fh, fh | LOCKED)) {
+ boolean validated = false;
+ boolean deleted = false;
+ try {
+ if (tabAt(tab, i) == f) {
+ validated = true;
+ for (Node e = f, pred = null;;) {
+ Object ek, ev;
+ if ((e.hash & HASH_BITS) == h &&
+ ((ev = e.val) != null) &&
+ ((ek = e.key) == k || k.equals(ek))) {
+ if (cv == null || cv == ev || cv.equals(ev)) {
+ oldVal = ev;
+ if ((e.val = v) == null) {
+ deleted = true;
+ Node en = e.next;
+ if (pred != null)
+ pred.next = en;
+ else
+ setTabAt(tab, i, en);
+ }
+ }
+ break;
+ }
+ pred = e;
+ if ((e = e.next) == null)
+ break;
+ }
+ }
+ } finally {
+ if (!f.casHash(fh | LOCKED, fh)) {
+ f.hash = fh;
+ synchronized (f) { f.notifyAll(); };
+ }
+ }
+ if (validated) {
+ if (deleted)
+ counter.add(-1L);
+ break;
+ }
}
}
- return false;
+ return oldVal;
}
- /**
- * Maps the specified key to the specified value in this table.
- * Neither the key nor the value can be null.
+ /*
+ * Internal versions of the six insertion methods, each a
+ * little more complicated than the last. All have
+ * the same basic structure as the first (internalPut):
+ * 1. If table uninitialized, create
+ * 2. If bin empty, try to CAS new node
+ * 3. If bin stale, use new table
+ * 4. if bin converted to TreeBin, validate and relay to TreeBin methods
+ * 5. Lock and validate; if valid, scan and add or update
*
- * <p>The value can be retrieved by calling the {@code get} method
- * with a key that is equal to the original key.
+ * The others interweave other checks and/or alternative actions:
+ * * Plain put checks for and performs resize after insertion.
+ * * putIfAbsent prescans for mapping without lock (and fails to add
+ * if present), which also makes pre-emptive resize checks worthwhile.
+ * * computeIfAbsent extends form used in putIfAbsent with additional
+ * mechanics to deal with, calls, potential exceptions and null
+ * returns from function call.
+ * * compute uses the same function-call mechanics, but without
+ * the prescans
+ * * merge acts as putIfAbsent in the absent case, but invokes the
+ * update function if present
+ * * putAll attempts to pre-allocate enough table space
+ * and more lazily performs count updates and checks.
*
- * @param key key with which the specified value is to be associated
- * @param value value to be associated with the specified key
- * @return the previous value associated with {@code key}, or
- * {@code null} if there was no mapping for {@code key}
- * @throws NullPointerException if the specified key or value is null
+ * Someday when details settle down a bit more, it might be worth
+ * some factoring to reduce sprawl.
*/
- public V put(K key, V value) {
- return putVal(key, value, false);
- }
- /** Implementation for put and putIfAbsent */
- final V putVal(K key, V value, boolean onlyIfAbsent) {
- if (key == null || value == null) throw new NullPointerException();
- int hash = spread(key.hashCode());
- int binCount = 0;
- for (Node<K,V>[] tab = table;;) {
- Node<K,V> f; int n, i, fh;
- if (tab == null || (n = tab.length) == 0)
+ /** Implementation for put */
+ private final Object internalPut(Object k, Object v) {
+ int h = spread(k.hashCode());
+ int count = 0;
+ for (Node[] tab = table;;) {
+ int i; Node f; int fh; Object fk;
+ if (tab == null)
tab = initTable();
- else if ((f = tabAt(tab, i = (n - 1) & hash)) == null) {
- if (casTabAt(tab, i, null,
- new Node<K,V>(hash, key, value, null)))
+ else if ((f = tabAt(tab, i = (tab.length - 1) & h)) == null) {
+ if (casTabAt(tab, i, null, new Node(h, k, v, null)))
break; // no lock when adding to empty bin
}
- else if ((fh = f.hash) == MOVED)
- tab = helpTransfer(tab, f);
- else {
- V oldVal = null;
- synchronized (f) {
- if (tabAt(tab, i) == f) {
- if (fh >= 0) {
- binCount = 1;
- for (Node<K,V> e = f;; ++binCount) {
- K ek;
- if (e.hash == hash &&
- ((ek = e.key) == key ||
- (ek != null && key.equals(ek)))) {
- oldVal = e.val;
- if (!onlyIfAbsent)
- e.val = value;
- break;
- }
- Node<K,V> pred = e;
- if ((e = e.next) == null) {
- pred.next = new Node<K,V>(hash, key,
- value, null);
- break;
- }
+ else if ((fh = f.hash) == MOVED) {
+ if ((fk = f.key) instanceof TreeBin) {
+ TreeBin t = (TreeBin)fk;
+ Object oldVal = null;
+ t.acquire(0);
+ try {
+ if (tabAt(tab, i) == f) {
+ count = 2;
+ TreeNode p = t.putTreeNode(h, k, v);
+ if (p != null) {
+ oldVal = p.val;
+ p.val = v;
}
}
- else if (f instanceof TreeBin) {
- Node<K,V> p;
- binCount = 2;
- if ((p = ((TreeBin<K,V>)f).putTreeVal(hash, key,
- value)) != null) {
- oldVal = p.val;
- if (!onlyIfAbsent)
- p.val = value;
+ } finally {
+ t.release(0);
+ }
+ if (count != 0) {
+ if (oldVal != null)
+ return oldVal;
+ break;
+ }
+ }
+ else
+ tab = (Node[])fk;
+ }
+ else if ((fh & LOCKED) != 0) {
+ checkForResize();
+ f.tryAwaitLock(tab, i);
+ }
+ else if (f.casHash(fh, fh | LOCKED)) {
+ Object oldVal = null;
+ try { // needed in case equals() throws
+ if (tabAt(tab, i) == f) {
+ count = 1;
+ for (Node e = f;; ++count) {
+ Object ek, ev;
+ if ((e.hash & HASH_BITS) == h &&
+ (ev = e.val) != null &&
+ ((ek = e.key) == k || k.equals(ek))) {
+ oldVal = ev;
+ e.val = v;
+ break;
+ }
+ Node last = e;
+ if ((e = e.next) == null) {
+ last.next = new Node(h, k, v, null);
+ if (count >= TREE_THRESHOLD)
+ replaceWithTreeBin(tab, i, k);
+ break;
}
}
}
+ } finally { // unlock and signal if needed
+ if (!f.casHash(fh | LOCKED, fh)) {
+ f.hash = fh;
+ synchronized (f) { f.notifyAll(); };
+ }
}
- if (binCount != 0) {
- if (binCount >= TREEIFY_THRESHOLD)
- treeifyBin(tab, i);
+ if (count != 0) {
if (oldVal != null)
return oldVal;
+ if (tab.length <= 64)
+ count = 2;
break;
}
}
}
- addCount(1L, binCount);
+ counter.add(1L);
+ if (count > 1)
+ checkForResize();
return null;
}
- /**
- * Copies all of the mappings from the specified map to this one.
- * These mappings replace any mappings that this map had for any of the
- * keys currently in the specified map.
- *
- * @param m mappings to be stored in this map
- */
- public void putAll(Map<? extends K, ? extends V> m) {
- tryPresize(m.size());
- for (Map.Entry<? extends K, ? extends V> e : m.entrySet())
- putVal(e.getKey(), e.getValue(), false);
- }
-
- /**
- * Removes the key (and its corresponding value) from this map.
- * This method does nothing if the key is not in the map.
- *
- * @param key the key that needs to be removed
- * @return the previous value associated with {@code key}, or
- * {@code null} if there was no mapping for {@code key}
- * @throws NullPointerException if the specified key is null
- */
- public V remove(Object key) {
- return replaceNode(key, null, null);
+ /** Implementation for putIfAbsent */
+ private final Object internalPutIfAbsent(Object k, Object v) {
+ int h = spread(k.hashCode());
+ int count = 0;
+ for (Node[] tab = table;;) {
+ int i; Node f; int fh; Object fk, fv;
+ if (tab == null)
+ tab = initTable();
+ else if ((f = tabAt(tab, i = (tab.length - 1) & h)) == null) {
+ if (casTabAt(tab, i, null, new Node(h, k, v, null)))
+ break;
+ }
+ else if ((fh = f.hash) == MOVED) {
+ if ((fk = f.key) instanceof TreeBin) {
+ TreeBin t = (TreeBin)fk;
+ Object oldVal = null;
+ t.acquire(0);
+ try {
+ if (tabAt(tab, i) == f) {
+ count = 2;
+ TreeNode p = t.putTreeNode(h, k, v);
+ if (p != null)
+ oldVal = p.val;
+ }
+ } finally {
+ t.release(0);
+ }
+ if (count != 0)
<TRUNCATED>
[34/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-994' into ignite-sprint-6
Posted by se...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-994' into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b087aca9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b087aca9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b087aca9
Branch: refs/heads/ignite-484-1
Commit: b087aca99243abb8569eecd572ada1414bfd7ce0
Parents: 904888b 5db0973
Author: sboikov <se...@inria.fr>
Authored: Fri Jun 12 07:50:25 2015 +0300
Committer: sboikov <se...@inria.fr>
Committed: Fri Jun 12 07:50:25 2015 +0300
----------------------------------------------------------------------
.../continuous/GridContinuousProcessor.java | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
[48/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/ignite-sprint-6' into ignite-sprint-6
Posted by se...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-6' into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/51600881
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/51600881
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/51600881
Branch: refs/heads/ignite-484-1
Commit: 516008811d416b92011d3a70249a579cf41b1e93
Parents: dd58664 2b81104
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri Jun 12 17:21:14 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri Jun 12 17:21:14 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/GridKernalContextImpl.java | 5 +++--
.../apache/ignite/internal/IgniteKernal.java | 21 ++++++++++++++++++--
.../internal/MarshallerContextAdapter.java | 18 +++++++++++++++--
.../ignite/internal/MarshallerContextImpl.java | 14 ++++++++++++-
.../GridClientOptimizedMarshaller.java | 5 +++++
.../plugin/IgnitePluginProcessor.java | 16 ++-------------
.../IgniteCacheP2pUnmarshallingTxErrorTest.java | 14 +++++++++----
.../marshaller/MarshallerContextTestImpl.java | 18 +++++++++++++++++
.../junits/GridTestKernalContext.java | 1 +
.../ignite/tools/classgen/ClassesGenerator.java | 18 +++++++++++++----
10 files changed, 101 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
[15/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: merge
from ignite-sprint-5
Posted by se...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index cca28af..a503e1e 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -136,6 +136,8 @@ public class IgniteCacheTestSuite4 extends TestSuite {
suite.addTestSuite(CacheReadOnlyTransactionalClientSelfTest.class);
+ suite.addTestSuite(IgniteCacheManyClientsTest.class);
+
return suite;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiCommunicationSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiCommunicationSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiCommunicationSelfTestSuite.java
index 1d3bfcd..ff86bda 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiCommunicationSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiCommunicationSelfTestSuite.java
@@ -38,10 +38,12 @@ public class IgniteSpiCommunicationSelfTestSuite extends TestSuite {
suite.addTest(new TestSuite(GridTcpCommunicationSpiTcpSelfTest.class));
suite.addTest(new TestSuite(GridTcpCommunicationSpiTcpNoDelayOffSelfTest.class));
+ suite.addTest(new TestSuite(GridTcpCommunicationSpiShmemSelfTest.class));
suite.addTest(new TestSuite(GridTcpCommunicationSpiStartStopSelfTest.class));
suite.addTest(new TestSuite(GridTcpCommunicationSpiMultithreadedSelfTest.class));
+ suite.addTest(new TestSuite(GridTcpCommunicationSpiMultithreadedShmemTest.class));
suite.addTest(new TestSuite(GridTcpCommunicationSpiConfigSelfTest.class));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index 6910093..ac0f9f0 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -96,6 +96,7 @@
<dependency>
<groupId>org.gridgain</groupId>
<artifactId>ignite-shmem</artifactId>
+ <scope>test</scope>
<version>1.0.0</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
index 91f926d..0394aaa 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
@@ -31,6 +31,8 @@ import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
+import org.apache.ignite.spi.communication.*;
+import org.apache.ignite.spi.communication.tcp.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -186,6 +188,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
cfg.setLocalHost(U.getLocalHost().getHostAddress());
+ cfg.setCommunicationSpi(communicationSpi());
G.start(cfg);
}
@@ -211,6 +214,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA
cfg.setFileSystemConfiguration(igfsConfiguration(gridName));
cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
cfg.setLocalHost("127.0.0.1");
+ cfg.setCommunicationSpi(communicationSpi());
return cfg;
}
@@ -270,6 +274,15 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA
return cfg;
}
+ /** @return Communication SPI. */
+ private CommunicationSpi communicationSpi() {
+ TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
+
+ commSpi.setSharedMemoryPort(-1);
+
+ return commSpi;
+ }
+
/** {@inheritDoc} */
@Override protected void afterTestsStopped() throws Exception {
G.stopAll(true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopSecondaryFileSystemConfigurationTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopSecondaryFileSystemConfigurationTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopSecondaryFileSystemConfigurationTest.java
index b089995..8c33679 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopSecondaryFileSystemConfigurationTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopSecondaryFileSystemConfigurationTest.java
@@ -31,6 +31,8 @@ import org.apache.ignite.internal.processors.hadoop.igfs.*;
import org.apache.ignite.internal.processors.igfs.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.spi.communication.*;
+import org.apache.ignite.spi.communication.tcp.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -279,6 +281,8 @@ public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstra
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
+ cfg.setCommunicationSpi(communicationSpi());
+
G.start(cfg);
}
@@ -314,6 +318,7 @@ public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstra
cfg.setCacheConfiguration(cacheConfiguration());
cfg.setFileSystemConfiguration(fsConfiguration(gridName));
cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
+ cfg.setCommunicationSpi(communicationSpi());
return cfg;
}
@@ -371,6 +376,15 @@ public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstra
return cfg;
}
+ /** @return Communication SPI. */
+ private CommunicationSpi communicationSpi() {
+ TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
+
+ commSpi.setSharedMemoryPort(-1);
+
+ return commSpi;
+ }
+
/**
* Case #SecondaryFileSystemProvider(null, path)
*
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java
index 7cea968..a89e586 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java
@@ -25,6 +25,7 @@ import org.apache.ignite.configuration.*;
import org.apache.ignite.hadoop.fs.v2.*;
import org.apache.ignite.internal.processors.igfs.*;
import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.spi.communication.tcp.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -197,6 +198,12 @@ public class IgniteHadoopFileSystemHandshakeSelfTest extends IgfsCommonAbstractT
cfg.setDiscoverySpi(discoSpi);
+ TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
+
+ commSpi.setSharedMemoryPort(-1);
+
+ cfg.setCommunicationSpi(commSpi);
+
CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
metaCacheCfg.setName("replicated");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java
index 2c17ba9..6773366 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java
@@ -26,6 +26,7 @@ import org.apache.ignite.internal.processors.igfs.*;
import org.apache.ignite.internal.util.ipc.shmem.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.spi.communication.tcp.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -86,6 +87,12 @@ public class IgniteHadoopFileSystemIpcCacheSelfTest extends IgfsCommonAbstractTe
cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
+ TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
+
+ commSpi.setSharedMemoryPort(-1);
+
+ cfg.setCommunicationSpi(commSpi);
+
cnt++;
return cfg;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractSelfTest.java
index e8a0a6f..a3c9bde 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractSelfTest.java
@@ -22,6 +22,7 @@ import org.apache.ignite.configuration.*;
import org.apache.ignite.igfs.*;
import org.apache.ignite.hadoop.fs.v2.IgniteHadoopFileSystem;
import org.apache.ignite.internal.processors.hadoop.fs.*;
+import org.apache.ignite.spi.communication.tcp.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -104,6 +105,12 @@ public abstract class HadoopAbstractSelfTest extends GridCommonAbstractTest {
cfg.setHadoopConfiguration(hadoopConfiguration(gridName));
+ TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
+
+ commSpi.setSharedMemoryPort(-1);
+
+ cfg.setCommunicationSpi(commSpi);
+
TcpDiscoverySpi discoSpi = (TcpDiscoverySpi)cfg.getDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 200da77..5e27c24 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -592,7 +592,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
* @throws SQLException If failed.
*/
private static List<GridQueryFieldMetadata> meta(ResultSetMetaData rsMeta) throws SQLException {
- ArrayList<GridQueryFieldMetadata> meta = new ArrayList<>(rsMeta.getColumnCount());
+ List<GridQueryFieldMetadata> meta = new ArrayList<>(rsMeta.getColumnCount());
for (int i = 1; i <= rsMeta.getColumnCount(); i++) {
String schemaName = rsMeta.getSchemaName(i);
@@ -771,8 +771,13 @@ public class IgniteH2Indexing implements GridQueryIndexing {
}
/** {@inheritDoc} */
- @Override public QueryCursor<List<?>> queryTwoStep(GridCacheContext<?,?> cctx, GridCacheTwoStepQuery qry) {
- return rdcQryExec.query(cctx, qry);
+ @Override public Iterable<List<?>> queryTwoStep(final GridCacheContext<?,?> cctx, final GridCacheTwoStepQuery qry,
+ final boolean keepCacheObj) {
+ return new Iterable<List<?>>() {
+ @Override public Iterator<List<?>> iterator() {
+ return rdcQryExec.query(cctx, qry, keepCacheObj);
+ }
+ };
}
/** {@inheritDoc} */
@@ -802,25 +807,30 @@ public class IgniteH2Indexing implements GridQueryIndexing {
final QueryCursor<List<?>> res = queryTwoStep(cctx, fqry);
- final Iterator<List<?>> iter0 = res.iterator();
+ final Iterable<Cache.Entry<K, V>> converted = new Iterable<Cache.Entry<K, V>>() {
+ @Override public Iterator<Cache.Entry<K, V>> iterator() {
+ final Iterator<List<?>> iter0 = res.iterator();
- Iterator<Cache.Entry<K,V>> iter = new Iterator<Cache.Entry<K,V>>() {
- @Override public boolean hasNext() {
- return iter0.hasNext();
- }
+ return new Iterator<Cache.Entry<K,V>>() {
+ @Override public boolean hasNext() {
+ return iter0.hasNext();
+ }
- @Override public Cache.Entry<K,V> next() {
- List<?> l = iter0.next();
+ @Override public Cache.Entry<K,V> next() {
+ List<?> l = iter0.next();
- return new CacheEntryImpl<>((K)l.get(0),(V)l.get(1));
- }
+ return new CacheEntryImpl<>((K)l.get(0),(V)l.get(1));
+ }
- @Override public void remove() {
- throw new UnsupportedOperationException();
+ @Override public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ };
}
};
- return new QueryCursorImpl<Cache.Entry<K,V>>(iter) {
+ // No metadata for SQL queries.
+ return new QueryCursorImpl<Cache.Entry<K,V>>(converted) {
@Override public void close() {
res.close();
}
@@ -844,7 +854,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
}
GridCacheTwoStepQuery twoStepQry;
- Collection<GridQueryFieldMetadata> meta;
+ List<GridQueryFieldMetadata> meta;
try {
twoStepQry = GridSqlQuerySplitter.split((JdbcPreparedStatement)stmt, qry.getArgs(), qry.isCollocated());
@@ -863,7 +873,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
twoStepQry.pageSize(qry.getPageSize());
- QueryCursorImpl<List<?>> cursor = (QueryCursorImpl<List<?>>)queryTwoStep(cctx, twoStepQry);
+ QueryCursorImpl<List<?>> cursor = new QueryCursorImpl<>(queryTwoStep(cctx, twoStepQry, cctx.keepPortable()));
cursor.fieldsMeta(meta);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index 50c30a5..11054b7 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -269,7 +269,7 @@ public class GridReduceQueryExecutor {
* @param qry Query.
* @return Cursor.
*/
- public QueryCursor<List<?>> query(GridCacheContext<?,?> cctx, GridCacheTwoStepQuery qry) {
+ public Iterator<List<?>> query(GridCacheContext<?,?> cctx, GridCacheTwoStepQuery qry, boolean keepPortable) {
long qryReqId = reqIdGen.incrementAndGet();
QueryRun r = new QueryRun();
@@ -356,7 +356,7 @@ public class GridReduceQueryExecutor {
// dropTable(r.conn, tbl.getName()); TODO
}
- return new QueryCursorImpl<>(new GridQueryCacheObjectsIterator(new Iter(res), cctx, cctx.keepPortable()));
+ return new GridQueryCacheObjectsIterator(new Iter(res), cctx, keepPortable);
}
catch (IgniteCheckedException | InterruptedException | RuntimeException e) {
U.closeQuiet(r.conn);
@@ -381,7 +381,7 @@ public class GridReduceQueryExecutor {
* @return Cursor for plans.
* @throws IgniteCheckedException if failed.
*/
- private QueryCursor<List<?>> explainPlan(JdbcConnection c, String space, GridCacheTwoStepQuery qry)
+ private Iterator<List<?>> explainPlan(JdbcConnection c, String space, GridCacheTwoStepQuery qry)
throws IgniteCheckedException {
List<List<?>> lists = new ArrayList<>();
@@ -403,7 +403,7 @@ public class GridReduceQueryExecutor {
lists.add(F.asList(getPlan(rs)));
- return new QueryCursorImpl<>(lists.iterator());
+ return lists.iterator();
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheScanPartitionQueryFallbackSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheScanPartitionQueryFallbackSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheScanPartitionQueryFallbackSelfTest.java
new file mode 100644
index 0000000..b7f5fa8
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheScanPartitionQueryFallbackSelfTest.java
@@ -0,0 +1,408 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.managers.communication.*;
+import org.apache.ignite.internal.processors.affinity.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
+import org.apache.ignite.internal.processors.cache.query.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
+import org.apache.ignite.spi.*;
+import org.apache.ignite.spi.communication.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+/**
+ * Tests partition scan query fallback.
+ */
+public class CacheScanPartitionQueryFallbackSelfTest extends GridCommonAbstractTest {
+ /** Grid count. */
+ private static final int GRID_CNT = 3;
+
+ /** Keys count. */
+ private static final int KEYS_CNT = 5000;
+
+ /** Ip finder. */
+ private static final TcpDiscoveryVmIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+ /** Backups. */
+ private int backups;
+
+ /** Cache mode. */
+ private CacheMode cacheMode;
+
+ /** Client mode. */
+ private volatile boolean clientMode;
+
+ /** Expected first node ID. */
+ private static UUID expNodeId;
+
+ /** Expected fallback node ID. */
+ private static UUID expFallbackNodeId;
+
+ /** Communication SPI factory. */
+ private CommunicationSpiFactory commSpiFactory;
+
+ /** Latch. */
+ private static CountDownLatch latch;
+
+ /** Test entries. */
+ private Map<Integer, Map<Integer, Integer>> entries = new HashMap<>();
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ cfg.setClientMode(clientMode);
+
+ TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+ discoSpi.setIpFinder(IP_FINDER);
+ discoSpi.setForceServerMode(true);
+ cfg.setDiscoverySpi(discoSpi);
+
+ cfg.setCommunicationSpi(commSpiFactory.create());
+
+ CacheConfiguration ccfg = defaultCacheConfiguration();
+ ccfg.setCacheMode(cacheMode);
+ ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
+ ccfg.setBackups(backups);
+ ccfg.setNearConfiguration(null);
+
+ cfg.setCacheConfiguration(ccfg);
+
+ return cfg;
+ }
+
+ /**
+ * Scan should perform on the local node.
+ *
+ * @throws Exception If failed.
+ */
+ public void testScanLocal() throws Exception {
+ cacheMode = CacheMode.PARTITIONED;
+ backups = 0;
+ commSpiFactory = new TestLocalCommunicationSpiFactory();
+
+ try {
+ Ignite ignite = startGrids(GRID_CNT);
+
+ IgniteCacheProxy<Integer, Integer> cache = fillCache(ignite);
+
+ int part = anyLocalPartition(cache.context());
+
+ CacheQuery<Map.Entry<Integer, Integer>> qry = cache.context().queries().createScanQuery(null, part, false);
+
+ doTestScanQuery(qry);
+ }
+ finally {
+ stopAllGrids();
+ }
+ }
+
+ /**
+ * Scan should perform on the remote node.
+ *
+ * @throws Exception If failed.
+ */
+ public void testScanRemote() throws Exception {
+ cacheMode = CacheMode.PARTITIONED;
+ backups = 0;
+ commSpiFactory = new TestRemoteCommunicationSpiFactory();
+
+ try {
+ Ignite ignite = startGrids(GRID_CNT);
+
+ IgniteCacheProxy<Integer, Integer> cache = fillCache(ignite);
+
+ IgniteBiTuple<Integer, UUID> tup = remotePartition(cache.context());
+
+ int part = tup.get1();
+
+ expNodeId = tup.get2();
+
+ CacheQuery<Map.Entry<Integer, Integer>> qry = cache.context().queries().createScanQuery(null, part, false);
+
+ doTestScanQuery(qry);
+ }
+ finally {
+ stopAllGrids();
+ }
+ }
+
+ /**
+ * Scan should try first remote node and fallbacks to second remote node.
+ *
+ * @throws Exception If failed.
+ */
+ public void testScanFallback() throws Exception {
+ cacheMode = CacheMode.PARTITIONED;
+ backups = 1;
+ commSpiFactory = new TestFallbackCommunicationSpiFactory();
+
+ final Set<Integer> candidates = new TreeSet<>();
+
+ final AtomicBoolean test = new AtomicBoolean(false);
+
+ for(int j = 0; j < 2; j++) {
+ clientMode = true;
+
+ latch = new CountDownLatch(1);
+
+ try {
+ final Ignite ignite0 = startGrid(0);
+
+ clientMode = false;
+
+ final IgniteEx ignite1 = startGrid(1);
+ final IgniteEx ignite2 = startGrid(2);
+ startGrid(3);
+
+ if (test.get()) {
+ expNodeId = ignite1.localNode().id();
+ expFallbackNodeId = ignite2.localNode().id();
+ }
+
+ final IgniteCacheProxy<Integer, Integer> cache = fillCache(ignite0);
+
+ if (!test.get()) {
+ candidates.addAll(localPartitions(ignite1));
+
+ candidates.retainAll(localPartitions(ignite2));
+ }
+
+ Runnable run = new Runnable() {
+ @Override public void run() {
+ try {
+ startGrid(4);
+ startGrid(5);
+
+ awaitPartitionMapExchange();
+
+ if (!test.get()) {
+ candidates.removeAll(localPartitions(ignite1));
+
+ F.retain(candidates, false, localPartitions(ignite2));
+ }
+
+ latch.countDown();
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+ };
+
+ int part;
+ CacheQuery<Map.Entry<Integer, Integer>> qry = null;
+
+ if (test.get()) {
+ part = F.first(candidates);
+
+ qry = cache.context().queries().createScanQuery(null, part, false);
+ }
+
+ new Thread(run).start();
+
+ if (test.get())
+ doTestScanQuery(qry);
+ else
+ latch.await();
+ }
+ finally {
+ test.set(true);
+
+ stopAllGrids();
+ }
+ }
+ }
+
+ /**
+ * @param ignite Ignite.
+ */
+ protected IgniteCacheProxy<Integer, Integer> fillCache(Ignite ignite) {
+ IgniteCacheProxy<Integer, Integer> cache =
+ (IgniteCacheProxy<Integer, Integer>)ignite.<Integer, Integer>cache(null);
+
+ for (int i = 0; i < KEYS_CNT; i++) {
+ cache.put(i, i);
+
+ int part = cache.context().affinity().partition(i);
+
+ Map<Integer, Integer> partEntries = entries.get(part);
+
+ if (partEntries == null)
+ entries.put(part, partEntries = new HashMap<>());
+
+ partEntries.put(i, i);
+ }
+
+ return cache;
+ }
+
+ /**
+ * @param qry Query.
+ */
+ protected void doTestScanQuery(
+ CacheQuery<Map.Entry<Integer, Integer>> qry) throws IgniteCheckedException {
+ CacheQueryFuture<Map.Entry<Integer, Integer>> fut = qry.execute();
+
+ Collection<Map.Entry<Integer, Integer>> expEntries = fut.get();
+
+ for (Map.Entry<Integer, Integer> e : expEntries) {
+ Map<Integer, Integer> map = entries.get(((GridCacheQueryAdapter)qry).partition());
+
+ if (map == null)
+ assertTrue(expEntries.isEmpty());
+ else
+ assertEquals(map.get(e.getKey()), e.getValue());
+ }
+ }
+
+ /**
+ * @param cctx Cctx.
+ */
+ private static int anyLocalPartition(GridCacheContext<?, ?> cctx) {
+ return F.first(cctx.topology().localPartitions()).id();
+ }
+
+ /**
+ * @param cctx Cctx.
+ */
+ private IgniteBiTuple<Integer, UUID> remotePartition(final GridCacheContext cctx) {
+ ClusterNode node = F.first(cctx.kernalContext().grid().cluster().forRemotes().nodes());
+
+ GridCacheAffinityManager affMgr = cctx.affinity();
+
+ AffinityTopologyVersion topVer = affMgr.affinityTopologyVersion();
+
+ Set<Integer> parts = affMgr.primaryPartitions(node.id(), topVer);
+
+ return new IgniteBiTuple<>(F.first(parts), node.id());
+ }
+
+ /**
+ * @param ignite Ignite.
+ */
+ private Set<Integer> localPartitions(Ignite ignite) {
+ GridCacheContext cctx = ((IgniteCacheProxy)ignite.cache(null)).context();
+
+ Collection<GridDhtLocalPartition> owningParts = F.view(cctx.topology().localPartitions(),
+ new IgnitePredicate<GridDhtLocalPartition>() {
+ @Override public boolean apply(GridDhtLocalPartition part) {
+ return part.state() == GridDhtPartitionState.OWNING;
+ }
+ });
+
+ return new HashSet<>(F.transform(owningParts, new IgniteClosure<GridDhtLocalPartition, Integer>() {
+ @Override public Integer apply(GridDhtLocalPartition part) {
+ return part.id();
+ }
+ }));
+ }
+
+ /**
+ * Factory for tests specific communication SPI.
+ */
+ private interface CommunicationSpiFactory {
+ /**
+ * Creates communication SPI instance.
+ */
+ TcpCommunicationSpi create();
+ }
+
+ /**
+ *
+ */
+ private static class TestLocalCommunicationSpiFactory implements CommunicationSpiFactory {
+ /** {@inheritDoc} */
+ @Override public TcpCommunicationSpi create() {
+ return new TcpCommunicationSpi() {
+ @Override public void sendMessage(ClusterNode node, Message msg) throws IgniteSpiException {
+ Object origMsg = ((GridIoMessage)msg).message();
+
+ if (origMsg instanceof GridCacheQueryRequest)
+ fail(); //should use local node
+
+ super.sendMessage(node, msg);
+ }
+ };
+ }
+ }
+
+ /**
+ *
+ */
+ private static class TestRemoteCommunicationSpiFactory implements CommunicationSpiFactory {
+ /** {@inheritDoc} */
+ @Override public TcpCommunicationSpi create() {
+ return new TcpCommunicationSpi() {
+ @Override public void sendMessage(ClusterNode node, Message msg) throws IgniteSpiException {
+ Object origMsg = ((GridIoMessage)msg).message();
+
+ if (origMsg instanceof GridCacheQueryRequest)
+ assertEquals(expNodeId, node.id());
+
+ super.sendMessage(node, msg);
+ }
+ };
+ }
+ }
+
+ /**
+ *
+ */
+ private static class TestFallbackCommunicationSpiFactory implements CommunicationSpiFactory {
+ /** {@inheritDoc} */
+ @Override public TcpCommunicationSpi create() {
+ return new TcpCommunicationSpi() {
+ @Override public void sendMessage(ClusterNode node, Message msg) throws IgniteSpiException {
+ Object origMsg = ((GridIoMessage)msg).message();
+
+ if (origMsg instanceof GridCacheQueryRequest) {
+ if (latch.getCount() > 0)
+ assertEquals(expNodeId, node.id());
+ else
+ assertEquals(expFallbackNodeId, node.id());
+
+ try {
+ latch.await();
+ }
+ catch (InterruptedException e) {
+ throw new IgniteSpiException(e);
+ }
+ }
+
+ super.sendMessage(node, msg);
+ }
+ };
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
index bc45d1e..40c40a5 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
@@ -129,9 +129,17 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest {
q.addMapQuery("_cnts_", "select count(*) x from \"partitioned\".FactPurchase where ? = ?", 2, 2);
- Object cnt = qryProc.queryTwoStep(cache, q).getAll().iterator().next().get(0);
+ Iterator<List<?>> it = qryProc.queryTwoStep(cache, q).iterator();
- assertEquals(10L, cnt);
+ try {
+ Object cnt = it.next().get(0);
+
+ assertEquals(10L, cnt);
+ }
+ finally {
+ if (it instanceof AutoCloseable)
+ ((AutoCloseable)it).close();
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
index 6224cb9..0d45711 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
@@ -27,6 +27,7 @@ import org.apache.ignite.events.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
import org.apache.ignite.internal.processors.cache.query.*;
+import org.apache.ignite.internal.processors.query.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -61,6 +62,9 @@ import static org.junit.Assert.*;
* Various tests for cache queries.
*/
public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstractTest {
+ /** Key count. */
+ private static final int KEY_CNT = 5000;
+
/** Cache store. */
private static TestStore store = new TestStore();
@@ -639,6 +643,48 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
}
/**
+ * @throws Exception In case of error.
+ */
+ public void testScanPartitionQuery() throws Exception {
+ IgniteCache<Integer, Integer> cache = ignite.cache(null);
+
+ GridCacheContext cctx = ((IgniteCacheProxy)cache).context();
+
+ Map<Integer, Map<Integer, Integer>> entries = new HashMap<>();
+
+ for (int i = 0; i < KEY_CNT; i++) {
+ cache.put(i, i);
+
+ int part = cctx.affinity().partition(i);
+
+ Map<Integer, Integer> partEntries = entries.get(part);
+
+ if (partEntries == null)
+ entries.put(part, partEntries = new HashMap<>());
+
+ partEntries.put(i, i);
+ }
+
+ for (int i = 0; i < cctx.affinity().partitions(); i++) {
+ ScanQuery<Integer, Integer> scan = new ScanQuery<>(i);
+
+ Collection<Cache.Entry<Integer, Integer>> actual = cache.query(scan).getAll();
+
+ Map<Integer, Integer> exp = entries.get(i);
+
+ int size = exp == null ? 0 : exp.size();
+
+ assertEquals("Failed for partition: " + i, size, actual.size());
+
+ if (exp == null)
+ assertTrue(actual.isEmpty());
+ else
+ for (Cache.Entry<Integer, Integer> entry : actual)
+ assertTrue(entry.getValue().equals(exp.get(entry.getKey())));
+ }
+ }
+
+ /**
* JUnit.
*
* @throws Exception In case of error.
@@ -942,6 +988,28 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
/**
* @throws Exception If failed.
*/
+ public void testFieldsQueryMetadata() throws Exception {
+ IgniteCache<UUID, Person> cache = ignite.cache(null);
+
+ for (int i = 0; i < 100; i++)
+ cache.put(UUID.randomUUID(), new Person("name-" + i, (i + 1) * 100));
+
+ QueryCursor<List<?>> cur = cache.query(new SqlFieldsQuery("select name, salary from Person where name like ?")
+ .setArgs("name-"));
+
+ assertTrue(cur instanceof QueryCursorEx);
+
+ QueryCursorEx<List<?>> curEx = (QueryCursorEx<List<?>>)cur;
+
+ List<GridQueryFieldMetadata> meta = curEx.fieldsMeta();
+
+ assertNotNull(meta);
+ assertEquals(2, meta.size());
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
private void checkSqlQueryEvents() throws Exception {
final CountDownLatch execLatch = new CountDownLatch(cacheMode() == REPLICATED ? 1 : gridCount());
@@ -1044,11 +1112,13 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
for (int i = 0; i < 20; i++)
cache.put(i, i);
- QueryCursor<Cache.Entry<Integer, Integer>> q = cache.query(new ScanQuery<>(new IgniteBiPredicate<Integer,Integer>() {
+ IgniteBiPredicate<Integer, Integer> filter = new IgniteBiPredicate<Integer, Integer>() {
@Override public boolean apply(Integer k, Integer v) {
return k >= 10;
}
- }));
+ };
+
+ QueryCursor<Cache.Entry<Integer, Integer>> q = cache.query(new ScanQuery<>(filter));
q.getAll();
@@ -1183,7 +1253,8 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
* @return {@code true} if index has a table for given class.
* @throws IgniteCheckedException If failed.
*/
- private boolean hasIndexTable(Class<?> cls, GridCacheQueryManager<Object, Object> qryMgr) throws IgniteCheckedException {
+ private boolean hasIndexTable(Class<?> cls, GridCacheQueryManager<Object, Object> qryMgr)
+ throws IgniteCheckedException {
return qryMgr.size(cls) != -1;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
index cfc8f2c..0815dc6 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
@@ -70,6 +70,8 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
suite.addTestSuite(GridCacheCrossCacheQuerySelfTest.class);
suite.addTestSuite(GridCacheQuerySerializationSelfTest.class);
+ // Scan queries.
+ suite.addTestSuite(CacheScanPartitionQueryFallbackSelfTest.class);
// Fields queries.
suite.addTestSuite(IgniteCacheLocalFieldsQuerySelfTest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/scalar-2.10/README.txt
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/README.txt b/modules/scalar-2.10/README.txt
new file mode 100644
index 0000000..535a193
--- /dev/null
+++ b/modules/scalar-2.10/README.txt
@@ -0,0 +1,4 @@
+Apache Ignite Scalar Module
+---------------------------
+
+Apache Ignite Scalar module to be build with Scala 2.10.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/scalar-2.10/licenses/apache-2.0.txt
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/licenses/apache-2.0.txt b/modules/scalar-2.10/licenses/apache-2.0.txt
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/modules/scalar-2.10/licenses/apache-2.0.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/scalar-2.10/licenses/scala-bsd-license.txt
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/licenses/scala-bsd-license.txt b/modules/scalar-2.10/licenses/scala-bsd-license.txt
new file mode 100644
index 0000000..b2be111
--- /dev/null
+++ b/modules/scalar-2.10/licenses/scala-bsd-license.txt
@@ -0,0 +1,18 @@
+Copyright (c) 2002-2014 EPFL
+Copyright (c) 2011-2014 Typesafe, Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or
+other materials provided with the distribution. Neither the name of the EPFL nor the names of its contributors may be used to endorse or promote products
+derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
new file mode 100644
index 0000000..e3d6125
--- /dev/null
+++ b/modules/scalar-2.10/pom.xml
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!--
+ POM file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-parent</artifactId>
+ <version>1</version>
+ <relativePath>../../parent</relativePath>
+ </parent>
+
+ <artifactId>ignite-scalar_2.10</artifactId>
+ <version>1.1.1-SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ <version>2.10.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-core</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-spring</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-indexing</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.scalatest</groupId>
+ <artifactId>scalatest_2.10</artifactId>
+ <version>2.2.2</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <sourceDirectory>../scalar/src/main/scala</sourceDirectory>
+
+ <resources>
+ <resource>
+ <directory>../scalar/src/main/scala</directory>
+ <excludes>
+ <exclude>**/*.scala</exclude>
+ </excludes>
+ </resource>
+ </resources>
+
+ <testResources>
+ <testResource>
+ <directory>../scalar/src/test/scala</directory>
+ <excludes>
+ <exclude>**/*.scala</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <groupId>net.alchim31.maven</groupId>
+ <artifactId>scala-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+
+ <!-- TODO IGNITE-956 FIX scaladocs plugins-->
+ <!--<plugin>-->
+ <!--<groupId>org.apache.maven.plugins</groupId>-->
+ <!--<artifactId>maven-antrun-plugin</artifactId>-->
+ <!--<version>1.7</version>-->
+ <!--<dependencies>-->
+ <!--<dependency>-->
+ <!--<groupId>org.apache.ignite</groupId>-->
+ <!--<artifactId>ignite-tools</artifactId>-->
+ <!--<version>${project.version}</version>-->
+ <!--</dependency>-->
+ <!--</dependencies>-->
+ <!--<executions>-->
+ <!--<execution>-->
+ <!--<id>scaladoc-postprocessing</id>-->
+ <!--<goals>-->
+ <!--<goal>run</goal>-->
+ <!--</goals>-->
+ <!--<phase>prepare-package</phase>-->
+ <!--<configuration>-->
+ <!--<target>-->
+ <!--<copy todir="target/site/scaladocs">-->
+ <!--<fileset dir="../../assembly/docfiles">-->
+ <!--<include name="img/**" />-->
+ <!--<include name="*.js" />-->
+ <!--</fileset>-->
+ <!--</copy>-->
+
+ <!--<taskdef name="doctask" classname="org.apache.ignite.tools.ant.beautifier.GridJavadocAntTask" />-->
+
+ <!--<doctask css="dotted" dir="target/site/scaladocs" verify="false">-->
+ <!--<include name="**/*.html" />-->
+ <!--</doctask>-->
+
+ <!--<property name="footer">-->
+ <!--<![CDATA[-->
+ <!--<table style="padding: 0px 10px 10px 10px; width: 100%" border="0">-->
+ <!--<tr>-->
+ <!--<td>-->
+ <!--<nobr>Ignite™ - Scalar DSL, ver. <strong>${project.version}</strong></nobr>-->
+ <!--<br>-->
+ <!--<a target=_blank href="https://incubator.apache.org/projects/ignite.html"><nobr>2015 Copyright © Apache Software Foundation</nobr></a>-->
+ <!--</td>-->
+ <!--</tr>-->
+ <!--</table>-->
+ <!--]]>-->
+ <!--</property>-->
+
+ <!--<replace dir="target/site/scaladocs" token="<!--FOOTER-->" value="${footer}">-->
+ <!--<include name="**/*.html" />-->
+ <!--</replace>-->
+
+ <!--<replace dir="target/site/scaladocs">-->
+ <!--<replacetoken>src="package.html"</replacetoken>-->
+ <!--<replacevalue>src=org/apache/ignite/scalar/scalar$.html</replacevalue>-->
+ <!--<include name="**/index.html" />-->
+ <!--</replace>-->
+
+ <!--<replace dir="target/site/scaladocs">-->
+ <!--<replacetoken>location.replace("package.html")</replacetoken>-->
+ <!--<replacevalue>location.replace("org/apache/ignite/scalar/scalar$.html")</replacevalue>-->
+ <!--<include name="**/index.js" />-->
+ <!--</replace>-->
+
+ <!--<replace dir="target/site/scaladocs">-->
+ <!--<replacetoken>docs.scala-lang.org/overviews/scaladoc/usage.html#members</replacetoken>-->
+ <!--<replacevalue>docs.scala-lang.org/overviews/scaladoc/interface.html</replacevalue>-->
+ <!--<fileset dir="target/site/scaladocs" />-->
+ <!--</replace>-->
+
+ <!--<replaceregexp byline="true" flags="im" encoding="UTF-8">-->
+ <!--<regexp pattern="(<dt>Attributes</dt><dd>protected\[)<a.+>(.+)</a>(\]\s+</dd>)" />-->
+ <!--<substitution expression="\1\2\3" />-->
+ <!--<fileset dir="target/site/scaladocs" />-->
+ <!--</replaceregexp>-->
+
+ <!--<zip destfile="target/ignite-scalar-${project.version}-javadoc.jar" basedir="target/site/scaladocs" encoding="UTF-8" />-->
+ <!--</target>-->
+ <!--</configuration>-->
+ <!--</execution>-->
+ <!--</executions>-->
+ <!--</plugin>-->
+ <!--</plugins>-->
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark-2.10/README.txt
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/README.txt b/modules/spark-2.10/README.txt
new file mode 100644
index 0000000..29d3930
--- /dev/null
+++ b/modules/spark-2.10/README.txt
@@ -0,0 +1,4 @@
+Apache Ignite Spark Module
+---------------------------
+
+Apache Ignite Spark module to be build with Scala 2.10.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark-2.10/licenses/apache-2.0.txt
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/licenses/apache-2.0.txt b/modules/spark-2.10/licenses/apache-2.0.txt
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/modules/spark-2.10/licenses/apache-2.0.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark-2.10/licenses/scala-bsd-license.txt
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/licenses/scala-bsd-license.txt b/modules/spark-2.10/licenses/scala-bsd-license.txt
new file mode 100644
index 0000000..b2be111
--- /dev/null
+++ b/modules/spark-2.10/licenses/scala-bsd-license.txt
@@ -0,0 +1,18 @@
+Copyright (c) 2002-2014 EPFL
+Copyright (c) 2011-2014 Typesafe, Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or
+other materials provided with the distribution. Neither the name of the EPFL nor the names of its contributors may be used to endorse or promote products
+derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
new file mode 100644
index 0000000..2547f7c
--- /dev/null
+++ b/modules/spark-2.10/pom.xml
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!--
+ POM file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-parent</artifactId>
+ <version>1</version>
+ <relativePath>../../parent</relativePath>
+ </parent>
+
+ <artifactId>ignite-spark_2.10</artifactId>
+ <version>1.1.1-SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-core</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ <version>2.10.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.spark</groupId>
+ <artifactId>spark-core_2.10</artifactId>
+ <version>1.3.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.spark</groupId>
+ <artifactId>spark-sql_2.10</artifactId>
+ <version>1.3.1</version>
+ </dependency>
+
+ <!-- Test dependencies -->
+
+ <dependency>
+ <groupId>org.scalatest</groupId>
+ <artifactId>scalatest_2.10</artifactId>
+ <version>2.2.2</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-indexing</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <sourceDirectory>../spark/src/main/scala</sourceDirectory>
+
+ <resources>
+ <resource>
+ <directory>../spark/src/main/scala</directory>
+ <excludes>
+ <exclude>**/*.scala</exclude>
+ </excludes>
+ </resource>
+ </resources>
+
+ <testResources>
+ <testResource>
+ <directory>../spark/src/test/scala</directory>
+ <excludes>
+ <exclude>**/*.scala</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <groupId>net.alchim31.maven</groupId>
+ <artifactId>scala-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/README.txt
----------------------------------------------------------------------
diff --git a/modules/spark/README.txt b/modules/spark/README.txt
new file mode 100644
index 0000000..589a050
--- /dev/null
+++ b/modules/spark/README.txt
@@ -0,0 +1,8 @@
+Apache Ignite Spark Module
+---------------------------
+
+Apache Ignite provides an implementation of Spark RDD abstraction which enables easy access to Ignite caches.
+Ignite RDD does not keep it's state in the memory of the Spark application and provides a view of the corresponding
+Ignite cache. Depending on the chosen deployment mode this state may exist only during the lifespan of the Spark
+application (embedded mode) or may exist outside of the Spark application (standalone mode), allowing seamless
+sharing of the state between multiple Spark jobs.
\ No newline at end of file
[23/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: fixed
javadoc issue
Posted by se...@apache.org.
ignite-sprint-6: fixed javadoc issue
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7ac692a2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7ac692a2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7ac692a2
Branch: refs/heads/ignite-484-1
Commit: 7ac692a2fd9008a833610ff1c681388f4dac0a6f
Parents: 8a98daf
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu Jun 11 16:16:55 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu Jun 11 16:16:55 2015 +0300
----------------------------------------------------------------------
modules/core/src/main/java/org/jsr166/ThreadLocalRandom8.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ac692a2/modules/core/src/main/java/org/jsr166/ThreadLocalRandom8.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/jsr166/ThreadLocalRandom8.java b/modules/core/src/main/java/org/jsr166/ThreadLocalRandom8.java
index 192db47..d4eba5d 100644
--- a/modules/core/src/main/java/org/jsr166/ThreadLocalRandom8.java
+++ b/modules/core/src/main/java/org/jsr166/ThreadLocalRandom8.java
@@ -26,7 +26,7 @@ import java.util.*;
* than shared {@code Random} objects in concurrent programs will
* typically encounter much less overhead and contention. Use of
* {@code ThreadLocalRandom} is particularly appropriate when multiple
- * tasks (for example, each a {@link ForkJoinTask}) use random numbers
+ * tasks (for example, each a ForkJoinTask) use random numbers
* in parallel in thread pools.
*
* <p>Usages of this class should typically be of the form:
[14/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: merge
from ignite-sprint-5
Posted by se...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/licenses/apache-2.0.txt
----------------------------------------------------------------------
diff --git a/modules/spark/licenses/apache-2.0.txt b/modules/spark/licenses/apache-2.0.txt
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/modules/spark/licenses/apache-2.0.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/licenses/scala-bsd-license.txt
----------------------------------------------------------------------
diff --git a/modules/spark/licenses/scala-bsd-license.txt b/modules/spark/licenses/scala-bsd-license.txt
new file mode 100644
index 0000000..b2be111
--- /dev/null
+++ b/modules/spark/licenses/scala-bsd-license.txt
@@ -0,0 +1,18 @@
+Copyright (c) 2002-2014 EPFL
+Copyright (c) 2011-2014 Typesafe, Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or
+other materials provided with the distribution. Neither the name of the EPFL nor the names of its contributors may be used to endorse or promote products
+derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
new file mode 100644
index 0000000..8900a10
--- /dev/null
+++ b/modules/spark/pom.xml
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!--
+ POM file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-parent</artifactId>
+ <version>1</version>
+ <relativePath>../../parent</relativePath>
+ </parent>
+
+ <artifactId>ignite-spark</artifactId>
+ <version>1.1.1-SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-core</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ <version>2.11.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.spark</groupId>
+ <artifactId>spark-core_2.11</artifactId>
+ <version>1.3.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.spark</groupId>
+ <artifactId>spark-sql_2.11</artifactId>
+ <version>1.3.1</version>
+ </dependency>
+
+ <!-- Test dependencies -->
+
+ <dependency>
+ <groupId>org.scalatest</groupId>
+ <artifactId>scalatest_2.11</artifactId>
+ <version>2.2.2</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-indexing</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${spring.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>net.alchim31.maven</groupId>
+ <artifactId>scala-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteContext.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteContext.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteContext.scala
new file mode 100644
index 0000000..e52555a
--- /dev/null
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteContext.scala
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spark
+
+
+import org.apache.ignite.internal.IgnitionEx
+import org.apache.ignite.{Ignition, Ignite}
+import org.apache.ignite.configuration.{CacheConfiguration, IgniteConfiguration}
+import org.apache.spark.{Logging, SparkContext}
+import org.apache.spark.sql.SQLContext
+
+/**
+ * Ignite context.
+ *
+ * @param sparkContext Spark context.
+ * @param cfgF Configuration factory.
+ * @tparam K Key type.
+ * @tparam V Value type.
+ */
+class IgniteContext[K, V](
+ @scala.transient val sparkContext: SparkContext,
+ cfgF: () ⇒ IgniteConfiguration,
+ client: Boolean = true
+) extends Serializable with Logging {
+ @scala.transient private val driver = true
+
+ if (!client) {
+ val workers = sparkContext.getExecutorStorageStatus.length - 1
+
+ if (workers <= 0)
+ throw new IllegalStateException("No Spark executors found to start Ignite nodes.")
+
+ logInfo("Will start Ignite nodes on " + workers + " workers")
+
+ // Start ignite server node on each worker in server mode.
+ sparkContext.parallelize(1 to workers, workers).foreach(it ⇒ ignite())
+ }
+
+ def this(
+ sc: SparkContext,
+ springUrl: String
+ ) {
+ this(sc, () ⇒ IgnitionEx.loadConfiguration(springUrl).get1())
+ }
+
+ val sqlContext = new SQLContext(sparkContext)
+
+ /**
+ * Creates an `IgniteRDD` instance from the given cache name. If the cache does not exist, it will be
+ * automatically started from template on the first invoked RDD action.
+ *
+ * @param cacheName Cache name.
+ * @return `IgniteRDD` instance.
+ */
+ def fromCache(cacheName: String): IgniteRDD[K, V] = {
+ new IgniteRDD[K, V](this, cacheName, null)
+ }
+
+ /**
+ * Creates an `IgniteRDD` instance from the given cache configuration. If the cache does not exist, it will be
+ * automatically started using the configuration provided on the first invoked RDD action.
+ *
+ * @param cacheCfg Cache configuration to use.
+ * @return `IgniteRDD` instance.
+ */
+ def fromCache(cacheCfg: CacheConfiguration[K, V]) = {
+ new IgniteRDD[K, V](this, cacheCfg.getName, cacheCfg)
+ }
+
+ /**
+ * Gets an Ignite instance supporting this context. Ignite instance will be started
+ * if it has not been started yet.
+ *
+ * @return Ignite instance.
+ */
+ def ignite(): Ignite = {
+ val igniteCfg = cfgF()
+
+ try {
+ Ignition.ignite(igniteCfg.getGridName)
+ }
+ catch {
+ case e: Exception ⇒
+ try {
+ igniteCfg.setClientMode(client || driver)
+
+ Ignition.start(igniteCfg)
+ }
+ catch {
+ case e: Exception ⇒ Ignition.ignite(igniteCfg.getGridName)
+ }
+ }
+ }
+
+ /**
+ * Stops supporting ignite instance. If ignite instance has been already stopped, this operation will be
+ * a no-op.
+ */
+ def close() = {
+ val igniteCfg = cfgF()
+
+ Ignition.stop(igniteCfg.getGridName, false)
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
new file mode 100644
index 0000000..2146acb
--- /dev/null
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
@@ -0,0 +1,244 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.spark
+
+import javax.cache.Cache
+
+import org.apache.ignite.cache.query._
+import org.apache.ignite.cluster.ClusterNode
+import org.apache.ignite.configuration.CacheConfiguration
+import org.apache.ignite.internal.processors.cache.query.QueryCursorEx
+import org.apache.ignite.internal.processors.query.GridQueryFieldMetadata
+import org.apache.ignite.lang.IgniteUuid
+import org.apache.ignite.spark.impl._
+import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode
+import org.apache.spark.rdd.RDD
+import org.apache.spark.sql.types._
+import org.apache.spark.sql._
+import org.apache.spark._
+
+import scala.collection.JavaConversions._
+
+/**
+ * Ignite RDD. Represents Ignite cache as Spark RDD abstraction.
+ *
+ * @param ic Ignite context to use.
+ * @param cacheName Cache name.
+ * @param cacheCfg Cache configuration.
+ * @tparam K Key type.
+ * @tparam V Value type.
+ */
+class IgniteRDD[K, V] (
+ val ic: IgniteContext[K, V],
+ val cacheName: String,
+ val cacheCfg: CacheConfiguration[K, V]
+) extends IgniteAbstractRDD[(K, V), K, V] (ic, cacheName, cacheCfg) {
+ /**
+ * Computes iterator based on given partition.
+ *
+ * @param part Partition to use.
+ * @param context Task context.
+ * @return Partition iterator.
+ */
+ override def compute(part: Partition, context: TaskContext): Iterator[(K, V)] = {
+ val cache = ensureCache()
+
+ val qry: ScanQuery[K, V] = new ScanQuery[K, V](part.index)
+
+ val partNodes = ic.ignite().affinity(cache.getName).mapPartitionToPrimaryAndBackups(part.index)
+
+ val it: java.util.Iterator[Cache.Entry[K, V]] = cache.query(qry).iterator()
+
+ new IgniteQueryIterator[Cache.Entry[K, V], (K, V)](it, entry ⇒ {
+ (entry.getKey, entry.getValue)
+ })
+ }
+
+ /**
+ * Gets partitions for the given cache RDD.
+ *
+ * @return Partitions.
+ */
+ override protected[spark] def getPartitions: Array[Partition] = {
+ ensureCache()
+
+ val parts = ic.ignite().affinity(cacheName).partitions()
+
+ (0 until parts).map(new IgnitePartition(_)).toArray
+ }
+
+ /**
+ * Gets preferred locations for the given partition.
+ *
+ * @param split Split partition.
+ * @return
+ */
+ override protected[spark] def getPreferredLocations(split: Partition): Seq[String] = {
+ ensureCache()
+
+ ic.ignite().affinity(cacheName).mapPartitionToPrimaryAndBackups(split.index)
+ .map(_.asInstanceOf[TcpDiscoveryNode].socketAddresses()).flatten.map(_.getHostName).toList
+ }
+
+ /**
+ * Runs an object SQL on corresponding Ignite cache.
+ *
+ * @param typeName Type name to run SQL against.
+ * @param sql SQL query to run.
+ * @param args Optional SQL query arguments.
+ * @return RDD with query results.
+ */
+ def objectSql(typeName: String, sql: String, args: Any*): RDD[(K, V)] = {
+ val qry: SqlQuery[K, V] = new SqlQuery[K, V](typeName, sql)
+
+ qry.setArgs(args.map(_.asInstanceOf[Object]):_*)
+
+ new IgniteSqlRDD[(K, V), Cache.Entry[K, V], K, V](ic, cacheName, cacheCfg, qry, entry ⇒ (entry.getKey, entry.getValue))
+ }
+
+ /**
+ * Runs an SQL fields query.
+ *
+ * @param sql SQL statement to run.
+ * @param args Optional SQL query arguments.
+ * @return `DataFrame` instance with the query results.
+ */
+ def sql(sql: String, args: Any*): DataFrame = {
+ val qry = new SqlFieldsQuery(sql)
+
+ qry.setArgs(args.map(_.asInstanceOf[Object]):_*)
+
+ val schema = buildSchema(ensureCache().query(qry).asInstanceOf[QueryCursorEx[java.util.List[_]]].fieldsMeta())
+
+ val rowRdd = new IgniteSqlRDD[Row, java.util.List[_], K, V](ic, cacheName, cacheCfg, qry, list ⇒ Row.fromSeq(list))
+
+ ic.sqlContext.createDataFrame(rowRdd, schema)
+ }
+
+ /**
+ * Saves values from given RDD into Ignite. A unique key will be generated for each value of the given RDD.
+ *
+ * @param rdd RDD instance to save values from.
+ */
+ def saveValues(rdd: RDD[V]) = {
+ rdd.foreachPartition(it ⇒ {
+ val ig = ic.ignite()
+
+ ensureCache()
+
+ val locNode = ig.cluster().localNode()
+
+ val node: Option[ClusterNode] = ig.cluster().forHost(locNode).nodes().find(!_.eq(locNode))
+
+ val streamer = ig.dataStreamer[Object, V](cacheName)
+
+ try {
+ it.foreach(value ⇒ {
+ val key = affinityKeyFunc(value, node.orNull)
+
+ streamer.addData(key, value)
+ })
+ }
+ finally {
+ streamer.close()
+ }
+ })
+ }
+
+ /**
+ * Saves values from the given key-value RDD into Ignite.
+ *
+ * @param rdd RDD instance to save values from.
+ * @param overwrite Boolean flag indicating whether the call on this method should overwrite existing
+ * values in Ignite cache.
+ */
+ def savePairs(rdd: RDD[(K, V)], overwrite: Boolean = false) = {
+ rdd.foreachPartition(it ⇒ {
+ val ig = ic.ignite()
+
+ // Make sure to deploy the cache
+ ensureCache()
+
+ val streamer = ig.dataStreamer[K, V](cacheName)
+
+ try {
+ streamer.allowOverwrite(overwrite)
+
+ it.foreach(tup ⇒ {
+ streamer.addData(tup._1, tup._2)
+ })
+ }
+ finally {
+ streamer.close()
+ }
+ })
+ }
+
+ /**
+ * Removes all values from the underlying Ignite cache.
+ */
+ def clear(): Unit = {
+ ensureCache().removeAll()
+ }
+
+ /**
+ * Builds spark schema from query metadata.
+ *
+ * @param fieldsMeta Fields metadata.
+ * @return Spark schema.
+ */
+ private def buildSchema(fieldsMeta: java.util.List[GridQueryFieldMetadata]): StructType = {
+ new StructType(fieldsMeta.map(i ⇒ new StructField(i.fieldName(), dataType(i.fieldTypeName()), nullable = true))
+ .toArray)
+ }
+
+ /**
+ * Gets Spark data type based on type name.
+ *
+ * @param typeName Type name.
+ * @return Spark data type.
+ */
+ private def dataType(typeName: String): DataType = typeName match {
+ case "java.lang.Boolean" ⇒ BooleanType
+ case "java.lang.Byte" ⇒ ByteType
+ case "java.lang.Short" ⇒ ShortType
+ case "java.lang.Integer" ⇒ IntegerType
+ case "java.lang.Long" ⇒ LongType
+ case "java.lang.Float" ⇒ FloatType
+ case "java.lang.Double" ⇒ DoubleType
+ case "java.lang.String" ⇒ StringType
+ case "java.util.Date" ⇒ DateType
+ case "java.sql.Timestamp" ⇒ TimestampType
+ case "[B" ⇒ BinaryType
+
+ case _ ⇒ StructType(new Array[StructField](0))
+ }
+
+ /**
+ * Generates affinity key for given cluster node.
+ *
+ * @param value Value to generate key for.
+ * @param node Node to generate key for.
+ * @return Affinity key.
+ */
+ private def affinityKeyFunc(value: V, node: ClusterNode): IgniteUuid = {
+ val aff = ic.ignite().affinity[IgniteUuid](cacheName)
+
+ Stream.from(1, 1000).map(_ ⇒ IgniteUuid.randomUuid()).find(node == null || aff.mapKeyToNode(_).eq(node))
+ .getOrElse(IgniteUuid.randomUuid())
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/src/main/scala/org/apache/ignite/spark/JavaIgniteContext.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/JavaIgniteContext.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/JavaIgniteContext.scala
new file mode 100644
index 0000000..e2d57bf
--- /dev/null
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/JavaIgniteContext.scala
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spark
+
+import org.apache.ignite.Ignite
+import org.apache.ignite.configuration.{CacheConfiguration, IgniteConfiguration}
+import org.apache.ignite.internal.IgnitionEx
+import org.apache.ignite.lang.IgniteOutClosure
+import org.apache.spark.api.java.JavaSparkContext
+
+import scala.reflect.ClassTag
+
+/**
+ * Java-friendly Ignite context wrapper.
+ *
+ * @param sc Java Spark context.
+ * @param cfgF Configuration factory.
+ * @tparam K Key type.
+ * @tparam V Value type.
+ */
+class JavaIgniteContext[K, V](
+ @scala.transient val sc: JavaSparkContext,
+ val cfgF: IgniteOutClosure[IgniteConfiguration]) extends Serializable {
+
+ @transient val ic: IgniteContext[K, V] = new IgniteContext[K, V](sc.sc, () => cfgF.apply())
+
+ def this(sc: JavaSparkContext, springUrl: String) {
+ this(sc, new IgniteOutClosure[IgniteConfiguration] {
+ override def apply() = IgnitionEx.loadConfiguration(springUrl).get1()
+ })
+ }
+
+ def fromCache(cacheName: String): JavaIgniteRDD[K, V] =
+ JavaIgniteRDD.fromIgniteRDD(new IgniteRDD[K, V](ic, cacheName, null))
+
+ def fromCache(cacheCfg: CacheConfiguration[K, V]) =
+ JavaIgniteRDD.fromIgniteRDD(new IgniteRDD[K, V](ic, cacheCfg.getName, cacheCfg))
+
+ def ignite(): Ignite = ic.ignite()
+
+ def close() = ic.close()
+
+ private[spark] def fakeClassTag[T]: ClassTag[T] = ClassTag.AnyRef.asInstanceOf[ClassTag[T]]
+
+ implicit val ktag: ClassTag[K] = fakeClassTag
+
+ implicit val vtag: ClassTag[V] = fakeClassTag
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/src/main/scala/org/apache/ignite/spark/JavaIgniteRDD.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/JavaIgniteRDD.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/JavaIgniteRDD.scala
new file mode 100644
index 0000000..2e8702e
--- /dev/null
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/JavaIgniteRDD.scala
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spark
+
+import java.util
+
+import org.apache.spark.api.java.{JavaPairRDD, JavaRDD}
+import org.apache.spark.rdd.RDD
+import org.apache.spark.sql.DataFrame
+import org.apache.spark.{Partition, TaskContext}
+
+import scala.annotation.varargs
+import scala.collection.JavaConversions._
+import scala.language.implicitConversions
+import scala.reflect.ClassTag
+
+/**
+ * Java-friendly Ignite RDD wrapper. Represents Ignite cache as Java Spark RDD abstraction.
+ *
+ * @param rdd Ignite RDD instance.
+ * @tparam K Key type.
+ * @tparam V Value type.
+ */
+class JavaIgniteRDD[K, V](override val rdd: IgniteRDD[K, V])
+ extends JavaPairRDD[K, V](rdd)(JavaIgniteRDD.fakeClassTag, JavaIgniteRDD.fakeClassTag) {
+
+ override def wrapRDD(rdd: RDD[(K, V)]): JavaPairRDD[K, V] = JavaPairRDD.fromRDD(rdd)
+
+ override val classTag: ClassTag[(K, V)] = JavaIgniteRDD.fakeClassTag
+
+ /**
+ * Computes iterator based on given partition.
+ *
+ * @param part Partition to use.
+ * @param context Task context.
+ * @return Partition iterator.
+ */
+ def compute(part: Partition, context: TaskContext): Iterator[(K, V)] = {
+ rdd.compute(part, context)
+ }
+
+ /**
+ * Gets partitions for the given cache RDD.
+ *
+ * @return Partitions.
+ */
+ protected def getPartitions: java.util.List[Partition] = {
+ new util.ArrayList[Partition](rdd.getPartitions.toSeq)
+ }
+
+ /**
+ * Gets preferred locations for the given partition.
+ *
+ * @param split Split partition.
+ * @return
+ */
+ protected def getPreferredLocations(split: Partition): Seq[String] = {
+ rdd.getPreferredLocations(split)
+ }
+
+ @varargs def objectSql(typeName: String, sql: String, args: Any*): JavaPairRDD[K, V] =
+ JavaPairRDD.fromRDD(rdd.objectSql(typeName, sql, args:_*))
+
+ @varargs def sql(sql: String, args: Any*): DataFrame = rdd.sql(sql, args:_*)
+
+ def saveValues(jrdd: JavaRDD[V]) = rdd.saveValues(JavaRDD.toRDD(jrdd))
+
+ def savePairs(jrdd: JavaPairRDD[K, V]) = {
+ val rrdd: RDD[(K, V)] = JavaPairRDD.toRDD(jrdd)
+
+ rdd.savePairs(rrdd)
+ }
+
+ def clear(): Unit = rdd.clear()
+}
+
+object JavaIgniteRDD {
+ implicit def fromIgniteRDD[K: ClassTag, V: ClassTag](rdd: IgniteRDD[K, V]): JavaIgniteRDD[K, V] =
+ new JavaIgniteRDD[K, V](rdd)
+
+ implicit def toIgniteRDD[K, V](rdd: JavaIgniteRDD[K, V]): IgniteRDD[K, V] = rdd.rdd
+
+ def fakeClassTag[T]: ClassTag[T] = ClassTag.AnyRef.asInstanceOf[ClassTag[T]]
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteAbstractRDD.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteAbstractRDD.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteAbstractRDD.scala
new file mode 100644
index 0000000..25b3b56
--- /dev/null
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteAbstractRDD.scala
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spark.impl
+
+import org.apache.ignite.IgniteCache
+import org.apache.ignite.configuration.CacheConfiguration
+import org.apache.ignite.spark.IgniteContext
+import org.apache.spark.rdd.RDD
+
+import scala.reflect.ClassTag
+
+abstract class IgniteAbstractRDD[R:ClassTag, K, V] (
+ ic: IgniteContext[K, V],
+ cacheName: String,
+ cacheCfg: CacheConfiguration[K, V]
+) extends RDD[R] (ic.sparkContext, deps = Nil) {
+ protected def ensureCache(): IgniteCache[K, V] = {
+ // Make sure to deploy the cache
+ if (cacheCfg != null)
+ ic.ignite().getOrCreateCache(cacheCfg)
+ else
+ ic.ignite().getOrCreateCache(cacheName)
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgnitePartition.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgnitePartition.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgnitePartition.scala
new file mode 100644
index 0000000..2def636
--- /dev/null
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgnitePartition.scala
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spark.impl
+
+import org.apache.spark.Partition
+
+class IgnitePartition(idx: Int) extends Partition {
+ override def index: Int = idx
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteQueryIterator.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteQueryIterator.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteQueryIterator.scala
new file mode 100644
index 0000000..4165fd3
--- /dev/null
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteQueryIterator.scala
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spark.impl
+
+class IgniteQueryIterator[T, R] (
+ cur: java.util.Iterator[T],
+ conv: (T) ⇒ R
+) extends Iterator[R] {
+ override def hasNext: Boolean = cur.hasNext
+
+ override def next(): R = conv(cur.next())
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala
new file mode 100644
index 0000000..762a6ed
--- /dev/null
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spark.impl
+
+import org.apache.ignite.cache.query.Query
+import org.apache.ignite.configuration.CacheConfiguration
+import org.apache.ignite.spark.IgniteContext
+import org.apache.spark.{TaskContext, Partition}
+
+import scala.reflect.ClassTag
+
+class IgniteSqlRDD[R: ClassTag, T, K, V](
+ ic: IgniteContext[K, V],
+ cacheName: String,
+ cacheCfg: CacheConfiguration[K, V],
+ qry: Query[T],
+ conv: (T) ⇒ R
+) extends IgniteAbstractRDD[R, K, V](ic, cacheName, cacheCfg) {
+ override def compute(split: Partition, context: TaskContext): Iterator[R] = {
+ new IgniteQueryIterator[T, R](ensureCache().query(qry).iterator(), conv)
+ }
+
+ override protected def getPartitions: Array[Partition] = {
+ Array(new IgnitePartition(0))
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/src/main/scala/org/apache/ignite/spark/impl/JavaIgniteAbstractRDD.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/impl/JavaIgniteAbstractRDD.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/impl/JavaIgniteAbstractRDD.scala
new file mode 100644
index 0000000..13bd3e8
--- /dev/null
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/impl/JavaIgniteAbstractRDD.scala
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spark.impl
+
+import org.apache.ignite.IgniteCache
+import org.apache.ignite.spark.IgniteRDD
+import org.apache.spark.api.java.{JavaPairRDD, JavaRDDLike}
+
+abstract class JavaIgniteAbstractRDD[K, V](val rdd: IgniteRDD[K, V])
+ extends JavaRDDLike[(K, V), JavaPairRDD[K, V]] {
+
+ protected def ensureCache(): IgniteCache[K, V] = {
+ // Make sure to deploy the cache
+ if (rdd.cacheCfg != null)
+ rdd.ic.ignite().getOrCreateCache(rdd.cacheCfg)
+ else
+ rdd.ic.ignite().getOrCreateCache(rdd.cacheName)
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/src/test/java/org/apache/ignite/spark/JavaIgniteRDDSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spark/src/test/java/org/apache/ignite/spark/JavaIgniteRDDSelfTest.java b/modules/spark/src/test/java/org/apache/ignite/spark/JavaIgniteRDDSelfTest.java
new file mode 100644
index 0000000..e14abfc
--- /dev/null
+++ b/modules/spark/src/test/java/org/apache/ignite/spark/JavaIgniteRDDSelfTest.java
@@ -0,0 +1,298 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spark;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.junits.common.*;
+import org.apache.spark.api.java.*;
+import org.apache.spark.api.java.function.*;
+import org.apache.spark.api.java.function.Function;
+import org.apache.spark.api.java.function.Function2;
+import org.apache.spark.sql.*;
+
+import scala.*;
+
+import java.util.*;
+
+/**
+ * Tests for {@link JavaIgniteRDD}.
+ */
+public class JavaIgniteRDDSelfTest extends GridCommonAbstractTest {
+ /** Grid count. */
+ private static final int GRID_CNT = 3;
+
+ /** Keys count. */
+ private static final int KEYS_CNT = 10000;
+
+ /** Cache name. */
+ private static final String PARTITIONED_CACHE_NAME = "partitioned";
+
+ /** Ip finder. */
+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+ /** Sum function. */
+ private static final Function2<Integer, Integer, Integer> SUM_F = new Function2<Integer, Integer, Integer>() {
+ public Integer call(Integer x, Integer y) {
+ return x + y;
+ }
+ };
+
+ /** To pair function. */
+ private static final PairFunction<Integer, String, String> TO_PAIR_F = new PairFunction<Integer, String, String>() {
+ /** {@inheritDoc} */
+ @Override public Tuple2<String, String> call(Integer i) {
+ return new Tuple2<>(String.valueOf(i), "val" + i);
+ }
+ };
+
+ /** (String, Integer); pair to Integer value function. */
+ private static final Function<Tuple2<String, Integer>, Integer> STR_INT_PAIR_TO_INT_F = new PairToValueFunction<>();
+
+ /** (String, Entity) pair to Entity value function. */
+ private static final Function<Tuple2<String, Entity>, Entity> STR_ENTITY_PAIR_TO_ENTITY_F =
+ new PairToValueFunction<>();
+
+ /** Integer to entity function. */
+ private static final PairFunction<Integer, String, Entity> INT_TO_ENTITY_F =
+ new PairFunction<Integer, String, Entity>() {
+ @Override public Tuple2<String, Entity> call(Integer i) throws Exception {
+ return new Tuple2<>(String.valueOf(i), new Entity(i, "name" + i, i * 100));
+ }
+ };
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ Ignition.ignite("grid-0").cache(PARTITIONED_CACHE_NAME).removeAll();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ Ignition.stop("client", false);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ for (int i = 0; i < GRID_CNT; i++)
+ Ignition.start(getConfiguration("grid-" + i, false));
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ for (int i = 0; i < GRID_CNT; i++)
+ Ignition.stop("grid-" + i, false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testStoreDataToIgnite() throws Exception {
+ JavaSparkContext sc = new JavaSparkContext("local[*]", "test");
+
+ try {
+ JavaIgniteContext<String, String> ic = new JavaIgniteContext<>(sc, new IgniteConfigProvider());
+
+ ic.fromCache(PARTITIONED_CACHE_NAME)
+ .savePairs(sc.parallelize(F.range(0, KEYS_CNT), 2).mapToPair(TO_PAIR_F));
+
+ Ignite ignite = Ignition.ignite("grid-0");
+
+ IgniteCache<String, String> cache = ignite.cache(PARTITIONED_CACHE_NAME);
+
+ for (int i = 0; i < KEYS_CNT; i++) {
+ String val = cache.get(String.valueOf(i));
+
+ assertNotNull("Value was not put to cache for key: " + i, val);
+ assertEquals("Invalid value stored for key: " + i, "val" + i, val);
+ }
+ }
+ finally {
+ sc.stop();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReadDataFromIgnite() throws Exception {
+ JavaSparkContext sc = new JavaSparkContext("local[*]", "test");
+
+ try {
+ JavaIgniteContext<String, Integer> ic = new JavaIgniteContext<>(sc, new IgniteConfigProvider());
+
+ Ignite ignite = Ignition.ignite("grid-0");
+
+ IgniteCache<String, Integer> cache = ignite.cache(PARTITIONED_CACHE_NAME);
+
+ for (int i = 0; i < KEYS_CNT; i++)
+ cache.put(String.valueOf(i), i);
+
+ JavaRDD<Integer> values = ic.fromCache(PARTITIONED_CACHE_NAME).map(STR_INT_PAIR_TO_INT_F);
+
+ int sum = values.fold(0, SUM_F);
+
+ int expSum = (KEYS_CNT * KEYS_CNT + KEYS_CNT) / 2 - KEYS_CNT;
+
+ assertEquals(expSum, sum);
+ }
+ finally {
+ sc.stop();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testQueryObjectsFromIgnite() throws Exception {
+ JavaSparkContext sc = new JavaSparkContext("local[*]", "test");
+
+ try {
+ JavaIgniteContext<String, Entity> ic = new JavaIgniteContext<>(sc, new IgniteConfigProvider());
+
+ JavaIgniteRDD<String, Entity> cache = ic.fromCache(PARTITIONED_CACHE_NAME);
+
+ cache.savePairs(sc.parallelize(F.range(0, 1001), 2).mapToPair(INT_TO_ENTITY_F));
+
+ List<Entity> res = cache.objectSql("Entity", "name = ? and salary = ?", "name50", 5000)
+ .map(STR_ENTITY_PAIR_TO_ENTITY_F).collect();
+
+ assertEquals("Invalid result length", 1, res.size());
+ assertEquals("Invalid result", 50, res.get(0).id());
+ assertEquals("Invalid result", "name50", res.get(0).name());
+ assertEquals("Invalid result", 5000, res.get(0).salary());
+ assertEquals("Invalid count", 500, cache.objectSql("Entity", "id > 500").count());
+ }
+ finally {
+ sc.stop();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testQueryFieldsFromIgnite() throws Exception {
+ JavaSparkContext sc = new JavaSparkContext("local[*]", "test");
+
+ try {
+ JavaIgniteContext<String, Entity> ic = new JavaIgniteContext<>(sc, new IgniteConfigProvider());
+
+ JavaIgniteRDD<String, Entity> cache = ic.fromCache(PARTITIONED_CACHE_NAME);
+
+ cache.savePairs(sc.parallelize(F.range(0, 1001), 2).mapToPair(INT_TO_ENTITY_F));
+
+ DataFrame df =
+ cache.sql("select id, name, salary from Entity where name = ? and salary = ?", "name50", 5000);
+
+ df.printSchema();
+
+ Row[] res = df.collect();
+
+ assertEquals("Invalid result length", 1, res.length);
+ assertEquals("Invalid result", 50, res[0].get(0));
+ assertEquals("Invalid result", "name50", res[0].get(1));
+ assertEquals("Invalid result", 5000, res[0].get(2));
+
+ Column exp = new Column("NAME").equalTo("name50").and(new Column("SALARY").equalTo(5000));
+
+ DataFrame df0 = cache.sql("select id, name, salary from Entity").where(exp);
+
+ df.printSchema();
+
+ Row[] res0 = df0.collect();
+
+ assertEquals("Invalid result length", 1, res0.length);
+ assertEquals("Invalid result", 50, res0[0].get(0));
+ assertEquals("Invalid result", "name50", res0[0].get(1));
+ assertEquals("Invalid result", 5000, res0[0].get(2));
+
+ assertEquals("Invalid count", 500, cache.sql("select id from Entity where id > 500").count());
+ }
+ finally {
+ sc.stop();
+ }
+
+ }
+
+ /**
+ * @param gridName Grid name.
+ * @param client Client.
+ */
+ private static IgniteConfiguration getConfiguration(String gridName, boolean client) throws Exception {
+ IgniteConfiguration cfg = new IgniteConfiguration();
+
+ TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+ discoSpi.setIpFinder(IP_FINDER);
+
+ cfg.setDiscoverySpi(discoSpi);
+
+ cfg.setCacheConfiguration(cacheConfiguration());
+
+ cfg.setClientMode(client);
+
+ cfg.setGridName(gridName);
+
+ return cfg;
+ }
+
+ /**
+ * Creates cache configuration.
+ */
+ private static CacheConfiguration<Object, Object> cacheConfiguration() {
+ CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+
+ ccfg.setBackups(1);
+
+ ccfg.setName(PARTITIONED_CACHE_NAME);
+
+ ccfg.setIndexedTypes(String.class, Entity.class);
+
+ return ccfg;
+ }
+
+ /**
+ * Ignite configiration provider.
+ */
+ static class IgniteConfigProvider implements IgniteOutClosure<IgniteConfiguration> {
+ /** {@inheritDoc} */
+ @Override public IgniteConfiguration apply() {
+ try {
+ return getConfiguration("client", true);
+ }
+ catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ /**
+ * @param <K>
+ * @param <V>
+ */
+ static class PairToValueFunction<K, V> implements Function<Tuple2<K, V>, V> {
+ /** {@inheritDoc} */
+ @Override public V call(Tuple2<K, V> t) throws Exception {
+ return t._2();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/src/test/scala/org/apache/ignite/spark/Entity.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/test/scala/org/apache/ignite/spark/Entity.scala b/modules/spark/src/test/scala/org/apache/ignite/spark/Entity.scala
new file mode 100644
index 0000000..00beac6
--- /dev/null
+++ b/modules/spark/src/test/scala/org/apache/ignite/spark/Entity.scala
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spark
+
+import org.apache.ignite.spark.IgniteRddSpec.ScalarCacheQuerySqlField
+
+class Entity (
+ @ScalarCacheQuerySqlField(index = true) val id: Int,
+ @ScalarCacheQuerySqlField(index = true) val name: String,
+ @ScalarCacheQuerySqlField(index = true) val salary: Int
+) extends Serializable {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/spark/src/test/scala/org/apache/ignite/spark/IgniteRddSpec.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/test/scala/org/apache/ignite/spark/IgniteRddSpec.scala b/modules/spark/src/test/scala/org/apache/ignite/spark/IgniteRddSpec.scala
new file mode 100644
index 0000000..26ce693
--- /dev/null
+++ b/modules/spark/src/test/scala/org/apache/ignite/spark/IgniteRddSpec.scala
@@ -0,0 +1,231 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spark
+
+import org.apache.ignite.Ignition
+import org.apache.ignite.cache.query.annotations.{QueryTextField, QuerySqlField}
+import org.apache.ignite.configuration.{CacheConfiguration, IgniteConfiguration}
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder
+import org.apache.spark.SparkContext
+import org.junit.runner.RunWith
+import org.scalatest._
+import org.scalatest.junit.JUnitRunner
+
+import IgniteRddSpec._
+
+import scala.annotation.meta.field
+
+@RunWith(classOf[JUnitRunner])
+class IgniteRddSpec extends FunSpec with Matchers with BeforeAndAfterAll with BeforeAndAfterEach {
+ describe("IgniteRDD") {
+ it("should successfully store data to ignite") {
+ val sc = new SparkContext("local[*]", "test")
+
+ try {
+ val ic = new IgniteContext[String, String](sc,
+ () ⇒ configuration("client", client = true))
+
+ // Save pairs ("0", "val0"), ("1", "val1"), ... to Ignite cache.
+ ic.fromCache(PARTITIONED_CACHE_NAME).savePairs(sc.parallelize(0 to 10000, 2).map(i ⇒ (String.valueOf(i), "val" + i)))
+
+ // Check cache contents.
+ val ignite = Ignition.ignite("grid-0")
+
+ for (i ← 0 to 10000) {
+ val res = ignite.cache[String, String](PARTITIONED_CACHE_NAME).get(String.valueOf(i))
+
+ assert(res != null, "Value was not put to cache for key: " + i)
+ assert("val" + i == res, "Invalid value stored for key: " + i)
+ }
+ }
+ finally {
+ sc.stop()
+ }
+ }
+
+ it("should successfully read data from ignite") {
+ val sc = new SparkContext("local[*]", "test")
+
+ try {
+ val cache = Ignition.ignite("grid-0").cache[String, Int](PARTITIONED_CACHE_NAME)
+
+ val num = 10000
+
+ for (i ← 0 to num) {
+ cache.put(String.valueOf(i), i)
+ }
+
+ val ic = new IgniteContext[String, Int](sc,
+ () ⇒ configuration("client", client = true))
+
+ val res = ic.fromCache(PARTITIONED_CACHE_NAME).map(_._2).sum()
+
+ assert(res == (0 to num).sum)
+ }
+ finally {
+ sc.stop()
+ }
+ }
+
+ it("should successfully query objects from ignite") {
+ val sc = new SparkContext("local[*]", "test")
+
+ try {
+ val ic = new IgniteContext[String, Entity](sc,
+ () ⇒ configuration("client", client = true))
+
+ val cache: IgniteRDD[String, Entity] = ic.fromCache(PARTITIONED_CACHE_NAME)
+
+ cache.savePairs(sc.parallelize(0 to 1000, 2).map(i ⇒ (String.valueOf(i), new Entity(i, "name" + i, i * 100))))
+
+ val res: Array[Entity] = cache.objectSql("Entity", "name = ? and salary = ?", "name50", 5000).map(_._2).collect()
+
+ assert(res.length == 1, "Invalid result length")
+ assert(50 == res(0).id, "Invalid result")
+ assert("name50" == res(0).name, "Invalid result")
+ assert(5000 == res(0).salary)
+
+ assert(500 == cache.objectSql("Entity", "id > 500").count(), "Invalid count")
+ }
+ finally {
+ sc.stop()
+ }
+ }
+
+ it("should successfully query fields from ignite") {
+ val sc = new SparkContext("local[*]", "test")
+
+ try {
+ val ic = new IgniteContext[String, Entity](sc,
+ () ⇒ configuration("client", client = true))
+
+ val cache: IgniteRDD[String, Entity] = ic.fromCache(PARTITIONED_CACHE_NAME)
+
+ import ic.sqlContext.implicits._
+
+ cache.savePairs(sc.parallelize(0 to 1000, 2).map(i ⇒ (String.valueOf(i), new Entity(i, "name" + i, i * 100))))
+
+ val df = cache.sql("select id, name, salary from Entity where name = ? and salary = ?", "name50", 5000)
+
+ df.printSchema()
+
+ val res = df.collect()
+
+ assert(res.length == 1, "Invalid result length")
+ assert(50 == res(0)(0), "Invalid result")
+ assert("name50" == res(0)(1), "Invalid result")
+ assert(5000 == res(0)(2), "Invalid result")
+
+ val df0 = cache.sql("select id, name, salary from Entity").where('NAME === "name50" and 'SALARY === 5000)
+
+ val res0 = df0.collect()
+
+ assert(res0.length == 1, "Invalid result length")
+ assert(50 == res0(0)(0), "Invalid result")
+ assert("name50" == res0(0)(1), "Invalid result")
+ assert(5000 == res0(0)(2), "Invalid result")
+
+ assert(500 == cache.sql("select id from Entity where id > 500").count(), "Invalid count")
+ }
+ finally {
+ sc.stop()
+ }
+ }
+ }
+
+ override protected def beforeEach() = {
+ Ignition.ignite("grid-0").cache(PARTITIONED_CACHE_NAME).removeAll()
+ }
+
+ override protected def afterEach() = {
+ Ignition.stop("client", false)
+ }
+
+ override protected def beforeAll() = {
+ for (i ← 0 to 3) {
+ Ignition.start(configuration("grid-" + i, client = false))
+ }
+ }
+
+ override protected def afterAll() = {
+ for (i ← 0 to 3) {
+ Ignition.stop("grid-" + i, false)
+ }
+ }
+}
+
+/**
+ * Constants and utility methods.
+ */
+object IgniteRddSpec {
+ /** IP finder for the test. */
+ val IP_FINDER = new TcpDiscoveryVmIpFinder(true)
+
+ /** Partitioned cache name. */
+ val PARTITIONED_CACHE_NAME = "partitioned"
+
+ /** Type alias for `QuerySqlField`. */
+ type ScalarCacheQuerySqlField = QuerySqlField @field
+
+ /** Type alias for `QueryTextField`. */
+ type ScalarCacheQueryTextField = QueryTextField @field
+
+ /**
+ * Gets ignite configuration.
+ *
+ * @param gridName Grid name.
+ * @param client Client mode flag.
+ * @return Ignite configuration.
+ */
+ def configuration(gridName: String, client: Boolean): IgniteConfiguration = {
+ val cfg = new IgniteConfiguration
+
+ val discoSpi = new TcpDiscoverySpi
+
+ discoSpi.setIpFinder(IgniteRddSpec.IP_FINDER)
+
+ cfg.setDiscoverySpi(discoSpi)
+
+ cfg.setCacheConfiguration(cacheConfiguration(gridName))
+
+ cfg.setClientMode(client)
+
+ cfg.setGridName(gridName)
+
+ cfg
+ }
+
+ /**
+ * Gets cache configuration for the given grid name.
+ *
+ * @param gridName Grid name.
+ * @return Cache configuration.
+ */
+ def cacheConfiguration(gridName: String): CacheConfiguration[Object, Object] = {
+ val ccfg = new CacheConfiguration[Object, Object]()
+
+ ccfg.setBackups(1)
+
+ ccfg.setName(PARTITIONED_CACHE_NAME)
+
+ ccfg.setIndexedTypes(classOf[String], classOf[Entity])
+
+ ccfg
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/visor-console-2.10/README.txt
----------------------------------------------------------------------
diff --git a/modules/visor-console-2.10/README.txt b/modules/visor-console-2.10/README.txt
new file mode 100644
index 0000000..1a018b9
--- /dev/null
+++ b/modules/visor-console-2.10/README.txt
@@ -0,0 +1,4 @@
+Apache Ignite Visor Console Module
+---------------------------
+
+Apache Ignite Visor Console module to be build with Scala 2.10.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/visor-console-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console-2.10/pom.xml b/modules/visor-console-2.10/pom.xml
new file mode 100644
index 0000000..f0df657
--- /dev/null
+++ b/modules/visor-console-2.10/pom.xml
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!--
+ POM file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-parent</artifactId>
+ <version>1</version>
+ <relativePath>../../parent</relativePath>
+ </parent>
+
+ <artifactId>ignite-visor-console_2.10</artifactId>
+ <version>1.1.1-SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-ssh</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-spring</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-expression</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ <version>2.10.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>jline</artifactId>
+ <version>2.10.4</version>
+ </dependency>
+ <!-- Third party dependencies -->
+
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-indexing</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.scalatest</groupId>
+ <artifactId>scalatest_2.10</artifactId>
+ <version>2.2.2</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- Test dependencies -->
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>../visor-console/src/main/scala</directory>
+ <excludes>
+ <exclude>**/*.scala</exclude>
+ </excludes>
+ </resource>
+ </resources>
+
+ <testResources>
+ <testResource>
+ <directory>../visor-console/src/test/scala</directory>
+ <excludes>
+ <exclude>**/*.scala</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+
+ <!-- TODO IGNITE-956 FIX scaladocs plugins-->
+ <!--<plugin>-->
+ <!--<groupId>net.alchim31.maven</groupId>-->
+ <!--<artifactId>scala-maven-plugin</artifactId>-->
+ <!--<executions>-->
+ <!--<execution>-->
+ <!--<id>scaladoc</id>-->
+ <!--<phase>prepare-package</phase>-->
+ <!--<goals>-->
+ <!--<goal>doc</goal>-->
+ <!--</goals>-->
+ <!--<configuration>-->
+ <!--<doctitle>Ignite Console Visor</doctitle>-->
+ <!--<windowtitle>Ignite Console Visor</windowtitle>-->
+ <!--</configuration>-->
+ <!--</execution>-->
+ <!--</executions>-->
+ <!--</plugin>-->
+
+ <!--<plugin>-->
+ <!--<groupId>org.apache.maven.plugins</groupId>-->
+ <!--<artifactId>maven-antrun-plugin</artifactId>-->
+ <!--<version>1.7</version>-->
+ <!--<executions>-->
+ <!--<execution>-->
+ <!--<id>javadoc-zip</id>-->
+ <!--<goals>-->
+ <!--<goal>run</goal>-->
+ <!--</goals>-->
+ <!--<phase>prepare-package</phase>-->
+ <!--<configuration>-->
+ <!--<target>-->
+ <!--<zip destfile="target/ignite-visor-console-${project.version}-javadoc.jar" basedir="target/site/scaladocs" encoding="UTF-8" />-->
+ <!--</target>-->
+ <!--</configuration>-->
+ <!--</execution>-->
+ <!--</executions>-->
+ <!--</plugin>-->
+ <!--/plugins-->
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index a514e35..f5b73df 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -321,6 +321,10 @@
<title>Mesos Framework</title>
<packages>org.apache.ignite.mesos*</packages>
</group>
+ <group>
+ <title>Spark Integration</title>
+ <packages>org.apache.ignite.spark.examples.java</packages>
+ </group>
</groups>
<header>
<![CDATA[
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6f8524f..a08dd6c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -409,18 +409,34 @@
<id>scala</id>
<activation>
- <activeByDefault>true</activeByDefault>
- <jdk>[1.7,)</jdk>
+ <property><name>!scala-2.10</name></property>
</activation>
<modules>
<module>modules/scalar</module>
+ <module>modules/spark</module>
<module>modules/visor-console</module>
<module>modules/visor-plugins</module>
</modules>
</profile>
<profile>
+ <id>scala-2.10</id>
+
+ <activation>
+ <property><name>scala-2.10</name></property>
+ </activation>
+
+ <modules>
+ <module>modules/scalar-2.10</module>
+ <module>modules/spark-2.10</module>
+ <module>modules/visor-console-2.10</module>
+ <module>modules/visor-plugins</module>
+ </modules>
+ </profile>
+
+
+ <profile>
<id>lgpl</id>
<modules>
<module>modules/hibernate</module>
[04/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: merge
from ignite-545
Posted by se...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/455b96fc/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java b/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
index 79b42b2..727db4c 100644
--- a/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
+++ b/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
@@ -5,16 +5,22 @@
*/
/*
- * The initial version of this file was copied from JSR-166:
- * http://gee.cs.oswego.edu/dl/concurrency-interest/
+ * The latest version of the file corresponds to the following CVS commit:
+ * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jdk7/java/util/concurrent/ConcurrentHashMap.java?pathrev=1.43
+ *
+ * Note, that the repository above is JDK 7 based that is kept up-to-date too.
+ * The main repository (JDK 8 based) uses JDK 8 features significantly that unavailable in JDK 7.
*/
+
package org.jsr166;
import java.io.*;
import java.util.*;
import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
import java.util.concurrent.locks.*;
+import java.lang.reflect.*;
/**
* A hash table supporting full concurrency of retrievals and
@@ -68,21 +74,15 @@ import java.util.concurrent.locks.*;
* expected {@code concurrencyLevel} as an additional hint for
* internal sizing. Note that using many keys with exactly the same
* {@code hashCode()} is a sure way to slow down performance of any
- * hash table.
+ * hash table. To ameliorate impact, when keys are {@link Comparable},
+ * this class may use comparison order among keys to help break ties.
*
- * <p>A {@link Set} projection of a ConcurrentHashMapV8 may be created
+ * <p>A {@link Set} projection of a ConcurrentHashMap may be created
* (using {@link #newKeySet()} or {@link #newKeySet(int)}), or viewed
* (using {@link #keySet(Object)} when only keys are of interest, and the
* mapped values are (perhaps transiently) not used or all take the
* same mapping value.
*
- * <p>A ConcurrentHashMapV8 can be used as scalable frequency map (a
- * form of histogram or multiset) by using {@link LongAdder8} values
- * and initializing via {@link #computeIfAbsent}. For example, to add
- * a count to a {@code ConcurrentHashMapV8<String,LongAdder8> freqs}, you
- * can use {@code freqs.computeIfAbsent(k -> new
- * LongAdder8()).increment();}
- *
* <p>This class and its views and iterators implement all of the
* <em>optional</em> methods of the {@link Map} and {@link Iterator}
* interfaces.
@@ -90,90 +90,9 @@ import java.util.concurrent.locks.*;
* <p>Like {@link Hashtable} but unlike {@link HashMap}, this class
* does <em>not</em> allow {@code null} to be used as a key or value.
*
- * <ul>
- * <li> forEach: Perform a given action on each element.
- * A variant form applies a given transformation on each element
- * before performing the action.</li>
- *
- * <li> search: Return the first available non-null result of
- * applying a given function on each element; skipping further
- * search when a result is found.</li>
- *
- * <li> reduce: Accumulate each element. The supplied reduction
- * function cannot rely on ordering (more formally, it should be
- * both associative and commutative). There are five variants:
- *
- * <ul>
- *
- * <li> Plain reductions. (There is not a form of this method for
- * (key, value) function arguments since there is no corresponding
- * return type.)</li>
- *
- * <li> Mapped reductions that accumulate the results of a given
- * function applied to each element.</li>
- *
- * <li> Reductions to scalar doubles, longs, and ints, using a
- * given basis value.</li>
- *
- * </li>
- * </ul>
- * </ul>
- *
- * <p>The concurrency properties of bulk operations follow
- * from those of ConcurrentHashMapV8: Any non-null result returned
- * from {@code get(key)} and related access methods bears a
- * happens-before relation with the associated insertion or
- * update. The result of any bulk operation reflects the
- * composition of these per-element relations (but is not
- * necessarily atomic with respect to the map as a whole unless it
- * is somehow known to be quiescent). Conversely, because keys
- * and values in the map are never null, null serves as a reliable
- * atomic indicator of the current lack of any result. To
- * maintain this property, null serves as an implicit basis for
- * all non-scalar reduction operations. For the double, long, and
- * int versions, the basis should be one that, when combined with
- * any other value, returns that other value (more formally, it
- * should be the identity element for the reduction). Most common
- * reductions have these properties; for example, computing a sum
- * with basis 0 or a minimum with basis MAX_VALUE.
- *
- * <p>Search and transformation functions provided as arguments
- * should similarly return null to indicate the lack of any result
- * (in which case it is not used). In the case of mapped
- * reductions, this also enables transformations to serve as
- * filters, returning null (or, in the case of primitive
- * specializations, the identity basis) if the element should not
- * be combined. You can create compound transformations and
- * filterings by composing them yourself under this "null means
- * there is nothing there now" rule before using them in search or
- * reduce operations.
- *
- * <p>Methods accepting and/or returning Entry arguments maintain
- * key-value associations. They may be useful for example when
- * finding the key for the greatest value. Note that "plain" Entry
- * arguments can be supplied using {@code new
- * AbstractMap.SimpleEntry(k,v)}.
- *
- * <p>Bulk operations may complete abruptly, throwing an
- * exception encountered in the application of a supplied
- * function. Bear in mind when handling such exceptions that other
- * concurrently executing functions could also have thrown
- * exceptions, or would have done so if the first exception had
- * not occurred.
- *
- * <p>Parallel speedups for bulk operations compared to sequential
- * processing are common but not guaranteed. Operations involving
- * brief functions on small maps may execute more slowly than
- * sequential loops if the underlying work to parallelize the
- * computation is more expensive than the computation itself.
- * Similarly, parallelization may not lead to much actual parallelism
- * if all processors are busy performing unrelated tasks.
- *
- * <p>All arguments to all task methods must be non-null.
- *
- * <p><em>jsr166e note: During transition, this class
- * uses nested functional interfaces with different names but the
- * same forms as those expected for JDK8.</em>
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
*
* @since 1.5
* @author Doug Lea
@@ -181,80 +100,9 @@ import java.util.concurrent.locks.*;
* @param <V> the type of mapped values
*/
@SuppressWarnings("ALL")
-public class ConcurrentHashMap8<K, V>
- implements ConcurrentMap<K, V>, Serializable {
+public class ConcurrentHashMap8<K,V> implements ConcurrentMap<K,V>, Serializable {
private static final long serialVersionUID = 7249069246763182397L;
- /**
- * A partitionable iterator. A Spliterator can be traversed
- * directly, but can also be partitioned (before traversal) by
- * creating another Spliterator that covers a non-overlapping
- * portion of the elements, and so may be amenable to parallel
- * execution.
- *
- * <p>This interface exports a subset of expected JDK8
- * functionality.
- *
- * <p>Sample usage: Here is one (of the several) ways to compute
- * the sum of the values held in a map using the ForkJoin
- * framework. As illustrated here, Spliterators are well suited to
- * designs in which a task repeatedly splits off half its work
- * into forked subtasks until small enough to process directly,
- * and then joins these subtasks. Variants of this style can also
- * be used in completion-based designs.
- *
- * <pre>
- * {@code ConcurrentHashMapV8<String, Long> m = ...
- * // split as if have 8 * parallelism, for load balance
- * int n = m.size();
- * int p = aForkJoinPool.getParallelism() * 8;
- * int split = (n < p)? n : p;
- * long sum = aForkJoinPool.invoke(new SumValues(m.valueSpliterator(), split, null));
- * // ...
- * static class SumValues extends RecursiveTask<Long> {
- * final Spliterator<Long> s;
- * final int split; // split while > 1
- * final SumValues nextJoin; // records forked subtasks to join
- * SumValues(Spliterator<Long> s, int depth, SumValues nextJoin) {
- * this.s = s; this.depth = depth; this.nextJoin = nextJoin;
- * }
- * public Long compute() {
- * long sum = 0;
- * SumValues subtasks = null; // fork subtasks
- * for (int s = split >>> 1; s > 0; s >>>= 1)
- * (subtasks = new SumValues(s.split(), s, subtasks)).fork();
- * while (s.hasNext()) // directly process remaining elements
- * sum += s.next();
- * for (SumValues t = subtasks; t != null; t = t.nextJoin)
- * sum += t.join(); // collect subtask results
- * return sum;
- * }
- * }
- * }</pre>
- */
- public static interface Spliterator<T> extends Iterator<T> {
- /**
- * Returns a Spliterator covering approximately half of the
- * elements, guaranteed not to overlap with those subsequently
- * returned by this Spliterator. After invoking this method,
- * the current Spliterator will <em>not</em> produce any of
- * the elements of the returned Spliterator, but the two
- * Spliterators together will produce all of the elements that
- * would have been produced by this Spliterator had this
- * method not been called. The exact number of elements
- * produced by the returned Spliterator is not guaranteed, and
- * may be zero (i.e., with {@code hasNext()} reporting {@code
- * false}) if this Spliterator cannot be further split.
- *
- * @return a Spliterator covering approximately half of the
- * elements
- * @throws IllegalStateException if this Spliterator has
- * already commenced traversing elements
- */
- Spliterator<T> split();
- }
-
-
/*
* Overview:
*
@@ -265,18 +113,21 @@ public class ConcurrentHashMap8<K, V>
* the same or better than java.util.HashMap, and to support high
* initial insertion rates on an empty table by many threads.
*
- * Each key-value mapping is held in a Node. Because Node fields
- * can contain special values, they are defined using plain Object
- * types. Similarly in turn, all internal methods that use them
- * work off Object types. And similarly, so do the internal
- * methods of auxiliary iterator and view classes. All public
- * generic typed methods relay in/out of these internal methods,
- * supplying null-checks and casts as needed. This also allows
- * many of the public methods to be factored into a smaller number
- * of internal methods (although sadly not so for the five
- * variants of put-related operations). The validation-based
- * approach explained below leads to a lot of code sprawl because
- * retry-control precludes factoring into smaller methods.
+ * This map usually acts as a binned (bucketed) hash table. Each
+ * key-value mapping is held in a Node. Most nodes are instances
+ * of the basic Node class with hash, key, value, and next
+ * fields. However, various subclasses exist: TreeNodes are
+ * arranged in balanced trees, not lists. TreeBins hold the roots
+ * of sets of TreeNodes. ForwardingNodes are placed at the heads
+ * of bins during resizing. ReservationNodes are used as
+ * placeholders while establishing values in computeIfAbsent and
+ * related methods. The types TreeBin, ForwardingNode, and
+ * ReservationNode do not hold normal user keys, values, or
+ * hashes, and are readily distinguishable during search etc
+ * because they have negative hash fields and null key and value
+ * fields. (These special nodes are either uncommon or transient,
+ * so the impact of carrying around some unused fields is
+ * insignificant.)
*
* The table is lazily initialized to a power-of-two size upon the
* first insertion. Each bin in the table normally contains a
@@ -284,24 +135,12 @@ public class ConcurrentHashMap8<K, V>
* Table accesses require volatile/atomic reads, writes, and
* CASes. Because there is no other way to arrange this without
* adding further indirections, we use intrinsics
- * (sun.misc.Unsafe) operations. The lists of nodes within bins
- * are always accurately traversable under volatile reads, so long
- * as lookups check hash code and non-nullness of value before
- * checking key equality.
- *
- * We use the top two bits of Node hash fields for control
- * purposes -- they are available anyway because of addressing
- * constraints. As explained further below, these top bits are
- * used as follows:
- * 00 - Normal
- * 01 - Locked
- * 11 - Locked and may have a thread waiting for lock
- * 10 - Node is a forwarding node
+ * (sun.misc.Unsafe) operations.
*
- * The lower 30 bits of each Node's hash field contain a
- * transformation of the key's hash code, except for forwarding
- * nodes, for which the lower bits are zero (and so always have
- * hash field == MOVED).
+ * We use the top (sign) bit of Node hash fields for control
+ * purposes -- it is available anyway because of addressing
+ * constraints. Nodes with negative hash fields are specially
+ * handled or ignored in map methods.
*
* Insertion (via put or its variants) of the first node in an
* empty bin is performed by just CASing it to the bin. This is
@@ -310,22 +149,15 @@ public class ConcurrentHashMap8<K, V>
* delete, and replace) require locks. We do not want to waste
* the space required to associate a distinct lock object with
* each bin, so instead use the first node of a bin list itself as
- * a lock. Blocking support for these locks relies on the builtin
- * "synchronized" monitors. However, we also need a tryLock
- * construction, so we overlay these by using bits of the Node
- * hash field for lock control (see above), and so normally use
- * builtin monitors only for blocking and signalling using
- * wait/notifyAll constructions. See Node.tryAwaitLock.
+ * a lock. Locking support for these locks relies on builtin
+ * "synchronized" monitors.
*
* Using the first node of a list as a lock does not by itself
* suffice though: When a node is locked, any update must first
* validate that it is still the first node after locking it, and
* retry if not. Because new nodes are always appended to lists,
* once a node is first in a bin, it remains first until deleted
- * or the bin becomes invalidated (upon resizing). However,
- * operations that only conditionally update may inspect nodes
- * until the point of update. This is a converse of sorts to the
- * lazy locking technique described by Herlihy & Shavit.
+ * or the bin becomes invalidated (upon resizing).
*
* The main disadvantage of per-bin locks is that other update
* operations on other nodes in a bin list protected by the same
@@ -358,15 +190,12 @@ public class ConcurrentHashMap8<K, V>
* sometimes deviate significantly from uniform randomness. This
* includes the case when N > (1<<30), so some keys MUST collide.
* Similarly for dumb or hostile usages in which multiple keys are
- * designed to have identical hash codes. Also, although we guard
- * against the worst effects of this (see method spread), sets of
- * hashes may differ only in bits that do not impact their bin
- * index for a given power-of-two mask. So we use a secondary
- * strategy that applies when the number of nodes in a bin exceeds
- * a threshold, and at least one of the keys implements
- * Comparable. These TreeBins use a balanced tree to hold nodes
- * (a specialized form of red-black trees), bounding search time
- * to O(log N). Each search step in a TreeBin is around twice as
+ * designed to have identical hash codes or ones that differs only
+ * in masked-out high bits. So we use a secondary strategy that
+ * applies when the number of nodes in a bin exceeds a
+ * threshold. These TreeBins use a balanced tree to hold nodes (a
+ * specialized form of red-black trees), bounding search time to
+ * O(log N). Each search step in a TreeBin is at least twice as
* slow as in a regular list, but given that N cannot exceed
* (1<<64) (before running out of addresses) this bounds search
* steps, lock hold times, etc, to reasonable constants (roughly
@@ -377,43 +206,50 @@ public class ConcurrentHashMap8<K, V>
* iterators in the same way.
*
* The table is resized when occupancy exceeds a percentage
- * threshold (nominally, 0.75, but see below). Only a single
- * thread performs the resize (using field "sizeCtl", to arrange
- * exclusion), but the table otherwise remains usable for reads
- * and updates. Resizing proceeds by transferring bins, one by
- * one, from the table to the next table. Because we are using
- * power-of-two expansion, the elements from each bin must either
- * stay at same index, or move with a power of two offset. We
- * eliminate unnecessary node creation by catching cases where old
- * nodes can be reused because their next fields won't change. On
- * average, only about one-sixth of them need cloning when a table
- * doubles. The nodes they replace will be garbage collectable as
- * soon as they are no longer referenced by any reader thread that
- * may be in the midst of concurrently traversing table. Upon
- * transfer, the old table bin contains only a special forwarding
- * node (with hash field "MOVED") that contains the next table as
- * its key. On encountering a forwarding node, access and update
- * operations restart, using the new table.
- *
- * Each bin transfer requires its bin lock. However, unlike other
- * cases, a transfer can skip a bin if it fails to acquire its
- * lock, and revisit it later (unless it is a TreeBin). Method
- * rebuild maintains a buffer of TRANSFER_BUFFER_SIZE bins that
- * have been skipped because of failure to acquire a lock, and
- * blocks only if none are available (i.e., only very rarely).
- * The transfer operation must also ensure that all accessible
- * bins in both the old and new table are usable by any traversal.
- * When there are no lock acquisition failures, this is arranged
- * simply by proceeding from the last bin (table.length - 1) up
- * towards the first. Upon seeing a forwarding node, traversals
- * (see class Iter) arrange to move to the new table
- * without revisiting nodes. However, when any node is skipped
- * during a transfer, all earlier table bins may have become
- * visible, so are initialized with a reverse-forwarding node back
- * to the old table until the new ones are established. (This
- * sometimes requires transiently locking a forwarding node, which
- * is possible under the above encoding.) These more expensive
- * mechanics trigger only when necessary.
+ * threshold (nominally, 0.75, but see below). Any thread
+ * noticing an overfull bin may assist in resizing after the
+ * initiating thread allocates and sets up the replacement array.
+ * However, rather than stalling, these other threads may proceed
+ * with insertions etc. The use of TreeBins shields us from the
+ * worst case effects of overfilling while resizes are in
+ * progress. Resizing proceeds by transferring bins, one by one,
+ * from the table to the next table. However, threads claim small
+ * blocks of indices to transfer (via field transferIndex) before
+ * doing so, reducing contention. A generation stamp in field
+ * sizeCtl ensures that resizings do not overlap. Because we are
+ * using power-of-two expansion, the elements from each bin must
+ * either stay at same index, or move with a power of two
+ * offset. We eliminate unnecessary node creation by catching
+ * cases where old nodes can be reused because their next fields
+ * won't change. On average, only about one-sixth of them need
+ * cloning when a table doubles. The nodes they replace will be
+ * garbage collectable as soon as they are no longer referenced by
+ * any reader thread that may be in the midst of concurrently
+ * traversing table. Upon transfer, the old table bin contains
+ * only a special forwarding node (with hash field "MOVED") that
+ * contains the next table as its key. On encountering a
+ * forwarding node, access and update operations restart, using
+ * the new table.
+ *
+ * Each bin transfer requires its bin lock, which can stall
+ * waiting for locks while resizing. However, because other
+ * threads can join in and help resize rather than contend for
+ * locks, average aggregate waits become shorter as resizing
+ * progresses. The transfer operation must also ensure that all
+ * accessible bins in both the old and new table are usable by any
+ * traversal. This is arranged in part by proceeding from the
+ * last bin (table.length - 1) up towards the first. Upon seeing
+ * a forwarding node, traversals (see class Traverser) arrange to
+ * move to the new table without revisiting nodes. To ensure that
+ * no intervening nodes are skipped even when moved out of order,
+ * a stack (see class TableStack) is created on first encounter of
+ * a forwarding node during a traversal, to maintain its place if
+ * later processing the current table. The need for these
+ * save/restore mechanics is relatively rare, but when one
+ * forwarding node is encountered, typically many more will be.
+ * So Traversers use a simple caching scheme to avoid creating so
+ * many new TableStack nodes. (Thanks to Peter Levart for
+ * suggesting use of a stack here.)
*
* The traversal scheme also applies to partial traversals of
* ranges of bins (via an alternate Traverser constructor)
@@ -428,20 +264,54 @@ public class ConcurrentHashMap8<K, V>
* These cases attempt to override the initial capacity settings,
* but harmlessly fail to take effect in cases of races.
*
- * The element count is maintained using a LongAdder8, which avoids
- * contention on updates but can encounter cache thrashing if read
- * too frequently during concurrent access. To avoid reading so
- * often, resizing is attempted either when a bin lock is
- * contended, or upon adding to a bin already holding two or more
- * nodes (checked before adding in the xIfAbsent methods, after
- * adding in others). Under uniform hash distributions, the
- * probability of this occurring at threshold is around 13%,
- * meaning that only about 1 in 8 puts check threshold (and after
- * resizing, many fewer do so). But this approximation has high
- * variance for small table sizes, so we check on any collision
- * for sizes <= 64. The bulk putAll operation further reduces
- * contention by only committing count updates upon these size
- * checks.
+ * The element count is maintained using a specialization of
+ * LongAdder. We need to incorporate a specialization rather than
+ * just use a LongAdder in order to access implicit
+ * contention-sensing that leads to creation of multiple
+ * CounterCells. The counter mechanics avoid contention on
+ * updates but can encounter cache thrashing if read too
+ * frequently during concurrent access. To avoid reading so often,
+ * resizing under contention is attempted only upon adding to a
+ * bin already holding two or more nodes. Under uniform hash
+ * distributions, the probability of this occurring at threshold
+ * is around 13%, meaning that only about 1 in 8 puts check
+ * threshold (and after resizing, many fewer do so).
+ *
+ * TreeBins use a special form of comparison for search and
+ * related operations (which is the main reason we cannot use
+ * existing collections such as TreeMaps). TreeBins contain
+ * Comparable elements, but may contain others, as well as
+ * elements that are Comparable but not necessarily Comparable for
+ * the same T, so we cannot invoke compareTo among them. To handle
+ * this, the tree is ordered primarily by hash value, then by
+ * Comparable.compareTo order if applicable. On lookup at a node,
+ * if elements are not comparable or compare as 0 then both left
+ * and right children may need to be searched in the case of tied
+ * hash values. (This corresponds to the full list search that
+ * would be necessary if all elements were non-Comparable and had
+ * tied hashes.) On insertion, to keep a total ordering (or as
+ * close as is required here) across rebalancings, we compare
+ * classes and identityHashCodes as tie-breakers. The red-black
+ * balancing code is updated from pre-jdk-collections
+ * (http://gee.cs.oswego.edu/dl/classes/collections/RBCell.java)
+ * based in turn on Cormen, Leiserson, and Rivest "Introduction to
+ * Algorithms" (CLR).
+ *
+ * TreeBins also require an additional locking mechanism. While
+ * list traversal is always possible by readers even during
+ * updates, tree traversal is not, mainly because of tree-rotations
+ * that may change the root node and/or its linkages. TreeBins
+ * include a simple read-write lock mechanism parasitic on the
+ * main bin-synchronization strategy: Structural adjustments
+ * associated with an insertion or removal are already bin-locked
+ * (and so cannot conflict with other writers) but must wait for
+ * ongoing readers to finish. Since there can be only one such
+ * waiter, we use a simple scheme using a single "waiter" field to
+ * block writers. However, readers need never block. If the root
+ * lock is held, they proceed along the slow traversal path (via
+ * next-pointers) until the lock becomes available or the list is
+ * exhausted, whichever comes first. These cases are not fast, but
+ * maximize aggregate expected throughput.
*
* Maintaining API and serialization compatibility with previous
* versions of this class introduces several oddities. Mainly: We
@@ -451,8 +321,20 @@ public class ConcurrentHashMap8<K, V>
* time that we can guarantee to honor it.) We also declare an
* unused "Segment" class that is instantiated in minimal form
* only when serializing.
+ *
+ * Also, solely for compatibility with previous versions of this
+ * class, it extends AbstractMap, even though all of its methods
+ * are overridden, so it is just useless baggage.
+ *
+ * This file is organized to make things a little easier to follow
+ * while reading than they might otherwise: First the main static
+ * declarations and utilities, then fields, then main public
+ * methods (with a few factorings of multiple public methods into
+ * internal ones), then sizing methods, trees, traversers, and
+ * bulk operations.
*/
+
/* ---------------- Constants -------------- */
/**
@@ -492,2737 +374,2362 @@ public class ConcurrentHashMap8<K, V>
private static final float LOAD_FACTOR = 0.75f;
/**
- * The buffer size for skipped bins during transfers. The
- * value is arbitrary but should be large enough to avoid
- * most locking stalls during resizes.
+ * The bin count threshold for using a tree rather than list for a
+ * bin. Bins are converted to trees when adding an element to a
+ * bin with at least this many nodes. The value must be greater
+ * than 2, and should be at least 8 to mesh with assumptions in
+ * tree removal about conversion back to plain bins upon
+ * shrinkage.
*/
- private static final int TRANSFER_BUFFER_SIZE = 32;
+ static final int TREEIFY_THRESHOLD = 8;
/**
- * The bin count threshold for using a tree rather than list for a
- * bin. The value reflects the approximate break-even point for
- * using tree-based operations.
+ * The bin count threshold for untreeifying a (split) bin during a
+ * resize operation. Should be less than TREEIFY_THRESHOLD, and at
+ * most 6 to mesh with shrinkage detection under removal.
*/
- private static final int TREE_THRESHOLD = 8;
+ static final int UNTREEIFY_THRESHOLD = 6;
- /*
- * Encodings for special uses of Node hash fields. See above for
- * explanation.
+ /**
+ * The smallest table capacity for which bins may be treeified.
+ * (Otherwise the table is resized if too many nodes in a bin.)
+ * The value should be at least 4 * TREEIFY_THRESHOLD to avoid
+ * conflicts between resizing and treeification thresholds.
*/
- static final int MOVED = 0x80000000; // hash field for forwarding nodes
- static final int LOCKED = 0x40000000; // set/tested only as a bit
- static final int WAITING = 0xc0000000; // both bits set/tested together
- static final int HASH_BITS = 0x3fffffff; // usable bits of normal node hash
-
- /* ---------------- Fields -------------- */
+ static final int MIN_TREEIFY_CAPACITY = 64;
/**
- * The array of bins. Lazily initialized upon first insertion.
- * Size is always a power of two. Accessed directly by iterators.
+ * Minimum number of rebinnings per transfer step. Ranges are
+ * subdivided to allow multiple resizer threads. This value
+ * serves as a lower bound to avoid resizers encountering
+ * excessive memory contention. The value should be at least
+ * DEFAULT_CAPACITY.
*/
- transient volatile Node[] table;
+ private static final int MIN_TRANSFER_STRIDE = 16;
/**
- * The counter maintaining number of elements.
+ * The number of bits used for generation stamp in sizeCtl.
+ * Must be at least 6 for 32bit arrays.
*/
- private transient final LongAdder8 counter;
+ private static int RESIZE_STAMP_BITS = 16;
/**
- * Table initialization and resizing control. When negative, the
- * table is being initialized or resized. Otherwise, when table is
- * null, holds the initial table size to use upon creation, or 0
- * for default. After initialization, holds the next element count
- * value upon which to resize the table.
+ * The maximum number of threads that can help resize.
+ * Must fit in 32 - RESIZE_STAMP_BITS bits.
*/
- private transient volatile int sizeCtl;
-
- // views
- private transient KeySetView<K,V> keySet;
- private transient ValuesView<K,V> values;
- private transient EntrySetView<K,V> entrySet;
-
- /** For serialization compatibility. Null unless serialized; see below */
- private Segment<K,V>[] segments;
+ private static final int MAX_RESIZERS = (1 << (32 - RESIZE_STAMP_BITS)) - 1;
- /* ---------------- Table element access -------------- */
+ /**
+ * The bit shift for recording size stamp in sizeCtl.
+ */
+ private static final int RESIZE_STAMP_SHIFT = 32 - RESIZE_STAMP_BITS;
/*
- * Volatile access methods are used for table elements as well as
- * elements of in-progress next table while resizing. Uses are
- * null checked by callers, and implicitly bounds-checked, relying
- * on the invariants that tab arrays have non-zero size, and all
- * indices are masked with (tab.length - 1) which is never
- * negative and always less than length. Note that, to be correct
- * wrt arbitrary concurrency errors by users, bounds checks must
- * operate on local variables, which accounts for some odd-looking
- * inline assignments below.
+ * Encodings for Node hash fields. See above for explanation.
*/
+ static final int MOVED = 0x8fffffff; // (-1) hash for forwarding nodes
+ static final int TREEBIN = 0x80000000; // hash for roots of trees
+ static final int RESERVED = 0x80000001; // hash for transient reservations
+ static final int HASH_BITS = 0x7fffffff; // usable bits of normal node hash
- static final Node tabAt(Node[] tab, int i) { // used by Iter
- return (Node)UNSAFE.getObjectVolatile(tab, ((long)i<<ASHIFT)+ABASE);
- }
-
- private static final boolean casTabAt(Node[] tab, int i, Node c, Node v) {
- return UNSAFE.compareAndSwapObject(tab, ((long)i<<ASHIFT)+ABASE, c, v);
- }
+ /** Number of CPUS, to place bounds on some sizings */
+ static final int NCPU = Runtime.getRuntime().availableProcessors();
- private static final void setTabAt(Node[] tab, int i, Node v) {
- UNSAFE.putObjectVolatile(tab, ((long)i<<ASHIFT)+ABASE, v);
- }
+ /** For serialization compatibility. */
+ private static final ObjectStreamField[] serialPersistentFields = {
+ new ObjectStreamField("segments", Segment[].class),
+ new ObjectStreamField("segmentMask", Integer.TYPE),
+ new ObjectStreamField("segmentShift", Integer.TYPE)
+ };
/* ---------------- Nodes -------------- */
/**
- * Key-value entry. Note that this is never exported out as a
- * user-visible Map.Entry (see MapEntry below). Nodes with a hash
- * field of MOVED are special, and do not contain user keys or
- * values. Otherwise, keys are never null, and null val fields
- * indicate that a node is in the process of being deleted or
- * created. For purposes of read-only access, a key may be read
- * before a val, but can only be used after checking val to be
- * non-null.
+ * Key-value entry. This class is never exported out as a
+ * user-mutable Map.Entry (i.e., one supporting setValue; see
+ * MapEntry below), but can be used for read-only traversals used
+ * in bulk tasks. Subclasses of Node with a negative hash field
+ * are special, and contain null keys and values (but are never
+ * exported). Otherwise, keys and vals are never null.
*/
- static class Node {
- volatile int hash;
- final Object key;
- volatile Object val;
- volatile Node next;
+ static class Node<K,V> implements Map.Entry<K,V> {
+ final int hash;
+ final K key;
+ volatile V val;
+ Node<K,V> next;
- Node(int hash, Object key, Object val, Node next) {
+ Node(int hash, K key, V val, Node<K,V> next) {
this.hash = hash;
this.key = key;
this.val = val;
this.next = next;
}
- /** CompareAndSet the hash field */
- final boolean casHash(int cmp, int val) {
- return UNSAFE.compareAndSwapInt(this, hashOffset, cmp, val);
+ public final K getKey() { return key; }
+ public final V getValue() { return val; }
+ public final int hashCode() { return key.hashCode() ^ val.hashCode(); }
+ public final String toString(){ return key + "=" + val; }
+ public final V setValue(V value) {
+ throw new UnsupportedOperationException();
}
- /** The number of spins before blocking for a lock */
- static final int MAX_SPINS =
- Runtime.getRuntime().availableProcessors() > 1 ? 64 : 1;
+ public final boolean equals(Object o) {
+ Object k, v, u; Map.Entry<?,?> e;
+ return ((o instanceof Map.Entry) &&
+ (k = (e = (Map.Entry<?,?>)o).getKey()) != null &&
+ (v = e.getValue()) != null &&
+ (k == key || k.equals(key)) &&
+ (v == (u = val) || v.equals(u)));
+ }
/**
- * Spins a while if LOCKED bit set and this node is the first
- * of its bin, and then sets WAITING bits on hash field and
- * blocks (once) if they are still set. It is OK for this
- * method to return even if lock is not available upon exit,
- * which enables these simple single-wait mechanics.
- *
- * The corresponding signalling operation is performed within
- * callers: Upon detecting that WAITING has been set when
- * unlocking lock (via a failed CAS from non-waiting LOCKED
- * state), unlockers acquire the sync lock and perform a
- * notifyAll.
- *
- * The initial sanity check on tab and bounds is not currently
- * necessary in the only usages of this method, but enables
- * use in other future contexts.
+ * Virtualized support for map.get(); overridden in subclasses.
*/
- final void tryAwaitLock(Node[] tab, int i) {
- if (tab != null && i >= 0 && i < tab.length) { // sanity check
- int r = ThreadLocalRandom8.current().nextInt(); // randomize spins
- int spins = MAX_SPINS, h;
- while (tabAt(tab, i) == this && ((h = hash) & LOCKED) != 0) {
- if (spins >= 0) {
- r ^= r << 1; r ^= r >>> 3; r ^= r << 10; // xorshift
- if (r >= 0 && --spins == 0)
- Thread.yield(); // yield before block
- }
- else if (casHash(h, h | WAITING)) {
- synchronized (this) {
- if (tabAt(tab, i) == this &&
- (hash & WAITING) == WAITING) {
- try {
- wait();
- } catch (InterruptedException ie) {
- try {
- Thread.currentThread().interrupt();
- } catch (SecurityException ignore) {
- }
- }
- }
- else
- notifyAll(); // possibly won race vs signaller
- }
- break;
- }
- }
+ Node<K,V> find(int h, Object k) {
+ Node<K,V> e = this;
+ if (k != null) {
+ do {
+ K ek;
+ if (e.hash == h &&
+ ((ek = e.key) == k || (ek != null && k.equals(ek))))
+ return e;
+ } while ((e = e.next) != null);
}
+ return null;
}
+ }
- // Unsafe mechanics for casHash
- private static final sun.misc.Unsafe UNSAFE;
- private static final long hashOffset;
+ /* ---------------- Static utilities -------------- */
- static {
- try {
- UNSAFE = getUnsafe();
- Class<?> k = Node.class;
- hashOffset = UNSAFE.objectFieldOffset
- (k.getDeclaredField("hash"));
- } catch (Exception e) {
- throw new Error(e);
+ /**
+ * Spreads (XORs) higher bits of hash to lower and also forces top
+ * bit to 0. Because the table uses power-of-two masking, sets of
+ * hashes that vary only in bits above the current mask will
+ * always collide. (Among known examples are sets of Float keys
+ * holding consecutive whole numbers in small tables.) So we
+ * apply a transform that spreads the impact of higher bits
+ * downward. There is a tradeoff between speed, utility, and
+ * quality of bit-spreading. Because many common sets of hashes
+ * are already reasonably distributed (so don't benefit from
+ * spreading), and because we use trees to handle large sets of
+ * collisions in bins, we just XOR some shifted bits in the
+ * cheapest possible way to reduce systematic lossage, as well as
+ * to incorporate impact of the highest bits that would otherwise
+ * never be used in index calculations because of table bounds.
+ */
+ static final int spread(int h) {
+ return (h ^ (h >>> 16)) & HASH_BITS;
+ }
+
+ /**
+ * Returns a power of two table size for the given desired capacity.
+ * See Hackers Delight, sec 3.2
+ */
+ private static final int tableSizeFor(int c) {
+ int n = c - 1;
+ n |= n >>> 1;
+ n |= n >>> 2;
+ n |= n >>> 4;
+ n |= n >>> 8;
+ n |= n >>> 16;
+ return (n < 0) ? 1 : (n >= MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : n + 1;
+ }
+
+ /**
+ * Returns x's Class if it is of the form "class C implements
+ * Comparable<C>", else null.
+ */
+ static Class<?> comparableClassFor(Object x) {
+ if (x instanceof Comparable) {
+ Class<?> c; Type[] ts, as; Type t; ParameterizedType p;
+ if ((c = x.getClass()) == String.class) // bypass checks
+ return c;
+ if ((ts = c.getGenericInterfaces()) != null) {
+ for (int i = 0; i < ts.length; ++i) {
+ if (((t = ts[i]) instanceof ParameterizedType) &&
+ ((p = (ParameterizedType)t).getRawType() ==
+ Comparable.class) &&
+ (as = p.getActualTypeArguments()) != null &&
+ as.length == 1 && as[0] == c) // type arg is c
+ return c;
+ }
}
}
+ return null;
}
- /* ---------------- TreeBins -------------- */
-
/**
- * Nodes for use in TreeBins
+ * Returns k.compareTo(x) if x matches kc (k's screened comparable
+ * class), else 0.
*/
- static final class TreeNode extends Node {
- TreeNode parent; // red-black tree links
- TreeNode left;
- TreeNode right;
- TreeNode prev; // needed to unlink next upon deletion
- boolean red;
+ @SuppressWarnings({"rawtypes","unchecked"}) // for cast to Comparable
+ static int compareComparables(Class<?> kc, Object k, Object x) {
+ return (x == null || x.getClass() != kc ? 0 :
+ ((Comparable)k).compareTo(x));
+ }
- TreeNode(int hash, Object key, Object val, Node next, TreeNode parent) {
- super(hash, key, val, next);
- this.parent = parent;
- }
+ /* ---------------- Table element access -------------- */
+
+ /*
+ * Volatile access methods are used for table elements as well as
+ * elements of in-progress next table while resizing. All uses of
+ * the tab arguments must be null checked by callers. All callers
+ * also paranoically precheck that tab's length is not zero (or an
+ * equivalent check), thus ensuring that any index argument taking
+ * the form of a hash value anded with (length - 1) is a valid
+ * index. Note that, to be correct wrt arbitrary concurrency
+ * errors by users, these checks must operate on local variables,
+ * which accounts for some odd-looking inline assignments below.
+ * Note that calls to setTabAt always occur within locked regions,
+ * and so do not need full volatile semantics, but still require
+ * ordering to maintain concurrent readability.
+ */
+
+ @SuppressWarnings("unchecked")
+ static final <K,V> Node<K,V> tabAt(Node<K,V>[] tab, int i) {
+ return (Node<K,V>)U.getObjectVolatile(tab, ((long)i << ASHIFT) + ABASE);
+ }
+
+ static final <K,V> boolean casTabAt(Node<K,V>[] tab, int i,
+ Node<K,V> c, Node<K,V> v) {
+ return U.compareAndSwapObject(tab, ((long)i << ASHIFT) + ABASE, c, v);
+ }
+
+ static final <K,V> void setTabAt(Node<K,V>[] tab, int i, Node<K,V> v) {
+ U.putOrderedObject(tab, ((long)i << ASHIFT) + ABASE, v);
}
+ /* ---------------- Fields -------------- */
+
/**
- * A specialized form of red-black tree for use in bins
- * whose size exceeds a threshold.
- *
- * TreeBins use a special form of comparison for search and
- * related operations (which is the main reason we cannot use
- * existing collections such as TreeMaps). TreeBins contain
- * Comparable elements, but may contain others, as well as
- * elements that are Comparable but not necessarily Comparable<T>
- * for the same T, so we cannot invoke compareTo among them. To
- * handle this, the tree is ordered primarily by hash value, then
- * by getClass().getName() order, and then by Comparator order
- * among elements of the same class. On lookup at a node, if
- * elements are not comparable or compare as 0, both left and
- * right children may need to be searched in the case of tied hash
- * values. (This corresponds to the full list search that would be
- * necessary if all elements were non-Comparable and had tied
- * hashes.) The red-black balancing code is updated from
- * pre-jdk-collections
- * (http://gee.cs.oswego.edu/dl/classes/collections/RBCell.java)
- * based in turn on Cormen, Leiserson, and Rivest "Introduction to
- * Algorithms" (CLR).
- *
- * TreeBins also maintain a separate locking discipline than
- * regular bins. Because they are forwarded via special MOVED
- * nodes at bin heads (which can never change once established),
- * we cannot use those nodes as locks. Instead, TreeBin
- * extends AbstractQueuedSynchronizer to support a simple form of
- * read-write lock. For update operations and table validation,
- * the exclusive form of lock behaves in the same way as bin-head
- * locks. However, lookups use shared read-lock mechanics to allow
- * multiple readers in the absence of writers. Additionally,
- * these lookups do not ever block: While the lock is not
- * available, they proceed along the slow traversal path (via
- * next-pointers) until the lock becomes available or the list is
- * exhausted, whichever comes first. (These cases are not fast,
- * but maximize aggregate expected throughput.) The AQS mechanics
- * for doing this are straightforward. The lock state is held as
- * AQS getState(). Read counts are negative; the write count (1)
- * is positive. There are no signalling preferences among readers
- * and writers. Since we don't need to export full Lock API, we
- * just override the minimal AQS methods and use them directly.
- */
- static final class TreeBin extends AbstractQueuedSynchronizer {
- private static final long serialVersionUID = 2249069246763182397L;
- transient TreeNode root; // root of tree
- transient TreeNode first; // head of next-pointer list
-
- /* AQS overrides */
- public final boolean isHeldExclusively() { return getState() > 0; }
- public final boolean tryAcquire(int ignore) {
- if (compareAndSetState(0, 1)) {
- setExclusiveOwnerThread(Thread.currentThread());
- return true;
- }
- return false;
- }
- public final boolean tryRelease(int ignore) {
- setExclusiveOwnerThread(null);
- setState(0);
- return true;
- }
- public final int tryAcquireShared(int ignore) {
- for (int c;;) {
- if ((c = getState()) > 0)
- return -1;
- if (compareAndSetState(c, c -1))
- return 1;
- }
- }
- public final boolean tryReleaseShared(int ignore) {
- int c;
- do {} while (!compareAndSetState(c = getState(), c + 1));
- return c == -1;
- }
+ * The array of bins. Lazily initialized upon first insertion.
+ * Size is always a power of two. Accessed directly by iterators.
+ */
+ transient volatile Node<K,V>[] table;
- /** From CLR */
- private void rotateLeft(TreeNode p) {
- if (p != null) {
- TreeNode r = p.right, pp, rl;
- if ((rl = p.right = r.left) != null)
- rl.parent = p;
- if ((pp = r.parent = p.parent) == null)
- root = r;
- else if (pp.left == p)
- pp.left = r;
- else
- pp.right = r;
- r.left = p;
- p.parent = r;
- }
- }
+ /**
+ * The next table to use; non-null only while resizing.
+ */
+ private transient volatile Node<K,V>[] nextTable;
- /** From CLR */
- private void rotateRight(TreeNode p) {
- if (p != null) {
- TreeNode l = p.left, pp, lr;
- if ((lr = p.left = l.right) != null)
- lr.parent = p;
- if ((pp = l.parent = p.parent) == null)
- root = l;
- else if (pp.right == p)
- pp.right = l;
- else
- pp.left = l;
- l.right = p;
- p.parent = l;
- }
- }
+ /**
+ * Base counter value, used mainly when there is no contention,
+ * but also as a fallback during table initialization
+ * races. Updated via CAS.
+ */
+ private transient volatile long baseCount;
- /**
- * Returns the TreeNode (or null if not found) for the given key
- * starting at given root.
- */
- @SuppressWarnings("unchecked") final TreeNode getTreeNode
- (int h, Object k, TreeNode p) {
- Class<?> c = k.getClass();
- while (p != null) {
- int dir, ph; Object pk; Class<?> pc;
- if ((ph = p.hash) == h) {
- if ((pk = p.key) == k || k.equals(pk))
- return p;
- if (c != (pc = pk.getClass()) ||
- !(k instanceof Comparable) ||
- (dir = ((Comparable)k).compareTo((Comparable)pk)) == 0) {
- dir = (c == pc) ? 0 : c.getName().compareTo(pc.getName());
- TreeNode r = null, s = null, pl, pr;
- if (dir >= 0) {
- if ((pl = p.left) != null && h <= pl.hash)
- s = pl;
- }
- else if ((pr = p.right) != null && h >= pr.hash)
- s = pr;
- if (s != null && (r = getTreeNode(h, k, s)) != null)
- return r;
- }
- }
- else
- dir = (h < ph) ? -1 : 1;
- p = (dir > 0) ? p.right : p.left;
- }
- return null;
- }
+ /**
+ * Table initialization and resizing control. When negative, the
+ * table is being initialized or resized: -1 for initialization,
+ * else -(1 + the number of active resizing threads). Otherwise,
+ * when table is null, holds the initial table size to use upon
+ * creation, or 0 for default. After initialization, holds the
+ * next element count value upon which to resize the table.
+ */
+ private transient volatile int sizeCtl;
- /**
- * Wrapper for getTreeNode used by CHM.get. Tries to obtain
- * read-lock to call getTreeNode, but during failure to get
- * lock, searches along next links.
- */
- final Object getValue(int h, Object k) {
- Node r = null;
- int c = getState(); // Must read lock state first
- for (Node e = first; e != null; e = e.next) {
- if (c <= 0 && compareAndSetState(c, c - 1)) {
- try {
- r = getTreeNode(h, k, root);
- } finally {
- releaseShared(0);
- }
- break;
- }
- else if ((e.hash & HASH_BITS) == h && k.equals(e.key)) {
- r = e;
- break;
- }
- else
- c = getState();
- }
- return r == null ? null : r.val;
- }
+ /**
+ * The next table index (plus one) to split while resizing.
+ */
+ private transient volatile int transferIndex;
- /**
- * Finds or adds a node.
- * @return null if added
- */
- @SuppressWarnings("unchecked") final TreeNode putTreeNode
- (int h, Object k, Object v) {
- Class<?> c = k.getClass();
- TreeNode pp = root, p = null;
- int dir = 0;
- while (pp != null) { // find existing node or leaf to insert at
- int ph; Object pk; Class<?> pc;
- p = pp;
- if ((ph = p.hash) == h) {
- if ((pk = p.key) == k || k.equals(pk))
- return p;
- if (c != (pc = pk.getClass()) ||
- !(k instanceof Comparable) ||
- (dir = ((Comparable)k).compareTo((Comparable)pk)) == 0) {
- dir = (c == pc) ? 0 : c.getName().compareTo(pc.getName());
- TreeNode r = null, s = null, pl, pr;
- if (dir >= 0) {
- if ((pl = p.left) != null && h <= pl.hash)
- s = pl;
- }
- else if ((pr = p.right) != null && h >= pr.hash)
- s = pr;
- if (s != null && (r = getTreeNode(h, k, s)) != null)
- return r;
- }
- }
- else
- dir = (h < ph) ? -1 : 1;
- pp = (dir > 0) ? p.right : p.left;
- }
+ /**
+ * Spinlock (locked via CAS) used when resizing and/or creating CounterCells.
+ */
+ private transient volatile int cellsBusy;
- TreeNode f = first;
- TreeNode x = first = new TreeNode(h, k, v, f, p);
- if (p == null)
- root = x;
- else { // attach and rebalance; adapted from CLR
- TreeNode xp, xpp;
- if (f != null)
- f.prev = x;
- if (dir <= 0)
- p.left = x;
- else
- p.right = x;
- x.red = true;
- while (x != null && (xp = x.parent) != null && xp.red &&
- (xpp = xp.parent) != null) {
- TreeNode xppl = xpp.left;
- if (xp == xppl) {
- TreeNode y = xpp.right;
- if (y != null && y.red) {
- y.red = false;
- xp.red = false;
- xpp.red = true;
- x = xpp;
- }
- else {
- if (x == xp.right) {
- rotateLeft(x = xp);
- xpp = (xp = x.parent) == null ? null : xp.parent;
- }
- if (xp != null) {
- xp.red = false;
- if (xpp != null) {
- xpp.red = true;
- rotateRight(xpp);
- }
- }
- }
- }
- else {
- TreeNode y = xppl;
- if (y != null && y.red) {
- y.red = false;
- xp.red = false;
- xpp.red = true;
- x = xpp;
- }
- else {
- if (x == xp.left) {
- rotateRight(x = xp);
- xpp = (xp = x.parent) == null ? null : xp.parent;
- }
- if (xp != null) {
- xp.red = false;
- if (xpp != null) {
- xpp.red = true;
- rotateLeft(xpp);
- }
- }
- }
- }
- }
- TreeNode r = root;
- if (r != null && r.red)
- r.red = false;
- }
- return null;
- }
+ /**
+ * Table of counter cells. When non-null, size is a power of 2.
+ */
+ private transient volatile CounterCell[] counterCells;
- /**
- * Removes the given node, that must be present before this
- * call. This is messier than typical red-black deletion code
- * because we cannot swap the contents of an interior node
- * with a leaf successor that is pinned by "next" pointers
- * that are accessible independently of lock. So instead we
- * swap the tree linkages.
- */
- final void deleteTreeNode(TreeNode p) {
- TreeNode next = (TreeNode)p.next; // unlink traversal pointers
- TreeNode pred = p.prev;
- if (pred == null)
- first = next;
- else
- pred.next = next;
- if (next != null)
- next.prev = pred;
- TreeNode replacement;
- TreeNode pl = p.left;
- TreeNode pr = p.right;
- if (pl != null && pr != null) {
- TreeNode s = pr, sl;
- while ((sl = s.left) != null) // find successor
- s = sl;
- boolean c = s.red; s.red = p.red; p.red = c; // swap colors
- TreeNode sr = s.right;
- TreeNode pp = p.parent;
- if (s == pr) { // p was s's direct parent
- p.parent = s;
- s.right = p;
- }
- else {
- TreeNode sp = s.parent;
- if ((p.parent = sp) != null) {
- if (s == sp.left)
- sp.left = p;
- else
- sp.right = p;
- }
- if ((s.right = pr) != null)
- pr.parent = s;
- }
- p.left = null;
- if ((p.right = sr) != null)
- sr.parent = p;
- if ((s.left = pl) != null)
- pl.parent = s;
- if ((s.parent = pp) == null)
- root = s;
- else if (p == pp.left)
- pp.left = s;
- else
- pp.right = s;
- replacement = sr;
- }
- else
- replacement = (pl != null) ? pl : pr;
- TreeNode pp = p.parent;
- if (replacement == null) {
- if (pp == null) {
- root = null;
- return;
- }
- replacement = p;
- }
- else {
- replacement.parent = pp;
- if (pp == null)
- root = replacement;
- else if (p == pp.left)
- pp.left = replacement;
- else
- pp.right = replacement;
- p.left = p.right = p.parent = null;
- }
- if (!p.red) { // rebalance, from CLR
- TreeNode x = replacement;
- while (x != null) {
- TreeNode xp, xpl;
- if (x.red || (xp = x.parent) == null) {
- x.red = false;
- break;
- }
- if (x == (xpl = xp.left)) {
- TreeNode sib = xp.right;
- if (sib != null && sib.red) {
- sib.red = false;
- xp.red = true;
- rotateLeft(xp);
- sib = (xp = x.parent) == null ? null : xp.right;
- }
- if (sib == null)
- x = xp;
- else {
- TreeNode sl = sib.left, sr = sib.right;
- if ((sr == null || !sr.red) &&
- (sl == null || !sl.red)) {
- sib.red = true;
- x = xp;
- }
- else {
- if (sr == null || !sr.red) {
- if (sl != null)
- sl.red = false;
- sib.red = true;
- rotateRight(sib);
- sib = (xp = x.parent) == null ? null : xp.right;
- }
- if (sib != null) {
- sib.red = (xp == null) ? false : xp.red;
- if ((sr = sib.right) != null)
- sr.red = false;
- }
- if (xp != null) {
- xp.red = false;
- rotateLeft(xp);
- }
- x = root;
- }
- }
- }
- else { // symmetric
- TreeNode sib = xpl;
- if (sib != null && sib.red) {
- sib.red = false;
- xp.red = true;
- rotateRight(xp);
- sib = (xp = x.parent) == null ? null : xp.left;
- }
- if (sib == null)
- x = xp;
- else {
- TreeNode sl = sib.left, sr = sib.right;
- if ((sl == null || !sl.red) &&
- (sr == null || !sr.red)) {
- sib.red = true;
- x = xp;
- }
- else {
- if (sl == null || !sl.red) {
- if (sr != null)
- sr.red = false;
- sib.red = true;
- rotateLeft(sib);
- sib = (xp = x.parent) == null ? null : xp.left;
- }
- if (sib != null) {
- sib.red = (xp == null) ? false : xp.red;
- if ((sl = sib.left) != null)
- sl.red = false;
- }
- if (xp != null) {
- xp.red = false;
- rotateRight(xp);
- }
- x = root;
- }
- }
- }
- }
- }
- if (p == replacement && (pp = p.parent) != null) {
- if (p == pp.left) // detach pointers
- pp.left = null;
- else if (p == pp.right)
- pp.right = null;
- p.parent = null;
- }
- }
+ // views
+ private transient KeySetView<K,V> keySet;
+ private transient ValuesView<K,V> values;
+ private transient EntrySetView<K,V> entrySet;
+
+
+ /* ---------------- Public operations -------------- */
+
+ /**
+ * Creates a new, empty map with the default initial table size (16).
+ */
+ public ConcurrentHashMap8() {
}
- /* ---------------- Collision reduction methods -------------- */
+ /**
+ * Creates a new, empty map with an initial table size
+ * accommodating the specified number of elements without the need
+ * to dynamically resize.
+ *
+ * @param initialCapacity The implementation performs internal
+ * sizing to accommodate this many elements.
+ * @throws IllegalArgumentException if the initial capacity of
+ * elements is negative
+ */
+ public ConcurrentHashMap8(int initialCapacity) {
+ if (initialCapacity < 0)
+ throw new IllegalArgumentException();
+ int cap = ((initialCapacity >= (MAXIMUM_CAPACITY >>> 1)) ?
+ MAXIMUM_CAPACITY :
+ tableSizeFor(initialCapacity + (initialCapacity >>> 1) + 1));
+ this.sizeCtl = cap;
+ }
/**
- * Spreads higher bits to lower, and also forces top 2 bits to 0.
- * Because the table uses power-of-two masking, sets of hashes
- * that vary only in bits above the current mask will always
- * collide. (Among known examples are sets of Float keys holding
- * consecutive whole numbers in small tables.) To counter this,
- * we apply a transform that spreads the impact of higher bits
- * downward. There is a tradeoff between speed, utility, and
- * quality of bit-spreading. Because many common sets of hashes
- * are already reasonably distributed across bits (so don't benefit
- * from spreading), and because we use trees to handle large sets
- * of collisions in bins, we don't need excessively high quality.
+ * Creates a new map with the same mappings as the given map.
+ *
+ * @param m the map
*/
- private static final int spread(int h) {
- h ^= (h >>> 18) ^ (h >>> 12);
- return (h ^ (h >>> 10)) & HASH_BITS;
+ public ConcurrentHashMap8(Map<? extends K, ? extends V> m) {
+ this.sizeCtl = DEFAULT_CAPACITY;
+ putAll(m);
}
/**
- * Replaces a list bin with a tree bin. Call only when locked.
- * Fails to replace if the given key is non-comparable or table
- * is, or needs, resizing.
+ * Creates a new, empty map with an initial table size based on
+ * the given number of elements ({@code initialCapacity}) and
+ * initial table density ({@code loadFactor}).
+ *
+ * @param initialCapacity the initial capacity. The implementation
+ * performs internal sizing to accommodate this many elements,
+ * given the specified load factor.
+ * @param loadFactor the load factor (table density) for
+ * establishing the initial table size
+ * @throws IllegalArgumentException if the initial capacity of
+ * elements is negative or the load factor is nonpositive
+ *
+ * @since 1.6
*/
- private final void replaceWithTreeBin(Node[] tab, int index, Object key) {
- if ((key instanceof Comparable) &&
- (tab.length >= MAXIMUM_CAPACITY || counter.sum() < (long)sizeCtl)) {
- TreeBin t = new TreeBin();
- for (Node e = tabAt(tab, index); e != null; e = e.next)
- t.putTreeNode(e.hash & HASH_BITS, e.key, e.val);
- setTabAt(tab, index, new Node(MOVED, t, null, null));
- }
+ public ConcurrentHashMap8(int initialCapacity, float loadFactor) {
+ this(initialCapacity, loadFactor, 1);
}
- /* ---------------- Internal access and update methods -------------- */
+ /**
+ * Creates a new, empty map with an initial table size based on
+ * the given number of elements ({@code initialCapacity}), table
+ * density ({@code loadFactor}), and number of concurrently
+ * updating threads ({@code concurrencyLevel}).
+ *
+ * @param initialCapacity the initial capacity. The implementation
+ * performs internal sizing to accommodate this many elements,
+ * given the specified load factor.
+ * @param loadFactor the load factor (table density) for
+ * establishing the initial table size
+ * @param concurrencyLevel the estimated number of concurrently
+ * updating threads. The implementation may use this value as
+ * a sizing hint.
+ * @throws IllegalArgumentException if the initial capacity is
+ * negative or the load factor or concurrencyLevel are
+ * nonpositive
+ */
+ public ConcurrentHashMap8(int initialCapacity,
+ float loadFactor, int concurrencyLevel) {
+ if (!(loadFactor > 0.0f) || initialCapacity < 0 || concurrencyLevel <= 0)
+ throw new IllegalArgumentException();
+ if (initialCapacity < concurrencyLevel) // Use at least as many bins
+ initialCapacity = concurrencyLevel; // as estimated threads
+ long size = (long)(1.0 + (long)initialCapacity / loadFactor);
+ int cap = (size >= (long)MAXIMUM_CAPACITY) ?
+ MAXIMUM_CAPACITY : tableSizeFor((int)size);
+ this.sizeCtl = cap;
+ }
- /** Implementation for get and containsKey */
- private final Object internalGet(Object k) {
- int h = spread(k.hashCode());
- retry: for (Node[] tab = table; tab != null;) {
- Node e, p; Object ek, ev; int eh; // locals to read fields once
- for (e = tabAt(tab, (tab.length - 1) & h); e != null; e = e.next) {
- if ((eh = e.hash) == MOVED) {
- if ((ek = e.key) instanceof TreeBin) // search TreeBin
- return ((TreeBin)ek).getValue(h, k);
- else { // restart with new table
- tab = (Node[])ek;
- continue retry;
- }
- }
- else if ((eh & HASH_BITS) == h && (ev = e.val) != null &&
- ((ek = e.key) == k || k.equals(ek)))
- return ev;
+ // Original (since JDK1.2) Map methods
+
+ /**
+ * {@inheritDoc}
+ */
+ public int size() {
+ long n = sumCount();
+ return ((n < 0L) ? 0 :
+ (n > (long)Integer.MAX_VALUE) ? Integer.MAX_VALUE :
+ (int)n);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isEmpty() {
+ return sumCount() <= 0L; // ignore transient negative values
+ }
+
+ /**
+ * Returns the value to which the specified key is mapped,
+ * or {@code null} if this map contains no mapping for the key.
+ *
+ * <p>More formally, if this map contains a mapping from a key
+ * {@code k} to a value {@code v} such that {@code key.equals(k)},
+ * then this method returns {@code v}; otherwise it returns
+ * {@code null}. (There can be at most one such mapping.)
+ *
+ * @throws NullPointerException if the specified key is null
+ */
+ public V get(Object key) {
+ Node<K,V>[] tab; Node<K,V> e, p; int n, eh; K ek;
+ int h = spread(key.hashCode());
+ if ((tab = table) != null && (n = tab.length) > 0 &&
+ (e = tabAt(tab, (n - 1) & h)) != null) {
+ if ((eh = e.hash) == h) {
+ if ((ek = e.key) == key || (ek != null && key.equals(ek)))
+ return e.val;
+ }
+ else if (eh < 0)
+ return (p = e.find(h, key)) != null ? p.val : null;
+ while ((e = e.next) != null) {
+ if (e.hash == h &&
+ ((ek = e.key) == key || (ek != null && key.equals(ek))))
+ return e.val;
}
- break;
}
return null;
}
/**
- * Implementation for the four public remove/replace methods:
- * Replaces node value with v, conditional upon match of cv if
- * non-null. If resulting value is null, delete.
+ * Tests if the specified object is a key in this table.
+ *
+ * @param key possible key
+ * @return {@code true} if and only if the specified object
+ * is a key in this table, as determined by the
+ * {@code equals} method; {@code false} otherwise
+ * @throws NullPointerException if the specified key is null
*/
- private final Object internalReplace(Object k, Object v, Object cv) {
- int h = spread(k.hashCode());
- Object oldVal = null;
- for (Node[] tab = table;;) {
- Node f; int i, fh; Object fk;
- if (tab == null ||
- (f = tabAt(tab, i = (tab.length - 1) & h)) == null)
- break;
- else if ((fh = f.hash) == MOVED) {
- if ((fk = f.key) instanceof TreeBin) {
- TreeBin t = (TreeBin)fk;
- boolean validated = false;
- boolean deleted = false;
- t.acquire(0);
- try {
- if (tabAt(tab, i) == f) {
- validated = true;
- TreeNode p = t.getTreeNode(h, k, t.root);
- if (p != null) {
- Object pv = p.val;
- if (cv == null || cv == pv || cv.equals(pv)) {
- oldVal = pv;
- if ((p.val = v) == null) {
- deleted = true;
- t.deleteTreeNode(p);
- }
- }
- }
- }
- } finally {
- t.release(0);
- }
- if (validated) {
- if (deleted)
- counter.add(-1L);
- break;
- }
- }
- else
- tab = (Node[])fk;
- }
- else if ((fh & HASH_BITS) != h && f.next == null) // precheck
- break; // rules out possible existence
- else if ((fh & LOCKED) != 0) {
- checkForResize(); // try resizing if can't get lock
- f.tryAwaitLock(tab, i);
- }
- else if (f.casHash(fh, fh | LOCKED)) {
- boolean validated = false;
- boolean deleted = false;
- try {
- if (tabAt(tab, i) == f) {
- validated = true;
- for (Node e = f, pred = null;;) {
- Object ek, ev;
- if ((e.hash & HASH_BITS) == h &&
- ((ev = e.val) != null) &&
- ((ek = e.key) == k || k.equals(ek))) {
- if (cv == null || cv == ev || cv.equals(ev)) {
- oldVal = ev;
- if ((e.val = v) == null) {
- deleted = true;
- Node en = e.next;
- if (pred != null)
- pred.next = en;
- else
- setTabAt(tab, i, en);
- }
- }
- break;
- }
- pred = e;
- if ((e = e.next) == null)
- break;
- }
- }
- } finally {
- if (!f.casHash(fh | LOCKED, fh)) {
- f.hash = fh;
- synchronized (f) { f.notifyAll(); };
- }
- }
- if (validated) {
- if (deleted)
- counter.add(-1L);
- break;
- }
+ public boolean containsKey(Object key) {
+ return get(key) != null;
+ }
+
+ /**
+ * Returns {@code true} if this map maps one or more keys to the
+ * specified value. Note: This method may require a full traversal
+ * of the map, and is much slower than method {@code containsKey}.
+ *
+ * @param value value whose presence in this map is to be tested
+ * @return {@code true} if this map maps one or more keys to the
+ * specified value
+ * @throws NullPointerException if the specified value is null
+ */
+ public boolean containsValue(Object value) {
+ if (value == null)
+ throw new NullPointerException();
+ Node<K,V>[] t;
+ if ((t = table) != null) {
+ Traverser<K,V> it = new Traverser<K,V>(t, t.length, 0, t.length);
+ for (Node<K,V> p; (p = it.advance()) != null; ) {
+ V v;
+ if ((v = p.val) == value || (v != null && value.equals(v)))
+ return true;
}
}
- return oldVal;
+ return false;
}
- /*
- * Internal versions of the six insertion methods, each a
- * little more complicated than the last. All have
- * the same basic structure as the first (internalPut):
- * 1. If table uninitialized, create
- * 2. If bin empty, try to CAS new node
- * 3. If bin stale, use new table
- * 4. if bin converted to TreeBin, validate and relay to TreeBin methods
- * 5. Lock and validate; if valid, scan and add or update
+ /**
+ * Maps the specified key to the specified value in this table.
+ * Neither the key nor the value can be null.
*
- * The others interweave other checks and/or alternative actions:
- * * Plain put checks for and performs resize after insertion.
- * * putIfAbsent prescans for mapping without lock (and fails to add
- * if present), which also makes pre-emptive resize checks worthwhile.
- * * computeIfAbsent extends form used in putIfAbsent with additional
- * mechanics to deal with, calls, potential exceptions and null
- * returns from function call.
- * * compute uses the same function-call mechanics, but without
- * the prescans
- * * merge acts as putIfAbsent in the absent case, but invokes the
- * update function if present
- * * putAll attempts to pre-allocate enough table space
- * and more lazily performs count updates and checks.
+ * <p>The value can be retrieved by calling the {@code get} method
+ * with a key that is equal to the original key.
*
- * Someday when details settle down a bit more, it might be worth
- * some factoring to reduce sprawl.
+ * @param key key with which the specified value is to be associated
+ * @param value value to be associated with the specified key
+ * @return the previous value associated with {@code key}, or
+ * {@code null} if there was no mapping for {@code key}
+ * @throws NullPointerException if the specified key or value is null
*/
+ public V put(K key, V value) {
+ return putVal(key, value, false);
+ }
- /** Implementation for put */
- private final Object internalPut(Object k, Object v) {
- int h = spread(k.hashCode());
- int count = 0;
- for (Node[] tab = table;;) {
- int i; Node f; int fh; Object fk;
- if (tab == null)
+ /** Implementation for put and putIfAbsent */
+ final V putVal(K key, V value, boolean onlyIfAbsent) {
+ if (key == null || value == null) throw new NullPointerException();
+ int hash = spread(key.hashCode());
+ int binCount = 0;
+ for (Node<K,V>[] tab = table;;) {
+ Node<K,V> f; int n, i, fh;
+ if (tab == null || (n = tab.length) == 0)
tab = initTable();
- else if ((f = tabAt(tab, i = (tab.length - 1) & h)) == null) {
- if (casTabAt(tab, i, null, new Node(h, k, v, null)))
+ else if ((f = tabAt(tab, i = (n - 1) & hash)) == null) {
+ if (casTabAt(tab, i, null,
+ new Node<K,V>(hash, key, value, null)))
break; // no lock when adding to empty bin
}
- else if ((fh = f.hash) == MOVED) {
- if ((fk = f.key) instanceof TreeBin) {
- TreeBin t = (TreeBin)fk;
- Object oldVal = null;
- t.acquire(0);
- try {
- if (tabAt(tab, i) == f) {
- count = 2;
- TreeNode p = t.putTreeNode(h, k, v);
- if (p != null) {
- oldVal = p.val;
- p.val = v;
- }
- }
- } finally {
- t.release(0);
- }
- if (count != 0) {
- if (oldVal != null)
- return oldVal;
- break;
- }
- }
- else
- tab = (Node[])fk;
- }
- else if ((fh & LOCKED) != 0) {
- checkForResize();
- f.tryAwaitLock(tab, i);
- }
- else if (f.casHash(fh, fh | LOCKED)) {
- Object oldVal = null;
- try { // needed in case equals() throws
+ else if ((fh = f.hash) == MOVED)
+ tab = helpTransfer(tab, f);
+ else {
+ V oldVal = null;
+ synchronized (f) {
if (tabAt(tab, i) == f) {
- count = 1;
- for (Node e = f;; ++count) {
- Object ek, ev;
- if ((e.hash & HASH_BITS) == h &&
- (ev = e.val) != null &&
- ((ek = e.key) == k || k.equals(ek))) {
- oldVal = ev;
- e.val = v;
- break;
+ if (fh >= 0) {
+ binCount = 1;
+ for (Node<K,V> e = f;; ++binCount) {
+ K ek;
+ if (e.hash == hash &&
+ ((ek = e.key) == key ||
+ (ek != null && key.equals(ek)))) {
+ oldVal = e.val;
+ if (!onlyIfAbsent)
+ e.val = value;
+ break;
+ }
+ Node<K,V> pred = e;
+ if ((e = e.next) == null) {
+ pred.next = new Node<K,V>(hash, key,
+ value, null);
+ break;
+ }
}
- Node last = e;
- if ((e = e.next) == null) {
- last.next = new Node(h, k, v, null);
- if (count >= TREE_THRESHOLD)
- replaceWithTreeBin(tab, i, k);
- break;
+ }
+ else if (f instanceof TreeBin) {
+ Node<K,V> p;
+ binCount = 2;
+ if ((p = ((TreeBin<K,V>)f).putTreeVal(hash, key,
+ value)) != null) {
+ oldVal = p.val;
+ if (!onlyIfAbsent)
+ p.val = value;
}
}
}
- } finally { // unlock and signal if needed
- if (!f.casHash(fh | LOCKED, fh)) {
- f.hash = fh;
- synchronized (f) { f.notifyAll(); };
- }
}
- if (count != 0) {
+ if (binCount != 0) {
+ if (binCount >= TREEIFY_THRESHOLD)
+ treeifyBin(tab, i);
if (oldVal != null)
return oldVal;
- if (tab.length <= 64)
- count = 2;
break;
}
}
}
- counter.add(1L);
- if (count > 1)
- checkForResize();
+ addCount(1L, binCount);
return null;
}
- /** Implementation for putIfAbsent */
- private final Object internalPutIfAbsent(Object k, Object v) {
- int h = spread(k.hashCode());
- int count = 0;
- for (Node[] tab = table;;) {
- int i; Node f; int fh; Object fk, fv;
- if (tab == null)
- tab = initTable();
- else if ((f = tabAt(tab, i = (tab.length - 1) & h)) == null) {
- if (casTabAt(tab, i, null, new Node(h, k, v, null)))
- break;
- }
- else if ((fh = f.hash) == MOVED) {
- if ((fk = f.key) instanceof TreeBin) {
- TreeBin t = (TreeBin)fk;
- Object oldVal = null;
- t.acquire(0);
- try {
- if (tabAt(tab, i) == f) {
- count = 2;
- TreeNode p = t.putTreeNode(h, k, v);
- if (p != null)
- oldVal = p.val;
- }
- } finally {
- t.release(0);
- }
- if (count != 0) {
- if (oldVal != null)
- return oldVal;
- break;
- }
- }
- else
- tab = (Node[])fk;
- }
- else if ((fh & HASH_BITS) == h && (fv = f.val) != null &&
- ((fk = f.key) == k || k.equals(fk)))
- return fv;
- else {
- Node g = f.next;
- if (g != null) { // at least 2 nodes -- search and maybe resize
- for (Node e = g;;) {
- Object ek, ev;
- if ((e.hash & HASH_BITS) == h && (ev = e.val) != null &&
- ((ek = e.key) == k || k.equals(ek)))
- return ev;
- if ((e = e.next) == null) {
- checkForResize();
- break;
- }
- }
- }
- if (((fh = f.hash) & LOCKED) != 0) {
- checkForResize();
- f.tryAwaitLock(tab, i);
- }
- else if (tabAt(tab, i) == f && f.casHash(fh, fh | LOCKED)) {
- Object oldVal = null;
- try {
- if (tabAt(tab, i) == f) {
- count = 1;
- for (Node e = f;; ++count) {
- Object ek, ev;
- if ((e.hash & HASH_BITS) == h &&
-
<TRUNCATED>
[07/50] [abbrv] incubator-ignite git commit: ignite-695: Implemented.
Posted by se...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
index 037af9d..6a59826 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@ -91,7 +91,7 @@ public class IgniteCacheTestSuite2 extends TestSuite {
suite.addTest(new TestSuite(GridCacheDhtEntrySelfTest.class));
suite.addTest(new TestSuite(GridCacheDhtInternalEntrySelfTest.class));
suite.addTest(new TestSuite(GridCacheDhtMappingSelfTest.class));
-// suite.addTest(new TestSuite(GridCachePartitionedTxMultiThreadedSelfTest.class)); TODO-gg-4066
+ suite.addTest(new TestSuite(GridCachePartitionedTxMultiThreadedSelfTest.class));
suite.addTest(new TestSuite(GridCacheDhtPreloadSelfTest.class));
suite.addTest(new TestSuite(GridCacheDhtPreloadOffHeapSelfTest.class));
suite.addTest(new TestSuite(GridCacheDhtPreloadBigDataSelfTest.class));
@@ -116,7 +116,7 @@ public class IgniteCacheTestSuite2 extends TestSuite {
suite.addTest(new TestSuite(GridCacheReplicatedEvictionSelfTest.class));
suite.addTest(new TestSuite(GridCacheDhtEvictionNearReadersSelfTest.class));
suite.addTest(new TestSuite(GridCacheDhtAtomicEvictionNearReadersSelfTest.class));
-// suite.addTest(new TestSuite(GridCachePartitionedTopologyChangeSelfTest.class)); TODO-gg-5489
+ suite.addTest(new TestSuite(GridCachePartitionedTopologyChangeSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedPreloadEventsSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedUnloadEventsSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedAffinityHashIdResolverSelfTest.class));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
index c2b56ca..5947d33 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
@@ -56,12 +56,10 @@ public class IgniteCacheTestSuite3 extends TestSuite {
suite.addTestSuite(GridCacheReplicatedEventSelfTest.class);
suite.addTestSuite(GridCacheReplicatedSynchronousCommitTest.class);
- // TODO: GG-7437.
- // suite.addTestSuite(GridCacheReplicatedInvalidateSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedInvalidateSelfTest.class);
suite.addTestSuite(GridCacheReplicatedLockSelfTest.class);
- // TODO: enable when GG-7437 is fixed.
- //suite.addTestSuite(GridCacheReplicatedMultiNodeLockSelfTest.class);
- //suite.addTestSuite(GridCacheReplicatedMultiNodeSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedMultiNodeLockSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedMultiNodeSelfTest.class);
suite.addTestSuite(GridCacheReplicatedNodeFailureSelfTest.class);
suite.addTestSuite(GridCacheReplicatedTxSingleThreadedSelfTest.class);
suite.addTestSuite(GridCacheReplicatedTxTimeoutSelfTest.class);
@@ -76,12 +74,10 @@ public class IgniteCacheTestSuite3 extends TestSuite {
suite.addTestSuite(GridCachePutArrayValueSelfTest.class);
suite.addTestSuite(GridCacheReplicatedUnswapAdvancedSelfTest.class);
suite.addTestSuite(GridCacheReplicatedEvictionEventSelfTest.class);
- // TODO: GG-7569.
- // suite.addTestSuite(GridCacheReplicatedTxMultiThreadedSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedTxMultiThreadedSelfTest.class);
suite.addTestSuite(GridCacheReplicatedPreloadEventsSelfTest.class);
suite.addTestSuite(GridCacheReplicatedPreloadStartStopEventsSelfTest.class);
- // TODO: GG-7434
- // suite.addTestSuite(GridReplicatedTxPreloadTest.class);
+ suite.addTestSuite(GridReplicatedTxPreloadTest.class);
suite.addTestSuite(IgniteTxReentryNearSelfTest.class);
suite.addTestSuite(IgniteTxReentryColocatedSelfTest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index 713c5e5..cca28af 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -39,9 +39,8 @@ public class IgniteCacheTestSuite4 extends TestSuite {
// Multi node update.
suite.addTestSuite(GridCacheMultinodeUpdateSelfTest.class);
- // TODO: GG-5353.
- // suite.addTestSuite(GridCacheMultinodeUpdateNearEnabledSelfTest.class);
- // suite.addTestSuite(GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.class);
+ suite.addTestSuite(GridCacheMultinodeUpdateNearEnabledSelfTest.class);
+ suite.addTestSuite(GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.class);
suite.addTestSuite(GridCacheMultinodeUpdateAtomicSelfTest.class);
suite.addTestSuite(GridCacheMultinodeUpdateAtomicNearEnabledSelfTest.class);
@@ -88,9 +87,8 @@ public class IgniteCacheTestSuite4 extends TestSuite {
suite.addTestSuite(IgniteCacheTxLocalPeekModesTest.class);
suite.addTestSuite(IgniteCacheTxReplicatedPeekModesTest.class);
- // TODO: IGNITE-114.
- // suite.addTestSuite(IgniteCacheInvokeReadThroughTest.class);
- // suite.addTestSuite(GridCacheVersionMultinodeTest.class);
+ suite.addTestSuite(IgniteCacheInvokeReadThroughTest.class);
+ suite.addTestSuite(GridCacheVersionMultinodeTest.class);
suite.addTestSuite(IgniteCacheNearReadCommittedTest.class);
suite.addTestSuite(IgniteCacheAtomicCopyOnReadDisabledTest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/util/GridRandomSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/util/GridRandomSelfTest.java b/modules/core/src/test/java/org/apache/ignite/util/GridRandomSelfTest.java
index d31e5bc..0dc4879 100644
--- a/modules/core/src/test/java/org/apache/ignite/util/GridRandomSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/util/GridRandomSelfTest.java
@@ -56,7 +56,9 @@ public class GridRandomSelfTest extends TestCase {
/**
* Test performance difference.
*/
- public void _testPerformance() {
+ public void testPerformance() {
+ fail("https://issues.apache.org/jira/browse/IGNITE-824");
+
Random rnd = new GridRandom(); // new Random();
long start = System.nanoTime();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
index 9bcd5de..91f926d 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
@@ -1079,7 +1079,9 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA
}
/** @throws Exception If failed. */
- public void _testRenameDirectoryIfDstPathExists() throws Exception {
+ public void testRenameDirectoryIfDstPathExists() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-825");
+
Path fsHome = new Path(primaryFsUri);
Path srcDir = new Path(fsHome, "/tmp/");
Path dstDir = new Path(fsHome, "/tmpNew/");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopHashMapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopHashMapSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopHashMapSelfTest.java
index 5b1b6a8..f28bfd9 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopHashMapSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopHashMapSelfTest.java
@@ -32,7 +32,9 @@ import java.util.concurrent.*;
*/
public class HadoopHashMapSelfTest extends HadoopAbstractMapTest {
- public void _testAllocation() throws Exception {
+ public void testAllocation() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-826");
+
final GridUnsafeMemory mem = new GridUnsafeMemory(0);
long size = 3L * 1024 * 1024 * 1024;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutionSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutionSelfTest.java
index 0b7ac15..b712636 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutionSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutionSelfTest.java
@@ -47,6 +47,8 @@ public class HadoopExternalTaskExecutionSelfTest extends HadoopAbstractSelfTest
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-404");
+
startGrids(gridCount());
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopExternalCommunicationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopExternalCommunicationSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopExternalCommunicationSelfTest.java
index 45fb3db..625b265 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopExternalCommunicationSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopExternalCommunicationSelfTest.java
@@ -33,6 +33,11 @@ import java.util.concurrent.*;
* Tests Hadoop external communication component.
*/
public class HadoopExternalCommunicationSelfTest extends GridCommonAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-404");
+ }
+
/**
* @throws Exception If failed.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
index 179f7f0..4be5d72 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
@@ -26,6 +26,8 @@ import org.apache.ignite.igfs.*;
import org.apache.ignite.internal.processors.hadoop.*;
import org.apache.ignite.internal.processors.hadoop.shuffle.collections.*;
import org.apache.ignite.internal.processors.hadoop.shuffle.streams.*;
+import org.apache.ignite.internal.processors.hadoop.taskexecutor.external.*;
+import org.apache.ignite.internal.processors.hadoop.taskexecutor.external.communication.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -106,9 +108,8 @@ public class IgniteHadoopTestSuite extends TestSuite {
suite.addTest(new TestSuite(ldr.loadClass(HadoopSortingTest.class.getName())));
- // TODO: IGNITE-404: Uncomment when fixed.
- //suite.addTest(new TestSuite(ldr.loadClass(HadoopExternalTaskExecutionSelfTest.class.getName())));
- //suite.addTest(new TestSuite(ldr.loadClass(HadoopExternalCommunicationSelfTest.class.getName())));
+ suite.addTest(new TestSuite(ldr.loadClass(HadoopExternalTaskExecutionSelfTest.class.getName())));
+ suite.addTest(new TestSuite(ldr.loadClass(HadoopExternalCommunicationSelfTest.class.getName())));
suite.addTest(new TestSuite(ldr.loadClass(HadoopSortingExternalTest.class.getName())));
suite.addTest(new TestSuite(ldr.loadClass(HadoopGroupingTest.class.getName())));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheSelfTest.java b/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheSelfTest.java
index 63cb3ac..bb5884a 100644
--- a/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheSelfTest.java
+++ b/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheSelfTest.java
@@ -51,6 +51,11 @@ import static org.hibernate.cfg.Environment.*;
* Tests Hibernate L2 cache.
*/
public class HibernateL2CacheSelfTest extends GridCommonAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-591");
+ }
+
/** */
private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheTransactionalSelfTest.java b/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheTransactionalSelfTest.java
index efc6f3e..c429d9a 100644
--- a/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheTransactionalSelfTest.java
+++ b/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheTransactionalSelfTest.java
@@ -41,6 +41,11 @@ import java.util.*;
* to used the same TransactionManager).
*/
public class HibernateL2CacheTransactionalSelfTest extends HibernateL2CacheSelfTest {
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-591");
+ }
+
/** */
private static Jotm jotm;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java b/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
index 655e801..3ac5ec4 100644
--- a/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
+++ b/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
@@ -33,8 +33,8 @@ public class IgniteHibernateTestSuite extends TestSuite {
TestSuite suite = new TestSuite("Hibernate Integration Test Suite");
// Hibernate L2 cache.
-// suite.addTestSuite(HibernateL2CacheSelfTest.class); // TODO GG-9141
-// suite.addTestSuite(HibernateL2CacheTransactionalSelfTest.class);
+ suite.addTestSuite(HibernateL2CacheSelfTest.class);
+ suite.addTestSuite(HibernateL2CacheTransactionalSelfTest.class);
suite.addTestSuite(HibernateL2CacheConfigurationSelfTest.class);
suite.addTestSuite(CacheHibernateBlobStoreSelfTest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
index 4e9bf31..bc45d1e 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
@@ -115,7 +115,9 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
- public void _testTwoStep() throws Exception {
+ public void testTwoStep() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-827");
+
String cache = "partitioned";
GridQueryProcessor qryProc = ((IgniteKernal) ignite).context().query();
@@ -249,7 +251,9 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest {
// return 10 * 60 * 1000;
// }
- public void _testLoop() throws Exception {
+ public void testLoop() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-827");
+
final IgniteCache<Object,Object> c = ignite.cache("partitioned");
X.println("___ GET READY");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java
index 5dce126..f86ae9c 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java
@@ -43,6 +43,11 @@ import static org.apache.ignite.cache.CacheMode.*;
* Test for distributed queries with node restarts.
*/
public class IgniteCacheQueryNodeRestartSelfTest extends GridCacheAbstractSelfTest {
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-484");
+ }
+
/** */
private static final int GRID_CNT = 3;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
index 3ec67b2..23d9fda 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
@@ -417,7 +417,9 @@ public abstract class GridIndexingSpiAbstractSelfTest extends GridCommonAbstract
}
}
- public void _testResultReuse() throws Exception {
+ public void testResultReuse() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-828");
+
final IgniteH2Indexing spi = getIndexing();
multithreaded(new Callable<Object>() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java
index 99366f0..9da7cf8 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java
@@ -437,7 +437,9 @@ public class BaseH2CompareQueryTest extends AbstractH2CompareQueryTest {
/**
* @throws Exception If failed.
*/
- public void _testCrossCache() throws Exception {
+ public void testCrossCache() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-829");
+
//TODO Investigate (should be 20 results instead of 0).
compareQueryRes0("select firstName, lastName" +
" from \"part\".Person, \"part\".Purchase" +
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
index 2d5fed5..cfc8f2c 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
@@ -65,7 +65,7 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
// suite.addTestSuite(IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest.class); TODO IGNITE-971.
suite.addTestSuite(IgniteCacheSqlQueryMultiThreadedSelfTest.class);
suite.addTestSuite(IgniteCacheOffheapTieredMultithreadedSelfTest.class);
-// suite.addTestSuite(IgniteCacheQueryNodeRestartSelfTest.class); TODO IGNITE-484
+ suite.addTestSuite(IgniteCacheQueryNodeRestartSelfTest.class);
suite.addTestSuite(GridCacheReduceQueryMultithreadedSelfTest.class);
suite.addTestSuite(GridCacheCrossCacheQuerySelfTest.class);
suite.addTestSuite(GridCacheQuerySerializationSelfTest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/web/src/test/java/org/apache/ignite/internal/websession/IgniteWebSessionSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/web/src/test/java/org/apache/ignite/internal/websession/IgniteWebSessionSelfTestSuite.java b/modules/web/src/test/java/org/apache/ignite/internal/websession/IgniteWebSessionSelfTestSuite.java
index 8f8b9ee..f7e5a2b 100644
--- a/modules/web/src/test/java/org/apache/ignite/internal/websession/IgniteWebSessionSelfTestSuite.java
+++ b/modules/web/src/test/java/org/apache/ignite/internal/websession/IgniteWebSessionSelfTestSuite.java
@@ -55,7 +55,7 @@ public class IgniteWebSessionSelfTestSuite extends TestSuite {
/** {@inheritDoc} */
@Override public void testRestarts() throws Exception {
- // TODO GG-8166, enable when fixed.
+ // TODO IGNITE-810, enable when fixed.
}
}
[31/50] [abbrv] incubator-ignite git commit: # Sprint-6 - Minor.
Posted by se...@apache.org.
# Sprint-6 - Minor.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5b4cb44b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5b4cb44b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5b4cb44b
Branch: refs/heads/ignite-484-1
Commit: 5b4cb44b85b1cf3cd25bcf2c2ababa6a4f3314f4
Parents: 2b63ff8
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Thu Jun 11 15:57:03 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Thu Jun 11 15:57:03 2015 -0700
----------------------------------------------------------------------
.../ignite/internal/util/ipc/shmem/IpcSharedMemoryUtils.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5b4cb44b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtils.java
index 7d0abaa..71bcac4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtils.java
@@ -26,8 +26,8 @@ import java.nio.*;
import java.util.*;
/**
- * NOTE: Native library should be loaded, before methods of this class are called. Native library is loaded with: {@link
- * IpcSharedMemoryNativeLoader#load()}.
+ * NOTE: Native library should be loaded, before methods of this class are called.
+ * Native library is loaded with: {@link IpcSharedMemoryNativeLoader#load(org.apache.ignite.IgniteLogger)}.
*/
public class IpcSharedMemoryUtils {
/**
[25/50] [abbrv] incubator-ignite git commit: #ignite-1005: Ignite
should not wait for update notifier thread to finish during stop.
Posted by se...@apache.org.
#ignite-1005: Ignite should not wait for update notifier thread to finish during stop.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cf323242
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cf323242
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cf323242
Branch: refs/heads/ignite-484-1
Commit: cf323242680056dbec7b1742e90a67e8fbb03e00
Parents: 420b6bd
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Jun 11 18:21:50 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Jun 11 18:21:50 2015 +0300
----------------------------------------------------------------------
.../src/main/java/org/apache/ignite/internal/IgniteKernal.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf323242/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 4f5e365..db238c8 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
@@ -686,7 +686,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
try {
verChecker = new GridUpdateNotifier(gridName, VER_STR, gw, ctx.plugins().allProviders(), false);
- updateNtfTimer = new Timer("ignite-update-notifier-timer");
+ updateNtfTimer = new Timer("ignite-update-notifier-timer", true);
// Setup periodic version check.
updateNtfTimer.scheduleAtFixedRate(new GridTimerTask() {
[19/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: merge
from ignite-471-2
Posted by se...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSslSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSslSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSslSelfTest.java
index ccf01c6..930b5d1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSslSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSslSelfTest.java
@@ -35,6 +35,8 @@ public class GridNioSslSelfTest extends GridNioSelfTest {
/** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
+ super.beforeTestsStarted();
+
sslCtx = GridTestUtils.sslContext();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/GridToStringBuilderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/GridToStringBuilderSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/GridToStringBuilderSelfTest.java
index c33014b..de6cd85 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/GridToStringBuilderSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/GridToStringBuilderSelfTest.java
@@ -70,11 +70,11 @@ public class GridToStringBuilderSelfTest extends GridCommonAbstractTest {
}
/**
- * TODO: IGNITE-602.
- *
* @throws Exception If failed.
*/
public void testToStringCheckAdvancedRecursionPrevention() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-602");
+
ArrayList<Object> list1 = new ArrayList<>();
ArrayList<Object> list2 = new ArrayList<>();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java b/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java
index 095a404..4164fda 100644
--- a/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java
+++ b/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java
@@ -17,6 +17,7 @@
package org.apache.ignite.marshaller;
+import org.apache.ignite.*;
import org.apache.ignite.internal.*;
import org.jsr166.*;
@@ -27,11 +28,15 @@ import java.util.concurrent.*;
*/
public class MarshallerContextTestImpl extends MarshallerContextAdapter {
/** */
- private final ConcurrentMap<Integer, String> map = new ConcurrentHashMap8<>();
+ private final static ConcurrentMap<Integer, String> map = new ConcurrentHashMap8<>();
/** {@inheritDoc} */
- @Override protected boolean registerClassName(int id, String clsName) {
- map.putIfAbsent(id, clsName);
+ @Override protected boolean registerClassName(int id, String clsName) throws IgniteCheckedException {
+ String oldClsName = map.putIfAbsent(id, clsName);
+
+ if (oldClsName != null && !oldClsName.equals(clsName))
+ throw new IgniteCheckedException("Duplicate ID [id=" + id + ", oldClsName=" + oldClsName + ", clsName=" +
+ clsName + ']');
return true;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/messaging/GridMessagingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/messaging/GridMessagingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/messaging/GridMessagingSelfTest.java
index b7838be..455bc8c 100644
--- a/modules/core/src/test/java/org/apache/ignite/messaging/GridMessagingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/messaging/GridMessagingSelfTest.java
@@ -24,7 +24,6 @@ import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.resources.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -185,8 +184,6 @@ public class GridMessagingSelfTest extends GridCommonAbstractTest implements Ser
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
- ((OptimizedMarshaller)cfg.getMarshaller()).setRequireSerializable(false);
-
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(ipFinder);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PContinuousDeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PContinuousDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PContinuousDeploymentSelfTest.java
index c71ccbb..6b3ad63 100644
--- a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PContinuousDeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PContinuousDeploymentSelfTest.java
@@ -98,6 +98,8 @@ public class GridP2PContinuousDeploymentSelfTest extends GridCommonAbstractTest
*/
@SuppressWarnings("unchecked")
public void testDeployment() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-934");
+
Ignite ignite = startGrid(GRID_NAME);
Class cls = getExternalClassLoader().loadClass(TEST_TASK_1);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PLocalDeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PLocalDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PLocalDeploymentSelfTest.java
index 28eb687..51a7574 100644
--- a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PLocalDeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PLocalDeploymentSelfTest.java
@@ -212,7 +212,7 @@ public class GridP2PLocalDeploymentSelfTest extends GridCommonAbstractTest {
for (ClusterNode node : subgrid) {
if (node.id().equals(arg))
- return Collections.singletonMap(new TestJob(arg), node);
+ return Collections.singletonMap(new DeployementTestJob(arg), node);
}
throw new IgniteException("Failed to find target node: " + arg);
@@ -230,7 +230,7 @@ public class GridP2PLocalDeploymentSelfTest extends GridCommonAbstractTest {
/**
* Simple job class.
*/
- public static class TestJob extends ComputeJobAdapter {
+ public static class DeployementTestJob extends ComputeJobAdapter {
/** Ignite instance. */
@IgniteInstanceResource
private Ignite ignite;
@@ -238,7 +238,7 @@ public class GridP2PLocalDeploymentSelfTest extends GridCommonAbstractTest {
/**
* @param nodeId Node ID for node this job is supposed to execute on.
*/
- public TestJob(UUID nodeId) { super(nodeId); }
+ public DeployementTestJob(UUID nodeId) { super(nodeId); }
/** {@inheritDoc} */
@Override public Serializable execute() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PRemoteClassLoadersSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PRemoteClassLoadersSelfTest.java b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PRemoteClassLoadersSelfTest.java
index a6e3411..e62141e 100644
--- a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PRemoteClassLoadersSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PRemoteClassLoadersSelfTest.java
@@ -43,9 +43,9 @@ public class GridP2PRemoteClassLoadersSelfTest extends GridCommonAbstractTest {
// Override P2P configuration to exclude Task and Job classes
cfg.setPeerClassLoadingLocalClassPathExclude(
- GridP2PTestTask.class.getName(),
- GridP2PTestTask1.class.getName(),
- GridP2PTestJob.class.getName(),
+ GridP2PRemoteTestTask.class.getName(),
+ GridP2PRemoteTestTask1.class.getName(),
+ GridP2PRemoteTestJob.class.getName(),
GridP2PRemoteClassLoadersSelfTest.class.getName()
);
@@ -73,13 +73,14 @@ public class GridP2PRemoteClassLoadersSelfTest extends GridCommonAbstractTest {
ClassLoader tstClsLdr =
new GridTestClassLoader(
Collections.<String, String>emptyMap(), getClass().getClassLoader(),
- GridP2PTestTask.class.getName(), GridP2PTestTask1.class.getName(), GridP2PTestJob.class.getName());
+ GridP2PRemoteTestTask.class.getName(), GridP2PRemoteTestTask1.class.getName(),
+ GridP2PRemoteTestJob.class.getName());
Class<? extends ComputeTask<?, ?>> task1 =
- (Class<? extends ComputeTask<?, ?>>) tstClsLdr.loadClass(GridP2PTestTask.class.getName());
+ (Class<? extends ComputeTask<?, ?>>) tstClsLdr.loadClass(GridP2PRemoteTestTask.class.getName());
Class<? extends ComputeTask<?, ?>> task2 =
- (Class<? extends ComputeTask<?, ?>>) tstClsLdr.loadClass(GridP2PTestTask1.class.getName());
+ (Class<? extends ComputeTask<?, ?>>) tstClsLdr.loadClass(GridP2PRemoteTestTask1.class.getName());
Object res1 = ignite1.compute().execute(task1.newInstance(), null);
@@ -124,19 +125,19 @@ public class GridP2PRemoteClassLoadersSelfTest extends GridCommonAbstractTest {
ClassLoader tstClsLdr1 =
new GridTestClassLoader(
Collections.EMPTY_MAP, getClass().getClassLoader(),
- GridP2PTestTask.class.getName(), GridP2PTestJob.class.getName()
+ GridP2PRemoteTestTask.class.getName(), GridP2PRemoteTestJob.class.getName()
);
ClassLoader tstClsLdr2 =
new GridTestClassLoader(
Collections.EMPTY_MAP, getClass().getClassLoader(),
- GridP2PTestTask1.class.getName(), GridP2PTestJob.class.getName());
+ GridP2PRemoteTestTask1.class.getName(), GridP2PRemoteTestJob.class.getName());
Class<? extends ComputeTask<?, ?>> task1 =
- (Class<? extends ComputeTask<?, ?>>) tstClsLdr1.loadClass(GridP2PTestTask.class.getName());
+ (Class<? extends ComputeTask<?, ?>>) tstClsLdr1.loadClass(GridP2PRemoteTestTask.class.getName());
Class<? extends ComputeTask<?, ?>> task2 =
- (Class<? extends ComputeTask<?, ?>>) tstClsLdr2.loadClass(GridP2PTestTask1.class.getName());
+ (Class<? extends ComputeTask<?, ?>>) tstClsLdr2.loadClass(GridP2PRemoteTestTask1.class.getName());
Object res1 = ignite1.compute().execute(task1.newInstance(), null);
@@ -217,11 +218,11 @@ public class GridP2PRemoteClassLoadersSelfTest extends GridCommonAbstractTest {
/**
* P2P test job.
*/
- public static class GridP2PTestJob extends ComputeJobAdapter {
+ public static class GridP2PRemoteTestJob extends ComputeJobAdapter {
/**
* @param arg Argument.
*/
- public GridP2PTestJob(String arg) {
+ public GridP2PRemoteTestJob(String arg) {
super(arg);
}
@@ -235,7 +236,7 @@ public class GridP2PRemoteClassLoadersSelfTest extends GridCommonAbstractTest {
/**
* P2P test task.
*/
- public static class GridP2PTestTask extends ComputeTaskAdapter<Serializable, Object> {
+ public static class GridP2PRemoteTestTask extends ComputeTaskAdapter<Serializable, Object> {
/** */
@LoggerResource
private IgniteLogger log;
@@ -250,7 +251,7 @@ public class GridP2PRemoteClassLoadersSelfTest extends GridCommonAbstractTest {
for (ClusterNode node : subgrid) {
if (!node.id().equals(ignite.configuration().getNodeId()))
- map.put(new GridP2PTestJob(null) , node);
+ map.put(new GridP2PRemoteTestJob(null) , node);
}
return map;
@@ -275,7 +276,7 @@ public class GridP2PRemoteClassLoadersSelfTest extends GridCommonAbstractTest {
/**
* P2p test task.
*/
- public static class GridP2PTestTask1 extends GridP2PTestTask {
+ public static class GridP2PRemoteTestTask1 extends GridP2PRemoteTestTask {
// No-op.
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/spi/GridTcpSpiForwardingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/GridTcpSpiForwardingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/GridTcpSpiForwardingSelfTest.java
index 744635d..9e18c70 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/GridTcpSpiForwardingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/GridTcpSpiForwardingSelfTest.java
@@ -23,7 +23,6 @@ import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.nio.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.communication.tcp.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.internal.*;
@@ -32,7 +31,6 @@ import org.apache.ignite.testframework.junits.common.*;
import java.net.*;
import java.util.*;
-import java.util.concurrent.*;
/**
* Test for {@link org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi} and {@link org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi}.
@@ -99,7 +97,6 @@ public class GridTcpSpiForwardingSelfTest extends GridCommonAbstractTest {
cfg.setDiscoverySpi(spi);
cfg.setLocalHost("127.0.0.1");
cfg.setConnectorConfiguration(null);
- cfg.setMarshaller(new OptimizedMarshaller(false));
TcpCommunicationSpi commSpi = new TcpCommunicationSpi() {
@Override protected GridCommunicationClient createTcpClient(ClusterNode node) throws IgniteCheckedException {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java b/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
index 1a85eae..d03d327 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
@@ -1510,4 +1510,18 @@ public final class GridTestUtils {
else
return cls.getSimpleName();
}
+
+ /**
+ * Adds test to the suite only if it's not in {@code ignoredTests} set.
+ *
+ * @param suite TestSuite where to place the test.
+ * @param test Test.
+ * @param ignoredTests Tests to ignore.
+ */
+ public static void addTestIfNeeded(TestSuite suite, Class test, Set<Class> ignoredTests) {
+ if (ignoredTests != null && ignoredTests.contains(test))
+ return;
+
+ suite.addTestSuite(test);
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/testframework/config/GridTestProperties.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/config/GridTestProperties.java b/modules/core/src/test/java/org/apache/ignite/testframework/config/GridTestProperties.java
index 5fa78ed..9345618 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/config/GridTestProperties.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/config/GridTestProperties.java
@@ -64,6 +64,9 @@ public final class GridTestProperties {
private static final Map<String, Map<String, String>> pathProps = new HashMap<>();
/** */
+ public static final String MARSH_CLASS_NAME = "marshaller.class";
+
+ /** */
static {
// Initialize IGNITE_HOME system property.
String igniteHome = System.getProperty("IGNITE_HOME");
@@ -159,6 +162,14 @@ public final class GridTestProperties {
}
/**
+ * @param name Property name.
+ * @param val Property value.
+ */
+ public static synchronized void setProperty(String name, String val) {
+ getProperties().put(name, val);
+ }
+
+ /**
* @param dir Directory path.
* @return Properties.
*/
@@ -175,9 +186,6 @@ public final class GridTestProperties {
// potentially overriding defaults.
loadProperties(props, dir);
- // Seal it.
- props = Collections.unmodifiableMap(props);
-
pathProps.put(dir, props);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
index 61dddbe..68ae64b 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
@@ -193,6 +193,7 @@ public class IgniteTestResources {
}
/**
+ * @param cls Class.
* @return Logger for specified class.
*/
public static IgniteLogger getLogger(Class<?> cls) {
@@ -226,17 +227,17 @@ public class IgniteTestResources {
*/
@SuppressWarnings("unchecked")
public synchronized Marshaller getMarshaller() throws IgniteCheckedException {
- String marshallerName = GridTestProperties.getProperty("marshaller.class");
+ String marshallerName = GridTestProperties.getProperty(GridTestProperties.MARSH_CLASS_NAME);
- Marshaller marshaller;
+ Marshaller marsh;
if (marshallerName == null)
- marshaller = new OptimizedMarshaller();
+ marsh = new OptimizedMarshaller();
else {
try {
Class<? extends Marshaller> cls = (Class<? extends Marshaller>)Class.forName(marshallerName);
- marshaller = cls.newInstance();
+ marsh = cls.newInstance();
}
catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) {
throw new IgniteCheckedException("Failed to create test marshaller [marshaller=" +
@@ -244,8 +245,11 @@ public class IgniteTestResources {
}
}
- marshaller.setContext(new MarshallerContextTestImpl());
+ if (marsh instanceof OptimizedMarshaller)
+ ((OptimizedMarshaller)marsh).setRequireSerializable(false);
- return marshaller;
+ marsh.setContext(new MarshallerContextTestImpl());
+
+ return marsh;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
index cc3abb4..b4977ce 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
@@ -29,6 +29,9 @@ import org.apache.ignite.internal.product.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.messaging.*;
import org.apache.ignite.spi.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.*;
/**
* Basic test suite.
@@ -39,28 +42,38 @@ public class IgniteBasicTestSuite extends TestSuite {
* @throws Exception Thrown in case of the failure.
*/
public static TestSuite suite() throws Exception {
+ return suite(null);
+ }
+
+ /**
+ * @param ignoredTests Tests don't include in the execution.
+ * @return Test suite.
+ * @throws Exception Thrown in case of the failure.
+ */
+ public static TestSuite suite(Set<Class> ignoredTests) throws Exception {
TestSuite suite = new TestSuite("Ignite Basic Test Suite");
suite.addTest(IgniteLangSelfTestSuite.suite());
- suite.addTest(IgniteUtilSelfTestSuite.suite());
- suite.addTest(IgniteMarshallerSelfTestSuite.suite());
- suite.addTest(IgniteKernalSelfTestSuite.suite());
+ suite.addTest(IgniteUtilSelfTestSuite.suite(ignoredTests));
+ suite.addTest(IgniteMarshallerSelfTestSuite.suite(ignoredTests));
+
+ suite.addTest(IgniteKernalSelfTestSuite.suite(ignoredTests));
suite.addTest(IgniteStartUpTestSuite.suite());
suite.addTest(IgniteExternalizableSelfTestSuite.suite());
suite.addTest(IgniteP2PSelfTestSuite.suite());
- suite.addTest(IgniteCacheP2pUnmarshallingErrorTestSuite.suite());
+ suite.addTest(IgniteCacheP2pUnmarshallingErrorTestSuite.suite(ignoredTests));
suite.addTest(IgniteStreamSelfTestSuite.suite());
suite.addTest(new TestSuite(GridSelfTest.class));
- suite.addTest(new TestSuite(GridProjectionSelfTest.class));
- suite.addTest(new TestSuite(GridMessagingSelfTest.class));
+ GridTestUtils.addTestIfNeeded(suite, GridProjectionSelfTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, GridMessagingSelfTest.class, ignoredTests);
suite.addTest(new TestSuite(IgniteMessagingWithClientTest.class));
- suite.addTest(new TestSuite(GridMessagingNoPeerClassLoadingSelfTest.class));
+ GridTestUtils.addTestIfNeeded(suite, GridMessagingNoPeerClassLoadingSelfTest.class, ignoredTests);
if (U.isLinux() || U.isMacOs())
suite.addTest(IgniteIpcSharedMemorySelfTestSuite.suite());
- suite.addTestSuite(GridReleaseTypeSelfTest.class);
+ GridTestUtils.addTestIfNeeded(suite, GridReleaseTypeSelfTest.class, ignoredTests);
suite.addTestSuite(GridProductVersionSelfTest.class);
suite.addTestSuite(GridAffinityProcessorRendezvousSelfTest.class);
suite.addTestSuite(GridClosureProcessorSelfTest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
index c71da11..08178db 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
@@ -24,6 +24,9 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.*;
import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.*;
/**
* Test suite.
@@ -34,12 +37,21 @@ public class IgniteCacheFailoverTestSuite extends TestSuite {
* @throws Exception Thrown in case of the failure.
*/
public static TestSuite suite() throws Exception {
+ return suite(null);
+ }
+
+ /**
+ * @param ignoredTests Tests don't include in the execution.
+ * @return Test suite.
+ * @throws Exception Thrown in case of the failure.
+ */
+ public static TestSuite suite(Set<Class> ignoredTests) throws Exception {
TestSuite suite = new TestSuite("Cache Failover Test Suite");
suite.addTestSuite(GridCacheAtomicInvalidPartitionHandlingSelfTest.class);
suite.addTestSuite(GridCacheAtomicClientInvalidPartitionHandlingSelfTest.class);
- suite.addTestSuite(GridCacheIncrementTransformTest.class);
+ GridTestUtils.addTestIfNeeded(suite, GridCacheIncrementTransformTest.class, ignoredTests);
// Failure consistency tests.
suite.addTestSuite(GridCacheAtomicRemoveFailureTest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheP2pUnmarshallingErrorTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheP2pUnmarshallingErrorTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheP2pUnmarshallingErrorTestSuite.java
index f54f85a..7cfefd1 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheP2pUnmarshallingErrorTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheP2pUnmarshallingErrorTestSuite.java
@@ -19,6 +19,9 @@ package org.apache.ignite.testsuites;
import junit.framework.*;
import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.*;
/**
* Checks behavior on exception while unmarshalling key.
@@ -29,12 +32,21 @@ public class IgniteCacheP2pUnmarshallingErrorTestSuite extends TestSuite {
* @throws Exception If failed.
*/
public static TestSuite suite() throws Exception {
+ return suite(null);
+ }
+
+ /**
+ * @param ignoredTests Tests don't include in the execution.
+ * @return Test suite.
+ * @throws Exception Thrown in case of the failure.
+ */
+ public static TestSuite suite(Set<Class> ignoredTests) throws Exception {
TestSuite suite = new TestSuite("P2p Unmarshalling Test Suite");
- suite.addTestSuite(IgniteCacheP2pUnmarshallingErrorTest.class);
- suite.addTestSuite(IgniteCacheP2pUnmarshallingNearErrorTest.class);
- suite.addTestSuite(IgniteCacheP2pUnmarshallingRebalanceErrorTest.class);
- suite.addTestSuite(IgniteCacheP2pUnmarshallingTxErrorTest.class);
+ GridTestUtils.addTestIfNeeded(suite, IgniteCacheP2pUnmarshallingErrorTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, IgniteCacheP2pUnmarshallingNearErrorTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, IgniteCacheP2pUnmarshallingRebalanceErrorTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, IgniteCacheP2pUnmarshallingTxErrorTest.class, ignoredTests);
return suite;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index 5f37aea..6245308 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -32,6 +32,9 @@ import org.apache.ignite.internal.processors.cache.distributed.near.*;
import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
import org.apache.ignite.internal.processors.cache.local.*;
import org.apache.ignite.internal.processors.datastreamer.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.*;
/**
* Test suite.
@@ -42,6 +45,15 @@ public class IgniteCacheTestSuite extends TestSuite {
* @throws Exception Thrown in case of the failure.
*/
public static TestSuite suite() throws Exception {
+ return suite(null);
+ }
+
+ /**
+ * @param ignoredTests
+ * @return Test suite.
+ * @throws Exception Thrown in case of the failure.
+ */
+ public static TestSuite suite(Set<Class> ignoredTests) throws Exception {
TestSuite suite = new TestSuite("IgniteCache Test Suite");
suite.addTestSuite(IgniteCacheEntryListenerAtomicTest.class);
@@ -97,8 +109,8 @@ public class IgniteCacheTestSuite extends TestSuite {
// Common tests.
suite.addTestSuite(GridCacheConcurrentMapSelfTest.class);
suite.addTestSuite(GridCacheAffinityMapperSelfTest.class);
- suite.addTestSuite(GridCacheAffinityRoutingSelfTest.class);
- suite.addTestSuite(GridCacheMvccSelfTest.class);
+ GridTestUtils.addTestIfNeeded(suite, GridCacheAffinityRoutingSelfTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, GridCacheMvccSelfTest.class, ignoredTests);
suite.addTestSuite(GridCacheMvccPartitionedSelfTest.class);
suite.addTestSuite(GridCacheMvccManagerSelfTest.class);
// suite.addTestSuite(GridCacheP2PUndeploySelfTest.class); TODO uncomment in DR branch.
@@ -111,11 +123,11 @@ public class IgniteCacheTestSuite extends TestSuite {
suite.addTestSuite(GridCacheBalancingStoreSelfTest.class);
suite.addTestSuite(GridCacheAffinityApiSelfTest.class);
suite.addTestSuite(GridCacheStoreValueBytesSelfTest.class);
- suite.addTestSuite(DataStreamProcessorSelfTest.class);
+ GridTestUtils.addTestIfNeeded(suite, DataStreamProcessorSelfTest.class, ignoredTests);
suite.addTestSuite(DataStreamerMultiThreadedSelfTest.class);
suite.addTestSuite(DataStreamerMultinodeCreateCacheTest.class);
suite.addTestSuite(DataStreamerImplSelfTest.class);
- suite.addTestSuite(GridCacheEntryMemorySizeSelfTest.class);
+ GridTestUtils.addTestIfNeeded(suite, GridCacheEntryMemorySizeSelfTest.class, ignoredTests);
suite.addTestSuite(GridCacheClearAllSelfTest.class);
suite.addTestSuite(GridCacheObjectToStringSelfTest.class);
suite.addTestSuite(GridCacheLoadOnlyStoreAdapterSelfTest.class);
@@ -140,10 +152,10 @@ public class IgniteCacheTestSuite extends TestSuite {
suite.addTestSuite(GridCacheMixedPartitionExchangeSelfTest.class);
suite.addTestSuite(IgniteCacheAtomicMessageRecoveryTest.class);
// suite.addTestSuite(IgniteCacheTxMessageRecoveryTest.class); TODO IGNITE-795
- suite.addTestSuite(GridCacheOffHeapTieredEvictionAtomicSelfTest.class);
- suite.addTestSuite(GridCacheOffHeapTieredEvictionSelfTest.class);
- suite.addTestSuite(GridCacheOffHeapTieredAtomicSelfTest.class);
- suite.addTestSuite(GridCacheOffHeapTieredSelfTest.class);
+ GridTestUtils.addTestIfNeeded(suite, GridCacheOffHeapTieredEvictionAtomicSelfTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, GridCacheOffHeapTieredEvictionSelfTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, GridCacheOffHeapTieredAtomicSelfTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, GridCacheOffHeapTieredSelfTest.class, ignoredTests);
suite.addTestSuite(GridCacheGlobalLoadTest.class);
suite.addTestSuite(GridCachePartitionedLocalStoreSelfTest.class);
suite.addTestSuite(GridCacheReplicatedLocalStoreSelfTest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java
index f0080d5..978941d 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java
@@ -29,6 +29,9 @@ import org.apache.ignite.internal.processors.port.*;
import org.apache.ignite.internal.processors.service.*;
import org.apache.ignite.internal.util.*;
import org.apache.ignite.spi.communication.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.*;
/**
* Kernal self test suite.
@@ -39,6 +42,15 @@ public class IgniteKernalSelfTestSuite extends TestSuite {
* @throws Exception If failed.
*/
public static TestSuite suite() throws Exception {
+ return suite(null);
+ }
+
+ /**
+ * @param ignoredTests Tests don't include in the execution.
+ * @return Test suite.
+ * @throws Exception Thrown in case of the failure.
+ */
+ public static TestSuite suite(Set<Class> ignoredTests) throws Exception {
TestSuite suite = new TestSuite("Ignite Kernal Test Suite");
suite.addTestSuite(GridSameVmStartupSelfTest.class);
@@ -63,7 +75,7 @@ public class IgniteKernalSelfTestSuite extends TestSuite {
suite.addTestSuite(GridDiscoveryEventSelfTest.class);
suite.addTestSuite(GridPortProcessorSelfTest.class);
suite.addTestSuite(GridHomePathSelfTest.class);
- suite.addTestSuite(GridStartupWithSpecifiedWorkDirectorySelfTest.class);
+ GridTestUtils.addTestIfNeeded(suite, GridStartupWithSpecifiedWorkDirectorySelfTest.class, ignoredTests);
suite.addTestSuite(GridStartupWithUndefinedIgniteHomeSelfTest.class);
suite.addTestSuite(GridVersionSelfTest.class);
suite.addTestSuite(GridListenActorSelfTest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMarshallerSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMarshallerSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMarshallerSelfTestSuite.java
index 10afe10..40c32a2 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMarshallerSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMarshallerSelfTestSuite.java
@@ -21,6 +21,9 @@ import junit.framework.*;
import org.apache.ignite.internal.util.io.*;
import org.apache.ignite.marshaller.jdk.*;
import org.apache.ignite.marshaller.optimized.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.*;
/**
* Test suite for all marshallers.
@@ -31,16 +34,25 @@ public class IgniteMarshallerSelfTestSuite extends TestSuite {
* @throws Exception If failed.
*/
public static TestSuite suite() throws Exception {
+ return suite(null);
+ }
+
+ /**
+ * @param ignoredTests
+ * @return Test suite.
+ * @throws Exception Thrown in case of the failure.
+ */
+ public static TestSuite suite(Set<Class> ignoredTests) throws Exception {
TestSuite suite = new TestSuite("Ignite Marshaller Test Suite");
- suite.addTest(new TestSuite(GridJdkMarshallerSelfTest.class));
- suite.addTest(new TestSuite(OptimizedMarshallerEnumSelfTest.class));
- suite.addTest(new TestSuite(OptimizedMarshallerSelfTest.class));
- suite.addTest(new TestSuite(OptimizedMarshallerTest.class));
- suite.addTest(new TestSuite(OptimizedObjectStreamSelfTest.class));
- suite.addTest(new TestSuite(GridUnsafeDataOutputArraySizingSelfTest.class));
- suite.addTest(new TestSuite(OptimizedMarshallerNodeFailoverTest.class));
- suite.addTest(new TestSuite(OptimizedMarshallerSerialPersistentFieldsSelfTest.class));
+ GridTestUtils.addTestIfNeeded(suite, GridJdkMarshallerSelfTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, OptimizedMarshallerEnumSelfTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, OptimizedMarshallerSelfTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, OptimizedMarshallerTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, OptimizedObjectStreamSelfTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, GridUnsafeDataOutputArraySizingSelfTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, OptimizedMarshallerNodeFailoverTest.class, ignoredTests);
+ GridTestUtils.addTestIfNeeded(suite, OptimizedMarshallerSerialPersistentFieldsSelfTest.class, ignoredTests);
return suite;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
index 1c75a7f..64ff6ee 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
@@ -26,10 +26,13 @@ import org.apache.ignite.internal.util.offheap.unsafe.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.spi.discovery.*;
+import org.apache.ignite.testframework.*;
import org.apache.ignite.thread.*;
import org.apache.ignite.util.*;
import org.apache.ignite.util.mbeans.*;
+import java.util.*;
+
/**
* Test suite for Ignite utility classes.
*/
@@ -39,10 +42,19 @@ public class IgniteUtilSelfTestSuite extends TestSuite {
* @throws Exception If failed.
*/
public static TestSuite suite() throws Exception {
+ return suite(null);
+ }
+
+ /**
+ * @param ignoredTests Tests don't include in the execution.
+ * @return Test suite.
+ * @throws Exception Thrown in case of the failure.
+ */
+ public static TestSuite suite(Set<Class> ignoredTests) throws Exception {
TestSuite suite = new TestSuite("Ignite Util Test Suite");
suite.addTestSuite(GridThreadPoolExecutorServiceSelfTest.class);
- suite.addTestSuite(IgniteUtilsSelfTest.class);
+ GridTestUtils.addTestIfNeeded(suite, IgniteUtilsSelfTest.class, ignoredTests);
suite.addTestSuite(GridSpinReadWriteLockSelfTest.class);
suite.addTestSuite(GridQueueSelfTest.class);
suite.addTestSuite(GridStringBuilderFactorySelfTest.class);
@@ -64,9 +76,9 @@ public class IgniteUtilSelfTestSuite extends TestSuite {
// NIO.
suite.addTestSuite(GridNioSessionMetaKeySelfTest.class);
- suite.addTestSuite(GridNioSelfTest.class);
+ GridTestUtils.addTestIfNeeded(suite, GridNioSelfTest.class, ignoredTests);
suite.addTestSuite(GridNioFilterChainSelfTest.class);
- suite.addTestSuite(GridNioSslSelfTest.class);
+ GridTestUtils.addTestIfNeeded(suite, GridNioSslSelfTest.class, ignoredTests);
suite.addTestSuite(GridNioDelimitedBufferSelfTest.class);
return suite;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath1.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath1.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath1.java
index c997358..2ae54aa 100644
--- a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath1.java
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath1.java
@@ -64,11 +64,11 @@ public class P2PTestTaskExternalPath1 extends ComputeTaskAdapter<Object, Integer
sleep = false;
}
- Map<TestJob, ClusterNode> jobs = U.newHashMap(subgrid.size());
+ Map<TestJob1, ClusterNode> jobs = U.newHashMap(subgrid.size());
for (ClusterNode node : subgrid) {
if (nodeIds.contains(node.id()))
- jobs.put(new TestJob(node.id(), sleep), node);
+ jobs.put(new TestJob1(node.id(), sleep), node);
}
if (!jobs.isEmpty())
@@ -88,7 +88,7 @@ public class P2PTestTaskExternalPath1 extends ComputeTaskAdapter<Object, Integer
* Simple job class
*/
@SuppressWarnings({"PublicInnerClass"})
- public static class TestJob extends ComputeJobAdapter {
+ public static class TestJob1 extends ComputeJobAdapter {
/** Task session. */
@TaskSessionResource
private ComputeTaskSession ses;
@@ -107,7 +107,7 @@ public class P2PTestTaskExternalPath1 extends ComputeTaskAdapter<Object, Integer
/**
*
*/
- public TestJob() {
+ public TestJob1() {
// No-op.
}
@@ -115,7 +115,7 @@ public class P2PTestTaskExternalPath1 extends ComputeTaskAdapter<Object, Integer
* @param nodeId Node ID for node this job is supposed to execute on.
* @param sleep Sleep flag.
*/
- public TestJob(UUID nodeId, boolean sleep) {
+ public TestJob1(UUID nodeId, boolean sleep) {
super(nodeId);
this.sleep = sleep;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath2.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath2.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath2.java
index 6c7565b..01f3991 100644
--- a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath2.java
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath2.java
@@ -64,11 +64,11 @@ public class P2PTestTaskExternalPath2 extends ComputeTaskAdapter<Object, Integer
sleep = false;
}
- Map<TestJob, ClusterNode> jobs = U.newHashMap(subgrid.size());
+ Map<TestJob2, ClusterNode> jobs = U.newHashMap(subgrid.size());
for (ClusterNode node : subgrid) {
if (nodeIds.contains(node.id()))
- jobs.put(new TestJob(node.id(), sleep), node);
+ jobs.put(new TestJob2(node.id(), sleep), node);
}
if (!jobs.isEmpty())
@@ -88,7 +88,7 @@ public class P2PTestTaskExternalPath2 extends ComputeTaskAdapter<Object, Integer
* Simple job class
*/
@SuppressWarnings("PublicInnerClass")
- public static class TestJob extends ComputeJobAdapter {
+ public static class TestJob2 extends ComputeJobAdapter {
/** Ignite instance. */
@IgniteInstanceResource
private Ignite ignite;
@@ -108,7 +108,7 @@ public class P2PTestTaskExternalPath2 extends ComputeTaskAdapter<Object, Integer
* @param nodeId Node ID for node this job is supposed to execute on.
* @param sleep Sleep flag.
*/
- public TestJob(UUID nodeId, boolean sleep) {
+ public TestJob2(UUID nodeId, boolean sleep) {
super(nodeId);
this.sleep = sleep;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 7aab5e8..e2175f6 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -93,4 +93,20 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
index 40c40a5..29220f3 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
@@ -58,8 +58,6 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest {
c.setDiscoverySpi(disco);
- c.setMarshaller(new OptimizedMarshaller(false));
-
c.setCacheConfiguration(createCache("replicated", CacheMode.REPLICATED),
createCache("partitioned", CacheMode.PARTITIONED));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
index 2d6855e..c29027c 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
@@ -98,7 +98,6 @@ public class GridCacheOffHeapSelfTest extends GridCommonAbstractTest {
cfg.setCacheConfiguration(cacheCfg);
- cfg.setMarshaller(new OptimizedMarshaller(false));
cfg.setDeploymentMode(SHARED);
if (excluded)
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java
index 7d06fe6..c3290a6 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReduceQueryMultithreadedSelfTest.java
@@ -21,7 +21,6 @@ import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.query.*;
import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.marshaller.optimized.*;
import java.util.*;
import java.util.concurrent.*;
@@ -51,15 +50,6 @@ public class GridCacheReduceQueryMultithreadedSelfTest extends GridCacheAbstract
}
/** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration c = super.getConfiguration(gridName);
-
- c.setMarshaller(new OptimizedMarshaller(false));
-
- return c;
- }
-
- /** {@inheritDoc} */
@Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
CacheConfiguration cfg = super.cacheConfiguration(gridName);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapSelfTest.java
index b859ba9..4555c6b 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapSelfTest.java
@@ -26,7 +26,6 @@ import org.apache.ignite.events.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -99,8 +98,6 @@ public class GridCacheSwapSelfTest extends GridCommonAbstractTest {
cfg.setPeerClassLoadingLocalClassPathExclude(GridCacheSwapSelfTest.class.getName(),
CacheValue.class.getName());
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
return cfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
index 3159589..ccb3115 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
@@ -29,7 +29,6 @@ import org.apache.ignite.internal.processors.datastructures.*;
import org.apache.ignite.internal.processors.query.*;
import org.apache.ignite.internal.processors.query.h2.sql.*;
import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -74,8 +73,6 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
cfg.setPeerClassLoadingEnabled(false);
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
if (hasCache)
cfg.setCacheConfiguration(cache(null, true), cache(CACHE, true), cache(EMPTY_CACHE, true),
cache(CACHE_NO_PRIMITIVES, false), cache(CACHE_COMPLEX_KEYS, false));
@@ -217,11 +214,11 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
assert metas != null;
- assertEquals("Invalid meta: " + metas, 5, metas.size());
-
boolean wasNull = false;
boolean wasNamed = false;
boolean wasEmpty = false;
+ boolean wasNoPrimitives = false;
+ boolean wasComplexKeys = false;
for (GridCacheSqlMetadata meta : metas) {
if (meta.cacheName() == null) {
@@ -288,11 +285,17 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
wasEmpty = true;
}
+ else if (CACHE_NO_PRIMITIVES.equals(meta.cacheName()))
+ wasNoPrimitives = true;
+ else if (CACHE_COMPLEX_KEYS.equals(meta.cacheName()))
+ wasComplexKeys = true;
}
assert wasNull;
assert wasNamed;
assert wasEmpty;
+ assert wasNoPrimitives;
+ assert wasComplexKeys;
}
finally {
((IgniteKernal)grid(0)).getCache(null).remove(new GridCacheInternalKeyImpl("LONG"));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
index 0d45711..f0ee81f 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
@@ -108,8 +108,6 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
// Otherwise noop swap space will be chosen on Windows.
c.setSwapSpaceSpi(new FileSwapSpaceSpi());
- c.setMarshaller(new OptimizedMarshaller(false));
-
if (!gridName.startsWith("client")) {
CacheConfiguration[] ccs = new CacheConfiguration[2];
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePartitionedQueryMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePartitionedQueryMultiThreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePartitionedQueryMultiThreadedSelfTest.java
index c0e1b21..024163e 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePartitionedQueryMultiThreadedSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePartitionedQueryMultiThreadedSelfTest.java
@@ -78,7 +78,7 @@ public class IgniteCachePartitionedQueryMultiThreadedSelfTest extends GridCommon
cc.setRebalanceMode(CacheRebalanceMode.SYNC);
cc.setAtomicityMode(TRANSACTIONAL);
cc.setIndexedTypes(
- UUID.class, Person.class
+ UUID.class, PersonObj.class
);
c.setCacheConfiguration(cc);
@@ -126,12 +126,12 @@ public class IgniteCachePartitionedQueryMultiThreadedSelfTest extends GridCommon
long duration = 10 * 1000;
final int logMod = 100;
- final Person p1 = new Person("Jon", 1500, "Master");
- final Person p2 = new Person("Jane", 2000, "Master");
- final Person p3 = new Person("Mike", 1800, "Bachelor");
- final Person p4 = new Person("Bob", 1900, "Bachelor");
+ final PersonObj p1 = new PersonObj("Jon", 1500, "Master");
+ final PersonObj p2 = new PersonObj("Jane", 2000, "Master");
+ final PersonObj p3 = new PersonObj("Mike", 1800, "Bachelor");
+ final PersonObj p4 = new PersonObj("Bob", 1900, "Bachelor");
- final IgniteCache<UUID, Person> cache0 = grid(0).cache(null);
+ final IgniteCache<UUID, PersonObj> cache0 = grid(0).cache(null);
cache0.put(p1.id(), p1);
cache0.put(p2.id(), p2);
@@ -150,10 +150,10 @@ public class IgniteCachePartitionedQueryMultiThreadedSelfTest extends GridCommon
IgniteInternalFuture<?> futLucene = GridTestUtils.runMultiThreadedAsync(new CAX() {
@Override public void applyx() throws IgniteCheckedException {
while (!done.get()) {
- QueryCursor<Cache.Entry<UUID, Person>> master =
- cache0.query(new TextQuery(Person.class, "Master"));
+ QueryCursor<Cache.Entry<UUID, PersonObj>> master =
+ cache0.query(new TextQuery(PersonObj.class, "Master"));
- Collection<Cache.Entry<UUID, Person>> entries = master.getAll();
+ Collection<Cache.Entry<UUID, PersonObj>> entries = master.getAll();
checkResult(entries, p1, p2);
@@ -171,10 +171,10 @@ public class IgniteCachePartitionedQueryMultiThreadedSelfTest extends GridCommon
IgniteInternalFuture<?> futSql = GridTestUtils.runMultiThreadedAsync(new CAX() {
@Override public void applyx() throws IgniteCheckedException {
while (!done.get()) {
- QueryCursor<Cache.Entry<UUID, Person>> bachelors =
- cache0.query(new SqlQuery(Person.class, "degree = 'Bachelor'"));
+ QueryCursor<Cache.Entry<UUID, PersonObj>> bachelors =
+ cache0.query(new SqlQuery(PersonObj.class, "degree = 'Bachelor'"));
- Collection<Cache.Entry<UUID, Person>> entries = bachelors.getAll();
+ Collection<Cache.Entry<UUID, PersonObj>> entries = bachelors.getAll();
checkResult(entries, p3, p4);
@@ -198,8 +198,8 @@ public class IgniteCachePartitionedQueryMultiThreadedSelfTest extends GridCommon
* @param entries Queried result.
* @param persons Persons that should be in the result.
*/
- private void checkResult(Iterable<Cache.Entry<UUID, Person>> entries, Person... persons) {
- for (Cache.Entry<UUID, Person> entry : entries) {
+ private void checkResult(Iterable<Cache.Entry<UUID, PersonObj>> entries, PersonObj... persons) {
+ for (Cache.Entry<UUID, PersonObj> entry : entries) {
assertEquals(entry.getKey(), entry.getValue().id());
assert F.asList(persons).contains(entry.getValue());
@@ -207,7 +207,7 @@ public class IgniteCachePartitionedQueryMultiThreadedSelfTest extends GridCommon
}
/** Test class. */
- private static class Person implements Externalizable {
+ private static class PersonObj implements Externalizable {
/** */
@GridToStringExclude
private UUID id = UUID.randomUUID();
@@ -226,7 +226,7 @@ public class IgniteCachePartitionedQueryMultiThreadedSelfTest extends GridCommon
private String degree;
/** Required by {@link Externalizable}. */
- public Person() {
+ public PersonObj() {
// No-op.
}
@@ -235,7 +235,7 @@ public class IgniteCachePartitionedQueryMultiThreadedSelfTest extends GridCommon
* @param salary Salary.
* @param degree Degree.
*/
- Person(String name, int salary, String degree) {
+ PersonObj(String name, int salary, String degree) {
assert name != null;
assert salary > 0;
assert degree != null;
@@ -291,17 +291,17 @@ public class IgniteCachePartitionedQueryMultiThreadedSelfTest extends GridCommon
if (obj == this)
return true;
- if (!(obj instanceof Person))
+ if (!(obj instanceof PersonObj))
return false;
- Person that = (Person)obj;
+ PersonObj that = (PersonObj)obj;
return that.id.equals(id) && that.name.equals(name) && that.salary == salary && that.degree.equals(degree);
}
/** {@inheritDoc} */
@Override public String toString() {
- return S.toString(Person.class, this);
+ return S.toString(PersonObj.class, this);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
index 1d6bbc8..9fcd947 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
@@ -84,7 +84,6 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
cfg.setDiscoverySpi(disco);
cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());
- cfg.setMarshaller(new OptimizedMarshaller(false));
cfg.setCacheConfiguration(cacheConfiguration());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
index 34e86ff..8ab2485 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
@@ -62,7 +62,6 @@ public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCom
cfg.setCacheConfiguration();
cfg.setDiscoverySpi(discovery());
- cfg.setMarshaller(new OptimizedMarshaller(false));
return cfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
index e8b3c61..c4d2481 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
@@ -25,7 +25,6 @@ import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.query.*;
import org.apache.ignite.internal.processors.query.h2.*;
import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -62,8 +61,6 @@ public class GridQueryParsingTest extends GridCommonAbstractTest {
c.setDiscoverySpi(disco);
- c.setMarshaller(new OptimizedMarshaller(true));
-
// Cache.
CacheConfiguration cc = defaultCacheConfiguration();
@@ -92,7 +89,7 @@ public class GridQueryParsingTest extends GridCommonAbstractTest {
}
/**
- *
+ * @throws Exception If failed.
*/
public void testAllExamples() throws Exception {
checkQuery("select ? limit ? offset ?");
[20/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: merge
from ignite-471-2
Posted by se...@apache.org.
ignite-sprint-6: merge from ignite-471-2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/37c56f69
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/37c56f69
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/37c56f69
Branch: refs/heads/ignite-484-1
Commit: 37c56f69749e994090e1df192b12617e795699f5
Parents: 8020594
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu Jun 11 15:48:14 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu Jun 11 15:48:14 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/GridPluginContext.java | 6 ++
.../internal/MarshallerContextAdapter.java | 30 ++++++-
.../ignite/internal/MarshallerContextImpl.java | 10 +--
.../internal/interop/InteropIgnition.java | 2 +
.../processors/cache/GridCacheMessage.java | 51 -----------
.../processors/cache/GridCacheProcessor.java | 10 +--
.../cacheobject/IgniteCacheObjectProcessor.java | 9 +-
.../IgniteCacheObjectProcessorImpl.java | 12 ++-
.../datastreamer/DataStreamerImpl.java | 8 +-
.../portable/GridPortableInputStream.java | 10 +++
.../processors/query/GridQueryProcessor.java | 2 +-
.../ignite/internal/util/IgniteUtils.java | 3 +
.../internal/visor/VisorMultiNodeTask.java | 2 +-
.../ignite/marshaller/MarshallerContext.java | 8 ++
.../org/apache/ignite/plugin/PluginContext.java | 6 ++
modules/core/src/test/config/tests.properties | 2 +-
.../internal/GridDiscoveryEventSelfTest.java | 6 +-
...ridFailFastNodeFailureDetectionSelfTest.java | 2 +
.../GridFailoverTaskWithPredicateSelfTest.java | 3 -
.../GridJobMasterLeaveAwareSelfTest.java | 2 -
.../internal/GridJobStealingSelfTest.java | 3 -
...ectionLocalJobMultipleArgumentsSelfTest.java | 2 -
.../GridTaskExecutionContextSelfTest.java | 9 --
.../IgniteComputeEmptyClusterGroupTest.java | 3 -
.../IgniteComputeTopologyExceptionTest.java | 9 --
.../GridDiscoveryManagerAliveCacheSelfTest.java | 5 ++
.../cache/GridCacheAbstractSelfTest.java | 3 -
.../cache/GridCacheAffinityRoutingSelfTest.java | 4 +-
.../cache/GridCacheDeploymentSelfTest.java | 3 -
.../cache/GridCacheEntryMemorySizeSelfTest.java | 91 +++++++++++---------
.../cache/GridCacheMemoryModeSelfTest.java | 2 -
.../GridCacheReferenceCleanupSelfTest.java | 3 -
.../cache/IgniteCacheAbstractTest.java | 3 -
.../IgniteCacheEntryListenerAbstractTest.java | 14 +--
...cheAtomicReferenceMultiNodeAbstractTest.java | 11 ---
...GridCacheQueueMultiNodeAbstractSelfTest.java | 2 -
...CacheQueueRotativeMultiNodeAbstractTest.java | 10 ---
.../GridCacheSetAbstractSelfTest.java | 9 --
.../GridCacheAbstractJobExecutionTest.java | 3 -
.../GridCachePreloadLifecycleAbstractTest.java | 2 -
...heAbstractTransformWriteThroughSelfTest.java | 3 -
.../near/GridCacheNearEvictionSelfTest.java | 3 -
...idCachePartitionedHitsAndMissesSelfTest.java | 3 -
.../GridCacheSwapScanQueryAbstractSelfTest.java | 3 -
...ridCacheContinuousQueryAbstractSelfTest.java | 2 -
.../closure/GridClosureProcessorSelfTest.java | 29 +++----
.../continuous/GridEventConsumeSelfTest.java | 2 -
.../DataStreamProcessorSelfTest.java | 44 ++++++----
.../internal/util/nio/GridNioSelfTest.java | 13 ++-
.../internal/util/nio/GridNioSslSelfTest.java | 2 +
.../tostring/GridToStringBuilderSelfTest.java | 4 +-
.../marshaller/MarshallerContextTestImpl.java | 11 ++-
.../ignite/messaging/GridMessagingSelfTest.java | 3 -
.../GridP2PContinuousDeploymentSelfTest.java | 2 +
.../p2p/GridP2PLocalDeploymentSelfTest.java | 6 +-
.../p2p/GridP2PRemoteClassLoadersSelfTest.java | 31 +++----
.../spi/GridTcpSpiForwardingSelfTest.java | 3 -
.../ignite/testframework/GridTestUtils.java | 14 +++
.../config/GridTestProperties.java | 14 ++-
.../junits/IgniteTestResources.java | 16 ++--
.../ignite/testsuites/IgniteBasicTestSuite.java | 29 +++++--
.../IgniteCacheFailoverTestSuite.java | 14 ++-
...niteCacheP2pUnmarshallingErrorTestSuite.java | 20 ++++-
.../ignite/testsuites/IgniteCacheTestSuite.java | 28 ++++--
.../testsuites/IgniteKernalSelfTestSuite.java | 14 ++-
.../IgniteMarshallerSelfTestSuite.java | 28 ++++--
.../testsuites/IgniteUtilSelfTestSuite.java | 18 +++-
.../tests/p2p/P2PTestTaskExternalPath1.java | 10 +--
.../tests/p2p/P2PTestTaskExternalPath2.java | 8 +-
modules/indexing/pom.xml | 16 ++++
.../cache/GridCacheCrossCacheQuerySelfTest.java | 2 -
.../cache/GridCacheOffHeapSelfTest.java | 1 -
...idCacheReduceQueryMultithreadedSelfTest.java | 10 ---
.../processors/cache/GridCacheSwapSelfTest.java | 3 -
.../IgniteCacheAbstractFieldsQuerySelfTest.java | 13 +--
.../cache/IgniteCacheAbstractQuerySelfTest.java | 2 -
...hePartitionedQueryMultiThreadedSelfTest.java | 40 ++++-----
.../IgniteCacheQueryMultiThreadedSelfTest.java | 1 -
...dCacheAbstractReduceFieldsQuerySelfTest.java | 1 -
.../query/h2/sql/GridQueryParsingTest.java | 5 +-
80 files changed, 452 insertions(+), 394 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/internal/GridPluginContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridPluginContext.java b/modules/core/src/main/java/org/apache/ignite/internal/GridPluginContext.java
index af03670..7abe05b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridPluginContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridPluginContext.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal;
import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
+import org.apache.ignite.marshaller.*;
import org.apache.ignite.plugin.*;
import org.apache.ignite.spi.*;
@@ -55,6 +56,11 @@ public class GridPluginContext implements PluginContext {
}
/** {@inheritDoc} */
+ @Override public MarshallerContext marshallerContext() {
+ return ctx.marshallerContext();
+ }
+
+ /** {@inheritDoc} */
@Override public Collection<ClusterNode> nodes() {
return ctx.discovery().allNodes();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java
index 21f2264..2ec9825 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java
@@ -41,6 +41,9 @@ public abstract class MarshallerContextAdapter implements MarshallerContext {
/** */
private final ConcurrentMap<Integer, String> map = new ConcurrentHashMap8<>();
+ /** */
+ private final Set<String> registeredSystemTypes = new HashSet<>();
+
/**
* Initializes context.
*/
@@ -107,7 +110,17 @@ public abstract class MarshallerContextAdapter implements MarshallerContext {
String clsName = line.trim();
- map.put(clsName.hashCode(), clsName);
+ int typeId = clsName.hashCode();
+
+ String oldClsName;
+
+ if ((oldClsName = map.put(typeId, clsName)) != null) {
+ if (!oldClsName.equals(clsName))
+ throw new IgniteException("Duplicate type ID [id=" + typeId + ", clsName=" + clsName +
+ ", oldClsName=" + oldClsName + ']');
+ }
+
+ registeredSystemTypes.add(clsName);
}
}
}
@@ -116,12 +129,17 @@ public abstract class MarshallerContextAdapter implements MarshallerContext {
@Override public boolean registerClass(int id, Class cls) throws IgniteCheckedException {
boolean registered = true;
- if (!map.containsKey(id)) {
+ String clsName = map.get(id);
+
+ if (clsName == null) {
registered = registerClassName(id, cls.getName());
if (registered)
map.putIfAbsent(id, cls.getName());
}
+ else if (!clsName.equals(cls.getName()))
+ throw new IgniteCheckedException("Duplicate ID [id=" + id + ", oldCls=" + clsName +
+ ", newCls=" + cls.getName());
return registered;
}
@@ -133,7 +151,8 @@ public abstract class MarshallerContextAdapter implements MarshallerContext {
if (clsName == null) {
clsName = className(id);
- assert clsName != null : id;
+ if (clsName == null)
+ throw new ClassNotFoundException("Unknown type ID: " + id);
String old = map.putIfAbsent(id, clsName);
@@ -144,6 +163,11 @@ public abstract class MarshallerContextAdapter implements MarshallerContext {
return U.forName(clsName, ldr);
}
+ /** {@inheritDoc} */
+ @Override public boolean isSystemType(String typeName) {
+ return registeredSystemTypes.contains(typeName);
+ }
+
/**
* Registers class name.
*
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
index e614408..4b0251d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
@@ -90,13 +90,9 @@ public class MarshallerContextImpl extends MarshallerContextAdapter {
try {
old = cache0.tryPutIfAbsent(id, clsName);
- if (old != null && !old.equals(clsName)) {
- U.quietAndWarn(log, "Type ID collision detected, may affect performance " +
- "(set idMapper property on marshaller to fix) [id=" + id + ", clsName1=" + clsName +
- "clsName2=" + old + ']');
-
- return false;
- }
+ if (old != null && !old.equals(clsName))
+ throw new IgniteCheckedException("Type ID collision detected [id=" + id + ", clsName1=" + clsName +
+ ", clsName2=" + old + ']');
failedCnt = 0;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
index d8cc276..96639cd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
@@ -53,6 +53,8 @@ public class InteropIgnition {
if (gridName != null)
cfg.setGridName(gridName);
+ else
+ gridName = cfg.getGridName();
InteropBootstrap bootstrap = bootstrap(factoryId);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
index 5432c90..8ebce35 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
@@ -566,57 +566,6 @@ public abstract class GridCacheMessage implements Message {
return col;
}
- /**
- * @param map Map to marshal.
- * @param ctx Context.
- * @return Marshalled map.
- * @throws IgniteCheckedException If failed.
- */
- @SuppressWarnings("TypeMayBeWeakened") // Don't weaken type to clearly see that it's linked hash map.
- @Nullable protected final LinkedHashMap<byte[], Boolean> marshalBooleanLinkedMap(
- @Nullable LinkedHashMap<?, Boolean> map, GridCacheSharedContext ctx) throws IgniteCheckedException {
- assert ctx != null;
-
- if (map == null)
- return null;
-
- LinkedHashMap<byte[], Boolean> byteMap = U.newLinkedHashMap(map.size());
-
- for (Map.Entry<?, Boolean> e : map.entrySet()) {
- if (ctx.deploymentEnabled())
- prepareObject(e.getKey(), ctx);
-
- byteMap.put(CU.marshal(ctx, e.getKey()), e.getValue());
- }
-
- return byteMap;
- }
-
- /**
- * @param byteMap Map to unmarshal.
- * @param ctx Context.
- * @param ldr Loader.
- * @return Unmarshalled map.
- * @throws IgniteCheckedException If failed.
- */
- @Nullable protected final <K1> LinkedHashMap<K1, Boolean> unmarshalBooleanLinkedMap(
- @Nullable Map<byte[], Boolean> byteMap, GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException {
- assert ldr != null;
- assert ctx != null;
-
- if (byteMap == null)
- return null;
-
- LinkedHashMap<K1, Boolean> map = U.newLinkedHashMap(byteMap.size());
-
- Marshaller marsh = ctx.marshaller();
-
- for (Map.Entry<byte[], Boolean> e : byteMap.entrySet())
- map.put(marsh.<K1>unmarshal(e.getKey(), ldr), e.getValue());
-
- return map;
- }
-
/** {@inheritDoc} */
@Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
writer.setBuffer(buf);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 5582ba7..9b16388 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -265,7 +265,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
// Suppress warning if at least one ATOMIC cache found.
perf.add("Enable ATOMIC mode if not using transactions (set 'atomicityMode' to ATOMIC)",
- cfg.getAtomicityMode() == ATOMIC);
+ cfg.getAtomicityMode() == ATOMIC);
// Suppress warning if at least one non-FULL_SYNC mode found.
perf.add("Disable fully synchronous writes (set 'writeSynchronizationMode' to PRIMARY_SYNC or FULL_ASYNC)",
@@ -784,8 +784,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
for (GridCacheAdapter<?, ?> cache : caches.values())
onKernalStart(cache);
- boolean utilityCacheStarted = false;
-
// Wait for caches in SYNC preload mode.
for (CacheConfiguration cfg : ctx.config().getCacheConfiguration()) {
GridCacheAdapter cache = caches.get(maskNull(cfg.getName()));
@@ -796,11 +794,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
(cfg.getCacheMode() == PARTITIONED && cfg.getRebalanceDelay() >= 0)) {
cache.preloader().syncFuture().get();
- if (CU.isUtilityCache(cache.name())) {
+ if (CU.isUtilityCache(cache.name()))
ctx.cacheObjects().onUtilityCacheStarted();
-
- utilityCacheStarted = true;
- }
}
}
}
@@ -808,7 +803,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
assert caches.containsKey(CU.MARSH_CACHE_NAME) : "Marshaller cache should be started";
assert caches.containsKey(CU.UTILITY_CACHE_NAME) : "Utility cache should be started";
- assert utilityCacheStarted;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
index f8e5a60..dc0d1e5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
@@ -76,10 +76,9 @@ public interface IgniteCacheObjectProcessor extends GridProcessor {
/**
* Checks whether given class is portable.
*
- * @param cls Class.
- * @return {@code true} If the class was registered as portable.
+ * @return {@code true} If portable objects are enabled.
*/
- public boolean isPortableClass(Class<?> cls);
+ public boolean isPortableEnabled();
/**
* @param obj Portable object to get field from.
@@ -115,9 +114,11 @@ public interface IgniteCacheObjectProcessor extends GridProcessor {
public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr) throws IgniteCheckedException;
/**
+ * @param ccfg Cache configuration.
* @return Cache object context.
+ * @throws IgniteCheckedException If failed.
*/
- public CacheObjectContext contextForCache(CacheConfiguration ccfg);
+ public CacheObjectContext contextForCache(CacheConfiguration ccfg) throws IgniteCheckedException;
/**
* @param ctx Cache context.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
index 45fc121..3e59b10 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
@@ -185,7 +185,7 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
}
/** {@inheritDoc} */
- @Override public CacheObjectContext contextForCache(CacheConfiguration ccfg) {
+ @Override public CacheObjectContext contextForCache(CacheConfiguration ccfg) throws IgniteCheckedException {
assert ccfg != null;
CacheMemoryMode memMode = ccfg.getMemoryMode();
@@ -194,10 +194,14 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
GridQueryProcessor.isEnabled(ccfg) ||
!ccfg.isCopyOnRead();
- return new CacheObjectContext(ctx,
+ CacheObjectContext res = new CacheObjectContext(ctx,
ccfg.getAffinityMapper() != null ? ccfg.getAffinityMapper() : new GridCacheDefaultAffinityKeyMapper(),
- ccfg.isCopyOnRead() && memMode == ONHEAP_TIERED,
+ ccfg.isCopyOnRead() && memMode != OFFHEAP_VALUES,
storeVal);
+
+ ctx.resource().injectGeneric(res.defaultAffMapper());
+
+ return res;
}
/** {@inheritDoc} */
@@ -229,7 +233,7 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
}
/** {@inheritDoc} */
- @Override public boolean isPortableClass(Class<?> cls) {
+ @Override public boolean isPortableEnabled() {
return false;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
index ed8e573..26b0568 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
@@ -183,7 +183,13 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
CacheConfiguration ccfg = ctx.cache().cacheConfiguration(cacheName);
- this.cacheObjCtx = ctx.cacheObjects().contextForCache(ccfg);
+ try {
+ this.cacheObjCtx = ctx.cacheObjects().contextForCache(ccfg);
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException("Failed to initialize cache context.", e);
+ }
+
this.cacheName = cacheName;
this.flushQ = flushQ;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableInputStream.java
index f630d01..501517b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableInputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableInputStream.java
@@ -37,6 +37,16 @@ public interface GridPortableInputStream extends GridPortableStream {
public byte[] readByteArray(int cnt);
/**
+ * Reads {@code cnt} of bytes into byte array.
+ *
+ * @param arr Expected item count.
+ * @param off offset
+ * @param cnt number of bytes to read.
+ * @return actual length read.
+ */
+ public int read(byte[] arr, int off, int cnt);
+
+ /**
* Read boolean value.
*
* @return Boolean value.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index e187713..fed90d5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -135,7 +135,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
TypeId typeId;
- if (valCls == null || ctx.cacheObjects().isPortableClass(valCls)) {
+ if (valCls == null || ctx.cacheObjects().isPortableEnabled()) {
processPortableMeta(meta, desc);
typeId = new TypeId(ccfg.getName(), ctx.cacheObjects().typeId(meta.getValueType()));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 9016b10..a303abc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -7872,6 +7872,9 @@ public abstract class IgniteUtils {
if (cls != null)
return cls;
+ if (ldr == null)
+ ldr = gridClassLoader;
+
ConcurrentMap<String, Class> ldrMap = classCache.get(ldr);
if (ldrMap == null) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorMultiNodeTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorMultiNodeTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorMultiNodeTask.java
index 7295760..9eda849 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorMultiNodeTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorMultiNodeTask.java
@@ -39,7 +39,7 @@ import static org.apache.ignite.internal.visor.util.VisorTaskUtils.*;
public abstract class VisorMultiNodeTask<A, R, J> implements ComputeTask<VisorTaskArgument<A>, R> {
/** Auto-injected grid instance. */
@IgniteInstanceResource
- protected IgniteEx ignite;
+ protected transient IgniteEx ignite;
/** Debug flag. */
protected boolean debug;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerContext.java b/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerContext.java
index f0e248a..dc131e8 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerContext.java
@@ -43,4 +43,12 @@ public interface MarshallerContext {
* @throws IgniteCheckedException In case of any other error.
*/
public Class getClass(int id, ClassLoader ldr) throws ClassNotFoundException, IgniteCheckedException;
+
+ /**
+ * Checks whether the given type is a system one - JDK class or Ignite class.
+ *
+ * @param typeName Type name.
+ * @return {@code true} if the type is a system one, {@code false} otherwise.
+ */
+ public boolean isSystemType(String typeName);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/main/java/org/apache/ignite/plugin/PluginContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/PluginContext.java b/modules/core/src/main/java/org/apache/ignite/plugin/PluginContext.java
index 6a4f20b..b519bd1 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/PluginContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/PluginContext.java
@@ -20,6 +20,7 @@ package org.apache.ignite.plugin;
import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
+import org.apache.ignite.marshaller.*;
import org.apache.ignite.spi.*;
import org.apache.ignite.spi.discovery.DiscoverySpi;
@@ -40,6 +41,11 @@ public interface PluginContext {
public Ignite grid();
/**
+ * @return Marshaller context.
+ */
+ public MarshallerContext marshallerContext();
+
+ /**
* Gets a collection of all grid nodes. Remote nodes are discovered via underlying
* {@link DiscoverySpi} implementation used.
*
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/config/tests.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/tests.properties b/modules/core/src/test/config/tests.properties
index 781b0f1..a9c6b77 100644
--- a/modules/core/src/test/config/tests.properties
+++ b/modules/core/src/test/config/tests.properties
@@ -129,7 +129,7 @@ ssh.username=uname
ssh.password=passwd
# SSL tests keystore.
-ssl.keystore.path=modules/clients/src/test/keystore/server.jks
+ssl.keystore.path=@{IGNITE_HOME}/modules/clients/src/test/keystore/server.jks
ssl.keystore.password=123456
# Hadoop home directory.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/GridDiscoveryEventSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridDiscoveryEventSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridDiscoveryEventSelfTest.java
index d90bafe..3981b7f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridDiscoveryEventSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridDiscoveryEventSelfTest.java
@@ -100,7 +100,7 @@ public class GridDiscoveryEventSelfTest extends GridCommonAbstractTest {
@Override public boolean apply(Event evt) {
assert evt.type() == EVT_NODE_JOINED;
- evts.put(cnt.getAndIncrement(), ((DiscoveryEvent) evt).topologyNodes());
+ evts.put(cnt.getAndIncrement(), ((DiscoveryEvent)evt).topologyNodes());
latch.countDown();
@@ -147,6 +147,8 @@ public class GridDiscoveryEventSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testLeaveSequenceEvents() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-932");
+
try {
Ignite g0 = startGrid(0);
@@ -213,6 +215,8 @@ public class GridDiscoveryEventSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testMixedSequenceEvents() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-932");
+
try {
Ignite g0 = startGrid(0);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/GridFailFastNodeFailureDetectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridFailFastNodeFailureDetectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridFailFastNodeFailureDetectionSelfTest.java
index a116d54..992d7bf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridFailFastNodeFailureDetectionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridFailFastNodeFailureDetectionSelfTest.java
@@ -66,6 +66,8 @@ public class GridFailFastNodeFailureDetectionSelfTest extends GridCommonAbstract
* @throws Exception If failed.
*/
public void testFailFast() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-933");
+
startGridsMultiThreaded(5);
final CountDownLatch failLatch = new CountDownLatch(4);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverTaskWithPredicateSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverTaskWithPredicateSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverTaskWithPredicateSelfTest.java
index eb99ce1..d14ed0d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverTaskWithPredicateSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverTaskWithPredicateSelfTest.java
@@ -22,7 +22,6 @@ import org.apache.ignite.cluster.*;
import org.apache.ignite.compute.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.resources.*;
import org.apache.ignite.spi.failover.*;
import org.apache.ignite.spi.failover.always.*;
@@ -77,8 +76,6 @@ public class GridFailoverTaskWithPredicateSelfTest extends GridCommonAbstractTes
}
});
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
return cfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/GridJobMasterLeaveAwareSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridJobMasterLeaveAwareSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridJobMasterLeaveAwareSelfTest.java
index 3af9b56..55fc2f7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridJobMasterLeaveAwareSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridJobMasterLeaveAwareSelfTest.java
@@ -26,7 +26,6 @@ import org.apache.ignite.internal.managers.communication.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.plugin.extensions.communication.*;
import org.apache.ignite.resources.*;
import org.apache.ignite.spi.*;
@@ -90,7 +89,6 @@ public class GridJobMasterLeaveAwareSelfTest extends GridCommonAbstractTest {
cfg.setDiscoverySpi(discoSpi);
cfg.setCommunicationSpi(new CommunicationSpi());
- cfg.setMarshaller(new OptimizedMarshaller(false));
CacheConfiguration ccfg = defaultCacheConfiguration();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingSelfTest.java
index 0980010..ea04f35 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingSelfTest.java
@@ -23,7 +23,6 @@ import org.apache.ignite.compute.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.resources.*;
import org.apache.ignite.spi.collision.jobstealing.*;
import org.apache.ignite.spi.failover.jobstealing.*;
@@ -290,8 +289,6 @@ public class GridJobStealingSelfTest extends GridCommonAbstractTest {
cfg.setCollisionSpi(colSpi);
cfg.setFailoverSpi(failSpi);
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
return cfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/GridProjectionLocalJobMultipleArgumentsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridProjectionLocalJobMultipleArgumentsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridProjectionLocalJobMultipleArgumentsSelfTest.java
index 79fcdbc..3bdc9cf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridProjectionLocalJobMultipleArgumentsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridProjectionLocalJobMultipleArgumentsSelfTest.java
@@ -56,8 +56,6 @@ public class GridProjectionLocalJobMultipleArgumentsSelfTest extends GridCommonA
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
CacheConfiguration cache = defaultCacheConfiguration();
cache.setCacheMode(PARTITIONED);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/GridTaskExecutionContextSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskExecutionContextSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskExecutionContextSelfTest.java
index d16aa1f..3dcc8f8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskExecutionContextSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskExecutionContextSelfTest.java
@@ -40,15 +40,6 @@ public class GridTaskExecutionContextSelfTest extends GridCommonAbstractTest {
private static final AtomicInteger CNT = new AtomicInteger();
/** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(gridName);
-
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
- return cfg;
- }
-
- /** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
startGridsMultiThreaded(2);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/IgniteComputeEmptyClusterGroupTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteComputeEmptyClusterGroupTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteComputeEmptyClusterGroupTest.java
index 4061881..610bec7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteComputeEmptyClusterGroupTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteComputeEmptyClusterGroupTest.java
@@ -22,7 +22,6 @@ import org.apache.ignite.cluster.*;
import org.apache.ignite.compute.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -51,8 +50,6 @@ public class IgniteComputeEmptyClusterGroupTest extends GridCommonAbstractTest {
cfg.setDiscoverySpi(discoSpi);
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
CacheConfiguration ccfg = defaultCacheConfiguration();
ccfg.setCacheMode(PARTITIONED);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/IgniteComputeTopologyExceptionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteComputeTopologyExceptionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteComputeTopologyExceptionTest.java
index 2db8062..14882ff 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteComputeTopologyExceptionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteComputeTopologyExceptionTest.java
@@ -44,15 +44,6 @@ public class IgniteComputeTopologyExceptionTest extends GridCommonAbstractTest {
stopAllGrids();
}
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(gridName);
-
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
- return cfg;
- }
-
/**
* @throws Exception If failed.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
index f2afb07..ba61890 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
@@ -78,6 +78,11 @@ public class GridDiscoveryManagerAliveCacheSelfTest extends GridCommonAbstractTe
};
/** {@inheritDoc} */
+ @Override protected long getTestTimeout() {
+ return 10 * 60 * 1000; //10 minutes.
+ }
+
+ /** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
index eeb9f45..3f14f49 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
@@ -27,7 +27,6 @@ import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -204,8 +203,6 @@ public abstract class GridCacheAbstractSelfTest extends GridCommonAbstractTest {
cfg.setCacheConfiguration(cacheConfiguration(gridName));
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
return cfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
index 5efe270..78ecf08 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
@@ -89,8 +89,6 @@ public class GridCacheAffinityRoutingSelfTest extends GridCommonAbstractTest {
cfg.setCacheConfiguration();
}
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
return cfg;
}
@@ -171,7 +169,7 @@ public class GridCacheAffinityRoutingSelfTest extends GridCommonAbstractTest {
/**
* Test key.
*/
- private static class AffinityTestKey {
+ protected static class AffinityTestKey {
/** Affinity key. */
@AffinityKeyMapped
private final int affKey;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
index 9d4298d..f46a463 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
@@ -23,7 +23,6 @@ import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -87,8 +86,6 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
cfg.setConnectorConfiguration(null);
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
return cfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
index 625a429..981ba78 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
@@ -48,59 +48,28 @@ public class GridCacheEntryMemorySizeSelfTest extends GridCommonAbstractTest {
private static final int NULL_REF_SIZE = 1;
/** Entry overhead. */
- private static final int ENTRY_OVERHEAD;
+ private static int ENTRY_OVERHEAD;
/** Replicated entry overhead. */
- private static final int REPLICATED_ENTRY_OVERHEAD;
+ private static int REPLICATED_ENTRY_OVERHEAD;
/** DHT entry overhead. */
- private static final int DHT_ENTRY_OVERHEAD;
+ private static int DHT_ENTRY_OVERHEAD;
/** Near entry overhead. */
- private static final int NEAR_ENTRY_OVERHEAD;
+ private static int NEAR_ENTRY_OVERHEAD;
/** Reader size. */
- private static final int READER_SIZE = 24;
+ private static int READER_SIZE = 24;
/** Key size in bytes. */
- private static final int KEY_SIZE;
+ private static int KEY_SIZE;
/** 1KB value size in bytes. */
- private static final int ONE_KB_VAL_SIZE;
+ private static int ONE_KB_VAL_SIZE;
/** 2KB value size in bytes. */
- private static final int TWO_KB_VAL_SIZE;
-
- /**
- *
- */
- static {
- try {
- ENTRY_OVERHEAD = U.<Integer>staticField(GridCacheMapEntry.class, "SIZE_OVERHEAD");
- DHT_ENTRY_OVERHEAD = U.<Integer>staticField(GridDhtCacheEntry.class, "DHT_SIZE_OVERHEAD");
- NEAR_ENTRY_OVERHEAD = U.<Integer>staticField(GridNearCacheEntry.class, "NEAR_SIZE_OVERHEAD");
- REPLICATED_ENTRY_OVERHEAD = DHT_ENTRY_OVERHEAD;
-
- Marshaller marsh = new OptimizedMarshaller();
-
- marsh.setContext(new MarshallerContext() {
- @Override public boolean registerClass(int id, Class cls) {
- return true;
- }
-
- @Override public Class getClass(int id, ClassLoader ldr) {
- throw new UnsupportedOperationException();
- }
- });
-
- KEY_SIZE = marsh.marshal(1).length;
- ONE_KB_VAL_SIZE = marsh.marshal(new Value(new byte[1024])).length;
- TWO_KB_VAL_SIZE = marsh.marshal(new Value(new byte[2048])).length;
- }
- catch (IgniteCheckedException e) {
- throw new IgniteException(e);
- }
- }
+ private static int TWO_KB_VAL_SIZE;
/** Cache mode. */
private CacheMode mode;
@@ -133,6 +102,50 @@ public class GridCacheEntryMemorySizeSelfTest extends GridCommonAbstractTest {
return cfg;
}
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ try {
+ ENTRY_OVERHEAD = U.<Integer>staticField(GridCacheMapEntry.class, "SIZE_OVERHEAD");
+ DHT_ENTRY_OVERHEAD = U.<Integer>staticField(GridDhtCacheEntry.class, "DHT_SIZE_OVERHEAD");
+ NEAR_ENTRY_OVERHEAD = U.<Integer>staticField(GridNearCacheEntry.class, "NEAR_SIZE_OVERHEAD");
+ REPLICATED_ENTRY_OVERHEAD = DHT_ENTRY_OVERHEAD;
+
+ Marshaller marsh = createMarshaller();
+
+ KEY_SIZE = marsh.marshal(1).length;
+ ONE_KB_VAL_SIZE = marsh.marshal(new Value(new byte[1024])).length;
+ TWO_KB_VAL_SIZE = marsh.marshal(new Value(new byte[2048])).length;
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
+ }
+
+ /**
+ * Creates an instance of Marshaller that is used by caches during the test run.
+ *
+ * @return
+ */
+ protected Marshaller createMarshaller() throws IgniteCheckedException {
+ Marshaller marsh = new OptimizedMarshaller();
+
+ marsh.setContext(new MarshallerContext() {
+ @Override public boolean registerClass(int id, Class cls) {
+ return true;
+ }
+
+ @Override public Class getClass(int id, ClassLoader ldr) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override public boolean isSystemType(String typeName) {
+ return false;
+ }
+ });
+
+ return marsh;
+ }
+
/** @throws Exception If failed. */
public void testLocal() throws Exception {
mode = LOCAL;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMemoryModeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMemoryModeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMemoryModeSelfTest.java
index b4e523e..5629a96 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMemoryModeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMemoryModeSelfTest.java
@@ -22,7 +22,6 @@ import org.apache.ignite.cache.*;
import org.apache.ignite.cache.eviction.lru.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -77,7 +76,6 @@ public class GridCacheMemoryModeSelfTest extends GridCommonAbstractTest {
cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());
cfg.setCacheConfiguration(cacheConfiguration());
- cfg.setMarshaller(new OptimizedMarshaller(false));
return cfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
index 35de371..7133ba8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
@@ -22,7 +22,6 @@ import org.apache.ignite.cache.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -69,8 +68,6 @@ public class GridCacheReferenceCleanupSelfTest extends GridCommonAbstractTest {
cfg.setCacheConfiguration(cacheCfg);
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
return cfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java
index 1a62d4b..62a5b20 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java
@@ -22,7 +22,6 @@ import org.apache.ignite.cache.*;
import org.apache.ignite.cache.store.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -95,8 +94,6 @@ public abstract class IgniteCacheAbstractTest extends GridCommonAbstractTest {
cfg.setCacheConfiguration(cacheConfiguration(gridName));
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
return cfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java
index bb449e0..aa24eab 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryListenerAbstractTest.java
@@ -695,11 +695,11 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
if (i % 2 == 0)
cache.put(key, i + 1);
else
- cache.invoke(key, new SetValueProcessor(i + 1));
+ cache.invoke(key, new EntrySetValueProcessor(i + 1));
}
// Invoke processor does not update value, should not trigger event.
- assertEquals(String.valueOf(UPDATES), cache.invoke(key, new ToStringProcessor()));
+ assertEquals(String.valueOf(UPDATES), cache.invoke(key, new EntryToStringProcessor()));
assertFalse(cache.putIfAbsent(key, -1));
@@ -1122,7 +1122,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
/**
*
*/
- protected static class ToStringProcessor implements EntryProcessor<Integer, Integer, String> {
+ protected static class EntryToStringProcessor implements EntryProcessor<Integer, Integer, String> {
/** {@inheritDoc} */
@Override public String process(MutableEntry<Integer, Integer> e, Object... arguments)
throws EntryProcessorException {
@@ -1131,21 +1131,21 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
/** {@inheritDoc} */
@Override public String toString() {
- return S.toString(ToStringProcessor.class, this);
+ return S.toString(EntryToStringProcessor.class, this);
}
}
/**
*
*/
- protected static class SetValueProcessor implements EntryProcessor<Integer, Integer, String> {
+ protected static class EntrySetValueProcessor implements EntryProcessor<Integer, Integer, String> {
/** */
private Integer val;
/**
* @param val Value to set.
*/
- public SetValueProcessor(Integer val) {
+ public EntrySetValueProcessor(Integer val) {
this.val = val;
}
@@ -1159,7 +1159,7 @@ public abstract class IgniteCacheEntryListenerAbstractTest extends IgniteCacheAb
/** {@inheritDoc} */
@Override public String toString() {
- return S.toString(SetValueProcessor.class, this);
+ return S.toString(EntrySetValueProcessor.class, this);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAtomicReferenceMultiNodeAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAtomicReferenceMultiNodeAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAtomicReferenceMultiNodeAbstractTest.java
index 412ad62..88cd623 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAtomicReferenceMultiNodeAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAtomicReferenceMultiNodeAbstractTest.java
@@ -18,9 +18,7 @@
package org.apache.ignite.internal.processors.cache.datastructures;
import org.apache.ignite.*;
-import org.apache.ignite.configuration.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import java.util.*;
@@ -36,15 +34,6 @@ public abstract class GridCacheAtomicReferenceMultiNodeAbstractTest extends Igni
return GRID_CNT;
}
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(gridName);
-
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
- return cfg;
- }
-
/**
* JUnit.
*
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeAbstractSelfTest.java
index b39017e..33fe127 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeAbstractSelfTest.java
@@ -25,7 +25,6 @@ import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.resources.*;
import org.apache.ignite.testframework.*;
@@ -95,7 +94,6 @@ public abstract class GridCacheQueueMultiNodeAbstractSelfTest extends IgniteColl
cfg.setSystemThreadPoolSize(RETRIES * 2);
- cfg.setMarshaller(new OptimizedMarshaller(false));
cfg.setConnectorConfiguration(null);
return cfg;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueRotativeMultiNodeAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueRotativeMultiNodeAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueRotativeMultiNodeAbstractTest.java
index f45d860..3997ebc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueRotativeMultiNodeAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueRotativeMultiNodeAbstractTest.java
@@ -23,7 +23,6 @@ import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.resources.*;
import org.apache.ignite.testframework.*;
@@ -71,15 +70,6 @@ public abstract class GridCacheQueueRotativeMultiNodeAbstractTest extends Ignite
assert G.allGrids().isEmpty();
}
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(gridName);
-
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
- return cfg;
- }
-
/**
* JUnit.
*
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheSetAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheSetAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheSetAbstractSelfTest.java
index 22af54a..6383f91 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheSetAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheSetAbstractSelfTest.java
@@ -48,15 +48,6 @@ public abstract class GridCacheSetAbstractSelfTest extends IgniteCollectionAbstr
}
/** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(gridName);
-
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
- return cfg;
- }
-
- /** {@inheritDoc} */
@Override protected CollectionConfiguration collectionConfiguration() {
CollectionConfiguration colCfg = super.collectionConfiguration();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractJobExecutionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractJobExecutionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractJobExecutionTest.java
index 0db5e95..f8a15bc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractJobExecutionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractJobExecutionTest.java
@@ -23,7 +23,6 @@ import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.resources.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -60,8 +59,6 @@ public abstract class GridCacheAbstractJobExecutionTest extends GridCommonAbstra
cfg.setDiscoverySpi(disco);
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
return cfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePreloadLifecycleAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePreloadLifecycleAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePreloadLifecycleAbstractTest.java
index 9818176..e670a0a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePreloadLifecycleAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePreloadLifecycleAbstractTest.java
@@ -21,7 +21,6 @@ import org.apache.ignite.cache.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lifecycle.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -80,7 +79,6 @@ public abstract class GridCachePreloadLifecycleAbstractTest extends GridCommonAb
c.setDeploymentMode(DeploymentMode.SHARED);
c.setNetworkTimeout(10000);
c.setConnectorConfiguration(null);
- c.setMarshaller(new OptimizedMarshaller(false));
// c.setPeerClassLoadingLocalClassPathExclude(GridCachePreloadLifecycleAbstractTest.class.getName(),
// MyValue.class.getName());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
index 5c1d674..62003e3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractTransformWriteThroughSelfTest.java
@@ -21,7 +21,6 @@ import org.apache.ignite.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -99,8 +98,6 @@ public abstract class GridCacheAbstractTransformWriteThroughSelfTest extends Gri
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearEvictionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearEvictionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearEvictionSelfTest.java
index ec3a3e4..28ef0a3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearEvictionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearEvictionSelfTest.java
@@ -23,7 +23,6 @@ import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.resources.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -72,8 +71,6 @@ public class GridCacheNearEvictionSelfTest extends GridCommonAbstractTest {
c.setDiscoverySpi(disco);
- c.setMarshaller(new OptimizedMarshaller(false));
-
return c;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java
index f5eb189..6138022 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed.near;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.configuration.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -51,8 +50,6 @@ public class GridCachePartitionedHitsAndMissesSelfTest extends GridCommonAbstrac
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
// DiscoverySpi
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(IP_FINDER);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
index 6ccfbc2..8896840 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
@@ -22,7 +22,6 @@ import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -56,8 +55,6 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends GridCommonA
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
index 378d5a3..4681071 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
@@ -99,8 +99,6 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
cfg.setDiscoverySpi(disco);
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
return cfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/closure/GridClosureProcessorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/closure/GridClosureProcessorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/closure/GridClosureProcessorSelfTest.java
index 0b178ff..381db74 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/closure/GridClosureProcessorSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/closure/GridClosureProcessorSelfTest.java
@@ -23,7 +23,6 @@ import org.apache.ignite.compute.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.resources.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -58,8 +57,6 @@ public class GridClosureProcessorSelfTest extends GridCommonAbstractTest {
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(ipFinder);
@@ -95,7 +92,7 @@ public class GridClosureProcessorSelfTest extends GridCommonAbstractTest {
/**
* Test runnable job.
*/
- private static class TestRunnable implements IgniteRunnable {
+ private static class ClosureTestRunnable implements IgniteRunnable {
/** */
@IgniteInstanceResource
private Ignite ignite;
@@ -130,7 +127,7 @@ public class GridClosureProcessorSelfTest extends GridCommonAbstractTest {
/**
* Test callable job.
*/
- private static class TestCallable extends AbstractTestCallable {
+ private static class ClosureTestCallable extends AbstractTestCallable {
/** {@inheritDoc} */
@Override public Integer call() {
log.info("Callable job executed on node: " + ignite.cluster().localNode().id());
@@ -144,11 +141,11 @@ public class GridClosureProcessorSelfTest extends GridCommonAbstractTest {
/**
* Test callable job which throws class not found exception.
*/
- private static class TestCallableError extends AbstractTestCallable implements Externalizable {
+ private static class ClosureTestCallableError extends AbstractTestCallable implements Externalizable {
/**
*
*/
- public TestCallableError() {
+ public ClosureTestCallableError() {
// No-op.
}
@@ -234,7 +231,7 @@ public class GridClosureProcessorSelfTest extends GridCommonAbstractTest {
* @return Future object.
*/
private ComputeTaskFuture<?> runAsync(int idx,
- Collection<TestRunnable> jobs,
+ Collection<ClosureTestRunnable> jobs,
@Nullable IgnitePredicate<ClusterNode> p)
{
assert idx >= 0 && idx < NODES_CNT;
@@ -302,7 +299,7 @@ public class GridClosureProcessorSelfTest extends GridCommonAbstractTest {
* @param p Optional node predicate.
* @return Future object.
*/
- private ComputeTaskFuture<Collection<Integer>> callAsync(int idx, Collection<TestCallable> jobs,
+ private ComputeTaskFuture<Collection<Integer>> callAsync(int idx, Collection<ClosureTestCallable> jobs,
@Nullable IgnitePredicate<ClusterNode> p) {
assert idx >= 0 && idx < NODES_CNT;
assert !F.isEmpty(jobs);
@@ -334,7 +331,7 @@ public class GridClosureProcessorSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testRunAsyncSingle() throws Exception {
- IgniteRunnable job = new TestRunnable();
+ IgniteRunnable job = new ClosureTestRunnable();
ComputeTaskFuture<?> fut = broadcast(0, job, null);
@@ -360,7 +357,7 @@ public class GridClosureProcessorSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testRunAsyncMultiple() throws Exception {
- Collection<TestRunnable> jobs = F.asList(new TestRunnable(), new TestRunnable());
+ Collection<ClosureTestRunnable> jobs = F.asList(new ClosureTestRunnable(), new ClosureTestRunnable());
ComputeTaskFuture<?> fut = runAsync(0, jobs, null);
@@ -374,7 +371,7 @@ public class GridClosureProcessorSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testCallAsyncSingle() throws Exception {
- IgniteCallable<Integer> job = new TestCallable();
+ IgniteCallable<Integer> job = new ClosureTestCallable();
ComputeTaskFuture<Collection<Integer>> fut1 = broadcast(0, job, null);
@@ -404,7 +401,7 @@ public class GridClosureProcessorSelfTest extends GridCommonAbstractTest {
public void testCallAsyncErrorNoFailover() throws Exception {
IgniteCompute comp = compute(grid(0).cluster().forPredicate(F.notEqualTo(grid(0).localNode()))).withAsync();
- comp.withNoFailover().call(new TestCallableError());
+ comp.withNoFailover().call(new ClosureTestCallableError());
ComputeTaskFuture<Integer> fut = comp.future();
@@ -422,7 +419,7 @@ public class GridClosureProcessorSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testWithName() throws Exception {
- grid(0).compute().withName("TestTaskName").call(new TestCallable());
+ grid(0).compute().withName("TestTaskName").call(new ClosureTestCallable());
}
/**
@@ -460,7 +457,7 @@ public class GridClosureProcessorSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testCallAsyncMultiple() throws Exception {
- Collection<TestCallable> jobs = F.asList(new TestCallable(), new TestCallable());
+ Collection<ClosureTestCallable> jobs = F.asList(new ClosureTestCallable(), new ClosureTestCallable());
ComputeTaskFuture<Collection<Integer>> fut = callAsync(0, jobs, null);
@@ -479,7 +476,7 @@ public class GridClosureProcessorSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testReduceAsync() throws Exception {
- Collection<TestCallable> jobs = F.asList(new TestCallable(), new TestCallable());
+ Collection<ClosureTestCallable> jobs = F.asList(new ClosureTestCallable(), new ClosureTestCallable());
IgniteCompute comp = grid(0).compute().withAsync();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/GridEventConsumeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/GridEventConsumeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/GridEventConsumeSelfTest.java
index 9ffef4b..5ce2efd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/GridEventConsumeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/GridEventConsumeSelfTest.java
@@ -85,8 +85,6 @@ public class GridEventConsumeSelfTest extends GridCommonAbstractTest {
if (include)
cfg.setUserAttributes(F.asMap("include", true));
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
return cfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java
index 81751f2..80bf9e0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java
@@ -91,8 +91,6 @@ public class DataStreamProcessorSelfTest extends GridCommonAbstractTest {
cfg.setIncludeProperties();
- cfg.setMarshaller(new OptimizedMarshaller(false));
-
if (useCache) {
CacheConfiguration cc = defaultCacheConfiguration();
@@ -893,18 +891,7 @@ public class DataStreamProcessorSelfTest extends GridCommonAbstractTest {
try (IgniteDataStreamer<String, TestObject> ldr = ignite.dataStreamer(null)) {
ldr.allowOverwrite(true);
- ldr.receiver(new StreamReceiver<String, TestObject>() {
- @Override
- public void receive(IgniteCache<String, TestObject> cache,
- Collection<Map.Entry<String, TestObject>> entries) {
- for (Map.Entry<String, TestObject> e : entries) {
- assertTrue(e.getKey() instanceof String);
- assertTrue(e.getValue() instanceof TestObject);
-
- cache.put(e.getKey(), new TestObject(e.getValue().val + 1));
- }
- }
- });
+ ldr.receiver(getStreamReceiver());
for (int i = 0; i < 100; i++)
ldr.addData(String.valueOf(i), new TestObject(i));
@@ -927,14 +914,14 @@ public class DataStreamProcessorSelfTest extends GridCommonAbstractTest {
/**
*
*/
- private static class TestObject {
+ public static class TestObject {
/** Value. */
- private final int val;
+ public final int val;
/**
* @param val Value.
*/
- private TestObject(int val) {
+ public TestObject(int val) {
this.val = val;
}
@@ -958,6 +945,13 @@ public class DataStreamProcessorSelfTest extends GridCommonAbstractTest {
}
/**
+ * @return Stream receiver.
+ */
+ protected StreamReceiver<String, TestObject> getStreamReceiver() {
+ return new TestDataReceiver();
+ }
+
+ /**
*
*/
@SuppressWarnings("PublicInnerClass")
@@ -977,4 +971,20 @@ public class DataStreamProcessorSelfTest extends GridCommonAbstractTest {
storeMap.remove(key);
}
}
+
+ /**
+ *
+ */
+ private static class TestDataReceiver implements StreamReceiver<String, TestObject> {
+ /** {@inheritDoc} */
+ @Override public void receive(IgniteCache<String, TestObject> cache,
+ Collection<Map.Entry<String, TestObject>> entries) {
+ for (Map.Entry<String, TestObject> e : entries) {
+ assertTrue(e.getKey() instanceof String);
+ assertTrue(e.getValue() instanceof TestObject);
+
+ cache.put(e.getKey(), new TestObject(e.getValue().val + 1));
+ }
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37c56f69/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java
index bdf9929..c81ed56 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java
@@ -644,7 +644,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest {
try {
client = createClient(U.getLocalHost(), PORT, U.getLocalHost());
- MessageWithId msg = new MessageWithId();
+ MessageWithId msg = new MessageWithId(idProvider.getAndIncrement());
byte[] data = serializeMessage(msg);
@@ -746,7 +746,7 @@ public class GridNioSelfTest extends GridCommonAbstractTest {
client = createClient(U.getLocalHost(), PORT, U.getLocalHost());
while (cntr.getAndIncrement() < MSG_CNT * THREAD_CNT) {
- MessageWithId msg = new MessageWithId();
+ MessageWithId msg = new MessageWithId(idProvider.getAndIncrement());
byte[] data = serializeMessage(msg);
@@ -1408,7 +1408,14 @@ public class GridNioSelfTest extends GridCommonAbstractTest {
*/
private static class MessageWithId implements Serializable {
/** */
- private final int id = idProvider.getAndIncrement();
+ private final int id;
+
+ /**
+ * @param id Message ID.
+ */
+ public MessageWithId(int id) {
+ this.id = id;
+ }
/** */
@SuppressWarnings({"unused"})
[13/50] [abbrv] incubator-ignite git commit: # GG-10405: C++:
Implemented serialization prototype and PUT operation.
Posted by se...@apache.org.
# GG-10405: C++: Implemented serialization prototype and PUT operation.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d4b97315
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d4b97315
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d4b97315
Branch: refs/heads/ignite-484-1
Commit: d4b973155892539593d69a10b2cbb6aa1931efb0
Parents: 95b7147
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Jun 11 09:42:50 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Jun 11 09:42:50 2015 +0300
----------------------------------------------------------------------
examples/config/example-cache.xml | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d4b97315/examples/config/example-cache.xml
----------------------------------------------------------------------
diff --git a/examples/config/example-cache.xml b/examples/config/example-cache.xml
index 98e1a71..6d1d0da 100644
--- a/examples/config/example-cache.xml
+++ b/examples/config/example-cache.xml
@@ -37,6 +37,8 @@
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ <property name="localHost" value="127.0.0.1" />
+
<property name="cacheConfiguration">
<list>
<!-- Partitioned cache example configuration (Atomic mode). -->
[30/50] [abbrv] incubator-ignite git commit: #ignite-1008: small
change.
Posted by se...@apache.org.
#ignite-1008: small change.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/fb8b9963
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fb8b9963
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fb8b9963
Branch: refs/heads/ignite-484-1
Commit: fb8b9963fbe25a36f860a31ec6a66bfecd035cbe
Parents: 0be4bec
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Jun 11 22:47:06 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Jun 11 22:47:06 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/processors/cache/GridCacheProcessor.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fb8b9963/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 28341ad..4fdec33 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -2956,8 +2956,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
if (transactions().tx() != null)
throw new IgniteException("Cannot start/stop cache within transaction.");
- if (ctx.cache().context().mvcc().
- lastExplicitLockTopologyVersion(Thread.currentThread().getId()) != null)
+ if (sharedCtx.mvcc().lastExplicitLockTopologyVersion(Thread.currentThread().getId()) != null)
throw new IgniteException("Cannot start/stop cache within lock.");
}
[42/50] [abbrv] incubator-ignite git commit: Tests unmuted
Posted by se...@apache.org.
Tests unmuted
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/96d12d0e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/96d12d0e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/96d12d0e
Branch: refs/heads/ignite-484-1
Commit: 96d12d0ec2bcee65a4f4f76869b3eb1c259f316e
Parents: b087aca
Author: agura <ag...@gridgain.com>
Authored: Fri Jun 12 16:38:29 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri Jun 12 16:38:29 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCachePutAllFailoverSelfTest.java | 5 -----
.../distributed/dht/GridCacheColocatedFailoverSelfTest.java | 5 -----
.../distributed/near/GridCachePartitionedFailoverSelfTest.java | 5 -----
.../replicated/GridCacheReplicatedFailoverSelfTest.java | 5 -----
4 files changed, 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96d12d0e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
index 4ef5787..fc9e17b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
@@ -49,11 +49,6 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
* Tests putAll() method along with failover and different configurations.
*/
public class GridCachePutAllFailoverSelfTest extends GridCommonAbstractTest {
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-157");
- }
-
/** IP finder. */
private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96d12d0e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
index 74a107d..568b08f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
@@ -28,11 +28,6 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheColocatedFailoverSelfTest extends GridCacheAbstractFailoverTxSelfTest {
/** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-631 or IGNITE-157 or IGNITE-882");
- }
-
- /** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return PARTITIONED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96d12d0e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
index 9825cfd..553d748 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
@@ -27,11 +27,6 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCachePartitionedFailoverSelfTest extends GridCacheAbstractFailoverTxSelfTest {
/** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-631 or IGNITE-157 or IGNITE-882");
- }
-
- /** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return PARTITIONED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96d12d0e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
index 1103773..3461dd4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
@@ -28,11 +28,6 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheReplicatedFailoverSelfTest extends GridCacheAbstractFailoverTxSelfTest {
/** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-631 or IGNITE-157 or IGNITE-882");
- }
-
- /** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return REPLICATED;
}
[35/50] [abbrv] incubator-ignite git commit: Merge branches
'ignite-484-1' and 'ignite-sprint-6' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-484-1
Posted by se...@apache.org.
Merge branches 'ignite-484-1' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-484-1
# Conflicts:
# modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
# modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
# modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
# modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
# modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
# modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
# modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
# modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
# modules/scalar-2.10/pom.xml
# modules/spark-2.10/pom.xml
# modules/spark/pom.xml
# modules/visor-console-2.10/pom.xml
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0a5e97c2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0a5e97c2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0a5e97c2
Branch: refs/heads/ignite-484-1
Commit: 0a5e97c248b2c3aa401ce9062b9ebd9787a4db24
Parents: a7229dc b087aca
Author: S.Vladykin <sv...@gridgain.com>
Authored: Fri Jun 12 10:36:11 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Fri Jun 12 10:36:11 2015 +0300
----------------------------------------------------------------------
DEVNOTES.txt | 15 +
examples/config/example-cache.xml | 2 +
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
.../client/router/TcpSslRouterSelfTest.java | 5 +
.../client/suite/IgniteClientTestSuite.java | 3 +-
modules/cloud/pom.xml | 2 +-
.../cloud/TcpDiscoveryCloudIpFinder.java | 25 +-
.../TcpDiscoveryCloudIpFinderSelfTest.java | 3 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
.../apache/ignite/cache/query/ScanQuery.java | 20 +
.../ignite/internal/GridPluginContext.java | 6 +
.../apache/ignite/internal/IgniteKernal.java | 2 +-
.../internal/MarshallerContextAdapter.java | 30 +-
.../ignite/internal/MarshallerContextImpl.java | 10 +-
.../internal/interop/InteropIgnition.java | 54 +-
.../internal/interop/InteropProcessor.java | 8 +
.../processors/cache/GridCacheMessage.java | 51 --
.../processors/cache/GridCacheProcessor.java | 27 +-
.../processors/cache/KeyCacheObjectImpl.java | 11 +-
.../cache/query/GridCacheQueryManager.java | 5 +-
.../cacheobject/IgniteCacheObjectProcessor.java | 9 +-
.../IgniteCacheObjectProcessorImpl.java | 12 +-
.../continuous/GridContinuousProcessor.java | 15 +-
.../datastreamer/DataStreamerCacheUpdaters.java | 2 +-
.../datastreamer/DataStreamerImpl.java | 8 +-
.../portable/GridPortableInputStream.java | 10 +
.../processors/query/GridQueryProcessor.java | 2 +-
.../ignite/internal/util/IgniteUtils.java | 3 +
.../util/ipc/shmem/IpcSharedMemoryUtils.java | 4 +-
.../internal/visor/VisorMultiNodeTask.java | 2 +-
.../ignite/marshaller/MarshallerContext.java | 8 +
.../org/apache/ignite/plugin/PluginContext.java | 6 +
.../java/org/jsr166/ConcurrentHashMap8.java | 8 +-
.../java/org/jsr166/ConcurrentLinkedDeque8.java | 586 ++++++-------------
.../src/main/java/org/jsr166/LongAdder8.java | 35 +-
.../core/src/main/java/org/jsr166/README.txt | 11 +
.../src/main/java/org/jsr166/Striped64_8.java | 22 +-
.../java/org/jsr166/ThreadLocalRandom8.java | 19 +-
.../src/main/java/org/jsr166/package-info.java | 12 +-
.../core/src/main/resources/ignite.properties | 2 +-
modules/core/src/test/config/tests.properties | 2 +-
.../ignite/GridSuppressedExceptionSelfTest.java | 4 +-
.../internal/GridDiscoveryEventSelfTest.java | 6 +-
...ridFailFastNodeFailureDetectionSelfTest.java | 2 +
.../GridFailoverTaskWithPredicateSelfTest.java | 3 -
.../GridJobMasterLeaveAwareSelfTest.java | 2 -
.../internal/GridJobStealingSelfTest.java | 3 -
...ectionLocalJobMultipleArgumentsSelfTest.java | 2 -
.../GridTaskExecutionContextSelfTest.java | 9 -
.../IgniteComputeEmptyClusterGroupTest.java | 3 -
.../IgniteComputeTopologyExceptionTest.java | 9 -
.../GridDiscoveryManagerAliveCacheSelfTest.java | 5 +
.../cache/GridCacheAbstractSelfTest.java | 3 -
.../cache/GridCacheAffinityRoutingSelfTest.java | 4 +-
.../cache/GridCacheDeploymentSelfTest.java | 3 -
.../cache/GridCacheEntryMemorySizeSelfTest.java | 91 +--
.../cache/GridCacheMemoryModeSelfTest.java | 2 -
...inodeUpdateNearEnabledNoBackupsSelfTest.java | 2 +-
...CacheMultinodeUpdateNearEnabledSelfTest.java | 2 +-
.../processors/cache/GridCacheOffHeapTest.java | 28 +-
.../cache/GridCachePutAllFailoverSelfTest.java | 5 +
.../GridCacheReferenceCleanupSelfTest.java | 3 -
.../processors/cache/GridCacheStopSelfTest.java | 5 +
.../cache/GridCacheVersionMultinodeTest.java | 2 +-
.../cache/IgniteCacheAbstractTest.java | 3 -
.../IgniteCacheEntryListenerAbstractTest.java | 14 +-
.../IgniteCacheInterceptorSelfTestSuite.java | 2 +-
.../cache/IgniteCacheInvokeReadThroughTest.java | 5 +
...gniteCacheTransactionalStopBusySelfTest.java | 5 +
...teStartCacheInTransactionAtomicSelfTest.java | 32 +
.../IgniteStartCacheInTransactionSelfTest.java | 254 ++++++++
.../IgniteTxMultiThreadedAbstractTest.java | 4 +-
...cheAtomicReferenceMultiNodeAbstractTest.java | 11 -
...GridCacheQueueMultiNodeAbstractSelfTest.java | 2 -
...dCacheQueueMultiNodeConsistencySelfTest.java | 5 +
...CacheQueueRotativeMultiNodeAbstractTest.java | 10 -
.../GridCacheSetAbstractSelfTest.java | 9 -
...omicOffheapQueueCreateMultiNodeSelfTest.java | 5 +
...ionedAtomicQueueCreateMultiNodeSelfTest.java | 5 +
...rtitionedDataStructuresFailoverSelfTest.java | 5 +
...edOffheapDataStructuresFailoverSelfTest.java | 5 +
...PartitionedQueueCreateMultiNodeSelfTest.java | 5 +
...dCachePartitionedQueueEntryMoveSelfTest.java | 5 +
...nedQueueFailoverDataConsistencySelfTest.java | 5 +
...eplicatedDataStructuresFailoverSelfTest.java | 5 +
...CacheLoadingConcurrentGridStartSelfTest.java | 5 +
.../GridCacheAbstractJobExecutionTest.java | 3 -
.../GridCachePreloadLifecycleAbstractTest.java | 2 -
...heAbstractTransformWriteThroughSelfTest.java | 3 -
.../dht/GridCacheColocatedFailoverSelfTest.java | 5 +
.../GridCacheColocatedTxExceptionSelfTest.java | 5 +
...ePartitionedNearDisabledMetricsSelfTest.java | 4 +-
...dCachePartitionedTopologyChangeSelfTest.java | 5 +
.../near/GridCacheNearEvictionSelfTest.java | 3 -
.../near/GridCacheNearTxExceptionSelfTest.java | 5 +
.../GridCachePartitionedFailoverSelfTest.java | 5 +
...PartitionedFullApiMultithreadedSelfTest.java | 5 +
...idCachePartitionedHitsAndMissesSelfTest.java | 3 -
.../GridCachePartitionedNodeRestartTest.java | 5 +
...ePartitionedOptimisticTxNodeRestartTest.java | 5 +
...CachePartitionedTxMultiThreadedSelfTest.java | 5 +
.../GridCacheReplicatedFailoverSelfTest.java | 5 +
...eReplicatedFullApiMultithreadedSelfTest.java | 5 +
.../GridCacheReplicatedInvalidateSelfTest.java | 4 +-
...ridCacheReplicatedMultiNodeLockSelfTest.java | 5 +
.../GridCacheReplicatedMultiNodeSelfTest.java | 5 +
.../GridCacheReplicatedNodeRestartSelfTest.java | 5 +
.../GridCacheReplicatedTxExceptionSelfTest.java | 5 +
.../replicated/GridReplicatedTxPreloadTest.java | 2 +
...acheAtomicReplicatedNodeRestartSelfTest.java | 5 +
.../GridCacheEvictionFilterSelfTest.java | 4 +-
...cheSynchronousEvictionsFailoverSelfTest.java | 5 +
.../IgniteCacheExpiryPolicyAbstractTest.java | 10 +-
...eCacheExpiryPolicyWithStoreAbstractTest.java | 4 +-
...dCacheLocalFullApiMultithreadedSelfTest.java | 5 +
.../GridCacheLocalTxExceptionSelfTest.java | 5 +
.../GridCacheSwapScanQueryAbstractSelfTest.java | 3 -
...ridCacheContinuousQueryAbstractSelfTest.java | 2 -
.../closure/GridClosureProcessorSelfTest.java | 29 +-
.../continuous/GridEventConsumeSelfTest.java | 2 -
.../DataStreamProcessorSelfTest.java | 44 +-
.../processors/igfs/IgfsModesSelfTest.java | 4 +-
.../internal/util/nio/GridNioSelfTest.java | 13 +-
.../internal/util/nio/GridNioSslSelfTest.java | 2 +
.../unsafe/GridUnsafeMemorySelfTest.java | 4 +-
.../tostring/GridToStringBuilderSelfTest.java | 4 +-
.../marshaller/MarshallerContextTestImpl.java | 11 +-
.../ignite/messaging/GridMessagingSelfTest.java | 3 -
.../GridP2PContinuousDeploymentSelfTest.java | 2 +
.../p2p/GridP2PLocalDeploymentSelfTest.java | 6 +-
.../p2p/GridP2PRemoteClassLoadersSelfTest.java | 31 +-
.../spi/GridTcpSpiForwardingSelfTest.java | 3 -
.../ignite/testframework/GridTestUtils.java | 14 +
.../config/GridTestProperties.java | 14 +-
.../junits/IgniteTestResources.java | 16 +-
.../ignite/testsuites/IgniteBasicTestSuite.java | 29 +-
.../IgniteCacheDataStructuresSelfTestSuite.java | 24 +-
.../IgniteCacheEvictionSelfTestSuite.java | 3 +-
.../IgniteCacheFailoverTestSuite.java | 22 +-
.../IgniteCacheFullApiSelfTestSuite.java | 8 +-
...niteCacheP2pUnmarshallingErrorTestSuite.java | 20 +-
.../testsuites/IgniteCacheRestartTestSuite.java | 10 +-
.../ignite/testsuites/IgniteCacheTestSuite.java | 44 +-
.../testsuites/IgniteCacheTestSuite2.java | 4 +-
.../testsuites/IgniteCacheTestSuite3.java | 14 +-
.../testsuites/IgniteCacheTestSuite4.java | 15 +-
.../testsuites/IgniteKernalSelfTestSuite.java | 14 +-
.../IgniteMarshallerSelfTestSuite.java | 28 +-
.../testsuites/IgniteUtilSelfTestSuite.java | 18 +-
.../apache/ignite/util/GridRandomSelfTest.java | 4 +-
modules/extdata/p2p/pom.xml | 2 +-
.../tests/p2p/P2PTestTaskExternalPath1.java | 10 +-
.../tests/p2p/P2PTestTaskExternalPath2.java | 8 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
.../HadoopIgfs20FileSystemAbstractSelfTest.java | 4 +-
.../IgniteHadoopFileSystemAbstractSelfTest.java | 2 +-
.../processors/hadoop/HadoopMapReduceTest.java | 21 +-
.../collections/HadoopHashMapSelfTest.java | 4 +-
.../HadoopExternalTaskExecutionSelfTest.java | 2 +
.../HadoopExternalCommunicationSelfTest.java | 5 +
.../testsuites/IgniteHadoopTestSuite.java | 7 +-
modules/hibernate/pom.xml | 2 +-
.../hibernate/HibernateL2CacheSelfTest.java | 5 +
.../HibernateL2CacheTransactionalSelfTest.java | 5 +
.../testsuites/IgniteHibernateTestSuite.java | 4 +-
modules/indexing/pom.xml | 18 +-
.../cache/GridCacheCrossCacheQuerySelfTest.java | 10 +-
.../cache/GridCacheOffHeapSelfTest.java | 1 -
...idCacheReduceQueryMultithreadedSelfTest.java | 10 -
.../processors/cache/GridCacheSwapSelfTest.java | 3 -
.../IgniteCacheAbstractFieldsQuerySelfTest.java | 13 +-
.../cache/IgniteCacheAbstractQuerySelfTest.java | 2 -
...hePartitionedQueryMultiThreadedSelfTest.java | 40 +-
.../IgniteCacheQueryMultiThreadedSelfTest.java | 1 -
.../IgniteCacheQueryNodeRestartSelfTest.java | 5 +
...dCacheAbstractReduceFieldsQuerySelfTest.java | 1 -
.../h2/GridIndexingSpiAbstractSelfTest.java | 4 +-
.../query/h2/sql/BaseH2CompareQueryTest.java | 4 +-
.../query/h2/sql/GridQueryParsingTest.java | 5 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/mesos/README.txt | 2 +-
modules/mesos/pom.xml | 2 +-
.../apache/ignite/mesos/ClusterProperties.java | 15 +
.../apache/ignite/mesos/IgniteScheduler.java | 10 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar-2.10/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spark-2.10/pom.xml | 2 +-
modules/spark/pom.xml | 40 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console-2.10/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
.../IgniteWebSessionSelfTestSuite.java | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 2 +-
212 files changed, 1554 insertions(+), 1032 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0a5e97c2/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
index 11a8c84,e6b69bc..90000e8
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
@@@ -99,26 -99,23 +99,46 @@@ public final class ScanQuery<K, V> exte
/**
* Gets partition number over which this query should iterate. Will return {@code null} if partition was not
* set. In this case query will iterate over all partitions in the cache.
+ *
+ * @return Partition number or {@code null}.
+ */
+ @Nullable public Integer getPartition() {
+ return part;
+ }
+
+ /**
+ * Sets partition number over which this query should iterate. If {@code null}, query will iterate over
+ * all partitions in the cache. Must be in the range [0, N) where N is partition number in the cache.
+ *
+ * @param part Partition number over which this query should iterate.
+ * @return {@code this} for chaining.
+ */
+ public ScanQuery<K, V> setPartition(@Nullable Integer part) {
+ this.part = part;
+
+ return this;
+ }
+
++ /**
++ * Gets partition number over which this query should iterate. Will return {@code null} if partition was not
++ * set. In this case query will iterate over all partitions in the cache.
+ *
+ * @return Partition number or {@code null}.
+ */
+ @Nullable public Integer getPartition() {
+ return part;
+ }
+
+ /**
+ * Sets partition number over which this query should iterate. If {@code null}, query will iterate over
+ * all partitions in the cache. Must be in the range [0, N) where N is partition number in the cache.
+ *
+ * @param part Partition number over which this query should iterate.
+ */
+ public void setPartition(@Nullable Integer part) {
+ this.part = part;
+ }
+
/** {@inheritDoc} */
@Override public ScanQuery<K, V> setPageSize(int pageSize) {
return (ScanQuery<K, V>)super.setPageSize(pageSize);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0a5e97c2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0a5e97c2/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0a5e97c2/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index ed9fc9a,c598e38..7fa038c
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@@ -140,6 -138,9 +138,11 @@@ public class IgniteCacheTestSuite4 exte
suite.addTestSuite(IgniteCacheManyClientsTest.class);
+ suite.addTestSuite(IgniteStartCacheInTransactionSelfTest.class);
+ suite.addTestSuite(IgniteStartCacheInTransactionAtomicSelfTest.class);
+
++ suite.addTestSuite(IgniteCacheManyClientsTest.class);
++
return suite;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0a5e97c2/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0a5e97c2/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java
----------------------------------------------------------------------
[28/50] [abbrv] incubator-ignite git commit: Partition reserve for
partition scan query fixed
Posted by se...@apache.org.
Partition reserve for partition scan query fixed
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2b63ff8c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2b63ff8c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2b63ff8c
Branch: refs/heads/ignite-484-1
Commit: 2b63ff8cfac20da0c7ab2f2fe55c33019dd3e9c4
Parents: e188e18
Author: agura <ag...@gridgain.com>
Authored: Thu Jun 11 21:55:00 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Thu Jun 11 21:55:00 2015 +0300
----------------------------------------------------------------------
.../internal/processors/cache/query/GridCacheQueryManager.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b63ff8c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 6e71ba7..1317d38 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -791,8 +791,9 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
locPart = dht.topology().localPartition(part, topVer, false);
- if (locPart == null || (locPart.state() != OWNING && locPart.state() != RENTING) ||
- !locPart.reserve())
+ // double check for owning state
+ if (locPart == null || locPart.state() != OWNING || !locPart.reserve() ||
+ locPart.state() != OWNING)
throw new GridDhtInvalidPartitionException(part, "Partition can't be reserved");
iter = new Iterator<K>() {
[49/50] [abbrv] incubator-ignite git commit: ignite-484-1 - refactor
Posted by se...@apache.org.
ignite-484-1 - refactor
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4a534059
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4a534059
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4a534059
Branch: refs/heads/ignite-484-1
Commit: 4a534059e4bf46b061e1272d432fd00c6f87acb0
Parents: 2b7dc3b
Author: S.Vladykin <sv...@gridgain.com>
Authored: Fri Jun 12 17:21:14 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Fri Jun 12 17:21:14 2015 +0300
----------------------------------------------------------------------
.../distributed/dht/GridDhtLocalPartition.java | 10 +-
.../dht/GridDhtPartitionsReservation.java | 169 ++++++++++++++-----
.../query/h2/twostep/GridMapQueryExecutor.java | 24 +--
3 files changed, 141 insertions(+), 62 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4a534059/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index 3670b8e..018ffd6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -143,19 +143,15 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
assert state.getReference() != EVICTED : "we can reserve only active partitions";
assert state.getStamp() != 0 : "partition must be already reserved before adding group reservation";
- if (!reservations.addIfAbsent(r))
- return false;
-
- r.register(this);
-
- return true;
+ return reservations.addIfAbsent(r);
}
/**
* @param r Reservation.
*/
public void removeReservation(GridDhtPartitionsReservation r) {
- reservations.remove(r);
+ if (!reservations.remove(r))
+ throw new IllegalStateException("Reservation was already removed.");
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4a534059/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
index fcd6088..71a1859 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
@@ -19,70 +19,126 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.lang.*;
+import org.apache.ignite.internal.util.typedef.*;
import java.util.*;
import java.util.concurrent.atomic.*;
-import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.*;
+import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.RENTING;
/**
* Reservation mechanism for multiple partitions allowing to do a reservation in one operation.
*/
public class GridDhtPartitionsReservation implements GridReservable {
/** */
+ private static final GridDhtLocalPartition[] EMPTY = {};
+
+ /** */
+ private final Object appKey;
+
+ /** */
private final GridCacheContext<?,?> cctx;
/** */
private final AffinityTopologyVersion topVer;
/** */
- private final List<GridDhtLocalPartition> parts = new ArrayList<>();
+ private final AtomicReference<GridDhtLocalPartition[]> parts = new AtomicReference<>();
/** */
private final AtomicInteger reservations = new AtomicInteger();
/** */
- private final IgniteInClosure<GridDhtPartitionsReservation> finalize;
+ private volatile CI1<GridDhtPartitionsReservation> unpublish;
/**
* @param topVer AffinityTopologyVersion version.
* @param cctx Cache context.
- * @param finalize Finalizing closure.
+ * @param appKey Application key for reservation.
*/
- public GridDhtPartitionsReservation(
- AffinityTopologyVersion topVer,
- GridCacheContext<?,?> cctx,
- IgniteInClosure<GridDhtPartitionsReservation> finalize) {
+ public GridDhtPartitionsReservation(AffinityTopologyVersion topVer, GridCacheContext<?,?> cctx, Object appKey) {
assert topVer != null;
assert cctx != null;
+ assert appKey != null;
this.topVer = topVer;
this.cctx = cctx;
- this.finalize = finalize;
+ this.appKey = appKey;
}
/**
- * @return Topology version.
+ * Registers all the given partitions for this reservation.
+ *
+ * @param parts Partitions.
+ * @return {@code true} If registration succeeded and this reservation can be published.
*/
- public AffinityTopologyVersion topologyVersion() {
- return topVer;
- }
+ public boolean register(Collection<? extends GridReservable> parts) {
+ assert !F.isEmpty(parts) : "empty partitions list";
- /**
- * @return Cache context.
- */
- public GridCacheContext<?,?> cacheContext() {
- return cctx;
+ GridDhtLocalPartition[] arr = new GridDhtLocalPartition[parts.size()];
+
+ int i = 0;
+ int prevPart = -1;
+ boolean sorted = true; // Most probably it is a sorted list.
+
+ for (GridReservable part : parts) {
+ arr[i] = (GridDhtLocalPartition)part;
+
+ if (sorted) { // Make sure it will be a sorted array.
+ int id = arr[i].id();
+
+ if (id <= prevPart)
+ sorted = false;
+
+ prevPart = id;
+ }
+
+ i++;
+ }
+
+ if (!sorted)
+ Arrays.sort(arr);
+
+ i = 0;
+ prevPart = -1;
+
+ // Register in correct sort order.
+ for (GridDhtLocalPartition part : arr) {
+ if (prevPart == part.id())
+ throw new IllegalStateException("Duplicated partitions.");
+
+ prevPart = part.id();
+
+ if (!part.addReservation(this)) {
+ if (i != 0)
+ throw new IllegalStateException(
+ "Trying to reserve different sets of partitions for the same topology version.");
+
+ return false;
+ }
+
+ i++;
+ }
+
+ if (!this.parts.compareAndSet(null, arr))
+ throw new IllegalStateException("Partitions can be registered only once.");
+
+ return true;
}
/**
- * Registers partition for this group reservation.
+ * Must be called when this reservation is published.
*
- * @param part Partition.
+ * @param unpublish Closure to unpublish this reservation when it will become invalid.
*/
- public void register(GridDhtLocalPartition part) {
- parts.add(part);
+ public void onPublish(CI1<GridDhtPartitionsReservation> unpublish) {
+ assert unpublish != null;
+ assert this.unpublish == null;
+
+ this.unpublish = unpublish;
+
+ if (reservations.get() == -1)
+ unregister();
}
/**
@@ -91,6 +147,8 @@ public class GridDhtPartitionsReservation implements GridReservable {
* @return {@code true} If succeeded.
*/
@Override public boolean reserve() {
+ assert parts.get() != null : "partitions must be registered before the first reserve attempt";
+
for (;;) {
int r = reservations.get();
@@ -105,6 +163,25 @@ public class GridDhtPartitionsReservation implements GridReservable {
}
/**
+ * @param parts Partitions.
+ */
+ private static void tryEvict(GridDhtLocalPartition[] parts) {
+ if (parts == null) // Can be not initialized yet.
+ return ;
+
+ for (GridDhtLocalPartition part : parts)
+ tryEvict(part);
+ }
+
+ /**
+ * @param part Partition.
+ */
+ private static void tryEvict(GridDhtLocalPartition part) {
+ if (part.state() == RENTING && part.reservations() == 0)
+ part.tryEvictAsync(true);
+ }
+
+ /**
* Releases all the registered partitions.
*/
@Override public void release() {
@@ -116,12 +193,8 @@ public class GridDhtPartitionsReservation implements GridReservable {
if (reservations.compareAndSet(r, r - 1)) {
// If it was the last reservation and topology version changed -> attempt to evict partitions.
- if (r == 1 && !topVer.equals(cctx.topology().topologyVersion())) {
- for (GridDhtLocalPartition part : parts) {
- if (part.state() == RENTING)
- part.tryEvictAsync(true);
- }
- }
+ if (r == 1 && !topVer.equals(cctx.topology().topologyVersion()))
+ tryEvict(parts.get());
return;
}
@@ -129,6 +202,26 @@ public class GridDhtPartitionsReservation implements GridReservable {
}
/**
+ * Unregisters this reservation from all the partitions.
+ */
+ private void unregister() {
+ GridDhtLocalPartition[] arr = parts.get();
+
+ if (!F.isEmpty(arr) && unpublish != null && parts.compareAndSet(arr, EMPTY)) {
+ // Reverse order makes sure that addReservation on the same topVer reservation will fail on the first partition.
+ for (int i = arr.length - 1; i >= 0; i--) {
+ GridDhtLocalPartition part = arr[i];
+
+ part.removeReservation(this);
+
+ tryEvict(part);
+ }
+
+ unpublish.apply(this);
+ }
+ }
+
+ /**
* Must be checked in {@link GridDhtLocalPartition#tryEvict(boolean)}.
* If returns {@code true} then probably partition will be evicted (or at least cleared),
* so this reservation object becomes invalid and must be dropped from the partition.
@@ -146,12 +239,7 @@ public class GridDhtPartitionsReservation implements GridReservable {
return r == -1;
if (reservations.compareAndSet(0, -1)) {
- // Remove our self.
- for (GridDhtLocalPartition part : parts)
- part.removeReservation(this);
-
- if (finalize != null)
- finalize.apply(this);
+ unregister();
return true;
}
@@ -169,13 +257,18 @@ public class GridDhtPartitionsReservation implements GridReservable {
GridDhtPartitionsReservation that = (GridDhtPartitionsReservation)o;
- return topVer.equals(that.topVer) && cctx == that.cctx;
+ return cctx == that.cctx && topVer.equals(that.topVer) && appKey.equals(that.appKey);
}
/** {@inheritDoc} */
@Override public int hashCode() {
- String cache = cctx.name();
+ String name = cctx.name();
+
+ int result = name == null ? 0 : name.hashCode();
+
+ result = 31 * result + appKey.hashCode();
+ result = 31 * result + topVer.hashCode();
- return 31 * topVer.hashCode() + cache == null ? 0 : cache.hashCode();
+ return result;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4a534059/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index a8bc6e0..42f01cb 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -290,27 +290,17 @@ public class GridMapQueryExecutor {
if (explicitParts == null) {
// We reserved all the primary partitions for cache, attempt to add group reservation.
- GridDhtPartitionsReservation reservation = new GridDhtPartitionsReservation(topVer, cctx,
- new CI1<GridDhtPartitionsReservation>() {
+ GridDhtPartitionsReservation grp = new GridDhtPartitionsReservation(topVer, cctx, "SQL");
+
+ if (grp.register(reserved.subList(reserved.size() - partIds.size(), reserved.size()))) {
+ if (reservations.putIfAbsent(grpKey, grp) != null)
+ throw new IllegalStateException("Reservation already exists.");
+
+ grp.onPublish(new CI1<GridDhtPartitionsReservation>() {
@Override public void apply(GridDhtPartitionsReservation r) {
reservations.remove(grpKey, r);
}
});
-
- for (int p = reserved.size() - partIds.size(); p < reserved.size(); p++) {
- if (!((GridDhtLocalPartition)reserved.get(p)).addReservation(reservation)) {
- // Can fail to add only on the first partition because of the same order of partitions.
- assert p == reserved.size() - partIds.size() : p;
-
- reservation = null;
-
- break;
- }
- }
-
- if (reservation != null) { // If we were able to add reservation to all partitions, publish it.
- if (reservations.putIfAbsent(grpKey, reservation) != null)
- throw new IllegalStateException();
}
}
}
[05/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: merge
from ignite-545
Posted by se...@apache.org.
ignite-sprint-6: merge from ignite-545
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/455b96fc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/455b96fc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/455b96fc
Branch: refs/heads/ignite-484-1
Commit: 455b96fc1791c9ec48372890d782513c58c1acd6
Parents: 593d862
Author: Denis Magda <dm...@gridgain.com>
Authored: Wed Jun 10 17:23:56 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Jun 10 17:23:56 2015 +0300
----------------------------------------------------------------------
.../processors/cache/KeyCacheObjectImpl.java | 11 +-
.../datastreamer/DataStreamerCacheUpdaters.java | 2 +-
.../java/org/jsr166/ConcurrentHashMap8.java | 5431 ++++++++----------
.../java/org/jsr166/ConcurrentLinkedDeque8.java | 586 +-
.../src/main/java/org/jsr166/LongAdder8.java | 35 +-
.../core/src/main/java/org/jsr166/README.txt | 11 +
.../src/main/java/org/jsr166/Striped64_8.java | 22 +-
.../java/org/jsr166/ThreadLocalRandom8.java | 19 +-
.../src/main/java/org/jsr166/package-info.java | 12 +-
.../IgniteHadoopFileSystemAbstractSelfTest.java | 2 +-
10 files changed, 2742 insertions(+), 3389 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/455b96fc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
index 61ca882..e5fa891 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
@@ -23,7 +23,7 @@ import org.jetbrains.annotations.*;
/**
*
*/
-public class KeyCacheObjectImpl extends CacheObjectAdapter implements KeyCacheObject, Comparable<KeyCacheObjectImpl> {
+public class KeyCacheObjectImpl extends CacheObjectAdapter implements KeyCacheObject {
/** */
private static final long serialVersionUID = 0L;
@@ -46,15 +46,6 @@ public class KeyCacheObjectImpl extends CacheObjectAdapter implements KeyCacheOb
}
/** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public int compareTo(KeyCacheObjectImpl other) {
- assert val instanceof Comparable : val;
- assert other.val instanceof Comparable : val;
-
- return ((Comparable)val).compareTo(other.val);
- }
-
- /** {@inheritDoc} */
@Override public byte[] valueBytes(CacheObjectContext ctx) throws IgniteCheckedException {
if (valBytes == null)
valBytes = ctx.processor().marshal(ctx, val);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/455b96fc/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerCacheUpdaters.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerCacheUpdaters.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerCacheUpdaters.java
index 50e9ab9..dc9d025 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerCacheUpdaters.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerCacheUpdaters.java
@@ -160,7 +160,7 @@ public class DataStreamerCacheUpdaters {
/**
* Batched updater. Updates cache using batch operations thus is dead lock prone.
*/
- private static class BatchedSorted<K, V> implements StreamReceiver<K, V>, InternalUpdater {
+ private static class BatchedSorted<K, V> implements StreamReceiver<K, V> {
/** */
private static final long serialVersionUID = 0L;
[39/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: merge
from ignite-1011
Posted by se...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
index b44f821..15f42ff 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
@@ -170,37 +170,37 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
}
switch (writer.state()) {
- case 19:
+ case 18:
if (!writer.writeBoolean("explicitLock", explicitLock))
return false;
writer.incrementState();
- case 20:
+ case 19:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 21:
+ case 20:
if (!writer.writeBoolean("storeEnabled", storeEnabled))
return false;
writer.incrementState();
- case 22:
+ case 21:
if (!writer.writeUuid("subjId", subjId))
return false;
writer.incrementState();
- case 23:
+ case 22:
if (!writer.writeInt("taskNameHash", taskNameHash))
return false;
writer.incrementState();
- case 24:
+ case 23:
if (!writer.writeMessage("topVer", topVer))
return false;
@@ -222,7 +222,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
return false;
switch (reader.state()) {
- case 19:
+ case 18:
explicitLock = reader.readBoolean("explicitLock");
if (!reader.isLastRead())
@@ -230,7 +230,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 20:
+ case 19:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -238,7 +238,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 21:
+ case 20:
storeEnabled = reader.readBoolean("storeEnabled");
if (!reader.isLastRead())
@@ -246,7 +246,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 22:
+ case 21:
subjId = reader.readUuid("subjId");
if (!reader.isLastRead())
@@ -254,7 +254,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 23:
+ case 22:
taskNameHash = reader.readInt("taskNameHash");
if (!reader.isLastRead())
@@ -262,7 +262,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 24:
+ case 23:
topVer = reader.readMessage("topVer");
if (!reader.isLastRead())
@@ -282,7 +282,7 @@ public class GridNearTxFinishRequest extends GridDistributedTxFinishRequest {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 25;
+ return 24;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
index b602a7f..4cc8f91 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
@@ -284,73 +284,73 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
}
switch (writer.state()) {
- case 23:
+ case 22:
if (!writer.writeBoolean("explicitLock", explicitLock))
return false;
writer.incrementState();
- case 24:
+ case 23:
if (!writer.writeBoolean("firstClientReq", firstClientReq))
return false;
writer.incrementState();
- case 25:
+ case 24:
if (!writer.writeIgniteUuid("futId", futId))
return false;
writer.incrementState();
- case 26:
+ case 25:
if (!writer.writeBoolean("implicitSingle", implicitSingle))
return false;
writer.incrementState();
- case 27:
+ case 26:
if (!writer.writeBoolean("last", last))
return false;
writer.incrementState();
- case 28:
+ case 27:
if (!writer.writeCollection("lastBackups", lastBackups, MessageCollectionItemType.UUID))
return false;
writer.incrementState();
- case 29:
+ case 28:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 30:
+ case 29:
if (!writer.writeBoolean("near", near))
return false;
writer.incrementState();
- case 31:
+ case 30:
if (!writer.writeBoolean("retVal", retVal))
return false;
writer.incrementState();
- case 32:
+ case 31:
if (!writer.writeUuid("subjId", subjId))
return false;
writer.incrementState();
- case 33:
+ case 32:
if (!writer.writeInt("taskNameHash", taskNameHash))
return false;
writer.incrementState();
- case 34:
+ case 33:
if (!writer.writeMessage("topVer", topVer))
return false;
@@ -372,7 +372,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
return false;
switch (reader.state()) {
- case 23:
+ case 22:
explicitLock = reader.readBoolean("explicitLock");
if (!reader.isLastRead())
@@ -380,7 +380,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 24:
+ case 23:
firstClientReq = reader.readBoolean("firstClientReq");
if (!reader.isLastRead())
@@ -388,7 +388,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 25:
+ case 24:
futId = reader.readIgniteUuid("futId");
if (!reader.isLastRead())
@@ -396,7 +396,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 26:
+ case 25:
implicitSingle = reader.readBoolean("implicitSingle");
if (!reader.isLastRead())
@@ -404,7 +404,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 27:
+ case 26:
last = reader.readBoolean("last");
if (!reader.isLastRead())
@@ -412,7 +412,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 28:
+ case 27:
lastBackups = reader.readCollection("lastBackups", MessageCollectionItemType.UUID);
if (!reader.isLastRead())
@@ -420,7 +420,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 29:
+ case 28:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -428,7 +428,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 30:
+ case 29:
near = reader.readBoolean("near");
if (!reader.isLastRead())
@@ -436,7 +436,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 31:
+ case 30:
retVal = reader.readBoolean("retVal");
if (!reader.isLastRead())
@@ -444,7 +444,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 32:
+ case 31:
subjId = reader.readUuid("subjId");
if (!reader.isLastRead())
@@ -452,7 +452,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 33:
+ case 32:
taskNameHash = reader.readInt("taskNameHash");
if (!reader.isLastRead())
@@ -460,7 +460,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 34:
+ case 33:
topVer = reader.readMessage("topVer");
if (!reader.isLastRead())
@@ -480,7 +480,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 35;
+ return 34;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
index 0f0b2c0..b418500 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
@@ -345,67 +345,67 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
}
switch (writer.state()) {
- case 10:
+ case 8:
if (!writer.writeMessage("clientRemapVer", clientRemapVer))
return false;
writer.incrementState();
- case 11:
+ case 9:
if (!writer.writeMessage("dhtVer", dhtVer))
return false;
writer.incrementState();
- case 12:
+ case 10:
if (!writer.writeCollection("filterFailedKeys", filterFailedKeys, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 13:
+ case 11:
if (!writer.writeIgniteUuid("futId", futId))
return false;
writer.incrementState();
- case 14:
+ case 12:
if (!writer.writeCollection("invalidParts", invalidParts, MessageCollectionItemType.INT))
return false;
writer.incrementState();
- case 15:
+ case 13:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 16:
+ case 14:
if (!writer.writeCollection("ownedValKeys", ownedValKeys, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 17:
+ case 15:
if (!writer.writeCollection("ownedValVals", ownedValVals, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 18:
+ case 16:
if (!writer.writeCollection("pending", pending, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 19:
+ case 17:
if (!writer.writeMessage("retVal", retVal))
return false;
writer.incrementState();
- case 20:
+ case 18:
if (!writer.writeMessage("writeVer", writeVer))
return false;
@@ -427,7 +427,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
return false;
switch (reader.state()) {
- case 10:
+ case 8:
clientRemapVer = reader.readMessage("clientRemapVer");
if (!reader.isLastRead())
@@ -435,7 +435,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
reader.incrementState();
- case 11:
+ case 9:
dhtVer = reader.readMessage("dhtVer");
if (!reader.isLastRead())
@@ -443,7 +443,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
reader.incrementState();
- case 12:
+ case 10:
filterFailedKeys = reader.readCollection("filterFailedKeys", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -451,7 +451,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
reader.incrementState();
- case 13:
+ case 11:
futId = reader.readIgniteUuid("futId");
if (!reader.isLastRead())
@@ -459,7 +459,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
reader.incrementState();
- case 14:
+ case 12:
invalidParts = reader.readCollection("invalidParts", MessageCollectionItemType.INT);
if (!reader.isLastRead())
@@ -467,7 +467,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
reader.incrementState();
- case 15:
+ case 13:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -475,7 +475,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
reader.incrementState();
- case 16:
+ case 14:
ownedValKeys = reader.readCollection("ownedValKeys", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -483,7 +483,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
reader.incrementState();
- case 17:
+ case 15:
ownedValVals = reader.readCollection("ownedValVals", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -491,7 +491,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
reader.incrementState();
- case 18:
+ case 16:
pending = reader.readCollection("pending", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -499,7 +499,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
reader.incrementState();
- case 19:
+ case 17:
retVal = reader.readMessage("retVal");
if (!reader.isLastRead())
@@ -507,7 +507,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
reader.incrementState();
- case 20:
+ case 18:
writeVer = reader.readMessage("writeVer");
if (!reader.isLastRead())
@@ -527,7 +527,7 @@ public class GridNearTxPrepareResponse extends GridDistributedTxPrepareResponse
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 21;
+ return 19;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java
index 3eb5dc0..292e04d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java
@@ -83,7 +83,7 @@ public class GridNearUnlockRequest extends GridDistributedUnlockRequest {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 9;
+ return 8;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
index e6d71aa..01662ef 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
@@ -1065,8 +1065,6 @@ public class IgniteTxHandler {
if (!F.isEmpty(req.writes())) {
GridDhtTxRemote tx = ctx.tm().tx(req.version());
- assert F.isEmpty(req.candidatesByKey());
-
if (tx == null) {
tx = new GridDhtTxRemote(
ctx,
@@ -1197,7 +1195,6 @@ public class IgniteTxHandler {
*/
@Nullable public GridNearTxRemote startNearRemoteTx(ClassLoader ldr, UUID nodeId,
GridDhtTxPrepareRequest req) throws IgniteCheckedException {
- assert F.isEmpty(req.candidatesByKey());
if (!F.isEmpty(req.nearWrites())) {
GridNearTxRemote tx = ctx.tm().nearTx(req.version());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
index 4fdc027..b210625 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
@@ -186,6 +186,7 @@ public class GridQueryNextPageResponse implements Message {
return false;
writer.incrementState();
+
}
return true;
[27/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/ignite-sprint-6' into ignite-sprint-6
Posted by se...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-6' into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e188e185
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e188e185
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e188e185
Branch: refs/heads/ignite-484-1
Commit: e188e185679fc7b0203ba88f9e3f5ede0998da38
Parents: b84e102 cf32324
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Thu Jun 11 18:47:25 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Thu Jun 11 18:47:25 2015 +0300
----------------------------------------------------------------------
.../src/main/java/org/apache/ignite/internal/IgniteKernal.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
[03/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: merge
from ignite-545
Posted by se...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/455b96fc/modules/core/src/main/java/org/jsr166/ConcurrentLinkedDeque8.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/jsr166/ConcurrentLinkedDeque8.java b/modules/core/src/main/java/org/jsr166/ConcurrentLinkedDeque8.java
index 630db1c..9c8c2db 100644
--- a/modules/core/src/main/java/org/jsr166/ConcurrentLinkedDeque8.java
+++ b/modules/core/src/main/java/org/jsr166/ConcurrentLinkedDeque8.java
@@ -5,8 +5,12 @@
*/
/*
- * The initial version of this file was copied from JSR-166:
- * http://gee.cs.oswego.edu/dl/concurrency-interest/
+ * The latest version of the file corresponds to the following CVS commit:
+ * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/
+ * ConcurrentLinkedDeque.java?pathrev=1.33
+ *
+ * The later versions use JDK 8 specific classes that are unavailable in JDK 7.
+ * Thus those commits can't be imported.
*/
package org.jsr166;
@@ -18,6 +22,7 @@ import java.security.*;
import java.util.*;
import java.util.Queue;
+
/**
* An unbounded concurrent {@linkplain Deque deque} based on linked nodes.
* Concurrent insertion, removal, and access operations execute safely
@@ -55,13 +60,21 @@ import java.util.Queue;
* <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
* actions subsequent to the access or removal of that element from
* the {@code ConcurrentLinkedDeque} in another thread.
- * <p>
- * Written by Doug Lea and Martin Buchholz with assistance from members of
- * JCP JSR-166 Expert Group and released to the public domain, as explained
- * at http://creativecommons.org/publicdomain/zero/1.0/
+ *
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @since 1.7
+ * @author Doug Lea
+ * @author Martin Buchholz
+ * @param <E> the type of elements held in this collection
*/
-@SuppressWarnings( {"ALL"})
-public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements Deque<E> {
+@SuppressWarnings("ALL")
+public class ConcurrentLinkedDeque8<E>
+ extends AbstractCollection<E>
+ implements Deque<E>, java.io.Serializable {
+
/*
* This is an implementation of a concurrent lock-free deque
* supporting interior removes but not interior insertions, as
@@ -213,6 +226,8 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* good as we can hope for.
*/
+ private static final long serialVersionUID = 876323262645176354L;
+
/**
* A node from which the first node on list (that is, the unique node p
* with p.prev == null && p.next != p) can be reached in O(1) time.
@@ -226,7 +241,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* - head.item may or may not be null
* - head may not be reachable from the first or last node, or from tail
*/
- private volatile Node<E> head;
+ private transient volatile Node<E> head;
/**
* A node from which the last node on list (that is, the unique node p
@@ -240,12 +255,11 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* - tail.item may or may not be null
* - tail may not be reachable from the first or last node, or from head
*/
- private volatile Node<E> tail;
+ private transient volatile Node<E> tail;
/** */
private final LongAdder8 size = new LongAdder8();
- /** Previous and next terminators. */
private static final Node<Object> PREV_TERMINATOR, NEXT_TERMINATOR;
@SuppressWarnings("unchecked")
@@ -258,29 +272,17 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
return (Node<E>) NEXT_TERMINATOR;
}
- /**
- * Internal node element.
- *
- * @param <E> Node item.
- */
- @SuppressWarnings( {"PackageVisibleField", "PackageVisibleInnerClass"})
public static final class Node<E> {
volatile Node<E> prev;
volatile E item;
volatile Node<E> next;
- /**
- * Default constructor for NEXT_TERMINATOR, PREV_TERMINATOR.
- */
- Node() {
- // No-op.
+ Node() { // default constructor for NEXT_TERMINATOR, PREV_TERMINATOR
}
/**
* Constructs a new node. Uses relaxed write because item can
* only be seen after publication via casNext or casPrev.
- *
- * @param item Item to initialize.
*/
Node(E item) {
UNSAFE.putObject(this, itemOffset, item);
@@ -293,73 +295,44 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
return item;
}
- /**
- * @param cmp Compare value.
- * @param val New value.
- * @return {@code True} if set.
- */
boolean casItem(E cmp, E val) {
return UNSAFE.compareAndSwapObject(this, itemOffset, cmp, val);
}
- /**
- * @param val New value.
- */
void lazySetNext(Node<E> val) {
UNSAFE.putOrderedObject(this, nextOffset, val);
}
- /**
- * @param cmp Compare value.
- * @param val New value.
- * @return {@code True} if set.
- */
boolean casNext(Node<E> cmp, Node<E> val) {
return UNSAFE.compareAndSwapObject(this, nextOffset, cmp, val);
}
- /**
- * @param val New value.
- */
void lazySetPrev(Node<E> val) {
UNSAFE.putOrderedObject(this, prevOffset, val);
}
- /**
- * @param cmp Compare value.
- * @param val New value.
- * @return {@code True} if set.
- */
boolean casPrev(Node<E> cmp, Node<E> val) {
return UNSAFE.compareAndSwapObject(this, prevOffset, cmp, val);
}
- /** Unsafe. */
- private static final Unsafe UNSAFE;
+ // Unsafe mechanics
- /** Previous field offset. */
+ private static final sun.misc.Unsafe UNSAFE;
private static final long prevOffset;
-
- /** Item field offset. */
private static final long itemOffset;
-
- /** Next field offset. */
private static final long nextOffset;
- /**
- * Initialize offsets.
- */
static {
try {
UNSAFE = unsafe();
-
- Class k = Node.class;
-
- prevOffset = UNSAFE.objectFieldOffset(k.getDeclaredField("prev"));
- itemOffset = UNSAFE.objectFieldOffset(k.getDeclaredField("item"));
- nextOffset = UNSAFE.objectFieldOffset(k.getDeclaredField("next"));
- }
- catch (Exception e) {
+ Class<?> k = Node.class;
+ prevOffset = UNSAFE.objectFieldOffset
+ (k.getDeclaredField("prev"));
+ itemOffset = UNSAFE.objectFieldOffset
+ (k.getDeclaredField("item"));
+ nextOffset = UNSAFE.objectFieldOffset
+ (k.getDeclaredField("next"));
+ } catch (Exception e) {
throw new Error(e);
}
}
@@ -376,9 +349,10 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
final Node<E> newNode = new Node<E>(e);
restartFromHead:
- for (;;) {
+ for (;;)
for (Node<E> h = head, p = h, q;;) {
- if ((q = p.prev) != null && (q = (p = q).prev) != null)
+ if ((q = p.prev) != null &&
+ (q = (p = q).prev) != null)
// Check for head updates every other hop.
// If p == q, we are sure to follow head instead.
p = (h != (h = head)) ? h : q;
@@ -386,21 +360,18 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
continue restartFromHead;
else {
// p is first node
- newNode.lazySetNext(p); // CAS piggyback.
-
+ newNode.lazySetNext(p); // CAS piggyback
if (p.casPrev(null, newNode)) {
// Successful CAS is the linearization point
// for e to become an element of this deque,
// and for newNode to become "live".
if (p != h) // hop two nodes at a time
casHead(h, newNode); // Failure is OK.
-
return;
}
// Lost CAS race to another thread; re-read prev
}
}
- }
}
/**
@@ -446,8 +417,6 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
/**
* Links e as last element.
- *
- * @param e Element to link.
*/
private void linkLast(E e) {
checkNotNull(e);
@@ -457,9 +426,10 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
final Node<E> newNode = new Node<E>(e);
restartFromTail:
- for (;;) {
+ for (;;)
for (Node<E> t = tail, p = t, q;;) {
- if ((q = p.next) != null && (q = (p = q).next) != null)
+ if ((q = p.next) != null &&
+ (q = (p = q).next) != null)
// Check for tail updates every other hop.
// If p == q, we are sure to follow tail instead.
p = (t != (t = tail)) ? t : q;
@@ -467,21 +437,18 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
continue restartFromTail;
else {
// p is last node
- newNode.lazySetPrev(p); // CAS piggyback.
-
+ newNode.lazySetPrev(p); // CAS piggyback
if (p.casNext(null, newNode)) {
// Successful CAS is the linearization point
// for e to become an element of this deque,
// and for newNode to become "live".
if (p != t) // hop two nodes at a time
casTail(t, newNode); // Failure is OK.
-
return;
}
// Lost CAS race to another thread; re-read next
}
}
- }
}
/**
@@ -563,7 +530,6 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
}
}
- /** Number of HOPs before unlinking head or tail. */
private static final int HOPS = 2;
/**
@@ -589,7 +555,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
/**
* Unlinks non-null node x.
*/
- private void unlink(Node<E> x) {
+ void unlink(Node<E> x) {
// assert x != null;
// assert x.item == null;
// assert x != PREV_TERMINATOR;
@@ -601,11 +567,11 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
// Unlink should not be called twice for the same node.
size.decrement();
- if (prev == null)
+ if (prev == null) {
unlinkFirst(x, next);
- else if (next == null)
+ } else if (next == null) {
unlinkLast(x, prev);
- else {
+ } else {
// Unlink interior node.
//
// This is the common case, since a series of polls at the
@@ -626,31 +592,22 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
// tail/head, before setting x's prev/next links to their
// logical approximate replacements, self/TERMINATOR.
Node<E> activePred, activeSucc;
-
boolean isFirst, isLast;
-
int hops = 1;
// Find active predecessor
for (Node<E> p = prev; ; ++hops) {
if (p.item != null) {
activePred = p;
-
isFirst = false;
-
break;
}
-
Node<E> q = p.prev;
-
if (q == null) {
if (p.next == p)
return;
-
activePred = p;
-
isFirst = true;
-
break;
}
else if (p == q)
@@ -663,22 +620,15 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
for (Node<E> p = next; ; ++hops) {
if (p.item != null) {
activeSucc = p;
-
isLast = false;
-
break;
}
-
Node<E> q = p.next;
-
if (q == null) {
if (p.prev == p)
return;
-
activeSucc = p;
-
isLast = true;
-
break;
}
else if (p == q)
@@ -688,8 +638,9 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
}
// TODO: better HOP heuristics
- // Always squeeze out interior deleted nodes.
- if (hops < HOPS && (isFirst | isLast))
+ if (hops < HOPS
+ // always squeeze out interior deleted nodes
+ && (isFirst | isLast))
return;
// Squeeze out deleted nodes between activePred and
@@ -699,6 +650,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
// Try to gc-unlink, if possible
if ((isFirst | isLast) &&
+
// Recheck expected state of predecessor and successor
(activePred.next == activeSucc) &&
(activeSucc.prev == activePred) &&
@@ -793,11 +745,11 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
// Either head already points to an active node, or we keep
// trying to cas it to the first node until it does.
Node<E> h, p, q;
-
restartFromHead:
while ((h = head).item == null && (p = h.prev) != null) {
for (;;) {
- if ((q = p.prev) == null || (q = (p = q).prev) == null) {
+ if ((q = p.prev) == null ||
+ (q = (p = q).prev) == null) {
// It is possible that p is PREV_TERMINATOR,
// but if so, the CAS is guaranteed to fail.
if (casHead(h, p))
@@ -823,11 +775,11 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
// Either tail already points to an active node, or we keep
// trying to cas it to the last node until it does.
Node<E> t, p, q;
-
restartFromTail:
while ((t = tail).item == null && (p = t.next) != null) {
for (;;) {
- if ((q = p.next) == null || (q = (p = q).next) == null) {
+ if ((q = p.next) == null ||
+ (q = (p = q).next) == null) {
// It is possible that p is NEXT_TERMINATOR,
// but if so, the CAS is guaranteed to fail.
if (casTail(t, p))
@@ -843,9 +795,6 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
}
}
- /**
- * @param x Node to start from.
- */
private void skipDeletedPredecessors(Node<E> x) {
whileActive:
do {
@@ -854,18 +803,14 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
// assert x != NEXT_TERMINATOR;
// assert x != PREV_TERMINATOR;
Node<E> p = prev;
-
findActive:
for (;;) {
if (p.item != null)
break findActive;
-
Node<E> q = p.prev;
-
if (q == null) {
if (p.next == p)
continue whileActive;
-
break findActive;
}
else if (p == q)
@@ -881,9 +826,6 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
} while (x.item != null || x.next == null);
}
- /**
- * @param x Node to start from.
- */
private void skipDeletedSuccessors(Node<E> x) {
whileActive:
do {
@@ -892,19 +834,14 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
// assert x != NEXT_TERMINATOR;
// assert x != PREV_TERMINATOR;
Node<E> p = next;
-
findActive:
-
for (;;) {
if (p.item != null)
break findActive;
-
Node<E> q = p.next;
-
if (q == null) {
if (p.prev == p)
continue whileActive;
-
break findActive;
}
else if (p == q)
@@ -917,22 +854,17 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
if (next == p || x.casNext(next, p))
return;
- }
- while (x.item != null || x.prev == null);
+ } while (x.item != null || x.prev == null);
}
/**
* Returns the successor of p, or the first node if p.next has been
* linked to self, which will only be true if traversing with a
* stale pointer that is now off the list.
- *
- * @param p Node to find successor for.
- * @return Successor node.
*/
- final Node<E> successor(Node<E> p) {
+ final Node<E> succ(Node<E> p) {
// TODO: should we skip deleted nodes here?
Node<E> q = p.next;
-
return (p == q) ? first() : q;
}
@@ -940,11 +872,8 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* Returns the predecessor of p, or the last node if p.prev has been
* linked to self, which will only be true if traversing with a
* stale pointer that is now off the list.
- *
- * @param p Node to find predecessor for.
- * @return Predecessor node.
*/
- final Node<E> predecessor(Node<E> p) {
+ final Node<E> pred(Node<E> p) {
Node<E> q = p.prev;
return (p == q) ? last() : q;
}
@@ -954,10 +883,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* p.prev == null && p.next != p
* The returned node may or may not be logically deleted.
* Guarantees that head is set to the returned node.
- *
- * @return First node.
*/
- @SuppressWarnings( {"TooBroadScope"})
Node<E> first() {
restartFromHead:
for (;;)
@@ -982,10 +908,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* p.next == null && p.prev != p
* The returned node may or may not be logically deleted.
* Guarantees that tail is set to the returned node.
- *
- * @return Last node.
*/
- @SuppressWarnings( {"TooBroadScope"})
Node<E> last() {
restartFromTail:
for (;;)
@@ -1005,6 +928,8 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
}
}
+ // Minor convenience utilities
+
/**
* Throws NullPointerException if argument is null.
*
@@ -1025,7 +950,6 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
private E screenNullResult(E v) {
if (v == null)
throw new NoSuchElementException();
-
return v;
}
@@ -1033,18 +957,15 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* Creates an array list and fills it with elements of this list.
* Used by toArray.
*
- * @return the arrayList
+ * @return the array list
*/
private ArrayList<E> toArrayList() {
ArrayList<E> list = new ArrayList<E>();
-
- for (Node<E> p = first(); p != null; p = successor(p)) {
+ for (Node<E> p = first(); p != null; p = succ(p)) {
E item = p.item;
-
if (item != null)
list.add(item);
}
-
return list;
}
@@ -1052,7 +973,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* Constructs an empty deque.
*/
public ConcurrentLinkedDeque8() {
- head = tail = new Node<E>();
+ head = tail = new Node<E>(null);
}
/**
@@ -1064,15 +985,12 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* @throws NullPointerException if the specified collection or any
* of its elements are null
*/
- public ConcurrentLinkedDeque8(Iterable<? extends E> c) {
+ public ConcurrentLinkedDeque8(Collection<? extends E> c) {
// Copy c into a private chain of Nodes
Node<E> h = null, t = null;
-
for (E e : c) {
checkNotNull(e);
-
Node<E> newNode = new Node<E>(e);
-
if (h == null)
h = t = newNode;
else {
@@ -1081,15 +999,11 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
t = newNode;
}
}
-
initHeadTail(h, t);
}
/**
* Initializes head and tail, ensuring invariants hold.
- *
- * @param h Head.
- * @param t Tail.
*/
private void initHeadTail(Node<E> h, Node<E> t) {
if (h == t) {
@@ -1098,15 +1012,11 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
else {
// Avoid edge case of a single Node with non-null item.
Node<E> newNode = new Node<E>(null);
-
t.lazySetNext(newNode);
-
newNode.lazySetPrev(t);
-
t = newNode;
}
}
-
head = h;
tail = t;
}
@@ -1118,21 +1028,11 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
*
* @throws NullPointerException if the specified element is null
*/
- @Override public void addFirst(E e) {
+ public void addFirst(E e) {
linkFirst(e);
}
/**
- * Same as {@link #addFirst(Object)}, but returns new node.
- *
- * @param e Element to add.
- * @return New node.
- */
- public Node<E> addFirstx(E e) {
- return linkFirstx(e);
- }
-
- /**
* Inserts the specified element at the end of this deque.
* As the deque is unbounded, this method will never throw
* {@link IllegalStateException}.
@@ -1141,7 +1041,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
*
* @throws NullPointerException if the specified element is null
*/
- @Override public void addLast(E e) {
+ public void addLast(E e) {
linkLast(e);
}
@@ -1162,9 +1062,8 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* @return {@code true} (as specified by {@link Deque#offerFirst})
* @throws NullPointerException if the specified element is null
*/
- @Override public boolean offerFirst(E e) {
+ public boolean offerFirst(E e) {
linkFirst(e);
-
return true;
}
@@ -1187,9 +1086,8 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* @return {@code true} (as specified by {@link Deque#offerLast})
* @throws NullPointerException if the specified element is null
*/
- @Override public boolean offerLast(E e) {
+ public boolean offerLast(E e) {
linkLast(e);
-
return true;
}
@@ -1203,15 +1101,12 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
return linkLastx(e);
}
- /** {@inheritDoc} */
- @Override public E peekFirst() {
- for (Node<E> p = first(); p != null; p = successor(p)) {
+ public E peekFirst() {
+ for (Node<E> p = first(); p != null; p = succ(p)) {
E item = p.item;
-
if (item != null)
return item;
}
-
return null;
}
@@ -1222,7 +1117,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* @return The header node of this deque, or <tt>null</tt> if this deque is empty
*/
public Node<E> peekFirstx() {
- for (Node<E> p = first(); p != null; p = successor(p)) {
+ for (Node<E> p = first(); p != null; p = succ(p)) {
E item = p.item;
if (item != null)
@@ -1232,76 +1127,67 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
return null;
}
- /** {@inheritDoc} */
- @Override public E peekLast() {
- for (Node<E> p = last(); p != null; p = predecessor(p)) {
+ public E peekLast() {
+ for (Node<E> p = last(); p != null; p = pred(p)) {
E item = p.item;
-
if (item != null)
return item;
}
-
return null;
}
/**
* @throws NoSuchElementException {@inheritDoc}
*/
- @Override public E getFirst() {
+ public E getFirst() {
return screenNullResult(peekFirst());
}
/**
* @throws NoSuchElementException {@inheritDoc}
*/
- @Override public E getLast() {
+ public E getLast() {
return screenNullResult(peekLast());
}
- /** {@inheritDoc} */
- @Override public E pollFirst() {
- for (Node<E> p = first(); p != null; p = successor(p)) {
+ public E pollFirst() {
+ for (Node<E> p = first(); p != null; p = succ(p)) {
E item = p.item;
-
if (item != null && p.casItem(item, null)) {
unlink(p);
-
return item;
}
}
-
return null;
}
- /** {@inheritDoc} */
- @Override public E pollLast() {
- for (Node<E> p = last(); p != null; p = predecessor(p)) {
+ public E pollLast() {
+ for (Node<E> p = last(); p != null; p = pred(p)) {
E item = p.item;
-
if (item != null && p.casItem(item, null)) {
unlink(p);
-
return item;
}
}
-
return null;
}
/**
* @throws NoSuchElementException {@inheritDoc}
*/
- @Override public E removeFirst() {
+ public E removeFirst() {
return screenNullResult(pollFirst());
}
/**
* @throws NoSuchElementException {@inheritDoc}
*/
- @Override public E removeLast() {
+ public E removeLast() {
return screenNullResult(pollLast());
}
+ // *** Queue and stack methods ***
+
/**
* Inserts the specified element at the tail of this deque.
* As the deque is unbounded, this method will never return {@code false}.
@@ -1309,21 +1195,11 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* @return {@code true} (as specified by {@link Queue#offer})
* @throws NullPointerException if the specified element is null
*/
- @Override public boolean offer(E e) {
+ public boolean offer(E e) {
return offerLast(e);
}
/**
- * Same as {@link #offer(Object)}, but returns new {@link Node}.
- *
- * @param e Element to add.
- * @return New node.
- */
- public Node<E> offerx(E e) {
- return offerLastx(e);
- }
-
- /**
* Inserts the specified element at the tail of this deque.
* As the deque is unbounded, this method will never throw
* {@link IllegalStateException} or return {@code false}.
@@ -1331,7 +1207,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* @return {@code true} (as specified by {@link Collection#add})
* @throws NullPointerException if the specified element is null
*/
- @Override public boolean add(E e) {
+ public boolean add(E e) {
return offerLast(e);
}
@@ -1345,20 +1221,12 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
return offerLastx(e);
}
- /** {@inheritDoc} */
- @Override public E poll() {
- return pollFirst();
- }
-
- /** {@inheritDoc} */
- @Override public E remove() {
- return removeFirst();
- }
-
- /** {@inheritDoc} */
- @Override public E peek() {
- return peekFirst();
- }
+ public E poll() { return pollFirst(); }
+ public E remove() { return removeFirst(); }
+ public E peek() { return peekFirst(); }
+ public E element() { return getFirst(); }
+ public void push(E e) { addFirst(e); }
+ public E pop() { return removeFirst(); }
/**
* Retrieves, but does not remove, the header node of the queue represented by
@@ -1374,21 +1242,6 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
return peekFirstx();
}
- /** {@inheritDoc} */
- @Override public E element() {
- return getFirst();
- }
-
- /** {@inheritDoc} */
- @Override public void push(E e) {
- addFirst(e);
- }
-
- /** {@inheritDoc} */
- @Override public E pop() {
- return removeFirst();
- }
-
/**
* Removes the first element {@code e} such that
* {@code o.equals(e)}, if such an element exists in this deque.
@@ -1398,19 +1251,15 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* @return {@code true} if the deque contained the specified element
* @throws NullPointerException if the specified element is null
*/
- @Override public boolean removeFirstOccurrence(Object o) {
+ public boolean removeFirstOccurrence(Object o) {
checkNotNull(o);
-
- for (Node<E> p = first(); p != null; p = successor(p)) {
+ for (Node<E> p = first(); p != null; p = succ(p)) {
E item = p.item;
-
if (item != null && o.equals(item) && p.casItem(item, null)) {
unlink(p);
-
return true;
}
}
-
return false;
}
@@ -1423,19 +1272,15 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* @return {@code true} if the deque contained the specified element
* @throws NullPointerException if the specified element is null
*/
- @Override public boolean removeLastOccurrence(Object o) {
+ public boolean removeLastOccurrence(Object o) {
checkNotNull(o);
-
- for (Node<E> p = last(); p != null; p = predecessor(p)) {
+ for (Node<E> p = last(); p != null; p = pred(p)) {
E item = p.item;
-
if (item != null && o.equals(item) && p.casItem(item, null)) {
unlink(p);
-
return true;
}
}
-
return false;
}
@@ -1446,17 +1291,13 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* @param o element whose presence in this deque is to be tested
* @return {@code true} if this deque contains the specified element
*/
- @Override public boolean contains(Object o) {
- if (o == null)
- return false;
-
- for (Node<E> p = first(); p != null; p = successor(p)) {
+ public boolean contains(Object o) {
+ if (o == null) return false;
+ for (Node<E> p = first(); p != null; p = succ(p)) {
E item = p.item;
-
if (item != null && o.equals(item))
return true;
}
-
return false;
}
@@ -1465,7 +1306,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
*
* @return {@code true} if this collection contains no elements
*/
- @Override public boolean isEmpty() {
+ public boolean isEmpty() {
return peekFirst() == null;
}
@@ -1497,16 +1338,14 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
*
* @return the number of elements in this deque
*/
- @Override public int size() {
- int cnt = 0;
-
- for (Node<E> p = first(); p != null; p = successor(p))
+ public int size() {
+ int count = 0;
+ for (Node<E> p = first(); p != null; p = succ(p))
if (p.item != null)
// Collection.size() spec says to max out
- if (++cnt == Integer.MAX_VALUE)
+ if (++count == Integer.MAX_VALUE)
break;
-
- return cnt;
+ return count;
}
/**
@@ -1525,7 +1364,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* @return {@code true} if the deque contained the specified element
* @throws NullPointerException if the specified element is null
*/
- @Override public boolean remove(Object o) {
+ public boolean remove(Object o) {
return removeFirstOccurrence(o);
}
@@ -1541,8 +1380,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* of its elements are null
* @throws IllegalArgumentException if the collection is this deque
*/
- @SuppressWarnings( {"TooBroadScope"})
- @Override public boolean addAll(Collection<? extends E> c) {
+ public boolean addAll(Collection<? extends E> c) {
if (c == this)
// As historically specified in AbstractQueue#addAll
throw new IllegalArgumentException();
@@ -1554,19 +1392,14 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
for (E e : c) {
checkNotNull(e);
-
Node<E> newNode = new Node<E>(e);
-
if (beginningOfTheEnd == null) {
beginningOfTheEnd = last = newNode;
-
s++;
}
else {
last.lazySetNext(newNode);
-
newNode.lazySetPrev(last);
-
last = newNode;
s++;
@@ -1580,9 +1413,10 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
// Atomically append the chain at the tail of this collection
restartFromTail:
- for (;;) {
+ for (;;)
for (Node<E> t = tail, p = t, q;;) {
- if ((q = p.next) != null && (q = (p = q).next) != null)
+ if ((q = p.next) != null &&
+ (q = (p = q).next) != null)
// Check for tail updates every other hop.
// If p == q, we are sure to follow tail instead.
p = (t != (t = tail)) ? t : q;
@@ -1591,7 +1425,6 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
else {
// p is last node
beginningOfTheEnd.lazySetPrev(p); // CAS piggyback
-
if (p.casNext(null, beginningOfTheEnd)) {
// Successful CAS is the linearization point
// for all elements to be added to this deque.
@@ -1599,26 +1432,22 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
// Try a little harder to update tail,
// since we may be adding many elements.
t = tail;
-
if (last.next == null)
casTail(t, last);
}
-
return true;
}
// Lost CAS race to another thread; re-read next
}
}
- }
}
/**
* Removes all of the elements from this deque.
*/
- @Override public void clear() {
- while (pollFirst() != null) {
- // No-op.
- }
+ public void clear() {
+ while (pollFirst() != null)
+ ;
}
/**
@@ -1634,7 +1463,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
*
* @return an array containing all of the elements in this deque
*/
- @Override public Object[] toArray() {
+ public Object[] toArray() {
return toArrayList().toArray();
}
@@ -1661,8 +1490,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* The following code can be used to dump the deque into a newly
* allocated array of {@code String}:
*
- * <pre>
- * String[] y = x.toArray(new String[0]);</pre>
+ * <pre> {@code String[] y = x.toArray(new String[0]);}</pre>
*
* Note that {@code toArray(new Object[0])} is identical in function to
* {@code toArray()}.
@@ -1676,8 +1504,7 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
* this deque
* @throws NullPointerException if the specified array is null
*/
- @SuppressWarnings( {"SuspiciousToArrayCall"})
- @Override public <T> T[] toArray(T[] a) {
+ public <T> T[] toArray(T[] a) {
return toArrayList().toArray(a);
}
@@ -1694,8 +1521,8 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
*
* @return an iterator over the elements in this deque in proper sequence
*/
- @Override public Iterator<E> iterator() {
- return new Iter();
+ public Iterator<E> iterator() {
+ return new Itr();
}
/**
@@ -1712,26 +1539,11 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
*
* @return an iterator over the elements in this deque in reverse order
*/
- @Override public Iterator<E> descendingIterator() {
- return new DescendingIter();
- }
-
- /**
- * Extended iterator interface.
- */
- public interface IteratorEx<E> extends Iterator<E> {
- /**
- * Same semantics as iterator's remove, but will return {@code false} if remove did not happen.
- *
- * @return {@code True} if element was removed by this call, {@code false} otherwise.
- */
- public boolean removex();
+ public Iterator<E> descendingIterator() {
+ return new DescendingItr();
}
- /**
- * Abstract iterator.
- */
- private abstract class AbstractIter implements IteratorEx<E> {
+ private abstract class AbstractItr implements Iterator<E> {
/**
* Next node to return item for.
*/
@@ -1751,21 +1563,10 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
*/
private Node<E> lastRet;
- /**
- * @return Starting node.
- */
abstract Node<E> startNode();
-
- /**
- * @param p Node.
- * @return Next node.
- */
abstract Node<E> nextNode(Node<E> p);
- /**
- * Advances to first element.
- */
- AbstractIter() {
+ AbstractItr() {
advance();
}
@@ -1777,150 +1578,127 @@ public class ConcurrentLinkedDeque8<E> extends AbstractCollection<E> implements
lastRet = nextNode;
Node<E> p = (nextNode == null) ? startNode() : nextNode(nextNode);
-
for (;; p = nextNode(p)) {
if (p == null) {
// p might be active end or TERMINATOR node; both are OK
nextNode = null;
nextItem = null;
-
break;
}
-
E item = p.item;
-
if (item != null) {
nextNode = p;
nextItem = item;
-
break;
}
}
}
- /** {@inheritDoc} */
- @Override public boolean hasNext() {
+ public boolean hasNext() {
return nextItem != null;
}
- /** {@inheritDoc} */
- @Override public E next() {
+ public E next() {
E item = nextItem;
-
- if (item == null)
- throw new NoSuchElementException();
-
+ if (item == null) throw new NoSuchElementException();
advance();
-
return item;
}
- /** {@inheritDoc} */
- @Override public void remove() {
+ public void remove() {
Node<E> l = lastRet;
-
- if (l == null)
- throw new IllegalStateException();
-
- unlinkx(l);
-
+ if (l == null) throw new IllegalStateException();
+ l.item = null;
+ unlink(l);
lastRet = null;
}
+ }
- /** {@inheritDoc} */
- @Override public boolean removex() {
- Node<E> l = lastRet;
-
- if (l == null)
- throw new IllegalStateException();
-
- boolean res = unlinkx(l);
-
- lastRet = null;
+ /** Forward iterator */
+ private class Itr extends AbstractItr {
+ Node<E> startNode() { return first(); }
+ Node<E> nextNode(Node<E> p) { return succ(p); }
+ }
- return res;
- }
+ /** Descending iterator */
+ private class DescendingItr extends AbstractItr {
+ Node<E> startNode() { return last(); }
+ Node<E> nextNode(Node<E> p) { return pred(p); }
}
/**
- * Forward iterator
+ * Saves this deque to a stream (that is, serializes it).
+ *
+ * @serialData All of the elements (each an {@code E}) in
+ * the proper order, followed by a null
*/
- private class Iter extends AbstractIter {
- /** {@inheritDoc} */
- @Override Node<E> startNode() {
- return first();
- }
+ private void writeObject(java.io.ObjectOutputStream s)
+ throws java.io.IOException {
+
+ // Write out any hidden stuff
+ s.defaultWriteObject();
- /** {@inheritDoc} */
- @Override Node<E> nextNode(Node<E> p) {
- return successor(p);
+ // Write out all elements in the proper order.
+ for (Node<E> p = first(); p != null; p = succ(p)) {
+ E item = p.item;
+ if (item != null)
+ s.writeObject(item);
}
+
+ // Use trailing null as sentinel
+ s.writeObject(null);
}
/**
- * Descending iterator.
+ * Reconstitutes this deque from a stream (that is, deserializes it).
*/
- private class DescendingIter extends AbstractIter {
- /** {@inheritDoc} */
- @Override Node<E> startNode() {
- return last();
- }
+ private void readObject(java.io.ObjectInputStream s)
+ throws java.io.IOException, ClassNotFoundException {
+ s.defaultReadObject();
- /** {@inheritDoc} */
- @Override Node<E> nextNode(Node<E> p) {
- return predecessor(p);
+ // Read in elements until trailing null sentinel found
+ Node<E> h = null, t = null;
+ Object item;
+ while ((item = s.readObject()) != null) {
+ @SuppressWarnings("unchecked")
+ Node<E> newNode = new Node<E>((E) item);
+ if (h == null)
+ h = t = newNode;
+ else {
+ t.lazySetNext(newNode);
+ newNode.lazySetPrev(t);
+ t = newNode;
+ }
}
+ initHeadTail(h, t);
}
- /**
- * CAS for head.
- *
- * @param cmp Compare value.
- * @param val New value.
- * @return {@code True} if set.
- */
private boolean casHead(Node<E> cmp, Node<E> val) {
return UNSAFE.compareAndSwapObject(this, headOffset, cmp, val);
}
- /**
- * CAS for tail.
- *
- * @param cmp Compare value.
- * @param val New value.
- * @return {@code True} if set.
- */
private boolean casTail(Node<E> cmp, Node<E> val) {
return UNSAFE.compareAndSwapObject(this, tailOffset, cmp, val);
}
- /** Unsafe. */
- private static final Unsafe UNSAFE;
+ // Unsafe mechanics
- /** Head offset. */
+ private static final sun.misc.Unsafe UNSAFE;
private static final long headOffset;
-
- /** Tail offset. */
private static final long tailOffset;
-
- /**
- * Initialize terminators using unsafe semantics.
- */
static {
PREV_TERMINATOR = new Node<Object>();
PREV_TERMINATOR.next = PREV_TERMINATOR;
NEXT_TERMINATOR = new Node<Object>();
NEXT_TERMINATOR.prev = NEXT_TERMINATOR;
-
try {
UNSAFE = unsafe();
-
- Class cls = ConcurrentLinkedDeque8.class;
-
- headOffset = UNSAFE.objectFieldOffset(cls.getDeclaredField("head"));
- tailOffset = UNSAFE.objectFieldOffset(cls.getDeclaredField("tail"));
- }
- catch (Exception e) {
+ Class<?> k = ConcurrentLinkedDeque8.class;
+ headOffset = UNSAFE.objectFieldOffset
+ (k.getDeclaredField("head"));
+ tailOffset = UNSAFE.objectFieldOffset
+ (k.getDeclaredField("tail"));
+ } catch (Exception e) {
throw new Error(e);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/455b96fc/modules/core/src/main/java/org/jsr166/LongAdder8.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/jsr166/LongAdder8.java b/modules/core/src/main/java/org/jsr166/LongAdder8.java
index 2480a5d..79ea32e 100644
--- a/modules/core/src/main/java/org/jsr166/LongAdder8.java
+++ b/modules/core/src/main/java/org/jsr166/LongAdder8.java
@@ -5,8 +5,11 @@
*/
/*
- * The initial version of this file was copied from JSR-166:
- * http://gee.cs.oswego.edu/dl/concurrency-interest/
+ * The latest version of the file corresponds to the following CVS commit:
+ * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/atomic/LongAdder.java?pathrev=1.3
+ *
+ * The later versions are based on updated Striped64 that uses java.util.function package which is unavailable in JDK 7.
+ * Thus they can't be imported.
*/
package org.jsr166;
@@ -22,7 +25,7 @@ import java.util.concurrent.atomic.*;
* #longValue}) returns the current total combined across the
* variables maintaining the sum.
*
- * <p> This class is usually preferable to {@link AtomicLong} when
+ * <p>This class is usually preferable to {@link AtomicLong} when
* multiple threads update a common sum that is used for purposes such
* as collecting statistics, not for fine-grained synchronization
* control. Under low update contention, the two classes have similar
@@ -36,7 +39,7 @@ import java.util.concurrent.atomic.*;
* collection keys.
*
* <p><em>jsr166e note: This class is targeted to be placed in
- * java.util.concurrent.atomic<em>
+ * java.util.concurrent.atomic.</em>
*
* @since 1.8
* @author Doug Lea
@@ -67,8 +70,8 @@ public class LongAdder8 extends Striped64_8 implements Serializable {
boolean uncontended = true;
int h = (hc = threadHashCode.get()).code;
if (as == null || (n = as.length) < 1 ||
- (a = as[(n - 1) & h]) == null ||
- !(uncontended = a.cas(v = a.value, v + x)))
+ (a = as[(n - 1) & h]) == null ||
+ !(uncontended = a.cas(v = a.value, v + x)))
retryUpdate(x, hc, uncontended);
}
}
@@ -149,6 +152,14 @@ public class LongAdder8 extends Striped64_8 implements Serializable {
}
/**
+ * Returns the String representation of the {@link #sum}.
+ * @return the String representation of the {@link #sum}
+ */
+ public String toString() {
+ return Long.toString(sum());
+ }
+
+ /**
* Equivalent to {@link #sum}.
*
* @return the sum
@@ -182,25 +193,17 @@ public class LongAdder8 extends Striped64_8 implements Serializable {
}
private void writeObject(java.io.ObjectOutputStream s)
- throws java.io.IOException {
+ throws java.io.IOException {
s.defaultWriteObject();
s.writeLong(sum());
}
private void readObject(ObjectInputStream s)
- throws IOException, ClassNotFoundException {
+ throws IOException, ClassNotFoundException {
s.defaultReadObject();
busy = 0;
cells = null;
base = s.readLong();
}
- /**
- * Returns the String representation of the {@link #sum}.
- *
- * @return String representation of the {@link #sum}
- */
- public String toString() {
- return Long.toString(sum());
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/455b96fc/modules/core/src/main/java/org/jsr166/README.txt
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/jsr166/README.txt b/modules/core/src/main/java/org/jsr166/README.txt
new file mode 100644
index 0000000..491f2b4
--- /dev/null
+++ b/modules/core/src/main/java/org/jsr166/README.txt
@@ -0,0 +1,11 @@
+Package contains classes that from JSR166.
+
+The files were imported from the following repositories:
+- http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/
+- http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jdk7/
+
+To keep the imported files up-to-date each of them (except ConcurrentLinkedHashMap) contains a reference to
+a corresponding CVS commit.
+
+For more information please refer to the community page:
+http://gee.cs.oswego.edu/dl/concurrency-interest/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/455b96fc/modules/core/src/main/java/org/jsr166/Striped64_8.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/jsr166/Striped64_8.java b/modules/core/src/main/java/org/jsr166/Striped64_8.java
index 9a4b1db..7281334 100644
--- a/modules/core/src/main/java/org/jsr166/Striped64_8.java
+++ b/modules/core/src/main/java/org/jsr166/Striped64_8.java
@@ -5,8 +5,11 @@
*/
/*
- * The initial version of this file was copied from JSR-166:
- * http://gee.cs.oswego.edu/dl/concurrency-interest/
+ * The latest version of the file corresponds to the following CVS commit:
+ * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/atomic/Striped64.java?pathrev=1.1
+ *
+ * The later versions use classes from java.util.function package that are unavailable in JDK 7.
+ * Thus they can't be imported.
*/
package org.jsr166;
@@ -329,18 +332,19 @@ abstract class Striped64_8 extends Number {
} catch (SecurityException se) {
try {
return java.security.AccessController.doPrivileged
- (new java.security
- .PrivilegedExceptionAction<sun.misc.Unsafe>() {
+ (new java.security.PrivilegedExceptionAction<sun.misc.Unsafe>() {
public sun.misc.Unsafe run() throws Exception {
- java.lang.reflect.Field f = sun.misc
- .Unsafe.class.getDeclaredField("theUnsafe");
+ java.lang.reflect.Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe");
f.setAccessible(true);
- return (sun.misc.Unsafe) f.get(null);
- }});
+
+ return (sun.misc.Unsafe)f.get(null);
+ }
+ });
} catch (java.security.PrivilegedActionException e) {
throw new RuntimeException("Could not initialize intrinsics",
- e.getCause());
+ e.getCause());
}
}
}
+
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/455b96fc/modules/core/src/main/java/org/jsr166/ThreadLocalRandom8.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/jsr166/ThreadLocalRandom8.java b/modules/core/src/main/java/org/jsr166/ThreadLocalRandom8.java
index d7d5736..192db47 100644
--- a/modules/core/src/main/java/org/jsr166/ThreadLocalRandom8.java
+++ b/modules/core/src/main/java/org/jsr166/ThreadLocalRandom8.java
@@ -5,8 +5,12 @@
*/
/*
- * The initial version of this file was copied from JSR-166:
- * http://gee.cs.oswego.edu/dl/concurrency-interest/
+ * The latest version of the file corresponds to the following CVS commit:
+ * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jdk7/java/util/concurrent/
+ * ThreadLocalRandom.java.java?pathrev=1.3
+ *
+ * Note, that the repository above is JDK 7 based that is kept up-to-date too.
+ * The main repository (JDK 8 based) uses JDK 8 features significantly that unavailable in JDK 7.
*/
package org.jsr166;
@@ -22,7 +26,8 @@ import java.util.*;
* than shared {@code Random} objects in concurrent programs will
* typically encounter much less overhead and contention. Use of
* {@code ThreadLocalRandom} is particularly appropriate when multiple
- * tasks use random numbers in parallel in thread pools.
+ * tasks (for example, each a {@link ForkJoinTask}) use random numbers
+ * in parallel in thread pools.
*
* <p>Usages of this class should typically be of the form:
* {@code ThreadLocalRandom.current().nextX(...)} (where
@@ -38,7 +43,7 @@ import java.util.*;
*/
@SuppressWarnings("ALL")
public class ThreadLocalRandom8 extends Random {
- // same constants as Random, but must be re-declared because private
+ // same constants as Random, but must be redeclared because private
private static final long multiplier = 0x5DEECE66DL;
private static final long addend = 0xBL;
private static final long mask = (1L << 48) - 1;
@@ -112,9 +117,9 @@ public class ThreadLocalRandom8 extends Random {
*
* @param least the least value returned
* @param bound the upper bound (exclusive)
+ * @return the next value
* @throws IllegalArgumentException if least greater than or equal
* to bound
- * @return the next value
*/
public int nextInt(int least, int bound) {
if (least >= bound)
@@ -177,7 +182,7 @@ public class ThreadLocalRandom8 extends Random {
* @throws IllegalArgumentException if n is not positive
*/
public double nextDouble(double n) {
- if (n <= 0)
+ if (!(n > 0))
throw new IllegalArgumentException("n must be positive");
return nextDouble() * n;
}
@@ -199,4 +204,4 @@ public class ThreadLocalRandom8 extends Random {
}
private static final long serialVersionUID = -5851777807851030925L;
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/455b96fc/modules/core/src/main/java/org/jsr166/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/jsr166/package-info.java b/modules/core/src/main/java/org/jsr166/package-info.java
index 135297c..6e839bb 100644
--- a/modules/core/src/main/java/org/jsr166/package-info.java
+++ b/modules/core/src/main/java/org/jsr166/package-info.java
@@ -5,6 +5,16 @@
*/
/**
- * Classes that were originally introduced in JSR166.
+ * Package contains classes that from JSR166.
+ *
+ * The files were imported from the following repositories:
+ * - http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/
+ * - http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jdk7/
+ *
+ * To keep the imported files up-to-date each of them (except ConcurrentLinkedHashMap) contains a reference to
+ * a corresponding CVS commit.
+ *
+ * For more information please refer to the community page:
+ * http://gee.cs.oswego.edu/dl/concurrency-interest/
*/
package org.jsr166;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/455b96fc/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
index b828aad..f215efb 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
@@ -90,7 +90,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA
private static final int THREAD_CNT = 8;
/** IP finder. */
- private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+ private final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
/** Barrier for multithreaded tests. */
private static CyclicBarrier barrier;
[43/50] [abbrv] incubator-ignite git commit: Merge branch
'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite
into ignite-sprint-6
Posted by se...@apache.org.
Merge branch 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2b7a18d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2b7a18d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2b7a18d9
Branch: refs/heads/ignite-484-1
Commit: 2b7a18d9a0bd1c98f9a780e0f8f29c34af95e5e3
Parents: 96d12d0 c233aa2
Author: agura <ag...@gridgain.com>
Authored: Fri Jun 12 16:39:07 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri Jun 12 16:39:07 2015 +0300
----------------------------------------------------------------------
.../distributed/GridCacheTxRecoveryRequest.java | 26 +++----
.../GridCacheTxRecoveryResponse.java | 14 ++--
.../distributed/GridDistributedBaseMessage.java | 77 +-------------------
.../distributed/GridDistributedLockRequest.java | 54 +++++++-------
.../GridDistributedLockResponse.java | 14 ++--
.../GridDistributedTxFinishRequest.java | 46 ++++++------
.../GridDistributedTxPrepareRequest.java | 62 ++++++++--------
.../GridDistributedTxPrepareResponse.java | 64 +---------------
.../GridDistributedUnlockRequest.java | 6 +-
.../distributed/dht/GridDhtLockRequest.java | 72 ++++++++++++++----
.../distributed/dht/GridDhtLockResponse.java | 18 ++---
.../distributed/dht/GridDhtTxFinishRequest.java | 38 +++++-----
.../dht/GridDhtTxPrepareRequest.java | 54 +++++++-------
.../dht/GridDhtTxPrepareResponse.java | 22 +++---
.../distributed/dht/GridDhtUnlockRequest.java | 6 +-
.../distributed/near/GridNearLockRequest.java | 58 +++++++--------
.../distributed/near/GridNearLockResponse.java | 26 +++----
.../near/GridNearTxFinishRequest.java | 26 +++----
.../near/GridNearTxPrepareRequest.java | 50 ++++++-------
.../near/GridNearTxPrepareResponse.java | 46 ++++++------
.../distributed/near/GridNearUnlockRequest.java | 2 +-
.../cache/transactions/IgniteTxHandler.java | 3 -
.../messages/GridQueryNextPageResponse.java | 1 +
.../DataStreamProcessorSelfTest.java | 3 +-
.../testsuites/IgniteKernalSelfTestSuite.java | 2 +-
25 files changed, 351 insertions(+), 439 deletions(-)
----------------------------------------------------------------------
[02/50] [abbrv] incubator-ignite git commit: #ignite-994: inject
ignite before using.
Posted by se...@apache.org.
#ignite-994: inject ignite before using.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5db09734
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5db09734
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5db09734
Branch: refs/heads/ignite-484-1
Commit: 5db097342411abe6dbdd3d1f9c70029b3b497aff
Parents: 8f455a9
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed Jun 10 15:38:17 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed Jun 10 15:38:17 2015 +0300
----------------------------------------------------------------------
.../continuous/GridContinuousProcessor.java | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5db09734/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
index 38d970b..dd04bf4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
@@ -343,16 +343,19 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
if (!ctx.isDaemon() && data != null) {
for (DiscoveryDataItem item : data.items) {
- // Register handler only if local node passes projection predicate.
- if (item.prjPred == null || item.prjPred.apply(ctx.discovery().localNode())) {
- try {
+ try {
+ if (item.prjPred != null)
+ ctx.resource().injectGeneric(item.prjPred);
+
+ // Register handler only if local node passes projection predicate.
+ if (item.prjPred == null || item.prjPred.apply(ctx.discovery().localNode())) {
if (registerHandler(data.nodeId, item.routineId, item.hnd, item.bufSize, item.interval,
item.autoUnsubscribe, false))
item.hnd.onListenerRegistered(item.routineId, ctx);
}
- catch (IgniteCheckedException e) {
- U.error(log, "Failed to register continuous handler.", e);
- }
+ }
+ catch (IgniteCheckedException e) {
+ U.error(log, "Failed to register continuous handler.", e);
}
}
[44/50] [abbrv] incubator-ignite git commit: Fixed test. Cache
doesn't start in transaction.
Posted by se...@apache.org.
Fixed test. Cache doesn't start in transaction.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e158c90f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e158c90f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e158c90f
Branch: refs/heads/ignite-484-1
Commit: e158c90fe58082e00d97f26c5bb3ae450906fc6a
Parents: fe1750d
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jun 12 17:11:27 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jun 12 17:11:27 2015 +0300
----------------------------------------------------------------------
.../cache/IgniteCacheP2pUnmarshallingTxErrorTest.java | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e158c90f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
index a4e2753..017f7db 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
@@ -50,9 +50,12 @@ public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmars
* Sends put with optimistic lock and handles fail.
*/
protected void failOptimistic() {
- try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.OPTIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+ IgniteCache<Object, Object> cache = jcache(0);
- jcache(0).put(new TestKey(String.valueOf(++key)), "");
+ try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.OPTIMISTIC,
+ TransactionIsolation.REPEATABLE_READ)) {
+
+ cache.put(new TestKey(String.valueOf(++key)), "");
tx.commit();
@@ -69,9 +72,12 @@ public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmars
* Sends put with pessimistic lock and handles fail.
*/
protected void failPessimictic() {
- try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+ IgniteCache<Object, Object> cache = jcache(0);
+
+ try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC,
+ TransactionIsolation.REPEATABLE_READ)) {
- jcache(0).put(new TestKey(String.valueOf(++key)), "");
+ cache.put(new TestKey(String.valueOf(++key)), "");
assert false : "p2p marshalling failed, but error response was not sent";
}
[50/50] [abbrv] incubator-ignite git commit: Merge branch
'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite
into ignite-484-1
Posted by se...@apache.org.
Merge branch 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-484-1
# Conflicts:
# modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d8825fd7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d8825fd7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d8825fd7
Branch: refs/heads/ignite-484-1
Commit: d8825fd71e55f285e62bb958357c3a5581607a4d
Parents: 4a53405 5160088
Author: S.Vladykin <sv...@gridgain.com>
Authored: Fri Jun 12 17:24:12 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Fri Jun 12 17:24:12 2015 +0300
----------------------------------------------------------------------
RELEASE_NOTES.txt | 10 +++
.../ignite/internal/GridKernalContextImpl.java | 5 +-
.../apache/ignite/internal/IgniteKernal.java | 21 +++++-
.../internal/MarshallerContextAdapter.java | 18 ++++-
.../ignite/internal/MarshallerContextImpl.java | 14 +++-
.../GridClientOptimizedMarshaller.java | 5 ++
.../distributed/GridCacheTxRecoveryRequest.java | 26 +++----
.../GridCacheTxRecoveryResponse.java | 14 ++--
.../distributed/GridDistributedBaseMessage.java | 77 +-------------------
.../distributed/GridDistributedLockRequest.java | 54 +++++++-------
.../GridDistributedLockResponse.java | 14 ++--
.../GridDistributedTxFinishRequest.java | 46 ++++++------
.../GridDistributedTxPrepareRequest.java | 62 ++++++++--------
.../GridDistributedTxPrepareResponse.java | 64 +---------------
.../GridDistributedUnlockRequest.java | 6 +-
.../distributed/dht/GridDhtLockRequest.java | 72 ++++++++++++++----
.../distributed/dht/GridDhtLockResponse.java | 18 ++---
.../distributed/dht/GridDhtTxFinishRequest.java | 38 +++++-----
.../dht/GridDhtTxPrepareRequest.java | 54 +++++++-------
.../dht/GridDhtTxPrepareResponse.java | 22 +++---
.../distributed/dht/GridDhtUnlockRequest.java | 6 +-
.../distributed/near/GridNearLockRequest.java | 58 +++++++--------
.../distributed/near/GridNearLockResponse.java | 26 +++----
.../near/GridNearTxFinishRequest.java | 26 +++----
.../near/GridNearTxPrepareRequest.java | 50 ++++++-------
.../near/GridNearTxPrepareResponse.java | 46 ++++++------
.../distributed/near/GridNearUnlockRequest.java | 2 +-
.../cache/transactions/IgniteTxHandler.java | 3 -
.../plugin/IgnitePluginProcessor.java | 16 +---
.../messages/GridQueryNextPageResponse.java | 1 +
.../cache/GridCachePutAllFailoverSelfTest.java | 5 --
.../IgniteCacheP2pUnmarshallingTxErrorTest.java | 14 +++-
.../dht/GridCacheColocatedFailoverSelfTest.java | 5 --
.../GridCachePartitionedFailoverSelfTest.java | 5 --
.../GridCacheReplicatedFailoverSelfTest.java | 5 --
.../DataStreamProcessorSelfTest.java | 3 +-
.../marshaller/MarshallerContextTestImpl.java | 18 +++++
.../junits/GridTestKernalContext.java | 1 +
.../testsuites/IgniteKernalSelfTestSuite.java | 2 +-
.../ignite/tools/classgen/ClassesGenerator.java | 18 ++++-
40 files changed, 462 insertions(+), 488 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d8825fd7/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
index b881f93,b210625..0f62ae9
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java
@@@ -191,11 -187,6 +191,12 @@@ public class GridQueryNextPageResponse
writer.incrementState();
+ case 6:
+ if (!writer.writeMessage("retry", retry))
+ return false;
+
+ writer.incrementState();
++
}
return true;
[24/50] [abbrv] incubator-ignite git commit: Merge branch
'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite
into ignite-sprint-6
Posted by se...@apache.org.
Merge branch 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/420b6bd8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/420b6bd8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/420b6bd8
Branch: refs/heads/ignite-484-1
Commit: 420b6bd82501a3f47388865ecbdf53ce1162462c
Parents: 7ac692a cfdce4f
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu Jun 11 16:17:18 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu Jun 11 16:17:18 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/src/main/resources/ignite.properties | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/mesos/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar-2.10/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spark-2.10/pom.xml | 2 +-
modules/spark/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console-2.10/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 2 +-
37 files changed, 37 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
[47/50] [abbrv] incubator-ignite git commit: # sp-6 release notes
Posted by se...@apache.org.
# sp-6 release notes
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/dd58664f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dd58664f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dd58664f
Branch: refs/heads/ignite-484-1
Commit: dd58664fc81462c81ac28e5bfefb4d07099ff1e8
Parents: 2b7a18d
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri Jun 12 17:20:50 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri Jun 12 17:20:50 2015 +0300
----------------------------------------------------------------------
RELEASE_NOTES.txt | 10 ++++++++++
1 file changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd58664f/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 0369ecd..fcd281a 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,5 +1,15 @@
Apache Ignite Release Notes
===========================
+Apache Ignite In-Memory Data Fabric 1.2
+---------------------------------------
+
+* Added client mode to TCP discovery SPI.
+* Added memory based evictions.
+* Added integration with Apache Spark.
+* Added integration with Apache Mesos.
+* Added support for log4j2.
+* Added IgniteCache.getAllOutTx() method.
+* Many stability and fault-tolerance fixes.
Apache Ignite In-Memory Data Fabric 1.1
---------------------------------------
[29/50] [abbrv] incubator-ignite git commit: #ignite-1008: Add check
for transactions in cache start/stop.
Posted by se...@apache.org.
#ignite-1008: Add check for transactions in cache start/stop.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0be4becc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0be4becc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0be4becc
Branch: refs/heads/ignite-484-1
Commit: 0be4becc99be9db8de840f0502703e278eb9f5b1
Parents: 2b63ff8
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Jun 11 22:33:25 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Jun 11 22:34:37 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 18 ++
...teStartCacheInTransactionAtomicSelfTest.java | 32 +++
.../IgniteStartCacheInTransactionSelfTest.java | 254 +++++++++++++++++++
.../testsuites/IgniteCacheTestSuite4.java | 3 +
4 files changed, 307 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0be4becc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 9b16388..28341ad 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -1874,6 +1874,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
CacheType cacheType,
boolean failIfExists
) {
+ checkEmptyTransactions();
+
assert ccfg != null || nearCfg != null;
DynamicCacheDescriptor desc = registeredCaches.get(maskNull(cacheName));
@@ -1964,6 +1966,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
* @return Future that will be completed when cache is stopped.
*/
public IgniteInternalFuture<?> dynamicStopCache(String cacheName) {
+ checkEmptyTransactions();
+
DynamicCacheChangeRequest t = new DynamicCacheChangeRequest(cacheName, ctx.localNodeId(), true);
return F.first(initiateCacheChanges(F.asList(t), false));
@@ -2647,6 +2651,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
* @throws IgniteCheckedException If failed.
*/
private IgniteCacheProxy startJCache(String cacheName, boolean failIfNotStarted) throws IgniteCheckedException {
+ checkEmptyTransactions();
+
String masked = maskNull(cacheName);
DynamicCacheDescriptor desc = registeredCaches.get(masked);
@@ -2944,6 +2950,18 @@ public class GridCacheProcessor extends GridProcessorAdapter {
}
/**
+ * @throws IgniteException If transaction exist.
+ */
+ private void checkEmptyTransactions() throws IgniteException {
+ if (transactions().tx() != null)
+ throw new IgniteException("Cannot start/stop cache within transaction.");
+
+ if (ctx.cache().context().mvcc().
+ lastExplicitLockTopologyVersion(Thread.currentThread().getId()) != null)
+ throw new IgniteException("Cannot start/stop cache within lock.");
+ }
+
+ /**
* @param val Object to check.
* @throws IgniteCheckedException If validation failed.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0be4becc/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteStartCacheInTransactionAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteStartCacheInTransactionAtomicSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteStartCacheInTransactionAtomicSelfTest.java
new file mode 100644
index 0000000..17320eb
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteStartCacheInTransactionAtomicSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ * Check starting cache in transaction.
+ */
+public class IgniteStartCacheInTransactionAtomicSelfTest extends IgniteStartCacheInTransactionSelfTest {
+ /** {@inheritDoc} */
+ @Override public CacheAtomicityMode atomicityMode() {
+ return ATOMIC;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0be4becc/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteStartCacheInTransactionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteStartCacheInTransactionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteStartCacheInTransactionSelfTest.java
new file mode 100644
index 0000000..fb0bee2
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteStartCacheInTransactionSelfTest.java
@@ -0,0 +1,254 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.testframework.*;
+import org.apache.ignite.testframework.junits.common.*;
+import org.apache.ignite.transactions.*;
+
+import java.util.concurrent.*;
+import java.util.concurrent.locks.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ * Check starting cache in transaction.
+ */
+public class IgniteStartCacheInTransactionSelfTest extends GridCommonAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ CacheConfiguration ccfg = new CacheConfiguration();
+
+ ccfg.setAtomicityMode(atomicityMode());
+ ccfg.setBackups(1);
+
+ cfg.setCacheConfiguration(ccfg);
+
+ return cfg;
+ }
+
+ /**
+ * @return Cache atomicity mode.
+ */
+ public CacheAtomicityMode atomicityMode() {
+ return TRANSACTIONAL;
+ }
+
+ /**
+ * @param cacheName Cache name.
+ * @return Cache configuration.
+ */
+ public CacheConfiguration cacheConfiguration(String cacheName) {
+ CacheConfiguration cfg = new CacheConfiguration();
+
+ cfg.setName(cacheName);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ startGrids(2);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testStartCache() throws Exception {
+ final Ignite ignite = grid(0);
+
+ final String key = "key";
+ final String val = "val";
+
+ try (Transaction tx = ignite.transactions().txStart(
+ TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)){
+ ignite.cache(null).put(key, val);
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ ignite.createCache("NEW_CACHE");
+
+ return null;
+ }
+ }, IgniteException.class, "Cannot start/stop cache within transaction.");
+
+ tx.commit();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testStartConfigurationCache() throws Exception {
+ final Ignite ignite = grid(0);
+
+ final String key = "key";
+ final String val = "val";
+
+ try (Transaction tx = ignite.transactions().txStart(
+ TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)){
+ ignite.cache(null).put(key, val);
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ ignite.createCache(cacheConfiguration("NEW_CACHE"));
+
+ return null;
+ }
+ }, IgniteException.class, "Cannot start/stop cache within transaction.");
+
+ tx.commit();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testStartConfigurationCacheWithNear() throws Exception {
+ final Ignite ignite = grid(0);
+
+ final String key = "key";
+ final String val = "val";
+
+ try (Transaction tx = ignite.transactions().txStart(
+ TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)){
+ ignite.cache(null).put(key, val);
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ ignite.createCache(cacheConfiguration("NEW_CACHE"), new NearCacheConfiguration());
+
+ return null;
+ }
+ }, IgniteException.class, "Cannot start/stop cache within transaction.");
+
+ tx.commit();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testGetOrCreateCache() throws Exception {
+ final Ignite ignite = grid(0);
+
+ final String key = "key";
+ final String val = "val";
+
+ try (Transaction tx = ignite.transactions().txStart(
+ TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)){
+ ignite.cache(null).put(key, val);
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ ignite.getOrCreateCache("NEW_CACHE");
+
+ return null;
+ }
+ }, IgniteException.class, "Cannot start/stop cache within transaction.");
+
+ tx.commit();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testGetOrCreateCacheConfiguration() throws Exception {
+ final Ignite ignite = grid(0);
+
+ final String key = "key";
+ final String val = "val";
+
+ try (Transaction tx = ignite.transactions().txStart(
+ TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)){
+ ignite.cache(null).put(key, val);
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ ignite.getOrCreateCache(cacheConfiguration("NEW_CACHE"));
+
+ return null;
+ }
+ }, IgniteException.class, "Cannot start/stop cache within transaction.");
+
+ tx.commit();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testStopCache() throws Exception {
+ final Ignite ignite = grid(0);
+
+ final String key = "key";
+ final String val = "val";
+
+ try (Transaction tx = ignite.transactions().txStart(
+ TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)){
+ ignite.cache(null).put(key, val);
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ ignite.destroyCache(null);
+
+ return null;
+ }
+ }, IgniteException.class, "Cannot start/stop cache within transaction.");
+
+ tx.commit();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testLockCache() throws Exception {
+ if (atomicityMode() != TRANSACTIONAL)
+ return;
+
+ final Ignite ignite = grid(0);
+
+ final String key = "key";
+
+ Lock lock = ignite.cache(null).lock(key);
+
+ lock.lock();
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ ignite.createCache("NEW_CACHE");
+
+ return null;
+ }
+ }, IgniteException.class, "Cannot start/stop cache within lock.");
+
+ lock.unlock();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0be4becc/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index a503e1e..c598e38 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -138,6 +138,9 @@ public class IgniteCacheTestSuite4 extends TestSuite {
suite.addTestSuite(IgniteCacheManyClientsTest.class);
+ suite.addTestSuite(IgniteStartCacheInTransactionSelfTest.class);
+ suite.addTestSuite(IgniteStartCacheInTransactionAtomicSelfTest.class);
+
return suite;
}
}
[06/50] [abbrv] incubator-ignite git commit: Merge branch
'ignite-sprint-5' into ignite-sprint-6
Posted by se...@apache.org.
Merge branch 'ignite-sprint-5' into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9300ca61
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9300ca61
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9300ca61
Branch: refs/heads/ignite-484-1
Commit: 9300ca616f8faed6b56287949d48a23e269c5b4c
Parents: 593d862 addc91b
Author: ashutak <as...@gridgain.com>
Authored: Wed Jun 10 17:31:32 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Wed Jun 10 17:31:32 2015 +0300
----------------------------------------------------------------------
.../client/memcache/MemcacheRestExample.java | 32 ++++++++++----------
.../java/org/apache/ignite/IgniteCache.java | 25 ++++++++++++++-
.../affinity/GridAffinityAssignmentCache.java | 5 ++-
.../processors/cache/IgniteInternalCache.java | 27 +++++------------
.../internal/visor/query/VisorQueryJob.java | 2 +-
.../internal/visor/util/VisorTaskUtils.java | 16 +++-------
.../ignite/spi/discovery/tcp/ServerImpl.java | 6 ++--
.../spi/discovery/tcp/TcpDiscoverySpi.java | 2 +-
.../RoundRobinGlobalLoadBalancer.java | 2 +-
.../ignite/testframework/GridTestUtils.java | 2 +-
10 files changed, 64 insertions(+), 55 deletions(-)
----------------------------------------------------------------------
[26/50] [abbrv] incubator-ignite git commit: #Added JVM_OPTS for
mesos. Updated DEVNOTE.
Posted by se...@apache.org.
#Added JVM_OPTS for mesos. Updated DEVNOTE.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b84e1027
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b84e1027
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b84e1027
Branch: refs/heads/ignite-484-1
Commit: b84e1027f97cccba245431ab13a1073e78975314
Parents: 420b6bd
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Thu Jun 11 18:47:15 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Thu Jun 11 18:47:15 2015 +0300
----------------------------------------------------------------------
DEVNOTES.txt | 8 ++++++++
modules/mesos/README.txt | 2 +-
.../org/apache/ignite/mesos/ClusterProperties.java | 15 +++++++++++++++
.../org/apache/ignite/mesos/IgniteScheduler.java | 10 +++++++---
4 files changed, 31 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b84e1027/DEVNOTES.txt
----------------------------------------------------------------------
diff --git a/DEVNOTES.txt b/DEVNOTES.txt
index d02e6ba..d7cffa7 100644
--- a/DEVNOTES.txt
+++ b/DEVNOTES.txt
@@ -91,6 +91,14 @@ To test compliance with JCache TCK use:
mvn test -P-release,jcache-tck -pl :ignite-core -am
+Ignite Mesos Maven Build Instructions
+============================================
+cd to ./modules/mesos
+
+mvn clean package
+
+Look for ignite-mesos-<version>-jar-with-dependencies.jar in ./target directory.
+
Run tests
==========
To run tests locally use:
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b84e1027/modules/mesos/README.txt
----------------------------------------------------------------------
diff --git a/modules/mesos/README.txt b/modules/mesos/README.txt
index 75a62f8..e5e4bbb 100644
--- a/modules/mesos/README.txt
+++ b/modules/mesos/README.txt
@@ -6,7 +6,7 @@ Apache Ignite Mesos module provides integration Apache Ignite with Apache Mesos.
Importing Apache Ignite Mesos Module In Maven Project
-------------------------------------
-If you are using Maven to manage dependencies of your project, you can add Cloud module
+If you are using Maven to manage dependencies of your project, you can add Mesos module
dependency like this (replace '${ignite.version}' with actual Ignite version you are
interested in):
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b84e1027/modules/mesos/src/main/java/org/apache/ignite/mesos/ClusterProperties.java
----------------------------------------------------------------------
diff --git a/modules/mesos/src/main/java/org/apache/ignite/mesos/ClusterProperties.java b/modules/mesos/src/main/java/org/apache/ignite/mesos/ClusterProperties.java
index 6663625..a97a97f 100644
--- a/modules/mesos/src/main/java/org/apache/ignite/mesos/ClusterProperties.java
+++ b/modules/mesos/src/main/java/org/apache/ignite/mesos/ClusterProperties.java
@@ -43,6 +43,12 @@ public class ClusterProperties {
private String mesosUrl = DEFAULT_MESOS_MASTER_URL;
/** */
+ public static final String IGNITE_JVM_OPTS = "IGNITE_JVM_OPTS";
+
+ /** JVM options. */
+ private String jvmOpts = "";
+
+ /** */
public static final String IGNITE_CLUSTER_NAME = "IGNITE_CLUSTER_NAME";
/** */
@@ -253,6 +259,13 @@ public class ClusterProperties {
}
/**
+ * @return JVM opts for ignite.
+ */
+ public String jmvOpts() {
+ return this.jvmOpts;
+ }
+
+ /**
* @return disk limit.
*/
public double disk() {
@@ -435,6 +448,8 @@ public class ClusterProperties {
prop.minCpu = getDoubleProperty(IGNITE_MIN_CPU_PER_NODE, props, DEFAULT_RESOURCE_MIN_CPU);
prop.minMemory = getDoubleProperty(IGNITE_MIN_MEMORY_PER_NODE, props, DEFAULT_RESOURCE_MIN_MEM);
+ prop.jvmOpts = getStringProperty(IGNITE_JVM_OPTS, props, "");
+
prop.igniteVer = getStringProperty(IGNITE_VERSION, props, DEFAULT_IGNITE_VERSION);
prop.igniteWorkDir = getStringProperty(IGNITE_WORK_DIR, props, DEFAULT_IGNITE_WORK_DIR);
prop.igniteCfg = getStringProperty(IGNITE_CONFIG_XML, props, null);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b84e1027/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
----------------------------------------------------------------------
diff --git a/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java b/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
index fbb9994..7795a31 100644
--- a/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
+++ b/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
@@ -119,9 +119,13 @@ public class IgniteScheduler implements Scheduler {
clusterProps.igniteConfigUrl() : resourceProvider.igniteConfigUrl();
Protos.CommandInfo.Builder builder = Protos.CommandInfo.newBuilder()
- .setEnvironment(Protos.Environment.newBuilder().addVariables(Protos.Environment.Variable.newBuilder()
- .setName("IGNITE_TCP_DISCOVERY_ADDRESSES")
- .setValue(getAddress(offer.getHostname()))))
+ .setEnvironment(Protos.Environment.newBuilder()
+ .addVariables(Protos.Environment.Variable.newBuilder()
+ .setName("IGNITE_TCP_DISCOVERY_ADDRESSES")
+ .setValue(getAddress(offer.getHostname())))
+ .addVariables(Protos.Environment.Variable.newBuilder()
+ .setName("JVM_OPTS")
+ .setValue(clusterProps.jmvOpts())))
.addUris(Protos.CommandInfo.URI.newBuilder()
.setValue(clusterProps.ignitePackageUrl() != null ?
clusterProps.ignitePackageUrl() : resourceProvider.igniteUrl())
[38/50] [abbrv] incubator-ignite git commit: ignite-classname Changed
script for classnames property.
Posted by se...@apache.org.
ignite-classname Changed script for classnames property.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/fe1750d3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fe1750d3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fe1750d3
Branch: refs/heads/ignite-484-1
Commit: fe1750d3f15ef283ecc76c0fcba0c8a59493691f
Parents: a515ec9
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jun 12 13:37:48 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jun 12 13:37:48 2015 +0300
----------------------------------------------------------------------
.../ignite/tools/classgen/ClassesGenerator.java | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe1750d3/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
----------------------------------------------------------------------
diff --git a/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java b/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
index ba0aab9..feb2d9d 100644
--- a/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
+++ b/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
@@ -29,7 +29,10 @@ import java.util.jar.*;
*/
public class ClassesGenerator {
/** */
- private static final String FILE_PATH = "META-INF/classnames.properties";
+ private static final String META_INF = "META-INF/";
+
+ /** */
+ private static final String DEFAULT_FILE_PATH = META_INF + "classnames.properties";
/** */
private static final String[] EXCLUDED_PACKAGES = {
@@ -46,8 +49,9 @@ public class ClassesGenerator {
String basePath = args[0];
String hdr = args[1];
String[] packages = args[2].split(":");
+ String finaName = args.length == 4 ? args[3] : null;
- ClassesGenerator gen = new ClassesGenerator(basePath, hdr, packages);
+ ClassesGenerator gen = new ClassesGenerator(basePath, hdr, packages, finaName);
gen.generate();
}
@@ -74,15 +78,20 @@ public class ClassesGenerator {
/** */
private final String[] packages;
+ /** */
+ private final String fileName;
+
/**
* @param basePath Base file path.
* @param hdr Header.
* @param packages Included packages.
+ * @param fileName Property file name.
*/
- private ClassesGenerator(String basePath, String hdr, String[] packages) {
+ private ClassesGenerator(String basePath, String hdr, String[] packages, String fileName) {
this.basePath = basePath;
this.hdr = hdr;
this.packages = packages;
+ this.fileName = fileName;
}
/**
@@ -103,7 +112,8 @@ public class ClassesGenerator {
throw new Exception(sb.toString().trim());
}
- PrintStream out = new PrintStream(new File(basePath, FILE_PATH));
+ PrintStream out = new PrintStream(new File(basePath,
+ (fileName == null || fileName.isEmpty()) ? DEFAULT_FILE_PATH : META_INF + fileName));
out.println(hdr);
out.println();
[12/50] [abbrv] incubator-ignite git commit: Merge branch
'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite
into ignite-sprint-6
Posted by se...@apache.org.
Merge branch 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/95b7147f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/95b7147f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/95b7147f
Branch: refs/heads/ignite-484-1
Commit: 95b7147fe18ef75ac67741647c9f2ab61a59dcb3
Parents: 8a1c85d a12302e
Author: Denis Magda <dm...@gridgain.com>
Authored: Wed Jun 10 18:04:08 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Jun 10 18:04:08 2015 +0300
----------------------------------------------------------------------
.../client/memcache/MemcacheRestExample.java | 32 ++++++++++----------
.../client/router/TcpSslRouterSelfTest.java | 5 +++
.../client/suite/IgniteClientTestSuite.java | 3 +-
.../java/org/apache/ignite/IgniteCache.java | 25 ++++++++++++++-
.../affinity/GridAffinityAssignmentCache.java | 5 ++-
.../processors/cache/IgniteInternalCache.java | 27 +++++------------
.../internal/visor/query/VisorQueryJob.java | 2 +-
.../internal/visor/util/VisorTaskUtils.java | 16 +++-------
.../ignite/spi/discovery/tcp/ServerImpl.java | 6 ++--
.../spi/discovery/tcp/TcpDiscoverySpi.java | 2 +-
.../RoundRobinGlobalLoadBalancer.java | 2 +-
.../ignite/GridSuppressedExceptionSelfTest.java | 4 ++-
...inodeUpdateNearEnabledNoBackupsSelfTest.java | 2 +-
...CacheMultinodeUpdateNearEnabledSelfTest.java | 2 +-
.../processors/cache/GridCacheOffHeapTest.java | 28 ++++++++++++-----
.../cache/GridCachePutAllFailoverSelfTest.java | 5 +++
.../processors/cache/GridCacheStopSelfTest.java | 5 +++
.../cache/GridCacheVersionMultinodeTest.java | 2 +-
.../IgniteCacheInterceptorSelfTestSuite.java | 2 +-
.../cache/IgniteCacheInvokeReadThroughTest.java | 5 +++
...gniteCacheTransactionalStopBusySelfTest.java | 5 +++
.../IgniteTxMultiThreadedAbstractTest.java | 4 +--
...dCacheQueueMultiNodeConsistencySelfTest.java | 5 +++
...omicOffheapQueueCreateMultiNodeSelfTest.java | 5 +++
...ionedAtomicQueueCreateMultiNodeSelfTest.java | 5 +++
...rtitionedDataStructuresFailoverSelfTest.java | 5 +++
...edOffheapDataStructuresFailoverSelfTest.java | 5 +++
...PartitionedQueueCreateMultiNodeSelfTest.java | 5 +++
...dCachePartitionedQueueEntryMoveSelfTest.java | 5 +++
...nedQueueFailoverDataConsistencySelfTest.java | 5 +++
...eplicatedDataStructuresFailoverSelfTest.java | 5 +++
...CacheLoadingConcurrentGridStartSelfTest.java | 5 +++
.../dht/GridCacheColocatedFailoverSelfTest.java | 5 +++
.../GridCacheColocatedTxExceptionSelfTest.java | 5 +++
...ePartitionedNearDisabledMetricsSelfTest.java | 4 ++-
...dCachePartitionedTopologyChangeSelfTest.java | 5 +++
.../near/GridCacheNearTxExceptionSelfTest.java | 5 +++
.../GridCachePartitionedFailoverSelfTest.java | 5 +++
...PartitionedFullApiMultithreadedSelfTest.java | 5 +++
.../GridCachePartitionedNodeRestartTest.java | 5 +++
...ePartitionedOptimisticTxNodeRestartTest.java | 5 +++
...CachePartitionedTxMultiThreadedSelfTest.java | 5 +++
.../GridCacheReplicatedFailoverSelfTest.java | 5 +++
...eReplicatedFullApiMultithreadedSelfTest.java | 5 +++
.../GridCacheReplicatedInvalidateSelfTest.java | 4 +--
...ridCacheReplicatedMultiNodeLockSelfTest.java | 5 +++
.../GridCacheReplicatedMultiNodeSelfTest.java | 5 +++
.../GridCacheReplicatedNodeRestartSelfTest.java | 5 +++
.../GridCacheReplicatedTxExceptionSelfTest.java | 5 +++
.../replicated/GridReplicatedTxPreloadTest.java | 2 ++
...acheAtomicReplicatedNodeRestartSelfTest.java | 5 +++
.../GridCacheEvictionFilterSelfTest.java | 4 ++-
...cheSynchronousEvictionsFailoverSelfTest.java | 5 +++
.../IgniteCacheExpiryPolicyAbstractTest.java | 10 +++---
...eCacheExpiryPolicyWithStoreAbstractTest.java | 4 ++-
...dCacheLocalFullApiMultithreadedSelfTest.java | 5 +++
.../GridCacheLocalTxExceptionSelfTest.java | 5 +++
.../processors/igfs/IgfsModesSelfTest.java | 4 ++-
.../unsafe/GridUnsafeMemorySelfTest.java | 4 ++-
.../ignite/testframework/GridTestUtils.java | 2 +-
.../IgniteCacheDataStructuresSelfTestSuite.java | 24 ++++++---------
.../IgniteCacheEvictionSelfTestSuite.java | 3 +-
.../IgniteCacheFailoverTestSuite.java | 8 ++---
.../IgniteCacheFullApiSelfTestSuite.java | 8 ++---
.../testsuites/IgniteCacheRestartTestSuite.java | 10 +++---
.../ignite/testsuites/IgniteCacheTestSuite.java | 16 +++++-----
.../testsuites/IgniteCacheTestSuite2.java | 4 +--
.../testsuites/IgniteCacheTestSuite3.java | 14 +++------
.../testsuites/IgniteCacheTestSuite4.java | 10 +++---
.../apache/ignite/util/GridRandomSelfTest.java | 4 ++-
.../HadoopIgfs20FileSystemAbstractSelfTest.java | 4 ++-
.../collections/HadoopHashMapSelfTest.java | 4 ++-
.../HadoopExternalTaskExecutionSelfTest.java | 2 ++
.../HadoopExternalCommunicationSelfTest.java | 5 +++
.../testsuites/IgniteHadoopTestSuite.java | 7 +++--
.../hibernate/HibernateL2CacheSelfTest.java | 5 +++
.../HibernateL2CacheTransactionalSelfTest.java | 5 +++
.../testsuites/IgniteHibernateTestSuite.java | 4 +--
.../cache/GridCacheCrossCacheQuerySelfTest.java | 8 +++--
.../IgniteCacheQueryNodeRestartSelfTest.java | 5 +++
.../h2/GridIndexingSpiAbstractSelfTest.java | 4 ++-
.../query/h2/sql/BaseH2CompareQueryTest.java | 4 ++-
.../IgniteCacheQuerySelfTestSuite.java | 2 +-
.../IgniteWebSessionSelfTestSuite.java | 2 +-
84 files changed, 384 insertions(+), 150 deletions(-)
----------------------------------------------------------------------
[10/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: revert
changes in concurrent map
Posted by se...@apache.org.
ignite-sprint-6: revert changes in concurrent map
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8203caf7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8203caf7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8203caf7
Branch: refs/heads/ignite-484-1
Commit: 8203caf7ac5f79e08b8f398e8608619c00256aac
Parents: 455b96f
Author: Denis Magda <dm...@gridgain.com>
Authored: Wed Jun 10 18:01:16 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Jun 10 18:01:16 2015 +0300
----------------------------------------------------------------------
.../java/org/jsr166/ConcurrentHashMap8.java | 5433 ++++++++++--------
1 file changed, 2943 insertions(+), 2490 deletions(-)
----------------------------------------------------------------------
[40/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: merge
from ignite-1011
Posted by se...@apache.org.
ignite-sprint-6: merge from ignite-1011
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/83a1986a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/83a1986a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/83a1986a
Branch: refs/heads/ignite-484-1
Commit: 83a1986aec68712a8199b99bfa73babe8c26164a
Parents: b087aca
Author: Denis Magda <dm...@gridgain.com>
Authored: Fri Jun 12 14:44:55 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri Jun 12 14:44:55 2015 +0300
----------------------------------------------------------------------
.../distributed/GridCacheTxRecoveryRequest.java | 26 +++----
.../GridCacheTxRecoveryResponse.java | 14 ++--
.../distributed/GridDistributedBaseMessage.java | 77 +-------------------
.../distributed/GridDistributedLockRequest.java | 54 +++++++-------
.../GridDistributedLockResponse.java | 14 ++--
.../GridDistributedTxFinishRequest.java | 46 ++++++------
.../GridDistributedTxPrepareRequest.java | 62 ++++++++--------
.../GridDistributedTxPrepareResponse.java | 64 +---------------
.../GridDistributedUnlockRequest.java | 6 +-
.../distributed/dht/GridDhtLockRequest.java | 72 ++++++++++++++----
.../distributed/dht/GridDhtLockResponse.java | 18 ++---
.../distributed/dht/GridDhtTxFinishRequest.java | 38 +++++-----
.../dht/GridDhtTxPrepareRequest.java | 54 +++++++-------
.../dht/GridDhtTxPrepareResponse.java | 22 +++---
.../distributed/dht/GridDhtUnlockRequest.java | 6 +-
.../distributed/near/GridNearLockRequest.java | 58 +++++++--------
.../distributed/near/GridNearLockResponse.java | 26 +++----
.../near/GridNearTxFinishRequest.java | 26 +++----
.../near/GridNearTxPrepareRequest.java | 50 ++++++-------
.../near/GridNearTxPrepareResponse.java | 46 ++++++------
.../distributed/near/GridNearUnlockRequest.java | 2 +-
.../cache/transactions/IgniteTxHandler.java | 3 -
.../messages/GridQueryNextPageResponse.java | 1 +
23 files changed, 348 insertions(+), 437 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryRequest.java
index 259c288..2f49ef4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryRequest.java
@@ -139,37 +139,37 @@ public class GridCacheTxRecoveryRequest extends GridDistributedBaseMessage {
}
switch (writer.state()) {
- case 8:
+ case 7:
if (!writer.writeIgniteUuid("futId", futId))
return false;
writer.incrementState();
- case 9:
+ case 8:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 10:
+ case 9:
if (!writer.writeBoolean("nearTxCheck", nearTxCheck))
return false;
writer.incrementState();
- case 11:
+ case 10:
if (!writer.writeMessage("nearXidVer", nearXidVer))
return false;
writer.incrementState();
- case 12:
+ case 11:
if (!writer.writeBoolean("sys", sys))
return false;
writer.incrementState();
- case 13:
+ case 12:
if (!writer.writeInt("txNum", txNum))
return false;
@@ -191,7 +191,7 @@ public class GridCacheTxRecoveryRequest extends GridDistributedBaseMessage {
return false;
switch (reader.state()) {
- case 8:
+ case 7:
futId = reader.readIgniteUuid("futId");
if (!reader.isLastRead())
@@ -199,7 +199,7 @@ public class GridCacheTxRecoveryRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 9:
+ case 8:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -207,7 +207,7 @@ public class GridCacheTxRecoveryRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 10:
+ case 9:
nearTxCheck = reader.readBoolean("nearTxCheck");
if (!reader.isLastRead())
@@ -215,7 +215,7 @@ public class GridCacheTxRecoveryRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 11:
+ case 10:
nearXidVer = reader.readMessage("nearXidVer");
if (!reader.isLastRead())
@@ -223,7 +223,7 @@ public class GridCacheTxRecoveryRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 12:
+ case 11:
sys = reader.readBoolean("sys");
if (!reader.isLastRead())
@@ -231,7 +231,7 @@ public class GridCacheTxRecoveryRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 13:
+ case 12:
txNum = reader.readInt("txNum");
if (!reader.isLastRead())
@@ -251,7 +251,7 @@ public class GridCacheTxRecoveryRequest extends GridDistributedBaseMessage {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 14;
+ return 13;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryResponse.java
index e5c026a..99b676a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryResponse.java
@@ -102,19 +102,19 @@ public class GridCacheTxRecoveryResponse extends GridDistributedBaseMessage {
}
switch (writer.state()) {
- case 8:
+ case 7:
if (!writer.writeIgniteUuid("futId", futId))
return false;
writer.incrementState();
- case 9:
+ case 8:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 10:
+ case 9:
if (!writer.writeBoolean("success", success))
return false;
@@ -136,7 +136,7 @@ public class GridCacheTxRecoveryResponse extends GridDistributedBaseMessage {
return false;
switch (reader.state()) {
- case 8:
+ case 7:
futId = reader.readIgniteUuid("futId");
if (!reader.isLastRead())
@@ -144,7 +144,7 @@ public class GridCacheTxRecoveryResponse extends GridDistributedBaseMessage {
reader.incrementState();
- case 9:
+ case 8:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -152,7 +152,7 @@ public class GridCacheTxRecoveryResponse extends GridDistributedBaseMessage {
reader.incrementState();
- case 10:
+ case 9:
success = reader.readBoolean("success");
if (!reader.isLastRead())
@@ -172,7 +172,7 @@ public class GridCacheTxRecoveryResponse extends GridDistributedBaseMessage {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 11;
+ return 10;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedBaseMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedBaseMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedBaseMessage.java
index 762455c..7b84f32 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedBaseMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedBaseMessage.java
@@ -24,7 +24,6 @@ import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.plugin.extensions.communication.*;
-import org.jetbrains.annotations.*;
import java.io.*;
import java.nio.*;
@@ -55,15 +54,6 @@ public abstract class GridDistributedBaseMessage extends GridCacheMessage implem
@GridToStringExclude
private byte[] candsByIdxBytes;
- /** Collections of local lock candidates. */
- @GridToStringInclude
- @GridDirectTransient
- private Map<KeyCacheObject, Collection<GridCacheMvccCandidate>> candsByKey;
-
- /** Collections of local lock candidates in serialized form. */
- @GridToStringExclude
- private byte[] candsByKeyBytes;
-
/** Committed versions with order higher than one for this message (needed for commit ordering). */
@GridToStringInclude
@GridDirectCollection(GridCacheVersion.class)
@@ -114,15 +104,6 @@ public abstract class GridDistributedBaseMessage extends GridCacheMessage implem
if (candsByIdx != null)
candsByIdxBytes = ctx.marshaller().marshal(candsByIdx);
-
- if (candsByKey != null) {
- if (ctx.deploymentEnabled()) {
- for (KeyCacheObject key : candsByKey.keySet())
- prepareObject(key, ctx);
- }
-
- candsByKeyBytes = CU.marshal(ctx, candsByKey);
- }
}
/** {@inheritDoc} */
@@ -131,9 +112,6 @@ public abstract class GridDistributedBaseMessage extends GridCacheMessage implem
if (candsByIdxBytes != null)
candsByIdx = ctx.marshaller().unmarshal(candsByIdxBytes, ldr);
-
- if (candsByKeyBytes != null)
- candsByKey = ctx.marshaller().unmarshal(candsByKeyBytes, ldr);
}
/**
@@ -202,39 +180,6 @@ public abstract class GridDistributedBaseMessage extends GridCacheMessage implem
}
/**
- * @param key Candidates key.
- * @param candsByKey Collection of local candidates.
- */
- public void candidatesByKey(KeyCacheObject key, Collection<GridCacheMvccCandidate> candsByKey) {
- if (this.candsByKey == null)
- this.candsByKey = new HashMap<>(1, 1.0f);
-
- this.candsByKey.put(key, candsByKey);
- }
-
- /**
- *
- * @param key Candidates key.
- * @return Collection of lock candidates at given index.
- */
- @Nullable public Collection<GridCacheMvccCandidate> candidatesByKey(KeyCacheObject key) {
- assert key != null;
-
- if (candsByKey == null)
- return null;
-
- return candsByKey.get(key);
- }
-
- /**
- * @return Map of candidates.
- */
- public Map<KeyCacheObject, Collection<GridCacheMvccCandidate>> candidatesByKey() {
- return candsByKey == null ?
- Collections.<KeyCacheObject, Collection<GridCacheMvccCandidate>>emptyMap() : candsByKey;
- }
-
- /**
* @return Count of keys referenced in candidates array (needed only locally for optimization).
*/
public int keysCount() {
@@ -263,24 +208,18 @@ public abstract class GridDistributedBaseMessage extends GridCacheMessage implem
writer.incrementState();
case 4:
- if (!writer.writeByteArray("candsByKeyBytes", candsByKeyBytes))
- return false;
-
- writer.incrementState();
-
- case 5:
if (!writer.writeCollection("committedVers", committedVers, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 6:
+ case 5:
if (!writer.writeCollection("rolledbackVers", rolledbackVers, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 7:
+ case 6:
if (!writer.writeMessage("ver", ver))
return false;
@@ -311,14 +250,6 @@ public abstract class GridDistributedBaseMessage extends GridCacheMessage implem
reader.incrementState();
case 4:
- candsByKeyBytes = reader.readByteArray("candsByKeyBytes");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 5:
committedVers = reader.readCollection("committedVers", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -326,7 +257,7 @@ public abstract class GridDistributedBaseMessage extends GridCacheMessage implem
reader.incrementState();
- case 6:
+ case 5:
rolledbackVers = reader.readCollection("rolledbackVers", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -334,7 +265,7 @@ public abstract class GridDistributedBaseMessage extends GridCacheMessage implem
reader.incrementState();
- case 7:
+ case 6:
ver = reader.readMessage("ver");
if (!reader.isLastRead())
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
index c5ac847..ecf3259 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
@@ -321,79 +321,79 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
}
switch (writer.state()) {
- case 8:
+ case 7:
if (!writer.writeByte("flags", flags))
return false;
writer.incrementState();
- case 9:
+ case 8:
if (!writer.writeIgniteUuid("futId", futId))
return false;
writer.incrementState();
- case 10:
+ case 9:
if (!writer.writeBoolean("isInTx", isInTx))
return false;
writer.incrementState();
- case 11:
+ case 10:
if (!writer.writeBoolean("isInvalidate", isInvalidate))
return false;
writer.incrementState();
- case 12:
+ case 11:
if (!writer.writeBoolean("isRead", isRead))
return false;
writer.incrementState();
- case 13:
+ case 12:
if (!writer.writeByte("isolation", isolation != null ? (byte)isolation.ordinal() : -1))
return false;
writer.incrementState();
- case 14:
+ case 13:
if (!writer.writeCollection("keys", keys, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 15:
+ case 14:
if (!writer.writeMessage("nearXidVer", nearXidVer))
return false;
writer.incrementState();
- case 16:
+ case 15:
if (!writer.writeUuid("nodeId", nodeId))
return false;
writer.incrementState();
- case 17:
+ case 16:
if (!writer.writeBooleanArray("retVals", retVals))
return false;
writer.incrementState();
- case 18:
+ case 17:
if (!writer.writeLong("threadId", threadId))
return false;
writer.incrementState();
- case 19:
+ case 18:
if (!writer.writeLong("timeout", timeout))
return false;
writer.incrementState();
- case 20:
+ case 19:
if (!writer.writeInt("txSize", txSize))
return false;
@@ -415,7 +415,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
return false;
switch (reader.state()) {
- case 8:
+ case 7:
flags = reader.readByte("flags");
if (!reader.isLastRead())
@@ -423,7 +423,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 9:
+ case 8:
futId = reader.readIgniteUuid("futId");
if (!reader.isLastRead())
@@ -431,7 +431,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 10:
+ case 9:
isInTx = reader.readBoolean("isInTx");
if (!reader.isLastRead())
@@ -439,7 +439,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 11:
+ case 10:
isInvalidate = reader.readBoolean("isInvalidate");
if (!reader.isLastRead())
@@ -447,7 +447,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 12:
+ case 11:
isRead = reader.readBoolean("isRead");
if (!reader.isLastRead())
@@ -455,7 +455,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 13:
+ case 12:
byte isolationOrd;
isolationOrd = reader.readByte("isolation");
@@ -467,7 +467,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 14:
+ case 13:
keys = reader.readCollection("keys", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -475,7 +475,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 15:
+ case 14:
nearXidVer = reader.readMessage("nearXidVer");
if (!reader.isLastRead())
@@ -483,7 +483,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 16:
+ case 15:
nodeId = reader.readUuid("nodeId");
if (!reader.isLastRead())
@@ -491,7 +491,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 17:
+ case 16:
retVals = reader.readBooleanArray("retVals");
if (!reader.isLastRead())
@@ -499,7 +499,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 18:
+ case 17:
threadId = reader.readLong("threadId");
if (!reader.isLastRead())
@@ -507,7 +507,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 19:
+ case 18:
timeout = reader.readLong("timeout");
if (!reader.isLastRead())
@@ -515,7 +515,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 20:
+ case 19:
txSize = reader.readInt("txSize");
if (!reader.isLastRead())
@@ -535,7 +535,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 21;
+ return 20;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
index b5e8d61..295506a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
@@ -243,19 +243,19 @@ public class GridDistributedLockResponse extends GridDistributedBaseMessage {
}
switch (writer.state()) {
- case 8:
+ case 7:
if (!writer.writeByteArray("errBytes", errBytes))
return false;
writer.incrementState();
- case 9:
+ case 8:
if (!writer.writeIgniteUuid("futId", futId))
return false;
writer.incrementState();
- case 10:
+ case 9:
if (!writer.writeCollection("vals", vals, MessageCollectionItemType.MSG))
return false;
@@ -277,7 +277,7 @@ public class GridDistributedLockResponse extends GridDistributedBaseMessage {
return false;
switch (reader.state()) {
- case 8:
+ case 7:
errBytes = reader.readByteArray("errBytes");
if (!reader.isLastRead())
@@ -285,7 +285,7 @@ public class GridDistributedLockResponse extends GridDistributedBaseMessage {
reader.incrementState();
- case 9:
+ case 8:
futId = reader.readIgniteUuid("futId");
if (!reader.isLastRead())
@@ -293,7 +293,7 @@ public class GridDistributedLockResponse extends GridDistributedBaseMessage {
reader.incrementState();
- case 10:
+ case 9:
vals = reader.readCollection("vals", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -313,7 +313,7 @@ public class GridDistributedLockResponse extends GridDistributedBaseMessage {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 11;
+ return 10;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java
index c524575..986e211 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishRequest.java
@@ -237,67 +237,67 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
}
switch (writer.state()) {
- case 8:
+ case 7:
if (!writer.writeMessage("baseVer", baseVer))
return false;
writer.incrementState();
- case 9:
+ case 8:
if (!writer.writeBoolean("commit", commit))
return false;
writer.incrementState();
- case 10:
+ case 9:
if (!writer.writeMessage("commitVer", commitVer))
return false;
writer.incrementState();
- case 11:
+ case 10:
if (!writer.writeIgniteUuid("futId", futId))
return false;
writer.incrementState();
- case 12:
+ case 11:
if (!writer.writeBoolean("invalidate", invalidate))
return false;
writer.incrementState();
- case 13:
+ case 12:
if (!writer.writeByte("plc", plc != null ? (byte)plc.ordinal() : -1))
return false;
writer.incrementState();
- case 14:
+ case 13:
if (!writer.writeBoolean("syncCommit", syncCommit))
return false;
writer.incrementState();
- case 15:
+ case 14:
if (!writer.writeBoolean("syncRollback", syncRollback))
return false;
writer.incrementState();
- case 16:
+ case 15:
if (!writer.writeBoolean("sys", sys))
return false;
writer.incrementState();
- case 17:
+ case 16:
if (!writer.writeLong("threadId", threadId))
return false;
writer.incrementState();
- case 18:
+ case 17:
if (!writer.writeInt("txSize", txSize))
return false;
@@ -319,7 +319,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
return false;
switch (reader.state()) {
- case 8:
+ case 7:
baseVer = reader.readMessage("baseVer");
if (!reader.isLastRead())
@@ -327,7 +327,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 9:
+ case 8:
commit = reader.readBoolean("commit");
if (!reader.isLastRead())
@@ -335,7 +335,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 10:
+ case 9:
commitVer = reader.readMessage("commitVer");
if (!reader.isLastRead())
@@ -343,7 +343,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 11:
+ case 10:
futId = reader.readIgniteUuid("futId");
if (!reader.isLastRead())
@@ -351,7 +351,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 12:
+ case 11:
invalidate = reader.readBoolean("invalidate");
if (!reader.isLastRead())
@@ -359,7 +359,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 13:
+ case 12:
byte plcOrd;
plcOrd = reader.readByte("plc");
@@ -371,7 +371,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 14:
+ case 13:
syncCommit = reader.readBoolean("syncCommit");
if (!reader.isLastRead())
@@ -379,7 +379,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 15:
+ case 14:
syncRollback = reader.readBoolean("syncRollback");
if (!reader.isLastRead())
@@ -387,7 +387,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 16:
+ case 15:
sys = reader.readBoolean("sys");
if (!reader.isLastRead())
@@ -395,7 +395,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 17:
+ case 16:
threadId = reader.readLong("threadId");
if (!reader.isLastRead())
@@ -403,7 +403,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
reader.incrementState();
- case 18:
+ case 17:
txSize = reader.readInt("txSize");
if (!reader.isLastRead())
@@ -423,7 +423,7 @@ public class GridDistributedTxFinishRequest extends GridDistributedBaseMessage {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 19;
+ return 18;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
index cc2783a..3078277 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
@@ -340,91 +340,91 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
}
switch (writer.state()) {
- case 8:
+ case 7:
if (!writer.writeByte("concurrency", concurrency != null ? (byte)concurrency.ordinal() : -1))
return false;
writer.incrementState();
- case 9:
+ case 8:
if (!writer.writeCollection("dhtVerKeys", dhtVerKeys, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 10:
+ case 9:
if (!writer.writeCollection("dhtVerVals", dhtVerVals, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 11:
+ case 10:
if (!writer.writeBoolean("invalidate", invalidate))
return false;
writer.incrementState();
- case 12:
+ case 11:
if (!writer.writeByte("isolation", isolation != null ? (byte)isolation.ordinal() : -1))
return false;
writer.incrementState();
- case 13:
+ case 12:
if (!writer.writeBoolean("onePhaseCommit", onePhaseCommit))
return false;
writer.incrementState();
- case 14:
+ case 13:
if (!writer.writeByte("plc", plc != null ? (byte)plc.ordinal() : -1))
return false;
writer.incrementState();
- case 15:
+ case 14:
if (!writer.writeCollection("reads", reads, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 16:
+ case 15:
if (!writer.writeBoolean("sys", sys))
return false;
writer.incrementState();
- case 17:
+ case 16:
if (!writer.writeLong("threadId", threadId))
return false;
writer.incrementState();
- case 18:
+ case 17:
if (!writer.writeLong("timeout", timeout))
return false;
writer.incrementState();
- case 19:
+ case 18:
if (!writer.writeByteArray("txNodesBytes", txNodesBytes))
return false;
writer.incrementState();
- case 20:
+ case 19:
if (!writer.writeInt("txSize", txSize))
return false;
writer.incrementState();
- case 21:
+ case 20:
if (!writer.writeMessage("writeVer", writeVer))
return false;
writer.incrementState();
- case 22:
+ case 21:
if (!writer.writeCollection("writes", writes, MessageCollectionItemType.MSG))
return false;
@@ -446,7 +446,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
return false;
switch (reader.state()) {
- case 8:
+ case 7:
byte concurrencyOrd;
concurrencyOrd = reader.readByte("concurrency");
@@ -458,7 +458,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 9:
+ case 8:
dhtVerKeys = reader.readCollection("dhtVerKeys", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -466,7 +466,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 10:
+ case 9:
dhtVerVals = reader.readCollection("dhtVerVals", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -474,7 +474,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 11:
+ case 10:
invalidate = reader.readBoolean("invalidate");
if (!reader.isLastRead())
@@ -482,7 +482,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 12:
+ case 11:
byte isolationOrd;
isolationOrd = reader.readByte("isolation");
@@ -494,7 +494,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 13:
+ case 12:
onePhaseCommit = reader.readBoolean("onePhaseCommit");
if (!reader.isLastRead())
@@ -502,7 +502,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 14:
+ case 13:
byte plcOrd;
plcOrd = reader.readByte("plc");
@@ -514,7 +514,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 15:
+ case 14:
reads = reader.readCollection("reads", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -522,7 +522,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 16:
+ case 15:
sys = reader.readBoolean("sys");
if (!reader.isLastRead())
@@ -530,7 +530,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 17:
+ case 16:
threadId = reader.readLong("threadId");
if (!reader.isLastRead())
@@ -538,7 +538,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 18:
+ case 17:
timeout = reader.readLong("timeout");
if (!reader.isLastRead())
@@ -546,7 +546,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 19:
+ case 18:
txNodesBytes = reader.readByteArray("txNodesBytes");
if (!reader.isLastRead())
@@ -554,7 +554,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 20:
+ case 19:
txSize = reader.readInt("txSize");
if (!reader.isLastRead())
@@ -562,7 +562,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 21:
+ case 20:
writeVer = reader.readMessage("writeVer");
if (!reader.isLastRead())
@@ -570,7 +570,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
reader.incrementState();
- case 22:
+ case 21:
writes = reader.readCollection("writes", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -590,7 +590,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 23;
+ return 22;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
index adece8c..f920e48 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
@@ -22,13 +22,10 @@ import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.util.tostring.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.plugin.extensions.communication.*;
-import org.jetbrains.annotations.*;
import java.io.*;
import java.nio.*;
-import java.util.*;
/**
* Response to prepare request.
@@ -37,14 +34,6 @@ public class GridDistributedTxPrepareResponse extends GridDistributedBaseMessage
/** */
private static final long serialVersionUID = 0L;
- /** Collections of local lock candidates. */
- @GridToStringInclude
- @GridDirectTransient
- private Map<KeyCacheObject, Collection<GridCacheMvccCandidate>> cands;
-
- /** */
- private byte[] candsBytes;
-
/** Error. */
@GridToStringExclude
@GridDirectTransient
@@ -98,27 +87,11 @@ public class GridDistributedTxPrepareResponse extends GridDistributedBaseMessage
return err != null;
}
- /**
- * @param cands Candidates map to set.
- */
- public void candidates(Map<KeyCacheObject, Collection<GridCacheMvccCandidate>> cands) {
- this.cands = cands;
- }
-
/** {@inheritDoc}
* @param ctx*/
@Override public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException {
super.prepareMarshal(ctx);
- if (candsBytes == null && cands != null) {
- if (ctx.deploymentEnabled()) {
- for (KeyCacheObject k : cands.keySet())
- prepareObject(k, ctx);
- }
-
- candsBytes = CU.marshal(ctx, cands);
- }
-
if (err != null)
errBytes = ctx.marshaller().marshal(err);
}
@@ -127,27 +100,10 @@ public class GridDistributedTxPrepareResponse extends GridDistributedBaseMessage
@Override public void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException {
super.finishUnmarshal(ctx, ldr);
- if (candsBytes != null && cands == null)
- cands = ctx.marshaller().unmarshal(candsBytes, ldr);
-
if (errBytes != null)
err = ctx.marshaller().unmarshal(errBytes, ldr);
}
- /**
- *
- * @param key Candidates key.
- * @return Collection of lock candidates at given index.
- */
- @Nullable public Collection<GridCacheMvccCandidate> candidatesForKey(KeyCacheObject key) {
- assert key != null;
-
- if (cands == null)
- return null;
-
- return cands.get(key);
- }
-
/** {@inheritDoc} */
@Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
writer.setBuffer(buf);
@@ -163,13 +119,7 @@ public class GridDistributedTxPrepareResponse extends GridDistributedBaseMessage
}
switch (writer.state()) {
- case 8:
- if (!writer.writeByteArray("candsBytes", candsBytes))
- return false;
-
- writer.incrementState();
-
- case 9:
+ case 7:
if (!writer.writeByteArray("errBytes", errBytes))
return false;
@@ -191,15 +141,7 @@ public class GridDistributedTxPrepareResponse extends GridDistributedBaseMessage
return false;
switch (reader.state()) {
- case 8:
- candsBytes = reader.readByteArray("candsBytes");
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 9:
+ case 7:
errBytes = reader.readByteArray("errBytes");
if (!reader.isLastRead())
@@ -219,7 +161,7 @@ public class GridDistributedTxPrepareResponse extends GridDistributedBaseMessage
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 10;
+ return 8;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java
index c0f2472..7f31b06 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java
@@ -106,7 +106,7 @@ public class GridDistributedUnlockRequest extends GridDistributedBaseMessage {
}
switch (writer.state()) {
- case 8:
+ case 7:
if (!writer.writeCollection("keys", keys, MessageCollectionItemType.MSG))
return false;
@@ -128,7 +128,7 @@ public class GridDistributedUnlockRequest extends GridDistributedBaseMessage {
return false;
switch (reader.state()) {
- case 8:
+ case 7:
keys = reader.readCollection("keys", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -148,7 +148,7 @@ public class GridDistributedUnlockRequest extends GridDistributedBaseMessage {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 9;
+ return 8;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
index 94ec718..7ce38f7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
@@ -58,8 +58,13 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
@GridDirectTransient
private Map<KeyCacheObject, GridCacheVersion> owned;
- /** Owner mapped version bytes. */
- private byte[] ownedBytes;
+ /** Array of keys from {@link #owned}. Used during marshalling and unmarshalling. */
+ @GridToStringExclude
+ private KeyCacheObject[] ownedKeys;
+
+ /** Array of values from {@link #owned}. Used during marshalling and unmarshalling. */
+ @GridToStringExclude
+ private GridCacheVersion[] ownedValues;
/** Topology version. */
private AffinityTopologyVersion topVer;
@@ -295,8 +300,18 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
prepareMarshalCacheObjects(nearKeys, ctx.cacheContext(cacheId));
- if (owned != null)
- ownedBytes = CU.marshal(ctx, owned);
+ if (owned != null) {
+ ownedKeys = new KeyCacheObject[owned.size()];
+ ownedValues = new GridCacheVersion[ownedKeys.length];
+
+ int i = 0;
+
+ for (Map.Entry<KeyCacheObject, GridCacheVersion> entry : owned.entrySet()) {
+ ownedKeys[i] = entry.getKey();
+ ownedValues[i] = entry.getValue();
+ i++;
+ }
+ }
}
/** {@inheritDoc} */
@@ -305,8 +320,17 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
finishUnmarshalCacheObjects(nearKeys, ctx.cacheContext(cacheId), ldr);
- if (ownedBytes != null)
- owned = ctx.marshaller().unmarshal(ownedBytes, ldr);
+ if (ownedKeys != null) {
+ owned = new GridLeanMap<>(ownedKeys.length);
+
+ for (int i = 0; i < ownedKeys.length; i++) {
+ ownedKeys[i].finishUnmarshal(ctx.cacheContext(cacheId).cacheObjectContext(), ldr);
+ owned.put(ownedKeys[i], ownedValues[i]);
+ }
+
+ ownedKeys = null;
+ ownedValues = null;
+ }
}
/** {@inheritDoc} */
@@ -324,32 +348,38 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
}
switch (writer.state()) {
- case 21:
+ case 20:
if (!writer.writeLong("accessTtl", accessTtl))
return false;
writer.incrementState();
- case 22:
+ case 21:
if (!writer.writeBitSet("invalidateEntries", invalidateEntries))
return false;
writer.incrementState();
- case 23:
+ case 22:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 24:
+ case 23:
if (!writer.writeCollection("nearKeys", nearKeys, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
+ case 24:
+ if (!writer.writeObjectArray("ownedKeys", ownedKeys, MessageCollectionItemType.MSG))
+ return false;
+
+ writer.incrementState();
+
case 25:
- if (!writer.writeByteArray("ownedBytes", ownedBytes))
+ if (!writer.writeObjectArray("ownedValues", ownedValues, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
@@ -394,7 +424,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
return false;
switch (reader.state()) {
- case 21:
+ case 20:
accessTtl = reader.readLong("accessTtl");
if (!reader.isLastRead())
@@ -402,7 +432,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 22:
+ case 21:
invalidateEntries = reader.readBitSet("invalidateEntries");
if (!reader.isLastRead())
@@ -410,7 +440,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 23:
+ case 22:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -418,7 +448,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 24:
+ case 23:
nearKeys = reader.readCollection("nearKeys", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -426,8 +456,18 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
reader.incrementState();
+ case 24:
+ ownedKeys = reader.readObjectArray("ownedKeys", MessageCollectionItemType.MSG, KeyCacheObject.class);
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
case 25:
- ownedBytes = reader.readByteArray("ownedBytes");
+ ownedValues = reader.readObjectArray("ownedValues",
+ MessageCollectionItemType.MSG,
+ GridCacheVersion.class);
if (!reader.isLastRead())
return false;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java
index bf3d974..8c9f32c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java
@@ -194,25 +194,25 @@ public class GridDhtLockResponse extends GridDistributedLockResponse {
}
switch (writer.state()) {
- case 11:
+ case 10:
if (!writer.writeCollection("invalidParts", invalidParts, MessageCollectionItemType.INT))
return false;
writer.incrementState();
- case 12:
+ case 11:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 13:
+ case 12:
if (!writer.writeCollection("nearEvicted", nearEvicted, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 14:
+ case 13:
if (!writer.writeCollection("preloadEntries", preloadEntries, MessageCollectionItemType.MSG))
return false;
@@ -234,7 +234,7 @@ public class GridDhtLockResponse extends GridDistributedLockResponse {
return false;
switch (reader.state()) {
- case 11:
+ case 10:
invalidParts = reader.readCollection("invalidParts", MessageCollectionItemType.INT);
if (!reader.isLastRead())
@@ -242,7 +242,7 @@ public class GridDhtLockResponse extends GridDistributedLockResponse {
reader.incrementState();
- case 12:
+ case 11:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -250,7 +250,7 @@ public class GridDhtLockResponse extends GridDistributedLockResponse {
reader.incrementState();
- case 13:
+ case 12:
nearEvicted = reader.readCollection("nearEvicted", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -258,7 +258,7 @@ public class GridDhtLockResponse extends GridDistributedLockResponse {
reader.incrementState();
- case 14:
+ case 13:
preloadEntries = reader.readCollection("preloadEntries", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -278,7 +278,7 @@ public class GridDhtLockResponse extends GridDistributedLockResponse {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 15;
+ return 14;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
index 7b077c3..a493ebb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
@@ -238,55 +238,55 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
}
switch (writer.state()) {
- case 19:
+ case 18:
if (!writer.writeByte("isolation", isolation != null ? (byte)isolation.ordinal() : -1))
return false;
writer.incrementState();
- case 20:
+ case 19:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 21:
+ case 20:
if (!writer.writeUuid("nearNodeId", nearNodeId))
return false;
writer.incrementState();
- case 22:
+ case 21:
if (!writer.writeCollection("pendingVers", pendingVers, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 23:
+ case 22:
if (!writer.writeUuid("subjId", subjId))
return false;
writer.incrementState();
- case 24:
+ case 23:
if (!writer.writeBoolean("sysInvalidate", sysInvalidate))
return false;
writer.incrementState();
- case 25:
+ case 24:
if (!writer.writeInt("taskNameHash", taskNameHash))
return false;
writer.incrementState();
- case 26:
+ case 25:
if (!writer.writeMessage("topVer", topVer))
return false;
writer.incrementState();
- case 27:
+ case 26:
if (!writer.writeMessage("writeVer", writeVer))
return false;
@@ -308,7 +308,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
return false;
switch (reader.state()) {
- case 19:
+ case 18:
byte isolationOrd;
isolationOrd = reader.readByte("isolation");
@@ -320,7 +320,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 20:
+ case 19:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -328,7 +328,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 21:
+ case 20:
nearNodeId = reader.readUuid("nearNodeId");
if (!reader.isLastRead())
@@ -336,7 +336,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 22:
+ case 21:
pendingVers = reader.readCollection("pendingVers", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -344,7 +344,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 23:
+ case 22:
subjId = reader.readUuid("subjId");
if (!reader.isLastRead())
@@ -352,7 +352,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 24:
+ case 23:
sysInvalidate = reader.readBoolean("sysInvalidate");
if (!reader.isLastRead())
@@ -360,7 +360,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 25:
+ case 24:
taskNameHash = reader.readInt("taskNameHash");
if (!reader.isLastRead())
@@ -368,7 +368,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 26:
+ case 25:
topVer = reader.readMessage("topVer");
if (!reader.isLastRead())
@@ -376,7 +376,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
reader.incrementState();
- case 27:
+ case 26:
writeVer = reader.readMessage("writeVer");
if (!reader.isLastRead())
@@ -396,6 +396,6 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 28;
+ return 27;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
index 73f86fd..909080d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
@@ -333,79 +333,79 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
}
switch (writer.state()) {
- case 23:
+ case 22:
if (!writer.writeIgniteUuid("futId", futId))
return false;
writer.incrementState();
- case 24:
+ case 23:
if (!writer.writeBitSet("invalidateNearEntries", invalidateNearEntries))
return false;
writer.incrementState();
- case 25:
+ case 24:
if (!writer.writeBoolean("last", last))
return false;
writer.incrementState();
- case 26:
+ case 25:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 27:
+ case 26:
if (!writer.writeUuid("nearNodeId", nearNodeId))
return false;
writer.incrementState();
- case 28:
+ case 27:
if (!writer.writeCollection("nearWrites", nearWrites, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 29:
+ case 28:
if (!writer.writeMessage("nearXidVer", nearXidVer))
return false;
writer.incrementState();
- case 30:
+ case 29:
if (!writer.writeCollection("ownedKeys", ownedKeys, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 31:
+ case 30:
if (!writer.writeCollection("ownedVals", ownedVals, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 32:
+ case 31:
if (!writer.writeBitSet("preloadKeys", preloadKeys))
return false;
writer.incrementState();
- case 33:
+ case 32:
if (!writer.writeUuid("subjId", subjId))
return false;
writer.incrementState();
- case 34:
+ case 33:
if (!writer.writeInt("taskNameHash", taskNameHash))
return false;
writer.incrementState();
- case 35:
+ case 34:
if (!writer.writeMessage("topVer", topVer))
return false;
@@ -427,7 +427,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
return false;
switch (reader.state()) {
- case 23:
+ case 22:
futId = reader.readIgniteUuid("futId");
if (!reader.isLastRead())
@@ -435,7 +435,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 24:
+ case 23:
invalidateNearEntries = reader.readBitSet("invalidateNearEntries");
if (!reader.isLastRead())
@@ -443,7 +443,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 25:
+ case 24:
last = reader.readBoolean("last");
if (!reader.isLastRead())
@@ -451,7 +451,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 26:
+ case 25:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -459,7 +459,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 27:
+ case 26:
nearNodeId = reader.readUuid("nearNodeId");
if (!reader.isLastRead())
@@ -467,7 +467,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 28:
+ case 27:
nearWrites = reader.readCollection("nearWrites", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -475,7 +475,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 29:
+ case 28:
nearXidVer = reader.readMessage("nearXidVer");
if (!reader.isLastRead())
@@ -483,7 +483,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 30:
+ case 29:
ownedKeys = reader.readCollection("ownedKeys", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -491,7 +491,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 31:
+ case 30:
ownedVals = reader.readCollection("ownedVals", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -499,7 +499,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 32:
+ case 31:
preloadKeys = reader.readBitSet("preloadKeys");
if (!reader.isLastRead())
@@ -507,7 +507,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 33:
+ case 32:
subjId = reader.readUuid("subjId");
if (!reader.isLastRead())
@@ -515,7 +515,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 34:
+ case 33:
taskNameHash = reader.readInt("taskNameHash");
if (!reader.isLastRead())
@@ -523,7 +523,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
reader.incrementState();
- case 35:
+ case 34:
topVer = reader.readMessage("topVer");
if (!reader.isLastRead())
@@ -543,6 +543,6 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 36;
+ return 35;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
index cfec044..753c117 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
@@ -225,31 +225,31 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse {
}
switch (writer.state()) {
- case 10:
+ case 8:
if (!writer.writeIgniteUuid("futId", futId))
return false;
writer.incrementState();
- case 11:
+ case 9:
if (!writer.writeCollection("invalidParts", invalidParts, MessageCollectionItemType.INT))
return false;
writer.incrementState();
- case 12:
+ case 10:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 13:
+ case 11:
if (!writer.writeCollection("nearEvicted", nearEvicted, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 14:
+ case 12:
if (!writer.writeCollection("preloadEntries", preloadEntries, MessageCollectionItemType.MSG))
return false;
@@ -271,7 +271,7 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse {
return false;
switch (reader.state()) {
- case 10:
+ case 8:
futId = reader.readIgniteUuid("futId");
if (!reader.isLastRead())
@@ -279,7 +279,7 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse {
reader.incrementState();
- case 11:
+ case 9:
invalidParts = reader.readCollection("invalidParts", MessageCollectionItemType.INT);
if (!reader.isLastRead())
@@ -287,7 +287,7 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse {
reader.incrementState();
- case 12:
+ case 10:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -295,7 +295,7 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse {
reader.incrementState();
- case 13:
+ case 11:
nearEvicted = reader.readCollection("nearEvicted", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -303,7 +303,7 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse {
reader.incrementState();
- case 14:
+ case 12:
preloadEntries = reader.readCollection("preloadEntries", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -323,6 +323,6 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 15;
+ return 13;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
index 1f3ba4c..f7f8167 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
@@ -110,7 +110,7 @@ public class GridDhtUnlockRequest extends GridDistributedUnlockRequest {
}
switch (writer.state()) {
- case 9:
+ case 8:
if (!writer.writeCollection("nearKeys", nearKeys, MessageCollectionItemType.MSG))
return false;
@@ -132,7 +132,7 @@ public class GridDhtUnlockRequest extends GridDistributedUnlockRequest {
return false;
switch (reader.state()) {
- case 9:
+ case 8:
nearKeys = reader.readCollection("nearKeys", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -152,6 +152,6 @@ public class GridDhtUnlockRequest extends GridDistributedUnlockRequest {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 10;
+ return 9;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
index 81184a9..4776963 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
@@ -363,85 +363,85 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
}
switch (writer.state()) {
- case 21:
+ case 20:
if (!writer.writeLong("accessTtl", accessTtl))
return false;
writer.incrementState();
- case 22:
+ case 21:
if (!writer.writeObjectArray("dhtVers", dhtVers, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 23:
+ case 22:
if (!writer.writeObjectArray("filter", filter, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 24:
+ case 23:
if (!writer.writeBoolean("firstClientReq", firstClientReq))
return false;
writer.incrementState();
- case 25:
+ case 24:
if (!writer.writeBoolean("hasTransforms", hasTransforms))
return false;
writer.incrementState();
- case 26:
+ case 25:
if (!writer.writeBoolean("implicitSingleTx", implicitSingleTx))
return false;
writer.incrementState();
- case 27:
+ case 26:
if (!writer.writeBoolean("implicitTx", implicitTx))
return false;
writer.incrementState();
- case 28:
+ case 27:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 29:
+ case 28:
if (!writer.writeBoolean("onePhaseCommit", onePhaseCommit))
return false;
writer.incrementState();
- case 30:
+ case 29:
if (!writer.writeBoolean("retVal", retVal))
return false;
writer.incrementState();
- case 31:
+ case 30:
if (!writer.writeUuid("subjId", subjId))
return false;
writer.incrementState();
- case 32:
+ case 31:
if (!writer.writeBoolean("syncCommit", syncCommit))
return false;
writer.incrementState();
- case 33:
+ case 32:
if (!writer.writeInt("taskNameHash", taskNameHash))
return false;
writer.incrementState();
- case 34:
+ case 33:
if (!writer.writeMessage("topVer", topVer))
return false;
@@ -463,7 +463,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
return false;
switch (reader.state()) {
- case 21:
+ case 20:
accessTtl = reader.readLong("accessTtl");
if (!reader.isLastRead())
@@ -471,7 +471,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 22:
+ case 21:
dhtVers = reader.readObjectArray("dhtVers", MessageCollectionItemType.MSG, GridCacheVersion.class);
if (!reader.isLastRead())
@@ -479,7 +479,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 23:
+ case 22:
filter = reader.readObjectArray("filter", MessageCollectionItemType.MSG, CacheEntryPredicate.class);
if (!reader.isLastRead())
@@ -487,7 +487,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 24:
+ case 23:
firstClientReq = reader.readBoolean("firstClientReq");
if (!reader.isLastRead())
@@ -495,7 +495,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 25:
+ case 24:
hasTransforms = reader.readBoolean("hasTransforms");
if (!reader.isLastRead())
@@ -503,7 +503,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 26:
+ case 25:
implicitSingleTx = reader.readBoolean("implicitSingleTx");
if (!reader.isLastRead())
@@ -511,7 +511,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 27:
+ case 26:
implicitTx = reader.readBoolean("implicitTx");
if (!reader.isLastRead())
@@ -519,7 +519,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 28:
+ case 27:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -527,7 +527,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 29:
+ case 28:
onePhaseCommit = reader.readBoolean("onePhaseCommit");
if (!reader.isLastRead())
@@ -535,7 +535,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 30:
+ case 29:
retVal = reader.readBoolean("retVal");
if (!reader.isLastRead())
@@ -543,7 +543,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 31:
+ case 30:
subjId = reader.readUuid("subjId");
if (!reader.isLastRead())
@@ -551,7 +551,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 32:
+ case 31:
syncCommit = reader.readBoolean("syncCommit");
if (!reader.isLastRead())
@@ -559,7 +559,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 33:
+ case 32:
taskNameHash = reader.readInt("taskNameHash");
if (!reader.isLastRead())
@@ -567,7 +567,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
reader.incrementState();
- case 34:
+ case 33:
topVer = reader.readMessage("topVer");
if (!reader.isLastRead())
@@ -587,7 +587,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 35;
+ return 34;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83a1986a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockResponse.java
index f324198..62002dc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockResponse.java
@@ -205,37 +205,37 @@ public class GridNearLockResponse extends GridDistributedLockResponse {
}
switch (writer.state()) {
- case 11:
+ case 10:
if (!writer.writeMessage("clientRemapVer", clientRemapVer))
return false;
writer.incrementState();
- case 12:
+ case 11:
if (!writer.writeObjectArray("dhtVers", dhtVers, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 13:
+ case 12:
if (!writer.writeBooleanArray("filterRes", filterRes))
return false;
writer.incrementState();
- case 14:
+ case 13:
if (!writer.writeObjectArray("mappedVers", mappedVers, MessageCollectionItemType.MSG))
return false;
writer.incrementState();
- case 15:
+ case 14:
if (!writer.writeIgniteUuid("miniId", miniId))
return false;
writer.incrementState();
- case 16:
+ case 15:
if (!writer.writeCollection("pending", pending, MessageCollectionItemType.MSG))
return false;
@@ -257,7 +257,7 @@ public class GridNearLockResponse extends GridDistributedLockResponse {
return false;
switch (reader.state()) {
- case 11:
+ case 10:
clientRemapVer = reader.readMessage("clientRemapVer");
if (!reader.isLastRead())
@@ -265,7 +265,7 @@ public class GridNearLockResponse extends GridDistributedLockResponse {
reader.incrementState();
- case 12:
+ case 11:
dhtVers = reader.readObjectArray("dhtVers", MessageCollectionItemType.MSG, GridCacheVersion.class);
if (!reader.isLastRead())
@@ -273,7 +273,7 @@ public class GridNearLockResponse extends GridDistributedLockResponse {
reader.incrementState();
- case 13:
+ case 12:
filterRes = reader.readBooleanArray("filterRes");
if (!reader.isLastRead())
@@ -281,7 +281,7 @@ public class GridNearLockResponse extends GridDistributedLockResponse {
reader.incrementState();
- case 14:
+ case 13:
mappedVers = reader.readObjectArray("mappedVers", MessageCollectionItemType.MSG, GridCacheVersion.class);
if (!reader.isLastRead())
@@ -289,7 +289,7 @@ public class GridNearLockResponse extends GridDistributedLockResponse {
reader.incrementState();
- case 15:
+ case 14:
miniId = reader.readIgniteUuid("miniId");
if (!reader.isLastRead())
@@ -297,7 +297,7 @@ public class GridNearLockResponse extends GridDistributedLockResponse {
reader.incrementState();
- case 16:
+ case 15:
pending = reader.readCollection("pending", MessageCollectionItemType.MSG);
if (!reader.isLastRead())
@@ -317,7 +317,7 @@ public class GridNearLockResponse extends GridDistributedLockResponse {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 17;
+ return 16;
}
/** {@inheritDoc} */
[32/50] [abbrv] incubator-ignite git commit: # Sprint-6 - Spark
dependencies improved.
Posted by se...@apache.org.
# Sprint-6 - Spark dependencies improved.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f0e74c0a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f0e74c0a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f0e74c0a
Branch: refs/heads/ignite-484-1
Commit: f0e74c0a245928dee16eabe88a3bff0892e6c167
Parents: 5b4cb44
Author: Alexey Goncharuk <ag...@gridgain.com>
Authored: Thu Jun 11 18:35:21 2015 -0700
Committer: Alexey Goncharuk <ag...@gridgain.com>
Committed: Thu Jun 11 18:35:21 2015 -0700
----------------------------------------------------------------------
modules/spark/pom.xml | 38 +++++++++++++++++---------------------
1 file changed, 17 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f0e74c0a/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index b3d2732..e62ca24 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -66,40 +66,36 @@
<version>1.3.1</version>
</dependency>
- <!-- Test dependencies -->
-
<dependency>
- <groupId>org.scalatest</groupId>
- <artifactId>scalatest_2.11</artifactId>
- <version>2.2.2</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-library</artifactId>
- </exclusion>
- </exclusions>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-indexing</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ignite</groupId>
- <artifactId>ignite-indexing</artifactId>
+ <artifactId>ignite-spring</artifactId>
<version>${project.version}</version>
- <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>${spring.version}</version>
- <scope>test</scope>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-log4j</artifactId>
+ <version>${project.version}</version>
</dependency>
+ <!-- Test dependencies -->
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>${spring.version}</version>
+ <groupId>org.scalatest</groupId>
+ <artifactId>scalatest_2.11</artifactId>
+ <version>2.2.2</version>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
[37/50] [abbrv] incubator-ignite git commit: ignite-classname
Marshaller load classname properties by plugin name.
Posted by se...@apache.org.
ignite-classname Marshaller load classname properties by plugin name.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a515ec91
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a515ec91
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a515ec91
Branch: refs/heads/ignite-484-1
Commit: a515ec91d23910b3a4d686f5d53f279cdb6e4cb0
Parents: b087aca
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jun 12 12:49:53 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jun 12 12:49:53 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/GridKernalContextImpl.java | 5 +++--
.../org/apache/ignite/internal/IgniteKernal.java | 19 +++++++++++++++++--
.../internal/MarshallerContextAdapter.java | 18 ++++++++++++++++--
.../ignite/internal/MarshallerContextImpl.java | 7 ++++++-
.../optimized/GridClientOptimizedMarshaller.java | 5 +++++
.../processors/plugin/IgnitePluginProcessor.java | 16 ++--------------
.../marshaller/MarshallerContextTestImpl.java | 18 ++++++++++++++++++
.../junits/GridTestKernalContext.java | 1 +
8 files changed, 68 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a515ec91/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
index f921d49..7b07593 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
@@ -340,7 +340,8 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
ExecutorService p2pExecSvc,
ExecutorService mgmtExecSvc,
ExecutorService igfsExecSvc,
- ExecutorService restExecSvc) throws IgniteCheckedException {
+ ExecutorService restExecSvc,
+ List<PluginProvider> plugins) throws IgniteCheckedException {
assert grid != null;
assert cfg != null;
assert gw != null;
@@ -357,7 +358,7 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
this.igfsExecSvc = igfsExecSvc;
this.restExecSvc = restExecSvc;
- marshCtx = new MarshallerContextImpl();
+ marshCtx = new MarshallerContextImpl(plugins);
try {
spring = SPRING.create(false);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a515ec91/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 db238c8..9b2ae27 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
@@ -77,6 +77,7 @@ import javax.management.*;
import java.io.*;
import java.lang.management.*;
import java.lang.reflect.*;
+import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
@@ -629,6 +630,19 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
// Ack configuration.
ackSpis();
+ List<PluginProvider> plugins = AccessController.doPrivileged(new PrivilegedAction<List<PluginProvider>>() {
+ @Override public List<PluginProvider> run() {
+ List<PluginProvider> providers = new ArrayList<>();
+
+ ServiceLoader<PluginProvider> ldr = ServiceLoader.load(PluginProvider.class);
+
+ for (PluginProvider provider : ldr)
+ providers.add(provider);
+
+ return providers;
+ }
+ });
+
// Spin out SPIs & managers.
try {
ctx = new GridKernalContextImpl(log,
@@ -642,7 +656,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
p2pExecSvc,
mgmtExecSvc,
igfsExecSvc,
- restExecSvc);
+ restExecSvc,
+ plugins);
cfg.getMarshaller().setContext(ctx.marshallerContext());
@@ -678,7 +693,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
addHelper(IGFS_HELPER.create(F.isEmpty(cfg.getFileSystemConfiguration())));
- startProcessor(new IgnitePluginProcessor(ctx, cfg));
+ startProcessor(new IgnitePluginProcessor(ctx, cfg, plugins));
verChecker = null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a515ec91/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java
index 2ec9825..6ef7713 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextAdapter.java
@@ -21,6 +21,8 @@ import org.apache.ignite.*;
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.marshaller.*;
+import org.apache.ignite.plugin.*;
+import org.jetbrains.annotations.*;
import org.jsr166.*;
import java.io.*;
@@ -46,8 +48,10 @@ public abstract class MarshallerContextAdapter implements MarshallerContext {
/**
* Initializes context.
+ *
+ * @param plugins Plugins.
*/
- public MarshallerContextAdapter() {
+ public MarshallerContextAdapter(@Nullable List<PluginProvider> plugins) {
try {
ClassLoader ldr = U.gridClassLoader();
@@ -76,6 +80,16 @@ public abstract class MarshallerContextAdapter implements MarshallerContext {
checkHasClassName(GridDhtPartitionFullMap.class.getName(), ldr, CLS_NAMES_FILE);
checkHasClassName(GridDhtPartitionMap.class.getName(), ldr, CLS_NAMES_FILE);
checkHasClassName(HashMap.class.getName(), ldr, JDK_CLS_NAMES_FILE);
+
+ if (plugins != null && !plugins.isEmpty()) {
+ for (PluginProvider plugin : plugins) {
+ URL pluginClsNames = ldr.getResource("META-INF/" + plugin.name().toLowerCase()
+ + ".classnames.properties");
+
+ if (pluginClsNames != null)
+ processResource(pluginClsNames);
+ }
+ }
}
catch (IOException e) {
throw new IllegalStateException("Failed to initialize marshaller context.", e);
@@ -87,7 +101,7 @@ public abstract class MarshallerContextAdapter implements MarshallerContext {
* @param ldr Class loader used to get properties file.
* @param fileName File name.
*/
- private void checkHasClassName(String clsName, ClassLoader ldr, String fileName) {
+ public void checkHasClassName(String clsName, ClassLoader ldr, String fileName) {
if (!map.containsKey(clsName.hashCode()))
throw new IgniteException("Failed to read class name from class names properties file. " +
"Make sure class names properties file packaged with ignite binaries is not corrupted " +
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a515ec91/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
index 4b0251d..7940e95 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
@@ -20,9 +20,11 @@ package org.apache.ignite.internal;
import org.apache.ignite.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.plugin.*;
import javax.cache.event.*;
import java.io.*;
+import java.util.*;
import java.util.concurrent.*;
/**
@@ -45,9 +47,12 @@ public class MarshallerContextImpl extends MarshallerContextAdapter {
private int failedCnt;
/**
+ * @param plugins Plugins.
* @throws IgniteCheckedException In case of error.
*/
- public MarshallerContextImpl() throws IgniteCheckedException {
+ public MarshallerContextImpl(List<PluginProvider> plugins) throws IgniteCheckedException {
+ super(plugins);
+
workDir = U.resolveWorkDirectory("marshaller", false);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a515ec91/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
index 254962a..7c2bd2f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
@@ -100,6 +100,11 @@ public class GridClientOptimizedMarshaller implements GridClientMarshaller {
/**
*/
private static class ClientMarshallerContext extends MarshallerContextAdapter {
+ /** */
+ public ClientMarshallerContext() {
+ super(null);
+ }
+
/** {@inheritDoc} */
@Override protected boolean registerClassName(int id, String clsName) {
throw new UnsupportedOperationException(clsName);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a515ec91/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
index 8f2cc51..ecc6924 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
@@ -48,26 +48,14 @@ public class IgnitePluginProcessor extends GridProcessorAdapter {
*
* @param ctx Kernal context.
* @param cfg Ignite configuration.
+ * @param providers Plugin providers.
*/
@SuppressWarnings("TypeMayBeWeakened")
- public IgnitePluginProcessor(GridKernalContext ctx, IgniteConfiguration cfg) {
+ public IgnitePluginProcessor(GridKernalContext ctx, IgniteConfiguration cfg, List<PluginProvider> providers) {
super(ctx);
ExtensionRegistryImpl registry = new ExtensionRegistryImpl();
- List<PluginProvider> providers = AccessController.doPrivileged(new PrivilegedAction<List<PluginProvider>>() {
- @Override public List<PluginProvider> run() {
- List<PluginProvider> providers = new ArrayList<>();
-
- ServiceLoader<PluginProvider> ldr = ServiceLoader.load(PluginProvider.class);
-
- for (PluginProvider provider : ldr)
- providers.add(provider);
-
- return providers;
- }
- });
-
for (PluginProvider provider : providers) {
GridPluginContext pluginCtx = new GridPluginContext(ctx, cfg);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a515ec91/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java b/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java
index 4164fda..00d1f43 100644
--- a/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java
+++ b/modules/core/src/test/java/org/apache/ignite/marshaller/MarshallerContextTestImpl.java
@@ -19,8 +19,10 @@ package org.apache.ignite.marshaller;
import org.apache.ignite.*;
import org.apache.ignite.internal.*;
+import org.apache.ignite.plugin.*;
import org.jsr166.*;
+import java.util.*;
import java.util.concurrent.*;
/**
@@ -30,6 +32,22 @@ public class MarshallerContextTestImpl extends MarshallerContextAdapter {
/** */
private final static ConcurrentMap<Integer, String> map = new ConcurrentHashMap8<>();
+ /**
+ * Initializes context.
+ *
+ * @param plugins Plugins.
+ */
+ public MarshallerContextTestImpl(List<PluginProvider> plugins) {
+ super(plugins);
+ }
+
+ /**
+ * Initializes context.
+ */
+ public MarshallerContextTestImpl() {
+ super(null);
+ }
+
/** {@inheritDoc} */
@Override protected boolean registerClassName(int id, String clsName) throws IgniteCheckedException {
String oldClsName = map.putIfAbsent(id, clsName);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a515ec91/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
index 6b7a7f9..37948d9 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
@@ -45,6 +45,7 @@ public class GridTestKernalContext extends GridKernalContextImpl {
null,
null,
null,
+ null,
null);
GridTestUtils.setFieldValue(grid(), "cfg", config());
[36/50] [abbrv] incubator-ignite git commit: ignite-484-1 - minor
Posted by se...@apache.org.
ignite-484-1 - minor
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2b7dc3bb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2b7dc3bb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2b7dc3bb
Branch: refs/heads/ignite-484-1
Commit: 2b7dc3bbe0a65fcdf8e7e50da0e494b07e15ffc7
Parents: 0a5e97c
Author: S.Vladykin <sv...@gridgain.com>
Authored: Fri Jun 12 10:36:43 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Fri Jun 12 10:36:43 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/cache/query/ScanQuery.java | 20 --------------------
.../IgniteCacheQueryMultiThreadedSelfTest.java | 1 -
2 files changed, 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b7dc3bb/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java b/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
index 90000e8..11a8c84 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
@@ -119,26 +119,6 @@ public final class ScanQuery<K, V> extends Query<Cache.Entry<K, V>> {
return this;
}
- /**
- * Gets partition number over which this query should iterate. Will return {@code null} if partition was not
- * set. In this case query will iterate over all partitions in the cache.
- *
- * @return Partition number or {@code null}.
- */
- @Nullable public Integer getPartition() {
- return part;
- }
-
- /**
- * Sets partition number over which this query should iterate. If {@code null}, query will iterate over
- * all partitions in the cache. Must be in the range [0, N) where N is partition number in the cache.
- *
- * @param part Partition number over which this query should iterate.
- */
- public void setPartition(@Nullable Integer part) {
- this.part = part;
- }
-
/** {@inheritDoc} */
@Override public ScanQuery<K, V> setPageSize(int pageSize) {
return (ScanQuery<K, V>)super.setPageSize(pageSize);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b7dc3bb/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
index 9fcd947..3e50443 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
@@ -29,7 +29,6 @@ import org.apache.ignite.internal.processors.query.*;
import org.apache.ignite.internal.processors.query.h2.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
[33/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-1008-v2' into ignite-sprint-6
Posted by se...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1008-v2' into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/904888b2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/904888b2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/904888b2
Branch: refs/heads/ignite-484-1
Commit: 904888b2b468637c76075523eee68506fef7c28e
Parents: f0e74c0 fb8b996
Author: sboikov <se...@inria.fr>
Authored: Fri Jun 12 07:44:41 2015 +0300
Committer: sboikov <se...@inria.fr>
Committed: Fri Jun 12 07:44:41 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 17 ++
...teStartCacheInTransactionAtomicSelfTest.java | 32 +++
.../IgniteStartCacheInTransactionSelfTest.java | 254 +++++++++++++++++++
.../testsuites/IgniteCacheTestSuite4.java | 3 +
4 files changed, 306 insertions(+)
----------------------------------------------------------------------
[45/50] [abbrv] incubator-ignite git commit: Release latch in
marshaller context in stop method.
Posted by se...@apache.org.
Release latch in marshaller context in stop method.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e17a2be1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e17a2be1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e17a2be1
Branch: refs/heads/ignite-484-1
Commit: e17a2be1b931ea6b4e56be653b73a7994fd59898
Parents: e158c90
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jun 12 17:13:06 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jun 12 17:13:06 2015 +0300
----------------------------------------------------------------------
.../main/java/org/apache/ignite/internal/IgniteKernal.java | 2 ++
.../org/apache/ignite/internal/MarshallerContextImpl.java | 7 +++++++
2 files changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e17a2be1/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 9b2ae27..9da3346 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
@@ -1705,6 +1705,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
List<GridComponent> comps = ctx.components();
+ ctx.marshallerContext().onKernalStop();
+
// Callback component in reverse order while kernal is still functional
// if called in the same thread, at least.
for (ListIterator<GridComponent> it = comps.listIterator(comps.size()); it.hasPrevious();) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e17a2be1/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
index 7940e95..48f24ac 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
@@ -83,6 +83,13 @@ public class MarshallerContextImpl extends MarshallerContextAdapter {
latch.countDown();
}
+ /**
+ * Release marshaller context.
+ */
+ public void onKernalStop() {
+ latch.countDown();
+ }
+
/** {@inheritDoc} */
@Override protected boolean registerClassName(int id, String clsName) throws IgniteCheckedException {
GridCacheAdapter<Integer, String> cache0 = cache;
[08/50] [abbrv] incubator-ignite git commit: ignite-695: Implemented.
Posted by se...@apache.org.
ignite-695: Implemented.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a12302ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a12302ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a12302ee
Branch: refs/heads/ignite-484-1
Commit: a12302eedea75cba53883182f2dd4423c39c45e2
Parents: 9300ca6
Author: ashutak <as...@gridgain.com>
Authored: Wed Jun 10 17:41:44 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Wed Jun 10 17:41:44 2015 +0300
----------------------------------------------------------------------
.../client/router/TcpSslRouterSelfTest.java | 5 ++++
.../client/suite/IgniteClientTestSuite.java | 3 +--
.../ignite/GridSuppressedExceptionSelfTest.java | 4 ++-
...inodeUpdateNearEnabledNoBackupsSelfTest.java | 2 +-
...CacheMultinodeUpdateNearEnabledSelfTest.java | 2 +-
.../processors/cache/GridCacheOffHeapTest.java | 28 +++++++++++++++-----
.../cache/GridCachePutAllFailoverSelfTest.java | 5 ++++
.../processors/cache/GridCacheStopSelfTest.java | 5 ++++
.../cache/GridCacheVersionMultinodeTest.java | 2 +-
.../IgniteCacheInterceptorSelfTestSuite.java | 2 +-
.../cache/IgniteCacheInvokeReadThroughTest.java | 5 ++++
...gniteCacheTransactionalStopBusySelfTest.java | 5 ++++
.../IgniteTxMultiThreadedAbstractTest.java | 4 +--
...dCacheQueueMultiNodeConsistencySelfTest.java | 5 ++++
...omicOffheapQueueCreateMultiNodeSelfTest.java | 5 ++++
...ionedAtomicQueueCreateMultiNodeSelfTest.java | 5 ++++
...rtitionedDataStructuresFailoverSelfTest.java | 5 ++++
...edOffheapDataStructuresFailoverSelfTest.java | 5 ++++
...PartitionedQueueCreateMultiNodeSelfTest.java | 5 ++++
...dCachePartitionedQueueEntryMoveSelfTest.java | 5 ++++
...nedQueueFailoverDataConsistencySelfTest.java | 5 ++++
...eplicatedDataStructuresFailoverSelfTest.java | 5 ++++
...CacheLoadingConcurrentGridStartSelfTest.java | 5 ++++
.../dht/GridCacheColocatedFailoverSelfTest.java | 5 ++++
.../GridCacheColocatedTxExceptionSelfTest.java | 5 ++++
...ePartitionedNearDisabledMetricsSelfTest.java | 4 ++-
...dCachePartitionedTopologyChangeSelfTest.java | 5 ++++
.../near/GridCacheNearTxExceptionSelfTest.java | 5 ++++
.../GridCachePartitionedFailoverSelfTest.java | 5 ++++
...PartitionedFullApiMultithreadedSelfTest.java | 5 ++++
.../GridCachePartitionedNodeRestartTest.java | 5 ++++
...ePartitionedOptimisticTxNodeRestartTest.java | 5 ++++
...CachePartitionedTxMultiThreadedSelfTest.java | 5 ++++
.../GridCacheReplicatedFailoverSelfTest.java | 5 ++++
...eReplicatedFullApiMultithreadedSelfTest.java | 5 ++++
.../GridCacheReplicatedInvalidateSelfTest.java | 4 +--
...ridCacheReplicatedMultiNodeLockSelfTest.java | 5 ++++
.../GridCacheReplicatedMultiNodeSelfTest.java | 5 ++++
.../GridCacheReplicatedNodeRestartSelfTest.java | 5 ++++
.../GridCacheReplicatedTxExceptionSelfTest.java | 5 ++++
.../replicated/GridReplicatedTxPreloadTest.java | 2 ++
...acheAtomicReplicatedNodeRestartSelfTest.java | 5 ++++
.../GridCacheEvictionFilterSelfTest.java | 4 ++-
...cheSynchronousEvictionsFailoverSelfTest.java | 5 ++++
.../IgniteCacheExpiryPolicyAbstractTest.java | 10 ++++---
...eCacheExpiryPolicyWithStoreAbstractTest.java | 4 ++-
...dCacheLocalFullApiMultithreadedSelfTest.java | 5 ++++
.../GridCacheLocalTxExceptionSelfTest.java | 5 ++++
.../processors/igfs/IgfsModesSelfTest.java | 4 ++-
.../unsafe/GridUnsafeMemorySelfTest.java | 4 ++-
.../IgniteCacheDataStructuresSelfTestSuite.java | 24 +++++++----------
.../IgniteCacheEvictionSelfTestSuite.java | 3 +--
.../IgniteCacheFailoverTestSuite.java | 8 +++---
.../IgniteCacheFullApiSelfTestSuite.java | 8 +++---
.../testsuites/IgniteCacheRestartTestSuite.java | 10 +++----
.../ignite/testsuites/IgniteCacheTestSuite.java | 16 ++++++-----
.../testsuites/IgniteCacheTestSuite2.java | 4 +--
.../testsuites/IgniteCacheTestSuite3.java | 14 ++++------
.../testsuites/IgniteCacheTestSuite4.java | 10 +++----
.../apache/ignite/util/GridRandomSelfTest.java | 4 ++-
.../HadoopIgfs20FileSystemAbstractSelfTest.java | 4 ++-
.../collections/HadoopHashMapSelfTest.java | 4 ++-
.../HadoopExternalTaskExecutionSelfTest.java | 2 ++
.../HadoopExternalCommunicationSelfTest.java | 5 ++++
.../testsuites/IgniteHadoopTestSuite.java | 7 ++---
.../hibernate/HibernateL2CacheSelfTest.java | 5 ++++
.../HibernateL2CacheTransactionalSelfTest.java | 5 ++++
.../testsuites/IgniteHibernateTestSuite.java | 4 +--
.../cache/GridCacheCrossCacheQuerySelfTest.java | 8 ++++--
.../IgniteCacheQueryNodeRestartSelfTest.java | 5 ++++
.../h2/GridIndexingSpiAbstractSelfTest.java | 4 ++-
.../query/h2/sql/BaseH2CompareQueryTest.java | 4 ++-
.../IgniteCacheQuerySelfTestSuite.java | 2 +-
.../IgniteWebSessionSelfTestSuite.java | 2 +-
74 files changed, 320 insertions(+), 95 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/clients/src/test/java/org/apache/ignite/internal/client/router/TcpSslRouterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/router/TcpSslRouterSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/router/TcpSslRouterSelfTest.java
index 750c246..498be7d 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/router/TcpSslRouterSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/router/TcpSslRouterSelfTest.java
@@ -26,6 +26,11 @@ import org.apache.ignite.testframework.*;
*/
public class TcpSslRouterSelfTest extends TcpRouterAbstractSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-433");
+ }
+
+ /** {@inheritDoc} */
@Override protected boolean useSsl() {
return true;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java
index 5fdafb1..e9d1ebb 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java
@@ -103,8 +103,7 @@ public class IgniteClientTestSuite extends TestSuite {
// Router tests.
suite.addTest(new TestSuite(TcpRouterSelfTest.class));
- // TODO uncomment when fixed https://issues.apache.org/jira/browse/IGNITE-433
- // suite.addTest(new TestSuite(TcpSslRouterSelfTest.class));
+ suite.addTest(new TestSuite(TcpSslRouterSelfTest.class));
suite.addTest(new TestSuite(TcpRouterMultiNodeSelfTest.class));
suite.addTest(new TestSuite(ClientFailedInitSelfTest.class));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/GridSuppressedExceptionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/GridSuppressedExceptionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/GridSuppressedExceptionSelfTest.java
index c41bdaf..4c27d50 100644
--- a/modules/core/src/test/java/org/apache/ignite/GridSuppressedExceptionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/GridSuppressedExceptionSelfTest.java
@@ -93,7 +93,9 @@ public class GridSuppressedExceptionSelfTest extends TestCase {
*
* @throws Exception If failed.
*/
- public void _testStackTrace() throws Exception {
+ public void testStackTrace() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-818");
+
IgniteCheckedException me = new IgniteCheckedException("Test message.");
for (int i = 5; i < 20; i++) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.java
index e10d626..09f9042 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.configuration.*;
/**
- *
+ * TODO: IGNITE-809.
*/
public class GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest extends GridCacheMultinodeUpdateNearEnabledSelfTest {
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledSelfTest.java
index 982f7b8..201aa44 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateNearEnabledSelfTest.java
@@ -23,7 +23,7 @@ import org.apache.ignite.configuration.*;
import static org.apache.ignite.cache.CacheAtomicityMode.*;
/**
- *
+ * TODO: IGNITE-809.
*/
public class GridCacheMultinodeUpdateNearEnabledSelfTest extends GridCacheMultinodeUpdateAbstractSelfTest {
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTest.java
index b0f07f0..f7e3962 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTest.java
@@ -92,7 +92,9 @@ public class GridCacheOffHeapTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
- public void _testOnHeapReplicatedPerformance() throws Exception {
+ public void testOnHeapReplicatedPerformance() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-817");
+
mode = REPLICATED;
onheap = 0;
startSize = 18 * 1024 * 1024;
@@ -103,7 +105,9 @@ public class GridCacheOffHeapTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
- public void _testOnHeapPartitionedPerformance() throws Exception {
+ public void testOnHeapPartitionedPerformance() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-817");
+
mode = PARTITIONED;
onheap = 0;
startSize = 18 * 1024 * 1024;
@@ -114,7 +118,9 @@ public class GridCacheOffHeapTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
- public void _testOffHeapReplicatedPerformance() throws Exception {
+ public void testOffHeapReplicatedPerformance() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-817");
+
mode = REPLICATED;
onheap = 1024 * 1024;
startSize = onheap;
@@ -125,7 +131,9 @@ public class GridCacheOffHeapTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
- public void _testOffHeapPartitionedPerformance() throws Exception {
+ public void testOffHeapPartitionedPerformance() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-817");
+
mode = PARTITIONED;
onheap = 4 * 1024 * 1024;
@@ -135,7 +143,9 @@ public class GridCacheOffHeapTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
- public void _testOnHeapReplicatedPerformanceMultithreaded() throws Exception {
+ public void testOnHeapReplicatedPerformanceMultithreaded() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-817");
+
mode = REPLICATED;
onheap = 0;
startSize = 18 * 1024 * 1024;
@@ -146,7 +156,9 @@ public class GridCacheOffHeapTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
- public void _testOnHeapPartitionedPerformanceMultithreaded() throws Exception {
+ public void testOnHeapPartitionedPerformanceMultithreaded() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-817");
+
mode = PARTITIONED;
onheap = 0;
startSize = 18 * 1024 * 1024;
@@ -168,7 +180,9 @@ public class GridCacheOffHeapTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
- public void _testOffHeapPartitionedPerformanceMultithreaded() throws Exception {
+ public void testOffHeapPartitionedPerformanceMultithreaded() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-817");
+
mode = PARTITIONED;
onheap = 4 * 1024 * 1024;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
index fc9e17b..4ef5787 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
@@ -49,6 +49,11 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
* Tests putAll() method along with failover and different configurations.
*/
public class GridCachePutAllFailoverSelfTest extends GridCommonAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-157");
+ }
+
/** IP finder. */
private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStopSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStopSelfTest.java
index 1d7c2bd..ccf2332 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStopSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStopSelfTest.java
@@ -36,6 +36,11 @@ import static org.apache.ignite.cache.CacheMode.*;
* Tests correct cache stopping.
*/
public class GridCacheStopSelfTest extends GridCommonAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-257");
+ }
+
/** */
private static final String EXPECTED_MSG = "Grid is in invalid state to perform this operation. " +
"It either not started yet or has already being or have stopped";
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java
index 3c3c5db..cecb4a9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java
@@ -81,7 +81,7 @@ public class GridCacheVersionMultinodeTest extends GridCacheAbstractSelfTest {
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
- // No-op.
+ fail("https://issues.apache.org/jira/browse/IGNITE-114");
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInterceptorSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInterceptorSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInterceptorSelfTestSuite.java
index ee4d64b..a5c4a99 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInterceptorSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInterceptorSelfTestSuite.java
@@ -47,7 +47,7 @@ public class IgniteCacheInterceptorSelfTestSuite extends TestSuite {
suite.addTestSuite(GridCacheInterceptorSelfTest.class);
suite.addTestSuite(GridCacheInterceptorNearEnabledSelfTest.class);
-// suite.addTestSuite(GridCacheInterceptorWithStoreSelfTest.class); TODO GG-9141
+ suite.addTestSuite(GridCacheInterceptorWithStoreSelfTest.class);
suite.addTestSuite(GridCacheInterceptorReplicatedSelfTest.class);
suite.addTestSuite(GridCacheInterceptorReplicatedWithStoreSelfTest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInvokeReadThroughTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInvokeReadThroughTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInvokeReadThroughTest.java
index 673bbaf..10ab1ab 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInvokeReadThroughTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInvokeReadThroughTest.java
@@ -32,6 +32,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*
*/
public class IgniteCacheInvokeReadThroughTest extends IgniteCacheAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-114");
+ }
+
/** */
private static volatile boolean failed;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java
index 07b7c13..fe1b266 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java
@@ -24,6 +24,11 @@ import org.apache.ignite.internal.processors.cache.distributed.near.*;
*/
public class IgniteCacheTransactionalStopBusySelfTest extends IgniteCacheAbstractStopBusySelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-257");
+ }
+
+ /** {@inheritDoc} */
@Override public void testPut() throws Exception {
bannedMessage.set(GridNearTxPrepareRequest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiThreadedAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiThreadedAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiThreadedAbstractTest.java
index 09090a4..b1d29e0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiThreadedAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiThreadedAbstractTest.java
@@ -204,11 +204,11 @@ public abstract class IgniteTxMultiThreadedAbstractTest extends IgniteTxAbstract
}
/**
- * TODO: IGNITE-582.
- *
* @throws Exception If failed.
*/
public void testOptimisticSerializableConsistency() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-582");
+
final IgniteCache<Integer, Long> cache = grid(0).cache(null);
final int THREADS = 2;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java
index 2232493..782ba97 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java
@@ -54,6 +54,11 @@ public class GridCacheQueueMultiNodeConsistencySelfTest extends IgniteCollection
private int backups;
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-583");
+ }
+
+ /** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
// No-op.
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest.java
index f29a752..317904e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest.java
@@ -26,6 +26,11 @@ import static org.apache.ignite.cache.CacheMemoryMode.*;
public class GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest
extends GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-80");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheMemoryMode collectionMemoryMode() {
return OFFHEAP_TIERED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest.java
index e2cebec..8a6db83 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest.java
@@ -28,6 +28,11 @@ import static org.apache.ignite.cache.CacheMemoryMode.*;
public class GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest
extends GridCachePartitionedQueueCreateMultiNodeSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-80");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheMemoryMode collectionMemoryMode() {
return ONHEAP_TIERED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedDataStructuresFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedDataStructuresFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedDataStructuresFailoverSelfTest.java
index 519148e..8d5a483 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedDataStructuresFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedDataStructuresFailoverSelfTest.java
@@ -30,6 +30,11 @@ import static org.apache.ignite.cache.CacheMode.*;
public class GridCachePartitionedDataStructuresFailoverSelfTest
extends GridCacheAbstractDataStructuresFailoverSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-803");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheMode collectionCacheMode() {
return PARTITIONED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedOffheapDataStructuresFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedOffheapDataStructuresFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedOffheapDataStructuresFailoverSelfTest.java
index 9878693..b38798e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedOffheapDataStructuresFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedOffheapDataStructuresFailoverSelfTest.java
@@ -26,6 +26,11 @@ import static org.apache.ignite.cache.CacheMemoryMode.*;
*/
public class GridCachePartitionedOffheapDataStructuresFailoverSelfTest extends GridCachePartitionedDataStructuresFailoverSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-803");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheMemoryMode collectionMemoryMode() {
return OFFHEAP_TIERED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueCreateMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueCreateMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueCreateMultiNodeSelfTest.java
index 5b6627e..592479c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueCreateMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueCreateMultiNodeSelfTest.java
@@ -42,6 +42,11 @@ import static org.apache.ignite.transactions.TransactionIsolation.*;
*/
public class GridCachePartitionedQueueCreateMultiNodeSelfTest extends IgniteCollectionAbstractTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-80");
+ }
+
+ /** {@inheritDoc} */
@Override protected int gridCount() {
return 1;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
index 13363cd..05e47ec 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
@@ -40,6 +40,11 @@ import static org.apache.ignite.cache.CacheMode.*;
* Cache queue test with changing topology.
*/
public class GridCachePartitionedQueueEntryMoveSelfTest extends IgniteCollectionAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-802");
+ }
+
/** Queue capacity. */
private static final int QUEUE_CAP = 5;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueFailoverDataConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueFailoverDataConsistencySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueFailoverDataConsistencySelfTest.java
index 4b809e2..92db5d8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueFailoverDataConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueFailoverDataConsistencySelfTest.java
@@ -29,6 +29,11 @@ import static org.apache.ignite.cache.CacheMemoryMode.*;
public class GridCachePartitionedQueueFailoverDataConsistencySelfTest extends
GridCacheAbstractQueueFailoverDataConsistencySelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-264");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheMemoryMode collectionMemoryMode() {
return ONHEAP_TIERED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/replicated/GridCacheReplicatedDataStructuresFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/replicated/GridCacheReplicatedDataStructuresFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/replicated/GridCacheReplicatedDataStructuresFailoverSelfTest.java
index 46e458b..869f2b6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/replicated/GridCacheReplicatedDataStructuresFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/replicated/GridCacheReplicatedDataStructuresFailoverSelfTest.java
@@ -30,6 +30,11 @@ import static org.apache.ignite.cache.CacheMode.*;
public class GridCacheReplicatedDataStructuresFailoverSelfTest
extends GridCacheAbstractDataStructuresFailoverSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-801");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheMode collectionCacheMode() {
return REPLICATED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
index 798494f..0fc1d41 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
@@ -39,6 +39,11 @@ import static org.apache.ignite.cache.CacheMode.*;
* Tests for cache data loading during simultaneous grids start.
*/
public class CacheLoadingConcurrentGridStartSelfTest extends GridCommonAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-500");
+ }
+
/** Grids count */
private static int GRIDS_CNT = 5;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
index 568b08f..74a107d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
@@ -28,6 +28,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheColocatedFailoverSelfTest extends GridCacheAbstractFailoverTxSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-631 or IGNITE-157 or IGNITE-882");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return PARTITIONED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedTxExceptionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedTxExceptionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedTxExceptionSelfTest.java
index 645c59f..0fd4bc8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedTxExceptionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedTxExceptionSelfTest.java
@@ -28,6 +28,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheColocatedTxExceptionSelfTest extends IgniteTxExceptionAbstractSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-257");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return PARTITIONED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
index 17bbead..fd04f4f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
@@ -75,7 +75,9 @@ public class GridCachePartitionedNearDisabledMetricsSelfTest extends GridCacheAb
/**
* @throws Exception If failed.
*/
- public void _testGettingRemovedKey() throws Exception {
+ public void testGettingRemovedKey() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-819");
+
IgniteCache<Integer, Integer> cache = grid(0).cache(null);
cache.put(0, 0);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedTopologyChangeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedTopologyChangeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedTopologyChangeSelfTest.java
index 7bd3876..812ee29 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedTopologyChangeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedTopologyChangeSelfTest.java
@@ -61,6 +61,11 @@ public class GridCachePartitionedTopologyChangeSelfTest extends GridCommonAbstra
private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-807");
+ }
+
+ /** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration c = super.getConfiguration(gridName);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxExceptionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxExceptionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxExceptionSelfTest.java
index 00154e1..7fd30f4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxExceptionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxExceptionSelfTest.java
@@ -27,6 +27,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheNearTxExceptionSelfTest extends IgniteTxExceptionAbstractSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-257");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return PARTITIONED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
index 553d748..9825cfd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
@@ -27,6 +27,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCachePartitionedFailoverSelfTest extends GridCacheAbstractFailoverTxSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-631 or IGNITE-157 or IGNITE-882");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return PARTITIONED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiMultithreadedSelfTest.java
index 7d4a61e..74df95f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiMultithreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiMultithreadedSelfTest.java
@@ -27,6 +27,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCachePartitionedFullApiMultithreadedSelfTest extends GridCacheAbstractFullApiMultithreadedSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-805");
+ }
+
+ /** {@inheritDoc} */
@Override protected int gridCount() {
return 3;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java
index 2096836..9529f9d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java
@@ -30,6 +30,11 @@ import static org.apache.ignite.transactions.TransactionConcurrency.*;
*/
public class GridCachePartitionedNodeRestartTest extends GridCacheAbstractNodeRestartSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-882");
+ }
+
+ /** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration c = super.getConfiguration(gridName);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java
index 82da2ac..62cc6b1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java
@@ -31,6 +31,11 @@ import static org.apache.ignite.transactions.TransactionConcurrency.*;
*/
public class GridCachePartitionedOptimisticTxNodeRestartTest extends GridCacheAbstractNodeRestartSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-882");
+ }
+
+ /** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration c = super.getConfiguration(gridName);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxMultiThreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxMultiThreadedSelfTest.java
index e6042e9..4b20f02 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxMultiThreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxMultiThreadedSelfTest.java
@@ -38,6 +38,11 @@ public class GridCachePartitionedTxMultiThreadedSelfTest extends IgniteTxMultiTh
private TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-806");
+ }
+
+ /** {@inheritDoc} */
@SuppressWarnings({"ConstantConditions"})
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration c = super.getConfiguration(gridName);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
index 3461dd4..1103773 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
@@ -28,6 +28,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheReplicatedFailoverSelfTest extends GridCacheAbstractFailoverTxSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-631 or IGNITE-157 or IGNITE-882");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return REPLICATED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiMultithreadedSelfTest.java
index 2fa8977..4eab551 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiMultithreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiMultithreadedSelfTest.java
@@ -27,6 +27,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheReplicatedFullApiMultithreadedSelfTest extends GridCacheAbstractFullApiMultithreadedSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-805");
+ }
+
+ /** {@inheritDoc} */
@Override protected int gridCount() {
return 2;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java
index c2c02fd..19e40bf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java
@@ -21,9 +21,7 @@ import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.managers.communication.*;
-import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.clock.*;
-import org.apache.ignite.internal.transactions.*;
import org.apache.ignite.plugin.extensions.communication.*;
import org.apache.ignite.spi.*;
import org.apache.ignite.spi.communication.tcp.*;
@@ -111,6 +109,8 @@ public class GridCacheReplicatedInvalidateSelfTest extends GridCommonAbstractTes
* @throws Exception If failed.
*/
@Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-601");
+
for (int i = 0; i < GRID_CNT; i++)
ioSpi(i).clearCounts();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeLockSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeLockSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeLockSelfTest.java
index 3c251ac..70e0ad6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeLockSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeLockSelfTest.java
@@ -27,6 +27,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheReplicatedMultiNodeLockSelfTest extends GridCacheMultiNodeLockAbstractTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-601");
+ }
+
+ /** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration() throws Exception {
IgniteConfiguration cfg = super.getConfiguration();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeSelfTest.java
index 905043b..d043a73 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeSelfTest.java
@@ -27,6 +27,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheReplicatedMultiNodeSelfTest extends GridCacheMultiNodeAbstractTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-601");
+ }
+
+ /** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java
index 8ce96cd..dfdfd7e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java
@@ -29,6 +29,11 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
*/
public class GridCacheReplicatedNodeRestartSelfTest extends GridCacheAbstractNodeRestartSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-882");
+ }
+
+ /** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration c = super.getConfiguration(gridName);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedTxExceptionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedTxExceptionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedTxExceptionSelfTest.java
index 9a366fc..e02fe6d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedTxExceptionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedTxExceptionSelfTest.java
@@ -28,6 +28,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheReplicatedTxExceptionSelfTest extends IgniteTxExceptionAbstractSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-257");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return REPLICATED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridReplicatedTxPreloadTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridReplicatedTxPreloadTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridReplicatedTxPreloadTest.java
index 5f0c8f3..9dd2fe1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridReplicatedTxPreloadTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridReplicatedTxPreloadTest.java
@@ -24,6 +24,8 @@ import static org.apache.ignite.cache.CacheMode.*;
/**
* Tests cache transaction during preloading.
+ *
+ * TODO: IGNITE-808.
*/
public class GridReplicatedTxPreloadTest extends IgniteTxPreloadAbstractTest {
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
index f556023..379ed65 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
@@ -26,6 +26,11 @@ import static org.apache.ignite.cache.CacheAtomicityMode.*;
*/
public class IgniteCacheAtomicReplicatedNodeRestartSelfTest extends GridCacheReplicatedNodeRestartSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-747");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheAtomicityMode atomicityMode() {
return ATOMIC;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java
index 6847c67..ea926ee 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java
@@ -184,7 +184,9 @@ public class GridCacheEvictionFilterSelfTest extends GridCommonAbstractTest {
*
* @throws Exception If failed.
*/
- public void _testPartitionedMixed() throws Exception {
+ public void testPartitionedMixed() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-820");
+
mode = PARTITIONED;
nearEnabled = false;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java
index d6df80a..f434308 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java
@@ -39,6 +39,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheSynchronousEvictionsFailoverSelfTest extends GridCacheAbstractSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-804");
+ }
+
+ /** {@inheritDoc} */
@Override protected int gridCount() {
return 3;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
index b74a373..f77a389 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
@@ -759,10 +759,11 @@ public abstract class IgniteCacheExpiryPolicyAbstractTest extends IgniteCacheAbs
}
/**
- * TODO IGNITE-518
* @throws Exception If failed.
*/
- public void _testNearCreateUpdate() throws Exception {
+ public void testNearCreateUpdate() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-518");
+
if (cacheMode() != PARTITIONED)
return;
@@ -883,10 +884,11 @@ public abstract class IgniteCacheExpiryPolicyAbstractTest extends IgniteCacheAbs
}
/**
- * TODO IGNITE-518
* @throws Exception If failed.
*/
- public void _testNearAccess() throws Exception {
+ public void testNearAccess() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-518");
+
if (cacheMode() != PARTITIONED)
return;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyWithStoreAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyWithStoreAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyWithStoreAbstractTest.java
index 3dec1a0..2dcb0c2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyWithStoreAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyWithStoreAbstractTest.java
@@ -137,7 +137,9 @@ public abstract class IgniteCacheExpiryPolicyWithStoreAbstractTest extends Ignit
/**
* @throws Exception If failed.
*/
- public void _testReadThrough() throws Exception {
+ public void testReadThrough() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-821");
+
IgniteCache<Integer, Integer> cache = jcache(0);
final Integer key = primaryKeys(cache, 1, 100_000).get(0);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalFullApiMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalFullApiMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalFullApiMultithreadedSelfTest.java
index 887192a..3c75b5f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalFullApiMultithreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalFullApiMultithreadedSelfTest.java
@@ -27,6 +27,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheLocalFullApiMultithreadedSelfTest extends GridCacheAbstractFullApiMultithreadedSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-805");
+ }
+
+ /** {@inheritDoc} */
@Override protected int gridCount() {
return 1;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalTxExceptionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalTxExceptionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalTxExceptionSelfTest.java
index 4b3c4d1..b659167 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalTxExceptionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalTxExceptionSelfTest.java
@@ -27,6 +27,11 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheLocalTxExceptionSelfTest extends IgniteTxExceptionAbstractSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-257");
+ }
+
+ /** {@inheritDoc} */
@Override protected int gridCount() {
return 1;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsModesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsModesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsModesSelfTest.java
index 3c90af2..5b80044 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsModesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsModesSelfTest.java
@@ -471,7 +471,9 @@ public class IgfsModesSelfTest extends IgfsCommonAbstractTest {
*
* @throws Exception If failed.
*/
- public void _testPropagationDualAsync() throws Exception {
+ public void testPropagationDualAsync() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-822");
+
mode = DUAL_ASYNC;
checkPropagation();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemorySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemorySelfTest.java
index 00f89f9..51199e6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemorySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemorySelfTest.java
@@ -257,7 +257,9 @@ public class GridUnsafeMemorySelfTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
- public void _testGuardedOpsPerformance() throws Exception {
+ public void testGuardedOpsPerformance() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-823");
+
final GridUnsafeGuard guard = new GridUnsafeGuard();
final AtomicInteger i = new AtomicInteger();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java
index 7fb4563..a689abb 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java
@@ -35,8 +35,7 @@ public class IgniteCacheDataStructuresSelfTestSuite extends TestSuite {
TestSuite suite = new TestSuite("Ignite Cache Data Structures Test Suite");
// Data structures.
- // TODO: IGNITE-264
- // suite.addTest(new TestSuite(GridCachePartitionedQueueFailoverDataConsistencySelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedQueueFailoverDataConsistencySelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedAtomicQueueFailoverDataConsistencySelfTest.class));
suite.addTest(new TestSuite(GridCacheLocalSequenceApiSelfTest.class));
@@ -54,8 +53,7 @@ public class IgniteCacheDataStructuresSelfTestSuite extends TestSuite {
suite.addTest(new TestSuite(GridCacheReplicatedQueueMultiNodeSelfTest.class));
suite.addTest(new TestSuite(GridCacheReplicatedQueueRotativeMultiNodeTest.class));
suite.addTest(new TestSuite(GridCacheReplicatedSetSelfTest.class));
- // TODO: GG-5306
- // suite.addTest(new TestSuite(GridCacheReplicatedDataStructuresFailoverSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheReplicatedDataStructuresFailoverSelfTest.class));
suite.addTest(new TestSuite(IgniteReplicatedCountDownLatchSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedSequenceApiSelfTest.class));
@@ -68,10 +66,9 @@ public class IgniteCacheDataStructuresSelfTestSuite extends TestSuite {
suite.addTest(new TestSuite(GridCachePartitionedAtomicQueueMultiNodeSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedAtomicOffheapQueueMultiNodeSelfTest.class));
- // TODO: IGNITE-80.
- //suite.addTest(new TestSuite(GridCachePartitionedQueueCreateMultiNodeSelfTest.class));
- //suite.addTest(new TestSuite(GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest.class));
- //suite.addTest(new TestSuite(GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedQueueCreateMultiNodeSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedSetSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedOffHeapValuesSetSelfTest.class));
suite.addTest(new TestSuite(IgnitePartitionedSetNoBackupsSelfTest.class));
@@ -86,14 +83,11 @@ public class IgniteCacheDataStructuresSelfTestSuite extends TestSuite {
suite.addTest(new TestSuite(GridCachePartitionedAtomicQueueRotativeMultiNodeTest.class));
suite.addTest(new TestSuite(GridCacheQueueCleanupSelfTest.class));
- // TODO: GG-5620 Uncomment when fix
- //suite.addTest(new TestSuite(GridCachePartitionedQueueEntryMoveSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedQueueEntryMoveSelfTest.class));
- // TODO: GG-2699
- //suite.addTest(new TestSuite(GridCachePartitionedDataStructuresFailoverSelfTest.class));
- //suite.addTest(new TestSuite(GridCachePartitionedOffheapDataStructuresFailoverSelfTest.class));
- // TODO: GG-4807 Uncomment when fix
- // suite.addTest(new TestSuite(GridCacheQueueMultiNodeConsistencySelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedDataStructuresFailoverSelfTest.class));
+ suite.addTest(new TestSuite(GridCachePartitionedOffheapDataStructuresFailoverSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheQueueMultiNodeConsistencySelfTest.class));
suite.addTest(new TestSuite(IgniteLocalAtomicLongApiSelfTest.class));
suite.addTest(new TestSuite(IgnitePartitionedAtomicLongApiSelfTest.class));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheEvictionSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheEvictionSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheEvictionSelfTestSuite.java
index 7f07d3d..4401dc5 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheEvictionSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheEvictionSelfTestSuite.java
@@ -57,8 +57,7 @@ public class IgniteCacheEvictionSelfTestSuite extends TestSuite {
suite.addTest(new TestSuite(GridCacheEmptyEntriesPartitionedSelfTest.class));
suite.addTest(new TestSuite(GridCacheEmptyEntriesLocalSelfTest.class));
suite.addTest(new TestSuite(GridCacheMemoryModeSelfTest.class));
- // TODO: 5276.
- //suite.addTest(new TestSuite(GridCacheSynchronousEvictionsFailoverSelfTest.class));
+ suite.addTest(new TestSuite(GridCacheSynchronousEvictionsFailoverSelfTest.class));
return suite;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
index c12ff66..c71da11 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
@@ -23,6 +23,7 @@ import org.apache.ignite.internal.processors.cache.distributed.*;
import org.apache.ignite.internal.processors.cache.distributed.dht.*;
import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
+import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
/**
* Test suite.
@@ -63,10 +64,9 @@ public class IgniteCacheFailoverTestSuite extends TestSuite {
suite.addTestSuite(IgniteCacheTxNearDisabledPutGetRestartTest.class);
suite.addTestSuite(IgniteCacheTxNearDisabledFairAffinityPutGetRestartTest.class);
- // TODO IGNITE-882.
- //suite.addTestSuite(GridCachePartitionedFailoverSelfTest.class);
- //suite.addTestSuite(GridCacheColocatedFailoverSelfTest.class);
- //suite.addTestSuite(GridCacheReplicatedFailoverSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedFailoverSelfTest.class);
+ suite.addTestSuite(GridCacheColocatedFailoverSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedFailoverSelfTest.class);
return suite;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
index 5fa3283..8ceb7e7 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
@@ -130,10 +130,10 @@ public class IgniteCacheFullApiSelfTestSuite extends TestSuite {
suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.class);
suite.addTestSuite(GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest.class);
-// Multithreaded // TODO: GG-708
-// suite.addTestSuite(GridCacheLocalFullApiMultithreadedSelfTest.class);
-// suite.addTestSuite(GridCacheReplicatedFullApiMultithreadedSelfTest.class);
-// suite.addTestSuite(GridCachePartitionedFullApiMultithreadedSelfTest.class);
+ // Multithreaded
+ suite.addTestSuite(GridCacheLocalFullApiMultithreadedSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedFullApiMultithreadedSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedFullApiMultithreadedSelfTest.class);
return suite;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java
index 24945dd..f0649f5 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheRestartTestSuite.java
@@ -21,6 +21,7 @@ import junit.framework.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
+import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
/**
* In-Memory Data Grid stability test suite on changing topology.
@@ -35,13 +36,12 @@ public class IgniteCacheRestartTestSuite extends TestSuite {
suite.addTestSuite(GridCachePartitionedTxSalvageSelfTest.class);
- // TODO IGNITE-882.
- //suite.addTestSuite(GridCachePartitionedNodeRestartTest.class);
- //suite.addTestSuite(GridCachePartitionedOptimisticTxNodeRestartTest.class);
- //suite.addTestSuite(GridCacheReplicatedNodeRestartSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedNodeRestartTest.class);
+ suite.addTestSuite(GridCachePartitionedOptimisticTxNodeRestartTest.class);
+ suite.addTestSuite(GridCacheReplicatedNodeRestartSelfTest.class);
suite.addTestSuite(IgniteCacheAtomicNodeRestartTest.class);
- // suite.addTestSuite(IgniteCacheAtomicReplicatedNodeRestartSelfTest.class); // TODO IGNITE-747
+ suite.addTestSuite(IgniteCacheAtomicReplicatedNodeRestartSelfTest.class);
suite.addTestSuite(IgniteCacheAtomicPutAllFailoverSelfTest.class);
suite.addTestSuite(IgniteCachePutAllRestartTest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a12302ee/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index 7e4409d..5f37aea 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -29,6 +29,8 @@ import org.apache.ignite.internal.processors.cache.context.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
import org.apache.ignite.internal.processors.cache.distributed.dht.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
+import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
+import org.apache.ignite.internal.processors.cache.local.*;
import org.apache.ignite.internal.processors.datastreamer.*;
/**
@@ -122,7 +124,7 @@ public class IgniteCacheTestSuite extends TestSuite {
suite.addTestSuite(GridCacheTtlManagerSelfTest.class);
suite.addTestSuite(GridCacheLifecycleAwareSelfTest.class);
suite.addTestSuite(IgniteCacheAtomicStopBusySelfTest.class);
- // suite.addTestSuite(IgniteCacheTransactionalStopBusySelfTest.class); TODO Ignite-257.
+ suite.addTestSuite(IgniteCacheTransactionalStopBusySelfTest.class);
suite.addTestSuite(GridCacheAtomicNearCacheSelfTest.class);
suite.addTestSuite(CacheAtomicNearUpdateTopologyChangeTest.class);
suite.addTestSuite(CacheTxNearUpdateTopologyChangeTest.class);
@@ -151,12 +153,12 @@ public class IgniteCacheTestSuite extends TestSuite {
suite.addTest(IgniteCacheTcpClientDiscoveryTestSuite.suite());
- // Heuristic exception handling. TODO IGNITE-257
-// suite.addTestSuite(GridCacheColocatedTxExceptionSelfTest.class);
-// suite.addTestSuite(GridCacheReplicatedTxExceptionSelfTest.class);
-// suite.addTestSuite(GridCacheLocalTxExceptionSelfTest.class);
-// suite.addTestSuite(GridCacheNearTxExceptionSelfTest.class);
-// suite.addTestSuite(GridCacheStopSelfTest.class); TODO IGNITE-257
+ // Heuristic exception handling.
+ suite.addTestSuite(GridCacheColocatedTxExceptionSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedTxExceptionSelfTest.class);
+ suite.addTestSuite(GridCacheLocalTxExceptionSelfTest.class);
+ suite.addTestSuite(GridCacheNearTxExceptionSelfTest.class);
+ suite.addTestSuite(GridCacheStopSelfTest.class);
suite.addTestSuite(IgniteCacheNearLockValueSelfTest.class);
[46/50] [abbrv] incubator-ignite git commit: Merge branch
'ignite-classname' into ignite-sprint-6
Posted by se...@apache.org.
Merge branch 'ignite-classname' into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2b81104a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2b81104a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2b81104a
Branch: refs/heads/ignite-484-1
Commit: 2b81104aaee4c39260dbd276405ef9f477c90f30
Parents: 2b7a18d e17a2be
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jun 12 17:16:43 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jun 12 17:16:43 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/GridKernalContextImpl.java | 5 +++--
.../apache/ignite/internal/IgniteKernal.java | 21 ++++++++++++++++++--
.../internal/MarshallerContextAdapter.java | 18 +++++++++++++++--
.../ignite/internal/MarshallerContextImpl.java | 14 ++++++++++++-
.../GridClientOptimizedMarshaller.java | 5 +++++
.../plugin/IgnitePluginProcessor.java | 16 ++-------------
.../IgniteCacheP2pUnmarshallingTxErrorTest.java | 14 +++++++++----
.../marshaller/MarshallerContextTestImpl.java | 18 +++++++++++++++++
.../junits/GridTestKernalContext.java | 1 +
.../ignite/tools/classgen/ClassesGenerator.java | 18 +++++++++++++----
10 files changed, 101 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
[22/50] [abbrv] incubator-ignite git commit: 1.1.2-SNAPSHOT
Posted by se...@apache.org.
1.1.2-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cfdce4f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cfdce4f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cfdce4f1
Branch: refs/heads/ignite-484-1
Commit: cfdce4f13eafab7736bdcccbb2eac29dc7734ac2
Parents: 8a98daf
Author: Ignite Teamcity <ig...@apache.org>
Authored: Thu Jun 11 16:09:41 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Thu Jun 11 16:09:41 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/src/main/resources/ignite.properties | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/mesos/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar-2.10/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spark-2.10/pom.xml | 2 +-
modules/spark/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console-2.10/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 2 +-
37 files changed, 37 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index a775987..016b3ce 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index 85e9608..e04f183 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index e5cdae7..f7fdfbc 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index 2132f24..7842c47 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index e27dc2a..579c6a0 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<properties>
<jcloud.version>1.9.0</jcloud.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 32bd7c2..9d375cc 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 47ed9cb..a0ee32e 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/core/src/main/resources/ignite.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/ignite.properties b/modules/core/src/main/resources/ignite.properties
index 78e294f..5171bd6 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
# limitations under the License.
#
-ignite.version=1.2.0-SNAPSHOT
+ignite.version=1.1.2-SNAPSHOT
ignite.build=0
ignite.revision=DEV
ignite.rel.date=01011970
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index b6a4a9e..4546112 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-p2p</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index c81b2c1..be0c73b 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-uri</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index 471a98b..e0a5d1d 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-gce</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index 0283930..d9bd236 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-geospatial</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index ac0f9f0..dd7c9b7 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hadoop</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index 8c2dcbb..10d91a2 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index e2175f6..18a3579 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-indexing</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 907844b..516df8a 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jcl</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index 3b70ad3..ca5ef52 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jta</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index b0dd5f3..533f592 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index c2bacff..173fe7c 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-mesos</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<properties>
<jetty.version>9.2.10.v20150310</jetty.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 64db144..243ac06 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-rest-http</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
index e3d6125..63bfd36 100644
--- a/modules/scalar-2.10/pom.xml
+++ b/modules/scalar-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar_2.10</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index d3fcf2e..3fb2470 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index cac133f..049fe65 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schedule</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 64f85d9..8523d34 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schema-import</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 7c1e660..5284182 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-slf4j</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
index 2547f7c..46cc4e7 100644
--- a/modules/spark-2.10/pom.xml
+++ b/modules/spark-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spark_2.10</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index 88ff229..b3d2732 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spark</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index a6e61ac..d7e66cb 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index 0dcbd80..d65d173 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-ssh</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 2351d95..0bb221f 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-tools</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index c6abfe5..70a23b0 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-urideploy</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/visor-console-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console-2.10/pom.xml b/modules/visor-console-2.10/pom.xml
index f0df657..bb7aefc 100644
--- a/modules/visor-console-2.10/pom.xml
+++ b/modules/visor-console-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console_2.10</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 8e71970..ef6abc0 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 46b136e..ef217ed 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-plugins</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<!-- Ignite dependencies -->
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index df6e923..6b69c63 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 3d4ce66..39c7f5a 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yardstick</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<properties>
<yardstick.version>0.7.0</yardstick.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cfdce4f1/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a08dd6c..68d610e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>apache-ignite</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.2-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
[18/50] [abbrv] incubator-ignite git commit: ignite-sprint-6:
adjusted spark version for sprint-6
Posted by se...@apache.org.
ignite-sprint-6: adjusted spark version for sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8020594e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8020594e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8020594e
Branch: refs/heads/ignite-484-1
Commit: 8020594e64ec548c510ed5cab777501c2eae70e0
Parents: a5d007e
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu Jun 11 12:49:45 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu Jun 11 12:49:45 2015 +0300
----------------------------------------------------------------------
modules/spark/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8020594e/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index 8900a10..88ff229 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spark</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<dependencies>
<dependency>
[41/50] [abbrv] incubator-ignite git commit: ignite-sprint-6:
fixing/ajusting tests that cooperate with portable marshaller
Posted by se...@apache.org.
ignite-sprint-6: fixing/ajusting tests that cooperate with portable marshaller
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c233aa26
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c233aa26
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c233aa26
Branch: refs/heads/ignite-484-1
Commit: c233aa260b35766495b23bc57c6ce55f0ddef3b3
Parents: 83a1986
Author: Denis Magda <dm...@gridgain.com>
Authored: Fri Jun 12 15:37:34 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri Jun 12 15:37:34 2015 +0300
----------------------------------------------------------------------
.../processors/datastreamer/DataStreamProcessorSelfTest.java | 3 ++-
.../org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c233aa26/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java
index 80bf9e0..8a539d2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java
@@ -29,7 +29,6 @@ import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -82,6 +81,8 @@ public class DataStreamProcessorSelfTest extends GridCommonAbstractTest {
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
+ cfg.setPeerClassLoadingEnabled(false);
+
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setForceServerMode(true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c233aa26/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java
index 978941d..e8c89ec 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java
@@ -77,7 +77,7 @@ public class IgniteKernalSelfTestSuite extends TestSuite {
suite.addTestSuite(GridHomePathSelfTest.class);
GridTestUtils.addTestIfNeeded(suite, GridStartupWithSpecifiedWorkDirectorySelfTest.class, ignoredTests);
suite.addTestSuite(GridStartupWithUndefinedIgniteHomeSelfTest.class);
- suite.addTestSuite(GridVersionSelfTest.class);
+ GridTestUtils.addTestIfNeeded(suite, GridVersionSelfTest.class, ignoredTests);
suite.addTestSuite(GridListenActorSelfTest.class);
suite.addTestSuite(GridNodeLocalSelfTest.class);
suite.addTestSuite(GridKernalConcurrentAccessStopSelfTest.class);
[21/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: merge
from sprint-5
Posted by se...@apache.org.
ignite-sprint-6: merge from sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8a98daf7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8a98daf7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8a98daf7
Branch: refs/heads/ignite-484-1
Commit: 8a98daf789de0a7cfba229597edc09e3416ab4af
Parents: 37c56f6
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu Jun 11 15:59:10 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu Jun 11 15:59:10 2015 +0300
----------------------------------------------------------------------
idea/ignite_codeStyle.xml | 147 +++++++++++++++++++
.../ignite/spi/discovery/tcp/ServerImpl.java | 38 +----
.../tcp/TcpClientDiscoverySpiSelfTest.java | 114 +++++++++++++-
parent/pom.xml | 1 +
4 files changed, 263 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a98daf7/idea/ignite_codeStyle.xml
----------------------------------------------------------------------
diff --git a/idea/ignite_codeStyle.xml b/idea/ignite_codeStyle.xml
new file mode 100644
index 0000000..14faf54
--- /dev/null
+++ b/idea/ignite_codeStyle.xml
@@ -0,0 +1,147 @@
+<code_scheme name="ignite">
+ <option name="USE_SAME_INDENTS" value="true" />
+ <option name="IGNORE_SAME_INDENTS_FOR_LANGUAGES" value="true" />
+ <option name="OTHER_INDENT_OPTIONS">
+ <value>
+ <option name="INDENT_SIZE" value="4" />
+ <option name="CONTINUATION_INDENT_SIZE" value="4" />
+ <option name="TAB_SIZE" value="4" />
+ <option name="USE_TAB_CHARACTER" value="false" />
+ <option name="SMART_TABS" value="false" />
+ <option name="LABEL_INDENT_SIZE" value="0" />
+ <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+ <option name="USE_RELATIVE_INDENTS" value="false" />
+ </value>
+ </option>
+ <option name="PREFER_LONGER_NAMES" value="false" />
+ <option name="USE_SINGLE_CLASS_IMPORTS" value="false" />
+ <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="0" />
+ <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="0" />
+ <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
+ <value />
+ </option>
+ <option name="IMPORT_LAYOUT_TABLE">
+ <value>
+ <package name="org.apache" withSubpackages="true" static="false" />
+ <package name="import org.gridgain" withSubpackages="true" static="false" />
+ <emptyLine />
+ <package name="" withSubpackages="true" static="false" />
+ <emptyLine />
+ <package name="javax" withSubpackages="true" static="false" />
+ <package name="java" withSubpackages="true" static="false" />
+ <emptyLine />
+ <package name="" withSubpackages="true" static="true" />
+ </value>
+ </option>
+ <option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
+ <option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
+ <option name="JD_P_AT_EMPTY_LINES" value="false" />
+ <option name="JD_KEEP_INVALID_TAGS" value="false" />
+ <option name="JD_DO_NOT_WRAP_ONE_LINE_COMMENTS" value="true" />
+ <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
+ <option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
+ <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
+ <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
+ <option name="ELSE_ON_NEW_LINE" value="true" />
+ <option name="WHILE_ON_NEW_LINE" value="true" />
+ <option name="CATCH_ON_NEW_LINE" value="true" />
+ <option name="FINALLY_ON_NEW_LINE" value="true" />
+ <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
+ <option name="ALIGN_MULTILINE_FOR" value="false" />
+ <option name="SPACE_AFTER_TYPE_CAST" value="false" />
+ <option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
+ <option name="METHOD_PARAMETERS_WRAP" value="1" />
+ <option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
+ <option name="LABELED_STATEMENT_WRAP" value="1" />
+ <option name="WRAP_COMMENTS" value="true" />
+ <option name="METHOD_ANNOTATION_WRAP" value="1" />
+ <option name="CLASS_ANNOTATION_WRAP" value="1" />
+ <option name="FIELD_ANNOTATION_WRAP" value="1" />
+ <JavaCodeStyleSettings>
+ <option name="CLASS_NAMES_IN_JAVADOC" value="3" />
+ </JavaCodeStyleSettings>
+ <XML>
+ <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
+ </XML>
+ <ADDITIONAL_INDENT_OPTIONS fileType="haml">
+ <option name="INDENT_SIZE" value="2" />
+ </ADDITIONAL_INDENT_OPTIONS>
+ <codeStyleSettings language="Groovy">
+ <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
+ <option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
+ <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
+ <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
+ <option name="ELSE_ON_NEW_LINE" value="true" />
+ <option name="CATCH_ON_NEW_LINE" value="true" />
+ <option name="FINALLY_ON_NEW_LINE" value="true" />
+ <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
+ <option name="ALIGN_MULTILINE_FOR" value="false" />
+ <option name="SPACE_AFTER_TYPE_CAST" value="false" />
+ <option name="METHOD_PARAMETERS_WRAP" value="1" />
+ <option name="METHOD_ANNOTATION_WRAP" value="1" />
+ <option name="CLASS_ANNOTATION_WRAP" value="1" />
+ <option name="FIELD_ANNOTATION_WRAP" value="1" />
+ <option name="PARENT_SETTINGS_INSTALLED" value="true" />
+ <indentOptions>
+ <option name="CONTINUATION_INDENT_SIZE" value="4" />
+ </indentOptions>
+ </codeStyleSettings>
+ <codeStyleSettings language="HOCON">
+ <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
+ <option name="PARENT_SETTINGS_INSTALLED" value="true" />
+ </codeStyleSettings>
+ <codeStyleSettings language="JAVA">
+ <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
+ <option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
+ <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
+ <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
+ <option name="ELSE_ON_NEW_LINE" value="true" />
+ <option name="WHILE_ON_NEW_LINE" value="true" />
+ <option name="CATCH_ON_NEW_LINE" value="true" />
+ <option name="FINALLY_ON_NEW_LINE" value="true" />
+ <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
+ <option name="ALIGN_MULTILINE_FOR" value="false" />
+ <option name="SPACE_AFTER_TYPE_CAST" value="false" />
+ <option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
+ <option name="METHOD_PARAMETERS_WRAP" value="1" />
+ <option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
+ <option name="LABELED_STATEMENT_WRAP" value="1" />
+ <option name="METHOD_ANNOTATION_WRAP" value="1" />
+ <option name="CLASS_ANNOTATION_WRAP" value="1" />
+ <option name="FIELD_ANNOTATION_WRAP" value="1" />
+ <option name="PARENT_SETTINGS_INSTALLED" value="true" />
+ <indentOptions>
+ <option name="CONTINUATION_INDENT_SIZE" value="4" />
+ </indentOptions>
+ </codeStyleSettings>
+ <codeStyleSettings language="JSON">
+ <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
+ <option name="PARENT_SETTINGS_INSTALLED" value="true" />
+ </codeStyleSettings>
+ <codeStyleSettings language="Scala">
+ <option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
+ <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
+ <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
+ <option name="ELSE_ON_NEW_LINE" value="true" />
+ <option name="WHILE_ON_NEW_LINE" value="true" />
+ <option name="CATCH_ON_NEW_LINE" value="true" />
+ <option name="FINALLY_ON_NEW_LINE" value="true" />
+ <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
+ <option name="ALIGN_MULTILINE_FOR" value="false" />
+ <option name="METHOD_PARAMETERS_WRAP" value="1" />
+ <option name="METHOD_ANNOTATION_WRAP" value="1" />
+ <option name="CLASS_ANNOTATION_WRAP" value="1" />
+ <option name="FIELD_ANNOTATION_WRAP" value="1" />
+ <option name="PARENT_SETTINGS_INSTALLED" value="true" />
+ <indentOptions>
+ <option name="INDENT_SIZE" value="4" />
+ <option name="CONTINUATION_INDENT_SIZE" value="4" />
+ <option name="TAB_SIZE" value="4" />
+ </indentOptions>
+ </codeStyleSettings>
+ <codeStyleSettings language="XML">
+ <indentOptions>
+ <option name="CONTINUATION_INDENT_SIZE" value="4" />
+ </indentOptions>
+ </codeStyleSettings>
+</code_scheme>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a98daf7/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 5aceaae..44374db 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -1752,6 +1752,9 @@ class ServerImpl extends TcpDiscoveryImpl {
@Nullable Collection<TcpDiscoveryAbstractMessage> messages(IgniteUuid lastMsgId) {
assert lastMsgId != null;
+ if (msgs.isEmpty())
+ return Collections.emptyList();
+
Collection<TcpDiscoveryAbstractMessage> cp = new ArrayList<>(msgs.size());
boolean skip = true;
@@ -1769,30 +1772,6 @@ class ServerImpl extends TcpDiscoveryImpl {
}
/**
- * Resets pending messages.
- *
- * @param msgs Message.
- * @param discardId Discarded message ID.
- */
- void reset(@Nullable Collection<TcpDiscoveryAbstractMessage> msgs, @Nullable IgniteUuid discardId) {
- this.msgs.clear();
-
- if (msgs != null)
- this.msgs.addAll(msgs);
-
- this.discardId = discardId;
- }
-
- /**
- * Clears pending messages.
- */
- void clear() {
- msgs.clear();
-
- discardId = null;
- }
-
- /**
* Discards message with provided ID and all before it.
*
* @param id Discarded message ID.
@@ -2921,8 +2900,7 @@ class ServerImpl extends TcpDiscoveryImpl {
topHist.clear();
topHist.putAll(msg.topologyHistory());
- // Restore pending messages.
- pendingMsgs.reset(msg.messages(), msg.discardedMessageId());
+ pendingMsgs.discard(msg.discardedMessageId());
// Clear data to minimize message size.
msg.messages(null, null);
@@ -3180,10 +3158,6 @@ class ServerImpl extends TcpDiscoveryImpl {
if (log.isDebugEnabled())
log.debug("Removed node from topology: " + leftNode);
- // Clear pending messages map.
- if (!ring.hasRemoteNodes())
- pendingMsgs.clear();
-
long topVer;
if (locNodeCoord) {
@@ -3347,10 +3321,6 @@ class ServerImpl extends TcpDiscoveryImpl {
assert node != null;
- // Clear pending messages map.
- if (!ring.hasRemoteNodes())
- pendingMsgs.clear();
-
long topVer;
if (locNodeCoord) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a98daf7/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
index 7333020..55a14e4 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
@@ -103,12 +103,17 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
/** */
private boolean longSockTimeouts;
+ /** */
+ private int maxMissedClientHbs = TcpDiscoverySpi.DFLT_MAX_MISSED_CLIENT_HEARTBEATS;
+
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
TcpDiscoverySpi disco = new TestTcpDiscoverySpi();
+ disco.setMaxMissedClientHeartbeats(maxMissedClientHbs);
+
if (gridName.startsWith("server"))
disco.setIpFinder(IP_FINDER);
else if (gridName.startsWith("client")) {
@@ -494,6 +499,96 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
+ public void testClientReconnectTopologyChange1() throws Exception {
+ maxMissedClientHbs = 100;
+
+ clientsPerSrv = 1;
+
+ startServerNodes(2);
+ startClientNodes(1);
+
+ checkNodes(2, 1);
+
+ srvLeftLatch = new CountDownLatch(3);
+ srvFailedLatch = new CountDownLatch(1);
+
+ attachListeners(2, 0);
+
+ Ignite ignite = G.ignite("client-0");
+
+ TestTcpDiscoverySpi spi = ((TestTcpDiscoverySpi)ignite.configuration().getDiscoverySpi());
+
+ spi.pauseAll();
+
+ try {
+ spi.brakeConnection();
+
+ Ignite g = startGrid("server-" + srvIdx.getAndIncrement());
+
+ g.close();
+
+ spi.resumeAll();
+
+ assertFalse(srvFailedLatch.await(2000, TimeUnit.MILLISECONDS));
+
+ assertEquals(1L, srvLeftLatch.getCount());
+
+ checkNodes(2, 1);
+ }
+ finally {
+ spi.resumeAll();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testClientReconnectTopologyChange2() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-998");
+
+ maxMissedClientHbs = 100;
+
+ clientsPerSrv = 1;
+
+ startServerNodes(1);
+ startClientNodes(1);
+
+ checkNodes(1, 1);
+
+ srvLeftLatch = new CountDownLatch(2);
+ srvFailedLatch = new CountDownLatch(1);
+
+ attachListeners(1, 0);
+
+ Ignite ignite = G.ignite("client-0");
+
+ TestTcpDiscoverySpi spi = ((TestTcpDiscoverySpi)ignite.configuration().getDiscoverySpi());
+
+ spi.pauseAll();
+
+ try {
+ spi.brakeConnection();
+
+ Ignite g = startGrid("server-" + srvIdx.getAndIncrement());
+
+ g.close();
+
+ spi.resumeAll();
+
+ assertFalse(srvFailedLatch.await(2000, TimeUnit.MILLISECONDS));
+
+ assertEquals(1L, srvLeftLatch.getCount());
+
+ checkNodes(1, 1);
+ }
+ finally {
+ spi.resumeAll();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
public void testGetMissedMessagesOnReconnect() throws Exception {
clientsPerSrv = 1;
@@ -731,8 +826,6 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
}
/**
- * TODO: IGNITE-587.
- *
* @throws Exception If failed.
*/
public void testDataExchangeFromClient() throws Exception {
@@ -740,6 +833,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
}
/**
+ * @param masterName Node name
* @throws Exception If failed.
*/
private void testDataExchange(String masterName) throws Exception {
@@ -890,7 +984,8 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
}
/**
- * @param clientIdx Index.
+ * @param clientIdx Client index.
+ * @param srvIdx Server index.
* @throws Exception In case of error.
*/
private void setClientRouter(int clientIdx, int srvIdx) throws Exception {
@@ -948,6 +1043,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
/**
* @param srvCnt Number of server nodes.
* @param clientCnt Number of client nodes.
+ * @throws Exception If failed.
*/
private void attachListeners(int srvCnt, int clientCnt) throws Exception {
if (srvJoinedLatch != null) {
@@ -1040,6 +1136,8 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
* @param clientCnt Number of client nodes.
*/
private void checkNodes(int srvCnt, int clientCnt) {
+ long topVer = -1;
+
for (int i = 0; i < srvCnt; i++) {
Ignite g = G.ignite("server-" + i);
@@ -1048,6 +1146,11 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
assertFalse(g.cluster().localNode().isClient());
checkRemoteNodes(g, srvCnt + clientCnt - 1);
+
+ if (topVer < 0)
+ topVer = g.cluster().topologyVersion();
+ else
+ assertEquals(topVer, g.cluster().topologyVersion());
}
for (int i = 0; i < clientCnt; i++) {
@@ -1060,6 +1163,11 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
assertTrue(g.cluster().localNode().isClient());
checkRemoteNodes(g, srvCnt + clientCnt - 1);
+
+ if (topVer < 0)
+ topVer = g.cluster().topologyVersion();
+ else
+ assertEquals(topVer, g.cluster().topologyVersion());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a98daf7/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index f5b73df..b167932 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -626,6 +626,7 @@
<exclude>**/keystore/*.pem</exclude><!--auto generated files-->
<exclude>**/keystore/*.pfx</exclude><!--bin-files-->
<!--special excludes-->
+ <exclude>idea/ignite_codeStyle.xml</exclude>
<exclude>DEVNOTES.txt</exclude>
<exclude>src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridOffHeapSnapTreeMap.java</exclude><!--BSD license-->
<exclude>src/main/java/org/apache/ignite/internal/util/snaptree/*.java</exclude><!--BSD license-->
[11/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: revert
changes in concurrent map
Posted by se...@apache.org.
ignite-sprint-6: revert changes in concurrent map
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8a1c85d6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8a1c85d6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8a1c85d6
Branch: refs/heads/ignite-484-1
Commit: 8a1c85d6070ec19c90abb7e8ae8a6f04720c72b6
Parents: 8203caf
Author: Denis Magda <dm...@gridgain.com>
Authored: Wed Jun 10 18:03:05 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Jun 10 18:03:05 2015 +0300
----------------------------------------------------------------------
modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a1c85d6/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java b/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
index 041130b..0b60ff7 100644
--- a/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
+++ b/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
@@ -8,7 +8,7 @@
* The latest version of the file was copied from the following CVS repository:
* http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/
*
- * Corresponding commit version in CVS repository is unknown (lost in our side).
+ * Corresponding commit version in CVS repository is unknown (lost on our side).
* On the other hand we can't simply synch the latest version from CVS here, because Ignite uses functionality that
* is no longer supported.
*/
[16/50] [abbrv] incubator-ignite git commit: ignite-sprint-6: merge
from ignite-sprint-5
Posted by se...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoader.java b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoader.java
index dc00ca6..d4ae147 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNativeLoader.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.util.ipc.shmem;
import org.apache.ignite.*;
+import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import java.io.*;
@@ -25,6 +26,8 @@ import java.net.*;
import java.nio.channels.*;
import java.security.*;
import java.util.*;
+import java.util.jar.*;
+import java.util.zip.*;
import static org.apache.ignite.internal.IgniteVersionUtils.*;
@@ -36,6 +39,9 @@ public class IpcSharedMemoryNativeLoader {
/** Library name base. */
private static final String LIB_NAME_BASE = "igniteshmem";
+ /** Library jar name base. */
+ private static final String JAR_NAME_BASE = "shmem";
+
/** Library name. */
static final String LIB_NAME = LIB_NAME_BASE + "-" + VER_STR;
@@ -84,9 +90,10 @@ public class IpcSharedMemoryNativeLoader {
}
/**
+ * @param log Logger, if available. If null, warnings will be printed out to console.
* @throws IgniteCheckedException If failed.
*/
- public static void load() throws IgniteCheckedException {
+ public static void load(IgniteLogger log) throws IgniteCheckedException {
if (loaded)
return;
@@ -94,7 +101,7 @@ public class IpcSharedMemoryNativeLoader {
if (loaded)
return;
- doLoad();
+ doLoad(log);
loaded = true;
}
@@ -103,7 +110,7 @@ public class IpcSharedMemoryNativeLoader {
/**
* @throws IgniteCheckedException If failed.
*/
- private static void doLoad() throws IgniteCheckedException {
+ private static void doLoad(IgniteLogger log) throws IgniteCheckedException {
assert Thread.holdsLock(IpcSharedMemoryNativeLoader.class);
Collection<Throwable> errs = new ArrayList<>();
@@ -124,7 +131,7 @@ public class IpcSharedMemoryNativeLoader {
// Obtain lock on file to prevent concurrent extracts.
try (RandomAccessFile randomAccessFile = new RandomAccessFile(lockFile, "rws");
- FileLock ignored = randomAccessFile.getChannel().lock()) {
+ FileLock ignored = randomAccessFile.getChannel().lock()) {
if (extractAndLoad(errs, tmpDir, platformSpecificResourcePath()))
return;
@@ -134,6 +141,31 @@ public class IpcSharedMemoryNativeLoader {
if (extractAndLoad(errs, tmpDir, resourcePath()))
return;
+ try {
+ if (log != null)
+ LT.warn(log, null, "Failed to load 'igniteshmem' library from classpath. Will try to load it from IGNITE_HOME.");
+
+ String igniteHome = X.resolveIgniteHome();
+
+ File shmemJar = findShmemJar(errs, igniteHome);
+
+ if (shmemJar != null) {
+ try (JarFile jar = new JarFile(shmemJar, false, JarFile.OPEN_READ)) {
+ if (extractAndLoad(errs, jar, tmpDir, platformSpecificResourcePath()))
+ return;
+
+ if (extractAndLoad(errs, jar, tmpDir, osSpecificResourcePath()))
+ return;
+
+ if (extractAndLoad(errs, jar, tmpDir, resourcePath()))
+ return;
+ }
+ }
+ }
+ catch (IgniteCheckedException ignore) {
+ // No-op.
+ }
+
// Failed to find the library.
assert !errs.isEmpty();
@@ -145,6 +177,32 @@ public class IpcSharedMemoryNativeLoader {
}
/**
+ * Tries to find shmem jar in IGNITE_HOME/libs folder.
+ *
+ * @param errs Collection of errors to add readable exception to.
+ * @param igniteHome Resolver IGNITE_HOME variable.
+ * @return File, if found.
+ */
+ private static File findShmemJar(Collection<Throwable> errs, String igniteHome) {
+ File libs = new File(igniteHome, "libs");
+
+ if (!libs.exists() || libs.isFile()) {
+ errs.add(new IllegalStateException("Failed to find libs folder in resolved IGNITE_HOME: " + igniteHome));
+
+ return null;
+ }
+
+ for (File lib : libs.listFiles()) {
+ if (lib.getName().endsWith(".jar") && lib.getName().contains(JAR_NAME_BASE))
+ return lib;
+ }
+
+ errs.add(new IllegalStateException("Failed to find shmem jar in resolved IGNITE_HOME: " + igniteHome));
+
+ return null;
+ }
+
+ /**
* Gets temporary directory unique for each OS user.
* The directory guaranteed to exist, though may not be empty.
*/
@@ -220,6 +278,24 @@ public class IpcSharedMemoryNativeLoader {
/**
* @param errs Errors collection.
+ * @param rsrcPath Path.
+ * @return {@code True} if library was found and loaded.
+ */
+ private static boolean extractAndLoad(Collection<Throwable> errs, JarFile jar, File tmpDir, String rsrcPath) {
+ ZipEntry rsrc = jar.getEntry(rsrcPath);
+
+ if (rsrc != null)
+ return extract(errs, rsrc, jar, new File(tmpDir, mapLibraryName(LIB_NAME)));
+ else {
+ errs.add(new IllegalStateException("Failed to find resource within specified jar file " +
+ "[rsrc=" + rsrcPath + ", jar=" + jar.getName() + ']'));
+
+ return false;
+ }
+ }
+
+ /**
+ * @param errs Errors collection.
* @param src Source.
* @param target Target.
* @return {@code True} if resource was found and loaded.
@@ -230,7 +306,7 @@ public class IpcSharedMemoryNativeLoader {
InputStream is = null;
try {
- if (!target.exists() || !haveEqualMD5(target, src)) {
+ if (!target.exists() || !haveEqualMD5(target, src.openStream())) {
is = src.openStream();
if (is != null) {
@@ -265,20 +341,69 @@ public class IpcSharedMemoryNativeLoader {
}
/**
- * @param target Target.
+ * @param errs Errors collection.
* @param src Source.
+ * @param target Target.
+ * @return {@code True} if resource was found and loaded.
+ */
+ @SuppressWarnings("ResultOfMethodCallIgnored")
+ private static boolean extract(Collection<Throwable> errs, ZipEntry src, JarFile jar, File target) {
+ FileOutputStream os = null;
+ InputStream is = null;
+
+ try {
+ if (!target.exists() || !haveEqualMD5(target, jar.getInputStream(src))) {
+ is = jar.getInputStream(src);
+
+ if (is != null) {
+ os = new FileOutputStream(target);
+
+ int read;
+
+ byte[] buf = new byte[4096];
+
+ while ((read = is.read(buf)) != -1)
+ os.write(buf, 0, read);
+ }
+ }
+
+ // chmod 775.
+ if (!U.isWindows())
+ Runtime.getRuntime().exec(new String[] {"chmod", "775", target.getCanonicalPath()}).waitFor();
+
+ System.load(target.getPath());
+
+ return true;
+ }
+ catch (IOException | UnsatisfiedLinkError | InterruptedException | NoSuchAlgorithmException e) {
+ errs.add(e);
+ }
+ finally {
+ U.closeQuiet(os);
+ U.closeQuiet(is);
+ }
+
+ return false;
+ }
+
+ /**
+ * @param target Target.
+ * @param srcIS Source input stream.
* @return {@code True} if target md5-sum equal to source md5-sum.
* @throws NoSuchAlgorithmException If md5 algorithm was not found.
* @throws IOException If an I/O exception occurs.
*/
- private static boolean haveEqualMD5(File target, URL src) throws NoSuchAlgorithmException, IOException {
- try (InputStream targetIS = new FileInputStream(target);
- InputStream srcIS = src.openStream()) {
-
- String targetMD5 = U.calculateMD5(targetIS);
- String srcMD5 = U.calculateMD5(srcIS);
+ private static boolean haveEqualMD5(File target, InputStream srcIS) throws NoSuchAlgorithmException, IOException {
+ try {
+ try (InputStream targetIS = new FileInputStream(target)) {
+ String targetMD5 = U.calculateMD5(targetIS);
+ String srcMD5 = U.calculateMD5(srcIS);
- return targetMD5.equals(srcMD5);
+ return targetMD5.equals(srcMD5);
+ }
+ }
+ finally {
+ srcIS.close();
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
index 5185856..102c5b1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
@@ -146,7 +146,7 @@ public class IpcSharedMemoryServerEndpoint implements IpcServerEndpoint {
/** {@inheritDoc} */
@Override public void start() throws IgniteCheckedException {
- IpcSharedMemoryNativeLoader.load();
+ IpcSharedMemoryNativeLoader.load(log);
pid = IpcSharedMemoryUtils.pid();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridShmemCommunicationClient.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridShmemCommunicationClient.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridShmemCommunicationClient.java
new file mode 100644
index 0000000..e05c37a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridShmemCommunicationClient.java
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.nio;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.util.ipc.shmem.*;
+import org.apache.ignite.internal.util.lang.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.plugin.extensions.communication.*;
+import org.jetbrains.annotations.*;
+
+import java.io.*;
+import java.nio.*;
+import java.util.*;
+
+/**
+ *
+ */
+public class GridShmemCommunicationClient extends GridAbstractCommunicationClient {
+ /** */
+ private final IpcSharedMemoryClientEndpoint shmem;
+
+ /** */
+ private final ByteBuffer writeBuf;
+
+ /** */
+ private final MessageFormatter formatter;
+
+ /**
+ * @param metricsLsnr Metrics listener.
+ * @param port Shared memory IPC server port.
+ * @param connTimeout Connection timeout.
+ * @param log Logger.
+ * @param formatter Message formatter.
+ * @throws IgniteCheckedException If failed.
+ */
+ public GridShmemCommunicationClient(GridNioMetricsListener metricsLsnr,
+ int port,
+ long connTimeout,
+ IgniteLogger log,
+ MessageFormatter formatter)
+ throws IgniteCheckedException
+ {
+ super(metricsLsnr);
+
+ assert metricsLsnr != null;
+ assert port > 0 && port < 0xffff;
+ assert connTimeout >= 0;
+
+ shmem = new IpcSharedMemoryClientEndpoint(port, (int)connTimeout, log);
+
+ writeBuf = ByteBuffer.allocate(8 << 10);
+
+ writeBuf.order(ByteOrder.nativeOrder());
+
+ this.formatter = formatter;
+ }
+
+ /** {@inheritDoc} */
+ @Override public synchronized void doHandshake(IgniteInClosure2X<InputStream, OutputStream> handshakeC)
+ throws IgniteCheckedException {
+ handshakeC.applyx(shmem.inputStream(), shmem.outputStream());
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean close() {
+ boolean res = super.close();
+
+ if (res)
+ shmem.close();
+
+ return res;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void forceClose() {
+ super.forceClose();
+
+ // Do not call forceClose() here.
+ shmem.close();
+ }
+
+ /** {@inheritDoc} */
+ @Override public synchronized void sendMessage(byte[] data, int len) throws IgniteCheckedException {
+ if (closed())
+ throw new IgniteCheckedException("Communication client was closed: " + this);
+
+ try {
+ shmem.outputStream().write(data, 0, len);
+
+ metricsLsnr.onBytesSent(len);
+ }
+ catch (IOException e) {
+ throw new IgniteCheckedException("Failed to send message to remote node: " + shmem, e);
+ }
+
+ markUsed();
+ }
+
+ /** {@inheritDoc} */
+ @Override public synchronized boolean sendMessage(@Nullable UUID nodeId, Message msg)
+ throws IgniteCheckedException {
+ if (closed())
+ throw new IgniteCheckedException("Communication client was closed: " + this);
+
+ assert writeBuf.hasArray();
+
+ try {
+ int cnt = U.writeMessageFully(msg, shmem.outputStream(), writeBuf, formatter.writer());
+
+ metricsLsnr.onBytesSent(cnt);
+ }
+ catch (IOException e) {
+ throw new IgniteCheckedException("Failed to send message to remote node: " + shmem, e);
+ }
+
+ markUsed();
+
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void sendMessage(ByteBuffer data) throws IgniteCheckedException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(GridShmemCommunicationClient.class, this, super.toString());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index 359de1c..a661965 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -25,15 +25,19 @@ import org.apache.ignite.internal.*;
import org.apache.ignite.internal.managers.eventstorage.*;
import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.future.*;
+import org.apache.ignite.internal.util.ipc.*;
+import org.apache.ignite.internal.util.ipc.shmem.*;
import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.nio.*;
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.lang.*;
import org.apache.ignite.plugin.extensions.communication.*;
import org.apache.ignite.resources.*;
import org.apache.ignite.spi.*;
import org.apache.ignite.spi.communication.*;
+import org.apache.ignite.thread.*;
import org.jetbrains.annotations.*;
import org.jsr166.*;
@@ -139,6 +143,10 @@ import static org.apache.ignite.events.EventType.*;
@IgniteSpiConsistencyChecked(optional = false)
public class TcpCommunicationSpi extends IgniteSpiAdapter
implements CommunicationSpi<Message>, TcpCommunicationSpiMBean {
+ /** IPC error message. */
+ public static final String OUT_OF_RESOURCES_TCP_MSG = "Failed to allocate shared memory segment " +
+ "(switching to TCP, may be slower).";
+
/** Node attribute that is mapped to node IP addresses (value is <tt>comm.tcp.addrs</tt>). */
public static final String ATTR_ADDRS = "comm.tcp.addrs";
@@ -148,12 +156,18 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
/** Node attribute that is mapped to node port number (value is <tt>comm.tcp.port</tt>). */
public static final String ATTR_PORT = "comm.tcp.port";
+ /** Node attribute that is mapped to node port number (value is <tt>comm.shmem.tcp.port</tt>). */
+ public static final String ATTR_SHMEM_PORT = "comm.shmem.tcp.port";
+
/** Node attribute that is mapped to node's external addresses (value is <tt>comm.tcp.ext-addrs</tt>). */
public static final String ATTR_EXT_ADDRS = "comm.tcp.ext-addrs";
/** Default port which node sets listener to (value is <tt>47100</tt>). */
public static final int DFLT_PORT = 47100;
+ /** Default port which node sets listener for shared memory connections (value is <tt>48100</tt>). */
+ public static final int DFLT_SHMEM_PORT = 48100;
+
/** Default idle connection timeout (value is <tt>30000</tt>ms). */
public static final long DFLT_IDLE_CONN_TIMEOUT = 30000;
@@ -287,7 +301,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
assert ses.accepted();
if (msg instanceof NodeIdMessage)
- sndId = U.bytesToUuid(((NodeIdMessage) msg).nodeIdBytes, 0);
+ sndId = U.bytesToUuid(((NodeIdMessage)msg).nodeIdBytes, 0);
else {
assert msg instanceof HandshakeMessage : msg;
@@ -316,6 +330,8 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
GridCommunicationClient oldClient = clients.get(sndId);
+ boolean hasShmemClient = false;
+
if (oldClient != null) {
if (oldClient instanceof GridTcpNioCommunicationClient) {
if (log.isDebugEnabled())
@@ -327,6 +343,11 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
return;
}
+ else {
+ assert oldClient instanceof GridShmemCommunicationClient;
+
+ hasShmemClient = true;
+ }
}
GridFutureAdapter<GridCommunicationClient> fut = new GridFutureAdapter<>();
@@ -353,10 +374,15 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
return;
}
+ else {
+ assert oldClient instanceof GridShmemCommunicationClient;
+
+ hasShmemClient = true;
+ }
}
boolean reserved = recoveryDesc.tryReserve(msg0.connectCount(),
- new ConnectClosure(ses, recoveryDesc, rmtNode, msg0, fut));
+ new ConnectClosure(ses, recoveryDesc, rmtNode, msg0, !hasShmemClient, fut));
if (log.isDebugEnabled())
log.debug("Received incoming connection from remote node " +
@@ -365,7 +391,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
if (reserved) {
try {
GridTcpNioCommunicationClient client =
- connected(recoveryDesc, ses, rmtNode, msg0.received(), true);
+ connected(recoveryDesc, ses, rmtNode, msg0.received(), true, !hasShmemClient);
fut.onDone(client);
}
@@ -387,11 +413,11 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
}
else {
boolean reserved = recoveryDesc.tryReserve(msg0.connectCount(),
- new ConnectClosure(ses, recoveryDesc, rmtNode, msg0, fut));
+ new ConnectClosure(ses, recoveryDesc, rmtNode, msg0, !hasShmemClient, fut));
if (reserved) {
GridTcpNioCommunicationClient client =
- connected(recoveryDesc, ses, rmtNode, msg0.received(), true);
+ connected(recoveryDesc, ses, rmtNode, msg0.received(), true, !hasShmemClient);
fut.onDone(client);
}
@@ -459,6 +485,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
* @param node Node.
* @param rcvCnt Number of received messages..
* @param sndRes If {@code true} sends response for recovery handshake.
+ * @param createClient If {@code true} creates NIO communication client.
* @return Client.
*/
private GridTcpNioCommunicationClient connected(
@@ -466,7 +493,8 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
GridNioSession ses,
ClusterNode node,
long rcvCnt,
- boolean sndRes) {
+ boolean sndRes,
+ boolean createClient) {
recovery.onHandshake(rcvCnt);
ses.recoveryDescriptor(recovery);
@@ -478,12 +506,16 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
recovery.connected();
- GridTcpNioCommunicationClient client = new GridTcpNioCommunicationClient(ses, log);
+ GridTcpNioCommunicationClient client = null;
- GridCommunicationClient oldClient = clients.putIfAbsent(node.id(), client);
+ if (createClient) {
+ client = new GridTcpNioCommunicationClient(ses, log);
- assert oldClient == null : "Client already created [node=" + node + ", client=" + client +
+ GridCommunicationClient oldClient = clients.putIfAbsent(node.id(), client);
+
+ assert oldClient == null : "Client already created [node=" + node + ", client=" + client +
", oldClient=" + oldClient + ", recoveryDesc=" + recovery + ']';
+ }
return client;
}
@@ -511,22 +543,28 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
/** */
private final GridFutureAdapter<GridCommunicationClient> fut;
+ /** */
+ private final boolean createClient;
+
/**
* @param ses Incoming session.
* @param recoveryDesc Recovery descriptor.
* @param rmtNode Remote node.
* @param msg Handshake message.
+ * @param createClient If {@code true} creates NIO communication client..
* @param fut Connect future.
*/
ConnectClosure(GridNioSession ses,
GridNioRecoveryDescriptor recoveryDesc,
ClusterNode rmtNode,
HandshakeMessage msg,
+ boolean createClient,
GridFutureAdapter<GridCommunicationClient> fut) {
this.ses = ses;
this.recoveryDesc = recoveryDesc;
this.rmtNode = rmtNode;
this.msg = msg;
+ this.createClient = createClient;
this.fut = fut;
}
@@ -539,7 +577,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
msgFut.get();
GridTcpNioCommunicationClient client =
- connected(recoveryDesc, ses, rmtNode, msg.received(), false);
+ connected(recoveryDesc, ses, rmtNode, msg.received(), false, createClient);
fut.onDone(client);
}
@@ -588,6 +626,9 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
/** Local port range. */
private int locPortRange = DFLT_PORT_RANGE;
+ /** Local port which node uses to accept shared memory connections. */
+ private int shmemPort = DFLT_SHMEM_PORT;
+
/** Allocate direct buffer or heap buffer. */
private boolean directBuf = true;
@@ -622,6 +663,9 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
/** NIO server. */
private GridNioServer<Message> nioSrvr;
+ /** Shared memory server. */
+ private IpcSharedMemoryServerEndpoint shmemSrv;
+
/** {@code TCP_NODELAY} option value for created sockets. */
private boolean tcpNoDelay = DFLT_TCP_NODELAY;
@@ -636,6 +680,12 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
/** Recovery and idle clients handler. */
private CommunicationWorker commWorker;
+
+ /** Shared memory accept worker. */
+ private ShmemAcceptWorker shmemAcceptWorker;
+
+ /** Shared memory workers. */
+ private final Collection<ShmemWorker> shmemWorkers = new ConcurrentLinkedDeque8<>();
/** Clients. */
private final ConcurrentMap<UUID, GridCommunicationClient> clients = GridConcurrentFactory.newMap();
@@ -646,6 +696,9 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
/** Bound port. */
private int boundTcpPort = -1;
+ /** Bound port for shared memory server. */
+ private int boundTcpShmemPort = -1;
+
/** Count of selectors to use in TCP server. */
private int selectorsCnt = DFLT_SELECTORS_CNT;
@@ -789,6 +842,25 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
}
/**
+ * Sets local port to accept shared memory connections.
+ * <p>
+ * If set to {@code -1} shared memory communication will be disabled.
+ * <p>
+ * If not provided, default value is {@link #DFLT_SHMEM_PORT}.
+ *
+ * @param shmemPort Port number.
+ */
+ @IgniteSpiConfiguration(optional = true)
+ public void setSharedMemoryPort(int shmemPort) {
+ this.shmemPort = shmemPort;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getSharedMemoryPort() {
+ return shmemPort;
+ }
+
+ /**
* Sets maximum idle connection timeout upon which a connection
* to client will be closed.
* <p>
@@ -1153,6 +1225,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
assertParameter(sockRcvBuf >= 0, "sockRcvBuf >= 0");
assertParameter(sockSndBuf >= 0, "sockSndBuf >= 0");
assertParameter(msgQueueLimit >= 0, "msgQueueLimit >= 0");
+ assertParameter(shmemPort > 0 || shmemPort == -1, "shmemPort > 0 || shmemPort == -1");
assertParameter(reconCnt > 0, "reconnectCnt > 0");
assertParameter(selectorsCnt > 0, "selectorsCnt > 0");
assertParameter(minBufferedMsgCnt >= 0, "minBufferedMsgCnt >= 0");
@@ -1178,6 +1251,13 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
}
try {
+ shmemSrv = resetShmemServer();
+ }
+ catch (IgniteCheckedException e) {
+ U.warn(log, "Failed to start shared memory communication server.", e);
+ }
+
+ try {
// This method potentially resets local port to the value
// local node was bound to.
nioSrvr = resetNioServer();
@@ -1197,6 +1277,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
createSpiAttributeName(ATTR_ADDRS), addrs.get1(),
createSpiAttributeName(ATTR_HOST_NAMES), addrs.get2(),
createSpiAttributeName(ATTR_PORT), boundTcpPort,
+ createSpiAttributeName(ATTR_SHMEM_PORT), boundTcpShmemPort >= 0 ? boundTcpShmemPort : null,
createSpiAttributeName(ATTR_EXT_ADDRS), extAddrs);
}
catch (IOException | IgniteCheckedException e) {
@@ -1223,6 +1304,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
log.debug(configInfo("tcpNoDelay", tcpNoDelay));
log.debug(configInfo("sockSndBuf", sockSndBuf));
log.debug(configInfo("sockRcvBuf", sockRcvBuf));
+ log.debug(configInfo("shmemPort", shmemPort));
log.debug(configInfo("msgQueueLimit", msgQueueLimit));
log.debug(configInfo("minBufferedMsgCnt", minBufferedMsgCnt));
log.debug(configInfo("connTimeout", connTimeout));
@@ -1239,6 +1321,12 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
registerMBean(gridName, this, TcpCommunicationSpiMBean.class);
+ if (shmemSrv != null) {
+ shmemAcceptWorker = new ShmemAcceptWorker(shmemSrv);
+
+ new IgniteThread(shmemAcceptWorker).start();
+ }
+
nioSrvr.start();
commWorker = new CommunicationWorker();
@@ -1254,6 +1342,10 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
@Override public void onContextInitialized0(IgniteSpiContext spiCtx) throws IgniteSpiException {
spiCtx.registerPort(boundTcpPort, IgnitePortProtocol.TCP);
+ // SPI can start without shmem port.
+ if (boundTcpShmemPort > 0)
+ spiCtx.registerPort(boundTcpShmemPort, IgnitePortProtocol.TCP);
+
spiCtx.addLocalEventListener(discoLsnr, EVT_NODE_LEFT, EVT_NODE_FAILED);
ctxInitLatch.countDown();
@@ -1294,7 +1386,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
// If configured TCP port is busy, find first available in range.
for (int port = locPort; port < locPort + locPortRange; port++) {
try {
- MessageFactory messageFactory = new MessageFactory() {
+ MessageFactory msgFactory = new MessageFactory() {
private MessageFactory impl;
@Nullable @Override public Message create(byte type) {
@@ -1307,7 +1399,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
}
};
- MessageFormatter messageFormatter = new MessageFormatter() {
+ MessageFormatter msgFormatter = new MessageFormatter() {
private MessageFormatter impl;
@Override public MessageWriter writer() {
@@ -1329,7 +1421,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
}
};
- GridDirectParser parser = new GridDirectParser(messageFactory, messageFormatter);
+ GridDirectParser parser = new GridDirectParser(msgFactory, msgFormatter);
IgnitePredicate<Message> skipRecoveryPred = new IgnitePredicate<Message>() {
@Override public boolean apply(Message msg) {
@@ -1356,7 +1448,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
.writeTimeout(sockWriteTimeout)
.filters(new GridNioCodecFilter(parser, log, true),
new GridConnectionBytesVerifyFilter(log))
- .messageFormatter(messageFormatter)
+ .messageFormatter(msgFormatter)
.skipRecoveryPredicate(skipRecoveryPred)
.build();
@@ -1388,6 +1480,55 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
", portRange=" + locPortRange + ", locHost=" + locHost + ']', lastEx);
}
+ /**
+ * Creates new shared memory communication server.
+ * @return Server.
+ * @throws IgniteCheckedException If failed.
+ */
+ @Nullable private IpcSharedMemoryServerEndpoint resetShmemServer() throws IgniteCheckedException {
+ if (boundTcpShmemPort >= 0)
+ throw new IgniteCheckedException("Shared memory server was already created on port " + boundTcpShmemPort);
+
+ if (shmemPort == -1 || U.isWindows())
+ return null;
+
+ IgniteCheckedException lastEx = null;
+
+ // If configured TCP port is busy, find first available in range.
+ for (int port = shmemPort; port < shmemPort + locPortRange; port++) {
+ try {
+ IpcSharedMemoryServerEndpoint srv =
+ new IpcSharedMemoryServerEndpoint(log, ignite.configuration().getNodeId(), gridName);
+
+ srv.setPort(port);
+
+ srv.omitOutOfResourcesWarning(true);
+
+ srv.start();
+
+ boundTcpShmemPort = port;
+
+ // Ack Port the TCP server was bound to.
+ if (log.isInfoEnabled())
+ log.info("Successfully bound shared memory communication to TCP port [port=" + boundTcpShmemPort +
+ ", locHost=" + locHost + ']');
+
+ return srv;
+ }
+ catch (IgniteCheckedException e) {
+ lastEx = e;
+
+ if (log.isDebugEnabled())
+ log.debug("Failed to bind to local port (will try next port within range) [port=" + port +
+ ", locHost=" + locHost + ']');
+ }
+ }
+
+ // If free port wasn't found.
+ throw new IgniteCheckedException("Failed to bind shared memory communication to any port within range [startPort=" +
+ locPort + ", portRange=" + locPortRange + ", locHost=" + locHost + ']', lastEx);
+ }
+
/** {@inheritDoc} */
@Override public void spiStop() throws IgniteSpiException {
assert isNodeStopping();
@@ -1399,9 +1540,16 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
nioSrvr.stop();
U.interrupt(commWorker);
-
U.join(commWorker, log);
+ U.cancel(shmemAcceptWorker);
+ U.join(shmemAcceptWorker, log);
+
+ U.cancel(shmemWorkers);
+ U.join(shmemWorkers, log);
+
+ shmemWorkers.clear();
+
// Force closing on stop (safety).
for (GridCommunicationClient client : clients.values())
client.forceClose();
@@ -1612,13 +1760,110 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
@Nullable protected GridCommunicationClient createNioClient(ClusterNode node) throws IgniteCheckedException {
assert node != null;
- if (getSpiContext().localNode() == null)
+ Integer shmemPort = node.attribute(createSpiAttributeName(ATTR_SHMEM_PORT));
+
+ ClusterNode locNode = getSpiContext().localNode();
+
+ if (locNode == null)
throw new IgniteCheckedException("Failed to create NIO client (local node is stopping)");
+ // If remote node has shared memory server enabled and has the same set of MACs
+ // then we are likely to run on the same host and shared memory communication could be tried.
+ if (shmemPort != null && U.sameMacs(locNode, node)) {
+ try {
+ return createShmemClient(node, shmemPort);
+ }
+ catch (IgniteCheckedException e) {
+ if (e.hasCause(IpcOutOfSystemResourcesException.class))
+ // Has cause or is itself the IpcOutOfSystemResourcesException.
+ LT.warn(log, null, OUT_OF_RESOURCES_TCP_MSG);
+ else if (getSpiContext().node(node.id()) != null)
+ LT.warn(log, null, e.getMessage());
+ else if (log.isDebugEnabled())
+ log.debug("Failed to establish shared memory connection with local node (node has left): " +
+ node.id());
+ }
+ }
+
return createTcpClient(node);
}
/**
+ * @param node Node.
+ * @param port Port.
+ * @return Client.
+ * @throws IgniteCheckedException If failed.
+ */
+ @Nullable protected GridCommunicationClient createShmemClient(ClusterNode node, Integer port) throws IgniteCheckedException {
+ int attempt = 1;
+
+ int connectAttempts = 1;
+
+ long connTimeout0 = connTimeout;
+
+ while (true) {
+ GridCommunicationClient client;
+
+ try {
+ client = new GridShmemCommunicationClient(metricsLsnr,
+ port,
+ connTimeout,
+ log,
+ getSpiContext().messageFormatter());
+ }
+ catch (IgniteCheckedException e) {
+ // Reconnect for the second time, if connection is not established.
+ if (connectAttempts < 2 && X.hasCause(e, ConnectException.class)) {
+ connectAttempts++;
+
+ continue;
+ }
+
+ throw e;
+ }
+
+ try {
+ safeHandshake(client, null, node.id(), connTimeout0);
+ }
+ catch (HandshakeTimeoutException e) {
+ if (log.isDebugEnabled())
+ log.debug("Handshake timedout (will retry with increased timeout) [timeout=" + connTimeout0 +
+ ", err=" + e.getMessage() + ", client=" + client + ']');
+
+ client.forceClose();
+
+ if (attempt == reconCnt || connTimeout0 > maxConnTimeout) {
+ if (log.isDebugEnabled())
+ log.debug("Handshake timedout (will stop attempts to perform the handshake) " +
+ "[timeout=" + connTimeout0 + ", maxConnTimeout=" + maxConnTimeout +
+ ", attempt=" + attempt + ", reconCnt=" + reconCnt +
+ ", err=" + e.getMessage() + ", client=" + client + ']');
+
+ throw e;
+ }
+ else {
+ attempt++;
+
+ connTimeout0 *= 2;
+
+ continue;
+ }
+ }
+ catch (IgniteCheckedException | RuntimeException | Error e) {
+ if (log.isDebugEnabled())
+ log.debug(
+ "Caught exception (will close client) [err=" + e.getMessage() + ", client=" + client + ']');
+
+ client.forceClose();
+
+ throw e;
+ }
+
+ return client;
+ }
+ }
+
+ /**
* Establish TCP connection to remote node and returns client.
*
* @param node Remote node.
@@ -2095,6 +2340,144 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
}
/**
+ * This worker takes responsibility to shut the server down when stopping,
+ * No other thread shall stop passed server.
+ */
+ private class ShmemAcceptWorker extends GridWorker {
+ /** */
+ private final IpcSharedMemoryServerEndpoint srv;
+
+ /**
+ * @param srv Server.
+ */
+ ShmemAcceptWorker(IpcSharedMemoryServerEndpoint srv) {
+ super(gridName, "shmem-communication-acceptor", TcpCommunicationSpi.this.log);
+
+ this.srv = srv;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void body() throws InterruptedException {
+ try {
+ while (!Thread.interrupted()) {
+ ShmemWorker e = new ShmemWorker(srv.accept());
+
+ shmemWorkers.add(e);
+
+ new IgniteThread(e).start();
+ }
+ }
+ catch (IgniteCheckedException e) {
+ if (!isCancelled())
+ U.error(log, "Shmem server failed.", e);
+ }
+ finally {
+ srv.close();
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public void cancel() {
+ super.cancel();
+
+ srv.close();
+ }
+ }
+
+ /**
+ *
+ */
+ private class ShmemWorker extends GridWorker {
+ /** */
+ private final IpcEndpoint endpoint;
+
+ /**
+ * @param endpoint Endpoint.
+ */
+ private ShmemWorker(IpcEndpoint endpoint) {
+ super(gridName, "shmem-worker", TcpCommunicationSpi.this.log);
+
+ this.endpoint = endpoint;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void body() throws InterruptedException {
+ try {
+ MessageFactory msgFactory = new MessageFactory() {
+ private MessageFactory impl;
+
+ @Nullable @Override public Message create(byte type) {
+ if (impl == null)
+ impl = getSpiContext().messageFactory();
+
+ assert impl != null;
+
+ return impl.create(type);
+ }
+ };
+
+ MessageFormatter msgFormatter = new MessageFormatter() {
+ private MessageFormatter impl;
+
+ @Override public MessageWriter writer() {
+ if (impl == null)
+ impl = getSpiContext().messageFormatter();
+
+ assert impl != null;
+
+ return impl.writer();
+ }
+
+ @Override public MessageReader reader(MessageFactory factory) {
+ if (impl == null)
+ impl = getSpiContext().messageFormatter();
+
+ assert impl != null;
+
+ return impl.reader(factory);
+ }
+ };
+
+ IpcToNioAdapter<Message> adapter = new IpcToNioAdapter<>(
+ metricsLsnr,
+ log,
+ endpoint,
+ srvLsnr,
+ msgFormatter,
+ new GridNioCodecFilter(new GridDirectParser(msgFactory, msgFormatter), log, true),
+ new GridConnectionBytesVerifyFilter(log)
+ );
+
+ adapter.serve();
+ }
+ finally {
+ shmemWorkers.remove(this);
+
+ endpoint.close();
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public void cancel() {
+ super.cancel();
+
+ endpoint.close();
+ }
+
+ /** @{@inheritDoc} */
+ @Override protected void cleanup() {
+ super.cleanup();
+
+ endpoint.close();
+ }
+
+ /** @{@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(ShmemWorker.class, this);
+ }
+ }
+
+ /**
*
*/
private class CommunicationWorker extends IgniteSpiThread {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java
index 6f5a738..fe4f581 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java
@@ -44,6 +44,14 @@ public interface TcpCommunicationSpiMBean extends IgniteSpiManagementMBean {
public int getLocalPort();
/**
+ * Gets local port for shared memory communication.
+ *
+ * @return Port number.
+ */
+ @MXBeanDescription("Shared memory endpoint port number.")
+ public int getSharedMemoryPort();
+
+ /**
* Gets maximum number of local ports tried if all previously
* tried ports are occupied.
*
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 9bfbd15..128d452 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -356,6 +356,21 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
}
/**
+ * @throws Exception If failed.
+ */
+ public void testRemoveAllSkipStore() throws Exception {
+ IgniteCache<String, Integer> jcache = jcache();
+
+ jcache.putAll(F.asMap("1", 1, "2", 2, "3", 3));
+
+ jcache.withSkipStore().removeAll();
+
+ assertEquals((Integer)1, jcache.get("1"));
+ assertEquals((Integer)2, jcache.get("2"));
+ assertEquals((Integer)3, jcache.get("3"));
+ }
+
+ /**
* @throws IgniteCheckedException If failed.
*/
public void testAtomicOps() throws IgniteCheckedException {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
index db9e6a8..7905565 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
@@ -807,6 +807,25 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
+ public void testGetOrCreateMultiNodeTemplate() throws Exception {
+ final AtomicInteger idx = new AtomicInteger();
+
+ GridTestUtils.runMultiThreaded(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ int idx0 = idx.getAndIncrement();
+
+ ignite(idx0 % nodeCount()).getOrCreateCache(DYNAMIC_CACHE_NAME);
+
+ return null;
+ }
+ }, nodeCount() * 4, "runner");
+
+ ignite(0).destroyCache(DYNAMIC_CACHE_NAME);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
public void testGetOrCreateNearOnlyMultiNode() throws Exception {
checkGetOrCreateNear(true);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
new file mode 100644
index 0000000..24ebb7c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
+
+/**
+ *
+ */
+public class IgniteCacheManyClientsTest extends GridCommonAbstractTest {
+ /** */
+ protected static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+ /** */
+ private static final int SRVS = 4;
+
+ /** */
+ private boolean client;
+
+ /** */
+ private boolean clientDiscovery;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+
+ if (!clientDiscovery)
+ ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true);
+
+ cfg.setClientMode(client);
+
+ CacheConfiguration ccfg = new CacheConfiguration();
+
+ ccfg.setCacheMode(PARTITIONED);
+ ccfg.setAtomicityMode(ATOMIC);
+ ccfg.setWriteSynchronizationMode(PRIMARY_SYNC);
+ ccfg.setBackups(1);
+
+ cfg.setCacheConfiguration(ccfg);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ startGrids(SRVS);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ super.afterTestsStopped();
+
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testManyClients() throws Exception {
+ manyClientsPutGet();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testManyClientsClientDiscovery() throws Exception {
+ clientDiscovery = true;
+
+ manyClientsPutGet();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ private void manyClientsPutGet() throws Exception {
+ client = true;
+
+ final AtomicInteger idx = new AtomicInteger(SRVS);
+
+ final AtomicBoolean stop = new AtomicBoolean();
+
+ final int THREADS = 30;
+
+ final CountDownLatch latch = new CountDownLatch(THREADS);
+
+ try {
+ IgniteInternalFuture<?> fut = GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try (Ignite ignite = startGrid(idx.getAndIncrement())) {
+ log.info("Started node: " + ignite.name());
+
+ assertTrue(ignite.configuration().isClientMode());
+
+ IgniteCache<Object, Object> cache = ignite.cache(null);
+
+ ThreadLocalRandom rnd = ThreadLocalRandom.current();
+
+ int iter = 0;
+
+ Integer key = rnd.nextInt(0, 1000);
+
+ cache.put(key, iter++);
+
+ assertNotNull(cache.get(key));
+
+ latch.countDown();
+
+ while (!stop.get()) {
+ key = rnd.nextInt(0, 1000);
+
+ cache.put(key, iter++);
+
+ assertNotNull(cache.get(key));
+ }
+
+ log.info("Stopping node: " + ignite.name());
+ }
+
+ return null;
+ }
+ }, THREADS, "client-thread");
+
+ latch.await();
+
+ Thread.sleep(10_000);
+
+ log.info("Stop clients.");
+
+ stop.set(true);
+
+ fut.get();
+ }
+ finally {
+ stop.set(true);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheMessageRecoveryAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheMessageRecoveryAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheMessageRecoveryAbstractTest.java
index 96abe5f..8031315 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheMessageRecoveryAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheMessageRecoveryAbstractTest.java
@@ -50,6 +50,7 @@ public abstract class IgniteCacheMessageRecoveryAbstractTest extends GridCommonA
TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
commSpi.setSocketWriteTimeout(1000);
+ commSpi.setSharedMemoryPort(-1);
cfg.setCommunicationSpi(commSpi);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
index 9d41074..4601586 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
@@ -176,7 +176,7 @@ public class GridCachePartitionedPreloadLifecycleSelfTest extends GridCachePrelo
for (int j = 0; j < G.allGrids().size(); j++) {
GridCacheAdapter<Object, MyValue> c2 = ((IgniteKernal)grid(j)).internalCache("two");
- CacheQuery<Map.Entry<Object, MyValue>> qry = c2.context().queries().createScanQuery(null, false);
+ CacheQuery<Map.Entry<Object, MyValue>> qry = c2.context().queries().createScanQuery(null, null, false);
int totalCnt = F.sumInt(qry.execute(new IgniteReducer<Map.Entry<Object, MyValue>, Integer>() {
@IgniteInstanceResource
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
index 62bf3f7..cc8217d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
@@ -179,7 +179,7 @@ public class GridCacheReplicatedPreloadLifecycleSelfTest extends GridCachePreloa
for (int j = 0; j < G.allGrids().size(); j++) {
GridCacheAdapter<Object, MyValue> c2 = ((IgniteKernal)grid(j)).internalCache("two");
- CacheQuery<Map.Entry<Object, MyValue>> qry = c2.context().queries().createScanQuery(null, false);
+ CacheQuery<Map.Entry<Object, MyValue>> qry = c2.context().queries().createScanQuery(null, null, false);
final int i0 = j;
final int j0 = i;
@@ -207,8 +207,8 @@ public class GridCacheReplicatedPreloadLifecycleSelfTest extends GridCachePreloa
Object v1 = e.getValue();
Object v2 = ((IgniteKernal)grid).getCache("one").get(key);
- assertNotNull("Cache c1 misses value for key [i=" + j0 + ", j=" + i0 +
- ", missedKey=" + key + ", cache=" + ((IgniteKernal)grid).getCache("one").values() + ']', v2);
+ assertNotNull("Cache c1 misses value for key [i=" + j0 + ", j=" + i0 + ", missedKey=" +
+ key + ", cache=" + ((IgniteKernal)grid).getCache("one").values() + ']', v2);
assertEquals(v1, v2);
}
catch (IgniteCheckedException e1) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
index 068a46c..6ccfbc2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
@@ -115,49 +115,81 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends GridCommonA
* @throws Exception If failed.
*/
public void testQuery() throws Exception {
- checkQuery(((IgniteKernal)grid(0)).internalCache(ATOMIC_CACHE_NAME));
+ checkQuery(((IgniteKernal)grid(0)).internalCache(ATOMIC_CACHE_NAME), false);
- checkQuery(((IgniteKernal)grid(0)).internalCache(TRANSACTIONAL_CACHE_NAME));
+ checkQuery(((IgniteKernal)grid(0)).internalCache(TRANSACTIONAL_CACHE_NAME), false);
+
+ checkQuery(((IgniteKernal)grid(0)).internalCache(ATOMIC_CACHE_NAME), true);
+
+ checkQuery(((IgniteKernal)grid(0)).internalCache(TRANSACTIONAL_CACHE_NAME), true);
}
/**
* @param cache Cache.
+ * @param scanPartitions Scan partitions.
* @throws Exception If failed.
*/
@SuppressWarnings("unchecked")
- private void checkQuery(GridCacheAdapter cache) throws Exception {
+ private void checkQuery(GridCacheAdapter cache, boolean scanPartitions) throws Exception {
final int ENTRY_CNT = 500;
- for (int i = 0; i < ENTRY_CNT; i++)
- cache.getAndPut(new Key(i), new Person("p-" + i, i));
+ Map<Integer, Map<Key, Person>> entries = new HashMap<>();
+
+ for (int i = 0; i < ENTRY_CNT; i++) {
+ Key key = new Key(i);
+ Person val = new Person("p-" + i, i);
+
+ int part = cache.context().affinity().partition(key);
+
+ cache.getAndPut(key, val);
+
+ Map<Key, Person> partEntries = entries.get(part);
+
+ if (partEntries == null)
+ entries.put(part, partEntries = new HashMap<>());
+
+ partEntries.put(key, val);
+ }
try {
- CacheQuery<Map.Entry<Key, Person>> qry = cache.context().queries().createScanQuery(
- new IgniteBiPredicate<Key, Person>() {
- @Override public boolean apply(Key key, Person p) {
- assertEquals(key.id, (Integer)p.salary);
+ int partitions = scanPartitions ? cache.context().affinity().partitions() : 1;
- return key.id % 2 == 0;
- }
- }, false);
+ for (int i = 0; i < partitions; i++) {
+ CacheQuery<Map.Entry<Key, Person>> qry = cache.context().queries().createScanQuery(
+ new IgniteBiPredicate<Key, Person>() {
+ @Override public boolean apply(Key key, Person p) {
+ assertEquals(key.id, (Integer)p.salary);
- Collection<Map.Entry<Key, Person>> res = qry.execute().get();
+ return key.id % 2 == 0;
+ }
+ }, (scanPartitions ? i : null), false);
- assertEquals(ENTRY_CNT / 2, res.size());
+ Collection<Map.Entry<Key, Person>> res = qry.execute().get();
- for (Map.Entry<Key, Person> e : res) {
- Key k = e.getKey();
- Person p = e.getValue();
+ if (!scanPartitions)
+ assertEquals(ENTRY_CNT / 2, res.size());
- assertEquals(k.id, (Integer)p.salary);
- assertEquals(0, k.id % 2);
- }
+ for (Map.Entry<Key, Person> e : res) {
+ Key k = e.getKey();
+ Person p = e.getValue();
- qry = cache.context().queries().createScanQuery(null, false);
+ assertEquals(k.id, (Integer)p.salary);
+ assertEquals(0, k.id % 2);
- res = qry.execute().get();
+ if (scanPartitions) {
+ Map<Key, Person> partEntries = entries.get(i);
- assertEquals(ENTRY_CNT, res.size());
+ assertEquals(p, partEntries.get(k));
+ }
+ }
+
+ qry = cache.context().queries().createScanQuery(null, (scanPartitions ? i : null), false);
+
+ res = qry.execute().get();
+
+ if (!scanPartitions)
+ assertEquals(ENTRY_CNT, res.size());
+ }
testMultithreaded(cache, ENTRY_CNT / 2);
}
@@ -185,7 +217,7 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends GridCommonA
return key.id % 2 == 0;
}
- }, false);
+ }, null, false);
for (int i = 0; i < 250; i++) {
Collection<Map.Entry<Key, Person>> res = qry.execute().get();
@@ -229,7 +261,7 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends GridCommonA
return val % 2 == 0;
}
- }, false);
+ }, null, false);
Collection<Map.Entry<String, Long>> res = qry.execute().get();
@@ -244,7 +276,7 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends GridCommonA
assertEquals(0, val % 2);
}
- qry = cache.context().queries().createScanQuery(null, false);
+ qry = cache.context().queries().createScanQuery(null, null, false);
res = qry.execute().get();
@@ -284,7 +316,7 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends GridCommonA
return key % 2 == 0;
}
- }, false);
+ }, null, false);
Collection<Map.Entry<Integer, byte[]>> res = qry.execute().get();
@@ -299,7 +331,7 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends GridCommonA
assertEquals(0, key % 2);
}
- qry = cache.context().queries().createScanQuery(null, false);
+ qry = cache.context().queries().createScanQuery(null, null, false);
res = qry.execute().get();
@@ -367,5 +399,29 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends GridCommonA
this.name = name;
this.salary = salary;
}
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ if (this == o)
+ return true;
+
+ if (o == null || getClass() != o.getClass())
+ return false;
+
+ Person person = (Person)o;
+
+ if (salary != person.salary)
+ return false;
+
+ return !(name != null ? !name.equals(person.name) : person.name != null);
+
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ int result = name != null ? name.hashCode() : 0;
+
+ return 31 * result + salary;
+ }
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IgfsSharedMemoryTestServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IgfsSharedMemoryTestServer.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IgfsSharedMemoryTestServer.java
index 1a8fd10..e220031 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IgfsSharedMemoryTestServer.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IgfsSharedMemoryTestServer.java
@@ -49,6 +49,8 @@ public class IgfsSharedMemoryTestServer {
srv.start();
+ System.out.println("IPC shared memory server endpoint started");
+
IpcEndpoint clientEndpoint = srv.accept();
is = clientEndpoint.inputStream();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
index 2ddf6f3..c6f590e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java
@@ -42,7 +42,7 @@ public class IpcSharedMemoryCrashDetectionSelfTest extends GridCommonAbstractTes
@Override protected void beforeTestsStarted() throws Exception {
super.beforeTestsStarted();
- IpcSharedMemoryNativeLoader.load();
+ IpcSharedMemoryNativeLoader.load(log());
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemorySpaceSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemorySpaceSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemorySpaceSelfTest.java
index 7dc0870..4afb64b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemorySpaceSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemorySpaceSelfTest.java
@@ -51,7 +51,7 @@ public class IpcSharedMemorySpaceSelfTest extends GridCommonAbstractTest {
@Override protected void beforeTestsStarted() throws Exception {
super.beforeTestsStarted();
- IpcSharedMemoryNativeLoader.load();
+ IpcSharedMemoryNativeLoader.load(log());
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtilsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtilsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtilsSelfTest.java
index 4c5413c..176429e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtilsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryUtilsSelfTest.java
@@ -31,7 +31,7 @@ public class IpcSharedMemoryUtilsSelfTest extends GridCommonAbstractTest {
@Override protected void beforeTestsStarted() throws Exception {
super.beforeTestsStarted();
- IpcSharedMemoryNativeLoader.load();
+ IpcSharedMemoryNativeLoader.load(log());
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/LoadWithCorruptedLibFileTestRunner.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/LoadWithCorruptedLibFileTestRunner.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/LoadWithCorruptedLibFileTestRunner.java
index 8ff827b..8fee239 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/LoadWithCorruptedLibFileTestRunner.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/LoadWithCorruptedLibFileTestRunner.java
@@ -37,7 +37,7 @@ public class LoadWithCorruptedLibFileTestRunner {
createCorruptedLibFile();
- IpcSharedMemoryNativeLoader.load();
+ IpcSharedMemoryNativeLoader.load(null);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkReader.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkReader.java
index 28495af..89eeda1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkReader.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkReader.java
@@ -43,7 +43,7 @@ public class IpcSharedMemoryBenchmarkReader implements IpcSharedMemoryBenchmarkP
* @throws IgniteCheckedException If failed.
*/
public static void main(String[] args) throws IgniteCheckedException {
- IpcSharedMemoryNativeLoader.load();
+ IpcSharedMemoryNativeLoader.load(null);
int nThreads = (args.length > 0 ? Integer.parseInt(args[0]) : 1);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkWriter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkWriter.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkWriter.java
index 2ade145..e8a8402 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkWriter.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/benchmark/IpcSharedMemoryBenchmarkWriter.java
@@ -42,7 +42,7 @@ public class IpcSharedMemoryBenchmarkWriter implements IpcSharedMemoryBenchmarkP
* @throws IgniteCheckedException If failed.
*/
public static void main(String[] args) throws IgniteCheckedException {
- IpcSharedMemoryNativeLoader.load();
+ IpcSharedMemoryNativeLoader.load(null);
int nThreads = args.length > 0 ? Integer.parseInt(args[0]) : 1;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridIoManagerBenchmark0.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridIoManagerBenchmark0.java b/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridIoManagerBenchmark0.java
index 422d608..ea5b716 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridIoManagerBenchmark0.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridIoManagerBenchmark0.java
@@ -455,6 +455,7 @@ public class GridIoManagerBenchmark0 extends GridCommonAbstractTest {
spi.setTcpNoDelay(true);
spi.setConnectionBufferSize(0);
+ spi.setSharedMemoryPort(-1);
info("Comm SPI: " + spi);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/spi/GridTcpSpiForwardingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/GridTcpSpiForwardingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/GridTcpSpiForwardingSelfTest.java
index ed9e0cf..744635d 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/GridTcpSpiForwardingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/GridTcpSpiForwardingSelfTest.java
@@ -115,6 +115,7 @@ public class GridTcpSpiForwardingSelfTest extends GridCommonAbstractTest {
commSpi.setLocalAddress("127.0.0.1");
commSpi.setLocalPort(commLocPort);
commSpi.setLocalPortRange(1);
+ commSpi.setSharedMemoryPort(-1);
cfg.setCommunicationSpi(commSpi);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiAbstractTest.java
index 8d27485..eee38a5 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiAbstractTest.java
@@ -37,10 +37,23 @@ abstract class GridTcpCommunicationSpiAbstractTest extends GridAbstractCommunica
/** */
public static final int IDLE_CONN_TIMEOUT = 2000;
+ /** */
+ private final boolean useShmem;
+
+ /**
+ * @param useShmem Use shared mem flag.
+ */
+ protected GridTcpCommunicationSpiAbstractTest(boolean useShmem) {
+ this.useShmem = useShmem;
+ }
+
/** {@inheritDoc} */
@Override protected CommunicationSpi getSpi(int idx) {
TcpCommunicationSpi spi = new TcpCommunicationSpi();
+ if (!useShmem)
+ spi.setSharedMemoryPort(-1);
+
spi.setLocalPort(GridTestUtils.getNextCommPort(getClass()));
spi.setIdleConnectionTimeout(IDLE_CONN_TIMEOUT);
spi.setTcpNoDelay(tcpNoDelay());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
index 2d175f5..a5cd7ae 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
@@ -181,8 +181,7 @@ public class GridTcpCommunicationSpiConcurrentConnectSelfTest<T extends Communic
if (load) {
loadFut = GridTestUtils.runMultiThreadedAsync(new Callable<Long>() {
- @Override
- public Long call() throws Exception {
+ @Override public Long call() throws Exception {
long dummyRes = 0;
List<String> list = new ArrayList<>();
@@ -300,6 +299,7 @@ public class GridTcpCommunicationSpiConcurrentConnectSelfTest<T extends Communic
spi.setLocalPort(port++);
spi.setIdleConnectionTimeout(60_000);
spi.setConnectTimeout(10_000);
+ spi.setSharedMemoryPort(-1);
return spi;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
index 3916f02..f682f01 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
@@ -55,12 +55,14 @@ public class GridTcpCommunicationSpiMultithreadedSelfTest extends GridSpiAbstrac
/** Message id sequence. */
private AtomicLong msgId = new AtomicLong();
+ /** */
+ private final boolean useShmem;
+
/** SPI resources. */
private static final Collection<IgniteTestResources> spiRsrcs = new ArrayList<>();
/** SPIs */
- private static final Map<UUID, CommunicationSpi<Message>> spis =
- new ConcurrentHashMap<>();
+ private static final Map<UUID, CommunicationSpi<Message>> spis = new ConcurrentHashMap<>();
/** Listeners. */
private static final Map<UUID, MessageListener> lsnrs = new HashMap<>();
@@ -80,9 +82,19 @@ public class GridTcpCommunicationSpiMultithreadedSelfTest extends GridSpiAbstrac
}
/**
+ * @param useShmem Use shared mem.
*/
- public GridTcpCommunicationSpiMultithreadedSelfTest() {
+ protected GridTcpCommunicationSpiMultithreadedSelfTest(boolean useShmem) {
super(false);
+
+ this.useShmem = useShmem;
+ }
+
+ /**
+ *
+ */
+ public GridTcpCommunicationSpiMultithreadedSelfTest() {
+ this(false);
}
/**
@@ -413,6 +425,9 @@ public class GridTcpCommunicationSpiMultithreadedSelfTest extends GridSpiAbstrac
private CommunicationSpi<Message> newCommunicationSpi() {
TcpCommunicationSpi spi = new TcpCommunicationSpi();
+ if (!useShmem)
+ spi.setSharedMemoryPort(-1);
+
spi.setLocalPort(GridTestUtils.getNextCommPort(getClass()));
spi.setIdleConnectionTimeout(IDLE_CONN_TIMEOUT);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedShmemTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedShmemTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedShmemTest.java
new file mode 100644
index 0000000..590b426
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedShmemTest.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spi.communication.tcp;
+
+/**
+ *
+ */
+public class GridTcpCommunicationSpiMultithreadedShmemTest extends GridTcpCommunicationSpiMultithreadedSelfTest {
+ /** */
+ public GridTcpCommunicationSpiMultithreadedShmemTest() {
+ super(true);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
index c0f0b11..1a4ba22 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
@@ -324,6 +324,7 @@ public class GridTcpCommunicationSpiRecoveryAckSelfTest<T extends CommunicationS
spi.setTcpNoDelay(true);
spi.setAckSendThreshold(ackCnt);
spi.setMessageQueueLimit(queueLimit);
+ spi.setSharedMemoryPort(-1);
return spi;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
index 7463388..5d3afd9 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
@@ -608,6 +608,7 @@ public class GridTcpCommunicationSpiRecoverySelfTest<T extends CommunicationSpi>
protected TcpCommunicationSpi getSpi(int idx) {
TcpCommunicationSpi spi = new TcpCommunicationSpi();
+ spi.setSharedMemoryPort(-1);
spi.setLocalPort(port++);
spi.setIdleConnectionTimeout(10_000);
spi.setConnectTimeout(10_000);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiShmemSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiShmemSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiShmemSelfTest.java
new file mode 100644
index 0000000..5746a3c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiShmemSelfTest.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spi.communication.tcp;
+
+import org.apache.ignite.testframework.junits.spi.*;
+
+/**
+ *
+ */
+@GridSpiTest(spi = TcpCommunicationSpi.class, group = "Communication SPI")
+public class GridTcpCommunicationSpiShmemSelfTest extends GridTcpCommunicationSpiAbstractTest {
+ /**
+ *
+ */
+ public GridTcpCommunicationSpiShmemSelfTest() {
+ super(true);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean tcpNoDelay() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5d007e3/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiTcpSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiTcpSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiTcpSelfTest.java
index 32bced2..c27a86f 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiTcpSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiTcpSelfTest.java
@@ -24,6 +24,13 @@ import org.apache.ignite.testframework.junits.spi.*;
*/
@GridSpiTest(spi = TcpCommunicationSpi.class, group = "Communication SPI")
public class GridTcpCommunicationSpiTcpSelfTest extends GridTcpCommunicationSpiAbstractTest {
+ /**
+ *
+ */
+ public GridTcpCommunicationSpiTcpSelfTest() {
+ super(false);
+ }
+
/** {@inheritDoc} */
@Override protected boolean tcpNoDelay() {
return true;