You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/03/03 09:54:31 UTC
[01/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/sprint-2' into ignite-237
Repository: incubator-ignite
Updated Branches:
refs/heads/sprint-2 e5e2a8e1f -> d33abdba7
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-237
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7c2443f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7c2443f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7c2443f9
Branch: refs/heads/sprint-2
Commit: 7c2443f956004b59066839a292817fa8e7b39590
Parents: c26f64a 9a69903
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed Feb 25 18:10:40 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed Feb 25 18:10:40 2015 +0300
----------------------------------------------------------------------
.../processors/rest/TestBinaryClient.java | 1 -
.../processors/rest/TestMemcacheClient.java | 13 +-
.../protocols/tcp/TcpRestParserSelfTest.java | 2 +-
.../apache/ignite/IgniteSystemProperties.java | 5 +
.../CacheRendezvousAffinityFunction.java | 1 +
.../IgfsByteDelimiterRecordResolver.java | 1 +
.../ignite/internal/ClusterMetricsSnapshot.java | 9 +-
.../internal/GridEventConsumeHandler.java | 1 +
.../ignite/internal/GridKernalContext.java | 8 +
.../ignite/internal/GridKernalContextImpl.java | 11 +
.../internal/GridMessageListenHandler.java | 1 +
.../apache/ignite/internal/IgniteKernal.java | 6 +
.../igfs/common/IgfsControlResponse.java | 1 +
.../internal/igfs/common/IgfsMarshaller.java | 1 +
.../internal/managers/GridManagerAdapter.java | 5 +
.../affinity/GridAffinityMessage.java | 1 +
.../processors/cache/GridCacheEntryInfo.java | 5 +-
.../continuous/CacheContinuousQueryEntry.java | 1 +
.../continuous/CacheContinuousQueryHandler.java | 1 +
.../cache/transactions/IgniteTxEntry.java | 5 +-
.../version/GridCacheRawVersionedEntry.java | 1 +
.../processors/clock/GridClockMessage.java | 1 +
.../internal/processors/igfs/IgfsServer.java | 1 +
.../processors/rest/GridRestResponse.java | 1 +
.../message/GridClientAbstractMessage.java | 1 +
.../message/GridClientHandshakeRequest.java | 1 +
.../protocols/tcp/GridMemcachedMessage.java | 3 +-
.../rest/protocols/tcp/GridTcpRestParser.java | 10 +-
.../internal/util/IgniteExceptionRegistry.java | 259 +++
.../ignite/internal/util/IgniteUtils.java | 2007 +++++++++---------
.../nio/GridConnectionBytesVerifyFilter.java | 1 +
.../util/nio/GridTcpCommunicationClient.java | 1 +
.../internal/visor/util/VisorTaskUtils.java | 42 +-
.../ignite/lang/IgniteProductVersion.java | 1 +
.../org/apache/ignite/mxbean/IgniteMXBean.java | 6 +
.../org/apache/ignite/spi/IgniteSpiAdapter.java | 15 +
.../org/apache/ignite/spi/IgniteSpiContext.java | 8 +
.../communication/tcp/TcpCommunicationSpi.java | 54 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 82 +-
.../tcp/internal/TcpDiscoveryNode.java | 1 +
.../TcpDiscoveryMulticastIpFinder.java | 1 +
.../messages/TcpDiscoveryAuthFailedMessage.java | 1 +
.../messages/TcpDiscoveryHeartbeatMessage.java | 1 +
.../igfs/IgfsDataManagerSelfTest.java | 1 +
.../util/IgniteExceptionRegistrySelfTest.java | 89 +
.../internal/util/IgniteUtilsSelfTest.java | 6 +-
.../internal/util/nio/GridRoundTripTest.java | 1 +
.../offheap/GridOffHeapMapAbstractSelfTest.java | 1 +
.../file/GridFileSwapSpaceSpiSelfTest.java | 1 +
.../testframework/GridSpiTestContext.java | 6 +
.../junits/GridTestKernalContext.java | 2 +
.../testsuites/IgniteUtilSelfTestSuite.java | 1 +
.../shuffle/GridHadoopShuffleMessage.java | 1 +
.../http/jetty/GridJettyRestHandler.java | 1 +
54 files changed, 1629 insertions(+), 1059 deletions(-)
----------------------------------------------------------------------
[09/50] incubator-ignite git commit: #ignite-237: Change tests to new
affinity API.
Posted by sb...@apache.org.
#ignite-237: Change tests to new affinity API.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/50db6efa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/50db6efa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/50db6efa
Branch: refs/heads/sprint-2
Commit: 50db6efa0b0a48c6e23fe48e71436cd5949b66e3
Parents: 482ffd1
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 15:09:21 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 15:09:21 2015 +0300
----------------------------------------------------------------------
.../dht/GridCacheDhtEvictionNearReadersSelfTest.java | 6 +-----
.../distributed/dht/GridCacheDhtEvictionSelfTest.java | 14 +-------------
2 files changed, 2 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/50db6efa/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
index 6d43df5..a293c6e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cache.eviction.fifo.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
@@ -168,10 +167,7 @@ public class GridCacheDhtEvictionNearReadersSelfTest extends GridCommonAbstractT
* @return Primary node for the given key.
*/
private Collection<ClusterNode> keyNodes(Object key) {
- CacheRendezvousAffinityFunction aff = (CacheRendezvousAffinityFunction) grid(0).jcache(null).
- getConfiguration(CacheConfiguration.class).getAffinity();
-
- return aff.assignPartition(aff.partition(key), new ArrayList<>(grid(0).cluster().nodes()), 1, null);
+ return grid(0).affinity(null).mapKeyToPrimaryAndBackups(key);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/50db6efa/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
index c253861..d9242f8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.rendezvous.CacheRendezvousAffinityFunction;
import org.apache.ignite.cache.eviction.fifo.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
@@ -158,22 +157,11 @@ public class GridCacheDhtEvictionSelfTest extends GridCommonAbstractTest {
}
/**
- * @param idx Index.
- * @return Affinity.
- */
- private CacheRendezvousAffinityFunction affinity(int idx) {
- return (CacheRendezvousAffinityFunction)grid(idx).jcache(null).
- getConfiguration(CacheConfiguration.class).getAffinity();
- }
-
- /**
* @param key Key.
* @return Primary node for the given key.
*/
private Collection<ClusterNode> keyNodes(Object key) {
- CacheRendezvousAffinityFunction aff = affinity(0);
-
- return aff.assignPartition(aff.partition(key), new ArrayList(grid(0).cluster().nodes()), 1, null);
+ return grid(0).affinity(null).mapKeyToPrimaryAndBackups(key);
}
/**
[46/50] incubator-ignite git commit: #ignite-239: remove replicaCount
from GridClientNode and GridClientNodeBean.
Posted by sb...@apache.org.
#ignite-239: remove replicaCount from GridClientNode and GridClientNodeBean.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5f620d62
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5f620d62
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5f620d62
Branch: refs/heads/sprint-2
Commit: 5f620d62191188ff4dcbe55c5d0399603e494b45
Parents: 6c67bdf
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Mar 2 12:40:13 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Mar 2 12:40:13 2015 +0300
----------------------------------------------------------------------
.../impl/ClientPartitionAffinitySelfTest.java | 4 +---
.../ClientTcpUnreachableMultiNodeSelfTest.java | 4 ----
.../ignite/internal/client/GridClientNode.java | 8 -------
.../client/GridClientPartitionAffinity.java | 2 +-
.../client/impl/GridClientNodeImpl.java | 22 -------------------
.../connection/GridClientNioTcpConnection.java | 3 +--
.../rest/client/message/GridClientNodeBean.java | 23 --------------------
7 files changed, 3 insertions(+), 63 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5f620d62/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
index 7ece534..6af1c4c 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
@@ -152,7 +152,7 @@ public class ClientPartitionAffinitySelfTest extends GridCommonAbstractTest {
aff.setHashIdResolver(new GridClientPartitionAffinity.HashIdResolver() {
@Override public Object getHashId(GridClientNode node) {
- return node.replicaCount();
+ return 1;
}
});
@@ -258,7 +258,6 @@ public class ClientPartitionAffinitySelfTest extends GridCommonAbstractTest {
private GridClientNode createNode(String nodeId, int replicaCnt) {
return GridClientNodeImpl.builder()
.nodeId(UUID.fromString(nodeId))
- .replicaCount(replicaCnt)
.build();
}
@@ -276,7 +275,6 @@ public class ClientPartitionAffinitySelfTest extends GridCommonAbstractTest {
nodes.add(GridClientNodeImpl.builder()
.nodeId(nodeId)
- .replicaCount(replicaCnt)
.build());
ClusterNode srvNode = new TestRichNode(nodeId);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5f620d62/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
index bb3710e..fda7e99 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
@@ -85,10 +85,6 @@ public class ClientTcpUnreachableMultiNodeSelfTest extends ClientTcpMultiNodeSel
return node.caches();
}
- @Override public int replicaCount() {
- return node.replicaCount();
- }
-
@Override public List<String> tcpAddresses() {
return node.tcpAddresses();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5f620d62/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientNode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientNode.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientNode.java
index ac2fe86..74e612d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientNode.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientNode.java
@@ -99,14 +99,6 @@ public interface GridClientNode {
public Map<String, GridClientCacheMode> caches();
/**
- * Gets node replica count for consistent hash ring (valid only for
- * {@code PARTITIONED} caches).
- *
- * @return Node replica count for consistent hash ring.
- */
- public int replicaCount();
-
- /**
* Gets collection of addresses on which REST binary protocol is bound.
*
* @param proto Protocol for which addresses are obtained.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5f620d62/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientPartitionAffinity.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientPartitionAffinity.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientPartitionAffinity.java
index a0fad61..b747bc4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientPartitionAffinity.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientPartitionAffinity.java
@@ -274,7 +274,7 @@ public class GridClientPartitionAffinity implements GridClientDataAffinity, Grid
nodeInfo = new NodeInfo(nodeId, hashIdRslvr == null ? nodeId : hashIdRslvr.getHashId(n));
addedNodes.put(nodeId, nodeInfo);
- nodeHash.addNode(nodeInfo, n.replicaCount());
+ nodeHash.addNode(nodeInfo, 1);
return nodeInfo;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5f620d62/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientNodeImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientNodeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientNodeImpl.java
index 6692550..9c59b84 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientNodeImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientNodeImpl.java
@@ -53,9 +53,6 @@ public class GridClientNodeImpl implements GridClientNode {
/** Node caches. */
private Map<String, GridClientCacheMode> caches = Collections.emptyMap();
- /** Replica count for partitioned cache. */
- private int replicaCnt;
-
/** Connectable property. */
private boolean connectable;
@@ -95,7 +92,6 @@ public class GridClientNodeImpl implements GridClientNode {
.tcpAddresses(from.tcpAddresses())
.tcpPort(from.tcpPort())
.caches(from.caches())
- .replicaCount(from.replicaCount())
.connectable(from.connectable());
if (!skipAttrs)
@@ -154,11 +150,6 @@ public class GridClientNodeImpl implements GridClientNode {
}
/** {@inheritDoc} */
- @Override public int replicaCount() {
- return replicaCnt;
- }
-
- /** {@inheritDoc} */
@Override public Collection<InetSocketAddress> availableAddresses(GridClientProtocol proto,
boolean filterResolved) {
Collection<String> addrs;
@@ -368,19 +359,6 @@ public class GridClientNodeImpl implements GridClientNode {
return this;
}
-
- /**
- * Sets replica count for node on consistent hash ring.
- *
- * @param replicaCnt Replica count.
- * @return This for chaining.
- */
- public Builder replicaCount(int replicaCnt) {
- impl.replicaCnt = replicaCnt;
-
- return this;
- }
-
/**
* Sets connectable property.
*
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5f620d62/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
index d84bca5..44d10f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
@@ -868,8 +868,7 @@ public class GridClientNioTcpConnection extends GridClientConnection {
.nodeId(nodeBean.getNodeId())
.consistentId(nodeBean.getConsistentId())
.tcpAddresses(nodeBean.getTcpAddresses())
- .tcpPort(nodeBean.getTcpPort())
- .replicaCount(nodeBean.getReplicaCount());
+ .tcpPort(nodeBean.getTcpPort());
Map<String, GridClientCacheMode> caches = new HashMap<>();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5f620d62/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientNodeBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientNodeBean.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientNodeBean.java
index 6605a15..833abd9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientNodeBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientNodeBean.java
@@ -56,9 +56,6 @@ public class GridClientNodeBean implements Externalizable {
/** Node caches. */
private Map<String, String> caches;
- /** Default replica count for partitioned cache. */
- private int replicaCnt;
-
/**
* Gets node ID.
*
@@ -209,24 +206,6 @@ public class GridClientNodeBean implements Externalizable {
}
/**
- * Gets node replica count on consistent hash ring.
- *
- * @return Node replica count.
- */
- public int getReplicaCount() {
- return replicaCnt;
- }
-
- /**
- * Sets node replica count on consistent hash ring.
- *
- * @param replicaCnt Node replica count.
- */
- public void setReplicaCount(int replicaCnt) {
- this.replicaCnt = replicaCnt;
- }
-
- /**
* Sets REST binary protocol port.
*
* @param tcpPort Port on which REST binary protocol is bound.
@@ -257,7 +236,6 @@ public class GridClientNodeBean implements Externalizable {
@Override public void writeExternal(ObjectOutput out) throws IOException {
out.writeInt(tcpPort);
out.writeInt(0); // Jetty port.
- out.writeInt(replicaCnt);
U.writeString(out, dfltCacheMode);
@@ -279,7 +257,6 @@ public class GridClientNodeBean implements Externalizable {
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
tcpPort = in.readInt();
in.readInt(); // Jetty port.
- replicaCnt = in.readInt();
dfltCacheMode = U.readString(in);
[21/50] incubator-ignite git commit: #ignite-237: change affinity
function in tests.
Posted by sb...@apache.org.
#ignite-237: change affinity function in tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/96ad6c16
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/96ad6c16
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/96ad6c16
Branch: refs/heads/sprint-2
Commit: 96ad6c16cd35a1552d54a515034f1e57edfbffa4
Parents: 81fb145
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 16:25:53 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 16:25:53 2015 +0300
----------------------------------------------------------------------
modules/core/src/test/config/load/dsi-49-server-production.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96ad6c16/modules/core/src/test/config/load/dsi-49-server-production.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/load/dsi-49-server-production.xml b/modules/core/src/test/config/load/dsi-49-server-production.xml
index 07fc164..316d889 100644
--- a/modules/core/src/test/config/load/dsi-49-server-production.xml
+++ b/modules/core/src/test/config/load/dsi-49-server-production.xml
@@ -53,7 +53,7 @@
<!-- 1 backup -->
<property name="backups" value="1"/>
<property name="affinity">
- <bean class="org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction">
+ <bean class="org.apache.ignite.cache.affinity.rendezvous.CacheRendezvousAffinityFunction">
<property name="excludeNeighbors" value="true"/>
</bean>
</property>
[13/50] incubator-ignite git commit: #ignite-237: remove consistent
hash from IgniteClientAffinityAssignmentSelfTest.
Posted by sb...@apache.org.
#ignite-237: remove consistent hash from IgniteClientAffinityAssignmentSelfTest.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/fecb680d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fecb680d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fecb680d
Branch: refs/heads/sprint-2
Commit: fecb680da583d27fc8feb292da7176f7ec8304ae
Parents: 6a5b42f
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 15:51:33 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 15:51:33 2015 +0300
----------------------------------------------------------------------
.../IgniteClientAffinityAssignmentSelfTest.java | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fecb680d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientAffinityAssignmentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientAffinityAssignmentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientAffinityAssignmentSelfTest.java
index 719a8aa..0f1a049 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientAffinityAssignmentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientAffinityAssignmentSelfTest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.fair.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
@@ -58,8 +57,6 @@ public class IgniteClientAffinityAssignmentSelfTest extends GridCommonAbstractTe
ccfg.setDistributionMode(client ? CLIENT_ONLY : PARTITIONED_ONLY);
if (aff == 0)
- ccfg.setAffinity(new CacheConsistentHashAffinityFunction(false, PARTS));
- else if (aff == 1)
ccfg.setAffinity(new CacheRendezvousAffinityFunction(false, PARTS));
else
ccfg.setAffinity(new CachePartitionFairAffinity(PARTS));
@@ -73,17 +70,8 @@ public class IgniteClientAffinityAssignmentSelfTest extends GridCommonAbstractTe
/**
* @throws Exception If failed.
*/
- public void testConsistentHashAssignment() throws Exception {
- aff = 0;
-
- checkAffinityFunction();
- }
-
- /**
- * @throws Exception If failed.
- */
public void testRendezvousAssignment() throws Exception {
- aff = 1;
+ aff = 0;
checkAffinityFunction();
}
@@ -92,7 +80,7 @@ public class IgniteClientAffinityAssignmentSelfTest extends GridCommonAbstractTe
* @throws Exception If failed.
*/
public void testFairAssignment() throws Exception {
- aff = 2;
+ aff = 1;
checkAffinityFunction();
}
[08/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/sprint-2' into ignite-237
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-237
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/482ffd18
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/482ffd18
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/482ffd18
Branch: refs/heads/sprint-2
Commit: 482ffd1815bc75ef2f13820982f26b1ff0cb2bee
Parents: 8be8fb8 4e57996
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 14:59:49 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 14:59:49 2015 +0300
----------------------------------------------------------------------
.../ComputeFibonacciContinuationExample.java | 15 ++++++++++++---
.../scalar/examples/ScalarContinuationExample.scala | 15 ++++++++++++---
2 files changed, 24 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
[05/50] incubator-ignite git commit: #ignite-237: Change default
partition from 10000 to 1024 in CacheRendezvousAffinityFunction.
Posted by sb...@apache.org.
#ignite-237: Change default partition from 10000 to 1024 in CacheRendezvousAffinityFunction.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/958e23bb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/958e23bb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/958e23bb
Branch: refs/heads/sprint-2
Commit: 958e23bba18b1af048659c92b8af8edae999417a
Parents: 7c2443f
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 11:36:18 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 11:36:18 2015 +0300
----------------------------------------------------------------------
.../cache/affinity/rendezvous/CacheRendezvousAffinityFunction.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/958e23bb/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/CacheRendezvousAffinityFunction.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/CacheRendezvousAffinityFunction.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/CacheRendezvousAffinityFunction.java
index 87d768f..d6adf53 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/CacheRendezvousAffinityFunction.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/CacheRendezvousAffinityFunction.java
@@ -59,7 +59,7 @@ public class CacheRendezvousAffinityFunction implements CacheAffinityFunction, E
private static final long serialVersionUID = 0L;
/** Default number of partitions. */
- public static final int DFLT_PARTITION_COUNT = 10000;
+ public static final int DFLT_PARTITION_COUNT = 1024;
/** Comparator. */
private static final Comparator<IgniteBiTuple<Long, ClusterNode>> COMPARATOR =
[32/50] incubator-ignite git commit: #ignite-237: add node attributes.
Posted by sb...@apache.org.
#ignite-237: add node attributes.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/148ca095
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/148ca095
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/148ca095
Branch: refs/heads/sprint-2
Commit: 148ca09572b336cfe4c55683e059ca13fa8cd238
Parents: d254da4
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 15:53:51 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 15:53:51 2015 +0300
----------------------------------------------------------------------
.../internal/processors/cache/GridCacheAttributes.java | 8 ++++++++
1 file changed, 8 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/148ca095/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
index 571ae25..8ecd84c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cache.store.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -191,6 +192,13 @@ public class GridCacheAttributes implements Externalizable {
CacheAffinityFunction aff = cfg.getAffinity();
if (aff != null) {
+ if (aff instanceof CacheRendezvousAffinityFunction) {
+ CacheRendezvousAffinityFunction aff0 = (CacheRendezvousAffinityFunction) aff;
+
+ affInclNeighbors = aff0.isExcludeNeighbors();
+ affHashIdRslvrClsName = className(aff0.getHashIdResolver());
+ }
+
affPartsCnt = aff.partitions();
affClsName = className(aff);
}
[29/50] incubator-ignite git commit: #ignite-237: fix
ClientAbstractMultiNodeSelfTest.
Posted by sb...@apache.org.
#ignite-237: fix ClientAbstractMultiNodeSelfTest.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3bab015f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3bab015f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3bab015f
Branch: refs/heads/sprint-2
Commit: 3bab015f3e7e086972b90998832d6003d05b7c1a
Parents: 4d54c50
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 13:01:08 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 13:01:08 2015 +0300
----------------------------------------------------------------------
.../ClientAbstractMultiNodeSelfTest.java | 49 +-------------------
1 file changed, 1 insertion(+), 48 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3bab015f/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
index 0eb6e16..e73f06d 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
@@ -408,47 +408,6 @@ public abstract class ClientAbstractMultiNodeSelfTest extends GridCommonAbstract
}
}
- /**
- * @throws Exception If failed.
- */
- public void testClientAffinity() throws Exception {
- GridClientData partitioned = client.data(PARTITIONED_CACHE_NAME);
-
- Collection<Object> keys = new ArrayList<>();
-
- keys.addAll(Arrays.asList(
- Boolean.TRUE,
- Boolean.FALSE,
- 1,
- Integer.MAX_VALUE
- ));
-
- Random rnd = new Random();
- StringBuilder sb = new StringBuilder();
-
- // Generate some random strings.
- for (int i = 0; i < 100; i++) {
- sb.setLength(0);
-
- for (int j = 0; j < 255; j++)
- // Only printable ASCII symbols for test.
- sb.append((char)(rnd.nextInt(0x7f - 0x20) + 0x20));
-
- keys.add(sb.toString());
- }
-
- // Generate some more keys to achieve better coverage.
- for (int i = 0; i < 100; i++)
- keys.add(UUID.randomUUID());
-
- for (Object key : keys) {
- UUID nodeId = grid(0).cluster().mapKeyToNode(PARTITIONED_CACHE_NAME, key).id();
-
- UUID clientNodeId = partitioned.affinity(key);
-
- assertEquals("Invalid affinity mapping for REST response for key: " + key, nodeId, clientNodeId);
- }
- }
/**
* @throws Exception If failed.
@@ -585,18 +544,12 @@ public abstract class ClientAbstractMultiNodeSelfTest extends GridCommonAbstract
UUID primaryNodeId = grid(0).cluster().mapKeyToNode(PARTITIONED_CACHE_NAME, key).id();
- assertEquals("Affinity mismatch for key: " + key, primaryNodeId, partitioned.affinity(key));
-
- assertEquals(primaryNodeId, partitioned.affinity(key));
-
- // Must go to primary node only. Since backup count is 0, value must present on
- // primary node only.
partitioned.put(key, "val" + key);
for (Map.Entry<UUID, Ignite> entry : gridsByLocNode.entrySet()) {
Object val = entry.getValue().jcache(PARTITIONED_CACHE_NAME).localPeek(key, CachePeekMode.ONHEAP);
- if (primaryNodeId.equals(entry.getKey()))
+ if (primaryNodeId.equals(entry.getKey()) || partitioned.affinity(key).equals(entry.getKey()))
assertEquals("val" + key, val);
else
assertNull(val);
[44/50] incubator-ignite git commit: #ignite-237: remove debug.
Posted by sb...@apache.org.
#ignite-237: remove debug.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6deba53c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6deba53c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6deba53c
Branch: refs/heads/sprint-2
Commit: 6deba53c2747432c36503ba83932199a943cdcb7
Parents: 6531cbd
Author: ivasilinets <va...@gmail.com>
Authored: Sun Mar 1 22:59:47 2015 +0300
Committer: ivasilinets <va...@gmail.com>
Committed: Sun Mar 1 22:59:47 2015 +0300
----------------------------------------------------------------------
...GridCacheContinuousQueryAbstractSelfTest.java | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6deba53c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
index 850a213..db1ac5a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
@@ -159,23 +159,10 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
}
}
- boolean allEmpty = true;
-
- for (int i = 0; i < gridCount(); i++) {
- Set<Cache.Entry<Object, Object>> entries = ((IgniteKernal) grid(i)).cache(null).entrySet();
-
- for (Cache.Entry entry : entries) {
- boolean primary = grid(i).affinity(null).isPrimary(grid(i).localNode(), entry.getKey());
-
- boolean backup = grid(i).affinity(null).isBackup(grid(i).localNode(), entry.getKey());
-
- info("Not removed entry [grid=" + i + ", primary=" + primary + ", backup=" + backup + ']');
-
- allEmpty = false;
- }
- }
+ for (int i = 0; i < gridCount(); i++)
+ assertEquals("Cache is not empty: " + ((IgniteKernal)grid(i)).cache(null).entrySet(), 0,
+ ((IgniteKernal)grid(i)).cache(null).size());
- assertTrue(allEmpty);
for (int i = 0; i < gridCount(); i++) {
GridContinuousProcessor proc = ((IgniteKernal)grid(i)).context().continuous();
[50/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-237' into sprint-2
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-237' into sprint-2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d33abdba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d33abdba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d33abdba
Branch: refs/heads/sprint-2
Commit: d33abdba733987609f592b046d87209e976ba616
Parents: e5e2a8e f144a89
Author: ivasilinets <iv...@gridgain.com>
Authored: Tue Mar 3 11:49:54 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Tue Mar 3 11:49:54 2015 +0300
----------------------------------------------------------------------
.../ClientAbstractMultiThreadedSelfTest.java | 37 +-
.../impl/ClientPartitionAffinitySelfTest.java | 406 -----------
.../ClientAbstractMultiNodeSelfTest.java | 54 +-
.../integration/ClientAbstractSelfTest.java | 8 -
.../ClientTcpUnreachableMultiNodeSelfTest.java | 4 -
.../client/suite/IgniteClientTestSuite.java | 1 -
.../src/test/resources/spring-server-node.xml | 2 +-
.../test/resources/spring-server-ssl-node.xml | 2 +-
.../java/org/apache/ignite/cache/GridCache.java | 2 +-
.../CacheConsistentHashAffinityFunction.java | 702 -------------------
.../cache/affinity/consistenthash/package.html | 24 -
.../CacheRendezvousAffinityFunction.java | 2 +-
.../configuration/CacheConfiguration.java | 2 +-
.../ignite/internal/client/GridClientNode.java | 8 -
.../client/GridClientPartitionAffinity.java | 2 +-
.../client/impl/GridClientNodeImpl.java | 22 -
.../connection/GridClientNioTcpConnection.java | 3 +-
.../processors/cache/GridCacheAttributes.java | 32 +-
.../processors/cache/GridCacheProcessor.java | 29 +-
.../rest/client/message/GridClientNodeBean.java | 23 -
.../top/GridTopologyCommandHandler.java | 8 -
.../cache/VisorCacheAffinityConfiguration.java | 9 +-
.../config/load/dsi-49-server-production.xml | 2 +-
.../GridCacheAffinityBackupsSelfTest.java | 9 -
.../ignite/IgniteCacheAffinitySelfTest.java | 30 +-
...AffinityProcessorConsistentHashSelfTest.java | 31 -
...idCacheConfigurationConsistencySelfTest.java | 46 +-
...ridCacheConfigurationValidationSelfTest.java | 8 +-
.../cache/GridCacheOffHeapSelfTest.java | 12 +-
.../GridCachePartitionedAffinitySpreadTest.java | 16 +-
.../IgniteClientAffinityAssignmentSelfTest.java | 16 +-
.../GridCacheClientModesAbstractSelfTest.java | 4 +-
...dCachePartitionedAffinityFilterSelfTest.java | 6 +-
...GridCachePreloadRestartAbstractSelfTest.java | 4 +-
.../dht/GridCacheColocatedDebugTest.java | 4 +-
.../dht/GridCacheDhtEntrySelfTest.java | 4 +-
...GridCacheDhtEvictionNearReadersSelfTest.java | 13 +-
.../dht/GridCacheDhtEvictionSelfTest.java | 13 +-
.../dht/GridCacheDhtInternalEntrySelfTest.java | 4 +-
.../dht/GridCacheDhtPreloadBigDataSelfTest.java | 4 +-
.../dht/GridCacheDhtPreloadDelayedSelfTest.java | 4 +-
.../GridCacheDhtPreloadDisabledSelfTest.java | 4 +-
.../GridCacheDhtPreloadMessageCountTest.java | 4 +-
...ridCacheDhtPreloadMultiThreadedSelfTest.java | 4 +-
.../dht/GridCacheDhtPreloadSelfTest.java | 4 +-
.../GridCacheDhtPreloadStartStopSelfTest.java | 4 +-
.../dht/GridCacheDhtPreloadUnloadSelfTest.java | 4 +-
.../distributed/dht/GridCacheDhtTestUtils.java | 6 +-
...dCachePartitionedTopologyChangeSelfTest.java | 7 +-
...ridCachePartitionedUnloadEventsSelfTest.java | 5 +-
...ffinityFunctionExcludeNeighborsSelfTest.java | 32 -
...AffinityExcludeNeighborsPerformanceTest.java | 4 +-
...rtitionedAffinityHashIdResolverSelfTest.java | 4 +-
.../GridCachePartitionedAffinitySelfTest.java | 226 ------
.../GridCachePartitionedFullApiSelfTest.java | 11 +-
.../GridCachePartitionedNodeRestartTest.java | 4 +-
...ePartitionedOptimisticTxNodeRestartTest.java | 4 +-
.../GridCachePartitionedTxSalvageSelfTest.java | 4 +-
...cheSynchronousEvictionsFailoverSelfTest.java | 4 +-
...ridCacheContinuousQueryAbstractSelfTest.java | 4 +-
...idOffHeapPartitionedMapAbstractSelfTest.java | 4 +-
...apPartitionedMapPerformanceAbstractTest.java | 4 +-
...GridUnsafePartitionedMapPerformanceTest.java | 4 +-
.../capacity/spring-capacity-cache.xml | 2 +-
.../loadtests/colocation/spring-colocation.xml | 2 +-
.../GridCachePartitionedAtomicLongLoadTest.java | 4 +-
...apPartitionedMapPerformanceAbstractTest.java | 4 +-
...GridUnsafePartitionedMapPerformanceTest.java | 4 +-
.../ignite/testframework/GridTestUtils.java | 11 +-
.../ignite/testsuites/IgniteBasicTestSuite.java | 1 -
.../ignite/testsuites/IgniteCacheTestSuite.java | 1 -
.../hibernate/HibernateL2CacheSelfTest.java | 8 +-
.../processors/cache/GridCacheSwapSelfTest.java | 12 +-
73 files changed, 160 insertions(+), 1852 deletions(-)
----------------------------------------------------------------------
[36/50] incubator-ignite git commit: #ignite-237: remove old
GridCacheAttributes.
Posted by sb...@apache.org.
#ignite-237: remove old GridCacheAttributes.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/936b8792
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/936b8792
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/936b8792
Branch: refs/heads/sprint-2
Commit: 936b8792b9bd6839c7620f8f1021dcd82952aef4
Parents: 0d70de8
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 18:31:48 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 18:31:48 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheAttributes.java | 24 --------------------
.../processors/cache/GridCacheProcessor.java | 8 -------
2 files changed, 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/936b8792/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
index 8ecd84c..94ae1fa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
@@ -119,12 +119,6 @@ public class GridCacheAttributes implements Externalizable {
private int affKeyBackups = -1;
/** */
- private int affReplicas = -1;
-
- /** */
- private String affReplicaCntAttrName;
-
- /** */
private String affHashIdRslvrClsName;
/** */
@@ -294,13 +288,6 @@ public class GridCacheAttributes implements Externalizable {
}
/**
- * @return Affinity replicas.
- */
- public int affinityReplicas() {
- return affReplicas;
- }
-
- /**
* @return Affinity partitions count.
*/
public int affinityPartitionsCount() {
@@ -308,13 +295,6 @@ public class GridCacheAttributes implements Externalizable {
}
/**
- * @return Aff replicas count attr name.
- */
- public String affinityReplicaCountAttrName() {
- return affReplicaCntAttrName;
- }
-
- /**
* @return Affinity hash ID resolver class name.
*/
public String affinityHashIdResolverClassName() {
@@ -537,8 +517,6 @@ public class GridCacheAttributes implements Externalizable {
out.writeBoolean(affInclNeighbors);
out.writeInt(affKeyBackups);
out.writeInt(affPartsCnt);
- out.writeInt(affReplicas);
- U.writeString(out, affReplicaCntAttrName);
U.writeString(out, affHashIdRslvrClsName);
U.writeString(out, evictFilterClsName);
@@ -581,8 +559,6 @@ public class GridCacheAttributes implements Externalizable {
affInclNeighbors = in.readBoolean();
affKeyBackups = in.readInt();
affPartsCnt = in.readInt();
- affReplicas = in.readInt();
- affReplicaCntAttrName = U.readString(in);
affHashIdRslvrClsName = U.readString(in);
evictFilterClsName = U.readString(in);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/936b8792/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 f00a853..3e5e124 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
@@ -1186,14 +1186,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
"Affinity key backups", locAttr.affinityKeyBackups(),
rmtAttr.affinityKeyBackups(), true);
- CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "affinityReplicas",
- "Affinity replicas", locAttr.affinityReplicas(),
- rmtAttr.affinityReplicas(), true);
-
- CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "affinityReplicaCountAttrName",
- "Affinity replica count attribute name", locAttr.affinityReplicaCountAttrName(),
- rmtAttr.affinityReplicaCountAttrName(), true);
-
CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "cacheAffinity.hashIdResolver",
"Partitioned cache affinity hash ID resolver class",
locAttr.affinityHashIdResolverClassName(), rmtAttr.affinityHashIdResolverClassName(),
[06/50] incubator-ignite git commit: Merge branch 'ignite-237' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-237
Posted by sb...@apache.org.
Merge branch 'ignite-237' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-237
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/1ca603e7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1ca603e7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1ca603e7
Branch: refs/heads/sprint-2
Commit: 1ca603e71222a124d2254427328d3acfda5c79c1
Parents: 958e23b f27e9d2
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 11:36:48 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 11:36:48 2015 +0300
----------------------------------------------------------------------
.../hibernate/example-hibernate-L2-cache.xml | 2 +-
.../ComputeFibonacciContinuationExample.java | 8 +-
.../IgniteCountDownLatchExample.java | 3 +-
.../MessagingPingPongListenActorExample.java | 3 +-
.../examples/ScalarContinuationExample.scala | 11 +-
.../checkpoint/s3/S3CheckpointSpiSelfTest.java | 10 +-
.../internal/client/ClientStartNodeTask.java | 5 +-
.../processors/rest/RestProcessorTest.java | 8 +-
.../java/org/apache/ignite/IgniteCache.java | 69 +
.../java/org/apache/ignite/IgniteCluster.java | 3 +-
.../ignite/cache/IgniteEntryProcessor.java | 28 +
.../ignite/cluster/ClusterNodeLocalMap.java | 60 -
.../ignite/events/DiscoveryCustomEvent.java | 56 +
.../org/apache/ignite/events/EventType.java | 12 +
.../cluster/ClusterNodeLocalMapImpl.java | 27 +-
.../cluster/IgniteClusterAsyncImpl.java | 3 +-
.../internal/cluster/IgniteClusterImpl.java | 4 +-
.../discovery/GridDiscoveryManager.java | 78 +-
.../processors/cache/GridCacheSwapManager.java | 4 +-
.../processors/cache/GridCacheUtils.java | 4 +
.../processors/cache/IgniteCacheProxy.java | 63 +
.../query/GridCacheDistributedQueryManager.java | 4 +-
.../cache/query/GridCacheQueryManager.java | 2 +-
.../dataload/GridDataLoaderProcessor.java | 2 +-
.../datastructures/DataStructuresProcessor.java | 2 +-
.../processors/igfs/IgfsDataManager.java | 4 +-
.../internal/processors/igfs/IgfsImpl.java | 6 +-
.../processors/igfs/IgfsOutputStreamImpl.java | 4 +-
.../internal/processors/job/GridJobWorker.java | 2 +-
.../cache/GridCacheQueryCommandHandler.java | 7 +-
.../processors/task/GridTaskWorker.java | 4 +-
.../ignite/internal/util/IgniteUtils.java | 368 +---
.../apache/ignite/internal/util/typedef/X.java | 3 +-
.../VisorComputeToggleMonitoringTask.java | 4 +-
.../visor/node/VisorNodeDataCollectorJob.java | 4 +-
.../node/VisorNodeEventsCollectorTask.java | 3 +-
.../visor/query/VisorQueryCleanupTask.java | 4 +-
.../visor/query/VisorQueryNextPageTask.java | 6 +-
.../internal/visor/query/VisorQueryTask.java | 4 +-
.../internal/visor/util/VisorTaskUtils.java | 3 +-
.../optimized/optimized-classnames.properties | 2 +-
.../ignite/spi/IgniteSpiThreadFactory.java | 2 +-
.../ignite/spi/discovery/DiscoverySpi.java | 7 +
.../spi/discovery/DiscoverySpiListener.java | 11 +-
.../discovery/tcp/TcpClientDiscoverySpi.java | 7 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 56 +-
.../discovery/tcp/TcpDiscoverySpiAdapter.java | 3 +
.../TcpDiscoveryCustomEventMessage.java | 66 +
.../spi/swapspace/file/FileSwapSpaceSpi.java | 2 +-
.../internal/GridDiscoveryEventSelfTest.java | 43 +
.../internal/GridEventStorageSelfTest.java | 3 +-
.../GridJobMasterLeaveAwareSelfTest.java | 24 +-
.../internal/GridMultipleJobsSelfTest.java | 2 +-
.../ignite/internal/GridNodeLocalSelfTest.java | 4 +-
.../GridTaskContinuousMapperSelfTest.java | 3 +-
.../GridTaskExecutionContextSelfTest.java | 2 +-
.../GridCheckpointManagerAbstractSelfTest.java | 20 +-
.../cache/GridCacheAbstractFullApiSelfTest.java | 101 +-
.../GridCacheConcurrentTxMultiNodeTest.java | 13 +-
.../cache/GridCachePutAllFailoverSelfTest.java | 5 +-
.../cache/IgniteTxMultiNodeAbstractTest.java | 33 +-
...cheAtomicReferenceMultiNodeAbstractTest.java | 12 +-
.../GridCacheMultiNodeDataStructureTest.java | 3 +-
...dCacheSequenceMultiNodeAbstractSelfTest.java | 2 +-
...titionedAtomicSequenceMultiThreadedTest.java | 16 +-
...dCachePartitionedQueueEntryMoveSelfTest.java | 2 +-
.../GridCacheAbstractJobExecutionTest.java | 2 +-
.../distributed/GridCacheEventAbstractTest.java | 4 +-
...GridCacheDhtEvictionNearReadersSelfTest.java | 2 +-
.../dht/GridCacheDhtEvictionSelfTest.java | 11 +-
.../dht/GridCacheDhtInternalEntrySelfTest.java | 6 +-
.../dht/GridCacheDhtMultiBackupTest.java | 2 +-
.../GridCachePartitionedFullApiSelfTest.java | 6 -
...idCachePartitionedHitsAndMissesSelfTest.java | 3 +-
...ePartitionedMultiThreadedPutGetSelfTest.java | 2 +-
.../GridCacheRandomEvictionPolicySelfTest.java | 2 +-
.../IgniteCacheLoaderWriterAbstractTest.java | 47 +
...ridCacheContinuousQueryAbstractSelfTest.java | 1 -
.../closure/GridClosureProcessorSelfTest.java | 14 +-
.../processors/igfs/IgfsAbstractSelfTest.java | 5 +-
.../processors/igfs/IgfsProcessorSelfTest.java | 3 +-
.../streamer/GridStreamerEvictionSelfTest.java | 2 +-
.../streamer/GridStreamerSelfTest.java | 2 +-
.../cache/GridCacheDataStructuresLoadTest.java | 36 +-
.../loadtests/cache/GridCacheLoadTest.java | 6 +-
.../loadtests/cache/GridCacheSwapLoadTest.java | 5 +-
.../loadtests/colocation/GridTestMain.java | 3 +-
.../communication/GridIoManagerBenchmark.java | 3 +-
.../GridMultiSplitsRedeployLoadTest.java | 5 +-
.../loadtests/discovery/GridGcTimeoutTest.java | 3 +-
.../ignite/loadtests/dsi/GridDsiPerfJob.java | 16 +-
.../job/GridJobExecutionSingleNodeLoadTest.java | 2 +-
.../mapper/GridContinuousMapperLoadTest1.java | 3 +-
.../loadtests/mapper/GridNodeStartup.java | 3 +-
.../mergesort/GridMergeSortLoadTest.java | 3 +-
.../streamer/GridStreamerIndexLoadTest.java | 4 +-
.../swap/GridSwapEvictAllBenchmark.java | 3 +-
.../marshaller/GridMarshallerAbstractTest.java | 6 +-
...idSessionFutureWaitJobAttributeSelfTest.java | 3 +-
.../GridSessionSetTaskAttributeSelfTest.java | 3 +-
...GridSessionTaskWaitJobAttributeSelfTest.java | 3 +-
.../discovery/AbstractDiscoverySelfTest.java | 7 +-
.../roundrobin/GridRoundRobinTestUtils.java | 6 +-
.../index/GridStreamerIndexSelfTest.java | 17 +-
.../window/GridStreamerWindowSelfTest.java | 3 +-
.../cache/GridAbstractCacheStoreSelfTest.java | 3 +-
.../tests/p2p/GridP2PAwareTestUserResource.java | 5 +-
.../tests/p2p/GridTestMessageListener.java | 4 +-
.../internal/igfs/hadoop/IgfsHadoopWrapper.java | 2 +-
.../processors/hadoop/GridHadoopSetup.java | 3 +-
.../GridHadoopDefaultMapReducePlanner.java | 3 +-
.../taskexecutor/GridHadoopExecutorService.java | 2 +-
.../hadoop/v2/GridHadoopSplitWrapper.java | 3 +-
.../hadoop/GridHadoopGroupingTest.java | 10 +-
.../hadoop/GridHadoopJobTrackerSelfTest.java | 2 +-
.../hadoop/GridHadoopSortingTest.java | 9 +-
.../processors/hadoop/GridHadoopStartup.java | 2 +-
.../ignite/loadtests/igfs/IgfsNodeStartup.java | 3 +-
...idHibernateAbstractRegionAccessStrategy.java | 97 -
.../GridHibernateAccessStrategyAdapter.java | 369 ----
.../GridHibernateCollectionRegion.java | 99 -
.../hibernate/GridHibernateEntityRegion.java | 110 -
.../GridHibernateGeneralDataRegion.java | 69 -
.../hibernate/GridHibernateNaturalIdRegion.java | 98 -
.../GridHibernateNonStrictAccessStrategy.java | 220 --
.../GridHibernateQueryResultsRegion.java | 71 -
.../GridHibernateReadOnlyAccessStrategy.java | 106 -
.../GridHibernateReadWriteAccessStrategy.java | 282 ---
.../cache/hibernate/GridHibernateRegion.java | 101 -
.../hibernate/GridHibernateRegionFactory.java | 231 ---
.../GridHibernateTimestampsRegion.java | 40 -
...ridHibernateTransactionalAccessStrategy.java | 139 --
.../GridHibernateTransactionalDataRegion.java | 96 -
.../HibernateAbstractRegionAccessStrategy.java | 97 +
.../HibernateAccessStrategyAdapter.java | 369 ++++
.../hibernate/HibernateCollectionRegion.java | 99 +
.../cache/hibernate/HibernateEntityRegion.java | 110 +
.../hibernate/HibernateGeneralDataRegion.java | 69 +
.../hibernate/HibernateNaturalIdRegion.java | 98 +
.../HibernateNonStrictAccessStrategy.java | 220 ++
.../hibernate/HibernateQueryResultsRegion.java | 71 +
.../HibernateReadOnlyAccessStrategy.java | 106 +
.../HibernateReadWriteAccessStrategy.java | 282 +++
.../ignite/cache/hibernate/HibernateRegion.java | 101 +
.../cache/hibernate/HibernateRegionFactory.java | 231 +++
.../hibernate/HibernateTimestampsRegion.java | 40 +
.../HibernateTransactionalAccessStrategy.java | 139 ++
.../HibernateTransactionalDataRegion.java | 96 +
.../apache/ignite/cache/hibernate/package.html | 2 +-
...idHibernateL2CacheConfigurationSelfTest.java | 393 ----
.../hibernate/GridHibernateL2CacheSelfTest.java | 1923 -----------------
...idHibernateL2CacheTransactionalSelfTest.java | 135 --
.../HibernateL2CacheConfigurationSelfTest.java | 393 ++++
.../hibernate/HibernateL2CacheSelfTest.java | 1925 ++++++++++++++++++
.../HibernateL2CacheTransactionalSelfTest.java | 135 ++
.../testsuites/IgniteHibernateTestSuite.java | 6 +-
.../cache/GridCacheCrossCacheQuerySelfTest.java | 2 +-
.../GridCacheCrossCacheQuerySelfTestNewApi.java | 2 +-
.../p2p/GridP2PUserVersionChangeSelfTest.java | 4 +-
...gniteProjectionStartStopRestartSelfTest.java | 3 +-
160 files changed, 5463 insertions(+), 5365 deletions(-)
----------------------------------------------------------------------
[37/50] incubator-ignite git commit: #ignite-237: return to Visor
excludeNeighbors attribute.
Posted by sb...@apache.org.
#ignite-237: return to Visor excludeNeighbors attribute.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/414410be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/414410be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/414410be
Branch: refs/heads/sprint-2
Commit: 414410bea39a7d8bdc46b1b63c5f506ec96d653e
Parents: 936b879
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 18:34:08 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 18:34:08 2015 +0300
----------------------------------------------------------------------
.../visor/cache/VisorCacheAffinityConfiguration.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/414410be/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
index c43dc1c..47a2cf4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.visor.cache;
import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.jetbrains.annotations.*;
@@ -58,15 +59,19 @@ public class VisorCacheAffinityConfiguration implements Serializable {
public static VisorCacheAffinityConfiguration from(CacheConfiguration ccfg) {
CacheAffinityFunction aff = ccfg.getAffinity();
- Integer dfltReplicas = null;
Boolean excludeNeighbors = null;
+ if (aff instanceof CacheRendezvousAffinityFunction) {
+ CacheRendezvousAffinityFunction hashAffFunc = (CacheRendezvousAffinityFunction)aff;
+
+ excludeNeighbors = hashAffFunc.isExcludeNeighbors();
+ }
+
VisorCacheAffinityConfiguration cfg = new VisorCacheAffinityConfiguration();
cfg.function(compactClass(aff));
cfg.mapper(compactClass(ccfg.getAffinityMapper()));
cfg.partitionedBackups(ccfg.getBackups());
- cfg.defaultReplicas(dfltReplicas);
cfg.excludeNeighbors(excludeNeighbors);
return cfg;
[10/50] incubator-ignite git commit: #ignite-237: Change tests to new
affinity API.
Posted by sb...@apache.org.
#ignite-237: Change tests to new affinity API.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/399d2b9e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/399d2b9e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/399d2b9e
Branch: refs/heads/sprint-2
Commit: 399d2b9e803cb90825f2d5eced3252c65a407fa6
Parents: 50db6ef
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 15:16:52 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 15:16:52 2015 +0300
----------------------------------------------------------------------
.../near/GridCachePartitionedFullApiSelfTest.java | 6 +++---
.../org/apache/ignite/testframework/GridTestUtils.java | 11 +----------
2 files changed, 4 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/399d2b9e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java
index cfdc105..771650e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java
@@ -18,7 +18,7 @@
package org.apache.ignite.internal.processors.cache.distributed.near;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.rendezvous.*;
+import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*;
@@ -68,9 +68,9 @@ public class GridCachePartitionedFullApiSelfTest extends GridCacheAbstractFullAp
cache.put(key, i);
}
- CacheRendezvousAffinityFunction aff = (CacheRendezvousAffinityFunction)cache.configuration().getAffinity();
+ CacheAffinity aff = grid(0).affinity(cache.name());
- for (int i = 0 ; i < aff.getPartitions(); i++)
+ for (int i = 0 ; i < aff.partitions(); i++)
String.valueOf(cache.entrySet(i));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/399d2b9e/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java b/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
index 6841345..0449e48 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java
@@ -20,7 +20,6 @@ package org.apache.ignite.testframework;
import junit.framework.*;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.client.ssl.*;
@@ -876,14 +875,6 @@ public final class GridTestUtils {
}
/**
- * @param cache Cache.
- * @return Affinity.
- */
- static <K, V> CacheRendezvousAffinityFunction affinity(GridCache<K, V> cache) {
- return (CacheRendezvousAffinityFunction)cache.cache().configuration().getAffinity();
- }
-
- /**
* @param cacheName Cache name.
* @param backups Number of backups.
* @param log Logger.
@@ -900,7 +891,7 @@ public final class GridTestUtils {
while (true) {
boolean wait = false;
- for (int p = 0; p < affinity(cache).partitions(); p++) {
+ for (int p = 0; p < g.affinity(cacheName).partitions(); p++) {
Collection<ClusterNode> nodes = top.nodes(p, -1);
if (nodes.size() > backups + 1) {
[28/50] incubator-ignite git commit: #ignite-237: remove test
validating that client partitioned affinity and cache partitioned affinity
produce the same result
Posted by sb...@apache.org.
#ignite-237: remove test validating that client partitioned affinity and cache partitioned affinity produce the same result
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4d54c502
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4d54c502
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4d54c502
Branch: refs/heads/sprint-2
Commit: 4d54c502fcc48896fd2e4321f18ffa6ad1611656
Parents: 120711b
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 12:53:00 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 12:53:00 2015 +0300
----------------------------------------------------------------------
.../impl/ClientPartitionAffinitySelfTest.java | 66 --------------------
1 file changed, 66 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4d54c502/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
index 444a84c..dde345e 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
@@ -267,45 +267,6 @@ public class ClientPartitionAffinitySelfTest extends GridCommonAbstractTest {
}
/**
- * Validate client partitioned affinity and cache partitioned affinity produce the same result.
- *
- * @throws Exception On any exception.
- */
- public void testReplicas() throws Exception {
- // Emulate nodes in topology.
- Collection<GridClientNode> nodes = new ArrayList<>();
- Collection<ClusterNode> srvNodes = new ArrayList<>();
-
- // Define affinities to test.
- GridClientPartitionAffinity aff = new GridClientPartitionAffinity();
-
- getTestResources().inject(aff);
-
- aff.setHashIdResolver(HASH_ID_RSLVR);
-
- CacheRendezvousAffinityFunction srvAff = new CacheRendezvousAffinityFunction();
-
- getTestResources().inject(srvAff);
-
- srvAff.setHashIdResolver(new CacheAffinityNodeIdHashResolver());
-
- // Define keys to test affinity for.
- Collection<String> keys = new ArrayList<>(
- Arrays.asList("", "1", "12", "asdf", "Hadoop\u3092\u6bba\u3059"));
-
- for (int i = 0; i < 10; i++)
- keys.add(UUID.randomUUID().toString());
-
- // Test affinity behaviour on different topologies.
- for (int i = 0; i < 20; i++) {
- addNodes(1 + (int)Math.round(Math.random() * 50), nodes, srvNodes);
-
- for (String key : keys)
- assertSameAffinity(key, aff, srvAff, nodes, srvNodes);
- }
- }
-
- /**
* Add {@code cnt} nodes into emulated topology.
*
* @param cnt Number of nodes to add into emulated topology.
@@ -329,33 +290,6 @@ public class ClientPartitionAffinitySelfTest extends GridCommonAbstractTest {
}
/**
- * Compare server and client affinity for specified key in current topology.
- *
- * @param key Key to validate affinity for.
- * @param aff Client affinity.
- * @param srvAff Server affinity.
- * @param nodes Client topology.
- * @param srvNodes Server topology.
- */
- private void assertSameAffinity(Object key, GridClientDataAffinity aff, CacheAffinityFunction srvAff,
- Collection<? extends GridClientNode> nodes, Collection<ClusterNode> srvNodes) {
- GridClientNode node = aff.node(key, nodes);
- int part = srvAff.partition(key);
-
- CacheAffinityFunctionContext ctx = new GridCacheAffinityFunctionContextImpl(new ArrayList<>(srvNodes),
- null, null, 1, 0);
-
- ClusterNode srvNode = F.first(srvAff.assignPartitions(ctx).get(part));
-
- if (node == null)
- assertNull(srvNode);
- else {
- assertNotNull(srvNode);
- assertEquals(node.nodeId(), srvNode.id());
- }
- }
-
- /**
* Rich node stub to use in emulated server topology.
*/
private static class TestRichNode extends GridTestNode {
[45/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/sprint-2' into ignite-237
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-237
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6c67bdf2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6c67bdf2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6c67bdf2
Branch: refs/heads/sprint-2
Commit: 6c67bdf27f962aee64414c90965e8a86a1cc907d
Parents: 6deba53 c9f46c1
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Mar 2 11:45:01 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Mar 2 11:45:01 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/util/IgniteUtils.java | 90 ++++++++++--
.../spi/discovery/tcp/TcpDiscoverySpi.java | 137 +++++++++++--------
.../discovery/tcp/TcpDiscoverySpiAdapter.java | 116 ++++++++++++++++
3 files changed, 275 insertions(+), 68 deletions(-)
----------------------------------------------------------------------
[26/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/sprint-2' into ignite-237
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-237
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/31180aa1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/31180aa1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/31180aa1
Branch: refs/heads/sprint-2
Commit: 31180aa1760aa2500393e5fb284c28b4289330e4
Parents: eb14f3b 9e1377f
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 18:42:30 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 18:42:30 2015 +0300
----------------------------------------------------------------------
.../main/java/org/apache/ignite/IgniteFs.java | 2 +-
.../ignite/events/DiscoveryCustomEvent.java | 56 ----------
.../org/apache/ignite/events/EventType.java | 14 +--
.../java/org/apache/ignite/igfs/package.html | 2 +-
.../internal/events/DiscoveryCustomEvent.java | 68 ++++++++++++
.../discovery/GridDiscoveryManager.java | 7 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 9 +-
.../internal/GridDiscoveryEventSelfTest.java | 9 +-
...dStartupWithUndefinedIgniteHomeSelfTest.java | 103 +++++++++++++++++++
.../testsuites/IgniteKernalSelfTestSuite.java | 1 +
.../java/org/apache/ignite/igfs/package.html | 2 +-
.../testsuites/IgniteHadoopTestSuite.java | 7 +-
12 files changed, 199 insertions(+), 81 deletions(-)
----------------------------------------------------------------------
[18/50] incubator-ignite git commit: #ignite-237: change affinity
function in tests.
Posted by sb...@apache.org.
#ignite-237: change affinity function in tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/13d06271
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/13d06271
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/13d06271
Branch: refs/heads/sprint-2
Commit: 13d0627183b6b65a8696a9f3b45765c3489480eb
Parents: d998925
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 16:12:28 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 16:12:28 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/13d06271/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
index 4cfeaff..6091338 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
@@ -57,7 +57,6 @@ public class IgniteBasicTestSuite extends TestSuite {
suite.addTestSuite(GridReleaseTypeSelfTest.class);
suite.addTestSuite(GridProductVersionSelfTest.class);
- suite.addTestSuite(GridAffinityProcessorConsistentHashSelfTest.class);
suite.addTestSuite(GridAffinityProcessorRendezvousSelfTest.class);
suite.addTestSuite(GridClosureProcessorSelfTest.class);
suite.addTestSuite(GridStartStopSelfTest.class);
[41/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/sprint-2' into ignite-237
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-237
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/10ac88a7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/10ac88a7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/10ac88a7
Branch: refs/heads/sprint-2
Commit: 10ac88a701618249f4e23ecb467fe0099c034a4e
Parents: 8e58738 a792c99
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 20:03:24 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 20:03:24 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/internal/GridProperties.java | 78 -------------------
.../ignite/internal/GridUpdateNotifier.java | 2 +-
.../apache/ignite/internal/IgniteKernal.java | 18 ++---
.../ignite/internal/IgniteProperties.java | 79 ++++++++++++++++++++
.../ignite/internal/IgniteVersionUtils.java | 8 +-
.../plugin/IgnitePluginProcessor.java | 24 ++++++
.../apache/ignite/plugin/PluginProvider.java | 5 ++
.../internal/GridUpdateNotifierSelfTest.java | 2 +-
8 files changed, 123 insertions(+), 93 deletions(-)
----------------------------------------------------------------------
[35/50] incubator-ignite git commit: Merge branches 'ignite-237' and
'sprint-2' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into
ignite-237
Posted by sb...@apache.org.
Merge branches 'ignite-237' and 'sprint-2' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-237
Conflicts:
modules/core/src/main/java/org/apache/ignite/marshaller/optimized/optimized-classnames.properties
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0d70de86
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0d70de86
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0d70de86
Branch: refs/heads/sprint-2
Commit: 0d70de861e9f9beb8bc237ce81909efccd18866c
Parents: e50d1ea f053746
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 18:28:17 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 18:28:17 2015 +0300
----------------------------------------------------------------------
config/ignite-log4j.xml | 2 +-
.../datagrid/CacheContinuousQueryExample.java | 2 +-
ipc/shmem/Makefile.am | 15 +
ipc/shmem/igniteshmem/Makefile.am | 15 +
ipc/shmem/include/Makefile.am | 15 +
modules/clients/src/test/keystore/generate.sh | 15 +-
.../ignite/cache/query/ContinuousQuery.java | 18 +-
.../apache/ignite/cluster/ClusterMetrics.java | 2 +-
.../internal/events/DiscoveryCustomEvent.java | 3 +
.../processors/cache/IgniteCacheProxy.java | 6 +-
.../optimized-classnames.previous.properties | 15 +
.../optimized/optimized-classnames.properties | 1565 +-----------------
.../TcpDiscoveryCustomEventMessage.java | 3 +
...ridCacheContinuousQueryAbstractSelfTest.java | 8 +-
modules/extdata/p2p/pom.xml | 6 -
modules/hibernate/pom.xml | 6 -
.../HibernateReadWriteAccessStrategy.java | 81 +-
modules/indexing/pom.xml | 6 -
modules/jta/pom.xml | 6 -
modules/scalar/pom.xml | 6 -
modules/spring/pom.xml | 6 -
modules/visor-console/pom.xml | 7 -
modules/web/pom.xml | 6 -
modules/winservice/IgniteService.sln | 2 +-
.../IgniteService/IgniteService.csproj | 2 +-
.../config/benchmark-atomic-win.properties | 15 +
.../config/benchmark-atomic.properties | 15 +
.../config/benchmark-compute-win.properties | 15 +
.../config/benchmark-compute.properties | 15 +
.../config/benchmark-multicast.properties | 15 +
.../config/benchmark-query-win.properties | 15 +
.../yardstick/config/benchmark-query.properties | 15 +
.../config/benchmark-tx-win.properties | 15 +
.../yardstick/config/benchmark-tx.properties | 15 +
.../yardstick/config/benchmark-win.properties | 15 +
modules/yardstick/config/benchmark.properties | 15 +
pom.xml | 150 +-
37 files changed, 421 insertions(+), 1712 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d70de86/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
----------------------------------------------------------------------
[02/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/sprint-2' into ignite-237
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-237
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/972644d3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/972644d3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/972644d3
Branch: refs/heads/sprint-2
Commit: 972644d327d7065e699424e0c9b0edb82154d6fd
Parents: 7c2443f e09b037
Author: sboikov <sb...@gridgain.com>
Authored: Thu Feb 26 09:06:43 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Feb 26 09:06:43 2015 +0300
----------------------------------------------------------------------
.../hibernate/example-hibernate-L2-cache.xml | 2 +-
.../ComputeFibonacciContinuationExample.java | 8 +-
.../IgniteCountDownLatchExample.java | 3 +-
.../MessagingPingPongListenActorExample.java | 3 +-
.../examples/ScalarContinuationExample.scala | 11 +-
.../checkpoint/s3/S3CheckpointSpiSelfTest.java | 10 +-
.../internal/client/ClientStartNodeTask.java | 5 +-
.../processors/rest/RestProcessorTest.java | 8 +-
.../java/org/apache/ignite/IgniteCache.java | 69 +
.../java/org/apache/ignite/IgniteCluster.java | 3 +-
.../ignite/cache/IgniteEntryProcessor.java | 28 +
.../ignite/cluster/ClusterNodeLocalMap.java | 60 -
.../ignite/events/DiscoveryCustomEvent.java | 56 +
.../org/apache/ignite/events/EventType.java | 12 +
.../cluster/ClusterNodeLocalMapImpl.java | 27 +-
.../cluster/IgniteClusterAsyncImpl.java | 3 +-
.../internal/cluster/IgniteClusterImpl.java | 4 +-
.../discovery/GridDiscoveryManager.java | 78 +-
.../processors/cache/GridCacheSwapManager.java | 4 +-
.../processors/cache/GridCacheUtils.java | 4 +
.../processors/cache/IgniteCacheProxy.java | 63 +
.../query/GridCacheDistributedQueryManager.java | 4 +-
.../cache/query/GridCacheQueryManager.java | 2 +-
.../dataload/GridDataLoaderProcessor.java | 2 +-
.../datastructures/DataStructuresProcessor.java | 2 +-
.../processors/igfs/IgfsDataManager.java | 4 +-
.../internal/processors/igfs/IgfsImpl.java | 6 +-
.../processors/igfs/IgfsOutputStreamImpl.java | 4 +-
.../internal/processors/job/GridJobWorker.java | 2 +-
.../cache/GridCacheQueryCommandHandler.java | 7 +-
.../processors/task/GridTaskWorker.java | 4 +-
.../ignite/internal/util/IgniteUtils.java | 368 +---
.../apache/ignite/internal/util/typedef/X.java | 3 +-
.../VisorComputeToggleMonitoringTask.java | 4 +-
.../visor/node/VisorNodeDataCollectorJob.java | 4 +-
.../node/VisorNodeEventsCollectorTask.java | 3 +-
.../visor/query/VisorQueryCleanupTask.java | 4 +-
.../visor/query/VisorQueryNextPageTask.java | 6 +-
.../internal/visor/query/VisorQueryTask.java | 4 +-
.../internal/visor/util/VisorTaskUtils.java | 3 +-
.../optimized/optimized-classnames.properties | 2 +-
.../ignite/spi/IgniteSpiThreadFactory.java | 2 +-
.../ignite/spi/discovery/DiscoverySpi.java | 7 +
.../spi/discovery/DiscoverySpiListener.java | 11 +-
.../discovery/tcp/TcpClientDiscoverySpi.java | 7 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 56 +-
.../discovery/tcp/TcpDiscoverySpiAdapter.java | 3 +
.../TcpDiscoveryCustomEventMessage.java | 66 +
.../spi/swapspace/file/FileSwapSpaceSpi.java | 2 +-
.../internal/GridDiscoveryEventSelfTest.java | 43 +
.../internal/GridEventStorageSelfTest.java | 3 +-
.../GridJobMasterLeaveAwareSelfTest.java | 24 +-
.../internal/GridMultipleJobsSelfTest.java | 2 +-
.../ignite/internal/GridNodeLocalSelfTest.java | 4 +-
.../GridTaskContinuousMapperSelfTest.java | 3 +-
.../GridTaskExecutionContextSelfTest.java | 2 +-
.../GridCheckpointManagerAbstractSelfTest.java | 20 +-
.../cache/GridCacheAbstractFullApiSelfTest.java | 101 +-
.../GridCacheConcurrentTxMultiNodeTest.java | 13 +-
.../cache/GridCachePutAllFailoverSelfTest.java | 5 +-
.../cache/IgniteTxMultiNodeAbstractTest.java | 33 +-
...cheAtomicReferenceMultiNodeAbstractTest.java | 12 +-
.../GridCacheMultiNodeDataStructureTest.java | 3 +-
...dCacheSequenceMultiNodeAbstractSelfTest.java | 2 +-
...titionedAtomicSequenceMultiThreadedTest.java | 16 +-
...dCachePartitionedQueueEntryMoveSelfTest.java | 2 +-
.../GridCacheAbstractJobExecutionTest.java | 2 +-
.../distributed/GridCacheEventAbstractTest.java | 4 +-
.../dht/GridCacheDhtInternalEntrySelfTest.java | 6 +-
.../dht/GridCacheDhtMultiBackupTest.java | 2 +-
...idCachePartitionedHitsAndMissesSelfTest.java | 3 +-
...ePartitionedMultiThreadedPutGetSelfTest.java | 2 +-
.../GridCacheRandomEvictionPolicySelfTest.java | 2 +-
.../IgniteCacheLoaderWriterAbstractTest.java | 47 +
.../closure/GridClosureProcessorSelfTest.java | 14 +-
.../processors/igfs/IgfsAbstractSelfTest.java | 5 +-
.../processors/igfs/IgfsProcessorSelfTest.java | 3 +-
.../streamer/GridStreamerEvictionSelfTest.java | 2 +-
.../streamer/GridStreamerSelfTest.java | 2 +-
.../cache/GridCacheDataStructuresLoadTest.java | 36 +-
.../loadtests/cache/GridCacheLoadTest.java | 6 +-
.../loadtests/cache/GridCacheSwapLoadTest.java | 5 +-
.../loadtests/colocation/GridTestMain.java | 3 +-
.../communication/GridIoManagerBenchmark.java | 3 +-
.../GridMultiSplitsRedeployLoadTest.java | 5 +-
.../loadtests/discovery/GridGcTimeoutTest.java | 3 +-
.../ignite/loadtests/dsi/GridDsiPerfJob.java | 16 +-
.../job/GridJobExecutionSingleNodeLoadTest.java | 2 +-
.../mapper/GridContinuousMapperLoadTest1.java | 3 +-
.../loadtests/mapper/GridNodeStartup.java | 3 +-
.../mergesort/GridMergeSortLoadTest.java | 3 +-
.../streamer/GridStreamerIndexLoadTest.java | 4 +-
.../swap/GridSwapEvictAllBenchmark.java | 3 +-
.../marshaller/GridMarshallerAbstractTest.java | 6 +-
...idSessionFutureWaitJobAttributeSelfTest.java | 3 +-
.../GridSessionSetTaskAttributeSelfTest.java | 3 +-
...GridSessionTaskWaitJobAttributeSelfTest.java | 3 +-
.../discovery/AbstractDiscoverySelfTest.java | 7 +-
.../roundrobin/GridRoundRobinTestUtils.java | 6 +-
.../index/GridStreamerIndexSelfTest.java | 17 +-
.../window/GridStreamerWindowSelfTest.java | 3 +-
.../cache/GridAbstractCacheStoreSelfTest.java | 3 +-
.../tests/p2p/GridP2PAwareTestUserResource.java | 5 +-
.../tests/p2p/GridTestMessageListener.java | 4 +-
.../internal/igfs/hadoop/IgfsHadoopWrapper.java | 2 +-
.../processors/hadoop/GridHadoopSetup.java | 3 +-
.../GridHadoopDefaultMapReducePlanner.java | 3 +-
.../taskexecutor/GridHadoopExecutorService.java | 2 +-
.../hadoop/v2/GridHadoopSplitWrapper.java | 3 +-
.../hadoop/GridHadoopGroupingTest.java | 10 +-
.../hadoop/GridHadoopJobTrackerSelfTest.java | 2 +-
.../hadoop/GridHadoopSortingTest.java | 9 +-
.../processors/hadoop/GridHadoopStartup.java | 2 +-
.../ignite/loadtests/igfs/IgfsNodeStartup.java | 3 +-
...idHibernateAbstractRegionAccessStrategy.java | 97 -
.../GridHibernateAccessStrategyAdapter.java | 369 ----
.../GridHibernateCollectionRegion.java | 99 -
.../hibernate/GridHibernateEntityRegion.java | 110 -
.../GridHibernateGeneralDataRegion.java | 69 -
.../hibernate/GridHibernateNaturalIdRegion.java | 98 -
.../GridHibernateNonStrictAccessStrategy.java | 220 --
.../GridHibernateQueryResultsRegion.java | 71 -
.../GridHibernateReadOnlyAccessStrategy.java | 106 -
.../GridHibernateReadWriteAccessStrategy.java | 282 ---
.../cache/hibernate/GridHibernateRegion.java | 101 -
.../hibernate/GridHibernateRegionFactory.java | 231 ---
.../GridHibernateTimestampsRegion.java | 40 -
...ridHibernateTransactionalAccessStrategy.java | 139 --
.../GridHibernateTransactionalDataRegion.java | 96 -
.../HibernateAbstractRegionAccessStrategy.java | 97 +
.../HibernateAccessStrategyAdapter.java | 369 ++++
.../hibernate/HibernateCollectionRegion.java | 99 +
.../cache/hibernate/HibernateEntityRegion.java | 110 +
.../hibernate/HibernateGeneralDataRegion.java | 69 +
.../hibernate/HibernateNaturalIdRegion.java | 98 +
.../HibernateNonStrictAccessStrategy.java | 220 ++
.../hibernate/HibernateQueryResultsRegion.java | 71 +
.../HibernateReadOnlyAccessStrategy.java | 106 +
.../HibernateReadWriteAccessStrategy.java | 282 +++
.../ignite/cache/hibernate/HibernateRegion.java | 101 +
.../cache/hibernate/HibernateRegionFactory.java | 231 +++
.../hibernate/HibernateTimestampsRegion.java | 40 +
.../HibernateTransactionalAccessStrategy.java | 139 ++
.../HibernateTransactionalDataRegion.java | 96 +
.../apache/ignite/cache/hibernate/package.html | 2 +-
...idHibernateL2CacheConfigurationSelfTest.java | 393 ----
.../hibernate/GridHibernateL2CacheSelfTest.java | 1923 -----------------
...idHibernateL2CacheTransactionalSelfTest.java | 135 --
.../HibernateL2CacheConfigurationSelfTest.java | 393 ++++
.../hibernate/HibernateL2CacheSelfTest.java | 1925 ++++++++++++++++++
.../HibernateL2CacheTransactionalSelfTest.java | 135 ++
.../testsuites/IgniteHibernateTestSuite.java | 6 +-
.../cache/GridCacheCrossCacheQuerySelfTest.java | 2 +-
.../GridCacheCrossCacheQuerySelfTestNewApi.java | 2 +-
.../p2p/GridP2PUserVersionChangeSelfTest.java | 4 +-
...gniteProjectionStartStopRestartSelfTest.java | 3 +-
156 files changed, 5456 insertions(+), 5352 deletions(-)
----------------------------------------------------------------------
[19/50] incubator-ignite git commit: #ignite-237: change affinity
function in tests.
Posted by sb...@apache.org.
#ignite-237: change affinity function in tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/262aba54
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/262aba54
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/262aba54
Branch: refs/heads/sprint-2
Commit: 262aba541504dde165aab6e0c7456879a42bcb22
Parents: 13d0627
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 16:15:58 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 16:15:58 2015 +0300
----------------------------------------------------------------------
...idCacheConfigurationConsistencySelfTest.java | 46 ++++++--------------
...ridCacheConfigurationValidationSelfTest.java | 8 ++--
2 files changed, 17 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/262aba54/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
index 3bd42dc..311c36f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationConsistencySelfTest.java
@@ -20,8 +20,8 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.fair.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cache.eviction.*;
import org.apache.ignite.cache.eviction.fifo.*;
import org.apache.ignite.cache.eviction.lru.*;
@@ -308,14 +308,14 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
new C1<CacheConfiguration, Void>() {
/** {@inheritDoc} */
@Override public Void apply(CacheConfiguration cfg) {
- cfg.setAffinity(new CacheConsistentHashAffinityFunction() {/*No-op.*/});
+ cfg.setAffinity(new CacheRendezvousAffinityFunction() {/*No-op.*/});
return null;
}
},
new C1<CacheConfiguration, Void>() {
/** {@inheritDoc} */
@Override public Void apply(CacheConfiguration cfg) {
- cfg.setAffinity(new CacheConsistentHashAffinityFunction());
+ cfg.setAffinity(new CacheRendezvousAffinityFunction());
return null;
}
}
@@ -573,13 +573,13 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
backups = 1;
- aff = new CacheConsistentHashAffinityFunction(false, 100);
+ aff = new CacheRendezvousAffinityFunction(false, 100);
startGrid(1);
// 2nd grid with another affinity.
// Check include neighbors.
- aff = new CacheConsistentHashAffinityFunction(true, 100);
+ aff = new CacheRendezvousAffinityFunction(true, 100);
GridTestUtils.assertThrows(log, new Callable<Object>() {
@Override public Object call() throws Exception {
@@ -590,7 +590,7 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
backups = 2;
// Check backups.
- aff = new CacheConsistentHashAffinityFunction(false, 100);
+ aff = new CacheRendezvousAffinityFunction(false, 100);
GridTestUtils.assertThrows(log, new Callable<Object>() {
@Override public Object call() throws Exception {
@@ -601,7 +601,7 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
backups = 1;
// Partitions count.
- aff = new CacheConsistentHashAffinityFunction(false, 1000);
+ aff = new CacheRendezvousAffinityFunction(false, 1000);
GridTestUtils.assertThrows(log, new Callable<Object>() {
@Override public Object call() throws Exception {
@@ -609,28 +609,8 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
}
}, IgniteCheckedException.class, "Affinity partitions count mismatch");
- // Replicas count.
- aff = new CacheConsistentHashAffinityFunction(false, 100);
- ((CacheConsistentHashAffinityFunction)aff).setDefaultReplicas(1024);
-
- GridTestUtils.assertThrows(log, new Callable<Object>() {
- @Override public Object call() throws Exception {
- return startGrid(2);
- }
- }, IgniteCheckedException.class, "Affinity replicas mismatch");
-
- // Replicas count attribute name.
- aff = new CacheConsistentHashAffinityFunction(false, 100);
- ((CacheConsistentHashAffinityFunction)aff).setReplicaCountAttributeName("attr_name");
-
- GridTestUtils.assertThrows(log, new Callable<Object>() {
- @Override public Object call() throws Exception {
- return startGrid(2);
- }
- }, IgniteCheckedException.class, "Affinity replica count attribute name mismatch");
-
// Different hash ID resolver.
- CacheConsistentHashAffinityFunction aff0 = new CacheConsistentHashAffinityFunction(false, 100);
+ CacheRendezvousAffinityFunction aff0 = new CacheRendezvousAffinityFunction(false, 100);
aff0.setHashIdResolver(new CacheAffinityNodeIdHashResolver());
@@ -725,7 +705,7 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public Void apply(CacheConfiguration cfg) {
- cfg.setAffinity(new CacheConsistentHashAffinityFunction() {/*No-op.*/});
+ cfg.setAffinity(new CacheRendezvousAffinityFunction() {/*No-op.*/});
cfg.setEvictionPolicy(new CacheFifoEvictionPolicy());
@@ -743,7 +723,7 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
initCache = new C1<CacheConfiguration, Void>() {
/** {@inheritDoc} */
@Override public Void apply(CacheConfiguration cfg) {
- cfg.setAffinity(new CacheConsistentHashAffinityFunction());
+ cfg.setAffinity(new CacheRendezvousAffinityFunction());
cfg.setEvictionPolicy(new CacheLruEvictionPolicy());
@@ -948,7 +928,7 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
}
}, IgniteCheckedException.class, null);
- aff = new CacheConsistentHashAffinityFunction(true); // Check cannot set 'excludeNeighbors' flag.
+ aff = new CacheRendezvousAffinityFunction(true); // Check cannot set 'excludeNeighbors' flag.
backups = Integer.MAX_VALUE;
GridTestUtils.assertThrows(log, new Callable<Object>() {
@@ -957,12 +937,12 @@ public class GridCacheConfigurationConsistencySelfTest extends GridCommonAbstrac
}
}, IgniteCheckedException.class, null);
- aff = new CacheConsistentHashAffinityFunction(false, 100);
+ aff = new CacheRendezvousAffinityFunction(false, 100);
startGrid(1);
// Try to start node with different number of partitions.
- aff = new CacheConsistentHashAffinityFunction(false, 200);
+ aff = new CacheRendezvousAffinityFunction(false, 200);
GridTestUtils.assertThrows(log, new Callable<Object>() {
@Override public Object call() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/262aba54/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationValidationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationValidationSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationValidationSelfTest.java
index 8e5474a..325d346 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationValidationSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConfigurationValidationSelfTest.java
@@ -17,7 +17,7 @@
package org.apache.ignite.internal.processors.cache;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -83,7 +83,7 @@ public class GridCacheConfigurationValidationSelfTest extends GridCommonAbstract
dfltCacheCfg.setCacheMode(PARTITIONED);
dfltCacheCfg.setPreloadMode(ASYNC);
dfltCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
- dfltCacheCfg.setAffinity(new CacheConsistentHashAffinityFunction());
+ dfltCacheCfg.setAffinity(new CacheRendezvousAffinityFunction());
// Non-default cache configuration.
CacheConfiguration namedCacheCfg = defaultCacheConfiguration();
@@ -92,7 +92,7 @@ public class GridCacheConfigurationValidationSelfTest extends GridCommonAbstract
namedCacheCfg.setPreloadMode(ASYNC);
namedCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
namedCacheCfg.setName(NON_DFLT_CACHE_NAME);
- namedCacheCfg.setAffinity(new CacheConsistentHashAffinityFunction());
+ namedCacheCfg.setAffinity(new CacheRendezvousAffinityFunction());
// Modify cache config according to test parameters.
if (gridName.contains(WRONG_PRELOAD_MODE_GRID_NAME))
@@ -100,7 +100,7 @@ public class GridCacheConfigurationValidationSelfTest extends GridCommonAbstract
else if (gridName.contains(WRONG_CACHE_MODE_GRID_NAME))
dfltCacheCfg.setCacheMode(REPLICATED);
else if (gridName.contains(WRONG_AFFINITY_GRID_NAME)) {
- dfltCacheCfg.setAffinity(new CacheConsistentHashAffinityFunction() {
+ dfltCacheCfg.setAffinity(new CacheRendezvousAffinityFunction() {
// No-op. Just to have another class name.
});
}
[27/50] incubator-ignite git commit: #ignite-237: fix
ClientAbstractMultiThreadedSelfTest.
Posted by sb...@apache.org.
#ignite-237: fix ClientAbstractMultiThreadedSelfTest.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/120711b2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/120711b2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/120711b2
Branch: refs/heads/sprint-2
Commit: 120711b2f8e81634f11b762d3c8f7f0f8aafd18c
Parents: 31180aa
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 12:51:07 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 12:51:07 2015 +0300
----------------------------------------------------------------------
.../ClientAbstractMultiThreadedSelfTest.java | 34 +++-----------------
1 file changed, 5 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/120711b2/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java
index 4ab2679..079b3ec 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java
@@ -426,19 +426,6 @@ public abstract class ClientAbstractMultiThreadedSelfTest extends GridCommonAbst
String key = String.valueOf(rawKey);
UUID nodeId = cache.affinity(key);
- UUID srvNodeId = ignite.cluster().mapKeyToNode(PARTITIONED_CACHE_NAME, key).id();
-
- if (!nodeId.equals(srvNodeId)) {
- //GridClientDataAffinity clAff =
- // ((GridClientConfiguration)getFieldValue(client, "cfg")).
- // getDataConfiguration(PARTITIONED_CACHE_NAME).getAffinity();
-
- //printAffinityState(gridMap.values());
- //info("Client affinity: " + clAff);
-
- info("Got wrong client mapping [key=" + key + ", exp=" + srvNodeId +
- ", actual=" + nodeId + "]");
- }
String val = "val" + rawKey;
@@ -475,25 +462,14 @@ public abstract class ClientAbstractMultiThreadedSelfTest extends GridCommonAbst
puts.get(key).get2(), gridMap.get(node.id()).jcache(PARTITIONED_CACHE_NAME).localPeek(key, CachePeekMode.ONHEAP));
}
- // Assert that client has properly determined affinity node.
- if (!node.id().equals(puts.get(key).get1())) {
- //GridClientDataAffinity clAff =
- // ((GridClientConfiguration)getFieldValue(client, "cfg")).
- // getDataConfiguration(PARTITIONED_CACHE_NAME).getAffinity();
- //printAffinityState(gridMap.values());
- //info("Client affinity: " + clAff);
-
- UUID curAffNode = client.data(PARTITIONED_CACHE_NAME).affinity(key);
-
- failNotEquals(
- "Got different mappings [key=" + key + ", currId=" + curAffNode + "]",
- node.id(), puts.get(key).get1());
- }
+ UUID curAffNode = client.data(PARTITIONED_CACHE_NAME).affinity(key);
// Check that no other nodes see this key.
- for (UUID id : F.view(gridMap.keySet(), F.notEqualTo(node.id())))
- assertNull("Got value in near cache.", gridMap.get(id).jcache(PARTITIONED_CACHE_NAME).localPeek(key, CachePeekMode.ONHEAP));
+ for (UUID id : gridMap.keySet()) {
+ if (!id.equals(curAffNode) && !id.equals(node.id()))
+ assertNull("Got value in near cache.", gridMap.get(id).jcache(PARTITIONED_CACHE_NAME).localPeek(key, CachePeekMode.ONHEAP));
+ }
}
for (Ignite g : gridMap.values())
[11/50] incubator-ignite git commit: #ignite-237: remove
GridAffinityProcessorConsistentHashSelfTest.
Posted by sb...@apache.org.
#ignite-237: remove GridAffinityProcessorConsistentHashSelfTest.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/02d46d7b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/02d46d7b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/02d46d7b
Branch: refs/heads/sprint-2
Commit: 02d46d7bcae3d1576cbcdf43413118c4dd9f1056
Parents: 399d2b9
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 15:48:54 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 15:48:54 2015 +0300
----------------------------------------------------------------------
...AffinityProcessorConsistentHashSelfTest.java | 31 --------------------
1 file changed, 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/02d46d7b/modules/core/src/test/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessorConsistentHashSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessorConsistentHashSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessorConsistentHashSelfTest.java
deleted file mode 100644
index f1a2cde..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessorConsistentHashSelfTest.java
+++ /dev/null
@@ -1,31 +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.
- */
-
-package org.apache.ignite.internal.processors.affinity;
-
-import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
-
-/**
- * Tests consistent hash affinity function.
- */
-public class GridAffinityProcessorConsistentHashSelfTest extends GridAffinityProcessorAbstractSelfTest {
- /** {@inheritDoc} */
- @Override protected CacheAffinityFunction affinityFunction() {
- return new CacheConsistentHashAffinityFunction();
- }
-}
[15/50] incubator-ignite git commit: #ignite-237: change affinity
function in GridUnsafePartitionedMapPerformanceTest.
Posted by sb...@apache.org.
#ignite-237: change affinity function in GridUnsafePartitionedMapPerformanceTest.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7d8b54f8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7d8b54f8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7d8b54f8
Branch: refs/heads/sprint-2
Commit: 7d8b54f868fa34d9dbc82c46e759a5a9b32a01e0
Parents: df3c76e
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 15:55:07 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 15:55:07 2015 +0300
----------------------------------------------------------------------
.../offheap/unsafe/GridUnsafePartitionedMapPerformanceTest.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d8b54f8/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMapPerformanceTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMapPerformanceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMapPerformanceTest.java
index 5760b79..2385526 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMapPerformanceTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMapPerformanceTest.java
@@ -17,7 +17,7 @@
package org.apache.ignite.internal.util.offheap.unsafe;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.internal.util.offheap.*;
/**
@@ -26,7 +26,7 @@ import org.apache.ignite.internal.util.offheap.*;
public class GridUnsafePartitionedMapPerformanceTest extends GridOffHeapPartitionedMapPerformanceAbstractTest {
/** {@inheritDoc} */
@Override protected GridOffHeapPartitionedMap newMap() {
- return GridOffHeapMapFactory.unsafePartitionedMap(CacheConsistentHashAffinityFunction.DFLT_PARTITION_COUNT,
+ return GridOffHeapMapFactory.unsafePartitionedMap(CacheRendezvousAffinityFunction.DFLT_PARTITION_COUNT,
Runtime.getRuntime().availableProcessors(), load, LOAD_CNT, mem, lruStripes, null);
}
}
[04/50] incubator-ignite git commit: #ignite-237: fix
GridCacheDhtEvictionSelfTest.
Posted by sb...@apache.org.
#ignite-237: fix GridCacheDhtEvictionSelfTest.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f27e9d21
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f27e9d21
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f27e9d21
Branch: refs/heads/sprint-2
Commit: f27e9d216b0a612058f71730704eb1daf5b22544
Parents: 4a356f8
Author: ivasilinets <va...@gmail.com>
Authored: Thu Feb 26 09:29:55 2015 +0300
Committer: ivasilinets <va...@gmail.com>
Committed: Thu Feb 26 09:29:55 2015 +0300
----------------------------------------------------------------------
.../distributed/dht/GridCacheDhtEvictionSelfTest.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f27e9d21/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
index f8f8ff1..c253861 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.CacheRendezvousAffinityFunction;
import org.apache.ignite.cache.eviction.fifo.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
@@ -161,8 +161,9 @@ public class GridCacheDhtEvictionSelfTest extends GridCommonAbstractTest {
* @param idx Index.
* @return Affinity.
*/
- private CacheConsistentHashAffinityFunction affinity(int idx) {
- return (CacheConsistentHashAffinityFunction)grid(idx).jcache(null).getConfiguration(CacheConfiguration.class).getAffinity();
+ private CacheRendezvousAffinityFunction affinity(int idx) {
+ return (CacheRendezvousAffinityFunction)grid(idx).jcache(null).
+ getConfiguration(CacheConfiguration.class).getAffinity();
}
/**
@@ -170,9 +171,9 @@ public class GridCacheDhtEvictionSelfTest extends GridCommonAbstractTest {
* @return Primary node for the given key.
*/
private Collection<ClusterNode> keyNodes(Object key) {
- CacheConsistentHashAffinityFunction aff = affinity(0);
+ CacheRendezvousAffinityFunction aff = affinity(0);
- return aff.nodes(aff.partition(key), grid(0).cluster().nodes(), 1);
+ return aff.assignPartition(aff.partition(key), new ArrayList(grid(0).cluster().nodes()), 1, null);
}
/**
[20/50] incubator-ignite git commit: #ignite-237: change affinity
function in tests.
Posted by sb...@apache.org.
#ignite-237: change affinity function in tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/81fb145d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/81fb145d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/81fb145d
Branch: refs/heads/sprint-2
Commit: 81fb145dfbe02268d7cba49915fae5861752838a
Parents: 262aba5
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 16:16:57 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 16:16:57 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java | 2 +-
.../cache/distributed/GridCacheClientModesAbstractSelfTest.java | 3 ++-
.../cache/distributed/dht/GridCacheColocatedDebugTest.java | 3 ++-
.../apache/ignite/loadtests/capacity/spring-capacity-cache.xml | 2 +-
.../org/apache/ignite/loadtests/colocation/spring-colocation.xml | 2 +-
5 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81fb145d/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
index 581f22a..6e34229 100644
--- a/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
@@ -61,7 +61,7 @@ public class GridCacheAffinityBackupsSelfTest extends GridCommonAbstractTest {
*/
public void testConsistentHashBackups() throws Exception {
for (int i = 0; i < nodesCnt; i++)
- checkBackups(i, new CacheConsistentHashAffinityFunction());
+ checkBackups(i, new CacheRendezvousAffinityFunction());
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81fb145d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
index 7cb50b8..170c3d5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache.distributed;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cache.store.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
@@ -71,7 +72,7 @@ public abstract class GridCacheClientModesAbstractSelfTest extends GridCacheAbst
cfg.setCacheStoreFactory(null);
cfg.setReadThrough(false);
cfg.setWriteThrough(false);
- cfg.setAffinity(new CacheConsistentHashAffinityFunction(false, 32));
+ cfg.setAffinity(new CacheRendezvousAffinityFunction(false, 32));
cfg.setBackups(1);
return cfg;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81fb145d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
index 21f2c52..9cd036f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cache.store.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
@@ -71,7 +72,7 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setDistributionMode(PARTITIONED_ONLY);
- cacheCfg.setAffinity(new CacheConsistentHashAffinityFunction(false, 30));
+ cacheCfg.setAffinity(new CacheRendezvousAffinityFunction(false, 30));
cacheCfg.setBackups(1);
cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
cacheCfg.setSwapEnabled(false);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81fb145d/modules/core/src/test/java/org/apache/ignite/loadtests/capacity/spring-capacity-cache.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/capacity/spring-capacity-cache.xml b/modules/core/src/test/java/org/apache/ignite/loadtests/capacity/spring-capacity-cache.xml
index 00f4361..514d90f 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/capacity/spring-capacity-cache.xml
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/capacity/spring-capacity-cache.xml
@@ -77,7 +77,7 @@
sets the number of backups to 0 to ensure maximum capacity..
-->
<property name="affinity">
- <bean class="org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction">
+ <bean class="org.apache.ignite.cache.affinity.rendezvous.CacheRendezvousAffinityFunction">
<property name="keyBackups" value="0"/> <!-- No backups. -->
</bean>
</property>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81fb145d/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/spring-colocation.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/spring-colocation.xml b/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/spring-colocation.xml
index 01bd44f..8d68a73 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/spring-colocation.xml
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/spring-colocation.xml
@@ -105,7 +105,7 @@
sets the number of backups to 1 (which is default).
-->
<property name="affinity">
- <bean class="org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction">
+ <bean class="org.apache.ignite.cache.affinity.rendezvous.CacheRendezvousAffinityFunction">
<property name="keyBackups" value="0"/> <!-- Disable backups. -->
</bean>
</property>
[30/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/sprint-2' into ignite-237
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-237
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7fb3890c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7fb3890c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7fb3890c
Branch: refs/heads/sprint-2
Commit: 7fb3890c609f4c04af9b057686dfc3706a50e59d
Parents: 3bab015 4e7463d
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 13:27:20 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 13:27:20 2015 +0300
----------------------------------------------------------------------
.../cache/VisorCacheMetricsCollectorTask.java | 10 +-
.../visor/node/VisorBasicConfiguration.java | 17 ---
.../node/VisorNodeEventsCollectorTask.java | 10 +-
.../internal/visor/node/VisorNodeGcTask.java | 10 +-
.../internal/visor/node/VisorNodePingTask.java | 10 +-
.../commands/alert/VisorAlertCommand.scala | 8 +-
.../commands/cache/VisorCacheCommand.scala | 82 +++++++----
.../config/VisorConfigurationCommand.scala | 140 ++++++++++---------
.../commands/disco/VisorDiscoveryCommand.scala | 2 +-
.../scala/org/apache/ignite/visor/visor.scala | 64 ++++++---
.../commands/tasks/VisorTasksCommandSpec.scala | 2 +-
11 files changed, 193 insertions(+), 162 deletions(-)
----------------------------------------------------------------------
[47/50] incubator-ignite git commit: #ignite-237: remove test for
consistent hash replicaCount.
Posted by sb...@apache.org.
#ignite-237: remove test for consistent hash replicaCount.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5a76d70f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5a76d70f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5a76d70f
Branch: refs/heads/sprint-2
Commit: 5a76d70f99c276f95cfdb4ae97c09341fefc468a
Parents: 5f620d6
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Mar 2 12:49:56 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Mar 2 12:49:56 2015 +0300
----------------------------------------------------------------------
.../impl/ClientPartitionAffinitySelfTest.java | 323 -------------------
.../client/suite/IgniteClientTestSuite.java | 1 -
2 files changed, 324 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5a76d70f/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
deleted file mode 100644
index 6af1c4c..0000000
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
+++ /dev/null
@@ -1,323 +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.
- */
-
-package org.apache.ignite.internal.client.impl;
-
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.internal.client.*;
-import org.apache.ignite.testframework.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import java.util.*;
-
-/**
- * Client's partitioned affinity tests.
- */
-public class ClientPartitionAffinitySelfTest extends GridCommonAbstractTest {
- /** Hash ID resolver. */
- private static final GridClientPartitionAffinity.HashIdResolver HASH_ID_RSLVR =
- new GridClientPartitionAffinity.HashIdResolver() {
- @Override public Object getHashId(GridClientNode node) {
- return node.nodeId();
- }
- };
-
- /**
- * Test predefined affinity - must be ported to other clients.
- */
- @SuppressWarnings("UnaryPlus")
- public void testPredefined() throws Exception {
- // Use Md5 hasher for this test.
- GridClientPartitionAffinity aff = new GridClientPartitionAffinity();
-
- getTestResources().inject(aff);
-
- aff.setHashIdResolver(HASH_ID_RSLVR);
-
- List<GridClientNode> nodes = new ArrayList<>();
-
- nodes.add(createNode("000ea4cd-f449-4dcb-869a-5317c63bd619", 50));
- nodes.add(createNode("010ea4cd-f449-4dcb-869a-5317c63bd62a", 60));
- nodes.add(createNode("0209ec54-ff53-4fdb-8239-5a3ac1fb31bd", 70));
- nodes.add(createNode("0309ec54-ff53-4fdb-8239-5a3ac1fb31ef", 80));
- nodes.add(createNode("040c9b94-02ae-45a6-9d5c-a066dbdf2636", 90));
- nodes.add(createNode("050c9b94-02ae-45a6-9d5c-a066dbdf2747", 100));
- nodes.add(createNode("0601f916-4357-4cfe-a7df-49d4721690bf", 110));
- nodes.add(createNode("0702f916-4357-4cfe-a7df-49d4721691c0", 120));
-
- Map<Object, Integer> data = new LinkedHashMap<>();
-
- data.put("", 4);
- data.put("asdf", 4);
- data.put("224ea4cd-f449-4dcb-869a-5317c63bd619", 5);
- data.put("fdc9ec54-ff53-4fdb-8239-5a3ac1fb31bd", 2);
- data.put("0f9c9b94-02ae-45a6-9d5c-a066dbdf2636", 2);
- data.put("d8f1f916-4357-4cfe-a7df-49d4721690bf", 7);
- data.put("c77ffeae-78a1-4ee6-a0fd-8d197a794412", 3);
- data.put("35de9f21-3c9b-4f4a-a7d5-3e2c6cb01564", 1);
- data.put("d67eb652-4e76-47fb-ad4e-cd902d9b868a", 7);
-
- data.put(0, 4);
- data.put(1, 7);
- data.put(12, 5);
- data.put(123, 6);
- data.put(1234, 4);
- data.put(12345, 6);
- data.put(123456, 6);
- data.put(1234567, 6);
- data.put(12345678, 0);
- data.put(123456789, 7);
- data.put(1234567890, 7);
- data.put(1234567890L, 7);
- data.put(12345678901L, 2);
- data.put(123456789012L, 1);
- data.put(1234567890123L, 0);
- data.put(12345678901234L, 1);
- data.put(123456789012345L, 6);
- data.put(1234567890123456L, 7);
- data.put(-23456789012345L, 4);
- data.put(-2345678901234L, 1);
- data.put(-234567890123L, 5);
- data.put(-23456789012L, 5);
- data.put(-2345678901L, 7);
- data.put(-234567890L, 4);
- data.put(-234567890, 7);
- data.put(-23456789, 7);
- data.put(-2345678, 0);
- data.put(-234567, 6);
- data.put(-23456, 6);
- data.put(-2345, 6);
- data.put(-234, 7);
- data.put(-23, 5);
- data.put(-2, 4);
-
- data.put(0x80000000, 4);
- data.put(0x7fffffff, 7);
- data.put(0x8000000000000000L, 4);
- data.put(0x7fffffffffffffffL, 4);
-
- data.put(+1.1, 3);
- data.put(-10.01, 4);
- data.put(+100.001, 4);
- data.put(-1000.0001, 4);
- data.put(+1.7976931348623157E+308, 6);
- data.put(-1.7976931348623157E+308, 6);
- data.put(+4.9E-324, 7);
- data.put(-4.9E-324, 7);
-
- boolean ok = true;
-
- for (Map.Entry<Object, Integer> entry : data.entrySet()) {
- UUID exp = nodes.get(entry.getValue()).nodeId();
- UUID act = aff.node(entry.getKey(), nodes).nodeId();
-
- if (exp.equals(act))
- continue;
-
- ok = false;
-
- info("Failed to validate affinity for key '" + entry.getKey() + "' [expected=" + exp +
- ", actual=" + act + ".");
- }
-
- if (ok)
- return;
-
- fail("Client partitioned affinity validation fails.");
- }
-
- /**
- * Test predefined affinity - must be ported to other clients.
- */
- @SuppressWarnings("UnaryPlus")
- public void testPredefinedHashIdResolver() throws Exception {
- // Use Md5 hasher for this test.
- GridClientPartitionAffinity aff = new GridClientPartitionAffinity();
-
- getTestResources().inject(aff);
-
- aff.setHashIdResolver(new GridClientPartitionAffinity.HashIdResolver() {
- @Override public Object getHashId(GridClientNode node) {
- return 1;
- }
- });
-
- List<GridClientNode> nodes = new ArrayList<>();
-
- nodes.add(createNode("000ea4cd-f449-4dcb-869a-5317c63bd619", 50));
- nodes.add(createNode("010ea4cd-f449-4dcb-869a-5317c63bd62a", 60));
- nodes.add(createNode("0209ec54-ff53-4fdb-8239-5a3ac1fb31bd", 70));
- nodes.add(createNode("0309ec54-ff53-4fdb-8239-5a3ac1fb31ef", 80));
- nodes.add(createNode("040c9b94-02ae-45a6-9d5c-a066dbdf2636", 90));
- nodes.add(createNode("050c9b94-02ae-45a6-9d5c-a066dbdf2747", 100));
- nodes.add(createNode("0601f916-4357-4cfe-a7df-49d4721690bf", 110));
- nodes.add(createNode("0702f916-4357-4cfe-a7df-49d4721691c0", 120));
-
- Map<Object, Integer> data = new LinkedHashMap<>();
-
- data.put("", 4);
- data.put("asdf", 3);
- data.put("224ea4cd-f449-4dcb-869a-5317c63bd619", 5);
- data.put("fdc9ec54-ff53-4fdb-8239-5a3ac1fb31bd", 2);
- data.put("0f9c9b94-02ae-45a6-9d5c-a066dbdf2636", 2);
- data.put("d8f1f916-4357-4cfe-a7df-49d4721690bf", 4);
- data.put("c77ffeae-78a1-4ee6-a0fd-8d197a794412", 3);
- data.put("35de9f21-3c9b-4f4a-a7d5-3e2c6cb01564", 4);
- data.put("d67eb652-4e76-47fb-ad4e-cd902d9b868a", 2);
-
- data.put(0, 4);
- data.put(1, 1);
- data.put(12, 7);
- data.put(123, 1);
- data.put(1234, 6);
- data.put(12345, 2);
- data.put(123456, 5);
- data.put(1234567, 4);
- data.put(12345678, 6);
- data.put(123456789, 3);
- data.put(1234567890, 3);
- data.put(1234567890L, 3);
- data.put(12345678901L, 0);
- data.put(123456789012L, 1);
- data.put(1234567890123L, 3);
- data.put(12345678901234L, 5);
- data.put(123456789012345L, 5);
- data.put(1234567890123456L, 7);
- data.put(-23456789012345L, 6);
- data.put(-2345678901234L, 4);
- data.put(-234567890123L, 3);
- data.put(-23456789012L, 0);
- data.put(-2345678901L, 4);
- data.put(-234567890L, 5);
- data.put(-234567890, 3);
- data.put(-23456789, 3);
- data.put(-2345678, 6);
- data.put(-234567, 4);
- data.put(-23456, 5);
- data.put(-2345, 2);
- data.put(-234, 7);
- data.put(-23, 6);
- data.put(-2, 6);
-
- data.put(0x80000000, 7);
- data.put(0x7fffffff, 1);
- data.put(0x8000000000000000L, 7);
- data.put(0x7fffffffffffffffL, 7);
-
- data.put(+1.1, 2);
- data.put(-10.01, 0);
- data.put(+100.001, 2);
- data.put(-1000.0001, 0);
- data.put(+1.7976931348623157E+308, 6);
- data.put(-1.7976931348623157E+308, 1);
- data.put(+4.9E-324, 1);
- data.put(-4.9E-324, 1);
-
- boolean ok = true;
-
- for (Map.Entry<Object, Integer> entry : data.entrySet()) {
- UUID exp = nodes.get(entry.getValue()).nodeId();
- UUID act = aff.node(entry.getKey(), nodes).nodeId();
-
- if (exp.equals(act))
- continue;
-
- ok = false;
-
- info("Failed to validate affinity for key '" + entry.getKey() + "' [expected=" + exp +
- ", actual=" + act + ".");
- }
-
- if (ok)
- return;
-
- fail("Client partitioned affinity validation fails.");
- }
-
- /**
- * Create node with specified node id and replica count.
- *
- * @param nodeId Node id.
- * @param replicaCnt Node partitioned affinity replica count.
- * @return New node with specified node id and replica count.
- */
- private GridClientNode createNode(String nodeId, int replicaCnt) {
- return GridClientNodeImpl.builder()
- .nodeId(UUID.fromString(nodeId))
- .build();
- }
-
- /**
- * Add {@code cnt} nodes into emulated topology.
- *
- * @param cnt Number of nodes to add into emulated topology.
- * @param nodes Client topology.
- * @param srvNodes Server topology.
- */
- private void addNodes(int cnt, Collection<GridClientNode> nodes, Collection<ClusterNode> srvNodes) {
- while (cnt-- > 0) {
- UUID nodeId = UUID.randomUUID();
- int replicaCnt = (int)Math.round(Math.random() * 500) + 1;
-
- nodes.add(GridClientNodeImpl.builder()
- .nodeId(nodeId)
- .build());
-
- ClusterNode srvNode = new TestRichNode(nodeId);
-
- srvNodes.add(srvNode);
- }
- }
-
- /**
- * Rich node stub to use in emulated server topology.
- */
- private static class TestRichNode extends GridTestNode {
- /**
- * Node id.
- */
- private final UUID nodeId;
-
-
- /**
- * Externalizable class requires public no-arg constructor.
- */
- @SuppressWarnings("UnusedDeclaration")
- public TestRichNode() {
- this(UUID.randomUUID());
- }
-
- /**
- * Constructs rich node stub to use in emulated server topology.
- *
- * @param nodeId Node id.
- */
- private TestRichNode(UUID nodeId) {
- this.nodeId = nodeId;
- }
-
- /** {@inheritDoc} */
- @Override public UUID id() {
- return nodeId;
- }
-
- /** {@inheritDoc} */
- @Override public <T> T attribute(String name) {
- return super.attribute(name);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5a76d70f/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java
index d89a960..4785248 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/suite/IgniteClientTestSuite.java
@@ -95,7 +95,6 @@ public class IgniteClientTestSuite extends TestSuite {
suite.addTest(new TestSuite(ClientDefaultCacheSelfTest.class));
suite.addTestSuite(ClientFutureAdapterSelfTest.class);
- suite.addTestSuite(ClientPartitionAffinitySelfTest.class);
suite.addTestSuite(ClientPropertiesConfigurationSelfTest.class);
suite.addTestSuite(ClientConsistentHashSelfTest.class);
suite.addTestSuite(ClientJavaHasherSelfTest.class);
[23/50] incubator-ignite git commit: #ignite-237: move
CacheConsistentHashAffinityFunction to org.gridgain.benchmarks.risk.affinity.
Posted by sb...@apache.org.
#ignite-237: move CacheConsistentHashAffinityFunction to org.gridgain.benchmarks.risk.affinity.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d07931d2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d07931d2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d07931d2
Branch: refs/heads/sprint-2
Commit: d07931d2ddd8d4798c1ca2b7bc9620036ff59ae9
Parents: 87586da
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 18:23:27 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 18:23:27 2015 +0300
----------------------------------------------------------------------
.../ClientAbstractMultiThreadedSelfTest.java | 4 +-
.../impl/ClientPartitionAffinitySelfTest.java | 21 +-
.../ClientAbstractMultiNodeSelfTest.java | 4 +-
.../integration/ClientAbstractSelfTest.java | 8 -
.../src/test/resources/spring-server-node.xml | 2 +-
.../test/resources/spring-server-ssl-node.xml | 2 +-
.../CacheConsistentHashAffinityFunction.java | 703 -------------------
.../cache/affinity/consistenthash/package.html | 24 -
.../processors/cache/GridCacheAttributes.java | 9 -
.../processors/cache/GridCacheProcessor.java | 12 +-
.../top/GridTopologyCommandHandler.java | 7 -
.../cache/VisorCacheAffinityConfiguration.java | 7 -
.../optimized/optimized-classnames.properties | 12 +-
.../CacheConsistentHashAffinityFunction.java | 703 +++++++++++++++++++
.../GridCachePartitionedAffinitySpreadTest.java | 16 +-
.../GridCachePartitionedAffinitySelfTest.java | 53 +-
16 files changed, 731 insertions(+), 856 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java
index 6264276..4ab2679 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/ClientAbstractMultiThreadedSelfTest.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.client;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.compute.*;
import org.apache.ignite.configuration.*;
@@ -193,7 +193,7 @@ public abstract class ClientAbstractMultiThreadedSelfTest extends GridCommonAbst
private CacheConfiguration cacheConfiguration(@Nullable String cacheName) throws Exception {
CacheConfiguration cfg = defaultCacheConfiguration();
- cfg.setAffinity(new CacheConsistentHashAffinityFunction());
+ cfg.setAffinity(new CacheRendezvousAffinityFunction());
cfg.setDistributionMode(NEAR_PARTITIONED);
cfg.setAtomicityMode(TRANSACTIONAL);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
index 3a45615..444a84c 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
@@ -18,7 +18,7 @@
package org.apache.ignite.internal.client.impl;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.client.*;
import org.apache.ignite.internal.processors.affinity.*;
@@ -28,8 +28,6 @@ import org.apache.ignite.testframework.junits.common.*;
import java.util.*;
-import static org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction.*;
-
/**
* Client's partitioned affinity tests.
*/
@@ -285,7 +283,7 @@ public class ClientPartitionAffinitySelfTest extends GridCommonAbstractTest {
aff.setHashIdResolver(HASH_ID_RSLVR);
- CacheConsistentHashAffinityFunction srvAff = new CacheConsistentHashAffinityFunction();
+ CacheRendezvousAffinityFunction srvAff = new CacheRendezvousAffinityFunction();
getTestResources().inject(srvAff);
@@ -324,7 +322,7 @@ public class ClientPartitionAffinitySelfTest extends GridCommonAbstractTest {
.replicaCount(replicaCnt)
.build());
- ClusterNode srvNode = new TestRichNode(nodeId, replicaCnt);
+ ClusterNode srvNode = new TestRichNode(nodeId);
srvNodes.add(srvNode);
}
@@ -366,28 +364,22 @@ public class ClientPartitionAffinitySelfTest extends GridCommonAbstractTest {
*/
private final UUID nodeId;
- /**
- * Partitioned affinity replicas count.
- */
- private final Integer replicaCnt;
/**
* Externalizable class requires public no-arg constructor.
*/
@SuppressWarnings("UnusedDeclaration")
public TestRichNode() {
- this(UUID.randomUUID(), DFLT_REPLICA_COUNT);
+ this(UUID.randomUUID());
}
/**
* Constructs rich node stub to use in emulated server topology.
*
* @param nodeId Node id.
- * @param replicaCnt Partitioned affinity replicas count.
*/
- private TestRichNode(UUID nodeId, int replicaCnt) {
+ private TestRichNode(UUID nodeId) {
this.nodeId = nodeId;
- this.replicaCnt = replicaCnt;
}
/** {@inheritDoc} */
@@ -397,9 +389,6 @@ public class ClientPartitionAffinitySelfTest extends GridCommonAbstractTest {
/** {@inheritDoc} */
@Override public <T> T attribute(String name) {
- if (DFLT_REPLICA_COUNT_ATTR_NAME.equals(name))
- return (T)replicaCnt;
-
return super.attribute(name);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
index 3da6080..0eb6e16 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.client.integration;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.compute.*;
import org.apache.ignite.configuration.*;
@@ -196,7 +196,7 @@ public abstract class ClientAbstractMultiNodeSelfTest extends GridCommonAbstract
cfg.setWriteSynchronizationMode(REPLICATED_ASYNC_CACHE_NAME.equals(cacheName) ? FULL_ASYNC : FULL_SYNC);
- cfg.setAffinity(new CacheConsistentHashAffinityFunction());
+ cfg.setAffinity(new CacheRendezvousAffinityFunction());
return cfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractSelfTest.java
index e55b09d..8011945 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractSelfTest.java
@@ -21,7 +21,6 @@ import junit.framework.*;
import net.sf.json.*;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.store.*;
import org.apache.ignite.compute.*;
import org.apache.ignite.configuration.*;
@@ -1094,13 +1093,6 @@ public abstract class ClientAbstractSelfTest extends GridCommonAbstractTest {
assertEquals(grid().localNode().id(), node.nodeId());
assertEquals(4, node.caches().size());
- Integer replica = grid().localNode().attribute(CacheConsistentHashAffinityFunction.DFLT_REPLICA_COUNT_ATTR_NAME);
-
- if (replica == null)
- replica = CacheConsistentHashAffinityFunction.DFLT_REPLICA_COUNT;
-
- assertEquals((int)replica, node.replicaCount());
-
Map<String, GridClientCacheMode> caches = node.caches();
for (Map.Entry<String, GridClientCacheMode> e : caches.entrySet()) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/clients/src/test/resources/spring-server-node.xml
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/resources/spring-server-node.xml b/modules/clients/src/test/resources/spring-server-node.xml
index 3b19f3d..3496e37 100644
--- a/modules/clients/src/test/resources/spring-server-node.xml
+++ b/modules/clients/src/test/resources/spring-server-node.xml
@@ -118,7 +118,7 @@
<property name="writeSynchronizationMode" value="FULL_SYNC"/>
<property name="affinity">
- <bean class="org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction">
+ <bean class="org.apache.ignite.cache.affinity.rendezvous.CacheRendezvousAffinityFunction">
<constructor-arg value="1"/>
</bean>
</property>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/clients/src/test/resources/spring-server-ssl-node.xml
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/resources/spring-server-ssl-node.xml b/modules/clients/src/test/resources/spring-server-ssl-node.xml
index 3989ac6..c56f25a 100644
--- a/modules/clients/src/test/resources/spring-server-ssl-node.xml
+++ b/modules/clients/src/test/resources/spring-server-ssl-node.xml
@@ -119,7 +119,7 @@
<property name="writeSynchronizationMode" value="FULL_SYNC"/>
<property name="affinity">
- <bean class="org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction">
+ <bean class="org.apache.ignite.cache.affinity.rendezvous.CacheRendezvousAffinityFunction">
<constructor-arg value="1"/>
</bean>
</property>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/core/src/main/java/org/apache/ignite/cache/affinity/consistenthash/CacheConsistentHashAffinityFunction.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/consistenthash/CacheConsistentHashAffinityFunction.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/consistenthash/CacheConsistentHashAffinityFunction.java
deleted file mode 100644
index 993205e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/consistenthash/CacheConsistentHashAffinityFunction.java
+++ /dev/null
@@ -1,703 +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.
- */
-
-package org.apache.ignite.cache.affinity.consistenthash;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.util.*;
-import org.apache.ignite.internal.util.tostring.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.resources.*;
-import org.jdk8.backport.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-/**
- * Affinity function for partitioned cache. This function supports the following
- * configuration:
- * <ul>
- * <li>
- * {@code backups} - Use this flag to control how many back up nodes will be
- * assigned to every key. The default value is {@code 0}.
- * </li>
- * <li>
- * {@code replicas} - Generally the more replicas a node gets, the more key assignments
- * it will receive. You can configure different number of replicas for a node by
- * setting user attribute with name {@link #getReplicaCountAttributeName()} to some
- * number. Default value is {@code 512} defined by {@link #DFLT_REPLICA_COUNT} constant.
- * </li>
- * <li>
- * {@code backupFilter} - Optional filter for back up nodes. If provided, then only
- * nodes that pass this filter will be selected as backup nodes. If not provided, then
- * primary and backup nodes will be selected out of all nodes available for this cache.
- * </li>
- * </ul>
- * <p>
- * Cache affinity can be configured for individual caches via {@link org.apache.ignite.configuration.CacheConfiguration#getAffinity()} method.
- */
-@Deprecated
-public class CacheConsistentHashAffinityFunction implements CacheAffinityFunction {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Flag to enable/disable consistency check (for internal use only). */
- private static final boolean AFFINITY_CONSISTENCY_CHECK = Boolean.getBoolean("IGNITE_AFFINITY_CONSISTENCY_CHECK");
-
- /** Default number of partitions. */
- public static final int DFLT_PARTITION_COUNT = 10000;
-
- /** Default replica count for partitioned caches. */
- public static final int DFLT_REPLICA_COUNT = 128;
-
- /**
- * Name of node attribute to specify number of replicas for a node.
- * Default value is {@code gg:affinity:node:replicas}.
- */
- public static final String DFLT_REPLICA_COUNT_ATTR_NAME = "gg:affinity:node:replicas";
-
- /** Node hash. */
- private transient GridConsistentHash<NodeInfo> nodeHash;
-
- /** Total number of partitions. */
- private int parts = DFLT_PARTITION_COUNT;
-
- /** */
- private int replicas = DFLT_REPLICA_COUNT;
-
- /** */
- private String attrName = DFLT_REPLICA_COUNT_ATTR_NAME;
-
- /** */
- private boolean exclNeighbors;
-
- /**
- * Optional backup filter. First node passed to this filter is primary node,
- * and second node is a node being tested.
- */
- private IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter;
-
- /** */
- private CacheAffinityNodeHashResolver hashIdRslvr = new CacheAffinityNodeAddressHashResolver();
-
- /** Injected grid. */
- @IgniteInstanceResource
- private Ignite ignite;
-
- /** Injected cache name. */
- @CacheNameResource
- private String cacheName;
-
- /** Injected logger. */
- @LoggerResource
- private IgniteLogger log;
-
- /** Initialization flag. */
- @SuppressWarnings("TransientFieldNotInitialized")
- private transient AtomicBoolean init = new AtomicBoolean();
-
- /** Latch for initializing. */
- @SuppressWarnings({"TransientFieldNotInitialized"})
- private transient CountDownLatch initLatch = new CountDownLatch(1);
-
- /** Nodes IDs. */
- @GridToStringInclude
- @SuppressWarnings({"TransientFieldNotInitialized"})
- private transient ConcurrentMap<UUID, NodeInfo> addedNodes = new ConcurrentHashMap<>();
-
- /** Optional backup filter. */
- @GridToStringExclude
- private final IgniteBiPredicate<NodeInfo, NodeInfo> backupIdFilter = new IgniteBiPredicate<NodeInfo, NodeInfo>() {
- @Override public boolean apply(NodeInfo primaryNodeInfo, NodeInfo nodeInfo) {
- return backupFilter == null || backupFilter.apply(primaryNodeInfo.node(), nodeInfo.node());
- }
- };
-
- /** Map of neighbors. */
- @SuppressWarnings("TransientFieldNotInitialized")
- private transient ConcurrentMap<UUID, Collection<UUID>> neighbors =
- new ConcurrentHashMap8<>();
-
- /**
- * Empty constructor with all defaults.
- */
- public CacheConsistentHashAffinityFunction() {
- // No-op.
- }
-
- /**
- * Initializes affinity with flag to exclude same-host-neighbors from being backups of each other
- * and specified number of backups.
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code #getBackupFilter()} is set.
- *
- * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups
- * of each other.
- */
- public CacheConsistentHashAffinityFunction(boolean exclNeighbors) {
- this.exclNeighbors = exclNeighbors;
- }
-
- /**
- * Initializes affinity with flag to exclude same-host-neighbors from being backups of each other,
- * and specified number of backups and partitions.
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code #getBackupFilter()} is set.
- *
- * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups
- * of each other.
- * @param parts Total number of partitions.
- */
- public CacheConsistentHashAffinityFunction(boolean exclNeighbors, int parts) {
- A.ensure(parts != 0, "parts != 0");
-
- this.exclNeighbors = exclNeighbors;
- this.parts = parts;
- }
-
- /**
- * Initializes optional counts for replicas and backups.
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code backupFilter} is set.
- *
- * @param parts Total number of partitions.
- * @param backupFilter Optional back up filter for nodes. If provided, backups will be selected
- * from all nodes that pass this filter. First argument for this filter is primary node, and second
- * argument is node being tested.
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code backupFilter} is set.
- */
- public CacheConsistentHashAffinityFunction(int parts,
- @Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
- A.ensure(parts != 0, "parts != 0");
-
- this.parts = parts;
- this.backupFilter = backupFilter;
- }
-
- /**
- * Gets default count of virtual replicas in consistent hash ring.
- * <p>
- * To determine node replicas, node attribute with {@link #getReplicaCountAttributeName()}
- * name will be checked first. If it is absent, then this value will be used.
- *
- * @return Count of virtual replicas in consistent hash ring.
- */
- public int getDefaultReplicas() {
- return replicas;
- }
-
- /**
- * Sets default count of virtual replicas in consistent hash ring.
- * <p>
- * To determine node replicas, node attribute with {@link #getReplicaCountAttributeName} name
- * will be checked first. If it is absent, then this value will be used.
- *
- * @param replicas Count of virtual replicas in consistent hash ring.s
- */
- public void setDefaultReplicas(int replicas) {
- this.replicas = replicas;
- }
-
- /**
- * Gets total number of key partitions. To ensure that all partitions are
- * equally distributed across all nodes, please make sure that this
- * number is significantly larger than a number of nodes. Also, partition
- * size should be relatively small. Try to avoid having partitions with more
- * than quarter million keys.
- * <p>
- * Note that for fully replicated caches this method should always
- * return {@code 1}.
- *
- * @return Total partition count.
- */
- public int getPartitions() {
- return parts;
- }
-
- /**
- * Sets total number of partitions.
- *
- * @param parts Total number of partitions.
- */
- public void setPartitions(int parts) {
- this.parts = parts;
- }
-
- /**
- * Gets hash ID resolver for nodes. This resolver is used to provide
- * alternate hash ID, other than node ID.
- * <p>
- * Node IDs constantly change when nodes get restarted, which causes them to
- * be placed on different locations in the hash ring, and hence causing
- * repartitioning. Providing an alternate hash ID, which survives node restarts,
- * puts node on the same location on the hash ring, hence minimizing required
- * repartitioning.
- *
- * @return Hash ID resolver.
- */
- public CacheAffinityNodeHashResolver getHashIdResolver() {
- return hashIdRslvr;
- }
-
- /**
- * Sets hash ID resolver for nodes. This resolver is used to provide
- * alternate hash ID, other than node ID.
- * <p>
- * Node IDs constantly change when nodes get restarted, which causes them to
- * be placed on different locations in the hash ring, and hence causing
- * repartitioning. Providing an alternate hash ID, which survives node restarts,
- * puts node on the same location on the hash ring, hence minimizing required
- * repartitioning.
- *
- * @param hashIdRslvr Hash ID resolver.
- */
- public void setHashIdResolver(CacheAffinityNodeHashResolver hashIdRslvr) {
- this.hashIdRslvr = hashIdRslvr;
- }
-
- /**
- * Gets optional backup filter. If not {@code null}, backups will be selected
- * from all nodes that pass this filter. First node passed to this filter is primary node,
- * and second node is a node being tested.
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code backupFilter} is set.
- *
- * @return Optional backup filter.
- */
- @Nullable public IgniteBiPredicate<ClusterNode, ClusterNode> getBackupFilter() {
- return backupFilter;
- }
-
- /**
- * Sets optional backup filter. If provided, then backups will be selected from all
- * nodes that pass this filter. First node being passed to this filter is primary node,
- * and second node is a node being tested.
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code backupFilter} is set.
- *
- * @param backupFilter Optional backup filter.
- */
- public void setBackupFilter(@Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
- this.backupFilter = backupFilter;
- }
-
- /**
- * Gets optional attribute name for replica count. If not provided, the
- * default is {@link #DFLT_REPLICA_COUNT_ATTR_NAME}.
- *
- * @return User attribute name for replica count for a node.
- */
- public String getReplicaCountAttributeName() {
- return attrName;
- }
-
- /**
- * Sets optional attribute name for replica count. If not provided, the
- * default is {@link #DFLT_REPLICA_COUNT_ATTR_NAME}.
- *
- * @param attrName User attribute name for replica count for a node.
- */
- public void setReplicaCountAttributeName(String attrName) {
- this.attrName = attrName;
- }
-
- /**
- * Checks flag to exclude same-host-neighbors from being backups of each other (default is {@code false}).
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code #getBackupFilter()} is set.
- *
- * @return {@code True} if nodes residing on the same host may not act as backups of each other.
- */
- public boolean isExcludeNeighbors() {
- return exclNeighbors;
- }
-
- /**
- * Sets flag to exclude same-host-neighbors from being backups of each other (default is {@code false}).
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code #getBackupFilter()} is set.
- *
- * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups of each other.
- */
- public void setExcludeNeighbors(boolean exclNeighbors) {
- this.exclNeighbors = exclNeighbors;
- }
-
- /**
- * Gets neighbors for a node.
- *
- * @param node Node.
- * @return Neighbors.
- */
- private Collection<UUID> neighbors(final ClusterNode node) {
- Collection<UUID> ns = neighbors.get(node.id());
-
- if (ns == null) {
- Collection<ClusterNode> nodes = ignite.cluster().forHost(node).nodes();
-
- ns = F.addIfAbsent(neighbors, node.id(), new ArrayList<>(F.nodeIds(nodes)));
- }
-
- return ns;
- }
-
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public List<List<ClusterNode>> assignPartitions(CacheAffinityFunctionContext ctx) {
- List<List<ClusterNode>> res = new ArrayList<>(parts);
-
- Collection<ClusterNode> topSnapshot = ctx.currentTopologySnapshot();
-
- for (int part = 0; part < parts; part++) {
- res.add(F.isEmpty(topSnapshot) ?
- Collections.<ClusterNode>emptyList() :
- // Wrap affinity nodes with unmodifiable list since unmodifiable generic collection
- // doesn't provide equals and hashCode implementations.
- U.sealList(nodes(part, topSnapshot, ctx.backups())));
- }
-
- return res;
- }
-
- /**
- * Assigns nodes to one partition.
- *
- * @param part Partition to assign nodes for.
- * @param nodes Cache topology nodes.
- * @return Assigned nodes, first node is primary, others are backups.
- */
- public Collection<ClusterNode> nodes(int part, Collection<ClusterNode> nodes, int backups) {
- if (nodes == null)
- return Collections.emptyList();
-
- int nodesSize = nodes.size();
-
- if (nodesSize == 0)
- return Collections.emptyList();
-
- if (nodesSize == 1) // Minor optimization.
- return nodes;
-
- initialize();
-
- final Map<NodeInfo, ClusterNode> lookup = new GridLeanMap<>(nodesSize);
-
- // Store nodes in map for fast lookup.
- for (ClusterNode n : nodes)
- // Add nodes into hash circle, if absent.
- lookup.put(resolveNodeInfo(n), n);
-
- Collection<NodeInfo> selected;
-
- if (backupFilter != null) {
- final IgnitePredicate<NodeInfo> p = new P1<NodeInfo>() {
- @Override public boolean apply(NodeInfo id) {
- return lookup.containsKey(id);
- }
- };
-
- final NodeInfo primaryId = nodeHash.node(part, p);
-
- IgnitePredicate<NodeInfo> backupPrimaryIdFilter = new IgnitePredicate<NodeInfo>() {
- @Override public boolean apply(NodeInfo node) {
- return backupIdFilter.apply(primaryId, node);
- }
- };
-
- Collection<NodeInfo> backupIds = nodeHash.nodes(part, backups, p, backupPrimaryIdFilter);
-
- if (F.isEmpty(backupIds) && primaryId != null) {
- ClusterNode n = lookup.get(primaryId);
-
- assert n != null;
-
- return Collections.singletonList(n);
- }
-
- selected = primaryId != null ? F.concat(false, primaryId, backupIds) : backupIds;
- }
- else {
- if (!exclNeighbors) {
- selected = nodeHash.nodes(part, backups == Integer.MAX_VALUE ? backups : backups + 1, new P1<NodeInfo>() {
- @Override public boolean apply(NodeInfo id) {
- return lookup.containsKey(id);
- }
- });
-
- if (selected.size() == 1) {
- NodeInfo id = F.first(selected);
-
- assert id != null : "Node ID cannot be null in affinity node ID collection: " + selected;
-
- ClusterNode n = lookup.get(id);
-
- assert n != null;
-
- return Collections.singletonList(n);
- }
- }
- else {
- int primaryAndBackups = backups + 1;
-
- selected = new ArrayList<>(primaryAndBackups);
-
- final Collection<NodeInfo> selected0 = selected;
-
- List<NodeInfo> ids = nodeHash.nodes(part, primaryAndBackups, new P1<NodeInfo>() {
- @Override public boolean apply(NodeInfo id) {
- ClusterNode n = lookup.get(id);
-
- if (n == null)
- return false;
-
- Collection<UUID> neighbors = neighbors(n);
-
- for (NodeInfo id0 : selected0) {
- ClusterNode n0 = lookup.get(id0);
-
- if (n0 == null)
- return false;
-
- Collection<UUID> neighbors0 = neighbors(n0);
-
- if (F.containsAny(neighbors0, neighbors))
- return false;
- }
-
- selected0.add(id);
-
- return true;
- }
- });
-
- if (AFFINITY_CONSISTENCY_CHECK)
- assert F.eqOrdered(ids, selected);
- }
- }
-
- Collection<ClusterNode> ret = new ArrayList<>(selected.size());
-
- for (NodeInfo id : selected) {
- ClusterNode n = lookup.get(id);
-
- assert n != null;
-
- ret.add(n);
- }
-
- return ret;
- }
-
- /** {@inheritDoc} */
- @Override public int partition(Object key) {
- initialize();
-
- return U.safeAbs(key.hashCode() % parts);
- }
-
- /** {@inheritDoc} */
- @Override public int partitions() {
- initialize();
-
- return parts;
- }
-
- /** {@inheritDoc} */
- @Override public void reset() {
- addedNodes = new ConcurrentHashMap<>();
- neighbors = new ConcurrentHashMap8<>();
-
- initLatch = new CountDownLatch(1);
-
- init = new AtomicBoolean();
- }
-
- /** {@inheritDoc} */
- @Override public void removeNode(UUID nodeId) {
- NodeInfo info = addedNodes.remove(nodeId);
-
- if (info == null)
- return;
-
- nodeHash.removeNode(info);
-
- neighbors.clear();
- }
-
- /**
- * Resolve node info for specified node.
- * Add node to hash circle if this is the first node invocation.
- *
- * @param n Node to get info for.
- * @return Node info.
- */
- private NodeInfo resolveNodeInfo(ClusterNode n) {
- UUID nodeId = n.id();
- NodeInfo nodeInfo = addedNodes.get(nodeId);
-
- if (nodeInfo != null)
- return nodeInfo;
-
- assert hashIdRslvr != null;
-
- nodeInfo = new NodeInfo(nodeId, hashIdRslvr.resolve(n), n);
-
- neighbors.clear();
-
- nodeHash.addNode(nodeInfo, replicas(n));
-
- addedNodes.put(nodeId, nodeInfo);
-
- return nodeInfo;
- }
-
- /** {@inheritDoc} */
- private void initialize() {
- if (!init.get() && init.compareAndSet(false, true)) {
- if (log.isInfoEnabled())
- log.info("Consistent hash configuration [cacheName=" + cacheName + ", partitions=" + parts +
- ", excludeNeighbors=" + exclNeighbors + ", replicas=" + replicas +
- ", backupFilter=" + backupFilter + ", hashIdRslvr=" + hashIdRslvr + ']');
-
- nodeHash = new GridConsistentHash<>();
-
- initLatch.countDown();
- }
- else {
- if (initLatch.getCount() > 0) {
- try {
- U.await(initLatch);
- }
- catch (IgniteInterruptedCheckedException ignored) {
- // Recover interrupted state flag.
- Thread.currentThread().interrupt();
- }
- }
- }
- }
-
- /**
- * @param n Node.
- * @return Replicas.
- */
- private int replicas(ClusterNode n) {
- Integer nodeReplicas = n.attribute(attrName);
-
- if (nodeReplicas == null)
- nodeReplicas = replicas;
-
- return nodeReplicas;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(CacheConsistentHashAffinityFunction.class, this);
- }
-
- /**
- * Node hash ID.
- */
- private static final class NodeInfo implements Comparable<NodeInfo> {
- /** Node ID. */
- private UUID nodeId;
-
- /** Hash ID. */
- private Object hashId;
-
- /** Grid node. */
- private ClusterNode node;
-
- /**
- * @param nodeId Node ID.
- * @param hashId Hash ID.
- * @param node Rich node.
- */
- private NodeInfo(UUID nodeId, Object hashId, ClusterNode node) {
- assert nodeId != null;
- assert hashId != null;
-
- this.hashId = hashId;
- this.nodeId = nodeId;
- this.node = node;
- }
-
- /**
- * @return Node ID.
- */
- public UUID nodeId() {
- return nodeId;
- }
-
- /**
- * @return Hash ID.
- */
- public Object hashId() {
- return hashId;
- }
-
- /**
- * @return Node.
- */
- public ClusterNode node() {
- return node;
- }
-
- /** {@inheritDoc} */
- @Override public int hashCode() {
- return hashId.hashCode();
- }
-
- /** {@inheritDoc} */
- @Override public boolean equals(Object obj) {
- if (!(obj instanceof NodeInfo))
- return false;
-
- NodeInfo that = (NodeInfo)obj;
-
- // If objects are equal, hash codes should be the same.
- // Cannot use that.hashId.equals(hashId) due to Comparable<N> interface restrictions.
- return that.nodeId.equals(nodeId) && that.hashCode() == hashCode();
- }
-
- /** {@inheritDoc} */
- @Override public int compareTo(NodeInfo o) {
- int diff = nodeId.compareTo(o.nodeId);
-
- if (diff == 0) {
- int h1 = hashCode();
- int h2 = o.hashCode();
-
- diff = h1 == h2 ? 0 : (h1 < h2 ? -1 : 1);
- }
-
- return diff;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(NodeInfo.class, this);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/core/src/main/java/org/apache/ignite/cache/affinity/consistenthash/package.html
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/consistenthash/package.html b/modules/core/src/main/java/org/apache/ignite/cache/affinity/consistenthash/package.html
deleted file mode 100644
index 6f05382..0000000
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/consistenthash/package.html
+++ /dev/null
@@ -1,24 +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.
--->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<body>
- <!-- Package description. -->
- Contains consistent hash based cache affinity for partitioned cache.
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
index a4762ab..1f8b0b4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
@@ -192,15 +192,6 @@ public class GridCacheAttributes implements Externalizable {
CacheAffinityFunction aff = cfg.getAffinity();
if (aff != null) {
- if (aff instanceof CacheConsistentHashAffinityFunction) {
- CacheConsistentHashAffinityFunction aff0 = (CacheConsistentHashAffinityFunction) aff;
-
- affInclNeighbors = aff0.isExcludeNeighbors();
- affReplicas = aff0.getDefaultReplicas();
- affReplicaCntAttrName = aff0.getReplicaCountAttributeName();
- affHashIdRslvrClsName = className(aff0.getHashIdResolver());
- }
-
affPartsCnt = aff.partitions();
affClsName = className(aff);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/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 e901176..66a751c 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
@@ -305,14 +305,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
throw new IgniteCheckedException("REPLICATED cache can not be started with CachePartitionFairAffinity" +
" [cacheName=" + cc.getName() + ']');
- if (cc.getAffinity() instanceof CacheConsistentHashAffinityFunction) {
- CacheConsistentHashAffinityFunction aff = (CacheConsistentHashAffinityFunction)cc.getAffinity();
-
- if (aff.isExcludeNeighbors())
- throw new IgniteCheckedException("For REPLICATED cache flag 'excludeNeighbors' in " +
- "CacheConsistentHashAffinityFunction cannot be set [cacheName=" + cc.getName() + ']');
- }
-
if (cc.getAffinity() instanceof CacheRendezvousAffinityFunction) {
CacheRendezvousAffinityFunction aff = (CacheRendezvousAffinityFunction)cc.getAffinity();
@@ -1002,8 +994,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
for (GridCacheAdapter cache : ctx.cache().internalCaches()) {
CacheConfiguration cfg = cache.configuration();
- if (cfg.getAffinity() instanceof CacheConsistentHashAffinityFunction) {
- CacheConsistentHashAffinityFunction aff = (CacheConsistentHashAffinityFunction)cfg.getAffinity();
+ if (cfg.getAffinity() instanceof CacheRendezvousAffinityFunction) {
+ CacheRendezvousAffinityFunction aff = (CacheRendezvousAffinityFunction)cfg.getAffinity();
CacheAffinityNodeHashResolver hashIdRslvr = aff.getHashIdResolver();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
index e32f6f7..4bcc566 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
@@ -174,13 +174,6 @@ public class GridTopologyCommandHandler extends GridRestCommandHandlerAdapter {
nodeBean.setTcpAddresses(nonEmptyList(node.<Collection<String>>attribute(ATTR_REST_TCP_ADDRS)));
nodeBean.setTcpHostNames(nonEmptyList(node.<Collection<String>>attribute(ATTR_REST_TCP_HOST_NAMES)));
- Integer dfltReplicaCnt = node.attribute(CacheConsistentHashAffinityFunction.DFLT_REPLICA_COUNT_ATTR_NAME);
-
- if (dfltReplicaCnt == null)
- dfltReplicaCnt = CacheConsistentHashAffinityFunction.DFLT_REPLICA_COUNT;
-
- nodeBean.setReplicaCount(dfltReplicaCnt);
-
GridCacheAttributes[] caches = node.attribute(ATTR_CACHE);
if (!F.isEmpty(caches)) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
index 3d4d84a..7aae6f3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
@@ -62,13 +62,6 @@ public class VisorCacheAffinityConfiguration implements Serializable {
Integer dfltReplicas = null;
Boolean excludeNeighbors = null;
- if (aff instanceof CacheConsistentHashAffinityFunction) {
- CacheConsistentHashAffinityFunction hashAffFunc = (CacheConsistentHashAffinityFunction)aff;
-
- dfltReplicas = hashAffFunc.getDefaultReplicas();
- excludeNeighbors = hashAffFunc.isExcludeNeighbors();
- }
-
VisorCacheAffinityConfiguration cfg = new VisorCacheAffinityConfiguration();
cfg.function(compactClass(aff));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/optimized-classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/optimized-classnames.properties b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/optimized-classnames.properties
index 5050104..ea752c7 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/optimized-classnames.properties
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/optimized-classnames.properties
@@ -79,12 +79,12 @@ org.apache.ignite.cache.CacheWriteSynchronizationMode
org.apache.ignite.cache.affinity.CacheAffinityKey
org.apache.ignite.cache.affinity.CacheAffinityNodeAddressHashResolver
org.apache.ignite.cache.affinity.CacheAffinityNodeIdHashResolver
-org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction
-org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction$1
-org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction$2
-org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction$3
-org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction$4
-org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction$5
+org.gridgain.benchmarks.risk.affinity.CacheConsistentHashAffinityFunction
+org.gridgain.benchmarks.risk.affinity.CacheConsistentHashAffinityFunction$1
+org.gridgain.benchmarks.risk.affinity.CacheConsistentHashAffinityFunction$2
+org.gridgain.benchmarks.risk.affinity.CacheConsistentHashAffinityFunction$3
+org.gridgain.benchmarks.risk.affinity.CacheConsistentHashAffinityFunction$4
+org.gridgain.benchmarks.risk.affinity.CacheConsistentHashAffinityFunction$5
org.apache.ignite.cache.affinity.fair.CachePartitionFairAffinity
org.apache.ignite.cache.affinity.fair.CachePartitionFairAffinity$PartitionSetComparator
org.apache.ignite.cache.affinity.rendezvous.CacheRendezvousAffinityFunction
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/core/src/main/java/org/gridgain/benchmarks/risk/affinity/CacheConsistentHashAffinityFunction.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/benchmarks/risk/affinity/CacheConsistentHashAffinityFunction.java b/modules/core/src/main/java/org/gridgain/benchmarks/risk/affinity/CacheConsistentHashAffinityFunction.java
new file mode 100644
index 0000000..35be9b8
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/benchmarks/risk/affinity/CacheConsistentHashAffinityFunction.java
@@ -0,0 +1,703 @@
+/*
+ * 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.gridgain.benchmarks.risk.affinity;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.*;
+import org.apache.ignite.internal.util.tostring.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.resources.*;
+import org.jdk8.backport.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+/**
+ * Affinity function for partitioned cache. This function supports the following
+ * configuration:
+ * <ul>
+ * <li>
+ * {@code backups} - Use this flag to control how many back up nodes will be
+ * assigned to every key. The default value is {@code 0}.
+ * </li>
+ * <li>
+ * {@code replicas} - Generally the more replicas a node gets, the more key assignments
+ * it will receive. You can configure different number of replicas for a node by
+ * setting user attribute with name {@link #getReplicaCountAttributeName()} to some
+ * number. Default value is {@code 512} defined by {@link #DFLT_REPLICA_COUNT} constant.
+ * </li>
+ * <li>
+ * {@code backupFilter} - Optional filter for back up nodes. If provided, then only
+ * nodes that pass this filter will be selected as backup nodes. If not provided, then
+ * primary and backup nodes will be selected out of all nodes available for this cache.
+ * </li>
+ * </ul>
+ * <p>
+ * Cache affinity can be configured for individual caches via {@link org.apache.ignite.configuration.CacheConfiguration#getAffinity()} method.
+ */
+@Deprecated
+public class CacheConsistentHashAffinityFunction implements CacheAffinityFunction {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Flag to enable/disable consistency check (for internal use only). */
+ private static final boolean AFFINITY_CONSISTENCY_CHECK = Boolean.getBoolean("IGNITE_AFFINITY_CONSISTENCY_CHECK");
+
+ /** Default number of partitions. */
+ public static final int DFLT_PARTITION_COUNT = 10000;
+
+ /** Default replica count for partitioned caches. */
+ public static final int DFLT_REPLICA_COUNT = 128;
+
+ /**
+ * Name of node attribute to specify number of replicas for a node.
+ * Default value is {@code gg:affinity:node:replicas}.
+ */
+ public static final String DFLT_REPLICA_COUNT_ATTR_NAME = "gg:affinity:node:replicas";
+
+ /** Node hash. */
+ private transient GridConsistentHash<NodeInfo> nodeHash;
+
+ /** Total number of partitions. */
+ private int parts = DFLT_PARTITION_COUNT;
+
+ /** */
+ private int replicas = DFLT_REPLICA_COUNT;
+
+ /** */
+ private String attrName = DFLT_REPLICA_COUNT_ATTR_NAME;
+
+ /** */
+ private boolean exclNeighbors;
+
+ /**
+ * Optional backup filter. First node passed to this filter is primary node,
+ * and second node is a node being tested.
+ */
+ private IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter;
+
+ /** */
+ private CacheAffinityNodeHashResolver hashIdRslvr = new CacheAffinityNodeAddressHashResolver();
+
+ /** Injected grid. */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** Injected cache name. */
+ @CacheNameResource
+ private String cacheName;
+
+ /** Injected logger. */
+ @LoggerResource
+ private IgniteLogger log;
+
+ /** Initialization flag. */
+ @SuppressWarnings("TransientFieldNotInitialized")
+ private transient AtomicBoolean init = new AtomicBoolean();
+
+ /** Latch for initializing. */
+ @SuppressWarnings({"TransientFieldNotInitialized"})
+ private transient CountDownLatch initLatch = new CountDownLatch(1);
+
+ /** Nodes IDs. */
+ @GridToStringInclude
+ @SuppressWarnings({"TransientFieldNotInitialized"})
+ private transient ConcurrentMap<UUID, NodeInfo> addedNodes = new ConcurrentHashMap<>();
+
+ /** Optional backup filter. */
+ @GridToStringExclude
+ private final IgniteBiPredicate<NodeInfo, NodeInfo> backupIdFilter = new IgniteBiPredicate<NodeInfo, NodeInfo>() {
+ @Override public boolean apply(NodeInfo primaryNodeInfo, NodeInfo nodeInfo) {
+ return backupFilter == null || backupFilter.apply(primaryNodeInfo.node(), nodeInfo.node());
+ }
+ };
+
+ /** Map of neighbors. */
+ @SuppressWarnings("TransientFieldNotInitialized")
+ private transient ConcurrentMap<UUID, Collection<UUID>> neighbors =
+ new ConcurrentHashMap8<>();
+
+ /**
+ * Empty constructor with all defaults.
+ */
+ public CacheConsistentHashAffinityFunction() {
+ // No-op.
+ }
+
+ /**
+ * Initializes affinity with flag to exclude same-host-neighbors from being backups of each other
+ * and specified number of backups.
+ * <p>
+ * Note that {@code excludeNeighbors} parameter is ignored if {@code #getBackupFilter()} is set.
+ *
+ * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups
+ * of each other.
+ */
+ public CacheConsistentHashAffinityFunction(boolean exclNeighbors) {
+ this.exclNeighbors = exclNeighbors;
+ }
+
+ /**
+ * Initializes affinity with flag to exclude same-host-neighbors from being backups of each other,
+ * and specified number of backups and partitions.
+ * <p>
+ * Note that {@code excludeNeighbors} parameter is ignored if {@code #getBackupFilter()} is set.
+ *
+ * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups
+ * of each other.
+ * @param parts Total number of partitions.
+ */
+ public CacheConsistentHashAffinityFunction(boolean exclNeighbors, int parts) {
+ A.ensure(parts != 0, "parts != 0");
+
+ this.exclNeighbors = exclNeighbors;
+ this.parts = parts;
+ }
+
+ /**
+ * Initializes optional counts for replicas and backups.
+ * <p>
+ * Note that {@code excludeNeighbors} parameter is ignored if {@code backupFilter} is set.
+ *
+ * @param parts Total number of partitions.
+ * @param backupFilter Optional back up filter for nodes. If provided, backups will be selected
+ * from all nodes that pass this filter. First argument for this filter is primary node, and second
+ * argument is node being tested.
+ * <p>
+ * Note that {@code excludeNeighbors} parameter is ignored if {@code backupFilter} is set.
+ */
+ public CacheConsistentHashAffinityFunction(int parts,
+ @Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
+ A.ensure(parts != 0, "parts != 0");
+
+ this.parts = parts;
+ this.backupFilter = backupFilter;
+ }
+
+ /**
+ * Gets default count of virtual replicas in consistent hash ring.
+ * <p>
+ * To determine node replicas, node attribute with {@link #getReplicaCountAttributeName()}
+ * name will be checked first. If it is absent, then this value will be used.
+ *
+ * @return Count of virtual replicas in consistent hash ring.
+ */
+ public int getDefaultReplicas() {
+ return replicas;
+ }
+
+ /**
+ * Sets default count of virtual replicas in consistent hash ring.
+ * <p>
+ * To determine node replicas, node attribute with {@link #getReplicaCountAttributeName} name
+ * will be checked first. If it is absent, then this value will be used.
+ *
+ * @param replicas Count of virtual replicas in consistent hash ring.s
+ */
+ public void setDefaultReplicas(int replicas) {
+ this.replicas = replicas;
+ }
+
+ /**
+ * Gets total number of key partitions. To ensure that all partitions are
+ * equally distributed across all nodes, please make sure that this
+ * number is significantly larger than a number of nodes. Also, partition
+ * size should be relatively small. Try to avoid having partitions with more
+ * than quarter million keys.
+ * <p>
+ * Note that for fully replicated caches this method should always
+ * return {@code 1}.
+ *
+ * @return Total partition count.
+ */
+ public int getPartitions() {
+ return parts;
+ }
+
+ /**
+ * Sets total number of partitions.
+ *
+ * @param parts Total number of partitions.
+ */
+ public void setPartitions(int parts) {
+ this.parts = parts;
+ }
+
+ /**
+ * Gets hash ID resolver for nodes. This resolver is used to provide
+ * alternate hash ID, other than node ID.
+ * <p>
+ * Node IDs constantly change when nodes get restarted, which causes them to
+ * be placed on different locations in the hash ring, and hence causing
+ * repartitioning. Providing an alternate hash ID, which survives node restarts,
+ * puts node on the same location on the hash ring, hence minimizing required
+ * repartitioning.
+ *
+ * @return Hash ID resolver.
+ */
+ public CacheAffinityNodeHashResolver getHashIdResolver() {
+ return hashIdRslvr;
+ }
+
+ /**
+ * Sets hash ID resolver for nodes. This resolver is used to provide
+ * alternate hash ID, other than node ID.
+ * <p>
+ * Node IDs constantly change when nodes get restarted, which causes them to
+ * be placed on different locations in the hash ring, and hence causing
+ * repartitioning. Providing an alternate hash ID, which survives node restarts,
+ * puts node on the same location on the hash ring, hence minimizing required
+ * repartitioning.
+ *
+ * @param hashIdRslvr Hash ID resolver.
+ */
+ public void setHashIdResolver(CacheAffinityNodeHashResolver hashIdRslvr) {
+ this.hashIdRslvr = hashIdRslvr;
+ }
+
+ /**
+ * Gets optional backup filter. If not {@code null}, backups will be selected
+ * from all nodes that pass this filter. First node passed to this filter is primary node,
+ * and second node is a node being tested.
+ * <p>
+ * Note that {@code excludeNeighbors} parameter is ignored if {@code backupFilter} is set.
+ *
+ * @return Optional backup filter.
+ */
+ @Nullable public IgniteBiPredicate<ClusterNode, ClusterNode> getBackupFilter() {
+ return backupFilter;
+ }
+
+ /**
+ * Sets optional backup filter. If provided, then backups will be selected from all
+ * nodes that pass this filter. First node being passed to this filter is primary node,
+ * and second node is a node being tested.
+ * <p>
+ * Note that {@code excludeNeighbors} parameter is ignored if {@code backupFilter} is set.
+ *
+ * @param backupFilter Optional backup filter.
+ */
+ public void setBackupFilter(@Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
+ this.backupFilter = backupFilter;
+ }
+
+ /**
+ * Gets optional attribute name for replica count. If not provided, the
+ * default is {@link #DFLT_REPLICA_COUNT_ATTR_NAME}.
+ *
+ * @return User attribute name for replica count for a node.
+ */
+ public String getReplicaCountAttributeName() {
+ return attrName;
+ }
+
+ /**
+ * Sets optional attribute name for replica count. If not provided, the
+ * default is {@link #DFLT_REPLICA_COUNT_ATTR_NAME}.
+ *
+ * @param attrName User attribute name for replica count for a node.
+ */
+ public void setReplicaCountAttributeName(String attrName) {
+ this.attrName = attrName;
+ }
+
+ /**
+ * Checks flag to exclude same-host-neighbors from being backups of each other (default is {@code false}).
+ * <p>
+ * Note that {@code excludeNeighbors} parameter is ignored if {@code #getBackupFilter()} is set.
+ *
+ * @return {@code True} if nodes residing on the same host may not act as backups of each other.
+ */
+ public boolean isExcludeNeighbors() {
+ return exclNeighbors;
+ }
+
+ /**
+ * Sets flag to exclude same-host-neighbors from being backups of each other (default is {@code false}).
+ * <p>
+ * Note that {@code excludeNeighbors} parameter is ignored if {@code #getBackupFilter()} is set.
+ *
+ * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups of each other.
+ */
+ public void setExcludeNeighbors(boolean exclNeighbors) {
+ this.exclNeighbors = exclNeighbors;
+ }
+
+ /**
+ * Gets neighbors for a node.
+ *
+ * @param node Node.
+ * @return Neighbors.
+ */
+ private Collection<UUID> neighbors(final ClusterNode node) {
+ Collection<UUID> ns = neighbors.get(node.id());
+
+ if (ns == null) {
+ Collection<ClusterNode> nodes = ignite.cluster().forHost(node).nodes();
+
+ ns = F.addIfAbsent(neighbors, node.id(), new ArrayList<>(F.nodeIds(nodes)));
+ }
+
+ return ns;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override public List<List<ClusterNode>> assignPartitions(CacheAffinityFunctionContext ctx) {
+ List<List<ClusterNode>> res = new ArrayList<>(parts);
+
+ Collection<ClusterNode> topSnapshot = ctx.currentTopologySnapshot();
+
+ for (int part = 0; part < parts; part++) {
+ res.add(F.isEmpty(topSnapshot) ?
+ Collections.<ClusterNode>emptyList() :
+ // Wrap affinity nodes with unmodifiable list since unmodifiable generic collection
+ // doesn't provide equals and hashCode implementations.
+ U.sealList(nodes(part, topSnapshot, ctx.backups())));
+ }
+
+ return res;
+ }
+
+ /**
+ * Assigns nodes to one partition.
+ *
+ * @param part Partition to assign nodes for.
+ * @param nodes Cache topology nodes.
+ * @return Assigned nodes, first node is primary, others are backups.
+ */
+ public Collection<ClusterNode> nodes(int part, Collection<ClusterNode> nodes, int backups) {
+ if (nodes == null)
+ return Collections.emptyList();
+
+ int nodesSize = nodes.size();
+
+ if (nodesSize == 0)
+ return Collections.emptyList();
+
+ if (nodesSize == 1) // Minor optimization.
+ return nodes;
+
+ initialize();
+
+ final Map<NodeInfo, ClusterNode> lookup = new GridLeanMap<>(nodesSize);
+
+ // Store nodes in map for fast lookup.
+ for (ClusterNode n : nodes)
+ // Add nodes into hash circle, if absent.
+ lookup.put(resolveNodeInfo(n), n);
+
+ Collection<NodeInfo> selected;
+
+ if (backupFilter != null) {
+ final IgnitePredicate<NodeInfo> p = new P1<NodeInfo>() {
+ @Override public boolean apply(NodeInfo id) {
+ return lookup.containsKey(id);
+ }
+ };
+
+ final NodeInfo primaryId = nodeHash.node(part, p);
+
+ IgnitePredicate<NodeInfo> backupPrimaryIdFilter = new IgnitePredicate<NodeInfo>() {
+ @Override public boolean apply(NodeInfo node) {
+ return backupIdFilter.apply(primaryId, node);
+ }
+ };
+
+ Collection<NodeInfo> backupIds = nodeHash.nodes(part, backups, p, backupPrimaryIdFilter);
+
+ if (F.isEmpty(backupIds) && primaryId != null) {
+ ClusterNode n = lookup.get(primaryId);
+
+ assert n != null;
+
+ return Collections.singletonList(n);
+ }
+
+ selected = primaryId != null ? F.concat(false, primaryId, backupIds) : backupIds;
+ }
+ else {
+ if (!exclNeighbors) {
+ selected = nodeHash.nodes(part, backups == Integer.MAX_VALUE ? backups : backups + 1, new P1<NodeInfo>() {
+ @Override public boolean apply(NodeInfo id) {
+ return lookup.containsKey(id);
+ }
+ });
+
+ if (selected.size() == 1) {
+ NodeInfo id = F.first(selected);
+
+ assert id != null : "Node ID cannot be null in affinity node ID collection: " + selected;
+
+ ClusterNode n = lookup.get(id);
+
+ assert n != null;
+
+ return Collections.singletonList(n);
+ }
+ }
+ else {
+ int primaryAndBackups = backups + 1;
+
+ selected = new ArrayList<>(primaryAndBackups);
+
+ final Collection<NodeInfo> selected0 = selected;
+
+ List<NodeInfo> ids = nodeHash.nodes(part, primaryAndBackups, new P1<NodeInfo>() {
+ @Override public boolean apply(NodeInfo id) {
+ ClusterNode n = lookup.get(id);
+
+ if (n == null)
+ return false;
+
+ Collection<UUID> neighbors = neighbors(n);
+
+ for (NodeInfo id0 : selected0) {
+ ClusterNode n0 = lookup.get(id0);
+
+ if (n0 == null)
+ return false;
+
+ Collection<UUID> neighbors0 = neighbors(n0);
+
+ if (F.containsAny(neighbors0, neighbors))
+ return false;
+ }
+
+ selected0.add(id);
+
+ return true;
+ }
+ });
+
+ if (AFFINITY_CONSISTENCY_CHECK)
+ assert F.eqOrdered(ids, selected);
+ }
+ }
+
+ Collection<ClusterNode> ret = new ArrayList<>(selected.size());
+
+ for (NodeInfo id : selected) {
+ ClusterNode n = lookup.get(id);
+
+ assert n != null;
+
+ ret.add(n);
+ }
+
+ return ret;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int partition(Object key) {
+ initialize();
+
+ return U.safeAbs(key.hashCode() % parts);
+ }
+
+ /** {@inheritDoc} */
+ @Override public int partitions() {
+ initialize();
+
+ return parts;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void reset() {
+ addedNodes = new ConcurrentHashMap<>();
+ neighbors = new ConcurrentHashMap8<>();
+
+ initLatch = new CountDownLatch(1);
+
+ init = new AtomicBoolean();
+ }
+
+ /** {@inheritDoc} */
+ @Override public void removeNode(UUID nodeId) {
+ NodeInfo info = addedNodes.remove(nodeId);
+
+ if (info == null)
+ return;
+
+ nodeHash.removeNode(info);
+
+ neighbors.clear();
+ }
+
+ /**
+ * Resolve node info for specified node.
+ * Add node to hash circle if this is the first node invocation.
+ *
+ * @param n Node to get info for.
+ * @return Node info.
+ */
+ private NodeInfo resolveNodeInfo(ClusterNode n) {
+ UUID nodeId = n.id();
+ NodeInfo nodeInfo = addedNodes.get(nodeId);
+
+ if (nodeInfo != null)
+ return nodeInfo;
+
+ assert hashIdRslvr != null;
+
+ nodeInfo = new NodeInfo(nodeId, hashIdRslvr.resolve(n), n);
+
+ neighbors.clear();
+
+ nodeHash.addNode(nodeInfo, replicas(n));
+
+ addedNodes.put(nodeId, nodeInfo);
+
+ return nodeInfo;
+ }
+
+ /** {@inheritDoc} */
+ private void initialize() {
+ if (!init.get() && init.compareAndSet(false, true)) {
+ if (log.isInfoEnabled())
+ log.info("Consistent hash configuration [cacheName=" + cacheName + ", partitions=" + parts +
+ ", excludeNeighbors=" + exclNeighbors + ", replicas=" + replicas +
+ ", backupFilter=" + backupFilter + ", hashIdRslvr=" + hashIdRslvr + ']');
+
+ nodeHash = new GridConsistentHash<>();
+
+ initLatch.countDown();
+ }
+ else {
+ if (initLatch.getCount() > 0) {
+ try {
+ U.await(initLatch);
+ }
+ catch (IgniteInterruptedCheckedException ignored) {
+ // Recover interrupted state flag.
+ Thread.currentThread().interrupt();
+ }
+ }
+ }
+ }
+
+ /**
+ * @param n Node.
+ * @return Replicas.
+ */
+ private int replicas(ClusterNode n) {
+ Integer nodeReplicas = n.attribute(attrName);
+
+ if (nodeReplicas == null)
+ nodeReplicas = replicas;
+
+ return nodeReplicas;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(CacheConsistentHashAffinityFunction.class, this);
+ }
+
+ /**
+ * Node hash ID.
+ */
+ private static final class NodeInfo implements Comparable<NodeInfo> {
+ /** Node ID. */
+ private UUID nodeId;
+
+ /** Hash ID. */
+ private Object hashId;
+
+ /** Grid node. */
+ private ClusterNode node;
+
+ /**
+ * @param nodeId Node ID.
+ * @param hashId Hash ID.
+ * @param node Rich node.
+ */
+ private NodeInfo(UUID nodeId, Object hashId, ClusterNode node) {
+ assert nodeId != null;
+ assert hashId != null;
+
+ this.hashId = hashId;
+ this.nodeId = nodeId;
+ this.node = node;
+ }
+
+ /**
+ * @return Node ID.
+ */
+ public UUID nodeId() {
+ return nodeId;
+ }
+
+ /**
+ * @return Hash ID.
+ */
+ public Object hashId() {
+ return hashId;
+ }
+
+ /**
+ * @return Node.
+ */
+ public ClusterNode node() {
+ return node;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ return hashId.hashCode();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object obj) {
+ if (!(obj instanceof NodeInfo))
+ return false;
+
+ NodeInfo that = (NodeInfo)obj;
+
+ // If objects are equal, hash codes should be the same.
+ // Cannot use that.hashId.equals(hashId) due to Comparable<N> interface restrictions.
+ return that.nodeId.equals(nodeId) && that.hashCode() == hashCode();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int compareTo(NodeInfo o) {
+ int diff = nodeId.compareTo(o.nodeId);
+
+ if (diff == 0) {
+ int h1 = hashCode();
+ int h2 = o.hashCode();
+
+ diff = h1 == h2 ? 0 : (h1 < h2 ? -1 : 1);
+ }
+
+ return diff;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(NodeInfo.class, this);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedAffinitySpreadTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedAffinitySpreadTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedAffinitySpreadTest.java
index b651e8a..47ccb5e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedAffinitySpreadTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePartitionedAffinitySpreadTest.java
@@ -17,7 +17,7 @@
package org.apache.ignite.internal.processors.cache;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.testframework.*;
@@ -25,8 +25,6 @@ import org.apache.ignite.testframework.junits.common.*;
import java.util.*;
-import static org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction.*;
-
/**
*
*/
@@ -44,7 +42,7 @@ public class GridCachePartitionedAffinitySpreadTest extends GridCommonAbstractTe
for (int replicas = 128; replicas <= 4096; replicas*=2) {
Collection<ClusterNode> nodes = createNodes(i, replicas);
- CacheConsistentHashAffinityFunction aff = new CacheConsistentHashAffinityFunction(false, 10000);
+ CacheRendezvousAffinityFunction aff = new CacheRendezvousAffinityFunction(false, 10000);
checkDistribution(aff, nodes);
}
@@ -71,11 +69,11 @@ public class GridCachePartitionedAffinitySpreadTest extends GridCommonAbstractTe
* @param aff Affinity to check.
* @param nodes Collection of nodes to test on.
*/
- private void checkDistribution(CacheConsistentHashAffinityFunction aff, Collection<ClusterNode> nodes) {
+ private void checkDistribution(CacheRendezvousAffinityFunction aff, Collection<ClusterNode> nodes) {
Map<ClusterNode, Integer> parts = new HashMap<>(nodes.size());
for (int part = 0; part < aff.getPartitions(); part++) {
- Collection<ClusterNode> affNodes = aff.nodes(part, nodes, 0);
+ Collection<ClusterNode> affNodes = aff.assignPartition(part, new ArrayList(nodes), 0, null);
assertEquals(1, affNodes.size());
@@ -112,8 +110,7 @@ public class GridCachePartitionedAffinitySpreadTest extends GridCommonAbstractTe
m2 /= (n - 1);
assertEquals(aff.getPartitions(), total);
- System.out.printf("%6s, %6s, %6s, %6s, %8.4f\n", nodes.size(),
- F.first(nodes).attribute(DFLT_REPLICA_COUNT_ATTR_NAME), min, max, Math.sqrt(m2));
+ System.out.printf("%6s, %6s, %6s, %8.4f\n", nodes.size(),min, max, Math.sqrt(m2));
}
/**
@@ -158,9 +155,6 @@ public class GridCachePartitionedAffinitySpreadTest extends GridCommonAbstractTe
/** {@inheritDoc} */
@Override public <T> T attribute(String name) {
- if (DFLT_REPLICA_COUNT_ATTR_NAME.equals(name))
- return (T)new Integer(replicas);
-
return super.attribute(name);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d07931d2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java
index 9cf7283..1559a24 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.processors.cache.distributed.near;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
@@ -41,7 +41,6 @@ import static org.apache.ignite.cache.CacheAtomicityMode.*;
import static org.apache.ignite.cache.CacheDistributionMode.*;
import static org.apache.ignite.cache.CacheMode.*;
import static org.apache.ignite.cache.CachePreloadMode.*;
-import static org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction.*;
import static org.apache.ignite.events.EventType.*;
/**
@@ -114,7 +113,7 @@ public class GridCachePartitionedAffinitySelfTest extends GridCommonAbstractTest
/** Test predefined affinity - must be ported to all clients. */
@SuppressWarnings("UnaryPlus")
public void testPredefined() throws IgniteCheckedException {
- CacheConsistentHashAffinityFunction aff = new CacheConsistentHashAffinityFunction();
+ CacheRendezvousAffinityFunction aff = new CacheRendezvousAffinityFunction();
getTestResources().inject(aff);
@@ -190,40 +189,19 @@ public class GridCachePartitionedAffinitySelfTest extends GridCommonAbstractTest
data.put(-1.7976931348623157E+308, 6);
data.put(+4.9E-324, 7);
data.put(-4.9E-324, 7);
-
- boolean ok = true;
-
- for (Map.Entry<Object, Integer> entry : data.entrySet()) {
- int part = aff.partition(entry.getKey());
- Collection<ClusterNode> affNodes = aff.nodes(part, nodes, 1);
- UUID act = F.first(affNodes).id();
- UUID exp = nodes.get(entry.getValue()).id();
-
- if (!exp.equals(act)) {
- ok = false;
-
- info("Failed to validate affinity for key '" + entry.getKey() + "' [expected=" + exp +
- ", actual=" + act + ".");
- }
- }
-
- if (ok)
- return;
-
- fail("Server partitioned affinity validation fails.");
}
/** Test predefined affinity - must be ported to other clients. */
@SuppressWarnings("UnaryPlus")
public void testPredefinedHashIdResolver() throws IgniteCheckedException {
// Use Md5 hasher for this test.
- CacheConsistentHashAffinityFunction aff = new CacheConsistentHashAffinityFunction();
+ CacheRendezvousAffinityFunction aff = new CacheRendezvousAffinityFunction();
getTestResources().inject(aff);
aff.setHashIdResolver(new CacheAffinityNodeHashResolver() {
@Override public Object resolve(ClusterNode node) {
- return node.attribute(DFLT_REPLICA_COUNT_ATTR_NAME);
+ return null;
}
});
@@ -297,27 +275,6 @@ public class GridCachePartitionedAffinitySelfTest extends GridCommonAbstractTest
data.put(-1.7976931348623157E+308, 1);
data.put(+4.9E-324, 1);
data.put(-4.9E-324, 1);
-
- boolean ok = true;
-
- for (Map.Entry<Object, Integer> entry : data.entrySet()) {
- int part = aff.partition(entry.getKey());
-
- UUID exp = nodes.get(entry.getValue()).id();
- UUID act = F.first(aff.nodes(part, nodes, 1)).id();
-
- if (!exp.equals(act)) {
- ok = false;
-
- info("Failed to validate affinity for key '" + entry.getKey() + "' [expected=" + exp +
- ", actual=" + act + ".");
- }
- }
-
- if (ok)
- return;
-
- fail("Server partitioned affinity validation fails.");
}
/**
@@ -330,8 +287,6 @@ public class GridCachePartitionedAffinitySelfTest extends GridCommonAbstractTest
private ClusterNode createNode(String nodeId, int replicaCnt) {
GridTestNode node = new GridTestNode(UUID.fromString(nodeId));
- node.setAttribute(DFLT_REPLICA_COUNT_ATTR_NAME, replicaCnt);
-
return node;
}
[03/50] incubator-ignite git commit: # ignite-237 minor
Posted by sb...@apache.org.
# ignite-237 minor
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4a356f81
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4a356f81
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4a356f81
Branch: refs/heads/sprint-2
Commit: 4a356f8195a44c10b8b30d7fabc0a77df6cb60a9
Parents: 972644d
Author: sboikov <sb...@gridgain.com>
Authored: Thu Feb 26 09:17:38 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Feb 26 09:17:38 2015 +0300
----------------------------------------------------------------------
.../dht/GridCacheDhtEvictionNearReadersSelfTest.java | 2 +-
.../distributed/near/GridCachePartitionedFullApiSelfTest.java | 6 ------
.../continuous/GridCacheContinuousQueryAbstractSelfTest.java | 1 -
3 files changed, 1 insertion(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4a356f81/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
index d8cc525..6d43df5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
@@ -171,7 +171,7 @@ public class GridCacheDhtEvictionNearReadersSelfTest extends GridCommonAbstractT
CacheRendezvousAffinityFunction aff = (CacheRendezvousAffinityFunction) grid(0).jcache(null).
getConfiguration(CacheConfiguration.class).getAffinity();
- return aff.assignPartition(aff.partition(key), new ArrayList<ClusterNode>(grid(0).cluster().nodes()), 1, null);
+ return aff.assignPartition(aff.partition(key), new ArrayList<>(grid(0).cluster().nodes()), 1, null);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4a356f81/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java
index 5c381bb..cfdc105 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java
@@ -17,17 +17,11 @@
package org.apache.ignite.internal.processors.cache.distributed.near;
-import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.util.typedef.*;
-
-import javax.cache.*;
-import java.util.*;
import static org.apache.ignite.cache.CacheMode.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4a356f81/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
index 9db6136..a69ce36 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
@@ -117,7 +117,6 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
/** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
startGridsMultiThreaded(gridCount());
- awaitPartitionMapExchange();
}
/** {@inheritDoc} */
[48/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/sprint-2' into ignite-237
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-237
Conflicts:
modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9efcd803
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9efcd803
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9efcd803
Branch: refs/heads/sprint-2
Commit: 9efcd8035dd74977f44ce7ab6ebd989b57e57482
Parents: 5a76d70 b2675bc
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Mar 2 18:03:07 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Mar 2 18:03:07 2015 +0300
----------------------------------------------------------------------
examples/pom-standalone.xml | 2 +-
.../java/org/apache/ignite/IgniteCluster.java | 8 +-
.../configuration/IgniteConfiguration.java | 5 +-
.../ignite/internal/GridKernalContext.java | 10 +-
.../ignite/internal/GridKernalContextImpl.java | 14 +-
.../apache/ignite/internal/IgniteKernal.java | 23 +-
.../org/apache/ignite/internal/IgnitionEx.java | 592 +++++++++----------
.../affinity/GridAffinityAssignmentCache.java | 13 +-
.../processors/cache/CacheMetricsImpl.java | 4 +
.../processors/cache/GridCacheContext.java | 19 +
.../processors/cache/GridCacheMapEntry.java | 9 +
.../processors/cache/GridCacheProcessor.java | 15 +
.../processors/cache/GridCacheStoreManager.java | 12 +-
.../GridDistributedCacheAdapter.java | 2 +
.../distributed/dht/GridDhtCacheEntry.java | 3 +
.../distributed/dht/GridDhtLocalPartition.java | 5 +
.../dht/atomic/GridDhtAtomicCache.java | 2 +-
.../dht/colocated/GridDhtColocatedCache.java | 2 +-
.../cache/transactions/IgniteTxManager.java | 7 +-
.../processors/cluster/ClusterProcessor.java | 46 ++
.../dataload/IgniteDataLoaderImpl.java | 29 +-
.../ignite/internal/visor/cache/VisorCache.java | 190 ++----
.../cache/VisorCacheAffinityConfiguration.java | 51 +-
.../visor/cache/VisorCacheConfiguration.java | 484 +++------------
.../cache/VisorCacheDefaultConfiguration.java | 27 +-
.../cache/VisorCacheEvictionConfiguration.java | 81 +--
.../cache/VisorCacheNearConfiguration.java | 42 +-
.../cache/VisorCachePreloadConfiguration.java | 54 +-
.../cache/VisorCacheStoreConfiguration.java | 148 ++++-
.../VisorCacheWriteBehindConfiguration.java | 137 -----
.../visor/node/VisorAtomicConfiguration.java | 27 +-
.../visor/node/VisorBasicConfiguration.java | 180 +-----
.../node/VisorCacheQueryConfiguration.java | 45 +-
.../node/VisorExecutorServiceConfiguration.java | 54 +-
.../visor/node/VisorGridConfiguration.java | 177 +-----
.../visor/node/VisorIgfsConfiguration.java | 244 +-------
.../visor/node/VisorLifecycleConfiguration.java | 9 +-
.../visor/node/VisorMetricsConfiguration.java | 29 +-
.../node/VisorPeerToPeerConfiguration.java | 28 +-
.../visor/node/VisorQueryConfiguration.java | 65 +-
.../visor/node/VisorRestConfiguration.java | 80 +--
.../node/VisorSegmentationConfiguration.java | 45 +-
.../visor/node/VisorSpisConfiguration.java | 92 +--
.../node/VisorTransactionConfiguration.java | 62 +-
.../internal/visor/util/VisorTaskUtils.java | 4 +-
.../core/src/main/resources/ignite.properties | 2 +-
.../core/src/test/config/store/jdbc/Ignite.xml | 63 +-
.../GridCacheAbstractLocalStoreSelfTest.java | 440 ++++++++++++++
.../cache/GridCacheAbstractMetricsSelfTest.java | 42 ++
...acheAbstractUsersAffinityMapperSelfTest.java | 207 +++++++
...dCacheAtomicUsersAffinityMapperSelfTest.java | 45 ++
.../GridCachePartitionedLocalStoreSelfTest.java | 51 ++
...chePartitionedOffHeapLocalStoreSelfTest.java | 56 ++
.../GridCacheReplicatedLocalStoreSelfTest.java | 51 ++
...heReplicatedUsersAffinityMapperSelfTest.java | 45 ++
...ridCacheTxPartitionedLocalStoreSelfTest.java | 51 ++
.../GridCacheTxUsersAffinityMapperSelfTest.java | 45 ++
.../GridCacheQueueCleanupSelfTest.java | 1 -
.../IgniteCacheExpiryPolicyAbstractTest.java | 38 +-
.../ignite/testsuites/IgniteCacheTestSuite.java | 4 +
modules/scalar/pom.xml | 6 +
.../ignite/schema/generator/XmlGenerator.java | 8 +-
.../apache/ignite/schema/model/PojoField.java | 11 +-
.../apache/ignite/schema/load/model/Ignite.xml | 133 +++--
.../commands/cache/VisorCacheCommand.scala | 25 +-
.../yardstick/config/ignite-store-config.xml | 15 +-
pom.xml | 4 +-
67 files changed, 2105 insertions(+), 2415 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9efcd803/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9efcd803/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
index 47a2cf4,0f6a84f..6ff2d2d
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
@@@ -69,10 -71,12 +69,11 @@@ public class VisorCacheAffinityConfigur
VisorCacheAffinityConfiguration cfg = new VisorCacheAffinityConfiguration();
- cfg.function(compactClass(aff));
- cfg.mapper(compactClass(ccfg.getAffinityMapper()));
- cfg.partitionedBackups(ccfg.getBackups());
- cfg.excludeNeighbors(excludeNeighbors);
+ cfg.function = compactClass(aff);
+ cfg.mapper = compactClass(ccfg.getAffinityMapper());
+ cfg.partitions = aff.partitions();
+ cfg.partitionedBackups = ccfg.getBackups();
- cfg.dfltReplicas = dfltReplicas;
+ cfg.excludeNeighbors = excludeNeighbors;
return cfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9efcd803/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
[49/50] incubator-ignite git commit: #ignite-237: change client test.
Posted by sb...@apache.org.
#ignite-237: change client test.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f144a892
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f144a892
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f144a892
Branch: refs/heads/sprint-2
Commit: f144a892e9747b297610f7d9d19c44f362dd4b1f
Parents: 9efcd80
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Mar 2 19:29:55 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Mar 2 19:29:55 2015 +0300
----------------------------------------------------------------------
.../client/integration/ClientAbstractMultiNodeSelfTest.java | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f144a892/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
index e73f06d..9257b71 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientAbstractMultiNodeSelfTest.java
@@ -403,8 +403,6 @@ public abstract class ClientAbstractMultiNodeSelfTest extends GridCommonAbstract
if (affinity(cache).isPrimaryOrBackup(g.cluster().localNode(), key))
assertEquals("zzz", cache.localPeek(key, CachePeekMode.ONHEAP));
- else
- assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
}
}
[07/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/sprint-2' into ignite-237
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-237
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8be8fb80
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8be8fb80
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8be8fb80
Branch: refs/heads/sprint-2
Commit: 8be8fb80d422eaefea3eec5b6e4fb8bfb107c1b7
Parents: 1ca603e 9c3ba04
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 11:37:51 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 11:37:51 2015 +0300
----------------------------------------------------------------------
modules/hadoop/pom.xml | 10 ----------
1 file changed, 10 deletions(-)
----------------------------------------------------------------------
[43/50] incubator-ignite git commit: Merge branch 'ignite-237' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-237
Posted by sb...@apache.org.
Merge branch 'ignite-237' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-237
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6531cbd1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6531cbd1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6531cbd1
Branch: refs/heads/sprint-2
Commit: 6531cbd1d7e6fa937f8536e349c8e8dd9631c17c
Parents: b378307 10ac88a
Author: ivasilinets <va...@gmail.com>
Authored: Sun Mar 1 21:23:31 2015 +0300
Committer: ivasilinets <va...@gmail.com>
Committed: Sun Mar 1 21:23:31 2015 +0300
----------------------------------------------------------------------
.../ClientAbstractMultiThreadedSelfTest.java | 38 +-
.../impl/ClientPartitionAffinitySelfTest.java | 87 +--
.../ClientAbstractMultiNodeSelfTest.java | 53 +-
.../integration/ClientAbstractSelfTest.java | 8 -
.../src/test/resources/spring-server-node.xml | 2 +-
.../test/resources/spring-server-ssl-node.xml | 2 +-
.../java/org/apache/ignite/cache/GridCache.java | 2 +-
.../CacheConsistentHashAffinityFunction.java | 703 -------------------
.../cache/affinity/consistenthash/package.html | 24 -
.../CacheRendezvousAffinityFunction.java | 2 +-
.../configuration/CacheConfiguration.java | 2 +-
.../processors/cache/GridCacheAttributes.java | 32 +-
.../processors/cache/GridCacheProcessor.java | 21 +-
.../top/GridTopologyCommandHandler.java | 8 -
.../cache/VisorCacheAffinityConfiguration.java | 9 +-
.../config/load/dsi-49-server-production.xml | 2 +-
.../GridCacheAffinityBackupsSelfTest.java | 9 -
.../ignite/IgniteCacheAffinitySelfTest.java | 30 +-
...AffinityProcessorConsistentHashSelfTest.java | 31 -
...idCacheConfigurationConsistencySelfTest.java | 46 +-
...ridCacheConfigurationValidationSelfTest.java | 8 +-
.../GridCachePartitionedAffinitySpreadTest.java | 16 +-
.../IgniteClientAffinityAssignmentSelfTest.java | 16 +-
.../GridCacheClientModesAbstractSelfTest.java | 4 +-
...dCachePartitionedAffinityFilterSelfTest.java | 6 +-
...GridCachePreloadRestartAbstractSelfTest.java | 4 +-
.../dht/GridCacheColocatedDebugTest.java | 4 +-
.../dht/GridCacheDhtEntrySelfTest.java | 4 +-
...GridCacheDhtEvictionNearReadersSelfTest.java | 6 +-
.../dht/GridCacheDhtEvictionSelfTest.java | 14 +-
.../dht/GridCacheDhtInternalEntrySelfTest.java | 4 +-
.../dht/GridCacheDhtPreloadBigDataSelfTest.java | 4 +-
.../dht/GridCacheDhtPreloadDelayedSelfTest.java | 4 +-
.../GridCacheDhtPreloadDisabledSelfTest.java | 4 +-
.../GridCacheDhtPreloadMessageCountTest.java | 4 +-
...ridCacheDhtPreloadMultiThreadedSelfTest.java | 4 +-
.../dht/GridCacheDhtPreloadSelfTest.java | 4 +-
.../GridCacheDhtPreloadStartStopSelfTest.java | 4 +-
.../dht/GridCacheDhtPreloadUnloadSelfTest.java | 4 +-
.../distributed/dht/GridCacheDhtTestUtils.java | 6 +-
...dCachePartitionedTopologyChangeSelfTest.java | 7 +-
...ridCachePartitionedUnloadEventsSelfTest.java | 5 +-
...ffinityFunctionExcludeNeighborsSelfTest.java | 32 -
...AffinityExcludeNeighborsPerformanceTest.java | 4 +-
...rtitionedAffinityHashIdResolverSelfTest.java | 4 +-
.../GridCachePartitionedAffinitySelfTest.java | 226 ------
.../GridCachePartitionedFullApiSelfTest.java | 6 +-
.../GridCachePartitionedNodeRestartTest.java | 4 +-
...ePartitionedOptimisticTxNodeRestartTest.java | 4 +-
.../GridCachePartitionedTxSalvageSelfTest.java | 4 +-
...cheSynchronousEvictionsFailoverSelfTest.java | 4 +-
...ridCacheContinuousQueryAbstractSelfTest.java | 19 +-
...idOffHeapPartitionedMapAbstractSelfTest.java | 4 +-
...apPartitionedMapPerformanceAbstractTest.java | 4 +-
...GridUnsafePartitionedMapPerformanceTest.java | 4 +-
.../capacity/spring-capacity-cache.xml | 2 +-
.../loadtests/colocation/spring-colocation.xml | 2 +-
.../GridCachePartitionedAtomicLongLoadTest.java | 4 +-
...apPartitionedMapPerformanceAbstractTest.java | 4 +-
...GridUnsafePartitionedMapPerformanceTest.java | 4 +-
.../ignite/testframework/GridTestUtils.java | 11 +-
.../ignite/testsuites/IgniteBasicTestSuite.java | 1 -
.../ignite/testsuites/IgniteCacheTestSuite.java | 1 -
.../hibernate/HibernateL2CacheSelfTest.java | 8 +-
64 files changed, 149 insertions(+), 1454 deletions(-)
----------------------------------------------------------------------
[40/50] incubator-ignite git commit: #ignite-237: remove unused
imports.
Posted by sb...@apache.org.
#ignite-237: remove unused imports.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8e587386
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8e587386
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8e587386
Branch: refs/heads/sprint-2
Commit: 8e587386d284373dbd6ac310dfcb2a9369236867
Parents: 5692d7e
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 19:46:58 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 19:46:58 2015 +0300
----------------------------------------------------------------------
.../internal/client/impl/ClientPartitionAffinitySelfTest.java | 4 ----
1 file changed, 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8e587386/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
index dde345e..7ece534 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientPartitionAffinitySelfTest.java
@@ -17,12 +17,8 @@
package org.apache.ignite.internal.client.impl;
-import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.client.*;
-import org.apache.ignite.internal.processors.affinity.*;
-import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.testframework.*;
import org.apache.ignite.testframework.junits.common.*;
[42/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/sprint-2' into ignite-237
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-237
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b378307e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b378307e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b378307e
Branch: refs/heads/sprint-2
Commit: b378307eaef5e41a5de0cff33c7265cec9729d61
Parents: f27e9d2 036bd71
Author: ivasilinets <va...@gmail.com>
Authored: Sun Mar 1 21:22:32 2015 +0300
Committer: ivasilinets <va...@gmail.com>
Committed: Sun Mar 1 21:22:32 2015 +0300
----------------------------------------------------------------------
config/hadoop/default-config.xml | 12 +
config/ignite-log4j.xml | 2 +-
.../ComputeFibonacciContinuationExample.java | 15 +-
.../datagrid/CacheContinuousQueryExample.java | 2 +-
.../store/CacheNodeWithStoreStartup.java | 6 +-
.../store/jdbc/CacheJdbcPersonStore.java | 115 +-
.../examples/ScalarContinuationExample.scala | 15 +-
ipc/shmem/Makefile.am | 15 +
ipc/shmem/igniteshmem/Makefile.am | 15 +
ipc/shmem/include/Makefile.am | 15 +
modules/clients/src/test/keystore/generate.sh | 15 +-
.../src/main/java/org/apache/ignite/Ignite.java | 4 +-
.../main/java/org/apache/ignite/IgniteFs.java | 2 +-
.../ignite/cache/query/ContinuousQuery.java | 18 +-
.../apache/ignite/cache/store/CacheStore.java | 4 +-
.../ignite/cache/store/CacheStoreAdapter.java | 2 +-
.../ignite/cache/store/CacheStoreSession.java | 17 +-
.../apache/ignite/cluster/ClusterMetrics.java | 2 +-
.../configuration/QueryConfiguration.java | 37 +-
.../ignite/events/DiscoveryCustomEvent.java | 56 -
.../org/apache/ignite/events/EventType.java | 14 +-
.../java/org/apache/ignite/igfs/IgfsMode.java | 6 +-
.../java/org/apache/ignite/igfs/package.html | 2 +-
.../apache/ignite/internal/GridProperties.java | 78 -
.../ignite/internal/GridUpdateNotifier.java | 2 +-
.../apache/ignite/internal/IgniteKernal.java | 18 +-
.../ignite/internal/IgniteProperties.java | 79 +
.../ignite/internal/IgniteVersionUtils.java | 8 +-
.../internal/events/DiscoveryCustomEvent.java | 71 +
.../discovery/GridDiscoveryManager.java | 7 +-
.../processors/cache/GridCacheStoreManager.java | 6 +-
.../processors/cache/IgniteCacheProxy.java | 6 +-
.../plugin/IgnitePluginProcessor.java | 24 +
.../cache/VisorCacheMetricsCollectorTask.java | 10 +-
.../visor/node/VisorBasicConfiguration.java | 17 -
.../node/VisorNodeEventsCollectorTask.java | 10 +-
.../internal/visor/node/VisorNodeGcTask.java | 10 +-
.../internal/visor/node/VisorNodePingTask.java | 10 +-
.../optimized-classnames.previous.properties | 15 +
.../optimized/optimized-classnames.properties | 1565 +-----------------
.../apache/ignite/plugin/PluginProvider.java | 5 +
.../spi/discovery/tcp/TcpDiscoverySpi.java | 9 +-
.../TcpDiscoveryCustomEventMessage.java | 3 +
.../internal/GridDiscoveryEventSelfTest.java | 9 +-
.../internal/GridUpdateNotifierSelfTest.java | 2 +-
...ridCacheContinuousQueryAbstractSelfTest.java | 8 +-
...dStartupWithUndefinedIgniteHomeSelfTest.java | 103 ++
.../config/GridTestProperties.java | 10 +-
.../junits/cache/TestCacheSession.java | 5 +
.../cache/TestThreadLocalCacheSession.java | 5 +
.../testsuites/IgniteKernalSelfTestSuite.java | 1 +
modules/extdata/p2p/pom.xml | 6 -
modules/hadoop/pom.xml | 10 -
.../client/hadoop/GridHadoopClientProtocol.java | 6 +-
.../hadoop/IgfsHadoopFileSystemWrapper.java | 412 +++++
.../igfs/hadoop/v1/IgfsHadoopFileSystem.java | 3 +-
.../igfs/hadoop/v2/IgfsHadoopFileSystem.java | 3 +-
.../java/org/apache/ignite/igfs/package.html | 2 +-
.../igfs/hadoop/IgfsHadoopFSProperties.java | 10 +-
.../hadoop/IgfsHadoopFileSystemWrapper.java | 413 -----
.../internal/igfs/hadoop/IgfsHadoopReader.java | 2 +-
.../internal/igfs/hadoop/IgfsHadoopUtils.java | 4 +-
.../hadoop/GridHadoopClassLoader.java | 12 +-
.../processors/hadoop/GridHadoopSetup.java | 8 +-
.../processors/hadoop/GridHadoopUtils.java | 4 +-
.../collections/GridHadoopHashMultimapBase.java | 2 +-
.../GridHadoopExternalCommunication.java | 14 +-
.../hadoop/v1/GridHadoopV1MapTask.java | 6 +-
.../v2/GridHadoopV2JobResourceManager.java | 2 +-
.../GridHadoopClientProtocolSelfTest.java | 6 +-
.../apache/ignite/igfs/IgfsEventsTestSuite.java | 2 +-
.../IgfsHadoop20FileSystemAbstractSelfTest.java | 2 +-
.../igfs/IgfsHadoopDualAbstractSelfTest.java | 2 +-
.../IgfsHadoopFileSystemAbstractSelfTest.java | 1 +
...fsHadoopFileSystemSecondaryModeSelfTest.java | 2 +-
.../hadoop/GridHadoopGroupingTest.java | 4 +-
.../igfs/IgfsPerformanceBenchmark.java | 9 +-
.../testsuites/IgniteHadoopTestSuite.java | 7 +-
modules/hibernate/pom.xml | 6 -
.../HibernateReadWriteAccessStrategy.java | 81 +-
modules/indexing/pom.xml | 6 -
modules/jta/pom.xml | 6 -
modules/scalar/pom.xml | 6 -
modules/spring/pom.xml | 6 -
modules/visor-console/pom.xml | 7 -
.../commands/alert/VisorAlertCommand.scala | 8 +-
.../commands/cache/VisorCacheCommand.scala | 82 +-
.../config/VisorConfigurationCommand.scala | 140 +-
.../commands/disco/VisorDiscoveryCommand.scala | 2 +-
.../scala/org/apache/ignite/visor/visor.scala | 64 +-
.../commands/tasks/VisorTasksCommandSpec.scala | 2 +-
modules/web/pom.xml | 6 -
modules/winservice/IgniteService.sln | 2 +-
.../IgniteService/IgniteService.csproj | 2 +-
.../config/benchmark-atomic-win.properties | 15 +
.../config/benchmark-atomic.properties | 15 +
.../config/benchmark-compute-win.properties | 15 +
.../config/benchmark-compute.properties | 15 +
.../config/benchmark-multicast.properties | 15 +
.../config/benchmark-query-win.properties | 15 +
.../yardstick/config/benchmark-query.properties | 15 +
.../config/benchmark-tx-win.properties | 15 +
.../yardstick/config/benchmark-tx.properties | 15 +
.../yardstick/config/benchmark-win.properties | 15 +
modules/yardstick/config/benchmark.properties | 15 +
pom.xml | 150 +-
106 files changed, 1568 insertions(+), 2614 deletions(-)
----------------------------------------------------------------------
[33/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/sprint-2' into ignite-237
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/sprint-2' into ignite-237
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/bcf802d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/bcf802d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/bcf802d9
Branch: refs/heads/sprint-2
Commit: bcf802d9a235b0a0e451bd2ac50ec0369e02f76b
Parents: 148ca09 dd66167
Author: sboikov <sb...@gridgain.com>
Authored: Fri Feb 27 16:56:52 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Feb 27 16:56:52 2015 +0300
----------------------------------------------------------------------
config/hadoop/default-config.xml | 12 +
.../src/main/java/org/apache/ignite/Ignite.java | 4 +-
.../configuration/QueryConfiguration.java | 37 +-
.../java/org/apache/ignite/igfs/IgfsMode.java | 6 +-
.../config/GridTestProperties.java | 10 +-
.../client/hadoop/GridHadoopClientProtocol.java | 6 +-
.../hadoop/IgfsHadoopFileSystemWrapper.java | 412 ++++++++++++++++++
.../igfs/hadoop/v1/IgfsHadoopFileSystem.java | 3 +-
.../igfs/hadoop/v2/IgfsHadoopFileSystem.java | 3 +-
.../igfs/hadoop/IgfsHadoopFSProperties.java | 10 +-
.../hadoop/IgfsHadoopFileSystemWrapper.java | 413 -------------------
.../internal/igfs/hadoop/IgfsHadoopReader.java | 2 +-
.../internal/igfs/hadoop/IgfsHadoopUtils.java | 4 +-
.../hadoop/GridHadoopClassLoader.java | 12 +-
.../processors/hadoop/GridHadoopSetup.java | 8 +-
.../processors/hadoop/GridHadoopUtils.java | 4 +-
.../collections/GridHadoopHashMultimapBase.java | 2 +-
.../GridHadoopExternalCommunication.java | 14 +-
.../hadoop/v1/GridHadoopV1MapTask.java | 6 +-
.../v2/GridHadoopV2JobResourceManager.java | 2 +-
.../GridHadoopClientProtocolSelfTest.java | 6 +-
.../apache/ignite/igfs/IgfsEventsTestSuite.java | 2 +-
.../IgfsHadoop20FileSystemAbstractSelfTest.java | 2 +-
.../igfs/IgfsHadoopDualAbstractSelfTest.java | 2 +-
.../IgfsHadoopFileSystemAbstractSelfTest.java | 1 +
...fsHadoopFileSystemSecondaryModeSelfTest.java | 2 +-
.../hadoop/GridHadoopGroupingTest.java | 4 +-
.../igfs/IgfsPerformanceBenchmark.java | 9 +-
28 files changed, 530 insertions(+), 468 deletions(-)
----------------------------------------------------------------------
[16/50] incubator-ignite git commit: #ignite-237: change affinity
function in tests.
Posted by sb...@apache.org.
#ignite-237: change affinity function in tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f358766f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f358766f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f358766f
Branch: refs/heads/sprint-2
Commit: f358766f944714acb29a9df313db70dd4ff01f8e
Parents: 7d8b54f
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 16:09:03 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 16:09:03 2015 +0300
----------------------------------------------------------------------
.../distributed/GridCachePreloadRestartAbstractSelfTest.java | 4 ++--
.../dht/GridCachePartitionedTopologyChangeSelfTest.java | 7 +++----
.../dht/GridCachePartitionedUnloadEventsSelfTest.java | 5 ++---
.../distributed/near/GridCachePartitionedNodeRestartTest.java | 4 ++--
.../near/GridCachePartitionedOptimisticTxNodeRestartTest.java | 4 ++--
.../near/GridCachePartitionedTxSalvageSelfTest.java | 4 ++--
.../GridCacheSynchronousEvictionsFailoverSelfTest.java | 4 ++--
.../offheap/GridOffHeapPartitionedMapAbstractSelfTest.java | 4 ++--
.../GridOffHeapPartitionedMapPerformanceAbstractTest.java | 4 ++--
.../GridCachePartitionedAtomicLongLoadTest.java | 4 ++--
.../GridOffHeapPartitionedMapPerformanceAbstractTest.java | 4 ++--
.../unsafe/GridUnsafePartitionedMapPerformanceTest.java | 4 ++--
12 files changed, 25 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f358766f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePreloadRestartAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePreloadRestartAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePreloadRestartAbstractSelfTest.java
index da111a6..f3ba5c8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePreloadRestartAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePreloadRestartAbstractSelfTest.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.processors.cache.distributed;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.spi.discovery.tcp.*;
@@ -114,7 +114,7 @@ public abstract class GridCachePreloadRestartAbstractSelfTest extends GridCommon
cc.setStartSize(20);
cc.setPreloadMode(preloadMode);
cc.setPreloadBatchSize(preloadBatchSize);
- cc.setAffinity(new CacheConsistentHashAffinityFunction(false, partitions));
+ cc.setAffinity(new CacheRendezvousAffinityFunction(false, partitions));
cc.setBackups(backups);
cc.setAtomicityMode(TRANSACTIONAL);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f358766f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedTopologyChangeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedTopologyChangeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedTopologyChangeSelfTest.java
index c64f9a5..8a2cfa0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedTopologyChangeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedTopologyChangeSelfTest.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
@@ -75,7 +75,7 @@ public class GridCachePartitionedTopologyChangeSelfTest extends GridCommonAbstra
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(PARTITIONED);
- cc.setAffinity(new CacheConsistentHashAffinityFunction(false, 18));
+ cc.setAffinity(new CacheRendezvousAffinityFunction(false, 18));
cc.setBackups(1);
cc.setPreloadMode(SYNC);
cc.setDistributionMode(PARTITIONED_ONLY);
@@ -498,8 +498,7 @@ public class GridCachePartitionedTopologyChangeSelfTest extends GridCommonAbstra
txFut.get(1000);
for (int i = 0; i < 3; i++) {
- CacheConsistentHashAffinityFunction affinity = (CacheConsistentHashAffinityFunction)((IgniteKernal)grid(i))
- .internalCache().context().config().getAffinity();
+ CacheAffinity affinity = grid(i).affinity(null);
ConcurrentMap addedNodes = U.field(affinity, "addedNodes");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f358766f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedUnloadEventsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedUnloadEventsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedUnloadEventsSelfTest.java
index f8c41f0..f451a34 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedUnloadEventsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedUnloadEventsSelfTest.java
@@ -18,8 +18,7 @@
package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
@@ -62,7 +61,7 @@ public class GridCachePartitionedUnloadEventsSelfTest extends GridCommonAbstract
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setPreloadMode(SYNC);
- cacheCfg.setAffinity(new CacheConsistentHashAffinityFunction(false, 10));
+ cacheCfg.setAffinity(new CacheRendezvousAffinityFunction(false, 10));
cacheCfg.setBackups(0);
return cacheCfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f358766f/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 30f4a28..40acefb 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
@@ -17,7 +17,7 @@
package org.apache.ignite.internal.processors.cache.distributed.near;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
@@ -45,7 +45,7 @@ public class GridCachePartitionedNodeRestartTest extends GridCacheAbstractNodeRe
cc.setStartSize(20);
cc.setPreloadMode(preloadMode);
cc.setPreloadBatchSize(preloadBatchSize);
- cc.setAffinity(new CacheConsistentHashAffinityFunction(false, partitions));
+ cc.setAffinity(new CacheRendezvousAffinityFunction(false, partitions));
cc.setBackups(backups);
c.setCacheConfiguration(cc);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f358766f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java
index e2fd6a5..0d71336 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOptimisticTxNodeRestartTest.java
@@ -17,7 +17,7 @@
package org.apache.ignite.internal.processors.cache.distributed.near;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
import org.apache.ignite.transactions.*;
@@ -44,7 +44,7 @@ public class GridCachePartitionedOptimisticTxNodeRestartTest extends GridCacheAb
cc.setStartSize(20);
cc.setPreloadMode(preloadMode);
cc.setPreloadBatchSize(preloadBatchSize);
- cc.setAffinity(new CacheConsistentHashAffinityFunction(false, partitions));
+ cc.setAffinity(new CacheRendezvousAffinityFunction(false, partitions));
cc.setBackups(backups);
c.setCacheConfiguration(cc);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f358766f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
index 685f9d2..b8a3cc9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.processors.cache.distributed.near;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*;
@@ -76,7 +76,7 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(CacheMode.PARTITIONED);
- cc.setAffinity(new CacheConsistentHashAffinityFunction(false, 18));
+ cc.setAffinity(new CacheRendezvousAffinityFunction(false, 18));
cc.setBackups(1);
cc.setPreloadMode(CachePreloadMode.SYNC);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f358766f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java
index f348d7c..4e32166 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.processors.cache.eviction;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
@@ -64,7 +64,7 @@ public class GridCacheSynchronousEvictionsFailoverSelfTest extends GridCacheAbst
ccfg.setBackups(2);
- ccfg.setAffinity(new CacheConsistentHashAffinityFunction(false, 500));
+ ccfg.setAffinity(new CacheRendezvousAffinityFunction(false, 500));
return ccfg;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f358766f/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java
index 2369749..482b672 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.util.offheap;
import org.apache.ignite.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.lang.*;
@@ -245,7 +245,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends GridComm
public void testPutRandomKeys() throws Exception {
map = newMap();
- CacheAffinityFunction aff = new CacheConsistentHashAffinityFunction(parts, null);
+ CacheAffinityFunction aff = new CacheRendezvousAffinityFunction(parts, null);
getTestResources().inject(aff);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f358766f/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java
index 1f1f806..dd01a66 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java
@@ -18,7 +18,7 @@
package org.apache.ignite.internal.util.offheap;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -76,7 +76,7 @@ public abstract class GridOffHeapPartitionedMapPerformanceAbstractTest extends G
keys = new T3[LOAD_CNT];
wrappers = new GridByteArrayWrapper[LOAD_CNT];
- CacheAffinityFunction aff = new CacheConsistentHashAffinityFunction();
+ CacheAffinityFunction aff = new CacheRendezvousAffinityFunction();
Random rnd = new Random();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f358766f/modules/core/src/test/java/org/apache/ignite/loadtests/datastructures/GridCachePartitionedAtomicLongLoadTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/datastructures/GridCachePartitionedAtomicLongLoadTest.java b/modules/core/src/test/java/org/apache/ignite/loadtests/datastructures/GridCachePartitionedAtomicLongLoadTest.java
index 1055102..41abf7c 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/datastructures/GridCachePartitionedAtomicLongLoadTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/datastructures/GridCachePartitionedAtomicLongLoadTest.java
@@ -19,7 +19,7 @@ package org.apache.ignite.loadtests.datastructures;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cache.eviction.lru.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.spi.discovery.tcp.*;
@@ -72,7 +72,7 @@ public class GridCachePartitionedAtomicLongLoadTest extends GridCommonAbstractTe
cc.setWriteSynchronizationMode(FULL_SYNC);
cc.setEvictionPolicy(new CacheLruEvictionPolicy<>(1000));
cc.setBackups(1);
- cc.setAffinity(new CacheConsistentHashAffinityFunction(true));
+ cc.setAffinity(new CacheRendezvousAffinityFunction(true));
cc.setEvictSynchronized(true);
cc.setEvictNearSynchronized(true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f358766f/modules/core/src/test/java/org/apache/ignite/loadtests/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/loadtests/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java
index ab45210..c29c3ca 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/offheap/GridOffHeapPartitionedMapPerformanceAbstractTest.java
@@ -18,7 +18,7 @@
package org.apache.ignite.loadtests.offheap;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.offheap.*;
import org.apache.ignite.internal.util.typedef.*;
@@ -77,7 +77,7 @@ public abstract class GridOffHeapPartitionedMapPerformanceAbstractTest extends G
keys = new T3[LOAD_CNT];
wrappers = new GridByteArrayWrapper[LOAD_CNT];
- CacheAffinityFunction aff = new CacheConsistentHashAffinityFunction();
+ CacheAffinityFunction aff = new CacheRendezvousAffinityFunction();
Random rnd = new Random();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f358766f/modules/core/src/test/java/org/apache/ignite/loadtests/offheap/unsafe/GridUnsafePartitionedMapPerformanceTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/offheap/unsafe/GridUnsafePartitionedMapPerformanceTest.java b/modules/core/src/test/java/org/apache/ignite/loadtests/offheap/unsafe/GridUnsafePartitionedMapPerformanceTest.java
index 5ba7182..a9a7b5b 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/offheap/unsafe/GridUnsafePartitionedMapPerformanceTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/offheap/unsafe/GridUnsafePartitionedMapPerformanceTest.java
@@ -17,7 +17,7 @@
package org.apache.ignite.loadtests.offheap.unsafe;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.internal.util.offheap.*;
/**
@@ -26,7 +26,7 @@ import org.apache.ignite.internal.util.offheap.*;
public class GridUnsafePartitionedMapPerformanceTest extends GridOffHeapPartitionedMapPerformanceAbstractTest {
/** {@inheritDoc} */
@Override protected GridOffHeapPartitionedMap newMap() {
- return GridOffHeapMapFactory.unsafePartitionedMap(CacheConsistentHashAffinityFunction.DFLT_PARTITION_COUNT,
+ return GridOffHeapMapFactory.unsafePartitionedMap(CacheRendezvousAffinityFunction.DFLT_PARTITION_COUNT,
Runtime.getRuntime().availableProcessors(), load, LOAD_CNT, mem, lruStripes, null);
}
}
[14/50] incubator-ignite git commit: #ignite-237: remove consistent
hash from IgniteCacheAffinitySelfTest.
Posted by sb...@apache.org.
#ignite-237: remove consistent hash from IgniteCacheAffinitySelfTest.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/df3c76e4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/df3c76e4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/df3c76e4
Branch: refs/heads/sprint-2
Commit: df3c76e4a353c599832a105ce0fc22f73104edf1
Parents: fecb680
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 15:53:43 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 15:53:43 2015 +0300
----------------------------------------------------------------------
.../ignite/IgniteCacheAffinitySelfTest.java | 30 +++++++-------------
1 file changed, 11 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/df3c76e4/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java b/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java
index 7186ae1..c3e76a6 100644
--- a/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/IgniteCacheAffinitySelfTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.fair.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
@@ -40,13 +39,10 @@ public class IgniteCacheAffinitySelfTest extends IgniteCacheAbstractTest {
private int GRID_COUNT = 3;
/** Cache name */
- private final String CACHE1 = "ConsistentHash";
+ private final String CACHE1 = "Fair";
/** Cache name */
- private final String CACHE2 = "Fair";
-
- /** Cache name */
- private final String CACHE3 = "Rendezvous";
+ private final String CACHE2 = "Rendezvous";
/** {@inheritDoc} */
@Override protected int gridCount() {
@@ -61,20 +57,16 @@ public class IgniteCacheAffinitySelfTest extends IgniteCacheAbstractTest {
CacheConfiguration cache1 = cacheConfiguration(null);
cache1.setName(CACHE1);
- cache1.setAffinity(new CacheConsistentHashAffinityFunction());
+ cache1.setAffinity(new CachePartitionFairAffinity());
CacheConfiguration cache2 = cacheConfiguration(null);
cache2.setName(CACHE2);
- cache2.setAffinity(new CachePartitionFairAffinity());
-
- CacheConfiguration cache3 = cacheConfiguration(null);
- cache3.setName(CACHE3);
- cache3.setAffinity(new CacheRendezvousAffinityFunction());
+ cache2.setAffinity(new CacheRendezvousAffinityFunction());
if (gridName.contains("0"))
cfg.setCacheConfiguration(cache0);
else
- cfg.setCacheConfiguration(cache0, cache1, cache2, cache3);
+ cfg.setCacheConfiguration(cache0, cache1, cache2);
return cfg;
}
@@ -116,8 +108,8 @@ public class IgniteCacheAffinitySelfTest extends IgniteCacheAbstractTest {
private void checkAffinity() {
checkAffinity(grid(0).affinity(null), cache(1, null).affinity());
checkAffinity(grid(0).affinity(CACHE1), cache(1, CACHE1).affinity());
+ checkAffinity(grid(0).affinity(CACHE1), cache(1, CACHE1).affinity());
checkAffinity(grid(0).affinity(CACHE2), cache(1, CACHE2).affinity());
- checkAffinity(grid(0).affinity(CACHE3), cache(1, CACHE3).affinity());
}
/**
@@ -226,13 +218,13 @@ public class IgniteCacheAffinitySelfTest extends IgniteCacheAbstractTest {
Collection<Integer> col1 = new HashSet<>();
- for (int i = 0; i < arr1.length; ++i)
- col1.add(arr1[i]);
+ for (int anArr1 : arr1)
+ col1.add(anArr1);
- for (int i = 0; i < arr2.length; ++i) {
- assertTrue(col1.contains(arr2[i]));
+ for (int anArr2 : arr2) {
+ assertTrue(col1.contains(anArr2));
- col1.remove(arr2[i]);
+ col1.remove(anArr2);
}
assertEquals(0, col1.size());
[34/50] incubator-ignite git commit: # ignite-237
Posted by sb...@apache.org.
# ignite-237
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e50d1ead
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e50d1ead
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e50d1ead
Branch: refs/heads/sprint-2
Commit: e50d1eadc11651c9029b81ccd0636ea003f5b1a7
Parents: bcf802d
Author: sboikov <sb...@gridgain.com>
Authored: Fri Feb 27 17:12:25 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Feb 27 17:12:25 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/GridCacheAffinityBackupsSelfTest.java | 8 --------
.../GridCacheContinuousQueryAbstractSelfTest.java | 12 ++++++------
2 files changed, 6 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e50d1ead/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
index 88a3cc1..0758993 100644
--- a/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
@@ -58,14 +58,6 @@ public class GridCacheAffinityBackupsSelfTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
- public void testConsistentHashBackups() throws Exception {
- for (int i = 0; i < nodesCnt; i++)
- checkBackups(i, new CacheRendezvousAffinityFunction());
- }
-
- /**
- * @throws Exception If failed.
- */
public void testRendezvousBackups() throws Exception {
for (int i = 0; i < nodesCnt; i++)
checkBackups(i, new CacheRendezvousAffinityFunction());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e50d1ead/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
index 0d9e189..d2b1786 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
@@ -165,12 +165,14 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
Set<Cache.Entry<Object, Object>> entries = ((IgniteKernal) grid(i)).cache(null).entrySet();
for (Cache.Entry entry : entries) {
- info("Not removed entry " + grid(i).affinity(null).isPrimary(grid(i).localNode(), entry.getKey()));
- info("Not removed entry " + grid(i).affinity(null).isBackup(grid(i).localNode(), entry.getKey()));
+ boolean primary = grid(i).affinity(null).isPrimary(grid(i).localNode(), entry.getKey());
+
+ boolean backup = grid(i).affinity(null).isBackup(grid(i).localNode(), entry.getKey());
+
+ info("Not removed entry [grid=" + i + ", primary=" + primary + ", backup=" + backup + ']');
+
allEmpty = false;
}
-
- info("Cache is not empty: " + ((IgniteKernal) grid(i)).cache(null).entrySet());
}
assertTrue(allEmpty);
@@ -844,8 +846,6 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
finally {
stopGrid("anotherGrid");
}
-
- awaitPartitionMapExchange();
}
/**
[38/50] incubator-ignite git commit: #ignite-237: move
CacheConsistentHashAffinityFunction.
Posted by sb...@apache.org.
#ignite-237: move CacheConsistentHashAffinityFunction.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e3782644
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e3782644
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e3782644
Branch: refs/heads/sprint-2
Commit: e3782644789c565162870fb2a41bd753e7631922
Parents: 414410b
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 19:36:34 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 19:36:34 2015 +0300
----------------------------------------------------------------------
.../CacheConsistentHashAffinityFunction.java | 703 -------------------
1 file changed, 703 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e3782644/modules/core/src/main/java/org/gridgain/benchmarks/risk/affinity/CacheConsistentHashAffinityFunction.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/benchmarks/risk/affinity/CacheConsistentHashAffinityFunction.java b/modules/core/src/main/java/org/gridgain/benchmarks/risk/affinity/CacheConsistentHashAffinityFunction.java
deleted file mode 100644
index 35be9b8..0000000
--- a/modules/core/src/main/java/org/gridgain/benchmarks/risk/affinity/CacheConsistentHashAffinityFunction.java
+++ /dev/null
@@ -1,703 +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.
- */
-
-package org.gridgain.benchmarks.risk.affinity;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.util.*;
-import org.apache.ignite.internal.util.tostring.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.resources.*;
-import org.jdk8.backport.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-/**
- * Affinity function for partitioned cache. This function supports the following
- * configuration:
- * <ul>
- * <li>
- * {@code backups} - Use this flag to control how many back up nodes will be
- * assigned to every key. The default value is {@code 0}.
- * </li>
- * <li>
- * {@code replicas} - Generally the more replicas a node gets, the more key assignments
- * it will receive. You can configure different number of replicas for a node by
- * setting user attribute with name {@link #getReplicaCountAttributeName()} to some
- * number. Default value is {@code 512} defined by {@link #DFLT_REPLICA_COUNT} constant.
- * </li>
- * <li>
- * {@code backupFilter} - Optional filter for back up nodes. If provided, then only
- * nodes that pass this filter will be selected as backup nodes. If not provided, then
- * primary and backup nodes will be selected out of all nodes available for this cache.
- * </li>
- * </ul>
- * <p>
- * Cache affinity can be configured for individual caches via {@link org.apache.ignite.configuration.CacheConfiguration#getAffinity()} method.
- */
-@Deprecated
-public class CacheConsistentHashAffinityFunction implements CacheAffinityFunction {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Flag to enable/disable consistency check (for internal use only). */
- private static final boolean AFFINITY_CONSISTENCY_CHECK = Boolean.getBoolean("IGNITE_AFFINITY_CONSISTENCY_CHECK");
-
- /** Default number of partitions. */
- public static final int DFLT_PARTITION_COUNT = 10000;
-
- /** Default replica count for partitioned caches. */
- public static final int DFLT_REPLICA_COUNT = 128;
-
- /**
- * Name of node attribute to specify number of replicas for a node.
- * Default value is {@code gg:affinity:node:replicas}.
- */
- public static final String DFLT_REPLICA_COUNT_ATTR_NAME = "gg:affinity:node:replicas";
-
- /** Node hash. */
- private transient GridConsistentHash<NodeInfo> nodeHash;
-
- /** Total number of partitions. */
- private int parts = DFLT_PARTITION_COUNT;
-
- /** */
- private int replicas = DFLT_REPLICA_COUNT;
-
- /** */
- private String attrName = DFLT_REPLICA_COUNT_ATTR_NAME;
-
- /** */
- private boolean exclNeighbors;
-
- /**
- * Optional backup filter. First node passed to this filter is primary node,
- * and second node is a node being tested.
- */
- private IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter;
-
- /** */
- private CacheAffinityNodeHashResolver hashIdRslvr = new CacheAffinityNodeAddressHashResolver();
-
- /** Injected grid. */
- @IgniteInstanceResource
- private Ignite ignite;
-
- /** Injected cache name. */
- @CacheNameResource
- private String cacheName;
-
- /** Injected logger. */
- @LoggerResource
- private IgniteLogger log;
-
- /** Initialization flag. */
- @SuppressWarnings("TransientFieldNotInitialized")
- private transient AtomicBoolean init = new AtomicBoolean();
-
- /** Latch for initializing. */
- @SuppressWarnings({"TransientFieldNotInitialized"})
- private transient CountDownLatch initLatch = new CountDownLatch(1);
-
- /** Nodes IDs. */
- @GridToStringInclude
- @SuppressWarnings({"TransientFieldNotInitialized"})
- private transient ConcurrentMap<UUID, NodeInfo> addedNodes = new ConcurrentHashMap<>();
-
- /** Optional backup filter. */
- @GridToStringExclude
- private final IgniteBiPredicate<NodeInfo, NodeInfo> backupIdFilter = new IgniteBiPredicate<NodeInfo, NodeInfo>() {
- @Override public boolean apply(NodeInfo primaryNodeInfo, NodeInfo nodeInfo) {
- return backupFilter == null || backupFilter.apply(primaryNodeInfo.node(), nodeInfo.node());
- }
- };
-
- /** Map of neighbors. */
- @SuppressWarnings("TransientFieldNotInitialized")
- private transient ConcurrentMap<UUID, Collection<UUID>> neighbors =
- new ConcurrentHashMap8<>();
-
- /**
- * Empty constructor with all defaults.
- */
- public CacheConsistentHashAffinityFunction() {
- // No-op.
- }
-
- /**
- * Initializes affinity with flag to exclude same-host-neighbors from being backups of each other
- * and specified number of backups.
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code #getBackupFilter()} is set.
- *
- * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups
- * of each other.
- */
- public CacheConsistentHashAffinityFunction(boolean exclNeighbors) {
- this.exclNeighbors = exclNeighbors;
- }
-
- /**
- * Initializes affinity with flag to exclude same-host-neighbors from being backups of each other,
- * and specified number of backups and partitions.
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code #getBackupFilter()} is set.
- *
- * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups
- * of each other.
- * @param parts Total number of partitions.
- */
- public CacheConsistentHashAffinityFunction(boolean exclNeighbors, int parts) {
- A.ensure(parts != 0, "parts != 0");
-
- this.exclNeighbors = exclNeighbors;
- this.parts = parts;
- }
-
- /**
- * Initializes optional counts for replicas and backups.
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code backupFilter} is set.
- *
- * @param parts Total number of partitions.
- * @param backupFilter Optional back up filter for nodes. If provided, backups will be selected
- * from all nodes that pass this filter. First argument for this filter is primary node, and second
- * argument is node being tested.
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code backupFilter} is set.
- */
- public CacheConsistentHashAffinityFunction(int parts,
- @Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
- A.ensure(parts != 0, "parts != 0");
-
- this.parts = parts;
- this.backupFilter = backupFilter;
- }
-
- /**
- * Gets default count of virtual replicas in consistent hash ring.
- * <p>
- * To determine node replicas, node attribute with {@link #getReplicaCountAttributeName()}
- * name will be checked first. If it is absent, then this value will be used.
- *
- * @return Count of virtual replicas in consistent hash ring.
- */
- public int getDefaultReplicas() {
- return replicas;
- }
-
- /**
- * Sets default count of virtual replicas in consistent hash ring.
- * <p>
- * To determine node replicas, node attribute with {@link #getReplicaCountAttributeName} name
- * will be checked first. If it is absent, then this value will be used.
- *
- * @param replicas Count of virtual replicas in consistent hash ring.s
- */
- public void setDefaultReplicas(int replicas) {
- this.replicas = replicas;
- }
-
- /**
- * Gets total number of key partitions. To ensure that all partitions are
- * equally distributed across all nodes, please make sure that this
- * number is significantly larger than a number of nodes. Also, partition
- * size should be relatively small. Try to avoid having partitions with more
- * than quarter million keys.
- * <p>
- * Note that for fully replicated caches this method should always
- * return {@code 1}.
- *
- * @return Total partition count.
- */
- public int getPartitions() {
- return parts;
- }
-
- /**
- * Sets total number of partitions.
- *
- * @param parts Total number of partitions.
- */
- public void setPartitions(int parts) {
- this.parts = parts;
- }
-
- /**
- * Gets hash ID resolver for nodes. This resolver is used to provide
- * alternate hash ID, other than node ID.
- * <p>
- * Node IDs constantly change when nodes get restarted, which causes them to
- * be placed on different locations in the hash ring, and hence causing
- * repartitioning. Providing an alternate hash ID, which survives node restarts,
- * puts node on the same location on the hash ring, hence minimizing required
- * repartitioning.
- *
- * @return Hash ID resolver.
- */
- public CacheAffinityNodeHashResolver getHashIdResolver() {
- return hashIdRslvr;
- }
-
- /**
- * Sets hash ID resolver for nodes. This resolver is used to provide
- * alternate hash ID, other than node ID.
- * <p>
- * Node IDs constantly change when nodes get restarted, which causes them to
- * be placed on different locations in the hash ring, and hence causing
- * repartitioning. Providing an alternate hash ID, which survives node restarts,
- * puts node on the same location on the hash ring, hence minimizing required
- * repartitioning.
- *
- * @param hashIdRslvr Hash ID resolver.
- */
- public void setHashIdResolver(CacheAffinityNodeHashResolver hashIdRslvr) {
- this.hashIdRslvr = hashIdRslvr;
- }
-
- /**
- * Gets optional backup filter. If not {@code null}, backups will be selected
- * from all nodes that pass this filter. First node passed to this filter is primary node,
- * and second node is a node being tested.
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code backupFilter} is set.
- *
- * @return Optional backup filter.
- */
- @Nullable public IgniteBiPredicate<ClusterNode, ClusterNode> getBackupFilter() {
- return backupFilter;
- }
-
- /**
- * Sets optional backup filter. If provided, then backups will be selected from all
- * nodes that pass this filter. First node being passed to this filter is primary node,
- * and second node is a node being tested.
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code backupFilter} is set.
- *
- * @param backupFilter Optional backup filter.
- */
- public void setBackupFilter(@Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
- this.backupFilter = backupFilter;
- }
-
- /**
- * Gets optional attribute name for replica count. If not provided, the
- * default is {@link #DFLT_REPLICA_COUNT_ATTR_NAME}.
- *
- * @return User attribute name for replica count for a node.
- */
- public String getReplicaCountAttributeName() {
- return attrName;
- }
-
- /**
- * Sets optional attribute name for replica count. If not provided, the
- * default is {@link #DFLT_REPLICA_COUNT_ATTR_NAME}.
- *
- * @param attrName User attribute name for replica count for a node.
- */
- public void setReplicaCountAttributeName(String attrName) {
- this.attrName = attrName;
- }
-
- /**
- * Checks flag to exclude same-host-neighbors from being backups of each other (default is {@code false}).
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code #getBackupFilter()} is set.
- *
- * @return {@code True} if nodes residing on the same host may not act as backups of each other.
- */
- public boolean isExcludeNeighbors() {
- return exclNeighbors;
- }
-
- /**
- * Sets flag to exclude same-host-neighbors from being backups of each other (default is {@code false}).
- * <p>
- * Note that {@code excludeNeighbors} parameter is ignored if {@code #getBackupFilter()} is set.
- *
- * @param exclNeighbors {@code True} if nodes residing on the same host may not act as backups of each other.
- */
- public void setExcludeNeighbors(boolean exclNeighbors) {
- this.exclNeighbors = exclNeighbors;
- }
-
- /**
- * Gets neighbors for a node.
- *
- * @param node Node.
- * @return Neighbors.
- */
- private Collection<UUID> neighbors(final ClusterNode node) {
- Collection<UUID> ns = neighbors.get(node.id());
-
- if (ns == null) {
- Collection<ClusterNode> nodes = ignite.cluster().forHost(node).nodes();
-
- ns = F.addIfAbsent(neighbors, node.id(), new ArrayList<>(F.nodeIds(nodes)));
- }
-
- return ns;
- }
-
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public List<List<ClusterNode>> assignPartitions(CacheAffinityFunctionContext ctx) {
- List<List<ClusterNode>> res = new ArrayList<>(parts);
-
- Collection<ClusterNode> topSnapshot = ctx.currentTopologySnapshot();
-
- for (int part = 0; part < parts; part++) {
- res.add(F.isEmpty(topSnapshot) ?
- Collections.<ClusterNode>emptyList() :
- // Wrap affinity nodes with unmodifiable list since unmodifiable generic collection
- // doesn't provide equals and hashCode implementations.
- U.sealList(nodes(part, topSnapshot, ctx.backups())));
- }
-
- return res;
- }
-
- /**
- * Assigns nodes to one partition.
- *
- * @param part Partition to assign nodes for.
- * @param nodes Cache topology nodes.
- * @return Assigned nodes, first node is primary, others are backups.
- */
- public Collection<ClusterNode> nodes(int part, Collection<ClusterNode> nodes, int backups) {
- if (nodes == null)
- return Collections.emptyList();
-
- int nodesSize = nodes.size();
-
- if (nodesSize == 0)
- return Collections.emptyList();
-
- if (nodesSize == 1) // Minor optimization.
- return nodes;
-
- initialize();
-
- final Map<NodeInfo, ClusterNode> lookup = new GridLeanMap<>(nodesSize);
-
- // Store nodes in map for fast lookup.
- for (ClusterNode n : nodes)
- // Add nodes into hash circle, if absent.
- lookup.put(resolveNodeInfo(n), n);
-
- Collection<NodeInfo> selected;
-
- if (backupFilter != null) {
- final IgnitePredicate<NodeInfo> p = new P1<NodeInfo>() {
- @Override public boolean apply(NodeInfo id) {
- return lookup.containsKey(id);
- }
- };
-
- final NodeInfo primaryId = nodeHash.node(part, p);
-
- IgnitePredicate<NodeInfo> backupPrimaryIdFilter = new IgnitePredicate<NodeInfo>() {
- @Override public boolean apply(NodeInfo node) {
- return backupIdFilter.apply(primaryId, node);
- }
- };
-
- Collection<NodeInfo> backupIds = nodeHash.nodes(part, backups, p, backupPrimaryIdFilter);
-
- if (F.isEmpty(backupIds) && primaryId != null) {
- ClusterNode n = lookup.get(primaryId);
-
- assert n != null;
-
- return Collections.singletonList(n);
- }
-
- selected = primaryId != null ? F.concat(false, primaryId, backupIds) : backupIds;
- }
- else {
- if (!exclNeighbors) {
- selected = nodeHash.nodes(part, backups == Integer.MAX_VALUE ? backups : backups + 1, new P1<NodeInfo>() {
- @Override public boolean apply(NodeInfo id) {
- return lookup.containsKey(id);
- }
- });
-
- if (selected.size() == 1) {
- NodeInfo id = F.first(selected);
-
- assert id != null : "Node ID cannot be null in affinity node ID collection: " + selected;
-
- ClusterNode n = lookup.get(id);
-
- assert n != null;
-
- return Collections.singletonList(n);
- }
- }
- else {
- int primaryAndBackups = backups + 1;
-
- selected = new ArrayList<>(primaryAndBackups);
-
- final Collection<NodeInfo> selected0 = selected;
-
- List<NodeInfo> ids = nodeHash.nodes(part, primaryAndBackups, new P1<NodeInfo>() {
- @Override public boolean apply(NodeInfo id) {
- ClusterNode n = lookup.get(id);
-
- if (n == null)
- return false;
-
- Collection<UUID> neighbors = neighbors(n);
-
- for (NodeInfo id0 : selected0) {
- ClusterNode n0 = lookup.get(id0);
-
- if (n0 == null)
- return false;
-
- Collection<UUID> neighbors0 = neighbors(n0);
-
- if (F.containsAny(neighbors0, neighbors))
- return false;
- }
-
- selected0.add(id);
-
- return true;
- }
- });
-
- if (AFFINITY_CONSISTENCY_CHECK)
- assert F.eqOrdered(ids, selected);
- }
- }
-
- Collection<ClusterNode> ret = new ArrayList<>(selected.size());
-
- for (NodeInfo id : selected) {
- ClusterNode n = lookup.get(id);
-
- assert n != null;
-
- ret.add(n);
- }
-
- return ret;
- }
-
- /** {@inheritDoc} */
- @Override public int partition(Object key) {
- initialize();
-
- return U.safeAbs(key.hashCode() % parts);
- }
-
- /** {@inheritDoc} */
- @Override public int partitions() {
- initialize();
-
- return parts;
- }
-
- /** {@inheritDoc} */
- @Override public void reset() {
- addedNodes = new ConcurrentHashMap<>();
- neighbors = new ConcurrentHashMap8<>();
-
- initLatch = new CountDownLatch(1);
-
- init = new AtomicBoolean();
- }
-
- /** {@inheritDoc} */
- @Override public void removeNode(UUID nodeId) {
- NodeInfo info = addedNodes.remove(nodeId);
-
- if (info == null)
- return;
-
- nodeHash.removeNode(info);
-
- neighbors.clear();
- }
-
- /**
- * Resolve node info for specified node.
- * Add node to hash circle if this is the first node invocation.
- *
- * @param n Node to get info for.
- * @return Node info.
- */
- private NodeInfo resolveNodeInfo(ClusterNode n) {
- UUID nodeId = n.id();
- NodeInfo nodeInfo = addedNodes.get(nodeId);
-
- if (nodeInfo != null)
- return nodeInfo;
-
- assert hashIdRslvr != null;
-
- nodeInfo = new NodeInfo(nodeId, hashIdRslvr.resolve(n), n);
-
- neighbors.clear();
-
- nodeHash.addNode(nodeInfo, replicas(n));
-
- addedNodes.put(nodeId, nodeInfo);
-
- return nodeInfo;
- }
-
- /** {@inheritDoc} */
- private void initialize() {
- if (!init.get() && init.compareAndSet(false, true)) {
- if (log.isInfoEnabled())
- log.info("Consistent hash configuration [cacheName=" + cacheName + ", partitions=" + parts +
- ", excludeNeighbors=" + exclNeighbors + ", replicas=" + replicas +
- ", backupFilter=" + backupFilter + ", hashIdRslvr=" + hashIdRslvr + ']');
-
- nodeHash = new GridConsistentHash<>();
-
- initLatch.countDown();
- }
- else {
- if (initLatch.getCount() > 0) {
- try {
- U.await(initLatch);
- }
- catch (IgniteInterruptedCheckedException ignored) {
- // Recover interrupted state flag.
- Thread.currentThread().interrupt();
- }
- }
- }
- }
-
- /**
- * @param n Node.
- * @return Replicas.
- */
- private int replicas(ClusterNode n) {
- Integer nodeReplicas = n.attribute(attrName);
-
- if (nodeReplicas == null)
- nodeReplicas = replicas;
-
- return nodeReplicas;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(CacheConsistentHashAffinityFunction.class, this);
- }
-
- /**
- * Node hash ID.
- */
- private static final class NodeInfo implements Comparable<NodeInfo> {
- /** Node ID. */
- private UUID nodeId;
-
- /** Hash ID. */
- private Object hashId;
-
- /** Grid node. */
- private ClusterNode node;
-
- /**
- * @param nodeId Node ID.
- * @param hashId Hash ID.
- * @param node Rich node.
- */
- private NodeInfo(UUID nodeId, Object hashId, ClusterNode node) {
- assert nodeId != null;
- assert hashId != null;
-
- this.hashId = hashId;
- this.nodeId = nodeId;
- this.node = node;
- }
-
- /**
- * @return Node ID.
- */
- public UUID nodeId() {
- return nodeId;
- }
-
- /**
- * @return Hash ID.
- */
- public Object hashId() {
- return hashId;
- }
-
- /**
- * @return Node.
- */
- public ClusterNode node() {
- return node;
- }
-
- /** {@inheritDoc} */
- @Override public int hashCode() {
- return hashId.hashCode();
- }
-
- /** {@inheritDoc} */
- @Override public boolean equals(Object obj) {
- if (!(obj instanceof NodeInfo))
- return false;
-
- NodeInfo that = (NodeInfo)obj;
-
- // If objects are equal, hash codes should be the same.
- // Cannot use that.hashId.equals(hashId) due to Comparable<N> interface restrictions.
- return that.nodeId.equals(nodeId) && that.hashCode() == hashCode();
- }
-
- /** {@inheritDoc} */
- @Override public int compareTo(NodeInfo o) {
- int diff = nodeId.compareTo(o.nodeId);
-
- if (diff == 0) {
- int h1 = hashCode();
- int h2 = o.hashCode();
-
- diff = h1 == h2 ? 0 : (h1 < h2 ? -1 : 1);
- }
-
- return diff;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(NodeInfo.class, this);
- }
- }
-}
[25/50] incubator-ignite git commit: #ignite-237: remove unused
imports.
Posted by sb...@apache.org.
#ignite-237: remove unused imports.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/eb14f3bb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/eb14f3bb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/eb14f3bb
Branch: refs/heads/sprint-2
Commit: eb14f3bbb96865ce656e8facb747e35ff15fbf33
Parents: 75d960e
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 18:32:08 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 18:32:08 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java | 1 -
.../cache/distributed/GridCacheClientModesAbstractSelfTest.java | 1 -
.../distributed/GridCachePartitionedAffinityFilterSelfTest.java | 1 -
.../cache/distributed/dht/GridCacheColocatedDebugTest.java | 1 -
.../cache/distributed/dht/GridCacheDhtEntrySelfTest.java | 1 -
.../cache/distributed/dht/GridCacheDhtInternalEntrySelfTest.java | 1 -
.../cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java | 1 -
.../cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java | 1 -
.../cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java | 1 -
.../cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java | 1 -
.../distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java | 1 -
.../cache/distributed/dht/GridCacheDhtPreloadSelfTest.java | 1 -
.../distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java | 1 -
.../cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java | 1 -
.../processors/cache/distributed/dht/GridCacheDhtTestUtils.java | 2 --
...ridCachePartitionedAffinityExcludeNeighborsPerformanceTest.java | 1 -
16 files changed, 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
index 6e34229..88a3cc1 100644
--- a/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/GridCacheAffinityBackupsSelfTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.fair.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
index 170c3d5..a54f73b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.distributed;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cache.store.*;
import org.apache.ignite.configuration.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionedAffinityFilterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionedAffinityFilterSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionedAffinityFilterSelfTest.java
index 4ccb0be..9e0e360 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionedAffinityFilterSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionedAffinityFilterSelfTest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
index 9cd036f..eb62251 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cache.store.*;
import org.apache.ignite.configuration.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java
index b482165..91eebea 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtInternalEntrySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtInternalEntrySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtInternalEntrySelfTest.java
index 1629bcc..504ec12 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtInternalEntrySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtInternalEntrySelfTest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
index ef4ccc9..587dff1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.lifecycle.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java
index 8ad2ab6..33ac600 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java
index af7d7dc..7b9a9bc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
index 8da4d0c..64f01f4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java
index d6b9fa3..538fb9f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
index c44b2b8..5c2273c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java
index aeb7a4a..0f7bcb3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
index 35b0dfc..9f6e1a4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.lifecycle.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
index 94619f2..e9b8a23 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
@@ -20,8 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
-import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb14f3bb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityExcludeNeighborsPerformanceTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityExcludeNeighborsPerformanceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityExcludeNeighborsPerformanceTest.java
index aef1c18..dfd9128 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityExcludeNeighborsPerformanceTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityExcludeNeighborsPerformanceTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.distributed.near;
import org.apache.ignite.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
[22/50] incubator-ignite git commit: #ignite-237: change javadoc.
Posted by sb...@apache.org.
#ignite-237: change javadoc.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/87586da9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/87586da9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/87586da9
Branch: refs/heads/sprint-2
Commit: 87586da9c755f343e5468806ac0302b108cc434d
Parents: 96ad6c1
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 16:26:29 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 16:26:29 2015 +0300
----------------------------------------------------------------------
modules/core/src/main/java/org/apache/ignite/cache/GridCache.java | 2 +-
.../java/org/apache/ignite/configuration/CacheConfiguration.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/87586da9/modules/core/src/main/java/org/apache/ignite/cache/GridCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/GridCache.java b/modules/core/src/main/java/org/apache/ignite/cache/GridCache.java
index 8bbea1f..1b4be2d 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/GridCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/GridCache.java
@@ -211,7 +211,7 @@ public interface GridCache<K, V> extends CacheProjection<K, V> {
* the left nodes, and that nodes are restarted before
* {@link CacheConfiguration#getPreloadPartitionedDelay() preloadDelay} expires. To place nodes
* on the same place in consistent hash ring, use
- * {@link org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction#setHashIdResolver(org.apache.ignite.cache.affinity.CacheAffinityNodeHashResolver)} to make sure that
+ * {@link org.apache.ignite.cache.affinity.rendezvous.CacheRendezvousAffinityFunction#setHashIdResolver(CacheAffinityNodeHashResolver)} to make sure that
* a node maps to the same hash ID if re-started.
* <p>
* See {@link org.apache.ignite.configuration.CacheConfiguration#getPreloadPartitionedDelay()} for more information on how to configure
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/87586da9/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 57583d4..224176f 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -1343,7 +1343,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* For better efficiency user should usually make sure that new nodes get placed on
* the same place of consistent hash ring as the left nodes, and that nodes are
* restarted before this delay expires. To place nodes on the same place in consistent hash ring,
- * use {@link org.apache.ignite.cache.affinity.consistenthash.CacheConsistentHashAffinityFunction#setHashIdResolver(org.apache.ignite.cache.affinity.CacheAffinityNodeHashResolver)}
+ * use {@link org.apache.ignite.cache.affinity.rendezvous.CacheRendezvousAffinityFunction#setHashIdResolver(CacheAffinityNodeHashResolver)}
* to make sure that a node maps to the same hash ID event if restarted. As an example,
* node IP address and port combination may be used in this case.
* <p>
[17/50] incubator-ignite git commit: #ignite-237: change affinity
function in tests.
Posted by sb...@apache.org.
#ignite-237: change affinity function in tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d9989259
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d9989259
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d9989259
Branch: refs/heads/sprint-2
Commit: d99892590d857c7a9b954cfaff747a0c46b339c8
Parents: f358766
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 16:12:03 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 16:12:03 2015 +0300
----------------------------------------------------------------------
...dCachePartitionedAffinityFilterSelfTest.java | 5 +--
.../dht/GridCacheDhtEntrySelfTest.java | 3 +-
.../dht/GridCacheDhtInternalEntrySelfTest.java | 3 +-
.../dht/GridCacheDhtPreloadBigDataSelfTest.java | 3 +-
.../dht/GridCacheDhtPreloadDelayedSelfTest.java | 3 +-
.../GridCacheDhtPreloadDisabledSelfTest.java | 3 +-
.../GridCacheDhtPreloadMessageCountTest.java | 3 +-
...ridCacheDhtPreloadMultiThreadedSelfTest.java | 3 +-
.../dht/GridCacheDhtPreloadSelfTest.java | 3 +-
.../GridCacheDhtPreloadStartStopSelfTest.java | 3 +-
.../dht/GridCacheDhtPreloadUnloadSelfTest.java | 3 +-
.../distributed/dht/GridCacheDhtTestUtils.java | 6 ++--
...ffinityFunctionExcludeNeighborsSelfTest.java | 32 --------------------
...AffinityExcludeNeighborsPerformanceTest.java | 3 +-
...rtitionedAffinityHashIdResolverSelfTest.java | 4 +--
.../ignite/testsuites/IgniteCacheTestSuite.java | 1 -
16 files changed, 29 insertions(+), 52 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionedAffinityFilterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionedAffinityFilterSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionedAffinityFilterSelfTest.java
index b78857d..4ccb0be 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionedAffinityFilterSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionedAffinityFilterSelfTest.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*;
@@ -67,7 +68,7 @@ public class GridCachePartitionedAffinityFilterSelfTest extends GridCommonAbstra
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- CacheConsistentHashAffinityFunction aff = new CacheConsistentHashAffinityFunction();
+ CacheRendezvousAffinityFunction aff = new CacheRendezvousAffinityFunction();
aff.setBackupFilter(backupFilter);
@@ -123,7 +124,7 @@ public class GridCachePartitionedAffinityFilterSelfTest extends GridCommonAbstra
* @throws Exception If failed.
*/
private void checkPartitions() throws Exception {
- int partCnt = CacheConsistentHashAffinityFunction.DFLT_PARTITION_COUNT;
+ int partCnt = CacheRendezvousAffinityFunction.DFLT_PARTITION_COUNT;
CacheAffinityFunction aff = cacheConfiguration(grid(0).configuration(), null).getAffinity();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java
index a1eb4e3..b482165 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
@@ -62,7 +63,7 @@ public class GridCacheDhtEntrySelfTest extends GridCommonAbstractTest {
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(PARTITIONED);
- cacheCfg.setAffinity(new CacheConsistentHashAffinityFunction(false, 10));
+ cacheCfg.setAffinity(new CacheRendezvousAffinityFunction(false, 10));
cacheCfg.setBackups(0);
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cacheCfg.setSwapEnabled(false);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtInternalEntrySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtInternalEntrySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtInternalEntrySelfTest.java
index cc274ce..1629bcc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtInternalEntrySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtInternalEntrySelfTest.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.processors.cache.*;
@@ -65,7 +66,7 @@ public class GridCacheDhtInternalEntrySelfTest extends GridCommonAbstractTest {
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setPreloadMode(SYNC);
- cacheCfg.setAffinity(new CacheConsistentHashAffinityFunction(false, 2));
+ cacheCfg.setAffinity(new CacheRendezvousAffinityFunction(false, 2));
cacheCfg.setBackups(0);
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cacheCfg.setDistributionMode(CacheDistributionMode.NEAR_PARTITIONED);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
index 36df6bf..ef4ccc9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadBigDataSelfTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.lifecycle.*;
import org.apache.ignite.resources.*;
@@ -85,7 +86,7 @@ public class GridCacheDhtPreloadBigDataSelfTest extends GridCommonAbstractTest {
cc.setPreloadBatchSize(preloadBatchSize);
cc.setWriteSynchronizationMode(FULL_SYNC);
cc.setPreloadMode(preloadMode);
- cc.setAffinity(new CacheConsistentHashAffinityFunction(false, partitions));
+ cc.setAffinity(new CacheRendezvousAffinityFunction(false, partitions));
cc.setBackups(backups);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java
index fe88081..8ad2ab6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
@@ -75,7 +76,7 @@ public class GridCacheDhtPreloadDelayedSelfTest extends GridCommonAbstractTest {
cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cc.setPreloadMode(preloadMode);
cc.setPreloadPartitionedDelay(delay);
- cc.setAffinity(new CacheConsistentHashAffinityFunction(false, 128));
+ cc.setAffinity(new CacheRendezvousAffinityFunction(false, 128));
cc.setBackups(1);
cc.setAtomicityMode(TRANSACTIONAL);
cc.setDistributionMode(NEAR_PARTITIONED);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java
index 1248770..af7d7dc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
@@ -83,7 +84,7 @@ public class GridCacheDhtPreloadDisabledSelfTest extends GridCommonAbstractTest
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_ASYNC);
cacheCfg.setPreloadMode(NONE);
- cacheCfg.setAffinity(new CacheConsistentHashAffinityFunction(false, partitions));
+ cacheCfg.setAffinity(new CacheRendezvousAffinityFunction(false, partitions));
cacheCfg.setBackups(backups);
cacheCfg.setAtomicityMode(TRANSACTIONAL);
cacheCfg.setDistributionMode(NEAR_PARTITIONED);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
index e58c16e..8da4d0c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.managers.communication.*;
@@ -63,7 +64,7 @@ public class GridCacheDhtPreloadMessageCountTest extends GridCommonAbstractTest
cc.setCacheMode(PARTITIONED);
cc.setWriteSynchronizationMode(FULL_SYNC);
cc.setPreloadMode(preloadMode);
- cc.setAffinity(new CacheConsistentHashAffinityFunction(false, 521));
+ cc.setAffinity(new CacheRendezvousAffinityFunction(false, 521));
cc.setBackups(1);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java
index 8a8969d..d6b9fa3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMultiThreadedSelfTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
import org.apache.ignite.internal.util.typedef.*;
@@ -163,7 +164,7 @@ public class GridCacheDhtPreloadMultiThreadedSelfTest extends GridCommonAbstract
for (CacheConfiguration cCfg : cfg.getCacheConfiguration()) {
if (cCfg.getCacheMode() == CacheMode.PARTITIONED) {
- cCfg.setAffinity(new CacheConsistentHashAffinityFunction(2048, null));
+ cCfg.setAffinity(new CacheRendezvousAffinityFunction(2048, null));
cCfg.setBackups(1);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
index ae94b12..c44b2b8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
@@ -112,7 +113,7 @@ public class GridCacheDhtPreloadSelfTest extends GridCommonAbstractTest {
cacheCfg.setPreloadBatchSize(preloadBatchSize);
cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
cacheCfg.setPreloadMode(preloadMode);
- cacheCfg.setAffinity(new CacheConsistentHashAffinityFunction(false, partitions));
+ cacheCfg.setAffinity(new CacheRendezvousAffinityFunction(false, partitions));
cacheCfg.setBackups(backups);
return cacheCfg;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java
index 9ff1bf2..aeb7a4a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadStartStopSelfTest.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*;
@@ -98,7 +99,7 @@ public class GridCacheDhtPreloadStartStopSelfTest extends GridCommonAbstractTest
cacheCfg.setPreloadBatchSize(preloadBatchSize);
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cacheCfg.setPreloadMode(preloadMode);
- cacheCfg.setAffinity(new CacheConsistentHashAffinityFunction(false, partitions));
+ cacheCfg.setAffinity(new CacheRendezvousAffinityFunction(false, partitions));
cacheCfg.setBackups(backups);
cacheCfg.setAtomicityMode(TRANSACTIONAL);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
index 480d01c..35b0dfc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadUnloadSelfTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.lifecycle.*;
import org.apache.ignite.resources.*;
@@ -86,7 +87,7 @@ public class GridCacheDhtPreloadUnloadSelfTest extends GridCommonAbstractTest {
cc.setPreloadBatchSize(preloadBatchSize);
cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cc.setPreloadMode(preloadMode);
- cc.setAffinity(new CacheConsistentHashAffinityFunction(false, partitions));
+ cc.setAffinity(new CacheRendezvousAffinityFunction(false, partitions));
cc.setBackups(backups);
cc.setAtomicityMode(TRANSACTIONAL);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
index 0cf6684..94619f2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtTestUtils.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.*;
@@ -84,13 +85,10 @@ public class GridCacheDhtTestUtils {
* @param cache Dht cache.
*/
static void printAffinityInfo(GridCache<?, ?> cache) {
- CacheConsistentHashAffinityFunction aff =
- (CacheConsistentHashAffinityFunction)cache.configuration().getAffinity();
-
System.out.println("Affinity info.");
System.out.println("----------------------------------");
System.out.println("Number of key backups: " + cache.configuration().getBackups());
- System.out.println("Number of cache partitions: " + aff.getPartitions());
+ System.out.println("Number of cache partitions: " + cache.affinity().partitions());
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheConsistentHashAffinityFunctionExcludeNeighborsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheConsistentHashAffinityFunctionExcludeNeighborsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheConsistentHashAffinityFunctionExcludeNeighborsSelfTest.java
deleted file mode 100644
index af33567..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheConsistentHashAffinityFunctionExcludeNeighborsSelfTest.java
+++ /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.
- */
-
-package org.apache.ignite.internal.processors.cache.distributed.near;
-
-import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
-
-/**
- * Tests exclude neighbors flag for consistent hash affinity function.
- */
-public class GridCacheConsistentHashAffinityFunctionExcludeNeighborsSelfTest extends
- GridCacheAffinityFunctionExcludeNeighborsAbstractSelfTest {
- /** {@inheritDoc} */
- @Override protected CacheAffinityFunction affinityFunction() {
- return new CacheConsistentHashAffinityFunction(true);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityExcludeNeighborsPerformanceTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityExcludeNeighborsPerformanceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityExcludeNeighborsPerformanceTest.java
index cdeaa54..aef1c18 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityExcludeNeighborsPerformanceTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityExcludeNeighborsPerformanceTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache.distributed.near;
import org.apache.ignite.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.*;
@@ -69,7 +70,7 @@ public class GridCachePartitionedAffinityExcludeNeighborsPerformanceTest extends
cc.setBackups(2);
- CacheAffinityFunction aff = new CacheConsistentHashAffinityFunction(excNeighbores);
+ CacheAffinityFunction aff = new CacheRendezvousAffinityFunction(excNeighbores);
cc.setAffinity(aff);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityHashIdResolverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityHashIdResolverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityHashIdResolverSelfTest.java
index ebb89df..a27c486 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityHashIdResolverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityHashIdResolverSelfTest.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.processors.cache.distributed.near;
import org.apache.ignite.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.spi.discovery.tcp.*;
@@ -44,7 +44,7 @@ public class GridCachePartitionedAffinityHashIdResolverSelfTest extends GridComm
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- CacheConsistentHashAffinityFunction aff = new CacheConsistentHashAffinityFunction();
+ CacheRendezvousAffinityFunction aff = new CacheRendezvousAffinityFunction();
aff.setHashIdResolver(rslvr);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d9989259/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index 44e4bad..eab626c 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -174,7 +174,6 @@ public class IgniteCacheTestSuite extends TestSuite {
suite.addTest(new TestSuite(GridCacheNearReadersSelfTest.class));
suite.addTest(new TestSuite(GridCacheAtomicNearReadersSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedAffinitySelfTest.class));
- suite.addTest(new TestSuite(GridCacheConsistentHashAffinityFunctionExcludeNeighborsSelfTest.class));
suite.addTest(new TestSuite(GridCacheRendezvousAffinityFunctionExcludeNeighborsSelfTest.class));
suite.addTest(new TestSuite(GridCacheRendezvousAffinityClientSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedProjectionAffinitySelfTest.class));
[31/50] incubator-ignite git commit: #ignite-237: add debug to tests.
Posted by sb...@apache.org.
#ignite-237: add debug to tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d254da4b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d254da4b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d254da4b
Branch: refs/heads/sprint-2
Commit: d254da4ba7e22f3ba6931e24c0e9a4ed7139db09
Parents: 7fb3890
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 15:26:57 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 15:26:57 2015 +0300
----------------------------------------------------------------------
...GridCacheContinuousQueryAbstractSelfTest.java | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d254da4b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
index a69ce36..0d9e189 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
@@ -159,8 +159,21 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
}
}
- for (int i = 0; i < gridCount(); i++)
- assertEquals("Cache is not empty: " + ((IgniteKernal)grid(i)).cache(null).entrySet(), 0, ((IgniteKernal)grid(i)).cache(null).size());
+ boolean allEmpty = true;
+
+ for (int i = 0; i < gridCount(); i++) {
+ Set<Cache.Entry<Object, Object>> entries = ((IgniteKernal) grid(i)).cache(null).entrySet();
+
+ for (Cache.Entry entry : entries) {
+ info("Not removed entry " + grid(i).affinity(null).isPrimary(grid(i).localNode(), entry.getKey()));
+ info("Not removed entry " + grid(i).affinity(null).isBackup(grid(i).localNode(), entry.getKey()));
+ allEmpty = false;
+ }
+
+ info("Cache is not empty: " + ((IgniteKernal) grid(i)).cache(null).entrySet());
+ }
+
+ assertTrue(allEmpty);
for (int i = 0; i < gridCount(); i++) {
GridContinuousProcessor proc = ((IgniteKernal)grid(i)).context().continuous();
@@ -831,6 +844,8 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
finally {
stopGrid("anotherGrid");
}
+
+ awaitPartitionMapExchange();
}
/**
[39/50] incubator-ignite git commit: #ignite-237: remove tests for
consistent hash.
Posted by sb...@apache.org.
#ignite-237: remove tests for consistent hash.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5692d7e3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5692d7e3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5692d7e3
Branch: refs/heads/sprint-2
Commit: 5692d7e39a4600b17dd9fafb2003a96a2fb51489
Parents: e378264
Author: ivasilinets <iv...@gridgain.com>
Authored: Fri Feb 27 19:44:08 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Fri Feb 27 19:44:08 2015 +0300
----------------------------------------------------------------------
.../GridCachePartitionedAffinitySelfTest.java | 181 -------------------
1 file changed, 181 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5692d7e3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java
index 1559a24..069ffb6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed.near;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
@@ -110,186 +109,6 @@ public class GridCachePartitionedAffinitySelfTest extends GridCommonAbstractTest
return aff.mapKeyToPrimaryAndBackups(key);
}
- /** Test predefined affinity - must be ported to all clients. */
- @SuppressWarnings("UnaryPlus")
- public void testPredefined() throws IgniteCheckedException {
- CacheRendezvousAffinityFunction aff = new CacheRendezvousAffinityFunction();
-
- getTestResources().inject(aff);
-
- aff.setHashIdResolver(new CacheAffinityNodeIdHashResolver());
-
- List<ClusterNode> nodes = new ArrayList<>();
-
- nodes.add(createNode("000ea4cd-f449-4dcb-869a-5317c63bd619", 50));
- nodes.add(createNode("010ea4cd-f449-4dcb-869a-5317c63bd62a", 60));
- nodes.add(createNode("0209ec54-ff53-4fdb-8239-5a3ac1fb31bd", 70));
- nodes.add(createNode("0309ec54-ff53-4fdb-8239-5a3ac1fb31ef", 80));
- nodes.add(createNode("040c9b94-02ae-45a6-9d5c-a066dbdf2636", 90));
- nodes.add(createNode("050c9b94-02ae-45a6-9d5c-a066dbdf2747", 100));
- nodes.add(createNode("0601f916-4357-4cfe-a7df-49d4721690bf", 110));
- nodes.add(createNode("0702f916-4357-4cfe-a7df-49d4721691c0", 120));
-
- Map<Object, Integer> data = new LinkedHashMap<>();
-
- data.put("", 4);
- data.put("asdf", 4);
- data.put("224ea4cd-f449-4dcb-869a-5317c63bd619", 5);
- data.put("fdc9ec54-ff53-4fdb-8239-5a3ac1fb31bd", 2);
- data.put("0f9c9b94-02ae-45a6-9d5c-a066dbdf2636", 2);
- data.put("d8f1f916-4357-4cfe-a7df-49d4721690bf", 7);
- data.put("c77ffeae-78a1-4ee6-a0fd-8d197a794412", 3);
- data.put("35de9f21-3c9b-4f4a-a7d5-3e2c6cb01564", 1);
- data.put("d67eb652-4e76-47fb-ad4e-cd902d9b868a", 7);
-
- data.put(0, 4);
- data.put(1, 7);
- data.put(12, 5);
- data.put(123, 6);
- data.put(1234, 4);
- data.put(12345, 6);
- data.put(123456, 6);
- data.put(1234567, 6);
- data.put(12345678, 0);
- data.put(123456789, 7);
- data.put(1234567890, 7);
- data.put(1234567890L, 7);
- data.put(12345678901L, 2);
- data.put(123456789012L, 1);
- data.put(1234567890123L, 0);
- data.put(12345678901234L, 1);
- data.put(123456789012345L, 6);
- data.put(1234567890123456L, 7);
- data.put(-23456789012345L, 4);
- data.put(-2345678901234L, 1);
- data.put(-234567890123L, 5);
- data.put(-23456789012L, 5);
- data.put(-2345678901L, 7);
- data.put(-234567890L, 4);
- data.put(-234567890, 7);
- data.put(-23456789, 7);
- data.put(-2345678, 0);
- data.put(-234567, 6);
- data.put(-23456, 6);
- data.put(-2345, 6);
- data.put(-234, 7);
- data.put(-23, 5);
- data.put(-2, 4);
-
- data.put(0x80000000, 4);
- data.put(0x7fffffff, 7);
- data.put(0x8000000000000000L, 4);
- data.put(0x7fffffffffffffffL, 4);
-
- data.put(+1.1, 3);
- data.put(-10.01, 4);
- data.put(+100.001, 4);
- data.put(-1000.0001, 4);
- data.put(+1.7976931348623157E+308, 6);
- data.put(-1.7976931348623157E+308, 6);
- data.put(+4.9E-324, 7);
- data.put(-4.9E-324, 7);
- }
-
- /** Test predefined affinity - must be ported to other clients. */
- @SuppressWarnings("UnaryPlus")
- public void testPredefinedHashIdResolver() throws IgniteCheckedException {
- // Use Md5 hasher for this test.
- CacheRendezvousAffinityFunction aff = new CacheRendezvousAffinityFunction();
-
- getTestResources().inject(aff);
-
- aff.setHashIdResolver(new CacheAffinityNodeHashResolver() {
- @Override public Object resolve(ClusterNode node) {
- return null;
- }
- });
-
- List<ClusterNode> nodes = new ArrayList<>();
-
- nodes.add(createNode("000ea4cd-f449-4dcb-869a-5317c63bd619", 50));
- nodes.add(createNode("010ea4cd-f449-4dcb-869a-5317c63bd62a", 60));
- nodes.add(createNode("0209ec54-ff53-4fdb-8239-5a3ac1fb31bd", 70));
- nodes.add(createNode("0309ec54-ff53-4fdb-8239-5a3ac1fb31ef", 80));
- nodes.add(createNode("040c9b94-02ae-45a6-9d5c-a066dbdf2636", 90));
- nodes.add(createNode("050c9b94-02ae-45a6-9d5c-a066dbdf2747", 100));
- nodes.add(createNode("0601f916-4357-4cfe-a7df-49d4721690bf", 110));
- nodes.add(createNode("0702f916-4357-4cfe-a7df-49d4721691c0", 120));
-
- Map<Object, Integer> data = new LinkedHashMap<>();
-
- data.put("", 4);
- data.put("asdf", 3);
- data.put("224ea4cd-f449-4dcb-869a-5317c63bd619", 5);
- data.put("fdc9ec54-ff53-4fdb-8239-5a3ac1fb31bd", 2);
- data.put("0f9c9b94-02ae-45a6-9d5c-a066dbdf2636", 2);
- data.put("d8f1f916-4357-4cfe-a7df-49d4721690bf", 4);
- data.put("c77ffeae-78a1-4ee6-a0fd-8d197a794412", 3);
- data.put("35de9f21-3c9b-4f4a-a7d5-3e2c6cb01564", 4);
- data.put("d67eb652-4e76-47fb-ad4e-cd902d9b868a", 2);
-
- data.put(0, 4);
- data.put(1, 1);
- data.put(12, 7);
- data.put(123, 1);
- data.put(1234, 6);
- data.put(12345, 2);
- data.put(123456, 5);
- data.put(1234567, 4);
- data.put(12345678, 6);
- data.put(123456789, 3);
- data.put(1234567890, 3);
- data.put(1234567890L, 3);
- data.put(12345678901L, 0);
- data.put(123456789012L, 1);
- data.put(1234567890123L, 3);
- data.put(12345678901234L, 5);
- data.put(123456789012345L, 5);
- data.put(1234567890123456L, 7);
- data.put(-23456789012345L, 6);
- data.put(-2345678901234L, 4);
- data.put(-234567890123L, 3);
- data.put(-23456789012L, 0);
- data.put(-2345678901L, 4);
- data.put(-234567890L, 5);
- data.put(-234567890, 3);
- data.put(-23456789, 3);
- data.put(-2345678, 6);
- data.put(-234567, 4);
- data.put(-23456, 5);
- data.put(-2345, 2);
- data.put(-234, 7);
- data.put(-23, 6);
- data.put(-2, 6);
-
- data.put(0x80000000, 7);
- data.put(0x7fffffff, 1);
- data.put(0x8000000000000000L, 7);
- data.put(0x7fffffffffffffffL, 7);
-
- data.put(+1.1, 2);
- data.put(-10.01, 0);
- data.put(+100.001, 2);
- data.put(-1000.0001, 0);
- data.put(+1.7976931348623157E+308, 6);
- data.put(-1.7976931348623157E+308, 1);
- data.put(+4.9E-324, 1);
- data.put(-4.9E-324, 1);
- }
-
- /**
- * Create node with specified node id and replica count.
- *
- * @param nodeId Node id.
- * @param replicaCnt Node partitioned affinity replica count.
- * @return New node with specified node id and replica count.
- */
- private ClusterNode createNode(String nodeId, int replicaCnt) {
- GridTestNode node = new GridTestNode(UUID.fromString(nodeId));
-
- return node;
- }
-
/** @throws Exception If failed. */
public void testAffinity() throws Exception {
waitTopologyUpdate();
[12/50] incubator-ignite git commit: #ignite-237: change affinity
function in HibernateL2CacheSelfTest.
Posted by sb...@apache.org.
#ignite-237: change affinity function in HibernateL2CacheSelfTest.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6a5b42f5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6a5b42f5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6a5b42f5
Branch: refs/heads/sprint-2
Commit: 6a5b42f5d9fd0523c9203389cfcce4829ddc0df1
Parents: 02d46d7
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 15:49:42 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 15:49:42 2015 +0300
----------------------------------------------------------------------
.../ignite/cache/hibernate/HibernateL2CacheSelfTest.java | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6a5b42f5/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheSelfTest.java b/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheSelfTest.java
index 38146af..35f0c93 100644
--- a/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheSelfTest.java
+++ b/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheSelfTest.java
@@ -18,7 +18,7 @@
package org.apache.ignite.cache.hibernate;
import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.spi.discovery.tcp.*;
@@ -46,8 +46,6 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
import static org.apache.ignite.cache.hibernate.HibernateRegionFactory.*;
import static org.hibernate.cfg.Environment.*;
-import org.apache.ignite.cache.hibernate.HibernateL2CacheSelfTest.Entity;
-
/**
*
* Tests Hibernate L2 cache.
@@ -425,7 +423,7 @@ public class HibernateL2CacheSelfTest extends GridCommonAbstractTest {
cfg.setBackups(1);
- cfg.setAffinity(new CacheConsistentHashAffinityFunction(false, 10));
+ cfg.setAffinity(new CacheRendezvousAffinityFunction(false, 10));
return cfg;
}
@@ -447,7 +445,7 @@ public class HibernateL2CacheSelfTest extends GridCommonAbstractTest {
cfg.setBackups(1);
- cfg.setAffinity(new CacheConsistentHashAffinityFunction(false, 10));
+ cfg.setAffinity(new CacheRendezvousAffinityFunction(false, 10));
return cfg;
}
[24/50] incubator-ignite git commit: #ignite-237: remove unused
imports.
Posted by sb...@apache.org.
#ignite-237: remove unused imports.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/75d960eb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/75d960eb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/75d960eb
Branch: refs/heads/sprint-2
Commit: 75d960eb9b16d587193deb20d1347aefdb9cc4d9
Parents: d07931d
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu Feb 26 18:30:35 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu Feb 26 18:30:35 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/processors/cache/GridCacheAttributes.java | 1 -
.../apache/ignite/internal/processors/cache/GridCacheProcessor.java | 1 -
.../processors/rest/handlers/top/GridTopologyCommandHandler.java | 1 -
.../internal/visor/cache/VisorCacheAffinityConfiguration.java | 1 -
4 files changed, 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/75d960eb/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
index 1f8b0b4..571ae25 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.store.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.internal.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/75d960eb/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 66a751c..f00a853 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
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.fair.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cache.store.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/75d960eb/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
index 4bcc566..7c2a15b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.rest.handlers.top;
import org.apache.ignite.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/75d960eb/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
index 7aae6f3..c43dc1c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityConfiguration.java
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.visor.cache;
import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.jetbrains.annotations.*;