You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by se...@apache.org on 2015/11/25 19:40:04 UTC
[1/8] ignite git commit: IGNITE-1999: Improved .NET ServicesExample a
bit.
Repository: ignite
Updated Branches:
refs/heads/ignite-sql-opt-2 f7e019994 -> 123b9db8f
IGNITE-1999: Improved .NET ServicesExample a bit.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f9690df8
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f9690df8
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f9690df8
Branch: refs/heads/ignite-sql-opt-2
Commit: f9690df8e6a87b5e537a2e75f5affc61deda468d
Parents: ef2007d
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Nov 25 17:44:15 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Nov 25 17:44:15 2015 +0300
----------------------------------------------------------------------
.../examples/Apache.Ignite.Examples/Services/ServicesExample.cs | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f9690df8/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
index 121a5c4..77eb253 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
@@ -72,6 +72,10 @@ namespace Apache.Ignite.Examples.Services
ignite.GetServices().CancelAll();
}
+
+ Console.WriteLine();
+ Console.WriteLine(">>> Example finished, press any key to exit ...");
+ Console.ReadKey();
}
}
}
[7/8] ignite git commit: Merge branches 'ignite-1.5' and
'ignite-sql-opt-2' of https://git-wip-us.apache.org/repos/asf/ignite into
ignite-sql-opt-2
Posted by se...@apache.org.
Merge branches 'ignite-1.5' and 'ignite-sql-opt-2' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-sql-opt-2
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/91e19606
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/91e19606
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/91e19606
Branch: refs/heads/ignite-sql-opt-2
Commit: 91e1960643dea9d7bdca1ce2a317fd14be130740
Parents: f7e0199 97270bf
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Nov 25 20:23:35 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Nov 25 20:23:35 2015 +0300
----------------------------------------------------------------------
.../client/router/RouterFactorySelfTest.java | 2 +
.../java/org/apache/ignite/IgniteCache.java | 23 +++
.../processors/cache/GridCacheAdapter.java | 156 ++++++++++++++++++-
.../processors/cache/GridCacheProxyImpl.java | 61 ++++++++
.../processors/cache/IgniteCacheProxy.java | 42 +++++
.../processors/cache/IgniteInternalCache.java | 47 +++++-
.../distributed/dht/GridDhtCacheAdapter.java | 7 +-
.../distributed/near/GridNearCacheAdapter.java | 10 ++
.../ignite/resources/MBeanServerResource.java | 69 --------
.../CacheDeferredDeleteSanitySelfTest.java | 98 ++++++++++++
.../cache/CacheStopAndDestroySelfTest.java | 8 +-
.../multijvm/IgniteCacheProcessProxy.java | 38 +++++
.../ignite/testsuites/IgniteCacheTestSuite.java | 2 +
...niteCacheP2pUnmarshallingQueryErrorTest.java | 7 +-
.../Services/ServicesExample.cs | 4 +
.../ignite-int-max-values-offheap-config.xml | 89 +++++++++++
.../ignite-int-max-values-onheap-config.xml | 84 ++++++++++
.../ignite-int-max-values-swap-config.xml | 93 +++++++++++
.../test-max-int-values-offheap.properties | 70 +++++++++
.../test-max-int-values-onheap.properties | 70 +++++++++
.../config/test-max-int-values-swap.properties | 69 ++++++++
.../yardstick/cache/IntMaxValueEntriesTest.java | 135 ++++++++++++++++
22 files changed, 1105 insertions(+), 79 deletions(-)
----------------------------------------------------------------------
[2/8] ignite git commit: IGNITE-1544: Make sure objects number stored
in a cache can be bigger than Integer.MAX_VALUE. This closes #252
Posted by se...@apache.org.
IGNITE-1544: Make sure objects number stored in a cache can be bigger than Integer.MAX_VALUE. This closes #252
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8a9cc540
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8a9cc540
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8a9cc540
Branch: refs/heads/ignite-sql-opt-2
Commit: 8a9cc5408f99713fb4a1a9036940fc76aef7b050
Parents: c23cda1
Author: Andrey Gura <ag...@gridgain.com>
Authored: Wed Nov 25 18:21:48 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Nov 25 18:21:48 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/IgniteCache.java | 23 +++
.../processors/cache/GridCacheAdapter.java | 156 ++++++++++++++++++-
.../processors/cache/GridCacheProxyImpl.java | 61 ++++++++
.../processors/cache/IgniteCacheProxy.java | 42 +++++
.../processors/cache/IgniteInternalCache.java | 47 +++++-
.../distributed/dht/GridDhtCacheAdapter.java | 7 +-
.../distributed/near/GridNearCacheAdapter.java | 10 ++
.../CacheDeferredDeleteSanitySelfTest.java | 98 ++++++++++++
.../multijvm/IgniteCacheProcessProxy.java | 38 +++++
.../ignite/testsuites/IgniteCacheTestSuite.java | 2 +
...niteCacheP2pUnmarshallingQueryErrorTest.java | 7 +-
.../ignite-int-max-values-offheap-config.xml | 89 +++++++++++
.../ignite-int-max-values-onheap-config.xml | 84 ++++++++++
.../ignite-int-max-values-swap-config.xml | 93 +++++++++++
.../test-max-int-values-offheap.properties | 70 +++++++++
.../test-max-int-values-onheap.properties | 70 +++++++++
.../config/test-max-int-values-swap.properties | 69 ++++++++
.../yardstick/cache/IntMaxValueEntriesTest.java | 135 ++++++++++++++++
18 files changed, 1094 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index c9de3f1..c575865 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -348,6 +348,19 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
public int size(CachePeekMode... peekModes) throws CacheException;
/**
+ * Gets the number of all entries cached across all nodes as a long value. By default, if {@code peekModes} value
+ * isn't defined, only size of primary copies across all nodes will be returned. This behavior is identical to
+ * calling this method with {@link CachePeekMode#PRIMARY} peek mode.
+ * <p>
+ * NOTE: this operation is distributed and will query all participating nodes for their cache sizes.
+ *
+ * @param peekModes Optional peek modes. If not provided, then total cache size is returned.
+ * @return Cache size across all nodes.
+ */
+ @IgniteAsyncSupported
+ public long sizeLong(CachePeekMode... peekModes) throws CacheException;
+
+ /**
* Gets the number of all entries cached on this node. By default, if {@code peekModes} value isn't defined,
* only size of primary copies will be returned. This behavior is identical to calling this method with
* {@link CachePeekMode#PRIMARY} peek mode.
@@ -358,6 +371,16 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
public int localSize(CachePeekMode... peekModes);
/**
+ * Gets the number of all entries cached on this node as a long value. By default, if {@code peekModes} value isn't
+ * defined, only size of primary copies will be returned. This behavior is identical to calling this method with
+ * {@link CachePeekMode#PRIMARY} peek mode.
+ *
+ * @param peekModes Optional peek modes. If not provided, then total cache size is returned.
+ * @return Cache size on this node.
+ */
+ public long localSizeLong(CachePeekMode... peekModes);
+
+ /**
* @param map Map containing keys and entry processors to be applied to values.
* @param args Additional arguments to pass to the {@link EntryProcessor}.
* @return The map of {@link EntryProcessorResult}s of the processing per key,
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 26a3acd..d9713e1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -303,7 +303,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
* @param ctx Cache context.
* @param map Concurrent map.
*/
- @SuppressWarnings("OverriddenMethodCallDuringObjectConstruction")
+ @SuppressWarnings({"OverriddenMethodCallDuringObjectConstruction", "deprecation"})
protected GridCacheAdapter(final GridCacheContext<K, V> ctx, GridCacheConcurrentMap map) {
assert ctx != null;
@@ -821,6 +821,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
* @throws GridCacheEntryRemovedException If entry removed.
* @throws IgniteCheckedException If failed.
*/
+ @SuppressWarnings("ConstantConditions")
@Nullable private CacheObject localCachePeek0(KeyCacheObject key,
boolean heap,
boolean offheap,
@@ -3601,6 +3602,14 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
+ @Override public long sizeLong(CachePeekMode[] peekModes) throws IgniteCheckedException {
+ if (isLocal())
+ return localSizeLong(peekModes);
+
+ return sizeLongAsync(peekModes).get();
+ }
+
+ /** {@inheritDoc} */
@Override public IgniteInternalFuture<Integer> sizeAsync(final CachePeekMode[] peekModes) {
assert peekModes != null;
@@ -3622,11 +3631,36 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
- @SuppressWarnings("ForLoopReplaceableByForEach")
+ @Override public IgniteInternalFuture<Long> sizeLongAsync(final CachePeekMode[] peekModes) {
+ assert peekModes != null;
+
+ PeekModes modes = parsePeekModes(peekModes, true);
+
+ IgniteClusterEx cluster = ctx.grid().cluster();
+
+ ClusterGroup grp = modes.near ? cluster.forCacheNodes(name(), true, true, false) : cluster.forDataNodes(name());
+
+ Collection<ClusterNode> nodes = grp.nodes();
+
+ if (nodes.isEmpty())
+ return new GridFinishedFuture<>(0L);
+
+ ctx.kernalContext().task().setThreadContext(TC_SUBGRID, nodes);
+
+ return ctx.kernalContext().task().execute(
+ new SizeLongTask(ctx.name(), ctx.affinity().affinityTopologyVersion(), peekModes), null);
+ }
+
+ /** {@inheritDoc} */
@Override public int localSize(CachePeekMode[] peekModes) throws IgniteCheckedException {
+ return (int)localSizeLong(peekModes);
+ }
+
+ /** {@inheritDoc} */
+ @Override public long localSizeLong(CachePeekMode[] peekModes) throws IgniteCheckedException {
PeekModes modes = parsePeekModes(peekModes, true);
- int size = 0;
+ long size = 0;
if (ctx.isLocal()) {
modes.primary = true;
@@ -3676,6 +3710,11 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
+ @Override public long sizeLong() {
+ return map.publicSize();
+ }
+
+ /** {@inheritDoc} */
@Override public int nearSize() {
return 0;
}
@@ -3686,6 +3725,11 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
+ @Override public long primarySizeLong() {
+ return map.publicSize();
+ }
+
+ /** {@inheritDoc} */
@Override public String toString() {
return S.toString(GridCacheAdapter.class, this, "name", name(), "size", size());
}
@@ -5233,6 +5277,47 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/**
+ * Internal callable for global size calculation.
+ */
+ @GridInternal
+ private static class SizeLongJob extends TopologyVersionAwareJob {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Peek modes. */
+ private final CachePeekMode[] peekModes;
+
+ /**
+ * @param cacheName Cache name.
+ * @param topVer Affinity topology version.
+ * @param peekModes Cache peek modes.
+ */
+ private SizeLongJob(String cacheName, AffinityTopologyVersion topVer, CachePeekMode[] peekModes) {
+ super(cacheName, topVer);
+
+ this.peekModes = peekModes;
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public Object localExecute(@Nullable IgniteInternalCache cache) {
+ if (cache == null)
+ return 0;
+
+ try {
+ return cache.localSizeLong(peekModes);
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public String toString() {
+ return S.toString(SizeLongJob.class, this);
+ }
+ }
+
+ /**
* Holder for last async operation future.
*/
protected static class FutureHolder {
@@ -5942,6 +6027,71 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/**
+ * Size task.
+ */
+ private static class SizeLongTask extends ComputeTaskAdapter<Object, Long> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Cache name. */
+ private final String cacheName;
+
+ /** Affinity topology version. */
+ private final AffinityTopologyVersion topVer;
+
+ /** Peek modes. */
+ private final CachePeekMode[] peekModes;
+
+ /**
+ * @param cacheName Cache name.
+ * @param topVer Affinity topology version.
+ * @param peekModes Cache peek modes.
+ */
+ public SizeLongTask(String cacheName, AffinityTopologyVersion topVer, CachePeekMode[] peekModes) {
+ this.cacheName = cacheName;
+ this.topVer = topVer;
+ this.peekModes = peekModes;
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @Nullable Object arg) throws IgniteException {
+ Map<ComputeJob, ClusterNode> jobs = new HashMap();
+
+ for (ClusterNode node : subgrid)
+ jobs.put(new SizeLongJob(cacheName, topVer, peekModes), node);
+
+ return jobs;
+ }
+
+ /** {@inheritDoc} */
+ @Override public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) {
+ IgniteException e = res.getException();
+
+ if (e != null) {
+ if (e instanceof ClusterTopologyException)
+ return ComputeJobResultPolicy.WAIT;
+
+ throw new IgniteException("Remote job threw exception.", e);
+ }
+
+ return ComputeJobResultPolicy.WAIT;
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public Long reduce(List<ComputeJobResult> results) throws IgniteException {
+ long size = 0;
+
+ for (ComputeJobResult res : results) {
+ if (res != null && res.getException() == null)
+ size += res.<Long>getData();
+ }
+
+ return size;
+ }
+ }
+
+ /**
* Clear task.
*/
private static class ClearTask<K> extends ComputeTaskAdapter<Object, Object> {
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index cca6d6a..e82c422 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -228,6 +228,7 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
}
/** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
@Override public <K1, V1> GridCacheProxyImpl<K1, V1> keepPortable() {
if (opCtx != null && opCtx.isKeepBinary())
return (GridCacheProxyImpl<K1, V1>)this;
@@ -1352,6 +1353,18 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
}
/** {@inheritDoc} */
+ @Override public long sizeLong() {
+ CacheOperationContext prev = gate.enter(opCtx);
+
+ try {
+ return delegate.sizeLong();
+ }
+ finally {
+ gate.leave(prev);
+ }
+ }
+
+ /** {@inheritDoc} */
@Override public int size(CachePeekMode[] peekModes) throws IgniteCheckedException {
CacheOperationContext prev = gate.enter(opCtx);
@@ -1364,6 +1377,18 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
}
/** {@inheritDoc} */
+ @Override public long sizeLong(CachePeekMode[] peekModes) throws IgniteCheckedException {
+ CacheOperationContext prev = gate.enter(opCtx);
+
+ try {
+ return delegate.sizeLong(peekModes);
+ }
+ finally {
+ gate.leave(prev);
+ }
+ }
+
+ /** {@inheritDoc} */
@Override public IgniteInternalFuture<Integer> sizeAsync(CachePeekMode[] peekModes) {
CacheOperationContext prev = gate.enter(opCtx);
@@ -1376,6 +1401,18 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
}
/** {@inheritDoc} */
+ @Override public IgniteInternalFuture<Long> sizeLongAsync(CachePeekMode[] peekModes) {
+ CacheOperationContext prev = gate.enter(opCtx);
+
+ try {
+ return delegate.sizeLongAsync(peekModes);
+ }
+ finally {
+ gate.leave(prev);
+ }
+ }
+
+ /** {@inheritDoc} */
@Override public int localSize(CachePeekMode[] peekModes) throws IgniteCheckedException {
CacheOperationContext prev = gate.enter(opCtx);
@@ -1388,6 +1425,18 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
}
/** {@inheritDoc} */
+ @Override public long localSizeLong(CachePeekMode[] peekModes) throws IgniteCheckedException {
+ CacheOperationContext prev = gate.enter(opCtx);
+
+ try {
+ return delegate.localSizeLong(peekModes);
+ }
+ finally {
+ gate.leave(prev);
+ }
+ }
+
+ /** {@inheritDoc} */
@Override public int nearSize() {
CacheOperationContext prev = gate.enter(opCtx);
@@ -1412,6 +1461,18 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
}
/** {@inheritDoc} */
+ @Override public long primarySizeLong() {
+ CacheOperationContext prev = gate.enter(opCtx);
+
+ try {
+ return delegate.primarySizeLong();
+ }
+ finally {
+ gate.leave(prev);
+ }
+ }
+
+ /** {@inheritDoc} */
@Override public void promoteAll(@Nullable Collection<? extends K> keys) throws IgniteCheckedException {
CacheOperationContext prev = gate.enter(opCtx);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index cb36432..2bab152 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -279,6 +279,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
}
/** {@inheritDoc} */
+ @SuppressWarnings("deprecation")
@Nullable @Override public Cache.Entry<K, V> randomEntry() {
GridKernalContext kctx = ctx.kernalContext();
@@ -784,6 +785,30 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
}
/** {@inheritDoc} */
+ @Override public long sizeLong(CachePeekMode... peekModes) throws CacheException {
+ GridCacheGateway<K, V> gate = this.gate;
+
+ CacheOperationContext prev = onEnter(gate, opCtx);
+
+ try {
+ if (isAsync()) {
+ setFuture(delegate.sizeLongAsync(peekModes));
+
+ return 0;
+ }
+ else
+ return delegate.sizeLong(peekModes);
+ }
+ catch (IgniteCheckedException e) {
+ throw cacheException(e);
+ }
+ finally {
+ onLeave(gate, prev);
+ }
+ }
+
+
+ /** {@inheritDoc} */
@Override public int localSize(CachePeekMode... peekModes) {
GridCacheGateway<K, V> gate = this.gate;
@@ -801,6 +826,23 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
}
/** {@inheritDoc} */
+ @Override public long localSizeLong(CachePeekMode... peekModes) {
+ GridCacheGateway<K, V> gate = this.gate;
+
+ CacheOperationContext prev = onEnter(gate, opCtx);
+
+ try {
+ return delegate.localSizeLong(peekModes);
+ }
+ catch (IgniteCheckedException e) {
+ throw cacheException(e);
+ }
+ finally {
+ onLeave(gate, prev);
+ }
+ }
+
+ /** {@inheritDoc} */
@Override public V get(K key) {
try {
GridCacheGateway<K, V> gate = this.gate;
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
index 4155706..1055cf4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
@@ -1342,6 +1342,17 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
public int size();
/**
+ * Gets the number of all entries cached on this node as a long value. This method will return the count of
+ * all cache entries and has O(1) complexity on base {@link IgniteInternalCache}. It is essentially the
+ * size of cache key set and is semantically identical to {{@code Cache.keySet().size()}.
+ * <p>
+ * NOTE: this operation is not distributed and returns only the number of entries cached on this node.
+ *
+ * @return Size of cache on this node.
+ */
+ public long sizeLong();
+
+ /**
* @param peekModes Peek modes.
* @return Local cache size.
* @throws IgniteCheckedException If failed.
@@ -1350,6 +1361,13 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
/**
* @param peekModes Peek modes.
+ * @return Local cache size as a long value.
+ * @throws IgniteCheckedException If failed.
+ */
+ public long localSizeLong(CachePeekMode[] peekModes) throws IgniteCheckedException;
+
+ /**
+ * @param peekModes Peek modes.
* @return Global cache size.
* @throws IgniteCheckedException If failed.
*/
@@ -1357,11 +1375,24 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
/**
* @param peekModes Peek modes.
+ * @return Global cache size as a long value.
+ * @throws IgniteCheckedException If failed.
+ */
+ public long sizeLong(CachePeekMode[] peekModes) throws IgniteCheckedException;
+
+ /**
+ * @param peekModes Peek modes.
* @return Future.
*/
public IgniteInternalFuture<Integer> sizeAsync(CachePeekMode[] peekModes);
/**
+ * @param peekModes Peek modes.
+ * @return Future.
+ */
+ public IgniteInternalFuture<Long> sizeLongAsync(CachePeekMode[] peekModes);
+
+ /**
* Gets size of near cache key set. This method will return count of all entries in near
* cache and has O(1) complexity on base cache projection.
* <p>
@@ -1386,6 +1417,20 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
public int primarySize();
/**
+ * Gets the number of all primary entries cached on this node as a long value. For {@link CacheMode#LOCAL}
+ * non-distributed cache mode, this method is identical to {@link #size()}.
+ * <p>
+ * For {@link CacheMode#PARTITIONED} and {@link CacheMode#REPLICATED} modes, this method will
+ * return number of primary entries cached on this node (excluding any backups). The complexity of
+ * this method is O(P), where P is the total number of partitions.
+ * <p>
+ * NOTE: this operation is not distributed and returns only the number of primary entries cached on this node.
+ *
+ * @return Number of primary entries in cache.
+ */
+ public long primarySizeLong();
+
+ /**
* This method unswaps cache entries by given keys, if any, from swap storage
* into memory.
* <h2 class="header">Transactions</h2>
@@ -1491,7 +1536,7 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
* @param subjId Client ID.
* @return Internal projection.
*/
- IgniteInternalCache<K, V> forSubjectId(UUID subjId);
+ public IgniteInternalCache<K, V> forSubjectId(UUID subjId);
/**
* Store DR data.
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index 8537357..de11235 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -593,7 +593,12 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
/** {@inheritDoc} */
@Override public int primarySize() {
- int sum = 0;
+ return (int)primarySizeLong();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long primarySizeLong() {
+ long sum = 0;
AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion();
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index cc9d007..b471486 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -310,11 +310,21 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
}
/** {@inheritDoc} */
+ @Override public long sizeLong() {
+ return nearEntries().size() + dht().sizeLong();
+ }
+
+ /** {@inheritDoc} */
@Override public int primarySize() {
return dht().primarySize();
}
/** {@inheritDoc} */
+ @Override public long primarySizeLong() {
+ return dht().primarySizeLong();
+ }
+
+ /** {@inheritDoc} */
@Override public int nearSize() {
return nearEntries().size();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDeferredDeleteSanitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDeferredDeleteSanitySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDeferredDeleteSanitySelfTest.java
new file mode 100644
index 0000000..5040172
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDeferredDeleteSanitySelfTest.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.NearCacheConfiguration;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMode.LOCAL;
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+import static org.apache.ignite.cache.CacheMode.REPLICATED;
+
+/**
+ * Sanity tests of deferred delete for different cache configurations.
+ */
+public class CacheDeferredDeleteSanitySelfTest extends GridCommonAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ startGrid(0);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception If fails.
+ */
+ public void testDeferredDelete() throws Exception {
+ testDeferredDelete(LOCAL, ATOMIC, false, false);
+ testDeferredDelete(LOCAL, TRANSACTIONAL, false, false);
+
+ testDeferredDelete(PARTITIONED, ATOMIC, false, true);
+ testDeferredDelete(PARTITIONED, TRANSACTIONAL, false, true);
+
+ testDeferredDelete(REPLICATED, ATOMIC, false, true);
+ testDeferredDelete(REPLICATED, TRANSACTIONAL, false, true);
+
+ // Near
+ testDeferredDelete(LOCAL, ATOMIC, true, false);
+ testDeferredDelete(LOCAL, TRANSACTIONAL, true, false);
+
+ testDeferredDelete(PARTITIONED, ATOMIC, true, true);
+ testDeferredDelete(PARTITIONED, TRANSACTIONAL, true, false);
+
+ testDeferredDelete(REPLICATED, ATOMIC, true, true);
+ testDeferredDelete(REPLICATED, TRANSACTIONAL, true, true);
+ }
+
+ /**
+ * @param mode Mode.
+ * @param atomicityMode Atomicity mode.
+ * @param near Near cache enabled.
+ * @param expVal Expected deferred delete value.
+ */
+ @SuppressWarnings("unchecked")
+ private void testDeferredDelete(CacheMode mode, CacheAtomicityMode atomicityMode, boolean near, boolean expVal) {
+ CacheConfiguration ccfg = new CacheConfiguration()
+ .setCacheMode(mode)
+ .setAtomicityMode(atomicityMode);
+
+ if (near)
+ ccfg.setNearConfiguration(new NearCacheConfiguration());
+
+ IgniteCache cache = null;
+
+ try {
+ cache = grid(0).getOrCreateCache(ccfg);
+
+ assertEquals(expVal, ((IgniteCacheProxy)grid(0).cache(null)).context().deferredDelete());
+ }
+ finally {
+ if (cache != null)
+ cache.destroy();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
index d2e17d8..035f1b0 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
@@ -196,11 +196,21 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
}
/** {@inheritDoc} */
+ @Override public long sizeLong(CachePeekMode... peekModes) throws CacheException {
+ return compute.call(new SizeLongTask(cacheName, isAsync, peekModes, false));
+ }
+
+ /** {@inheritDoc} */
@Override public int localSize(CachePeekMode... peekModes) {
return compute.call(new SizeTask(cacheName, isAsync, peekModes, true));
}
/** {@inheritDoc} */
+ @Override public long localSizeLong(CachePeekMode... peekModes) {
+ return compute.call(new SizeLongTask(cacheName, isAsync, peekModes, true));
+ }
+
+ /** {@inheritDoc} */
@Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(
Map<? extends K, ? extends EntryProcessor<K, V, T>> map,
Object... args)
@@ -649,6 +659,34 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
/**
*
*/
+ private static class SizeLongTask extends CacheTaskAdapter<Void, Void, Long> {
+ /** Peek modes. */
+ private final CachePeekMode[] peekModes;
+
+ /** Local. */
+ private final boolean loc;
+
+ /**
+ * @param cacheName Cache name.
+ * @param async Async.
+ * @param peekModes Peek modes.
+ * @param loc Local.
+ */
+ public SizeLongTask(String cacheName, boolean async, CachePeekMode[] peekModes, boolean loc) {
+ super(cacheName, async);
+ this.loc = loc;
+ this.peekModes = peekModes;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Long call() throws Exception {
+ return loc ? cache().localSizeLong(peekModes) : cache().sizeLong(peekModes);
+ }
+ }
+
+ /**
+ *
+ */
private static class GetTask<K, V> extends CacheTaskAdapter<K, V, V> {
/** Key. */
private final K key;
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/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 8af9443..2c9ba93 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
@@ -36,6 +36,7 @@ import org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStorePortableMarshallerSe
import org.apache.ignite.cache.store.jdbc.GridCacheJdbcBlobStoreMultithreadedSelfTest;
import org.apache.ignite.cache.store.jdbc.GridCacheJdbcBlobStoreSelfTest;
import org.apache.ignite.internal.processors.cache.CacheAffinityCallSelfTest;
+import org.apache.ignite.internal.processors.cache.CacheDeferredDeleteSanitySelfTest;
import org.apache.ignite.internal.processors.cache.CacheFutureExceptionSelfTest;
import org.apache.ignite.internal.processors.cache.CacheNamesSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheAffinityApiSelfTest;
@@ -262,6 +263,7 @@ public class IgniteCacheTestSuite extends TestSuite {
suite.addTestSuite(GridCachePartitionedOffHeapLocalStoreSelfTest.class);
suite.addTestSuite(GridCacheTxPartitionedLocalStoreSelfTest.class);
suite.addTestSuite(IgniteCacheSystemTransactionsSelfTest.class);
+ suite.addTestSuite(CacheDeferredDeleteSanitySelfTest.class);
suite.addTest(IgniteCacheTcpClientDiscoveryTestSuite.suite());
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
index 4d9456a..d4a4c62 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache;
import java.io.IOException;
import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import javax.cache.CacheException;
import org.apache.ignite.cache.query.ScanQuery;
import org.apache.ignite.cache.query.SqlQuery;
@@ -68,8 +69,6 @@ public class IgniteCacheP2pUnmarshallingQueryErrorTest extends IgniteCacheP2pUnm
public void testResponseMessageOnRequestUnmarshallingFailed() throws Exception {
readCnt.set(Integer.MAX_VALUE);
- jcache(0).put(new TestKey(String.valueOf(++key)), "");
-
try {
jcache().query(new ScanQuery<>(new IgniteBiPredicate<TestKey, String>() {
@Override public boolean apply(TestKey key, String val) {
@@ -79,6 +78,10 @@ public class IgniteCacheP2pUnmarshallingQueryErrorTest extends IgniteCacheP2pUnm
private void readObject(ObjectInputStream is) throws IOException {
throw new IOException();
}
+
+ private void writeObject(ObjectOutputStream os) throws IOException {
+ throw new IOException();
+ }
})).getAll();
assertTrue("Request unmarshalling failed, but error response was not sent.", portableMarshaller());
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/yardstick/config/ignite-int-max-values-offheap-config.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/config/ignite-int-max-values-offheap-config.xml b/modules/yardstick/config/ignite-int-max-values-offheap-config.xml
new file mode 100644
index 0000000..1aaab67
--- /dev/null
+++ b/modules/yardstick/config/ignite-int-max-values-offheap-config.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!--
+ Ignite Spring configuration file.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+ <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ <property name="peerClassLoadingEnabled" value="true"/>
+
+ <property name="marshaller">
+ <bean class="org.apache.ignite.marshaller.optimized.OptimizedMarshaller">
+ <property name="requireSerializable" value="false"/>
+ </bean>
+ </property>
+
+<!--
+ <property name="marshaller">
+ <bean class="org.apache.ignite.internal.portable.api.PortableMarshaller"/>
+ </property>
+-->
+
+ <property name="networkTimeout" value="600000"/>
+
+ <property name="discoverySpi">
+ <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+ <property name="networkTimeout" value="600000"/>
+
+ <property name="socketTimeout" value="600000"/>
+
+ <property name="ackTimeout" value="60000"/>
+
+ <property name="ipFinder">
+ <!-- <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder"> -->
+ <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+ <!--
+ <property name="addresses">
+ <list>
+ <!– In distributed environment, replace with actual host IP address. –>
+ <value>127.0.0.1:47500..47509</value>
+ </list>
+ </property>
+ -->
+ </bean>
+ </property>
+ </bean>
+ </property>
+
+ <property name="cacheConfiguration">
+ <list>
+ <bean class="org.apache.ignite.configuration.CacheConfiguration">
+ <property name="name" value="int-max-value-cache"/>
+ <property name="cacheMode" value="PARTITIONED"/>
+ <property name="backups" value="0"/>
+ <property name="atomicityMode" value="ATOMIC"/>
+ <property name="memoryMode" value="ONHEAP_TIERED"/>
+ <property name="offHeapMaxMemory" value="#{32 * 1024 * 1024 * 1024L}"/>
+ <property name="swapEnabled" value="false"/>
+ <property name="evictionPolicy">
+ <bean class="org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy">
+ <property name="maxSize" value="4000000"/>
+ <property name="batchSize" value="500000"/>
+ </bean>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+</beans>
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/yardstick/config/ignite-int-max-values-onheap-config.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/config/ignite-int-max-values-onheap-config.xml b/modules/yardstick/config/ignite-int-max-values-onheap-config.xml
new file mode 100644
index 0000000..d1359b3
--- /dev/null
+++ b/modules/yardstick/config/ignite-int-max-values-onheap-config.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!--
+ Ignite Spring configuration file.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+ <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ <property name="peerClassLoadingEnabled" value="true"/>
+
+ <property name="marshaller">
+ <bean class="org.apache.ignite.marshaller.optimized.OptimizedMarshaller">
+ <property name="requireSerializable" value="false"/>
+ </bean>
+ </property>
+
+<!--
+ <property name="marshaller">
+ <bean class="org.apache.ignite.internal.portable.api.PortableMarshaller"/>
+ </property>
+-->
+
+ <property name="networkTimeout" value="600000"/>
+
+ <property name="discoverySpi">
+ <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+ <property name="networkTimeout" value="600000"/>
+
+ <property name="socketTimeout" value="600000"/>
+
+ <property name="ackTimeout" value="60000"/>
+
+
+ <property name="ipFinder">
+ <!-- <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder"> -->
+ <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+ <!--
+ <property name="addresses">
+ <list>
+ <!– In distributed environment, replace with actual host IP address. –>
+ <value>127.0.0.1:47500..47509</value>
+ </list>
+ </property>
+ -->
+ </bean>
+ </property>
+ </bean>
+ </property>
+
+ <property name="cacheConfiguration">
+ <list>
+ <bean class="org.apache.ignite.configuration.CacheConfiguration">
+ <property name="name" value="int-max-value-cache"/>
+ <property name="cacheMode" value="PARTITIONED"/>
+ <property name="backups" value="0"/>
+ <property name="atomicityMode" value="ATOMIC"/>
+ <property name="memoryMode" value="ONHEAP_TIERED"/>
+ <property name="offHeapMaxMemory" value="-1"/>
+ <property name="swapEnabled" value="false"/>
+ </bean>
+ </list>
+ </property>
+ </bean>
+</beans>
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/yardstick/config/ignite-int-max-values-swap-config.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/config/ignite-int-max-values-swap-config.xml b/modules/yardstick/config/ignite-int-max-values-swap-config.xml
new file mode 100644
index 0000000..8634b4f
--- /dev/null
+++ b/modules/yardstick/config/ignite-int-max-values-swap-config.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!--
+ Ignite Spring configuration file.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+ <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ <property name="peerClassLoadingEnabled" value="true"/>
+
+ <property name="marshaller">
+ <bean class="org.apache.ignite.marshaller.optimized.OptimizedMarshaller">
+ <property name="requireSerializable" value="false"/>
+ </bean>
+ </property>
+
+<!--
+ <property name="marshaller">
+ <bean class="org.apache.ignite.internal.portable.api.PortableMarshaller"/>
+ </property>
+-->
+
+ <property name="networkTimeout" value="600000"/>
+
+ <property name="discoverySpi">
+ <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+ <property name="networkTimeout" value="600000"/>
+
+ <property name="socketTimeout" value="600000"/>
+
+ <property name="ackTimeout" value="60000"/>
+
+ <property name="ipFinder">
+ <!-- <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder"> -->
+ <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+ <!--
+ <property name="addresses">
+ <list>
+ <!– In distributed environment, replace with actual host IP address. –>
+ <value>127.0.0.1:47500..47509</value>
+ </list>
+ </property>
+ -->
+ </bean>
+ </property>
+ </bean>
+ </property>
+
+ <property name="cacheConfiguration">
+ <list>
+ <bean class="org.apache.ignite.configuration.CacheConfiguration">
+ <property name="name" value="int-max-value-cache"/>
+ <property name="cacheMode" value="PARTITIONED"/>
+ <property name="backups" value="0"/>
+ <property name="atomicityMode" value="ATOMIC"/>
+ <property name="memoryMode" value="ONHEAP_TIERED"/>
+ <property name="offHeapMaxMemory" value="#{32 * 1024 * 1024 * 1024L}"/>
+ <property name="swapEnabled" value="true"/>
+ <property name="evictionPolicy">
+ <bean class="org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy">
+ <property name="maxSize" value="4000000"/>
+ <property name="batchSize" value="500000"/>
+ </bean>
+ </property>
+ </bean>
+ </list>
+ </property>
+
+ <property name="swapSpaceSpi">
+ <bean class="org.apache.ignite.spi.swapspace.file.FileSwapSpaceSpi"/>
+ </property>
+ </bean>
+</beans>
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/yardstick/config/test-max-int-values-offheap.properties
----------------------------------------------------------------------
diff --git a/modules/yardstick/config/test-max-int-values-offheap.properties b/modules/yardstick/config/test-max-int-values-offheap.properties
new file mode 100644
index 0000000..5b4da20
--- /dev/null
+++ b/modules/yardstick/config/test-max-int-values-offheap.properties
@@ -0,0 +1,70 @@
+# 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.
+
+#
+# Contains benchmarks for SQL queries.
+#
+
+# JVM options.
+# JVM_OPTS=${JVM_OPTS}" -DIGNITE_QUIET=false"
+
+# Uncomment to enable concurrent garbage collection (GC) if you encounter long GC pauses.
+JVM_OPTS=${JVM_OPTS}" -DIGNITE_QUIET=false \
+ -Xloggc:./gc${now0}.log \
+ -XX:+PrintGCDetails \
+ -XX:-PrintGCTimeStamps \
+ -verbose:gc \
+ -Xmx8g \
+ -Xms8g \
+ -XX:+UseParNewGC \
+ -XX:+UseConcMarkSweepGC \
+ -XX:+UseTLAB \
+ -XX:NewSize=1g \
+ -XX:MaxNewSize=1g \
+ -XX:MaxTenuringThreshold=0 \
+ -XX:SurvivorRatio=1024 \
+ -XX:+UseCMSInitiatingOccupancyOnly \
+ -XX:CMSInitiatingOccupancyFraction=60 \
+"
+
+# List of default probes.
+# Add DStatProbe or VmStatProbe if your OS supports it (e.g. if running on Linux).
+# BENCHMARK_DEFAULT_PROBES=ThroughputLatencyProbe,PercentileProbe
+
+# Packages where the specified benchmark is searched by reflection mechanism.
+BENCHMARK_PACKAGES=org.yardstickframework,org.apache.ignite.yardstick
+
+# Probe point writer class name.
+# BENCHMARK_WRITER=
+
+# Comma-separated list of the hosts to run BenchmarkServers on. 2 nodes on local host are enabled by default.
+SERVER_HOSTS=fosters-215,fosters-216,fosters-217,fosters-226,fosters-219,fosters-221,fosters-222,fosters-223
+
+# Comma-separated list of the hosts to run BenchmarkDrivers on. 1 node on local host is enabled by default.
+DRIVER_HOSTS=fosters-218
+
+# Remote username.
+# REMOTE_USER=
+
+# Number of nodes, used to wait for the specified number of nodes to start.
+nodesNum=$((`echo ${SERVER_HOSTS} | tr ',' '\n' | wc -l` + `echo ${DRIVER_HOSTS} | tr ',' '\n' | wc -l`))
+
+# Run configuration.
+# Note that each benchmark is set to run for 300 seconds (5 mins) with warm-up set to 60 seconds (1 minute).
+CONFIGS="\
+-cfg ${SCRIPT_DIR}/../config/ignite-int-max-values-offheap-config.xml -nn ${nodesNum} -b 0 -w 0 -d 9999999 -t 1 -sm PRIMARY_SYNC -dn IntMaxValueEntriesTest -sn IgniteNode -ds int-max-values-offheap\
+"
+
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/yardstick/config/test-max-int-values-onheap.properties
----------------------------------------------------------------------
diff --git a/modules/yardstick/config/test-max-int-values-onheap.properties b/modules/yardstick/config/test-max-int-values-onheap.properties
new file mode 100644
index 0000000..d29800a
--- /dev/null
+++ b/modules/yardstick/config/test-max-int-values-onheap.properties
@@ -0,0 +1,70 @@
+# 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.
+
+#
+# Contains benchmarks for SQL queries.
+#
+
+# JVM options.
+# JVM_OPTS=${JVM_OPTS}" -DIGNITE_QUIET=false"
+
+# Uncomment to enable concurrent garbage collection (GC) if you encounter long GC pauses.
+JVM_OPTS=${JVM_OPTS}" -DIGNITE_QUIET=false \
+ -Xloggc:./gc${now0}.log \
+ -XX:+PrintGCDetails \
+ -XX:-PrintGCTimeStamps \
+ -verbose:gc \
+ -Xmx92g \
+ -Xms32g \
+ -XX:+UseParNewGC \
+ -XX:+UseConcMarkSweepGC \
+ -XX:+UseTLAB \
+ -XX:NewSize=4g \
+ -XX:MaxNewSize=4g \
+ -XX:MaxTenuringThreshold=0 \
+ -XX:SurvivorRatio=1024 \
+ -XX:+UseCMSInitiatingOccupancyOnly \
+ -XX:CMSInitiatingOccupancyFraction=60 \
+"
+
+# List of default probes.
+# Add DStatProbe or VmStatProbe if your OS supports it (e.g. if running on Linux).
+# BENCHMARK_DEFAULT_PROBES=ThroughputLatencyProbe,PercentileProbe
+
+# Packages where the specified benchmark is searched by reflection mechanism.
+BENCHMARK_PACKAGES=org.yardstickframework,org.apache.ignite.yardstick
+
+# Probe point writer class name.
+# BENCHMARK_WRITER=
+
+# Comma-separated list of the hosts to run BenchmarkServers on. 2 nodes on local host are enabled by default.
+SERVER_HOSTS=fosters-215,fosters-216,fosters-217,fosters-226,fosters-219,fosters-221,fosters-222,fosters-223
+
+# Comma-separated list of the hosts to run BenchmarkDrivers on. 1 node on local host is enabled by default.
+DRIVER_HOSTS=fosters-218
+
+# Remote username.
+# REMOTE_USER=
+
+# Number of nodes, used to wait for the specified number of nodes to start.
+nodesNum=$((`echo ${SERVER_HOSTS} | tr ',' '\n' | wc -l` + `echo ${DRIVER_HOSTS} | tr ',' '\n' | wc -l`))
+
+# Run configuration.
+# Note that each benchmark is set to run for 300 seconds (5 mins) with warm-up set to 60 seconds (1 minute).
+CONFIGS="\
+-cfg ${SCRIPT_DIR}/../config/ignite-int-max-values-onheap-config.xml -nn ${nodesNum} -b 0 -w 0 -d 9999999 -t 1 -sm PRIMARY_SYNC -dn IntMaxValueEntriesTest -sn IgniteNode -ds int-max-values-onheap\
+"
+
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/yardstick/config/test-max-int-values-swap.properties
----------------------------------------------------------------------
diff --git a/modules/yardstick/config/test-max-int-values-swap.properties b/modules/yardstick/config/test-max-int-values-swap.properties
new file mode 100644
index 0000000..203f004
--- /dev/null
+++ b/modules/yardstick/config/test-max-int-values-swap.properties
@@ -0,0 +1,69 @@
+# 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.
+
+#
+# Contains benchmarks for SQL queries.
+#
+
+# JVM options.
+# JVM_OPTS=${JVM_OPTS}" -DIGNITE_QUIET=false"
+
+# Uncomment to enable concurrent garbage collection (GC) if you encounter long GC pauses.
+JVM_OPTS=${JVM_OPTS}" -DIGNITE_QUIET=false \
+ -Xloggc:./gc${now0}.log \
+ -XX:+PrintGCDetails \
+ -XX:-PrintGCTimeStamps \
+ -verbose:gc \
+ -Xmx8g \
+ -Xms8g \
+ -XX:+UseParNewGC \
+ -XX:+UseConcMarkSweepGC \
+ -XX:+UseTLAB \
+ -XX:NewSize=1g \
+ -XX:MaxNewSize=1g \
+ -XX:MaxTenuringThreshold=0 \
+ -XX:SurvivorRatio=1024 \
+ -XX:+UseCMSInitiatingOccupancyOnly \
+ -XX:CMSInitiatingOccupancyFraction=60 \
+"
+
+# List of default probes.
+# Add DStatProbe or VmStatProbe if your OS supports it (e.g. if running on Linux).
+# BENCHMARK_DEFAULT_PROBES=ThroughputLatencyProbe,PercentileProbe
+
+# Packages where the specified benchmark is searched by reflection mechanism.
+BENCHMARK_PACKAGES=org.yardstickframework,org.apache.ignite.yardstick
+
+# Probe point writer class name.
+# BENCHMARK_WRITER=
+
+# Comma-separated list of the hosts to run BenchmarkServers on. 2 nodes on local host are enabled by default.
+SERVER_HOSTS=fosters-215,fosters-216,fosters-217,fosters-226,fosters-219,fosters-221,fosters-222,fosters-223
+
+# Comma-separated list of the hosts to run BenchmarkDrivers on. 1 node on local host is enabled by default.
+DRIVER_HOSTS=fosters-218
+
+# Remote username.
+# REMOTE_USER=
+
+# Number of nodes, used to wait for the specified number of nodes to start.
+nodesNum=$((`echo ${SERVER_HOSTS} | tr ',' '\n' | wc -l` + `echo ${DRIVER_HOSTS} | tr ',' '\n' | wc -l`))
+
+# Run configuration.
+# Note that each benchmark is set to run for 300 seconds (5 mins) with warm-up set to 60 seconds (1 minute).
+CONFIGS="\
+-cfg ${SCRIPT_DIR}/../config/ignite-int-max-values-swap-config.xml -nn ${nodesNum} -b 0 -w 0 -d 9999999 -t 1 -sm PRIMARY_SYNC -dn IntMaxValueEntriesTest -sn IgniteNode -ds int-max-values-swap\
+"
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/8a9cc540/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IntMaxValueEntriesTest.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IntMaxValueEntriesTest.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IntMaxValueEntriesTest.java
new file mode 100644
index 0000000..06ca3b7
--- /dev/null
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IntMaxValueEntriesTest.java
@@ -0,0 +1,135 @@
+/*
+ * 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.yardstick.cache;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ThreadLocalRandom;
+import javax.cache.Cache;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteDataStreamer;
+import org.jsr166.LongAdder8;
+
+import static org.yardstickframework.BenchmarkUtils.println;
+
+/**
+ *
+ */
+public class IntMaxValueEntriesTest extends IgniteCacheAbstractBenchmark {
+ /** Threads. */
+ private static final int THREADS = 16;
+
+ /** Keys lo. */
+ private static final int KEYS_LO = -100_000;
+
+ /** Keys hi. */
+ private static final long KEYS_HI = Integer.MAX_VALUE;
+
+ /** Report delta. */
+ private static final int REPORT_DELTA = 1_000_000;
+
+ /** Cache name. */
+ private static final String CACHE_NAME = "int-max-value-cache";
+
+ /** {@inheritDoc} */
+ @Override public boolean test(Map<Object, Object> ctx) throws Exception {
+ final IgniteCache<Integer, Object> cache = cache();
+
+ final IgniteDataStreamer<Integer, Object> stmr = ignite().dataStreamer(cache.getName());
+
+ final List<Thread> threads = new ArrayList<>(THREADS);
+
+ final LongAdder8 addedCnt = new LongAdder8();
+
+ int delta = (int)((KEYS_HI + Math.abs(KEYS_LO)) / THREADS);
+
+ System.out.println("Delta: " + delta);
+
+ for (int i = 0; i < THREADS; i++) {
+ final int lo = i == 0 ? KEYS_LO : delta * i + 1;
+
+ final int hi = i == THREADS - 1 ? (int)KEYS_HI : (int)((long)delta * (i + 1));
+
+ Thread t = new Thread(new Runnable() {
+ @Override public void run() {
+ ThreadLocalRandom rnd = ThreadLocalRandom.current();
+
+ byte val = (byte)rnd.nextInt();
+
+ println("Start from " + lo + " to " + hi);
+
+ for (int j = lo, k = 0; j < hi; j++, k++) {
+ stmr.addData(j, val++);
+
+ addedCnt.increment();
+
+ if (k % REPORT_DELTA == 0)
+ println(addedCnt.sum() + " entries");
+ }
+
+ println("Thread finished. " + addedCnt.sum() + " entries.");
+ }
+ });
+
+ threads.add(t);
+ t.start();
+ }
+
+ for (Thread thread : threads)
+ thread.join();
+
+ println("All threads finished. " + addedCnt.sum() + " entries.");
+
+ println("Streamer flush");
+
+ stmr.flush();
+
+ println("Streamer flushed");
+
+ println("Calculating cache size");
+ println("Cache size: " + cache.size());
+
+ println("Calculating long cache size");
+ println("Cache size long: " + cache.sizeLong());
+
+ Thread.sleep(10000);
+
+ println("Iterating started");
+
+ long cnt = 0;
+
+ for (Cache.Entry<Integer, Object> ignored : cache) {
+ cnt++;
+
+ if (cnt > 0 && cnt % REPORT_DELTA == 0)
+ println("Iterated via " + cnt + " entries");
+ }
+
+ println("Iterated via " + cnt + " entries");
+
+ cache.destroy();
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteCache cache() {
+ return ignite().cache(CACHE_NAME);
+ }
+}
[5/8] ignite git commit: ignite-1800: Annotation MBeanServerResource
should be deleted as unsupported. This closes #260
Posted by se...@apache.org.
ignite-1800: Annotation MBeanServerResource should be deleted as unsupported. This closes #260
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b83f75ed
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b83f75ed
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b83f75ed
Branch: refs/heads/ignite-sql-opt-2
Commit: b83f75edaa7145be443429d9cce54c86fe85730a
Parents: e02edcd
Author: Roman Shtykh <ap...@gmail.com>
Authored: Wed Nov 25 18:41:03 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Nov 25 18:41:03 2015 +0300
----------------------------------------------------------------------
.../ignite/resources/MBeanServerResource.java | 69 --------------------
1 file changed, 69 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b83f75ed/modules/core/src/main/java/org/apache/ignite/resources/MBeanServerResource.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/resources/MBeanServerResource.java b/modules/core/src/main/java/org/apache/ignite/resources/MBeanServerResource.java
deleted file mode 100644
index 17b9aa7..0000000
--- a/modules/core/src/main/java/org/apache/ignite/resources/MBeanServerResource.java
+++ /dev/null
@@ -1,69 +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.resources;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import javax.management.MBeanServer;
-
-/**
- * Annotates a field or a setter method for injection of {@link MBeanServer} resource. MBean server
- * is provided to grid via {@link org.apache.ignite.configuration.IgniteConfiguration}.
- * <p>
- * MBean server can be injected into instances of following classes:
- * <ul>
- * <li>{@link org.apache.ignite.compute.ComputeTask}</li>
- * <li>{@link org.apache.ignite.compute.ComputeJob}</li>
- * <li>{@link org.apache.ignite.spi.IgniteSpi}</li>
- * <li>{@link org.apache.ignite.lifecycle.LifecycleBean}</li>
- * </ul>
- * <p>
- * Here is how injection would typically happen:
- * <pre name="code" class="java">
- * public class MyGridJob implements ComputeJob {
- * ...
- * @IgniteMBeanServerResource
- * private MBeanServer mbeanSrv;
- * ...
- * }
- * </pre>
- * or
- * <pre name="code" class="java">
- * public class MyGridJob implements ComputeJob {
- * ...
- * private MBeanSever mbeanSrv;
- * ...
- * @IgniteMBeanServerResource
- * public void setMBeanServer(MBeanServer mbeanSrv) {
- * this.mbeanSrv = mbeanSrv;
- * }
- * ...
- * }
- * </pre>
- * <p>
- * See {@link org.apache.ignite.configuration.IgniteConfiguration#getMBeanServer()} for Grid configuration details.
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.METHOD, ElementType.FIELD})
-public @interface MBeanServerResource {
- // No-op.
-}
\ No newline at end of file
[6/8] ignite git commit: IGNITE-2005: [Test failed] Ignite Java
Client suite fails. This closes #264
Posted by se...@apache.org.
IGNITE-2005: [Test failed] Ignite Java Client suite fails. This closes #264
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/97270bf3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/97270bf3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/97270bf3
Branch: refs/heads/ignite-sql-opt-2
Commit: 97270bf3ec5a220f44b21ba6fbaf254a9c0a6c08
Parents: b83f75e
Author: Andrey Gura <ag...@gridgain.com>
Authored: Wed Nov 25 18:56:15 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Nov 25 18:56:15 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/client/router/RouterFactorySelfTest.java | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/97270bf3/modules/clients/src/test/java/org/apache/ignite/internal/client/router/RouterFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/router/RouterFactorySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/router/RouterFactorySelfTest.java
index d5eee7f..2e9e62a 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/router/RouterFactorySelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/router/RouterFactorySelfTest.java
@@ -105,6 +105,8 @@ public class RouterFactorySelfTest extends GridCommonAbstractTest {
}
finally {
GridRouterFactory.stopAllRouters();
+
+ stopAllGrids();
}
}
}
\ No newline at end of file
[8/8] ignite git commit: ignite-sql-opt-2 - minor review fixes
Posted by se...@apache.org.
ignite-sql-opt-2 - minor review fixes
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/123b9db8
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/123b9db8
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/123b9db8
Branch: refs/heads/ignite-sql-opt-2
Commit: 123b9db8f4f4dc415aa397954128a2ad268fcc66
Parents: 91e1960
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Nov 25 21:39:40 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Nov 25 21:39:40 2015 +0300
----------------------------------------------------------------------
.../processors/query/GridQueryProperty.java | 2 +-
.../processors/query/h2/IgniteH2Indexing.java | 35 +++++++++++---------
.../processors/query/h2/sql/GridSqlSelect.java | 18 +++-------
.../h2/twostep/GridReduceQueryExecutor.java | 22 ++++++------
4 files changed, 37 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/123b9db8/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProperty.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProperty.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProperty.java
index 1b484c1..d623d25 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProperty.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProperty.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.processors.query;
import org.apache.ignite.IgniteCheckedException;
/**
- *
+ * Description and access method for query entity field.
*/
public abstract class GridQueryProperty {
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/123b9db8/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 7c137d2..cc452c1 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -183,7 +183,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
private static final int PREPARED_STMT_CACHE_SIZE = 256;
/** */
- private static final int TWO_STEP_QRY_CACHE_SIZE = 256;
+ private static final int TWO_STEP_QRY_CACHE_SIZE = 1024;
/** Field name for key. */
public static final String KEY_FIELD_NAME = "_key";
@@ -1003,27 +1003,32 @@ public class IgniteH2Indexing implements GridQueryIndexing {
PreparedStatement stmt;
try {
- stmt = prepareStatement(c, sqlQry, true);
+ // Do not cache this statement because the whole two step query object will be cached later on.
+ stmt = prepareStatement(c, sqlQry, false);
}
catch (SQLException e) {
throw new CacheException("Failed to parse query: " + sqlQry, e);
}
-
try {
- bindParameters(stmt, F.asList(qry.getArgs()));
- }
- catch (IgniteCheckedException e) {
- throw new CacheException("Failed to bind parameters: [qry=" + sqlQry + ", params=" +
- Arrays.deepToString(qry.getArgs()) + "]", e);
- }
+ try {
+ bindParameters(stmt, F.asList(qry.getArgs()));
+ }
+ catch (IgniteCheckedException e) {
+ throw new CacheException("Failed to bind parameters: [qry=" + sqlQry + ", params=" +
+ Arrays.deepToString(qry.getArgs()) + "]", e);
+ }
- try {
- twoStepQry = GridSqlQuerySplitter.split((JdbcPreparedStatement)stmt, qry.getArgs(), qry.isCollocated());
+ try {
+ twoStepQry = GridSqlQuerySplitter.split((JdbcPreparedStatement)stmt, qry.getArgs(), qry.isCollocated());
- meta = meta(stmt.getMetaData());
+ meta = meta(stmt.getMetaData());
+ }
+ catch (SQLException e) {
+ throw new CacheException(e);
+ }
}
- catch (SQLException e) {
- throw new CacheException(e);
+ finally {
+ U.close(stmt, log);
}
}
@@ -2419,7 +2424,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
}
/**
- *
+ * Statement cache.
*/
private static class StatementCache extends LinkedHashMap<String, PreparedStatement> {
/** */
http://git-wip-us.apache.org/repos/asf/ignite/blob/123b9db8/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlSelect.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlSelect.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlSelect.java
index ae522da..e190c87 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlSelect.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlSelect.java
@@ -118,21 +118,11 @@ public class GridSqlSelect extends GridSqlQuery {
if (simple) {
for (GridSqlElement expression : columns(true)) {
- if (expression instanceof GridSqlColumn)
- continue;
+ if (expression instanceof GridSqlAlias)
+ expression = expression.child();
- if (expression instanceof GridSqlAlias) {
- if (expression.size() == 1) {
- GridSqlElement child = expression.child();
-
- if (child instanceof GridSqlColumn)
- continue;
- }
- }
-
- simple = false;
-
- break;
+ if (!(expression instanceof GridSqlColumn))
+ return false;
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/123b9db8/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index cf54a4a..1d4fa30 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -605,21 +605,23 @@ public class GridReduceQueryExecutor {
if (skipMergeTbl) {
List<List<?>> res = new ArrayList<>();
- for (GridMergeIndex idx : r.idxs) {
- Cursor cur = idx.findInStream(null, null);
+ assert r.idxs.size() == 1 : r.idxs;
- while (cur.next()) {
- Row row = cur.get();
+ GridMergeIndex idx = r.idxs.get(0);
- int cols = row.getColumnCount();
+ Cursor cur = idx.findInStream(null, null);
- List<Object> resRow = new ArrayList<>(cols);
+ while (cur.next()) {
+ Row row = cur.get();
- for (int c = 0; c < cols; c++)
- resRow .add(row.getValue(c).getObject());
+ int cols = row.getColumnCount();
- res.add(resRow);
- }
+ List<Object> resRow = new ArrayList<>(cols);
+
+ for (int c = 0; c < cols; c++)
+ resRow.add(row.getValue(c).getObject());
+
+ res.add(resRow);
}
resIter = res.iterator();
[4/8] ignite git commit: IGNITE-1992: [Test failed]
CacheStopAndDestroySelfTest.testLocalClose test fails periodicaly. This
closes #261
Posted by se...@apache.org.
IGNITE-1992: [Test failed] CacheStopAndDestroySelfTest.testLocalClose test fails periodicaly. This closes #261
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e02edcd3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e02edcd3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e02edcd3
Branch: refs/heads/ignite-sql-opt-2
Commit: e02edcd36d79f1e107c2ebe5096238f2f2a62a23
Parents: b9e4e03
Author: Andrey Gura <ag...@gridgain.com>
Authored: Wed Nov 25 18:34:42 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Nov 25 18:34:42 2015 +0300
----------------------------------------------------------------------
.../processors/cache/CacheStopAndDestroySelfTest.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e02edcd3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
index 29828af..061a374 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
@@ -30,6 +30,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.managers.communication.GridIoMessage;
+import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareRequest;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteInClosure;
@@ -67,9 +68,6 @@ public class CacheStopAndDestroySelfTest extends GridCommonAbstractTest {
/** local cache name. */
protected static String CACHE_NAME_LOC = "cache_local";
- /** */
- private static volatile boolean stop;
-
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
super.beforeTest();
@@ -674,6 +672,10 @@ public class CacheStopAndDestroySelfTest extends GridCommonAbstractTest {
// Local creation after closed.
+ AffinityTopologyVersion topVer = grid(1).context().cache().context().exchange().lastTopologyFuture().get();
+
+ grid(0).context().cache().context().exchange().affinityReadyFuture(topVer).get();
+
grid(0).getOrCreateCache(getLocalConfig());
grid(0).cache(CACHE_NAME_LOC).put(KEY_VAL, KEY_VAL + "recreated0");
[3/8] ignite git commit: Merge branch 'ignite-1.5' of
https://git-wip-us.apache.org/repos/asf/ignite into ignite-1.5
Posted by se...@apache.org.
Merge branch 'ignite-1.5' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-1.5
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b9e4e036
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b9e4e036
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b9e4e036
Branch: refs/heads/ignite-sql-opt-2
Commit: b9e4e0367dd38c5d4053e15e1d7307621f52bcfc
Parents: 8a9cc54 f9690df
Author: Denis Magda <dm...@gridgain.com>
Authored: Wed Nov 25 18:23:54 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Nov 25 18:23:54 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
.../org/apache/ignite/internal/IgnitionEx.java | 9 +++--
.../internal/portable/BinaryReaderExImpl.java | 18 +++++++--
.../processors/cache/CacheLockImpl.java | 18 ++++++++-
.../colocated/GridDhtColocatedLockFuture.java | 8 ++--
.../platform/PlatformContextImpl.java | 2 +-
.../cache/GridCacheAbstractFullApiSelfTest.java | 42 +++++++++++++++++++-
.../Services/ServicesExample.cs | 4 ++
modules/scalar/pom.xml | 4 +-
modules/spark/pom.xml | 4 +-
modules/visor-console/pom.xml | 2 +-
parent/pom.xml | 2 +-
12 files changed, 93 insertions(+), 22 deletions(-)
----------------------------------------------------------------------