You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2017/07/04 10:02:07 UTC
[01/50] ignite git commit: Merge remote-tracking branch
'professional/ignite-gg-12336' into ignite-2.1.2
Repository: ignite
Updated Branches:
refs/heads/master 5093660d7 -> 15613e2af
Merge remote-tracking branch 'professional/ignite-gg-12336' 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/94fd7318
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/94fd7318
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/94fd7318
Branch: refs/heads/master
Commit: 94fd73186b591328f2244818174cd8a2f5a45be9
Parents: 0d68cef b999926
Author: Dmitriy Govorukhin <dm...@gmail.com>
Authored: Fri Jun 23 10:53:05 2017 +0300
Committer: Dmitriy Govorukhin <dm...@gmail.com>
Committed: Fri Jun 23 10:53:05 2017 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 10 +++-
.../IgniteStandByClusterTest.java | 51 ++++++++++++++++++++
2 files changed, 60 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
[08/50] ignite git commit: added javadoc to class header of
GridNearGetRequest
Posted by vo...@apache.org.
added javadoc to class header of GridNearGetRequest
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7538ed19
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7538ed19
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7538ed19
Branch: refs/heads/master
Commit: 7538ed19b18b445b01f83daf7d5bfacd37e8f9a5
Parents: 62a427b
Author: Ivan Rakov <iv...@gmail.com>
Authored: Fri Jun 23 20:20:07 2017 +0300
Committer: Ivan Rakov <iv...@gmail.com>
Committed: Fri Jun 23 20:20:07 2017 +0300
----------------------------------------------------------------------
.../processors/cache/distributed/near/GridNearGetRequest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/7538ed19/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
index a550aa3..1bffac4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
@@ -47,7 +47,7 @@ import org.apache.ignite.plugin.extensions.communication.MessageWriter;
import org.jetbrains.annotations.NotNull;
/**
- * Get request. Responsible for obtaining entry from primary code. 'Near' means 'Primary' here, not 'Near Cache'.
+ * Get request. Responsible for obtaining entry from primary node. 'Near' means 'Primary' here, not 'Near Cache'.
*/
public class GridNearGetRequest extends GridCacheIdMessage implements GridCacheDeployable,
GridCacheVersionable {
[23/50] ignite git commit: Merge remote-tracking branch
'remotes/origin/master' into ignite-2.1.2
Posted by vo...@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/master
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
----------------------------------------------------------------------
[48/50] ignite git commit: Reduced amount of debug logging.
Posted by vo...@apache.org.
Reduced amount of debug logging.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/211caf15
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/211caf15
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/211caf15
Branch: refs/heads/master
Commit: 211caf15fa4d2f01ac09c7de414272b8c0d8d908
Parents: ae5ec94
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jul 4 11:21:49 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jul 4 11:21:49 2017 +0300
----------------------------------------------------------------------
.../processors/affinity/GridAffinityAssignmentCache.java | 8 +++++++-
.../processors/cache/GridCachePartitionExchangeManager.java | 8 ++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/211caf15/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index 71ec3ea..a8c6c59 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -431,8 +431,10 @@ public class GridAffinityAssignmentCache {
/**
* Dumps debug information.
+ *
+ * @return {@code True} if there are pending futures.
*/
- public void dumpDebugInfo() {
+ public boolean dumpDebugInfo() {
if (!readyFuts.isEmpty()) {
U.warn(log, "First 3 pending affinity ready futures [grp=" + cacheOrGrpName +
", total=" + readyFuts.size() +
@@ -446,7 +448,11 @@ public class GridAffinityAssignmentCache {
if (++cnt == 3)
break;
}
+
+ return true;
}
+
+ return false;
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/211caf15/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 2b5a4ff..f07119a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -1636,6 +1636,8 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
}
}
+ int affDumpCnt = 0;
+
for (CacheGroupContext grp : cctx.cache().cacheGroups()) {
if (grp.isLocal())
continue;
@@ -1647,8 +1649,10 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
GridAffinityAssignmentCache aff = grp.affinity();
- if (aff != null)
- aff.dumpDebugInfo();
+ if (aff != null && affDumpCnt < 5) {
+ if (aff.dumpDebugInfo())
+ affDumpCnt++;
+ }
}
}
[13/50] ignite git commit: Merge remote-tracking branch
'remotes/origin/master' into ignite-2.1.2
Posted by vo...@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/master
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;
}
}
[22/50] ignite git commit: IGNITE-5599 Added check that node URL is
valid. Added warning about ignite-rest-http.
Posted by vo...@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/master
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 + "]");
}
}
[16/50] ignite git commit: Added test for concurrent activation and
node join.
Posted by vo...@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/master
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;
+ }
+}
[26/50] ignite git commit: ignite-2.1.2 Limit amount of debug logging
Posted by vo...@apache.org.
ignite-2.1.2 Limit amount of debug logging
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d6972e95
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d6972e95
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d6972e95
Branch: refs/heads/master
Commit: d6972e95367d93c1015b6bab8dd4dc78ae2fc1e6
Parents: 764eeea
Author: sboikov <sb...@gridgain.com>
Authored: Wed Jun 28 11:30:47 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Jun 28 11:30:47 2017 +0300
----------------------------------------------------------------------
.../affinity/GridAffinityAssignmentCache.java | 14 ++++++++---
.../GridCachePartitionExchangeManager.java | 25 +++++++++++++++-----
2 files changed, 30 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d6972e95/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index b478462..71ec3ea 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -88,7 +88,7 @@ public class GridAffinityAssignmentCache {
private final AtomicReference<GridAffinityAssignment> head;
/** Ready futures. */
- private final ConcurrentMap<AffinityTopologyVersion, AffinityReadyFuture> readyFuts = new ConcurrentHashMap8<>();
+ private final ConcurrentMap<AffinityTopologyVersion, AffinityReadyFuture> readyFuts = new ConcurrentSkipListMap<>();
/** Log. */
private final IgniteLogger log;
@@ -434,10 +434,18 @@ public class GridAffinityAssignmentCache {
*/
public void dumpDebugInfo() {
if (!readyFuts.isEmpty()) {
- U.warn(log, "Pending affinity ready futures [grp=" + cacheOrGrpName + ", lastVer=" + lastVersion() + "]:");
+ U.warn(log, "First 3 pending affinity ready futures [grp=" + cacheOrGrpName +
+ ", total=" + readyFuts.size() +
+ ", lastVer=" + lastVersion() + "]:");
- for (AffinityReadyFuture fut : readyFuts.values())
+ int cnt = 0;
+
+ for (AffinityReadyFuture fut : readyFuts.values()) {
U.warn(log, ">>> " + fut);
+
+ if (++cnt == 3)
+ break;
+ }
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d6972e95/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 322da18..19d99a4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -154,7 +154,8 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
private final AtomicReference<GridDhtTopologyFuture> lastFinishedFut = new AtomicReference<>();
/** */
- private final ConcurrentMap<AffinityTopologyVersion, AffinityReadyFuture> readyFuts = new ConcurrentHashMap8<>();
+ private final ConcurrentMap<AffinityTopologyVersion, AffinityReadyFuture> readyFuts =
+ new ConcurrentSkipListMap<>();
/** */
private final ConcurrentSkipListMap<AffinityTopologyVersion, IgnitePair<IgniteProductVersion>> nodeVers =
@@ -1402,10 +1403,16 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
exchWorker.dumpExchangeDebugInfo();
if (!readyFuts.isEmpty()) {
- U.warn(diagnosticLog, "Pending affinity ready futures:");
+ U.warn(diagnosticLog, "First 5 pending affinity ready futures [total=" + readyFuts.size() + ']');
+
+ int cnt = 0;
- for (AffinityReadyFuture fut : readyFuts.values())
+ for (AffinityReadyFuture fut : readyFuts.values()) {
U.warn(diagnosticLog, ">>> " + fut);
+
+ if (++cnt == 5)
+ break;
+ }
}
IgniteDiagnosticPrepareContext diagCtx = cctx.kernalContext().cluster().diagnosticEnabled() ?
@@ -1775,11 +1782,17 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
* Dump debug info.
*/
void dumpExchangeDebugInfo() {
- U.warn(log, "Pending exchange futures:");
+ U.warn(log, "First 10 pending exchange futures [total=" + futQ.size() + ']');
- for (CachePartitionExchangeWorkerTask task: futQ) {
- if (isExchangeTask(task))
+ int cnt = 0;
+
+ for (CachePartitionExchangeWorkerTask task : futQ) {
+ if (isExchangeTask(task)) {
U.warn(log, ">>> " + ((GridDhtPartitionsExchangeFuture)task).shortInfo());
+
+ if (++cnt == 10)
+ break;
+ }
}
}
[34/50] ignite git commit: ignite-2.1.2 detectLostPartitions minor
optimization
Posted by vo...@apache.org.
ignite-2.1.2 detectLostPartitions minor optimization
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5699be75
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5699be75
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5699be75
Branch: refs/heads/master
Commit: 5699be758110d007c2cae3da2edf83245c01907f
Parents: db8112f
Author: sboikov <sb...@gridgain.com>
Authored: Fri Jun 30 09:21:41 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Jun 30 09:21:41 2017 +0300
----------------------------------------------------------------------
.../cache/distributed/dht/GridDhtPartitionTopologyImpl.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5699be75/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 a6f1831..1eab708 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
@@ -1556,8 +1556,12 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
for (GridDhtPartitionMap partMap : node2part.values()) {
for (Map.Entry<Integer, GridDhtPartitionState> e : partMap.entrySet()) {
- if (e.getValue() == OWNING)
+ if (e.getValue() == OWNING) {
lost.remove(e.getKey());
+
+ if (lost.isEmpty())
+ break;
+ }
}
}
[41/50] ignite git commit: IGNITE-5529 Stop exchange worker before
cancelling exchange futures.
Posted by vo...@apache.org.
IGNITE-5529 Stop exchange worker before cancelling exchange futures.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ddeb935b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ddeb935b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ddeb935b
Branch: refs/heads/master
Commit: ddeb935b12009fa969f5971a51a054d429045c8b
Parents: 18bbb14
Author: Pavel Kovalenko <jo...@gmail.com>
Authored: Mon Jul 3 11:39:57 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jul 3 11:39:57 2017 +0300
----------------------------------------------------------------------
.../cache/GridCachePartitionExchangeManager.java | 15 ++++++++-------
.../near/GridCachePartitionedNodeRestartTest.java | 5 -----
2 files changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ddeb935b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 19d99a4..85719b7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -522,6 +522,14 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
"Client node disconnected: " + cctx.igniteInstanceName()) :
new IgniteInterruptedCheckedException("Node is stopping: " + cctx.igniteInstanceName());
+ // Stop exchange worker
+ U.cancel(exchWorker);
+
+ if (log.isDebugEnabled())
+ log.debug("Before joining on exchange worker: " + exchWorker);
+
+ U.join(exchWorker, log);
+
// Finish all exchange futures.
ExchangeFutureSet exchFuts0 = exchFuts;
@@ -538,13 +546,6 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
cctx.io().removeOrderedHandler(true, rebalanceTopic(cnt));
}
- U.cancel(exchWorker);
-
- if (log.isDebugEnabled())
- log.debug("Before joining on exchange worker: " + exchWorker);
-
- U.join(exchWorker, log);
-
ResendTimeoutObject resendTimeoutObj = pendingResend.getAndSet(null);
if (resendTimeoutObj != null)
http://git-wip-us.apache.org/repos/asf/ignite/blob/ddeb935b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java
index 1d325a5..d7a0cdd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNodeRestartTest.java
@@ -56,11 +56,6 @@ public class GridCachePartitionedNodeRestartTest extends GridCacheAbstractNodeRe
return cc;
}
- @Override protected void beforeTest() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-5529");
- }
-
-
/** {@inheritDoc} */
@Override public void testRestart() throws Exception {
super.testRestart();
[11/50] ignite git commit: GG-12168 Do not store partitions state for
local caches
Posted by vo...@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/master
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);
}
[09/50] ignite git commit: IGNITE-4467 Fix webconsole frontend build.
Posted by vo...@apache.org.
IGNITE-4467 Fix webconsole frontend build.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e35358ca
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e35358ca
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e35358ca
Branch: refs/heads/master
Commit: e35358cabb08b62166f6ff7dfa6b55296ac68704
Parents: 7538ed1
Author: Ilya Borisov <Kl...@gmail.com>
Authored: Mon Jun 26 10:22:27 2017 +0700
Committer: Ilya Borisov <Kl...@gmail.com>
Committed: Mon Jun 26 10:22:27 2017 +0700
----------------------------------------------------------------------
modules/web-console/frontend/app/helpers/jade/mixins.pug | 1 -
modules/web-console/frontend/app/primitives/index.js | 1 -
2 files changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e35358ca/modules/web-console/frontend/app/helpers/jade/mixins.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/helpers/jade/mixins.pug b/modules/web-console/frontend/app/helpers/jade/mixins.pug
index 50a0208..e18fcb1 100644
--- a/modules/web-console/frontend/app/helpers/jade/mixins.pug
+++ b/modules/web-console/frontend/app/helpers/jade/mixins.pug
@@ -21,7 +21,6 @@ include ../../primitives/timepicker/index
include ../../primitives/dropdown/index
include ../../primitives/tooltip/index
include ../../primitives/ui-grid-settings/index
-include ../../primitives/radio/index
include ../../primitives/switcher/index
//- Mixin for advanced options toggle.
http://git-wip-us.apache.org/repos/asf/ignite/blob/e35358ca/modules/web-console/frontend/app/primitives/index.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/index.js b/modules/web-console/frontend/app/primitives/index.js
index 30f7d7e..219581c 100644
--- a/modules/web-console/frontend/app/primitives/index.js
+++ b/modules/web-console/frontend/app/primitives/index.js
@@ -28,7 +28,6 @@ import './ui-grid/index.scss';
import './ui-grid-header/index.scss';
import './ui-grid-settings/index.scss';
import './page/index.scss';
-import './radio/index.scss';
import './switcher/index.scss';
import './form-field/index.scss';
import './typography/index.scss';
[43/50] ignite git commit: Optimize allocations in
GridPartitionStateMap
Posted by vo...@apache.org.
Optimize allocations in GridPartitionStateMap
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e1ce7c97
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e1ce7c97
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e1ce7c97
Branch: refs/heads/master
Commit: e1ce7c972cc128b7aa82eb9baab50623292dc202
Parents: f202e0f
Author: Alexei Scherbakov <al...@gmail.com>
Authored: Mon Jul 3 13:49:52 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Mon Jul 3 13:49:52 2017 +0300
----------------------------------------------------------------------
.../GridCachePartitionExchangeManager.java | 8 +-
.../dht/GridClientPartitionTopology.java | 5 +-
.../dht/GridDhtPartitionTopologyImpl.java | 7 +-
.../dht/preloader/GridDhtPartitionMap.java | 13 +-
.../internal/util/GridPartitionStateMap.java | 60 ++++++-
.../CacheLateAffinityAssignmentTest.java | 8 +-
.../testsuites/IgniteUtilSelfTestSuite.java | 3 +
.../ignite/util/GridPartitionMapSelfTest.java | 162 +++++++++++++++++++
8 files changed, 240 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e1ce7c97/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 85719b7..0e541c8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -64,7 +64,6 @@ import org.apache.ignite.internal.pagemem.snapshot.StartSnapshotOperationAckDisc
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.affinity.GridAffinityAssignmentCache;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridClientPartitionTopology;
-import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTopologyFuture;
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemandMessage;
@@ -86,6 +85,7 @@ import org.apache.ignite.internal.processors.query.schema.SchemaNodeLeaveExchang
import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
import org.apache.ignite.internal.util.GridListSet;
import org.apache.ignite.internal.util.future.GridCompoundFuture;
+import org.apache.ignite.internal.util.GridPartitionStateMap;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.lang.IgnitePair;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
@@ -1039,7 +1039,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
cctx.versions().last(),
true);
- Map<Object, T2<Integer,Map<Integer, GridDhtPartitionState>>> dupData = new HashMap<>();
+ Map<Object, T2<Integer, GridPartitionStateMap>> dupData = new HashMap<>();
for (CacheGroupContext grp : cctx.cache().cacheGroups()) {
if (!grp.isLocal()) {
@@ -1086,7 +1086,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
* @param affKey Cache affinity key.
*/
private void addPartitionMap(GridDhtPartitionsSingleMessage m,
- Map<Object, T2<Integer, Map<Integer, GridDhtPartitionState>>> dupData,
+ Map<Object, T2<Integer, GridPartitionStateMap>> dupData,
boolean compress,
Integer cacheId,
GridDhtPartitionMap map,
@@ -1094,7 +1094,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
Integer dupDataCache = null;
if (compress) {
- T2<Integer, Map<Integer, GridDhtPartitionState>> state0 = dupData.get(affKey);
+ T2<Integer, GridPartitionStateMap> state0 = dupData.get(affKey);
if (state0 != null && state0.get2().equals(map.map())) {
dupDataCache = state0.get1();
http://git-wip-us.apache.org/repos/asf/ignite/blob/e1ce7c97/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 26d12d6..9e9f4fb 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
@@ -43,6 +43,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.Gri
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.GridAtomicLong;
+import org.apache.ignite.internal.util.GridPartitionStateMap;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.T2;
@@ -396,7 +397,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
try {
return new GridDhtPartitionMap(cctx.localNodeId(), updateSeq.get(), topVer,
- Collections.<Integer, GridDhtPartitionState>emptyMap(), true);
+ GridPartitionStateMap.EMPTY, true);
}
finally {
lock.readLock().unlock();
@@ -874,7 +875,7 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
if (map == null)
node2part.put(nodeId, map = new GridDhtPartitionMap(nodeId, updateSeq, topVer,
- Collections.<Integer, GridDhtPartitionState>emptyMap(), false));
+ GridPartitionStateMap.EMPTY, false));
map.updateSequence(updateSeq, topVer);
http://git-wip-us.apache.org/repos/asf/ignite/blob/e1ce7c97/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 1eab708..c205c3b 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
@@ -49,6 +49,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.Gri
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.GridAtomicLong;
+import org.apache.ignite.internal.util.GridPartitionStateMap;
import org.apache.ignite.internal.util.StripedCompositeReadWriteLock;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.typedef.F;
@@ -813,7 +814,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
/** {@inheritDoc} */
@Override public GridDhtPartitionMap localPartitionMap() {
- Map<Integer, GridDhtPartitionState> map = new HashMap<>();
+ GridPartitionStateMap map = new GridPartitionStateMap(locParts.length());
lock.readLock().lock();
@@ -830,7 +831,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
return new GridDhtPartitionMap(ctx.localNodeId(),
updateSeq.get(),
topVer,
- Collections.unmodifiableMap(map),
+ map,
true);
}
finally {
@@ -1897,7 +1898,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
map = new GridDhtPartitionMap(locNodeId,
updateSeq,
topVer,
- Collections.<Integer, GridDhtPartitionState>emptyMap(),
+ GridPartitionStateMap.EMPTY,
false);
node2part.put(locNodeId, map);
http://git-wip-us.apache.org/repos/asf/ignite/blob/e1ce7c97/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
index 0b44d3c..cfd4400 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
@@ -73,7 +73,7 @@ public class GridDhtPartitionMap implements Comparable<GridDhtPartitionMap>, Ext
public GridDhtPartitionMap(UUID nodeId,
long updateSeq,
AffinityTopologyVersion top,
- Map<Integer, GridDhtPartitionState> m,
+ GridPartitionStateMap m,
boolean onlyActive) {
assert nodeId != null;
assert updateSeq > 0;
@@ -82,14 +82,7 @@ public class GridDhtPartitionMap implements Comparable<GridDhtPartitionMap>, Ext
this.updateSeq = updateSeq;
this.top = top;
- map = new GridPartitionStateMap(m.size());
-
- for (Map.Entry<Integer, GridDhtPartitionState> e : m.entrySet()) {
- GridDhtPartitionState state = e.getValue();
-
- if (!onlyActive || state.active())
- put(e.getKey(), state);
- }
+ map = new GridPartitionStateMap(m, onlyActive);
}
/**
@@ -185,7 +178,7 @@ public class GridDhtPartitionMap implements Comparable<GridDhtPartitionMap>, Ext
/**
* @return Underlying map.
*/
- public Map<Integer, GridDhtPartitionState> map() {
+ public GridPartitionStateMap map() {
return map;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/e1ce7c97/modules/core/src/main/java/org/apache/ignite/internal/util/GridPartitionStateMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridPartitionStateMap.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridPartitionStateMap.java
index 72f8469..173ddbe 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridPartitionStateMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridPartitionStateMap.java
@@ -17,14 +17,12 @@
package org.apache.ignite.internal.util;
-import java.io.Externalizable;
import java.io.Serializable;
import java.util.AbstractMap;
import java.util.AbstractSet;
import java.util.BitSet;
-import java.util.HashSet;
import java.util.Iterator;
-import java.util.Map;
+import java.util.NoSuchElementException;
import java.util.Set;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
@@ -34,6 +32,9 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartit
* Null values are prohibited.
*/
public class GridPartitionStateMap extends AbstractMap<Integer, GridDhtPartitionState> implements Serializable {
+ /** Empty map. */
+ public static final GridPartitionStateMap EMPTY = new GridPartitionStateMap(0);
+
/** */
private static final long serialVersionUID = 0L;
@@ -51,7 +52,7 @@ public class GridPartitionStateMap extends AbstractMap<Integer, GridDhtPartition
@Override public Set<Entry<Integer, GridDhtPartitionState>> entrySet() {
return new AbstractSet<Entry<Integer, GridDhtPartitionState>>() {
@Override public Iterator<Entry<Integer, GridDhtPartitionState>> iterator() {
- final int size = states.length() == 0 ? 0 : (states.length() - 1)/ BITS + 1;
+ final int size = states.isEmpty() ? 0 : (states.length() - 1)/ BITS + 1;
return new Iterator<Entry<Integer, GridDhtPartitionState>>() {
private int next;
@@ -65,6 +66,9 @@ public class GridPartitionStateMap extends AbstractMap<Integer, GridDhtPartition
}
@Override public Entry<Integer, GridDhtPartitionState> next() {
+ if (!hasNext())
+ throw new NoSuchElementException();
+
cur = next;
next++;
@@ -111,6 +115,32 @@ public class GridPartitionStateMap extends AbstractMap<Integer, GridDhtPartition
states = new BitSet(parts);
}
+ /**
+ * Creates map copy.
+ * @param from Source map.
+ * @param onlyActive Retains only active partitions.
+ */
+ public GridPartitionStateMap(GridPartitionStateMap from, boolean onlyActive) {
+ size = from.size();
+
+ states = (BitSet)from.states.clone();
+
+ if (onlyActive) {
+ int part = 0;
+
+ int maxPart = states.size() / BITS;
+
+ while (part < maxPart) {
+ GridDhtPartitionState state = from.state(part);
+
+ if (state != null && !state.active())
+ remove(part);
+
+ part++;
+ }
+ }
+ }
+
/** {@inheritDoc} */
@Override public GridDhtPartitionState put(Integer key, GridDhtPartitionState val) {
assert val != null;
@@ -169,6 +199,24 @@ public class GridPartitionStateMap extends AbstractMap<Integer, GridDhtPartition
for (int i = 0; i < BITS; i++)
st |= ((states.get(off + i) ? 1 : 0) << i);
- return st == 0 ? null : GridDhtPartitionState.values()[st - 1];
+ return st == 0 ? null : GridDhtPartitionState.fromOrdinal(st - 1);
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ if (this == o)
+ return true;
+
+ if (o == null || getClass() != o.getClass())
+ return false;
+
+ GridPartitionStateMap map = (GridPartitionStateMap)o;
+
+ return size == map.size && states.equals(map.states);
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ return 31 * states.hashCode() + size;
}
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/e1ce7c97/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLateAffinityAssignmentTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLateAffinityAssignmentTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLateAffinityAssignmentTest.java
index 6fac920..f1ecfa4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLateAffinityAssignmentTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLateAffinityAssignmentTest.java
@@ -48,6 +48,7 @@ import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.MemoryConfiguration;
import org.apache.ignite.events.DiscoveryEvent;
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.GridNodeOrderComparator;
@@ -55,7 +56,6 @@ import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.TestRecordingCommunicationSpi;
import org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException;
-import org.apache.ignite.internal.managers.communication.GridIoMessage;
import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.affinity.GridAffinityFunctionContextImpl;
@@ -180,6 +180,12 @@ public class CacheLateAffinityAssignmentTest extends GridCommonAbstractTest {
discoSpi.setJoinTimeout(30_000);
}
+ MemoryConfiguration cfg1 = new MemoryConfiguration();
+
+ cfg1.setDefaultMemoryPolicySize(50 * 1024 * 1024L);
+
+ cfg.setMemoryConfiguration(cfg1);
+
cfg.setClientMode(client);
return cfg;
http://git-wip-us.apache.org/repos/asf/ignite/blob/e1ce7c97/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
index 64a94fd..1298a75 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
@@ -42,6 +42,7 @@ import org.apache.ignite.thread.IgniteThreadPoolSizeTest;
import org.apache.ignite.util.GridIntListSelfTest;
import org.apache.ignite.util.GridLongListSelfTest;
import org.apache.ignite.util.GridMessageCollectionTest;
+import org.apache.ignite.util.GridPartitionMapSelfTest;
import org.apache.ignite.util.GridQueueSelfTest;
import org.apache.ignite.util.GridSpinReadWriteLockSelfTest;
import org.apache.ignite.util.GridStringBuilderFactorySelfTest;
@@ -99,6 +100,8 @@ public class IgniteUtilSelfTestSuite extends TestSuite {
GridTestUtils.addTestIfNeeded(suite, GridNioSslSelfTest.class, ignoredTests);
suite.addTestSuite(GridNioDelimitedBufferSelfTest.class);
+ suite.addTestSuite(GridPartitionMapSelfTest.class);
+
//dbx
suite.addTestSuite(PageIdUtilsSelfTest.class);
http://git-wip-us.apache.org/repos/asf/ignite/blob/e1ce7c97/modules/core/src/test/java/org/apache/ignite/util/GridPartitionMapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/util/GridPartitionMapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/util/GridPartitionMapSelfTest.java
new file mode 100644
index 0000000..ebb4cd7
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/util/GridPartitionMapSelfTest.java
@@ -0,0 +1,162 @@
+/*
+ * 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.util;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
+import org.apache.ignite.internal.util.GridPartitionStateMap;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.testframework.junits.common.GridCommonTest;
+
+/**
+ * Grid utils tests.
+ */
+@GridCommonTest(group = "Utils")
+public class GridPartitionMapSelfTest extends GridCommonAbstractTest {
+ /** */
+ public void testPartitionStateMap() {
+ GridPartitionStateMap map = initMap(new GridPartitionStateMap());
+
+ Set<Map.Entry<Integer, GridDhtPartitionState>> entries = map.entrySet();
+
+ assertEquals(10, map.size());
+
+ for (Map.Entry<Integer, GridDhtPartitionState> entry : entries)
+ entry.setValue(GridDhtPartitionState.OWNING);
+
+ assertEquals(10, map.size());
+
+ for (GridDhtPartitionState state : map.values())
+ assertEquals(GridDhtPartitionState.OWNING, state);
+
+ Set<Map.Entry<Integer, GridDhtPartitionState>> tmp = new HashSet<>();
+
+ for (Map.Entry<Integer, GridDhtPartitionState> entry : entries) {
+ tmp.add(entry);
+
+ entry.setValue(GridDhtPartitionState.LOST);
+ }
+
+ for (Map.Entry<Integer, GridDhtPartitionState> entry : tmp)
+ entry.setValue(GridDhtPartitionState.LOST);
+
+ for (GridDhtPartitionState state : map.values())
+ assertEquals(GridDhtPartitionState.LOST, state);
+
+ assertFalse(map.containsKey(10));
+
+ assertNull(map.remove(10));
+
+ assertEquals(10, map.size());
+
+ assertEquals(GridDhtPartitionState.LOST, map.put(9, GridDhtPartitionState.EVICTED));
+
+ assertEquals(10, map.size());
+
+ assertEquals(GridDhtPartitionState.EVICTED, map.put(9, GridDhtPartitionState.EVICTED));
+
+ assertEquals(10, map.size());
+
+ map.remove(5);
+
+ assertEquals(9, map.size());
+ assertEquals(9, map.keySet().size());
+ assertEquals(9, map.values().size());
+
+ map.clear();
+
+ assertEquals(0, map.size());
+ assertEquals(0, map.keySet().size());
+ assertEquals(0, map.values().size());
+ }
+
+ /** */
+ public void testEqualsAndHashCode() {
+ GridPartitionStateMap map1 = initMap(new GridPartitionStateMap());
+
+ GridPartitionStateMap map2 = initMap(new GridPartitionStateMap());
+
+ assertEquals(map1, map2);
+
+ assertEquals(map1.hashCode(), map2.hashCode());
+
+ assertFalse(map1.equals(new HashMap()));
+
+ assertFalse(map1.equals(null));
+ }
+
+ /**
+ *
+ */
+ public void testCopy() {
+ GridPartitionStateMap map1 = initMap(new GridPartitionStateMap());
+
+ GridPartitionStateMap cp1 = new GridPartitionStateMap(map1, false);
+
+ assertEquals(map1, cp1);
+
+ GridPartitionStateMap map2 = new GridPartitionStateMap();
+ map2.put(0, GridDhtPartitionState.MOVING);
+ map2.put(1, GridDhtPartitionState.RENTING);
+ map2.put(2, GridDhtPartitionState.LOST);
+ map2.put(3, GridDhtPartitionState.OWNING);
+ map2.put(5, GridDhtPartitionState.MOVING);
+ map2.put(6, GridDhtPartitionState.RENTING);
+ map2.put(7, GridDhtPartitionState.LOST);
+ map2.put(8, GridDhtPartitionState.OWNING);
+
+ GridPartitionStateMap cp2 = new GridPartitionStateMap(map1, true);
+
+ assertEquals(map2, cp2);
+ }
+
+ /**
+ *
+ */
+ public void testCopyNoActive() {
+ GridPartitionStateMap map2 = new GridPartitionStateMap();
+
+ map2.put(100, GridDhtPartitionState.EVICTED);
+ map2.put(101, GridDhtPartitionState.EVICTED);
+ map2.put(102, GridDhtPartitionState.EVICTED);
+ map2.put(103, GridDhtPartitionState.OWNING);
+
+ GridPartitionStateMap cp2 = new GridPartitionStateMap(map2, true);
+
+ assertEquals(1, cp2.size());
+ }
+
+ /** */
+ private GridPartitionStateMap initMap(GridPartitionStateMap map) {
+ map.put(0, GridDhtPartitionState.MOVING);
+ map.put(1, GridDhtPartitionState.RENTING);
+ map.put(2, GridDhtPartitionState.LOST);
+ map.put(3, GridDhtPartitionState.OWNING);
+ map.put(4, GridDhtPartitionState.EVICTED);
+ map.put(5, GridDhtPartitionState.MOVING);
+ map.put(6, GridDhtPartitionState.RENTING);
+ map.put(7, GridDhtPartitionState.LOST);
+ map.put(8, GridDhtPartitionState.OWNING);
+ map.put(9, GridDhtPartitionState.EVICTED);
+
+ return map;
+ }
+}
\ No newline at end of file
[29/50] ignite git commit: IGNITE-4467 Added missing style.
Posted by vo...@apache.org.
IGNITE-4467 Added missing style.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fe5f5519
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fe5f5519
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fe5f5519
Branch: refs/heads/master
Commit: fe5f551963bdda28e6b64b9827c226a6fcddb684
Parents: 459dc9e
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Thu Jun 29 15:12:55 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Thu Jun 29 15:12:55 2017 +0700
----------------------------------------------------------------------
.../frontend/app/components/input-dialog/input-dialog.tpl.pug | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/fe5f5519/modules/web-console/frontend/app/components/input-dialog/input-dialog.tpl.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/input-dialog/input-dialog.tpl.pug b/modules/web-console/frontend/app/components/input-dialog/input-dialog.tpl.pug
index 416d79b..5c6e173 100644
--- a/modules/web-console/frontend/app/components/input-dialog/input-dialog.tpl.pug
+++ b/modules/web-console/frontend/app/components/input-dialog/input-dialog.tpl.pug
@@ -16,7 +16,7 @@
include /app/helpers/jade/mixins
-.modal.modal--ignite(tabindex='-1' role='dialog')
+.modal.modal--ignite.theme--ignite(tabindex='-1' role='dialog')
.modal-dialog
form.modal-content(name='ctrl.form' novalidate)
.modal-header
[19/50] ignite git commit: GG-12347 restoring binary metadata at
correct moment of ObjectBinaryProcessor startup process
Posted by vo...@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/master
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();
}
}
[10/50] ignite git commit: ignite-gg-12324 fix caches start after
restore hangs if concurrent transactions run
Posted by vo...@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/master
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) {
[36/50] ignite git commit: IGNITE-5627 Refactored grid columns menu.
Posted by vo...@apache.org.
IGNITE-5627 Refactored grid columns menu.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4a1fef5c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4a1fef5c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4a1fef5c
Branch: refs/heads/master
Commit: 4a1fef5cb2442833e1110fc45b341cb146592bd3
Parents: 531a0de
Author: Ilya Borisov <ib...@gridgain.com>
Authored: Fri Jun 30 16:47:18 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Jun 30 16:47:18 2017 +0700
----------------------------------------------------------------------
modules/web-console/frontend/.eslintrc | 2 +-
modules/web-console/frontend/app/app.js | 4 +
.../grid-column-selector/component.js | 29 ++
.../grid-column-selector/controller.js | 111 +++++
.../grid-column-selector/controller.spec.js | 435 +++++++++++++++++++
.../components/grid-column-selector/index.js | 24 +
.../components/grid-column-selector/style.scss | 24 +
.../grid-column-selector/template.pug | 28 ++
.../list-of-registered-users.categories.js | 22 +-
.../list-of-registered-users.column-defs.js | 4 +-
.../list-of-registered-users.controller.js | 46 --
.../list-of-registered-users.scss | 3 +
.../list-of-registered-users.tpl.pug | 26 +-
.../components/pcbProtectFromBsSelectRender.js | 32 --
.../components/page-configure-basic/index.js | 2 -
.../page-configure-basic/template.pug | 4 +-
.../protect-from-bs-select-render/directive.js | 32 ++
.../protect-from-bs-select-render/index.js | 24 +
.../frontend/app/helpers/jade/mixins.pug | 1 -
.../frontend/app/modules/sql/sql.controller.js | 21 +-
.../frontend/app/primitives/btn/index.scss | 8 +-
.../frontend/app/primitives/dropdown/index.pug | 2 +-
.../app/primitives/ui-grid-settings/index.pug | 33 --
.../frontend/public/stylesheets/style.scss | 13 +
.../web-console/frontend/views/sql/sql.tpl.pug | 6 +-
25 files changed, 764 insertions(+), 172 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/.eslintrc
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/.eslintrc b/modules/web-console/frontend/.eslintrc
index 6778b86..d88fb97 100644
--- a/modules/web-console/frontend/.eslintrc
+++ b/modules/web-console/frontend/.eslintrc
@@ -178,7 +178,7 @@ rules:
prefer-const: 1
prefer-spread: 2
quote-props: [2, "as-needed"]
- quotes: [2, "single"]
+ quotes: [2, "single", {"allowTemplateLiterals": true}]
radix: 1
semi: [2, "always"]
semi-spacing: [2, {"before": false, "after": true}]
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/app.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/app.js b/modules/web-console/frontend/app/app.js
index 61372a2..7b8196e 100644
--- a/modules/web-console/frontend/app/app.js
+++ b/modules/web-console/frontend/app/app.js
@@ -123,7 +123,9 @@ import userNotifications from './components/user-notifications';
import pageConfigure from './components/page-configure';
import pageConfigureBasic from './components/page-configure-basic';
import pageConfigureAdvanced from './components/page-configure-advanced';
+import gridColumnSelector from './components/grid-column-selector';
import bsSelectMenu from './components/bs-select-menu';
+import protectFromBsSelectRender from './components/protect-from-bs-select-render';
// Inject external modules.
import IgniteModules from 'IgniteModules/index';
@@ -189,7 +191,9 @@ angular
pageConfigure.name,
pageConfigureBasic.name,
pageConfigureAdvanced.name,
+ gridColumnSelector.name,
bsSelectMenu.name,
+ protectFromBsSelectRender.name,
// Ignite modules.
IgniteModules.name
])
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/grid-column-selector/component.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/grid-column-selector/component.js b/modules/web-console/frontend/app/components/grid-column-selector/component.js
new file mode 100644
index 0000000..957c821f
--- /dev/null
+++ b/modules/web-console/frontend/app/components/grid-column-selector/component.js
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+
+import template from './template.pug';
+import controller from './controller.js';
+import './style.scss';
+
+export default {
+ template,
+ controller,
+ transclude: true,
+ bindings: {
+ gridApi: '<'
+ }
+};
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/grid-column-selector/controller.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/grid-column-selector/controller.js b/modules/web-console/frontend/app/components/grid-column-selector/controller.js
new file mode 100644
index 0000000..1f04861
--- /dev/null
+++ b/modules/web-console/frontend/app/components/grid-column-selector/controller.js
@@ -0,0 +1,111 @@
+/*
+ * 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.
+ */
+
+import uniq from 'lodash/fp/uniq';
+import difference from 'lodash/difference';
+import findLast from 'lodash/findLast';
+
+const hasGrouping = (changes) => {
+ return changes.gridApi.currentValue !== changes.gridApi.previousValue && changes.gridApi.currentValue.grouping;
+};
+const id = (column) => column.categoryDisplayName || column.displayName || column.name;
+const picksrc = (state) => state.categories.length ? state.categories : state.columns;
+
+export default class GridColumnSelectorController {
+ static $inject = ['$scope', 'uiGridConstants'];
+
+ constructor($scope, uiGridConstants) {
+ Object.assign(this, {$scope, uiGridConstants});
+ }
+
+ $onChanges(changes) {
+ if (changes && 'gridApi' in changes && changes.gridApi.currentValue) {
+ this.applyValues();
+ this.gridApi.grid.registerDataChangeCallback(() => this.applyValues(), [this.uiGridConstants.dataChange.COLUMN]);
+ if (hasGrouping(changes)) this.gridApi.grouping.on.groupingChanged(this.$scope, () => this.applyValues());
+ }
+ }
+
+ applyValues() {
+ this.state = this.getState();
+ this.columnsMenu = this.makeMenu();
+ this.selectedColumns = this.getSelectedColumns();
+ this.setSelectedColumns();
+ }
+
+ getSelectedColumns() {
+ return picksrc(this.state).filter((i) => i.isVisible && i.isInMenu).map((i) => id(i.item));
+ }
+
+ makeMenu() {
+ return picksrc(this.state).filter((i) => i.isInMenu).map((i) => ({
+ name: id(i.item),
+ item: i.item
+ }));
+ }
+
+ getState() {
+ const api = this.gridApi;
+ const columns = api.grid.options.columnDefs;
+ const categories = api.grid.options.categories || [];
+ const grouping = api.grouping
+ ? api.grouping.getGrouping().grouping.map((g) => columns.find((c) => c.name === g.colName).categoryDisplayName)
+ : [];
+ const mapfn = (item) => ({
+ item,
+ isInMenu: item.enableHiding !== false && !grouping.includes(item.name),
+ isVisible: grouping.includes(item.name) || item.visible !== false
+ });
+ return ({
+ categories: categories.map(mapfn),
+ columns: columns.map(mapfn)
+ });
+ }
+
+ findScrollToNext(columns, prevColumns) {
+ if (!prevColumns) return;
+ const diff = difference(columns, prevColumns);
+ if (diff.length === 1 && columns.includes(diff[0])) return diff[0];
+ }
+
+ setSelectedColumns() {
+ const {selectedColumns} = this;
+ const scrollToNext = this.findScrollToNext(selectedColumns, this.prevSelectedColumns);
+ this.prevSelectedColumns = selectedColumns;
+ const all = this.state.categories.concat(this.state.columns);
+ const itemsToShow = uniq(all.filter((i) => !i.isInMenu && i.isVisible).map((i) => id(i.item)).concat(selectedColumns));
+ (this.gridApi.grid.options.categories || []).concat(this.gridApi.grid.options.columnDefs).forEach((item) => {
+ item.visible = itemsToShow.includes(id(item));
+ });
+ // Scrolls to the last matching columnDef, useful if it was out of view after being enabled.
+ this.refreshColumns().then(() => {
+ if (scrollToNext) {
+ const column = findLast(this.gridApi.grid.options.columnDefs, (c) => id(c) === scrollToNext);
+ this.gridApi.grid.scrollTo(null, column);
+ }
+ });
+ }
+
+ // gridApi.grid.refreshColumns method does not allow to wait until async operation completion.
+ // This method does roughly the same, but returns a Promise.
+ refreshColumns() {
+ return this.gridApi.grid.processColumnsProcessors(this.gridApi.grid.columns)
+ .then((renderableColumns) => this.gridApi.grid.setVisibleColumns(renderableColumns))
+ .then(() => this.gridApi.grid.redrawInPlace())
+ .then(() => this.gridApi.grid.refreshCanvas(true));
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/grid-column-selector/controller.spec.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/grid-column-selector/controller.spec.js b/modules/web-console/frontend/app/components/grid-column-selector/controller.spec.js
new file mode 100644
index 0000000..d163a9c
--- /dev/null
+++ b/modules/web-console/frontend/app/components/grid-column-selector/controller.spec.js
@@ -0,0 +1,435 @@
+/*
+ * 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.
+ */
+
+import {suite, test} from 'mocha';
+import {assert} from 'chai';
+import {spy, stub} from 'sinon';
+
+import Controller from './controller';
+
+const mocks = () => new Map([
+ ['$scope', {}],
+ ['uiGridConstants', {
+ dataChange: {
+ COLUMN: 'COLUMN'
+ }
+ }]
+]);
+
+const apiMock = () => ({
+ grid: {
+ options: {
+ columnDefs: []
+ },
+ registerDataChangeCallback: spy(),
+ processColumnsProcessors: spy((v) => Promise.resolve(v)),
+ setVisibleColumns: spy((v) => Promise.resolve(v)),
+ redrawInPlace: spy((v) => Promise.resolve(v)),
+ refreshCanvas: spy((v) => Promise.resolve(v)),
+ scrollTo: spy()
+ },
+ grouping: {
+ on: {
+ groupingChanged: spy()
+ },
+ getGrouping: stub().returns({grouping: []})
+ }
+});
+
+suite('grid-column-selector component controller', () => {
+ test('$onChanges', () => {
+ const c = new Controller(...mocks().values());
+ c.applyValues = spy(c.applyValues.bind(c));
+ const api = apiMock();
+ c.gridApi = api;
+ c.$onChanges({gridApi: {currentValue: api}});
+
+ assert.equal(c.applyValues.callCount, 1, 'calls applyValues');
+ assert.isFunction(
+ c.gridApi.grid.registerDataChangeCallback.lastCall.args[0]
+ );
+
+ c.gridApi.grid.registerDataChangeCallback.lastCall.args[0]();
+
+ assert.equal(
+ c.applyValues.callCount,
+ 2,
+ 'registers applyValues as data change callback'
+ );
+ assert.deepEqual(
+ c.gridApi.grid.registerDataChangeCallback.lastCall.args[1],
+ [c.uiGridConstants.dataChange.COLUMN],
+ 'registers data change callback for COLUMN'
+ );
+ assert.equal(
+ c.gridApi.grouping.on.groupingChanged.lastCall.args[0],
+ c.$scope,
+ 'registers grouping change callback with correct $scope'
+ );
+
+ c.gridApi.grouping.on.groupingChanged.lastCall.args[1]();
+
+ assert.equal(
+ c.applyValues.callCount,
+ 3,
+ 'registers applyValues as grouping change callback'
+ );
+ });
+ test('applyValues', () => {
+ const c = new Controller(...mocks().values());
+ const mock = {
+ getState: stub().returns({}),
+ makeMenu: stub().returns({}),
+ getSelectedColumns: stub().returns({}),
+ setSelectedColumns: spy()
+ };
+ c.applyValues.call(mock);
+
+ assert.equal(
+ mock.state,
+ mock.getState.lastCall.returnValue,
+ 'assigns getState return value as this.state'
+ );
+ assert.equal(
+ mock.columnsMenu,
+ mock.makeMenu.lastCall.returnValue,
+ 'assigns makeMenu return value as this.columnsMenu'
+ );
+ assert.equal(
+ mock.selectedColumns,
+ mock.getSelectedColumns.lastCall.returnValue,
+ 'assigns getSelectedColumns return value as this.selectedColumns'
+ );
+ assert.equal(
+ mock.setSelectedColumns.callCount,
+ 1,
+ 'calls setSelectedColumns once'
+ );
+ });
+ test('getSelectedColumns, using categories', () => {
+ const c = new Controller(...mocks().values());
+ c.state = {
+ categories: [
+ {isVisible: false},
+ {isVisible: true, isInMenu: false},
+ {isVisible: true, isInMenu: true, item: {categoryDisplayName: '1'}},
+ {isVisible: true, isInMenu: true, item: {displayName: '2'}},
+ {isVisible: true, isInMenu: true, item: {name: '3'}}
+ ],
+ columns: []
+ };
+
+ assert.deepEqual(
+ c.getSelectedColumns(),
+ ['1', '2', '3'],
+ 'returns correct value, prefers categories over columns'
+ );
+ });
+ test('getSelectedColumns, using columnDefs', () => {
+ const c = new Controller(...mocks().values());
+ c.state = {
+ categories: [
+ ],
+ columns: [
+ {isVisible: false},
+ {isVisible: true, isInMenu: false},
+ {isVisible: true, isInMenu: true, item: {categoryDisplayName: '1'}},
+ {isVisible: true, isInMenu: true, item: {displayName: '2'}},
+ {isVisible: true, isInMenu: true, item: {name: '3'}}
+ ]
+ };
+
+ assert.deepEqual(
+ c.getSelectedColumns(),
+ ['1', '2', '3'],
+ 'returns correct value, uses columns if there are no categories'
+ );
+ });
+ test('makeMenu, using categories', () => {
+ const c = new Controller(...mocks().values());
+ c.state = {
+ categories: [
+ {isVisible: false},
+ {isVisible: true, isInMenu: false},
+ {isVisible: true, isInMenu: true, item: {categoryDisplayName: '1'}},
+ {isVisible: true, isInMenu: true, item: {displayName: '2'}},
+ {isVisible: true, isInMenu: true, item: {name: '3'}}
+ ],
+ columns: []
+ };
+
+ assert.deepEqual(
+ c.makeMenu(),
+ [
+ {item: {categoryDisplayName: '1'}, name: '1'},
+ {item: {displayName: '2'}, name: '2'},
+ {item: {name: '3'}, name: '3'}
+ ],
+ 'returns correct value, prefers categories over columns'
+ );
+ });
+ test('makeMenu, using columns', () => {
+ const c = new Controller(...mocks().values());
+ c.state = {
+ categories: [],
+ columns: [
+ {isVisible: false},
+ {isVisible: true, isInMenu: false},
+ {isVisible: true, isInMenu: true, item: {categoryDisplayName: '1'}},
+ {isVisible: true, isInMenu: true, item: {displayName: '2'}},
+ {isVisible: true, isInMenu: true, item: {name: '3'}}
+ ]
+ };
+
+ assert.deepEqual(
+ c.makeMenu(),
+ [
+ {item: {categoryDisplayName: '1'}, name: '1'},
+ {item: {displayName: '2'}, name: '2'},
+ {item: {name: '3'}, name: '3'}
+ ],
+ 'returns correct value, uses columns if there are no categories'
+ );
+ });
+ test('getState', () => {
+ const c = new Controller(...mocks().values());
+ c.gridApi = apiMock();
+ c.gridApi.grouping.getGrouping = () => ({grouping: [{colName: 'a', categoryDisplayName: 'A'}]});
+ c.gridApi.grid.options.columnDefs = [
+ {visible: false, name: 'a', categoryDisplayName: 'A'},
+ {visible: true, name: 'a1', categoryDisplayName: 'A'},
+ {visible: true, name: 'a2', categoryDisplayName: 'A'},
+ {visible: true, name: 'b1', categoryDisplayName: 'B'},
+ {visible: true, name: 'b2', categoryDisplayName: 'B'},
+ {visible: true, name: 'b3', categoryDisplayName: 'B'},
+ {visible: true, name: 'c1', categoryDisplayName: 'C'},
+ {visible: true, name: 'c2', categoryDisplayName: 'C', enableHiding: false},
+ {visible: false, name: 'c3', categoryDisplayName: 'C'}
+ ];
+ c.gridApi.grid.options.categories = [
+ {categoryDisplayName: 'A', enableHiding: false, visible: true},
+ {categoryDisplayName: 'B', enableHiding: true, visible: false},
+ {categoryDisplayName: 'C', enableHiding: true, visible: true}
+ ];
+
+ assert.deepEqual(
+ c.getState(),
+ {
+ categories: [{
+ isInMenu: false,
+ isVisible: true,
+ item: {
+ categoryDisplayName: 'A',
+ enableHiding: false,
+ visible: true
+ }
+ }, {
+ isInMenu: true,
+ isVisible: false,
+ item: {
+ categoryDisplayName: 'B',
+ enableHiding: true,
+ visible: false
+ }
+ }, {
+ isInMenu: true,
+ isVisible: true,
+ item: {
+ categoryDisplayName: 'C',
+ enableHiding: true,
+ visible: true
+ }
+ }],
+ columns: [{
+ isInMenu: true,
+ isVisible: false,
+ item: {
+ categoryDisplayName: 'A',
+ name: 'a',
+ visible: false
+ }
+ }, {
+ isInMenu: true,
+ isVisible: true,
+ item: {
+ categoryDisplayName: 'A',
+ name: 'a1',
+ visible: true
+ }
+ }, {
+ isInMenu: true,
+ isVisible: true,
+ item: {
+ categoryDisplayName: 'A',
+ name: 'a2',
+ visible: true
+ }
+ }, {
+ isInMenu: true,
+ isVisible: true,
+ item: {
+ categoryDisplayName: 'B',
+ name: 'b1',
+ visible: true
+ }
+ }, {
+ isInMenu: true,
+ isVisible: true,
+ item: {
+ categoryDisplayName: 'B',
+ name: 'b2',
+ visible: true
+ }
+ }, {
+ isInMenu: true,
+ isVisible: true,
+ item: {
+ categoryDisplayName: 'B',
+ name: 'b3',
+ visible: true
+ }
+ }, {
+ isInMenu: true,
+ isVisible: true,
+ item: {
+ categoryDisplayName: 'C',
+ name: 'c1',
+ visible: true
+ }
+ }, {
+ isInMenu: false,
+ isVisible: true,
+ item: {
+ categoryDisplayName: 'C',
+ name: 'c2',
+ visible: true,
+ enableHiding: false
+ }
+ }, {
+ isInMenu: true,
+ isVisible: false,
+ item: {
+ categoryDisplayName: 'C',
+ name: 'c3',
+ visible: false
+ }
+ }]
+ },
+ 'returns correct value'
+ );
+ });
+ test('findScrollToNext', () => {
+ assert.deepEqual(
+ Controller.prototype.findScrollToNext([1, 2, 3], [1, 2]),
+ 3,
+ `returns new item if it's in selected collection end`
+ );
+ assert.deepEqual(
+ Controller.prototype.findScrollToNext([1, 2], [1, 3]),
+ 2,
+ `returns new item if it's in selected collection middle`
+ );
+ assert.deepEqual(
+ Controller.prototype.findScrollToNext([1, 2, 3], [2, 3]),
+ 1,
+ `returns new item if it's in selected collection start`
+ );
+ assert.equal(
+ Controller.prototype.findScrollToNext([1, 2, 3, 4, 5], [1]),
+ void 0,
+ `returns nothing if there's more than one new item`
+ );
+ assert.equal(
+ Controller.prototype.findScrollToNext([1, 2], [1, 2, 3]),
+ void 0,
+ `returns nothing if items were removed`
+ );
+ });
+ test('setSelectedColumns', () => {
+ const c = new Controller(...mocks().values());
+ const api = c.gridApi = apiMock();
+ c.refreshColumns = stub().returns(({then: (f) => f()}));
+ c.gridApi.grid.options.columnDefs = [
+ {name: 'a', visible: false, categoryDisplayName: 'A'},
+ {name: 'a1', visible: false, categoryDisplayName: 'A'},
+ {name: 'b', visible: true, categoryDisplayName: 'B'}
+ ];
+ c.gridApi.grid.options.categories = [
+ {categoryDisplayName: 'A', visible: false},
+ {categoryDisplayName: 'B'}
+ ];
+ c.$onChanges({gridApi: {currentValue: api}});
+ c.selectedColumns = ['A', 'B'];
+ c.setSelectedColumns();
+
+ assert.equal(
+ c.refreshColumns.callCount,
+ 2,
+ 'calls refreshColumns'
+ );
+ assert.deepEqual(
+ c.gridApi.grid.options.categories,
+ [
+ {categoryDisplayName: 'A', visible: true},
+ {categoryDisplayName: 'B', visible: true}
+ ],
+ 'changes category visibility'
+ );
+ assert.deepEqual(
+ c.gridApi.grid.options.columnDefs,
+ [
+ {name: 'a', visible: true, categoryDisplayName: 'A'},
+ {name: 'a1', visible: true, categoryDisplayName: 'A'},
+ {name: 'b', visible: true, categoryDisplayName: 'B'}
+ ],
+ 'changes column visibility'
+ );
+ assert.deepEqual(
+ c.gridApi.grid.scrollTo.lastCall.args,
+ [null, {name: 'a1', visible: true, categoryDisplayName: 'A'}],
+ 'scrolls to last added column'
+ );
+ });
+ test('refreshColumns', () => {
+ const c = new Controller(...mocks().values());
+ c.gridApi = apiMock();
+ c.gridApi.grid.columns = [1, 2, 3];
+
+ return c.refreshColumns().then(() => {
+ assert.equal(
+ c.gridApi.grid.processColumnsProcessors.lastCall.args[0],
+ c.gridApi.grid.columns,
+ 'calls processColumnsProcessors with correct args'
+ );
+ assert.equal(
+ c.gridApi.grid.setVisibleColumns.lastCall.args[0],
+ c.gridApi.grid.columns,
+ 'calls setVisibleColumns with correct args'
+ );
+ assert.equal(
+ c.gridApi.grid.redrawInPlace.callCount,
+ 1,
+ 'calls redrawInPlace'
+ );
+ assert.equal(
+ c.gridApi.grid.refreshCanvas.lastCall.args[0],
+ true,
+ 'calls refreshCanvas with correct args'
+ );
+ });
+ });
+});
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/grid-column-selector/index.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/grid-column-selector/index.js b/modules/web-console/frontend/app/components/grid-column-selector/index.js
new file mode 100644
index 0000000..16ef655
--- /dev/null
+++ b/modules/web-console/frontend/app/components/grid-column-selector/index.js
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+import component from './component';
+
+export default angular
+ .module('ignite-console.grid-column-selector', [])
+ .component('gridColumnSelector', component);
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/grid-column-selector/style.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/grid-column-selector/style.scss b/modules/web-console/frontend/app/components/grid-column-selector/style.scss
new file mode 100644
index 0000000..5e0d5d4
--- /dev/null
+++ b/modules/web-console/frontend/app/components/grid-column-selector/style.scss
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+grid-column-selector {
+ display: inline-block;
+
+ .btn-ignite, .icon {
+ margin: 0 !important;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/grid-column-selector/template.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/grid-column-selector/template.pug b/modules/web-console/frontend/app/components/grid-column-selector/template.pug
new file mode 100644
index 0000000..86fd152
--- /dev/null
+++ b/modules/web-console/frontend/app/components/grid-column-selector/template.pug
@@ -0,0 +1,28 @@
+//-
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+button.btn-ignite.btn-ignite--link-dashed-secondary(
+ protect-from-bs-select-render
+ bs-select
+ ng-model='$ctrl.selectedColumns'
+ ng-change='$ctrl.setSelectedColumns()'
+ ng-model-options='{debounce: {default: 5}}',
+ bs-options='column.name as column.name for column in $ctrl.columnsMenu'
+ bs-on-before-show='$ctrl.onShow'
+ data-multiple='true'
+ ng-transclude
+)
+ svg(ignite-icon='gear').icon
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.categories.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.categories.js b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.categories.js
index 01b1fc8..e73dd17 100644
--- a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.categories.js
+++ b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.categories.js
@@ -16,15 +16,15 @@
*/
export default [
- {name: 'Actions', visible: false, selectable: false},
- {name: 'User', visible: true, selectable: false},
- {name: 'Email', visible: true, selectable: true},
- {name: 'Company', visible: true, selectable: true},
- {name: 'Country', visible: true, selectable: true},
- {name: 'Last login', visible: false, selectable: true},
- {name: 'Last activity', visible: true, selectable: true},
- {name: 'Configurations', visible: false, selectable: true},
- {name: 'Total activities', visible: true, selectable: true},
- {name: 'Configuration\'s activities', visible: false, selectable: true},
- {name: 'Queries\' activities', visible: false, selectable: true}
+ {name: 'Actions', visible: false, enableHiding: false},
+ {name: 'User', visible: true, enableHiding: false},
+ {name: 'Email', visible: true, enableHiding: true},
+ {name: 'Company', visible: true, enableHiding: true},
+ {name: 'Country', visible: true, enableHiding: true},
+ {name: 'Last login', visible: false, enableHiding: true},
+ {name: 'Last activity', visible: true, enableHiding: true},
+ {name: 'Configurations', visible: false, enableHiding: true},
+ {name: 'Total activities', visible: true, enableHiding: true},
+ {name: 'Configuration\'s activities', visible: false, enableHiding: true},
+ {name: 'Queries\' activities', visible: false, enableHiding: true}
];
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.column-defs.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.column-defs.js b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.column-defs.js
index baf5aed..493c239 100644
--- a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.column-defs.js
+++ b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.column-defs.js
@@ -49,8 +49,8 @@ const ACTIONS_TEMPLATE = `
const EMAIL_TEMPLATE = '<div class="ui-grid-cell-contents"><a ng-href="mailto:{{ COL_FIELD }}">{{ COL_FIELD }}</a></div>';
export default [
- {name: 'actions', displayName: 'Actions', categoryDisplayName: 'Actions', cellTemplate: ACTIONS_TEMPLATE, field: 'actions', minWidth: 70, width: 70, enableFiltering: false, enableSorting: false, visible: false},
- {name: 'user', displayName: 'User', categoryDisplayName: 'User', field: 'userName', cellTemplate: USER_TEMPLATE, minWidth: 160, enableFiltering: true, pinnedLeft: true, filter: { placeholder: 'Filter by name...' }},
+ {name: 'actions', enableHiding: false, displayName: 'Actions', categoryDisplayName: 'Actions', cellTemplate: ACTIONS_TEMPLATE, field: 'actions', minWidth: 70, width: 70, enableFiltering: false, enableSorting: false, visible: false},
+ {name: 'user', enableHiding: false, displayName: 'User', categoryDisplayName: 'User', field: 'userName', cellTemplate: USER_TEMPLATE, minWidth: 160, enableFiltering: true, pinnedLeft: true, filter: { placeholder: 'Filter by name...' }},
{name: 'email', displayName: 'Email', categoryDisplayName: 'Email', field: 'email', cellTemplate: EMAIL_TEMPLATE, minWidth: 160, enableFiltering: true, filter: { placeholder: 'Filter by email...' }},
{name: 'company', displayName: 'Company', categoryDisplayName: 'Company', field: 'company', minWidth: 180, enableFiltering: true, filter: { placeholder: 'Filter by company...' }},
{name: 'country', displayName: 'Country', categoryDisplayName: 'Country', field: 'countryCode', minWidth: 160, enableFiltering: true, filter: { placeholder: 'Filter by country...' }},
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js
index c006003..58e93b4 100644
--- a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js
+++ b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js
@@ -246,52 +246,6 @@ export default class IgniteListOfRegisteredUsersCtrl {
this.selected = ids;
}
- _enableColumns(_categories, visible) {
- _.forEach(_categories, (cat) => {
- cat.visible = visible;
-
- _.forEach(this.gridOptions.columnDefs, (col) => {
- if (col.categoryDisplayName === cat.name)
- col.visible = visible;
- });
- });
-
- // Check to all selected columns.
- this.gridOptions.selectedAll = true;
- _.forEach(this._selectableColumns(), ({ visible }) => this.gridOptions.selectedAll = visible);
-
- // Workaround for this.gridApi.grid.refresh() didn't return promise.
- this.gridApi.grid.processColumnsProcessors(this.gridApi.grid.columns)
- .then((renderableColumns) => this.gridApi.grid.setVisibleColumns(renderableColumns))
- .then(() => this.gridApi.grid.redrawInPlace())
- .then(() => this.gridApi.grid.refreshCanvas(true))
- .then(() => {
- if (visible) {
- const categoryDisplayName = _.last(_categories).name;
-
- const col = _.findLast(this.gridOptions.columnDefs, {categoryDisplayName});
-
- this.gridApi.grid.scrollTo(null, col);
- }
- });
- }
-
- _selectableColumns() {
- return _.filter(this.gridOptions.categories, (cat) => cat.selectable);
- }
-
- toggleColumns(category, visible) {
- this._enableColumns([category], visible);
- }
-
- selectAllColumns() {
- this._enableColumns(this._selectableColumns(), true);
- }
-
- clearAllColumns() {
- this._enableColumns(this._selectableColumns(), false);
- }
-
exportCsv() {
this.gridApi.exporter.csvExport('visible', 'visible');
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.scss b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.scss
index d94fb2e..71d93a7 100644
--- a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.scss
+++ b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.scss
@@ -20,6 +20,9 @@ ignite-list-of-registered-users {
}
.list-of-registered-users {
+ .ui-grid-settings--heading {
+ display: flex;
+ }
& > a {
display: inline-block;
margin: 10px;
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.tpl.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.tpl.pug b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.tpl.pug
index 85a2070..3558ab5 100644
--- a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.tpl.pug
+++ b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.tpl.pug
@@ -16,21 +16,6 @@
include /app/helpers/jade/mixins
-mixin grid-settings()
- .grid-settings
- svg(ignite-icon='gear' data-animation='am-flip-x' bs-dropdown='' aria-haspopup='true' aria-expanded='expanded' data-auto-close='1' data-trigger='click')
- ul.select.dropdown-menu(role='menu')
- li
- a(ng-click='$ctrl.gridOptions.selectedAll ? $ctrl.clearAllColumns() : $ctrl.selectAllColumns()')
- i.fa.fa-check-square-o.pull-left(ng-if='$ctrl.gridOptions.selectedAll')
- i.fa.fa-square-o.pull-left(ng-if='!$ctrl.gridOptions.selectedAll')
- span All
- li(ng-repeat='item in $ctrl.gridOptions.categories|filter:{selectable:true}')
- a(ng-click='$ctrl.toggleColumns(item, !item.visible)')
- i.fa.fa-check-square-o.pull-left(ng-if='item.visible')
- i.fa.fa-square-o.pull-left(ng-if='!item.visible')
- span {{::item.name}}
-
.list-of-registered-users
ul.tabs.tabs--blue
li(role='presentation' ng-class='{ active: $ctrl.groupBy === "user" }')
@@ -52,7 +37,14 @@ mixin grid-settings()
.panel--ignite
.panel-heading.ui-grid-settings
.panel-title
- +ignite-form-field-bsdropdown('Actions', '$ctrl.action', 'action', '!$ctrl.selected.length', false, '$ctrl.actionOptions')
+ +ignite-form-field-bsdropdown({
+ label: 'Actions',
+ model: '$ctrl.action',
+ name: 'action',
+ disabled: '!$ctrl.selected.length',
+ required: false,
+ options: '$ctrl.actionOptions'
+ })
button.btn-ignite.btn-ignite--primary-outline(ng-click='$ctrl.exportCsv()' bs-tooltip='' data-title='Export table to csv' data-placement='top')
svg(ignite-icon='csv')
form.ui-grid-settings-dateperiod(name=form novalidate)
@@ -67,7 +59,7 @@ mixin grid-settings()
span(ng-if='$ctrl.groupBy === "user"') List of registered users
span(ng-if='$ctrl.groupBy === "company"') List of registered companies
span(ng-if='$ctrl.groupBy === "country"') List of registered countries
- +grid-settings
+ grid-column-selector(grid-api='$ctrl.gridApi')
.panel-selected(ng-show='$ctrl.selected.length')
| {{ $ctrl.selected.length }} item{{ $ctrl.selected.length > 1 ? 's' : '' }} selected
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/page-configure-basic/components/pcbProtectFromBsSelectRender.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/page-configure-basic/components/pcbProtectFromBsSelectRender.js b/modules/web-console/frontend/app/components/page-configure-basic/components/pcbProtectFromBsSelectRender.js
deleted file mode 100644
index 5d0ef53..0000000
--- a/modules/web-console/frontend/app/components/page-configure-basic/components/pcbProtectFromBsSelectRender.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.
- */
-
-export default function pcbProtectFromBsSelectRender() {
- return {
- link(scope, el, attr, ctrl) {
- const {$render} = ctrl;
-
- Object.defineProperty(ctrl, '$render', {
- set() {},
- get() {
- return $render;
- }
- });
- },
- require: 'ngModel'
- };
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/page-configure-basic/index.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/page-configure-basic/index.js b/modules/web-console/frontend/app/components/page-configure-basic/index.js
index 1bec7cb..21ae777 100644
--- a/modules/web-console/frontend/app/components/page-configure-basic/index.js
+++ b/modules/web-console/frontend/app/components/page-configure-basic/index.js
@@ -20,12 +20,10 @@ import angular from 'angular';
import component from './component';
import service from './service';
-import pcbProtectFromBsSelectRender from './components/pcbProtectFromBsSelectRender';
import pcbScaleNumber from './components/pcbScaleNumber';
export default angular
.module('ignite-console.page-configure-basic', [])
.component('pageConfigureBasic', component)
- .directive('pcbProtectFromBsSelectRender', pcbProtectFromBsSelectRender)
.directive('pcbScaleNumber', pcbScaleNumber)
.service('PageConfigureBasic', service);
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/page-configure-basic/template.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/page-configure-basic/template.pug b/modules/web-console/frontend/app/components/page-configure-basic/template.pug
index 36dfb20..ab8f43c 100644
--- a/modules/web-console/frontend/app/components/page-configure-basic/template.pug
+++ b/modules/web-console/frontend/app/components/page-configure-basic/template.pug
@@ -99,7 +99,7 @@ form(novalidate name=form)
bs-select
bs-options='size as size.label for size in $ctrl.sizesMenu'
ng-model='$ctrl.memorySizeScale'
- pcb-protect-from-bs-select-render
+ protect-from-bs-select-render
)
| {{ $ctrl.memorySizeScale.label }}
span.fa.fa-caret-down.icon-right
@@ -153,7 +153,7 @@ form(novalidate name=form)
bs-options='cache._id as cache.name for cache in $ctrl.cachesMenu'
data-multiple='true'
data-placement='top-left'
- pcb-protect-from-bs-select-render
+ protect-from-bs-select-render
)
| + Select from existing caches
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/protect-from-bs-select-render/directive.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/protect-from-bs-select-render/directive.js b/modules/web-console/frontend/app/components/protect-from-bs-select-render/directive.js
new file mode 100644
index 0000000..e51d477
--- /dev/null
+++ b/modules/web-console/frontend/app/components/protect-from-bs-select-render/directive.js
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default function protectFromBsSelectRender() {
+ return {
+ link(scope, el, attr, ctrl) {
+ const {$render} = ctrl;
+
+ Object.defineProperty(ctrl, '$render', {
+ set() {},
+ get() {
+ return $render;
+ }
+ });
+ },
+ require: 'ngModel'
+ };
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/components/protect-from-bs-select-render/index.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/protect-from-bs-select-render/index.js b/modules/web-console/frontend/app/components/protect-from-bs-select-render/index.js
new file mode 100644
index 0000000..fd63000
--- /dev/null
+++ b/modules/web-console/frontend/app/components/protect-from-bs-select-render/index.js
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+import directive from './directive';
+
+export default angular
+ .module('ignite-console.protect-from-bs-select-render', [])
+ .directive('protectFromBsSelectRender', directive);
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/helpers/jade/mixins.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/helpers/jade/mixins.pug b/modules/web-console/frontend/app/helpers/jade/mixins.pug
index 9dfdab3..fc193eb 100644
--- a/modules/web-console/frontend/app/helpers/jade/mixins.pug
+++ b/modules/web-console/frontend/app/helpers/jade/mixins.pug
@@ -20,7 +20,6 @@ include ../../primitives/datepicker/index
include ../../primitives/timepicker/index
include ../../primitives/dropdown/index
include ../../primitives/tooltip/index
-include ../../primitives/ui-grid-settings/index
include ../../primitives/switcher/index
//- Mixin for advanced options toggle.
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/modules/sql/sql.controller.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/sql/sql.controller.js b/modules/web-console/frontend/app/modules/sql/sql.controller.js
index 5c678d6..633f167 100644
--- a/modules/web-console/frontend/app/modules/sql/sql.controller.js
+++ b/modules/web-console/frontend/app/modules/sql/sql.controller.js
@@ -57,25 +57,6 @@ class Paragraph {
_.assign(this, paragraph);
- const _enableColumns = (categories, visible) => {
- _.forEach(categories, (cat) => {
- cat.visible = visible;
-
- _.forEach(this.gridOptions.columnDefs, (col) => {
- if (col.displayName === cat.name)
- col.visible = visible;
- });
- });
-
- this.gridOptions.api.grid.refresh();
- };
-
- const _selectableColumns = () => _.filter(this.gridOptions.categories, (cat) => cat.selectable);
-
- this.toggleColumns = (category, visible) => _enableColumns([category], visible);
- this.selectAllColumns = () => _enableColumns(_selectableColumns(), true);
- this.clearAllColumns = () => _enableColumns(_selectableColumns(), false);
-
Object.defineProperty(this, 'gridOptions', {value: {
enableGridMenu: false,
enableColumnMenus: false,
@@ -101,7 +82,7 @@ class Paragraph {
this.categories.push({
name: col.fieldName,
visible: self.columnFilter(col),
- selectable: true
+ enableHiding: true
});
return cols;
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/primitives/btn/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/btn/index.scss b/modules/web-console/frontend/app/primitives/btn/index.scss
index 6fb76c8..94b5bd2 100644
--- a/modules/web-console/frontend/app/primitives/btn/index.scss
+++ b/modules/web-console/frontend/app/primitives/btn/index.scss
@@ -17,6 +17,9 @@
@import "./../../../public/stylesheets/variables.scss";
+$btn-content-padding: 10px 12px;
+$btn-content-padding-with-border: 9px 11px;
+
@mixin active-focus-shadows(
$focus: (0 0 5px #095d9a, 0 0 5px #095d9a),
$active: (inset 0 1px 3px 0 rgba(0, 0, 0, 0.5))
@@ -39,7 +42,6 @@
}
.btn-ignite {
- $content-padding: 10px 12px;
$icon-margin: 8px;
display: inline-flex;
@@ -48,7 +50,7 @@
align-items: center;
box-sizing: border-box;
margin: 0;
- padding: $content-padding;
+ padding: $btn-content-padding;
border: none;
border-radius: $ignite-button-border-radius;
@@ -128,6 +130,7 @@
border: 1px solid $accent-color;
background: white;
color: $accent-color;
+ padding: $btn-content-padding-with-border;
&:hover, &.hover,
&:active, &.active {
@@ -248,6 +251,7 @@
background-color: white;
color: #424242;
border: 1px solid #dedede;
+ padding: $btn-content-padding-with-border;
&:hover, &.hover,
&:active, &.active {
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/primitives/dropdown/index.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/dropdown/index.pug b/modules/web-console/frontend/app/primitives/dropdown/index.pug
index 3a5f1b1..c145244 100644
--- a/modules/web-console/frontend/app/primitives/dropdown/index.pug
+++ b/modules/web-console/frontend/app/primitives/dropdown/index.pug
@@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-mixin ignite-form-field-bsdropdown(label, model, name, disabled, required, options, tip)
+mixin ignite-form-field-bsdropdown({label, model, name, disabled, required, options, tip})
.dropdown--ignite.ignite-form-field
.btn-ignite.btn-ignite--primary-outline(
data-ng-model=model
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/app/primitives/ui-grid-settings/index.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/ui-grid-settings/index.pug b/modules/web-console/frontend/app/primitives/ui-grid-settings/index.pug
deleted file mode 100644
index 8f1487e..0000000
--- a/modules/web-console/frontend/app/primitives/ui-grid-settings/index.pug
+++ /dev/null
@@ -1,33 +0,0 @@
-//-
- 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.
-
-mixin ui-grid-settings()
- .ui-grid-settings
- i.fa.fa-bars(data-animation='am-flip-x' bs-dropdown='' aria-haspopup='true' aria-expanded='expanded' data-auto-close='1' data-trigger='click')
- ul.select.dropdown-menu(role='menu')
- li(ng-repeat='item in paragraph.gridOptions.categories|filter:{selectable:true}')
- a(ng-click='paragraph.toggleColumns(item, !item.visible)')
- i.fa.fa-check-square-o.pull-left(ng-if='item.visible')
- i.fa.fa-square-o.pull-left(ng-if='!item.visible')
- span {{::item.name}}
- li.divider
- li
- a(ng-click='paragraph.selectAllColumns()') Select all
- li
- a(ng-click='paragraph.clearAllColumns()') Clear all
- li.divider
- li
- a(ng-click='$hide()') Close
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/public/stylesheets/style.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/public/stylesheets/style.scss b/modules/web-console/frontend/public/stylesheets/style.scss
index 857cdce..305e7f7 100644
--- a/modules/web-console/frontend/public/stylesheets/style.scss
+++ b/modules/web-console/frontend/public/stylesheets/style.scss
@@ -604,6 +604,19 @@ button.form-control {
padding: 5px 10px;
}
+
+ grid-column-selector {
+ margin-right: 5px;
+
+ .btn-ignite {
+ padding: 5px 0;
+ box-shadow: none !important;
+
+ .fa {
+ font-size: 14px;
+ }
+ }
+ }
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4a1fef5c/modules/web-console/frontend/views/sql/sql.tpl.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/views/sql/sql.tpl.pug b/modules/web-console/frontend/views/sql/sql.tpl.pug
index 94251f9..f215c43 100644
--- a/modules/web-console/frontend/views/sql/sql.tpl.pug
+++ b/modules/web-console/frontend/views/sql/sql.tpl.pug
@@ -124,7 +124,8 @@ mixin query-actions
mixin table-result-heading-query
.total.row
.col-xs-4
- +ui-grid-settings
+ grid-column-selector(grid-api='paragraph.gridOptions.api')
+ .fa.fa-bars.icon
label Page: #[b {{paragraph.page}}]
label.margin-left-dflt Results so far: #[b {{paragraph.rows.length + paragraph.total}}]
label.margin-left-dflt Duration: #[b {{paragraph.duration | duration}}]
@@ -139,7 +140,8 @@ mixin table-result-heading-query
mixin table-result-heading-scan
.total.row
.col-xs-4
- +ui-grid-settings
+ grid-column-selector(grid-api='paragraph.gridOptions.api')
+ .fa.fa-bars.icon
label Page: #[b {{paragraph.page}}]
label.margin-left-dflt Results so far: #[b {{paragraph.rows.length + paragraph.total}}]
label.margin-left-dflt Duration: #[b {{paragraph.duration | duration}}]
[18/50] ignite git commit: ignite-gg-12052 code comments
Posted by vo...@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/master
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();
[30/50] ignite git commit: fail added to
IgnitePersistentStoreDataStructuresTest::testSet, link to JIRA is provided
Posted by vo...@apache.org.
fail added to IgnitePersistentStoreDataStructuresTest::testSet, link to JIRA is provided
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0bd6e8f4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0bd6e8f4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0bd6e8f4
Branch: refs/heads/master
Commit: 0bd6e8f44bcd8385b82480a4bf850b39d2adb3cf
Parents: fe5f551
Author: Sergey Chugunov <se...@gmail.com>
Authored: Thu Jun 29 11:55:25 2017 +0300
Committer: Sergey Chugunov <se...@gmail.com>
Committed: Thu Jun 29 11:55:25 2017 +0300
----------------------------------------------------------------------
.../cache/persistence/IgnitePersistentStoreDataStructuresTest.java | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0bd6e8f4/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreDataStructuresTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreDataStructuresTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreDataStructuresTest.java
index 1cae210..5561d95 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreDataStructuresTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreDataStructuresTest.java
@@ -170,6 +170,8 @@ public class IgnitePersistentStoreDataStructuresTest extends GridCommonAbstractT
* @throws Exception If failed.
*/
public void testSet() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-5553");
+
Ignite ignite = startGrids(4);
ignite.active(true);
[40/50] ignite git commit: IGNITE-5656 Fixed misaligned checkboxs.
Posted by vo...@apache.org.
IGNITE-5656 Fixed misaligned checkboxs.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ad739d59
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ad739d59
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ad739d59
Branch: refs/heads/master
Commit: ad739d59d5517994cdab18a8a5dad3cad7b9dfa0
Parents: 18bbb14
Author: Ilya Borisov <ib...@gridgain.com>
Authored: Mon Jul 3 15:39:56 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Jul 3 15:39:56 2017 +0700
----------------------------------------------------------------------
.../frontend/app/helpers/jade/form/form-field-checkbox.pug | 2 +-
modules/web-console/frontend/app/primitives/tooltip/index.pug | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ad739d59/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug b/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug
index 21be8b2..497680b 100644
--- a/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug
+++ b/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug
@@ -36,4 +36,4 @@ mixin form-field-checkbox(label, model, name, disabled, required, tip)
)
span #{label}
- +tooltip(tip, tipOpts)
+ +tooltip(tip, tipOpts, 'tipLabel')
http://git-wip-us.apache.org/repos/asf/ignite/blob/ad739d59/modules/web-console/frontend/app/primitives/tooltip/index.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/tooltip/index.pug b/modules/web-console/frontend/app/primitives/tooltip/index.pug
index de1b116..632fc61 100644
--- a/modules/web-console/frontend/app/primitives/tooltip/index.pug
+++ b/modules/web-console/frontend/app/primitives/tooltip/index.pug
@@ -14,12 +14,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-mixin tooltip(title, options)
+mixin tooltip(title, options, tipClass = 'tipField')
if title
- i.tipField.icon-help(
+ i.icon-help(
bs-tooltip=''
data-title=title
data-container=options && options.container || false
data-placement=options && options.placement || false
+ class=`${tipClass}`
)
[31/50] ignite git commit: IGNITE-5076: improved multi-threaded start
of nodes
Posted by vo...@apache.org.
IGNITE-5076: improved multi-threaded start of nodes
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4936c888
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4936c888
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4936c888
Branch: refs/heads/master
Commit: 4936c8887f3ea58875c257ac2b999f90b6d9818f
Parents: 0bd6e8f
Author: Slava Koptilin <sl...@gmail.com>
Authored: Mon Jun 26 15:37:26 2017 +0300
Committer: agura <ag...@gridgain.com>
Committed: Thu Jun 29 15:45:22 2017 +0300
----------------------------------------------------------------------
.../ignite/testframework/junits/GridAbstractTest.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4936c888/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
old mode 100644
new mode 100755
index 01b27ad..a9a870e
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
@@ -692,12 +692,14 @@ public abstract class GridAbstractTest extends TestCase {
* @throws Exception If failed.
*/
protected Ignite startGridsMultiThreaded(int cnt) throws Exception {
- if (cnt == 1)
- return startGrids(1);
+ assert cnt > 0 : "Number of grids must be a positive number";
- Ignite ignite = startGridsMultiThreaded(0, cnt);
+ Ignite ignite = startGrids(1);
- checkTopology(cnt);
+ if (cnt > 1) {
+ startGridsMultiThreaded(1, cnt - 1);
+ checkTopology(cnt);
+ }
return ignite;
}
[33/50] ignite git commit: Code commenting after dev list questions
Posted by vo...@apache.org.
Code commenting after dev list questions
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/db8112fc
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/db8112fc
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/db8112fc
Branch: refs/heads/master
Commit: db8112fc67c7d539e7ce28f65669b33b38fabebc
Parents: 5037604
Author: dpavlov <dp...@gridgain.com>
Authored: Fri Jun 23 21:02:02 2017 +0300
Committer: dpavlov <dp...@gridgain.com>
Committed: Thu Jun 29 21:03:48 2017 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java | 5 +++++
.../discovery/tcp/messages/TcpDiscoveryAbstractMessage.java | 8 +++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/db8112fc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 184b6cd..03afff5 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -3981,6 +3981,11 @@ class ServerImpl extends TcpDiscoveryImpl {
/**
* Processes node added message.
*
+ * For coordinator node method marks the messages as verified for rest of nodes to apply the
+ * changes this message is issued for.
+ *
+ * Node added message is processed by other nodes only after coordinator verification.
+ *
* @param msg Node added message.
* @deprecated Due to current protocol node add process cannot be dropped in the middle of the ring,
* if new node auth fails due to config inconsistency. So, we need to finish add
http://git-wip-us.apache.org/repos/asf/ignite/blob/db8112fc/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
index e982b2f..a23cb63 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
@@ -57,7 +57,13 @@ public abstract class TcpDiscoveryAbstractMessage implements Serializable {
/** Message ID. */
private IgniteUuid id;
- /** Verifier node ID. */
+ /**
+ * Verifier node ID.
+ * Node can mark the messages as verified for rest of nodes to apply the
+ * changes this message is issued for, i.e. node added message, node failed or
+ * left message are processed by other nodes only after coordinator
+ * verification.
+ */
private UUID verifierNodeId;
/** Topology version. */
[27/50] ignite git commit: Merge remote-tracking branch
'community/ignite-2.1.2' into ignite-2.1.2
Posted by vo...@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/1ced55b6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1ced55b6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1ced55b6
Branch: refs/heads/master
Commit: 1ced55b6fabfd009e98a2d2010bf6e9a01a30fb9
Parents: d6972e9 3dbeac4
Author: sboikov <sb...@gridgain.com>
Authored: Wed Jun 28 11:31:18 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Jun 28 11:31:18 2017 +0300
----------------------------------------------------------------------
.../app/modules/configuration/generator/Docker.service.js | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[32/50] ignite git commit: IGNITE-5611 Update some selects to new
design.
Posted by vo...@apache.org.
IGNITE-5611 Update some selects to new design.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/50376045
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/50376045
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/50376045
Branch: refs/heads/master
Commit: 50376045c2585ecf7a944d54846256e7b9bb514f
Parents: 4936c88
Author: Ilya Borisov <ib...@gridgain.com>
Authored: Thu Jun 29 20:11:27 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Thu Jun 29 20:11:27 2017 +0700
----------------------------------------------------------------------
modules/web-console/frontend/app/app.config.js | 3 +-
modules/web-console/frontend/app/app.js | 2 +
.../app/components/bs-select-menu/controller.js | 28 +++++++
.../app/components/bs-select-menu/directive.js | 30 ++++++++
.../app/components/bs-select-menu/index.js | 24 ++++++
.../app/components/bs-select-menu/style.scss | 77 ++++++++++++++++++++
.../app/components/bs-select-menu/template.pug | 49 +++++++++++++
.../page-configure-basic/controller.js | 2 +-
.../page-configure-basic/controller.spec.js | 1 -
.../page-configure-basic/template.pug | 1 -
.../directives/ui-ace-pojos/ui-ace-pojos.pug | 2 +-
.../helpers/jade/form/form-field-dropdown.pug | 1 -
.../frontend/app/helpers/jade/mixins.pug | 2 +-
.../states/configuration/caches/node-filter.pug | 2 +-
.../states/configuration/caches/store.pug | 2 +-
.../configuration/clusters/deployment.pug | 2 +-
.../clusters/general/discovery/zookeeper.pug | 2 +-
.../states/configuration/clusters/hadoop.pug | 2 +-
.../configuration/clusters/load-balancing.pug | 2 +-
.../states/configuration/clusters/logger.pug | 2 +-
.../configuration/clusters/logger/log4j.pug | 2 +-
.../configuration/clusters/logger/log4j2.pug | 2 +-
.../states/configuration/clusters/swap.pug | 2 +-
.../frontend/controllers/domains-controller.js | 3 -
.../views/configuration/domains-import.tpl.pug | 13 ++--
.../frontend/views/templates/select.tpl.pug | 26 -------
26 files changed, 230 insertions(+), 54 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/app.config.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/app.config.js b/modules/web-console/frontend/app/app.config.js
index f93ee7e..b9741d1 100644
--- a/modules/web-console/frontend/app/app.config.js
+++ b/modules/web-console/frontend/app/app.config.js
@@ -29,7 +29,6 @@ _.mixin({
});
import alertTemplateUrl from 'views/templates/alert.tpl.pug';
-import selectTemplateUrl from 'views/templates/select.tpl.pug';
import dropdownTemplateUrl from 'views/templates/dropdown.tpl.pug';
import validationTemplateUrl from 'views/templates/validation-error.tpl.pug';
@@ -77,7 +76,7 @@ igniteConsoleCfg.config(['$selectProvider', ($selectProvider) => {
maxLength: '5',
allText: 'Select All',
noneText: 'Clear All',
- templateUrl: selectTemplateUrl,
+ template: '<bs-select-menu></bs-select-menu>',
iconCheckmark: 'fa fa-check',
caretHtml: ''
});
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/app.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/app.js b/modules/web-console/frontend/app/app.js
index fb444d9..61372a2 100644
--- a/modules/web-console/frontend/app/app.js
+++ b/modules/web-console/frontend/app/app.js
@@ -123,6 +123,7 @@ import userNotifications from './components/user-notifications';
import pageConfigure from './components/page-configure';
import pageConfigureBasic from './components/page-configure-basic';
import pageConfigureAdvanced from './components/page-configure-advanced';
+import bsSelectMenu from './components/bs-select-menu';
// Inject external modules.
import IgniteModules from 'IgniteModules/index';
@@ -188,6 +189,7 @@ angular
pageConfigure.name,
pageConfigureBasic.name,
pageConfigureAdvanced.name,
+ bsSelectMenu.name,
// Ignite modules.
IgniteModules.name
])
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/components/bs-select-menu/controller.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/bs-select-menu/controller.js b/modules/web-console/frontend/app/components/bs-select-menu/controller.js
new file mode 100644
index 0000000..f8c0171
--- /dev/null
+++ b/modules/web-console/frontend/app/components/bs-select-menu/controller.js
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default class {
+ static $inject = ['$scope'];
+
+ constructor($scope) {
+ Object.assign(this, {$scope});
+ }
+
+ areAllSelected() {
+ return this.$scope.$matches.every(({index}) => this.$scope.$isActive(index));
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/components/bs-select-menu/directive.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/bs-select-menu/directive.js b/modules/web-console/frontend/app/components/bs-select-menu/directive.js
new file mode 100644
index 0000000..44aa199
--- /dev/null
+++ b/modules/web-console/frontend/app/components/bs-select-menu/directive.js
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+import template from './template.pug';
+import controller from './controller';
+import './style.scss';
+
+export default function bsSelectMenu() {
+ return {
+ template,
+ controller,
+ controllerAs: '$ctrl',
+ restrict: 'E',
+ replace: true // Workaround: without [replace: true] bs-select detects incorrect menu size.
+ };
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/components/bs-select-menu/index.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/bs-select-menu/index.js b/modules/web-console/frontend/app/components/bs-select-menu/index.js
new file mode 100644
index 0000000..e64e1fa
--- /dev/null
+++ b/modules/web-console/frontend/app/components/bs-select-menu/index.js
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+import directive from './directive';
+
+export default angular
+ .module('ignite-console.bs-select-menu', [])
+ .directive('bsSelectMenu', directive);
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/components/bs-select-menu/style.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/bs-select-menu/style.scss b/modules/web-console/frontend/app/components/bs-select-menu/style.scss
new file mode 100644
index 0000000..67dec24
--- /dev/null
+++ b/modules/web-console/frontend/app/components/bs-select-menu/style.scss
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+
+.bs-select-menu {
+ @import '../../../public/stylesheets/variables.scss';
+
+ $item-height: 30px;
+ $max-visible-items: 11;
+
+ z-index: 2000;
+ padding: 0;
+ margin: 0;
+ list-style: none;
+ position: absolute;
+ font-family: Roboto;
+ outline: none !important;
+ overflow-y: auto;
+ overflow-x: hidden;
+ max-height: $max-visible-items * $item-height;
+ max-width: 280px;
+ box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.3);
+ border-radius: $ignite-button-border-radius;
+ border: 1px solid #c5c5c5;
+ background: white;
+
+ .bssm-active-indicator {
+ font-size: 14px;
+ width: 12px;
+ color: #afafaf;
+
+ &.bssm-active-indicator__active {
+ color: $ignite-brand-success;
+ }
+ }
+
+ .bssm-item-text {
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+
+ &>li {
+ width: 100%;
+
+ &>.bssm-item-button {
+ width: 100%;
+ justify-content: flex-start;
+ border-bottom: 1px solid #dedede;
+ padding-bottom: 9px;
+ background-color: transparent;
+ border-radius: 0;
+
+ &:hover {
+ background-color: #eeeeee;
+ }
+ }
+
+ &:last-child > .bssm-item-button {
+ border-bottom: none;
+ padding-bottom: 10px;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/components/bs-select-menu/template.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/bs-select-menu/template.pug b/modules/web-console/frontend/app/components/bs-select-menu/template.pug
new file mode 100644
index 0000000..91f3d8e
--- /dev/null
+++ b/modules/web-console/frontend/app/components/bs-select-menu/template.pug
@@ -0,0 +1,49 @@
+//-
+ 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.
+
+ul.bs-select-menu(
+ tabindex='-1'
+ ng-show='$isVisible()'
+ role='select'
+)
+ li(ng-if='$showAllNoneButtons || ($isMultiple && $matches.length > 2)')
+ button.btn-ignite.bssm-item-button(
+ ng-click='$ctrl.areAllSelected() ? $selectNone() : $selectAll()'
+ type='button'
+ )
+ span.bssm-active-indicator.icon.icon-left.fa(
+ ng-class=`{
+ 'fa-check-square bssm-active-indicator__active': $ctrl.areAllSelected(),
+ 'fa-square-o': !$ctrl.areAllSelected()
+ }`
+ )
+ | All
+ li(role='presentation' ng-repeat='match in $matches')
+ button.btn-ignite.bssm-item-button(
+ type='button'
+ role='menuitem'
+ tabindex='-1'
+ ng-click='$select($index, $event)'
+ data-placement='right auto'
+ title='{{ ::match.label }}'
+ )
+ span.bssm-active-indicator.icon.icon-left.fa(
+ ng-class=`{
+ 'fa-check-square bssm-active-indicator__active': $isActive($index),
+ 'fa-square-o': !$isActive($index)
+ }`
+ )
+ span.bssm-item-text(ng-bind-html='match.label')
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/components/page-configure-basic/controller.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/page-configure-basic/controller.js b/modules/web-console/frontend/app/components/page-configure-basic/controller.js
index ac99977..c0b56ac 100644
--- a/modules/web-console/frontend/app/components/page-configure-basic/controller.js
+++ b/modules/web-console/frontend/app/components/page-configure-basic/controller.js
@@ -113,7 +113,7 @@ export default class PageConfigureBasicController {
getClustersMenu(clusters = new Map()) {
const newOne = {_id: -1, name: '+ Add new cluster'};
return clusters.size
- ? [newOne, {}, ...clusters.values()]
+ ? [newOne, ...clusters.values()]
: [newOne];
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/components/page-configure-basic/controller.spec.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/page-configure-basic/controller.spec.js b/modules/web-console/frontend/app/components/page-configure-basic/controller.spec.js
index 4798219..f23b410 100644
--- a/modules/web-console/frontend/app/components/page-configure-basic/controller.spec.js
+++ b/modules/web-console/frontend/app/components/page-configure-basic/controller.spec.js
@@ -188,7 +188,6 @@ suite('page-configure-basic component controller', () => {
],
clustersMenu: [
{_id: -1, name: '+ Add new cluster'},
- {},
{_id: 1, name: '1', caches: [1, 2]},
{_id: 2, name: '2'}
],
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/components/page-configure-basic/template.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/page-configure-basic/template.pug b/modules/web-console/frontend/app/components/page-configure-basic/template.pug
index 91b0692..36dfb20 100644
--- a/modules/web-console/frontend/app/components/page-configure-basic/template.pug
+++ b/modules/web-console/frontend/app/components/page-configure-basic/template.pug
@@ -152,7 +152,6 @@ form(novalidate name=form)
}`
bs-options='cache._id as cache.name for cache in $ctrl.cachesMenu'
data-multiple='true'
- data-all-none-buttons='true'
data-placement='top-left'
pcb-protect-from-bs-select-render
)
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/directives/ui-ace-pojos/ui-ace-pojos.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/directives/ui-ace-pojos/ui-ace-pojos.pug b/modules/web-console/frontend/app/directives/ui-ace-pojos/ui-ace-pojos.pug
index 4bee5e5..bb8e6d352 100644
--- a/modules/web-console/frontend/app/directives/ui-ace-pojos/ui-ace-pojos.pug
+++ b/modules/web-console/frontend/app/directives/ui-ace-pojos/ui-ace-pojos.pug
@@ -22,7 +22,7 @@ mixin check-tooltip(message)
.col-xs-2.col-sm-2.col-md-2
label POJO class:
.col-xs-10.col-sm-10.col-md-10.summary-pojo-list
- button.select-toggle.form-control(ng-model='ctrl.class' bs-select bs-options='item for item in ctrl.classes' data-container='')
+ button.select-toggle.form-control(ng-model='ctrl.class' bs-select bs-options='item for item in ctrl.classes')
.details-row.checkbox
.col-xs-2.col-sm-2.col-md-2
.col-xs-10.col-sm-10.col-md-10
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/helpers/jade/form/form-field-dropdown.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/helpers/jade/form/form-field-dropdown.pug b/modules/web-console/frontend/app/helpers/jade/form/form-field-dropdown.pug
index 2f13d69..d0f95d4 100644
--- a/modules/web-console/frontend/app/helpers/jade/form/form-field-dropdown.pug
+++ b/modules/web-console/frontend/app/helpers/jade/form/form-field-dropdown.pug
@@ -31,7 +31,6 @@ mixin ignite-form-field-dropdown(label, model, name, disabled, required, multipl
bs-options=`item.value as item.label for item in ${options}`
data-multiple=multiple ? '1' : false
- data-container='body > .wrapper'
tabindex='0'
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/helpers/jade/mixins.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/helpers/jade/mixins.pug b/modules/web-console/frontend/app/helpers/jade/mixins.pug
index e18fcb1..9dfdab3 100644
--- a/modules/web-console/frontend/app/helpers/jade/mixins.pug
+++ b/modules/web-console/frontend/app/helpers/jade/mixins.pug
@@ -499,7 +499,7 @@ mixin evictionPolicy(model, name, enabled, required, tip)
{value: "LRU", label: "LRU"},\
{value: "FIFO", label: "FIFO"},\
{value: "SORTED", label: "Sorted"},\
- {value: undefined, label: "Not set"}\
+ {value: null, label: "Not set"}\
]', tip)
span(ng-show=kind)
+showHideLink('expanded', 'settings')
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/modules/states/configuration/caches/node-filter.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/states/configuration/caches/node-filter.pug b/modules/web-console/frontend/app/modules/states/configuration/caches/node-filter.pug
index 1b34b60..e184941 100644
--- a/modules/web-console/frontend/app/modules/states/configuration/caches/node-filter.pug
+++ b/modules/web-console/frontend/app/modules/states/configuration/caches/node-filter.pug
@@ -38,7 +38,7 @@ include /app/helpers/jade/mixins
'[\
{value: "IGFS", label: "IGFS nodes"},\
{value: "Custom", label: "Custom"},\
- {value: undefined, label: "Not set"}\
+ {value: null, label: "Not set"}\
]',
'Node filter variant'
)
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/modules/states/configuration/caches/store.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/states/configuration/caches/store.pug b/modules/web-console/frontend/app/modules/states/configuration/caches/store.pug
index 3af24df..d68b57e 100644
--- a/modules/web-console/frontend/app/modules/states/configuration/caches/store.pug
+++ b/modules/web-console/frontend/app/modules/states/configuration/caches/store.pug
@@ -62,7 +62,7 @@ mixin hibernateField(name, model, items, valid, save, newItem)
{value: "CacheJdbcPojoStoreFactory", label: "JDBC POJO store factory"},\
{value: "CacheJdbcBlobStoreFactory", label: "JDBC BLOB store factory"},\
{value: "CacheHibernateBlobStoreFactory", label: "Hibernate BLOB store factory"},\
- {value: undefined, label: "Not set"}\
+ {value: null, label: "Not set"}\
]',
'Factory for persistent storage for cache data\
<ul>\
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/modules/states/configuration/clusters/deployment.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/deployment.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/deployment.pug
index 25ee62a..74b2acf 100644
--- a/modules/web-console/frontend/app/modules/states/configuration/clusters/deployment.pug
+++ b/modules/web-console/frontend/app/modules/states/configuration/clusters/deployment.pug
@@ -127,7 +127,7 @@ include /app/helpers/jade/mixins
{value: "URI", label: "URI"},\
{value: "Local", label: "Local"}, \
{value: "Custom", label: "Custom"},\
- {value: undefined, label: "Default"}\
+ {value: null, label: "Default"}\
]',
'Grid deployment SPI is in charge of deploying tasks and classes from different sources:\
<ul>\
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/zookeeper.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/zookeeper.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/zookeeper.pug
index 6220eb0..6531d1d 100644
--- a/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/zookeeper.pug
+++ b/modules/web-console/frontend/app/modules/states/configuration/clusters/general/discovery/zookeeper.pug
@@ -43,7 +43,7 @@ mixin discovery-zookeeper(modelAt = 'backupItem')
{value: "OneTime", label: "Only once"},\
{value: "Forever", label: "Always allow retry"},\
{value: "Custom", label: "Custom"},\
- {value: undefined, label: "Default"}\
+ {value: null, label: "Default"}\
]',
'Available retry policies:\
<ul>\
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/modules/states/configuration/clusters/hadoop.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/hadoop.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/hadoop.pug
index b45efa4..22852cb 100644
--- a/modules/web-console/frontend/app/modules/states/configuration/clusters/hadoop.pug
+++ b/modules/web-console/frontend/app/modules/states/configuration/clusters/hadoop.pug
@@ -40,7 +40,7 @@ include /app/helpers/jade/mixins
+dropdown('Map reduce planner:', plannerModel + '.kind', '"MapReducePlanner"', 'true', 'Default', '[\
{value: "Weighted", label: "Weighted"},\
{value: "Custom", label: "Custom"},\
- {value: undefined, label: "Default"}\
+ {value: null, label: "Default"}\
]', 'Implementation of map reduce planner\
<ul>\
<li>Weighted - Planner which assigns mappers and reducers based on their "weights"</li>\
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/modules/states/configuration/clusters/load-balancing.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/load-balancing.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/load-balancing.pug
index b80f430..4fbc54e 100644
--- a/modules/web-console/frontend/app/modules/states/configuration/clusters/load-balancing.pug
+++ b/modules/web-console/frontend/app/modules/states/configuration/clusters/load-balancing.pug
@@ -68,7 +68,7 @@ include /app/helpers/jade/mixins
{value: "CPU", label: "CPU load"},\
{value: "ProcessingTime", label: "Processing time"},\
{value: "Custom", label: "Custom"},\
- {value: undefined, label: "Default"}\
+ {value: null, label: "Default"}\
]', 'Implementation of node load probing\
<ul>\
<li>Job count - Based on active and waiting job count</li>\
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/modules/states/configuration/clusters/logger.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/logger.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/logger.pug
index f135114..e750365 100644
--- a/modules/web-console/frontend/app/modules/states/configuration/clusters/logger.pug
+++ b/modules/web-console/frontend/app/modules/states/configuration/clusters/logger.pug
@@ -40,7 +40,7 @@ include /app/helpers/jade/mixins
{value: "JCL", label: "Jakarta Commons Logging (JCL)"},\
{value: "Null", label: "Null logger"},\
{value: "Custom", label: "Custom"},\
- {value: undefined, label: "Default"}\
+ {value: null, label: "Default"}\
]',
'Logger implementations\
<ul>\
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/modules/states/configuration/clusters/logger/log4j.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/logger/log4j.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/logger/log4j.pug
index fadaea4..c4ab379 100644
--- a/modules/web-console/frontend/app/modules/states/configuration/clusters/logger/log4j.pug
+++ b/modules/web-console/frontend/app/modules/states/configuration/clusters/logger/log4j.pug
@@ -32,7 +32,7 @@ div
{value: "DEBUG", label: "DEBUG"},\
{value: "TRACE", label: "TRACE"},\
{value: "ALL", label: "ALL"},\
- {value: undefined, label: "Default"}\
+ {value: null, label: "Default"}\
]',
'Level for internal log4j implementation')
.details-row
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/modules/states/configuration/clusters/logger/log4j2.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/logger/log4j2.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/logger/log4j2.pug
index d90ca09..299386f 100644
--- a/modules/web-console/frontend/app/modules/states/configuration/clusters/logger/log4j2.pug
+++ b/modules/web-console/frontend/app/modules/states/configuration/clusters/logger/log4j2.pug
@@ -32,7 +32,7 @@ div
{value: "DEBUG", label: "DEBUG"},\
{value: "TRACE", label: "TRACE"},\
{value: "ALL", label: "ALL"},\
- {value: undefined, label: "Default"}\
+ {value: null, label: "Default"}\
]',
'Level for internal log4j2 implementation')
.details-row
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/app/modules/states/configuration/clusters/swap.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/states/configuration/clusters/swap.pug b/modules/web-console/frontend/app/modules/states/configuration/clusters/swap.pug
index d278a09..019b0cc 100644
--- a/modules/web-console/frontend/app/modules/states/configuration/clusters/swap.pug
+++ b/modules/web-console/frontend/app/modules/states/configuration/clusters/swap.pug
@@ -36,7 +36,7 @@ include /app/helpers/jade/mixins
+dropdown('Swap space SPI:', `${swapModel}.kind`, '"swapSpaceSpi"', 'true', 'Choose swap SPI',
'[\
{value: "FileSwapSpaceSpi", label: "File-based swap"},\
- {value: undefined, label: "Not set"}\
+ {value: null, label: "Not set"}\
]',
'Provides a mechanism in grid for storing data on disk<br/>\
Ignite cache uses swap space to overflow data to disk if it cannot fit in memory\
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/controllers/domains-controller.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/controllers/domains-controller.js b/modules/web-console/frontend/controllers/domains-controller.js
index 25bb877..7a16c50 100644
--- a/modules/web-console/frontend/controllers/domains-controller.js
+++ b/modules/web-console/frontend/controllers/domains-controller.js
@@ -661,9 +661,6 @@ export default ['$rootScope', '$scope', '$http', '$state', '$filter', '$timeout'
}
if (!_.isEmpty($scope.caches)) {
- if (item.cachesOrTemplates.length > 0)
- item.cachesOrTemplates.push(null);
-
_.forEach($scope.caches, function(cache) {
item.cachesOrTemplates.push(cache);
});
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/views/configuration/domains-import.tpl.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/views/configuration/domains-import.tpl.pug b/modules/web-console/frontend/views/configuration/domains-import.tpl.pug
index 29bbf4a..7097197 100644
--- a/modules/web-console/frontend/views/configuration/domains-import.tpl.pug
+++ b/modules/web-console/frontend/views/configuration/domains-import.tpl.pug
@@ -66,7 +66,6 @@ mixin td-ellipses-lbl(w, lbl)
'Choose JDBC driver', '', 'jdbcDriverJars',
'Select appropriate JAR with JDBC driver<br> To add another driver you need to place it into "/jdbc-drivers" folder of Ignite Web Agent<br> Refer to Ignite Web Agent README.txt for for more information'
)(
- data-container='.modal-domain-import'
data-ignite-form-field-input-autofocus='true'
)
.settings-row.settings-row_small-label
@@ -137,8 +136,8 @@ mixin td-ellipses-lbl(w, lbl)
div.td-ellipsis
a(ng-if='!table.edit' ng-click='startEditDbTableCache(table)') {{tableActionView(table)}}
div(style='display: flex' ng-if='table.edit')
- button.select-toggle.form-control(style='width: 35%; margin-right: 5px' bs-select ng-model='table.action' data-container='.modal-domain-import' bs-options='item.value as item.shortLabel for item in importActions')
- button.select-toggle.form-control(style='width: 65%; margin-right: 0' bs-select ng-model='table.cacheOrTemplate' data-container='.modal-domain-import' bs-options='item.value as item.label for item in table.cachesOrTemplates')
+ button.select-toggle.form-control(style='width: 35%; margin-right: 5px' bs-select ng-model='table.action' bs-options='item.value as item.shortLabel for item in importActions')
+ button.select-toggle.form-control(style='width: 65%; margin-right: 0' bs-select ng-model='table.cacheOrTemplate' bs-options='item.value as item.label for item in table.cachesOrTemplates')
td
.settings-row
label Defaults to be applied for filtered tables
@@ -146,9 +145,9 @@ mixin td-ellipses-lbl(w, lbl)
.settings-row
.col-sm-11
.col-sm-6(style='padding-right: 5px')
- button.select-toggle.form-control(bs-select ng-model='importCommon.action' data-container='.modal-domain-import' bs-options='item.value as item.label for item in importActions')
+ button.select-toggle.form-control(bs-select ng-model='importCommon.action' bs-options='item.value as item.label for item in importActions')
.col-sm-6(style='padding-left: 5px; padding-right: 5px')
- button.select-toggle.form-control(bs-select ng-model='importCommon.cacheOrTemplate' data-container='.modal-domain-import' bs-options='item.value as item.label for item in importCommon.cachesOrTemplates')
+ button.select-toggle.form-control(bs-select ng-model='importCommon.cacheOrTemplate' bs-options='item.value as item.label for item in importCommon.cachesOrTemplates')
.col-sm-1(style='padding-left: 5px')
button.btn.btn-primary(ng-click='applyDefaults()') Apply
.import-domain-model-wizard-page(ng-show='importDomain.action == "options"')
@@ -167,12 +166,12 @@ mixin td-ellipses-lbl(w, lbl)
.settings-row(ng-show=generatePojo)
+checkbox('Generate aliases for query fields', 'ui.generateFieldAliases', '"domainGenerateFieldAliases"', 'Generate aliases for query fields with database field names when database field name differ from Java field name')
.settings-row.settings-row_small-label(ng-show=generatePojo)
- +java-package('Package:', 'ui.packageName', '"domainPackageName"', true, true, 'Package that will be used for POJOs generation')(data-container='.modal-domain-import')
+ +java-package('Package:', 'ui.packageName', '"domainPackageName"', true, true, 'Package that will be used for POJOs generation')
.settings-row.settings-row_small-label
+ignite-form-field-dropdown('Clusters:', 'ui.generatedCachesClusters', '"generatedCachesClusters"', false, false, true,
'Choose clusters for generated caches', '', 'clusters',
'Choose clusters that will be associated with generated caches'
- )(data-container='.modal-domain-import')
+ )
.modal-footer
label(ng-hide='importDomain.action == "drivers" || (importDomain.action == "connect" && importDomain.demo)').labelField {{importDomain.info}}
a.btn.btn-primary(ng-hide='importDomain.action == "drivers" || importDomain.action == "connect"' ng-click='importDomainPrev()' bs-tooltip='' data-title='{{prevTooltipText()}}' data-placement='bottom') Prev
http://git-wip-us.apache.org/repos/asf/ignite/blob/50376045/modules/web-console/frontend/views/templates/select.tpl.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/views/templates/select.tpl.pug b/modules/web-console/frontend/views/templates/select.tpl.pug
deleted file mode 100644
index aa6a2ef..0000000
--- a/modules/web-console/frontend/views/templates/select.tpl.pug
+++ /dev/null
@@ -1,26 +0,0 @@
-//-
- 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.
-
-ul.select.dropdown-menu(tabindex='-1' ng-show='$isVisible()' role='select')
- li(ng-if='$showAllNoneButtons || ($isMultiple && $matches.length > 2)')
- a(id='li-dropdown-select-all' ng-click='$selectAll()') {{$allText}} ({{$matches.length}})
- a(id='li-dropdown-select-none' ng-click='$selectNone()') {{$noneText}}
- hr(style='margin: 5px 0')
- li(role='presentation' ng-repeat='match in $matches')
- hr(ng-if='match.value == undefined' style='margin: 5px 0')
- a(id='li-dropdown-item-{{$index}}' role='menuitem' tabindex='-1' ng-class='{active: $isActive($index)}' ng-click='$select($index, $event)' bs-tooltip='widthIsSufficient && !widthIsSufficient("li-dropdown-item-{{$index}}", $index, match.label) ? match.label : ""' data-placement='right auto')
- i(class='{{$iconCheckmark}}' ng-if='$isActive($index)' ng-class='{active: $isActive($index)}')
- span(ng-bind-html='match.label')
[21/50] ignite git commit: IGNITE-5461 Support for Memory metrics and
fixed cache metrics.
Posted by vo...@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/master
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')
[47/50] ignite git commit: Merge remote-tracking branch
'professional/ignite-2.1.2' into ignite-2.1.2
Posted by vo...@apache.org.
Merge remote-tracking branch 'professional/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/ae5ec942
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ae5ec942
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ae5ec942
Branch: refs/heads/master
Commit: ae5ec942710c9c70829288169474787d1e682b35
Parents: 64596ea 7d42dea
Author: Dmitriy Govorukhin <dm...@gmail.com>
Authored: Mon Jul 3 18:20:55 2017 +0300
Committer: Dmitriy Govorukhin <dm...@gmail.com>
Committed: Mon Jul 3 18:20:55 2017 +0300
----------------------------------------------------------------------
.../GridCacheAtomicSequenceImpl.java | 55 ++++++++++++--------
...titionedAtomicSequenceMultiThreadedTest.java | 32 ++++++++++++
2 files changed, 64 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
[45/50] ignite git commit: IGNITE-5613 - Fixed race on local sequence
increment and distributed update
Posted by vo...@apache.org.
IGNITE-5613 - Fixed race on local sequence increment and distributed update
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7d42dea8
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7d42dea8
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7d42dea8
Branch: refs/heads/master
Commit: 7d42dea8e3e50707c34e8e8d211cd54da1505210
Parents: c4ddda3
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Mon Jul 3 17:05:48 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Mon Jul 3 17:05:48 2017 +0300
----------------------------------------------------------------------
.../GridCacheAtomicSequenceImpl.java | 55 ++++++++++++--------
...titionedAtomicSequenceMultiThreadedTest.java | 32 ++++++++++++
2 files changed, 64 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d42dea8/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
index 725e4aa..47fa49e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
@@ -382,39 +382,48 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
long newUpBound;
- curLocVal = locVal;
+ // Even though we hold a transaction lock here, we must hold the local update lock here as well
+ // because we mutate multipe variables (locVal and upBound).
+ localUpdate.lock();
- // If local range was already reserved in another thread.
- if (curLocVal + l <= upBound) {
- locVal = curLocVal + l;
+ try {
+ curLocVal = locVal;
- return updated ? curLocVal + l : curLocVal;
- }
+ // If local range was already reserved in another thread.
+ if (curLocVal + l <= upBound) {
+ locVal = curLocVal + l;
- long curGlobalVal = seq.get();
+ return updated ? curLocVal + l : curLocVal;
+ }
- long newLocVal;
+ long curGlobalVal = seq.get();
- /* We should use offset because we already reserved left side of range.*/
- long off = batchSize > 1 ? batchSize - 1 : 1;
+ long newLocVal;
- // Calculate new values for local counter, global counter and upper bound.
- if (curLocVal + l >= curGlobalVal) {
- newLocVal = curLocVal + l;
+ /* We should use offset because we already reserved left side of range.*/
+ long off = batchSize > 1 ? batchSize - 1 : 1;
- newUpBound = newLocVal + off;
- }
- else {
- newLocVal = curGlobalVal;
+ // Calculate new values for local counter, global counter and upper bound.
+ if (curLocVal + l >= curGlobalVal) {
+ newLocVal = curLocVal + l;
- newUpBound = newLocVal + off;
- }
+ newUpBound = newLocVal + off;
+ }
+ else {
+ newLocVal = curGlobalVal;
- locVal = newLocVal;
- upBound = newUpBound;
+ newUpBound = newLocVal + off;
+ }
- if (updated)
- curLocVal = newLocVal;
+ locVal = newLocVal;
+ upBound = newUpBound;
+
+ if (updated)
+ curLocVal = newLocVal;
+ }
+ finally {
+ localUpdate.unlock();
+ }
// Global counter must be more than reserved upper bound.
seq.set(newUpBound + 1);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d42dea8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicSequenceMultiThreadedTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicSequenceMultiThreadedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicSequenceMultiThreadedTest.java
index 945650d..4db9bd3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicSequenceMultiThreadedTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicSequenceMultiThreadedTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache.datastructures.partitioned;
import java.util.Random;
import java.util.UUID;
+import java.util.concurrent.Callable;
import org.apache.ignite.IgniteAtomicSequence;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.cache.CacheMode;
@@ -26,6 +27,7 @@ import org.apache.ignite.configuration.AtomicConfiguration;
import org.apache.ignite.internal.processors.cache.datastructures.IgniteAtomicsAbstractTest;
import org.apache.ignite.internal.processors.datastructures.GridCacheAtomicSequenceImpl;
import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.testframework.GridTestUtils;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
@@ -281,6 +283,36 @@ public class GridCachePartitionedAtomicSequenceMultiThreadedTest extends IgniteA
}
/**
+ * @throws Exception if failed.
+ */
+ public void testMultipleSequences() throws Exception {
+ final int seqCnt = 5;
+ final int threadCnt = 5;
+ final int incCnt = 1_000;
+
+ final IgniteAtomicSequence[] seqs = new IgniteAtomicSequence[seqCnt];
+
+ String seqName = UUID.randomUUID().toString();
+
+ for (int i = 0; i < seqs.length; i++)
+ seqs[i] = grid(0).atomicSequence(seqName, 0, true);
+
+ GridTestUtils.runMultiThreaded(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ for (int i = 0; i < incCnt; i++) {
+ for (IgniteAtomicSequence seq : seqs)
+ seq.incrementAndGet();
+ }
+
+ return null;
+ }
+ }, threadCnt, "load");
+
+ for (IgniteAtomicSequence seq : seqs)
+ assertEquals(seqCnt * threadCnt * incCnt, seq.get());
+ }
+
+ /**
* Executes given closure in a given number of threads given number of times.
*
* @param c Closure to execute.
[35/50] ignite git commit: IGNITE-5611 Fix text color cascading issue.
Posted by vo...@apache.org.
IGNITE-5611 Fix text color cascading issue.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/531a0de3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/531a0de3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/531a0de3
Branch: refs/heads/master
Commit: 531a0de302a00e2285bf4bc16bee1f1bdcc7d4f1
Parents: 5699be7
Author: Ilya Borisov <kl...@gmail.com>
Authored: Fri Jun 30 14:16:49 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Jun 30 14:39:27 2017 +0700
----------------------------------------------------------------------
.../web-console/frontend/app/components/bs-select-menu/style.scss | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/531a0de3/modules/web-console/frontend/app/components/bs-select-menu/style.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/bs-select-menu/style.scss b/modules/web-console/frontend/app/components/bs-select-menu/style.scss
index 67dec24..faddd3c 100644
--- a/modules/web-console/frontend/app/components/bs-select-menu/style.scss
+++ b/modules/web-console/frontend/app/components/bs-select-menu/style.scss
@@ -36,6 +36,7 @@
border-radius: $ignite-button-border-radius;
border: 1px solid #c5c5c5;
background: white;
+ color: initial; // Fixes color inheritance inside some containers
.bssm-active-indicator {
font-size: 14px;
[15/50] ignite git commit: Quick fix for NPE in
PageMemoryImpl.loadedPages
Posted by vo...@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/master
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();
+ }
}
}
[12/50] ignite git commit: IGNITE-4467 fixed table header scrolling
with content
Posted by vo...@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/master
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 {
[14/50] ignite git commit: Merge remote-tracking branch
'remotes/origin/master' into ignite-2.1.2
Posted by vo...@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/master
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);
[04/50] ignite git commit: IGNITE-4467 Fixed ui for modal, select,
grid. Added components: switcher, timepicker.
Posted by vo...@apache.org.
IGNITE-4467 Fixed ui for modal, select, grid. Added components: switcher, timepicker.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9e06773b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9e06773b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9e06773b
Branch: refs/heads/master
Commit: 9e06773bed20e15772aa51ec2c2bbb4c984e8912
Parents: bebe80e
Author: Dmitriy Shabalin <ds...@gridgain.com>
Authored: Fri Jun 23 17:37:10 2017 +0700
Committer: Andrey Novikov <an...@gridgain.com>
Committed: Fri Jun 23 17:37:10 2017 +0700
----------------------------------------------------------------------
.../input-dialog/input-dialog.tpl.pug | 32 ++--
.../list-of-registered-users.tpl.pug | 2 +-
.../helpers/jade/form/form-field-checkbox.pug | 15 +-
.../frontend/app/helpers/jade/mixins.pug | 4 +-
.../app/modules/agent/AgentManager.service.js | 5 +-
.../app/primitives/datepicker/index.pug | 11 +-
.../app/primitives/datepicker/index.scss | 34 +++-
.../frontend/app/primitives/dropdown/index.scss | 98 ++++++++++-
.../frontend/app/primitives/file/index.pug | 37 +++++
.../frontend/app/primitives/file/index.scss | 60 +++++++
.../app/primitives/form-field/index.scss | 76 +++++++++
.../frontend/app/primitives/grid/index.scss | 42 +++++
.../frontend/app/primitives/index.js | 7 +-
.../frontend/app/primitives/modal/index.scss | 42 ++++-
.../frontend/app/primitives/panel/index.scss | 1 +
.../frontend/app/primitives/switcher/index.pug | 20 +++
.../frontend/app/primitives/switcher/index.scss | 80 +++++++++
.../app/primitives/timepicker/index.pug | 59 +++++++
.../app/primitives/timepicker/index.scss | 137 ++++++++++++++++
.../app/primitives/typography/index.scss | 36 ++++
.../app/primitives/ui-grid-header/index.scss | 2 +-
.../app/primitives/ui-grid-settings/index.scss | 163 +++++++++++++------
.../frontend/app/primitives/ui-grid/index.scss | 159 +++++++++++++++---
.../frontend/public/images/icons/filter.svg | 1 +
.../frontend/public/images/icons/index.js | 2 +
.../frontend/public/images/icons/search.svg | 1 +
.../frontend/public/stylesheets/style.scss | 24 ---
.../views/templates/agent-download.tpl.pug | 23 +--
.../frontend/views/templates/confirm.tpl.pug | 17 +-
29 files changed, 1019 insertions(+), 171 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/components/input-dialog/input-dialog.tpl.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/input-dialog/input-dialog.tpl.pug b/modules/web-console/frontend/app/components/input-dialog/input-dialog.tpl.pug
index 95549d7..416d79b 100644
--- a/modules/web-console/frontend/app/components/input-dialog/input-dialog.tpl.pug
+++ b/modules/web-console/frontend/app/components/input-dialog/input-dialog.tpl.pug
@@ -16,24 +16,24 @@
include /app/helpers/jade/mixins
-.modal(tabindex='-1' role='dialog')
+.modal.modal--ignite(tabindex='-1' role='dialog')
.modal-dialog
- .modal-content
+ form.modal-content(name='ctrl.form' novalidate)
.modal-header
- button.close(ng-click='$hide()') ×
h4.modal-title
i.fa.fa-clone
- | {{ ctrl.title }}
- form.form-horizontal.modal-body.row(name='ui.inputForm' novalidate)
- div
- .col-sm-2
- label.required.labelFormField {{ ctrl.label }}:
- .col-sm-10
- .input-tip
- +ignite-form-field-input('"input-field"', 'ctrl.value', false, 'true', 'Enter value')(
- data-ignite-form-field-input-autofocus='true'
- ignite-on-enter='form.$valid && ctrl.confirm()'
- )
+ span {{ ctrl.title }}
+ button.close(type='button' aria-label='Close' ng-click='$hide()')
+ svg(ignite-icon="cross")
+
+ .modal-body
+ .row
+ .col-100
+ +ignite-form-field-text('{{ ctrl.label }}', 'ctrl.value', '"input-field"', false, true, 'Enter value')(
+ data-ignite-form-field-input-autofocus='true'
+ ignite-on-enter='form.$valid && ctrl.confirm()'
+ )
+
.modal-footer
- button.btn.btn-default(id='copy-btn-cancel' ng-click='$hide()') Cancel
- button.btn.btn-primary(id='copy-btn-confirm' ng-disabled='ui.inputForm.$invalid' ng-click='ctrl.confirm()') Confirm
+ button#copy-btn-cancel.btn-ignite.btn-ignite--link-success(ng-click='$hide()') Cancel
+ button#copy-btn-confirm.btn-ignite.btn-ignite--success(ng-disabled='ctrl.form.$invalid' ng-click='ctrl.confirm()') Confirm
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.tpl.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.tpl.pug b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.tpl.pug
index d9e55af..85a2070 100644
--- a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.tpl.pug
+++ b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.tpl.pug
@@ -72,4 +72,4 @@ mixin grid-settings()
| {{ $ctrl.selected.length }} item{{ $ctrl.selected.length > 1 ? 's' : '' }} selected
.panel-collapse
- .grid.ui-grid--ignite(ui-grid='$ctrl.gridOptions' ui-grid-resize-columns ui-grid-selection ui-grid-exporter ui-grid-pinning ui-grid-grouping)
+ .grid.ui-grid--ignite.ui-grid-disabled-group-selection(ui-grid='$ctrl.gridOptions' ui-grid-resize-columns ui-grid-selection ui-grid-exporter ui-grid-pinning ui-grid-grouping)
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug b/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug
index fe7f912..21be8b2 100644
--- a/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug
+++ b/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug
@@ -15,18 +15,7 @@
limitations under the License.
mixin form-field-checkbox(label, model, name, disabled, required, tip)
- //- TODO: Need to use common tooltip.
- mixin tooltip-checkbox(title, options)
- if title
- i.tipLabel.icon-help(
- bs-tooltip=''
-
- data-title=title
- data-container=options && options.container || false
- data-placement=options && options.placement || false
- )
-
- div.checkbox.col-xs-12.col-sm-12.col-md-12
+ .checkbox
label(id=`{{ ${name} }}Label`)
.input-tip
if block
@@ -47,4 +36,4 @@ mixin form-field-checkbox(label, model, name, disabled, required, tip)
)
span #{label}
- +tooltip-checkbox(tip, tipOpts)
+ +tooltip(tip, tipOpts)
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/helpers/jade/mixins.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/helpers/jade/mixins.pug b/modules/web-console/frontend/app/helpers/jade/mixins.pug
index e9278bd..50a0208 100644
--- a/modules/web-console/frontend/app/helpers/jade/mixins.pug
+++ b/modules/web-console/frontend/app/helpers/jade/mixins.pug
@@ -17,10 +17,12 @@
include ./form
include ../../primitives/btn-group/index
include ../../primitives/datepicker/index
+include ../../primitives/timepicker/index
include ../../primitives/dropdown/index
include ../../primitives/tooltip/index
include ../../primitives/ui-grid-settings/index
-include ../../primitives/switch/index
+include ../../primitives/radio/index
+include ../../primitives/switcher/index
//- Mixin for advanced options toggle.
mixin advanced-options-toggle(click, cond, showMessage, hideMessage)
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/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 281d532..eb4ebfc 100644
--- a/modules/web-console/frontend/app/modules/agent/AgentManager.service.js
+++ b/modules/web-console/frontend/app/modules/agent/AgentManager.service.js
@@ -15,11 +15,10 @@
* limitations under the License.
*/
-import io from 'socket.io-client'; // eslint-disable-line no-unused-vars
-import maskNull from 'app/core/utils/maskNull';
-
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
+import maskNull from 'app/core/utils/maskNull';
+
const State = {
INIT: 'INIT',
AGENT_DISCONNECTED: 'AGENT_DISCONNECTED',
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/datepicker/index.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/datepicker/index.pug b/modules/web-console/frontend/app/primitives/datepicker/index.pug
index e5da970..e789a1f 100644
--- a/modules/web-console/frontend/app/primitives/datepicker/index.pug
+++ b/modules/web-console/frontend/app/primitives/datepicker/index.pug
@@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-mixin ignite-form-field-datepicker(label, model, name, mindate, maxdate, disabled, required, placeholder, tip)
+mixin ignite-form-field-datepicker(label, model, name, mindate, maxdate, minview = 1, format = 'MMM yyyy', disabled, required, placeholder, tip)
mixin form-field-input()
input.form-control(
id=`{{ ${name} }}Input`
@@ -28,15 +28,16 @@ mixin ignite-form-field-datepicker(label, model, name, mindate, maxdate, disable
data-ng-disabled=disabled && `${disabled}`
bs-datepicker
- data-date-format='MMM yyyy'
- data-start-view='1'
- data-min-view='1'
data-min-date=mindate ? `{{ ${mindate} }}` : false
data-max-date=maxdate ? `{{ ${maxdate} }}` : `today`
+ data-min-view=minview
+ data-date-format=format
+ data-start-view=minview
+
data-placement='bottom'
- data-container='.docs-content'
+ data-container='.ignite-form-field'
tabindex='0'
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/datepicker/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/datepicker/index.scss b/modules/web-console/frontend/app/primitives/datepicker/index.scss
index 786a2c1..1670704 100644
--- a/modules/web-console/frontend/app/primitives/datepicker/index.scss
+++ b/modules/web-console/frontend/app/primitives/datepicker/index.scss
@@ -15,8 +15,29 @@
* limitations under the License.
*/
-.datepicker.dropdown-menu tbody button {
- height: 100%;
+.datepicker.dropdown-menu {
+ width: 250px;
+ height: 270px;
+
+ button {
+ outline: none;
+ border: 0;
+ }
+
+ tbody {
+ height: 180px;
+ }
+
+ tbody button {
+ padding: 6px;
+ height: 100%;
+ }
+
+ &.datepicker-mode-1, &.datepicker-mode-2 {
+ tbody button {
+ height: 65px;
+ }
+ }
}
.datepicker--ignite {
@@ -61,4 +82,13 @@
}
}
}
+}
+
+.theme--ignite {
+ .datepicker--ignite {
+ display: block;
+ width: 100%;
+
+ font-size: 14px;
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/dropdown/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/dropdown/index.scss b/modules/web-console/frontend/app/primitives/dropdown/index.scss
index a3252cc..d39306d 100644
--- a/modules/web-console/frontend/app/primitives/dropdown/index.scss
+++ b/modules/web-console/frontend/app/primitives/dropdown/index.scss
@@ -22,6 +22,7 @@
ul.dropdown-menu {
z-index: 1;
+
min-width: calc(100% + 2px);
margin-top: 2px;
padding: 0;
@@ -29,15 +30,22 @@
border-color: #c5c5c5;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.3);
- a {
- padding-left: 15px;
- padding-right: 15px;
+ li {
+ a {
+ padding-left: 15px;
+ padding-right: 15px;
+
+ color: $text-color;
+ line-height: 26px;
- color: $text-color;
- line-height: 26px;
+ &:hover {
+ color: #a8110f;
+ }
- &:hover {
- color: #a8110f;
+ &.active {
+ background-color: #fff;
+ font-weight: normal;
+ }
}
}
@@ -45,19 +53,91 @@
border-bottom: 1px solid $table-border-color;
}
}
+
+ ul.select.dropdown-menu {
+ li {
+ a {
+ &:before {
+ content: '';
+
+ position: relative;
+ top: 1px;
+ left: -3px;
+
+ display: inline-block;
+ width: 12px;
+ height: 12px;
+
+ margin-left: 0;
+ margin-right: 7px;
+
+ border: 1px solid #afafaf;
+ border-radius: 2px;
+ background-color: #FFF;
+
+ box-shadow: inset 0 1px 1px $input-border;
+ }
+
+ &.active {
+ color: $text-color;
+ }
+
+ &.active:before {
+ border-color: $brand-info;
+ background-color: $brand-info;
+
+ box-shadow: none;
+ }
+
+ & > i {
+ position: relative;
+ top: -2px;
+ left: -18px;
+
+ float: none;
+
+ width: 0;
+ margin: 0;
+
+ background: none;
+
+ &.fa-check:before {
+ content: '';
+
+ display: block;
+ width: 4px;
+ height: 8px;
+
+ border: solid #FFF;
+ border-width: 0 2px 2px 0;
+
+ transform: rotate(35deg);
+ }
+ }
+ }
+ }
+ }
}
.dropdown--ignite {
- button, .btn-ignite {
+ .btn-ignite {
position: relative;
&::after {
content: '';
+
position: absolute;
bottom: -4px;
+
display: block;
height: 4px;
width: 100%;
}
+
+ &[disabled='disabled'] {
+ ul.dropdown-menu {
+ display: none !important;
+ }
+ }
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/file/index.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/file/index.pug b/modules/web-console/frontend/app/primitives/file/index.pug
new file mode 100644
index 0000000..4ce9ef4
--- /dev/null
+++ b/modules/web-console/frontend/app/primitives/file/index.pug
@@ -0,0 +1,37 @@
+//-
+ 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.
+
+mixin ignite-form-field-file(label, model, name, disabled, required, options, tip)
+ .file--ignite.ignite-form-field(ng-class='{ "choosen": `${model}` }')
+ label.ignite-form-field__label(for=`{{ ${name} }}Input`)
+ span Folder name:
+ .ignite-form-field__control
+ label.btn-ignite.btn-ignite--primary(for=`{{ ${name} }}Input`)
+ | Choose Destination Folder
+ label.tipField.link-primary(for=`{{ ${name} }}Input`) Change folder
+
+ +tooltip(tip, tipOpts)
+
+ if block
+ block
+
+ .input-tip
+ input(
+ id=`{{ ${name} }}Input`
+ type='file'
+ data-ng-model=model
+ )&attributes(attributes)
+ | {{ `${model}` }}
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/file/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/file/index.scss b/modules/web-console/frontend/app/primitives/file/index.scss
new file mode 100644
index 0000000..dbd32a4
--- /dev/null
+++ b/modules/web-console/frontend/app/primitives/file/index.scss
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+.file--ignite {
+ label {
+ cursor: pointer;
+ }
+
+ &.choosen {
+ .ignite-form-field__control {
+ .btn-ignite {
+ display: none;
+ }
+
+ .tipField {
+ display: block;
+ }
+ }
+ }
+
+ &:not(.choosen) {
+ .ignite-form-field__label {
+ font-size: 0;
+ line-height: 0;
+ margin-bottom: 0px;
+ }
+ }
+
+ .ignite-form-field__control {
+ display: flex;
+
+ input[type='file'] {
+ position: absolute;
+ opacity: 0;
+ z-index: -1;
+ }
+
+ .tipField {
+ display: none;
+ }
+
+ .input-tip {
+ order: -1;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/form-field/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/form-field/index.scss b/modules/web-console/frontend/app/primitives/form-field/index.scss
new file mode 100644
index 0000000..42370b3
--- /dev/null
+++ b/modules/web-console/frontend/app/primitives/form-field/index.scss
@@ -0,0 +1,76 @@
+
+/*
+ * 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.
+ */
+
+@import '../../../public/stylesheets/variables';
+
+.theme--ignite {
+ .ignite-form-field {
+ width: 100%;
+
+ &.radio--ignite {
+ width: auto;
+ }
+
+ .ignite-form-field__label {
+ float: left;
+ width: 100%;
+ margin: 4px 10px;
+
+ color: $gray-light;
+ font-size: 12px;
+ line-height: 12px;
+ }
+
+ .ignite-form-field__control {
+ width: 100%;
+
+ .input-tip {
+ display: flex;
+ overflow: visible;
+ }
+
+ .tipField {
+ line-height: 36px;
+ }
+
+ input,
+ button {
+ overflow: visible;
+
+ box-sizing: border-box;
+ width: 100%;
+ max-width: initial;
+ height: 36px;
+ padding: 0px 10px;
+ margin-right: 0;
+
+ border: solid 1px #c5c5c5;
+ border-radius: 4px;
+ background-color: #ffffff;
+ box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.2);
+
+ color: $text-color;
+ line-height: 36px;
+ }
+
+ input[type='number'] {
+ text-align: right;
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/grid/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/grid/index.scss b/modules/web-console/frontend/app/primitives/grid/index.scss
new file mode 100644
index 0000000..a77240f
--- /dev/null
+++ b/modules/web-console/frontend/app/primitives/grid/index.scss
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+
+.theme--ignite {
+ .row {
+ display: flex;
+ margin: 16px -10px;
+
+ line-height: 36px;
+
+ & > [class*="col-"] {
+ & > * {
+ align-self: flex-end;
+ }
+ }
+ }
+
+ [class*="col-"] {
+ display: inline-flex;
+ padding: 0 10px;
+ }
+
+ @for $i from 1 through 20 {
+ .col-#{$i*5} {
+ width: $i*5%;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/index.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/index.js b/modules/web-console/frontend/app/primitives/index.js
index 35a7cde..30f7d7e 100644
--- a/modules/web-console/frontend/app/primitives/index.js
+++ b/modules/web-console/frontend/app/primitives/index.js
@@ -18,6 +18,7 @@
import './badge/index.scss';
import './btn/index.scss';
import './datepicker/index.scss';
+import './timepicker/index.scss';
import './tabs/index.scss';
import './table/index.scss';
import './panel/index.scss';
@@ -27,4 +28,8 @@ import './ui-grid/index.scss';
import './ui-grid-header/index.scss';
import './ui-grid-settings/index.scss';
import './page/index.scss';
-import './switch/index.scss';
+import './radio/index.scss';
+import './switcher/index.scss';
+import './form-field/index.scss';
+import './typography/index.scss';
+import './grid/index.scss';
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/modal/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/modal/index.scss b/modules/web-console/frontend/app/primitives/modal/index.scss
index 58b7370..87d8dc3 100644
--- a/modules/web-console/frontend/app/primitives/modal/index.scss
+++ b/modules/web-console/frontend/app/primitives/modal/index.scss
@@ -150,15 +150,18 @@
border-bottom: 1px solid $table-border-color;
h4 {
+ display: inline-flex;
+ align-items: center;
+ margin-top: 1px;
+ margin-bottom: -1px;
+
color: $text-color;
font-size: 16px;
font-family: Roboto;
font-weight: 400;
line-height: 36px;
- margin-top: 1px;
- margin-bottom: -1px;
- svg, i {
+ i, .icon-left, svg {
margin-right: 8px;
color: #424242;
@@ -169,17 +172,44 @@
}
.modal-body {
- padding: 20px;
+ margin: 0;
+ padding: 5px 20px;
+
+ .input-tip {
+ padding-top: 0;
+ }
}
.modal-footer {
padding: 10px 20px;
border-top: 1px solid $table-border-color;
-
- button + button {
+
+ button + button,
+ button + a {
margin-left: 20px;
}
}
+
+ ul.tabs {
+ margin-top: 20px;
+ }
+
+ .panel--ignite {
+ margin-top: 20px;
+ margin-bottom: 20px;
+ }
+
+ ul.tabs + .panel--ignite {
+ margin-top: 0;
+ }
+
+ fieldset {
+ margin: 16px 0;
+
+ & > .row:first-child {
+ margin-top: 0;
+ }
+ }
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/panel/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/panel/index.scss b/modules/web-console/frontend/app/primitives/panel/index.scss
index 75662ef..38d18dd 100644
--- a/modules/web-console/frontend/app/primitives/panel/index.scss
+++ b/modules/web-console/frontend/app/primitives/panel/index.scss
@@ -45,6 +45,7 @@
font-size: 14px;
font-style: italic;
line-height: 36px;
+ cursor: default;
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/switcher/index.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/switcher/index.pug b/modules/web-console/frontend/app/primitives/switcher/index.pug
new file mode 100644
index 0000000..5689094
--- /dev/null
+++ b/modules/web-console/frontend/app/primitives/switcher/index.pug
@@ -0,0 +1,20 @@
+//-
+ 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.
+
+mixin switcher()
+ label.switcher--ignite
+ input(type='checkbox')&attributes(attributes)
+ div(bs-tooltip=attributes.tip && '' data-title=attributes.tip data-trigger='hover')
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/switcher/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/switcher/index.scss b/modules/web-console/frontend/app/primitives/switcher/index.scss
new file mode 100644
index 0000000..cf8ed64
--- /dev/null
+++ b/modules/web-console/frontend/app/primitives/switcher/index.scss
@@ -0,0 +1,80 @@
+/*
+ * 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.
+ */
+
+@import '../../../public/stylesheets/variables';
+
+label.switcher--ignite {
+ width: 34px;
+ max-width: 34px !important;
+ height: 20px;
+
+ line-height: 20px;
+ vertical-align: middle;
+
+ cursor: pointer;
+
+ input[type="checkbox"] {
+ position: absolute;
+ opacity: 0.0;
+
+ & + div {
+ position: relative;
+
+ width: 34px;
+ height: 14px;
+ margin: 3px 0;
+
+ border-radius: 8px;
+ background-color: #C5C5C5;
+ transition: background 0.2s ease;
+
+ &:before {
+ content: '';
+
+ position: absolute;
+ top: -3px;
+ left: 0;
+
+ width: 20px;
+ height: 20px;
+
+ border: solid 1px #C5C5C5;
+ border-radius: 50%;
+ background-color: #FFF;
+
+ transition: all 0.12s ease;
+ }
+
+ &:active:before {
+ transform: scale(1.15, 0.85);
+ }
+ }
+
+ &:checked + div {
+ background-color: #FF8485;
+
+ &:before {
+ content: '';
+
+ left: 14px;
+
+ border: 0;
+ background-color: #EE2B27;
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/timepicker/index.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/timepicker/index.pug b/modules/web-console/frontend/app/primitives/timepicker/index.pug
new file mode 100644
index 0000000..9f1f6ec
--- /dev/null
+++ b/modules/web-console/frontend/app/primitives/timepicker/index.pug
@@ -0,0 +1,59 @@
+//-
+ 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.
+
+mixin ignite-form-field-timepicker(label, model, name, mindate, maxdate, disabled, required, placeholder, tip)
+
+ mixin form-field-input()
+ input.form-control(
+ id=`{{ ${name} }}Input`
+ name=`{{ ${name} }}`
+
+ placeholder=placeholder
+
+ data-ng-model=model
+
+ data-ng-required=required && `${required}`
+ data-ng-disabled=disabled && `${disabled}`
+
+ bs-timepicker
+ data-time-format='HH:mm'
+ data-length='1'
+ data-minute-step='1'
+ data-arrow-behavior='picker'
+
+ data-placement='bottom'
+ data-container=`.timepicker--ignite`
+
+ tabindex='0'
+
+ onkeydown="return false"
+
+ data-ignite-form-panel-field=''
+ )&attributes(attributes.attributes)
+
+ .timepicker--ignite.ignite-form-field
+ if name
+ +ignite-form-field__label(label, name, required)
+
+ .ignite-form-field__control
+ if tip
+ i.tipField.icon-help(bs-tooltip='' data-title=tip)
+
+ if block
+ block
+
+ .input-tip
+ +form-field-input(attributes=attributes)
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/timepicker/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/timepicker/index.scss b/modules/web-console/frontend/app/primitives/timepicker/index.scss
new file mode 100644
index 0000000..361e949
--- /dev/null
+++ b/modules/web-console/frontend/app/primitives/timepicker/index.scss
@@ -0,0 +1,137 @@
+/*
+ * 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.
+ */
+
+.timepicker.dropdown-menu {
+ padding: 0 4px;
+
+ button {
+ outline: none;
+ border: 0;
+ }
+
+ tbody button {
+ height: 100%;
+ padding: 6px;
+ }
+}
+
+.timepicker--ignite {
+ $height: 36px;
+
+ display: inline-block;
+ width: auto;
+
+ font-size: 14px;
+
+ label.ignite-form-field__label {
+ width: auto;
+ max-width: initial;
+
+ font-size: inherit;
+ line-height: $height;
+ }
+
+ .ignite-form-field__control {
+ width: auto;
+
+ input {
+ width: auto;
+ height: $height;
+ min-width: 40px;
+ max-width: 70px;
+ padding: 0;
+ padding-left: 5px;
+
+ cursor: pointer;
+ color: transparent;
+ font-size: inherit;
+ line-height: $height;
+ text-align: left;
+ text-shadow: 0 0 0 #ee2b27;
+
+ border: none;
+ box-shadow: none;
+ background: none;
+
+ &:hover, &:focus {
+ text-shadow: 0 0 0 #a8110f;
+ }
+ }
+ }
+
+ .dropdown-menu {
+ line-height: 30px;
+
+ thead, tfoot {
+ th {
+ text-align: center;
+ line-height: 0;
+ }
+
+ .btn.btn-default {
+ float: none !important;
+ display: inline-block;
+ margin-right: 0;
+
+ &:active {
+ box-shadow: none;
+ background: none;
+ }
+
+ &:before {
+ content: '';
+
+ display: block;
+ width: 10px;
+ height: 10px;
+
+ border: 2px solid #757575;
+ transform: rotate(45deg);
+ }
+
+ &:hover {
+ background: none;
+ }
+ }
+ }
+
+ thead {
+ th {
+ padding-top: 10px;
+ }
+
+ .btn.btn-default {
+ &:before {
+ border-width: 2px 0 0 2px;
+ }
+ }
+ }
+
+ tfoot {
+ th {
+ padding-top: 2px;
+ padding-bottom: 10px;
+ }
+
+ .btn.btn-default {
+ &:before {
+ border-width: 0 2px 2px 0;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/typography/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/typography/index.scss b/modules/web-console/frontend/app/primitives/typography/index.scss
new file mode 100644
index 0000000..7fee674
--- /dev/null
+++ b/modules/web-console/frontend/app/primitives/typography/index.scss
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+@import '../../../public/stylesheets/variables';
+
+.theme--ignite {
+ p {
+ margin: 20px 0;
+
+ color: $text-color;
+ font-size: 14px;
+ line-height: 17px;
+ }
+
+ h4 {
+ margin-top: 20px;
+
+ color: $text-color;
+ font-size: 16px;
+ font-weight: normal;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/ui-grid-header/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/ui-grid-header/index.scss b/modules/web-console/frontend/app/primitives/ui-grid-header/index.scss
index 7b3ce7b..ac58707 100644
--- a/modules/web-console/frontend/app/primitives/ui-grid-header/index.scss
+++ b/modules/web-console/frontend/app/primitives/ui-grid-header/index.scss
@@ -78,7 +78,7 @@
top: -100px;
}
.ng-hide + .ui-grid-header-cell-row .ui-grid-column-resizer.right {
- bottom: -100px;
+ bottom: 0;
}
&.ui-grid-header-cell .ui-grid-header-cell .ui-grid-column-resizer.right {
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/app/primitives/ui-grid-settings/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/ui-grid-settings/index.scss b/modules/web-console/frontend/app/primitives/ui-grid-settings/index.scss
index e192ad8..e5d30e6 100644
--- a/modules/web-console/frontend/app/primitives/ui-grid-settings/index.scss
+++ b/modules/web-console/frontend/app/primitives/ui-grid-settings/index.scss
@@ -20,73 +20,80 @@
.ui-grid-settings {
color: #393939;
- ul.select.dropdown-menu {
- padding: 0;
-
- & > li {
- & > a {
- padding: 3px 12px;
-
- & > span {
- line-height: 26px;
- padding-left: 10px;
- padding-right: 8px;
- cursor: pointer;
- }
+ .grid-settings {
+ ul.dropdown-menu {
+ padding: 0;
+ min-width: auto;
+
+ & > li {
+ & > a {
+ padding: 3px 12px;
+
+ & > span {
+ line-height: 26px;
+ padding-left: 10px;
+ padding-right: 8px;
+ cursor: pointer;
+ }
- & > i {
- position: relative;
-
- width: 12px;
- height: 12px;
- margin-top: 7px;
- margin-left: 0;
+ & > i {
+ position: relative;
+
+ width: 12px;
+ height: 12px;
+ margin-top: 7px;
+ margin-left: 0;
- color: inherit;
- line-height: 26px;
+ color: inherit;
+ line-height: 26px;
- border: 1px solid #afafaf;
- border-radius: 2px;
- background-color: #FFF;
+ border: 1px solid #afafaf;
+ border-radius: 2px;
+ background-color: #FFF;
- box-shadow: inset 0 1px 1px #ccc;
+ box-shadow: inset 0 1px 1px #ccc;
- &.fa-square-o:before,
- &.fa-check-square-o:before {
- content: '';
- }
+ &.fa-square-o:before,
+ &.fa-check-square-o:before {
+ content: '';
+ }
- &.fa-check-square-o {
- border-color: #0067b9;
- background-color: #0067b9;
+ &.fa-check-square-o {
+ border-color: #0067b9;
+ background-color: #0067b9;
- box-shadow: none;
- }
+ box-shadow: none;
+ }
- &.fa-check-square-o:before {
- content: '';
+ &.fa-check-square-o:before {
+ content: '';
- position: absolute;
- top: 0;
- left: 3px;
+ position: absolute;
+ top: 0;
+ left: 3px;
- width: 4px;
- height: 8px;
+ width: 4px;
+ height: 8px;
- border: solid #FFF;
- border-width: 0 2px 2px 0;
+ border: solid #FFF;
+ border-width: 0 2px 2px 0;
- transform: rotate(35deg);
+ transform: rotate(35deg);
+ }
}
}
- }
- &:not(:last-child) {
- border-bottom: 1px solid #dddddd;
+ &:not(:last-child) {
+ border-bottom: 1px solid #dddddd;
+ }
}
}
}
+ &--heading {
+ cursor: default;
+ }
+
&--heading > span {
position: relative;
top: -1px;
@@ -157,6 +164,62 @@
&-dateperiod {
display: block;
margin-right: 35px;
+
+ .ignite-form-field {
+ $height: 36px;
+
+ display: inline-block;
+ width: auto;
+
+ font-size: 14px;
+
+ label.ignite-form-field__label {
+ width: auto;
+ max-width: initial;
+
+ font-size: inherit;
+ line-height: $height;
+ }
+
+ .ignite-form-field__control {
+ width: auto;
+
+ .input-tip {
+ overflow: visible;
+ }
+
+ button {
+ overflow: visible;
+
+ width: auto;
+ height: $height;
+ min-width: 70px;
+ max-width: 70px;
+ padding: 0;
+ padding-left: 5px;
+
+ cursor: pointer;
+ color: transparent;
+ font-size: inherit;
+ line-height: $height;
+ text-align: left;
+ text-shadow: 0 0 0 #ee2b27;
+
+ border: none;
+ box-shadow: none;
+
+ &:hover, &:focus {
+ text-shadow: 0 0 0 #a8110f;
+ }
+ }
+
+ ul.dropdown-menu {
+ span {
+ text-shadow: none;
+ }
+ }
+ }
+ }
}
.btn-ignite,
@@ -167,6 +230,10 @@
margin-left: 20px;
margin-right: 0;
+
+ .timepicker--ignite {
+ width: 45px;
+ }
}
&-dateperiod {
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/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 7908d06..b26036b 100644
--- a/modules/web-console/frontend/app/primitives/ui-grid/index.scss
+++ b/modules/web-console/frontend/app/primitives/ui-grid/index.scss
@@ -17,15 +17,20 @@
@import '../../../public/stylesheets/variables';
-.ui-grid--ignite {
+.ui-grid.ui-grid--ignite {
$height: 46px;
+ position: relative;
border-top: none;
[role="button"] {
outline: none;
}
+ sup {
+ color: $ignite-brand-success;
+ }
+
.ui-grid-top-panel {
background: initial;
}
@@ -40,6 +45,14 @@
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 {
@@ -47,10 +60,14 @@
text-align: left;
font-family: Roboto;
+ white-space: nowrap;
}
}
.ui-grid-contents-wrapper {
+ position: absolute;
+ top: 0;
+
border-bottom-right-radius: 6px;
overflow: hidden;
}
@@ -69,24 +86,78 @@
}
}
- .ui-grid-header--subcategories {
- .ui-grid-header-span {
- background: initial;
+ .ui-grid-header-viewport {
+ .ui-grid-header-canvas {
+ .ui-grid-header-cell {
+ .ui-grid-cell-contents {
+ color: $gray-light;
+ font-size: 14px;
+ font-weight: normal;
+ font-style: normal;
+ line-height: 18px;
+ text-align: left;
- .ui-grid-cell-contents {
- color: $gray-light;
- font-size: 14px;
- font-weight: normal;
- font-style: normal;
- line-height: 18px;
- text-align: left;
+ padding: 15px 20px;
- padding: 8px 20px;
+ & > i {
+ line-height: 18px;
+ }
- & > i {
- line-height: 18px;
+ .ui-grid-header-cell-label {
+ // position: relative;
+ }
+
+ .ui-grid-header-cell-label + span {
+ position: relative;
+ right: 3px;
+ }
+
+ .ui-grid-header-cell-filter {
+ background-image:
+ linear-gradient(to right, $ignite-brand-success, transparent),
+ linear-gradient(to right, $ignite-brand-success 70%, transparent 0%);
+ background-position: left bottom;
+ background-repeat: repeat-x;
+ background-size: 0, 8px 1px, 0, 0;
+
+ &:hover {
+ background-image: none;
+ // linear-gradient(to right, change-color($ignite-brand-success, $lightness: 26%), transparent),
+ // linear-gradient(to right, change-color($ignite-brand-success, $lightness: 26%) 70%, transparent 0%);
+ }
+
+ div {
+ z-index: 1;
+ position: fixed;
+
+ width: calc(100% - 40px);
+ width: 100px;
+ height: 20px;
+ margin-top: -20px;
+
+ font-size: 0;
+ }
+
+ &.active {
+ color: $ignite-brand-primary;
+
+ background-image:
+ linear-gradient(to right, $ignite-brand-primary, transparent),
+ linear-gradient(to right, $ignite-brand-primary 70%, transparent 0%);
+ }
+ }
}
}
+ }
+ }
+
+ .ui-grid-header--subcategories {
+ .ui-grid-header-span.ui-grid-header-cell {
+ .ui-grid-cell-contents {
+ padding: 8px 20px;
+ }
+
+ background: initial;
[ng-show] .ui-grid-cell-contents {
text-align: center;
@@ -111,10 +182,6 @@
padding-right: 20px;
}
}
-
- .ui-grid-header-cell-label + span {
- position: relative;
- }
}
}
@@ -132,6 +199,24 @@
}
}
+ .ui-grid-header--subcategories {
+ .ui-grid-tree-base-row-header-buttons {
+ margin-top: 10px;
+ }
+
+ .ui-grid-selection-row-header-buttons {
+ margin-top: 12px;
+
+ &:after {
+ top: 3px;
+ }
+ }
+ }
+
+ .ui-grid-cell.ui-grid-disable-selection.ui-grid-row-header-cell {
+ pointer-events: auto;
+ }
+
&:before {
content: '';
@@ -339,11 +424,6 @@
}
.ui-grid-tree-header-row {
- .ui-grid-selection-row-header-buttons {
- opacity: .2;
- cursor: default;
- }
-
& ~ .ui-grid-row:not(.ui-grid-tree-header-row) {
position: relative;
@@ -413,4 +493,37 @@
background-position: center;
}
}
+
+ .ui-grid-icon-filter {
+ position: absolute;
+ right: 20px;
+
+ color: $text-color;
+
+ &:before {
+ content: '';
+ }
+ }
}
+
+.ui-grid--ignite.ui-grid-disabled-group-selection {
+ .ui-grid-pinned-container {
+ .ui-grid-tree-header-row {
+ .ui-grid-selection-row-header-buttons {
+ opacity: .2;
+ cursor: default;
+ }
+ }
+ }
+}
+
+.ui-grid--ignite.no-data {
+ position: relative;
+
+ padding: 16px 51px;
+
+ border-radius: 0 0 4px 4px;
+
+ font-style: italic;
+ line-height: 16px;
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/public/images/icons/filter.svg
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/public/images/icons/filter.svg b/modules/web-console/frontend/public/images/icons/filter.svg
new file mode 100644
index 0000000..b924daf
--- /dev/null
+++ b/modules/web-console/frontend/public/images/icons/filter.svg
@@ -0,0 +1 @@
+<svg id="filter-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g fill="currentColor" transform="translate(-635 -112)"><g transform="translate(475 33)"><path d="M175.9 79.4c.1.3.1.6-.2.8l-5.6 5.6v8.4c0 .3-.1.5-.4.7-.1 0-.2.1-.3.1-.2 0-.4-.1-.5-.2l-2.9-2.9c-.1-.1-.2-.3-.2-.5v-5.5l-5.6-5.6c-.2-.2-.3-.5-.2-.8.1-.3.4-.4.7-.4h14.5c.4-.1.6 0 .7.3z"/></g></g></svg>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/public/images/icons/index.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/public/images/icons/index.js b/modules/web-console/frontend/public/images/icons/index.js
index d6e7c6f..2609550 100644
--- a/modules/web-console/frontend/public/images/icons/index.js
+++ b/modules/web-console/frontend/public/images/icons/index.js
@@ -21,3 +21,5 @@ export gear from './gear.svg';
export clock from './clock.svg';
export manual from './manual.svg';
export download from './download.svg';
+export filter from './filter.svg';
+export search from './search.svg';
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/public/images/icons/search.svg
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/public/images/icons/search.svg b/modules/web-console/frontend/public/images/icons/search.svg
new file mode 100644
index 0000000..32e594c
--- /dev/null
+++ b/modules/web-console/frontend/public/images/icons/search.svg
@@ -0,0 +1 @@
+<svg id="search-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18"><g stroke="currentColor" stroke-width="2" transform="translate(-156 -179)"><g transform="translate(0 33)"><g transform="translate(0 120)"><g transform="translate(157 27)"><circle fill="transparent" cx="5.7" cy="5.7" r="5.7"/><path d="M9.1 9.1L16 16"/></g></g></g></g></svg>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/public/stylesheets/style.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/public/stylesheets/style.scss b/modules/web-console/frontend/public/stylesheets/style.scss
index dd2fc05..857cdce 100644
--- a/modules/web-console/frontend/public/stylesheets/style.scss
+++ b/modules/web-console/frontend/public/stylesheets/style.scss
@@ -2172,27 +2172,3 @@ html,body,.splash-screen {
line-height: $line-height-base;
}
}
-
-.datepicker.dropdown-menu {
- width: 250px;
- height: 270px;
-
- button {
- outline: none;
- border: 0;
- }
-
- tbody {
- height: 180px;
- }
-
- tbody button {
- padding: 6px;
- }
-
- &.datepicker-mode-1, &.datepicker-mode-2 {
- tbody button {
- height: 65px;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/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 5abc587..baf2c6c 100644
--- a/modules/web-console/frontend/views/templates/agent-download.tpl.pug
+++ b/modules/web-console/frontend/views/templates/agent-download.tpl.pug
@@ -14,13 +14,15 @@
See the License for the specific language governing permissions and
limitations under the License.
-.modal.center(tabindex='-1' role='dialog')
+.modal.modal--ignite.theme--ignite.center(tabindex='-1' role='dialog')
.modal-dialog(ng-switch='ctrl.status')
.modal-content(ng-switch-when='agentMissing')
.modal-header.header
h4.modal-title
i.fa.fa-download
span Connection to Ignite Web Agent is not established
+ 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:
@@ -31,14 +33,14 @@
.modal-advanced-options
i.fa(ng-class='showToken ? "fa-chevron-circle-down" : "fa-chevron-circle-right"' ng-click='showToken = !showToken')
a(ng-click='showToken = !showToken') {{showToken ? 'Hide security token...' : 'Show security token...'}}
- .details-row(ng-show='showToken')
+ p(ng-show='showToken')
label.labelField Security token: {{user.becameToken || user.token}}
i.tipLabel.fa.fa-clipboard(ignite-copy-to-clipboard='{{user.becameToken || user.token}}' bs-tooltip='' data-title='Copy security token to clipboard')
i.tipLabel.icon-help(ng-if=lines bs-tooltip='' data-title='The security token is used for authorization of web agent')
.modal-footer
- button.btn.btn-default(ng-click='ctrl.back()') {{::ctrl.backText}}
- a.btn.btn-primary(href='/api/v1/downloads/agent' target='_self') Download agent
+ button.btn-ignite.btn-ignite--link-success(ng-click='ctrl.back()') {{::ctrl.backText}}
+ a.btn-ignite.btn-ignite--success(href='/api/v1/downloads/agent' target='_self') Download agent
.modal-content(ng-switch-when='nodeMissing')
.modal-header.header
@@ -49,11 +51,12 @@
.modal-body.agent-download
p Connection to Ignite Web Agent is established, but agent failed to connect to Ignite Node
p Please check the following:
- ul
- li Ignite Grid is up and Ignite REST server started (copy "ignite-rest-http" folder from libs/optional/ to libs/)
- li In agent settings check URI for connect to Ignite REST server
- li Check agent logs for errors
- li Refer to #[b README.txt] in the ignite-web-agent folder for more information.
+ p
+ ul
+ li Ignite Grid is up and Ignite REST server started (copy "ignite-rest-http" folder from libs/optional/ to libs/)
+ li In agent settings check URI for connect to Ignite REST server
+ li Check agent logs for errors
+ li Refer to #[b README.txt] in the ignite-web-agent folder for more information.
.modal-footer
- button.btn.btn-default(ng-click='ctrl.back()') {{::ctrl.backText}}
+ button.btn-ignite.btn-ignite--link-success(ng-click='ctrl.back()') {{::ctrl.backText}}
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e06773b/modules/web-console/frontend/views/templates/confirm.tpl.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/views/templates/confirm.tpl.pug b/modules/web-console/frontend/views/templates/confirm.tpl.pug
index 0031498..ccbcfae 100644
--- a/modules/web-console/frontend/views/templates/confirm.tpl.pug
+++ b/modules/web-console/frontend/views/templates/confirm.tpl.pug
@@ -14,20 +14,21 @@
See the License for the specific language governing permissions and
limitations under the License.
-.modal(tabindex='-1' role='dialog')
+.modal.modal--ignite.theme--ignite(tabindex='-1' role='dialog')
.modal-dialog
.modal-content
.modal-header
- button.close(ng-click='confirmCancel()' aria-hidden='true') ×
h4.modal-title
i.icon-confirm
- | Confirmation
+ span Confirmation
+ button.close(type='button' aria-label='Close' ng-click='confirmCancel()')
+ svg(ignite-icon="cross")
.modal-body(ng-show='content')
- p(ng-bind-html='content' style='text-align: center;')
+ p(ng-bind-html='content')
.modal-footer
- button#confirm-btn-cancel.btn.btn-default(ng-click='confirmCancel()') Cancel
+ button#confirm-btn-cancel.btn-ignite.btn-ignite--link-success(ng-click='confirmCancel()') Cancel
- button#confirm-btn-no.btn.btn-default(ng-if='yesNo' ng-click='confirmNo()') No
- button#confirm-btn-yes.btn.btn-primary(ng-if='yesNo' ng-click='confirmYes()') Yes
+ button#confirm-btn-no.btn-ignite.btn-ignite--link-success(ng-if='yesNo' ng-click='confirmNo()') No
+ button#confirm-btn-yes.btn-ignite.btn-ignite--success(ng-if='yesNo' ng-click='confirmYes()') Yes
- button#confirm-btn-ok.btn.btn-primary(ng-if='!yesNo' ng-click='confirmYes()') Confirm
+ button#confirm-btn-ok.btn-ignite.btn-ignite--success(ng-if='!yesNo' ng-click='confirmYes()') Confirm
[02/50] ignite git commit: Storing binary metadata in FS
Posted by vo...@apache.org.
Storing binary metadata in FS
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/92f66b23
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/92f66b23
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/92f66b23
Branch: refs/heads/master
Commit: 92f66b23e4beb613b7dead87111ccc54aef8bf22
Parents: 94fd731
Author: Sergey Chugunov <se...@gmail.com>
Authored: Fri Jun 23 11:24:52 2017 +0300
Committer: Sergey Chugunov <se...@gmail.com>
Committed: Fri Jun 23 11:24:52 2017 +0300
----------------------------------------------------------------------
.../discovery/GridDiscoveryManager.java | 2 +-
.../cache/binary/BinaryMetadataFileStore.java | 114 ++++
.../cache/binary/BinaryMetadataTransport.java | 15 +-
.../binary/CacheObjectBinaryProcessorImpl.java | 14 +-
...tePdsBinaryMetadataOnClusterRestartTest.java | 514 +++++++++++++++++++
.../testframework/junits/GridAbstractTest.java | 1 +
.../IgnitePdsWithIndexingCoreTestSuite.java | 3 +
7 files changed, 659 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/92f66b23/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index de8daa7..c38e37a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -1947,7 +1947,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
inject();
}
catch (IgniteCheckedException e) {
- throw new IgniteException("Failed to init consisten ID.", e);
+ throw new IgniteException("Failed to init consistent ID.", e);
}
consistentId = getSpi().consistentId();
http://git-wip-us.apache.org/repos/asf/ignite/blob/92f66b23/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataFileStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataFileStore.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataFileStore.java
new file mode 100644
index 0000000..e682593
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataFileStore.java
@@ -0,0 +1,114 @@
+/*
+ * 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.binary;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.util.concurrent.ConcurrentMap;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.binary.BinaryMetadata;
+import org.apache.ignite.internal.util.typedef.internal.U;
+
+/**
+ * Class handles saving/restoring binary metadata to/from disk.
+ *
+ * Current implementation needs to be rewritten as it issues IO operations from discovery thread
+ * which may lead to segmentation of nodes from cluster.
+ */
+class BinaryMetadataFileStore {
+ /** */
+ private File workDir;
+
+ /** */
+ private final ConcurrentMap<Integer, BinaryMetadataHolder> metadataLocCache;
+
+ /** */
+ private final GridKernalContext ctx;
+
+ /** */
+ private final IgniteLogger log;
+
+ /**
+ * @param metadataLocCache Metadata locale cache.
+ * @param ctx Context.
+ * @param log Logger.
+ */
+ BinaryMetadataFileStore(ConcurrentMap<Integer, BinaryMetadataHolder> metadataLocCache, GridKernalContext ctx, IgniteLogger log) throws IgniteCheckedException {
+ this.metadataLocCache = metadataLocCache;
+ this.ctx = ctx;
+ this.log = log;
+
+ if (!ctx.config().isPersistentStoreEnabled())
+ return;
+
+ String consId = U.maskForFileName(ctx.discovery().consistentId().toString());
+
+ workDir = new File(U.resolveWorkDirectory(
+ ctx.config().getWorkDirectory(),
+ "binary_meta",
+ false
+ ),
+ consId);
+
+ U.ensureDirectory(workDir, "directory for serialized binary metadata", log);
+ }
+
+ /**
+ * @param binMeta Binary metadata to be written to disk.
+ */
+ void saveMetadata(BinaryMetadata binMeta) {
+ if (!ctx.config().isPersistentStoreEnabled())
+ return;
+
+ try {
+ File file = new File(workDir, Integer.toString(binMeta.typeId()) + ".bin");
+
+ try(FileOutputStream out = new FileOutputStream(file, false)) {
+ byte[] marshalled = U.marshal(ctx, binMeta);
+
+ out.write(marshalled);
+ }
+ }
+ catch (Exception e) {
+ U.warn(log, "Failed to save metadata for typeId: " + binMeta.typeId() +
+ "; exception was thrown: " + e.getMessage());
+ }
+ }
+
+ /**
+ * Restores metadata on startup of {@link CacheObjectBinaryProcessorImpl} but before starting discovery.
+ */
+ void restoreMetadata() {
+ if (!ctx.config().isPersistentStoreEnabled())
+ return;
+
+ for (File file : workDir.listFiles()) {
+ try (FileInputStream in = new FileInputStream(file)) {
+ BinaryMetadata meta = U.unmarshal(ctx.config().getMarshaller(), in, U.resolveClassLoader(ctx.config()));
+
+ metadataLocCache.put(meta.typeId(), new BinaryMetadataHolder(meta, 0, 0));
+ }
+ catch (Exception e) {
+ U.warn(log, "Failed to restore metadata from file: " + file.getName() +
+ "; exception was thrown: " + e.getMessage());
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/92f66b23/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataTransport.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataTransport.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataTransport.java
index e4df075..59c4856 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataTransport.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataTransport.java
@@ -75,6 +75,9 @@ final class BinaryMetadataTransport {
private final ConcurrentMap<Integer, BinaryMetadataHolder> metaLocCache;
/** */
+ private final BinaryMetadataFileStore metadataFileStore;
+
+ /** */
private final Queue<MetadataUpdateResultFuture> unlabeledFutures = new ConcurrentLinkedQueue<>();
/** */
@@ -91,12 +94,20 @@ final class BinaryMetadataTransport {
/**
* @param metaLocCache Metadata locale cache.
+ * @param metadataFileStore File store for binary metadata.
* @param ctx Context.
* @param log Logger.
*/
- BinaryMetadataTransport(ConcurrentMap<Integer, BinaryMetadataHolder> metaLocCache, final GridKernalContext ctx, IgniteLogger log) {
+ BinaryMetadataTransport(
+ ConcurrentMap<Integer, BinaryMetadataHolder> metaLocCache,
+ BinaryMetadataFileStore metadataFileStore,
+ final GridKernalContext ctx,
+ IgniteLogger log
+ ) {
this.metaLocCache = metaLocCache;
+ this.metadataFileStore = metadataFileStore;
+
this.ctx = ctx;
this.log = log;
@@ -441,6 +452,8 @@ final class BinaryMetadataTransport {
}
metaLocCache.put(typeId, new BinaryMetadataHolder(holder.metadata(), holder.pendingVersion(), newAcceptedVer));
+
+ metadataFileStore.saveMetadata(holder.metadata());
}
for (BinaryMetadataUpdatedListener lsnr : binaryUpdatedLsnrs)
http://git-wip-us.apache.org/repos/asf/ignite/blob/92f66b23/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 83e2997..329c50e 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
@@ -107,6 +107,9 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
private GridBinaryMarshaller binaryMarsh;
/** */
+ private BinaryMetadataFileStore metadataFileStore;
+
+ /** */
@GridToStringExclude
private IgniteBinary binaries;
@@ -143,7 +146,11 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
if (ctx.clientNode())
ctx.event().addLocalEventListener(clientDisconLsnr, EVT_CLIENT_NODE_DISCONNECTED);
- transport = new BinaryMetadataTransport(metadataLocCache, ctx, log);
+ metadataFileStore = new BinaryMetadataFileStore(metadataLocCache, ctx, log);
+
+ metadataFileStore.restoreMetadata();
+
+ transport = new BinaryMetadataTransport(metadataLocCache, metadataFileStore, ctx, log);
BinaryMetadataHandler metaHnd = new BinaryMetadataHandler() {
@Override public void addMeta(int typeId, BinaryType newMeta) throws BinaryObjectException {
@@ -158,7 +165,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
BinaryMetadata mergedMeta = BinaryUtils.mergeMetadata(oldMeta, ((BinaryTypeImpl)newMeta).metadata());
if (oldMeta != mergedMeta)
- metadataLocCache.putIfAbsent(typeId, new BinaryMetadataHolder(mergedMeta, 0, 0));
+ metadataLocCache.put(typeId, new BinaryMetadataHolder(mergedMeta, 0, 0));
return;
}
@@ -881,6 +888,9 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
log.debug("Received metadata on join: " + localHolder);
metadataLocCache.put(e.getKey(), localHolder);
+
+ if (!ctx.clientNode())
+ metadataFileStore.saveMetadata(holder.metadata());
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/92f66b23/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataOnClusterRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataOnClusterRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataOnClusterRestartTest.java
new file mode 100644
index 0000000..cc3820b
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataOnClusterRestartTest.java
@@ -0,0 +1,514 @@
+/*
+ * 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.persistence;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collection;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.binary.BinaryType;
+import org.apache.ignite.binary.BinaryTypeConfiguration;
+import org.apache.ignite.cache.CacheKeyConfiguration;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.affinity.AffinityKeyMapped;
+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.PersistentStoreConfiguration;
+import org.apache.ignite.configuration.WALMode;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ *
+ */
+public class IgnitePdsBinaryMetadataOnClusterRestartTest extends GridCommonAbstractTest {
+ /** */
+ private static final String CACHE_NAME = "cache1";
+
+ /** */
+ private static final String DYNAMIC_TYPE_NAME = "DynamicType";
+
+ /** */
+ private static final String DYNAMIC_INT_FIELD_NAME = "intField";
+
+ /** */
+ private static final String DYNAMIC_STR_FIELD_NAME = "strField";
+
+ /** */
+ private boolean clientMode;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ cfg.setClientMode(clientMode);
+
+ cfg.setPersistentStoreConfiguration(
+ new PersistentStoreConfiguration()
+ .setWalMode(WALMode.LOG_ONLY)
+ );
+
+ BinaryConfiguration bCfg = new BinaryConfiguration();
+
+ BinaryTypeConfiguration binaryEnumCfg = new BinaryTypeConfiguration(EnumType.class.getName());
+
+ binaryEnumCfg.setEnum(true);
+ binaryEnumCfg.setEnumValues(F.asMap(EnumType.ENUM_VAL_0.name(),
+ EnumType.ENUM_VAL_0.ordinal(),
+ EnumType.ENUM_VAL_1.name(),
+ EnumType.ENUM_VAL_1.ordinal()));
+
+ bCfg.setTypeConfigurations(Arrays.asList(binaryEnumCfg));
+
+ cfg.setBinaryConfiguration(bCfg);
+
+ CacheKeyConfiguration dynamicMetaKeyCfg = new CacheKeyConfiguration(DYNAMIC_TYPE_NAME, DYNAMIC_INT_FIELD_NAME);
+
+ cfg.setCacheKeyConfiguration(dynamicMetaKeyCfg);
+
+ cfg.setCacheConfiguration(new CacheConfiguration()
+ .setName(CACHE_NAME)
+ .setAffinity(new RendezvousAffinityFunction())
+ .setCacheMode(CacheMode.REPLICATED));
+
+ return cfg;
+ }
+
+ /**
+ * Test verifies that binary metadata from regular java classes is saved and restored correctly
+ * on cluster restart.
+ */
+ public void testStaticMetadataIsRestoredOnRestart() throws Exception {
+ clientMode = false;
+
+ startGrids(2);
+
+ Ignite ignite0 = grid(0);
+
+ ignite0.active(true);
+
+ IgniteCache<Object, Object> cache0 = ignite0.cache(CACHE_NAME);
+
+ cache0.put(0, new TestValue1(0));
+ cache0.put(1, new TestValue2("value"));
+
+ stopAllGrids();
+
+ startGrids(2);
+
+ ignite0 = grid(0);
+
+ ignite0.active(true);
+
+ examineStaticMetadata(2);
+
+ startGrid(2);
+
+ startGrid(3);
+
+ awaitPartitionMapExchange();
+
+ examineStaticMetadata(4);
+ }
+
+ /**
+ * @param nodesCnt Number of nodes in grid.
+ */
+ private void examineStaticMetadata(int nodesCnt) {
+ for (int i = 0; i < nodesCnt; i++) {
+ IgniteCache cache = grid(i).cache(CACHE_NAME).withKeepBinary();
+
+ BinaryObject o1 = (BinaryObject) cache.get(0);
+
+ TestValue1 t1 = o1.deserialize();
+
+ assertEquals(0, t1.getValue());
+
+ BinaryObject o2 = (BinaryObject) cache.get(1);
+
+ TestValue2 t2 = o2.deserialize();
+
+ assertEquals("value", t2.getValue());
+
+ assertEquals(TestValue1.class.getName(), o1.type().typeName());
+ assertEquals(TestValue2.class.getName(), o2.type().typeName());
+
+ assertEquals("val", o1.type().affinityKeyFieldName());
+ }
+ }
+
+ /**
+ * @param nodesCount Nodes count.
+ */
+ private void examineDynamicMetadata(int nodesCount, BinaryObjectExaminer... examiners) {
+ for (int i = 0; i < nodesCount; i++) {
+ Ignite ignite = grid(i);
+
+ for (BinaryObjectExaminer examiner : examiners)
+ examiner.examine(ignite.cache(CACHE_NAME).withKeepBinary());
+ }
+ }
+
+ /**
+ * Test verifies that metadata for binary types built with BinaryObjectBuilder is saved and updated correctly
+ * on cluster restart.
+ */
+ public void testDynamicMetadataIsRestoredOnRestart() throws Exception {
+ clientMode = false;
+ //1: start two nodes, add single BinaryObject
+ startGrids(2);
+
+ Ignite ignite0 = grid(0);
+
+ ignite0.active(true);
+
+ IgniteCache<Object, Object> cache0 = ignite0.cache(CACHE_NAME);
+
+ BinaryObject bo = ignite0
+ .binary()
+ .builder(DYNAMIC_TYPE_NAME)
+ .setField(DYNAMIC_INT_FIELD_NAME, 10)
+ .build();
+
+ cache0.put(2, bo);
+
+ stopAllGrids();
+
+ //2: start two nodes, check BinaryObject added on step 1) (field values, metadata info),
+ // modify BinaryObject type, add new instance of modified type
+ startGrids(2);
+
+ ignite0 = grid(0);
+
+ ignite0.active(true);
+
+ examineDynamicMetadata(2, contentExaminer0, structureExaminer0);
+
+ Ignite ignite1 = grid(1);
+
+ BinaryObject bo1 = ignite1
+ .binary()
+ .builder(DYNAMIC_TYPE_NAME)
+ .setField(DYNAMIC_INT_FIELD_NAME, 20)
+ .setField(DYNAMIC_STR_FIELD_NAME, "str")
+ .build();
+
+ ignite1.cache(CACHE_NAME).put(3, bo1);
+
+ stopAllGrids();
+
+ //3: start two nodes, check both BinaryObject instances,
+ // start two additional nodes, check BO instances on all nodes
+ startGrids(2);
+
+ ignite0 = grid(0);
+
+ ignite0.active(true);
+
+ examineDynamicMetadata(2, contentExaminer0, contentExaminer1, structureExaminer1);
+
+ startGrid(2);
+
+ startGrid(3);
+
+ awaitPartitionMapExchange();
+
+ examineDynamicMetadata(4, contentExaminer0, contentExaminer1, structureExaminer1);
+ }
+
+ /**
+ *
+ */
+ public void testBinaryEnumMetadataIsRestoredOnRestart() throws Exception {
+ clientMode = false;
+
+ Ignite ignite0 = startGrids(2);
+
+ ignite0.active(true);
+
+ BinaryObject enumBo0 = ignite0.binary().buildEnum(EnumType.class.getName(), 0);
+
+ ignite0.cache(CACHE_NAME).put(4, enumBo0);
+
+ stopAllGrids();
+
+ ignite0 = startGrids(2);
+
+ ignite0.active(true);
+
+ startGrid(2);
+
+ awaitPartitionMapExchange();
+
+ examineDynamicMetadata(3, enumExaminer0);
+
+ stopAllGrids();
+
+ ignite0 = startGrids(3);
+
+ ignite0.active(true);
+
+ clientMode = true;
+
+ startGrid(3);
+
+ awaitPartitionMapExchange();
+
+ examineDynamicMetadata(4, enumExaminer0);
+ }
+
+ /**
+ * Test verifies that metadata is saved, stored and delivered to client nodes correctly.
+ */
+ public void testMixedMetadataIsRestoredOnRestart() throws Exception {
+ clientMode = false;
+
+ //1: starts 4 nodes one by one and adds java classes and classless BinaryObjects
+ // to the same replicated cache from different nodes.
+ // Examines all objects in cache (field values and metadata).
+ Ignite ignite0 = startGrid(0);
+
+ ignite0.active(true);
+
+ IgniteCache cache0 = ignite0.cache(CACHE_NAME);
+
+ cache0.put(0, new TestValue1(0));
+
+ startGrid(1);
+
+ awaitPartitionMapExchange();
+
+ grid(1).cache(CACHE_NAME).put(1, new TestValue2("value"));
+
+ Ignite ignite2 = startGrid(2);
+
+ awaitPartitionMapExchange();
+
+ BinaryObject bo0 = ignite2.binary().builder(DYNAMIC_TYPE_NAME).setField(DYNAMIC_INT_FIELD_NAME, 10).build();
+
+ ignite2.cache(CACHE_NAME).put(2, bo0);
+
+ Ignite ignite3 = startGrid(3);
+
+ awaitPartitionMapExchange();
+
+ BinaryObject bo1 = ignite3
+ .binary()
+ .builder(DYNAMIC_TYPE_NAME)
+ .setField(DYNAMIC_INT_FIELD_NAME, 20)
+ .setField(DYNAMIC_STR_FIELD_NAME, "str")
+ .build();
+
+ ignite3.cache(CACHE_NAME).put(3, bo1);
+
+ stopAllGrids();
+
+ startGrids(4);
+
+ grid(0).active(true);
+
+ examineStaticMetadata(4);
+
+ examineDynamicMetadata(4, contentExaminer0, contentExaminer1, structureExaminer1);
+
+ //2: starts up client node and performs the same set of checks from all nodes including client
+ clientMode = true;
+
+ startGrid(4);
+
+ examineStaticMetadata(5);
+
+ examineDynamicMetadata(5, contentExaminer0, contentExaminer1, structureExaminer1);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ stopAllGrids();
+
+ cleanIgniteWorkDir();
+ }
+
+ /**
+ *
+ */
+ private void cleanIgniteWorkDir() throws IgniteCheckedException {
+ String baseDir = U.defaultWorkDirectory();
+
+ File baseDirFile = new File(baseDir);
+
+ for (File f : baseDirFile.listFiles())
+ deleteRecursively(U.resolveWorkDirectory(baseDir, f.getName(), false));
+ }
+
+ /**
+ *
+ */
+ private static class TestValue1 {
+ /** */
+ @AffinityKeyMapped
+ private final int val;
+
+ /**
+ * @param val Value.
+ */
+ TestValue1(int val) {
+ this.val = val;
+ }
+
+ /**
+ *
+ */
+ int getValue() {
+ return val;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class TestValue2 {
+ /** */
+ private final String val;
+
+ /**
+ * @param val Value.
+ */
+ TestValue2(String val) {
+ this.val = val;
+ }
+
+ /**
+ *
+ */
+ String getValue() {
+ return val;
+ }
+ }
+
+ /** */
+ private enum EnumType {
+ /** */ ENUM_VAL_0,
+ /** */ ENUM_VAL_1
+ }
+
+ /**
+ *
+ */
+ private static interface BinaryObjectExaminer {
+ /**
+ * @param cache Cache.
+ */
+ void examine(IgniteCache cache);
+ }
+
+ /** */
+ private BinaryObjectExaminer contentExaminer0 = new BinaryObjectExaminer() {
+ @Override public void examine(IgniteCache cache) {
+ BinaryObject bo = (BinaryObject) cache.get(2);
+
+ int fieldVal = bo.field(DYNAMIC_INT_FIELD_NAME);
+
+ assertEquals(10, fieldVal);
+ }
+ };
+
+ /** */
+ private BinaryObjectExaminer contentExaminer1 = new BinaryObjectExaminer() {
+ @Override public void examine(IgniteCache cache) {
+ BinaryObject bo = (BinaryObject) cache.get(3);
+
+ int fieldVal = bo.field(DYNAMIC_INT_FIELD_NAME);
+
+ assertEquals(20, fieldVal);
+ assertEquals("str", bo.field(DYNAMIC_STR_FIELD_NAME));
+ }
+ };
+
+ /** */
+ private BinaryObjectExaminer structureExaminer0 = new BinaryObjectExaminer() {
+ @Override public void examine(IgniteCache cache) {
+ BinaryObject bo = (BinaryObject) cache.get(2);
+
+ BinaryType type = bo.type();
+
+ assertFalse(type.isEnum());
+
+ assertEquals(DYNAMIC_TYPE_NAME, type.typeName());
+
+ Collection<String> fieldNames = type.fieldNames();
+
+ assertEquals(1, fieldNames.size());
+
+ assertTrue(fieldNames.contains(DYNAMIC_INT_FIELD_NAME));
+
+ assertEquals(DYNAMIC_INT_FIELD_NAME, type.affinityKeyFieldName());
+ }
+ };
+
+ /** */
+ private BinaryObjectExaminer structureExaminer1 = new BinaryObjectExaminer() {
+ @Override public void examine(IgniteCache cache) {
+ BinaryObject bo = (BinaryObject) cache.get(2);
+
+ BinaryType type = bo.type();
+
+ assertFalse(bo.type().isEnum());
+
+ assertEquals(DYNAMIC_TYPE_NAME, type.typeName());
+
+ Collection<String> fieldNames = type.fieldNames();
+
+ assertEquals(2, fieldNames.size());
+
+ assertTrue(fieldNames.contains(DYNAMIC_INT_FIELD_NAME));
+ assertTrue(fieldNames.contains(DYNAMIC_STR_FIELD_NAME));
+ }
+ };
+
+ /** */
+ private BinaryObjectExaminer enumExaminer0 = new BinaryObjectExaminer() {
+ @Override public void examine(IgniteCache cache) {
+ BinaryObject enumBo = (BinaryObject) cache.get(4);
+
+ assertEquals(EnumType.ENUM_VAL_0.ordinal(), enumBo.enumOrdinal());
+
+ BinaryType type = enumBo.type();
+
+ assertTrue(type.isEnum());
+
+ assertEquals(EnumType.class.getName(), type.typeName());
+
+ Collection<BinaryObject> enumVals = type.enumValues();
+
+ assertEquals(2, enumVals.size());
+
+ int i = 0;
+
+ for (BinaryObject bo : enumVals) {
+ assertEquals(i, bo.enumOrdinal());
+
+ assertEquals("ENUM_VAL_" + (i++), bo.enumName());
+ }
+ }
+ };
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/92f66b23/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
index fc828a8..01b27ad 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
@@ -537,6 +537,7 @@ public abstract class GridAbstractTest extends TestCase {
protected void beforeTestsStarted() throws Exception {
// Will clean and re-create marshaller directory from scratch.
U.resolveWorkDirectory(U.defaultWorkDirectory(), "marshaller", true);
+ U.resolveWorkDirectory(U.defaultWorkDirectory(), "binary_meta", true);
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/92f66b23/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePdsWithIndexingCoreTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePdsWithIndexingCoreTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePdsWithIndexingCoreTestSuite.java
index eda99ce..bb9c9d1 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePdsWithIndexingCoreTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePdsWithIndexingCoreTestSuite.java
@@ -18,6 +18,7 @@ package org.apache.ignite.testsuites;
import junit.framework.TestSuite;
import org.apache.ignite.internal.processors.cache.persistence.IgnitePdsAtomicCacheRebalancingTest;
+import org.apache.ignite.internal.processors.cache.persistence.IgnitePdsBinaryMetadataOnClusterRestartTest;
import org.apache.ignite.internal.processors.cache.persistence.IgnitePdsTxCacheRebalancingTest;
import org.apache.ignite.internal.processors.cache.persistence.IgnitePersistentStoreCacheGroupsTest;
import org.apache.ignite.internal.processors.cache.persistence.db.IgnitePdsMultiNodePutGetRestartTest;
@@ -49,6 +50,8 @@ public class IgnitePdsWithIndexingCoreTestSuite extends TestSuite {
suite.addTestSuite(IgnitePdsAtomicCacheRebalancingTest.class);
suite.addTestSuite(IgnitePdsTxCacheRebalancingTest.class);
+ suite.addTestSuite(IgnitePdsBinaryMetadataOnClusterRestartTest.class);
+
return suite;
}
}
[49/50] ignite git commit: IGNITE-5683 Fixed missing fully qualified
class names for generated indexed types on Models screen.
Posted by vo...@apache.org.
IGNITE-5683 Fixed missing fully qualified class names for generated indexed types on Models screen.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d8461977
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d8461977
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d8461977
Branch: refs/heads/master
Commit: d84619775e3960f30890a467b897315deed20ab7
Parents: 211caf1
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Tue Jul 4 15:44:27 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Jul 4 15:44:27 2017 +0700
----------------------------------------------------------------------
.../configuration/generator/ConfigurationGenerator.js | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d8461977/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js b/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
index a903ec4..f850dce 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
@@ -1653,8 +1653,11 @@ export default class IgniteConfigurationGenerator {
static domainModelGeneral(domain, cfg = this.domainConfigurationBean(domain)) {
switch (cfg.valueOf('queryMetadata')) {
case 'Annotations':
- if (_.nonNil(domain.keyType) && _.nonNil(domain.valueType))
- cfg.varArgProperty('indexedTypes', 'indexedTypes', [domain.keyType, domain.valueType], 'java.lang.Class');
+ if (_.nonNil(domain.keyType) && _.nonNil(domain.valueType)) {
+ cfg.varArgProperty('indexedTypes', 'indexedTypes',
+ [javaTypes.fullClassName(domain.keyType), javaTypes.fullClassName(domain.valueType)],
+ 'java.lang.Class');
+ }
break;
case 'Configuration':
@@ -1864,7 +1867,7 @@ export default class IgniteConfigurationGenerator {
static cacheQuery(cache, domains, available, ccfg = this.cacheConfigurationBean(cache)) {
const indexedTypes = _.reduce(domains, (acc, domain) => {
if (domain.queryMetadata === 'Annotations')
- acc.push(domain.keyType, domain.valueType);
+ acc.push(javaTypes.fullClassName(domain.keyType), javaTypes.fullClassName(domain.valueType));
return acc;
}, []);
[17/50] ignite git commit: IGNITE-5548 Deadlock Detection uses
IgniteCheckedException instead of TransactionTimeoutException
Posted by vo...@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/master
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 + ']';
+ }
+ }
+}
[37/50] ignite git commit: Fixed CSS for IE11.
Posted by vo...@apache.org.
Fixed CSS for IE11.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6239e04a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6239e04a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6239e04a
Branch: refs/heads/master
Commit: 6239e04a8273faa7763d2e11e933b1852637ff03
Parents: 4a1fef5
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Jun 30 17:51:39 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Jun 30 17:51:39 2017 +0700
----------------------------------------------------------------------
modules/web-console/frontend/public/stylesheets/style.scss | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6239e04a/modules/web-console/frontend/public/stylesheets/style.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/public/stylesheets/style.scss b/modules/web-console/frontend/public/stylesheets/style.scss
index 305e7f7..183dc29 100644
--- a/modules/web-console/frontend/public/stylesheets/style.scss
+++ b/modules/web-console/frontend/public/stylesheets/style.scss
@@ -2185,3 +2185,7 @@ html,body,.splash-screen {
line-height: $line-height-base;
}
}
+
+.center-container {
+ position: absolute !important;
+}
[20/50] ignite git commit: IGNITE-5577 Added missed fields to DTO.
Posted by vo...@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/master
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} */
[39/50] ignite git commit: GG-12330 Do not destroy single cache if
cache group will be destroyed
Posted by vo...@apache.org.
GG-12330 Do not destroy single cache if cache group will be destroyed
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/18bbb14e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/18bbb14e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/18bbb14e
Branch: refs/heads/master
Commit: 18bbb14e35eecaddb86ec4361f18a652b9559836
Parents: c697d45
Author: Pavel Kovalenko <jo...@gmail.com>
Authored: Fri Jun 30 21:22:28 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Jun 30 21:22:28 2017 +0300
----------------------------------------------------------------------
.../cache/CacheAffinitySharedManager.java | 26 ++---
.../processors/cache/ClusterCachesInfo.java | 13 ++-
.../cache/DynamicCacheChangeRequest.java | 1 +
.../processors/cache/ExchangeActions.java | 109 +++++++++++++++----
.../processors/cache/GridCacheProcessor.java | 58 +++++-----
5 files changed, 141 insertions(+), 66 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/18bbb14e/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 5984ef5..9516f84 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,10 +772,10 @@ 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()) {
- cctx.exchange().clearClientTopology(grpDesc.groupId());
+ for (ExchangeActions.CacheGroupActionData action : exchActions.cacheGroupsToStop()) {
+ cctx.exchange().clearClientTopology(action.descriptor().groupId());
- CacheGroupContext gctx = cctx.cache().cacheGroup(grpDesc.groupId());
+ CacheGroupContext gctx = cctx.cache().cacheGroup(action.descriptor().groupId());
if (gctx != null) {
IgniteCheckedException ex;
@@ -797,11 +797,11 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
Set<Integer> stoppedGrps = null;
if (crd && lateAffAssign) {
- for (CacheGroupDescriptor grpDesc : exchActions.cacheGroupsToStop()) {
- if (grpDesc.config().getCacheMode() != LOCAL) {
- CacheGroupHolder cacheGrp = grpHolders.remove(grpDesc.groupId());
+ for (ExchangeActions.CacheGroupActionData data : exchActions.cacheGroupsToStop()) {
+ if (data.descriptor().config().getCacheMode() != LOCAL) {
+ CacheGroupHolder cacheGrp = grpHolders.remove(data.descriptor().groupId());
- assert cacheGrp != null : grpDesc;
+ assert cacheGrp != null : data.descriptor();
if (stoppedGrps == null)
stoppedGrps = new HashSet<>();
@@ -2270,7 +2270,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
if (!registeredGrps.containsKey(grpDesc.groupId()))
registeredGrps.put(grpDesc.groupId(), grpDesc);
- if (!registeredCaches.containsKey(desc.cacheName()))
+ if (!registeredCaches.containsKey(desc.cacheId()))
registeredCaches.put(desc.cacheId(), desc);
}
}
@@ -2279,14 +2279,14 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
* @param exchActions Exchange actions.
*/
void updateCachesInfo(ExchangeActions exchActions) {
- for (CacheGroupDescriptor stopDesc : exchActions.cacheGroupsToStop()) {
- CacheGroupDescriptor rmvd = registeredGrps.remove(stopDesc.groupId());
+ for (ExchangeActions.CacheGroupActionData stopAction : exchActions.cacheGroupsToStop()) {
+ CacheGroupDescriptor rmvd = registeredGrps.remove(stopAction.descriptor().groupId());
- assert rmvd != null : stopDesc.cacheOrGroupName();
+ assert rmvd != null : stopAction.descriptor().cacheOrGroupName();
}
- for (CacheGroupDescriptor startDesc : exchActions.cacheGroupsToStart()) {
- CacheGroupDescriptor old = registeredGrps.put(startDesc.groupId(), startDesc);
+ for (ExchangeActions.CacheGroupActionData startAction : exchActions.cacheGroupsToStart()) {
+ CacheGroupDescriptor old = registeredGrps.put(startAction.descriptor().groupId(), startAction.descriptor());
assert old == null : old;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/18bbb14e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
index 15345d9..4e9dcf1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
@@ -539,7 +539,18 @@ class ClusterCachesInfo {
ctx.discovery().removeCacheGroup(grpDesc);
- exchangeActions.addCacheGroupToStop(grpDesc);
+ exchangeActions.addCacheGroupToStop(grpDesc, req.destroy());
+
+ assert exchangeActions.checkStopRequestConsistency(grpDesc.groupId());
+
+ // If all caches in group will be destroyed it is not necessary to destroy single cache
+ // because group will be stopped anyway.
+ if (req.destroy()) {
+ for (ExchangeActions.ActionData action : exchangeActions.cacheStopRequests()) {
+ if (action.descriptor().groupId() == grpDesc.groupId())
+ action.request().destroy(false);
+ }
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/18bbb14e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
index 2c9e7f2..6d5eaf3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
@@ -427,6 +427,7 @@ public class DynamicCacheChangeRequest implements Serializable {
", nodeId=" + initiatingNodeId +
", clientStartOnly=" + clientStartOnly +
", stop=" + stop +
+ ", destroy=" + destroy +
']';
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/18bbb14e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
index 1a6b068..9caf9aa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
@@ -35,10 +35,10 @@ import org.jetbrains.annotations.Nullable;
*/
public class ExchangeActions {
/** */
- private List<CacheGroupDescriptor> cacheGrpsToStart;
+ private List<CacheGroupActionData> cacheGrpsToStart;
/** */
- private List<CacheGroupDescriptor> cacheGrpsToStop;
+ private List<CacheGroupActionData> cacheGrpsToStop;
/** */
private Map<String, ActionData> cachesToStart;
@@ -53,6 +53,29 @@ public class ExchangeActions {
private ClusterState newState;
/**
+ * @param grpId Group ID.
+ * @return Always {@code true}, fails with assert error if inconsistent.
+ */
+ boolean checkStopRequestConsistency(int grpId) {
+ Boolean destroy = null;
+
+ // Check that caches associated with that group will be all stopped only or all destroyed.
+ for (ExchangeActions.ActionData action : cacheStopRequests()) {
+ if (action.descriptor().groupId() == grpId) {
+ if (destroy == null)
+ destroy = action.request().destroy();
+ else {
+ assert action.request().destroy() == destroy
+ : "Both cache stop only and cache destroy request associated with one group in batch "
+ + cacheStopRequests();
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
* @return {@code True} if server nodes should not participate in exchange.
*/
public boolean clientOnlyExchange() {
@@ -237,14 +260,14 @@ public class ExchangeActions {
if (cacheGrpsToStart == null)
cacheGrpsToStart = new ArrayList<>();
- cacheGrpsToStart.add(grpDesc);
+ cacheGrpsToStart.add(new CacheGroupActionData(grpDesc));
}
/**
* @return Cache groups to start.
*/
- public List<CacheGroupDescriptor> cacheGroupsToStart() {
- return cacheGrpsToStart != null ? cacheGrpsToStart : Collections.<CacheGroupDescriptor>emptyList();
+ public List<CacheGroupActionData> cacheGroupsToStart() {
+ return cacheGrpsToStart != null ? cacheGrpsToStart : Collections.<CacheGroupActionData>emptyList();
}
/**
@@ -253,8 +276,8 @@ public class ExchangeActions {
*/
public boolean cacheGroupStarting(int grpId) {
if (cacheGrpsToStart != null) {
- for (CacheGroupDescriptor grp : cacheGrpsToStart) {
- if (grp.groupId() == grpId)
+ for (CacheGroupActionData grp : cacheGrpsToStart) {
+ if (grp.desc.groupId() == grpId)
return true;
}
}
@@ -264,21 +287,22 @@ public class ExchangeActions {
/**
* @param grpDesc Group descriptor.
+ * @param destroy Destroy flag.
*/
- public void addCacheGroupToStop(CacheGroupDescriptor grpDesc) {
+ public void addCacheGroupToStop(CacheGroupDescriptor grpDesc, boolean destroy) {
assert grpDesc != null;
if (cacheGrpsToStop == null)
cacheGrpsToStop = new ArrayList<>();
- cacheGrpsToStop.add(grpDesc);
+ cacheGrpsToStop.add(new CacheGroupActionData(grpDesc, destroy));
}
/**
* @return Cache groups to start.
*/
- public List<CacheGroupDescriptor> cacheGroupsToStop() {
- return cacheGrpsToStop != null ? cacheGrpsToStop : Collections.<CacheGroupDescriptor>emptyList();
+ public List<CacheGroupActionData> cacheGroupsToStop() {
+ return cacheGrpsToStop != null ? cacheGrpsToStop : Collections.<CacheGroupActionData>emptyList();
}
/**
@@ -287,8 +311,8 @@ public class ExchangeActions {
*/
public boolean cacheGroupStopping(int grpId) {
if (cacheGrpsToStop != null) {
- for (CacheGroupDescriptor grp : cacheGrpsToStop) {
- if (grp.groupId() == grpId)
+ for (CacheGroupActionData grp : cacheGrpsToStop) {
+ if (grp.desc.groupId() == grpId)
return true;
}
}
@@ -312,10 +336,10 @@ public class ExchangeActions {
*/
static class ActionData {
/** */
- private DynamicCacheChangeRequest req;
+ private final DynamicCacheChangeRequest req;
/** */
- private DynamicCacheDescriptor desc;
+ private final DynamicCacheDescriptor desc;
/**
* @param req Request.
@@ -344,16 +368,59 @@ public class ExchangeActions {
}
}
+ /**
+ *
+ */
+ static class CacheGroupActionData {
+ /** */
+ private final CacheGroupDescriptor desc;
+
+ /** */
+ private final boolean destroy;
+
+ /**
+ * @param desc Group descriptor
+ * @param destroy Destroy flag
+ */
+ CacheGroupActionData(CacheGroupDescriptor desc, boolean destroy) {
+ assert desc != null;
+
+ this.desc = desc;
+ this.destroy = destroy;
+ }
+
+ /**
+ * @param desc Group descriptor
+ */
+ CacheGroupActionData(CacheGroupDescriptor desc) {
+ this(desc, false);
+ }
+
+ /**
+ * @return Group descriptor
+ */
+ public CacheGroupDescriptor descriptor() {
+ return desc;
+ }
+
+ /**
+ * @return Destroy flag
+ */
+ public boolean destroy() {
+ return destroy;
+ }
+ }
+
/** {@inheritDoc} */
@Override public String toString() {
- Object startGrps = F.viewReadOnly(cacheGrpsToStart, new C1<CacheGroupDescriptor, String>() {
- @Override public String apply(CacheGroupDescriptor desc) {
- return desc.cacheOrGroupName();
+ Object startGrps = F.viewReadOnly(cacheGrpsToStart, new C1<CacheGroupActionData, String>() {
+ @Override public String apply(CacheGroupActionData data) {
+ return data.desc.cacheOrGroupName();
}
});
- Object stopGrps = F.viewReadOnly(cacheGrpsToStop, new C1<CacheGroupDescriptor, String>() {
- @Override public String apply(CacheGroupDescriptor desc) {
- return desc.cacheOrGroupName();
+ Object stopGrps = F.viewReadOnly(cacheGrpsToStop, new C1<CacheGroupActionData, String>() {
+ @Override public String apply(CacheGroupActionData data) {
+ return data.desc.cacheOrGroupName() + ", destroy=" + data.destroy;
}
});
http://git-wip-us.apache.org/repos/asf/ignite/blob/18bbb14e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index c425bfb..bb6d068 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -2110,40 +2110,34 @@ public class GridCacheProcessor extends GridProcessorAdapter {
public void onExchangeDone(
AffinityTopologyVersion topVer,
@Nullable ExchangeActions exchActions,
- Throwable err
+ @Nullable Throwable err
) {
initCacheProxies(topVer, err);
- if (exchActions != null && exchActions.systemCachesStarting() && exchActions.newClusterState() == null)
- ctx.dataStructures().restoreStructuresState(ctx);
-
- if (exchActions != null && err == null) {
- Collection<IgniteBiTuple<CacheGroupContext, Boolean>> stoppedGrps = null;
-
- boolean forceCheckpoint = false;
-
- for (ExchangeActions.ActionData action : exchActions.cacheStopRequests()) {
- GridCacheContext<?, ?> stopCtx;
- boolean destroy;
+ if (exchActions == null)
+ return;
- if (!forceCheckpoint){
- try {
- sharedCtx.database().waitForCheckpoint("caches stop");
- }
- catch (IgniteCheckedException e) {
- U.error(log, "Failed to wait for checkpoint finish during cache stop.", e);
- }
+ if (exchActions.systemCachesStarting() && exchActions.newClusterState() == null)
+ ctx.dataStructures().restoreStructuresState(ctx);
- forceCheckpoint = true;
+ if (err == null) {
+ // Force checkpoint if there is any cache stop request
+ if (exchActions.cacheStopRequests().size() > 0) {
+ try {
+ sharedCtx.database().waitForCheckpoint("caches stop");
}
+ catch (IgniteCheckedException e) {
+ U.error(log, "Failed to wait for checkpoint finish during cache stop.", e);
+ }
+ }
+ for (ExchangeActions.ActionData action : exchActions.cacheStopRequests()) {
stopGateway(action.request());
sharedCtx.database().checkpointReadLock();
try {
- stopCtx = prepareCacheStop(action.request().cacheName(), action.request().destroy());
- destroy = action.request().destroy();
+ prepareCacheStop(action.request().cacheName(), action.request().destroy());
if (exchActions.newClusterState() == null)
ctx.state().onCacheStop(action.request());
@@ -2151,20 +2145,22 @@ public class GridCacheProcessor extends GridProcessorAdapter {
finally {
sharedCtx.database().checkpointReadUnlock();
}
+ }
+
+ List<IgniteBiTuple<CacheGroupContext, Boolean>> stoppedGroups = new ArrayList<>();
- if (stopCtx != null && !stopCtx.group().hasCaches()) {
- if (stoppedGrps == null)
- stoppedGrps = new ArrayList<>();
+ for (ExchangeActions.CacheGroupActionData action : exchActions.cacheGroupsToStop()) {
+ Integer groupId = action.descriptor().groupId();
- stoppedGrps.add(F.t(stopCtx.group(), destroy));
+ if (cacheGrps.containsKey(groupId)) {
+ stoppedGroups.add(F.t(cacheGrps.get(groupId), action.destroy()));
+
+ stopCacheGroup(groupId);
}
}
- for (CacheGroupDescriptor grpDesc : exchActions.cacheGroupsToStop())
- stopCacheGroup(grpDesc.groupId());
-
- if (stoppedGrps != null && !sharedCtx.kernalContext().clientNode())
- sharedCtx.database().onCacheGroupsStopped(stoppedGrps);
+ if (!sharedCtx.kernalContext().clientNode())
+ sharedCtx.database().onCacheGroupsStopped(stoppedGroups);
}
}
[42/50] ignite git commit: Merge remote-tracking branch
'community/ignite-2.1.2' into ignite-2.1.2
Posted by vo...@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/f202e0fe
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f202e0fe
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f202e0fe
Branch: refs/heads/master
Commit: f202e0fe62cc40d555b3efb038de7c7fd7a96f47
Parents: ddeb935 ad739d5
Author: sboikov <sb...@gridgain.com>
Authored: Mon Jul 3 11:40:35 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jul 3 11:40:35 2017 +0300
----------------------------------------------------------------------
.../frontend/app/helpers/jade/form/form-field-checkbox.pug | 2 +-
modules/web-console/frontend/app/primitives/tooltip/index.pug | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[38/50] ignite git commit: Fixed "IGNITE-5521 Large near caches lead
to cluster instability with metrics enabled". This closes #2201.
Posted by vo...@apache.org.
Fixed "IGNITE-5521 Large near caches lead to cluster instability with metrics enabled". This closes #2201.
Signed-off-by: nikolay_tikhonov <nt...@gridgain.com>
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c697d450
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c697d450
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c697d450
Branch: refs/heads/master
Commit: c697d4509b2d3ff7ef5bed93a9b697f45c830f8c
Parents: 6239e04
Author: mcherkasov <mc...@gridgain.com>
Authored: Thu Jun 29 12:15:33 2017 +0300
Committer: mcherkasov <mc...@gridgain.com>
Committed: Fri Jun 30 18:40:41 2017 +0300
----------------------------------------------------------------------
.../distributed/near/GridNearCacheAdapter.java | 4 +--
.../near/GridCacheNearEvictionSelfTest.java | 5 ++--
.../near/GridCacheNearMetricsSelfTest.java | 29 +++++++++++++++++++-
3 files changed, 32 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c697d450/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index 5b53935..b27591e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -37,7 +37,6 @@ import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
import org.apache.ignite.internal.processors.cache.CacheEntryPredicateAdapter;
-import org.apache.ignite.internal.processors.cache.CacheObject;
import org.apache.ignite.internal.processors.cache.GridCacheClearAllRunnable;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
@@ -46,7 +45,6 @@ import org.apache.ignite.internal.processors.cache.GridCacheLocalConcurrentMap;
import org.apache.ignite.internal.processors.cache.GridCacheMapEntry;
import org.apache.ignite.internal.processors.cache.GridCacheMapEntryFactory;
import org.apache.ignite.internal.processors.cache.GridCachePreloader;
-import org.apache.ignite.internal.processors.cache.GridCacheValueCollection;
import org.apache.ignite.internal.processors.cache.IgniteCacheExpiryPolicy;
import org.apache.ignite.internal.processors.cache.KeyCacheObject;
import org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheAdapter;
@@ -298,7 +296,7 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
/** {@inheritDoc} */
@Override public int size() {
- return nearEntries().size() + dht().size();
+ return dht().size();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/c697d450/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearEvictionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearEvictionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearEvictionSelfTest.java
index 1b09cff..9c7c933 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearEvictionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearEvictionSelfTest.java
@@ -163,12 +163,13 @@ public class GridCacheNearEvictionSelfTest extends GridCommonAbstractTest {
for (int i = 0; i < gridCnt; i++) {
final GridCacheAdapter cache = internalCache(i);
+ final GridCacheAdapter near = near(i);
// Repeatedly check cache sizes because of concurrent cache updates.
assertTrue(GridTestUtils.waitForCondition(new PA() {
@Override public boolean apply() {
// Every node contains either near, backup, or primary.
- return cnt == cache.size();
+ return cnt == cache.size() + near.nearSize();
}
}, getTestTimeout()));
@@ -181,4 +182,4 @@ public class GridCacheNearEvictionSelfTest extends GridCommonAbstractTest {
stopAllGrids();
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c697d450/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java
index 30e9146..f9d567d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java
@@ -21,7 +21,9 @@ import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest;
import org.apache.ignite.internal.util.typedef.internal.U;
@@ -100,6 +102,31 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
/**
* @throws Exception If failed.
*/
+ public void testNearCacheDoesNotAffectCacheSize() throws Exception {
+ IgniteCache<Integer, Integer> cache0 = grid(0).cache(DEFAULT_CACHE_NAME);
+
+ for (int i = 0; i < 100 ; i++)
+ cache0.put(i, i);
+
+ IgniteEx g1 = grid(1);
+
+ IgniteCache<Integer, Integer> cache1 = g1.cache(DEFAULT_CACHE_NAME);
+
+ ClusterNode localNode = g1.cluster().localNode();
+
+ int beforeSize = cache1.localMetrics().getSize();
+
+ for (int i = 0; i < 100 ; i++) {
+ if (!affinity(cache1).isPrimaryOrBackup(localNode, i))
+ cache1.get(i); // put entry to near cache
+ }
+
+ assertEquals(beforeSize, cache1.localMetrics().getSize());
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
public void testPrimaryPut() throws Exception {
Ignite g0 = grid(0);
@@ -417,4 +444,4 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
}
}
}
-}
\ No newline at end of file
+}
[05/50] ignite git commit: Merge remote-tracking branch
'remotes/origin/master' into ignite-2.1.2
Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-2.1.2
# Conflicts:
# 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/4debe5b8
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4debe5b8
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4debe5b8
Branch: refs/heads/master
Commit: 4debe5b8c1383d10770a024e179a9a64787105ba
Parents: 9e06773 039c02a
Author: sboikov <sb...@gridgain.com>
Authored: Fri Jun 23 14:06:39 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Jun 23 14:06:39 2017 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/IgniteCache.java | 3 +-
.../ignite/internal/GridJobSiblingImpl.java | 34 +-
.../internal/IgniteDiagnosticMessage.java | 19 +-
.../managers/communication/GridIoManager.java | 116 +++--
.../deployment/GridDeploymentCommunication.java | 6 +
.../eventstorage/GridEventStorageManager.java | 5 +
.../processors/cache/GridCacheIoManager.java | 135 +----
.../GridCachePartitionExchangeManager.java | 6 +-
.../processors/cache/GridCachePreloader.java | 4 +-
.../cache/GridCachePreloaderAdapter.java | 4 +-
.../cache/binary/BinaryMetadataTransport.java | 5 +
.../dht/atomic/GridDhtAtomicCache.java | 2 +-
.../dht/preloader/GridDhtPartitionDemander.java | 17 +-
.../GridDhtPartitionsExchangeFuture.java | 21 +-
.../dht/preloader/GridDhtPreloader.java | 2 +-
.../cache/distributed/near/GridNearTxLocal.java | 5 +-
.../query/GridCacheDistributedQueryFuture.java | 19 +-
.../query/GridCacheDistributedQueryManager.java | 18 +-
.../cache/transactions/IgniteTxManager.java | 8 +
.../continuous/GridContinuousProcessor.java | 2 +-
.../datastreamer/DataStreamerImpl.java | 5 +
.../internal/processors/igfs/IgfsContext.java | 15 -
.../processors/job/GridJobProcessor.java | 3 +-
.../internal/processors/job/GridJobWorker.java | 2 +-
.../GridMarshallerMappingProcessor.java | 5 +
.../processors/odbc/SqlListenerNioListener.java | 4 +-
.../odbc/odbc/OdbcQueryFetchResult.java | 4 +-
.../odbc/odbc/OdbcRequestHandler.java | 66 ++-
.../processors/task/GridTaskProcessor.java | 3 +-
.../processors/task/GridTaskWorker.java | 6 +-
.../communication/tcp/TcpCommunicationSpi.java | 55 ++-
.../managers/IgniteDiagnosticMessagesTest.java | 289 ++++++++++-
.../communication/GridIoManagerSelfTest.java | 2 +-
...cTransactionsWithFilterSingleServerTest.java | 28 ++
...cheOptimisticTransactionsWithFilterTest.java | 493 +++++++++++++++++++
.../IgniteRejectConnectOnNodeStopTest.java | 188 +++++++
.../rebalancing/CacheManualRebalancingTest.java | 178 +++++++
.../ignite/testframework/GridStringLogger.java | 35 +-
.../ignite/testsuites/IgniteBasicTestSuite.java | 3 +
.../testsuites/IgniteCacheTestSuite2.java | 5 +
.../testsuites/IgniteCacheTestSuite5.java | 2 +
.../query/h2/twostep/GridMapQueryExecutor.java | 2 +-
.../compute-example/src/compute_example.cpp | 2 +
.../src/continuous_query_example.cpp | 2 +
.../examples/odbc-example/src/odbc_example.cpp | 5 +-
.../put-get-example/src/put_get_example.cpp | 5 +-
.../query-example/src/query_example.cpp | 5 +-
.../cpp/odbc-test/src/configuration_test.cpp | 56 ++-
.../include/ignite/odbc/config/configuration.h | 52 ++
.../cpp/odbc/include/ignite/odbc/connection.h | 2 +-
.../cpp/odbc/include/ignite/odbc/message.h | 11 +-
.../odbc/system/ui/dsn_configuration_window.h | 8 +
.../src/system/ui/dsn_configuration_window.cpp | 34 +-
.../cpp/odbc/src/config/configuration.cpp | 4 +
modules/platforms/cpp/odbc/src/connection.cpp | 14 +-
modules/platforms/cpp/odbc/src/dsn_config.cpp | 6 +
modules/platforms/cpp/odbc/src/message.cpp | 9 +-
.../platforms/cpp/odbc/src/query/data_query.cpp | 5 +-
modules/platforms/cpp/odbc/src/result_page.cpp | 2 +-
.../Cache/Query/CacheLinqTest.cs | 32 +-
.../Impl/CacheQueryExpressionVisitor.cs | 5 +
61 files changed, 1744 insertions(+), 339 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataTransport.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/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/4debe5b8/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 6cc269a,c8138f7..fe250bd
--- 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
@@@ -217,25 -211,11 +218,25 @@@ public class GridDhtPartitionsExchangeF
private boolean exchangeOnChangeGlobalState;
/** */
- private final ConcurrentMap<UUID, GridDhtPartitionsAbstractMessage> msgs = new ConcurrentHashMap8<>();
+ private ConcurrentMap<UUID, GridDhtPartitionsSingleMessage> msgs = new ConcurrentHashMap8<>();
+
+ /** */
+ @GridToStringExclude
+ private volatile IgniteDhtPartitionHistorySuppliersMap partHistSuppliers = new IgniteDhtPartitionHistorySuppliersMap();
/** Forced Rebalance future. */
- private GridFutureAdapter<Boolean> forcedRebFut;
+ private GridCompoundFuture<Boolean, Boolean> forcedRebFut;
+ /** */
+ private volatile Map<Integer, Map<Integer, Long>> partHistReserved;
+
+ /** */
+ @GridToStringExclude
+ private volatile IgniteDhtPartitionsToReloadMap partsToReload = new IgniteDhtPartitionsToReloadMap();
+
+ /** */
+ private final AtomicBoolean done = new AtomicBoolean();
+
/**
* Dummy future created to trigger reassignments if partition
* topology changed while preloading.
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/main/java/org/apache/ignite/internal/processors/marshaller/GridMarshallerMappingProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/test/java/org/apache/ignite/testframework/GridStringLogger.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/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 83b8df5,158b118..5ff5b08
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@@ -278,8 -279,9 +280,11 @@@ public class IgniteCacheTestSuite2 exte
suite.addTest(new TestSuite(IgniteNearClientCacheCloseTest.class));
suite.addTest(new TestSuite(IgniteClientCacheStartFailoverTest.class));
+ suite.addTest(new TestSuite(CacheOptimisticTransactionsWithFilterSingleServerTest.class));
+ suite.addTest(new TestSuite(CacheOptimisticTransactionsWithFilterTest.class));
+
+ suite.addTest(new TestSuite(NonAffinityCoordinatorDynamicStartStopTest.class));
+
return suite;
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4debe5b8/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
----------------------------------------------------------------------
[50/50] ignite git commit: Merge master into ignite-2.1.2
Posted by vo...@apache.org.
Merge master 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/15613e2a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/15613e2a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/15613e2a
Branch: refs/heads/master
Commit: 15613e2af5e0a4a0014bb5c6d6f6915038b1be1a
Parents: d846197 5093660
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Jul 4 12:39:38 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Jul 4 12:39:38 2017 +0300
----------------------------------------------------------------------
.../checkpoint/GridCheckpointManager.java | 2 +-
.../managers/communication/GridIoManager.java | 10 +--
.../communication/GridMessageListener.java | 3 +-
.../deployment/GridDeploymentCommunication.java | 4 +-
.../eventstorage/GridEventStorageManager.java | 4 +-
.../processors/cache/GridCacheIoManager.java | 85 +++++++++++---------
.../GridCachePartitionExchangeManager.java | 16 ++--
.../cache/binary/BinaryMetadataTransport.java | 4 +-
.../GridDhtPartitionsExchangeFuture.java | 11 +--
.../cache/transactions/IgniteTxManager.java | 2 +-
.../processors/cluster/ClusterProcessor.java | 2 +-
.../continuous/GridContinuousProcessor.java | 4 +-
.../datastreamer/DataStreamProcessor.java | 2 +-
.../datastreamer/DataStreamerImpl.java | 2 +-
.../processors/igfs/IgfsDataManager.java | 2 +-
.../igfs/IgfsFragmentizerManager.java | 4 +-
.../processors/job/GridJobProcessor.java | 8 +-
.../GridMarshallerMappingProcessor.java | 4 +-
.../processors/query/GridQueryProcessor.java | 2 +-
.../handlers/task/GridTaskCommandHandler.java | 4 +-
.../processors/task/GridTaskProcessor.java | 6 +-
.../jobstealing/JobStealingCollisionSpi.java | 2 +-
...idCommunicationManagerListenersSelfTest.java | 2 +-
.../GridCommunicationSendMessageSelfTest.java | 2 +-
.../cache/GridCachePartitionedGetSelfTest.java | 2 +-
...lerCacheClientRequestsMappingOnMissTest.java | 6 +-
...naryObjectMetadataExchangeMultinodeTest.java | 6 +-
...DeadlockDetectionMessageMarshallingTest.java | 2 +-
.../communication/GridIoManagerBenchmark.java | 4 +-
.../communication/GridIoManagerBenchmark0.java | 12 +--
.../communication/GridCacheMessageSelfTest.java | 2 +-
.../testframework/GridSpiTestContext.java | 5 +-
.../hadoop/shuffle/HadoopShuffle.java | 2 +-
.../query/h2/opt/GridH2IndexBase.java | 2 +-
.../query/h2/twostep/GridMapQueryExecutor.java | 2 +-
.../h2/twostep/GridReduceQueryExecutor.java | 2 +-
.../Apache.Ignite.Core/Impl/IgniteUtils.cs | 12 ++-
37 files changed, 129 insertions(+), 117 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 44eedb1,49cfcdd..2de3808
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@@ -19,7 -19,7 +19,6 @@@ package org.apache.ignite.internal.proc
import java.util.ArrayList;
import java.util.Arrays;
--import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@@ -80,17 -80,17 +79,12 @@@ import org.apache.ignite.internal.proce
import org.apache.ignite.internal.processors.cache.transactions.IgniteTxState;
import org.apache.ignite.internal.processors.cache.transactions.IgniteTxStateAware;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
--import org.apache.ignite.internal.util.F0;
--import org.apache.ignite.internal.util.GridLeanSet;
import org.apache.ignite.internal.util.StripedCompositeReadWriteLock;
import org.apache.ignite.internal.util.typedef.CI1;
--import org.apache.ignite.internal.util.typedef.F;
--import org.apache.ignite.internal.util.typedef.P1;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteBiInClosure;
--import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.thread.IgniteThread;
import org.jetbrains.annotations.Nullable;
@@@ -355,19 -358,9 +357,19 @@@ public class GridCacheIoManager extend
if (log.isDebugEnabled())
log.debug(msg0.toString());
}
- else
+ else {
U.error(log, msg0.toString());
+ try {
+ cacheMsg.onClassError(new IgniteCheckedException("Failed to find message handler for message: " + cacheMsg));
+
- processFailedMessage(nodeId, cacheMsg, c);
++ processFailedMessage(nodeId, cacheMsg, c, plc);
+ }
+ catch (Exception e) {
+ U.error(log, "Failed to process failed message: " + e, e);
+ }
+ }
+
return;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index f07119a,2d1aca0..93310e3
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@@ -863,7 -860,7 +863,7 @@@ public class GridCachePartitionExchange
* @param nodes Nodes.
*/
private void sendAllPartitions(Collection<ClusterNode> nodes) {
- GridDhtPartitionsFullMessage m = createPartitionsFullMessage(nodes, null, null, null, null, true);
- GridDhtPartitionsFullMessage m = createPartitionsFullMessage(null, null);
++ GridDhtPartitionsFullMessage m = createPartitionsFullMessage(null, null, null, null);
if (log.isDebugEnabled())
log.debug("Sending all partitions [nodeIds=" + U.nodeIds(nodes) + ", msg=" + m + ']');
@@@ -886,26 -883,18 +886,24 @@@
}
/**
- * @param nodes Target nodes.
* @param exchId Non-null exchange ID if message is created for exchange.
* @param lastVer Last version.
- * @param compress {@code True} if it is possible to use compression for message.
* @return Message.
*/
- public GridDhtPartitionsFullMessage createPartitionsFullMessage(Collection<ClusterNode> nodes,
+ public GridDhtPartitionsFullMessage createPartitionsFullMessage(
- final @Nullable GridDhtPartitionExchangeId exchId,
- @Nullable GridCacheVersion lastVer) {
+ @Nullable final GridDhtPartitionExchangeId exchId,
+ @Nullable GridCacheVersion lastVer,
+ @Nullable IgniteDhtPartitionHistorySuppliersMap partHistSuppliers,
- @Nullable IgniteDhtPartitionsToReloadMap partsToReload,
- final boolean compress) {
++ @Nullable IgniteDhtPartitionsToReloadMap partsToReload
++ ) {
final GridDhtPartitionsFullMessage m = new GridDhtPartitionsFullMessage(exchId,
lastVer,
- exchId != null ? exchId.topologyVersion() : AffinityTopologyVersion.NONE);
+ exchId != null ? exchId.topologyVersion() : AffinityTopologyVersion.NONE,
+ partHistSuppliers,
+ partsToReload
+ );
- m.compress(compress);
+ m.compress(true);
final Map<Object, T2<Integer, GridDhtPartitionFullMap>> dupData = new HashMap<>();
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataTransport.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/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 42f60b1,7471855..a1926ee
--- 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
@@@ -1156,12 -1089,8 +1155,10 @@@ public class GridDhtPartitionsExchangeF
GridCacheVersion last = lastVer.get();
GridDhtPartitionsFullMessage m = cctx.exchange().createPartitionsFullMessage(
- nodes,
exchangeId(),
- last != null ? last : cctx.versions().last());
+ last != null ? last : cctx.versions().last(),
+ partHistSuppliers,
- partsToReload,
- compress);
++ partsToReload);
if (exchangeOnChangeGlobalState && !F.isEmpty(changeGlobalStateExceptions))
m.setExceptionsMap(changeGlobalStateExceptions);
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/modules/core/src/main/java/org/apache/ignite/internal/processors/marshaller/GridMarshallerMappingProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/15613e2a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
----------------------------------------------------------------------
[46/50] ignite git commit: ignite-2.1.2 more assert info in wal
manager
Posted by vo...@apache.org.
ignite-2.1.2 more assert info in wal manager
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/64596ea8
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/64596ea8
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/64596ea8
Branch: refs/heads/master
Commit: 64596ea8348105bf7b0e931af89e31190a2b53e5
Parents: c4ddda3
Author: Dmitriy Govorukhin <dm...@gmail.com>
Authored: Mon Jul 3 18:20:35 2017 +0300
Committer: Dmitriy Govorukhin <dm...@gmail.com>
Committed: Mon Jul 3 18:20:35 2017 +0300
----------------------------------------------------------------------
.../cache/persistence/wal/FileWriteAheadLogManager.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/64596ea8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
index 225776d..5918141 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
@@ -1918,7 +1918,11 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
lock.lock();
try {
- assert head.get() instanceof FakeRecord: "head";
+ WALRecord rec = head.get();
+
+ assert rec instanceof FakeRecord : "Expected head FakeRecord, actual head "
+ + (rec != null ? rec.getClass().getSimpleName() : "null");
+
assert written == lastFsyncPos || mode != WALMode.DEFAULT :
"fsync [written=" + written + ", lastFsync=" + lastFsyncPos + ']';
[44/50] ignite git commit: Merge branch master into ignite-2.1.2
Posted by vo...@apache.org.
Merge branch master 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/c4ddda3c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c4ddda3c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c4ddda3c
Branch: refs/heads/master
Commit: c4ddda3c730ccc3d5de4245049819605769e918c
Parents: e1ce7c9 7db925c
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Mon Jul 3 15:30:39 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Mon Jul 3 15:30:39 2017 +0300
----------------------------------------------------------------------
.../apache/ignite/internal/IgniteKernal.java | 11 ++-
.../processors/cache/GridCacheAdapter.java | 4 +
.../GridCachePartitionExchangeManager.java | 2 +-
.../processors/cache/GridCacheProcessor.java | 9 +-
.../GridDhtPartitionsExchangeFuture.java | 2 +-
.../GridCacheAtomicSequenceImpl.java | 99 ++++++++++++--------
.../CacheLateAffinityAssignmentTest.java | 73 +++++++++++++++
7 files changed, 154 insertions(+), 46 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c4ddda3c/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c4ddda3c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c4ddda3c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 0e541c8,cbb07f9..2b5a4ff
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@@ -264,12 -261,13 +264,12 @@@ public class GridCachePartitionExchange
exchFut = exchangeFuture(exchId, evt, cache, null, msg);
}
}
- else
- else if (msg.exchangeId().topologyVersion().topologyVersion() >= cctx.discovery().localJoinEvent().topologyVersion()) {
++ else if (msg.exchangeId().topologyVersion().topologyVersion() >= cctx.discovery().localJoinEvent().topologyVersion())
exchangeFuture(msg.exchangeId(), null, null, null, null)
.onAffinityChangeMessage(evt.eventNode(), msg);
- }
}
- else if (customMsg instanceof StartFullSnapshotAckDiscoveryMessage
- && !((StartFullSnapshotAckDiscoveryMessage)customMsg).hasError()) {
+ else if (customMsg instanceof StartSnapshotOperationAckDiscoveryMessage
+ && ((StartSnapshotOperationAckDiscoveryMessage)customMsg).needExchange()) {
exchId = exchangeId(n.id(), affinityTopologyVersion(evt), evt.type());
exchFut = exchangeFuture(exchId, evt, null, null, null);
http://git-wip-us.apache.org/repos/asf/ignite/blob/c4ddda3c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index bb6d068,91325fd..402d874
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@@ -1213,10 -1261,10 +1220,10 @@@ public class GridCacheProcessor extend
if (log.isInfoEnabled()) {
log.info("Started cache [name=" + cfg.getName() +
(cfg.getGroupName() != null ? ", group=" + cfg.getGroupName() : "") +
- ", memoryPolicyName=" + cfg.getMemoryPolicyName() +
+ ", memoryPolicyName=" + memPlcName +
", mode=" + cfg.getCacheMode() +
", atomicity=" + cfg.getAtomicityMode() + ']');
-}
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/c4ddda3c/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/c4ddda3c/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
index 29f5880,31ec16f..725e4aa
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
@@@ -416,9 -438,9 +435,9 @@@ public final class GridCacheAtomicSeque
}
/** {@inheritDoc} */
- @Override public void onActivate(GridKernalContext kctx) throws IgniteCheckedException {
- this.ctx = kctx.cache().<GridCacheInternalKey, GridCacheAtomicSequenceValue>context().cacheContext(ctx.cacheId());
- this.seqView = ctx.cache();
+ @Override public void onActivate(GridKernalContext kctx) {
- seqView = kctx.cache().atomicsCache();
- ctx = seqView.context();
++ ctx = kctx.cache().<GridCacheInternalKey, GridCacheAtomicSequenceValue>context().cacheContext(ctx.cacheId());
++ seqView = ctx.cache();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/c4ddda3c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLateAffinityAssignmentTest.java
----------------------------------------------------------------------
[07/50] ignite git commit: added javadoc to class header of
GridNearGetRequest
Posted by vo...@apache.org.
added javadoc to class header of GridNearGetRequest
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/62a427b2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/62a427b2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/62a427b2
Branch: refs/heads/master
Commit: 62a427b2f2c1429dfae86cbec23abb6071cb5196
Parents: b621431
Author: Ivan Rakov <iv...@gmail.com>
Authored: Fri Jun 23 20:19:49 2017 +0300
Committer: Ivan Rakov <iv...@gmail.com>
Committed: Fri Jun 23 20:19:49 2017 +0300
----------------------------------------------------------------------
.../processors/cache/distributed/near/GridNearGetRequest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/62a427b2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
index 5f042d3..a550aa3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
@@ -47,7 +47,7 @@ import org.apache.ignite.plugin.extensions.communication.MessageWriter;
import org.jetbrains.annotations.NotNull;
/**
- * Get request.
+ * Get request. Responsible for obtaining entry from primary code. 'Near' means 'Primary' here, not 'Near Cache'.
*/
public class GridNearGetRequest extends GridCacheIdMessage implements GridCacheDeployable,
GridCacheVersionable {
[06/50] ignite git commit: New method to register marshaller mappings
locally without triggering discovery messages exchange
Posted by vo...@apache.org.
New method to register marshaller mappings locally without triggering discovery messages exchange
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b6214314
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b6214314
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b6214314
Branch: refs/heads/master
Commit: b621431416a692af8ff3172331ee665efacf9ff5
Parents: 4debe5b
Author: Sergey Chugunov <se...@gmail.com>
Authored: Fri Jun 23 15:36:24 2017 +0300
Committer: Sergey Chugunov <se...@gmail.com>
Committed: Fri Jun 23 15:36:24 2017 +0300
----------------------------------------------------------------------
.../ignite/internal/MarshallerContextImpl.java | 11 ++++++++
.../ignite/marshaller/MarshallerContext.java | 27 +++++++++++++++++---
...GridBinaryMarshallerCtxDisabledSelfTest.java | 5 ++++
.../cache/GridCacheEntryMemorySizeSelfTest.java | 4 +++
4 files changed, 43 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b6214314/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
index 265481e..cad06c3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
@@ -265,6 +265,17 @@ public class MarshallerContextImpl implements MarshallerContext {
}
}
+ /** {@inheritDoc} */
+ @Override public boolean registerClassNameLocally(byte platformId, int typeId, String clsName)
+ throws IgniteCheckedException
+ {
+ ConcurrentMap<Integer, MappedName> cache = getCacheFor(platformId);
+
+ cache.put(typeId, new MappedName(clsName, true));
+
+ return true;
+ }
+
/**
* @param res result of exchange.
*/
http://git-wip-us.apache.org/repos/asf/ignite/blob/b6214314/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerContext.java b/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerContext.java
index 6898c36..8d6cd77 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerContext.java
@@ -24,17 +24,36 @@ import org.apache.ignite.IgniteCheckedException;
*/
public interface MarshallerContext {
/**
- * Registers class with provided type ID.
+ * Method to register typeId->class name mapping in marshaller context <b>cluster-wide</b>.
*
+ * This method <b>guarantees</b> that mapping is delivered to all nodes in cluster
+ * and blocks caller thread until then.
+ *
+ * @param platformId Id of a platform (java, .NET, etc.) to register mapping for.
* @param typeId Type ID.
- * @param platformId id of a platform to register class.
- * @param clsName class name.
- * @return Whether class was registered.
+ * @param clsName Class name.
+ * @return {@code True} if mapping was registered successfully.
* @throws IgniteCheckedException In case of error.
*/
public boolean registerClassName(byte platformId, int typeId, String clsName) throws IgniteCheckedException;
/**
+ * Method to register typeId->class name mapping in marshaller context <b>on local node only</b>.
+ *
+ * <b>No guarantees</b> that the mapping is presented on other nodes are provided.
+ *
+ * This method is safe to use if there is another source of mappings like metadata persisted on disk
+ * and this source is known to be solid and free of conflicts beforehand.
+ *
+ * @param platformId Id of a platform (java, .NET, etc.) to register mapping for.
+ * @param typeId Type id.
+ * @param clsName Class name.
+ * @return {@code True} if class mapping was registered successfully.
+ * @throws IgniteCheckedException In case of error.
+ */
+ public boolean registerClassNameLocally(byte platformId, int typeId, String clsName) throws IgniteCheckedException;
+
+ /**
* Gets class for provided type ID.
*
* @param typeId Type ID.
http://git-wip-us.apache.org/repos/asf/ignite/blob/b6214314/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMarshallerCtxDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMarshallerCtxDisabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMarshallerCtxDisabledSelfTest.java
index 5ee2423..35aa9b9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMarshallerCtxDisabledSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMarshallerCtxDisabledSelfTest.java
@@ -98,6 +98,11 @@ public class GridBinaryMarshallerCtxDisabledSelfTest extends GridCommonAbstractT
}
/** {@inheritDoc} */
+ @Override public boolean registerClassNameLocally(byte platformId, int typeId, String clsName) {
+ return false;
+ }
+
+ /** {@inheritDoc} */
@Override public Class getClass(
int typeId,
ClassLoader ldr
http://git-wip-us.apache.org/repos/asf/ignite/blob/b6214314/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
index 6939258..f18afb2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
@@ -151,6 +151,10 @@ public class GridCacheEntryMemorySizeSelfTest extends GridCommonAbstractTest {
return true;
}
+ @Override public boolean registerClassNameLocally(byte platformId, int typeId, String clsName) {
+ return true;
+ }
+
@Override public Class getClass(int typeId, ClassLoader ldr) {
throw new UnsupportedOperationException();
}
[28/50] ignite git commit: IGNITE-5599 Added log throttling.
Posted by vo...@apache.org.
IGNITE-5599 Added log throttling.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/459dc9e4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/459dc9e4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/459dc9e4
Branch: refs/heads/master
Commit: 459dc9e455ca23968210a50ebe87d312846cc48b
Parents: 1ced55b
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Thu Jun 29 14:43:42 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Thu Jun 29 14:43:42 2017 +0700
----------------------------------------------------------------------
.../ignite/console/agent/rest/RestExecutor.java | 24 +++++++++++++-------
1 file changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/459dc9e4/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 52d37c4..3936374 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
@@ -32,9 +32,13 @@ import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
-import org.apache.ignite.console.demo.*;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.console.demo.AgentClusterDemo;
import org.apache.ignite.internal.processors.rest.protocols.http.jetty.GridJettyObjectMapper;
-import org.apache.log4j.Logger;
+import org.apache.ignite.internal.util.typedef.internal.LT;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.logger.slf4j.Slf4jLogger;
+import org.slf4j.LoggerFactory;
import static org.apache.ignite.internal.processors.rest.GridRestResponse.STATUS_AUTH_FAILED;
import static org.apache.ignite.internal.processors.rest.GridRestResponse.STATUS_FAILED;
@@ -45,7 +49,7 @@ import static org.apache.ignite.internal.processors.rest.GridRestResponse.STATUS
*/
public class RestExecutor {
/** */
- private static final Logger log = Logger.getLogger(RestExecutor.class);
+ private static final IgniteLogger log = new Slf4jLogger(LoggerFactory.getLogger(RestExecutor.class));
/** JSON object mapper. */
private static final ObjectMapper mapper = new GridJettyObjectMapper();
@@ -166,12 +170,15 @@ public class RestExecutor {
}
if (resp.code() == 401)
- return RestResult.fail(STATUS_AUTH_FAILED, "Failed to authenticate in grid. Please check agent\'s login and password or node port.");
+ return RestResult.fail(STATUS_AUTH_FAILED, "Failed to authenticate in grid. " +
+ "Please check agent\'s login and password or node port.");
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).");
+ catch (ConnectException ignored) {
+ LT.warn(log, "Failed connect to node and execute REST command. " +
+ "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 + "]");
}
@@ -187,14 +194,15 @@ public class RestExecutor {
*/
public RestResult execute(boolean demo, String path, Map<String, Object> params,
String mtd, Map<String, Object> headers, String body) {
- log.debug("Start execute REST command [method=" + mtd + ", uri=/" + (path == null ? "" : path) +
+ if (log.isDebugEnabled())
+ log.debug("Start execute REST command [method=" + mtd + ", uri=/" + (path == null ? "" : path) +
", parameters=" + params + "]");
try {
return sendRequest(demo, path, params, mtd, headers, body);
}
catch (Exception e) {
- log.info("Failed to execute REST command [method=" + mtd + ", uri=/" + (path == null ? "" : path) +
+ U.error(log, "Failed to execute REST command [method=" + mtd + ", uri=/" + (path == null ? "" : path) +
", parameters=" + params + "]", e);
return RestResult.fail(404, e.getMessage());
[25/50] ignite git commit: IGNITE-5536 Fixed Docker file generation.
Posted by vo...@apache.org.
IGNITE-5536 Fixed Docker file generation.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3dbeac44
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3dbeac44
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3dbeac44
Branch: refs/heads/master
Commit: 3dbeac440591c8404bdbea78fc46cdff7c2f432e
Parents: 764eeea
Author: vsisko <vs...@gridgain.com>
Authored: Wed Jun 28 15:07:30 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Wed Jun 28 15:07:30 2017 +0700
----------------------------------------------------------------------
.../app/modules/configuration/generator/Docker.service.js | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/3dbeac44/modules/web-console/frontend/app/modules/configuration/generator/Docker.service.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/Docker.service.js b/modules/web-console/frontend/app/modules/configuration/generator/Docker.service.js
index 91457e8..ea49c41 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/Docker.service.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/Docker.service.js
@@ -19,6 +19,8 @@
* Docker file generation entry point.
*/
export default class IgniteDockerGenerator {
+ escapeFileName = (name) => name.replace(/[\\\/*\"\[\],\.:;|=<>?]/g, '-').replace(/ /g, '_');
+
/**
* Generate from section.
*
@@ -44,7 +46,7 @@ export default class IgniteDockerGenerator {
this.from(cluster, targetVer),
'',
'# Set config uri for node.',
- `ENV CONFIG_URI config/${cluster.name}-server.xml`,
+ `ENV CONFIG_URI ${this.escapeFileName(cluster.name)}-server.xml`,
'',
'# Copy ignite-http-rest from optional.',
'ENV OPTION_LIBS ignite-rest-http',
@@ -62,8 +64,7 @@ export default class IgniteDockerGenerator {
'',
'# Copy project jars to node classpath.',
`RUN mkdir $IGNITE_HOME/libs/${cluster.name} && \\`,
- ` find ${cluster.name}/target -name "*.jar" -type f -exec cp {} $IGNITE_HOME/libs/${cluster.name} \\; && \\`,
- ` cp -r ${cluster.name}/config/* $IGNITE_HOME/config`
+ ` find ${cluster.name}/target -name "*.jar" -type f -exec cp {} $IGNITE_HOME/libs/${cluster.name} \\;`
].join('\n');
}
[24/50] ignite git commit: Merge remote-tracking branch
'community/ignite-2.1.2' into ignite-2.1.2
Posted by vo...@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/master
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(-)
----------------------------------------------------------------------
[03/50] ignite git commit: Merge branch 'web-console-2.1.1' into
'ignite-2.1.2'
Posted by vo...@apache.org.
Merge branch 'web-console-2.1.1' 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/bebe80e3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bebe80e3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bebe80e3
Branch: refs/heads/master
Commit: bebe80e3f5ce2a3a078800c05c3e2eb8d8cde51b
Parents: 92f66b2 c1e2bc4
Author: Andrey Novikov <an...@gridgain.com>
Authored: Fri Jun 23 16:07:17 2017 +0700
Committer: Andrey Novikov <an...@gridgain.com>
Committed: Fri Jun 23 16:07:17 2017 +0700
----------------------------------------------------------------------
modules/web-console/backend/.gitignore | 1 +
modules/web-console/backend/app/mongo.js | 2 +-
modules/web-console/frontend/.gitignore | 1 +
.../app/modules/configuration/generator/Beans.js | 8 ++++++++
.../configuration/generator/ConfigurationGenerator.js | 12 +++++++-----
.../configuration/generator/JavaTransformer.service.js | 4 ++--
.../modules/states/configuration/clusters/memory.pug | 7 ++++---
.../states/configuration/clusters/persistence.pug | 2 +-
8 files changed, 25 insertions(+), 12 deletions(-)
----------------------------------------------------------------------