You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/06/28 06:10:21 UTC
[01/26] ignite git commit: minor - fixed javadoc and import
Repository: ignite
Updated Branches:
refs/heads/ignite-2.1.2-exchange c95b86042 -> 025974023
minor - fixed javadoc and import
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f3b06727
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f3b06727
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f3b06727
Branch: refs/heads/ignite-2.1.2-exchange
Commit: f3b067271d5f1e393ffc01479ceaab541e143e8c
Parents: 039c02a
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Jun 26 12:03:14 2017 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Jun 26 12:03:14 2017 +0300
----------------------------------------------------------------------
.../internal/processors/cache/GridCacheSharedContext.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f3b06727/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
index 050e102..d108454 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
@@ -35,6 +35,7 @@ import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.managers.communication.GridIoManager;
import org.apache.ignite.internal.managers.deployment.GridDeploymentManager;
+import org.apache.ignite.internal.managers.discovery.DiscoCache;
import org.apache.ignite.internal.managers.discovery.GridDiscoveryManager;
import org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager;
import org.apache.ignite.internal.pagemem.store.IgnitePageStoreManager;
@@ -42,8 +43,7 @@ import org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.database.IgniteCacheDatabaseSharedManager;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
-import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId;
-import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTopologyFuture;
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal;
import org.apache.ignite.internal.processors.cache.jta.CacheJtaManagerAdapter;
import org.apache.ignite.internal.processors.cache.store.CacheStoreManager;
@@ -719,7 +719,7 @@ public class GridCacheSharedContext<K, V> {
/**
* Captures all ongoing operations that we need to wait before we can proceed to the next topology version.
* This method must be called only after
- * {@link GridDhtPartitionTopology#updateTopologyVersion(GridDhtPartitionExchangeId, GridDhtPartitionsExchangeFuture, long, boolean)}
+ * {@link GridDhtPartitionTopology#updateTopologyVersion(GridDhtTopologyFuture, DiscoCache, long, boolean)}
* method is called so that all new updates will wait to switch to the new version.
* This method will capture:
* <ul>
[21/26] ignite git commit: IGNITE-5461 Support for Memory metrics and
fixed cache metrics.
Posted by sb...@apache.org.
IGNITE-5461 Support for Memory metrics and fixed cache metrics.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3cd30f06
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3cd30f06
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3cd30f06
Branch: refs/heads/ignite-2.1.2-exchange
Commit: 3cd30f0640fb9b77d4db739a8291055c2207aa4f
Parents: 1cb9772
Author: anovikov <an...@gridgain.com>
Authored: Wed Jun 28 11:47:25 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Wed Jun 28 11:47:25 2017 +0700
----------------------------------------------------------------------
.../IgniteCacheDatabaseSharedManager.java | 1 -
.../ignite/internal/visor/cache/VisorCache.java | 20 ++-
.../cache/VisorCacheAggregatedMetrics.java | 6 +-
.../internal/visor/cache/VisorCacheMetrics.java | 28 +++
.../visor/cache/VisorMemoryMetrics.java | 10 +-
.../node/VisorMemoryPolicyConfiguration.java | 10 +-
.../resources/META-INF/classnames.properties | 46 ++---
.../cluster-select/cluster-select.controller.js | 51 +++---
.../cluster-select/cluster-select.pug | 16 +-
.../app/modules/agent/AgentManager.service.js | 174 +++++++++++--------
.../frontend/app/modules/cluster/Cache.js | 19 +-
.../modules/configuration/Version.service.js | 9 +-
.../configuration/generator/Maven.service.js | 159 +++++++++--------
.../views/templates/agent-download.tpl.pug | 9 +-
14 files changed, 308 insertions(+), 250 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/3cd30f06/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
index e1f1c9a..ec0e895 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
@@ -41,7 +41,6 @@ import org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider;
import org.apache.ignite.internal.pagemem.PageMemory;
import org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl;
import org.apache.ignite.internal.processors.cache.CacheGroupContext;
-import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheMapEntry;
import org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter;
import org.apache.ignite.internal.processors.cache.persistence.evict.FairFifoPageEvictionTracker;
http://git-wip-us.apache.org/repos/asf/ignite/blob/3cd30f06/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
index aa4f271..5d7dfd3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
@@ -33,6 +33,10 @@ import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.internal.visor.VisorDataTransferObject;
import org.apache.ignite.lang.IgniteUuid;
+import static org.apache.ignite.cache.CachePeekMode.ONHEAP;
+import static org.apache.ignite.cache.CachePeekMode.PRIMARY;
+import static org.apache.ignite.cache.CachePeekMode.BACKUP;
+
/**
* Data transfer object for {@link IgniteCache}.
*/
@@ -41,8 +45,12 @@ public class VisorCache extends VisorDataTransferObject {
private static final long serialVersionUID = 0L;
/** */
- private static final CachePeekMode[] PEEK_NO_NEAR =
- new CachePeekMode[] {CachePeekMode.PRIMARY, CachePeekMode.BACKUP};
+ private static final CachePeekMode[] PEEK_ONHEAP_PRIMARY =
+ new CachePeekMode[] {ONHEAP, PRIMARY};
+
+ /** */
+ private static final CachePeekMode[] PEEK_ONHEAP_BACKUP =
+ new CachePeekMode[] {ONHEAP, BACKUP};
/** Cache name. */
private String name;
@@ -102,10 +110,12 @@ public class VisorCache extends VisorDataTransferObject {
name = ca.name();
dynamicDeploymentId = cctx.dynamicDeploymentId();
mode = cfg.getCacheMode();
- size = ca.localSizeLong(PEEK_NO_NEAR);
- primarySize = ca.primarySizeLong();
- backupSize = size - primarySize;
+
+ primarySize = ca.localSizeLong(PEEK_ONHEAP_PRIMARY);
+ backupSize = ca.localSizeLong(PEEK_ONHEAP_BACKUP);
nearSize = ca.nearSize();
+ size = primarySize + backupSize + nearSize;
+
partitions = ca.affinity().partitions();
near = cctx.isNear();
http://git-wip-us.apache.org/repos/asf/ignite/blob/3cd30f06/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAggregatedMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAggregatedMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAggregatedMetrics.java
index 6812274..ccefa67 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAggregatedMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAggregatedMetrics.java
@@ -170,7 +170,7 @@ public class VisorCacheAggregatedMetrics extends VisorDataTransferObject {
minHeapSize = Long.MAX_VALUE;
for (VisorCacheMetrics metric : metrics.values())
- minHeapSize = Math.min(minHeapSize, metric.getKeySize());
+ minHeapSize = Math.min(minHeapSize, metric.getHeapEntriesCount());
}
return minHeapSize;
@@ -184,7 +184,7 @@ public class VisorCacheAggregatedMetrics extends VisorDataTransferObject {
avgHeapSize = 0.0d;
for (VisorCacheMetrics metric : metrics.values())
- avgHeapSize += metric.getKeySize();
+ avgHeapSize += metric.getHeapEntriesCount();
avgHeapSize /= metrics.size();
}
@@ -200,7 +200,7 @@ public class VisorCacheAggregatedMetrics extends VisorDataTransferObject {
maxHeapSize = Long.MIN_VALUE;
for (VisorCacheMetrics metric : metrics.values())
- maxHeapSize = Math.max(maxHeapSize, metric.getKeySize());
+ maxHeapSize = Math.max(maxHeapSize, metric.getHeapEntriesCount());
}
return maxHeapSize;
http://git-wip-us.apache.org/repos/asf/ignite/blob/3cd30f06/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
index e67f5f8..d99e0c9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
@@ -166,6 +166,9 @@ public class VisorCacheMetrics extends VisorDataTransferObject {
/** Number of cache entries stored in off-heap memory. */
private long offHeapEntriesCnt;
+ /** Number of primary cache entries stored in off-heap memory. */
+ private long offHeapPrimaryEntriesCnt;
+
/** Total number of partitions on current node. */
private int totalPartsCnt;
@@ -265,6 +268,7 @@ public class VisorCacheMetrics extends VisorDataTransferObject {
heapEntriesCnt = m.getHeapEntriesCount();
offHeapAllocatedSize = m.getOffHeapAllocatedSize();
offHeapEntriesCnt = m.getOffHeapEntriesCount();
+ offHeapPrimaryEntriesCnt = m.getOffHeapPrimaryEntriesCount();
totalPartsCnt = m.getTotalPartitionsCount();
rebalancingPartsCnt = m.getRebalancingPartitionsCount();
@@ -586,6 +590,20 @@ public class VisorCacheMetrics extends VisorDataTransferObject {
}
/**
+ * @return Number of primary cache entries stored in off-heap memory.
+ */
+ public long getOffHeapPrimaryEntriesCount() {
+ return offHeapPrimaryEntriesCnt;
+ }
+
+ /**
+ * @return Number of backup cache entries stored in off-heap memory.
+ */
+ public long getOffHeapBackupEntriesCount() {
+ return offHeapEntriesCnt - offHeapPrimaryEntriesCnt;
+ }
+
+ /**
* @return Total number of partitions on current node.
*/
public int getTotalPartitionsCount() {
@@ -621,6 +639,11 @@ public class VisorCacheMetrics extends VisorDataTransferObject {
}
/** {@inheritDoc} */
+ @Override public byte getProtocolVersion() {
+ return V2;
+ }
+
+ /** {@inheritDoc} */
@Override protected void writeExternalData(ObjectOutput out) throws IOException {
U.writeString(out, name);
U.writeEnum(out, mode);
@@ -675,6 +698,8 @@ public class VisorCacheMetrics extends VisorDataTransferObject {
out.writeLong(rebalancingBytesRate);
out.writeObject(qryMetrics);
+
+ out.writeLong(offHeapPrimaryEntriesCnt);
}
/** {@inheritDoc} */
@@ -731,6 +756,9 @@ public class VisorCacheMetrics extends VisorDataTransferObject {
rebalancingBytesRate = in.readLong();
qryMetrics = (VisorQueryMetrics)in.readObject();
+
+ if (protoVer >= V2)
+ offHeapPrimaryEntriesCnt = in.readLong();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/3cd30f06/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java
index 8193db6..c6cdd5c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java
@@ -54,7 +54,7 @@ public class VisorMemoryMetrics extends VisorDataTransferObject {
private long dirtyPages;
/** */
- private float pageReplaceRate;
+ private float pagesReplaceRate;
/** */
private long physicalMemoryPages;
@@ -77,7 +77,7 @@ public class VisorMemoryMetrics extends VisorDataTransferObject {
largeEntriesPagesPercentage = m.getLargeEntriesPagesPercentage();
pagesFillFactor = m.getPagesFillFactor();
dirtyPages = m.getDirtyPages();
- pageReplaceRate = m.getPagesReplaceRate();
+ pagesReplaceRate = m.getPagesReplaceRate();
physicalMemoryPages = m.getPhysicalMemoryPages();
}
@@ -134,7 +134,7 @@ public class VisorMemoryMetrics extends VisorDataTransferObject {
* @return Pages per second replace rate.
*/
public float getPagesReplaceRate() {
- return pageReplaceRate;
+ return pagesReplaceRate;
}
/**
@@ -153,7 +153,7 @@ public class VisorMemoryMetrics extends VisorDataTransferObject {
out.writeFloat(largeEntriesPagesPercentage);
out.writeFloat(pagesFillFactor);
out.writeLong(dirtyPages);
- out.writeFloat(pageReplaceRate);
+ out.writeFloat(pagesReplaceRate);
out.writeLong(physicalMemoryPages);
}
@@ -166,7 +166,7 @@ public class VisorMemoryMetrics extends VisorDataTransferObject {
largeEntriesPagesPercentage = in.readFloat();
pagesFillFactor = in.readFloat();
dirtyPages = in.readLong();
- pageReplaceRate = in.readFloat();
+ pagesReplaceRate = in.readFloat();
physicalMemoryPages = in.readLong();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/3cd30f06/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
index 4f8d15e..ced3124 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
@@ -81,11 +81,6 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject {
emptyPagesPoolSize = plc.getEmptyPagesPoolSize();
}
- /** {@inheritDoc} */
- @Override public byte getProtocolVersion() {
- return V2;
- }
-
/**
* Unique name of MemoryPolicy.
*/
@@ -136,6 +131,11 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject {
}
/** {@inheritDoc} */
+ @Override public byte getProtocolVersion() {
+ return V2;
+ }
+
+ /** {@inheritDoc} */
@Override protected void writeExternalData(ObjectOutput out) throws IOException {
U.writeString(out, name);
out.writeLong(maxSize);
http://git-wip-us.apache.org/repos/asf/ignite/blob/3cd30f06/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index 93382d7..1528040 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -408,20 +408,24 @@ org.apache.ignite.internal.processors.cache.CacheWeakQueryIteratorsHolder$WeakQu
org.apache.ignite.internal.processors.cache.CacheWeakQueryIteratorsHolder$WeakQueryFutureIterator
org.apache.ignite.internal.processors.cache.CacheWeakQueryIteratorsHolder$WeakReferenceCloseableIterator
org.apache.ignite.internal.processors.cache.ChangeGlobalStateMessage
+org.apache.ignite.internal.processors.cache.ClientCacheChangeDiscoveryMessage
+org.apache.ignite.internal.processors.cache.ClientCacheChangeDummyDiscoveryMessage
org.apache.ignite.internal.processors.cache.ClusterCachesInfo$1$1
org.apache.ignite.internal.processors.cache.ClusterState
org.apache.ignite.internal.processors.cache.DynamicCacheChangeBatch
org.apache.ignite.internal.processors.cache.DynamicCacheChangeRequest
org.apache.ignite.internal.processors.cache.EntryProcessorResourceInjectorProxy
+org.apache.ignite.internal.processors.cache.ExchangeActions$1
+org.apache.ignite.internal.processors.cache.ExchangeActions$2
org.apache.ignite.internal.processors.cache.GridCacheAdapter
org.apache.ignite.internal.processors.cache.GridCacheAdapter$10
org.apache.ignite.internal.processors.cache.GridCacheAdapter$11
org.apache.ignite.internal.processors.cache.GridCacheAdapter$12
org.apache.ignite.internal.processors.cache.GridCacheAdapter$13
org.apache.ignite.internal.processors.cache.GridCacheAdapter$14
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$15
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$15$1
org.apache.ignite.internal.processors.cache.GridCacheAdapter$16
-org.apache.ignite.internal.processors.cache.GridCacheAdapter$17$1
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$17
org.apache.ignite.internal.processors.cache.GridCacheAdapter$2
org.apache.ignite.internal.processors.cache.GridCacheAdapter$25$1
org.apache.ignite.internal.processors.cache.GridCacheAdapter$27
@@ -489,7 +493,6 @@ org.apache.ignite.internal.processors.cache.GridCacheIdMessage
org.apache.ignite.internal.processors.cache.GridCacheIndexUpdateException
org.apache.ignite.internal.processors.cache.GridCacheIoManager$1$1
org.apache.ignite.internal.processors.cache.GridCacheIoManager$1$2
-org.apache.ignite.internal.processors.cache.GridCacheIoManager$2
org.apache.ignite.internal.processors.cache.GridCacheIterator
org.apache.ignite.internal.processors.cache.GridCacheLoaderWriterStore
org.apache.ignite.internal.processors.cache.GridCacheLoaderWriterStoreFactory
@@ -513,10 +516,10 @@ org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$7
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeFutureSet
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$MessageHandler
org.apache.ignite.internal.processors.cache.GridCacheProcessor$1
-org.apache.ignite.internal.processors.cache.GridCacheProcessor$10
org.apache.ignite.internal.processors.cache.GridCacheProcessor$3
org.apache.ignite.internal.processors.cache.GridCacheProcessor$4
org.apache.ignite.internal.processors.cache.GridCacheProcessor$5
+org.apache.ignite.internal.processors.cache.GridCacheProcessor$7
org.apache.ignite.internal.processors.cache.GridCacheProcessor$8
org.apache.ignite.internal.processors.cache.GridCacheProcessor$9
org.apache.ignite.internal.processors.cache.GridCacheProcessor$LocalAffinityFunction
@@ -556,7 +559,8 @@ org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$3
org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$4
org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$5
org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$6
-org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$8
+org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$7
+org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$9
org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl$1
org.apache.ignite.internal.processors.cache.IgniteCacheProxy
org.apache.ignite.internal.processors.cache.IgniteCacheProxy$1
@@ -758,9 +762,8 @@ org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPar
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$1$1
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$2
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$3
-org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$4
+org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$4$1
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$5$1
-org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$6$1
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap
@@ -883,13 +886,11 @@ org.apache.ignite.internal.processors.cache.persistence.wal.SegmentEofException
org.apache.ignite.internal.processors.cache.persistence.wal.crc.IgniteDataIntegrityViolationException
org.apache.ignite.internal.processors.cache.query.CacheQueryType
org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryFuture$1
-org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryFuture$3
org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryManager$1
org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryManager$2
org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryManager$4
org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryManager$5
org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryManager$6
-org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryManager$7
org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter$1
org.apache.ignite.internal.processors.cache.query.GridCacheQueryAdapter$ScanQueryFallbackClosableIterator
org.apache.ignite.internal.processors.cache.query.GridCacheQueryDetailMetricsAdapter
@@ -1071,39 +1072,22 @@ org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$IsolatedUpda
org.apache.ignite.internal.processors.datastreamer.DataStreamerRequest
org.apache.ignite.internal.processors.datastreamer.DataStreamerResponse
org.apache.ignite.internal.processors.datastreamer.DataStreamerUpdateJob$1
+org.apache.ignite.internal.processors.datastructures.AtomicDataStructureValue
org.apache.ignite.internal.processors.datastructures.DataStructureInfoKey
+org.apache.ignite.internal.processors.datastructures.DataStructureType
org.apache.ignite.internal.processors.datastructures.DataStructuresCacheKey
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$10
org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$11
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$12
org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$13
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$14
org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$15
org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$16
org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$17
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$18
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$19
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$2
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$20
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$21
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$22
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$23
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$24
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$3
org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$4
org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$5
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$6
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$7
org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$8
org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$9
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$AddDataCacheProcessor
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$CacheCollectionInfo
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$CollectionInfo
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$DataStructureInfo
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$DataStructureType
org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$DataStructuresEntryFilter
org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$DataStructuresEntryListener$2
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$QueueInfo
+org.apache.ignite.internal.processors.datastructures.DistributedCollectionMetadata
org.apache.ignite.internal.processors.datastructures.GridCacheAtomicLongImpl
org.apache.ignite.internal.processors.datastructures.GridCacheAtomicLongImpl$AddAndGetProcessor
org.apache.ignite.internal.processors.datastructures.GridCacheAtomicLongImpl$CompareAndSetProcessor
@@ -1148,6 +1132,7 @@ org.apache.ignite.internal.processors.datastructures.GridCacheSetImpl$SumReducer
org.apache.ignite.internal.processors.datastructures.GridCacheSetItemKey
org.apache.ignite.internal.processors.datastructures.GridCacheSetProxy
org.apache.ignite.internal.processors.datastructures.GridSetQueryPredicate
+org.apache.ignite.internal.processors.datastructures.VolatileAtomicDataStructureValue
org.apache.ignite.internal.processors.dr.GridDrType
org.apache.ignite.internal.processors.dr.IgniteDrDataStreamerCacheUpdater
org.apache.ignite.internal.processors.hadoop.HadoopDefaultJobInfo
@@ -1322,7 +1307,6 @@ org.apache.ignite.internal.processors.platform.utils.PlatformFutureUtils$FutureL
org.apache.ignite.internal.processors.platform.utils.PlatformFutureUtils$InternalFutureListenable$1
org.apache.ignite.internal.processors.platform.websession.PlatformDotNetSessionLockProcessor
org.apache.ignite.internal.processors.platform.websession.PlatformDotNetSessionSetAndUnlockProcessor
-org.apache.ignite.internal.processors.query.DynamicTableAffinityKeyMapper
org.apache.ignite.internal.processors.query.GridQueryFieldMetadata
org.apache.ignite.internal.processors.query.GridQueryProcessor$10
org.apache.ignite.internal.processors.query.GridQueryProcessor$4
@@ -1778,6 +1762,7 @@ org.apache.ignite.internal.visor.cache.VisorCacheStopTask
org.apache.ignite.internal.visor.cache.VisorCacheStopTask$VisorCacheStopJob
org.apache.ignite.internal.visor.cache.VisorCacheStopTaskArg
org.apache.ignite.internal.visor.cache.VisorCacheStoreConfiguration
+org.apache.ignite.internal.visor.cache.VisorMemoryMetrics
org.apache.ignite.internal.visor.cache.VisorPartitionMap
org.apache.ignite.internal.visor.compute.VisorComputeCancelSessionsTask
org.apache.ignite.internal.visor.compute.VisorComputeCancelSessionsTask$VisorComputeCancelSessionsJob
@@ -2001,6 +1986,7 @@ org.apache.ignite.spi.collision.priorityqueue.PriorityQueueCollisionSpi$Priority
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi$1
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi$12
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi$13
+org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi$2$1
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi$2$ConnectClosure
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi$2$ConnectClosure$1
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi$2$ConnectClosureNew
http://git-wip-us.apache.org/repos/asf/ignite/blob/3cd30f06/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js b/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js
index a318172..6d30e94 100644
--- a/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js
+++ b/modules/web-console/frontend/app/components/cluster-select/cluster-select.controller.js
@@ -23,33 +23,44 @@ export default ['$scope', 'AgentManager', function($scope, agentMgr) {
ctrl.cluster = null;
ctrl.clusters = [];
- $scope.$watchCollection(() => agentMgr.clusters, (clusters) => {
- if (_.isEmpty(clusters))
- return ctrl.clusters.length = 0;
+ agentMgr.connectionSbj.subscribe({
+ next: ({cluster, clusters}) => {
+ if (_.isEmpty(clusters))
+ return ctrl.clusters.length = 0;
- const removed = _.differenceBy(ctrl.clusters, clusters, 'id');
+ const removed = _.differenceBy(ctrl.clusters, clusters, 'id');
- if (_.nonEmpty(removed))
- _.pullAll(ctrl.clusters, removed);
+ if (_.nonEmpty(removed))
+ _.pullAll(ctrl.clusters, removed);
- const added = _.differenceBy(clusters, ctrl.clusters, 'id');
+ const added = _.differenceBy(clusters, ctrl.clusters, 'id');
- _.forEach(added, (cluster) => {
- ctrl.clusters.push({
- id: cluster.id,
- name: `Cluster ${cluster.id.substring(0, 8).toUpperCase()}`,
- click: () => {
- if (cluster.id === ctrl.cluster.id)
- return;
+ _.forEach(added, (cluster) => {
+ ctrl.clusters.push({
+ id: cluster.id,
+ name: `Cluster ${cluster.id.substring(0, 8).toUpperCase()}`,
+ connected: true,
+ click: () => {
+ if (cluster.id === _.get(ctrl, 'cluster.id'))
+ return;
- agentMgr.saveToStorage(cluster);
+ if (_.get(ctrl, 'cluster.connected')) {
+ agentMgr.saveToStorage(cluster);
- window.open(window.location.href, '_blank');
- }
+ window.open(window.location.href, '_blank');
+ }
+ else
+ ctrl.cluster = _.find(ctrl.clusters, {id: cluster.id});
+ }
+ });
});
- });
- if (_.isNil(ctrl.cluster))
- ctrl.cluster = _.find(ctrl.clusters, {id: agentMgr.cluster.id});
+ const item = _.find(ctrl.clusters, {id: cluster.id});
+
+ if (_.isNil(ctrl.cluster))
+ ctrl.cluster = item;
+ else
+ ctrl.cluster.connected = !!item;
+ }
});
}];
http://git-wip-us.apache.org/repos/asf/ignite/blob/3cd30f06/modules/web-console/frontend/app/components/cluster-select/cluster-select.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/cluster-select/cluster-select.pug b/modules/web-console/frontend/app/components/cluster-select/cluster-select.pug
index a5fd08c..bb81415 100644
--- a/modules/web-console/frontend/app/components/cluster-select/cluster-select.pug
+++ b/modules/web-console/frontend/app/components/cluster-select/cluster-select.pug
@@ -14,22 +14,26 @@
See the License for the specific language governing permissions and
limitations under the License.
-ul.nav(ng-switch='ctrl.clusters.length')
- li.disabled(ng-switch-when='0')
- a
+ul.nav
+ li.disabled(ng-if='ctrl.clusters.length === 0')
+ a(ng-if='!ctrl.cluster')
i.icon-cluster
label.padding-left-dflt(bs-tooltip='' data-placement='bottom' data-title='Check that Web Agent(s) started and connected to cluster(s)') No clusters available
+ a(ng-if='ctrl.cluster')
+ i.icon-danger
+ label.padding-left-dflt(bs-tooltip='' data-placement='bottom' data-title='Connection to cluster was lost') {{ctrl.cluster.name}}
- li.disabled(ng-switch-when='1')
+ li(ng-if='ctrl.clusters.length === 1 && ctrl.cluster.connected')
a
i.icon-cluster
label.padding-left-dflt {{ctrl.cluster.name}}
- li(ng-switch-default)
+ li(ng-if='ctrl.clusters.length > 1 || ctrl.clusters.length === 1 && !ctrl.cluster.connected')
a.dropdown-toggle(bs-dropdown='' data-placement='bottom-left' data-trigger='hover focus' data-container='self' ng-click='$event.stopPropagation()' aria-haspopup='true' aria-expanded='expanded')
- i.icon-cluster
+ i(ng-class='{"icon-cluster": ctrl.cluster.connected, "icon-danger": !ctrl.cluster.connected}')
label.padding-left-dflt {{ctrl.cluster.name}}
span.caret
+
ul.dropdown-menu(role='menu')
li(ng-repeat='item in ctrl.clusters' ng-class='{active: ctrl.cluster === item}')
div(ng-click='item.click()')
http://git-wip-us.apache.org/repos/asf/ignite/blob/3cd30f06/modules/web-console/frontend/app/modules/agent/AgentManager.service.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/agent/AgentManager.service.js b/modules/web-console/frontend/app/modules/agent/AgentManager.service.js
index eb4ebfc..3873567 100644
--- a/modules/web-console/frontend/app/modules/agent/AgentManager.service.js
+++ b/modules/web-console/frontend/app/modules/agent/AgentManager.service.js
@@ -20,12 +20,56 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import maskNull from 'app/core/utils/maskNull';
const State = {
- INIT: 'INIT',
+ DISCONNECTED: 'DISCONNECTED',
AGENT_DISCONNECTED: 'AGENT_DISCONNECTED',
CLUSTER_DISCONNECTED: 'CLUSTER_DISCONNECTED',
CONNECTED: 'CONNECTED'
};
+class ConnectionState {
+ constructor(cluster) {
+ this.agents = [];
+ this.cluster = cluster;
+ this.clusters = [];
+ this.state = State.DISCONNECTED;
+ }
+
+ update(demo, count, clusters) {
+ this.clusters = clusters;
+
+ if (_.isNil(this.cluster))
+ this.cluster = _.head(clusters);
+
+ if (_.nonNil(this.cluster))
+ this.cluster.connected = !!_.find(clusters, {id: this.cluster.id});
+
+ if (count === 0)
+ this.state = State.AGENT_DISCONNECTED;
+ else if (demo || _.get(this.cluster, 'connected'))
+ this.state = State.CONNECTED;
+ else
+ this.state = State.CLUSTER_DISCONNECTED;
+ }
+
+ useConnectedCluster() {
+ if (_.nonEmpty(this.clusters) && !this.cluster.connected) {
+ this.cluster = _.head(this.clusters);
+
+ this.state = State.CONNECTED;
+ }
+ }
+
+ disconnect() {
+ this.agents = [];
+
+ if (this.cluster)
+ this.cluster.disconnect = true;
+
+ this.clusters = [];
+ this.state = State.DISCONNECTED;
+ }
+}
+
export default class IgniteAgentManager {
static $inject = ['$rootScope', '$q', 'igniteSocketFactory', 'AgentModal', 'UserNotifications'];
@@ -48,34 +92,41 @@ export default class IgniteAgentManager {
$root.$on('$stateChangeSuccess', () => this.stopWatch());
- this.ignite2x = true;
- this.ignite2_1 = true;
-
- if (!$root.IgniteDemoMode) {
- $root.$watch(() => _.get(this, 'cluster.clusterVersion'), (ver) => {
- if (_.isEmpty(ver))
- return;
-
- this.ignite2x = ver.startsWith('2.');
- this.ignite2_1 = ver.startsWith('2.1');
- }, true);
- }
-
/**
* Connection to backend.
* @type {Socket}
*/
this.socket = null;
- this.connectionState = new BehaviorSubject(State.INIT);
+ let cluster;
- /**
- * Has agent with enabled demo mode.
- * @type {boolean}
- */
- this.hasDemo = false;
+ try {
+ cluster = JSON.parse(localStorage.cluster);
- this.clusters = [];
+ localStorage.removeItem('cluster');
+ }
+ catch (ignore) {
+ // No-op.
+ }
+
+ this.connectionSbj = new BehaviorSubject(new ConnectionState(cluster));
+
+ this.ignite2x = true;
+ this.ignite2_1 = true;
+
+ if (!$root.IgniteDemoMode) {
+ this.connectionSbj.subscribe({
+ next: ({cluster}) => {
+ const version = _.get(cluster, 'clusterVersion');
+
+ if (_.isEmpty(version))
+ return;
+
+ this.ignite2x = version.startsWith('2.');
+ this.ignite2_1 = version.startsWith('2.1');
+ }
+ });
+ }
}
connect() {
@@ -87,59 +138,28 @@ export default class IgniteAgentManager {
self.socket = self.socketFactory();
const onDisconnect = () => {
- self.connected = false;
+ const conn = self.connectionSbj.getValue();
+
+ conn.disconnect();
+
+ self.connectionSbj.next(conn);
};
self.socket.on('connect_error', onDisconnect);
self.socket.on('disconnect', onDisconnect);
- self.connected = null;
+ self.socket.on('agents:stat', ({clusters, count}) => {
+ const conn = self.connectionSbj.getValue();
- try {
- self.cluster = JSON.parse(localStorage.cluster);
+ conn.update(self.$root.IgniteDemoMode, count, clusters);
- localStorage.removeItem('cluster');
- }
- catch (ignore) {
- // No-op.
- }
-
- self.socket.on('agents:stat', ({count, hasDemo, clusters}) => {
- self.hasDemo = hasDemo;
-
- const removed = _.differenceBy(self.clusters, clusters, 'id');
-
- if (_.nonEmpty(removed)) {
- _.pullAll(self.clusters, removed);
-
- if (self.cluster && _.find(removed, {id: self.cluster.id}))
- self.cluster.disconnect = true;
- }
-
- const added = _.differenceBy(clusters, self.clusters, 'id');
-
- if (_.nonEmpty(added)) {
- self.clusters.push(...added);
-
- if (_.isNil(self.cluster))
- self.cluster = _.head(added);
-
- if (self.cluster && _.find(added, {id: self.cluster.id}))
- self.cluster.disconnect = false;
- }
-
- if (count === 0)
- self.connectionState.next(State.AGENT_DISCONNECTED);
- else if (self.$root.IgniteDemoMode || _.get(self.cluster, 'disconnect') === false)
- self.connectionState.next(State.CONNECTED);
- else
- self.connectionState.next(State.CLUSTER_DISCONNECTED);
+ self.connectionSbj.next(conn);
});
self.socket.on('user:notifications', (notification) => this.UserNotifications.notification = notification);
}
- saveToStorage(cluster = this.cluster) {
+ saveToStorage(cluster = this.connectionSbj.getValue().cluster) {
try {
localStorage.cluster = JSON.stringify(cluster);
} catch (ignore) {
@@ -156,8 +176,8 @@ export default class IgniteAgentManager {
this.promises.add(defer);
- const subscription = this.connectionState.subscribe({
- next: (state) => {
+ const subscription = this.connectionSbj.subscribe({
+ next: ({state}) => {
if (_.includes(states, state))
defer.resolve();
}
@@ -190,14 +210,14 @@ export default class IgniteAgentManager {
self.backText = backText;
self.backState = backState;
- if (_.nonEmpty(self.clusters) && _.get(self.cluster, 'disconnect') === true) {
- self.cluster = _.head(self.clusters);
+ const conn = self.connectionSbj.getValue();
- self.connectionState.next(State.CONNECTED);
- }
+ conn.useConnectedCluster();
- self.modalSubscription = this.connectionState.subscribe({
- next: (state) => {
+ self.connectionSbj.next(conn);
+
+ self.modalSubscription = this.connectionSbj.subscribe({
+ next: ({state}) => {
switch (state) {
case State.CONNECTED:
case State.CLUSTER_DISCONNECTED:
@@ -211,7 +231,7 @@ export default class IgniteAgentManager {
break;
default:
- // Connection to backend is not established yet.
+ // Connection to backend is not established yet.
}
}
});
@@ -230,14 +250,14 @@ export default class IgniteAgentManager {
self.backText = backText;
self.backState = backState;
- if (_.nonEmpty(self.clusters) && _.get(self.cluster, 'disconnect') === true) {
- self.cluster = _.head(self.clusters);
+ const conn = self.connectionSbj.getValue();
- self.connectionState.next(State.CONNECTED);
- }
+ conn.useConnectedCluster();
+
+ self.connectionSbj.next(conn);
- self.modalSubscription = this.connectionState.subscribe({
- next: (state) => {
+ self.modalSubscription = this.connectionSbj.subscribe({
+ next: ({state}) => {
switch (state) {
case State.CONNECTED:
this.AgentModal.hide();
http://git-wip-us.apache.org/repos/asf/ignite/blob/3cd30f06/modules/web-console/frontend/app/modules/cluster/Cache.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/cluster/Cache.js b/modules/web-console/frontend/app/modules/cluster/Cache.js
index 62c0512..c5b1d00 100644
--- a/modules/web-console/frontend/app/modules/cluster/Cache.js
+++ b/modules/web-console/frontend/app/modules/cluster/Cache.js
@@ -25,27 +25,20 @@ export default class Cache {
// Mode.
this.mode = cache.mode;
- // Memory Usage.
- this.memorySize = cache.memorySize;
-
// Heap.
this.size = cache.size;
this.primarySize = cache.primarySize;
this.backupSize = _.isNil(cache.backupSize) ? cache.dhtSize - cache.primarySize : cache.backupSize;
this.nearSize = cache.nearSize;
- // Off-heap.
- this.offHeapAllocatedSize = cache.offHeapAllocatedSize;
- this.offHeapSize = cache.offHeapEntriesCount;
- this.offHeapPrimarySize = cache.offHeapPrimaryEntriesCount || 0;
- this.offHeapBackupSize = cache.offHeapBackupEntriesCount || 0;
-
- // Swap.
- this.swapSize = cache.swapSize;
- this.swapKeys = cache.swapKeys;
-
const m = cache.metrics;
+ // Off-heap.
+ this.offHeapAllocatedSize = m.offHeapAllocatedSize;
+ this.offHeapSize = m.offHeapEntriesCount;
+ this.offHeapPrimarySize = m.offHeapPrimaryEntriesCount || 0;
+ this.offHeapBackupSize = this.offHeapSize - this.offHeapPrimarySize;
+
// Read/write metrics.
this.hits = m.hits;
this.misses = m.misses;
http://git-wip-us.apache.org/repos/asf/ignite/blob/3cd30f06/modules/web-console/frontend/app/modules/configuration/Version.service.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/Version.service.js b/modules/web-console/frontend/app/modules/configuration/Version.service.js
index 5b29291..ad8916c 100644
--- a/modules/web-console/frontend/app/modules/configuration/Version.service.js
+++ b/modules/web-console/frontend/app/modules/configuration/Version.service.js
@@ -118,14 +118,15 @@ export default class IgniteVersion {
}
/**
- * @return {String} Target Ignite version.
+ * @return {String} Current Ignite version.
*/
get current() {
return this.currentSbj.getValue().ignite;
}
/**
- * Check if version in range
+ * Check if version in range.
+ *
* @param {String} target Target version.
* @param {String | Array.<String>} ranges Version ranges to compare with.
* @returns {Boolean} `True` if version is equal or greater than specified range.
@@ -147,6 +148,7 @@ export default class IgniteVersion {
/**
* Check whether version before than specified version.
+ *
* @param {String} target Target version.
* @param {String} ranges Version ranges to compare with.
* @return {Boolean} `True` if version before than specified version.
@@ -156,7 +158,8 @@ export default class IgniteVersion {
}
/**
- * Check if configuration version in range
+ * Check if current version in specified range.
+ *
* @param {String|Array.<String>} ranges Version ranges to compare with.
* @returns {Boolean} `True` if configuration version is equal or greater than specified range.
*/
http://git-wip-us.apache.org/repos/asf/ignite/blob/3cd30f06/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js b/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
index f6f6a80..da098fc 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
@@ -32,18 +32,26 @@ export default class IgniteMavenGenerator {
}
addProperty(sb, tag, val) {
- sb.append('<' + tag + '>' + val + '</' + tag + '>');
+ sb.append(`<${tag}>${val}</${tag}>`);
}
addDependency(deps, groupId, artifactId, version, jar) {
- if (!_.find(deps, (dep) => dep.groupId === groupId && dep.artifactId === artifactId))
- deps.push({groupId, artifactId, version, jar});
+ deps.add({groupId, artifactId, version, jar});
+ }
+
+ pickDependency(deps, key, dfltVer) {
+ if (!_.has(POM_DEPENDENCIES, key))
+ return;
+
+ const {groupId, artifactId, version, jar} = POM_DEPENDENCIES[key];
+
+ this.addDependency(deps, groupId || 'org.apache.ignite', artifactId, version || dfltVer, jar);
}
addResource(sb, dir, exclude) {
sb.startBlock('<resource>');
- if (dir)
- this.addProperty(sb, 'directory', dir);
+
+ this.addProperty(sb, 'directory', dir);
if (exclude) {
sb.startBlock('<excludes>');
@@ -54,18 +62,16 @@ export default class IgniteMavenGenerator {
sb.endBlock('</resource>');
}
- artifact(sb, cluster, version) {
+ artifactSection(sb, cluster, targetVer) {
this.addProperty(sb, 'groupId', 'org.apache.ignite');
this.addProperty(sb, 'artifactId', this.escapeId(cluster.name) + '-project');
- this.addProperty(sb, 'version', version);
-
- sb.emptyLine();
+ this.addProperty(sb, 'version', targetVer.ignite);
}
- dependencies(sb, cluster, deps) {
+ dependenciesSection(sb, deps) {
sb.startBlock('<dependencies>');
- _.forEach(deps, (dep) => {
+ deps.forEach((dep) => {
sb.startBlock('<dependency>');
this.addProperty(sb, 'groupId', dep.groupId);
@@ -85,14 +91,16 @@ export default class IgniteMavenGenerator {
return sb;
}
- build(sb = new StringBuilder(), cluster, excludeGroupIds) {
+ buildSection(sb = new StringBuilder(), excludeGroupIds) {
sb.startBlock('<build>');
+
sb.startBlock('<resources>');
this.addResource(sb, 'src/main/java', '**/*.java');
this.addResource(sb, 'src/main/resources');
sb.endBlock('</resources>');
sb.startBlock('<plugins>');
+
sb.startBlock('<plugin>');
this.addProperty(sb, 'artifactId', 'maven-dependency-plugin');
sb.startBlock('<executions>');
@@ -111,6 +119,7 @@ export default class IgniteMavenGenerator {
sb.endBlock('</execution>');
sb.endBlock('</executions>');
sb.endBlock('</plugin>');
+
sb.startBlock('<plugin>');
this.addProperty(sb, 'artifactId', 'maven-compiler-plugin');
this.addProperty(sb, 'version', '3.1');
@@ -119,67 +128,27 @@ export default class IgniteMavenGenerator {
this.addProperty(sb, 'target', '1.7');
sb.endBlock('</configuration>');
sb.endBlock('</plugin>');
+
sb.endBlock('</plugins>');
- sb.endBlock('</build>');
- sb.endBlock('</project>');
+ sb.endBlock('</build>');
}
/**
* Add dependency for specified store factory if not exist.
- * @param storeDeps Already added dependencies.
+ * @param deps Already added dependencies.
* @param storeFactory Store factory to add dependency.
*/
- storeFactoryDependency(storeDeps, storeFactory) {
- if (storeFactory.dialect && (!storeFactory.connectVia || storeFactory.connectVia === 'DataSource')) {
- const dep = POM_DEPENDENCIES[storeFactory.dialect];
-
- this.addDependency(storeDeps, dep.groupId, dep.artifactId, dep.version, dep.jar);
- }
+ storeFactoryDependency(deps, storeFactory) {
+ if (storeFactory.dialect && (!storeFactory.connectVia || storeFactory.connectVia === 'DataSource'))
+ this.pickDependency(deps, storeFactory.dialect);
}
- /**
- * Generate pom.xml.
- *
- * @param {Object} cluster Cluster to take info about dependencies.
- * @param {Object} targetVer Target version for dependencies.
- * @returns {String} Generated content.
- */
- generate(cluster, targetVer) {
- const caches = cluster.caches;
- const deps = [];
- const storeDeps = [];
- const excludeGroupIds = ['org.apache.ignite'];
-
- const blobStoreFactory = {cacheStoreFactory: {kind: 'CacheHibernateBlobStoreFactory'}};
-
+ collectDependencies(cluster, targetVer) {
const igniteVer = targetVer.ignite;
- _.forEach(caches, (cache) => {
- if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind)
- this.storeFactoryDependency(storeDeps, cache.cacheStoreFactory[cache.cacheStoreFactory.kind]);
-
- if (_.get(cache, 'nodeFilter.kind') === 'Exclude')
- this.addDependency(deps, 'org.apache.ignite', 'ignite-extdata-p2p', igniteVer);
- });
-
- const sb = new StringBuilder();
-
- sb.append('<?xml version="1.0" encoding="UTF-8"?>');
-
- sb.emptyLine();
-
- sb.append(`<!-- ${sb.generatedBy()} -->`);
-
- sb.emptyLine();
-
- sb.startBlock('<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">');
-
- sb.append('<modelVersion>4.0.0</modelVersion>');
-
- sb.emptyLine();
-
- this.artifact(sb, cluster, igniteVer);
+ const deps = new Set();
+ const storeDeps = new Set();
this.addDependency(deps, 'org.apache.ignite', 'ignite-core', igniteVer);
@@ -190,10 +159,19 @@ export default class IgniteMavenGenerator {
if (_.get(cluster, 'deploymentSpi.kind') === 'URI')
this.addDependency(deps, 'org.apache.ignite', 'ignite-urideploy', igniteVer);
- let dep = POM_DEPENDENCIES[cluster.discovery.kind];
+ this.pickDependency(deps, cluster.discovery.kind, igniteVer);
+
+ const caches = cluster.caches;
+
+ const blobStoreFactory = {cacheStoreFactory: {kind: 'CacheHibernateBlobStoreFactory'}};
+
+ _.forEach(caches, (cache) => {
+ if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind)
+ this.storeFactoryDependency(storeDeps, cache.cacheStoreFactory[cache.cacheStoreFactory.kind]);
- if (dep)
- this.addDependency(deps, 'org.apache.ignite', dep.artifactId, igniteVer);
+ if (_.get(cache, 'nodeFilter.kind') === 'Exclude')
+ this.addDependency(deps, 'org.apache.ignite', 'ignite-extdata-p2p', igniteVer);
+ });
if (cluster.discovery.kind === 'Jdbc') {
const store = cluster.discovery.Jdbc;
@@ -203,12 +181,8 @@ export default class IgniteMavenGenerator {
}
_.forEach(cluster.checkpointSpi, (spi) => {
- if (spi.kind === 'S3') {
- dep = POM_DEPENDENCIES.S3;
-
- if (dep)
- this.addDependency(deps, 'org.apache.ignite', dep.artifactId, igniteVer);
- }
+ if (spi.kind === 'S3')
+ this.pickDependency(deps, spi.kind, igniteVer);
else if (spi.kind === 'JDBC')
this.storeFactoryDependency(storeDeps, spi.JDBC);
});
@@ -220,18 +194,49 @@ export default class IgniteMavenGenerator {
if (_.find(caches, blobStoreFactory))
this.addDependency(deps, 'org.apache.ignite', 'ignite-hibernate', igniteVer);
- if (cluster.logger && cluster.logger.kind) {
- dep = POM_DEPENDENCIES[cluster.logger.kind];
+ if (cluster.logger && cluster.logger.kind)
+ this.pickDependency(deps, cluster.logger.kind, igniteVer);
- if (dep)
- this.addDependency(deps, 'org.apache.ignite', dep.artifactId, igniteVer);
- }
+ return new Set([...deps, ...storeDeps]);
+ }
+
+ /**
+ * Generate pom.xml.
+ *
+ * @param {Object} cluster Cluster to take info about dependencies.
+ * @param {Object} targetVer Target version for dependencies.
+ * @returns {String} Generated content.
+ */
+ generate(cluster, targetVer) {
+ const sb = new StringBuilder();
+
+ sb.append('<?xml version="1.0" encoding="UTF-8"?>');
+
+ sb.emptyLine();
+
+ sb.append(`<!-- ${sb.generatedBy()} -->`);
+
+ sb.emptyLine();
- this.dependencies(sb, cluster, deps.concat(storeDeps));
+ sb.startBlock('<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">');
+
+ sb.append('<modelVersion>4.0.0</modelVersion>');
+
+ sb.emptyLine();
+
+ this.artifactSection(sb, cluster, targetVer);
sb.emptyLine();
- this.build(sb, cluster, excludeGroupIds);
+ const deps = this.collectDependencies(cluster, targetVer);
+
+ this.dependenciesSection(sb, deps);
+
+ sb.emptyLine();
+
+ this.buildSection(sb, ['org.apache.ignite']);
+
+ sb.endBlock('</project>');
return sb.asString();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/3cd30f06/modules/web-console/frontend/views/templates/agent-download.tpl.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/views/templates/agent-download.tpl.pug b/modules/web-console/frontend/views/templates/agent-download.tpl.pug
index baf2c6c..0aec7e5 100644
--- a/modules/web-console/frontend/views/templates/agent-download.tpl.pug
+++ b/modules/web-console/frontend/views/templates/agent-download.tpl.pug
@@ -24,11 +24,10 @@
button.close(type='button' aria-label='Close' ng-click='$hide()')
svg(ignite-icon="cross")
.modal-body.agent-download
- p Please download and run #[a(href='/api/v1/downloads/agent' target='_self') ignite-web-agent] to use this functionality
- p To start:
- ul
- li Download and unzip #[a(href='/api/v1/downloads/agent' target='_self') ignite-web-agent] archive
- li Run shell file #[b ignite-web-agent.{sh|bat}]
+ p Please download and run #[a(href='/api/v1/downloads/agent' target='_self') ignite-web-agent] to use this functionality:
+ ul
+ li Download and unzip #[a(href='/api/v1/downloads/agent' target='_self') ignite-web-agent] archive
+ li Run shell file #[b ignite-web-agent.{sh|bat}]
p Refer to #[b README.txt] in the ignite-web-agent folder for more information.
.modal-advanced-options
i.fa(ng-class='showToken ? "fa-chevron-circle-down" : "fa-chevron-circle-right"' ng-click='showToken = !showToken')
[18/26] ignite git commit: IGNITE-5279 Name case sensitivity tests
for CREATE INDEX and CREATE TABLE.
Posted by sb...@apache.org.
IGNITE-5279 Name case sensitivity tests for CREATE INDEX and CREATE TABLE.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/eec0fcf3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/eec0fcf3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/eec0fcf3
Branch: refs/heads/ignite-2.1.2-exchange
Commit: eec0fcf313c6631b44098e203365e7f5cfd34d54
Parents: d2b4759
Author: Alexander Paschenko <al...@gmail.com>
Authored: Tue Jun 27 17:53:55 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 27 17:53:55 2017 +0300
----------------------------------------------------------------------
.../DynamicIndexAbstractBasicSelfTest.java | 81 ++++++++-
.../cache/index/H2DynamicTableSelfTest.java | 182 +++++++++++++++----
2 files changed, 222 insertions(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/eec0fcf3/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
index 0b6b0ca..1c6ced1 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
@@ -17,6 +17,11 @@
package org.apache.ignite.internal.processors.cache.index;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.Callable;
+import javax.cache.CacheException;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.Ignition;
@@ -32,11 +37,7 @@ import org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode;
import org.apache.ignite.internal.processors.query.IgniteSQLException;
import org.apache.ignite.internal.processors.query.schema.SchemaOperationException;
import org.apache.ignite.internal.util.typedef.F;
-
-import javax.cache.CacheException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
+import org.apache.ignite.testframework.GridTestUtils;
import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
@@ -912,6 +913,76 @@ public abstract class DynamicIndexAbstractBasicSelfTest extends DynamicIndexAbst
}
/**
+ * Test behavior depending on index name case sensitivity.
+ */
+ public void testIndexNameCaseSensitivity() throws Exception {
+ doTestIndexNameCaseSensitivity("myIdx", false);
+
+ doTestIndexNameCaseSensitivity("myIdx", true);
+ }
+
+ /**
+ * Perform a check on given index name considering case sensitivity.
+ * @param idxName Index name to check.
+ * @param sensitive Whether index should be created w/case sensitive name or not.
+ */
+ private void doTestIndexNameCaseSensitivity(String idxName, boolean sensitive) throws Exception {
+ String idxNameSql = (sensitive ? '"' + idxName + '"' : idxName);
+
+ // This one should always work.
+ assertIndexNameIsValid(idxNameSql, idxNameSql);
+
+ if (sensitive) {
+ assertIndexNameIsNotValid(idxNameSql, idxName.toUpperCase());
+
+ assertIndexNameIsNotValid(idxNameSql, idxName.toLowerCase());
+ }
+ else {
+ assertIndexNameIsValid(idxNameSql, '"' + idxName.toUpperCase() + '"');
+
+ assertIndexNameIsValid(idxNameSql, idxName.toUpperCase());
+
+ assertIndexNameIsValid(idxNameSql, idxName.toLowerCase());
+ }
+ }
+
+ /**
+ * Check that given variant of index name works for DDL context.
+ * @param idxNameToCreate Name of the index to use in {@code CREATE INDEX}.
+ * @param checkedIdxName Index name to use in actual check.
+ */
+ private void assertIndexNameIsValid(String idxNameToCreate, String checkedIdxName) throws Exception {
+ info("Checking index name variant for validity: " + checkedIdxName);
+
+ final QueryIndex idx = index(idxNameToCreate, field(FIELD_NAME_1));
+
+ dynamicIndexCreate(STATIC_CACHE_NAME, TBL_NAME, idx, true);
+
+ dynamicIndexDrop(STATIC_CACHE_NAME, checkedIdxName, false);
+ }
+
+ /**
+ * Check that given variant of index name works for DDL context.
+ * @param idxNameToCreate Name of the index to use in {@code CREATE INDEX}.
+ * @param checkedIdxName Index name to use in actual check.
+ */
+ private void assertIndexNameIsNotValid(String idxNameToCreate, final String checkedIdxName) throws Exception {
+ info("Checking index name variant for invalidity: " + checkedIdxName);
+
+ final QueryIndex idx = index(idxNameToCreate, field(FIELD_NAME_1));
+
+ dynamicIndexCreate(STATIC_CACHE_NAME, TBL_NAME, idx, true);
+
+ GridTestUtils.assertThrows(null, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ dynamicIndexDrop(STATIC_CACHE_NAME, checkedIdxName, false);
+
+ return null;
+ }
+ }, IgniteSQLException.class, "Index doesn't exist: " + checkedIdxName.toUpperCase());
+ }
+
+ /**
* Get node which should be used to start operations.
*
* @return If failed.
http://git-wip-us.apache.org/repos/asf/ignite/blob/eec0fcf3/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicTableSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicTableSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicTableSelfTest.java
index ca1c937..5975b4e 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicTableSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicTableSelfTest.java
@@ -53,6 +53,7 @@ import org.apache.ignite.internal.processors.query.h2.opt.GridH2Table;
import org.apache.ignite.internal.processors.query.schema.SchemaOperationException;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.testframework.GridTestUtils;
+import org.h2.jdbc.JdbcSQLException;
/**
* Tests for CREATE/DROP TABLE.
@@ -94,8 +95,8 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
- executeDdl("DROP TABLE IF EXISTS PUBLIC.\"Person\"");
- executeDdl("DROP TABLE IF EXISTS PUBLIC.\"City\"");
+ execute("DROP TABLE IF EXISTS PUBLIC.\"Person\"");
+ execute("DROP TABLE IF EXISTS PUBLIC.\"City\"");
super.afterTest();
}
@@ -162,6 +163,115 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
}
/**
+ * Test behavior depending on table name case sensitivity.
+ */
+ public void testTableNameCaseSensitivity() {
+ doTestTableNameCaseSensitivity("Person", false);
+
+ doTestTableNameCaseSensitivity("Person", true);
+ }
+
+ /**
+ * Perform a check on given table name considering case sensitivity.
+ * @param tblName Table name to check.
+ * @param sensitive Whether table should be created w/case sensitive name or not.
+ */
+ private void doTestTableNameCaseSensitivity(String tblName, boolean sensitive) {
+ String tblNameSql = (sensitive ? '"' + tblName + '"' : tblName);
+
+ // This one should always work.
+ assertTableNameIsValid(tblNameSql, tblNameSql);
+
+ if (sensitive) {
+ assertTableNameIsNotValid(tblNameSql, tblName.toUpperCase());
+
+ assertTableNameIsNotValid(tblNameSql, tblName.toLowerCase());
+ }
+ else {
+ assertTableNameIsValid(tblNameSql, '"' + tblName.toUpperCase() + '"');
+
+ assertTableNameIsValid(tblNameSql, tblName.toUpperCase());
+
+ assertTableNameIsValid(tblNameSql, tblName.toLowerCase());
+ }
+ }
+
+ /**
+ * Check that given variant of table name works for DML and DDL contexts, as well as selects.
+ * @param tblNameToCreate Name of the table to use in {@code CREATE TABLE}.
+ * @param checkedTblName Table name to use in actual checks.
+ */
+ private void assertTableNameIsValid(String tblNameToCreate, String checkedTblName) {
+ info("Checking table name variant for validity: " + checkedTblName);
+
+ execute("create table if not exists " + tblNameToCreate + " (id int primary key, name varchar)");
+
+ execute("MERGE INTO " + checkedTblName + " (id, name) values (1, 'A')");
+
+ execute("SELECT * FROM " + checkedTblName);
+
+ execute("DROP TABLE " + checkedTblName);
+ }
+
+ /**
+ * Check that given variant of table name does not work for DML and DDL contexts, as well as selects.
+ * @param tblNameToCreate Name of the table to use in {@code CREATE TABLE}.
+ * @param checkedTblName Table name to use in actual checks.
+ */
+ private void assertTableNameIsNotValid(String tblNameToCreate, String checkedTblName) {
+ info("Checking table name variant for invalidity: " + checkedTblName);
+
+ execute("create table if not exists " + tblNameToCreate + " (id int primary key, name varchar)");
+
+ assertCommandThrowsTableNotFound(checkedTblName.toUpperCase(),
+ "MERGE INTO " + checkedTblName + " (id, name) values (1, 'A')");
+
+ assertCommandThrowsTableNotFound(checkedTblName.toUpperCase(), "SELECT * FROM " + checkedTblName);
+
+ assertDdlCommandThrowsTableNotFound(checkedTblName.toUpperCase(), "DROP TABLE " + checkedTblName);
+ }
+
+ /**
+ * Check that given (non DDL) command throws an exception as expected.
+ * @param checkedTblName Table name to expect in error message.
+ * @param cmd Command to execute.
+ */
+ @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
+ private void assertCommandThrowsTableNotFound(String checkedTblName, final String cmd) {
+ final Throwable e = GridTestUtils.assertThrowsWithCause(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ execute(cmd);
+
+ return null;
+ }
+ }, JdbcSQLException.class);
+
+ GridTestUtils.assertThrows(null, new Callable<Object>() {
+ @SuppressWarnings("ConstantConditions")
+ @Override public Object call() throws Exception {
+ throw (Exception)e.getCause();
+ }
+ }, JdbcSQLException.class, "Table \"" + checkedTblName + "\" not found");
+ }
+
+ /**
+ * Check that given DDL command throws an exception as expected.
+ * @param checkedTblName Table name to expect in error message.
+ * @param cmd Command to execute.
+ */
+ @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
+ private void assertDdlCommandThrowsTableNotFound(String checkedTblName, final String cmd) {
+ GridTestUtils.assertThrows(null, new Callable<Object>() {
+ @SuppressWarnings("ConstantConditions")
+ @Override public Object call() throws Exception {
+ execute(cmd);
+
+ return null;
+ }
+ }, IgniteSQLException.class, "Table doesn't exist: " + checkedTblName);
+ }
+
+ /**
* Test that {@code CREATE TABLE} with given template cache name actually creates new cache,
* H2 table and type descriptor on all nodes, optionally with cache type check.
* @param tplCacheName Template cache name.
@@ -169,7 +279,7 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
* @param mode Expected cache mode, or {@code null} if no check is needed.
*/
private void doTestCreateTable(String tplCacheName, String cacheGrp, CacheMode mode) {
- executeDdl("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar," +
+ execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar," +
" \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) WITH " +
(F.isEmpty(tplCacheName) ? "" : "\"template=" + tplCacheName + "\",") + "\"backups=10,atomicity=atomic\"" +
(F.isEmpty(cacheGrp) ? "" : ",\"cacheGroup=" + cacheGrp + '"'));
@@ -268,11 +378,11 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
* @throws Exception if failed.
*/
public void testCreateTableIfNotExists() throws Exception {
- executeDdl("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar," +
+ execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar," +
" \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) WITH " +
"\"template=cache\"");
- executeDdl("CREATE TABLE IF NOT EXISTS \"Person\" (\"id\" int, \"city\" varchar," +
+ execute("CREATE TABLE IF NOT EXISTS \"Person\" (\"id\" int, \"city\" varchar," +
" \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) WITH " +
"\"template=cache\"");
}
@@ -283,13 +393,13 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
*/
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
public void testCreateExistingTable() throws Exception {
- executeDdl("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar," +
+ execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar," +
" \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) WITH " +
"\"template=cache\"");
GridTestUtils.assertThrows(null, new Callable<Object>() {
@Override public Object call() throws Exception {
- executeDdl("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar" +
+ execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar" +
", \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) WITH " +
"\"template=cache\"");
@@ -303,11 +413,11 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
* @throws Exception if failed.
*/
public void testDropTable() throws Exception {
- executeDdl("CREATE TABLE IF NOT EXISTS \"Person\" (\"id\" int, \"city\" varchar," +
+ execute("CREATE TABLE IF NOT EXISTS \"Person\" (\"id\" int, \"city\" varchar," +
" \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) WITH " +
"\"template=cache\"");
- executeDdl("DROP TABLE \"Person\"");
+ execute("DROP TABLE \"Person\"");
for (int i = 0; i < 4; i++) {
IgniteEx node = grid(i);
@@ -327,7 +437,7 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
* @throws Exception if failed.
*/
public void testDropMissingTableIfExists() throws Exception {
- executeDdl("DROP TABLE IF EXISTS \"City\"");
+ execute("DROP TABLE IF EXISTS \"City\"");
}
/**
@@ -338,7 +448,7 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
public void testDropMissingTable() throws Exception {
GridTestUtils.assertThrows(null, new Callable<Object>() {
@Override public Object call() throws Exception {
- executeDdl("DROP TABLE \"City\"");
+ execute("DROP TABLE \"City\"");
return null;
}
@@ -353,7 +463,7 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
public void testDropNonDynamicTable() throws Exception {
GridTestUtils.assertThrows(null, new Callable<Object>() {
@Override public Object call() throws Exception {
- executeDdl("DROP TABLE PUBLIC.\"Integer\"");
+ execute("DROP TABLE PUBLIC.\"Integer\"");
return null;
}
@@ -367,7 +477,7 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
*/
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
public void testDestroyDynamicSqlCache() throws Exception {
- executeDdl("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar," +
+ execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar," +
" \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) WITH " +
"\"template=cache\"");
@@ -388,7 +498,7 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
*/
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
public void testSqlFlagCompatibilityCheck() throws Exception {
- executeDdl("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar, \"name\" varchar, \"surname\" varchar, " +
+ execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar, \"name\" varchar, \"surname\" varchar, " +
"\"age\" int, PRIMARY KEY (\"id\", \"city\")) WITH \"template=cache\"");
GridTestUtils.assertThrows(null, new Callable<Object>() {
@@ -409,9 +519,9 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
*/
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
public void testIndexNameConflictCheckDiscovery() throws Exception {
- executeDdl(grid(0), "CREATE TABLE \"Person\" (id int primary key, name varchar)");
+ execute(grid(0), "CREATE TABLE \"Person\" (id int primary key, name varchar)");
- executeDdl(grid(0), "CREATE INDEX \"idx\" ON \"Person\" (\"name\")");
+ execute(grid(0), "CREATE INDEX \"idx\" ON \"Person\" (\"name\")");
GridTestUtils.assertThrows(null, new Callable<Object>() {
@Override public Object call() throws Exception {
@@ -438,11 +548,11 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
*/
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
public void testTableNameConflictCheckSql() throws Exception {
- executeDdl(grid(0), "CREATE TABLE \"Person\" (id int primary key, name varchar)");
+ execute(grid(0), "CREATE TABLE \"Person\" (id int primary key, name varchar)");
GridTestUtils.assertThrows(null, new Callable<Object>() {
@Override public Object call() throws Exception {
- executeDdl(client(), "CREATE TABLE \"Person\" (id int primary key, name varchar)");
+ execute(client(), "CREATE TABLE \"Person\" (id int primary key, name varchar)");
return null;
}
@@ -453,18 +563,18 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
* @throws Exception if failed.
*/
public void testAffinityKey() throws Exception {
- executeDdl("CREATE TABLE \"City\" (\"name\" varchar primary key, \"code\" int) WITH \"affinityKey='name'\"");
+ execute("CREATE TABLE \"City\" (\"name\" varchar primary key, \"code\" int) WITH \"affinityKey='name'\"");
assertAffinityCacheConfiguration("City", "name");
- executeDdl("INSERT INTO \"City\" (\"name\", \"code\") values ('A', 1), ('B', 2), ('C', 3)");
+ execute("INSERT INTO \"City\" (\"name\", \"code\") values ('A', 1), ('B', 2), ('C', 3)");
List<String> cityNames = Arrays.asList("A", "B", "C");
List<Integer> cityCodes = Arrays.asList(1, 2, 3);
// We need unique name for this table to avoid conflicts with existing binary metadata.
- executeDdl("CREATE TABLE \"Person2\" (\"id\" int, \"city\" varchar," +
+ execute("CREATE TABLE \"Person2\" (\"id\" int, \"city\" varchar," +
" \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) WITH " +
"\"template=cache,affinityKey='city'\"");
@@ -511,26 +621,26 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
*/
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
public void testAffinityKeyCaseSensitivity() {
- executeDdl("CREATE TABLE \"A\" (\"name\" varchar primary key, \"code\" int) WITH \"affinityKey='name'\"");
+ execute("CREATE TABLE \"A\" (\"name\" varchar primary key, \"code\" int) WITH \"affinityKey='name'\"");
assertAffinityCacheConfiguration("A", "name");
- executeDdl("CREATE TABLE \"B\" (name varchar primary key, \"code\" int) WITH \"affinityKey=name\"");
+ execute("CREATE TABLE \"B\" (name varchar primary key, \"code\" int) WITH \"affinityKey=name\"");
assertAffinityCacheConfiguration("B", "NAME");
- executeDdl("CREATE TABLE \"C\" (name varchar primary key, \"code\" int) WITH \"affinityKey=NamE\"");
+ execute("CREATE TABLE \"C\" (name varchar primary key, \"code\" int) WITH \"affinityKey=NamE\"");
assertAffinityCacheConfiguration("C", "NAME");
- executeDdl("CREATE TABLE \"D\" (\"name\" varchar primary key, \"code\" int) WITH \"affinityKey=NAME\"");
+ execute("CREATE TABLE \"D\" (\"name\" varchar primary key, \"code\" int) WITH \"affinityKey=NAME\"");
assertAffinityCacheConfiguration("D", "name");
// Error arises because user has specified case sensitive affinity column name
GridTestUtils.assertThrows(null, new Callable<Object>() {
@Override public Object call() throws Exception {
- executeDdl("CREATE TABLE \"E\" (name varchar primary key, \"code\" int) WITH \"affinityKey='Name'\"");
+ execute("CREATE TABLE \"E\" (name varchar primary key, \"code\" int) WITH \"affinityKey='Name'\"");
return null;
}
@@ -540,14 +650,14 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
// columns whose names are equal in ignore case.
GridTestUtils.assertThrows(null, new Callable<Object>() {
@Override public Object call() throws Exception {
- executeDdl("CREATE TABLE \"E\" (\"name\" varchar, \"Name\" int, val int, primary key(\"name\", " +
+ execute("CREATE TABLE \"E\" (\"name\" varchar, \"Name\" int, val int, primary key(\"name\", " +
"\"Name\")) WITH \"affinityKey=name\"");
return null;
}
}, IgniteSQLException.class, "Ambiguous affinity column name, use single quotes for case sensitivity: name");
- executeDdl("CREATE TABLE \"E\" (\"name\" varchar, \"Name\" int, val int, primary key(\"name\", " +
+ execute("CREATE TABLE \"E\" (\"name\" varchar, \"Name\" int, val int, primary key(\"name\", " +
"\"Name\")) WITH \"affinityKey='Name'\"");
assertAffinityCacheConfiguration("E", "Name");
@@ -561,7 +671,7 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
// Error arises because user has specified case sensitive affinity column name
GridTestUtils.assertThrows(null, new Callable<Object>() {
@Override public Object call() throws Exception {
- executeDdl("CREATE TABLE \"E\" (name varchar primary key, \"code\" int) WITH \"affinityKey=code\"");
+ execute("CREATE TABLE \"E\" (name varchar primary key, \"code\" int) WITH \"affinityKey=code\"");
return null;
}
@@ -576,7 +686,7 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
// Error arises because user has specified case sensitive affinity column name
GridTestUtils.assertThrows(null, new Callable<Object>() {
@Override public Object call() throws Exception {
- executeDdl("CREATE TABLE \"E\" (name varchar primary key, \"code\" int) WITH \"affinityKey=missing\"");
+ execute("CREATE TABLE \"E\" (name varchar primary key, \"code\" int) WITH \"affinityKey=missing\"");
return null;
}
@@ -615,7 +725,7 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
* @param params Engine parameters.
*/
private void createTableWithParams(final String params) {
- executeDdl("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar" +
+ execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar" +
", \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) WITH " +
"\"template=cache," + params + '"');
}
@@ -629,7 +739,7 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
public void testCreateTableInNonPublicSchema() throws Exception {
GridTestUtils.assertThrows(null, new Callable<Object>() {
@Override public Object call() throws Exception {
- executeDdl("CREATE TABLE \"cache_idx\".\"Person\" (\"id\" int, \"city\" varchar," +
+ execute("CREATE TABLE \"cache_idx\".\"Person\" (\"id\" int, \"city\" varchar," +
" \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) WITH " +
"\"template=cache\"");
@@ -663,7 +773,7 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
public void testDropTableNotPublicSchema() throws Exception {
GridTestUtils.assertThrows(null, new Callable<Object>() {
@Override public Object call() throws Exception {
- executeDdl("DROP TABLE \"cache_idx\".\"Person\"");
+ execute("DROP TABLE \"cache_idx\".\"Person\"");
return null;
}
@@ -675,8 +785,8 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
*
* @param sql Statement.
*/
- private void executeDdl(String sql) {
- executeDdl(client(), sql);
+ private void execute(String sql) {
+ execute(client(), sql);
}
/**
@@ -755,7 +865,7 @@ public class H2DynamicTableSelfTest extends AbstractSchemaSelfTest {
* @param node Node.
* @param sql Statement.
*/
- private void executeDdl(Ignite node, String sql) {
+ private void execute(Ignite node, String sql) {
queryProcessor(node).querySqlFieldsNoCache(new SqlFieldsQuery(sql).setSchema("PUBLIC"), true);
}
[09/26] ignite git commit: IGNITE-5588 .NET: Inject resources in
ScanQuery
Posted by sb...@apache.org.
IGNITE-5588 .NET: Inject resources in ScanQuery
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d2b47591
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d2b47591
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d2b47591
Branch: refs/heads/ignite-2.1.2-exchange
Commit: d2b47591319967264d8e0b7364494cc8208c016a
Parents: f0c62ac
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Mon Jun 26 17:40:41 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Mon Jun 26 17:40:41 2017 +0300
----------------------------------------------------------------------
.../Cache/Query/CacheQueriesTest.cs | 7 +++++++
.../Impl/Cache/CacheEntryFilterHolder.cs | 13 +++++++++++++
2 files changed, 20 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d2b47591/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
index 852aa87..ee2806f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
@@ -30,6 +30,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
using Apache.Ignite.Core.Cache.Configuration;
using Apache.Ignite.Core.Cache.Query;
using Apache.Ignite.Core.Common;
+ using Apache.Ignite.Core.Resource;
using NUnit.Framework;
/// <summary>
@@ -956,9 +957,15 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
// Error flag
public bool ThrowErr { get; set; }
+ // Injection test
+ [InstanceResource]
+ public IIgnite Ignite { get; set; }
+
/** <inheritdoc /> */
public bool Invoke(ICacheEntry<int, TV> entry)
{
+ Assert.IsNotNull(Ignite);
+
if (ThrowErr)
throw new Exception(ErrMessage);
http://git-wip-us.apache.org/repos/asf/ignite/blob/d2b47591/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryFilterHolder.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryFilterHolder.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryFilterHolder.cs
index 90db02c..779e350 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryFilterHolder.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheEntryFilterHolder.cs
@@ -24,6 +24,7 @@ namespace Apache.Ignite.Core.Impl.Cache
using Apache.Ignite.Core.Impl.Binary;
using Apache.Ignite.Core.Impl.Binary.IO;
using Apache.Ignite.Core.Impl.Common;
+ using Apache.Ignite.Core.Impl.Resource;
/// <summary>
/// Non-generic binary filter wrapper.
@@ -60,6 +61,8 @@ namespace Apache.Ignite.Core.Impl.Cache
_invoker = invoker;
_marsh = marsh;
_keepBinary = keepBinary;
+
+ InjectResources();
}
/// <summary>
@@ -97,6 +100,16 @@ namespace Apache.Ignite.Core.Impl.Cache
_marsh = reader.Marshaller;
_invoker = GetInvoker(_pred);
+
+ InjectResources();
+ }
+
+ /// <summary>
+ /// Injects the resources.
+ /// </summary>
+ private void InjectResources()
+ {
+ ResourceProcessor.Inject(_pred, _marsh.Ignite);
}
/// <summary>
[22/26] ignite git commit: IGNITE-5599 Added check that node URL is
valid. Added warning about ignite-rest-http.
Posted by sb...@apache.org.
IGNITE-5599 Added check that node URL is valid. Added warning about ignite-rest-http.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/cff23a99
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/cff23a99
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/cff23a99
Branch: refs/heads/ignite-2.1.2-exchange
Commit: cff23a99b655bc353e93fee5b2d87c5f76ff8d7b
Parents: 3cd30f0
Author: vsisko <vs...@gridgain.com>
Authored: Wed Jun 28 12:04:58 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Wed Jun 28 12:04:58 2017 +0700
----------------------------------------------------------------------
.../apache/ignite/console/agent/rest/RestExecutor.java | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/cff23a99/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/rest/RestExecutor.java
----------------------------------------------------------------------
diff --git a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/rest/RestExecutor.java b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/rest/RestExecutor.java
index bfeef58..52d37c4 100644
--- a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/rest/RestExecutor.java
+++ b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/agent/rest/RestExecutor.java
@@ -92,14 +92,18 @@ public class RestExecutor {
AgentClusterDemo.tryStart().await();
}
catch (InterruptedException ignore) {
- throw new IllegalStateException("Failed to execute request because of embedded node for demo mode is not started yet.");
+ throw new IllegalStateException("Failed to send request because of embedded node for demo mode is not started yet.");
}
}
String url = demo ? AgentClusterDemo.getDemoUrl() : nodeUrl;
- HttpUrl.Builder urlBuilder = HttpUrl.parse(url)
- .newBuilder();
+ HttpUrl httpUrl = HttpUrl.parse(url);
+
+ if (httpUrl == null)
+ throw new IllegalStateException("Failed to send request because of node URL is invalid: " + url);
+
+ HttpUrl.Builder urlBuilder = httpUrl.newBuilder();
if (path != null)
urlBuilder.addPathSegment(path);
@@ -167,6 +171,8 @@ public class RestExecutor {
return RestResult.fail(STATUS_FAILED, "Failed connect to node and execute REST command.");
}
catch (ConnectException ignore) {
+ log.warn("Please ensure that nodes have ignite-rest-http module in classpath (was copied from libs/optional to libs folder).");
+
throw new ConnectException("Failed connect to node and execute REST command [url=" + urlBuilder + "]");
}
}
[10/26] ignite git commit: IGNITE-4467 fixed table header scrolling
with content
Posted by sb...@apache.org.
IGNITE-4467 fixed table header scrolling with content
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/caa4f25e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/caa4f25e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/caa4f25e
Branch: refs/heads/ignite-2.1.2-exchange
Commit: caa4f25e989528249f4755cd59c9758dc1c31641
Parents: 8b0f3c1
Author: Dmitriy Shabalin <dm...@gmail.com>
Authored: Tue Jun 27 15:32:13 2017 +0700
Committer: Dmitriy Shabalin <dm...@gmail.com>
Committed: Tue Jun 27 15:32:13 2017 +0700
----------------------------------------------------------------------
.../web-console/frontend/app/primitives/ui-grid/index.scss | 8 --------
1 file changed, 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/caa4f25e/modules/web-console/frontend/app/primitives/ui-grid/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/ui-grid/index.scss b/modules/web-console/frontend/app/primitives/ui-grid/index.scss
index b26036b..8e1da49 100644
--- a/modules/web-console/frontend/app/primitives/ui-grid/index.scss
+++ b/modules/web-console/frontend/app/primitives/ui-grid/index.scss
@@ -45,14 +45,6 @@
border-color: transparent;
}
- .ui-grid-top-panel {
- overflow: visible;
-
- .ui-grid-header-viewport {
- overflow: visible;
- }
- }
-
.ui-grid-cell,
.ui-grid-header-cell {
.ui-grid-cell-contents {
[19/26] ignite git commit: IGNITE-5449 DML+DDL complex test.
Posted by sb...@apache.org.
IGNITE-5449 DML+DDL complex test.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ff151e5f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ff151e5f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ff151e5f
Branch: refs/heads/ignite-2.1.2-exchange
Commit: ff151e5fd1b0d9782b53e88b46fb7aab9dd019a7
Parents: eec0fcf
Author: Alexander Paschenko <al...@gmail.com>
Authored: Tue Jun 27 18:07:00 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 27 18:07:00 2017 +0300
----------------------------------------------------------------------
...exingComplexClientAtomicPartitionedTest.java | 33 ++
...dexingComplexClientAtomicReplicatedTest.java | 33 ++
...mplexClientTransactionalPartitionedTest.java | 33 ++
...omplexClientTransactionalReplicatedTest.java | 33 ++
...exingComplexServerAtomicPartitionedTest.java | 33 ++
...dexingComplexServerAtomicReplicatedTest.java | 33 ++
...mplexServerTransactionalPartitionedTest.java | 33 ++
...omplexServerTransactionalReplicatedTest.java | 33 ++
.../index/H2DynamicIndexingComplexTest.java | 356 +++++++++++++++++++
.../IgniteCacheQuerySelfTestSuite.java | 30 +-
10 files changed, 644 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ff151e5f/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientAtomicPartitionedTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientAtomicPartitionedTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientAtomicPartitionedTest.java
new file mode 100644
index 0000000..78eddbf
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientAtomicPartitionedTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.index;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+
+/**
+ * Test to check work of DML+DDL operations of atomic partitioned cache with queries initiated from client node.
+ */
+public class H2DynamicIndexingComplexClientAtomicPartitionedTest extends H2DynamicIndexingComplexTest {
+ /**
+ * Constructor.
+ */
+ public H2DynamicIndexingComplexClientAtomicPartitionedTest() {
+ super(CacheMode.PARTITIONED, CacheAtomicityMode.ATOMIC, CLIENT_IDX);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/ff151e5f/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientAtomicReplicatedTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientAtomicReplicatedTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientAtomicReplicatedTest.java
new file mode 100644
index 0000000..0e1004c
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientAtomicReplicatedTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.index;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+
+/**
+ * Test to check work of DML+DDL operations of atomic replicated cache with queries initiated from client node.
+ */
+public class H2DynamicIndexingComplexClientAtomicReplicatedTest extends H2DynamicIndexingComplexTest {
+ /**
+ * Constructor.
+ */
+ public H2DynamicIndexingComplexClientAtomicReplicatedTest() {
+ super(CacheMode.REPLICATED, CacheAtomicityMode.ATOMIC, CLIENT_IDX);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/ff151e5f/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientTransactionalPartitionedTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientTransactionalPartitionedTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientTransactionalPartitionedTest.java
new file mode 100644
index 0000000..6dead30
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientTransactionalPartitionedTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.index;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+
+/**
+ * Test to check work of DML+DDL operations of transactional partitioned cache with queries initiated from client node.
+ */
+public class H2DynamicIndexingComplexClientTransactionalPartitionedTest extends H2DynamicIndexingComplexTest {
+ /**
+ * Constructor.
+ */
+ public H2DynamicIndexingComplexClientTransactionalPartitionedTest() {
+ super(CacheMode.PARTITIONED, CacheAtomicityMode.TRANSACTIONAL, CLIENT_IDX);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/ff151e5f/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientTransactionalReplicatedTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientTransactionalReplicatedTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientTransactionalReplicatedTest.java
new file mode 100644
index 0000000..3c73d2c
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexClientTransactionalReplicatedTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.index;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+
+/**
+ * Test to check work of DML+DDL operations of transactional replicated cache with queries initiated from client node.
+ */
+public class H2DynamicIndexingComplexClientTransactionalReplicatedTest extends H2DynamicIndexingComplexTest {
+ /**
+ * Constructor.
+ */
+ public H2DynamicIndexingComplexClientTransactionalReplicatedTest() {
+ super(CacheMode.REPLICATED, CacheAtomicityMode.TRANSACTIONAL, CLIENT_IDX);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/ff151e5f/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerAtomicPartitionedTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerAtomicPartitionedTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerAtomicPartitionedTest.java
new file mode 100644
index 0000000..ff0c1cb
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerAtomicPartitionedTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.index;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+
+/**
+ * Test to check work of DML+DDL operations of atomic partitioned cache with queries initiated from server node.
+ */
+public class H2DynamicIndexingComplexServerAtomicPartitionedTest extends H2DynamicIndexingComplexTest {
+ /**
+ * Constructor.
+ */
+ public H2DynamicIndexingComplexServerAtomicPartitionedTest() {
+ super(CacheMode.PARTITIONED, CacheAtomicityMode.ATOMIC, SRV_IDX);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/ff151e5f/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerAtomicReplicatedTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerAtomicReplicatedTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerAtomicReplicatedTest.java
new file mode 100644
index 0000000..3d7ee18
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerAtomicReplicatedTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.index;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+
+/**
+ * Test to check work of DML+DDL operations of atomic replicated cache with queries initiated from server node.
+ */
+public class H2DynamicIndexingComplexServerAtomicReplicatedTest extends H2DynamicIndexingComplexTest {
+ /**
+ * Constructor.
+ */
+ public H2DynamicIndexingComplexServerAtomicReplicatedTest() {
+ super(CacheMode.REPLICATED, CacheAtomicityMode.ATOMIC, SRV_IDX);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/ff151e5f/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerTransactionalPartitionedTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerTransactionalPartitionedTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerTransactionalPartitionedTest.java
new file mode 100644
index 0000000..aeb3839
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerTransactionalPartitionedTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.index;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+
+/**
+ * Test to check work of DML+DDL operations of transactional partitioned cache with queries initiated from server node.
+ */
+public class H2DynamicIndexingComplexServerTransactionalPartitionedTest extends H2DynamicIndexingComplexTest {
+ /**
+ * Constructor.
+ */
+ public H2DynamicIndexingComplexServerTransactionalPartitionedTest() {
+ super(CacheMode.PARTITIONED, CacheAtomicityMode.TRANSACTIONAL, SRV_IDX);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/ff151e5f/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerTransactionalReplicatedTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerTransactionalReplicatedTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerTransactionalReplicatedTest.java
new file mode 100644
index 0000000..4266161
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexServerTransactionalReplicatedTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.index;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+
+/**
+ * Test to check work of DML+DDL operations of transactional replicated cache with queries initiated from client node.
+ */
+public class H2DynamicIndexingComplexServerTransactionalReplicatedTest extends H2DynamicIndexingComplexTest {
+ /**
+ * Constructor.
+ */
+ public H2DynamicIndexingComplexServerTransactionalReplicatedTest() {
+ super(CacheMode.REPLICATED, CacheAtomicityMode.TRANSACTIONAL, SRV_IDX);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/ff151e5f/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexTest.java
new file mode 100644
index 0000000..0be691e
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2DynamicIndexingComplexTest.java
@@ -0,0 +1,356 @@
+/*
+ * 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.index;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.processors.query.GridQueryTypeDescriptor;
+import org.apache.ignite.internal.processors.query.IgniteSQLException;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteInClosure;
+import org.apache.ignite.testframework.GridTestUtils;
+
+/**
+ * Base class for testing work of combinations of DML and DDL operations.
+ */
+public abstract class H2DynamicIndexingComplexTest extends DynamicIndexAbstractSelfTest {
+ /** Cache mode to test with. */
+ private final CacheMode cacheMode;
+
+ /** Cache atomicity mode to test with. */
+ private final CacheAtomicityMode atomicityMode;
+
+ /** Node index to initiate operations from. */
+ private final int nodeIdx;
+
+ /** Names of companies to use. */
+ private final static List<String> COMPANIES = Arrays.asList("ASF", "GNU", "BSD");
+
+ /** Cities to use. */
+ private final static List<String> CITIES = Arrays.asList("St. Petersburg", "Boston", "Berkeley", "London");
+
+ /** Index of server node. */
+ protected final static int SRV_IDX = 0;
+
+ /** Index of client node. */
+ protected final static int CLIENT_IDX = 1;
+
+ /**
+ * Constructor.
+ * @param cacheMode Cache mode.
+ * @param atomicityMode Cache atomicity mode.
+ * @param nodeIdx Node index.
+ */
+ H2DynamicIndexingComplexTest(CacheMode cacheMode, CacheAtomicityMode atomicityMode, int nodeIdx) {
+ this.cacheMode = cacheMode;
+ this.atomicityMode = atomicityMode;
+ this.nodeIdx = nodeIdx;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ super.beforeTestsStarted();
+
+ Ignition.start(serverConfiguration(0));
+
+ Ignition.start(clientConfiguration(1));
+
+ Ignition.start(serverConfiguration(2));
+
+ Ignition.start(serverConfiguration(3));
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ stopAllGrids();
+
+ super.afterTestsStopped();
+ }
+
+ /** Do test. */
+ @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
+ public void testOperations() {
+ executeSql("CREATE TABLE person (id int, name varchar, age int, company varchar, city varchar, " +
+ "primary key (id, name, city)) WITH \"template=" + cacheMode.name() + ",atomicity=" + atomicityMode.name() +
+ ",affinitykey=city\"");
+
+ executeSql("CREATE INDEX idx on person (city asc, name asc)");
+
+ executeSql("CREATE TABLE city (name varchar, population int, primary key (name)) WITH " +
+ "\"template=" + cacheMode.name() + ",atomicity=" + atomicityMode.name() + ",affinitykey=name\"");
+
+ executeSql("INSERT INTO city (name, population) values(?, ?), (?, ?), (?, ?)",
+ "St. Petersburg", 6000000,
+ "Boston", 2000000,
+ "London", 8000000
+ );
+
+ for (int i = 0; i < 100; i++)
+ executeSql("INSERT INTO person (id, name, age, company, city) values (?, ?, ?, ?, ?)",
+ i,
+ "Person " + i,
+ 20 + (i % 10),
+ COMPANIES.get(i % COMPANIES.size()),
+ CITIES.get(i % CITIES.size()));
+
+ assertAllPersons(new IgniteInClosure<List<?>>() {
+ @Override public void apply(List<?> person) {
+ assertInitPerson(person);
+ }
+ });
+
+ long r = (Long)executeSqlSingle("SELECT COUNT(*) from Person p inner join City c on p.city = c.name");
+
+ // Berkeley is not present in City table, although 25 people have it specified as their city.
+ assertEquals(75L, r);
+
+ executeSqlSingle("UPDATE Person SET company = 'GNU', age = CASE WHEN MOD(id, 2) <> 0 THEN age + 5 ELSE " +
+ "age + 1 END WHERE company = 'ASF'");
+
+ assertAllPersons(new IgniteInClosure<List<?>>() {
+ @Override public void apply(List<?> person) {
+ int id = (Integer)person.get(0);
+
+ if (id % COMPANIES.size() == 0) {
+ int initAge = 20 + id % 10;
+
+ int expAge = (initAge % 2 != 0 ? initAge + 5 : initAge + 1);
+
+ assertPerson(id, "Person " + id, expAge, "GNU", CITIES.get(id % CITIES.size()), person);
+ }
+ else
+ assertInitPerson(person);
+ }
+ });
+
+ executeSql("DROP INDEX idx");
+
+ // Index drop should not affect data.
+ assertAllPersons(new IgniteInClosure<List<?>>() {
+ @Override public void apply(List<?> person) {
+ int id = (Integer)person.get(0);
+
+ if (id % COMPANIES.size() == 0) {
+ int initAge = 20 + id % 10;
+
+ int expAge = initAge % 2 != 0 ? initAge + 5 : initAge + 1;
+
+ assertPerson(id, "Person " + id, expAge, "GNU", CITIES.get(id % CITIES.size()), person);
+ }
+ else
+ assertInitPerson(person);
+ }
+ });
+
+ // Let's drop all BSD folks living in Berkeley and Boston - this compares ASCII codes of 1st symbols.
+ executeSql("DELETE FROM person WHERE ASCII(company) = ASCII(city)");
+
+ assertAllPersons(new IgniteInClosure<List<?>>() {
+ @Override public void apply(List<?> person) {
+ String city = city(person);
+
+ String company = company(person);
+
+ assertFalse(city.charAt(0) == company.charAt(0));
+ }
+ });
+
+ assertNotNull(node().cache("SQL_PUBLIC_PERSON"));
+
+ executeSql("DROP TABLE person");
+
+ assertNull(node().cache("SQL_PUBLIC_PERSON"));
+
+ GridTestUtils.assertThrows(null, new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return executeSql("SELECT * from Person");
+ }
+ }, IgniteSQLException.class, "Failed to parse query: SELECT * from Person");
+ }
+
+ /**
+ * Select all data from the table and check that all records correspond to rules set by given closure.
+ * @param clo Closure to apply to each record.
+ */
+ private void assertAllPersons(IgniteInClosure<List<?>> clo) {
+ List<List<?>> res = executeSql("SELECT * from Person");
+
+ for (List<?> p : res)
+ clo.apply(p);
+ }
+
+ /**
+ * Get person's id from data row.
+ * @param person data row.
+ * @return person's id.
+ */
+ private static int id(List<?> person) {
+ return (Integer)person.get(0);
+ }
+
+ /**
+ * Get person's name from data row.
+ * @param person data row.
+ * @return person's name.
+ */
+ private static String name(List<?> person) {
+ return (String)person.get(1);
+ }
+
+ /**
+ * Get person's age from data row.
+ * @param person data row.
+ * @return person's age.
+ */
+ private static int age(List<?> person) {
+ return (Integer)person.get(2);
+ }
+
+ /**
+ * Get person's company from data row.
+ * @param person data row.
+ * @return person's company.
+ */
+ private static String company(List<?> person) {
+ return (String)person.get(3);
+ }
+
+ /**
+ * Get person's city from data row.
+ * @param person data row.
+ * @return person's city.
+ */
+ private static String city(List<?> person) {
+ return (String)person.get(4);
+ }
+
+ /**
+ * Check that all columns in data row are exactly how they were initially inserted.
+ * @param person data row.
+ */
+ private void assertInitPerson(List<?> person) {
+ assertEquals(5, person.size());
+
+ int id = id(person);
+
+ String name = "Person " + id;
+
+ int age = 20 + id % 10;
+
+ String company = COMPANIES.get(id % COMPANIES.size());
+
+ String city = CITIES.get(id % CITIES.size());
+
+ assertPerson(id, name, age, company, city, person);
+ }
+
+ /**
+ * Check contents of SQL data row and corresponding cache entry.
+ * @param id Expected id.
+ * @param name Expected name.
+ * @param age Expected age.
+ * @param company Expected company.
+ * @param city Expected city.
+ * @param person Data row.
+ */
+ private void assertPerson(int id, String name, int age, String company, String city, List<?> person) {
+ assertEquals(name, name(person));
+
+ assertEquals(age, age(person));
+
+ assertEquals(company, company(person));
+
+ assertEquals(city, city(person));
+
+ String cacheName = "SQL_PUBLIC_PERSON";
+
+ Collection<GridQueryTypeDescriptor> descs = node().context().query().types(cacheName);
+
+ assertEquals(1, descs.size());
+
+ GridQueryTypeDescriptor desc = descs.iterator().next();
+
+ String keyType = desc.keyTypeName();
+
+ String valType = desc.valueTypeName();
+
+ BinaryObject k = node().binary().builder(keyType)
+ .setField("id", id)
+ .setField("name", name)
+ .setField("city", city).build();
+
+ Object v = node().cache(cacheName).withKeepBinary().get(k);
+
+ assertNotNull(v);
+
+ BinaryObject expVal = node().binary().builder(valType)
+ .setField("age", age)
+ .setField("company", company).build();
+
+ assertEquals(expVal, v);
+ }
+
+ /**
+ * Run SQL statement on specified node.
+ * @param stmt Statement to run.
+ * @return Run result.
+ */
+ private List<List<?>> executeSql(IgniteEx node, String stmt, Object... args) {
+ return node.context().query().querySqlFieldsNoCache(new SqlFieldsQuery(stmt).setArgs(args), true).getAll();
+ }
+
+ /**
+ * Run SQL statement on default node.
+ * @param stmt Statement to run.
+ * @return Run result.
+ */
+ private List<List<?>> executeSql(String stmt, Object... args) {
+ return executeSql(node(), stmt, args);
+ }
+
+ /**
+ * Run SQL statement that is expected to return strictly one value (like COUNT(*)).
+ * @param stmt Statement to run.
+ * @return Run result.
+ */
+ private Object executeSqlSingle(String stmt, Object... args) {
+ List<List<?>> res = executeSql(stmt, args);
+
+ assertEquals(1, res.size());
+
+ List<?> row = res.get(0);
+
+ assertEquals(1, row.size());
+
+ return row.get(0);
+ }
+
+ /**
+ * @return Node to initiate operations from.
+ */
+ protected IgniteEx node() {
+ return grid(nodeIdx);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/ff151e5f/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 7b90e8e..012ed29 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
@@ -69,6 +69,7 @@ import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheA
import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheAtomicNearEnabledFieldsQuerySelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheAtomicNearEnabledQuerySelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheAtomicQuerySelfTest;
+import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheDistributedPartitionQueryConfigurationSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheDistributedPartitionQueryNodeRestartsSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheDistributedPartitionQuerySelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheDistributedQueryCancelSelfTest;
@@ -78,7 +79,6 @@ import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheP
import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCachePartitionedQuerySelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCachePartitionedSnapshotEnabledQuerySelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheQueryAbstractDistributedJoinSelfTest;
-import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheDistributedPartitionQueryConfigurationSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.IgniteCacheQueryNoRebalanceSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedFieldsQueryP2PEnabledSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedFieldsQueryROSelfTest;
@@ -86,17 +86,25 @@ import org.apache.ignite.internal.processors.cache.distributed.replicated.Ignite
import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedQueryP2PDisabledSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheReplicatedQuerySelfTest;
import org.apache.ignite.internal.processors.cache.index.DuplicateKeyValueClassesSelfTest;
+import org.apache.ignite.internal.processors.cache.index.DynamicIndexClientBasicSelfTest;
+import org.apache.ignite.internal.processors.cache.index.DynamicIndexServerBasicSelfTest;
+import org.apache.ignite.internal.processors.cache.index.DynamicIndexServerCoordinatorBasicSelfTest;
+import org.apache.ignite.internal.processors.cache.index.DynamicIndexServerNodeFIlterBasicSelfTest;
+import org.apache.ignite.internal.processors.cache.index.DynamicIndexServerNodeFilterCoordinatorBasicSelfTest;
import org.apache.ignite.internal.processors.cache.index.H2DynamicIndexAtomicPartitionedNearSelfTest;
import org.apache.ignite.internal.processors.cache.index.H2DynamicIndexAtomicPartitionedSelfTest;
import org.apache.ignite.internal.processors.cache.index.H2DynamicIndexAtomicReplicatedSelfTest;
import org.apache.ignite.internal.processors.cache.index.H2DynamicIndexTransactionalPartitionedNearSelfTest;
import org.apache.ignite.internal.processors.cache.index.H2DynamicIndexTransactionalPartitionedSelfTest;
import org.apache.ignite.internal.processors.cache.index.H2DynamicIndexTransactionalReplicatedSelfTest;
-import org.apache.ignite.internal.processors.cache.index.DynamicIndexClientBasicSelfTest;
-import org.apache.ignite.internal.processors.cache.index.DynamicIndexServerCoordinatorBasicSelfTest;
-import org.apache.ignite.internal.processors.cache.index.DynamicIndexServerNodeFIlterBasicSelfTest;
-import org.apache.ignite.internal.processors.cache.index.DynamicIndexServerNodeFilterCoordinatorBasicSelfTest;
-import org.apache.ignite.internal.processors.cache.index.DynamicIndexServerBasicSelfTest;
+import org.apache.ignite.internal.processors.cache.index.H2DynamicIndexingComplexClientAtomicPartitionedTest;
+import org.apache.ignite.internal.processors.cache.index.H2DynamicIndexingComplexClientAtomicReplicatedTest;
+import org.apache.ignite.internal.processors.cache.index.H2DynamicIndexingComplexClientTransactionalPartitionedTest;
+import org.apache.ignite.internal.processors.cache.index.H2DynamicIndexingComplexClientTransactionalReplicatedTest;
+import org.apache.ignite.internal.processors.cache.index.H2DynamicIndexingComplexServerAtomicPartitionedTest;
+import org.apache.ignite.internal.processors.cache.index.H2DynamicIndexingComplexServerAtomicReplicatedTest;
+import org.apache.ignite.internal.processors.cache.index.H2DynamicIndexingComplexServerTransactionalPartitionedTest;
+import org.apache.ignite.internal.processors.cache.index.H2DynamicIndexingComplexServerTransactionalReplicatedTest;
import org.apache.ignite.internal.processors.cache.index.H2DynamicTableSelfTest;
import org.apache.ignite.internal.processors.cache.index.SchemaExchangeSelfTest;
import org.apache.ignite.internal.processors.cache.local.IgniteCacheLocalAtomicQuerySelfTest;
@@ -237,6 +245,16 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
suite.addTestSuite(H2DynamicIndexAtomicPartitionedNearSelfTest.class);
suite.addTestSuite(H2DynamicTableSelfTest.class);
+ // DML+DDL.
+ suite.addTestSuite(H2DynamicIndexingComplexClientAtomicPartitionedTest.class);
+ suite.addTestSuite(H2DynamicIndexingComplexClientAtomicReplicatedTest.class);
+ suite.addTestSuite(H2DynamicIndexingComplexClientTransactionalPartitionedTest.class);
+ suite.addTestSuite(H2DynamicIndexingComplexClientTransactionalReplicatedTest.class);
+ suite.addTestSuite(H2DynamicIndexingComplexServerAtomicPartitionedTest.class);
+ suite.addTestSuite(H2DynamicIndexingComplexServerAtomicReplicatedTest.class);
+ suite.addTestSuite(H2DynamicIndexingComplexServerTransactionalPartitionedTest.class);
+ suite.addTestSuite(H2DynamicIndexingComplexServerTransactionalReplicatedTest.class);
+
// Fields queries.
suite.addTestSuite(SqlFieldsQuerySelfTest.class);
suite.addTestSuite(IgniteCacheLocalFieldsQuerySelfTest.class);
[06/26] ignite git commit: minor - fixed javadoc
Posted by sb...@apache.org.
minor - fixed javadoc
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/285644ae
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/285644ae
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/285644ae
Branch: refs/heads/ignite-2.1.2-exchange
Commit: 285644ae597a49c25a84c21c2601729e40459c38
Parents: 42b8000
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Jun 26 13:46:33 2017 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Jun 26 13:46:33 2017 +0300
----------------------------------------------------------------------
.../main/java/org/apache/ignite/IgniteDataStreamer.java | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/285644ae/modules/core/src/main/java/org/apache/ignite/IgniteDataStreamer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteDataStreamer.java b/modules/core/src/main/java/org/apache/ignite/IgniteDataStreamer.java
index 6665f59..e2473dc 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteDataStreamer.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteDataStreamer.java
@@ -31,8 +31,15 @@ import org.jetbrains.annotations.Nullable;
* to make sure that there is the least amount of data movement possible and optimal
* network and memory utilization.
* <p>
- * Note that data streamer is not transactional and therefore dishonours any active transaction
- * when updating data.
+ * Note that data streamer data manipulation methods do not support transactions.
+ * When updating data with {@link #allowOverwrite()} set to {@code false} new entry
+ * is created on primary and backups if it has not existed. If {@link #allowOverwrite()}
+ * is {@code true} then batches are applied with regular {@code cache.put(..)} methods
+ * starting implicit transactions if streamer is targeted to a transactional cache.
+ * <p>
+ * However, explicit transactional updates inside are possible with custom {@link StreamReceiver}.
+ * This way batches can be applied within transaction(s) on target node.
+ * See {@link #receiver(StreamReceiver)} for details.
* <p>
* Note that streamer will stream data concurrently by multiple internal threads, so the
* data may get to remote nodes in different order from which it was added to
[03/26] ignite git commit: minor - fixed javadoc
Posted by sb...@apache.org.
minor - fixed javadoc
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ec9d47b1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ec9d47b1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ec9d47b1
Branch: refs/heads/ignite-2.1.2-exchange
Commit: ec9d47b197738459b7721d5b393f5be223cd76e0
Parents: f3b0672
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Jun 26 13:25:50 2017 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Jun 26 13:25:50 2017 +0300
----------------------------------------------------------------------
.../src/main/java/org/apache/ignite/IgniteDataStreamer.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec9d47b1/modules/core/src/main/java/org/apache/ignite/IgniteDataStreamer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteDataStreamer.java b/modules/core/src/main/java/org/apache/ignite/IgniteDataStreamer.java
index 4e00d66..6665f59 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteDataStreamer.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteDataStreamer.java
@@ -31,6 +31,9 @@ import org.jetbrains.annotations.Nullable;
* to make sure that there is the least amount of data movement possible and optimal
* network and memory utilization.
* <p>
+ * Note that data streamer is not transactional and therefore dishonours any active transaction
+ * when updating data.
+ * <p>
* Note that streamer will stream data concurrently by multiple internal threads, so the
* data may get to remote nodes in different order from which it was added to
* the streamer.
@@ -441,4 +444,4 @@ public interface IgniteDataStreamer<K, V> extends AutoCloseable {
@Override public void close() throws CacheException, IgniteInterruptedException,
IgniteDataStreamerTimeoutException;
-}
\ No newline at end of file
+}
[04/26] ignite git commit: NPE in
GridDhtPartitionDemander.requestPartitions.
Posted by sb...@apache.org.
NPE in GridDhtPartitionDemander.requestPartitions.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7b17bb85
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7b17bb85
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7b17bb85
Branch: refs/heads/ignite-2.1.2-exchange
Commit: 7b17bb85f262efa991c83e92cbf3545caedfac33
Parents: f3b0672
Author: sboikov <sb...@gridgain.com>
Authored: Mon Jun 26 13:41:45 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jun 26 13:41:45 2017 +0300
----------------------------------------------------------------------
.../distributed/dht/preloader/GridDhtPartitionDemander.java | 5 ++---
.../discovery/GridDiscoveryManagerAliveCacheSelfTest.java | 2 --
2 files changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/7b17bb85/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
index e4f0d08..15caae2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
@@ -363,7 +363,6 @@ public class GridDhtPartitionDemander {
/**
* @param fut Rebalance future.
* @param assigns Assignments.
- * @throws IgniteCheckedException If failed.
*/
private void requestPartitions(final RebalanceFuture fut, GridDhtPreloaderAssignments assigns) {
assert fut != null;
@@ -398,10 +397,10 @@ public class GridDhtPartitionDemander {
for (Map.Entry<ClusterNode, GridDhtPartitionDemandMessage> e : assigns.entrySet()) {
final ClusterNode node = e.getKey();
- final Collection<Integer> parts = fut.remaining.get(node.id()).get2();
-
GridDhtPartitionDemandMessage d = e.getValue();
+ final Collection<Integer> parts = d.partitions();
+
U.log(log, "Starting rebalancing [mode=" + cfg.getRebalanceMode() +
", fromNode=" + node.id() + ", partitionsCount=" + parts.size() +
", topology=" + fut.topologyVersion() + ", updateSeq=" + fut.updateSeq + "]");
http://git-wip-us.apache.org/repos/asf/ignite/blob/7b17bb85/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 3807939..a8afa8b 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
@@ -169,8 +169,6 @@ public class GridDiscoveryManagerAliveCacheSelfTest extends GridCommonAbstractTe
* @throws Exception If failed.
*/
public void testAlivesClient() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-1583");
-
clientMode = true;
doTestAlive();
[15/26] ignite git commit: IGNITE-5548 Deadlock Detection uses
IgniteCheckedException instead of TransactionTimeoutException
Posted by sb...@apache.org.
IGNITE-5548 Deadlock Detection uses IgniteCheckedException instead of TransactionTimeoutException
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/07bf0f6f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/07bf0f6f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/07bf0f6f
Branch: refs/heads/ignite-2.1.2-exchange
Commit: 07bf0f6f3ab5333ba42808c6b39000cf13b77f5c
Parents: acf0441
Author: Igor Seliverstov <gv...@gmail.com>
Authored: Wed Jun 21 15:05:05 2017 +0300
Committer: Igor Seliverstov <gv...@gmail.com>
Committed: Tue Jun 27 15:53:55 2017 +0300
----------------------------------------------------------------------
.../colocated/GridDhtColocatedLockFuture.java | 4 +-
.../distributed/near/GridNearLockFuture.java | 4 +-
.../cache/local/GridLocalLockFuture.java | 5 +-
.../cache/transactions/TxDeadlockCauseTest.java | 279 +++++++++++++++++++
4 files changed, 289 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/07bf0f6f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index fb4f28b..40eb371 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@ -1409,7 +1409,9 @@ public final class GridDhtColocatedLockFuture extends GridCacheCompoundIdentityF
TxDeadlock deadlock = fut.get();
if (deadlock != null)
- err = new TransactionDeadlockException(deadlock.toString(cctx.shared()));
+ err = new IgniteTxTimeoutCheckedException("Failed to acquire lock within provided timeout for " +
+ "transaction [timeout=" + tx.timeout() + ", tx=" + tx + ']',
+ new TransactionDeadlockException(deadlock.toString(cctx.shared())));
}
catch (IgniteCheckedException e) {
err = e;
http://git-wip-us.apache.org/repos/asf/ignite/blob/07bf0f6f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
index 4f8d433..db030b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
@@ -1466,7 +1466,9 @@ public final class GridNearLockFuture extends GridCacheCompoundIdentityFuture<Bo
TxDeadlock deadlock = fut.get();
if (deadlock != null)
- err = new TransactionDeadlockException(deadlock.toString(cctx.shared()));
+ err = new IgniteTxTimeoutCheckedException("Failed to acquire lock within provided timeout for " +
+ "transaction [timeout=" + tx.timeout() + ", tx=" + tx + ']',
+ new TransactionDeadlockException(deadlock.toString(cctx.shared())));
}
catch (IgniteCheckedException e) {
err = e;
http://git-wip-us.apache.org/repos/asf/ignite/blob/07bf0f6f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java
index 9641533..e2311b8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java
@@ -41,6 +41,7 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalEx;
import org.apache.ignite.internal.processors.cache.transactions.TxDeadlock;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.processors.timeout.GridTimeoutObjectAdapter;
+import org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException;
import org.apache.ignite.transactions.TransactionDeadlockException;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
@@ -501,7 +502,9 @@ public final class GridLocalLockFuture<K, V> extends GridCacheFutureAdapter<Bool
if (deadlock != null)
ERR_UPD.compareAndSet(GridLocalLockFuture.this, null,
- new TransactionDeadlockException(deadlock.toString(cctx.shared())));
+ new IgniteTxTimeoutCheckedException("Failed to acquire lock within provided timeout for " +
+ "transaction [timeout=" + tx.timeout() + ", tx=" + tx + ']',
+ new TransactionDeadlockException(deadlock.toString(cctx.shared()))));
}
catch (IgniteCheckedException e) {
U.warn(log, "Failed to detect deadlock.", e);
http://git-wip-us.apache.org/repos/asf/ignite/blob/07bf0f6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockCauseTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockCauseTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockCauseTest.java
new file mode 100644
index 0000000..530009b
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxDeadlockCauseTest.java
@@ -0,0 +1,279 @@
+/*
+ * 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.transactions;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.typedef.CAX;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.X;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.transactions.*;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicReference;
+
+/**
+ *
+ */
+public class TxDeadlockCauseTest extends GridCommonAbstractTest {
+ /** */
+ private CacheConfiguration ccfg;
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+ if (isDebug()) {
+ TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+ discoSpi.failureDetectionTimeoutEnabled(false);
+
+ cfg.setDiscoverySpi(discoSpi);
+ }
+
+ MemoryConfiguration memCfg = new MemoryConfiguration();
+
+ MemoryPolicyConfiguration plc = new MemoryPolicyConfiguration();
+
+ plc.setName("dfltPlc");
+ plc.setMaxSize(100L * 1024 * 1024);
+
+ memCfg.setDefaultMemoryPolicyName("dfltPlc");
+ memCfg.setMemoryPolicies(plc);
+
+ cfg.setMemoryConfiguration(memCfg);
+
+ CacheConfiguration ccfg0 = ccfg == null ? new CacheConfiguration(DEFAULT_CACHE_NAME)
+ .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL) : ccfg;
+
+ cfg.setCacheConfiguration(ccfg0);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ super.afterTest();
+
+ stopAllGrids();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ super.afterTestsStopped();
+
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testCause() throws Exception {
+ startGrids(1);
+
+ for (TransactionIsolation isolation : TransactionIsolation.values()) {
+ testCauseObject(1, 2, 1000, isolation, true);
+ testCauseObject(1, 2, 1000, isolation, false);
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testCauseSeveralNodes() throws Exception {
+ startGrids(2);
+
+ for (TransactionIsolation isolation : TransactionIsolation.values()) {
+ testCauseObject(2, 2, 1500, isolation, true);
+ testCauseObject(2, 2, 1500, isolation, false);
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testCauseNear() throws Exception {
+ ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME)
+ .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
+ .setNearConfiguration(new NearCacheConfiguration());
+
+ startGrids(1);
+
+ for (TransactionIsolation isolation : TransactionIsolation.values()) {
+ testCauseObject(1, 2, 1000, isolation, true);
+ testCauseObject(1, 2, 1000, isolation, false);
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testCauseSeveralNodesNear() throws Exception {
+ ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME)
+ .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
+ .setNearConfiguration(new NearCacheConfiguration());
+
+ startGrids(4);
+
+ for (TransactionIsolation isolation : TransactionIsolation.values()) {
+ testCauseObject(2, 2, 2000, isolation, true);
+ testCauseObject(2, 2, 2000, isolation, false);
+ }
+ }
+
+ /**
+ * @param nodes Nodes count.
+ * @param keysCnt Keys count.
+ * @param timeout Timeout.
+ * @param isolation TransactionIsolation.
+ * @param oneOp Determines whether {@link IgniteCache#getAndPut(java.lang.Object, java.lang.Object)}
+ * instead of {@link IgniteCache#get(java.lang.Object)} and {@link IgniteCache#put(java.lang.Object, java.lang.Object)} operations sequence.
+ * @throws Exception If failed.
+ */
+ public void testCauseObject(int nodes, final int keysCnt, final long timeout, final TransactionIsolation isolation, final boolean oneOp) throws Exception {
+ final Ignite ignite = grid(new Random().nextInt(nodes));
+
+ final IgniteCache<Integer, Account> cache = ignite.cache(DEFAULT_CACHE_NAME);
+ final List<Integer> keys = new ArrayList<>(keysCnt);
+
+ for (int i = 0; i < keysCnt; i ++) {
+ keys.add(i);
+ cache.put(i, new Account(i, i * 100));
+ }
+
+ final List<Integer> keysReversed = new ArrayList<>(keys);
+ Collections.reverse(keysReversed);
+
+ final AtomicBoolean reverse = new AtomicBoolean();
+ final AtomicReference<Exception> ex = new AtomicReference<>();
+ final CyclicBarrier barrier = new CyclicBarrier(2);
+
+ IgniteInternalFuture<Long> fut = GridTestUtils.runMultiThreadedAsync(new CAX() {
+ @Override
+ public void applyx() throws IgniteCheckedException {
+ try (Transaction tx = ignite.transactions().txStart(TransactionConcurrency.PESSIMISTIC, isolation, timeout, keys.size())) {
+
+ List<Integer> keys0 = getAndFlip(reverse) ? keys : keysReversed;
+
+ for (int i = 0; i < keys0.size(); i++) {
+ Integer key = keys0.get(i);
+
+ if(oneOp)
+ cache.getAndPut(key, new Account(key, (key + 1) * 100));
+ else
+ cache.put(key, new Account(cache.get(key).id, (key + 1) * 100));
+
+ if (i == 0)
+ barrier.await(timeout >> 1, TimeUnit.MILLISECONDS);
+ }
+
+ tx.commit();
+ } catch (Exception e) {
+ ex.compareAndSet(null, e);
+ }
+ }
+ }, 2, "tx");
+
+ fut.get(timeout << 1);
+
+ Exception e = ex.get();
+
+ assertNotNull(e);
+
+ boolean detected = X.hasCause(e, TransactionDeadlockException.class);
+
+ if(!detected)
+ U.error(log, "Failed to detect a deadlock.", e);
+ else
+ log.info(X.cause(e, TransactionDeadlockException.class).getMessage());
+
+ assertTrue(detected);
+
+ try {
+ assertEquals(TransactionTimeoutException.class, e.getCause().getClass());
+ assertEquals(TransactionDeadlockException.class, e.getCause().getCause().getClass());
+ }
+ catch (AssertionError err) {
+ U.error(log, "Unexpected exception structure.", e);
+
+ throw err;
+ }
+ }
+
+ /**
+ * @param b AtomicBoolean.
+ * @return Current value.
+ */
+ private boolean getAndFlip(AtomicBoolean b) {
+ while (true) {
+ boolean res = b.get();
+
+ if(b.compareAndSet(res, !res))
+ return res;
+ }
+ }
+
+ /** */
+ static class Account implements Serializable {
+ /** Account ID. */
+ private int id;
+
+ /** Account balance. */
+ private double balance;
+
+ /**
+ * @param id Account ID.
+ * @param balance Balance.
+ */
+ Account(int id, double balance) {
+ this.id = id;
+ this.balance = balance;
+ }
+
+ /**
+ * Change balance by specified amount.
+ *
+ * @param amount Amount to add to balance (may be negative).
+ */
+ void update(double amount) {
+ balance += amount;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return "Account [id=" + id + ", balance=$" + balance + ']';
+ }
+ }
+}
[17/26] ignite git commit: GG-12347 restoring binary metadata at
correct moment of ObjectBinaryProcessor startup process
Posted by sb...@apache.org.
GG-12347 restoring binary metadata at correct moment of ObjectBinaryProcessor startup process
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4adfca9d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4adfca9d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4adfca9d
Branch: refs/heads/ignite-2.1.2-exchange
Commit: 4adfca9dcbbb8709744dce5a986e193ba4015eb1
Parents: 1d88bec
Author: Sergey Chugunov <se...@gmail.com>
Authored: Tue Jun 27 17:04:16 2017 +0300
Committer: Sergey Chugunov <se...@gmail.com>
Committed: Tue Jun 27 17:04:16 2017 +0300
----------------------------------------------------------------------
.../processors/cache/binary/CacheObjectBinaryProcessorImpl.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4adfca9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
index 329c50e..c2c71ea 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
@@ -148,8 +148,6 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
metadataFileStore = new BinaryMetadataFileStore(metadataLocCache, ctx, log);
- metadataFileStore.restoreMetadata();
-
transport = new BinaryMetadataTransport(metadataLocCache, metadataFileStore, ctx, log);
BinaryMetadataHandler metaHnd = new BinaryMetadataHandler() {
@@ -231,6 +229,8 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
ctx.addNodeAttribute(IgniteNodeAttributes.ATTR_BINARY_CONFIGURATION, map);
}
}
+
+ metadataFileStore.restoreMetadata();
}
}
[12/26] ignite git commit: Merge remote-tracking branch
'remotes/origin/master' into ignite-2.1.2
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-2.1.2
# Conflicts:
# modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
# modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fd09d301
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fd09d301
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fd09d301
Branch: refs/heads/ignite-2.1.2-exchange
Commit: fd09d301b14a2e20774503359bcef4280a67da92
Parents: a9db2ad
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 27 12:27:45 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 27 12:27:45 2017 +0300
----------------------------------------------------------------------
.../cache/IgniteCacheOffheapManagerImpl.java | 38 ++++++++++----------
1 file changed, 20 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/fd09d301/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
index d64d19c..b51fc10 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
@@ -447,31 +447,33 @@ public class IgniteCacheOffheapManagerImpl implements IgniteCacheOffheapManager
@Override public void clearCache(GridCacheContext cctx, boolean readers) {
GridCacheVersion obsoleteVer = null;
- try (GridCloseableIterator<CacheDataRow> it = grp.isLocal() ?iterator(cctx.cacheId(), cacheDataStores().iterator()):
-evictionSafeIterator(cctx.cacheId(), cacheDataStores().iterator())) {
- while (it.hasNext()) {
- cctx.shared().database().checkpointReadLock();
+ try (GridCloseableIterator<CacheDataRow> it = grp.isLocal() ? iterator(cctx.cacheId(), cacheDataStores().iterator()) :
+ evictionSafeIterator(cctx.cacheId(), cacheDataStores().iterator())) {
+ while (it.hasNext()) {
+ cctx.shared().database().checkpointReadLock();
- try {KeyCacheObject key = it.next().key();
+ try{
+ KeyCacheObject key = it.next().key();
- try {
- if (obsoleteVer == null)
- obsoleteVer = ctx.versions().next();
+ try {
+ if (obsoleteVer == null)
+ obsoleteVer = ctx.versions().next();
- GridCacheEntryEx entry = cctx.cache().entryEx(key);
+ GridCacheEntryEx entry = cctx.cache().entryEx(key);
- entry.clear(obsoleteVer, readers);
- }
- catch (GridDhtInvalidPartitionException ignore) {
- // Ignore.
+ entry.clear(obsoleteVer, readers);
+ }
+ catch (GridDhtInvalidPartitionException ignore) {
+ // Ignore.
+ }
+ catch (IgniteCheckedException e) {
+ U.error(log, "Failed to clear cache entry: " + key, e);
+ }
}
- catch (IgniteCheckedException e) {
- U.error(log, "Failed to clear cache entry: " + key, e);
+ finally {
+ cctx.shared().database().checkpointReadUnlock();
}
}
- finally {
- cctx.shared().database().checkpointReadUnlock();
- }
}
catch (IgniteCheckedException e) {
U.error(log, "Failed to close iterator", e);
[08/26] ignite git commit: GG-12168 Do not store partitions state for
local caches
Posted by sb...@apache.org.
GG-12168 Do not store partitions state for local caches
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8b0f3c10
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8b0f3c10
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8b0f3c10
Branch: refs/heads/ignite-2.1.2-exchange
Commit: 8b0f3c104d27a298eb0518f67183c81ef07ed47f
Parents: 6391b3d
Author: Igor Seliverstov <is...@gridgain.com>
Authored: Mon Jun 26 16:00:58 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jun 26 16:00:58 2017 +0300
----------------------------------------------------------------------
.../GridCacheDatabaseSharedManager.java | 4 +++
.../persistence/GridCacheOffheapManager.java | 31 ++++++++++++--------
.../persistence/IgnitePdsDynamicCacheTest.java | 11 +++++++
.../junits/GridTestKernalContext.java | 1 +
4 files changed, 34 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/8b0f3c10/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
index 0624774..b9ff7e7 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
@@ -1573,6 +1573,10 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
Map<T2<Integer, Integer>, T2<Integer, Long>> partStates
) throws IgniteCheckedException {
for (CacheGroupContext grp : cctx.cache().cacheGroups()) {
+ if (grp.isLocal())
+ // Local cache has no partitions and its states.
+ continue;
+
int grpId = grp.groupId();
PageMemoryEx pageMem = (PageMemoryEx)grp.memoryPolicy().pageMemory();
http://git-wip-us.apache.org/repos/asf/ignite/blob/8b0f3c10/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
index 5a35490..4e322b9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
@@ -188,20 +188,22 @@ public class GridCacheOffheapManager extends IgniteCacheOffheapManagerImpl imple
if (size > 0 || updCntr > 0) {
int state = -1;
- if (beforeDestroy)
- state = GridDhtPartitionState.EVICTED.ordinal();
- else {
- // localPartition will not acquire writeLock here because create=false.
- GridDhtLocalPartition part = grp.topology().localPartition(store.partId(),
- AffinityTopologyVersion.NONE, false);
+ if (!grp.isLocal()) {
+ if (beforeDestroy)
+ state = GridDhtPartitionState.EVICTED.ordinal();
+ else {
+ // localPartition will not acquire writeLock here because create=false.
+ GridDhtLocalPartition part = grp.topology().localPartition(store.partId(),
+ AffinityTopologyVersion.NONE, false);
- if (part != null && part.state() != GridDhtPartitionState.EVICTED)
- state = part.state().ordinal();
- }
+ if (part != null && part.state() != GridDhtPartitionState.EVICTED)
+ state = part.state().ordinal();
+ }
- // Do not save meta for evicted partitions on next checkpoints.
- if (state == -1)
- return false;
+ // Do not save meta for evicted partitions on next checkpoints.
+ if (state == -1)
+ return false;
+ }
int grpId = grp.groupId();
long partMetaId = pageMem.partitionMetaPageId(grpId, store.partId());
@@ -227,7 +229,10 @@ public class GridCacheOffheapManager extends IgniteCacheOffheapManagerImpl imple
changed |= io.setGlobalRemoveId(pageAddr, rmvId);
changed |= io.setSize(pageAddr, size);
- changed |= io.setPartitionState(pageAddr, (byte)state);
+ if (state != -1)
+ changed |= io.setPartitionState(pageAddr, (byte)state);
+ else
+ assert grp.isLocal() : grp.cacheOrGroupName();
long cntrsPageId;
http://git-wip-us.apache.org/repos/asf/ignite/blob/8b0f3c10/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDynamicCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDynamicCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDynamicCacheTest.java
index ae4b850..189b866 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDynamicCacheTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDynamicCacheTest.java
@@ -21,6 +21,7 @@ import java.io.Serializable;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.CacheRebalanceMode;
import org.apache.ignite.cache.CacheWriteSynchronizationMode;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
@@ -118,8 +119,15 @@ public class IgnitePdsDynamicCacheTest extends IgniteDbDynamicCacheSelfTest {
ccfg2.setAffinity(new RendezvousAffinityFunction(false, 32));
ccfg2.setIndexedTypes(Integer.class, Value.class);
+ CacheConfiguration ccfg3 = new CacheConfiguration();
+
+ ccfg3.setName("cache3");
+ ccfg3.setAtomicityMode(CacheAtomicityMode.ATOMIC);
+ ccfg3.setCacheMode(CacheMode.LOCAL);
+
ignite.createCache(ccfg1);
ignite.createCache(ccfg2);
+ ignite.createCache(ccfg3).put(2, 3);
int iterations = 20;
@@ -140,6 +148,9 @@ public class IgnitePdsDynamicCacheTest extends IgniteDbDynamicCacheSelfTest {
ignite.getOrCreateCache(ccfg2);
+ assertEquals(1, ignite.cache(ccfg3.getName()).size());
+ assertEquals(3, ignite.cache(ccfg3.getName()).get(2));
+
ignite.destroyCache(ccfg2.getName());
ignite.getOrCreateCache(ccfg2);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8b0f3c10/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 bb92e25..3d3de22 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
@@ -72,6 +72,7 @@ public class GridTestKernalContext extends GridKernalContextImpl {
);
GridTestUtils.setFieldValue(grid(), "cfg", config());
+ GridTestUtils.setFieldValue(grid(), "ctx", this);
config().setGridLogger(log);
}
[23/26] ignite git commit: ignite-5595 Client event exchange
optimization
Posted by sb...@apache.org.
ignite-5595 Client event exchange optimization
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8445b315
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8445b315
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8445b315
Branch: refs/heads/ignite-2.1.2-exchange
Commit: 8445b315663710507e6e3996223f01748f9674a6
Parents: ff151e5
Author: sboikov <sb...@gridgain.com>
Authored: Wed Jun 28 08:58:09 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Jun 28 08:58:09 2017 +0300
----------------------------------------------------------------------
.../dht/GridClientPartitionTopology.java | 2 +-
.../dht/GridDhtPartitionTopologyImpl.java | 147 ++++++++++---------
.../GridDhtPartitionsExchangeFuture.java | 24 +--
3 files changed, 95 insertions(+), 78 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/8445b315/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
index 9c769a9..20a7f91 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
@@ -269,7 +269,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
assert topVer.equals(exchId.topologyVersion()) : "Invalid topology version [topVer=" +
topVer + ", exchId=" + exchId + ']';
- if (!exchId.isJoined())
+ if (exchId.isLeft() && exchFut.serverNodeDiscoveryEvent())
removeNode(exchId.nodeId());
// In case if node joins, get topology at the time of joining node.
http://git-wip-us.apache.org/repos/asf/ignite/blob/8445b315/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index f3170fa..bb6aab3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -62,6 +62,7 @@ import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_THREAD_DUMP_ON_EXCHANGE_TIMEOUT;
import static org.apache.ignite.events.EventType.EVT_CACHE_REBALANCE_PART_DATA_LOST;
+import static org.apache.ignite.internal.events.DiscoveryCustomEvent.EVT_DISCOVERY_CUSTOM_EVT;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.EVICTED;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.LOST;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.MOVING;
@@ -208,6 +209,9 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
* @throws IgniteCheckedException If failed.
*/
private boolean waitForRent() throws IgniteCheckedException {
+ if (!grp.affinityNode())
+ return false;
+
final long longOpDumpTimeout =
IgniteSystemProperties.getLong(IgniteSystemProperties.IGNITE_LONG_OPERATIONS_DUMP_TIMEOUT, 60_000);
@@ -379,91 +383,93 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
* @param updateSeq Update sequence.
*/
private void initPartitions0(GridDhtPartitionsExchangeFuture exchFut, long updateSeq) {
- ClusterNode loc = ctx.localNode();
+ List<List<ClusterNode>> aff = grp.affinity().assignments(exchFut.topologyVersion());
- ClusterNode oldest = discoCache.oldestAliveServerNodeWithCache();
+ if (grp.affinityNode()) {
+ ClusterNode loc = ctx.localNode();
- GridDhtPartitionExchangeId exchId = exchFut.exchangeId();
+ ClusterNode oldest = discoCache.oldestAliveServerNodeWithCache();
- assert topVer.equals(exchFut.topologyVersion()) :
- "Invalid topology [topVer=" + topVer +
- ", grp=" + grp.cacheOrGroupName() +
- ", futVer=" + exchFut.topologyVersion() +
- ", fut=" + exchFut + ']';
- assert grp.affinity().lastVersion().equals(exchFut.topologyVersion()) :
- "Invalid affinity [topVer=" + grp.affinity().lastVersion() +
- ", grp=" + grp.cacheOrGroupName() +
- ", futVer=" + exchFut.topologyVersion() +
- ", fut=" + exchFut + ']';
+ GridDhtPartitionExchangeId exchId = exchFut.exchangeId();
- List<List<ClusterNode>> aff = grp.affinity().assignments(exchFut.topologyVersion());
+ assert topVer.equals(exchFut.topologyVersion()) :
+ "Invalid topology [topVer=" + topVer +
+ ", grp=" + grp.cacheOrGroupName() +
+ ", futVer=" + exchFut.topologyVersion() +
+ ", fut=" + exchFut + ']';
+ assert grp.affinity().lastVersion().equals(exchFut.topologyVersion()) :
+ "Invalid affinity [topVer=" + grp.affinity().lastVersion() +
+ ", grp=" + grp.cacheOrGroupName() +
+ ", futVer=" + exchFut.topologyVersion() +
+ ", fut=" + exchFut + ']';
- int num = grp.affinity().partitions();
+ int num = grp.affinity().partitions();
- if (grp.rebalanceEnabled()) {
- boolean added = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom());
+ if (grp.rebalanceEnabled()) {
+ boolean added = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom());
- boolean first = added || (loc.equals(oldest) && loc.id().equals(exchId.nodeId()) && exchId.isJoined());
+ boolean first = added || (loc.equals(oldest) && loc.id().equals(exchId.nodeId()) && exchId.isJoined());
- if (first) {
- assert exchId.isJoined() || added;
+ if (first) {
+ assert exchId.isJoined() || added;
- for (int p = 0; p < num; p++) {
- if (localNode(p, aff)) {
- GridDhtLocalPartition locPart = createPartition(p);
+ for (int p = 0; p < num; p++) {
+ if (localNode(p, aff)) {
+ GridDhtLocalPartition locPart = createPartition(p);
- boolean owned = locPart.own();
+ boolean owned = locPart.own();
- assert owned : "Failed to own partition for oldest node [grp=" + grp.cacheOrGroupName() +
- ", part=" + locPart + ']';
+ assert owned : "Failed to own partition for oldest node [grp=" + grp.cacheOrGroupName() +
+ ", part=" + locPart + ']';
- if (log.isDebugEnabled())
- log.debug("Owned partition for oldest node: " + locPart);
+ if (log.isDebugEnabled())
+ log.debug("Owned partition for oldest node: " + locPart);
- updateSeq = updateLocal(p, locPart.state(), updateSeq);
+ updateSeq = updateLocal(p, locPart.state(), updateSeq);
+ }
}
}
+ else
+ createPartitions(aff, updateSeq);
}
- else
- createPartitions(aff, updateSeq);
- }
- else {
- // If preloader is disabled, then we simply clear out
- // the partitions this node is not responsible for.
- for (int p = 0; p < num; p++) {
- GridDhtLocalPartition locPart = localPartition(p, topVer, false, false);
+ else {
+ // If preloader is disabled, then we simply clear out
+ // the partitions this node is not responsible for.
+ for (int p = 0; p < num; p++) {
+ GridDhtLocalPartition locPart = localPartition(p, topVer, false, false);
- boolean belongs = localNode(p, aff);
+ boolean belongs = localNode(p, aff);
- if (locPart != null) {
- if (!belongs) {
- GridDhtPartitionState state = locPart.state();
+ if (locPart != null) {
+ if (!belongs) {
+ GridDhtPartitionState state = locPart.state();
- if (state.active()) {
- locPart.rent(false);
+ if (state.active()) {
+ locPart.rent(false);
- updateSeq = updateLocal(p, locPart.state(), updateSeq);
+ updateSeq = updateLocal(p, locPart.state(), updateSeq);
- if (log.isDebugEnabled())
- log.debug("Evicting partition with rebalancing disabled " +
- "(it does not belong to affinity): " + locPart);
+ if (log.isDebugEnabled())
+ log.debug("Evicting partition with rebalancing disabled " +
+ "(it does not belong to affinity): " + locPart);
+ }
}
+ else
+ locPart.own();
}
- else
- locPart.own();
- }
- else if (belongs) {
- locPart = createPartition(p);
+ else if (belongs) {
+ locPart = createPartition(p);
- locPart.own();
+ locPart.own();
- updateLocal(p, locPart.state(), updateSeq);
+ updateLocal(p, locPart.state(), updateSeq);
+ }
}
}
- }
- if (node2part != null && node2part.valid())
- checkEvictions(updateSeq, aff);
+ if (node2part != null && node2part.valid())
+ checkEvictions(updateSeq, aff);
+ }
updateRebalanceVersion(aff);
}
@@ -473,6 +479,9 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
* @param updateSeq Update sequence.
*/
private void createPartitions(List<List<ClusterNode>> aff, long updateSeq) {
+ if (!grp.affinityNode())
+ return;
+
int num = grp.affinity().partitions();
for (int p = 0; p < num; p++) {
@@ -527,15 +536,15 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
}
try {
- GridDhtPartitionExchangeId exchId = exchFut.exchangeId();
-
if (stopping)
return;
+ GridDhtPartitionExchangeId exchId = exchFut.exchangeId();
+
assert topVer.equals(exchId.topologyVersion()) : "Invalid topology version [topVer=" +
topVer + ", exchId=" + exchId + ']';
- if (exchId.isLeft())
+ if (exchId.isLeft() && exchFut.serverNodeDiscoveryEvent())
removeNode(exchId.nodeId());
ClusterNode oldest = discoCache.oldestAliveServerNodeWithCache();
@@ -547,8 +556,10 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
cntrMap.clear();
+ boolean grpStarted = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom());
+
// If this is the oldest node.
- if (oldest != null && (loc.equals(oldest) || exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom()))) {
+ if (oldest != null && (loc.equals(oldest) || grpStarted)) {
if (node2part == null) {
node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq);
@@ -572,12 +583,16 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
}
}
- if (affReady)
- initPartitions0(exchFut, updateSeq);
- else {
- List<List<ClusterNode>> aff = grp.affinity().idealAssignment();
+ if (grpStarted ||
+ exchFut.discoveryEvent().type() == EVT_DISCOVERY_CUSTOM_EVT ||
+ exchFut.serverNodeDiscoveryEvent()) {
+ if (affReady)
+ initPartitions0(exchFut, updateSeq);
+ else {
+ List<List<ClusterNode>> aff = grp.affinity().idealAssignment();
- createPartitions(aff, updateSeq);
+ createPartitions(aff, updateSeq);
+ }
}
consistencyCheck();
http://git-wip-us.apache.org/repos/asf/ignite/blob/8445b315/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index c8138f7..1f13e56 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1150,7 +1150,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
/**
* @return {@code True} if exchange triggered by server node join or fail.
*/
- private boolean serverNodeDiscoveryEvent() {
+ public boolean serverNodeDiscoveryEvent() {
assert discoEvt != null;
return discoEvt.type() != EVT_DISCOVERY_CUSTOM_EVT && !CU.clientNode(discoEvt.eventNode());
@@ -1173,16 +1173,17 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
}
if (err == null && realExchange) {
- for (CacheGroupContext grp : cctx.cache().cacheGroups()) {
- if (grp.isLocal())
- continue;
+ if (centralizedAff) {
+ for (CacheGroupContext grp : cctx.cache().cacheGroups()) {
+ if (grp.isLocal())
+ continue;
- try {
- if (centralizedAff)
+ try {
grp.topology().initPartitions(this);
- }
- catch (IgniteInterruptedCheckedException e) {
- U.error(log, "Failed to initialize partitions.", e);
+ }
+ catch (IgniteInterruptedCheckedException e) {
+ U.error(log, "Failed to initialize partitions.", e);
+ }
}
}
@@ -1199,9 +1200,10 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
}
}
- if (discoEvt.type() == EVT_NODE_LEFT ||
+ if (serverNodeDiscoveryEvent() &&
+ (discoEvt.type() == EVT_NODE_LEFT ||
discoEvt.type() == EVT_NODE_FAILED ||
- discoEvt.type() == EVT_NODE_JOINED)
+ discoEvt.type() == EVT_NODE_JOINED))
detectLostPartitions();
Map<Integer, CacheValidation> m = U.newHashMap(cctx.cache().cacheGroups().size());
[13/26] ignite git commit: Quick fix for NPE in
PageMemoryImpl.loadedPages
Posted by sb...@apache.org.
Quick fix for NPE in PageMemoryImpl.loadedPages
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f2a5a93f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f2a5a93f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f2a5a93f
Branch: refs/heads/ignite-2.1.2-exchange
Commit: f2a5a93f0748f905ede77ff84787947a0893c3f8
Parents: fd09d30
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 27 13:43:13 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 27 13:43:13 2017 +0300
----------------------------------------------------------------------
.../persistence/pagemem/PageMemoryImpl.java | 21 +++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f2a5a93f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
index fb9bd3e..6bb5c33 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
@@ -1014,14 +1014,21 @@ public class PageMemoryImpl implements PageMemoryEx {
@Override public long loadedPages() {
long total = 0;
- for (Segment seg : segments) {
- seg.readLock().lock();
+ Segment[] segments = this.segments;
- try {
- total += seg.loadedPages.size();
- }
- finally {
- seg.readLock().unlock();
+ if (segments != null) {
+ for (Segment seg : segments) {
+ if (seg == null)
+ break;
+
+ seg.readLock().lock();
+
+ try {
+ total += seg.loadedPages.size();
+ }
+ finally {
+ seg.readLock().unlock();
+ }
}
}
[24/26] ignite git commit: Merge remote-tracking branch
'remotes/origin/master' into ignite-2.1.2
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-2.1.2
# Conflicts:
# modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f0f59631
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f0f59631
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f0f59631
Branch: refs/heads/ignite-2.1.2-exchange
Commit: f0f59631ec05a281af671f6cc246ca3ef443e083
Parents: 4adfca9 8445b31
Author: sboikov <sb...@gridgain.com>
Authored: Wed Jun 28 09:06:23 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Jun 28 09:06:23 2017 +0300
----------------------------------------------------------------------
.../dht/GridClientPartitionTopology.java | 2 +-
.../dht/GridDhtPartitionTopologyImpl.java | 153 ++++----
.../GridDhtPartitionsExchangeFuture.java | 24 +-
.../DynamicIndexAbstractBasicSelfTest.java | 81 ++++-
...exingComplexClientAtomicPartitionedTest.java | 33 ++
...dexingComplexClientAtomicReplicatedTest.java | 33 ++
...mplexClientTransactionalPartitionedTest.java | 33 ++
...omplexClientTransactionalReplicatedTest.java | 33 ++
...exingComplexServerAtomicPartitionedTest.java | 33 ++
...dexingComplexServerAtomicReplicatedTest.java | 33 ++
...mplexServerTransactionalPartitionedTest.java | 33 ++
...omplexServerTransactionalReplicatedTest.java | 33 ++
.../index/H2DynamicIndexingComplexTest.java | 356 +++++++++++++++++++
.../cache/index/H2DynamicTableSelfTest.java | 182 ++++++++--
.../IgniteCacheQuerySelfTestSuite.java | 30 +-
15 files changed, 961 insertions(+), 131 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f0f59631/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f0f59631/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index ce19c6b,bb6aab3..a6f1831
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@@ -59,7 -60,9 +59,8 @@@ import org.apache.ignite.internal.util.
import org.apache.ignite.internal.util.typedef.internal.U;
import org.jetbrains.annotations.Nullable;
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_THREAD_DUMP_ON_EXCHANGE_TIMEOUT;
import static org.apache.ignite.events.EventType.EVT_CACHE_REBALANCE_PART_DATA_LOST;
+ import static org.apache.ignite.internal.events.DiscoveryCustomEvent.EVT_DISCOVERY_CUSTOM_EVT;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.EVICTED;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.LOST;
import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.MOVING;
@@@ -299,91 -383,93 +300,93 @@@ public class GridDhtPartitionTopologyIm
* @param updateSeq Update sequence.
*/
private void initPartitions0(GridDhtPartitionsExchangeFuture exchFut, long updateSeq) {
- ClusterNode loc = ctx.localNode();
+ List<List<ClusterNode>> aff = grp.affinity().assignments(exchFut.topologyVersion());
- ClusterNode oldest = discoCache.oldestAliveServerNodeWithCache();
+ if (grp.affinityNode()) {
+ ClusterNode loc = ctx.localNode();
- GridDhtPartitionExchangeId exchId = exchFut.exchangeId();
+ ClusterNode oldest = discoCache.oldestAliveServerNodeWithCache();
- assert topVer.equals(exchFut.topologyVersion()) :
- "Invalid topology [topVer=" + topVer +
- ", grp=" + grp.cacheOrGroupName() +
- ", futVer=" + exchFut.topologyVersion() +
- ", fut=" + exchFut + ']';
- assert grp.affinity().lastVersion().equals(exchFut.topologyVersion()) :
- "Invalid affinity [topVer=" + grp.affinity().lastVersion() +
- ", grp=" + grp.cacheOrGroupName() +
- ", futVer=" + exchFut.topologyVersion() +
- ", fut=" + exchFut + ']';
+ GridDhtPartitionExchangeId exchId = exchFut.exchangeId();
- List<List<ClusterNode>> aff = grp.affinity().assignments(exchFut.topologyVersion());
+ assert topVer.equals(exchFut.topologyVersion()) :
+ "Invalid topology [topVer=" + topVer +
+ ", grp=" + grp.cacheOrGroupName() +
+ ", futVer=" + exchFut.topologyVersion() +
+ ", fut=" + exchFut + ']';
+ assert grp.affinity().lastVersion().equals(exchFut.topologyVersion()) :
+ "Invalid affinity [topVer=" + grp.affinity().lastVersion() +
+ ", grp=" + grp.cacheOrGroupName() +
+ ", futVer=" + exchFut.topologyVersion() +
+ ", fut=" + exchFut + ']';
- int num = grp.affinity().partitions();
+ int num = grp.affinity().partitions();
- if (grp.rebalanceEnabled()) {
- boolean added = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom());
+ if (grp.rebalanceEnabled()) {
+ boolean added = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom());
- boolean first = added || (loc.equals(oldest) && loc.id().equals(exchId.nodeId()) && exchId.isJoined());
+ boolean first = added || (loc.equals(oldest) && loc.id().equals(exchId.nodeId()) && exchId.isJoined());
- if (first) {
- assert exchId.isJoined() || added;
+ if (first) {
+ assert exchId.isJoined() || added;
- for (int p = 0; p < num; p++) {
- if (localNode(p, aff)) {
- GridDhtLocalPartition locPart = createPartition(p);
+ for (int p = 0; p < num; p++) {
+ if (localNode(p, aff)) {
+ GridDhtLocalPartition locPart = createPartition(p);
- boolean owned = locPart.own();
+ boolean owned = locPart.own();
- assert owned : "Failed to own partition for oldest node [grp=" + grp.cacheOrGroupName() +
- ", part=" + locPart + ']';
+ assert owned : "Failed to own partition for oldest node [grp=" + grp.cacheOrGroupName() +
+ ", part=" + locPart + ']';
- if (log.isDebugEnabled())
- log.debug("Owned partition for oldest node: " + locPart);
+ if (log.isDebugEnabled())
+ log.debug("Owned partition for oldest node: " + locPart);
- updateSeq = updateLocal(p, locPart.state(), updateSeq);
+ updateSeq = updateLocal(p, locPart.state(), updateSeq);
+ }
}
}
+ else
+ createPartitions(aff, updateSeq);
}
- else
- createPartitions(aff, updateSeq);
- }
- else {
- // If preloader is disabled, then we simply clear out
- // the partitions this node is not responsible for.
- for (int p = 0; p < num; p++) {
- GridDhtLocalPartition locPart = localPartition0(p, topVer, false, true, false);
+ else {
+ // If preloader is disabled, then we simply clear out
+ // the partitions this node is not responsible for.
+ for (int p = 0; p < num; p++) {
- GridDhtLocalPartition locPart = localPartition(p, topVer, false, false);
++ GridDhtLocalPartition locPart = localPartition0(p, topVer, false, true, false);
- boolean belongs = localNode(p, aff);
+ boolean belongs = localNode(p, aff);
- if (locPart != null) {
- if (!belongs) {
- GridDhtPartitionState state = locPart.state();
+ if (locPart != null) {
+ if (!belongs) {
+ GridDhtPartitionState state = locPart.state();
- if (state.active()) {
- locPart.rent(false);
+ if (state.active()) {
+ locPart.rent(false);
- updateSeq = updateLocal(p, locPart.state(), updateSeq);
+ updateSeq = updateLocal(p, locPart.state(), updateSeq);
- if (log.isDebugEnabled())
- log.debug("Evicting partition with rebalancing disabled " +
- "(it does not belong to affinity): " + locPart);
+ if (log.isDebugEnabled())
+ log.debug("Evicting partition with rebalancing disabled " +
+ "(it does not belong to affinity): " + locPart);
+ }
}
+ else
+ locPart.own();
}
- else
- locPart.own();
- }
- else if (belongs) {
- locPart = createPartition(p);
+ else if (belongs) {
+ locPart = createPartition(p);
- locPart.own();
+ locPart.own();
- updateLocal(p, locPart.state(), updateSeq);
+ updateLocal(p, locPart.state(), updateSeq);
+ }
}
}
- }
- if (node2part != null && node2part.valid())
- checkEvictions(updateSeq, aff);
+ if (node2part != null && node2part.valid())
+ checkEvictions(updateSeq, aff);
+ }
updateRebalanceVersion(aff);
}
@@@ -430,81 -522,94 +436,84 @@@
ctx.database().checkpointReadLock();
- synchronized (ctx.exchange().interruptLock()) {
- if (Thread.currentThread().isInterrupted())
- throw new IgniteInterruptedCheckedException("Thread is interrupted: " + Thread.currentThread());
+ try {
+ synchronized (ctx.exchange().interruptLock()) {
+ if (Thread.currentThread().isInterrupted())
+ throw new IgniteInterruptedCheckedException("Thread is interrupted: " + Thread.currentThread());
- try {
U.writeLock(lock);
- }
- catch (IgniteInterruptedCheckedException e) {
- ctx.database().checkpointReadUnlock();
-
- throw e;
- }
- try {
- GridDhtPartitionExchangeId exchId = exchFut.exchangeId();
+ try {
+
- if (stopping)
- return;
+
- assert topVer.equals(exchId.topologyVersion()) : "Invalid topology version [topVer=" +
- topVer + ", exchId=" + exchId + ']';
+ if (stopping)
+ return;
- if (exchId.isLeft())
- GridDhtPartitionExchangeId exchId = exchFut.exchangeId();
-
- assert topVer.equals(exchId.topologyVersion()) : "Invalid topology version [topVer=" +
++ GridDhtPartitionExchangeId exchId = exchFut.exchangeId();assert topVer.equals(exchId.topologyVersion()) : "Invalid topology version [topVer=" +
+ topVer + ", exchId=" + exchId + ']';
+
- if (exchId.isLeft() && exchFut.serverNodeDiscoveryEvent())
- removeNode(exchId.nodeId());
++ if (exchId.isLeft() && exchFut.serverNodeDiscoveryEvent())
+ removeNode(exchId.nodeId());
- ClusterNode oldest = discoCache.oldestAliveServerNodeWithCache();
+ ClusterNode oldest = discoCache.oldestAliveServerNodeWithCache();
- if (log.isDebugEnabled())
- log.debug("Partition map beforeExchange [exchId=" + exchId + ", fullMap=" + fullMapString() + ']');
+ if (log.isDebugEnabled())
+ log.debug("Partition map beforeExchange [exchId=" + exchId + ", fullMap=" + fullMapString() + ']');
- long updateSeq = this.updateSeq.incrementAndGet();
+ long updateSeq = this.updateSeq.incrementAndGet();
- cntrMap.clear();
+ cntrMap.clear();
- // If this is the oldest node.
- if (oldest != null && (loc.equals(oldest) || exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom()))) {
- if (node2part == null) {
- node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq);
- boolean grpStarted = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom());
-
- // If this is the oldest node.
++ boolean grpStarted = exchFut.cacheGroupAddedOnExchange(grp.groupId(), grp.receivedFrom());// If this is the oldest node.
+ if (oldest != null && (loc.equals(oldest) || grpStarted)) {
+ if (node2part == null) {
+ node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq);
- if (log.isDebugEnabled())
- log.debug("Created brand new full topology map on oldest node [exchId=" +
- exchId + ", fullMap=" + fullMapString() + ']');
- }
- else if (!node2part.valid()) {
- node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq, node2part, false);
+ if (log.isDebugEnabled())
+ log.debug("Created brand new full topology map on oldest node [exchId=" +
+ exchId + ", fullMap=" + fullMapString() + ']');
+ }
+ else if (!node2part.valid()) {
+ node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq, node2part, false);
- if (log.isDebugEnabled())
- log.debug("Created new full topology map on oldest node [exchId=" + exchId + ", fullMap=" +
- node2part + ']');
- }
- else if (!node2part.nodeId().equals(loc.id())) {
- node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq, node2part, false);
+ if (log.isDebugEnabled())
+ log.debug("Created new full topology map on oldest node [exchId=" + exchId + ", fullMap=" +
+ node2part + ']');
+ }
+ else if (!node2part.nodeId().equals(loc.id())) {
+ node2part = new GridDhtPartitionFullMap(oldest.id(), oldest.order(), updateSeq, node2part, false);
- if (log.isDebugEnabled())
- log.debug("Copied old map into new map on oldest node (previous oldest node left) [exchId=" +
- exchId + ", fullMap=" + fullMapString() + ']');
+ if (log.isDebugEnabled())
+ log.debug("Copied old map into new map on oldest node (previous oldest node left) [exchId=" +
+ exchId + ", fullMap=" + fullMapString() + ']');
+ }
}
- }
- if (affReady)
- initPartitions0(exchFut, updateSeq);
- else {
- List<List<ClusterNode>> aff = grp.affinity().idealAssignment();
+ if (grpStarted ||
+ exchFut.discoveryEvent().type() == EVT_DISCOVERY_CUSTOM_EVT ||
- exchFut.serverNodeDiscoveryEvent()) {
- if (affReady)
- initPartitions0(exchFut, updateSeq);
- else {
- List<List<ClusterNode>> aff = grp.affinity().idealAssignment();
++ exchFut.serverNodeDiscoveryEvent()) {if (affReady)
++ initPartitions0(exchFut, updateSeq);
++ else {
++ List<List<ClusterNode>> aff = grp.affinity().idealAssignment();
createPartitions(aff, updateSeq);
}
+ }
- consistencyCheck();
-
- if (log.isDebugEnabled())
- log.debug("Partition map after beforeExchange [exchId=" + exchId + ", fullMap=" +
- fullMapString() + ']');
- }
- finally {
- lock.writeLock().unlock();
+ consistencyCheck();
- ctx.database().checkpointReadUnlock();
+ if (log.isDebugEnabled())
+ log.debug("Partition map after beforeExchange [exchId=" + exchId + ", fullMap=" +
+ fullMapString() + ']');
+ }
+ finally {
+ lock.writeLock().unlock();
+ }
}
}
-
- // Wait for evictions.
- waitForRent();
+ finally {
+ ctx.database().checkpointReadUnlock();
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/f0f59631/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f0f59631/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java
----------------------------------------------------------------------
[02/26] ignite git commit: ignite-gg-12324 fix caches start after
restore hangs if concurrent transactions run
Posted by sb...@apache.org.
ignite-gg-12324 fix caches start after restore hangs if concurrent transactions run
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6391b3d0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6391b3d0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6391b3d0
Branch: refs/heads/ignite-2.1.2-exchange
Commit: 6391b3d0db2b0ea36fde50301951dfef6aacb5ff
Parents: e35358c
Author: Dmitriy Govorukhin <dm...@gmail.com>
Authored: Mon Jun 26 12:41:57 2017 +0300
Committer: Dmitriy Govorukhin <dm...@gmail.com>
Committed: Mon Jun 26 12:41:57 2017 +0300
----------------------------------------------------------------------
.../cache/CacheAffinitySharedManager.java | 21 +++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6391b3d0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
index 35f7a0e..5984ef5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
@@ -772,9 +772,28 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
for (ExchangeActions.ActionData action : exchActions.cacheStopRequests())
cctx.cache().blockGateway(action.request().cacheName(), true, action.request().restart());
- for (CacheGroupDescriptor grpDesc : exchActions.cacheGroupsToStop())
+ for (CacheGroupDescriptor grpDesc : exchActions.cacheGroupsToStop()) {
cctx.exchange().clearClientTopology(grpDesc.groupId());
+ CacheGroupContext gctx = cctx.cache().cacheGroup(grpDesc.groupId());
+
+ if (gctx != null) {
+ IgniteCheckedException ex;
+
+ String msg = "Failed to wait for topology update, cache group is stopping.";
+
+ // If snapshot operation in progress we must throw CacheStoppedException
+ // for correct cache proxy restart. For more details see
+ // IgniteCacheProxy.cacheException()
+ if (cctx.cache().context().snapshot().snapshotOperationInProgress())
+ ex = new CacheStoppedException(msg);
+ else
+ ex = new IgniteCheckedException(msg);
+
+ gctx.affinity().cancelFutures(ex);
+ }
+ }
+
Set<Integer> stoppedGrps = null;
if (crd && lateAffAssign) {
[11/26] ignite git commit: Merge remote-tracking branch
'remotes/origin/master' into ignite-2.1.2
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-2.1.2
# Conflicts:
# modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
# modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a9db2ad0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a9db2ad0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a9db2ad0
Branch: refs/heads/ignite-2.1.2-exchange
Commit: a9db2ad01c0ec04a5edc42890acd535653bd6f88
Parents: caa4f25 d2b4759
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 27 12:27:34 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 27 12:27:34 2017 +0300
----------------------------------------------------------------------
.../org/apache/ignite/IgniteDataStreamer.java | 12 +-
.../cache/GridCacheSharedContext.java | 3 +-
.../cache/IgniteCacheOffheapManagerImpl.java | 105 +++++++++++++++-
.../dht/preloader/GridDhtPartitionDemander.java | 4 +-
.../GridDiscoveryManagerAliveCacheSelfTest.java | 2 -
.../IgniteCacheClearDuringRebalanceTest.java | 126 +++++++++++++++++++
.../testsuites/IgniteCacheTestSuite2.java | 3 +
.../Cache/Query/CacheQueriesTest.cs | 7 ++
.../Impl/Cache/CacheEntryFilterHolder.cs | 13 ++
9 files changed, 263 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9db2ad0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
index 6ba8c20,d108454..75d03d7
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
@@@ -41,12 -41,9 +41,11 @@@ import org.apache.ignite.internal.manag
import org.apache.ignite.internal.pagemem.store.IgnitePageStoreManager;
import org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
-import org.apache.ignite.internal.processors.cache.database.IgniteCacheDatabaseSharedManager;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTopologyFuture;
+import org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager;
+import org.apache.ignite.internal.processors.cache.persistence.IgniteCacheSnapshotManager;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
- import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId;
- import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
+ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTopologyFuture;
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal;
import org.apache.ignite.internal.processors.cache.jta.CacheJtaManagerAdapter;
import org.apache.ignite.internal.processors.cache.store.CacheStoreManager;
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9db2ad0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
index e90a6c4,b95828c..d64d19c
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
@@@ -447,13 -427,10 +447,12 @@@ public class IgniteCacheOffheapManagerI
@Override public void clearCache(GridCacheContext cctx, boolean readers) {
GridCacheVersion obsoleteVer = null;
- GridIterator<CacheDataRow> it = iterator(cctx.cacheId(), cacheDataStores().iterator());
-
- try (GridCloseableIterator<CacheDataRow> it = grp.isLocal() ? iterator(cctx.cacheId(), cacheDataStores().iterator()) :
- evictionSafeIterator(cctx.cacheId(), cacheDataStores().iterator())) {
- while (it.hasNext()) {
- KeyCacheObject key = it.next().key();
++ try (GridCloseableIterator<CacheDataRow> it = grp.isLocal() ?iterator(cctx.cacheId(), cacheDataStores().iterator()):
++evictionSafeIterator(cctx.cacheId(), cacheDataStores().iterator())) {
+ while (it.hasNext()) {
+ cctx.shared().database().checkpointReadLock();
+
- try {
- KeyCacheObject key = it.next().key();
++ try {KeyCacheObject key = it.next().key();
try {
if (obsoleteVer == null)
@@@ -470,10 -447,10 +469,13 @@@
U.error(log, "Failed to clear cache entry: " + key, e);
}
}
+ finally {
+ cctx.shared().database().checkpointReadUnlock();
+ }
}
+ catch (IgniteCheckedException e) {
+ U.error(log, "Failed to close iterator", e);
+ }
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9db2ad0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9db2ad0/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
index 5ff5b08,eec0273..4c9accf
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@@ -283,8 -283,8 +284,10 @@@ public class IgniteCacheTestSuite2 exte
suite.addTest(new TestSuite(CacheOptimisticTransactionsWithFilterSingleServerTest.class));
suite.addTest(new TestSuite(CacheOptimisticTransactionsWithFilterTest.class));
+ suite.addTest(new TestSuite(NonAffinityCoordinatorDynamicStartStopTest.class));
+
+ suite.addTest(new TestSuite(IgniteCacheClearDuringRebalanceTest.class));
+
return suite;
}
}
[05/26] ignite git commit: Merge remote-tracking branch
'origin/master'
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/master'
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/42b8000c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/42b8000c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/42b8000c
Branch: refs/heads/ignite-2.1.2-exchange
Commit: 42b8000c7fcc5e45315c191b95def11e806cb02c
Parents: 7b17bb8 ec9d47b
Author: sboikov <sb...@gridgain.com>
Authored: Mon Jun 26 13:44:03 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jun 26 13:44:03 2017 +0300
----------------------------------------------------------------------
.../src/main/java/org/apache/ignite/IgniteDataStreamer.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
[07/26] ignite git commit: ignite-5454 Prevent partition tree destroy
while clearing
Posted by sb...@apache.org.
ignite-5454 Prevent partition tree destroy while clearing
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f0c62ac0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f0c62ac0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f0c62ac0
Branch: refs/heads/ignite-2.1.2-exchange
Commit: f0c62ac0fc77b4dbc438dbd23ce756dbebc0659c
Parents: 285644a
Author: Igor Seliverstov <is...@gridgain.com>
Authored: Mon Jun 26 15:43:17 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jun 26 15:43:17 2017 +0300
----------------------------------------------------------------------
.../cache/IgniteCacheOffheapManagerImpl.java | 129 ++++++++++++++++---
.../IgniteCacheClearDuringRebalanceTest.java | 126 ++++++++++++++++++
.../testsuites/IgniteCacheTestSuite2.java | 3 +
3 files changed, 242 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f0c62ac0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
index a4e4c24..b95828c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
@@ -427,26 +427,30 @@ public class IgniteCacheOffheapManagerImpl implements IgniteCacheOffheapManager
@Override public void clearCache(GridCacheContext cctx, boolean readers) {
GridCacheVersion obsoleteVer = null;
- GridIterator<CacheDataRow> it = iterator(cctx.cacheId(), cacheDataStores().iterator());
+ try (GridCloseableIterator<CacheDataRow> it = grp.isLocal() ? iterator(cctx.cacheId(), cacheDataStores().iterator()) :
+ evictionSafeIterator(cctx.cacheId(), cacheDataStores().iterator())) {
+ while (it.hasNext()) {
+ KeyCacheObject key = it.next().key();
- while (it.hasNext()) {
- KeyCacheObject key = it.next().key();
-
- try {
- if (obsoleteVer == null)
- obsoleteVer = ctx.versions().next();
+ try {
+ if (obsoleteVer == null)
+ obsoleteVer = ctx.versions().next();
- GridCacheEntryEx entry = cctx.cache().entryEx(key);
+ GridCacheEntryEx entry = cctx.cache().entryEx(key);
- entry.clear(obsoleteVer, readers);
- }
- catch (GridDhtInvalidPartitionException ignore) {
- // Ignore.
- }
- catch (IgniteCheckedException e) {
- U.error(log, "Failed to clear cache entry: " + key, e);
+ entry.clear(obsoleteVer, readers);
+ }
+ catch (GridDhtInvalidPartitionException ignore) {
+ // Ignore.
+ }
+ catch (IgniteCheckedException e) {
+ U.error(log, "Failed to clear cache entry: " + key, e);
+ }
}
}
+ catch (IgniteCheckedException e) {
+ U.error(log, "Failed to close iterator", e);
+ }
}
/** {@inheritDoc} */
@@ -587,7 +591,7 @@ public class IgniteCacheOffheapManagerImpl implements IgniteCacheOffheapManager
* @param dataIt Data store iterator.
* @return Rows iterator
*/
- private GridIterator<CacheDataRow> iterator(final int cacheId, final Iterator<CacheDataStore> dataIt) {
+ private GridCloseableIterator<CacheDataRow> iterator(final int cacheId, final Iterator<CacheDataStore> dataIt) {
return new GridCloseableIteratorAdapter<CacheDataRow>() {
/** */
private GridCursor<? extends CacheDataRow> cur;
@@ -638,6 +642,99 @@ public class IgniteCacheOffheapManagerImpl implements IgniteCacheOffheapManager
}
/**
+ * @param cacheId Cache ID.
+ * @param dataIt Data store iterator.
+ * @return Rows iterator
+ */
+ private GridCloseableIterator<CacheDataRow> evictionSafeIterator(final int cacheId, final Iterator<CacheDataStore> dataIt) {
+ return new GridCloseableIteratorAdapter<CacheDataRow>() {
+ /** */
+ private GridCursor<? extends CacheDataRow> cur;
+
+ /** */
+ private GridDhtLocalPartition curPart;
+
+ /** */
+ private CacheDataRow next;
+
+ @Override protected CacheDataRow onNext() {
+ CacheDataRow res = next;
+
+ next = null;
+
+ return res;
+ }
+
+ @Override protected boolean onHasNext() throws IgniteCheckedException {
+ if (next != null)
+ return true;
+
+ while (true) {
+ if (cur == null) {
+ if (dataIt.hasNext()) {
+ CacheDataStore ds = dataIt.next();
+
+ if (!reservePartition(ds.partId()))
+ continue;
+
+ cur = cacheId == UNDEFINED_CACHE_ID ? ds.cursor() : ds.cursor(cacheId);
+ }
+ else
+ break;
+ }
+
+ if (cur.next()) {
+ next = cur.get();
+ next.key().partition(curPart.id());
+
+ break;
+ }
+ else {
+ cur = null;
+
+ releaseCurrentPartition();
+ }
+ }
+
+ return next != null;
+ }
+
+ /** */
+ private void releaseCurrentPartition() {
+ GridDhtLocalPartition p = curPart;
+
+ assert p != null;
+
+ curPart = null;
+
+ p.release();
+ }
+
+ /**
+ * @param partId Partition number.
+ * @return {@code True} if partition was reserved.
+ */
+ private boolean reservePartition(int partId) {
+ GridDhtLocalPartition p = grp.topology().localPartition(partId);
+
+ if (p != null && p.reserve()) {
+ curPart = p;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void onClose() throws IgniteCheckedException {
+ if (curPart != null)
+ releaseCurrentPartition();
+ }
+ };
+ }
+
+ /**
* @param item Item.
* @return Single item iterator.
*/
http://git-wip-us.apache.org/repos/asf/ignite/blob/f0c62ac0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheClearDuringRebalanceTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheClearDuringRebalanceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheClearDuringRebalanceTest.java
new file mode 100644
index 0000000..8561c5c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheClearDuringRebalanceTest.java
@@ -0,0 +1,126 @@
+/*
+ * 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.dht;
+
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+
+/**
+ *
+ */
+public class IgniteCacheClearDuringRebalanceTest extends GridCommonAbstractTest {
+ /** */
+ private static final String CACHE_NAME = "cache";
+
+ /** */
+ private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ super.afterTest();
+
+ stopAllGrids();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+ TcpDiscoverySpi spi = new TcpDiscoverySpi();
+
+ spi.setIpFinder(ipFinder);
+
+ cfg.setDiscoverySpi(spi);
+
+ cfg.setCacheConfiguration(new CacheConfiguration(CACHE_NAME)
+ .setCacheMode(PARTITIONED));
+
+ return cfg;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testClearAll() throws Exception {
+ final IgniteEx node = startGrid(0);
+
+ for (int i = 0; i < 5; i++) {
+ populate(node);
+
+ try {
+ startGrid(1).cache(CACHE_NAME).clear();
+ }
+ finally {
+ stopGrid(1);
+ }
+ }
+
+ populate(node);
+
+ startGrid(1).cache(CACHE_NAME).clear();
+
+ startGrid(2);
+ }
+
+ /**
+ * @param node Ignite node;
+ * @throws Exception If failed.
+ */
+ private void populate(final Ignite node) throws Exception {
+ final AtomicInteger id = new AtomicInteger();
+
+ final int tCnt = Runtime.getRuntime().availableProcessors();
+
+ final byte[] data = new byte[1024];
+
+ ThreadLocalRandom.current().nextBytes(data);
+
+ GridTestUtils.runMultiThreaded(new Runnable() {
+ @Override public void run() {
+ try (IgniteDataStreamer<Object, Object> str = node.dataStreamer(CACHE_NAME)) {
+ int idx = id.getAndIncrement();
+
+ str.autoFlushFrequency(0);
+
+ for (int i = idx; i < 500_000; i += tCnt) {
+ str.addData(i, data);
+
+ if (i % (100 * tCnt) == idx)
+ str.flush();
+ }
+
+ str.flush();
+ }
+ }
+ }, tCnt, "ldr");
+
+ assertEquals(500_000, node.cache(CACHE_NAME).size());
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/f0c62ac0/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 158b118..eec0273 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
@@ -80,6 +80,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridCachePart
import org.apache.ignite.internal.processors.cache.distributed.dht.GridCachePartitionedPreloadEventsSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridCachePartitionedTopologyChangeSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridCachePartitionedUnloadEventsSelfTest;
+import org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCacheClearDuringRebalanceTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCachePartitionedBackupNodeFailureRecoveryTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheAtomicNearEvictionEventSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheAtomicNearMultiNodeSelfTest;
@@ -282,6 +283,8 @@ public class IgniteCacheTestSuite2 extends TestSuite {
suite.addTest(new TestSuite(CacheOptimisticTransactionsWithFilterSingleServerTest.class));
suite.addTest(new TestSuite(CacheOptimisticTransactionsWithFilterTest.class));
+ suite.addTest(new TestSuite(IgniteCacheClearDuringRebalanceTest.class));
+
return suite;
}
}
[14/26] ignite git commit: Added test for concurrent activation and
node join.
Posted by sb...@apache.org.
Added test for concurrent activation and node join.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/acf0441b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/acf0441b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/acf0441b
Branch: refs/heads/ignite-2.1.2-exchange
Commit: acf0441b043a04cd01200d955e64d73e40436cd0
Parents: f2a5a93
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 27 14:10:41 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 27 14:10:41 2017 +0300
----------------------------------------------------------------------
.../cache/IgniteActiveClusterTest.java | 182 +++++++++++++++++++
1 file changed, 182 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/acf0441b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteActiveClusterTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteActiveClusterTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteActiveClusterTest.java
new file mode 100644
index 0000000..cf68767
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteActiveClusterTest.java
@@ -0,0 +1,182 @@
+/*
+ * 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 java.util.concurrent.Callable;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+
+/**
+ *
+ */
+public class IgniteActiveClusterTest extends GridCommonAbstractTest {
+ /** */
+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+ /** */
+ private boolean client;
+
+ /** */
+ private boolean active = true;
+
+ /** */
+ private CacheConfiguration ccfg;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+ ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
+
+ cfg.setClientMode(client);
+
+ cfg.setActiveOnStart(active);
+
+ if (ccfg != null) {
+ cfg.setCacheConfiguration(ccfg);
+
+ ccfg = null;
+ }
+
+ return cfg;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testActivate() throws Exception {
+ active = false;
+
+ for (int i = 0; i < 3; i++) {
+ ccfg = cacheConfiguration(DEFAULT_CACHE_NAME);
+
+ startGrid(i);
+ }
+
+ ignite(0).active(true);
+
+ startGrid(3);
+
+ for (int i = 0; i < 4; i++) {
+ IgniteCache<Integer, Integer> cache = ignite(i).cache(DEFAULT_CACHE_NAME);
+
+ for (int j = 0; j < 10; j++) {
+ ThreadLocalRandom rnd = ThreadLocalRandom.current();
+
+ Integer key = rnd.nextInt(1000);
+
+ cache.put(key, j);
+
+ assertEquals((Integer)j, cache.get(key));
+ }
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testJoinAndActivate() throws Exception {
+ for (int iter = 0; iter < 3; iter++) {
+ log.info("Iteration: " + iter);
+
+ active = false;
+
+ for (int i = 0; i < 3; i++) {
+ ccfg = cacheConfiguration(DEFAULT_CACHE_NAME);
+
+ startGrid(i);
+ }
+
+ final int START_NODES = 3;
+
+ final CyclicBarrier b = new CyclicBarrier(START_NODES + 1);
+
+ IgniteInternalFuture<?> fut1 = GridTestUtils.runAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ b.await();
+
+ Thread.sleep(ThreadLocalRandom.current().nextLong(100) + 1);
+
+ ignite(0).active(true);
+
+ return null;
+ }
+ });
+
+ final AtomicInteger nodeIdx = new AtomicInteger(3);
+
+ IgniteInternalFuture<?> fut2 = GridTestUtils.runMultiThreadedAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ int idx = nodeIdx.getAndIncrement();
+
+ b.await();
+
+ startGrid(idx);
+
+ return null;
+ }
+ }, START_NODES, "start-node");
+
+ fut1.get();
+ fut2.get();
+
+ for (int i = 0; i < 6; i++) {
+ IgniteCache<Integer, Integer> cache = ignite(i).cache(DEFAULT_CACHE_NAME);
+
+ for (int j = 0; j < 10; j++) {
+ ThreadLocalRandom rnd = ThreadLocalRandom.current();
+
+ Integer key = rnd.nextInt(1000);
+
+ cache.put(key, j);
+
+ assertEquals((Integer)j, cache.get(key));
+ }
+ }
+
+ stopAllGrids();
+ }
+ }
+
+ /**
+ * @param name Cache name.
+ * @return Cache configuration.
+ */
+ private CacheConfiguration cacheConfiguration(String name) {
+ CacheConfiguration ccfg = new CacheConfiguration(name);
+
+ ccfg.setWriteSynchronizationMode(FULL_SYNC);
+ ccfg.setAtomicityMode(TRANSACTIONAL);
+ ccfg.setBackups(3);
+
+ return ccfg;
+ }
+}
[20/26] ignite git commit: IGNITE-5577 Added missed fields to DTO.
Posted by sb...@apache.org.
IGNITE-5577 Added missed fields to DTO.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1cb97728
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1cb97728
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1cb97728
Branch: refs/heads/ignite-2.1.2-exchange
Commit: 1cb9772833261a14afc8aae3e6005df7fb28b83f
Parents: 4adfca9
Author: vsisko <vs...@gridgain.com>
Authored: Wed Jun 28 10:44:33 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Wed Jun 28 10:44:33 2017 +0700
----------------------------------------------------------------------
.../internal/visor/VisorDataTransferObject.java | 8 ++++-
.../node/VisorMemoryPolicyConfiguration.java | 36 +++++++++++++++-----
2 files changed, 35 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1cb97728/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorDataTransferObject.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorDataTransferObject.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorDataTransferObject.java
index c562662..8660891 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorDataTransferObject.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorDataTransferObject.java
@@ -35,6 +35,12 @@ public abstract class VisorDataTransferObject implements Externalizable {
/** Magic number to detect correct transfer objects. */
private static final int MAGIC = 0x42BEEF00;
+ /** Version 1. */
+ protected static final byte V1 = 1;
+
+ /** Version 2. */
+ protected static final byte V2 = 2;
+
/**
* @param col Source collection.
* @param <T> Collection type.
@@ -63,7 +69,7 @@ public abstract class VisorDataTransferObject implements Externalizable {
* @return Transfer object version.
*/
public byte getProtocolVersion() {
- return 1;
+ return V1;
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/1cb97728/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
index dedd71c..4f8d15e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
@@ -36,8 +36,11 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject {
/** Unique name of MemoryPolicy. */
private String name;
- /** Page memory size in bytes. */
- private long size;
+ /** Maximum memory region size defined by this memory policy. */
+ private long maxSize;
+
+ /** Initial memory region size defined by this memory policy. */
+ private long initSize;
/** Path for memory mapped file. */
private String swapFilePath;
@@ -70,13 +73,19 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject {
assert plc != null;
name = plc.getName();
- size = plc.getMaxSize();
+ maxSize = plc.getMaxSize();
+ initSize = plc.getInitialSize();
swapFilePath = plc.getSwapFilePath();
pageEvictionMode = plc.getPageEvictionMode();
evictionThreshold = plc.getEvictionThreshold();
emptyPagesPoolSize = plc.getEmptyPagesPoolSize();
}
+ /** {@inheritDoc} */
+ @Override public byte getProtocolVersion() {
+ return V2;
+ }
+
/**
* Unique name of MemoryPolicy.
*/
@@ -85,10 +94,17 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject {
}
/**
- * Page memory size in bytes.
+ * Maximum memory region size defined by this memory policy.
*/
- public long getSize() {
- return size;
+ public long getMaxSize() {
+ return maxSize;
+ }
+
+ /**
+ * Initial memory region size defined by this memory policy.
+ */
+ public long getInitSize() {
+ return initSize;
}
/**
@@ -122,21 +138,25 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject {
/** {@inheritDoc} */
@Override protected void writeExternalData(ObjectOutput out) throws IOException {
U.writeString(out, name);
- out.writeLong(size);
+ out.writeLong(maxSize);
U.writeString(out, swapFilePath);
U.writeEnum(out, pageEvictionMode);
out.writeDouble(evictionThreshold);
out.writeInt(emptyPagesPoolSize);
+ out.writeLong(initSize);
}
/** {@inheritDoc} */
@Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
name = U.readString(in);
- size = in.readLong();
+ maxSize = in.readLong();
swapFilePath = U.readString(in);
pageEvictionMode = DataPageEvictionMode.fromOrdinal(in.readByte());
evictionThreshold = in.readDouble();
emptyPagesPoolSize = in.readInt();
+
+ if (protoVer >= V2)
+ initSize = in.readLong();
}
/** {@inheritDoc} */
[26/26] ignite git commit: Merge remote-tracking branch
'remotes/community/ignite-2.1.2' into ignite-2.1.2-exchange
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/community/ignite-2.1.2' into ignite-2.1.2-exchange
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/02597402
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/02597402
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/02597402
Branch: refs/heads/ignite-2.1.2-exchange
Commit: 025974023a7c97db05ba62cbee95261661aba2d3
Parents: c95b860 764eeea
Author: sboikov <sb...@gridgain.com>
Authored: Wed Jun 28 09:09:59 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Jun 28 09:09:59 2017 +0300
----------------------------------------------------------------------
.../org/apache/ignite/IgniteDataStreamer.java | 12 +-
.../cache/CacheAffinitySharedManager.java | 21 +-
.../cache/GridCacheSharedContext.java | 3 +-
.../cache/IgniteCacheOffheapManagerImpl.java | 137 +++++--
.../binary/CacheObjectBinaryProcessorImpl.java | 4 +-
.../dht/GridClientPartitionTopology.java | 2 +-
.../dht/GridDhtPartitionTopologyImpl.java | 153 ++++----
.../colocated/GridDhtColocatedLockFuture.java | 4 +-
.../dht/preloader/GridDhtPartitionDemander.java | 4 +-
.../GridDhtPartitionsExchangeFuture.java | 24 +-
.../distributed/near/GridNearLockFuture.java | 4 +-
.../cache/local/GridLocalLockFuture.java | 5 +-
.../GridCacheDatabaseSharedManager.java | 9 +-
.../persistence/GridCacheOffheapManager.java | 31 +-
.../IgniteCacheDatabaseSharedManager.java | 1 -
.../persistence/pagemem/PageMemoryImpl.java | 21 +-
.../internal/visor/VisorDataTransferObject.java | 8 +-
.../ignite/internal/visor/cache/VisorCache.java | 20 +-
.../cache/VisorCacheAggregatedMetrics.java | 6 +-
.../internal/visor/cache/VisorCacheMetrics.java | 28 ++
.../visor/cache/VisorMemoryMetrics.java | 10 +-
.../node/VisorMemoryPolicyConfiguration.java | 36 +-
.../resources/META-INF/classnames.properties | 46 +--
.../GridDiscoveryManagerAliveCacheSelfTest.java | 2 -
.../cache/IgniteActiveClusterTest.java | 182 ++++++++++
.../IgniteCacheClearDuringRebalanceTest.java | 126 +++++++
.../persistence/IgnitePdsDynamicCacheTest.java | 11 +
.../cache/transactions/TxDeadlockCauseTest.java | 279 +++++++++++++++
.../junits/GridTestKernalContext.java | 1 +
.../testsuites/IgniteCacheTestSuite2.java | 3 +
.../DynamicIndexAbstractBasicSelfTest.java | 81 ++++-
...exingComplexClientAtomicPartitionedTest.java | 33 ++
...dexingComplexClientAtomicReplicatedTest.java | 33 ++
...mplexClientTransactionalPartitionedTest.java | 33 ++
...omplexClientTransactionalReplicatedTest.java | 33 ++
...exingComplexServerAtomicPartitionedTest.java | 33 ++
...dexingComplexServerAtomicReplicatedTest.java | 33 ++
...mplexServerTransactionalPartitionedTest.java | 33 ++
...omplexServerTransactionalReplicatedTest.java | 33 ++
.../index/H2DynamicIndexingComplexTest.java | 356 +++++++++++++++++++
.../cache/index/H2DynamicTableSelfTest.java | 182 ++++++++--
.../IgniteCacheQuerySelfTestSuite.java | 30 +-
.../Cache/Query/CacheQueriesTest.cs | 7 +
.../Impl/Cache/CacheEntryFilterHolder.cs | 13 +
.../cluster-select/cluster-select.controller.js | 51 +--
.../cluster-select/cluster-select.pug | 16 +-
.../app/modules/agent/AgentManager.service.js | 174 +++++----
.../frontend/app/modules/cluster/Cache.js | 19 +-
.../modules/configuration/Version.service.js | 9 +-
.../configuration/generator/Maven.service.js | 159 +++++----
.../frontend/app/primitives/ui-grid/index.scss | 8 -
.../views/templates/agent-download.tpl.pug | 9 +-
.../ignite/console/agent/rest/RestExecutor.java | 12 +-
53 files changed, 2133 insertions(+), 450 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/02597402/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/02597402/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 77963e9,4ca9643..e19cc72
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@@ -1336,13 -1271,12 +1337,14 @@@ public class GridDhtPartitionsExchangeF
}
}
- if (discoEvt.type() == EVT_NODE_LEFT ||
+ if (serverNodeDiscoveryEvent() &&
+ (discoEvt.type() == EVT_NODE_LEFT ||
discoEvt.type() == EVT_NODE_FAILED ||
- discoEvt.type() == EVT_NODE_JOINED)
+ discoEvt.type() == EVT_NODE_JOINED))
detectLostPartitions();
+ long start = U.currentTimeMillis();
+
Map<Integer, CacheValidation> m = U.newHashMap(cctx.cache().cacheGroups().size());
for (CacheGroupContext grp : cctx.cache().cacheGroups())
[16/26] ignite git commit: ignite-gg-12052 code comments
Posted by sb...@apache.org.
ignite-gg-12052 code comments
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1d88bec2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1d88bec2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1d88bec2
Branch: refs/heads/ignite-2.1.2-exchange
Commit: 1d88bec2da02b6343ee867e4fbc25b00e67c1fd6
Parents: 07bf0f6
Author: Dmitriy Govorukhin <dm...@gmail.com>
Authored: Tue Jun 27 16:13:30 2017 +0300
Committer: Dmitriy Govorukhin <dm...@gmail.com>
Committed: Tue Jun 27 16:13:30 2017 +0300
----------------------------------------------------------------------
.../cache/persistence/GridCacheDatabaseSharedManager.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1d88bec2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
index b9ff7e7..990f54c 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
@@ -676,8 +676,10 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
ByteBuffer pageBuf,
Integer tag
) throws IgniteCheckedException {
+ // First of all, write page to disk.
storeMgr.write(fullId.cacheId(), fullId.pageId(), pageBuf, tag);
+ // Only after write we can write page into snapshot.
snapshotMgr.flushDirtyPageHandler(fullId, pageBuf, tag);
}
},
@@ -2381,7 +2383,8 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
PageMemoryEx pageMem = (PageMemoryEx)grp.memoryPolicy().pageMemory();
- Integer tag = pageMem.getForCheckpoint(fullId, tmpWriteBuf, persStoreMetrics.metricsEnabled() ? tracker : null);
+ Integer tag = pageMem.getForCheckpoint(
+ fullId, tmpWriteBuf, persStoreMetrics.metricsEnabled() ? tracker : null);
if (tag != null) {
tmpWriteBuf.rewind();
[25/26] ignite git commit: Merge remote-tracking branch
'community/ignite-2.1.2' into ignite-2.1.2
Posted by sb...@apache.org.
Merge remote-tracking branch 'community/ignite-2.1.2' into ignite-2.1.2
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/764eeeaa
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/764eeeaa
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/764eeeaa
Branch: refs/heads/ignite-2.1.2-exchange
Commit: 764eeeaa387f1800d0501cc1e7060c1125b3ad72
Parents: f0f5963 cff23a9
Author: sboikov <sb...@gridgain.com>
Authored: Wed Jun 28 09:07:17 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Jun 28 09:07:17 2017 +0300
----------------------------------------------------------------------
.../IgniteCacheDatabaseSharedManager.java | 1 -
.../internal/visor/VisorDataTransferObject.java | 8 +-
.../ignite/internal/visor/cache/VisorCache.java | 20 ++-
.../cache/VisorCacheAggregatedMetrics.java | 6 +-
.../internal/visor/cache/VisorCacheMetrics.java | 28 +++
.../visor/cache/VisorMemoryMetrics.java | 10 +-
.../node/VisorMemoryPolicyConfiguration.java | 36 +++-
.../resources/META-INF/classnames.properties | 46 ++---
.../cluster-select/cluster-select.controller.js | 51 +++---
.../cluster-select/cluster-select.pug | 16 +-
.../app/modules/agent/AgentManager.service.js | 174 +++++++++++--------
.../frontend/app/modules/cluster/Cache.js | 19 +-
.../modules/configuration/Version.service.js | 9 +-
.../configuration/generator/Maven.service.js | 159 +++++++++--------
.../views/templates/agent-download.tpl.pug | 9 +-
.../ignite/console/agent/rest/RestExecutor.java | 12 +-
16 files changed, 347 insertions(+), 257 deletions(-)
----------------------------------------------------------------------