You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/01/17 10:44:11 UTC
[01/50] [abbrv] ignite git commit: Fixed Visor queries for
BinaryObjects.
Repository: ignite
Updated Branches:
refs/heads/ignite-3477 e7e0d876b -> ca373d786
Fixed Visor queries for BinaryObjects.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5769f443
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5769f443
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5769f443
Branch: refs/heads/ignite-3477
Commit: 5769f44367cae5908cd291f226e9fccd68fe1c39
Parents: 9273e51
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Tue Dec 27 15:14:13 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Dec 27 15:14:13 2016 +0700
----------------------------------------------------------------------
.../query/VisorQueryScanSubstringFilter.java | 5 +-
.../internal/visor/query/VisorQueryUtils.java | 60 ++++++++++++++++++++
2 files changed, 63 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5769f443/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryScanSubstringFilter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryScanSubstringFilter.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryScanSubstringFilter.java
index 43eb6dd..171698b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryScanSubstringFilter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryScanSubstringFilter.java
@@ -17,6 +17,7 @@
package org.apache.ignite.internal.visor.query;
+import org.apache.ignite.binary.BinaryObject;
import org.apache.ignite.lang.IgniteBiPredicate;
/**
@@ -52,8 +53,8 @@ public class VisorQueryScanSubstringFilter implements IgniteBiPredicate<Object,
* @return {@code true} when string presentation of key or value contain specified string.
*/
@Override public boolean apply(Object key, Object val) {
- String k = key.toString();
- String v = val.toString();
+ String k = key instanceof BinaryObject ? VisorQueryUtils.binaryToString((BinaryObject)key) : key.toString();
+ String v = val instanceof BinaryObject ? VisorQueryUtils.binaryToString((BinaryObject)val) : val.toString();
if (caseSensitive)
return k.contains(ptrn) || v.contains(ptrn);
http://git-wip-us.apache.org/repos/asf/ignite/blob/5769f443/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryUtils.java
index 0b8cf83..5faeac0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryUtils.java
@@ -25,7 +25,13 @@ import java.util.Collection;
import java.util.Date;
import java.util.List;
import javax.cache.Cache;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryType;
+import org.apache.ignite.internal.binary.BinaryObjectEx;
import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.SB;
/**
* Contains utility methods for Visor query tasks and jobs.
@@ -77,12 +83,19 @@ public class VisorQueryUtils {
private static String valueOf(Object o) {
if (o == null)
return "null";
+
if (o instanceof byte[])
return "size=" + ((byte[])o).length;
+
if (o instanceof Byte[])
return "size=" + ((Byte[])o).length;
+
if (o instanceof Object[])
return "size=" + ((Object[])o).length + ", values=[" + mkString((Object[])o, 120) + "]";
+
+ if (o instanceof BinaryObject)
+ return binaryToString((BinaryObject)o);
+
return o.toString();
}
@@ -168,6 +181,51 @@ public class VisorQueryUtils {
}
/**
+ * Convert Binary object to string.
+ *
+ * @param obj Binary object.
+ * @return String representation of Binary object.
+ */
+ public static String binaryToString(BinaryObject obj) {
+ int hash = obj.hashCode();
+
+ if (obj instanceof BinaryObjectEx) {
+ BinaryObjectEx objEx = (BinaryObjectEx)obj;
+
+ BinaryType meta;
+
+ try {
+ meta = ((BinaryObjectEx)obj).rawType();
+ }
+ catch (BinaryObjectException ignore) {
+ meta = null;
+ }
+
+ if (meta != null) {
+ SB buf = new SB(meta.typeName());
+
+ if (meta.fieldNames() != null) {
+ buf.a(" [hash=").a(hash);
+
+ for (String name : meta.fieldNames()) {
+ Object val = objEx.field(name);
+
+ buf.a(", ").a(name).a('=').a(val);
+ }
+
+ buf.a(']');
+
+ return buf.toString();
+ }
+ }
+ }
+
+ return S.toString(obj.getClass().getSimpleName(),
+ "hash", hash, false,
+ "typeId", obj.type().typeId(), true);
+ }
+
+ /**
* Collects rows from sql query future, first time creates meta and column names arrays.
*
* @param cur Query cursor to fetch rows from.
@@ -193,6 +251,8 @@ public class VisorQueryUtils {
row[i] = null;
else if (isKnownType(o))
row[i] = o;
+ else if (o instanceof BinaryObject)
+ row[i] = binaryToString((BinaryObject)o);
else
row[i] = o.getClass().isArray() ? "binary" : o.toString();
}
[16/50] [abbrv] ignite git commit: IGNITE-4458: Hadoop: "striped"
shuffle mode is default from now on. This closes #1390.
Posted by ag...@apache.org.
IGNITE-4458: Hadoop: "striped" shuffle mode is default from now on. This closes #1390.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1f743465
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1f743465
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1f743465
Branch: refs/heads/ignite-3477
Commit: 1f743465d6875ef48b1835d03a78a0dbaf339bf6
Parents: a9b1fc2
Author: tledkov-gridgain <tl...@gridgain.com>
Authored: Thu Dec 29 11:14:10 2016 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Dec 29 11:14:10 2016 +0300
----------------------------------------------------------------------
.../ignite/internal/processors/hadoop/HadoopJobProperty.java | 2 +-
.../internal/processors/hadoop/shuffle/HadoopShuffleJob.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1f743465/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobProperty.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobProperty.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobProperty.java
index 4398acd..a3115bf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobProperty.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobProperty.java
@@ -105,7 +105,7 @@ public enum HadoopJobProperty {
/**
* Whether to stripe mapper output for remote reducers.
* <p>
- * Defaults to {@code false}.
+ * Defaults to {@code true}.
*/
SHUFFLE_MAPPER_STRIPED_OUTPUT("ignite.shuffle.mapper.striped.output"),
http://git-wip-us.apache.org/repos/asf/ignite/blob/1f743465/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java
index 1c546a1..7713d6d 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java
@@ -169,7 +169,7 @@ public class HadoopShuffleJob<T> implements AutoCloseable {
this.embedded = embedded;
// No stripes for combiner.
- boolean stripeMappers0 = get(job.info(), SHUFFLE_MAPPER_STRIPED_OUTPUT, false);
+ boolean stripeMappers0 = get(job.info(), SHUFFLE_MAPPER_STRIPED_OUTPUT, true);
if (stripeMappers0) {
if (job.info().hasCombiner()) {
[40/50] [abbrv] ignite git commit: Added more metrics to Flume
IgniteSink.
Posted by ag...@apache.org.
Added more metrics to Flume IgniteSink.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6045a246
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6045a246
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6045a246
Branch: refs/heads/ignite-3477
Commit: 6045a2469a4d2e23cad918b44e002c7de237abcb
Parents: e304b48
Author: shroman <rs...@yahoo.com>
Authored: Sat Jan 14 21:14:34 2017 +0900
Committer: shroman <rs...@yahoo.com>
Committed: Sat Jan 14 21:14:34 2017 +0900
----------------------------------------------------------------------
.../main/java/org/apache/ignite/stream/flume/IgniteSink.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6045a246/modules/flume/src/main/java/org/apache/ignite/stream/flume/IgniteSink.java
----------------------------------------------------------------------
diff --git a/modules/flume/src/main/java/org/apache/ignite/stream/flume/IgniteSink.java b/modules/flume/src/main/java/org/apache/ignite/stream/flume/IgniteSink.java
index e6e7e90..083e833 100644
--- a/modules/flume/src/main/java/org/apache/ignite/stream/flume/IgniteSink.java
+++ b/modules/flume/src/main/java/org/apache/ignite/stream/flume/IgniteSink.java
@@ -85,7 +85,7 @@ public class IgniteSink extends AbstractSink implements Configurable {
}
/**
- * Starts a grid and initializes na event transformer.
+ * Starts a grid and initializes an event transformer.
*/
@SuppressWarnings("unchecked")
@Override synchronized public void start() {
@@ -109,9 +109,13 @@ public class IgniteSink extends AbstractSink implements Configurable {
catch (Exception e) {
log.error("Failed to start grid", e);
+ sinkCounter.incrementConnectionFailedCount();
+
throw new FlumeException("Failed to start grid", e);
}
+ sinkCounter.incrementConnectionCreatedCount();
+
super.start();
}
@@ -122,6 +126,7 @@ public class IgniteSink extends AbstractSink implements Configurable {
if (ignite != null)
ignite.close();
+ sinkCounter.incrementConnectionClosedCount();
sinkCounter.stop();
super.stop();
[33/50] [abbrv] ignite git commit: .NET: Fix flaky tests - improve
assertions
Posted by ag...@apache.org.
.NET: Fix flaky tests - improve assertions
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c4d67d2a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c4d67d2a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c4d67d2a
Branch: refs/heads/ignite-3477
Commit: c4d67d2ab737c398c9158dfeb67dc979f5c052af
Parents: 87fbb27
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Jan 10 16:07:36 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Jan 10 16:07:36 2017 +0300
----------------------------------------------------------------------
.../dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs | 2 ++
.../platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs | 6 +++++-
2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c4d67d2a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
index 250f974..1239794 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
@@ -309,6 +309,8 @@ namespace Apache.Ignite.Core.Tests.Cache
Ignition.Start(cfg);
}
+
+ Assert.AreEqual(GridCount(), GetIgnite(0).GetCluster().GetNodes().Count);
}
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/c4d67d2a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs
index 82c6742..8b57c81 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MessagingTest.cs
@@ -56,6 +56,8 @@ namespace Apache.Ignite.Core.Tests
_grid1 = Ignition.Start(Configuration("config\\compute\\compute-grid1.xml"));
_grid2 = Ignition.Start(Configuration("config\\compute\\compute-grid2.xml"));
_grid3 = Ignition.Start(Configuration("config\\compute\\compute-grid3.xml"));
+
+ Assert.AreEqual(3, _grid1.GetCluster().GetNodes().Count);
}
/// <summary>
@@ -556,7 +558,9 @@ namespace Apache.Ignite.Core.Tests
Func<IEnumerable<string>, IEnumerable<string>> resultFunc, int expectedRepeat)
{
// check if expected message count has been received; Wait returns false if there were none.
- Assert.IsTrue(ReceivedEvent.Wait(MessageTimeout));
+ Assert.IsTrue(ReceivedEvent.Wait(MessageTimeout),
+ string.Format("expectedMessages: {0}, expectedRepeat: {1}, remaining: {2}",
+ expectedMessages, expectedRepeat, ReceivedEvent.CurrentCount));
expectedMessages = expectedMessages.SelectMany(x => Enumerable.Repeat(x, expectedRepeat));
[20/50] [abbrv] ignite git commit: Fixed JavaDoc for
RoundRobinLoadBalancingSpi
Posted by ag...@apache.org.
Fixed JavaDoc for RoundRobinLoadBalancingSpi
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/228d97ba
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/228d97ba
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/228d97ba
Branch: refs/heads/ignite-3477
Commit: 228d97bab116a513ed03f4f7f48ddeb1ef5b6577
Parents: f4a1e6c
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Thu Dec 29 12:21:34 2016 -0800
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Thu Dec 29 12:21:34 2016 -0800
----------------------------------------------------------------------
.../roundrobin/RoundRobinLoadBalancingSpi.java | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/228d97ba/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpi.java
index 069641b..b0e2c78 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpi.java
@@ -51,15 +51,13 @@ import static org.apache.ignite.events.EventType.EVT_TASK_FINISHED;
/**
* This SPI iterates through nodes in round-robin fashion and pick the next
* sequential node. Two modes of operation are supported: per-task and global
- * (see {@link #setPerTask(boolean)} configuration).
+ * (see {@link #setPerTask(boolean)} configuration). Global mode is used be default.
* <p>
- * When configured in per-task mode, implementation will pick a random starting
- * node at the beginning of every task execution and then sequentially iterate through all
- * nodes in topology starting from the picked node. This is the default configuration
- * and should fit most of the use cases as it provides a fairly well-distributed
- * split and also ensures that jobs within a single task are spread out across
- * nodes to the maximum. For cases when split size is equal to the number of nodes,
- * this mode guarantees that all nodes will participate in the split.
+ * When configured in per-task mode, implementation will pick a random node at the
+ * beginning of every task execution and then sequentially iterate through all
+ * nodes in topology starting from the picked node. For cases when split size
+ * is equal to the number of nodes, this mode guarantees that all nodes will
+ * participate in the split.
* <p>
* When configured in global mode, a single sequential queue of nodes is maintained for
* all tasks and the next node in the queue is picked every time. In this mode (unlike in
@@ -336,4 +334,4 @@ public class RoundRobinLoadBalancingSpi extends IgniteSpiAdapter implements Load
@Override public String toString() {
return S.toString(RoundRobinLoadBalancingSpi.class, this);
}
-}
\ No newline at end of file
+}
[04/50] [abbrv] ignite git commit: 1.8.0-SNAPSHOT
Posted by ag...@apache.org.
1.8.0-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5494dfb8
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5494dfb8
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5494dfb8
Branch: refs/heads/ignite-3477
Commit: 5494dfb8dd222bf7aee8214b6bb201d3ae8a1ec5
Parents: 5769f44
Author: Ignite Teamcity <ig...@apache.org>
Authored: Tue Dec 27 14:50:58 2016 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Tue Dec 27 14:50:58 2016 +0300
----------------------------------------------------------------------
modules/platforms/cpp/configure.ac | 2 +-
modules/platforms/cpp/configure.acrel | 2 +-
modules/platforms/cpp/examples/configure.ac | 2 +-
modules/platforms/cpp/odbc/install/ignite-odbc-amd64.wxs | 2 +-
modules/platforms/cpp/odbc/install/ignite-odbc-x86.wxs | 2 +-
.../dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs | 4 ++--
.../Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs | 4 ++--
.../Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.Log4Net/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.NLog/Properties/AssemblyInfo.cs | 4 ++--
.../platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs | 4 ++--
.../examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs | 4 ++--
.../Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs | 4 ++--
18 files changed, 31 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/cpp/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/configure.ac b/modules/platforms/cpp/configure.ac
index 9dc9f52..500bdbf 100644
--- a/modules/platforms/cpp/configure.ac
+++ b/modules/platforms/cpp/configure.ac
@@ -19,7 +19,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++], [1.8.0.14218], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++], [1.8.0.16695], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
AC_CANONICAL_HOST
AC_CONFIG_MACRO_DIR([m4])
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/cpp/configure.acrel
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/configure.acrel b/modules/platforms/cpp/configure.acrel
index 036f124..984aa38 100644
--- a/modules/platforms/cpp/configure.acrel
+++ b/modules/platforms/cpp/configure.acrel
@@ -19,7 +19,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++], [1.6.0.8653], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++], [1.8.0.16695], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
AC_CANONICAL_HOST
AC_CONFIG_MACRO_DIR([m4])
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/cpp/examples/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/configure.ac b/modules/platforms/cpp/examples/configure.ac
index 82a3727..6f08490 100644
--- a/modules/platforms/cpp/examples/configure.ac
+++ b/modules/platforms/cpp/examples/configure.ac
@@ -19,7 +19,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++ Examples], [1.8.0.14218], [dev@ignite.apache.org], [ignite-examples], [ignite.apache.org])
+AC_INIT([Apache Ignite C++ Examples], [1.8.0.16695], [dev@ignite.apache.org], [ignite-examples], [ignite.apache.org])
AC_CANONICAL_HOST
AC_CONFIG_MACRO_DIR([m4])
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/cpp/odbc/install/ignite-odbc-amd64.wxs
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/install/ignite-odbc-amd64.wxs b/modules/platforms/cpp/odbc/install/ignite-odbc-amd64.wxs
index cb6ab54..2c12d9a 100644
--- a/modules/platforms/cpp/odbc/install/ignite-odbc-amd64.wxs
+++ b/modules/platforms/cpp/odbc/install/ignite-odbc-amd64.wxs
@@ -21,7 +21,7 @@
<Product Name='Apache Ignite ODBC 64-bit Driver' Manufacturer='The Apache Software Foundation'
Id='F3E308E4-910C-4AF5-82DE-2ACF4D64830E'
UpgradeCode='1D7AEFDF-6CD2-4FB5-88F2-811A89832D6D'
- Language='1033' Codepage='1252' Version='1.6.7.0'>
+ Language='1033' Codepage='1252' Version='1.8.0.16695'>
<Package Id='*' Keywords='Installer' Description="Apache Ignite ODBC 64-bit Driver Installer"
Comments='Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are trademarks of The Apache Software Foundation.'
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/cpp/odbc/install/ignite-odbc-x86.wxs
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/install/ignite-odbc-x86.wxs b/modules/platforms/cpp/odbc/install/ignite-odbc-x86.wxs
index 6ee1cdf..9e77e2a 100644
--- a/modules/platforms/cpp/odbc/install/ignite-odbc-x86.wxs
+++ b/modules/platforms/cpp/odbc/install/ignite-odbc-x86.wxs
@@ -21,7 +21,7 @@
<Product Name='Apache Ignite ODBC 32-bit Driver' Manufacturer='The Apache Software Foundation'
Id='D39CBABA-1E21-4701-AA5C-91EDA07B383B'
UpgradeCode='743902A4-365C-424E-B226-5B2898A3941E'
- Language='1033' Codepage='1252' Version='1.6.7.0'>
+ Language='1033' Codepage='1252' Version='1.8.0.16695'>
<Package Id='*' Keywords='Installer' Description="Apache Ignite ODBC 32-bit Driver Installer"
Comments='Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are trademarks of The Apache Software Foundation.'
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
index afaa6f0..d6cb3df 100644
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
@@ -35,8 +35,8 @@ using System.Runtime.InteropServices;
[assembly: Guid("18ea4c71-a11d-4ab1-8042-418f7559d84f")]
-[assembly: AssemblyVersion("1.8.0.14218")]
-[assembly: AssemblyFileVersion("1.8.0.14218")]
+[assembly: AssemblyVersion("1.8.0.16695")]
+[assembly: AssemblyFileVersion("1.8.0.16695")]
[assembly: AssemblyInformationalVersion("1.8.0")]
[assembly: CLSCompliant(true)]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
index 2a7da67..9bd5c47 100644
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
@@ -33,8 +33,8 @@ using System.Runtime.InteropServices;
[assembly: Guid("13ea96fc-cc83-4164-a7c0-4f30ed797460")]
-[assembly: AssemblyVersion("1.8.0.14218")]
-[assembly: AssemblyFileVersion("1.8.0.14218")]
+[assembly: AssemblyVersion("1.8.0.16695")]
+[assembly: AssemblyFileVersion("1.8.0.16695")]
[assembly: AssemblyInformationalVersion("1.8.0")]
[assembly: CLSCompliant(true)]
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
index 85af146..91f79bd 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
[assembly: Guid("8fae8395-7e91-411a-a78f-44d6d3fed0fc")]
-[assembly: AssemblyVersion("1.8.0.14218")]
-[assembly: AssemblyFileVersion("1.8.0.14218")]
+[assembly: AssemblyVersion("1.8.0.16695")]
+[assembly: AssemblyFileVersion("1.8.0.16695")]
[assembly: AssemblyInformationalVersion("1.8.0")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs
index 34fca37..ad0e915 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs
@@ -30,6 +30,6 @@ using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
[assembly: Guid("134707f6-155d-47f6-9eb2-c67abbf3c009")]
-[assembly: AssemblyVersion("1.8.0.14218")]
-[assembly: AssemblyFileVersion("1.8.0.14218")]
+[assembly: AssemblyVersion("1.8.0.16695")]
+[assembly: AssemblyFileVersion("1.8.0.16695")]
[assembly: AssemblyInformationalVersion("1.8.0")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
index 4aa03f1..a8c4305 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
@@ -45,6 +45,6 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.8.0.14218")]
-[assembly: AssemblyFileVersion("1.8.0.14218")]
+[assembly: AssemblyVersion("1.8.0.16695")]
+[assembly: AssemblyFileVersion("1.8.0.16695")]
[assembly: AssemblyInformationalVersion("1.8.0")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
index 9eb2e24..7bf322f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
[assembly: Guid("de8dd5cc-7c7f-4a09-80d5-7086d9416a7b")]
-[assembly: AssemblyVersion("1.8.0.14218")]
-[assembly: AssemblyFileVersion("1.8.0.14218")]
+[assembly: AssemblyVersion("1.8.0.16695")]
+[assembly: AssemblyFileVersion("1.8.0.16695")]
[assembly: AssemblyInformationalVersion("1.8.0")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
index 9fcbeb0..240f273 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
@@ -33,8 +33,8 @@ using System.Runtime.InteropServices;
[assembly: Guid("97db45a8-f922-456a-a819-7b3c6e5e03ba")]
-[assembly: AssemblyVersion("1.8.0.14218")]
-[assembly: AssemblyFileVersion("1.8.0.14218")]
+[assembly: AssemblyVersion("1.8.0.16695")]
+[assembly: AssemblyFileVersion("1.8.0.16695")]
[assembly: AssemblyInformationalVersion("1.8.0")]
[assembly: CLSCompliant(true)]
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs
index d47bef9..76596da 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs
@@ -33,8 +33,8 @@ using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5b571661-17f4-4f29-8c7d-0edb38ca9b55")]
-[assembly: AssemblyVersion("1.8.0.14218")]
-[assembly: AssemblyFileVersion("1.8.0.14218")]
+[assembly: AssemblyVersion("1.8.0.16695")]
+[assembly: AssemblyFileVersion("1.8.0.16695")]
[assembly: AssemblyInformationalVersion("1.8.0")]
[assembly: CLSCompliant(true)]
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/dotnet/Apache.Ignite.Log4Net/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Log4Net/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Log4Net/Properties/AssemblyInfo.cs
index bb8e830..824252e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Log4Net/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Log4Net/Properties/AssemblyInfo.cs
@@ -33,8 +33,8 @@ using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6f82d669-382e-4435-8092-68c4440146d8")]
-[assembly: AssemblyVersion("1.8.0.14218")]
-[assembly: AssemblyFileVersion("1.8.0.14218")]
+[assembly: AssemblyVersion("1.8.0.16695")]
+[assembly: AssemblyFileVersion("1.8.0.16695")]
[assembly: AssemblyInformationalVersion("1.8.0")]
[assembly: CLSCompliant(true)]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/dotnet/Apache.Ignite.NLog/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.NLog/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.NLog/Properties/AssemblyInfo.cs
index 50220d2..f28278c 100644
--- a/modules/platforms/dotnet/Apache.Ignite.NLog/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.NLog/Properties/AssemblyInfo.cs
@@ -33,8 +33,8 @@ using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c6b58e4a-a2e9-4554-ad02-68ce6da5cfb7")]
-[assembly: AssemblyVersion("1.8.0.14218")]
-[assembly: AssemblyFileVersion("1.8.0.14218")]
+[assembly: AssemblyVersion("1.8.0.16695")]
+[assembly: AssemblyFileVersion("1.8.0.16695")]
[assembly: AssemblyInformationalVersion("1.8.0")]
[assembly: CLSCompliant(true)]
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
index 82e27b1..8503026 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
[assembly: Guid("0f9702ec-da7d-4ce5-b4b7-73310c885355")]
-[assembly: AssemblyVersion("1.8.0.14218")]
-[assembly: AssemblyFileVersion("1.8.0.14218")]
+[assembly: AssemblyVersion("1.8.0.16695")]
+[assembly: AssemblyFileVersion("1.8.0.16695")]
[assembly: AssemblyInformationalVersion("1.8.0")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
index 4f55039..5834c57 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@
[assembly: Guid("41a0cb95-3435-4c78-b867-900b28e2c9ee")]
-[assembly: AssemblyVersion("1.8.0.14218")]
-[assembly: AssemblyFileVersion("1.8.0.14218")]
+[assembly: AssemblyVersion("1.8.0.16695")]
+[assembly: AssemblyFileVersion("1.8.0.16695")]
[assembly: AssemblyInformationalVersion("1.8.0")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/5494dfb8/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
index 471e7e9..230e9d8 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Reflection;
[assembly: Guid("ce65ec7c-d3cf-41ad-8f45-f90d5af68d77")]
-[assembly: AssemblyVersion("1.8.0.14218")]
-[assembly: AssemblyFileVersion("1.8.0.14218")]
+[assembly: AssemblyVersion("1.8.0.16695")]
+[assembly: AssemblyFileVersion("1.8.0.16695")]
[assembly: AssemblyInformationalVersion("1.8.0")]
[25/50] [abbrv] ignite git commit: Merge branch 'ignite-1.7.5'
Posted by ag...@apache.org.
Merge branch 'ignite-1.7.5'
# Conflicts:
# modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
# modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
# modules/core/src/main/resources/META-INF/classnames.properties
# modules/platforms/cpp/configure.ac
# modules/platforms/cpp/configure.acrel
# modules/platforms/cpp/examples/configure.ac
# modules/platforms/cpp/odbc/install/ignite-odbc-amd64.wxs
# modules/platforms/cpp/odbc/install/ignite-odbc-x86.wxs
# modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
# modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/Apache.Ignite.Log4Net/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/Apache.Ignite.NLog/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
# modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/beb242bc
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/beb242bc
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/beb242bc
Branch: refs/heads/ignite-3477
Commit: beb242bc22aa7ca6c068fd59a09965fa5967177e
Parents: d62542b 6c38eb2
Author: devozerov <vo...@gridgain.com>
Authored: Thu Jan 5 11:44:55 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Jan 5 11:44:55 2017 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/IgniteLogger.java | 4 +-
.../apache/ignite/IgniteSystemProperties.java | 13 +
.../ignite/cache/affinity/AffinityKey.java | 4 +-
.../org/apache/ignite/events/CacheEvent.java | 6 +-
.../ignite/events/CacheQueryReadEvent.java | 8 +-
.../ignite/internal/binary/BinaryContext.java | 4 +-
.../internal/binary/BinaryEnumObjectImpl.java | 10 +-
.../ignite/internal/binary/BinaryMetadata.java | 5 +-
.../internal/binary/BinaryObjectExImpl.java | 8 +-
.../ignite/internal/binary/BinaryTypeProxy.java | 15 +-
.../ignite/internal/binary/BinaryUtils.java | 4 +-
.../cache/CacheInvokeDirectResult.java | 2 +-
.../processors/cache/CacheInvokeResult.java | 2 +-
.../processors/cache/CacheLazyEntry.java | 4 +-
.../processors/cache/CacheObjectAdapter.java | 7 +-
.../processors/cache/GridCacheAdapter.java | 5 +-
.../cache/GridCacheMvccCandidate.java | 9 +-
.../processors/cache/GridCacheReturn.java | 2 +-
.../processors/cache/IgniteCacheProxy.java | 2 +-
.../distributed/dht/GridDhtCacheAdapter.java | 2 +-
.../distributed/near/GridNearLockFuture.java | 2 +-
.../cache/query/GridCacheQueryAdapter.java | 4 +-
.../cache/query/GridCacheQueryManager.java | 13 +-
.../cache/query/GridCacheQueryRequest.java | 2 +
.../cache/query/GridCacheSqlQuery.java | 4 +-
.../continuous/CacheContinuousQueryEvent.java | 8 +-
.../continuous/CacheContinuousQueryManager.java | 4 +-
.../store/GridCacheStoreManagerAdapter.java | 30 +-
.../cache/store/GridCacheWriteBehindStore.java | 2 +-
.../transactions/IgniteTxLocalAdapter.java | 11 +-
.../GridCacheVersionConflictContext.java | 2 +-
.../closure/GridClosureProcessor.java | 4 +-
.../continuous/GridContinuousMessage.java | 2 +-
.../datastructures/CollocatedSetItemKey.java | 2 +-
.../GridCacheAtomicLongValue.java | 2 +
.../GridCacheAtomicSequenceImpl.java | 2 +
.../GridCacheAtomicSequenceValue.java | 2 +
.../GridCacheCountDownLatchValue.java | 3 +
.../datastructures/GridCacheSetItemKey.java | 2 +-
.../internal/processors/job/GridJobWorker.java | 7 +-
.../odbc/OdbcQueryExecuteRequest.java | 6 +-
.../platform/PlatformNativeException.java | 3 +-
.../processors/query/GridQueryProcessor.java | 35 +-
.../processors/rest/GridRestResponse.java | 2 +-
.../internal/util/future/GridFutureAdapter.java | 2 +-
.../util/lang/GridMetadataAwareAdapter.java | 2 +-
.../util/tostring/GridToStringBuilder.java | 656 +++++++++++++++++--
.../util/tostring/GridToStringInclude.java | 12 +-
.../util/tostring/GridToStringThreadLocal.java | 12 +-
.../query/VisorQueryScanSubstringFilter.java | 5 +-
.../internal/visor/query/VisorQueryUtils.java | 60 ++
.../apache/ignite/spi/indexing/IndexingSpi.java | 3 +
.../resources/META-INF/classnames.properties | 1 +
.../internal/binary/BinaryEnumsSelfTest.java | 18 +
.../GridCacheBinaryObjectsAbstractSelfTest.java | 7 +-
.../cache/query/IndexingSpiQuerySelfTest.java | 199 +++++-
.../tostring/GridToStringBuilderSelfTest.java | 33 +-
.../hadoop/impl/igfs/HadoopIgfsJclLogger.java | 9 +-
.../org/apache/ignite/logger/jcl/JclLogger.java | 9 +-
.../Properties/AssemblyInfo.cs | 2 +-
.../Properties/AssemblyInfo.cs | 2 +-
.../Query/CacheQueriesCodeConfigurationTest.cs | 4 +-
.../Properties/AssemblyInfo.cs | 2 +-
.../apache/ignite/logger/slf4j/Slf4jLogger.java | 11 +-
64 files changed, 1145 insertions(+), 174 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
index 4d85c54,0da0f49..083bb72
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@@ -500,17 -502,17 +505,25 @@@ public final class IgniteSystemProperti
* <p>
* Defaults to {@code} false, meaning that unaligned access will be performed only on x86 architecture.
*/
- public static final String IGNITE_UNALIGNED_MEMORY_ACCESS = "IGNITE_UNALIGNED_MEMORY_ACCESS";
+ public static final String IGNITE_MEMORY_UNALIGNED_ACCESS = "IGNITE_MEMORY_UNALIGNED_ACCESS";
+
+ /**
+ * When unsafe memory copy if performed below this threshold, Ignite will do it on per-byte basis instead of
+ * calling to Unsafe.copyMemory().
+ * <p>
+ * Defaults to 0, meaning that threshold is disabled.
+ */
+ public static final String IGNITE_MEMORY_PER_BYTE_COPY_THRESHOLD = "IGNITE_MEMORY_PER_BYTE_COPY_THRESHOLD";
/**
+ * When set to {@code true} BinaryObject will be unwrapped before passing to IndexingSpi to preserve
+ * old behavior query processor with IndexingSpi.
+ * <p>
+ * @deprecated Should be removed in Apache Ignite 2.0.
+ */
+ public static final String IGNITE_UNWRAP_BINARY_FOR_INDEXING_SPI = "IGNITE_UNWRAP_BINARY_FOR_INDEXING_SPI";
+
+ /**
* Enforces singleton.
*/
private IgniteSystemProperties() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
index b80f573,5f1e3e9..5b5aeba
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
@@@ -27,9 -26,10 +27,10 @@@ import org.apache.ignite.binary.BinaryA
import org.apache.ignite.binary.BinaryObject;
import org.apache.ignite.binary.BinaryObjectBuilder;
import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryIdentityResolver;
import org.apache.ignite.binary.BinaryType;
import org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl;
-import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory;
+ import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.SB;
import org.apache.ignite.lang.IgniteUuid;
import org.jetbrains.annotations.Nullable;
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheWriteBehindStore.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 1594cee,6c093ee..58f94f4
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@@ -44,9 -44,9 +44,10 @@@ import javax.cache.Cache
import javax.cache.CacheException;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
+ import org.apache.ignite.IgniteSystemProperties;
import org.apache.ignite.binary.BinaryField;
import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.binary.BinaryObjectBuilder;
import org.apache.ignite.binary.BinaryType;
import org.apache.ignite.binary.Binarylizable;
import org.apache.ignite.cache.CacheTypeMetadata;
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --cc modules/core/src/main/resources/META-INF/classnames.properties
index 4d0b931,8a6dc66..212e94a
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@@ -724,11 -719,9 +724,12 @@@ org.apache.ignite.internal.processors.c
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtForceKeysResponse
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemandMessage
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$1
+org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$1$1
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$2
+org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$3
+ org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$3$1
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$4$1
+org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$5$1
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$DemandWorker$1
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander$DemandWorker$2
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java
index 2a177ff,bf72782..c9f50d1
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java
@@@ -65,10 -58,9 +65,11 @@@ import org.apache.ignite.binary.BinaryF
import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.IgniteCacheProxy;
+import org.apache.ignite.internal.processors.cache.MapCacheStoreStrategy;
+import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.P2;
import org.apache.ignite.internal.util.typedef.internal.CU;
+ import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteBiInClosure;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
index 1bca0e8,d6cb3df..f5fa618
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--\ufeff/*
++\ufeff\ufeff/*
* 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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
index 0926a46,9bd5c47..d72c9db
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--\ufeff/*
++\ufeff\ufeff/*
* 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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/beb242bc/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
index 1fc6c59,7bf322f..cc833ea
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
@@@ -1,19 -1,19 +1,19 @@@
- \ufeff/*
-\ufeff\ufeff\ufeff\ufeff/*
- * 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.
- */
++\ufeff\ufeff/*
+* 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.
+*/
using System.Reflection;
using System.Runtime.InteropServices;
[14/50] [abbrv] ignite git commit: IGNITE-4462: IGFS: removed grid
name from HadoopIgfsEndpoint. This closes #1368.
Posted by ag...@apache.org.
IGNITE-4462: IGFS: removed grid name from HadoopIgfsEndpoint. This closes #1368.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2e691d80
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2e691d80
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2e691d80
Branch: refs/heads/ignite-3477
Commit: 2e691d80ea4870c3e7b5b127792b66c920f72c39
Parents: 2df39a8
Author: tledkov-gridgain <tl...@gridgain.com>
Authored: Thu Dec 29 11:00:01 2016 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Dec 29 11:00:01 2016 +0300
----------------------------------------------------------------------
.../igfs/common/IgfsHandshakeRequest.java | 17 ---------
.../internal/igfs/common/IgfsMarshaller.java | 2 --
.../processors/igfs/IgfsIpcHandler.java | 4 ---
.../mapreduce/IgniteHadoopMapReducePlanner.java | 6 ++--
.../IgniteHadoopWeightedMapReducePlanner.java | 5 +--
.../hadoop/igfs/HadoopIgfsEndpoint.java | 38 +++++++++-----------
.../hadoop/impl/igfs/HadoopIgfsOutProc.java | 24 ++++++-------
.../hadoop/impl/igfs/HadoopIgfsWrapper.java | 33 +++++++++--------
.../impl/HadoopAbstractMapReduceTest.java | 2 +-
.../hadoop/impl/HadoopAbstractSelfTest.java | 3 +-
.../impl/HadoopTaskExecutionSelfTest.java | 19 +++++-----
.../client/HadoopClientProtocolSelfTest.java | 2 +-
.../impl/igfs/Hadoop1DualAbstractTest.java | 7 ++--
.../igfs/HadoopFIleSystemFactorySelfTest.java | 6 ++--
...Igfs20FileSystemLoopbackPrimarySelfTest.java | 2 +-
...oopIgfs20FileSystemShmemPrimarySelfTest.java | 2 +-
.../igfs/HadoopIgfsDualAbstractSelfTest.java | 6 ++--
...oopSecondaryFileSystemConfigurationTest.java | 4 +--
.../hadoop/impl/igfs/IgfsEventsTestSuite.java | 4 +--
.../IgniteHadoopFileSystemAbstractSelfTest.java | 4 +--
.../IgniteHadoopFileSystemClientSelfTest.java | 2 +-
...IgniteHadoopFileSystemHandshakeSelfTest.java | 32 ++++++++---------
...niteHadoopFileSystemLoggerStateSelfTest.java | 6 ++--
...condaryFileSystemInitializationSelfTest.java | 4 +--
24 files changed, 104 insertions(+), 130 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsHandshakeRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsHandshakeRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsHandshakeRequest.java
index 21da5b1..1335ca8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsHandshakeRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsHandshakeRequest.java
@@ -25,9 +25,6 @@ import static org.apache.ignite.internal.igfs.common.IgfsIpcCommand.HANDSHAKE;
* Handshake request.
*/
public class IgfsHandshakeRequest extends IgfsMessage {
- /** Expected Grid name. */
- private String gridName;
-
/** Expected IGFS name. */
private String igfsName;
@@ -45,20 +42,6 @@ public class IgfsHandshakeRequest extends IgfsMessage {
}
/**
- * @return Grid name.
- */
- public String gridName() {
- return gridName;
- }
-
- /**
- * @param gridName Grid name.
- */
- public void gridName(String gridName) {
- this.gridName = gridName;
- }
-
- /**
* @return IGFS name.
*/
public String igfsName() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsMarshaller.java
index 91656fd..859069a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsMarshaller.java
@@ -97,7 +97,6 @@ public class IgfsMarshaller {
IgfsHandshakeRequest req = (IgfsHandshakeRequest)msg;
- U.writeString(out, req.gridName());
U.writeString(out, req.igfsName());
U.writeString(out, req.logDirectory());
@@ -214,7 +213,6 @@ public class IgfsMarshaller {
case HANDSHAKE: {
IgfsHandshakeRequest req = new IgfsHandshakeRequest();
- req.gridName(U.readString(in));
req.igfsName(U.readString(in));
req.logDirectory(U.readString(in));
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
index 6047604..aed0961 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsIpcHandler.java
@@ -258,10 +258,6 @@ class IgfsIpcHandler implements IgfsServerHandler {
* @throws IgniteCheckedException In case of handshake failure.
*/
private IgfsMessage processHandshakeRequest(IgfsHandshakeRequest req) throws IgniteCheckedException {
- if (req.gridName() != null && !F.eq(ctx.gridName(), req.gridName()))
- throw new IgniteCheckedException("Failed to perform handshake because existing Grid name " +
- "differs from requested [requested=" + req.gridName() + ", existing=" + ctx.gridName() + ']');
-
if (req.igfsName() != null && !F.eq(igfs.name(), req.igfsName()))
throw new IgniteCheckedException("Failed to perform handshake because existing IGFS name " +
"differs from requested [requested=" + req.igfsName() + ", existing=" + igfs.name() + ']');
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopMapReducePlanner.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopMapReducePlanner.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopMapReducePlanner.java
index e1101c5..ac42381 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopMapReducePlanner.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopMapReducePlanner.java
@@ -123,6 +123,7 @@ public class IgniteHadoopMapReducePlanner extends HadoopAbstractMapReducePlanner
* @param nodes Nodes.
* @param nodeLoads Node load tracker.
* @return Node ID.
+ * @throws IgniteCheckedException On error.
*/
@SuppressWarnings("unchecked")
private UUID nodeForSplit(HadoopInputSplit split, Collection<UUID> topIds, Map<String, Collection<UUID>> nodes,
@@ -133,10 +134,7 @@ public class IgniteHadoopMapReducePlanner extends HadoopAbstractMapReducePlanner
if (IGFS_SCHEME.equalsIgnoreCase(split0.file().getScheme())) {
HadoopIgfsEndpoint endpoint = new HadoopIgfsEndpoint(split0.file().getAuthority());
- IgfsEx igfs = null;
-
- if (F.eq(ignite.name(), endpoint.grid()))
- igfs = (IgfsEx)((IgniteEx)ignite).igfsx(endpoint.igfs());
+ IgfsEx igfs = (IgfsEx)((IgniteEx)ignite).igfsx(endpoint.igfs());
if (igfs != null && !igfs.isProxy(split0.file())) {
IgfsPath path = new IgfsPath(split0.file());
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopWeightedMapReducePlanner.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopWeightedMapReducePlanner.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopWeightedMapReducePlanner.java
index 2d1ac0b..178cdb5 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopWeightedMapReducePlanner.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopWeightedMapReducePlanner.java
@@ -212,10 +212,7 @@ public class IgniteHadoopWeightedMapReducePlanner extends HadoopAbstractMapReduc
if (IgniteFileSystem.IGFS_SCHEME.equalsIgnoreCase(split0.file().getScheme())) {
HadoopIgfsEndpoint endpoint = new HadoopIgfsEndpoint(split0.file().getAuthority());
- IgfsEx igfs = null;
-
- if (F.eq(ignite.name(), endpoint.grid()))
- igfs = (IgfsEx)((IgniteEx)ignite).igfsx(endpoint.igfs());
+ IgfsEx igfs = (IgfsEx)((IgniteEx)ignite).igfsx(endpoint.igfs());
if (igfs != null && !igfs.isProxy(split0.file())) {
IgfsPath path = new IgfsPath(split0.file());
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsEndpoint.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsEndpoint.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsEndpoint.java
index a44e1ae..3771520 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsEndpoint.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsEndpoint.java
@@ -20,6 +20,10 @@ package org.apache.ignite.internal.processors.hadoop.igfs;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteFileSystem;
import org.apache.ignite.igfs.IgfsIpcEndpointConfiguration;
@@ -32,15 +36,18 @@ import org.jetbrains.annotations.Nullable;
* IGFS endpoint abstraction.
*/
public class HadoopIgfsEndpoint {
+ /** Guard ensuring that warning about grid name is printed only once. */
+ private static final AtomicBoolean LOG_WARN_GUARD = new AtomicBoolean();
+
+ /** Logger. */
+ private static final Log LOG = LogFactory.getLog(HadoopIgfsEndpoint.class);
+
/** Localhost. */
public static final String LOCALHOST = "127.0.0.1";
/** IGFS name. */
private final String igfsName;
- /** Grid name. */
- private final String gridName;
-
/** Host. */
private final String host;
@@ -66,9 +73,6 @@ public class HadoopIgfsEndpoint {
if (endpoint.igfs() != null)
sb.append(endpoint.igfs());
- if (endpoint.grid() != null)
- sb.append(":").append(endpoint.grid());
-
return new URI(uri.getScheme(), sb.length() != 0 ? sb.toString() : null, endpoint.host(), endpoint.port(),
uri.getPath(), uri.getQuery(), uri.getFragment());
}
@@ -93,27 +97,24 @@ public class HadoopIgfsEndpoint {
if (tokens.length == 1) {
igfsName = null;
- gridName = null;
hostPort = hostPort(connStr, connStr);
}
else if (tokens.length == 2) {
String authStr = tokens[0];
- if (authStr.isEmpty()) {
- gridName = null;
+ if (authStr.isEmpty())
igfsName = null;
- }
else {
String[] authTokens = authStr.split(":", -1);
igfsName = F.isEmpty(authTokens[0]) ? null : authTokens[0];
- if (authTokens.length == 1)
- gridName = null;
- else if (authTokens.length == 2)
- gridName = F.isEmpty(authTokens[1]) ? null : authTokens[1];
- else
+ if (authTokens.length == 2) {
+ if (!LOG_WARN_GUARD.get() && LOG_WARN_GUARD.compareAndSet(false, true))
+ LOG.warn("Grid name in IGFS connection string is deprecated and will be ignored: " + connStr);
+ }
+ else if (authTokens.length > 2)
throw new IgniteCheckedException("Invalid connection string format: " + connStr);
}
@@ -176,13 +177,6 @@ public class HadoopIgfsEndpoint {
}
/**
- * @return Grid name.
- */
- @Nullable public String grid() {
- return gridName;
- }
-
- /**
* @return Host.
*/
public String host() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsOutProc.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsOutProc.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsOutProc.java
index 4dc3c7f..88f26f1 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsOutProc.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsOutProc.java
@@ -103,9 +103,6 @@ public class HadoopIgfsOutProc implements HadoopIgfsEx, HadoopIgfsIpcIoListener
private static final IgniteClosure<IgniteInternalFuture<IgfsMessage>,
Collection<IgfsBlockLocation>> BLOCK_LOCATION_COL_RES = createClosure();
- /** Grid name. */
- private final String grid;
-
/** IGFS name. */
private final String igfs;
@@ -126,26 +123,26 @@ public class HadoopIgfsOutProc implements HadoopIgfsEx, HadoopIgfsIpcIoListener
*
* @param host Host.
* @param port Port.
- * @param grid Grid name.
* @param igfs IGFS name.
* @param log Client logger.
+ * @param user User name.
* @throws IOException If failed.
*/
- public HadoopIgfsOutProc(String host, int port, String grid, String igfs, Log log, String user) throws IOException {
- this(host, port, grid, igfs, false, log, user);
+ public HadoopIgfsOutProc(String host, int port, String igfs, Log log, String user) throws IOException {
+ this(host, port, igfs, false, log, user);
}
/**
* Constructor for shmem endpoint.
*
* @param port Port.
- * @param grid Grid name.
* @param igfs IGFS name.
* @param log Client logger.
+ * @param user User name.
* @throws IOException If failed.
*/
- public HadoopIgfsOutProc(int port, String grid, String igfs, Log log, String user) throws IOException {
- this(null, port, grid, igfs, true, log, user);
+ public HadoopIgfsOutProc(int port, String igfs, Log log, String user) throws IOException {
+ this(null, port, igfs, true, log, user);
}
/**
@@ -153,20 +150,19 @@ public class HadoopIgfsOutProc implements HadoopIgfsEx, HadoopIgfsIpcIoListener
*
* @param host Host.
* @param port Port.
- * @param grid Grid name.
* @param igfs IGFS name.
* @param shmem Shared memory flag.
* @param log Client logger.
+ * @param user User name.
* @throws IOException If failed.
*/
- private HadoopIgfsOutProc(String host, int port, String grid, String igfs, boolean shmem, Log log, String user)
+ private HadoopIgfsOutProc(String host, int port, String igfs, boolean shmem, Log log, String user)
throws IOException {
assert host != null && !shmem || host == null && shmem :
"Invalid arguments [host=" + host + ", port=" + port + ", shmem=" + shmem + ']';
String endpoint = host != null ? host + ":" + port : "shmem:" + port;
- this.grid = grid;
this.igfs = igfs;
this.log = log;
this.userName = IgfsUtils.fixUserName(user);
@@ -180,7 +176,6 @@ public class HadoopIgfsOutProc implements HadoopIgfsEx, HadoopIgfsIpcIoListener
@Override public IgfsHandshakeResponse handshake(String logDir) throws IgniteCheckedException {
final IgfsHandshakeRequest req = new IgfsHandshakeRequest();
- req.gridName(grid);
req.igfsName(igfs);
req.logDirectory(logDir);
@@ -223,7 +218,8 @@ public class HadoopIgfsOutProc implements HadoopIgfsEx, HadoopIgfsIpcIoListener
}
/** {@inheritDoc} */
- @Override public Boolean setTimes(IgfsPath path, long accessTime, long modificationTime) throws IgniteCheckedException {
+ @Override public Boolean setTimes(IgfsPath path, long accessTime, long modificationTime)
+ throws IgniteCheckedException {
final IgfsPathControlRequest msg = new IgfsPathControlRequest();
msg.command(SET_TIMES);
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsWrapper.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsWrapper.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsWrapper.java
index 1fda1c3..aaf79de 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsWrapper.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsWrapper.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.hadoop.impl.igfs;
import org.apache.commons.logging.Log;
import org.apache.hadoop.conf.Configuration;
+import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteFileSystem;
import org.apache.ignite.IgniteIllegalStateException;
@@ -81,8 +82,10 @@ public class HadoopIgfsWrapper implements HadoopIgfs {
*
* @param authority Authority (connection string).
* @param logDir Log directory for server.
+ * @param user User name.
* @param conf Configuration.
* @param log Current logger.
+ * @throws IOException On error.
*/
public HadoopIgfsWrapper(String authority, String logDir, Configuration conf, Log log, String user)
throws IOException {
@@ -349,6 +352,7 @@ public class HadoopIgfsWrapper implements HadoopIgfs {
* Get delegate creating it if needed.
*
* @return Delegate.
+ * @throws HadoopIgfsCommunicationException On error.
*/
private Delegate delegate() throws HadoopIgfsCommunicationException {
// These fields will contain possible exceptions from shmem and TCP endpoints.
@@ -365,7 +369,7 @@ public class HadoopIgfsWrapper implements HadoopIgfs {
boolean skipInProc = parameter(conf, PARAM_IGFS_ENDPOINT_NO_EMBED, authority, false);
if (!skipInProc) {
- IgfsEx igfs = getIgfsEx(endpoint.grid(), endpoint.igfs());
+ IgfsEx igfs = getIgfsEx(endpoint.igfs());
if (igfs != null) {
HadoopIgfsEx hadoop = null;
@@ -393,7 +397,7 @@ public class HadoopIgfsWrapper implements HadoopIgfs {
HadoopIgfsEx hadoop = null;
try {
- hadoop = new HadoopIgfsOutProc(endpoint.port(), endpoint.grid(), endpoint.igfs(), log, userName);
+ hadoop = new HadoopIgfsOutProc(endpoint.port(), endpoint.igfs(), log, userName);
curDelegate = new Delegate(hadoop, hadoop.handshake(logDir));
}
@@ -415,7 +419,7 @@ public class HadoopIgfsWrapper implements HadoopIgfs {
HadoopIgfsEx hadoop = null;
try {
- hadoop = new HadoopIgfsOutProc(LOCALHOST, endpoint.port(), endpoint.grid(), endpoint.igfs(),
+ hadoop = new HadoopIgfsOutProc(LOCALHOST, endpoint.port(), endpoint.igfs(),
log, userName);
curDelegate = new Delegate(hadoop, hadoop.handshake(logDir));
@@ -437,7 +441,7 @@ public class HadoopIgfsWrapper implements HadoopIgfs {
HadoopIgfsEx hadoop = null;
try {
- hadoop = new HadoopIgfsOutProc(endpoint.host(), endpoint.port(), endpoint.grid(), endpoint.igfs(),
+ hadoop = new HadoopIgfsOutProc(endpoint.host(), endpoint.port(), endpoint.igfs(),
log, userName);
curDelegate = new Delegate(hadoop, hadoop.handshake(logDir));
@@ -532,20 +536,21 @@ public class HadoopIgfsWrapper implements HadoopIgfs {
/**
* Helper method to find Igfs of the given name in the given Ignite instance.
*
- * @param gridName The name of the grid to check.
* @param igfsName The name of Igfs.
* @return The file system instance, or null if not found.
*/
- private static IgfsEx getIgfsEx(@Nullable String gridName, @Nullable String igfsName) {
- if (Ignition.state(gridName) == STARTED) {
- try {
- for (IgniteFileSystem fs : Ignition.ignite(gridName).fileSystems()) {
- if (F.eq(fs.name(), igfsName))
- return (IgfsEx)fs;
+ private static IgfsEx getIgfsEx(@Nullable String igfsName) {
+ for (Ignite ignite : Ignition.allGrids()) {
+ if (Ignition.state(ignite.name()) == STARTED) {
+ try {
+ for (IgniteFileSystem fs : ignite.fileSystems()) {
+ if (F.eq(fs.name(), igfsName))
+ return (IgfsEx)fs;
+ }
+ }
+ catch (IgniteIllegalStateException ignore) {
+ // May happen if the grid state has changed:
}
- }
- catch (IgniteIllegalStateException ignore) {
- // May happen if the grid state has changed:
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractMapReduceTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractMapReduceTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractMapReduceTest.java
index 89005f6..d516179 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractMapReduceTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractMapReduceTest.java
@@ -86,7 +86,7 @@ public class HadoopAbstractMapReduceTest extends HadoopAbstractWordCountTest {
protected static final int SEQ_READS_BEFORE_PREFETCH = 2;
/** Secondary file system URI. */
- protected static final String SECONDARY_URI = "igfs://igfs-secondary:grid-secondary@127.0.0.1:11500/";
+ protected static final String SECONDARY_URI = "igfs://igfs-secondary@127.0.0.1:11500/";
/** Secondary file system configuration path. */
protected static final String SECONDARY_CFG = "modules/core/src/test/config/hadoop/core-site-loopback-secondary.xml";
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractSelfTest.java
index 5666cbc..e2e8295 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractSelfTest.java
@@ -101,6 +101,7 @@ public abstract class HadoopAbstractSelfTest extends GridCommonAbstractTest {
/**
* Performs additional initialization in the beginning of test class execution.
+ * @throws Exception If failed.
*/
protected void beforeTestsStarted0() throws Exception {
// noop
@@ -245,6 +246,6 @@ public abstract class HadoopAbstractSelfTest extends GridCommonAbstractTest {
* @return IGFS scheme for test.
*/
protected String igfsScheme() {
- return "igfs://:" + getTestGridName(0) + "@/";
+ return "igfs://@/";
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTaskExecutionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTaskExecutionSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTaskExecutionSelfTest.java
index 9d45b03..21e2f3d 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTaskExecutionSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTaskExecutionSelfTest.java
@@ -137,8 +137,8 @@ public class HadoopTaskExecutionSelfTest extends HadoopAbstractSelfTest {
job.setInputFormatClass(TextInputFormat.class);
- FileInputFormat.setInputPaths(job, new Path("igfs://:" + getTestGridName(0) + "@/"));
- FileOutputFormat.setOutputPath(job, new Path("igfs://:" + getTestGridName(0) + "@/output/"));
+ FileInputFormat.setInputPaths(job, new Path("igfs://@/"));
+ FileOutputFormat.setOutputPath(job, new Path("igfs://@/output/"));
job.setJarByClass(getClass());
@@ -181,8 +181,8 @@ public class HadoopTaskExecutionSelfTest extends HadoopAbstractSelfTest {
job.setInputFormatClass(TextInputFormat.class);
- FileInputFormat.setInputPaths(job, new Path("igfs://:" + getTestGridName(0) + "@/"));
- FileOutputFormat.setOutputPath(job, new Path("igfs://:" + getTestGridName(0) + "@/output"));
+ FileInputFormat.setInputPaths(job, new Path("igfs://@/"));
+ FileOutputFormat.setOutputPath(job, new Path("igfs://@/output"));
job.setJarByClass(getClass());
@@ -220,8 +220,8 @@ public class HadoopTaskExecutionSelfTest extends HadoopAbstractSelfTest {
job.setInputFormatClass(TextInputFormat.class);
- FileInputFormat.setInputPaths(job, new Path("igfs://:" + getTestGridName(0) + "@/"));
- FileOutputFormat.setOutputPath(job, new Path("igfs://:" + getTestGridName(0) + "@/output/"));
+ FileInputFormat.setInputPaths(job, new Path("igfs://@/"));
+ FileOutputFormat.setOutputPath(job, new Path("igfs://@/output/"));
job.setJarByClass(getClass());
@@ -282,8 +282,8 @@ public class HadoopTaskExecutionSelfTest extends HadoopAbstractSelfTest {
job.setInputFormatClass(InFormat.class);
- FileInputFormat.setInputPaths(job, new Path("igfs://:" + getTestGridName(0) + "@/"));
- FileOutputFormat.setOutputPath(job, new Path("igfs://:" + getTestGridName(0) + "@/output/"));
+ FileInputFormat.setInputPaths(job, new Path("igfs://@/"));
+ FileOutputFormat.setOutputPath(job, new Path("igfs://@/output/"));
job.setJarByClass(getClass());
@@ -409,6 +409,9 @@ public class HadoopTaskExecutionSelfTest extends HadoopAbstractSelfTest {
assertFalse(killRes);
}
+ /**
+ *
+ */
private static class CancellingTestMapper extends Mapper<Object, Text, Text, IntWritable> {
private int mapperId;
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolSelfTest.java
index 44fc46e..b3ff3e4 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/client/HadoopClientProtocolSelfTest.java
@@ -482,7 +482,7 @@ public class HadoopClientProtocolSelfTest extends HadoopAbstractSelfTest {
conf.set(MRConfig.FRAMEWORK_NAME, IgniteHadoopClientProtocolProvider.FRAMEWORK_NAME);
conf.set(MRConfig.MASTER_ADDRESS, "127.0.0.1:" + port);
- conf.set("fs.defaultFS", "igfs://:" + getTestGridName(0) + "@/");
+ conf.set("fs.defaultFS", "igfs://@/");
return conf;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/Hadoop1DualAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/Hadoop1DualAbstractTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/Hadoop1DualAbstractTest.java
index 367a406..cc9ea92 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/Hadoop1DualAbstractTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/Hadoop1DualAbstractTest.java
@@ -56,7 +56,7 @@ public abstract class Hadoop1DualAbstractTest extends IgfsDualAbstractSelfTest {
}};
/** Secondary file system authority. */
- private static final String SECONDARY_AUTHORITY = IGFS_NAME + ":" + GRID_NAME + "@127.0.0.1:" + PORT;
+ private static final String SECONDARY_AUTHORITY = IGFS_NAME + "@127.0.0.1:" + PORT;
/** Secondary file system authority. */
private static final String SECONDARY_WORKDIR = "workdir/test";
@@ -67,7 +67,10 @@ public abstract class Hadoop1DualAbstractTest extends IgfsDualAbstractSelfTest {
/** Secondary Fs URI. */
protected String secondaryUri;
- /** Constructor. */
+ /** Constructor.
+ *
+ * @param mode IGFS mode.
+ */
public Hadoop1DualAbstractTest(IgfsMode mode) {
super(mode);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java
index 5d955d4..5f64845 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java
@@ -125,7 +125,7 @@ public class HadoopFIleSystemFactorySelfTest extends IgfsCommonAbstractTest {
assert secondary.exists(IGFS_PATH_DUAL);
// Create remote instance.
- FileSystem fs = FileSystem.get(URI.create("igfs://primary:primary@127.0.0.1:10500/"), baseConfiguration());
+ FileSystem fs = FileSystem.get(URI.create("igfs://primary@127.0.0.1:10500/"), baseConfiguration());
// Ensure lifecycle callback was invoked.
assert START_CNT.get() == 2;
@@ -181,14 +181,14 @@ public class HadoopFIleSystemFactorySelfTest extends IgfsCommonAbstractTest {
// Prepare configuration.
Configuration conf = baseConfiguration();
- conf.set("fs.defaultFS", "igfs://secondary:secondary@127.0.0.1:11500/");
+ conf.set("fs.defaultFS", "igfs://secondary@127.0.0.1:11500/");
writeConfigurationToFile(conf);
// Get file system instance to be used.
CachingHadoopFileSystemFactory delegate = new CachingHadoopFileSystemFactory();
- delegate.setUri("igfs://secondary:secondary@127.0.0.1:11500/");
+ delegate.setUri("igfs://secondary@127.0.0.1:11500/");
delegate.setConfigPaths(SECONDARY_CFG_PATH);
// Configure factory.
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemLoopbackPrimarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemLoopbackPrimarySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemLoopbackPrimarySelfTest.java
index ee167d1..13996b9 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemLoopbackPrimarySelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemLoopbackPrimarySelfTest.java
@@ -36,7 +36,7 @@ public class HadoopIgfs20FileSystemLoopbackPrimarySelfTest extends HadoopIgfs20F
/** {@inheritDoc} */
@Override protected String primaryFileSystemUriPath() {
- return "igfs://igfs:" + getTestGridName(0) + "@/";
+ return "igfs://igfs@/";
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemShmemPrimarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemShmemPrimarySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemShmemPrimarySelfTest.java
index 5f45488..3a4160d 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemShmemPrimarySelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemShmemPrimarySelfTest.java
@@ -36,7 +36,7 @@ public class HadoopIgfs20FileSystemShmemPrimarySelfTest extends HadoopIgfs20File
/** {@inheritDoc} */
@Override protected String primaryFileSystemUriPath() {
- return "igfs://igfs:" + getTestGridName(0) + "@/";
+ return "igfs://igfs@/";
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java
index 8816182..cf1ccda 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java
@@ -77,13 +77,13 @@ public abstract class HadoopIgfsDualAbstractSelfTest extends IgfsCommonAbstractT
protected static final int SEQ_READS_BEFORE_PREFETCH = 2;
/** Secondary file system URI. */
- protected static final String SECONDARY_URI = "igfs://igfs-secondary:grid-secondary@127.0.0.1:11500/";
+ protected static final String SECONDARY_URI = "igfs://igfs-secondary@127.0.0.1:11500/";
/** Secondary file system configuration path. */
protected static final String SECONDARY_CFG = "modules/core/src/test/config/hadoop/core-site-loopback-secondary.xml";
/** Primary file system URI. */
- protected static final String PRIMARY_URI = "igfs://igfs:grid@/";
+ protected static final String PRIMARY_URI = "igfs://igfs@/";
/** Primary file system configuration path. */
protected static final String PRIMARY_CFG = "modules/core/src/test/config/hadoop/core-site-loopback.xml";
@@ -268,7 +268,7 @@ public abstract class HadoopIgfsDualAbstractSelfTest extends IgfsCommonAbstractT
int seqReads = SEQ_READS_BEFORE_PREFETCH + 1;
- cfg.setInt(String.format(PARAM_IGFS_SEQ_READS_BEFORE_PREFETCH, "igfs:grid@"), seqReads);
+ cfg.setInt(String.format(PARAM_IGFS_SEQ_READS_BEFORE_PREFETCH, "igfs@"), seqReads);
FileSystem fs = FileSystem.get(new URI(PRIMARY_URI), cfg);
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java
index 78f457b..9d49537 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java
@@ -72,13 +72,13 @@ public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstra
static final String IGFS_SCHEME = "igfs";
/** Primary file system authority. */
- private static final String PRIMARY_AUTHORITY = "igfs:grid0@";
+ private static final String PRIMARY_AUTHORITY = "igfs@";
/** Autogenerated secondary file system configuration path. */
private static final String PRIMARY_CFG_PATH = "/work/core-site-primary-test.xml";
/** Secondary file system authority. */
- private static final String SECONDARY_AUTHORITY = "igfs_secondary:grid_secondary@127.0.0.1:11500";
+ private static final String SECONDARY_AUTHORITY = "igfs_secondary@127.0.0.1:11500";
/** Autogenerated secondary file system configuration path. */
static final String SECONDARY_CFG_PATH = "/work/core-site-test.xml";
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsEventsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsEventsTestSuite.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsEventsTestSuite.java
index 6d7dc99..2395338 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsEventsTestSuite.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsEventsTestSuite.java
@@ -131,7 +131,7 @@ public class IgfsEventsTestSuite extends TestSuite {
FileSystemConfiguration igfsCfg = super.getIgfsConfiguration();
igfsCfg.setSecondaryFileSystem(new IgniteHadoopIgfsSecondaryFileSystem(
- "igfs://igfs-secondary:grid-secondary@127.0.0.1:11500/",
+ "igfs://igfs-secondary@127.0.0.1:11500/",
"modules/core/src/test/config/hadoop/core-site-secondary.xml"));
return igfsCfg;
@@ -235,7 +235,7 @@ public class IgfsEventsTestSuite extends TestSuite {
igfsCfg.setDefaultMode(IgfsMode.PRIMARY);
igfsCfg.setSecondaryFileSystem(new IgniteHadoopIgfsSecondaryFileSystem(
- "igfs://igfs-secondary:grid-secondary@127.0.0.1:11500/",
+ "igfs://igfs-secondary@127.0.0.1:11500/",
"modules/core/src/test/config/hadoop/core-site-loopback-secondary.xml"));
return igfsCfg;
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
index bd17edc..1bcbdaa 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
@@ -99,13 +99,13 @@ import static org.apache.ignite.igfs.IgfsMode.PROXY;
@SuppressWarnings("all")
public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonAbstractTest {
/** Primary file system authority. */
- private static final String PRIMARY_AUTHORITY = "igfs:grid0@";
+ private static final String PRIMARY_AUTHORITY = "igfs@";
/** Primary file systme URI. */
private static final String PRIMARY_URI = "igfs://" + PRIMARY_AUTHORITY + "/";
/** Secondary file system authority. */
- private static final String SECONDARY_AUTHORITY = "igfs_secondary:grid_secondary@127.0.0.1:11500";
+ private static final String SECONDARY_AUTHORITY = "igfs_secondary@127.0.0.1:11500";
/** Secondary file systme URI. */
private static final String SECONDARY_URI = "igfs://" + SECONDARY_AUTHORITY + "/";
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java
index 555da1e..92956b0 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java
@@ -142,7 +142,7 @@ public class IgniteHadoopFileSystemClientSelfTest extends IgfsCommonAbstractTest
try {
switchHandlerErrorFlag(true);
- HadoopIgfs client = new HadoopIgfsOutProc("127.0.0.1", 10500, getTestGridName(0), "igfs", LOG, null);
+ HadoopIgfs client = new HadoopIgfsOutProc("127.0.0.1", 10500, "igfs", LOG, null);
client.handshake(null);
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java
index 9891c60..a01c015 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java
@@ -110,7 +110,7 @@ public class IgniteHadoopFileSystemHandshakeSelfTest extends IgfsCommonAbstractT
checkValid(IGFS_NAME + ":" + GRID_NAME + "@" + HOST_PORT_UNUSED);
checkValid(IGFS_NAME + "@"); // Embedded mode fails, but remote tcp succeeds.
- checkInvalid(IGFS_NAME + "@" + HOST_PORT_UNUSED);
+ checkValid(IGFS_NAME + "@" + HOST_PORT_UNUSED);
checkValid(":" + GRID_NAME + "@"); // Embedded mode fails, but remote tcp succeeds.
checkInvalid(":" + GRID_NAME + "@" + HOST_PORT_UNUSED);
@@ -129,17 +129,17 @@ public class IgniteHadoopFileSystemHandshakeSelfTest extends IgfsCommonAbstractT
tcp = true;
- checkInvalid(IGFS_NAME + ":" + GRID_NAME + "@");
- checkInvalid(IGFS_NAME + ":" + GRID_NAME + "@127.0.0.1");
- checkInvalid(IGFS_NAME + ":" + GRID_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+ checkValid(IGFS_NAME + ":" + GRID_NAME + "@");
+ checkValid(IGFS_NAME + ":" + GRID_NAME + "@127.0.0.1");
+ checkValid(IGFS_NAME + ":" + GRID_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
checkValid(IGFS_NAME + "@");
checkValid(IGFS_NAME + "@127.0.0.1");
checkValid(IGFS_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
- checkInvalid(":" + GRID_NAME + "@");
- checkInvalid(":" + GRID_NAME + "@127.0.0.1");
- checkInvalid(":" + GRID_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+ checkValid(":" + GRID_NAME + "@");
+ checkValid(":" + GRID_NAME + "@127.0.0.1");
+ checkValid(":" + GRID_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
checkValid("");
checkValid("127.0.0.1");
@@ -147,13 +147,13 @@ public class IgniteHadoopFileSystemHandshakeSelfTest extends IgfsCommonAbstractT
tcp = false; // Embedded mode:
- checkInvalid(IGFS_NAME + ":" + GRID_NAME + "@");
- checkInvalid(IGFS_NAME + ":" + GRID_NAME + "@" + HOST_PORT_UNUSED);
+ checkValid(IGFS_NAME + ":" + GRID_NAME + "@");
+ checkValid(IGFS_NAME + ":" + GRID_NAME + "@" + HOST_PORT_UNUSED);
checkValid(IGFS_NAME + "@");
checkValid(IGFS_NAME + "@" + HOST_PORT_UNUSED);
- checkInvalid(":" + GRID_NAME + "@");
+ checkValid(":" + GRID_NAME + "@");
checkInvalid(":" + GRID_NAME + "@" + HOST_PORT_UNUSED);
checkValid("@"); // Embedded mode fails, but remote tcp succeeds.
@@ -198,7 +198,7 @@ public class IgniteHadoopFileSystemHandshakeSelfTest extends IgfsCommonAbstractT
checkValid(":" + GRID_NAME + "@" + HOST_PORT_UNUSED);
checkValid("@"); // NB: in embedded mode this fails, but remote TCP still succeeds.
- checkInvalid("@" + HOST_PORT_UNUSED);
+ checkValid("@" + HOST_PORT_UNUSED);
}
/**
@@ -219,9 +219,9 @@ public class IgniteHadoopFileSystemHandshakeSelfTest extends IgfsCommonAbstractT
checkInvalid(IGFS_NAME + "@127.0.0.1");
checkInvalid(IGFS_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
- checkInvalid(":" + GRID_NAME + "@");
- checkInvalid(":" + GRID_NAME + "@127.0.0.1");
- checkInvalid(":" + GRID_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+ checkValid(":" + GRID_NAME + "@");
+ checkValid(":" + GRID_NAME + "@127.0.0.1");
+ checkValid(":" + GRID_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
checkValid("");
checkValid("127.0.0.1");
@@ -235,8 +235,8 @@ public class IgniteHadoopFileSystemHandshakeSelfTest extends IgfsCommonAbstractT
checkInvalid(IGFS_NAME + "@");
checkInvalid(IGFS_NAME + "@" + HOST_PORT_UNUSED);
- checkInvalid(":" + GRID_NAME + "@");
- checkInvalid(":" + GRID_NAME + "@" + HOST_PORT_UNUSED);
+ checkValid(":" + GRID_NAME + "@");
+ checkValid(":" + GRID_NAME + "@" + HOST_PORT_UNUSED);
checkValid("@");
checkValid("@" + HOST_PORT_UNUSED);
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerStateSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerStateSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerStateSelfTest.java
index e30779f..8b6635e 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerStateSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerStateSelfTest.java
@@ -307,11 +307,11 @@ public class IgniteHadoopFileSystemLoggerStateSelfTest extends IgfsCommonAbstrac
fsCfg.setBoolean("fs.igfs.impl.disable.cache", true);
if (logging)
- fsCfg.setBoolean(String.format(PARAM_IGFS_LOG_ENABLED, "igfs:igfs-grid@"), logging);
+ fsCfg.setBoolean(String.format(PARAM_IGFS_LOG_ENABLED, "igfs@"), logging);
- fsCfg.setStrings(String.format(PARAM_IGFS_LOG_DIR, "igfs:igfs-grid@"), U.getIgniteHome());
+ fsCfg.setStrings(String.format(PARAM_IGFS_LOG_DIR, "igfs@"), U.getIgniteHome());
- return (IgniteHadoopFileSystem)FileSystem.get(new URI("igfs://igfs:igfs-grid@/"), fsCfg);
+ return (IgniteHadoopFileSystem)FileSystem.get(new URI("igfs://igfs@/"), fsCfg);
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/2e691d80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
index 4c96244..fd56137 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
@@ -84,7 +84,7 @@ public class IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest ext
igfsCfg.setManagementPort(-1);
igfsCfg.setSecondaryFileSystem(new IgniteHadoopIgfsSecondaryFileSystem(
- "igfs://igfs-secondary:igfs-grid-secondary@127.0.0.1:11500/",
+ "igfs://igfs-secondary@127.0.0.1:11500/",
"modules/core/src/test/config/hadoop/core-site-loopback-secondary.xml"));
CacheConfiguration cacheCfg = defaultCacheConfiguration();
@@ -126,7 +126,7 @@ public class IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest ext
fsCfg.setBoolean("fs.igfs.impl.disable.cache", true);
- fs = (IgniteHadoopFileSystem)FileSystem.get(new URI("igfs://igfs:igfs-grid@/"), fsCfg);
+ fs = (IgniteHadoopFileSystem)FileSystem.get(new URI("igfs://igfs@/"), fsCfg);
}
/**
[18/50] [abbrv] ignite git commit: Removed duplicated benchmark.
Posted by ag...@apache.org.
Removed duplicated benchmark.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/864a95e1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/864a95e1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/864a95e1
Branch: refs/heads/ignite-3477
Commit: 864a95e13f1262f14351df0883d0a1abd1bf70c7
Parents: 8372e69
Author: sboikov <sb...@gridgain.com>
Authored: Thu Dec 29 14:45:08 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Dec 29 14:45:08 2016 +0300
----------------------------------------------------------------------
.../yardstick/cache/IgniteIoTestBenchmark.java | 73 --------------------
1 file changed, 73 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/864a95e1/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteIoTestBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteIoTestBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteIoTestBenchmark.java
deleted file mode 100644
index bee45e0..0000000
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteIoTestBenchmark.java
+++ /dev/null
@@ -1,73 +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.yardstick.cache;
-
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.IgniteKernal;
-import org.apache.ignite.yardstick.IgniteAbstractBenchmark;
-import org.yardstickframework.BenchmarkConfiguration;
-import org.yardstickframework.BenchmarkUtils;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-/**
- *
- */
-public class IgniteIoTestBenchmark extends IgniteAbstractBenchmark {
- /** */
- private List<ClusterNode> targetNodes;
-
- /** */
- private IgniteKernal ignite;
-
- /** {@inheritDoc} */
- @Override public void setUp(BenchmarkConfiguration cfg) throws Exception {
- super.setUp(cfg);
-
- ignite = (IgniteKernal)ignite();
-
- targetNodes = new ArrayList<>();
-
- ClusterNode loc = ignite().cluster().localNode();
-
- Collection<ClusterNode> nodes = ignite().cluster().forServers().nodes();
-
- for (ClusterNode node : nodes) {
- if (!loc.equals(node))
- targetNodes.add(node);
- }
-
- if (targetNodes.isEmpty())
- throw new IgniteException("Failed to find remote server nodes [nodes=" + nodes + ']');
-
- BenchmarkUtils.println(cfg, "Initialized target nodes: " + targetNodes + ']');
- }
-
- /** {@inheritDoc} */
- @Override public boolean test(Map<Object, Object> ctx) throws Exception {
- ClusterNode node = targetNodes.get(nextRandom(targetNodes.size()));
-
- ignite.sendIoTest(node, null, false).get();
-
- return true;
- }
-}
[28/50] [abbrv] ignite git commit: .NET: Fix non-ascii chars in
AssemblyInfo
Posted by ag...@apache.org.
.NET: Fix non-ascii chars in AssemblyInfo
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d2e6007b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d2e6007b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d2e6007b
Branch: refs/heads/ignite-3477
Commit: d2e6007b905b6c19cd87786a039229156d10c013
Parents: f406887
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Mon Jan 9 12:40:42 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Mon Jan 9 12:40:42 2017 +0300
----------------------------------------------------------------------
.../dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs | 2 +-
.../dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs | 2 +-
.../dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d2e6007b/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
index f5fa618..1bca0e8 100644
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
@@ -1,4 +1,4 @@
-\ufeff\ufeff/*
+\ufeff/*
* 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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/d2e6007b/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
index d72c9db..0926a46 100644
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
@@ -1,4 +1,4 @@
-\ufeff\ufeff/*
+\ufeff/*
* 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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/d2e6007b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
index cc833ea..1fc6c59 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
@@ -1,4 +1,4 @@
-\ufeff\ufeff/*
+\ufeff/*
* 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.
[31/50] [abbrv] ignite git commit: IGNITE-4470 Added support for log
file configuration via environmental variable IGNITE_ODBC_LOG_PATH
Posted by ag...@apache.org.
IGNITE-4470 Added support for log file configuration via environmental variable IGNITE_ODBC_LOG_PATH
This closes #1384
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/825fe9cd
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/825fe9cd
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/825fe9cd
Branch: refs/heads/ignite-3477
Commit: 825fe9cd64ded64068c573d7e3c3901efae6283f
Parents: 9e8e979
Author: Sergey Kalashnikov <sk...@gridgain.com>
Authored: Tue Jan 10 15:57:05 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Jan 10 15:57:05 2017 +0300
----------------------------------------------------------------------
modules/platforms/cpp/odbc/Makefile.am | 3 +-
modules/platforms/cpp/odbc/include/Makefile.am | 3 +-
.../ignite/odbc/config/connection_info.h | 2 -
.../cpp/odbc/include/ignite/odbc/log.h | 123 ++++++++++++++
.../odbc/include/ignite/odbc/meta/column_meta.h | 2 -
.../cpp/odbc/include/ignite/odbc/utility.h | 19 +--
.../odbc/os/linux/src/system/socket_client.cpp | 9 +-
.../odbc/os/win/src/system/socket_client.cpp | 9 +-
.../src/system/ui/dsn_configuration_window.cpp | 18 +-
.../cpp/odbc/os/win/src/system_dsn.cpp | 17 +-
.../platforms/cpp/odbc/project/vs/odbc.vcxproj | 2 +
.../cpp/odbc/project/vs/odbc.vcxproj.filters | 6 +
.../cpp/odbc/src/config/connection_info.cpp | 3 -
modules/platforms/cpp/odbc/src/connection.cpp | 19 ++-
.../odbc/src/diagnostic/diagnosable_adapter.cpp | 3 +-
modules/platforms/cpp/odbc/src/entry_points.cpp | 52 +++---
modules/platforms/cpp/odbc/src/log.cpp | 83 +++++++++
.../platforms/cpp/odbc/src/meta/column_meta.cpp | 4 -
modules/platforms/cpp/odbc/src/odbc.cpp | 167 ++++++++++---------
.../odbc/src/query/column_metadata_query.cpp | 13 +-
.../platforms/cpp/odbc/src/query/data_query.cpp | 23 ++-
.../cpp/odbc/src/query/table_metadata_query.cpp | 12 +-
modules/platforms/cpp/odbc/src/statement.cpp | 11 +-
modules/platforms/cpp/odbc/src/utility.cpp | 18 +-
24 files changed, 412 insertions(+), 209 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/Makefile.am b/modules/platforms/cpp/odbc/Makefile.am
index 1eb42d1..de6f75a 100644
--- a/modules/platforms/cpp/odbc/Makefile.am
+++ b/modules/platforms/cpp/odbc/Makefile.am
@@ -79,7 +79,8 @@ libignite_odbc_la_SOURCES = \
src/column.cpp \
src/statement.cpp \
src/type_traits.cpp \
- src/utility.cpp
+ src/utility.cpp \
+ src/log.cpp
clean-local:
$(RM) *.gcno *.gcda
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/Makefile.am b/modules/platforms/cpp/odbc/include/Makefile.am
index 073dcaa..36d8e25 100644
--- a/modules/platforms/cpp/odbc/include/Makefile.am
+++ b/modules/platforms/cpp/odbc/include/Makefile.am
@@ -53,7 +53,8 @@ noinst_HEADERS = \
ignite/odbc/cursor.h \
ignite/odbc/common_types.h \
ignite/odbc/result_page.h \
- ignite/odbc/type_traits.h
+ ignite/odbc/type_traits.h \
+ ignite/odbc/log.h
uninstall-hook:
if [ -d ${includedir}/ignite ]; then find ${includedir}/ignite -type d -empty -delete; fi
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h b/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
index e0ed152..d421952 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_info.h
@@ -40,7 +40,6 @@ namespace ignite
/** Info type. */
typedef unsigned short InfoType;
-#ifdef ODBC_DEBUG
/**
* Convert type to string containing its name.
* Debug function.
@@ -48,7 +47,6 @@ namespace ignite
* @return Null-terminated string containing types name.
*/
static const char* InfoTypeToString(InfoType type);
-#endif
/**
* Constructor.
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/include/ignite/odbc/log.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/log.h b/modules/platforms/cpp/odbc/include/ignite/odbc/log.h
new file mode 100644
index 0000000..5a6dafc
--- /dev/null
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/log.h
@@ -0,0 +1,123 @@
+/*
+ * 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.
+ */
+
+#ifndef _IGNITE_ODBC_LOG
+#define _IGNITE_ODBC_LOG
+
+#include <string>
+#include <sstream>
+#include <fstream>
+
+#include "ignite/common/common.h"
+#include "ignite/common/concurrent.h"
+
+# define LOG_MSG(param) \
+ if (ignite::odbc::Logger* p = ignite::odbc::Logger::Get()) \
+ { \
+ ignite::odbc::LogStream lstream(p); \
+ lstream << __FUNCTION__ << ": " << param; \
+ }
+
+namespace ignite
+{
+ namespace odbc
+ {
+ /* Forward declaration */
+ class Logger;
+
+ /**
+ * Helper object providing stream operations for single log line.
+ * Writes resulting string to Logger object upon destruction.
+ */
+ class LogStream: public std::basic_ostream<char>
+ {
+ public:
+ /**
+ * Constructor.
+ * @param parent pointer to Logger.
+ */
+ LogStream(Logger* parent);
+
+ /**
+ * Conversion operator helpful to determine if log is enabled
+ * @return True if logger is enabled
+ */
+ bool operator()();
+
+ /**
+ * Destructor.
+ */
+ virtual ~LogStream();
+
+ private:
+ IGNITE_NO_COPY_ASSIGNMENT(LogStream);
+
+ /** String buffer. */
+ std::basic_stringbuf<char> strbuf;
+
+ /** Parent logger object */
+ Logger* logger;
+ };
+
+ /**
+ * Logging facility.
+ */
+ class Logger
+ {
+ public:
+ /**
+ * Get instance of Logger, if enabled.
+ * @return Logger instance if logging is enabled. Null otherwise.
+ */
+ static Logger* Get();
+
+ /**
+ * Checks if logging is enabled.
+ * @return True, if logging is enabled.
+ */
+ bool IsEnabled() const;
+
+ /**
+ * Outputs the message to log file
+ * @param message The message to write
+ */
+ void WriteMessage(std::string const& message);
+
+ private:
+ /**
+ * Constructor.
+ * @param path to log file.
+ */
+ Logger(const char* path);
+
+ /**
+ * Destructor.
+ */
+ ~Logger();
+
+ IGNITE_NO_COPY_ASSIGNMENT(Logger);
+
+ /** Mutex for writes synchronization. */
+ ignite::common::concurrent::CriticalSection mutex;
+
+ /** File stream. */
+ std::ofstream stream;
+ };
+ }
+}
+
+#endif //_IGNITE_ODBC_LOG
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/include/ignite/odbc/meta/column_meta.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/meta/column_meta.h b/modules/platforms/cpp/odbc/include/ignite/odbc/meta/column_meta.h
index 5ffff03..6a94b04 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/meta/column_meta.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/meta/column_meta.h
@@ -38,7 +38,6 @@ namespace ignite
class ColumnMeta
{
public:
-#ifdef ODBC_DEBUG
/**
* Convert attribute ID to string containing its name.
* Debug function.
@@ -46,7 +45,6 @@ namespace ignite
* @return Null-terminated string containing attribute name.
*/
static const char* AttrIdToString(uint16_t id);
-#endif
/**
* Default constructor.
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h b/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h
index 590e97c..7ff5b23 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h
@@ -27,6 +27,7 @@
#include <string>
#include <algorithm>
+#include <sstream>
#include <ignite/common/utils.h>
#include <ignite/common/decimal.h>
@@ -34,22 +35,6 @@
#include "ignite/impl/binary/binary_reader_impl.h"
#include "ignite/impl/binary/binary_writer_impl.h"
-
-#ifdef ODBC_DEBUG
-
-extern FILE* log_file;
-void logInit(const char*);
-
-# define LOG_MSG(fmt, ...) \
- do { \
- logInit(ODBC_LOG_PATH); \
- fprintf(log_file, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__); \
- fflush(log_file); \
- } while (false)
-#else
-# define LOG_MSG(...)
-#endif
-
namespace ignite
{
namespace utility
@@ -187,7 +172,7 @@ namespace ignite
* @param count data length
* @return standard string containing the formated hex dump
*/
- std::string HexDump(const char* data, size_t count);
+ std::string HexDump(const void* data, size_t count);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/os/linux/src/system/socket_client.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/os/linux/src/system/socket_client.cpp b/modules/platforms/cpp/odbc/os/linux/src/system/socket_client.cpp
index a355625..9bdf1d7 100644
--- a/modules/platforms/cpp/odbc/os/linux/src/system/socket_client.cpp
+++ b/modules/platforms/cpp/odbc/os/linux/src/system/socket_client.cpp
@@ -27,6 +27,7 @@
#include "ignite/odbc/system/socket_client.h"
#include "ignite/odbc/utility.h"
+#include "ignite/odbc/log.h"
#define SOCKET_ERROR (-1)
@@ -49,7 +50,7 @@ namespace ignite
bool SocketClient::Connect(const char* hostname, uint16_t port)
{
- LOG_MSG("Host: %s, port: %d\n", hostname, port);
+ LOG_MSG("Host: " << hostname << ", port: " << port);
addrinfo hints;
memset(&hints, 0, sizeof(hints));
@@ -70,8 +71,10 @@ namespace ignite
// Attempt to connect to an address until one succeeds
for (addrinfo *it = result; it != NULL; it = it->ai_next)
{
- LOG_MSG("Addr: %u.%u.%u.%u\n", it->ai_addr->sa_data[2], it->ai_addr->sa_data[3],
- it->ai_addr->sa_data[4], it->ai_addr->sa_data[5]);
+ LOG_MSG("Addr: " << it->ai_addr->sa_data[2] << "."
+ << it->ai_addr->sa_data[3] << "."
+ << it->ai_addr->sa_data[4] << "."
+ << it->ai_addr->sa_data[5]);
// Create a SOCKET for connecting to server
socketHandle = socket(it->ai_family, it->ai_socktype, it->ai_protocol);
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/os/win/src/system/socket_client.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/os/win/src/system/socket_client.cpp b/modules/platforms/cpp/odbc/os/win/src/system/socket_client.cpp
index e248323..4c440e2 100644
--- a/modules/platforms/cpp/odbc/os/win/src/system/socket_client.cpp
+++ b/modules/platforms/cpp/odbc/os/win/src/system/socket_client.cpp
@@ -28,6 +28,7 @@
#include "ignite/odbc/system/socket_client.h"
#include "ignite/odbc/utility.h"
+#include "ignite/odbc/log.h"
namespace ignite
{
@@ -64,7 +65,7 @@ namespace ignite
addrinfo *result = NULL;
addrinfo hints;
- LOG_MSG("Host: %s, port: %d\n", hostname, port);
+ LOG_MSG("Host: " << hostname << " port: " << port);
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
@@ -83,8 +84,10 @@ namespace ignite
// Attempt to connect to an address until one succeeds
for (addrinfo *it = result; it != NULL; it = it->ai_next)
{
- LOG_MSG("Addr: %u.%u.%u.%u\n", it->ai_addr->sa_data[2] & 0xFF, it->ai_addr->sa_data[3] & 0xFF,
- it->ai_addr->sa_data[4] & 0xFF, it->ai_addr->sa_data[5] & 0xFF);
+ LOG_MSG("Addr: " << (it->ai_addr->sa_data[2] & 0xFF) << "."
+ << (it->ai_addr->sa_data[3] & 0xFF) << "."
+ << (it->ai_addr->sa_data[4] & 0xFF) << "."
+ << (it->ai_addr->sa_data[5] & 0xFF));
// Create a SOCKET for connecting to server
socketHandle = socket(it->ai_family, it->ai_socktype, it->ai_protocol);
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp b/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
index a758bd9..864ca85 100644
--- a/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
+++ b/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp
@@ -17,6 +17,8 @@
#include <Windowsx.h>
+#include "ignite/odbc/log.h"
+
#include "ignite/odbc/system/ui/dsn_configuration_window.h"
namespace ignite
@@ -300,14 +302,14 @@ namespace ignite
distributedJoins = distributedJoinsCheckBox->IsEnabled() && distributedJoinsCheckBox->IsChecked();
enforceJoinOrder = enforceJoinOrderCheckBox->IsEnabled() && enforceJoinOrderCheckBox->IsChecked();
- LOG_MSG("Retriving arguments:\n");
- LOG_MSG("DSN: %s\n", dsn.c_str());
- LOG_MSG("Address: %s\n", address.c_str());
- LOG_MSG("Cache: %s\n", cache.c_str());
- LOG_MSG("Page size: %d\n", pageSize);
- LOG_MSG("Protocol version: %s\n", version.c_str());
- LOG_MSG("Distributed Joins: %s\n", distributedJoins ? "true" : "false");
- LOG_MSG("Enforce Join Order: %s\n", enforceJoinOrder ? "true" : "false");
+ LOG_MSG("Retriving arguments:");
+ LOG_MSG("DSN: " << dsn);
+ LOG_MSG("Address: " << address);
+ LOG_MSG("Cache: " << cache);
+ LOG_MSG("Page size: " << pageSize);
+ LOG_MSG("Protocol version: " << version);
+ LOG_MSG("Distributed Joins: " << (distributedJoins ? "true" : "false"));
+ LOG_MSG("Enforce Join Order: " << (enforceJoinOrder ? "true" : "false"));
if (dsn.empty())
throw IgniteError(IgniteError::IGNITE_ERR_GENERIC, "DSN name can not be empty.");
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp b/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp
index f432a40..3d41e3e 100644
--- a/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp
+++ b/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp
@@ -16,6 +16,7 @@
*/
#include "ignite/odbc/utility.h"
+#include "ignite/odbc/log.h"
#include "ignite/odbc/system/odbc_constants.h"
#include "ignite/odbc/dsn_config.h"
@@ -147,27 +148,27 @@ BOOL INSTAPI ConfigDSN(HWND hwndParent, WORD req, LPCSTR driver, LPCSTR attribut
{
using namespace ignite::odbc;
- LOG_MSG("ConfigDSN called\n");
+ LOG_MSG("ConfigDSN called");
Configuration config;
- LOG_MSG("Attributes: %s\n", attributes);
+ LOG_MSG("Attributes: " << attributes);
config.FillFromConfigAttributes(attributes);
if (!SQLValidDSN(config.GetDsn().c_str()))
return FALSE;
- LOG_MSG("Driver: %s\n", driver);
- LOG_MSG("Attributes: %s\n", attributes);
+ LOG_MSG("Driver: " << driver);
+ LOG_MSG("Attributes: " << attributes);
- LOG_MSG("DSN: %s\n", config.GetDsn().c_str());
+ LOG_MSG("DSN: " << config.GetDsn());
switch (req)
{
case ODBC_ADD_DSN:
{
- LOG_MSG("ODBC_ADD_DSN\n");
+ LOG_MSG("ODBC_ADD_DSN");
if (!DisplayConfigureDsnWindow(hwndParent, config))
return FALSE;
@@ -180,7 +181,7 @@ BOOL INSTAPI ConfigDSN(HWND hwndParent, WORD req, LPCSTR driver, LPCSTR attribut
case ODBC_CONFIG_DSN:
{
- LOG_MSG("ODBC_CONFIG_DSN\n");
+ LOG_MSG("ODBC_CONFIG_DSN");
std::string dsn = config.GetDsn();
@@ -202,7 +203,7 @@ BOOL INSTAPI ConfigDSN(HWND hwndParent, WORD req, LPCSTR driver, LPCSTR attribut
case ODBC_REMOVE_DSN:
{
- LOG_MSG("ODBC_REMOVE_DSN\n");
+ LOG_MSG("ODBC_REMOVE_DSN");
if (!UnregisterDsn(config.GetDsn().c_str()))
return FALSE;
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj
index 56358c5..b00e432 100644
--- a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj
+++ b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj
@@ -188,6 +188,7 @@
<ClCompile Include="..\..\src\statement.cpp" />
<ClCompile Include="..\..\src\type_traits.cpp" />
<ClCompile Include="..\..\src\utility.cpp" />
+ <ClCompile Include="..\..\src\log.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="module.def" />
@@ -230,6 +231,7 @@
<ClInclude Include="..\..\include\ignite\odbc\system\ui\dsn_configuration_window.h" />
<ClInclude Include="..\..\include\ignite\odbc\type_traits.h" />
<ClInclude Include="..\..\include\ignite\odbc\utility.h" />
+ <ClInclude Include="..\..\include\ignite\odbc\log.h" />
<ClInclude Include="..\..\os\win\include\ignite\odbc\system\ui\custom_window.h" />
<ClInclude Include="..\..\os\win\include\ignite\odbc\system\ui\window.h" />
</ItemGroup>
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters
index 58764e4..1828be1 100644
--- a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters
+++ b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters
@@ -52,6 +52,9 @@
<ClCompile Include="..\..\src\utility.cpp">
<Filter>Code</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\log.cpp">
+ <Filter>Code</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\cursor.cpp">
<Filter>Code</Filter>
</ClCompile>
@@ -176,6 +179,9 @@
<ClInclude Include="..\..\include\ignite\odbc\utility.h">
<Filter>Code</Filter>
</ClInclude>
+ <ClInclude Include="..\..\include\ignite\odbc\log.h">
+ <Filter>Code</Filter>
+ </ClInclude>
<ClInclude Include="..\..\include\ignite\odbc\query\query.h">
<Filter>Code\query</Filter>
</ClInclude>
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/config/connection_info.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/config/connection_info.cpp b/modules/platforms/cpp/odbc/src/config/connection_info.cpp
index 7c612bc..ed76aab 100644
--- a/modules/platforms/cpp/odbc/src/config/connection_info.cpp
+++ b/modules/platforms/cpp/odbc/src/config/connection_info.cpp
@@ -42,8 +42,6 @@ namespace ignite
namespace config
{
-#ifdef ODBC_DEBUG
-
#define DBG_STR_CASE(x) case x: return #x
const char * ConnectionInfo::InfoTypeToString(InfoType type)
@@ -102,7 +100,6 @@ namespace ignite
}
#undef DBG_STR_CASE
-#endif
ConnectionInfo::ConnectionInfo() : strParams(), intParams(),
shortParams()
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/connection.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/connection.cpp b/modules/platforms/cpp/odbc/src/connection.cpp
index 4a6de5e..960a507 100644
--- a/modules/platforms/cpp/odbc/src/connection.cpp
+++ b/modules/platforms/cpp/odbc/src/connection.cpp
@@ -21,6 +21,7 @@
#include <ignite/common/fixed_size_array.h>
+#include "ignite/odbc/log.h"
#include "ignite/odbc/utility.h"
#include "ignite/odbc/statement.h"
#include "ignite/odbc/connection.h"
@@ -65,6 +66,13 @@ namespace ignite
void Connection::GetInfo(config::ConnectionInfo::InfoType type, void* buf, short buflen, short* reslen)
{
+ LOG_MSG("SQLGetInfo called: "
+ << type << " ("
+ << config::ConnectionInfo::InfoTypeToString(type) << "), "
+ << std::hex << reinterpret_cast<size_t>(buf) << ", "
+ << buflen << ", "
+ << std::hex << reinterpret_cast<size_t>(reslen));
+
IGNITE_ODBC_API_CALL(InternalGetInfo(type, buf, buflen, reslen));
}
@@ -195,7 +203,7 @@ namespace ignite
if (sent != len + sizeof(OdbcProtocolHeader))
IGNITE_ERROR_1(IgniteError::IGNITE_ERR_GENERIC, "Can not send message");
- LOG_MSG("message sent: (%d bytes)%s\n", msg.GetSize(), utility::HexDump((char*)msg.GetData(), msg.GetSize()).c_str());
+ LOG_MSG("message sent: (" << msg.GetSize() << " bytes)" << utility::HexDump(msg.GetData(), msg.GetSize()));
}
size_t Connection::SendAll(const int8_t* data, size_t len)
@@ -206,7 +214,7 @@ namespace ignite
{
int res = socket.Send(data + sent, len - sent);
- LOG_MSG("Sent: %d\n", res);
+ LOG_MSG("Sent: " << res);
if (res <= 0)
return sent;
@@ -259,8 +267,7 @@ namespace ignite
size_t received = len - remain;
int res = socket.Receive(buffer + received, remain);
- LOG_MSG("Receive res: %d\n", res);
- LOG_MSG("remain: %d\n", remain);
+ LOG_MSG("Receive res: " << res << " remain: " << remain);
if (res <= 0)
return received;
@@ -345,7 +352,7 @@ namespace ignite
if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
{
- LOG_MSG("Error: %s\n", rsp.GetError().c_str());
+ LOG_MSG("Error: " << rsp.GetError().c_str());
AddStatusRecord(SQL_STATE_08001_CANNOT_CONNECT, rsp.GetError());
@@ -356,7 +363,7 @@ namespace ignite
if (!rsp.IsAccepted())
{
- LOG_MSG("Hanshake message has been rejected.\n");
+ LOG_MSG("Hanshake message has been rejected.");
std::stringstream constructor;
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp b/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp
index 260e3e4..94ea53e 100644
--- a/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp
+++ b/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+#include "ignite/odbc/log.h"
#include "ignite/odbc/connection.h"
#include "ignite/odbc/diagnostic/diagnosable_adapter.h"
@@ -41,7 +42,7 @@ namespace ignite
void DiagnosableAdapter::AddStatusRecord(SqlState sqlState, const std::string& message)
{
- LOG_MSG("Adding new record: %s\n", message.c_str());
+ LOG_MSG("Adding new record: " << message);
AddStatusRecord(sqlState, message, 0, 0);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/entry_points.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/entry_points.cpp b/modules/platforms/cpp/odbc/src/entry_points.cpp
index 850fa10..e241a9f 100644
--- a/modules/platforms/cpp/odbc/src/entry_points.cpp
+++ b/modules/platforms/cpp/odbc/src/entry_points.cpp
@@ -17,6 +17,8 @@
#include "ignite/odbc.h"
+#include "ignite/odbc/log.h"
+
#include "ignite/odbc/utility.h"
SQLRETURN SQL_API SQLGetInfo(SQLHDBC conn,
@@ -440,7 +442,7 @@ SQLRETURN SQL_API SQLError(SQLHENV env,
SQLRETURN SQL_API SQLCancel(SQLHSTMT stmt)
{
- LOG_MSG("SQLCancel called\n");
+ LOG_MSG("SQLCancel called");
return SQL_SUCCESS;
}
@@ -452,7 +454,7 @@ SQLRETURN SQL_API SQLColAttributes(SQLHSTMT stmt,
SQLSMALLINT* strAttrResLen,
SQLLEN* numAttrBuf)
{
- LOG_MSG("SQLColAttributes called\n");
+ LOG_MSG("SQLColAttributes called");
return SQL_SUCCESS;
}
@@ -461,7 +463,7 @@ SQLRETURN SQL_API SQLGetCursorName(SQLHSTMT stmt,
SQLSMALLINT nameBufLen,
SQLSMALLINT* nameResLen)
{
- LOG_MSG("SQLGetCursorName called\n");
+ LOG_MSG("SQLGetCursorName called");
return SQL_SUCCESS;
}
@@ -469,7 +471,7 @@ SQLRETURN SQL_API SQLSetCursorName(SQLHSTMT stmt,
SQLCHAR* name,
SQLSMALLINT nameLen)
{
- LOG_MSG("SQLSetCursorName called\n");
+ LOG_MSG("SQLSetCursorName called");
return SQL_SUCCESS;
}
@@ -477,7 +479,7 @@ SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC conn,
SQLUSMALLINT option,
SQLPOINTER value)
{
- LOG_MSG("SQLGetConnectOption called\n");
+ LOG_MSG("SQLGetConnectOption called");
return SQL_SUCCESS;
}
@@ -485,7 +487,7 @@ SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT stmt,
SQLUSMALLINT option,
SQLPOINTER value)
{
- LOG_MSG("SQLGetStmtOption called\n");
+ LOG_MSG("SQLGetStmtOption called");
return SQL_SUCCESS;
}
@@ -493,7 +495,7 @@ SQLRETURN SQL_API SQLSetConnectOption(SQLHDBC conn,
SQLUSMALLINT option,
SQLULEN value)
{
- LOG_MSG("SQLSetConnectOption called\n");
+ LOG_MSG("SQLSetConnectOption called");
return SQL_SUCCESS;
}
@@ -501,7 +503,7 @@ SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT stmt,
SQLUSMALLINT option,
SQLULEN value)
{
- LOG_MSG("SQLSetStmtOption called\n");
+ LOG_MSG("SQLSetStmtOption called");
return SQL_SUCCESS;
}
@@ -515,7 +517,7 @@ SQLRETURN SQL_API SQLStatistics(SQLHSTMT stmt,
SQLUSMALLINT unique,
SQLUSMALLINT reserved)
{
- LOG_MSG("SQLStatistics called\n");
+ LOG_MSG("SQLStatistics called");
return SQL_SUCCESS;
}
@@ -526,7 +528,7 @@ SQLRETURN SQL_API SQLBrowseConnect(SQLHDBC conn,
SQLSMALLINT outConnectionStrBufLen,
SQLSMALLINT* outConnectionStrResLen)
{
- LOG_MSG("SQLBrowseConnect called\n");
+ LOG_MSG("SQLBrowseConnect called");
return SQL_SUCCESS;
}
@@ -540,7 +542,7 @@ SQLRETURN SQL_API SQLProcedureColumns(SQLHSTMT stmt,
SQLCHAR * columnName,
SQLSMALLINT columnNameLen)
{
- LOG_MSG("SQLProcedureColumns called\n");
+ LOG_MSG("SQLProcedureColumns called");
return SQL_SUCCESS;
}
@@ -549,7 +551,7 @@ SQLRETURN SQL_API SQLSetPos(SQLHSTMT stmt,
SQLUSMALLINT operation,
SQLUSMALLINT lockType)
{
- LOG_MSG("SQLSetPos called\n");
+ LOG_MSG("SQLSetPos called");
return SQL_SUCCESS;
}
@@ -558,7 +560,7 @@ SQLRETURN SQL_API SQLSetScrollOptions(SQLHSTMT stmt,
SQLLEN crowKeyset,
SQLUSMALLINT crowRowset)
{
- LOG_MSG("SQLSetScrollOptions called\n");
+ LOG_MSG("SQLSetScrollOptions called");
return SQL_SUCCESS;
}
@@ -568,7 +570,7 @@ SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC conn,
SQLINTEGER valueBufLen,
SQLINTEGER* valueResLen)
{
- LOG_MSG("SQLGetConnectAttr called\n");
+ LOG_MSG("SQLGetConnectAttr called");
return SQL_SUCCESS;
}
@@ -577,14 +579,14 @@ SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC conn,
SQLPOINTER value,
SQLINTEGER valueLen)
{
- LOG_MSG("SQLSetConnectAttr called\n");
+ LOG_MSG("SQLSetConnectAttr called");
return SQL_SUCCESS;
}
SQLRETURN SQL_API SQLBulkOperations(SQLHSTMT stmt,
SQLUSMALLINT operation)
{
- LOG_MSG("SQLBulkOperations called\n");
+ LOG_MSG("SQLBulkOperations called");
return SQL_SUCCESS;
}
@@ -596,13 +598,13 @@ SQLRETURN SQL_API SQLTablePrivileges(SQLHSTMT stmt,
SQLCHAR* tableName,
SQLSMALLINT tableNameLen)
{
- LOG_MSG("SQLTablePrivileges called\n");
+ LOG_MSG("SQLTablePrivileges called");
return SQL_SUCCESS;
}
SQLRETURN SQL_API SQLCopyDesc(SQLHDESC src, SQLHDESC dst)
{
- LOG_MSG("SQLCopyDesc called\n");
+ LOG_MSG("SQLCopyDesc called");
return SQL_SUCCESS;
}
@@ -613,7 +615,7 @@ SQLRETURN SQL_API SQLGetDescField(SQLHDESC descr,
SQLINTEGER bufferLen,
SQLINTEGER* resLen)
{
- LOG_MSG("SQLGetDescField called\n");
+ LOG_MSG("SQLGetDescField called");
return SQL_SUCCESS;
}
@@ -629,7 +631,7 @@ SQLRETURN SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle,
SQLSMALLINT* scale,
SQLSMALLINT* nullable)
{
- LOG_MSG("SQLGetDescRec called\n");
+ LOG_MSG("SQLGetDescRec called");
return SQL_SUCCESS;
}
@@ -639,7 +641,7 @@ SQLRETURN SQL_API SQLSetDescField(SQLHDESC descr,
SQLPOINTER buffer,
SQLINTEGER bufferLen)
{
- LOG_MSG("SQLSetDescField called\n");
+ LOG_MSG("SQLSetDescField called");
return SQL_SUCCESS;
}
@@ -654,7 +656,7 @@ SQLRETURN SQL_API SQLSetDescRec(SQLHDESC descr,
SQLLEN* resLen,
SQLLEN* id)
{
- LOG_MSG("SQLSetDescRec called\n");
+ LOG_MSG("SQLSetDescRec called");
return SQL_SUCCESS;
}
@@ -668,7 +670,7 @@ SQLRETURN SQL_API SQLColumnPrivileges(SQLHSTMT stmt,
SQLCHAR* columnName,
SQLSMALLINT columnNameLen)
{
- LOG_MSG("SQLColumnPrivileges called\n");
+ LOG_MSG("SQLColumnPrivileges called");
return SQL_SUCCESS;
}
@@ -676,7 +678,7 @@ SQLRETURN SQL_API SQLParamOptions(SQLHSTMT stmt,
SQLULEN paramSetSize,
SQLULEN* paramsProcessed)
{
- LOG_MSG("SQLParamOptions called\n");
+ LOG_MSG("SQLParamOptions called");
return SQL_SUCCESS;
}
@@ -688,6 +690,6 @@ SQLRETURN SQL_API SQLProcedures(SQLHSTMT stmt,
SQLCHAR* tableName,
SQLSMALLINT tableNameLen)
{
- LOG_MSG("SQLProcedures called\n");
+ LOG_MSG("SQLProcedures called");
return SQL_SUCCESS;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/log.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/log.cpp b/modules/platforms/cpp/odbc/src/log.cpp
new file mode 100644
index 0000000..755798f
--- /dev/null
+++ b/modules/platforms/cpp/odbc/src/log.cpp
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ */
+
+#include <cstdlib>
+
+#include "ignite/odbc/log.h"
+
+namespace ignite
+{
+ namespace odbc
+ {
+ LogStream::LogStream(Logger* parent) :
+ std::basic_ostream<char>(0),
+ strbuf(),
+ logger(parent)
+ {
+ init(&strbuf);
+ }
+
+ bool LogStream::operator()()
+ {
+ return logger != 0;
+ }
+
+ LogStream::~LogStream()
+ {
+ if (logger)
+ {
+ logger->WriteMessage(strbuf.str());
+ }
+ }
+
+ Logger::Logger(const char* path) :
+ mutex(),
+ stream()
+ {
+ if (path)
+ {
+ stream.open(path);
+ }
+ }
+
+ Logger::~Logger()
+ {
+ }
+
+ bool Logger::IsEnabled() const
+ {
+ return stream.is_open();
+ }
+
+ void Logger::WriteMessage(std::string const& message)
+ {
+ if (IsEnabled())
+ {
+ ignite::common::concurrent::CsLockGuard guard(mutex);
+ stream << message << std::endl;
+ }
+ }
+
+ Logger* Logger::Get()
+ {
+ const char* envVarName = "IGNITE_ODBC_LOG_PATH";
+ static Logger logger(getenv(envVarName));
+ return logger.IsEnabled() ? &logger : 0;
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/meta/column_meta.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/meta/column_meta.cpp b/modules/platforms/cpp/odbc/src/meta/column_meta.cpp
index d397618..12dbfc1 100644
--- a/modules/platforms/cpp/odbc/src/meta/column_meta.cpp
+++ b/modules/platforms/cpp/odbc/src/meta/column_meta.cpp
@@ -27,8 +27,6 @@ namespace ignite
namespace meta
{
-#ifdef ODBC_DEBUG
-
#define DBG_STR_CASE(x) case x: return #x
const char* ColumnMeta::AttrIdToString(uint16_t id)
@@ -70,8 +68,6 @@ namespace ignite
#undef DBG_STR_CASE
-#endif
-
void ColumnMeta::Read(ignite::impl::binary::BinaryReaderImpl& reader)
{
utility::ReadString(reader, schemaName);
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/odbc.cpp b/modules/platforms/cpp/odbc/src/odbc.cpp
index fd69c0d..542e64c 100644
--- a/modules/platforms/cpp/odbc/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/src/odbc.cpp
@@ -20,6 +20,7 @@
#include <cstring>
#include <algorithm>
+#include "ignite/odbc/log.h"
#include "ignite/odbc/utility.h"
#include "ignite/odbc/system/odbc_constants.h"
@@ -43,9 +44,10 @@ namespace ignite
using odbc::Connection;
using odbc::config::ConnectionInfo;
- LOG_MSG("SQLGetInfo called: %d (%s), %p, %d, %p\n",
- infoType, ConnectionInfo::InfoTypeToString(infoType),
- infoValue, infoValueMax, length);
+ LOG_MSG("SQLGetInfo called: "
+ << infoType << " (" << ConnectionInfo::InfoTypeToString(infoType) << "), "
+ << std::hex << reinterpret_cast<size_t>(infoValue) << ", " << infoValueMax << ", "
+ << std::hex << reinterpret_cast<size_t>(length));
Connection *connection = reinterpret_cast<Connection*>(conn);
@@ -59,7 +61,7 @@ namespace ignite
SQLRETURN SQLAllocHandle(SQLSMALLINT type, SQLHANDLE parent, SQLHANDLE* result)
{
- //LOG_MSG("SQLAllocHandle called\n");
+ //LOG_MSG("SQLAllocHandle called");
switch (type)
{
case SQL_HANDLE_ENV:
@@ -101,7 +103,7 @@ namespace ignite
{
using odbc::Environment;
- LOG_MSG("SQLAllocEnv called\n");
+ LOG_MSG("SQLAllocEnv called");
*env = reinterpret_cast<SQLHENV>(new Environment());
@@ -113,7 +115,7 @@ namespace ignite
using odbc::Environment;
using odbc::Connection;
- LOG_MSG("SQLAllocConnect called\n");
+ LOG_MSG("SQLAllocConnect called");
*conn = SQL_NULL_HDBC;
@@ -137,7 +139,7 @@ namespace ignite
using odbc::Connection;
using odbc::Statement;
- LOG_MSG("SQLAllocStmt called\n");
+ LOG_MSG("SQLAllocStmt called");
*stmt = SQL_NULL_HDBC;
@@ -178,7 +180,7 @@ namespace ignite
{
using odbc::Environment;
- LOG_MSG("SQLFreeEnv called\n");
+ LOG_MSG("SQLFreeEnv called");
Environment *environment = reinterpret_cast<Environment*>(env);
@@ -194,7 +196,7 @@ namespace ignite
{
using odbc::Connection;
- LOG_MSG("SQLFreeConnect called\n");
+ LOG_MSG("SQLFreeConnect called");
Connection *connection = reinterpret_cast<Connection*>(conn);
@@ -210,7 +212,7 @@ namespace ignite
{
using odbc::Statement;
- LOG_MSG("SQLFreeStmt called\n");
+ LOG_MSG("SQLFreeStmt called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -232,7 +234,7 @@ namespace ignite
{
using odbc::Statement;
- LOG_MSG("SQLCloseCursor called\n");
+ LOG_MSG("SQLCloseCursor called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -257,8 +259,9 @@ namespace ignite
UNREFERENCED_PARAMETER(windowHandle);
- LOG_MSG("SQLDriverConnect called\n");
- LOG_MSG("Connection String: [%s]\n", inConnectionString);
+ LOG_MSG("SQLDriverConnect called");
+ if (inConnectionString)
+ LOG_MSG("Connection String: [" << inConnectionString << "]");
Connection *connection = reinterpret_cast<Connection*>(conn);
@@ -290,7 +293,8 @@ namespace ignite
if (outConnectionStringLen)
*outConnectionStringLen = static_cast<SQLSMALLINT>(reslen);
- LOG_MSG("%s\n", outConnectionString);
+ if (outConnectionString)
+ LOG_MSG(outConnectionString);
return diag.GetReturnCode();
}
@@ -318,7 +322,7 @@ namespace ignite
std::string dsn = SqlStringToString(serverName, serverNameLen);
- LOG_MSG("DSN: %s\n", dsn.c_str());
+ LOG_MSG("DSN: " << dsn);
odbc::ReadDsnConfiguration(dsn.c_str(), config);
@@ -331,7 +335,7 @@ namespace ignite
{
using odbc::Connection;
- LOG_MSG("SQLDisconnect called\n");
+ LOG_MSG("SQLDisconnect called");
Connection *connection = reinterpret_cast<Connection*>(conn);
@@ -348,7 +352,7 @@ namespace ignite
using odbc::Statement;
using utility::SqlStringToString;
- LOG_MSG("SQLPrepare called\n");
+ LOG_MSG("SQLPrepare called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -357,7 +361,7 @@ namespace ignite
std::string sql = SqlStringToString(query, queryLen);
- LOG_MSG("SQL: %s\n", sql.c_str());
+ LOG_MSG("SQL: " << sql);
statement->PrepareSqlQuery(sql);
@@ -368,7 +372,7 @@ namespace ignite
{
using odbc::Statement;
- LOG_MSG("SQLExecute called\n");
+ LOG_MSG("SQLExecute called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -385,7 +389,7 @@ namespace ignite
using odbc::Statement;
using utility::SqlStringToString;
- LOG_MSG("SQLExecDirect called\n");
+ LOG_MSG("SQLExecDirect called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -394,7 +398,7 @@ namespace ignite
std::string sql = SqlStringToString(query, queryLen);
- LOG_MSG("SQL: %s\n", sql.c_str());
+ LOG_MSG("SQL: " << sql);
statement->ExecuteSqlQuery(sql);
@@ -413,7 +417,10 @@ namespace ignite
using odbc::Statement;
using odbc::app::ApplicationDataBuffer;
- LOG_MSG("SQLBindCol called: index=%d, type=%d targetValue=%p bufferLength=%d\n", colNum, targetType, targetValue, bufferLength);
+ LOG_MSG("SQLBindCol called: index=" << colNum << ", type=" << targetType <<
+ ", targetValue=" << reinterpret_cast<size_t>(targetValue) <<
+ ", bufferLength=" << bufferLength <<
+ ", lengthInd=" << reinterpret_cast<size_t>(strLengthOrIndicator));
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -429,7 +436,7 @@ namespace ignite
{
using odbc::Statement;
- LOG_MSG("SQLFetch called\n");
+ LOG_MSG("SQLFetch called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -445,8 +452,8 @@ namespace ignite
{
using odbc::Statement;
- LOG_MSG("SQLFetchScroll called\n");
- LOG_MSG("Orientation: %d, Offset: %d\n", orientation, offset);
+ LOG_MSG("SQLFetchScroll called");
+ LOG_MSG("Orientation: " << orientation << " Offset: " << offset);
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -464,7 +471,7 @@ namespace ignite
SQLULEN* rowCount,
SQLUSMALLINT* rowStatusArray)
{
- LOG_MSG("SQLExtendedFetch called\n");
+ LOG_MSG("SQLExtendedFetch called");
SQLRETURN res = SQLFetchScroll(stmt, orientation, offset);
@@ -487,7 +494,7 @@ namespace ignite
using odbc::Statement;
using odbc::meta::ColumnMetaVector;
- LOG_MSG("SQLNumResultCols called\n");
+ LOG_MSG("SQLNumResultCols called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -499,7 +506,7 @@ namespace ignite
if (columnNum)
{
*columnNum = static_cast<SQLSMALLINT>(res);
- LOG_MSG("columnNum: %d\n", *columnNum);
+ LOG_MSG("columnNum: " << *columnNum);
}
return statement->GetDiagnosticRecords().GetReturnCode();
@@ -518,7 +525,7 @@ namespace ignite
using odbc::Statement;
using utility::SqlStringToString;
- LOG_MSG("SQLTables called\n");
+ LOG_MSG("SQLTables called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -530,10 +537,10 @@ namespace ignite
std::string table = SqlStringToString(tableName, tableNameLen);
std::string tableTypeStr = SqlStringToString(tableType, tableTypeLen);
- LOG_MSG("catalog: %s\n", catalog.c_str());
- LOG_MSG("schema: %s\n", schema.c_str());
- LOG_MSG("table: %s\n", table.c_str());
- LOG_MSG("tableType: %s\n", tableTypeStr.c_str());
+ LOG_MSG("catalog: " << catalog);
+ LOG_MSG("schema: " << schema);
+ LOG_MSG("table: " << table);
+ LOG_MSG("tableType: " << tableTypeStr);
statement->ExecuteGetTablesMetaQuery(catalog, schema, table, tableTypeStr);
@@ -553,7 +560,7 @@ namespace ignite
using odbc::Statement;
using utility::SqlStringToString;
- LOG_MSG("SQLColumns called\n");
+ LOG_MSG("SQLColumns called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -565,10 +572,10 @@ namespace ignite
std::string table = SqlStringToString(tableName, tableNameLen);
std::string column = SqlStringToString(columnName, columnNameLen);
- LOG_MSG("catalog: %s\n", catalog.c_str());
- LOG_MSG("schema: %s\n", schema.c_str());
- LOG_MSG("table: %s\n", table.c_str());
- LOG_MSG("column: %s\n", column.c_str());
+ LOG_MSG("catalog: " << catalog);
+ LOG_MSG("schema: " << schema);
+ LOG_MSG("table: " << table);
+ LOG_MSG("column: " << column);
statement->ExecuteGetColumnsMetaQuery(schema, table, column);
@@ -579,7 +586,7 @@ namespace ignite
{
using odbc::Statement;
- LOG_MSG("SQLMoreResults called\n");
+ LOG_MSG("SQLMoreResults called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -604,7 +611,7 @@ namespace ignite
{
using odbc::Statement;
- LOG_MSG("SQLBindParameter called: %d, %d, %d\n", paramIdx, bufferType, paramSqlType);
+ LOG_MSG("SQLBindParameter called: " << paramIdx << ", " << bufferType << ", " << paramSqlType);
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -625,7 +632,7 @@ namespace ignite
{
using namespace utility;
- LOG_MSG("SQLNativeSql called\n");
+ LOG_MSG("SQLNativeSql called");
std::string in = SqlStringToString(inQuery, inQueryLen);
@@ -650,7 +657,7 @@ namespace ignite
using odbc::meta::ColumnMetaVector;
using odbc::meta::ColumnMeta;
- LOG_MSG("SQLColAttribute called: %d (%s)\n", fieldId, ColumnMeta::AttrIdToString(fieldId));
+ LOG_MSG("SQLColAttribute called: " << fieldId << " (" << ColumnMeta::AttrIdToString(fieldId) << ")");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -689,7 +696,7 @@ namespace ignite
using odbc::Statement;
using odbc::SqlLen;
- LOG_MSG("SQLDescribeCol called\n");
+ LOG_MSG("SQLDescribeCol called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -709,13 +716,13 @@ namespace ignite
statement->GetColumnAttribute(columnNum, SQL_DESC_SCALE, 0, 0, 0, &decimalDigitsRes);
statement->GetColumnAttribute(columnNum, SQL_DESC_NULLABLE, 0, 0, 0, &nullableRes);
- LOG_MSG("columnNum: %lld\n", columnNum);
- LOG_MSG("dataTypeRes: %lld\n", dataTypeRes);
- LOG_MSG("columnSizeRes: %lld\n", columnSizeRes);
- LOG_MSG("decimalDigitsRes: %lld\n", decimalDigitsRes);
- LOG_MSG("nullableRes: %lld\n", nullableRes);
- LOG_MSG("columnNameBuf: %s\n", columnNameBuf ? reinterpret_cast<const char*>(columnNameBuf) : "<null>");
- LOG_MSG("columnNameLen: %d\n", columnNameLen ? *columnNameLen : -1);
+ LOG_MSG("columnNum: " << columnNum);
+ LOG_MSG("dataTypeRes: " << dataTypeRes);
+ LOG_MSG("columnSizeRes: " << columnSizeRes);
+ LOG_MSG("decimalDigitsRes: " << decimalDigitsRes);
+ LOG_MSG("nullableRes: " << nullableRes);
+ LOG_MSG("columnNameBuf: " << (columnNameBuf ? reinterpret_cast<const char*>(columnNameBuf) : "<null>"));
+ LOG_MSG("columnNameLen: " << (columnNameLen ? *columnNameLen : -1));
if (dataType)
*dataType = static_cast<SQLSMALLINT>(dataTypeRes);
@@ -737,7 +744,7 @@ namespace ignite
{
using odbc::Statement;
- LOG_MSG("SQLRowCount called\n");
+ LOG_MSG("SQLRowCount called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -769,7 +776,7 @@ namespace ignite
using odbc::Statement;
using utility::SqlStringToString;
- LOG_MSG("SQLForeignKeys called\n");
+ LOG_MSG("SQLForeignKeys called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -783,12 +790,12 @@ namespace ignite
std::string foreignSchema = SqlStringToString(foreignSchemaName, foreignSchemaNameLen);
std::string foreignTable = SqlStringToString(foreignTableName, foreignTableNameLen);
- LOG_MSG("primaryCatalog: %s\n", primaryCatalog.c_str());
- LOG_MSG("primarySchema: %s\n", primarySchema.c_str());
- LOG_MSG("primaryTable: %s\n", primaryTable.c_str());
- LOG_MSG("foreignCatalog: %s\n", foreignCatalog.c_str());
- LOG_MSG("foreignSchema: %s\n", foreignSchema.c_str());
- LOG_MSG("foreignTable: %s\n", foreignTable.c_str());
+ LOG_MSG("primaryCatalog: " << primaryCatalog);
+ LOG_MSG("primarySchema: " << primarySchema);
+ LOG_MSG("primaryTable: " << primaryTable);
+ LOG_MSG("foreignCatalog: " << foreignCatalog);
+ LOG_MSG("foreignSchema: " << foreignSchema);
+ LOG_MSG("foreignTable: " << foreignTable);
statement->ExecuteGetForeignKeysQuery(primaryCatalog, primarySchema,
primaryTable, foreignCatalog, foreignSchema, foreignTable);
@@ -809,7 +816,7 @@ namespace ignite
#ifdef ODBC_DEBUG
using odbc::type_traits::StatementAttrIdToString;
- LOG_MSG("Attr: %s (%d)\n", StatementAttrIdToString(attr), attr);
+ LOG_MSG("Attr: " << StatementAttrIdToString(attr) << " (" << attr << ")");
#endif //ODBC_DEBUG
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -834,7 +841,7 @@ namespace ignite
#ifdef ODBC_DEBUG
using odbc::type_traits::StatementAttrIdToString;
- LOG_MSG("Attr: %s (%d)\n", StatementAttrIdToString(attr), attr);
+ LOG_MSG("Attr: " << StatementAttrIdToString(attr) << " (" << attr << ")");
#endif //ODBC_DEBUG
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -858,7 +865,7 @@ namespace ignite
using odbc::Statement;
using utility::SqlStringToString;
- LOG_MSG("SQLPrimaryKeys called\n");
+ LOG_MSG("SQLPrimaryKeys called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -869,9 +876,9 @@ namespace ignite
std::string schema = SqlStringToString(schemaName, schemaNameLen);
std::string table = SqlStringToString(tableName, tableNameLen);
- LOG_MSG("catalog: %s\n", catalog.c_str());
- LOG_MSG("schema: %s\n", schema.c_str());
- LOG_MSG("table: %s\n", table.c_str());
+ LOG_MSG("catalog: " << catalog);
+ LOG_MSG("schema: " << schema);
+ LOG_MSG("table: " << table);
statement->ExecuteGetPrimaryKeysQuery(catalog, schema, table);
@@ -882,7 +889,7 @@ namespace ignite
{
using odbc::Statement;
- LOG_MSG("SQLNumParams called\n");
+ LOG_MSG("SQLNumParams called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -909,7 +916,7 @@ namespace ignite
using odbc::app::ApplicationDataBuffer;
- LOG_MSG("SQLGetDiagField called: %d\n", recNum);
+ LOG_MSG("SQLGetDiagField called: " << recNum);
SqlLen outResLen;
ApplicationDataBuffer outBuffer(IGNITE_ODBC_C_TYPE_DEFAULT, buffer, bufferLen, &outResLen);
@@ -960,7 +967,7 @@ namespace ignite
using odbc::app::ApplicationDataBuffer;
- LOG_MSG("SQLGetDiagRec called\n");
+ LOG_MSG("SQLGetDiagRec called");
const DiagnosticRecordStorage* records = 0;
@@ -1007,7 +1014,7 @@ namespace ignite
{
using odbc::Statement;
- LOG_MSG("SQLGetTypeInfo called\n");
+ LOG_MSG("SQLGetTypeInfo called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -1023,7 +1030,7 @@ namespace ignite
{
using namespace odbc;
- LOG_MSG("SQLEndTran called\n");
+ LOG_MSG("SQLEndTran called");
SQLRETURN result;
@@ -1086,7 +1093,7 @@ namespace ignite
using odbc::Statement;
using odbc::app::ApplicationDataBuffer;
- LOG_MSG("SQLGetData called\n");
+ LOG_MSG("SQLGetData called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -1109,7 +1116,7 @@ namespace ignite
{
using odbc::Environment;
- LOG_MSG("SQLSetEnvAttr called\n");
+ LOG_MSG("SQLSetEnvAttr called");
Environment *environment = reinterpret_cast<Environment*>(env);
@@ -1132,7 +1139,7 @@ namespace ignite
using odbc::app::ApplicationDataBuffer;
- LOG_MSG("SQLGetEnvAttr called\n");
+ LOG_MSG("SQLGetEnvAttr called");
Environment *environment = reinterpret_cast<Environment*>(env);
@@ -1166,7 +1173,7 @@ namespace ignite
using utility::SqlStringToString;
- LOG_MSG("SQLSpecialColumns called\n");
+ LOG_MSG("SQLSpecialColumns called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -1177,9 +1184,9 @@ namespace ignite
std::string schema = SqlStringToString(schemaName, schemaNameLen);
std::string table = SqlStringToString(tableName, tableNameLen);
- LOG_MSG("catalog: %s\n", catalog.c_str());
- LOG_MSG("schema: %s\n", schema.c_str());
- LOG_MSG("table: %s\n", table.c_str());
+ LOG_MSG("catalog: " << catalog);
+ LOG_MSG("schema: " << schema);
+ LOG_MSG("table: " << table);
statement->ExecuteSpecialColumnsQuery(idType, catalog, schema, table, scope, nullable);
@@ -1190,7 +1197,7 @@ namespace ignite
{
using namespace ignite::odbc;
- LOG_MSG("SQLParamData called\n");
+ LOG_MSG("SQLParamData called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -1206,7 +1213,7 @@ namespace ignite
{
using namespace ignite::odbc;
- LOG_MSG("SQLPutData called\n");
+ LOG_MSG("SQLPutData called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -1227,7 +1234,7 @@ namespace ignite
{
using namespace ignite::odbc;
- LOG_MSG("SQLDescribeParam called\n");
+ LOG_MSG("SQLDescribeParam called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
@@ -1255,7 +1262,7 @@ namespace ignite
using ignite::odbc::app::ApplicationDataBuffer;
- LOG_MSG("SQLError called\n");
+ LOG_MSG("SQLError called");
SQLHANDLE handle = 0;
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp b/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp
index 1cd2a9f..9aa5f7d 100644
--- a/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/src/query/column_metadata_query.cpp
@@ -20,6 +20,7 @@
#include "ignite/odbc/type_traits.h"
#include "ignite/odbc/connection.h"
#include "ignite/odbc/message.h"
+#include "ignite/odbc/log.h"
#include "ignite/odbc/query/column_metadata_query.h"
namespace
@@ -292,8 +293,7 @@ namespace ignite
if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
{
- LOG_MSG("Error: %s\n", rsp.GetError().c_str());
-
+ LOG_MSG("Error: " << rsp.GetError());
diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
return SQL_RESULT_ERROR;
@@ -303,11 +303,10 @@ namespace ignite
for (size_t i = 0; i < meta.size(); ++i)
{
- LOG_MSG("[%d] SchemaName: %s\n", i, meta[i].GetSchemaName().c_str());
- LOG_MSG("[%d] TableName: %s\n", i, meta[i].GetTableName().c_str());
- LOG_MSG("[%d] ColumnName: %s\n", i, meta[i].GetColumnName().c_str());
- LOG_MSG("[%d] ColumnType: %d\n", i, meta[i].GetDataType());
- LOG_MSG("\n");
+ LOG_MSG("\n[" << i << "] SchemaName: " << meta[i].GetSchemaName()
+ << "\n[" << i << "] TableName: " << meta[i].GetTableName()
+ << "\n[" << i << "] ColumnName: " << meta[i].GetColumnName()
+ << "\n[" << i << "] ColumnType: " << meta[i].GetDataType());
}
return SQL_RESULT_SUCCESS;
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/query/data_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/query/data_query.cpp b/modules/platforms/cpp/odbc/src/query/data_query.cpp
index 5b1b758..c9762ad 100644
--- a/modules/platforms/cpp/odbc/src/query/data_query.cpp
+++ b/modules/platforms/cpp/odbc/src/query/data_query.cpp
@@ -17,6 +17,7 @@
#include "ignite/odbc/connection.h"
#include "ignite/odbc/message.h"
+#include "ignite/odbc/log.h"
#include "ignite/odbc/query/data_query.h"
namespace ignite
@@ -40,7 +41,7 @@ namespace ignite
{
Close();
}
-
+
SqlResult DataQuery::Execute()
{
if (cursor.get())
@@ -186,7 +187,7 @@ namespace ignite
if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
{
- LOG_MSG("Error: %s\n", rsp.GetError().c_str());
+ LOG_MSG("Error: " << rsp.GetError());
diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
@@ -197,15 +198,13 @@ namespace ignite
resultMeta.assign(rsp.GetMeta().begin(), rsp.GetMeta().end());
- LOG_MSG("Query id: %lld\n", cursor->GetQueryId());
-
+ LOG_MSG("Query id: " << cursor->GetQueryId());
for (size_t i = 0; i < rsp.GetMeta().size(); ++i)
{
- LOG_MSG("[%d] SchemaName: %s\n", i, rsp.GetMeta()[i].GetSchemaName().c_str());
- LOG_MSG("[%d] TypeName: %s\n", i, rsp.GetMeta()[i].GetTableName().c_str());
- LOG_MSG("[%d] ColumnName: %s\n", i, rsp.GetMeta()[i].GetColumnName().c_str());
- LOG_MSG("[%d] ColumnType: %d\n", i, rsp.GetMeta()[i].GetDataType());
- LOG_MSG("\n");
+ LOG_MSG("\n[" << i << "] SchemaName: " << rsp.GetMeta()[i].GetSchemaName()
+ << "\n[" << i << "] TypeName: " << rsp.GetMeta()[i].GetTableName()
+ << "\n[" << i << "] ColumnName: " << rsp.GetMeta()[i].GetColumnName()
+ << "\n[" << i << "] ColumnType: " << rsp.GetMeta()[i].GetDataType());
}
return SQL_RESULT_SUCCESS;
@@ -227,11 +226,11 @@ namespace ignite
return SQL_RESULT_ERROR;
}
- LOG_MSG("Query id: %lld\n", rsp.GetQueryId());
+ LOG_MSG("Query id: " << rsp.GetQueryId());
if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
{
- LOG_MSG("Error: %s\n", rsp.GetError().c_str());
+ LOG_MSG("Error: " << rsp.GetError());
diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
@@ -261,7 +260,7 @@ namespace ignite
if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
{
- LOG_MSG("Error: %s\n", rsp.GetError().c_str());
+ LOG_MSG("Error: " << rsp.GetError());
diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp b/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp
index 3cddd1b..4fd5f7b 100644
--- a/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/src/query/table_metadata_query.cpp
@@ -20,6 +20,7 @@
#include "ignite/odbc/type_traits.h"
#include "ignite/odbc/connection.h"
#include "ignite/odbc/message.h"
+#include "ignite/odbc/log.h"
#include "ignite/odbc/query/table_metadata_query.h"
namespace
@@ -218,7 +219,7 @@ namespace ignite
if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
{
- LOG_MSG("Error: %s\n", rsp.GetError().c_str());
+ LOG_MSG("Error: " << rsp.GetError());
diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
@@ -229,11 +230,10 @@ namespace ignite
for (size_t i = 0; i < meta.size(); ++i)
{
- LOG_MSG("[%d] CatalogName: %s\n", i, meta[i].GetCatalogName().c_str());
- LOG_MSG("[%d] SchemaName: %s\n", i, meta[i].GetSchemaName().c_str());
- LOG_MSG("[%d] TableName: %s\n", i, meta[i].GetTableName().c_str());
- LOG_MSG("[%d] TableType: %s\n", i, meta[i].GetTableType().c_str());
- LOG_MSG("\n");
+ LOG_MSG("\n[" << i << "] CatalogName: " << meta[i].GetCatalogName()
+ << "\n[" << i << "] SchemaName: " << meta[i].GetSchemaName()
+ << "\n[" << i << "] TableName: " << meta[i].GetTableName()
+ << "\n[" << i << "] TableType: " << meta[i].GetTableType());
}
return SQL_RESULT_SUCCESS;
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/statement.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/statement.cpp b/modules/platforms/cpp/odbc/src/statement.cpp
index 09ad81c..2395d66 100644
--- a/modules/platforms/cpp/odbc/src/statement.cpp
+++ b/modules/platforms/cpp/odbc/src/statement.cpp
@@ -27,6 +27,7 @@
#include "ignite/odbc/utility.h"
#include "ignite/odbc/message.h"
#include "ignite/odbc/statement.h"
+#include "ignite/odbc/log.h"
namespace ignite
{
@@ -232,7 +233,7 @@ namespace ignite
{
SQLULEN val = reinterpret_cast<SQLULEN>(value);
- LOG_MSG("SQL_ATTR_ROW_ARRAY_SIZE: %d\n", val);
+ LOG_MSG("SQL_ATTR_ROW_ARRAY_SIZE: " << val);
if (val != 1)
{
@@ -986,7 +987,7 @@ namespace ignite
if (paramNum > 0 && static_cast<size_t>(paramNum) <= paramTypes.size())
type = paramTypes[paramNum - 1];
- LOG_MSG("Type: %d\n", type);
+ LOG_MSG("Type: " << type);
if (!type)
{
@@ -1044,7 +1045,7 @@ namespace ignite
if (rsp.GetStatus() != RESPONSE_STATUS_SUCCESS)
{
- LOG_MSG("Error: %s\n", rsp.GetError().c_str());
+ LOG_MSG("Error: " << rsp.GetError());
AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, rsp.GetError());
@@ -1054,7 +1055,9 @@ namespace ignite
paramTypes = rsp.GetTypeIds();
for (size_t i = 0; i < paramTypes.size(); ++i)
- LOG_MSG("[%zu] Parameter type: %u\n", i, paramTypes[i]);
+ {
+ LOG_MSG("[" << i << "] Parameter type: " << paramTypes[i]);
+ }
return SQL_RESULT_SUCCESS;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/825fe9cd/modules/platforms/cpp/odbc/src/utility.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/utility.cpp b/modules/platforms/cpp/odbc/src/utility.cpp
index c15c23c..63454dc 100644
--- a/modules/platforms/cpp/odbc/src/utility.cpp
+++ b/modules/platforms/cpp/odbc/src/utility.cpp
@@ -22,20 +22,6 @@
#include "ignite/odbc/utility.h"
#include "ignite/odbc/system/odbc_constants.h"
-#ifdef ODBC_DEBUG
-
-FILE* log_file = NULL;
-
-void logInit(const char* path)
-{
- if (!log_file)
- {
- log_file = fopen(path, "w");
- }
-}
-
-#endif //ODBC_DEBUG
-
namespace ignite
{
namespace utility
@@ -155,11 +141,11 @@ namespace ignite
res.clear();
}
- std::string HexDump(const char* data, size_t count)
+ std::string HexDump(const void* data, size_t count)
{
std::stringstream dump;
size_t cnt = 0;
- for(const char* p = data, *e = data + count; p != e; ++p)
+ for(const uint8_t* p = (const uint8_t*)data, *e = (const uint8_t*)data + count; p != e; ++p)
{
if (cnt++ % 16 == 0)
{
[43/50] [abbrv] ignite git commit: IGNITE-4424 REPLICATED cache isn't
synced across nodes
Posted by ag...@apache.org.
IGNITE-4424 REPLICATED cache isn't synced across nodes
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/82dd9128
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/82dd9128
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/82dd9128
Branch: refs/heads/ignite-3477
Commit: 82dd912889b0dfca213edb1374c1fa0ed79411fd
Parents: 27ba69b
Author: Anton Vinogradov <av...@apache.org>
Authored: Fri Dec 30 13:41:34 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Jan 16 12:18:14 2017 +0300
----------------------------------------------------------------------
.../GridNearAtomicAbstractUpdateFuture.java | 34 ++-
.../GridNearAtomicSingleUpdateFuture.java | 44 ++--
.../dht/atomic/GridNearAtomicUpdateFuture.java | 57 ++---
.../AtomicPutAllChangingTopologyTest.java | 212 +++++++++++++++++++
.../IgniteCacheFailoverTestSuite.java | 3 +
5 files changed, 284 insertions(+), 66 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/82dd9128/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
index 2fbabaa..c92e0f5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
@@ -212,14 +212,18 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
// Cannot remap.
remapCnt = 1;
- map(topVer);
+ GridCacheVersion futVer = addAtomicFuture(topVer);
+
+ if (futVer != null)
+ map(topVer, futVer);
}
}
/**
* @param topVer Topology version.
+ * @param futVer Future version
*/
- protected abstract void map(AffinityTopologyVersion topVer);
+ protected abstract void map(AffinityTopologyVersion topVer, GridCacheVersion futVer);
/**
* Maps future on ready topology.
@@ -302,7 +306,7 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
* @param req Request.
* @param e Error.
*/
- protected void onSendError(GridNearAtomicAbstractUpdateRequest req, IgniteCheckedException e) {
+ protected final void onSendError(GridNearAtomicAbstractUpdateRequest req, IgniteCheckedException e) {
synchronized (mux) {
GridNearAtomicUpdateResponse res = new GridNearAtomicUpdateResponse(cctx.cacheId(),
req.nodeId(),
@@ -314,4 +318,28 @@ public abstract class GridNearAtomicAbstractUpdateFuture extends GridFutureAdapt
onResult(req.nodeId(), res, true);
}
}
+
+ /**
+ * Adds future prevents topology change before operation complete.
+ * Should be invoked before topology lock released.
+ *
+ * @param topVer Topology version.
+ * @return Future version in case future added.
+ */
+ protected final GridCacheVersion addAtomicFuture(AffinityTopologyVersion topVer) {
+ GridCacheVersion futVer = cctx.versions().next(topVer);
+
+ synchronized (mux) {
+ assert this.futVer == null : this;
+ assert this.topVer == AffinityTopologyVersion.ZERO : this;
+
+ this.topVer = topVer;
+ this.futVer = futVer;
+ }
+
+ if (storeFuture() && !cctx.mvcc().addAtomicFuture(futVer, this))
+ return null;
+
+ return futVer;
+ }
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/82dd9128/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
index bd231cf..7376aff 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
@@ -348,14 +348,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
@Override public void apply(final IgniteInternalFuture<AffinityTopologyVersion> fut) {
cctx.kernalContext().closure().runLocalSafe(new Runnable() {
@Override public void run() {
- try {
- AffinityTopologyVersion topVer = fut.get();
-
- map(topVer);
- }
- catch (IgniteCheckedException e) {
- onDone(e);
- }
+ mapOnTopology();
}
});
}
@@ -388,7 +381,9 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
@Override protected void mapOnTopology() {
cache.topology().readLock();
- AffinityTopologyVersion topVer = null;
+ AffinityTopologyVersion topVer;
+
+ GridCacheVersion futVer;
try {
if (cache.topology().stopping()) {
@@ -410,6 +405,8 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
}
topVer = fut.topologyVersion();
+
+ futVer = addAtomicFuture(topVer);
}
else {
if (waitTopFut) {
@@ -435,11 +432,12 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
cache.topology().readUnlock();
}
- map(topVer);
+ if (futVer != null)
+ map(topVer, futVer);
}
/** {@inheritDoc} */
- protected void map(AffinityTopologyVersion topVer) {
+ @Override protected void map(AffinityTopologyVersion topVer, GridCacheVersion futVer) {
Collection<ClusterNode> topNodes = CU.affinityNodes(cctx, topVer);
if (F.isEmpty(topNodes)) {
@@ -449,11 +447,6 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
return;
}
- Exception err = null;
- GridNearAtomicAbstractUpdateRequest singleReq0 = null;
-
- GridCacheVersion futVer = cctx.versions().next(topVer);
-
GridCacheVersion updVer;
// Assign version on near node in CLOCK ordering mode even if fastMap is false.
@@ -470,16 +463,17 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
else
updVer = null;
+ Exception err = null;
+ GridNearAtomicAbstractUpdateRequest singleReq0 = null;
+
try {
singleReq0 = mapSingleUpdate(topVer, futVer, updVer);
synchronized (mux) {
- assert this.futVer == null : this;
- assert this.topVer == AffinityTopologyVersion.ZERO : this;
+ assert this.futVer == futVer || (this.isDone() && this.error() != null);
+ assert this.topVer == topVer;
- this.topVer = topVer;
this.updVer = updVer;
- this.futVer = futVer;
resCnt = 0;
@@ -496,14 +490,6 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
return;
}
- if (storeFuture()) {
- if (!cctx.mvcc().addAtomicFuture(futVer, this)) {
- assert isDone() : this;
-
- return;
- }
- }
-
// Optimize mapping for single key.
mapSingle(singleReq0.nodeId(), singleReq0);
}
@@ -511,7 +497,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
/**
* @return Future version.
*/
- GridCacheVersion onFutureDone() {
+ private GridCacheVersion onFutureDone() {
GridCacheVersion ver0;
GridFutureAdapter<Void> fut0;
http://git-wip-us.apache.org/repos/asf/ignite/blob/82dd9128/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index cd64117..950e5bd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -456,14 +456,7 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
@Override public void apply(final IgniteInternalFuture<AffinityTopologyVersion> fut) {
cctx.kernalContext().closure().runLocalSafe(new Runnable() {
@Override public void run() {
- try {
- AffinityTopologyVersion topVer = fut.get();
-
- map(topVer, remapKeys);
- }
- catch (IgniteCheckedException e) {
- onDone(e);
- }
+ mapOnTopology();
}
});
}
@@ -497,7 +490,9 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
@Override protected void mapOnTopology() {
cache.topology().readLock();
- AffinityTopologyVersion topVer = null;
+ AffinityTopologyVersion topVer;
+
+ GridCacheVersion futVer;
try {
if (cache.topology().stopping()) {
@@ -519,6 +514,8 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
}
topVer = fut.topologyVersion();
+
+ futVer = addAtomicFuture(topVer);
}
else {
if (waitTopFut) {
@@ -544,7 +541,8 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
cache.topology().readUnlock();
}
- map(topVer, null);
+ if (futVer != null)
+ map(topVer, futVer, remapKeys);
}
/**
@@ -602,15 +600,18 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
}
/** {@inheritDoc} */
- protected void map(AffinityTopologyVersion topVer) {
- map(topVer, null);
+ @Override protected void map(AffinityTopologyVersion topVer, GridCacheVersion futVer) {
+ map(topVer, futVer, null);
}
/**
* @param topVer Topology version.
+ * @param futVer Future ID.
* @param remapKeys Keys to remap.
*/
- void map(AffinityTopologyVersion topVer, @Nullable Collection<KeyCacheObject> remapKeys) {
+ void map(AffinityTopologyVersion topVer,
+ GridCacheVersion futVer,
+ @Nullable Collection<KeyCacheObject> remapKeys) {
Collection<ClusterNode> topNodes = CU.affinityNodes(cctx, topVer);
if (F.isEmpty(topNodes)) {
@@ -620,14 +621,6 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
return;
}
- Exception err = null;
- GridNearAtomicFullUpdateRequest singleReq0 = null;
- Map<UUID, GridNearAtomicFullUpdateRequest> mappings0 = null;
-
- int size = keys.size();
-
- GridCacheVersion futVer = cctx.versions().next(topVer);
-
GridCacheVersion updVer;
// Assign version on near node in CLOCK ordering mode even if fastMap is false.
@@ -644,6 +637,12 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
else
updVer = null;
+ Exception err = null;
+ GridNearAtomicFullUpdateRequest singleReq0 = null;
+ Map<UUID, GridNearAtomicFullUpdateRequest> mappings0 = null;
+
+ int size = keys.size();
+
try {
if (size == 1 && !fastMap) {
assert remapKeys == null || remapKeys.size() == 1;
@@ -676,12 +675,10 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
}
synchronized (mux) {
- assert this.futVer == null : this;
- assert this.topVer == AffinityTopologyVersion.ZERO : this;
+ assert this.futVer == futVer || (this.isDone() && this.error() != null);
+ assert this.topVer == topVer;
- this.topVer = topVer;
this.updVer = updVer;
- this.futVer = futVer;
resCnt = 0;
@@ -701,14 +698,6 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
return;
}
- if (storeFuture()) {
- if (!cctx.mvcc().addAtomicFuture(futVer, this)) {
- assert isDone() : this;
-
- return;
- }
- }
-
// Optimize mapping for single key.
if (singleReq0 != null)
mapSingle(singleReq0.nodeId(), singleReq0);
@@ -725,7 +714,7 @@ public class GridNearAtomicUpdateFuture extends GridNearAtomicAbstractUpdateFutu
/**
* @return Future version.
*/
- GridCacheVersion onFutureDone() {
+ private GridCacheVersion onFutureDone() {
GridCacheVersion ver0;
GridFutureAdapter<Void> fut0;
http://git-wip-us.apache.org/repos/asf/ignite/blob/82dd9128/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicPutAllChangingTopologyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicPutAllChangingTopologyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicPutAllChangingTopologyTest.java
new file mode 100644
index 0000000..878cb17
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicPutAllChangingTopologyTest.java
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.dht.atomic;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.concurrent.CountDownLatch;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.cache.affinity.fair.FairAffinityFunction;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheMode.REPLICATED;
+import static org.apache.ignite.cache.CachePeekMode.BACKUP;
+import static org.apache.ignite.cache.CachePeekMode.PRIMARY;
+import static org.apache.ignite.cache.CacheRebalanceMode.SYNC;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+
+/** */
+public class AtomicPutAllChangingTopologyTest extends GridCommonAbstractTest {
+ /** */
+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+ /** */
+ private static final int NODES_CNT = 3;
+
+ /** */
+ public static final String CACHE_NAME = "test-cache";
+
+ /** */
+ private static final int CACHE_SIZE = 20_000;
+
+ /** */
+ private static volatile CountDownLatch FILLED_LATCH;
+
+ /**
+ * @return Cache configuration.
+ */
+ private CacheConfiguration<Integer, Integer> cacheConfig() {
+ return new CacheConfiguration<Integer, Integer>()
+ .setAtomicityMode(ATOMIC)
+ .setCacheMode(REPLICATED)
+ .setAffinity(new FairAffinityFunction(false, 1))
+ .setWriteSynchronizationMode(FULL_SYNC)
+ .setRebalanceMode(SYNC)
+ .setName(CACHE_NAME);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
+
+ return cfg;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testPutAllOnChangingTopology() throws Exception {
+ List<IgniteInternalFuture> futs = new LinkedList<>();
+
+ for (int i = 1; i < NODES_CNT; i++)
+ futs.add(startNodeAsync(i));
+
+ futs.add(startSeedNodeAsync());
+
+ boolean failed = false;
+
+ for (IgniteInternalFuture fut : futs) {
+ try {
+ fut.get();
+ }
+ catch (Throwable th) {
+ log.error("Check failed.", th);
+
+ failed = true;
+ }
+ }
+
+ if (failed)
+ throw new RuntimeException("Test Failed.");
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ FILLED_LATCH = new CountDownLatch(1);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ super.afterTest();
+
+ stopAllGrids();
+ }
+
+ /**
+ * @return Future.
+ * @throws IgniteCheckedException If failed.
+ */
+ private IgniteInternalFuture startSeedNodeAsync() throws IgniteCheckedException {
+ return GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Boolean call() throws Exception {
+ Ignite node = startGrid(0);
+
+ log.info("Creating cache.");
+
+ IgniteCache<Integer, Integer> cache = node.getOrCreateCache(cacheConfig());
+
+ log.info("Created cache.");
+
+ Map<Integer, Integer> data = new HashMap<>(CACHE_SIZE);
+
+ for (int i = 0; i < CACHE_SIZE; i++)
+ data.put(i, i);
+
+ log.info("Filling.");
+
+ cache.putAll(data);
+
+ log.info("Filled.");
+
+ FILLED_LATCH.countDown();
+
+ checkCacheState(node, cache);
+
+ return true;
+ }
+ });
+ }
+
+ /**
+ * @param nodeId Node index.
+ * @return Future.
+ * @throws IgniteCheckedException If failed.
+ */
+ private IgniteInternalFuture startNodeAsync(final int nodeId) throws IgniteCheckedException {
+ return GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Boolean call() throws Exception {
+ Ignite node = startGrid(nodeId);
+
+ log.info("Getting cache.");
+
+ IgniteCache<Integer, Integer> cache = node.getOrCreateCache(cacheConfig());
+
+ log.info("Got cache.");
+
+ FILLED_LATCH.await();
+
+ log.info("Got Filled.");
+
+ cache.put(1, nodeId);
+
+ checkCacheState(node, cache);
+
+ return true;
+ }
+ });
+ }
+
+ /**
+ * @param node Node.
+ * @param cache Cache.
+ * @throws Exception If failed.
+ */
+ private void checkCacheState(Ignite node, IgniteCache<Integer, Integer> cache) throws Exception {
+ int locSize = cache.localSize(PRIMARY, BACKUP);
+ int locSize2 = -1;
+
+ if (locSize != CACHE_SIZE) {
+ U.sleep(5000);
+
+ // Rechecking.
+ locSize2 = cache.localSize(PRIMARY, BACKUP);
+ }
+
+ assertEquals("Wrong cache size on node [node=" + node.configuration().getGridName() +
+ ", expected= " + CACHE_SIZE +
+ ", actual=" + locSize +
+ ", actual2=" + locSize2 + "]",
+ locSize, CACHE_SIZE);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/82dd9128/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
index 26cea39..986b8d4 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
@@ -33,6 +33,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridCacheDhtR
import org.apache.ignite.internal.processors.cache.distributed.dht.GridCacheTxNodeFailureSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridNearCacheTxNodeFailureSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.IgniteAtomicLongChangingTopologySelfTest;
+import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.AtomicPutAllChangingTopologyTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridCacheAtomicClientInvalidPartitionHandlingSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridCacheAtomicClientRemoveFailureTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridCacheAtomicInvalidPartitionHandlingSelfTest;
@@ -97,6 +98,8 @@ public class IgniteCacheFailoverTestSuite extends TestSuite {
suite.addTestSuite(GridCacheTxNodeFailureSelfTest.class);
suite.addTestSuite(GridNearCacheTxNodeFailureSelfTest.class);
+ suite.addTestSuite(AtomicPutAllChangingTopologyTest.class);
+
return suite;
}
}
[46/50] [abbrv] ignite git commit: IGNITE-4428: Hadoop: moved
HadoopMapReducePlanner and dependent classes to public space. This closes
#1389. This closes #1394.
Posted by ag...@apache.org.
IGNITE-4428: Hadoop: moved HadoopMapReducePlanner and dependent classes to public space. This closes #1389. This closes #1394.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d14e0727
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d14e0727
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d14e0727
Branch: refs/heads/ignite-3477
Commit: d14e0727b3dd61ab5ec2957133d77dbc25e9ba68
Parents: 77ca2e6
Author: tledkov-gridgain <tl...@gridgain.com>
Authored: Mon Jan 16 16:36:25 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Mon Jan 16 16:36:25 2017 +0300
----------------------------------------------------------------------
.../configuration/HadoopConfiguration.java | 2 +-
.../apache/ignite/hadoop/HadoopInputSplit.java | 54 +++++++
.../org/apache/ignite/hadoop/HadoopJob.java | 74 ++++++++++
.../ignite/hadoop/HadoopMapReducePlan.java | 80 +++++++++++
.../ignite/hadoop/HadoopMapReducePlanner.java | 40 ++++++
.../processors/hadoop/HadoopDefaultJobInfo.java | 4 +-
.../processors/hadoop/HadoopFileBlock.java | 1 +
.../processors/hadoop/HadoopInputSplit.java | 54 -------
.../internal/processors/hadoop/HadoopJob.java | 107 --------------
.../internal/processors/hadoop/HadoopJobEx.java | 140 +++++++++++++++++++
.../processors/hadoop/HadoopJobInfo.java | 54 +++----
.../processors/hadoop/HadoopMapReducePlan.java | 80 -----------
.../hadoop/HadoopMapReducePlanner.java | 40 ------
.../processors/hadoop/HadoopTaskContext.java | 6 +-
.../processors/hadoop/HadoopTaskInfo.java | 1 +
.../hadoop/counter/HadoopCounterWriter.java | 4 +-
.../resources/META-INF/classnames.properties | 4 +-
.../fs/IgniteHadoopFileSystemCounterWriter.java | 6 +-
.../IgniteHadoopWeightedMapReducePlanner.java | 10 +-
.../planner/HadoopAbstractMapReducePlanner.java | 118 ++++++++++++++++
.../planner/HadoopTestRoundRobinMrPlanner.java | 75 ++++++++++
.../processors/hadoop/HadoopCommonUtils.java | 1 +
.../processors/hadoop/HadoopContext.java | 2 +
.../processors/hadoop/HadoopExternalSplit.java | 1 +
.../processors/hadoop/HadoopSplitWrapper.java | 1 +
.../HadoopFileSystemCounterWriterDelegate.java | 4 +-
...doopFileSystemCounterWriterDelegateImpl.java | 4 +-
.../hadoop/impl/v1/HadoopV1MapTask.java | 6 +-
.../hadoop/impl/v1/HadoopV1ReduceTask.java | 4 +-
.../hadoop/impl/v1/HadoopV1Splitter.java | 2 +-
.../hadoop/impl/v2/HadoopV2Context.java | 2 +-
.../processors/hadoop/impl/v2/HadoopV2Job.java | 15 +-
.../hadoop/impl/v2/HadoopV2Splitter.java | 2 +-
.../hadoop/impl/v2/HadoopV2TaskContext.java | 6 +-
.../hadoop/jobtracker/HadoopJobMetadata.java | 4 +-
.../hadoop/jobtracker/HadoopJobTracker.java | 32 ++---
.../planner/HadoopAbstractMapReducePlanner.java | 116 ---------------
.../planner/HadoopDefaultMapReducePlan.java | 4 +-
.../hadoop/shuffle/HadoopShuffle.java | 4 +-
.../hadoop/shuffle/HadoopShuffleJob.java | 7 +-
.../HadoopEmbeddedTaskExecutor.java | 8 +-
.../hadoop/taskexecutor/HadoopRunnableTask.java | 6 +-
.../taskexecutor/HadoopTaskExecutorAdapter.java | 8 +-
.../external/HadoopExternalTaskExecutor.java | 16 +--
.../child/HadoopChildProcessRunner.java | 4 +-
.../resources/META-INF/classnames.properties | 4 +-
.../hadoop/impl/HadoopCommandLineTest.java | 4 +-
.../hadoop/impl/HadoopJobTrackerSelfTest.java | 1 +
.../hadoop/impl/HadoopPlannerMockJob.java | 10 +-
.../hadoop/impl/HadoopTasksAllVersionsTest.java | 16 +--
.../hadoop/impl/HadoopTasksV1Test.java | 4 +-
.../hadoop/impl/HadoopTasksV2Test.java | 4 +-
.../impl/HadoopTestRoundRobinMrPlanner.java | 75 ----------
.../hadoop/impl/HadoopTestTaskContext.java | 6 +-
.../hadoop/impl/HadoopV2JobSelfTest.java | 6 +-
.../HadoopWeightedMapReducePlannerTest.java | 6 +-
.../collections/HadoopAbstractMapTest.java | 4 +-
57 files changed, 738 insertions(+), 615 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/configuration/HadoopConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/HadoopConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/HadoopConfiguration.java
index 84014d6..6443a67 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/HadoopConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/HadoopConfiguration.java
@@ -18,7 +18,7 @@
package org.apache.ignite.configuration;
import org.apache.ignite.lifecycle.LifecycleBean;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlanner;
+import org.apache.ignite.hadoop.HadoopMapReducePlanner;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.jetbrains.annotations.Nullable;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopInputSplit.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopInputSplit.java b/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopInputSplit.java
new file mode 100644
index 0000000..4138e64
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopInputSplit.java
@@ -0,0 +1,54 @@
+/*
+ * 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.hadoop;
+
+import java.io.Externalizable;
+
+/**
+ * Abstract fragment of an input data source.
+ */
+public abstract class HadoopInputSplit implements Externalizable {
+ /** */
+ protected String[] hosts;
+
+ /**
+ * Array of hosts where this input split resides.
+ *
+ * @return Hosts.
+ */
+ public String[] hosts() {
+ assert hosts != null;
+
+ return hosts;
+ }
+
+ /**
+ * This method must be implemented for purpose of internal implementation.
+ *
+ * @param obj Another object.
+ * @return {@code true} If objects are equal.
+ */
+ @Override public abstract boolean equals(Object obj);
+
+ /**
+ * This method must be implemented for purpose of internal implementation.
+ *
+ * @return Hash code of the object.
+ */
+ @Override public abstract int hashCode();
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopJob.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopJob.java b/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopJob.java
new file mode 100644
index 0000000..8ee0330
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopJob.java
@@ -0,0 +1,74 @@
+/*
+ * 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.hadoop;
+
+import java.util.Collection;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Compact job description.
+ */
+public interface HadoopJob {
+ /**
+ * Gets collection of input splits for this job.
+ *
+ * @return Input splits.
+ */
+ public Collection<HadoopInputSplit> input();
+
+ /**
+ * Gets optional configuration property for the job.
+ *
+ * @param name Property name.
+ * @return Value or {@code null} if none.
+ */
+ @Nullable String property(String name);
+
+ /**
+ * Checks whether job has combiner.
+ *
+ * @return {@code true} If job has combiner.
+ */
+ boolean hasCombiner();
+
+ /**
+ * Checks whether job has reducer.
+ * Actual number of reducers will be in {@link HadoopMapReducePlan#reducers()}.
+ *
+ * @return Number of reducer.
+ */
+ boolean hasReducer();
+
+ /**
+ * @return Number of reducers configured for job.
+ */
+ int reducers();
+
+ /**
+ * Gets job name.
+ *
+ * @return Job name.
+ */
+ String jobName();
+
+ /**
+ * Gets user name.
+ *
+ * @return User name.
+ */
+ String user();
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopMapReducePlan.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopMapReducePlan.java b/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopMapReducePlan.java
new file mode 100644
index 0000000..f77fb64
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopMapReducePlan.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.hadoop;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.UUID;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Map-reduce job execution plan.
+ */
+public interface HadoopMapReducePlan extends Serializable {
+ /**
+ * Gets collection of file blocks for which mappers should be executed.
+ *
+ * @param nodeId Node ID to check.
+ * @return Collection of file blocks or {@code null} if no mappers should be executed on given node.
+ */
+ @Nullable public Collection<HadoopInputSplit> mappers(UUID nodeId);
+
+ /**
+ * Gets reducer IDs that should be started on given node.
+ *
+ * @param nodeId Node ID to check.
+ * @return Array of reducer IDs.
+ */
+ @Nullable public int[] reducers(UUID nodeId);
+
+ /**
+ * Gets collection of all node IDs involved in map part of job execution.
+ *
+ * @return Collection of node IDs.
+ */
+ public Collection<UUID> mapperNodeIds();
+
+ /**
+ * Gets collection of all node IDs involved in reduce part of job execution.
+ *
+ * @return Collection of node IDs.
+ */
+ public Collection<UUID> reducerNodeIds();
+
+ /**
+ * Gets overall number of mappers for the job.
+ *
+ * @return Number of mappers.
+ */
+ public int mappers();
+
+ /**
+ * Gets overall number of reducers for the job.
+ *
+ * @return Number of reducers.
+ */
+ public int reducers();
+
+ /**
+ * Gets node ID for reducer.
+ *
+ * @param reducer Reducer.
+ * @return Node ID.
+ */
+ public UUID nodeForReducer(int reducer);
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopMapReducePlanner.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopMapReducePlanner.java b/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopMapReducePlanner.java
new file mode 100644
index 0000000..8d77b70
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/hadoop/HadoopMapReducePlanner.java
@@ -0,0 +1,40 @@
+/*
+ * 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.hadoop;
+
+import java.util.Collection;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Map-reduce execution planner.
+ */
+public interface HadoopMapReducePlanner {
+ /**
+ * Prepares map-reduce execution plan for the given job and topology.
+ *
+ * @param job Job.
+ * @param top Topology.
+ * @param oldPlan Old plan in case of partial failure.
+ * @return Map reduce plan.
+ * @throws IgniteCheckedException If an error occurs.
+ */
+ public HadoopMapReducePlan preparePlan(HadoopJob job, Collection<ClusterNode> top,
+ @Nullable HadoopMapReducePlan oldPlan) throws IgniteCheckedException;
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopDefaultJobInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopDefaultJobInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopDefaultJobInfo.java
index ae17ac8..ab38e4c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopDefaultJobInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopDefaultJobInfo.java
@@ -82,12 +82,12 @@ public class HadoopDefaultJobInfo implements HadoopJobInfo, Externalizable {
}
/** {@inheritDoc} */
- @Override public HadoopJob createJob(Class<? extends HadoopJob> jobCls, HadoopJobId jobId, IgniteLogger log,
+ @Override public HadoopJobEx createJob(Class<? extends HadoopJobEx> jobCls, HadoopJobId jobId, IgniteLogger log,
@Nullable String[] libNames, HadoopHelper helper) throws IgniteCheckedException {
assert jobCls != null;
try {
- Constructor<? extends HadoopJob> constructor = jobCls.getConstructor(HadoopJobId.class,
+ Constructor<? extends HadoopJobEx> constructor = jobCls.getConstructor(HadoopJobId.class,
HadoopDefaultJobInfo.class, IgniteLogger.class, String[].class, HadoopHelper.class);
return constructor.newInstance(jobId, this, log, libNames, helper);
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopFileBlock.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopFileBlock.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopFileBlock.java
index bc665eb..351abce 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopFileBlock.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopFileBlock.java
@@ -22,6 +22,7 @@ import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.net.URI;
import java.util.Arrays;
+import org.apache.ignite.hadoop.HadoopInputSplit;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.A;
import org.apache.ignite.internal.util.typedef.internal.S;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopInputSplit.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopInputSplit.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopInputSplit.java
deleted file mode 100644
index 998cb61..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopInputSplit.java
+++ /dev/null
@@ -1,54 +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.hadoop;
-
-import java.io.Externalizable;
-
-/**
- * Abstract fragment of an input data source.
- */
-public abstract class HadoopInputSplit implements Externalizable {
- /** */
- protected String[] hosts;
-
- /**
- * Array of hosts where this input split resides.
- *
- * @return Hosts.
- */
- public String[] hosts() {
- assert hosts != null;
-
- return hosts;
- }
-
- /**
- * This method must be implemented for purpose of internal implementation.
- *
- * @param obj Another object.
- * @return {@code true} If objects are equal.
- */
- @Override public abstract boolean equals(Object obj);
-
- /**
- * This method must be implemented for purpose of internal implementation.
- *
- * @return Hash code of the object.
- */
- @Override public abstract int hashCode();
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJob.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJob.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJob.java
deleted file mode 100644
index a77c744..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJob.java
+++ /dev/null
@@ -1,107 +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.hadoop;
-
-import java.util.Collection;
-import java.util.UUID;
-import org.apache.ignite.IgniteCheckedException;
-
-/**
- * Hadoop job.
- */
-public interface HadoopJob {
- /**
- * Gets job ID.
- *
- * @return Job ID.
- */
- public HadoopJobId id();
-
- /**
- * Gets job information.
- *
- * @return Job information.
- */
- public HadoopJobInfo info();
-
- /**
- * Gets collection of input splits for this job.
- *
- * @return Input splits.
- */
- public Collection<HadoopInputSplit> input() throws IgniteCheckedException;
-
- /**
- * Returns context for task execution.
- *
- * @param info Task info.
- * @return Task Context.
- * @throws IgniteCheckedException If failed.
- */
- public HadoopTaskContext getTaskContext(HadoopTaskInfo info) throws IgniteCheckedException;
-
- /**
- * Does all the needed initialization for the job. Will be called on each node where tasks for this job must
- * be executed.
- * <p>
- * If job is running in external mode this method will be called on instance in Ignite node with parameter
- * {@code false} and on instance in external process with parameter {@code true}.
- *
- * @param external If {@code true} then this job instance resides in external process.
- * @param locNodeId Local node ID.
- * @throws IgniteCheckedException If failed.
- */
- public void initialize(boolean external, UUID locNodeId) throws IgniteCheckedException;
-
- /**
- * Release all the resources.
- * <p>
- * If job is running in external mode this method will be called on instance in Ignite node with parameter
- * {@code false} and on instance in external process with parameter {@code true}.
- *
- * @param external If {@code true} then this job instance resides in external process.
- * @throws IgniteCheckedException If failed.
- */
- public void dispose(boolean external) throws IgniteCheckedException;
-
- /**
- * Prepare local environment for the task.
- *
- * @param info Task info.
- * @throws IgniteCheckedException If failed.
- */
- public void prepareTaskEnvironment(HadoopTaskInfo info) throws IgniteCheckedException;
-
- /**
- * Cleans up local environment of the task.
- *
- * @param info Task info.
- * @throws IgniteCheckedException If failed.
- */
- public void cleanupTaskEnvironment(HadoopTaskInfo info) throws IgniteCheckedException;
-
- /**
- * Cleans up the job staging directory.
- */
- public void cleanupStagingDirectory();
-
- /**
- * @return Ignite work directory.
- */
- public String igniteWorkDirectory();
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobEx.java
new file mode 100644
index 0000000..ba78af9
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobEx.java
@@ -0,0 +1,140 @@
+/*
+ * 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.hadoop;
+
+import java.util.Collection;
+import java.util.UUID;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.hadoop.HadoopInputSplit;
+import org.apache.ignite.hadoop.HadoopJob;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Hadoop job.
+ */
+public abstract class HadoopJobEx implements HadoopJob {
+ /**
+ * Gets job ID.
+ *
+ * @return Job ID.
+ */
+ abstract public HadoopJobId id();
+
+ /**
+ * Gets job information.
+ *
+ * @return Job information.
+ */
+ abstract public HadoopJobInfo info();
+
+ /**
+ * Gets collection of input splits for this job.
+ *
+ * @return Input splits.
+ */
+ abstract public Collection<HadoopInputSplit> input();
+
+ /**
+ * Returns context for task execution.
+ *
+ * @param info Task info.
+ * @return Task Context.
+ * @throws IgniteCheckedException If failed.
+ */
+ abstract public HadoopTaskContext getTaskContext(HadoopTaskInfo info) throws IgniteCheckedException;
+
+ /**
+ * Does all the needed initialization for the job. Will be called on each node where tasks for this job must
+ * be executed.
+ * <p>
+ * If job is running in external mode this method will be called on instance in Ignite node with parameter
+ * {@code false} and on instance in external process with parameter {@code true}.
+ *
+ * @param external If {@code true} then this job instance resides in external process.
+ * @param locNodeId Local node ID.
+ * @throws IgniteCheckedException If failed.
+ */
+ abstract public void initialize(boolean external, UUID locNodeId) throws IgniteCheckedException;
+
+ /**
+ * Release all the resources.
+ * <p>
+ * If job is running in external mode this method will be called on instance in Ignite node with parameter
+ * {@code false} and on instance in external process with parameter {@code true}.
+ *
+ * @param external If {@code true} then this job instance resides in external process.
+ * @throws IgniteCheckedException If failed.
+ */
+ abstract public void dispose(boolean external) throws IgniteCheckedException;
+
+ /**
+ * Prepare local environment for the task.
+ *
+ * @param info Task info.
+ * @throws IgniteCheckedException If failed.
+ */
+ abstract public void prepareTaskEnvironment(HadoopTaskInfo info) throws IgniteCheckedException;
+
+ /**
+ * Cleans up local environment of the task.
+ *
+ * @param info Task info.
+ * @throws IgniteCheckedException If failed.
+ */
+ abstract public void cleanupTaskEnvironment(HadoopTaskInfo info) throws IgniteCheckedException;
+
+ /**
+ * Cleans up the job staging directory.
+ */
+ abstract public void cleanupStagingDirectory();
+
+ /**
+ * @return Ignite work directory.
+ */
+ abstract public String igniteWorkDirectory();
+
+ /** {@inheritDoc} */
+ @Nullable @Override public String property(String name) {
+ return info().property(name);
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean hasCombiner() {
+ return info().hasCombiner();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean hasReducer() {
+ return info().hasReducer();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int reducers() {
+ return info().reducers();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String jobName() {
+ return info().jobName();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String user() {
+ return info().user();
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobInfo.java
index 853c63d..4cc8f80 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobInfo.java
@@ -17,29 +17,29 @@
package org.apache.ignite.internal.processors.hadoop;
-import java.io.Serializable;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.hadoop.HadoopMapReducePlan;
import org.jetbrains.annotations.Nullable;
/**
- * Compact job description.
+ * Extended job description.
*/
-public interface HadoopJobInfo extends Serializable {
+public interface HadoopJobInfo {
/**
* Gets optional configuration property for the job.
*
* @param name Property name.
* @return Value or {@code null} if none.
*/
- @Nullable public String property(String name);
+ @Nullable String property(String name);
/**
* Checks whether job has combiner.
*
* @return {@code true} If job has combiner.
*/
- public boolean hasCombiner();
+ boolean hasCombiner();
/**
* Checks whether job has reducer.
@@ -47,42 +47,42 @@ public interface HadoopJobInfo extends Serializable {
*
* @return Number of reducer.
*/
- public boolean hasReducer();
-
- /**
- * Creates new job instance for the given ID.
- * {@link HadoopJobInfo} is reusable for multiple jobs while {@link HadoopJob} is for one job execution.
- * This method will be called once for the same ID on one node, though it can be called on the same host
- * multiple times from different processes (in case of multiple nodes on the same host or external execution).
- *
- * @param jobCls The job class.
- * @param jobId Job ID.
- * @param log Logger.
- * @param libNames Optional additional native library names.
- * @param helper HadoopHelper.
- * @return Job.
- * @throws IgniteCheckedException If failed.
- */
- public HadoopJob createJob(Class<? extends HadoopJob> jobCls,
- HadoopJobId jobId, IgniteLogger log, @Nullable String[] libNames, HadoopHelper helper)
- throws IgniteCheckedException;
+ boolean hasReducer();
/**
* @return Number of reducers configured for job.
*/
- public int reducers();
+ int reducers();
/**
* Gets job name.
*
* @return Job name.
*/
- public String jobName();
+ String jobName();
/**
* Gets user name.
*
* @return User name.
*/
- public String user();
+ String user();
+
+ /**
+ * Creates new job instance for the given ID.
+ * {@link HadoopJobInfo} is reusable for multiple jobs while {@link HadoopJobEx} is for one job execution.
+ * This method will be called once for the same ID on one node, though it can be called on the same host
+ * multiple times from different processes (in case of multiple nodes on the same host or external execution).
+ *
+ * @param jobCls The job class.
+ * @param jobId Job ID.
+ * @param log Logger.
+ * @param libNames Optional additional native library names.
+ * @param helper HadoopHelper.
+ * @return Job.
+ * @throws IgniteCheckedException If failed.
+ */
+ public HadoopJobEx createJob(Class<? extends HadoopJobEx> jobCls,
+ HadoopJobId jobId, IgniteLogger log, @Nullable String[] libNames, HadoopHelper helper)
+ throws IgniteCheckedException;
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReducePlan.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReducePlan.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReducePlan.java
deleted file mode 100644
index aadc2bf..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReducePlan.java
+++ /dev/null
@@ -1,80 +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.hadoop;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.UUID;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Map-reduce job execution plan.
- */
-public interface HadoopMapReducePlan extends Serializable {
- /**
- * Gets collection of file blocks for which mappers should be executed.
- *
- * @param nodeId Node ID to check.
- * @return Collection of file blocks or {@code null} if no mappers should be executed on given node.
- */
- @Nullable public Collection<HadoopInputSplit> mappers(UUID nodeId);
-
- /**
- * Gets reducer IDs that should be started on given node.
- *
- * @param nodeId Node ID to check.
- * @return Array of reducer IDs.
- */
- @Nullable public int[] reducers(UUID nodeId);
-
- /**
- * Gets collection of all node IDs involved in map part of job execution.
- *
- * @return Collection of node IDs.
- */
- public Collection<UUID> mapperNodeIds();
-
- /**
- * Gets collection of all node IDs involved in reduce part of job execution.
- *
- * @return Collection of node IDs.
- */
- public Collection<UUID> reducerNodeIds();
-
- /**
- * Gets overall number of mappers for the job.
- *
- * @return Number of mappers.
- */
- public int mappers();
-
- /**
- * Gets overall number of reducers for the job.
- *
- * @return Number of reducers.
- */
- public int reducers();
-
- /**
- * Gets node ID for reducer.
- *
- * @param reducer Reducer.
- * @return Node ID.
- */
- public UUID nodeForReducer(int reducer);
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReducePlanner.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReducePlanner.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReducePlanner.java
deleted file mode 100644
index 0009c4a..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReducePlanner.java
+++ /dev/null
@@ -1,40 +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.hadoop;
-
-import java.util.Collection;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.cluster.ClusterNode;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Map-reduce execution planner.
- */
-public interface HadoopMapReducePlanner {
- /**
- * Prepares map-reduce execution plan for the given job and topology.
- *
- * @param job Job.
- * @param top Topology.
- * @param oldPlan Old plan in case of partial failure.
- * @return Map reduce plan.
- * @throws IgniteCheckedException If an error occurs.
- */
- public HadoopMapReducePlan preparePlan(HadoopJob job, Collection<ClusterNode> top,
- @Nullable HadoopMapReducePlan oldPlan) throws IgniteCheckedException;
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskContext.java
index dddd017..194c1dd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskContext.java
@@ -29,7 +29,7 @@ import org.apache.ignite.internal.processors.hadoop.io.PartiallyOffheapRawCompar
*/
public abstract class HadoopTaskContext {
/** */
- protected final HadoopJob job;
+ protected final HadoopJobEx job;
/** */
private HadoopTaskInput input;
@@ -44,7 +44,7 @@ public abstract class HadoopTaskContext {
* @param taskInfo Task info.
* @param job Job.
*/
- protected HadoopTaskContext(HadoopTaskInfo taskInfo, HadoopJob job) {
+ protected HadoopTaskContext(HadoopTaskInfo taskInfo, HadoopJobEx job) {
this.taskInfo = taskInfo;
this.job = job;
}
@@ -88,7 +88,7 @@ public abstract class HadoopTaskContext {
/**
* @return Job.
*/
- public HadoopJob job() {
+ public HadoopJobEx job() {
return job;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskInfo.java
index 3509367..eb3113c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopTaskInfo.java
@@ -21,6 +21,7 @@ import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
+import org.apache.ignite.hadoop.HadoopInputSplit;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.jetbrains.annotations.Nullable;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/counter/HadoopCounterWriter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/counter/HadoopCounterWriter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/counter/HadoopCounterWriter.java
index 6c033b2..93a69db 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/counter/HadoopCounterWriter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/counter/HadoopCounterWriter.java
@@ -18,7 +18,7 @@
package org.apache.ignite.internal.processors.hadoop.counter;
import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
/**
* The object that writes some system counters to some storage for each running job. This operation is a part of
@@ -32,5 +32,5 @@ public interface HadoopCounterWriter {
* @param cntrs Counters.
* @throws IgniteCheckedException If failed.
*/
- public void write(HadoopJob job, HadoopCounters cntrs) throws IgniteCheckedException;
+ public void write(HadoopJobEx job, HadoopCounters cntrs) throws IgniteCheckedException;
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index 212e94a..02bad40 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -1110,13 +1110,13 @@ org.apache.ignite.internal.processors.dr.GridDrType
org.apache.ignite.internal.processors.dr.IgniteDrDataStreamerCacheUpdater
org.apache.ignite.internal.processors.hadoop.HadoopDefaultJobInfo
org.apache.ignite.internal.processors.hadoop.HadoopFileBlock
-org.apache.ignite.internal.processors.hadoop.HadoopInputSplit
+org.apache.ignite.hadoop.HadoopInputSplit
org.apache.ignite.internal.processors.hadoop.HadoopJobId
org.apache.ignite.internal.processors.hadoop.HadoopJobInfo
org.apache.ignite.internal.processors.hadoop.HadoopJobPhase
org.apache.ignite.internal.processors.hadoop.HadoopJobProperty
org.apache.ignite.internal.processors.hadoop.HadoopJobStatus
-org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlan
+org.apache.ignite.hadoop.HadoopMapReducePlan
org.apache.ignite.internal.processors.hadoop.HadoopTaskInfo
org.apache.ignite.internal.processors.hadoop.HadoopTaskType
org.apache.ignite.internal.processors.hadoop.message.HadoopMessage
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopFileSystemCounterWriter.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopFileSystemCounterWriter.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopFileSystemCounterWriter.java
index f1c1b16..1128fa4 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopFileSystemCounterWriter.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopFileSystemCounterWriter.java
@@ -18,7 +18,7 @@
package org.apache.ignite.hadoop.fs;
import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.counter.HadoopCounterWriter;
import org.apache.ignite.internal.processors.hadoop.counter.HadoopCounters;
import org.apache.ignite.internal.processors.hadoop.delegate.HadoopDelegateUtils;
@@ -41,7 +41,7 @@ public class IgniteHadoopFileSystemCounterWriter implements HadoopCounterWriter
private volatile HadoopFileSystemCounterWriterDelegate delegate;
/** {@inheritDoc} */
- @Override public void write(HadoopJob job, HadoopCounters cntrs)
+ @Override public void write(HadoopJobEx job, HadoopCounters cntrs)
throws IgniteCheckedException {
delegate(job).write(job, cntrs);
}
@@ -52,7 +52,7 @@ public class IgniteHadoopFileSystemCounterWriter implements HadoopCounterWriter
* @param job Job.
* @return Delegate.
*/
- private HadoopFileSystemCounterWriterDelegate delegate(HadoopJob job) {
+ private HadoopFileSystemCounterWriterDelegate delegate(HadoopJobEx job) {
HadoopFileSystemCounterWriterDelegate delegate0 = delegate;
if (delegate0 == null) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopWeightedMapReducePlanner.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopWeightedMapReducePlanner.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopWeightedMapReducePlanner.java
index 178cdb5..bb0b47f 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopWeightedMapReducePlanner.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopWeightedMapReducePlanner.java
@@ -21,16 +21,16 @@ import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteFileSystem;
import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.hadoop.HadoopJob;
import org.apache.ignite.igfs.IgfsBlockLocation;
import org.apache.ignite.igfs.IgfsPath;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.processors.hadoop.HadoopCommonUtils;
import org.apache.ignite.internal.processors.hadoop.HadoopFileBlock;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlan;
+import org.apache.ignite.hadoop.HadoopInputSplit;
+import org.apache.ignite.hadoop.HadoopMapReducePlan;
import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsEndpoint;
-import org.apache.ignite.internal.processors.hadoop.planner.HadoopAbstractMapReducePlanner;
+import org.apache.ignite.hadoop.planner.HadoopAbstractMapReducePlanner;
import org.apache.ignite.internal.processors.hadoop.planner.HadoopDefaultMapReducePlan;
import org.apache.ignite.internal.processors.hadoop.planner.HadoopMapReducePlanGroup;
import org.apache.ignite.internal.processors.hadoop.planner.HadoopMapReducePlanTopology;
@@ -117,7 +117,7 @@ public class IgniteHadoopWeightedMapReducePlanner extends HadoopAbstractMapReduc
@Override public HadoopMapReducePlan preparePlan(HadoopJob job, Collection<ClusterNode> nodes,
@Nullable HadoopMapReducePlan oldPlan) throws IgniteCheckedException {
List<HadoopInputSplit> splits = HadoopCommonUtils.sortInputSplits(job.input());
- int reducerCnt = job.info().reducers();
+ int reducerCnt = job.reducers();
if (reducerCnt < 0)
throw new IgniteCheckedException("Number of reducers must be non-negative, actual: " + reducerCnt);
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/hadoop/planner/HadoopAbstractMapReducePlanner.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/planner/HadoopAbstractMapReducePlanner.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/planner/HadoopAbstractMapReducePlanner.java
new file mode 100644
index 0000000..dd01f11
--- /dev/null
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/planner/HadoopAbstractMapReducePlanner.java
@@ -0,0 +1,118 @@
+/*
+ * 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.hadoop.planner;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.hadoop.HadoopMapReducePlanner;
+import org.apache.ignite.internal.processors.hadoop.planner.HadoopMapReducePlanGroup;
+import org.apache.ignite.internal.processors.hadoop.planner.HadoopMapReducePlanTopology;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.resources.IgniteInstanceResource;
+import org.apache.ignite.resources.LoggerResource;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MACS;
+
+/**
+ * Base class for map-reduce planners.
+ */
+public abstract class HadoopAbstractMapReducePlanner implements HadoopMapReducePlanner {
+ /** Injected grid. */
+ @IgniteInstanceResource
+ protected Ignite ignite;
+
+ /** Logger. */
+ @SuppressWarnings("UnusedDeclaration")
+ @LoggerResource
+ protected IgniteLogger log;
+
+ /**
+ * Create plan topology.
+ *
+ * @param nodes Topology nodes.
+ * @return Plan topology.
+ */
+ protected static HadoopMapReducePlanTopology topology(Collection<ClusterNode> nodes) {
+ Map<String, HadoopMapReducePlanGroup> macsMap = new HashMap<>(nodes.size());
+
+ Map<UUID, HadoopMapReducePlanGroup> idToGrp = new HashMap<>(nodes.size());
+ Map<String, HadoopMapReducePlanGroup> hostToGrp = new HashMap<>(nodes.size());
+
+ for (ClusterNode node : nodes) {
+ String macs = node.attribute(ATTR_MACS);
+
+ HadoopMapReducePlanGroup grp = macsMap.get(macs);
+
+ if (grp == null) {
+ grp = new HadoopMapReducePlanGroup(node, macs);
+
+ macsMap.put(macs, grp);
+ }
+ else
+ grp.add(node);
+
+ idToGrp.put(node.id(), grp);
+
+ for (String host : node.addresses()) {
+ HadoopMapReducePlanGroup hostGrp = hostToGrp.get(host);
+
+ if (hostGrp == null)
+ hostToGrp.put(host, grp);
+ else
+ assert hostGrp == grp;
+ }
+ }
+
+ return new HadoopMapReducePlanTopology(new ArrayList<>(macsMap.values()), idToGrp, hostToGrp);
+ }
+
+
+ /**
+ * Groups nodes by host names.
+ *
+ * @param top Topology to group.
+ * @return Map.
+ */
+ protected static Map<String, Collection<UUID>> groupByHost(Collection<ClusterNode> top) {
+ Map<String, Collection<UUID>> grouped = U.newHashMap(top.size());
+
+ for (ClusterNode node : top) {
+ for (String host : node.hostNames()) {
+ Collection<UUID> nodeIds = grouped.get(host);
+
+ if (nodeIds == null) {
+ // Expecting 1-2 nodes per host.
+ nodeIds = new ArrayList<>(2);
+
+ grouped.put(host, nodeIds);
+ }
+
+ nodeIds.add(node.id());
+ }
+ }
+
+ return grouped;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/hadoop/planner/HadoopTestRoundRobinMrPlanner.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/planner/HadoopTestRoundRobinMrPlanner.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/planner/HadoopTestRoundRobinMrPlanner.java
new file mode 100644
index 0000000..d9de0c1
--- /dev/null
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/planner/HadoopTestRoundRobinMrPlanner.java
@@ -0,0 +1,75 @@
+/*
+ * 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.hadoop.planner;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.UUID;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.hadoop.HadoopInputSplit;
+import org.apache.ignite.hadoop.HadoopJob;
+import org.apache.ignite.hadoop.HadoopMapReducePlan;
+import org.apache.ignite.hadoop.HadoopMapReducePlanner;
+import org.apache.ignite.internal.processors.hadoop.planner.HadoopDefaultMapReducePlan;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Round-robin mr planner.
+ */
+public class HadoopTestRoundRobinMrPlanner implements HadoopMapReducePlanner {
+ /** {@inheritDoc} */
+ @Override public HadoopMapReducePlan preparePlan(HadoopJob job, Collection<ClusterNode> top,
+ @Nullable HadoopMapReducePlan oldPlan) throws IgniteCheckedException {
+ if (top.isEmpty())
+ throw new IllegalArgumentException("Topology is empty");
+
+ // Has at least one element.
+ Iterator<ClusterNode> it = top.iterator();
+
+ Map<UUID, Collection<HadoopInputSplit>> mappers = new HashMap<>();
+
+ for (HadoopInputSplit block : job.input()) {
+ ClusterNode node = it.next();
+
+ Collection<HadoopInputSplit> nodeBlocks = mappers.get(node.id());
+
+ if (nodeBlocks == null) {
+ nodeBlocks = new ArrayList<>();
+
+ mappers.put(node.id(), nodeBlocks);
+ }
+
+ nodeBlocks.add(block);
+
+ if (!it.hasNext())
+ it = top.iterator();
+ }
+
+ int[] rdc = new int[job.reducers()];
+
+ for (int i = 0; i < rdc.length; i++)
+ rdc[i] = i;
+
+ return new HadoopDefaultMapReducePlan(mappers, Collections.singletonMap(it.next().id(), rdc));
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopCommonUtils.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopCommonUtils.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopCommonUtils.java
index 37af147..7e74d82 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopCommonUtils.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopCommonUtils.java
@@ -17,6 +17,7 @@
package org.apache.ignite.internal.processors.hadoop;
+import org.apache.ignite.hadoop.HadoopInputSplit;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopContext.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopContext.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopContext.java
index 4326ad2..f125485 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopContext.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopContext.java
@@ -23,6 +23,8 @@ import java.util.List;
import java.util.UUID;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.HadoopConfiguration;
+import org.apache.ignite.hadoop.HadoopMapReducePlan;
+import org.apache.ignite.hadoop.HadoopMapReducePlanner;
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.processors.hadoop.jobtracker.HadoopJobMetadata;
import org.apache.ignite.internal.processors.hadoop.jobtracker.HadoopJobTracker;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopExternalSplit.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopExternalSplit.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopExternalSplit.java
index a9b4532..7db535a 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopExternalSplit.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopExternalSplit.java
@@ -17,6 +17,7 @@
package org.apache.ignite.internal.processors.hadoop;
+import org.apache.ignite.hadoop.HadoopInputSplit;
import org.apache.ignite.internal.util.typedef.internal.S;
import java.io.Externalizable;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopSplitWrapper.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopSplitWrapper.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopSplitWrapper.java
index fb6d0f3..fe5d434 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopSplitWrapper.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopSplitWrapper.java
@@ -22,6 +22,7 @@ import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Arrays;
+import org.apache.ignite.hadoop.HadoopInputSplit;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/delegate/HadoopFileSystemCounterWriterDelegate.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/delegate/HadoopFileSystemCounterWriterDelegate.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/delegate/HadoopFileSystemCounterWriterDelegate.java
index 541cf80..0d82b5b 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/delegate/HadoopFileSystemCounterWriterDelegate.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/delegate/HadoopFileSystemCounterWriterDelegate.java
@@ -18,7 +18,7 @@
package org.apache.ignite.internal.processors.hadoop.delegate;
import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.counter.HadoopCounters;
/**
@@ -32,5 +32,5 @@ public interface HadoopFileSystemCounterWriterDelegate {
* @param cntrs Counters.
* @throws IgniteCheckedException If failed.
*/
- public void write(HadoopJob job, HadoopCounters cntrs) throws IgniteCheckedException;
+ public void write(HadoopJobEx job, HadoopCounters cntrs) throws IgniteCheckedException;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/delegate/HadoopFileSystemCounterWriterDelegateImpl.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/delegate/HadoopFileSystemCounterWriterDelegateImpl.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/delegate/HadoopFileSystemCounterWriterDelegateImpl.java
index d4c10da..6b36d26 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/delegate/HadoopFileSystemCounterWriterDelegateImpl.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/delegate/HadoopFileSystemCounterWriterDelegateImpl.java
@@ -24,7 +24,7 @@ import org.apache.hadoop.mapreduce.MRJobConfig;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.hadoop.fs.IgniteHadoopFileSystemCounterWriter;
import org.apache.ignite.internal.processors.hadoop.HadoopDefaultJobInfo;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
import org.apache.ignite.internal.processors.hadoop.HadoopJobInfo;
import org.apache.ignite.internal.processors.hadoop.counter.HadoopCounters;
@@ -60,7 +60,7 @@ public class HadoopFileSystemCounterWriterDelegateImpl implements HadoopFileSyst
}
/** {@inheritDoc} */
- public void write(HadoopJob job, HadoopCounters cntrs) throws IgniteCheckedException {
+ public void write(HadoopJobEx job, HadoopCounters cntrs) throws IgniteCheckedException {
Configuration hadoopCfg = HadoopUtils.safeCreateConfiguration();
final HadoopJobInfo jobInfo = job.info();
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1MapTask.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1MapTask.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1MapTask.java
index 65ff280..cde6da6 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1MapTask.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1MapTask.java
@@ -28,8 +28,8 @@ import org.apache.hadoop.mapred.Reporter;
import org.apache.hadoop.util.ReflectionUtils;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.processors.hadoop.HadoopFileBlock;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.hadoop.HadoopInputSplit;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskCancelledException;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskContext;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskInfo;
@@ -54,7 +54,7 @@ public class HadoopV1MapTask extends HadoopV1Task {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public void run(HadoopTaskContext taskCtx) throws IgniteCheckedException {
- HadoopJob job = taskCtx.job();
+ HadoopJobEx job = taskCtx.job();
HadoopV2TaskContext ctx = (HadoopV2TaskContext)taskCtx;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1ReduceTask.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1ReduceTask.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1ReduceTask.java
index 92c024e..6b90653 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1ReduceTask.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1ReduceTask.java
@@ -22,7 +22,7 @@ import org.apache.hadoop.mapred.Reducer;
import org.apache.hadoop.mapred.Reporter;
import org.apache.hadoop.util.ReflectionUtils;
import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskCancelledException;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskContext;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskInfo;
@@ -51,7 +51,7 @@ public class HadoopV1ReduceTask extends HadoopV1Task {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public void run(HadoopTaskContext taskCtx) throws IgniteCheckedException {
- HadoopJob job = taskCtx.job();
+ HadoopJobEx job = taskCtx.job();
HadoopV2TaskContext ctx = (HadoopV2TaskContext)taskCtx;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1Splitter.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1Splitter.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1Splitter.java
index 11a3598..26325b9 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1Splitter.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v1/HadoopV1Splitter.java
@@ -24,7 +24,7 @@ import org.apache.hadoop.mapred.InputSplit;
import org.apache.hadoop.mapred.JobConf;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.processors.hadoop.HadoopFileBlock;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
+import org.apache.ignite.hadoop.HadoopInputSplit;
import org.apache.ignite.internal.processors.hadoop.impl.HadoopUtils;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.jetbrains.annotations.Nullable;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Context.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Context.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Context.java
index eec0636..11f2ecc 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Context.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Context.java
@@ -30,7 +30,7 @@ import org.apache.hadoop.mapreduce.lib.input.FileSplit;
import org.apache.hadoop.mapreduce.task.JobContextImpl;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.processors.hadoop.HadoopFileBlock;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
+import org.apache.ignite.hadoop.HadoopInputSplit;
import org.apache.ignite.internal.processors.hadoop.HadoopMapperAwareTaskOutput;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskCancelledException;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskContext;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Job.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Job.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Job.java
index a24e581..5d3f22d 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Job.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Job.java
@@ -30,6 +30,7 @@ import org.apache.hadoop.mapreduce.MRJobConfig;
import org.apache.hadoop.mapreduce.split.JobSplit;
import org.apache.hadoop.mapreduce.split.SplitMetaInfoReader;
import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.internal.processors.hadoop.HadoopClassLoader;
import org.apache.ignite.internal.processors.hadoop.HadoopCommonUtils;
@@ -37,8 +38,8 @@ import org.apache.ignite.internal.processors.hadoop.HadoopDefaultJobInfo;
import org.apache.ignite.internal.processors.hadoop.HadoopExternalSplit;
import org.apache.ignite.internal.processors.hadoop.HadoopFileBlock;
import org.apache.ignite.internal.processors.hadoop.HadoopHelper;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.hadoop.HadoopInputSplit;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
import org.apache.ignite.internal.processors.hadoop.HadoopJobInfo;
import org.apache.ignite.internal.processors.hadoop.HadoopJobProperty;
@@ -85,7 +86,7 @@ import static org.apache.ignite.internal.processors.hadoop.impl.fs.HadoopFileSys
/**
* Hadoop job implementation for v2 API.
*/
-public class HadoopV2Job implements HadoopJob {
+public class HadoopV2Job extends HadoopJobEx {
/** */
private final JobConf jobConf;
@@ -139,6 +140,7 @@ public class HadoopV2Job implements HadoopJob {
* @param jobInfo Job info.
* @param log Logger.
* @param libNames Optional additional native library names.
+ * @param helper Hadoop helper.
*/
public HadoopV2Job(HadoopJobId jobId, final HadoopDefaultJobInfo jobInfo, IgniteLogger log,
@Nullable String[] libNames, HadoopHelper helper) {
@@ -182,7 +184,7 @@ public class HadoopV2Job implements HadoopJob {
}
/** {@inheritDoc} */
- @Override public Collection<HadoopInputSplit> input() throws IgniteCheckedException {
+ @Override public Collection<HadoopInputSplit> input() {
ClassLoader oldLdr = HadoopCommonUtils.setContextClassLoader(jobConf.getClassLoader());
try {
@@ -239,6 +241,9 @@ public class HadoopV2Job implements HadoopJob {
throw transformException(e);
}
}
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
finally {
HadoopCommonUtils.restoreContextClassLoader(oldLdr);
}
@@ -274,7 +279,7 @@ public class HadoopV2Job implements HadoopJob {
fullCtxClsQueue.add(cls);
}
- Constructor<?> ctr = cls.getConstructor(HadoopTaskInfo.class, HadoopJob.class,
+ Constructor<?> ctr = cls.getConstructor(HadoopTaskInfo.class, HadoopJobEx.class,
HadoopJobId.class, UUID.class, DataInput.class);
if (jobConfData == null)
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Splitter.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Splitter.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Splitter.java
index 667ef1e..c878515 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Splitter.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2Splitter.java
@@ -25,7 +25,7 @@ import org.apache.hadoop.util.ReflectionUtils;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.processors.hadoop.HadoopFileBlock;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
+import org.apache.ignite.hadoop.HadoopInputSplit;
import org.apache.ignite.internal.processors.hadoop.impl.HadoopUtils;
import org.jetbrains.annotations.Nullable;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2TaskContext.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2TaskContext.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2TaskContext.java
index d328550..8b8a728 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2TaskContext.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2TaskContext.java
@@ -45,8 +45,8 @@ import org.apache.ignite.hadoop.io.TextPartiallyRawComparator;
import org.apache.ignite.internal.processors.hadoop.HadoopClassLoader;
import org.apache.ignite.internal.processors.hadoop.HadoopCommonUtils;
import org.apache.ignite.internal.processors.hadoop.HadoopExternalSplit;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.hadoop.HadoopInputSplit;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
import org.apache.ignite.internal.processors.hadoop.HadoopJobProperty;
import org.apache.ignite.internal.processors.hadoop.HadoopPartitioner;
@@ -165,7 +165,7 @@ public class HadoopV2TaskContext extends HadoopTaskContext {
* @param locNodeId Local node ID.
* @param jobConfDataInput DataInput for read JobConf.
*/
- public HadoopV2TaskContext(HadoopTaskInfo taskInfo, HadoopJob job, HadoopJobId jobId,
+ public HadoopV2TaskContext(HadoopTaskInfo taskInfo, HadoopJobEx job, HadoopJobId jobId,
@Nullable UUID locNodeId, DataInput jobConfDataInput) throws IgniteCheckedException {
super(taskInfo, job);
this.locNodeId = locNodeId;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobMetadata.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobMetadata.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobMetadata.java
index 090b336..1035701 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobMetadata.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobMetadata.java
@@ -24,11 +24,11 @@ import java.io.ObjectOutput;
import java.util.Collection;
import java.util.Map;
import java.util.UUID;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
+import org.apache.ignite.hadoop.HadoopInputSplit;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
import org.apache.ignite.internal.processors.hadoop.HadoopJobInfo;
import org.apache.ignite.internal.processors.hadoop.HadoopJobPhase;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlan;
+import org.apache.ignite.hadoop.HadoopMapReducePlan;
import org.apache.ignite.internal.processors.hadoop.counter.HadoopCounters;
import org.apache.ignite.internal.processors.hadoop.counter.HadoopCountersImpl;
import org.apache.ignite.internal.processors.hadoop.taskexecutor.external.HadoopProcessDescriptor;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java
index 9542372..9284c02 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java
@@ -49,14 +49,14 @@ import org.apache.ignite.internal.processors.hadoop.HadoopClassLoader;
import org.apache.ignite.internal.processors.hadoop.HadoopCommonUtils;
import org.apache.ignite.internal.processors.hadoop.HadoopComponent;
import org.apache.ignite.internal.processors.hadoop.HadoopContext;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.hadoop.HadoopInputSplit;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
import org.apache.ignite.internal.processors.hadoop.HadoopJobInfo;
import org.apache.ignite.internal.processors.hadoop.HadoopJobPhase;
import org.apache.ignite.internal.processors.hadoop.HadoopJobStatus;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlan;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlanner;
+import org.apache.ignite.hadoop.HadoopMapReducePlan;
+import org.apache.ignite.hadoop.HadoopMapReducePlanner;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskCancelledException;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskInfo;
import org.apache.ignite.internal.processors.hadoop.counter.HadoopCounterWriter;
@@ -114,7 +114,7 @@ public class HadoopJobTracker extends HadoopComponent {
private HadoopMapReducePlanner mrPlanner;
/** All the known jobs. */
- private final ConcurrentMap<HadoopJobId, GridFutureAdapter<HadoopJob>> jobs = new ConcurrentHashMap8<>();
+ private final ConcurrentMap<HadoopJobId, GridFutureAdapter<HadoopJobEx>> jobs = new ConcurrentHashMap8<>();
/** Locally active jobs. */
private final ConcurrentMap<HadoopJobId, JobLocalState> activeJobs = new ConcurrentHashMap8<>();
@@ -129,8 +129,8 @@ public class HadoopJobTracker extends HadoopComponent {
/** Component busy lock. */
private GridSpinReadWriteLock busyLock;
- /** Class to create HadoopJob instances from. */
- private Class<? extends HadoopJob> jobCls;
+ /** Class to create HadoopJobEx instances from. */
+ private Class<? extends HadoopJobEx> jobCls;
/** Closure to check result of async transform of system cache. */
private final IgniteInClosure<IgniteInternalFuture<?>> failsLog = new CI1<IgniteInternalFuture<?>>() {
@@ -158,7 +158,7 @@ public class HadoopJobTracker extends HadoopComponent {
HadoopClassLoader ldr = ctx.kernalContext().hadoopHelper().commonClassLoader();
try {
- jobCls = (Class<HadoopJob>)ldr.loadClass(HadoopCommonUtils.JOB_CLS_NAME);
+ jobCls = (Class<HadoopJobEx>)ldr.loadClass(HadoopCommonUtils.JOB_CLS_NAME);
}
catch (Exception ioe) {
throw new IgniteCheckedException("Failed to load job class [class=" +
@@ -310,7 +310,7 @@ public class HadoopJobTracker extends HadoopComponent {
if (jobs.containsKey(jobId) || jobMetaCache().containsKey(jobId))
throw new IgniteCheckedException("Failed to submit job. Job with the same ID already exists: " + jobId);
- HadoopJob job = job(jobId, info);
+ HadoopJobEx job = job(jobId, info);
HadoopMapReducePlan mrPlan = mrPlanner.preparePlan(job, ctx.nodes(), null);
@@ -692,7 +692,7 @@ public class HadoopJobTracker extends HadoopComponent {
try {
if (checkSetup && phase == PHASE_SETUP && !activeJobs.containsKey(jobId)) {
// Failover setup task.
- HadoopJob job = job(jobId, meta.jobInfo());
+ HadoopJobEx job = job(jobId, meta.jobInfo());
Collection<HadoopTaskInfo> setupTask = setupTask(jobId);
@@ -818,7 +818,7 @@ public class HadoopJobTracker extends HadoopComponent {
throws IgniteCheckedException {
JobLocalState state = activeJobs.get(jobId);
- HadoopJob job = job(jobId, meta.jobInfo());
+ HadoopJobEx job = job(jobId, meta.jobInfo());
HadoopMapReducePlan plan = meta.mapReducePlan();
@@ -1048,7 +1048,7 @@ public class HadoopJobTracker extends HadoopComponent {
* @param job Job instance.
* @return Collection of task infos.
*/
- private Collection<HadoopTaskInfo> reducerTasks(int[] reducers, HadoopJob job) {
+ private Collection<HadoopTaskInfo> reducerTasks(int[] reducers, HadoopJobEx job) {
UUID locNodeId = ctx.localNodeId();
HadoopJobId jobId = job.id();
@@ -1097,15 +1097,15 @@ public class HadoopJobTracker extends HadoopComponent {
* @return Job.
* @throws IgniteCheckedException If failed.
*/
- @Nullable public HadoopJob job(HadoopJobId jobId, @Nullable HadoopJobInfo jobInfo) throws IgniteCheckedException {
- GridFutureAdapter<HadoopJob> fut = jobs.get(jobId);
+ @Nullable public HadoopJobEx job(HadoopJobId jobId, @Nullable HadoopJobInfo jobInfo) throws IgniteCheckedException {
+ GridFutureAdapter<HadoopJobEx> fut = jobs.get(jobId);
- if (fut != null || (fut = jobs.putIfAbsent(jobId, new GridFutureAdapter<HadoopJob>())) != null)
+ if (fut != null || (fut = jobs.putIfAbsent(jobId, new GridFutureAdapter<HadoopJobEx>())) != null)
return fut.get();
fut = jobs.get(jobId);
- HadoopJob job = null;
+ HadoopJobEx job = null;
try {
if (jobInfo == null) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/planner/HadoopAbstractMapReducePlanner.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/planner/HadoopAbstractMapReducePlanner.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/planner/HadoopAbstractMapReducePlanner.java
deleted file mode 100644
index f01f72b..0000000
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/planner/HadoopAbstractMapReducePlanner.java
+++ /dev/null
@@ -1,116 +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.hadoop.planner;
-
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteLogger;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlanner;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.resources.IgniteInstanceResource;
-import org.apache.ignite.resources.LoggerResource;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MACS;
-
-/**
- * Base class for map-reduce planners.
- */
-public abstract class HadoopAbstractMapReducePlanner implements HadoopMapReducePlanner {
- /** Injected grid. */
- @IgniteInstanceResource
- protected Ignite ignite;
-
- /** Logger. */
- @SuppressWarnings("UnusedDeclaration")
- @LoggerResource
- protected IgniteLogger log;
-
- /**
- * Create plan topology.
- *
- * @param nodes Topology nodes.
- * @return Plan topology.
- */
- protected static HadoopMapReducePlanTopology topology(Collection<ClusterNode> nodes) {
- Map<String, HadoopMapReducePlanGroup> macsMap = new HashMap<>(nodes.size());
-
- Map<UUID, HadoopMapReducePlanGroup> idToGrp = new HashMap<>(nodes.size());
- Map<String, HadoopMapReducePlanGroup> hostToGrp = new HashMap<>(nodes.size());
-
- for (ClusterNode node : nodes) {
- String macs = node.attribute(ATTR_MACS);
-
- HadoopMapReducePlanGroup grp = macsMap.get(macs);
-
- if (grp == null) {
- grp = new HadoopMapReducePlanGroup(node, macs);
-
- macsMap.put(macs, grp);
- }
- else
- grp.add(node);
-
- idToGrp.put(node.id(), grp);
-
- for (String host : node.addresses()) {
- HadoopMapReducePlanGroup hostGrp = hostToGrp.get(host);
-
- if (hostGrp == null)
- hostToGrp.put(host, grp);
- else
- assert hostGrp == grp;
- }
- }
-
- return new HadoopMapReducePlanTopology(new ArrayList<>(macsMap.values()), idToGrp, hostToGrp);
- }
-
-
- /**
- * Groups nodes by host names.
- *
- * @param top Topology to group.
- * @return Map.
- */
- protected static Map<String, Collection<UUID>> groupByHost(Collection<ClusterNode> top) {
- Map<String, Collection<UUID>> grouped = U.newHashMap(top.size());
-
- for (ClusterNode node : top) {
- for (String host : node.hostNames()) {
- Collection<UUID> nodeIds = grouped.get(host);
-
- if (nodeIds == null) {
- // Expecting 1-2 nodes per host.
- nodeIds = new ArrayList<>(2);
-
- grouped.put(host, nodeIds);
- }
-
- nodeIds.add(node.id());
- }
- }
-
- return grouped;
- }
-}
[06/50] [abbrv] ignite git commit: IGNITE-4307 .NET: Fix
AtomicConfiguration in AtomicSequenceExample
Posted by ag...@apache.org.
IGNITE-4307 .NET: Fix AtomicConfiguration in AtomicSequenceExample
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/06ef8460
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/06ef8460
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/06ef8460
Branch: refs/heads/ignite-3477
Commit: 06ef846067411350081c4112ef9e9466deb6086c
Parents: 8dd0322
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Dec 28 11:29:30 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Dec 28 11:29:30 2016 +0300
----------------------------------------------------------------------
.../examples/Apache.Ignite.Examples/App.config | 2 ++
.../DataStructures/AtomicSequenceExample.cs | 26 +++-----------------
2 files changed, 6 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/06ef8460/modules/platforms/dotnet/examples/Apache.Ignite.Examples/App.config
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/App.config b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/App.config
index 8b16df3..13f0d86 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/App.config
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/App.config
@@ -40,6 +40,8 @@
<string>Apache.Ignite.ExamplesDll.Compute.AverageSalaryJob</string>
</types>
</binaryConfiguration>
+
+ <atomicConfiguration atomicSequenceReserveSize="10" />
<discoverySpi type="TcpDiscoverySpi">
<ipFinder type="TcpDiscoveryMulticastIpFinder">
http://git-wip-us.apache.org/repos/asf/ignite/blob/06ef8460/modules/platforms/dotnet/examples/Apache.Ignite.Examples/DataStructures/AtomicSequenceExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/DataStructures/AtomicSequenceExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/DataStructures/AtomicSequenceExample.cs
index f08c998..89e8ed3 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/DataStructures/AtomicSequenceExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/DataStructures/AtomicSequenceExample.cs
@@ -21,9 +21,6 @@ namespace Apache.Ignite.Examples.DataStructures
using System.Threading;
using Apache.Ignite.Core;
using Apache.Ignite.Core.DataStructures;
- using Apache.Ignite.Core.DataStructures.Configuration;
- using Apache.Ignite.Core.Discovery.Tcp;
- using Apache.Ignite.Core.Discovery.Tcp.Multicast;
using Apache.Ignite.ExamplesDll.DataStructures;
/// <summary>
@@ -44,26 +41,11 @@ namespace Apache.Ignite.Examples.DataStructures
[STAThread]
public static void Main()
{
- var atomicCfg = new AtomicConfiguration
- {
- // Each node reserves 10 numbers to itself, so that 10 increments can be done locally,
- // without communicating to other nodes. After that, another 10 elements are reserved.
- AtomicSequenceReserveSize = 10
- };
-
- var cfg = new IgniteConfiguration
- {
- DiscoverySpi = new TcpDiscoverySpi
- {
- IpFinder = new TcpDiscoveryMulticastIpFinder
- {
- Endpoints = new[] { "127.0.0.1:47500" }
- }
- },
- AtomicConfiguration = atomicCfg
- };
+ // See app.config: <atomicConfiguration atomicSequenceReserveSize="10" />
+ // Each node reserves 10 numbers to itself, so that 10 increments can be done locally,
+ // without communicating to other nodes. After that, another 10 elements are reserved.
- using (var ignite = Ignition.Start(cfg))
+ using (var ignite = Ignition.StartFromApplicationConfiguration())
{
Console.WriteLine();
Console.WriteLine(">>> Atomic sequence example started.");
[30/50] [abbrv] ignite git commit: IGNITE-4493: ODBC: Added missing
diagnostic records for error cases
Posted by ag...@apache.org.
IGNITE-4493: ODBC: Added missing diagnostic records for error cases
This closes #1396
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9e8e9798
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9e8e9798
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9e8e9798
Branch: refs/heads/ignite-3477
Commit: 9e8e9798dae8b92cfbf4d940856dec35d3e30f54
Parents: bf118aa
Author: Sergey Kalashnikov <sk...@gridgain.com>
Authored: Tue Jan 10 11:10:56 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Jan 10 11:10:56 2017 +0300
----------------------------------------------------------------------
.../cpp/odbc-test/src/api_robustness_test.cpp | 113 +++++++++++-
.../cpp/odbc/include/ignite/odbc/common_types.h | 29 ++-
.../cpp/odbc/include/ignite/odbc/statement.h | 143 +++++++++++----
modules/platforms/cpp/odbc/src/connection.cpp | 2 +-
.../odbc/src/diagnostic/diagnostic_record.cpp | 38 ++++
modules/platforms/cpp/odbc/src/odbc.cpp | 118 ++++---------
modules/platforms/cpp/odbc/src/statement.cpp | 176 ++++++++++++++++---
7 files changed, 484 insertions(+), 135 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e8e9798/modules/platforms/cpp/odbc-test/src/api_robustness_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/api_robustness_test.cpp b/modules/platforms/cpp/odbc-test/src/api_robustness_test.cpp
index 13a5ea6..0b6df93 100644
--- a/modules/platforms/cpp/odbc-test/src/api_robustness_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/api_robustness_test.cpp
@@ -50,7 +50,7 @@ using ignite::impl::binary::BinaryUtils;
/**
* Test setup fixture.
*/
-struct ApiRobustnessTestSuiteFixture
+struct ApiRobustnessTestSuiteFixture
{
void Prepare()
{
@@ -206,6 +206,33 @@ struct ApiRobustnessTestSuiteFixture
// Operation is not supported. However, there should be no crash.
BOOST_CHECK(ret == SQL_ERROR);
+
+ CheckSQLStatementDiagnosticError("HY106");
+ }
+
+ void CheckSQLDiagnosticError(int16_t handleType, SQLHANDLE handle, const std::string& expectSqlState)
+ {
+ SQLCHAR state[ODBC_BUFFER_SIZE];
+ SQLINTEGER nativeError = 0;
+ SQLCHAR message[ODBC_BUFFER_SIZE];
+ SQLSMALLINT messageLen = 0;
+
+ SQLRETURN ret = SQLGetDiagRec(handleType, handle, 1, state, &nativeError, message, sizeof(message), &messageLen);
+
+ const std::string sqlState = reinterpret_cast<char*>(state);
+ BOOST_REQUIRE_EQUAL(ret, SQL_SUCCESS);
+ BOOST_REQUIRE_EQUAL(sqlState, expectSqlState);
+ BOOST_REQUIRE(messageLen > 0);
+ }
+
+ void CheckSQLStatementDiagnosticError(const std::string& expectSqlState)
+ {
+ CheckSQLDiagnosticError(SQL_HANDLE_STMT, stmt, expectSqlState);
+ }
+
+ void CheckSQLConnectionDiagnosticError(const std::string& expectSqlState)
+ {
+ CheckSQLDiagnosticError(SQL_HANDLE_DBC, dbc, expectSqlState);
}
/**
@@ -234,6 +261,43 @@ struct ApiRobustnessTestSuiteFixture
SQLHSTMT stmt;
};
+SQLSMALLINT unsupportedC[] = {
+ SQL_C_INTERVAL_YEAR,
+ SQL_C_INTERVAL_MONTH,
+ SQL_C_INTERVAL_DAY,
+ SQL_C_INTERVAL_HOUR,
+ SQL_C_INTERVAL_MINUTE,
+ SQL_C_INTERVAL_SECOND,
+ SQL_C_INTERVAL_YEAR_TO_MONTH,
+ SQL_C_INTERVAL_DAY_TO_HOUR,
+ SQL_C_INTERVAL_DAY_TO_MINUTE,
+ SQL_C_INTERVAL_DAY_TO_SECOND,
+ SQL_C_INTERVAL_HOUR_TO_MINUTE,
+ SQL_C_INTERVAL_HOUR_TO_SECOND,
+ SQL_C_INTERVAL_MINUTE_TO_SECOND
+ };
+
+SQLSMALLINT unsupportedSql[] = {
+ SQL_WVARCHAR,
+ SQL_WLONGVARCHAR,
+ SQL_REAL,
+ SQL_NUMERIC,
+ SQL_TYPE_TIME,
+ SQL_INTERVAL_MONTH,
+ SQL_INTERVAL_YEAR,
+ SQL_INTERVAL_YEAR_TO_MONTH,
+ SQL_INTERVAL_DAY,
+ SQL_INTERVAL_HOUR,
+ SQL_INTERVAL_MINUTE,
+ SQL_INTERVAL_SECOND,
+ SQL_INTERVAL_DAY_TO_HOUR,
+ SQL_INTERVAL_DAY_TO_MINUTE,
+ SQL_INTERVAL_DAY_TO_SECOND,
+ SQL_INTERVAL_HOUR_TO_MINUTE,
+ SQL_INTERVAL_HOUR_TO_SECOND,
+ SQL_INTERVAL_MINUTE_TO_SECOND
+ };
+
BOOST_FIXTURE_TEST_SUITE(ApiRobustnessTestSuite, ApiRobustnessTestSuiteFixture)
BOOST_AUTO_TEST_CASE(TestSQLDriverConnect)
@@ -516,6 +580,19 @@ BOOST_AUTO_TEST_CASE(TestSQLBindCol)
ODBC_FAIL_ON_ERROR(ret, SQL_HANDLE_STMT, stmt);
+ //Unsupported data types
+ for(int i = 0; i < sizeof(unsupportedC)/sizeof(unsupportedC[0]); ++i)
+ {
+ ret = SQLBindCol(stmt, 1, unsupportedC[i], &ind1, sizeof(ind1), &len1);
+ BOOST_REQUIRE_EQUAL(ret, SQL_ERROR);
+ CheckSQLStatementDiagnosticError("HY003");
+ }
+
+ // Size is negative.
+ ret = SQLBindCol(stmt, 1, SQL_C_SLONG, &ind1, -1, &len1);
+ BOOST_REQUIRE_EQUAL(ret, SQL_ERROR);
+ CheckSQLStatementDiagnosticError("HY090");
+
// Size is null.
SQLBindCol(stmt, 1, SQL_C_SLONG, &ind1, 0, &len1);
@@ -545,6 +622,24 @@ BOOST_AUTO_TEST_CASE(TestSQLBindParameter)
ODBC_FAIL_ON_ERROR(ret, SQL_HANDLE_STMT, stmt);
+ //Unsupported parameter type : output
+ SQLBindParameter(stmt, 2, SQL_PARAM_OUTPUT, SQL_C_SLONG, SQL_INTEGER, 100, 100, &ind1, sizeof(ind1), &len1);
+ CheckSQLStatementDiagnosticError("HY105");
+
+ //Unsupported parameter type : input/output
+ SQLBindParameter(stmt, 2, SQL_PARAM_INPUT_OUTPUT, SQL_C_SLONG, SQL_INTEGER, 100, 100, &ind1, sizeof(ind1), &len1);
+ CheckSQLStatementDiagnosticError("HY105");
+
+
+ //Unsupported data types
+ for(int i = 0; i < sizeof(unsupportedSql)/sizeof(unsupportedSql[0]); ++i)
+ {
+ ret = SQLBindParameter(stmt, 2, SQL_PARAM_INPUT, SQL_C_SLONG, unsupportedSql[i], 100, 100, &ind1, sizeof(ind1), &len1);
+ BOOST_REQUIRE_EQUAL(ret, SQL_ERROR);
+ CheckSQLStatementDiagnosticError("HYC00");
+ }
+
+
// Size is null.
SQLBindParameter(stmt, 2, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 100, 100, &ind1, 0, &len1);
@@ -1111,4 +1206,20 @@ BOOST_AUTO_TEST_CASE(TestSQLError)
SQLError(0, 0, 0, 0, 0, 0, 0, 0);
}
+BOOST_AUTO_TEST_CASE(TestSQLDiagnosticRecords)
+{
+ Connect("DRIVER={Apache Ignite};address=127.0.0.1:11110;cache=cache");
+
+ SQLHANDLE hnd;
+ SQLRETURN ret;
+
+ ret = SQLAllocHandle(SQL_HANDLE_DESC, dbc, &hnd);
+ BOOST_REQUIRE_EQUAL(ret, SQL_ERROR);
+ CheckSQLConnectionDiagnosticError("IM001");
+
+ ret = SQLFreeStmt(stmt, 4);
+ BOOST_REQUIRE_EQUAL(ret, SQL_ERROR);
+ CheckSQLStatementDiagnosticError("HY092");
+}
+
BOOST_AUTO_TEST_SUITE_END()
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e8e9798/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h b/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
index 517fe4e..5d8901d 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/common_types.h
@@ -113,15 +113,37 @@ namespace ignite
*/
SQL_STATE_HY001_MEMORY_ALLOCATION,
+ /**
+ * The argument TargetType was neither a valid data type
+ * nor SQL_C_DEFAULT
+ */
+ SQL_STATE_HY003_INVALID_APPLICATION_BUFFER_TYPE,
+
/** Invalid use of null pointer. */
SQL_STATE_HY009_INVALID_USE_OF_NULL_POINTER,
/** Function sequence error. */
SQL_STATE_HY010_SEQUENCE_ERROR,
+ /**
+ * Invalid string or buffer length
+ */
+ SQL_STATE_HY090_INVALID_STRING_OR_BUFFER_LENGTH,
+
+ /**
+ * Option type was out of range.
+ */
+ SQL_STATE_HY092_OPTION_TYPE_OUT_OF_RANGE,
+
/** Column type out of range. */
SQL_STATE_HY097_COLUMN_TYPE_OUT_OF_RANGE,
+ /** The value specified for the argument InputOutputType was invalid. */
+ SQL_STATE_HY105_INVALID_PARAMETER_TYPE,
+
+ /** The value specified for the argument FetchOrientation was invalid. */
+ SQL_STATE_HY106_FETCH_TYPE_OUT_OF_RANGE,
+
/**
* The driver does not support the feature of ODBC behavior that
* the application requested.
@@ -132,7 +154,12 @@ namespace ignite
* The connection timeout period expired before the data source
* responded to the request.
*/
- SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT
+ SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT,
+
+ /**
+ * Driver does not support this function.
+ */
+ SQL_STATE_IM001_FUNCTION_NOT_SUPPORTED
};
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e8e9798/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h b/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
index db56660..596fc66 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/statement.h
@@ -57,24 +57,15 @@ namespace ignite
~Statement();
/**
- * Bind result column to specified data buffer.
+ * Bind result column to data buffer provided by application
*
* @param columnIdx Column index.
- * @param buffer Buffer to put column data to.
+ * @param targetType Type of target buffer.
+ * @param targetValue Pointer to target buffer.
+ * @param bufferLength Length of target buffer.
+ * @param strLengthOrIndicator Pointer to the length/indicator buffer.
*/
- void BindColumn(uint16_t columnIdx, const app::ApplicationDataBuffer& buffer);
-
- /**
- * Unbind specified column buffer.
- *
- * @param columnIdx Column index.
- */
- void UnbindColumn(uint16_t columnIdx);
-
- /**
- * Unbind all column buffers.
- */
- void UnbindAllColumns();
+ void BindColumn(uint16_t columnIdx, int16_t targetType, void* targetValue, SqlLen bufferLength, SqlLen* strLengthOrIndicator);
/**
* Set column binding offset pointer.
@@ -101,21 +92,17 @@ namespace ignite
* Bind parameter.
*
* @param paramIdx Parameter index.
- * @param param Parameter.
- */
- void BindParameter(uint16_t paramIdx, const app::Parameter& param);
-
- /**
- * Unbind specified parameter.
- *
- * @param paramIdx Parameter index.
+ * @param ioType Type of the parameter (input/output).
+ * @param bufferType The data type of the parameter.
+ * @param paramSqlType The SQL data type of the parameter.
+ * @param columnSize The size of the column or expression of the corresponding parameter marker.
+ * @param decDigits The decimal digits of the column or expression of the corresponding parameter marker.
+ * @param buffer A pointer to a buffer for the parameter's data.
+ * @param bufferLen Length of the ParameterValuePtr buffer in bytes.
+ * @param resLen A pointer to a buffer for the parameter's length.
*/
- void UnbindParameter(uint16_t paramIdx);
-
- /**
- * Unbind all parameters.
- */
- void UnbindAllParameters();
+ void BindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
+ SqlUlen columnSize, int16_t decDigits, void* buffer, SqlLen bufferLen, SqlLen* resLen);
/**
* Set statement attribute.
@@ -171,7 +158,7 @@ namespace ignite
* @param query SQL query.
*/
void PrepareSqlQuery(const std::string& query);
-
+
/**
* Execute SQL query.
*
@@ -254,11 +241,24 @@ namespace ignite
void ExecuteGetTypeInfoQuery(int16_t sqlType);
/**
+ * Free resources
+ * @param option indicates what needs to be freed
+ */
+ void FreeResources(int16_t option);
+
+ /**
* Close statement.
*/
void Close();
/**
+ * Fetch query result row with offset
+ * @param orientation Fetch type
+ * @param offset Fetch offset
+ */
+ void FetchScroll(int16_t orientation, int64_t offset);
+
+ /**
* Fetch query result row.
*/
void FetchRow();
@@ -362,14 +362,75 @@ namespace ignite
private:
IGNITE_NO_COPY_ASSIGNMENT(Statement);
+
+ /**
+ * Bind result column to specified data buffer.
+ *
+ * @param columnIdx Column index.
+ * @param buffer Buffer to put column data to.
+ */
+ void SafeBindColumn(uint16_t columnIdx, const app::ApplicationDataBuffer& buffer);
+
+ /**
+ * Unbind specified column buffer.
+ *
+ * @param columnIdx Column index.
+ */
+ void SafeUnbindColumn(uint16_t columnIdx);
+
+ /**
+ * Unbind all column buffers.
+ */
+ void SafeUnbindAllColumns();
+
+ /**
+ * Bind result column to data buffer provided by application
+ *
+ * @param columnIdx Column index.
+ * @param targetType Type of target buffer.
+ * @param targetValue Pointer to target buffer.
+ * @param bufferLength Length of target buffer.
+ * @param strLengthOrIndicator Pointer to the length/indicator buffer.
+ * @return Operation result.
+ */
+ SqlResult InternalBindColumn(uint16_t columnIdx, int16_t targetType, void* targetValue, SqlLen bufferLength, SqlLen* strLengthOrIndicator);
+
/**
* Bind parameter.
*
* @param paramIdx Parameter index.
* @param param Parameter.
+ */
+ void SafeBindParameter(uint16_t paramIdx, const app::Parameter& param);
+
+ /**
+ * Unbind specified parameter.
+ *
+ * @param paramIdx Parameter index.
+ */
+ void SafeUnbindParameter(uint16_t paramIdx);
+
+ /**
+ * Unbind all parameters.
+ */
+ void SafeUnbindAllParameters();
+
+ /**
+ * Bind parameter.
+ *
+ * @param paramIdx Parameter index.
+ * @param ioType Type of the parameter (input/output).
+ * @param bufferType The data type of the parameter.
+ * @param paramSqlType The SQL data type of the parameter.
+ * @param columnSize The size of the column or expression of the corresponding parameter marker.
+ * @param decDigits The decimal digits of the column or expression of the corresponding parameter marker.
+ * @param buffer A pointer to a buffer for the parameter's data.
+ * @param bufferLen Length of the ParameterValuePtr buffer in bytes.
+ * @param resLen A pointer to a buffer for the parameter's length.
* @return Operation result.
*/
- SqlResult InternalBindParameter(uint16_t paramIdx, const app::Parameter& param);
+ SqlResult InternalBindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
+ SqlUlen columnSize, int16_t decDigits, void* buffer, SqlLen bufferLen, SqlLen* resLen);
/**
* Set statement attribute.
@@ -403,6 +464,14 @@ namespace ignite
*/
SqlResult InternalGetColumnData(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+
+ /**
+ * Free resources
+ * @param option indicates what needs to be freed
+ * @return Operation result.
+ */
+ SqlResult InternalFreeResources(int16_t option);
+
/**
* Close statement.
* Internal call.
@@ -418,7 +487,7 @@ namespace ignite
* @return Operation result.
*/
SqlResult InternalPrepareSqlQuery(const std::string& query);
-
+
/**
* Execute SQL query.
*
@@ -435,6 +504,14 @@ namespace ignite
SqlResult InternalExecuteSqlQuery();
/**
+ * Fetch query result row with offset
+ * @param orientation Fetch type
+ * @param offset Fetch offset
+ * @return Operation result.
+ */
+ SqlResult InternalFetchScroll(int16_t orientation, int64_t offset);
+
+ /**
* Fetch query result row.
*
* @return Operation result.
@@ -621,7 +698,7 @@ namespace ignite
/** Offset added to pointers to change binding of parameters. */
int* paramBindOffset;
-
+
/** Offset added to pointers to change binding of column data. */
int* columnBindOffset;
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e8e9798/modules/platforms/cpp/odbc/src/connection.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/connection.cpp b/modules/platforms/cpp/odbc/src/connection.cpp
index 2afa42d..4a6de5e 100644
--- a/modules/platforms/cpp/odbc/src/connection.cpp
+++ b/modules/platforms/cpp/odbc/src/connection.cpp
@@ -226,7 +226,7 @@ namespace ignite
OdbcProtocolHeader hdr;
- int64_t received = ReceiveAll(reinterpret_cast<int8_t*>(&hdr), sizeof(hdr));
+ size_t received = ReceiveAll(reinterpret_cast<int8_t*>(&hdr), sizeof(hdr));
if (received != sizeof(hdr))
IGNITE_ERROR_1(IgniteError::IGNITE_ERR_GENERIC, "Can not receive message header");
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e8e9798/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp b/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp
index 215d77f..3c411d2 100644
--- a/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp
+++ b/modules/platforms/cpp/odbc/src/diagnostic/diagnostic_record.cpp
@@ -64,17 +64,35 @@ namespace
/** SQL state HY001 constant. */
const std::string STATE_HY001 = "HY001";
+ /** SQL state HY003 constant. */
+ const std::string STATE_HY003 = "HY003";
+
/** SQL state HY009 constant. */
const std::string STATE_HY009 = "HY009";
/** SQL state HY010 constant. */
const std::string STATE_HY010 = "HY010";
+ /** SQL state HY092 constant. */
+ const std::string STATE_HY092 = "HY092";
+
+ /** SQL state HY105 constant. */
+ const std::string STATE_HY105 = "HY105";
+
+ /** SQL state HY106 constant. */
+ const std::string STATE_HY106 = "HY106";
+
/** SQL state HYC00 constant. */
const std::string STATE_HYC00 = "HYC00";
/** SQL state HYT01 constant. */
const std::string STATE_HYT01 = "HYT01";
+
+ /** SQL state HY090 constant. */
+ const std::string STATE_HY090 = "HY090";
+
+ /** SQL state IM001 constant. */
+ const std::string STATE_IM001 = "IM001";
}
namespace ignite
@@ -130,6 +148,8 @@ namespace ignite
if (odbcSubclasses.empty())
{
+ // This is a fixed list taken from ODBC doc.
+ // Please do not add/remove values here.
odbcSubclasses.insert("01S00");
odbcSubclasses.insert("01S01");
odbcSubclasses.insert("01S02");
@@ -234,18 +254,36 @@ namespace ignite
case SQL_STATE_HY001_MEMORY_ALLOCATION:
return STATE_HY001;
+ case SQL_STATE_HY003_INVALID_APPLICATION_BUFFER_TYPE:
+ return STATE_HY003;
+
case SQL_STATE_HY009_INVALID_USE_OF_NULL_POINTER:
return STATE_HY009;
case SQL_STATE_HY010_SEQUENCE_ERROR:
return STATE_HY010;
+ case SQL_STATE_HY090_INVALID_STRING_OR_BUFFER_LENGTH:
+ return STATE_HY090;
+
+ case SQL_STATE_HY092_OPTION_TYPE_OUT_OF_RANGE:
+ return STATE_HY092;
+
+ case SQL_STATE_HY105_INVALID_PARAMETER_TYPE:
+ return STATE_HY105;
+
+ case SQL_STATE_HY106_FETCH_TYPE_OUT_OF_RANGE:
+ return STATE_HY106;
+
case SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED:
return STATE_HYC00;
case SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT:
return STATE_HYT01;
+ case SQL_STATE_IM001_FUNCTION_NOT_SUPPORTED:
+ return STATE_IM001;
+
default:
break;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e8e9798/modules/platforms/cpp/odbc/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/odbc.cpp b/modules/platforms/cpp/odbc/src/odbc.cpp
index dbec55f..fd69c0d 100644
--- a/modules/platforms/cpp/odbc/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/src/odbc.cpp
@@ -31,6 +31,7 @@
#include "ignite/odbc/dsn_config.h"
#include "ignite/odbc.h"
+
namespace ignite
{
SQLRETURN SQLGetInfo(SQLHDBC conn,
@@ -71,6 +72,23 @@ namespace ignite
return SQLAllocStmt(parent, result);
case SQL_HANDLE_DESC:
+ {
+ using odbc::Connection;
+ Connection *connection = reinterpret_cast<Connection*>(parent);
+
+ if (!connection)
+ return SQL_INVALID_HANDLE;
+
+ if (result)
+ *result = 0;
+
+ connection->GetDiagnosticRecords().Reset();
+ connection->AddStatusRecord(odbc::SQL_STATE_IM001_FUNCTION_NOT_SUPPORTED,
+ "The HandleType argument was SQL_HANDLE_DESC, and "
+ "the driver does not support allocating a descriptor handle");
+
+ return SQL_ERROR;
+ }
default:
break;
}
@@ -199,39 +217,15 @@ namespace ignite
if (!statement)
return SQL_INVALID_HANDLE;
- switch (option)
+ if (option == SQL_DROP)
{
- case SQL_DROP:
- {
- delete statement;
-
- break;
- }
-
- case SQL_CLOSE:
- {
- return SQLCloseCursor(stmt);
- }
-
- case SQL_UNBIND:
- {
- statement->UnbindAllColumns();
-
- break;
- }
-
- case SQL_RESET_PARAMS:
- {
- statement->UnbindAllParameters();
-
- break;
- }
-
- default:
- return SQL_ERROR;
+ delete statement;
+ return SQL_SUCCESS;
}
- return SQL_SUCCESS;
+ statement->FreeResources(option);
+
+ return statement->GetDiagnosticRecords().GetReturnCode();
}
SQLRETURN SQLCloseCursor(SQLHSTMT stmt)
@@ -419,29 +413,14 @@ namespace ignite
using odbc::Statement;
using odbc::app::ApplicationDataBuffer;
- LOG_MSG("SQLBindCol called: index=%d, type=%d\n", colNum, targetType);
+ LOG_MSG("SQLBindCol called: index=%d, type=%d targetValue=%p bufferLength=%d\n", colNum, targetType, targetValue, bufferLength);
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
- IgniteSqlType driverType = ToDriverType(targetType);
-
- if (driverType == IGNITE_ODBC_C_TYPE_UNSUPPORTED)
- return SQL_ERROR;
-
- if (bufferLength < 0)
- return SQL_ERROR;
-
- if (targetValue || strLengthOrIndicator)
- {
- ApplicationDataBuffer dataBuffer(driverType, targetValue, bufferLength, strLengthOrIndicator);
-
- statement->BindColumn(colNum, dataBuffer);
- }
- else
- statement->UnbindColumn(colNum);
+ statement->BindColumn(colNum, targetType, targetValue, bufferLength, strLengthOrIndicator);
return statement->GetDiagnosticRecords().GetReturnCode();
}
@@ -464,13 +443,19 @@ namespace ignite
SQLRETURN SQLFetchScroll(SQLHSTMT stmt, SQLSMALLINT orientation, SQLLEN offset)
{
+ using odbc::Statement;
+
LOG_MSG("SQLFetchScroll called\n");
LOG_MSG("Orientation: %d, Offset: %d\n", orientation, offset);
- if (orientation != SQL_FETCH_NEXT)
- return SQL_ERROR;
+ Statement *statement = reinterpret_cast<Statement*>(stmt);
+
+ if (!statement)
+ return SQL_INVALID_HANDLE;
+
+ statement->FetchScroll(orientation, offset);
- return SQLFetch(stmt);
+ return statement->GetDiagnosticRecords().GetReturnCode();
}
SQLRETURN SQLExtendedFetch(SQLHSTMT stmt,
@@ -617,12 +602,7 @@ namespace ignite
SQLLEN bufferLen,
SQLLEN* resLen)
{
- using namespace odbc::type_traits;
-
using odbc::Statement;
- using odbc::app::ApplicationDataBuffer;
- using odbc::app::Parameter;
- using odbc::type_traits::IsSqlTypeSupported;
LOG_MSG("SQLBindParameter called: %d, %d, %d\n", paramIdx, bufferType, paramSqlType);
@@ -631,27 +611,7 @@ namespace ignite
if (!statement)
return SQL_INVALID_HANDLE;
- if (ioType != SQL_PARAM_INPUT)
- return SQL_ERROR;
-
- if (!IsSqlTypeSupported(paramSqlType))
- return SQL_ERROR;
-
- IgniteSqlType driverType = ToDriverType(bufferType);
-
- if (driverType == IGNITE_ODBC_C_TYPE_UNSUPPORTED)
- return SQL_ERROR;
-
- if (buffer)
- {
- ApplicationDataBuffer dataBuffer(driverType, buffer, bufferLen, resLen);
-
- Parameter param(dataBuffer, paramSqlType, columnSize, decDigits);
-
- statement->BindParameter(paramIdx, param);
- }
- else
- statement->UnbindParameter(paramIdx);
+ statement->BindParameter(paramIdx, ioType, bufferType, paramSqlType, columnSize, decDigits, buffer, bufferLen, resLen);
return statement->GetDiagnosticRecords().GetReturnCode();
}
@@ -717,13 +677,13 @@ namespace ignite
}
SQLRETURN SQLDescribeCol(SQLHSTMT stmt,
- SQLUSMALLINT columnNum,
+ SQLUSMALLINT columnNum,
SQLCHAR* columnNameBuf,
SQLSMALLINT columnNameBufLen,
SQLSMALLINT* columnNameLen,
- SQLSMALLINT* dataType,
+ SQLSMALLINT* dataType,
SQLULEN* columnSize,
- SQLSMALLINT* decimalDigits,
+ SQLSMALLINT* decimalDigits,
SQLSMALLINT* nullable)
{
using odbc::Statement;
http://git-wip-us.apache.org/repos/asf/ignite/blob/9e8e9798/modules/platforms/cpp/odbc/src/statement.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/statement.cpp b/modules/platforms/cpp/odbc/src/statement.cpp
index 02c6dd9..09ad81c 100644
--- a/modules/platforms/cpp/odbc/src/statement.cpp
+++ b/modules/platforms/cpp/odbc/src/statement.cpp
@@ -50,26 +50,57 @@ namespace ignite
// No-op.
}
- void Statement::BindColumn(uint16_t columnIdx, const app::ApplicationDataBuffer& buffer)
+ void Statement::BindColumn(uint16_t columnIdx, int16_t targetType, void* targetValue, SqlLen bufferLength, SqlLen* strLengthOrIndicator)
{
- IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
+ IGNITE_ODBC_API_CALL(InternalBindColumn(columnIdx, targetType, targetValue, bufferLength, strLengthOrIndicator));
+ }
+
+ SqlResult Statement::InternalBindColumn(uint16_t columnIdx, int16_t targetType, void* targetValue, SqlLen bufferLength, SqlLen* strLengthOrIndicator)
+ {
+ using namespace odbc::type_traits;
+ IgniteSqlType driverType = ToDriverType(targetType);
+
+ if (driverType == IGNITE_ODBC_C_TYPE_UNSUPPORTED)
+ {
+ AddStatusRecord(odbc::SQL_STATE_HY003_INVALID_APPLICATION_BUFFER_TYPE, "The argument TargetType was not a valid data type.");
+
+ return SQL_RESULT_ERROR;
+ }
+
+ if (bufferLength < 0)
+ {
+ AddStatusRecord(odbc::SQL_STATE_HY090_INVALID_STRING_OR_BUFFER_LENGTH,
+ "The value specified for the argument BufferLength was less than 0.");
+
+ return SQL_RESULT_ERROR;
+ }
+
+ if (targetValue || strLengthOrIndicator)
+ {
+ app::ApplicationDataBuffer dataBuffer(driverType, targetValue, bufferLength, strLengthOrIndicator);
+ SafeBindColumn(columnIdx, dataBuffer);
+ }
+ else
+ SafeUnbindColumn(columnIdx);
+
+ return SQL_RESULT_SUCCESS;
+ }
+
+ void Statement::SafeBindColumn(uint16_t columnIdx, const app::ApplicationDataBuffer& buffer)
+ {
columnBindings[columnIdx] = buffer;
columnBindings[columnIdx].SetPtrToOffsetPtr(&columnBindOffset);
}
- void Statement::UnbindColumn(uint16_t columnIdx)
+ void Statement::SafeUnbindColumn(uint16_t columnIdx)
{
- IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
-
columnBindings.erase(columnIdx);
}
- void Statement::UnbindAllColumns()
+ void Statement::SafeUnbindAllColumns()
{
- IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
-
columnBindings.clear();
}
@@ -108,14 +139,21 @@ namespace ignite
return SQL_RESULT_SUCCESS;
}
- void Statement::BindParameter(uint16_t paramIdx, const app::Parameter& param)
+ void Statement::BindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
+ SqlUlen columnSize, int16_t decDigits, void* buffer, SqlLen bufferLen, SqlLen* resLen)
{
- IGNITE_ODBC_API_CALL(InternalBindParameter(paramIdx, param));
+ IGNITE_ODBC_API_CALL(InternalBindParameter(paramIdx, ioType, bufferType, paramSqlType, columnSize, decDigits, buffer, bufferLen, resLen));
}
-
- SqlResult Statement::InternalBindParameter(uint16_t paramIdx, const app::Parameter& param)
+ SqlResult Statement::InternalBindParameter(uint16_t paramIdx, int16_t ioType, int16_t bufferType, int16_t paramSqlType,
+ SqlUlen columnSize, int16_t decDigits, void* buffer, SqlLen bufferLen, SqlLen* resLen)
{
+ using namespace odbc::type_traits;
+ using odbc::Statement;
+ using odbc::app::ApplicationDataBuffer;
+ using odbc::app::Parameter;
+ using odbc::type_traits::IsSqlTypeSupported;
+
if (paramIdx == 0)
{
AddStatusRecord(SQL_STATE_24000_INVALID_CURSOR_STATE,
@@ -124,24 +162,60 @@ namespace ignite
return SQL_RESULT_ERROR;
}
- paramBindings[paramIdx] = param;
+ if (ioType != SQL_PARAM_INPUT)
+ {
+ AddStatusRecord(SQL_STATE_HY105_INVALID_PARAMETER_TYPE,
+ "The value specified for the argument InputOutputType was not SQL_PARAM_INPUT.");
- paramBindings[paramIdx].GetBuffer().SetPtrToOffsetPtr(¶mBindOffset);
+ return SQL_RESULT_ERROR;
+ }
+
+ if (!IsSqlTypeSupported(paramSqlType))
+ {
+ AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+ "Data type is not supported.");
+
+ return SQL_RESULT_ERROR;
+ }
+
+ IgniteSqlType driverType = ToDriverType(bufferType);
+
+ if (driverType == IGNITE_ODBC_C_TYPE_UNSUPPORTED)
+ {
+ AddStatusRecord(odbc::SQL_STATE_HY003_INVALID_APPLICATION_BUFFER_TYPE,
+ "The argument TargetType was not a valid data type.");
+
+ return SQL_RESULT_ERROR;
+ }
+
+ if (buffer)
+ {
+ ApplicationDataBuffer dataBuffer(driverType, buffer, bufferLen, resLen);
+
+ Parameter param(dataBuffer, paramSqlType, columnSize, decDigits);
+
+ SafeBindParameter(paramIdx, param);
+ }
+ else
+ SafeUnbindParameter(paramIdx);
return SQL_RESULT_SUCCESS;
}
- void Statement::UnbindParameter(uint16_t paramIdx)
+ void Statement::SafeBindParameter(uint16_t paramIdx, const app::Parameter& param)
{
- IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
+ paramBindings[paramIdx] = param;
- paramBindings.erase(paramIdx);
+ paramBindings[paramIdx].GetBuffer().SetPtrToOffsetPtr(¶mBindOffset);
}
- void Statement::UnbindAllParameters()
+ void Statement::SafeUnbindParameter(uint16_t paramIdx)
{
- IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
+ paramBindings.erase(paramIdx);
+ }
+ void Statement::SafeUnbindAllParameters()
+ {
paramBindings.clear();
}
@@ -536,6 +610,50 @@ namespace ignite
return currentQuery->Execute();
}
+ void Statement::FreeResources(int16_t option)
+ {
+ IGNITE_ODBC_API_CALL(InternalFreeResources(option));
+ }
+
+ SqlResult Statement::InternalFreeResources(int16_t option)
+ {
+ switch (option)
+ {
+ case SQL_DROP:
+ {
+ AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, "Deprecated, call SQLFreeHandle instead");
+
+ return SQL_RESULT_ERROR;
+ }
+
+ case SQL_CLOSE:
+ {
+ return InternalClose();
+ }
+
+ case SQL_UNBIND:
+ {
+ SafeUnbindAllColumns();
+
+ break;
+ }
+
+ case SQL_RESET_PARAMS:
+ {
+ SafeUnbindAllParameters();
+
+ break;
+ }
+
+ default:
+ {
+ AddStatusRecord(SQL_STATE_HY092_OPTION_TYPE_OUT_OF_RANGE, "The value specified for the argument Option was invalid");
+ return SQL_RESULT_ERROR;
+ }
+ }
+ return SQL_RESULT_SUCCESS;
+ }
+
void Statement::Close()
{
IGNITE_ODBC_API_CALL(InternalClose());
@@ -545,7 +663,7 @@ namespace ignite
{
if (!currentQuery.get())
return SQL_RESULT_SUCCESS;
-
+
SqlResult result = currentQuery->Close();
if (result == SQL_RESULT_SUCCESS)
@@ -554,6 +672,24 @@ namespace ignite
return result;
}
+ void Statement::FetchScroll(int16_t orientation, int64_t offset)
+ {
+ IGNITE_ODBC_API_CALL(InternalFetchScroll(orientation, offset));
+ }
+
+ SqlResult Statement::InternalFetchScroll(int16_t orientation, int64_t offset)
+ {
+ UNREFERENCED_PARAMETER(offset);
+
+ if (orientation != SQL_FETCH_NEXT)
+ {
+ AddStatusRecord(SQL_STATE_HY106_FETCH_TYPE_OUT_OF_RANGE, "The value specified for the argument FetchOrientation was not SQL_FETCH_NEXT.");
+ return SQL_RESULT_ERROR;
+ }
+
+ return InternalFetchRow();
+ }
+
void Statement::FetchRow()
{
IGNITE_ODBC_API_CALL(InternalFetchRow());
[47/50] [abbrv] ignite git commit: IGNITE-4503: Hadoop: added
boundary checks to HadoopDirectDataInput. This closes # 1416.
Posted by ag...@apache.org.
IGNITE-4503: Hadoop: added boundary checks to HadoopDirectDataInput. This closes # 1416.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f1365421
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f1365421
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f1365421
Branch: refs/heads/ignite-3477
Commit: f1365421c299b754a10edf8b6f156aeeb5ff0ce1
Parents: d14e072
Author: tledkov-gridgain <tl...@gridgain.com>
Authored: Mon Jan 16 16:57:27 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Mon Jan 16 16:57:27 2017 +0300
----------------------------------------------------------------------
.../shuffle/direct/HadoopDirectDataInput.java | 41 +++++++++++++++++++-
1 file changed, 39 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f1365421/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataInput.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataInput.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataInput.java
index 6f0e2b0..8031c9f 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataInput.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataInput.java
@@ -17,6 +17,7 @@
package org.apache.ignite.internal.processors.hadoop.shuffle.direct;
+import java.io.EOFException;
import org.apache.ignite.internal.util.GridUnsafe;
import org.apache.ignite.internal.util.typedef.internal.SB;
import org.jetbrains.annotations.NotNull;
@@ -59,6 +60,8 @@ public class HadoopDirectDataInput extends InputStream implements DataInput {
/** {@inheritDoc} */
@Override public void readFully(@NotNull byte[] b, int off, int len) throws IOException {
+ checkRange(len);
+
System.arraycopy(buf, pos, b, off, len);
pos += len;
@@ -66,9 +69,16 @@ public class HadoopDirectDataInput extends InputStream implements DataInput {
/** {@inheritDoc} */
@Override public int skipBytes(int n) throws IOException {
- pos += n;
+ if (n < 0)
+ throw new IllegalArgumentException();
+
+ assert pos <= buf.length;
+
+ int toSkip = Math.min(buf.length - pos, n);
- return n;
+ pos += toSkip;
+
+ return toSkip;
}
/** {@inheritDoc} */
@@ -78,6 +88,8 @@ public class HadoopDirectDataInput extends InputStream implements DataInput {
/** {@inheritDoc} */
@Override public byte readByte() throws IOException {
+ checkRange(1);
+
byte res = GridUnsafe.getByte(buf, BYTE_ARR_OFF + pos);
pos += 1;
@@ -92,6 +104,8 @@ public class HadoopDirectDataInput extends InputStream implements DataInput {
/** {@inheritDoc} */
@Override public short readShort() throws IOException {
+ checkRange(2);
+
short res = GridUnsafe.getShort(buf, BYTE_ARR_OFF + pos);
pos += 2;
@@ -106,6 +120,8 @@ public class HadoopDirectDataInput extends InputStream implements DataInput {
/** {@inheritDoc} */
@Override public char readChar() throws IOException {
+ checkRange(2);
+
char res = GridUnsafe.getChar(buf, BYTE_ARR_OFF + pos);
pos += 2;
@@ -115,6 +131,8 @@ public class HadoopDirectDataInput extends InputStream implements DataInput {
/** {@inheritDoc} */
@Override public int readInt() throws IOException {
+ checkRange(4);
+
int res = GridUnsafe.getInt(buf, BYTE_ARR_OFF + pos);
pos += 4;
@@ -124,6 +142,8 @@ public class HadoopDirectDataInput extends InputStream implements DataInput {
/** {@inheritDoc} */
@Override public long readLong() throws IOException {
+ checkRange(8);
+
long res = GridUnsafe.getLong(buf, BYTE_ARR_OFF + pos);
pos += 8;
@@ -133,6 +153,8 @@ public class HadoopDirectDataInput extends InputStream implements DataInput {
/** {@inheritDoc} */
@Override public float readFloat() throws IOException {
+ checkRange(4);
+
float res = GridUnsafe.getFloat(buf, BYTE_ARR_OFF + pos);
pos += 4;
@@ -142,6 +164,8 @@ public class HadoopDirectDataInput extends InputStream implements DataInput {
/** {@inheritDoc} */
@Override public double readDouble() throws IOException {
+ checkRange(8);
+
double res = GridUnsafe.getDouble(buf, BYTE_ARR_OFF + pos);
pos += 8;
@@ -193,4 +217,17 @@ public class HadoopDirectDataInput extends InputStream implements DataInput {
return new String(bytes, StandardCharsets.UTF_8);
}
+
+ /**
+ * Ensures the position is still within the buffer.
+ *
+ * @throws EOFException if an attempt is made to read beyond the buffer end.
+ */
+ private void checkRange(int bytesToRead) throws EOFException {
+ assert bytesToRead > 0;
+
+ if (pos + bytesToRead - 1 >= buf.length)
+ throw new EOFException("Attempt to read beyond the end of buffer: " + (pos + bytesToRead - 1)
+ + " >= " + buf.length);
+ }
}
[23/50] [abbrv] ignite git commit: IGNITE-4519 updating versions for
gce and jcloud
Posted by ag...@apache.org.
IGNITE-4519 updating versions for gce and jcloud
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2774d879
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2774d879
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2774d879
Branch: refs/heads/ignite-3477
Commit: 2774d879a72b0eeced862cc9a3fbd5d9c5ff2d72
Parents: 6c1cd16
Author: chandresh.pancholi <ch...@arvindinternet.com>
Authored: Thu Jan 5 02:31:13 2017 +0530
Committer: chandresh.pancholi <ch...@arvindinternet.com>
Committed: Thu Jan 5 02:31:13 2017 +0530
----------------------------------------------------------------------
modules/cloud/pom.xml | 6 +++---
modules/gce/pom.xml | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/2774d879/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 5ac1990..8d806f4 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -33,7 +33,7 @@
<url>http://ignite.apache.org</url>
<properties>
- <jcloud.version>1.9.0</jcloud.version>
+ <jcloud.version>2.0.0</jcloud.version>
</properties>
<dependencies>
@@ -52,13 +52,13 @@
<dependency>
<groupId>org.apache.jclouds.labs</groupId>
<artifactId>google-compute-engine</artifactId>
- <version>${jcloud.version}</version>
+ <version>1.9.3</version>
</dependency>
<dependency>
<groupId>org.apache.jclouds.labs</groupId>
<artifactId>docker</artifactId>
- <version>${jcloud.version}</version>
+ <version>1.9.3</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/ignite/blob/2774d879/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index b235d82..89f9a8b 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -44,13 +44,13 @@
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
- <version>1.19.1</version>
+ <version>1.22.0</version>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-storage</artifactId>
- <version>v1-rev32-1.20.0</version>
+ <version>v1-rev92-1.22.0</version>
</dependency>
<dependency>
[32/50] [abbrv] ignite git commit: IGNITE-4532 .NET: Fix build
warnings
Posted by ag...@apache.org.
IGNITE-4532 .NET: Fix build warnings
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/87fbb275
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/87fbb275
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/87fbb275
Branch: refs/heads/ignite-3477
Commit: 87fbb275eb9d11084485e6b4314b5bf7f8d42a1a
Parents: 825fe9c
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Jan 10 16:02:26 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Jan 10 16:02:26 2017 +0300
----------------------------------------------------------------------
.../platforms/cpp/common/project/vs/common.vcxproj | 1 +
modules/platforms/cpp/jni/project/vs/jni.vcxproj | 1 +
.../Apache.Ignite.AspNet.Tests.csproj | 7 ++++++-
.../Apache.Ignite.AspNet.csproj | 5 +++++
.../Apache.Ignite.Benchmarks.csproj | 5 +++++
.../Apache.Ignite.Core.Tests.TestDll.csproj | 5 +++++
.../Apache.Ignite.Core.Tests.csproj | 5 +++++
.../dotnet/Apache.Ignite.Core.Tests/TestUtils.cs | 1 -
.../Apache.Ignite.Core/Apache.Ignite.Core.csproj | 16 ++++++++--------
.../Impl/Unmanaged/UnmanagedUtils.cs | 4 ++--
.../Apache.Ignite.EntityFramework.Tests.csproj | 5 +++++
.../Apache.Ignite.EntityFramework.csproj | 9 +++++++--
.../Impl/ArrayDbDataReader.cs | 5 +++++
.../Impl/DataReaderResult.cs | 2 ++
.../Impl/DbCommandInfo.cs | 11 +++++++++++
.../Impl/DbCommandProxy.cs | 1 +
.../Apache.Ignite.Linq/Apache.Ignite.Linq.csproj | 5 +++++
.../Apache.Ignite.Log4Net.csproj | 5 +++++
.../Apache.Ignite.Log4Net/IgniteLog4NetLogger.cs | 16 ++++++++--------
.../Apache.Ignite.NLog/Apache.Ignite.NLog.csproj | 5 +++++
modules/platforms/dotnet/Apache.Ignite.sln | 3 +++
.../dotnet/Apache.Ignite/Apache.Ignite.csproj | 5 +++++
.../Apache.Ignite.Examples.csproj | 3 +++
.../Apache.Ignite.ExamplesDll.csproj | 4 ++++
.../Services/MapService.cs | 2 --
25 files changed, 107 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/cpp/common/project/vs/common.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/project/vs/common.vcxproj b/modules/platforms/cpp/common/project/vs/common.vcxproj
index 99fd551..b4431f8 100644
--- a/modules/platforms/cpp/common/project/vs/common.vcxproj
+++ b/modules/platforms/cpp/common/project/vs/common.vcxproj
@@ -97,6 +97,7 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;IGNITEJVM_EXPORTS;_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/cpp/jni/project/vs/jni.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/jni/project/vs/jni.vcxproj b/modules/platforms/cpp/jni/project/vs/jni.vcxproj
index f080a68..cb03197 100644
--- a/modules/platforms/cpp/jni/project/vs/jni.vcxproj
+++ b/modules/platforms/cpp/jni/project/vs/jni.vcxproj
@@ -97,6 +97,7 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;IGNITEJVM_EXPORTS;_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Apache.Ignite.AspNet.Tests.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Apache.Ignite.AspNet.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Apache.Ignite.AspNet.Tests.csproj
index aed74db..628942d 100644
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Apache.Ignite.AspNet.Tests.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Apache.Ignite.AspNet.Tests.csproj
@@ -21,7 +21,8 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>true</RunCodeAnalysis>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -30,6 +31,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
@@ -37,6 +39,9 @@
<PropertyGroup>
<AssemblyOriginatorKeyFile>Apache.Ignite.AspNet.Tests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
+ <PropertyGroup>
+ <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.Runners.2.6.3\tools\nunit.framework.dll</HintPath>
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.AspNet/Apache.Ignite.AspNet.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet/Apache.Ignite.AspNet.csproj b/modules/platforms/dotnet/Apache.Ignite.AspNet/Apache.Ignite.AspNet.csproj
index 2e501c1..4508776 100644
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet/Apache.Ignite.AspNet.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet/Apache.Ignite.AspNet.csproj
@@ -28,6 +28,7 @@
<RunCodeAnalysis>true</RunCodeAnalysis>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>Apache.Ignite.AspNet.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
@@ -37,6 +38,10 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>Apache.Ignite.AspNet.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\Release\Apache.Ignite.AspNet.XML</DocumentationFile>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ </PropertyGroup>
+ <PropertyGroup>
+ <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj
index 811047c..65dfc1e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Apache.Ignite.Benchmarks.csproj
@@ -27,12 +27,17 @@
<DefineConstants>DEBUG</DefineConstants>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<Optimize>true</Optimize>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ </PropertyGroup>
+ <PropertyGroup>
+ <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Apache.Ignite.Core.Tests.TestDll.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Apache.Ignite.Core.Tests.TestDll.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Apache.Ignite.Core.Tests.TestDll.csproj
index b33023a..db7a4d1 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Apache.Ignite.Core.Tests.TestDll.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Apache.Ignite.Core.Tests.TestDll.csproj
@@ -23,12 +23,17 @@
<OutputPath>bin\Debug\</OutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<Optimize>true</Optimize>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ </PropertyGroup>
+ <PropertyGroup>
+ <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
index 55adfe4..78a08d2 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
@@ -28,6 +28,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
@@ -35,6 +36,10 @@
<Optimize>true</Optimize>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ </PropertyGroup>
+ <PropertyGroup>
+ <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
index ad27398..8360bf1 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-#pragma warning disable S2360 // Optional parameters should not be used
namespace Apache.Ignite.Core.Tests
{
using System;
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
index b2db0a7..a80dfc0 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
@@ -21,6 +21,7 @@
<DocumentationFile>bin\x64\Debug\Apache.Ignite.Core.XML</DocumentationFile>
<RunCodeAnalysis>false</RunCodeAnalysis>
<CodeAnalysisRuleSet>Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
@@ -30,6 +31,7 @@
<Optimize>true</Optimize>
<DocumentationFile>bin\x64\Release\Apache.Ignite.Core.XML</DocumentationFile>
<CodeAnalysisRuleSet>Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
@@ -39,6 +41,7 @@
<CodeAnalysisRuleSet>Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\x86\Debug\Apache.Ignite.Core.XML</DocumentationFile>
<CodeAnalysisRuleSet>Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
@@ -48,6 +51,7 @@
<Optimize>true</Optimize>
<DocumentationFile>bin\x86\Release\Apache.Ignite.Core.XML</DocumentationFile>
<CodeAnalysisRuleSet>Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
@@ -67,6 +71,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
@@ -76,6 +81,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
<DebugType>none</DebugType>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -514,10 +520,10 @@
</ItemGroup>
<ItemGroup Condition="'$(Platform)' == 'AnyCPU'">
<EmbeddedResource Include="$(ProjectDir)..\..\cpp\jni\project\vs\x64\$(Configuration)\ignite.jni.dll">
- <Link>resources\$(Configuration)\x64\ignite.jni.dll</Link>
+ <Link>resources\x64\ignite.jni.dll</Link>
</EmbeddedResource>
<EmbeddedResource Include="$(ProjectDir)..\..\cpp\jni\project\vs\Win32\$(Configuration)\ignite.jni.dll" Condition="'$(Configuration)' == 'Release' Or Exists('$(ProjectDir)..\..\cpp\jni\project\vs\Win32\$(Configuration)\ignite.jni.dll')">
- <Link>resources\$(Configuration)\x86\ignite.jni.dll</Link>
+ <Link>resources\x86\ignite.jni.dll</Link>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
@@ -537,12 +543,6 @@
<ItemGroup>
<Folder Include="Impl\Common\JavaObjects\" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\cpp\jni\project\vs\jni.vcxproj">
- <Project>{4f7e4917-4612-4b96-9838-025711ade391}</Project>
- <Name>jni</Name>
- </ProjectReference>
- </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup Condition="'$(Platform)' == 'AnyCPU'">
<PreBuildEvent>cd "$(ProjectDir)"
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
index 0a2a1f0..34baee0 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs
@@ -38,9 +38,9 @@ namespace Apache.Ignite.Core.Impl.Unmanaged
[SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
static UnmanagedUtils()
{
- var platfrom = Environment.Is64BitProcess ? "x64" : "x86";
+ var platform = Environment.Is64BitProcess ? "x64" : "x86";
- var resName = string.Format("{0}.{1}", platfrom, IgniteUtils.FileIgniteJniDll);
+ var resName = string.Format("{0}.{1}", platform, IgniteUtils.FileIgniteJniDll);
var path = IgniteUtils.UnpackEmbeddedResource(resName, IgniteUtils.FileIgniteJniDll);
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Apache.Ignite.EntityFramework.Tests.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Apache.Ignite.EntityFramework.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Apache.Ignite.EntityFramework.Tests.csproj
index 9711087..b03d5f0 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Apache.Ignite.EntityFramework.Tests.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Apache.Ignite.EntityFramework.Tests.csproj
@@ -20,6 +20,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -28,6 +29,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
@@ -35,6 +37,9 @@
<PropertyGroup>
<AssemblyOriginatorKeyFile>Apache.Ignite.EntityFramework.Tests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
+ <PropertyGroup>
+ <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework">
<HintPath>..\packages\EntityFramework.6.1.3\lib\net40\EntityFramework.dll</HintPath>
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj
index 7082182..372c2ed 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Apache.Ignite.EntityFramework.csproj
@@ -21,9 +21,10 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>true</RunCodeAnalysis>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Debug\Apache.Ignite.EntityFramework.XML</DocumentationFile>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -32,7 +33,8 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
- <DocumentationFile>bin\Release\Apache.Ignite.EntityFramework.XML</DocumentationFile>
+ <DocumentationFile>bin\Release\Apache.Ignite.EntityFramework.XML</DocumentationFile>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
@@ -40,6 +42,9 @@
<PropertyGroup>
<AssemblyOriginatorKeyFile>Apache.Ignite.EntityFramework.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
+ <PropertyGroup>
+ <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.3\lib\net40\EntityFramework.dll</HintPath>
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/ArrayDbDataReader.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/ArrayDbDataReader.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/ArrayDbDataReader.cs
index 89523f4..0cf31e5 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/ArrayDbDataReader.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/ArrayDbDataReader.cs
@@ -117,6 +117,7 @@ namespace Apache.Ignite.EntityFramework.Impl
}
/** <inheritDoc /> */
+ [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")]
public override long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length)
{
Debug.Assert(buffer != null);
@@ -137,6 +138,7 @@ namespace Apache.Ignite.EntityFramework.Impl
}
/** <inheritDoc /> */
+ [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")]
public override long GetChars(int ordinal, long dataOffset, char[] buffer, int bufferOffset, int length)
{
Debug.Assert(buffer != null);
@@ -193,8 +195,11 @@ namespace Apache.Ignite.EntityFramework.Impl
}
/** <inheritDoc /> */
+ [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")]
public override int GetValues(object[] values)
{
+ Debug.Assert(values != null);
+
var row = GetRow();
var size = Math.Min(row.Length, values.Length);
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DataReaderResult.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DataReaderResult.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DataReaderResult.cs
index 48f763c..b683184 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DataReaderResult.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DataReaderResult.cs
@@ -21,6 +21,7 @@ namespace Apache.Ignite.EntityFramework.Impl
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
+ using System.Diagnostics.CodeAnalysis;
using System.Linq;
/// <summary>
@@ -38,6 +39,7 @@ namespace Apache.Ignite.EntityFramework.Impl
/// <summary>
/// Initializes a new instance of the <see cref="DataReaderResult"/> class.
/// </summary>
+ [SuppressMessage("Microsoft.Usage", "CA2202: Do not call Dispose more than one time on an object")]
public DataReaderResult(IDataReader reader)
{
try
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandInfo.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandInfo.cs
index 6b5db05..b80764c 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandInfo.cs
@@ -21,6 +21,7 @@ namespace Apache.Ignite.EntityFramework.Impl
using System.Data.Entity.Core.Common.CommandTrees;
using System.Data.Entity.Core.Metadata.Edm;
using System.Diagnostics;
+ using System.Diagnostics.CodeAnalysis;
using System.Linq;
/// <summary>
@@ -166,8 +167,18 @@ namespace Apache.Ignite.EntityFramework.Impl
public static readonly EntitySetComparer Instance = new EntitySetComparer();
/** <inheritdoc /> */
+ [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")]
public int Compare(EntitySetBase x, EntitySetBase y)
{
+ if (x == null && y == null)
+ return 0;
+
+ if (x == null)
+ return -1;
+
+ if (y == null)
+ return 1;
+
return string.CompareOrdinal(x.Name, y.Name);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandProxy.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandProxy.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandProxy.cs
index e3353d5..0eb90ae 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandProxy.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Impl/DbCommandProxy.cs
@@ -73,6 +73,7 @@ namespace Apache.Ignite.EntityFramework.Impl
}
/** <inheritDoc /> */
+ [SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Justification = "This class is just a proxy.")]
public override string CommandText
{
get { return _command.CommandText; }
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Linq/Apache.Ignite.Linq.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/Apache.Ignite.Linq.csproj b/modules/platforms/dotnet/Apache.Ignite.Linq/Apache.Ignite.Linq.csproj
index 72e050c..04b4916 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Linq/Apache.Ignite.Linq.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Linq/Apache.Ignite.Linq.csproj
@@ -21,6 +21,7 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>..\Apache.Ignite.Core\Apache.Ignite.Core.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>false</RunCodeAnalysis>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
@@ -30,6 +31,7 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\Release\Apache.Ignite.Linq.XML</DocumentationFile>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
@@ -37,6 +39,9 @@
<PropertyGroup>
<AssemblyOriginatorKeyFile>Apache.Ignite.Linq.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
+ <PropertyGroup>
+ <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="Remotion.Linq, Version=2.0.0.0, Culture=neutral, PublicKeyToken=fee00910d6e5f53b, processorArchitecture=MSIL">
<HintPath>..\packages\Remotion.Linq.2.0.1\lib\net40\Remotion.Linq.dll</HintPath>
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj b/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj
index af5b7e4..142ce73 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Log4Net/Apache.Ignite.Log4Net.csproj
@@ -22,6 +22,7 @@
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
@@ -30,6 +31,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Apache.Ignite.Log4Net.XML</DocumentationFile>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
@@ -37,6 +39,9 @@
<PropertyGroup>
<AssemblyOriginatorKeyFile>Apache.Ignite.Log4Net.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
+ <PropertyGroup>
+ <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.5\lib\net40-full\log4net.dll</HintPath>
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.Log4Net/IgniteLog4NetLogger.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Log4Net/IgniteLog4NetLogger.cs b/modules/platforms/dotnet/Apache.Ignite.Log4Net/IgniteLog4NetLogger.cs
index 058176f..1270600 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Log4Net/IgniteLog4NetLogger.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Log4Net/IgniteLog4NetLogger.cs
@@ -55,7 +55,7 @@ namespace Apache.Ignite.Log4Net
/// <summary>
/// Logs the specified message.
/// </summary>
- /// <param name="logLevel">The level.</param>
+ /// <param name="level">The level.</param>
/// <param name="message">The message.</param>
/// <param name="args">The arguments to format <paramref name="message" />.
/// Can be null (formatting will not occur).</param>
@@ -63,10 +63,10 @@ namespace Apache.Ignite.Log4Net
/// <param name="category">The logging category name.</param>
/// <param name="nativeErrorInfo">The native error information.</param>
/// <param name="ex">The exception. Can be null.</param>
- public void Log(LogLevel logLevel, string message, object[] args, IFormatProvider formatProvider,
+ public void Log(LogLevel level, string message, object[] args, IFormatProvider formatProvider,
string category, string nativeErrorInfo, Exception ex)
{
- var level = ConvertLogLevel(logLevel);
+ var logLevel = ConvertLogLevel(level);
var repo = _log.Logger.Repository;
@@ -74,7 +74,7 @@ namespace Apache.Ignite.Log4Net
? (object) message
: new SystemStringFormat(formatProvider, message, args);
- var evt = new LoggingEvent(GetType(), repo, category, level, messageObject, ex);
+ var evt = new LoggingEvent(GetType(), repo, category, logLevel, messageObject, ex);
if (nativeErrorInfo != null)
evt.Properties["nativeErrorInfo"] = nativeErrorInfo;
@@ -85,15 +85,15 @@ namespace Apache.Ignite.Log4Net
/// <summary>
/// Determines whether the specified log level is enabled.
/// </summary>
- /// <param name="logLevel">The level.</param>
+ /// <param name="level">The level.</param>
/// <returns>
/// Value indicating whether the specified log level is enabled
/// </returns>
- public bool IsEnabled(LogLevel logLevel)
+ public bool IsEnabled(LogLevel level)
{
- var level = ConvertLogLevel(logLevel);
+ var logLevel = ConvertLogLevel(level);
- return _log.Logger.IsEnabledFor(level);
+ return _log.Logger.IsEnabledFor(logLevel);
}
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.NLog/Apache.Ignite.NLog.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.NLog/Apache.Ignite.NLog.csproj b/modules/platforms/dotnet/Apache.Ignite.NLog/Apache.Ignite.NLog.csproj
index 9fc6ffc..520763b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.NLog/Apache.Ignite.NLog.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.NLog/Apache.Ignite.NLog.csproj
@@ -20,6 +20,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
@@ -28,6 +29,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Apache.Ignite.NLog.XML</DocumentationFile>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
@@ -35,6 +37,9 @@
<PropertyGroup>
<AssemblyOriginatorKeyFile>Apache.Ignite.NLog.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
+ <PropertyGroup>
+ <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.3.7\lib\net40\NLog.dll</HintPath>
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite.sln
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.sln b/modules/platforms/dotnet/Apache.Ignite.sln
index bcaa753..fe83ccd 100644
--- a/modules/platforms/dotnet/Apache.Ignite.sln
+++ b/modules/platforms/dotnet/Apache.Ignite.sln
@@ -2,6 +2,9 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Ignite.Core", "Apache.Ignite.Core\Apache.Ignite.Core.csproj", "{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}"
+ ProjectSection(ProjectDependencies) = postProject
+ {4F7E4917-4612-4B96-9838-025711ADE391} = {4F7E4917-4612-4B96-9838-025711ADE391}
+ EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Ignite.Core.Tests", "Apache.Ignite.Core.Tests\Apache.Ignite.Core.Tests.csproj", "{6A62F66C-DA5B-4FBB-8CE7-A95F740FDC7A}"
EndProject
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj b/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj
index e98ddd1..13379f5 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite/Apache.Ignite.csproj
@@ -23,12 +23,17 @@
<OutputPath>bin\Debug\</OutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<Optimize>true</Optimize>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ </PropertyGroup>
+ <PropertyGroup>
+ <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Apache.Ignite.Examples.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Apache.Ignite.Examples.csproj b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Apache.Ignite.Examples.csproj
index 7d0b438..3f7e1dc 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Apache.Ignite.Examples.csproj
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Apache.Ignite.Examples.csproj
@@ -35,6 +35,9 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
+ <PropertyGroup>
+ <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="Apache.Ignite.Core">
<HintPath Condition="Exists('..\..\Apache.Ignite')">..\..\Apache.Ignite\bin\$(Configuration)\Apache.Ignite.Core.dll</HintPath>
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
index 8515bf6..6ea6227 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
@@ -11,6 +11,7 @@
<AssemblyName>Apache.Ignite.ExamplesDll</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
+ <NoWarn>649</NoWarn>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
@@ -32,6 +33,9 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
+ <PropertyGroup>
+ <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="Apache.Ignite.Core">
<HintPath Condition="Exists('..\..\Apache.Ignite')">..\..\Apache.Ignite\bin\$(Configuration)\Apache.Ignite.Core.dll</HintPath>
http://git-wip-us.apache.org/repos/asf/ignite/blob/87fbb275/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Services/MapService.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Services/MapService.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Services/MapService.cs
index 958d91d..7071cd4 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Services/MapService.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Services/MapService.cs
@@ -30,9 +30,7 @@ namespace Apache.Ignite.ExamplesDll.Services
public class MapService<TK, TV> : IService
{
/** Injected Ignite instance. */
-#pragma warning disable 649
[InstanceResource] private readonly IIgnite _ignite;
-#pragma warning restore 649
/** Cache. */
private ICache<TK, TV> _cache;
[48/50] [abbrv] ignite git commit: Merge branch ignite-gg-8.0.2.ea2
into ignite-db-x
Posted by ag...@apache.org.
Merge branch ignite-gg-8.0.2.ea2 into ignite-db-x
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0ee73fb0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0ee73fb0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0ee73fb0
Branch: refs/heads/ignite-3477
Commit: 0ee73fb097a6d0e15fbfd6ae8acedac46c45a640
Parents: 53e2cd2 b0ac987
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Jan 17 13:06:46 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Jan 17 13:06:46 2017 +0300
----------------------------------------------------------------------
.gitignore | 1 +
README.md | 8 +
RELEASE_NOTES.txt | 22 +
assembly/dependencies-fabric-lgpl.xml | 1 +
assembly/dependencies-fabric.xml | 1 +
assembly/release-base.xml | 5 +
assembly/release-fabric-base.xml | 1 +
bin/control.bat | 229 ++
bin/control.sh | 180 +
bin/ignite.sh | 9 +
config/dotnet/default-dotnet.xml | 45 +
examples/pom-standalone.xml | 6 +
examples/pom.xml | 2 +-
examples/redis/redis-example.php | 82 +
examples/redis/redis-example.py | 62 +
examples/schema-import/pom.xml | 2 +-
.../ignite/examples/ExampleNodeStartup.java | 2 +-
.../examples/datagrid/CachePutGetExample.java | 2 +-
.../examples/datagrid/CacheQueryDmlExample.java | 163 +
.../scalar/examples/ScalarJvmCloudExample.scala | 2 +-
.../CacheExamplesMultiNodeSelfTest.java | 7 +
.../ignite/examples/CacheExamplesSelfTest.java | 8 +
modules/aop/pom.xml | 2 +-
modules/apache-license-gen/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/benchmarks/pom.xml | 2 +-
.../jmh/misc/JmhIncrementBenchmark.java | 95 +
modules/camel/pom.xml | 2 +-
modules/cassandra/pom.xml | 16 +-
modules/cassandra/serializers/README.txt | 7 +-
modules/cassandra/serializers/pom.xml | 4 +-
modules/cassandra/store/pom.xml | 4 +-
.../store/cassandra/CassandraCacheStore.java | 6 +
.../store/cassandra/datasource/DataSource.java | 9 +
modules/clients/pom.xml | 12 +-
.../clients/src/test/config/jdbc-bin-config.xml | 54 +
.../jdbc2/JdbcAbstractDmlStatementSelfTest.java | 263 ++
.../JdbcAbstractUpdateStatementSelfTest.java | 37 +
...BinaryMarshallerInsertStatementSelfTest.java | 37 +
...cBinaryMarshallerMergeStatementSelfTest.java | 37 +
.../jdbc2/JdbcDeleteStatementSelfTest.java | 49 +
.../jdbc2/JdbcInsertStatementSelfTest.java | 122 +
.../jdbc2/JdbcMergeStatementSelfTest.java | 91 +
.../internal/jdbc2/JdbcNoDefaultCacheTest.java | 40 +-
.../internal/jdbc2/JdbcResultSetSelfTest.java | 18 +
.../rest/ChangeStateCommandHandlerTest.java | 125 +
.../rest/ClientMemcachedProtocolSelfTest.java | 4 +-
.../JettyRestProcessorAbstractSelfTest.java | 11 +-
.../rest/RestProcessorMultiStartSelfTest.java | 48 +-
.../rest/protocols/tcp/MockNioSession.java | 11 +
.../tcp/redis/RedisProtocolSelfTest.java | 101 +-
.../jdbc/suite/IgniteJdbcDriverTestSuite.java | 5 +
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
.../ignite/codegen/MessageCodeGenerator.java | 2 +
modules/core/pom.xml | 2 +-
.../src/main/java/org/apache/ignite/Ignite.java | 8 +-
.../java/org/apache/ignite/IgniteCache.java | 9 +
.../apache/ignite/IgniteCheckedException.java | 12 +
.../java/org/apache/ignite/IgniteLogger.java | 6 +-
.../java/org/apache/ignite/IgniteServices.java | 16 +
.../apache/ignite/IgniteSystemProperties.java | 58 +
.../binary/BinaryAbstractIdentityResolver.java | 53 +
.../binary/BinaryArrayIdentityResolver.java | 224 ++
.../binary/BinaryFieldIdentityResolver.java | 307 ++
.../ignite/binary/BinaryIdentityResolver.java | 42 +
.../ignite/binary/BinaryTypeConfiguration.java | 27 +-
.../org/apache/ignite/cache/QueryEntity.java | 27 +
.../rendezvous/RendezvousAffinityFunction.java | 80 +-
.../ignite/cache/query/SqlFieldsQuery.java | 2 +-
.../cache/store/CacheLoadOnlyStoreAdapter.java | 6 +-
.../ignite/cache/store/CacheStoreAdapter.java | 6 +
.../cache/store/jdbc/CacheJdbcPojoStore.java | 19 +-
.../store/jdbc/JdbcTypesDefaultTransformer.java | 112 +-
.../store/jdbc/dialect/BasicJdbcDialect.java | 31 +-
.../configuration/CacheConfiguration.java | 49 +-
.../configuration/IgniteConfiguration.java | 50 +-
.../apache/ignite/internal/GridComponent.java | 7 +-
.../internal/GridEventConsumeHandler.java | 7 +-
.../ignite/internal/GridJobContextImpl.java | 4 +-
.../ignite/internal/GridKernalContext.java | 17 +
.../ignite/internal/GridKernalContextImpl.java | 28 +-
.../internal/GridMessageListenHandler.java | 5 +-
.../internal/GridPerformanceSuggestions.java | 2 +-
.../ignite/internal/GridPluginComponent.java | 4 +-
.../org/apache/ignite/internal/GridTopic.java | 6 +-
.../ignite/internal/IgniteInternalFuture.java | 11 +
.../apache/ignite/internal/IgniteKernal.java | 187 +-
.../ignite/internal/IgniteServicesImpl.java | 9 +-
.../org/apache/ignite/internal/IgnitionEx.java | 37 +-
.../ignite/internal/MarshallerContextImpl.java | 10 +-
.../internal/binary/BinaryClassDescriptor.java | 27 +-
.../ignite/internal/binary/BinaryContext.java | 80 +-
.../ignite/internal/binary/BinaryFieldImpl.java | 10 +-
.../internal/binary/BinaryObjectExImpl.java | 90 +-
.../internal/binary/BinaryObjectImpl.java | 48 +-
.../binary/BinaryObjectOffheapImpl.java | 42 +-
.../internal/binary/BinaryPrimitives.java | 30 +-
.../binary/BinarySerializedFieldComparator.java | 343 ++
.../ignite/internal/binary/BinaryTypeProxy.java | 15 +-
.../ignite/internal/binary/BinaryUtils.java | 16 +-
.../internal/binary/BinaryWriterExImpl.java | 47 +-
.../internal/binary/GridBinaryMarshaller.java | 2 +-
.../binary/builder/BinaryBuilderReader.java | 11 +
.../binary/builder/BinaryBuilderSerializer.java | 4 +
.../binary/builder/BinaryObjectBuilderImpl.java | 27 +-
.../streams/BinaryAbstractInputStream.java | 5 +
.../streams/BinaryAbstractOutputStream.java | 5 +
.../streams/BinaryByteBufferInputStream.java | 10 +
.../binary/streams/BinaryHeapInputStream.java | 9 +-
.../binary/streams/BinaryHeapOutputStream.java | 7 +-
.../streams/BinaryMemoryAllocatorChunk.java | 3 +-
.../streams/BinaryOffheapInputStream.java | 14 +-
.../streams/BinaryOffheapOutputStream.java | 8 +-
.../internal/binary/streams/BinaryStream.java | 12 +-
.../ignite/internal/client/GridClient.java | 9 +
.../internal/client/GridClientClusterState.java | 33 +
.../client/impl/GridClientClusterStateImpl.java | 75 +
.../internal/client/impl/GridClientImpl.java | 11 +
.../impl/connection/GridClientConnection.java | 17 +
.../GridClientConnectionManagerAdapter.java | 8 +-
.../connection/GridClientNioTcpConnection.java | 21 +
.../impl/connection/GridClientTopology.java | 53 +-
.../router/impl/GridRouterClientImpl.java | 6 +
.../internal/commandline/CommandHandler.java | 89 +
.../ignite/internal/jdbc2/JdbcConnection.java | 17 +
.../internal/jdbc2/JdbcPreparedStatement.java | 71 +-
.../ignite/internal/jdbc2/JdbcQueryTask.java | 5 +-
.../ignite/internal/jdbc2/JdbcQueryTaskV2.java | 406 ++
.../ignite/internal/jdbc2/JdbcResultSet.java | 72 +-
.../internal/jdbc2/JdbcSqlFieldsQuery.java | 49 +
.../ignite/internal/jdbc2/JdbcStatement.java | 213 +-
.../apache/ignite/internal/jdbc2/JdbcUtils.java | 25 +-
.../internal/managers/GridManagerAdapter.java | 2 +-
.../checkpoint/GridCheckpointManager.java | 2 +-
.../collision/GridCollisionManager.java | 2 +-
.../managers/communication/GridIoManager.java | 35 +-
.../managers/communication/GridIoMessage.java | 13 +
.../communication/GridIoMessageFactory.java | 71 +-
.../communication/IgniteIoTestMessage.java | 13 +-
.../deployment/GridDeploymentManager.java | 2 +-
.../discovery/GridDiscoveryManager.java | 125 +-
.../eventstorage/GridEventStorageManager.java | 2 +-
.../managers/failover/GridFailoverManager.java | 2 +-
.../managers/indexing/GridIndexingManager.java | 2 +-
.../loadbalancer/GridLoadBalancerManager.java | 2 +-
.../ignite/internal/pagemem/FullPageId.java | 30 +-
.../ignite/internal/pagemem/PageIdUtils.java | 8 +
.../pagemem/backup/BackupFinishedMessage.java | 136 -
.../StartFullBackupAckDiscoveryMessage.java | 128 -
.../backup/StartFullBackupDiscoveryMessage.java | 135 -
.../pagemem/impl/PageMemoryNoStoreImpl.java | 2 +-
.../snapshot/SnapshotFinishedMessage.java | 136 +
.../snapshot/SnapshotProgressMessage.java | 135 +
.../StartFullSnapshotAckDiscoveryMessage.java | 147 +
.../StartFullSnapshotDiscoveryMessage.java | 160 +
.../pagemem/store/IgnitePageStoreManager.java | 13 +-
.../internal/pagemem/store/PageStore.java | 2 +-
.../pagemem/wal/IgniteWriteAheadLogManager.java | 3 +-
.../wal/record/MemoryRecoveryRecord.java | 23 +-
.../internal/pagemem/wal/record/WALRecord.java | 23 +-
.../MetaPageUpdateCandidateAllocatedIndex.java | 63 -
.../MetaPageUpdateLastSuccessfulBackupId.java | 59 -
...etaPageUpdateLastSuccessfulFullBackupId.java | 59 -
...aPageUpdateLastSuccessfulFullSnapshotId.java | 59 +
.../MetaPageUpdateLastSuccessfulSnapshotId.java | 70 +
.../delta/MetaPageUpdateNextBackupId.java | 59 -
.../delta/MetaPageUpdateNextSnapshotId.java | 59 +
.../MetaPageUpdatePartitionDataRecord.java | 15 +-
.../delta/PageListMetaResetCountRecord.java | 47 +
.../record/delta/TrackingPageDeltaRecord.java | 28 +-
.../processors/GridProcessorAdapter.java | 4 +-
.../affinity/GridAffinityProcessor.java | 4 +-
.../cache/CacheAffinitySharedManager.java | 9 +
.../processors/cache/CacheLockCandidates.java | 42 +
.../cache/CacheLockCandidatesList.java | 71 +
.../internal/processors/cache/CacheState.java | 33 -
.../cache/CacheStoreBalancingWrapper.java | 6 +
.../cache/ChangeGlobalStateMessage.java | 120 +
.../internal/processors/cache/ClusterState.java | 38 +
.../cache/DynamicCacheChangeRequest.java | 31 +-
.../cache/DynamicCacheDescriptor.java | 17 +
.../processors/cache/GridCacheAdapter.java | 756 ++--
.../processors/cache/GridCacheContext.java | 8 +
.../processors/cache/GridCacheEntryEx.java | 7 +-
.../cache/GridCacheLoaderWriterStore.java | 6 +
.../processors/cache/GridCacheMapEntry.java | 141 +-
.../processors/cache/GridCacheMessage.java | 7 +
.../processors/cache/GridCacheMvcc.java | 376 +-
.../processors/cache/GridCacheMvccCallback.java | 4 +-
.../cache/GridCacheMvccCandidate.java | 80 +-
.../processors/cache/GridCacheMvccManager.java | 19 +-
.../GridCachePartitionExchangeManager.java | 211 +-
.../processors/cache/GridCachePreloader.java | 16 +-
.../cache/GridCachePreloaderAdapter.java | 14 +-
.../processors/cache/GridCacheProcessor.java | 472 ++-
.../processors/cache/GridCacheProxyImpl.java | 24 +-
.../processors/cache/GridCacheTtlManager.java | 9 +-
.../processors/cache/GridCacheUtils.java | 62 +-
.../GridChangeGlobalStateMessageResponse.java | 177 +
.../cache/IgniteCacheOffheapManager.java | 22 +-
.../cache/IgniteCacheOffheapManagerImpl.java | 184 +-
.../processors/cache/IgniteCacheProxy.java | 14 +-
.../processors/cache/IgniteInternalCache.java | 8 +
.../processors/cache/QueryCursorImpl.java | 31 +-
.../binary/CacheObjectBinaryProcessorImpl.java | 9 +-
.../IgniteCacheDatabaseSharedManager.java | 66 +-
.../cache/database/freelist/PagesList.java | 4 +
.../cache/database/tree/BPlusTree.java | 23 +-
.../cache/database/tree/io/PageMetaIO.java | 95 +-
.../cache/database/tree/io/TrackingPageIO.java | 124 +-
.../cache/database/tree/util/PageHandler.java | 15 +-
.../CacheDataStructuresManager.java | 6 +-
.../distributed/GridCacheTxRecoveryFuture.java | 4 +-
.../distributed/GridDistributedCacheEntry.java | 303 +-
.../distributed/GridDistributedLockRequest.java | 5 +
.../GridDistributedTxRemoteAdapter.java | 14 +-
.../GridDistributedUnlockRequest.java | 5 +
.../dht/GridClientPartitionTopology.java | 71 +-
.../distributed/dht/GridDhtCacheAdapter.java | 3 +-
.../distributed/dht/GridDhtCacheEntry.java | 34 +-
.../cache/distributed/dht/GridDhtGetFuture.java | 2 +-
.../distributed/dht/GridDhtLocalPartition.java | 129 +-
.../distributed/dht/GridDhtLockFuture.java | 61 +-
.../distributed/dht/GridDhtLockResponse.java | 9 +-
.../dht/GridDhtPartitionTopology.java | 22 +-
.../dht/GridDhtPartitionTopologyImpl.java | 382 +-
.../dht/GridDhtTransactionalCacheAdapter.java | 1 -
.../distributed/dht/GridDhtTxFinishFuture.java | 79 +-
.../cache/distributed/dht/GridDhtTxLocal.java | 125 +-
.../distributed/dht/GridDhtTxLocalAdapter.java | 7 +-
.../dht/GridDhtTxOnePhaseCommitAckRequest.java | 2 +-
.../distributed/dht/GridDhtTxPrepareFuture.java | 9 +-
.../dht/atomic/GridDhtAtomicCache.java | 461 ++-
.../GridDhtAtomicSingleUpdateRequest.java | 7 +-
.../dht/atomic/GridDhtAtomicUpdateRequest.java | 5 +
...idNearAtomicAbstractSingleUpdateRequest.java | 28 +-
.../atomic/GridNearAtomicFullUpdateRequest.java | 69 +-
...GridNearAtomicSingleUpdateInvokeRequest.java | 6 +-
.../GridNearAtomicSingleUpdateRequest.java | 7 +-
.../dht/colocated/GridDhtColocatedCache.java | 13 -
.../colocated/GridDhtColocatedLockFuture.java | 12 +-
.../dht/preloader/GridDhtPartitionDemander.java | 277 +-
.../dht/preloader/GridDhtPartitionFullMap.java | 18 +-
.../dht/preloader/GridDhtPartitionMap2.java | 4 +
.../GridDhtPartitionsAbstractMessage.java | 3 +-
.../GridDhtPartitionsExchangeFuture.java | 218 +-
.../preloader/GridDhtPartitionsFullMessage.java | 83 +-
.../GridDhtPartitionsSingleMessage.java | 81 +-
.../GridDhtPartitionsSingleRequest.java | 3 +-
.../dht/preloader/GridDhtPreloader.java | 47 +-
.../distributed/near/GridNearAtomicCache.java | 65 +-
.../distributed/near/GridNearCacheEntry.java | 44 +-
.../distributed/near/GridNearGetRequest.java | 5 +
.../distributed/near/GridNearLockFuture.java | 7 +-
...arOptimisticSerializableTxPrepareFuture.java | 4 +-
.../near/GridNearOptimisticTxPrepareFuture.java | 15 +-
.../GridNearPessimisticTxPrepareFuture.java | 4 +-
.../near/GridNearTransactionalCache.java | 5 +-
.../near/GridNearTxFinishFuture.java | 46 +-
.../cache/distributed/near/GridNearTxLocal.java | 48 +-
.../processors/cache/local/GridLocalCache.java | 7 +-
.../cache/local/GridLocalCacheEntry.java | 173 +-
.../cache/local/GridLocalLockFuture.java | 2 +-
.../local/atomic/GridLocalAtomicCache.java | 174 +-
.../query/GridCacheDistributedQueryManager.java | 2 +-
.../cache/query/GridCacheQueryManager.java | 48 +-
.../cache/query/GridCacheQueryRequest.java | 6 +-
.../cache/query/GridCacheTwoStepQuery.java | 253 --
.../cache/query/IgniteQueryErrorCode.java | 91 +
.../continuous/CacheContinuousQueryHandler.java | 37 +-
.../cache/store/CacheStoreManager.java | 4 +-
.../store/GridCacheStoreManagerAdapter.java | 34 +-
.../cache/store/GridCacheWriteBehindStore.java | 6 +-
.../cache/transactions/IgniteTxHandler.java | 17 +-
.../transactions/IgniteTxLocalAdapter.java | 38 +-
.../cache/transactions/IgniteTxManager.java | 20 +-
.../cacheobject/IgniteCacheObjectProcessor.java | 2 +-
.../clock/GridClockSyncProcessor.java | 8 +-
.../closure/GridClosureProcessor.java | 33 +-
.../processors/cluster/ClusterProcessor.java | 2 +-
.../cluster/GridClusterStateProcessor.java | 941 +++++
.../cluster/IgniteChangeGlobalStateSupport.java | 40 +
.../continuous/GridContinuousHandler.java | 5 +-
.../continuous/GridContinuousProcessor.java | 7 +-
.../StartRoutineAckDiscoveryMessage.java | 13 +-
.../StartRoutineDiscoveryMessage.java | 19 +-
.../datastreamer/DataStreamProcessor.java | 24 +-
.../datastructures/DataStructuresProcessor.java | 132 +-
.../datastructures/GridCacheAtomicLongImpl.java | 14 +-
.../GridCacheAtomicReferenceImpl.java | 16 +-
.../GridCacheAtomicSequenceImpl.java | 26 +-
.../GridCacheAtomicStampedImpl.java | 14 +-
.../GridCacheCountDownLatchImpl.java | 14 +-
.../datastructures/GridCacheLockImpl.java | 17 +-
.../datastructures/GridCacheSemaphoreImpl.java | 14 +-
.../processors/hadoop/HadoopClassLoader.java | 11 +
.../internal/processors/hadoop/HadoopJobId.java | 79 +-
.../processors/hadoop/HadoopJobProperty.java | 64 +-
.../hadoop/HadoopMapperAwareTaskOutput.java | 32 +
.../processors/hadoop/HadoopTaskContext.java | 8 +
.../processors/hadoop/HadoopTaskInfo.java | 43 +
.../io/PartiallyOffheapRawComparatorEx.java | 33 +
.../hadoop/message/HadoopMessage.java | 27 +
.../shuffle/HadoopDirectShuffleMessage.java | 243 ++
.../hadoop/shuffle/HadoopShuffleAck.java | 170 +
.../shuffle/HadoopShuffleFinishRequest.java | 172 +
.../shuffle/HadoopShuffleFinishResponse.java | 142 +
.../hadoop/shuffle/HadoopShuffleMessage.java | 361 ++
.../internal/processors/igfs/IgfsContext.java | 4 +-
.../processors/igfs/IgfsDataManager.java | 6 +-
.../internal/processors/igfs/IgfsImpl.java | 2 +-
.../internal/processors/igfs/IgfsProcessor.java | 4 +-
.../processors/job/GridJobProcessor.java | 2 +-
.../internal/processors/job/GridJobWorker.java | 76 +-
.../jobmetrics/GridJobMetricsProcessor.java | 2 +-
.../processors/odbc/OdbcMessageParser.java | 16 +
.../processors/odbc/OdbcNioListener.java | 2 +-
.../internal/processors/odbc/OdbcProcessor.java | 11 +-
.../odbc/OdbcQueryGetParamsMetaRequest.java | 60 +
.../odbc/OdbcQueryGetParamsMetaResult.java | 40 +
.../internal/processors/odbc/OdbcRequest.java | 3 +
.../processors/odbc/OdbcRequestHandler.java | 181 +-
.../internal/processors/odbc/OdbcTableMeta.java | 15 +-
.../internal/processors/odbc/OdbcUtils.java | 4 +-
.../platform/PlatformAbstractTarget.java | 268 +-
.../platform/PlatformAsyncTarget.java | 44 +
.../platform/PlatformContextImpl.java | 2 +-
.../platform/PlatformNoopProcessor.java | 41 +-
.../processors/platform/PlatformProcessor.java | 42 +-
.../platform/PlatformProcessorImpl.java | 89 +-
.../processors/platform/PlatformTarget.java | 103 +-
.../platform/PlatformTargetProxy.java | 126 +
.../platform/PlatformTargetProxyImpl.java | 222 ++
.../binary/PlatformBinaryProcessor.java | 6 +-
.../platform/cache/PlatformCache.java | 15 +-
.../cache/PlatformCacheEntryFilterImpl.java | 4 +-
.../cache/PlatformCacheEntryProcessorImpl.java | 43 +-
.../platform/cache/PlatformCacheIterator.java | 2 +-
.../cache/affinity/PlatformAffinity.java | 4 +-
.../affinity/PlatformAffinityFunction.java | 59 +-
.../PlatformAffinityFunctionTarget.java | 4 +-
.../query/PlatformAbstractQueryCursor.java | 4 +-
.../query/PlatformContinuousQueryProxy.java | 3 +-
.../callback/PlatformCallbackGateway.java | 272 +-
.../platform/callback/PlatformCallbackOp.java | 206 +
.../callback/PlatformCallbackUtils.java | 544 +--
.../platform/cluster/PlatformClusterGroup.java | 18 +-
.../platform/compute/PlatformAbstractJob.java | 2 +-
.../platform/compute/PlatformAbstractTask.java | 15 +-
.../platform/compute/PlatformClosureJob.java | 12 +-
.../platform/compute/PlatformCompute.java | 21 +-
.../platform/compute/PlatformFullJob.java | 15 +-
.../platform/compute/PlatformFullTask.java | 18 +-
.../datastreamer/PlatformDataStreamer.java | 4 +-
.../PlatformStreamReceiverImpl.java | 11 +-
.../datastructures/PlatformAtomicLong.java | 4 +-
.../datastructures/PlatformAtomicReference.java | 8 +-
.../datastructures/PlatformAtomicSequence.java | 2 +-
.../dotnet/PlatformDotNetCacheStore.java | 17 +-
.../platform/events/PlatformEvents.java | 15 +-
.../memory/PlatformInputStreamImpl.java | 14 +-
.../memory/PlatformOutputStreamImpl.java | 14 +-
.../platform/messaging/PlatformMessaging.java | 9 +-
.../services/PlatformAbstractService.java | 25 +-
.../platform/services/PlatformServices.java | 29 +-
.../transactions/PlatformTransactions.java | 8 +-
.../platform/utils/PlatformFutureUtils.java | 18 +-
.../utils/PlatformListenableTarget.java | 62 +
.../platform/utils/PlatformUtils.java | 36 +-
.../plugin/IgnitePluginProcessor.java | 2 +-
.../processors/port/GridPortProcessor.java | 2 +-
.../processors/query/GridQueryIndexing.java | 42 +-
.../processors/query/GridQueryProcessor.java | 646 +++-
.../processors/query/GridQueryProperty.java | 20 +
.../query/GridQueryTypeDescriptor.java | 25 +
.../processors/query/IgniteSQLException.java | 89 +
.../resource/GridResourceProcessor.java | 2 +-
.../processors/rest/GridRestCommand.java | 11 +-
.../processors/rest/GridRestProcessor.java | 22 +-
.../client/message/GridClientStateRequest.java | 80 +
.../cluster/GridChangeStateCommandHandler.java | 89 +
.../redis/GridRedisRestCommandHandler.java | 1 +
.../redis/key/GridRedisDelCommandHandler.java | 7 +-
.../key/GridRedisExistsCommandHandler.java | 7 +-
.../server/GridRedisDbSizeCommandHandler.java | 7 +-
.../string/GridRedisAppendCommandHandler.java | 7 +-
.../string/GridRedisGetCommandHandler.java | 34 +-
.../string/GridRedisGetRangeCommandHandler.java | 7 +-
.../string/GridRedisGetSetCommandHandler.java | 7 +-
.../string/GridRedisIncrDecrCommandHandler.java | 70 +-
.../string/GridRedisMGetCommandHandler.java | 7 +-
.../string/GridRedisMSetCommandHandler.java | 7 +-
.../string/GridRedisSetCommandHandler.java | 31 +-
.../string/GridRedisSetRangeCommandHandler.java | 7 +-
.../string/GridRedisStrlenCommandHandler.java | 7 +-
.../tcp/GridTcpMemcachedNioListener.java | 15 +-
.../protocols/tcp/GridTcpRestNioListener.java | 22 +-
.../tcp/redis/GridRedisNioListener.java | 4 +-
.../request/GridRestChangeStateRequest.java | 57 +
.../service/GridServiceProcessor.java | 144 +-
.../processors/service/GridServiceProxy.java | 18 +-
.../session/GridTaskSessionProcessor.java | 2 +-
.../processors/task/GridTaskProcessor.java | 6 +-
.../processors/task/GridTaskWorker.java | 7 +
.../timeout/GridTimeoutProcessor.java | 2 +-
.../util/GridCursorIteratorWrapper.java | 36 +
.../ignite/internal/util/GridHandleTable.java | 10 +-
.../apache/ignite/internal/util/GridUnsafe.java | 70 +-
.../apache/ignite/internal/util/IgniteTree.java | 70 +
.../ignite/internal/util/IgniteUtils.java | 121 +-
.../internal/util/OffheapReadWriteLock.java | 4 +
.../ignite/internal/util/StripedExecutor.java | 667 ++++
.../util/future/GridCompoundFuture.java | 56 +-
.../util/future/GridFinishedFuture.java | 24 +
.../internal/util/future/GridFutureAdapter.java | 15 +-
.../util/future/GridFutureChainListener.java | 30 +-
.../util/future/IgniteRemoteMapTask.java | 17 +
.../internal/util/io/GridUnsafeDataInput.java | 12 +-
.../internal/util/io/GridUnsafeDataOutput.java | 12 +-
.../internal/util/ipc/IpcToNioAdapter.java | 2 +-
.../util/lang/IgniteSingletonIterator.java | 56 +
.../util/nio/GridCommunicationClient.java | 4 +-
.../nio/GridConnectionBytesVerifyFilter.java | 15 +-
.../util/nio/GridNioAsyncNotifyFilter.java | 10 +-
.../internal/util/nio/GridNioCodecFilter.java | 17 +-
.../ignite/internal/util/nio/GridNioFilter.java | 16 +-
.../internal/util/nio/GridNioFilterAdapter.java | 10 +-
.../internal/util/nio/GridNioFilterChain.java | 14 +-
.../ignite/internal/util/nio/GridNioFuture.java | 4 +-
.../util/nio/GridNioRecoveryDescriptor.java | 95 +-
.../ignite/internal/util/nio/GridNioServer.java | 1343 +++++--
.../internal/util/nio/GridNioSession.java | 11 +
.../internal/util/nio/GridNioSessionImpl.java | 49 +-
.../ignite/internal/util/nio/GridNioWorker.java | 48 +
.../util/nio/GridSelectorNioSessionImpl.java | 157 +-
.../util/nio/GridTcpNioCommunicationClient.java | 49 +-
.../internal/util/nio/SessionWriteRequest.java | 85 +
.../internal/util/nio/ssl/GridNioSslFilter.java | 10 +-
.../util/nio/ssl/GridNioSslHandler.java | 4 +-
.../offheap/unsafe/GridOffHeapSnapTreeMap.java | 11 +-
.../util/offheap/unsafe/GridUnsafeMemory.java | 10 +-
.../internal/util/snaptree/SnapTreeMap.java | 10 +-
.../util/tostring/GridToStringBuilder.java | 2 +-
.../internal/visor/VisorMultiNodeTask.java | 2 +-
.../internal/visor/VisorTaskArgument.java | 2 +-
.../ignite/internal/visor/cache/VisorCache.java | 87 +-
.../visor/cache/VisorCachePartition.java | 14 +-
.../visor/cache/VisorCachePartitions.java | 10 +-
.../visor/cache/VisorCachePartitionsTask.java | 4 +-
.../visor/cache/VisorCacheSwapBackupsTask.java | 102 -
.../visor/event/VisorGridDiscoveryEvent.java | 18 +-
.../visor/event/VisorGridDiscoveryEventV2.java | 80 -
.../misc/VisorChangeGridActiveStateTask.java | 65 +
.../visor/node/VisorNodeDataCollectorJob.java | 3 +-
.../visor/node/VisorNodeDataCollectorTask.java | 2 +
.../node/VisorNodeDataCollectorTaskResult.java | 17 +
.../internal/visor/query/VisorQueryJob.java | 2 +-
.../visor/service/VisorCancelServiceTask.java | 70 +
.../visor/service/VisorServiceDescriptor.java | 132 +
.../visor/service/VisorServiceTask.java | 75 +
.../internal/visor/util/VisorEventMapper.java | 4 +-
.../internal/visor/util/VisorTaskUtils.java | 38 +-
.../apache/ignite/logger/java/JavaLogger.java | 4 +-
.../ignite/marshaller/jdk/JdkMarshaller.java | 4 +-
.../optimized/OptimizedMarshaller.java | 8 +-
.../optimized/OptimizedObjectOutputStream.java | 25 +-
.../org/apache/ignite/mxbean/IgniteMXBean.java | 21 +
.../communication/tcp/TcpCommunicationSpi.java | 324 +-
.../tcp/TcpCommunicationSpiMBean.java | 40 +
.../ignite/spi/discovery/tcp/ClientImpl.java | 2 +-
.../ignite/spi/discovery/tcp/ServerImpl.java | 74 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 22 +-
.../tcp/internal/TcpDiscoveryNode.java | 5 +-
.../tcp/internal/TcpDiscoveryStatistics.java | 4 +
.../org/apache/ignite/stream/StreamAdapter.java | 4 +-
.../ignite/thread/IgniteThreadFactory.java | 8 +-
.../apache/ignite/util/AttributeNodeFilter.java | 108 +
.../org/jsr166/ConcurrentLinkedHashMap.java | 2 +-
.../resources/META-INF/classnames.properties | 172 +-
.../core/src/main/resources/ignite.properties | 2 +-
.../AbstractAffinityFunctionSelfTest.java | 2 +-
.../store/jdbc/CacheJdbcPojoStoreTest.java | 48 +-
.../jdbc/JdbcTypesDefaultTransformerTest.java | 283 ++
.../internal/ClusterNodeMetricsSelfTest.java | 2 +
.../IgniteComputeTopologyExceptionTest.java | 5 +-
.../BinaryArrayIdentityResolverSelfTest.java | 300 ++
.../internal/binary/BinaryEnumsSelfTest.java | 18 +
.../BinaryFieldIdentityResolverSelfTest.java | 333 ++
.../binary/BinaryFieldsOffheapSelfTest.java | 2 +-
.../BinaryFooterOffsetsOffheapSelfTest.java | 2 +-
...ryIdentityResolverConfigurationSelfTest.java | 138 +
.../binary/BinaryMarshallerSelfTest.java | 68 +-
.../BinaryObjectBuilderAdditionalSelfTest.java | 157 +-
...naryObjectBuilderDefaultMappersSelfTest.java | 2 +-
.../BinarySerialiedFieldComparatorSelfTest.java | 568 +++
...GridManagerLocalMessageListenerSelfTest.java | 8 +-
.../managers/GridNoopManagerSelfTest.java | 2 +-
.../GridCommunicationSendMessageSelfTest.java | 7 +-
...unicationBalanceMultipleConnectionsTest.java | 28 +
.../IgniteCommunicationBalanceTest.java | 339 ++
.../communication/IgniteIoTestMessagesTest.java | 95 +
.../IgniteVariousConnectionNumberTest.java | 166 +
.../GridDeploymentMessageCountSelfTest.java | 3 +
.../GridDiscoveryManagerAliveCacheSelfTest.java | 2 +-
.../pagemem/impl/PageMemoryNoLoadSelfTest.java | 2 +-
.../cache/CacheClientStoreSelfTest.java | 6 +-
.../cache/CacheConfigurationLeakTest.java | 15 +
.../cache/CacheEntryProcessorCopySelfTest.java | 8 -
.../cache/CacheRebalancingSelfTest.java | 75 +
.../CacheSerializableTransactionsTest.java | 604 ++-
.../cache/ClusterStateAbstractTest.java | 46 +-
.../cache/CrossCacheTxRandomOperationsTest.java | 30 +-
...idAbstractCacheInterceptorRebalanceTest.java | 6 +-
.../cache/GridCacheAbstractFullApiSelfTest.java | 11 +-
.../cache/GridCacheAbstractMetricsSelfTest.java | 8 +-
.../cache/GridCacheAbstractTxReadTest.java | 2 -
.../cache/GridCacheBasicStoreAbstractTest.java | 7 +-
...GridCacheConcurrentGetCacheOnClientTest.java | 129 +
.../GridCacheMissingCommitVersionSelfTest.java | 6 +-
.../cache/GridCacheMvccFlagsTest.java | 8 +-
.../cache/GridCacheMvccPartitionedSelfTest.java | 334 +-
.../processors/cache/GridCacheMvccSelfTest.java | 212 +-
...CacheOffHeapMultiThreadedUpdateSelfTest.java | 6 +-
.../GridCacheOffHeapTieredAbstractSelfTest.java | 4 +
.../cache/GridCacheP2PUndeploySelfTest.java | 5 -
.../GridCachePartitionedAffinitySpreadTest.java | 7 +-
.../processors/cache/GridCacheTestEntryEx.java | 80 +-
.../GridCacheTtlManagerEvictionSelfTest.java | 1 +
...idCacheValueConsistencyAbstractSelfTest.java | 30 -
.../IgniteCacheConfigVariationsFullApiTest.java | 35 +-
.../IgniteCacheInterceptorSelfTestSuite.java | 10 +-
.../cache/IgniteCachePeekModesAbstractTest.java | 6 +
.../IgniteCacheReadThroughEvictionSelfTest.java | 5 +-
.../IgniteTxStoreExceptionAbstractSelfTest.java | 1 +
...heapCacheMetricsForClusterGroupSelfTest.java | 141 +
.../GridCacheBinaryObjectsAbstractSelfTest.java | 260 +-
.../GridDataStreamerImplSelfTest.java | 8 +-
.../database/tree/io/TrackingPageIOTest.java | 21 +-
...achePartitionedAtomicSequenceTxSelfTest.java | 169 +
...CacheLoadingConcurrentGridStartSelfTest.java | 20 +-
.../CacheLockReleaseNodeLeaveTest.java | 135 +
...tractDistributedByteArrayValuesSelfTest.java | 3 +
...eAtomicMessageRecovery10ConnectionsTest.java | 28 +
...cMessageRecoveryNoPairedConnectionsTest.java | 47 +
...acheConnectionRecovery10ConnectionsTest.java | 35 +
.../distributed/IgniteCacheCreatePutTest.java | 2 +-
.../IgniteTxCachePrimarySyncTest.java | 7 +
...teSynchronizationModesMultithreadedTest.java | 5 +-
.../distributed/dht/GridCacheDhtTestUtils.java | 232 --
.../dht/GridCacheTxNodeFailureSelfTest.java | 13 +-
.../dht/IgniteCacheMultiTxLockSelfTest.java | 6 +-
...eAtomicInvalidPartitionHandlingSelfTest.java | 16 +-
...nabledMultiNodeLongTxTimeoutFullApiTest.java | 2 +-
...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 2 +-
.../near/GridCacheNearReadersSelfTest.java | 3 +-
...achePartitionedMultiNodeFullApiSelfTest.java | 37 +-
...edNoStripedPoolMultiNodeFullApiSelfTest.java | 35 +
.../near/NoneRebalanceModeSelfTest.java | 4 +-
.../GridCacheRebalancingSyncSelfTest.java | 2 +
...idCacheReplicatedUnswapAdvancedSelfTest.java | 3 +
...maryWriteOrderWithStoreExpiryPolicyTest.java | 2 +-
.../IgniteCacheExpiryPolicyAbstractTest.java | 6 +-
...eCacheExpiryPolicyWithStoreAbstractTest.java | 57 +-
.../CacheOffHeapAndSwapMetricsSelfTest.java | 617 ---
...cheLocalBasicStoreMultithreadedSelfTest.java | 1 +
...LocalCacheOffHeapAndSwapMetricsSelfTest.java | 627 +++
...ContinuousQueryFailoverAbstractSelfTest.java | 6 +-
.../CacheKeepBinaryIterationTest.java | 3 +
.../GridCacheContinuousQueryConcurrentTest.java | 47 +-
...teCacheContinuousQueryNoUnsubscribeTest.java | 2 +
.../TxDeadlockDetectionNoHangsTest.java | 2 +-
.../TxOptimisticDeadlockDetectionTest.java | 29 +-
.../closure/GridClosureSerializationTest.java | 177 +
.../processors/database/BPlusTreeSelfTest.java | 33 +
...lockMessageSystemPoolStarvationSelfTest.java | 14 +-
.../GridServiceProcessorProxySelfTest.java | 2 +-
...gniteServiceProxyTimeoutInitializedTest.java | 284 ++
.../util/future/GridFutureAdapterSelfTest.java | 122 +-
.../nio/impl/GridNioFilterChainSelfTest.java | 18 +-
.../loadtests/hashmap/GridHashMapLoadTest.java | 7 +-
.../loadtests/nio/GridNioBenchmarkClient.java | 4 +-
.../p2p/GridP2PRecursionTaskSelfTest.java | 2 +-
...mmunicationSpiConcurrentConnectSelfTest.java | 37 +-
...cpCommunicationSpiMultithreadedSelfTest.java | 13 +-
...dTcpCommunicationSpiRecoveryAckSelfTest.java | 6 +-
...ationSpiRecoveryNoPairedConnectionsTest.java | 28 +
...GridTcpCommunicationSpiRecoverySelfTest.java | 8 +
...CommunicationRecoveryAckClosureSelfTest.java | 6 +-
.../ignite/testframework/GridTestUtils.java | 80 +-
.../testframework/junits/GridAbstractTest.java | 2 +-
.../junits/GridTestKernalContext.java | 6 +-
.../junits/logger/GridTestLog4jLogger.java | 4 +-
.../multijvm/IgniteCacheProcessProxy.java | 5 +
.../junits/multijvm/IgniteNodeRunner.java | 2 +-
.../junits/multijvm/IgniteProcessProxy.java | 2 +
.../ignite/testsuites/IgniteBasicTestSuite.java | 5 +
.../IgniteBinaryObjectsTestSuite.java | 10 +
.../IgniteCacheDataStructuresSelfTestSuite.java | 5 +-
.../IgniteCacheFullApiSelfTestSuite.java | 4 +
.../IgniteCacheMetricsSelfTestSuite.java | 6 +-
.../ignite/testsuites/IgniteCacheTestSuite.java | 29 +-
.../testsuites/IgniteCacheTestSuite2.java | 3 +-
.../testsuites/IgniteCacheTestSuite4.java | 3 +
.../testsuites/IgniteCacheTestSuite5.java | 4 +
.../testsuites/IgniteComputeGridTestSuite.java | 1 -
.../testsuites/IgniteKernalSelfTestSuite.java | 2 +
.../IgniteSpiCommunicationSelfTestSuite.java | 2 +
.../util/AttributeNodeFilterSelfTest.java | 184 +
modules/docker/1.8.0/Dockerfile | 46 +
modules/docker/1.8.0/run.sh | 51 +
modules/docker/Dockerfile | 6 +-
modules/extdata/p2p/pom.xml | 2 +-
.../extdata/uri/modules/uri-dependency/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/flink/pom.xml | 2 +-
modules/flume/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
.../query/h2/opt/GridH2SpatialIndex.java | 24 +-
modules/hadoop/pom.xml | 9 +-
.../hadoop/io/PartiallyRawComparator.java | 33 +
.../org/apache/ignite/hadoop/io/RawMemory.java | 86 +
.../hadoop/io/TextPartiallyRawComparator.java | 115 +
.../apache/ignite/hadoop/io/package-info.java | 22 +
.../IgniteHadoopClientProtocolProvider.java | 70 +-
.../processors/hadoop/HadoopMapperUtils.java | 56 +
.../processors/hadoop/HadoopProcessor.java | 6 +-
.../hadoop/impl/fs/HadoopFileSystemsUtils.java | 11 +
.../hadoop/impl/proto/HadoopClientProtocol.java | 55 +-
.../hadoop/impl/v2/HadoopV2Context.java | 11 +
...DelegatingPartiallyOffheapRawComparator.java | 54 +
.../processors/hadoop/impl/v2/HadoopV2Job.java | 22 +-
.../impl/v2/HadoopV2JobResourceManager.java | 25 +-
.../hadoop/impl/v2/HadoopV2MapTask.java | 10 +
.../hadoop/impl/v2/HadoopV2TaskContext.java | 21 +
.../processors/hadoop/io/OffheapRawMemory.java | 131 +
.../hadoop/jobtracker/HadoopJobTracker.java | 8 +-
.../hadoop/mapreduce/MapReduceClient.java | 147 +
.../hadoop/message/HadoopMessage.java | 27 -
.../hadoop/shuffle/HadoopShuffle.java | 112 +-
.../hadoop/shuffle/HadoopShuffleAck.java | 92 -
.../hadoop/shuffle/HadoopShuffleJob.java | 748 +++-
.../hadoop/shuffle/HadoopShuffleLocalState.java | 67 +
.../hadoop/shuffle/HadoopShuffleMessage.java | 242 --
.../shuffle/HadoopShuffleRemoteState.java | 61 +
.../shuffle/collections/HadoopMultimapBase.java | 5 +-
.../shuffle/collections/HadoopSkipList.java | 14 +-
.../shuffle/direct/HadoopDirectDataInput.java | 166 +
.../shuffle/direct/HadoopDirectDataOutput.java | 221 ++
.../direct/HadoopDirectDataOutputContext.java | 100 +
.../direct/HadoopDirectDataOutputState.java | 54 +
.../shuffle/streams/HadoopDataOutStream.java | 2 +-
.../child/HadoopChildProcessRunner.java | 12 +-
.../HadoopExternalCommunication.java | 4 +-
.../communication/HadoopIpcToNioAdapter.java | 2 +-
.../communication/HadoopMarshallerFilter.java | 6 +-
.../resources/META-INF/classnames.properties | 100 +
.../hadoop/impl/HadoopAbstractSelfTest.java | 13 +-
.../impl/HadoopAbstractWordCountTest.java | 6 +-
.../hadoop/impl/HadoopFileSystemsTest.java | 9 +
.../hadoop/impl/HadoopJobTrackerSelfTest.java | 4 +-
.../impl/HadoopMapReduceEmbeddedSelfTest.java | 22 +-
.../impl/HadoopTaskExecutionSelfTest.java | 4 +-
.../hadoop/impl/HadoopTeraSortTest.java | 383 ++
...opClientProtocolMultipleServersSelfTest.java | 93 +-
.../client/HadoopClientProtocolSelfTest.java | 232 +-
.../collections/HadoopAbstractMapTest.java | 6 +
.../HadoopConcurrentHashMultimapSelftest.java | 2 +-
.../collections/HadoopSkipListSelfTest.java | 16 +-
.../HadoopExternalTaskExecutionSelfTest.java | 2 +
.../testsuites/IgniteHadoopTestSuite.java | 3 +
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
.../cache/query/GridCacheTwoStepQuery.java | 253 ++
.../query/h2/DmlStatementsProcessor.java | 1083 ++++++
.../query/h2/GridH2ResultSetIterator.java | 3 +-
.../internal/processors/query/h2/H2Cursor.java | 105 +
.../processors/query/h2/IgniteH2Indexing.java | 383 +-
.../query/h2/database/H2PkHashIndex.java | 319 ++
.../query/h2/database/H2TreeIndex.java | 132 +-
.../query/h2/dml/FastUpdateArgument.java | 27 +
.../query/h2/dml/FastUpdateArguments.java | 53 +
.../query/h2/dml/KeyValueSupplier.java | 30 +
.../processors/query/h2/dml/UpdateMode.java | 36 +
.../processors/query/h2/dml/UpdatePlan.java | 128 +
.../query/h2/dml/UpdatePlanBuilder.java | 486 +++
.../processors/query/h2/dml/package-info.java | 22 +
.../query/h2/opt/GridH2IndexBase.java | 182 +-
.../query/h2/opt/GridH2RowDescriptor.java | 23 +
.../processors/query/h2/opt/GridH2Table.java | 145 +-
.../query/h2/opt/GridH2TreeIndex.java | 203 +-
.../processors/query/h2/sql/DmlAstUtils.java | 616 +++
.../processors/query/h2/sql/GridSqlArray.java | 8 +
.../processors/query/h2/sql/GridSqlConst.java | 6 +
.../processors/query/h2/sql/GridSqlDelete.java | 68 +
.../query/h2/sql/GridSqlFunction.java | 5 +-
.../processors/query/h2/sql/GridSqlInsert.java | 149 +
.../processors/query/h2/sql/GridSqlKeyword.java | 46 +
.../processors/query/h2/sql/GridSqlMerge.java | 143 +
.../processors/query/h2/sql/GridSqlQuery.java | 44 +-
.../query/h2/sql/GridSqlQueryParser.java | 323 +-
.../query/h2/sql/GridSqlQuerySplitter.java | 6 +-
.../processors/query/h2/sql/GridSqlSelect.java | 3 +-
.../query/h2/sql/GridSqlStatement.java | 64 +
.../processors/query/h2/sql/GridSqlUpdate.java | 105 +
.../h2/twostep/GridReduceQueryExecutor.java | 61 +-
...niteCacheAbstractInsertSqlQuerySelfTest.java | 559 +++
.../cache/IgniteCacheAbstractQuerySelfTest.java | 2 +-
.../IgniteCacheAbstractSqlDmlQuerySelfTest.java | 243 ++
.../IgniteCacheDeleteSqlQuerySelfTest.java | 106 +
.../IgniteCacheInsertSqlQuerySelfTest.java | 203 +
.../cache/IgniteCacheLargeResultSelfTest.java | 15 +-
...niteCacheLockPartitionOnAffinityRunTest.java | 36 +-
.../cache/IgniteCacheMergeSqlQuerySelfTest.java | 153 +
.../IgniteCacheQueryMultiThreadedSelfTest.java | 10 +-
.../IgniteCacheUpdateSqlQuerySelfTest.java | 472 +++
.../IgniteCacheAtomicFieldsQuerySelfTest.java | 21 -
...niteCachePartitionedFieldsQuerySelfTest.java | 25 +
...QueryNodeRestartDistributedJoinSelfTest.java | 104 +-
.../IgniteCacheQueryNodeRestartSelfTest.java | 3 +-
.../query/IgniteSqlDistributedJoinSelfTest.java | 179 +
.../query/IgniteSqlSplitterSelfTest.java | 8 +-
.../h2/GridIndexingSpiAbstractSelfTest.java | 37 +-
.../query/h2/opt/GridH2TableSelfTest.java | 37 +-
.../query/h2/sql/GridQueryParsingTest.java | 111 +-
.../IgniteCacheQuerySelfTestSuite.java | 148 +-
.../IgniteCacheQuerySelfTestSuite2.java | 111 +-
.../IgniteCacheQuerySelfTestSuite3.java | 2 +
.../IgniteDistributedJoinTestSuite.java | 55 +
.../IgniteH2IndexingSpiTestSuite.java | 16 +-
modules/jcl/pom.xml | 2 +-
modules/jms11/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/kafka/pom.xml | 2 +-
.../ignite/stream/kafka/KafkaStreamer.java | 50 +-
.../kafka/KafkaIgniteStreamerSelfTest.java | 36 +-
modules/log4j/pom.xml | 2 +-
.../apache/ignite/logger/log4j/Log4JLogger.java | 4 +-
modules/log4j2/pom.xml | 2 +-
modules/mesos/pom.xml | 2 +-
modules/mqtt/pom.xml | 2 +-
modules/osgi-karaf/pom.xml | 2 +-
modules/osgi-paxlogging/pom.xml | 2 +-
modules/osgi/pom.xml | 3 +-
modules/platforms/.gitignore | 31 +
.../include/ignite/binary/binary_raw_reader.h | 21 +
.../ignite/impl/binary/binary_reader_impl.h | 9 +-
.../src/impl/binary/binary_reader_impl.cpp | 20 +-
.../platforms/cpp/common/include/Makefile.am | 5 +-
.../common/include/ignite/common/concurrent.h | 90 +-
.../include/ignite/common/reference_impl.h | 286 ++
.../cpp/common/include/ignite/reference.h | 564 +++
.../cpp/common/project/vs/common.vcxproj | 2 +
.../common/project/vs/common.vcxproj.filters | 6 +
modules/platforms/cpp/configure.ac | 2 +-
modules/platforms/cpp/configure.acrel | 2 +-
modules/platforms/cpp/core-test/Makefile.am | 7 +-
.../core-test/config/cache-query-continuous.xml | 87 +
.../cpp/core-test/config/cache-query.xml | 10 +
.../cpp/core-test/config/cache-test.xml | 1 +
.../platforms/cpp/core-test/config/invalid.xml | 39 +
.../cpp/core-test/project/vs/core-test.vcxproj | 13 +-
.../project/vs/core-test.vcxproj.filters | 11 +-
.../cpp/core-test/src/cache_query_test.cpp | 76 +-
.../cpp/core-test/src/continuous_query_test.cpp | 611 +++
.../cpp/core-test/src/handle_registry_test.cpp | 18 +-
.../cpp/core-test/src/interop_test.cpp | 17 +-
.../cpp/core-test/src/reference_test.cpp | 412 ++
modules/platforms/cpp/core/Makefile.am | 1 +
.../cpp/core/include/ignite/cache/cache.h | 104 +-
.../cpp/core/include/ignite/cache/cache_entry.h | 40 +-
.../ignite/cache/event/cache_entry_event.h | 139 +
.../cache/event/cache_entry_event_listener.h | 71 +
.../cache/query/continuous/continuous_query.h | 239 ++
.../query/continuous/continuous_query_handle.h | 133 +
.../core/include/ignite/impl/cache/cache_impl.h | 116 +-
.../continuous/continuous_query_handle_impl.h | 101 +
.../query/continuous/continuous_query_impl.h | 351 ++
.../core/include/ignite/impl/handle_registry.h | 62 +-
.../include/ignite/impl/ignite_environment.h | 34 +-
modules/platforms/cpp/core/namespaces.dox | 74 +-
.../platforms/cpp/core/project/vs/core.vcxproj | 7 +
.../cpp/core/project/vs/core.vcxproj.filters | 30 +
modules/platforms/cpp/core/src/ignition.cpp | 15 +-
.../cpp/core/src/impl/cache/cache_impl.cpp | 31 +
.../continuous/continuous_query_handle_impl.cpp | 96 +
.../cpp/core/src/impl/handle_registry.cpp | 102 +-
.../cpp/core/src/impl/ignite_environment.cpp | 146 +-
modules/platforms/cpp/examples/Makefile.am | 1 +
modules/platforms/cpp/examples/configure.ac | 3 +-
.../continuous-query-example/Makefile.am | 58 +
.../config/continuous-query-example.xml | 52 +
.../project/vs/continuous-query-example.vcxproj | 110 +
.../vs/continuous-query-example.vcxproj.filters | 35 +
.../src/continuous_query_example.cpp | 142 +
.../examples/include/ignite/examples/person.h | 2 +-
.../odbc-example/config/example-odbc.xml | 38 +-
.../project/vs/odbc-example.vcxproj | 7 +-
.../project/vs/odbc-example.vcxproj.filters | 8 +
.../examples/odbc-example/src/odbc_example.cpp | 514 ++-
.../cpp/examples/project/vs/ignite-examples.sln | 6 +
.../putget-example/src/putget_example.cpp | 2 +-
.../query-example/src/query_example.cpp | 4 +-
.../cpp/jni/include/ignite/jni/exports.h | 3 -
.../platforms/cpp/jni/include/ignite/jni/java.h | 94 +-
modules/platforms/cpp/jni/project/vs/module.def | 6 +-
modules/platforms/cpp/jni/src/exports.cpp | 8 -
modules/platforms/cpp/jni/src/java.cpp | 419 +-
.../cpp/odbc-test/config/queries-default.xml | 145 +
.../odbc-test/config/queries-test-noodbc.xml | 80 +-
.../cpp/odbc-test/config/queries-test.xml | 81 +-
.../platforms/cpp/odbc-test/include/Makefile.am | 1 +
.../cpp/odbc-test/include/complex_type.h | 122 +
.../cpp/odbc-test/project/vs/odbc-test.vcxproj | 5 +-
.../project/vs/odbc-test.vcxproj.filters | 3 +
.../src/application_data_buffer_test.cpp | 2 +-
.../cpp/odbc-test/src/queries_test.cpp | 513 ++-
.../cpp/odbc-test/src/utility_test.cpp | 27 +-
.../platforms/cpp/odbc/include/ignite/odbc.h | 14 +-
.../ignite/odbc/app/application_data_buffer.h | 4 +-
.../odbc/include/ignite/odbc/app/parameter.h | 2 +-
.../cpp/odbc/include/ignite/odbc/common_types.h | 3 +
.../cpp/odbc/include/ignite/odbc/message.h | 138 +-
.../odbc/include/ignite/odbc/query/data_query.h | 12 +-
.../cpp/odbc/include/ignite/odbc/query/query.h | 44 +-
.../cpp/odbc/include/ignite/odbc/statement.h | 83 +-
.../cpp/odbc/include/ignite/odbc/type_traits.h | 2 +-
.../cpp/odbc/include/ignite/odbc/utility.h | 11 +-
.../cpp/odbc/install/ignite-odbc-amd64.wxs | 2 +-
.../cpp/odbc/install/ignite-odbc-x86.wxs | 2 +-
.../odbc/src/app/application_data_buffer.cpp | 57 +-
.../platforms/cpp/odbc/src/app/parameter.cpp | 3 +-
modules/platforms/cpp/odbc/src/column.cpp | 41 +-
modules/platforms/cpp/odbc/src/connection.cpp | 23 +-
modules/platforms/cpp/odbc/src/entry_points.cpp | 32 +-
modules/platforms/cpp/odbc/src/odbc.cpp | 25 +-
.../odbc/src/query/column_metadata_query.cpp | 2 +-
.../platforms/cpp/odbc/src/query/data_query.cpp | 6 +-
.../cpp/odbc/src/query/foreign_keys_query.cpp | 2 +-
.../cpp/odbc/src/query/primary_keys_query.cpp | 2 +-
.../odbc/src/query/special_columns_query.cpp | 2 +-
.../cpp/odbc/src/query/table_metadata_query.cpp | 2 +-
.../cpp/odbc/src/query/type_info_query.cpp | 2 +-
modules/platforms/cpp/odbc/src/statement.cpp | 230 +-
modules/platforms/cpp/odbc/src/type_traits.cpp | 3 +
modules/platforms/cpp/odbc/src/utility.cpp | 24 +-
modules/platforms/cpp/project/vs/ignite.slnrel | 3 +
.../platforms/cpp/project/vs/ignite_x86.slnrel | 3 +
.../Properties/AssemblyInfo.cs | 6 +-
.../Apache.Ignite.AspNet.nuspec | 4 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Binary/BinaryCompactFooterInteropTest.cs | 31 +-
.../Cache/Query/CacheLinqTest.cs | 72 +-
.../Query/CacheQueriesCodeConfigurationTest.cs | 17 +-
.../Cache/Query/CacheQueriesTest.cs | 8 +
.../Examples/Example.cs | 11 +-
.../Examples/ExamplesTest.cs | 104 +-
.../Apache.Ignite.Core.Tests/ExecutableTest.cs | 64 +-
.../Process/IgniteProcess.cs | 21 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Apache.Ignite.Core.Tests/ReconnectTest.cs | 23 +-
.../Services/ServicesTest.cs | 46 +-
.../Apache.Ignite.Core.Tests/TestUtils.cs | 3 +-
.../Apache.Ignite.Core.csproj | 2 +
.../dotnet/Apache.Ignite.Core/Binary/IBinary.cs | 3 +-
.../Apache.Ignite.Core/Cache/Query/QueryBase.cs | 15 +-
.../Apache.Ignite.Core/IgniteConfiguration.cs | 1 +
.../Impl/Binary/BinaryUtils.cs | 16 +
.../Impl/Binary/Io/BinaryStreamBase.cs | 4 +-
.../Apache.Ignite.Core/Impl/Cache/CacheImpl.cs | 29 +-
.../Apache.Ignite.Core/Impl/Common/Future.cs | 13 +-
.../Impl/Common/Listenable.cs | 49 +
.../Impl/Compute/ComputeImpl.cs | 4 +-
.../Impl/Compute/ComputeTaskHolder.cs | 14 +-
.../Apache.Ignite.Core/Impl/PlatformTarget.cs | 2 +-
.../Impl/Unmanaged/IgniteJniNativeMethods.cs | 8 -
.../Impl/Unmanaged/UnmanagedCallbackHandlers.cs | 79 +-
.../Impl/Unmanaged/UnmanagedCallbackOp.cs | 86 +
.../Impl/Unmanaged/UnmanagedCallbacks.cs | 1229 +++---
.../Impl/Unmanaged/UnmanagedUtils.cs | 5 -
.../Properties/AssemblyInfo.cs | 6 +-
.../EntityFrameworkCacheTest.cs | 58 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Impl/DbCommandInfo.cs | 21 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Impl/CacheQueryExpressionVisitor.cs | 12 +-
.../Apache.Ignite.Linq/Impl/ExpressionWalker.cs | 8 +
.../Apache.Ignite.Linq/Impl/MethodVisitor.cs | 34 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
modules/platforms/dotnet/Apache.Ignite.sln | 7 +
.../Apache.Ignite/Config/ArgsConfigurator.cs | 7 +-
.../dotnet/Apache.Ignite/Config/Configurator.cs | 10 +
.../Apache.Ignite/Properties/AssemblyInfo.cs | 6 +-
modules/platforms/dotnet/DEVNOTES.txt | 12 +-
modules/platforms/dotnet/README.md | 150 +
modules/platforms/dotnet/build.bat | 19 +
modules/platforms/dotnet/build.ps1 | 211 +
.../Datagrid/MultiTieredCacheExample.cs | 8 +-
.../Misc/ClientReconnectExample.cs | 18 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar-2.10/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
.../schedule/IgniteScheduleProcessor.java | 2 +-
modules/schema-import-db/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spark-2.10/pom.xml | 2 +-
modules/spark/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/storm/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
.../ignite/tools/classgen/ClassesGenerator.java | 8 +-
modules/twitter/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
.../spi/deployment/uri/UriDeploymentSpi.java | 2 +-
modules/visor-console-2.10/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
.../ignite/visor/commands/VisorConsole.scala | 1 -
.../commands/cache/VisorCacheCommand.scala | 37 +-
.../commands/cache/VisorCacheSwapCommand.scala | 145 -
.../commands/disco/VisorDiscoveryCommand.scala | 2 +-
.../commands/events/VisorEventsCommand.scala | 8 +-
.../cswap/VisorCacheSwapCommandSpec.scala | 89 -
.../testsuites/VisorConsoleSelfTestSuite.scala | 2 -
modules/visor-plugins/pom.xml | 2 +-
modules/web-console/backend/app/agent.js | 47 +-
modules/web-console/backend/app/browser.js | 26 +
modules/web-console/backend/app/mongo.js | 30 +-
.../backend/config/settings.json.sample | 7 -
modules/web-console/backend/index.js | 6 +-
modules/web-console/backend/middlewares/host.js | 7 +-
modules/web-console/backend/routes/agent.js | 4 +-
modules/web-console/backend/routes/demo.js | 17 +-
modules/web-console/backend/routes/profile.js | 3 +-
modules/web-console/backend/services/agents.js | 2 +-
modules/web-console/backend/services/caches.js | 2 +
.../web-console/backend/services/notebooks.js | 14 +-
.../web-console/backend/services/sessions.js | 6 +-
modules/web-console/backend/services/spaces.js | 15 +
.../docker/compose/backend/.dockerignore | 2 +
.../docker/compose/backend/Dockerfile | 6 +-
.../web-console/docker/compose/backend/build.sh | 4 +-
.../docker/compose/docker-compose.yml | 5 -
.../docker/compose/frontend/DockerfileBuild | 4 +-
.../docker/compose/frontend/build.sh | 6 +-
.../compose/frontend/nginx/web-console.conf | 9 +
.../web-console/docker/standalone/.dockerignore | 5 +
.../web-console/docker/standalone/Dockerfile | 10 +-
modules/web-console/docker/standalone/build.sh | 4 +-
.../docker/standalone/docker-compose.yml | 7 +-
.../docker/standalone/nginx/web-console.conf | 9 +
modules/web-console/frontend/app/app.js | 5 -
.../controllers/reset-password.controller.js | 14 +-
.../frontend/app/data/event-groups.json | 169 +
.../frontend/app/data/event-types.json | 169 -
.../frontend/app/data/pom-dependencies.json | 14 +-
.../ui-ace-docker/ui-ace-docker.controller.js | 2 +-
.../directives/ui-ace-docker/ui-ace-docker.jade | 2 +-
.../ui-ace-pojos/ui-ace-pojos.controller.js | 12 +-
.../directives/ui-ace-pojos/ui-ace-pojos.jade | 2 +-
.../ui-ace-pom/ui-ace-pom.controller.js | 4 +-
.../frontend/app/filters/duration.filter.js | 3 +
.../helpers/jade/form/form-field-checkbox.jade | 2 +-
.../helpers/jade/form/form-field-datalist.jade | 2 +-
.../helpers/jade/form/form-field-dropdown.jade | 5 +-
.../helpers/jade/form/form-field-number.jade | 3 +-
.../helpers/jade/form/form-field-password.jade | 2 +-
.../app/helpers/jade/form/form-field-text.jade | 19 +-
.../frontend/app/helpers/jade/mixins.jade | 76 +-
.../frontend/app/modules/Demo/Demo.module.js | 6 +-
.../configuration/EventGroups.provider.js | 30 -
.../modules/configuration/Version.service.js | 6 +-
.../configuration/configuration.module.js | 63 +-
.../generator/AbstractTransformer.js | 17 +
.../modules/configuration/generator/Beans.js | 11 +
.../generator/ConfigurationGenerator.js | 2776 +++++++-------
.../configuration/generator/Custom.service.js | 23 +
.../configuration/generator/Docker.service.js | 4 +-
.../generator/JavaTransformer.service.js | 2315 +++++------
.../configuration/generator/Maven.service.js | 234 ++
.../configuration/generator/Pom.service.js | 233 --
.../generator/Properties.service.js | 21 +-
.../configuration/generator/Readme.service.js | 2 +-
.../generator/SharpTransformer.service.js | 437 ++-
.../generator/SpringTransformer.service.js | 489 +--
.../defaults/Cache.platform.service.js | 56 +
.../generator/defaults/Cache.service.js | 131 +
.../defaults/Cluster.platform.service.js | 43 +
.../generator/defaults/Cluster.service.js | 289 ++
.../generator/defaults/Event-groups.service.js | 27 +
.../generator/defaults/IGFS.service.js | 64 +
.../defaults/cache.platform.provider.js | 60 -
.../generator/defaults/cache.provider.js | 129 -
.../defaults/cluster.platform.provider.js | 49 -
.../generator/defaults/cluster.provider.js | 293 --
.../generator/defaults/igfs.provider.js | 68 -
.../configuration/generator/generator-common.js | 625 ---
.../configuration/generator/generator-java.js | 3617 ------------------
.../generator/generator-optional.js | 25 -
.../configuration/generator/generator-spring.js | 2111 ----------
.../app/modules/form/field/tooltip.directive.js | 2 +-
.../app/modules/form/group/tooltip.directive.js | 2 +-
.../app/modules/form/panel/field.directive.js | 4 +-
.../frontend/app/modules/sql/Notebook.data.js | 11 +-
.../app/modules/sql/Notebook.service.js | 2 +-
.../app/modules/sql/scan-filter-input.jade | 39 -
.../modules/sql/scan-filter-input.service.js | 51 -
.../frontend/app/modules/sql/sql.controller.js | 217 +-
.../frontend/app/modules/sql/sql.module.js | 2 -
.../app/modules/states/configuration.state.js | 2 +
.../configuration/caches/client-near-cache.jade | 2 +-
.../configuration/caches/concurrency.jade | 2 +-
.../states/configuration/caches/general.jade | 2 +-
.../states/configuration/caches/memory.jade | 2 +-
.../configuration/caches/near-cache-client.jade | 2 +-
.../configuration/caches/near-cache-server.jade | 2 +-
.../configuration/caches/node-filter.jade | 4 +-
.../states/configuration/caches/query.jade | 5 +-
.../states/configuration/caches/rebalance.jade | 2 +-
.../states/configuration/caches/statistics.jade | 2 +-
.../states/configuration/caches/store.jade | 20 +-
.../states/configuration/clusters/atomic.jade | 2 +-
.../configuration/clusters/attributes.jade | 2 +-
.../states/configuration/clusters/binary.jade | 2 +-
.../configuration/clusters/cache-key-cfg.jade | 2 +-
.../configuration/clusters/checkpoint.jade | 17 +-
.../configuration/clusters/checkpoint/fs.jade | 10 +-
.../configuration/clusters/checkpoint/jdbc.jade | 47 +-
.../configuration/clusters/checkpoint/s3.jade | 244 +-
.../configuration/clusters/collision.jade | 12 +-
.../clusters/collision/custom.jade | 4 +-
.../clusters/collision/fifo-queue.jade | 2 +-
.../clusters/collision/job-stealing.jade | 4 +-
.../clusters/collision/priority-queue.jade | 2 +-
.../configuration/clusters/communication.jade | 2 +-
.../configuration/clusters/connector.jade | 2 +-
.../configuration/clusters/deployment.jade | 131 +-
.../configuration/clusters/discovery.jade | 2 +-
.../states/configuration/clusters/events.jade | 6 +-
.../states/configuration/clusters/failover.jade | 6 +-
.../states/configuration/clusters/general.jade | 2 +-
.../clusters/general/discovery/cloud.jade | 2 +-
.../clusters/general/discovery/google.jade | 2 +-
.../clusters/general/discovery/jdbc.jade | 3 +-
.../clusters/general/discovery/multicast.jade | 2 +-
.../clusters/general/discovery/s3.jade | 2 +-
.../clusters/general/discovery/shared.jade | 2 +-
.../clusters/general/discovery/vm.jade | 2 +-
.../clusters/general/discovery/zookeeper.jade | 4 +-
.../bounded-exponential-backoff.jade | 2 +-
.../discovery/zookeeper/retrypolicy/custom.jade | 4 +-
.../retrypolicy/exponential-backoff.jade | 2 +-
.../zookeeper/retrypolicy/forever.jade | 2 +-
.../zookeeper/retrypolicy/n-times.jade | 2 +-
.../zookeeper/retrypolicy/one-time.jade | 2 +-
.../zookeeper/retrypolicy/until-elapsed.jade | 2 +-
.../states/configuration/clusters/igfs.jade | 2 +-
.../configuration/clusters/load-balancing.jade | 25 +-
.../states/configuration/clusters/logger.jade | 2 +-
.../configuration/clusters/logger/custom.jade | 4 +-
.../configuration/clusters/logger/log4j.jade | 2 +-
.../configuration/clusters/logger/log4j2.jade | 2 +-
.../configuration/clusters/marshaller.jade | 2 +-
.../states/configuration/clusters/metrics.jade | 2 +-
.../states/configuration/clusters/odbc.jade | 2 +-
.../states/configuration/clusters/ssl.jade | 4 +-
.../states/configuration/clusters/swap.jade | 2 +-
.../states/configuration/clusters/thread.jade | 2 +-
.../states/configuration/clusters/time.jade | 2 +-
.../configuration/clusters/transactions.jade | 2 +-
.../states/configuration/domains/general.jade | 2 +-
.../states/configuration/domains/query.jade | 16 +-
.../states/configuration/domains/store.jade | 12 +-
.../modules/states/configuration/igfs/dual.jade | 2 +-
.../states/configuration/igfs/fragmentizer.jade | 2 +-
.../states/configuration/igfs/general.jade | 2 +-
.../modules/states/configuration/igfs/ipc.jade | 2 +-
.../modules/states/configuration/igfs/misc.jade | 6 +-
.../states/configuration/igfs/secondary.jade | 2 +-
.../summary/summary-zipper.service.js | 37 +
.../configuration/summary/summary.controller.js | 99 +-
.../configuration/summary/summary.worker.js | 123 +
.../frontend/app/modules/user/Auth.service.js | 11 +-
.../frontend/app/services/JavaTypes.service.js | 13 +-
.../frontend/app/services/Messages.service.js | 17 +-
.../frontend/controllers/admin-controller.js | 211 +-
.../frontend/controllers/caches-controller.js | 22 +-
.../frontend/controllers/clusters-controller.js | 52 +-
.../frontend/controllers/domains-controller.js | 40 +-
.../frontend/controllers/igfs-controller.js | 20 +-
.../frontend/controllers/profile-controller.js | 3 +-
.../frontend/gulpfile.babel.js/tasks/jade.js | 4 +-
.../frontend/gulpfile.babel.js/tasks/test.js | 92 -
.../gulpfile.babel.js/webpack/common.js | 22 +-
.../webpack/environments/development.js | 17 +-
.../webpack/environments/production.js | 3 +-
.../webpack/plugins/progress.js | 82 -
modules/web-console/frontend/package.json | 180 +-
.../frontend/public/images/cache.png | Bin 23700 -> 24791 bytes
.../frontend/public/images/domains.png | Bin 23828 -> 22131 bytes
.../web-console/frontend/public/images/igfs.png | Bin 14307 -> 14139 bytes
.../frontend/public/images/query-chart.png | Bin 16637 -> 17142 bytes
.../frontend/public/images/query-metadata.png | Bin 32298 -> 39361 bytes
.../frontend/public/images/query-table.png | Bin 29189 -> 28065 bytes
.../frontend/public/images/summary.png | Bin 31997 -> 33650 bytes
.../stylesheets/_font-awesome-custom.scss | 39 +
.../frontend/public/stylesheets/form-field.scss | 37 +
.../frontend/public/stylesheets/style.scss | 124 +-
.../frontend/test/unit/JavaTypes.test.js | 17 +-
.../frontend/test/unit/Version.test.js | 8 +-
.../frontend/views/configuration/caches.jade | 22 +-
.../frontend/views/configuration/clusters.jade | 50 +-
.../views/configuration/domains-import.jade | 9 +-
.../frontend/views/configuration/domains.jade | 8 +-
.../frontend/views/configuration/igfs.jade | 14 +-
.../frontend/views/configuration/summary.jade | 27 +-
.../frontend/views/includes/header.jade | 15 +-
.../frontend/views/settings/admin.jade | 85 +-
.../frontend/views/settings/profile.jade | 2 +-
.../frontend/views/sql/notebook-new.jade | 2 +-
modules/web-console/frontend/views/sql/sql.jade | 237 +-
.../views/templates/agent-download.jade | 2 +-
.../frontend/views/templates/alert.jade | 2 +-
.../frontend/views/templates/batch-confirm.jade | 2 +-
.../frontend/views/templates/clone.jade | 2 +-
.../frontend/views/templates/confirm.jade | 2 +-
.../frontend/views/templates/select.jade | 2 +-
modules/web-console/pom.xml | 2 +-
modules/web-console/web-agent/README.txt | 4 +-
.../web-agent/bin/ignite-web-agent.bat | 7 +-
.../web-agent/bin/ignite-web-agent.sh | 6 +-
modules/web-console/web-agent/pom.xml | 2 +-
.../console/agent/AgentConfiguration.java | 5 +-
.../ignite/console/agent/AgentLauncher.java | 6 +-
.../ignite/console/demo/AgentClusterDemo.java | 1 +
modules/web/ignite-appserver-test/pom.xml | 2 +-
modules/web/ignite-websphere-test/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
.../internal/websession/WebSessionSelfTest.java | 4 +
.../config/benchmark-bin-identity.properties | 94 +
.../config/benchmark-multicast.properties | 15 +
.../config/benchmark-sql-dml.properties | 72 +
modules/yardstick/config/ignite-base-config.xml | 71 +-
.../config/ignite-bin-multicast-config.xml | 86 +
modules/yardstick/pom.xml | 2 +-
.../yardstick/IgniteAbstractBenchmark.java | 30 +
.../yardstick/IgniteBenchmarkArguments.java | 11 +
.../ignite/yardstick/IgniteBenchmarkUtils.java | 42 +-
.../apache/ignite/yardstick/PreloadLogger.java | 155 +
.../yardstick/cache/CacheEntryEventProbe.java | 2 +-
.../cache/IgniteBinaryIdentityBenchmark.java | 108 +
.../cache/IgniteBinaryIdentityGetBenchmark.java | 34 +
.../cache/IgniteBinaryIdentityPutBenchmark.java | 35 +
.../IgniteFieldsBinaryIdentityGetBenchmark.java | 30 +
.../IgniteFieldsBinaryIdentityPutBenchmark.java | 30 +
.../yardstick/cache/IgniteIoTestBenchmark.java | 73 +
.../IgniteLegacyBinaryIdentityGetBenchmark.java | 30 +
.../IgniteLegacyBinaryIdentityPutBenchmark.java | 30 +
...IgnitePutIfAbsentIndexedValue1Benchmark.java | 45 +
.../IgniteReplaceIndexedValue1Benchmark.java | 79 +
.../cache/dml/IgniteSqlDeleteBenchmark.java | 83 +
.../dml/IgniteSqlDeleteFilteredBenchmark.java | 88 +
.../IgniteSqlInsertIndexedValue1Benchmark.java | 48 +
.../IgniteSqlInsertIndexedValue2Benchmark.java | 48 +
.../IgniteSqlInsertIndexedValue8Benchmark.java | 48 +
.../cache/dml/IgniteSqlMergeAllBenchmark.java | 82 +
.../cache/dml/IgniteSqlMergeBenchmark.java | 42 +
.../IgniteSqlMergeIndexedValue1Benchmark.java | 43 +
.../IgniteSqlMergeIndexedValue2Benchmark.java | 43 +
.../IgniteSqlMergeIndexedValue8Benchmark.java | 43 +
.../cache/dml/IgniteSqlMergeQueryBenchmark.java | 116 +
.../cache/dml/IgniteSqlUpdateBenchmark.java | 82 +
.../dml/IgniteSqlUpdateFilteredBenchmark.java | 88 +
.../IgniteCacheRandomOperationBenchmark.java | 22 +-
.../yardstick/cache/model/SampleValue.java | 2 +
.../io/IgniteIoTestAbstractBenchmark.java | 61 +
.../io/IgniteIoTestSendAllBenchmark.java | 32 +
.../io/IgniteIoTestSendRandomBenchmark.java | 35 +
modules/yarn/pom.xml | 2 +-
modules/zookeeper/pom.xml | 2 +-
pom.xml | 2 +-
1191 files changed, 52652 insertions(+), 24120 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0ee73fb0/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoStoreImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0ee73fb0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 85b9de5,7f4fb99..be22aed
--- 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
@@@ -72,9 -72,10 +72,9 @@@ import org.apache.ignite.internal.binar
import org.apache.ignite.internal.binary.BinaryMarshaller;
import org.apache.ignite.internal.binary.GridBinaryMarshaller;
import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
- import org.apache.ignite.internal.pagemem.backup.StartFullBackupAckDiscoveryMessage;
+ import org.apache.ignite.internal.pagemem.snapshot.StartFullSnapshotAckDiscoveryMessage;
import org.apache.ignite.internal.pagemem.store.IgnitePageStoreManager;
import org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager;
-import org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogNoopManager;
import org.apache.ignite.internal.processors.GridProcessorAdapter;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
http://git-wip-us.apache.org/repos/asf/ignite/blob/0ee73fb0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0ee73fb0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0ee73fb0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
[45/50] [abbrv] ignite git commit: IGNITE-4428: Hadoop: moved
HadoopMapReducePlanner and dependent classes to public space. This closes
#1389. This closes #1394.
Posted by ag...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/planner/HadoopDefaultMapReducePlan.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/planner/HadoopDefaultMapReducePlan.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/planner/HadoopDefaultMapReducePlan.java
index 7aaf3fa..1004e3c 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/planner/HadoopDefaultMapReducePlan.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/planner/HadoopDefaultMapReducePlan.java
@@ -17,8 +17,8 @@
package org.apache.ignite.internal.processors.hadoop.planner;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlan;
+import org.apache.ignite.hadoop.HadoopInputSplit;
+import org.apache.ignite.hadoop.HadoopMapReducePlan;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffle.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffle.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffle.java
index 8ffea8c..6f9b7a4 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffle.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffle.java
@@ -25,9 +25,9 @@ import org.apache.ignite.internal.managers.communication.GridIoPolicy;
import org.apache.ignite.internal.managers.communication.GridMessageListener;
import org.apache.ignite.internal.processors.hadoop.HadoopComponent;
import org.apache.ignite.internal.processors.hadoop.HadoopContext;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
+import org.apache.ignite.hadoop.HadoopInputSplit;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlan;
+import org.apache.ignite.hadoop.HadoopMapReducePlan;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskContext;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskInput;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskOutput;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java
index 318ead3..25925fc 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java
@@ -21,7 +21,7 @@ import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
import org.apache.ignite.internal.processors.hadoop.HadoopMapperAwareTaskOutput;
import org.apache.ignite.internal.processors.hadoop.HadoopMapperUtils;
@@ -86,7 +86,7 @@ public class HadoopShuffleJob<T> implements AutoCloseable {
private static final boolean DFLT_SHUFFLE_MSG_GZIP = false;
/** */
- private final HadoopJob job;
+ private final HadoopJobEx job;
/** */
private final GridUnsafeMemory mem;
@@ -169,7 +169,7 @@ public class HadoopShuffleJob<T> implements AutoCloseable {
* @param embedded Whether shuffle is running in embedded mode.
* @throws IgniteCheckedException If error.
*/
- public HadoopShuffleJob(T locReduceAddr, IgniteLogger log, HadoopJob job, GridUnsafeMemory mem,
+ public HadoopShuffleJob(T locReduceAddr, IgniteLogger log, HadoopJobEx job, GridUnsafeMemory mem,
int totalReducerCnt, int[] locReducers, int locMappersCnt, boolean embedded) throws IgniteCheckedException {
this.locReduceAddr = locReduceAddr;
this.totalReducerCnt = totalReducerCnt;
@@ -412,6 +412,7 @@ public class HadoopShuffleJob<T> implements AutoCloseable {
*
* @param msg Message.
* @return Buffer.
+ * @throws IgniteCheckedException On error.
*/
private byte[] extractBuffer(HadoopDirectShuffleMessage msg) throws IgniteCheckedException {
if (msgGzip) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopEmbeddedTaskExecutor.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopEmbeddedTaskExecutor.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopEmbeddedTaskExecutor.java
index 5ede18e..96893b1 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopEmbeddedTaskExecutor.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopEmbeddedTaskExecutor.java
@@ -21,7 +21,7 @@ import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
import org.apache.ignite.internal.processors.hadoop.HadoopJobPhase;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskContext;
@@ -76,7 +76,7 @@ public class HadoopEmbeddedTaskExecutor extends HadoopTaskExecutorAdapter {
}
/** {@inheritDoc} */
- @Override public void run(final HadoopJob job, Collection<HadoopTaskInfo> tasks) throws IgniteCheckedException {
+ @Override public void run(final HadoopJobEx job, Collection<HadoopTaskInfo> tasks) throws IgniteCheckedException {
if (log.isDebugEnabled())
log.debug("Submitting tasks for local execution [locNodeId=" + ctx.localNodeId() +
", tasksCnt=" + tasks.size() + ']');
@@ -128,8 +128,8 @@ public class HadoopEmbeddedTaskExecutor extends HadoopTaskExecutorAdapter {
* for this job ID.
* <p>
* It is guaranteed that this method will not be called concurrently with
- * {@link #run(org.apache.ignite.internal.processors.hadoop.HadoopJob, Collection)} method. No more job submissions will be performed via
- * {@link #run(org.apache.ignite.internal.processors.hadoop.HadoopJob, Collection)} method for given job ID after this method is called.
+ * {@link #run(HadoopJobEx, Collection)} method. No more job submissions will be performed via
+ * {@link #run(HadoopJobEx, Collection)} method for given job ID after this method is called.
*
* @param jobId Job ID to cancel.
*/
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java
index a57efe6..afa01a4 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java
@@ -21,7 +21,7 @@ import java.util.UUID;
import java.util.concurrent.Callable;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskCancelledException;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskContext;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskInfo;
@@ -51,7 +51,7 @@ public abstract class HadoopRunnableTask implements Callable<Void> {
private final IgniteLogger log;
/** */
- private final HadoopJob job;
+ private final HadoopJobEx job;
/** Task to run. */
private final HadoopTaskInfo info;
@@ -84,7 +84,7 @@ public abstract class HadoopRunnableTask implements Callable<Void> {
* @param info Task info.
* @param nodeId Node id.
*/
- protected HadoopRunnableTask(IgniteLogger log, HadoopJob job, GridUnsafeMemory mem, HadoopTaskInfo info,
+ protected HadoopRunnableTask(IgniteLogger log, HadoopJobEx job, GridUnsafeMemory mem, HadoopTaskInfo info,
UUID nodeId) {
this.nodeId = nodeId;
this.log = log.getLogger(HadoopRunnableTask.class);
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopTaskExecutorAdapter.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopTaskExecutorAdapter.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopTaskExecutorAdapter.java
index f13c76a..b7d0a34 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopTaskExecutorAdapter.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopTaskExecutorAdapter.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.processors.hadoop.taskexecutor;
import java.util.Collection;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.processors.hadoop.HadoopComponent;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskInfo;
import org.apache.ignite.internal.processors.hadoop.jobtracker.HadoopJobMetadata;
@@ -36,15 +36,15 @@ public abstract class HadoopTaskExecutorAdapter extends HadoopComponent {
* @param tasks Tasks.
* @throws IgniteCheckedException If failed.
*/
- public abstract void run(final HadoopJob job, Collection<HadoopTaskInfo> tasks) throws IgniteCheckedException;
+ public abstract void run(final HadoopJobEx job, Collection<HadoopTaskInfo> tasks) throws IgniteCheckedException;
/**
* Cancels all currently running tasks for given job ID and cancels scheduled execution of tasks
* for this job ID.
* <p>
* It is guaranteed that this method will not be called concurrently with
- * {@link #run(org.apache.ignite.internal.processors.hadoop.HadoopJob, Collection)} method. No more job submissions will be performed via
- * {@link #run(org.apache.ignite.internal.processors.hadoop.HadoopJob, Collection)} method for given job ID after this method is called.
+ * {@link #run(HadoopJobEx, Collection)} method. No more job submissions will be performed via
+ * {@link #run(HadoopJobEx, Collection)} method for given job ID after this method is called.
*
* @param jobId Job ID to cancel.
*/
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java
index 2c560bc..afa3e25 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java
@@ -33,10 +33,10 @@ import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.processors.hadoop.HadoopContext;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
import org.apache.ignite.internal.processors.hadoop.HadoopJobPhase;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlan;
+import org.apache.ignite.hadoop.HadoopMapReducePlan;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskInfo;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskType;
import org.apache.ignite.internal.processors.hadoop.jobtracker.HadoopJobMetadata;
@@ -198,7 +198,7 @@ public class HadoopExternalTaskExecutor extends HadoopTaskExecutorAdapter {
}
}
else if (ctx.isParticipating(meta)) {
- HadoopJob job;
+ HadoopJobEx job;
try {
job = jobTracker.job(meta.jobId(), meta.jobInfo());
@@ -215,7 +215,7 @@ public class HadoopExternalTaskExecutor extends HadoopTaskExecutorAdapter {
/** {@inheritDoc} */
@SuppressWarnings("ConstantConditions")
- @Override public void run(final HadoopJob job, final Collection<HadoopTaskInfo> tasks) throws IgniteCheckedException {
+ @Override public void run(final HadoopJobEx job, final Collection<HadoopTaskInfo> tasks) throws IgniteCheckedException {
if (!busyLock.tryReadLock()) {
if (log.isDebugEnabled())
log.debug("Failed to start hadoop tasks (grid is stopping, will ignore).");
@@ -293,7 +293,7 @@ public class HadoopExternalTaskExecutor extends HadoopTaskExecutorAdapter {
* @param job Job instance.
* @param tasks Collection of tasks to execute in started process.
*/
- private void sendExecutionRequest(HadoopProcess proc, HadoopJob job, Collection<HadoopTaskInfo> tasks)
+ private void sendExecutionRequest(HadoopProcess proc, HadoopJobEx job, Collection<HadoopTaskInfo> tasks)
throws IgniteCheckedException {
// Must synchronize since concurrent process crash may happen and will receive onConnectionLost().
proc.lock();
@@ -349,7 +349,7 @@ public class HadoopExternalTaskExecutor extends HadoopTaskExecutorAdapter {
* @param job Job instance.
* @param plan Map reduce plan.
*/
- private HadoopProcess startProcess(final HadoopJob job, final HadoopMapReducePlan plan) {
+ private HadoopProcess startProcess(final HadoopJobEx job, final HadoopMapReducePlan plan) {
final UUID childProcId = UUID.randomUUID();
HadoopJobId jobId = job.id();
@@ -523,7 +523,7 @@ public class HadoopExternalTaskExecutor extends HadoopTaskExecutorAdapter {
* @return Started process.
*/
private Process startJavaProcess(UUID childProcId, HadoopExternalTaskMetadata startMeta,
- HadoopJob job, String igniteWorkDir) throws Exception {
+ HadoopJobEx job, String igniteWorkDir) throws Exception {
String outFldr = jobWorkFolder(job.id()) + File.separator + childProcId;
if (log.isDebugEnabled())
@@ -633,7 +633,7 @@ public class HadoopExternalTaskExecutor extends HadoopTaskExecutorAdapter {
* @param job Job.
* @param plan Map reduce plan.
*/
- private void prepareForJob(HadoopProcess proc, HadoopJob job, HadoopMapReducePlan plan) {
+ private void prepareForJob(HadoopProcess proc, HadoopJobEx job, HadoopMapReducePlan plan) {
try {
comm.sendMessage(proc.descriptor(), new HadoopPrepareForJobRequest(job.id(), job.info(),
plan.reducers(), plan.reducers(ctx.localNodeId())));
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/child/HadoopChildProcessRunner.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/child/HadoopChildProcessRunner.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/child/HadoopChildProcessRunner.java
index 3336120..8d23ffe 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/child/HadoopChildProcessRunner.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/child/HadoopChildProcessRunner.java
@@ -26,7 +26,7 @@ import org.apache.ignite.IgniteLogger;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.processors.hadoop.HadoopCommonUtils;
import org.apache.ignite.internal.processors.hadoop.HadoopHelperImpl;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskContext;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskInfo;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskInput;
@@ -90,7 +90,7 @@ public class HadoopChildProcessRunner {
private final GridFutureAdapter<?> initFut = new GridFutureAdapter<>();
/** Job instance. */
- private HadoopJob job;
+ private HadoopJobEx job;
/** Number of uncompleted tasks. */
private final AtomicInteger pendingTasks = new AtomicInteger();
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/resources/META-INF/classnames.properties b/modules/hadoop/src/main/resources/META-INF/classnames.properties
index 0ac17cf..f528107 100644
--- a/modules/hadoop/src/main/resources/META-INF/classnames.properties
+++ b/modules/hadoop/src/main/resources/META-INF/classnames.properties
@@ -29,13 +29,13 @@ org.apache.ignite.internal.processors.hadoop.HadoopAttributes
org.apache.ignite.internal.processors.hadoop.HadoopDefaultJobInfo
org.apache.ignite.internal.processors.hadoop.HadoopExternalSplit
org.apache.ignite.internal.processors.hadoop.HadoopFileBlock
-org.apache.ignite.internal.processors.hadoop.HadoopInputSplit
+org.apache.ignite.hadoop.HadoopInputSplit
org.apache.ignite.internal.processors.hadoop.HadoopJobId
org.apache.ignite.internal.processors.hadoop.HadoopJobInfo
org.apache.ignite.internal.processors.hadoop.HadoopJobPhase
org.apache.ignite.internal.processors.hadoop.HadoopJobProperty
org.apache.ignite.internal.processors.hadoop.HadoopJobStatus
-org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlan
+org.apache.ignite.hadoop.HadoopMapReducePlan
org.apache.ignite.internal.processors.hadoop.HadoopSplitWrapper
org.apache.ignite.internal.processors.hadoop.HadoopTaskCancelledException
org.apache.ignite.internal.processors.hadoop.HadoopTaskInfo
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopCommandLineTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopCommandLineTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopCommandLineTest.java
index 0be8bf9..666acdf 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopCommandLineTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopCommandLineTest.java
@@ -38,7 +38,7 @@ import org.apache.ignite.igfs.IgfsInputStream;
import org.apache.ignite.igfs.IgfsPath;
import org.apache.ignite.internal.IgnitionEx;
import org.apache.ignite.internal.processors.hadoop.HadoopCommonUtils;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.jobtracker.HadoopJobTracker;
import org.apache.ignite.internal.processors.igfs.IgfsEx;
import org.apache.ignite.internal.processors.resource.GridSpringResourceContext;
@@ -245,7 +245,7 @@ public class HadoopCommandLineTest extends GridCommonAbstractTest {
private ProcessBuilder createProcessBuilder() {
String sep = ":";
- String ggClsPath = HadoopJob.class.getProtectionDomain().getCodeSource().getLocation().getPath() + sep +
+ String ggClsPath = HadoopJobEx.class.getProtectionDomain().getCodeSource().getLocation().getPath() + sep +
HadoopJobTracker.class.getProtectionDomain().getCodeSource().getLocation().getPath() + sep +
ConcurrentHashMap8.class.getProtectionDomain().getCodeSource().getLocation().getPath();
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopJobTrackerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopJobTrackerSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopJobTrackerSelfTest.java
index 91ad5ec..692c2a3 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopJobTrackerSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopJobTrackerSelfTest.java
@@ -36,6 +36,7 @@ import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.ignite.configuration.HadoopConfiguration;
+import org.apache.ignite.hadoop.planner.HadoopTestRoundRobinMrPlanner;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.processors.hadoop.Hadoop;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopPlannerMockJob.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopPlannerMockJob.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopPlannerMockJob.java
index 7e6fa9c..28c8264 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopPlannerMockJob.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopPlannerMockJob.java
@@ -20,8 +20,8 @@ package org.apache.ignite.internal.processors.hadoop.impl;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.internal.processors.hadoop.HadoopHelper;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.hadoop.HadoopInputSplit;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
import org.apache.ignite.internal.processors.hadoop.HadoopJobInfo;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskContext;
@@ -34,7 +34,7 @@ import java.util.UUID;
/**
* Mock job for planner tests.
*/
-public class HadoopPlannerMockJob implements HadoopJob {
+public class HadoopPlannerMockJob extends HadoopJobEx {
/** Input splits. */
private final Collection<HadoopInputSplit> splits;
@@ -53,7 +53,7 @@ public class HadoopPlannerMockJob implements HadoopJob {
}
/** {@inheritDoc} */
- @Override public Collection<HadoopInputSplit> input() throws IgniteCheckedException {
+ @Override public Collection<HadoopInputSplit> input() {
return splits;
}
@@ -158,7 +158,7 @@ public class HadoopPlannerMockJob implements HadoopJob {
}
/** {@inheritDoc} */
- @Override public HadoopJob createJob(Class<? extends HadoopJob> jobCls, HadoopJobId jobId, IgniteLogger log,
+ @Override public HadoopJobEx createJob(Class<? extends HadoopJobEx> jobCls, HadoopJobId jobId, IgniteLogger log,
@Nullable String[] libNames, HadoopHelper helper) throws IgniteCheckedException {
throwUnsupported();
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksAllVersionsTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksAllVersionsTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksAllVersionsTest.java
index 8b1b693..5d34989 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksAllVersionsTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksAllVersionsTest.java
@@ -28,7 +28,7 @@ import org.apache.hadoop.io.Text;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.igfs.IgfsPath;
import org.apache.ignite.internal.processors.hadoop.HadoopFileBlock;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskInfo;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskType;
import org.apache.ignite.internal.processors.hadoop.impl.examples.HadoopWordCount2;
@@ -48,7 +48,7 @@ abstract class HadoopTasksAllVersionsTest extends HadoopAbstractWordCountTest {
* @return Hadoop job.
* @throws IOException If fails.
*/
- public abstract HadoopJob getHadoopJob(String inFile, String outFile) throws Exception;
+ public abstract HadoopJobEx getHadoopJob(String inFile, String outFile) throws Exception;
/**
* @return prefix of reducer output file name. It's "part-" for v1 and "part-r-" for v2 API
@@ -84,7 +84,7 @@ abstract class HadoopTasksAllVersionsTest extends HadoopAbstractWordCountTest {
HadoopFileBlock fileBlock2 = new HadoopFileBlock(HOSTS, inFileUri, fileBlock1.length(),
igfs.info(inFile).length() - fileBlock1.length());
- HadoopJob gridJob = getHadoopJob(igfsScheme() + inFile.toString(), igfsScheme() + PATH_OUTPUT);
+ HadoopJobEx gridJob = getHadoopJob(igfsScheme() + inFile.toString(), igfsScheme() + PATH_OUTPUT);
HadoopTaskInfo taskInfo = new HadoopTaskInfo(HadoopTaskType.MAP, gridJob.id(), 0, 0, fileBlock1);
@@ -115,7 +115,7 @@ abstract class HadoopTasksAllVersionsTest extends HadoopAbstractWordCountTest {
* @return Context with mock output.
* @throws IgniteCheckedException If fails.
*/
- private HadoopTestTaskContext runTaskWithInput(HadoopJob gridJob, HadoopTaskType taskType,
+ private HadoopTestTaskContext runTaskWithInput(HadoopJobEx gridJob, HadoopTaskType taskType,
int taskNum, String... words) throws IgniteCheckedException {
HadoopTaskInfo taskInfo = new HadoopTaskInfo(taskType, gridJob.id(), taskNum, 0, null);
@@ -141,7 +141,7 @@ abstract class HadoopTasksAllVersionsTest extends HadoopAbstractWordCountTest {
* @throws Exception If fails.
*/
public void testReduceTask() throws Exception {
- HadoopJob gridJob = getHadoopJob(igfsScheme() + PATH_INPUT, igfsScheme() + PATH_OUTPUT);
+ HadoopJobEx gridJob = getHadoopJob(igfsScheme() + PATH_INPUT, igfsScheme() + PATH_OUTPUT);
runTaskWithInput(gridJob, HadoopTaskType.REDUCE, 0, "word1", "5", "word2", "10");
runTaskWithInput(gridJob, HadoopTaskType.REDUCE, 1, "word3", "7", "word4", "15");
@@ -167,7 +167,7 @@ abstract class HadoopTasksAllVersionsTest extends HadoopAbstractWordCountTest {
* @throws Exception If fails.
*/
public void testCombinerTask() throws Exception {
- HadoopJob gridJob = getHadoopJob("/", "/");
+ HadoopJobEx gridJob = getHadoopJob("/", "/");
HadoopTestTaskContext ctx =
runTaskWithInput(gridJob, HadoopTaskType.COMBINE, 0, "word1", "5", "word2", "10");
@@ -187,7 +187,7 @@ abstract class HadoopTasksAllVersionsTest extends HadoopAbstractWordCountTest {
* @return Context of combine task with mock output.
* @throws IgniteCheckedException If fails.
*/
- private HadoopTestTaskContext runMapCombineTask(HadoopFileBlock fileBlock, HadoopJob gridJob)
+ private HadoopTestTaskContext runMapCombineTask(HadoopFileBlock fileBlock, HadoopJobEx gridJob)
throws IgniteCheckedException {
HadoopTaskInfo taskInfo = new HadoopTaskInfo(HadoopTaskType.MAP, gridJob.id(), 0, 0, fileBlock);
@@ -233,7 +233,7 @@ abstract class HadoopTasksAllVersionsTest extends HadoopAbstractWordCountTest {
HadoopFileBlock fileBlock1 = new HadoopFileBlock(HOSTS, inFileUri, 0, l);
HadoopFileBlock fileBlock2 = new HadoopFileBlock(HOSTS, inFileUri, l, fileLen - l);
- HadoopJob gridJob = getHadoopJob(inFileUri.toString(), igfsScheme() + PATH_OUTPUT);
+ HadoopJobEx gridJob = getHadoopJob(inFileUri.toString(), igfsScheme() + PATH_OUTPUT);
HadoopTestTaskContext combine1Ctx = runMapCombineTask(fileBlock1, gridJob);
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksV1Test.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksV1Test.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksV1Test.java
index d7cd738..1d7f3e4 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksV1Test.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksV1Test.java
@@ -21,7 +21,7 @@ import java.io.IOException;
import java.util.UUID;
import org.apache.hadoop.mapred.JobConf;
import org.apache.ignite.internal.processors.hadoop.HadoopDefaultJobInfo;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
import org.apache.ignite.internal.processors.hadoop.HadoopHelperImpl;
import org.apache.ignite.internal.processors.hadoop.impl.examples.HadoopWordCount1;
@@ -41,7 +41,7 @@ public class HadoopTasksV1Test extends HadoopTasksAllVersionsTest {
* @return Hadoop job.
* @throws IOException If fails.
*/
- @Override public HadoopJob getHadoopJob(String inFile, String outFile) throws Exception {
+ @Override public HadoopJobEx getHadoopJob(String inFile, String outFile) throws Exception {
JobConf jobConf = HadoopWordCount1.getJob(inFile, outFile);
setupFileSystems(jobConf);
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksV2Test.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksV2Test.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksV2Test.java
index c635c41..61e3e46 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksV2Test.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTasksV2Test.java
@@ -26,7 +26,7 @@ import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.ignite.internal.processors.hadoop.HadoopDefaultJobInfo;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
import org.apache.ignite.internal.processors.hadoop.HadoopHelperImpl;
import org.apache.ignite.internal.processors.hadoop.impl.examples.HadoopWordCount2;
@@ -46,7 +46,7 @@ public class HadoopTasksV2Test extends HadoopTasksAllVersionsTest {
* @return Hadoop job.
* @throws Exception if fails.
*/
- @Override public HadoopJob getHadoopJob(String inFile, String outFile) throws Exception {
+ @Override public HadoopJobEx getHadoopJob(String inFile, String outFile) throws Exception {
Job job = Job.getInstance();
job.setOutputKeyClass(Text.class);
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTestRoundRobinMrPlanner.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTestRoundRobinMrPlanner.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTestRoundRobinMrPlanner.java
deleted file mode 100644
index 81f6f3c..0000000
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTestRoundRobinMrPlanner.java
+++ /dev/null
@@ -1,75 +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.hadoop.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.UUID;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlan;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlanner;
-import org.apache.ignite.internal.processors.hadoop.planner.HadoopDefaultMapReducePlan;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Round-robin mr planner.
- */
-public class HadoopTestRoundRobinMrPlanner implements HadoopMapReducePlanner {
- /** {@inheritDoc} */
- @Override public HadoopMapReducePlan preparePlan(HadoopJob job, Collection<ClusterNode> top,
- @Nullable HadoopMapReducePlan oldPlan) throws IgniteCheckedException {
- if (top.isEmpty())
- throw new IllegalArgumentException("Topology is empty");
-
- // Has at least one element.
- Iterator<ClusterNode> it = top.iterator();
-
- Map<UUID, Collection<HadoopInputSplit>> mappers = new HashMap<>();
-
- for (HadoopInputSplit block : job.input()) {
- ClusterNode node = it.next();
-
- Collection<HadoopInputSplit> nodeBlocks = mappers.get(node.id());
-
- if (nodeBlocks == null) {
- nodeBlocks = new ArrayList<>();
-
- mappers.put(node.id(), nodeBlocks);
- }
-
- nodeBlocks.add(block);
-
- if (!it.hasNext())
- it = top.iterator();
- }
-
- int[] rdc = new int[job.info().reducers()];
-
- for (int i = 0; i < rdc.length; i++)
- rdc[i] = i;
-
- return new HadoopDefaultMapReducePlan(mappers, Collections.singletonMap(it.next().id(), rdc));
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTestTaskContext.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTestTaskContext.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTestTaskContext.java
index cfd41cf..fd213a1 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTestTaskContext.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTestTaskContext.java
@@ -33,7 +33,7 @@ import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.JobConf;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.processors.hadoop.HadoopDefaultJobInfo;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskInfo;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskInput;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskOutput;
@@ -192,7 +192,7 @@ class HadoopTestTaskContext extends HadoopV2TaskContext {
* @param taskInfo Task info.
* @param gridJob Grid Hadoop job.
*/
- public HadoopTestTaskContext(HadoopTaskInfo taskInfo, HadoopJob gridJob) throws IgniteCheckedException {
+ public HadoopTestTaskContext(HadoopTaskInfo taskInfo, HadoopJobEx gridJob) throws IgniteCheckedException {
super(taskInfo, gridJob, gridJob.id(), null, jobConfDataInput(gridJob));
}
@@ -203,7 +203,7 @@ class HadoopTestTaskContext extends HadoopV2TaskContext {
* @return DataInput with JobConf.
* @throws IgniteCheckedException If failed.
*/
- private static DataInput jobConfDataInput(HadoopJob job) throws IgniteCheckedException {
+ private static DataInput jobConfDataInput(HadoopJobEx job) throws IgniteCheckedException {
JobConf jobConf = new JobConf();
for (Map.Entry<String, String> e : ((HadoopDefaultJobInfo)job.info()).properties().entrySet())
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopV2JobSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopV2JobSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopV2JobSelfTest.java
index 540a7aa..2c2f049 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopV2JobSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopV2JobSelfTest.java
@@ -31,7 +31,7 @@ import org.apache.hadoop.io.serializer.WritableSerialization;
import org.apache.hadoop.mapred.JobConf;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.processors.hadoop.HadoopDefaultJobInfo;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
import org.apache.ignite.internal.processors.hadoop.HadoopSerialization;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskContext;
@@ -69,7 +69,7 @@ public class HadoopV2JobSelfTest extends HadoopAbstractSelfTest {
}
/**
- * Tests that {@link HadoopJob} provides wrapped serializer if it's set in configuration.
+ * Tests that {@link HadoopJobEx} provides wrapped serializer if it's set in configuration.
*
* @throws IgniteCheckedException If fails.
*/
@@ -86,7 +86,7 @@ public class HadoopV2JobSelfTest extends HadoopAbstractSelfTest {
HadoopJobId id = new HadoopJobId(uuid, 1);
- HadoopJob job = info.createJob(HadoopV2Job.class, id, log, null, new HadoopHelperImpl());
+ HadoopJobEx job = info.createJob(HadoopV2Job.class, id, log, null, new HadoopHelperImpl());
HadoopTaskContext taskCtx = job.getTaskContext(new HadoopTaskInfo(HadoopTaskType.MAP, null, 0, 0,
null));
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopWeightedMapReducePlannerTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopWeightedMapReducePlannerTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopWeightedMapReducePlannerTest.java
index 430c675..6dcd998 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopWeightedMapReducePlannerTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopWeightedMapReducePlannerTest.java
@@ -24,9 +24,9 @@ import org.apache.ignite.igfs.IgfsBlockLocation;
import org.apache.ignite.igfs.IgfsPath;
import org.apache.ignite.internal.IgniteNodeAttributes;
import org.apache.ignite.internal.processors.hadoop.HadoopFileBlock;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlan;
-import org.apache.ignite.internal.processors.hadoop.planner.HadoopAbstractMapReducePlanner;
+import org.apache.ignite.hadoop.HadoopInputSplit;
+import org.apache.ignite.hadoop.HadoopMapReducePlan;
+import org.apache.ignite.hadoop.planner.HadoopAbstractMapReducePlanner;
import org.apache.ignite.internal.processors.igfs.IgfsIgniteMock;
import org.apache.ignite.internal.processors.igfs.IgfsMock;
import org.apache.ignite.internal.util.typedef.F;
http://git-wip-us.apache.org/repos/asf/ignite/blob/d14e0727/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/shuffle/collections/HadoopAbstractMapTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/shuffle/collections/HadoopAbstractMapTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/shuffle/collections/HadoopAbstractMapTest.java
index 1f8978d..b9dcae1 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/shuffle/collections/HadoopAbstractMapTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/shuffle/collections/HadoopAbstractMapTest.java
@@ -24,7 +24,7 @@ import org.apache.hadoop.io.IntWritable;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.internal.processors.hadoop.HadoopHelper;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
+import org.apache.ignite.internal.processors.hadoop.HadoopJobEx;
import org.apache.ignite.internal.processors.hadoop.HadoopJobId;
import org.apache.ignite.internal.processors.hadoop.HadoopJobInfo;
import org.apache.ignite.internal.processors.hadoop.HadoopPartitioner;
@@ -150,7 +150,7 @@ public abstract class HadoopAbstractMapTest extends GridCommonAbstractTest {
}
/** {@inheritDoc} */
- @Override public HadoopJob createJob(Class<? extends HadoopJob> jobCls, HadoopJobId jobId, IgniteLogger log,
+ @Override public HadoopJobEx createJob(Class<? extends HadoopJobEx> jobCls, HadoopJobId jobId, IgniteLogger log,
@Nullable String[] libNames, HadoopHelper helper) throws IgniteCheckedException {
assert false;
[24/50] [abbrv] ignite git commit: IGNITE-4516: Hadoop: implemented
optional compression for remote shuffle output. This closes #1399.
Posted by ag...@apache.org.
IGNITE-4516: Hadoop: implemented optional compression for remote shuffle output. This closes #1399.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d62542b9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d62542b9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d62542b9
Branch: refs/heads/ignite-3477
Commit: d62542b9bbfff5a221915f2bd1d23ecfee9814cf
Parents: 2774d87
Author: devozerov <vo...@gridgain.com>
Authored: Thu Jan 5 11:30:42 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Jan 5 11:30:42 2017 +0300
----------------------------------------------------------------------
.../processors/hadoop/HadoopJobProperty.java | 7 +++
.../shuffle/HadoopDirectShuffleMessage.java | 34 +++++++++++-
.../hadoop/shuffle/HadoopShuffleJob.java | 57 +++++++++++++++++---
.../shuffle/direct/HadoopDirectDataOutput.java | 14 +++++
.../direct/HadoopDirectDataOutputContext.java | 48 +++++++++++++++--
.../direct/HadoopDirectDataOutputState.java | 14 ++++-
.../hadoop/impl/HadoopTeraSortTest.java | 32 +++++++++--
7 files changed, 188 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d62542b9/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobProperty.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobProperty.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobProperty.java
index 4398acd..4dd3bf5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobProperty.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobProperty.java
@@ -103,6 +103,13 @@ public enum HadoopJobProperty {
SHUFFLE_MSG_SIZE("ignite.shuffle.message.size"),
/**
+ * Whether shuffle message should be compressed with GZIP.
+ * <p>
+ * Defaults to {@code false}.
+ */
+ SHUFFLE_MSG_GZIP("ignite.shuffle.message.gzip"),
+
+ /**
* Whether to stripe mapper output for remote reducers.
* <p>
* Defaults to {@code false}.
http://git-wip-us.apache.org/repos/asf/ignite/blob/d62542b9/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopDirectShuffleMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopDirectShuffleMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopDirectShuffleMessage.java
index e81dc5f..f596100 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopDirectShuffleMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopDirectShuffleMessage.java
@@ -57,6 +57,9 @@ public class HadoopDirectShuffleMessage implements Message, HadoopMessage {
@GridDirectTransient
private transient int bufLen;
+ /** Data length. */
+ private int dataLen;
+
/**
* Default constructor.
*/
@@ -72,8 +75,9 @@ public class HadoopDirectShuffleMessage implements Message, HadoopMessage {
* @param cnt Count.
* @param buf Buffer.
* @param bufLen Buffer length.
+ * @param dataLen Data length.
*/
- public HadoopDirectShuffleMessage(HadoopJobId jobId, int reducer, int cnt, byte[] buf, int bufLen) {
+ public HadoopDirectShuffleMessage(HadoopJobId jobId, int reducer, int cnt, byte[] buf, int bufLen, int dataLen) {
assert jobId != null;
this.jobId = jobId;
@@ -81,6 +85,7 @@ public class HadoopDirectShuffleMessage implements Message, HadoopMessage {
this.cnt = cnt;
this.buf = buf;
this.bufLen = bufLen;
+ this.dataLen = dataLen;
}
/**
@@ -111,6 +116,13 @@ public class HadoopDirectShuffleMessage implements Message, HadoopMessage {
return buf;
}
+ /**
+ * @return Data length.
+ */
+ public int dataLength() {
+ return dataLen;
+ }
+
/** {@inheritDoc} */
@Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
writer.setBuffer(buf);
@@ -147,6 +159,12 @@ public class HadoopDirectShuffleMessage implements Message, HadoopMessage {
writer.incrementState();
+ case 4:
+ if (!writer.writeInt("dataLen", dataLen))
+ return false;
+
+ writer.incrementState();
+
}
return true;
@@ -194,6 +212,14 @@ public class HadoopDirectShuffleMessage implements Message, HadoopMessage {
reader.incrementState();
+ case 4:
+ dataLen = reader.readInt("dataLen");
+
+ if (!reader.isLastRead())
+ return false;
+
+ reader.incrementState();
+
}
return reader.afterMessageRead(HadoopDirectShuffleMessage.class);
@@ -206,7 +232,7 @@ public class HadoopDirectShuffleMessage implements Message, HadoopMessage {
/** {@inheritDoc} */
@Override public byte fieldsCount() {
- return 4;
+ return 5;
}
/** {@inheritDoc} */
@@ -222,6 +248,8 @@ public class HadoopDirectShuffleMessage implements Message, HadoopMessage {
out.writeInt(cnt);
U.writeByteArray(out, buf);
+
+ out.writeInt(dataLen);
}
/** {@inheritDoc} */
@@ -234,6 +262,8 @@ public class HadoopDirectShuffleMessage implements Message, HadoopMessage {
buf = U.readByteArray(in);
bufLen = buf != null ? buf.length : 0;
+
+ dataLen = in.readInt();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/d62542b9/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java
index 1c546a1..0394865 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java
@@ -56,6 +56,8 @@ import org.apache.ignite.lang.IgniteInClosure;
import org.apache.ignite.thread.IgniteThread;
import org.jetbrains.annotations.Nullable;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -63,10 +65,12 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReferenceArray;
+import java.util.zip.GZIPInputStream;
import static org.apache.ignite.internal.processors.hadoop.HadoopJobProperty.PARTITION_HASHMAP_SIZE;
import static org.apache.ignite.internal.processors.hadoop.HadoopJobProperty.SHUFFLE_JOB_THROTTLE;
import static org.apache.ignite.internal.processors.hadoop.HadoopJobProperty.SHUFFLE_MAPPER_STRIPED_OUTPUT;
+import static org.apache.ignite.internal.processors.hadoop.HadoopJobProperty.SHUFFLE_MSG_GZIP;
import static org.apache.ignite.internal.processors.hadoop.HadoopJobProperty.SHUFFLE_MSG_SIZE;
import static org.apache.ignite.internal.processors.hadoop.HadoopJobProperty.SHUFFLE_REDUCER_NO_SORTING;
import static org.apache.ignite.internal.processors.hadoop.HadoopJobProperty.get;
@@ -79,6 +83,9 @@ public class HadoopShuffleJob<T> implements AutoCloseable {
private static final int DFLT_SHUFFLE_MSG_SIZE = 1024 * 1024;
/** */
+ private static final boolean DFLT_SHUFFLE_MSG_GZIP = false;
+
+ /** */
private final HadoopJob job;
/** */
@@ -130,6 +137,9 @@ public class HadoopShuffleJob<T> implements AutoCloseable {
/** Message size. */
private final int msgSize;
+ /** Whether to GZIP shuffle messages. */
+ private final boolean msgGzip;
+
/** Whether to strip mappers for remote execution. */
private final boolean stripeMappers;
@@ -190,6 +200,7 @@ public class HadoopShuffleJob<T> implements AutoCloseable {
stripeMappers = stripeMappers0;
msgSize = get(job.info(), SHUFFLE_MSG_SIZE, DFLT_SHUFFLE_MSG_SIZE);
+ msgGzip = get(job.info(), SHUFFLE_MSG_GZIP, DFLT_SHUFFLE_MSG_GZIP);
locReducersCtx = new AtomicReferenceArray<>(totalReducerCnt);
@@ -360,22 +371,26 @@ public class HadoopShuffleJob<T> implements AutoCloseable {
* @throws IgniteCheckedException Exception.
*/
public void onDirectShuffleMessage(T src, HadoopDirectShuffleMessage msg) throws IgniteCheckedException {
- assert msg.buffer() != null;
+ byte[] buf = extractBuffer(msg);
- HadoopTaskContext taskCtx = locReducersCtx.get(msg.reducer()).get();
+ assert buf != null;
+
+ int rdc = msg.reducer();
+
+ HadoopTaskContext taskCtx = locReducersCtx.get(rdc).get();
HadoopPerformanceCounter perfCntr = HadoopPerformanceCounter.getCounter(taskCtx.counters(), null);
- perfCntr.onShuffleMessage(msg.reducer(), U.currentTimeMillis());
+ perfCntr.onShuffleMessage(rdc, U.currentTimeMillis());
- HadoopMultimap map = getOrCreateMap(locMaps, msg.reducer());
+ HadoopMultimap map = getOrCreateMap(locMaps, rdc);
HadoopSerialization keySer = taskCtx.keySerialization();
HadoopSerialization valSer = taskCtx.valueSerialization();
// Add data from message to the map.
try (HadoopMultimap.Adder adder = map.startAdding(taskCtx)) {
- HadoopDirectDataInput in = new HadoopDirectDataInput(msg.buffer());
+ HadoopDirectDataInput in = new HadoopDirectDataInput(buf);
Object key = null;
Object val = null;
@@ -393,6 +408,31 @@ public class HadoopShuffleJob<T> implements AutoCloseable {
}
/**
+ * Extract buffer from direct shuffle message.
+ *
+ * @param msg Message.
+ * @return Buffer.
+ */
+ private byte[] extractBuffer(HadoopDirectShuffleMessage msg) throws IgniteCheckedException {
+ if (msgGzip) {
+ byte[] res = new byte[msg.dataLength()];
+
+ try (GZIPInputStream in = new GZIPInputStream(new ByteArrayInputStream(msg.buffer()), res.length)) {
+ int len = in.read(res, 0, res.length);
+
+ assert len == res.length;
+ }
+ catch (IOException e) {
+ throw new IgniteCheckedException("Failed to uncompress direct shuffle message.", e);
+ }
+
+ return res;
+ }
+ else
+ return msg.buffer();
+ }
+
+ /**
* @param ack Shuffle ack.
*/
@SuppressWarnings("ConstantConditions")
@@ -595,7 +635,8 @@ public class HadoopShuffleJob<T> implements AutoCloseable {
* @param rmtDirectCtx Remote direct context.
* @param reset Whether to perform reset.
*/
- private void sendShuffleMessage(int rmtMapIdx, @Nullable HadoopDirectDataOutputContext rmtDirectCtx, boolean reset) {
+ private void sendShuffleMessage(int rmtMapIdx, @Nullable HadoopDirectDataOutputContext rmtDirectCtx,
+ boolean reset) {
if (rmtDirectCtx == null)
return;
@@ -612,7 +653,7 @@ public class HadoopShuffleJob<T> implements AutoCloseable {
rmtDirectCtx.reset();
HadoopDirectShuffleMessage msg = new HadoopDirectShuffleMessage(job.id(), rmtRdcIdx, cnt,
- state.buffer(), state.bufferLength());
+ state.buffer(), state.bufferLength(), state.dataLength());
T nodeId = reduceAddrs[rmtRdcIdx];
@@ -983,7 +1024,7 @@ public class HadoopShuffleJob<T> implements AutoCloseable {
HadoopDirectDataOutputContext rmtDirectCtx = rmtDirectCtxs[idx];
if (rmtDirectCtx == null) {
- rmtDirectCtx = new HadoopDirectDataOutputContext(msgSize, taskCtx);
+ rmtDirectCtx = new HadoopDirectDataOutputContext(msgSize, msgGzip, taskCtx);
rmtDirectCtxs[idx] = rmtDirectCtx;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d62542b9/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutput.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutput.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutput.java
index 151e552..5840994 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutput.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutput.java
@@ -170,6 +170,13 @@ public class HadoopDirectDataOutput extends OutputStream implements DataOutput {
}
/**
+ * @return Buffer length (how much memory is allocated).
+ */
+ public int bufferLength() {
+ return bufSize;
+ }
+
+ /**
* @return Position.
*/
public int position() {
@@ -184,6 +191,13 @@ public class HadoopDirectDataOutput extends OutputStream implements DataOutput {
}
/**
+ * Reset the stream.
+ */
+ public void reset() {
+ pos = 0;
+ }
+
+ /**
* Ensure that the given amount of bytes is available within the stream, then shift the position.
*
* @param cnt Count.
http://git-wip-us.apache.org/repos/asf/ignite/blob/d62542b9/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutputContext.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutputContext.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutputContext.java
index bc70ef3..454278b 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutputContext.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutputContext.java
@@ -18,16 +18,29 @@
package org.apache.ignite.internal.processors.hadoop.shuffle.direct;
import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteException;
import org.apache.ignite.internal.processors.hadoop.HadoopSerialization;
import org.apache.ignite.internal.processors.hadoop.HadoopTaskContext;
+import java.io.IOException;
+import java.util.zip.GZIPOutputStream;
+
/**
* Hadoop data output context for direct communication.
*/
public class HadoopDirectDataOutputContext {
+ /** Initial allocation size for GZIP output. We start with very low value, but then it will grow if needed. */
+ private static final int GZIP_OUT_MIN_ALLOC_SIZE = 1024;
+
+ /** GZIP buffer size. We should remove it when we implement efficient direct GZIP output. */
+ private static final int GZIP_BUFFER_SIZE = 8096;
+
/** Flush size. */
private final int flushSize;
+ /** Whether to perform GZIP. */
+ private final boolean gzip;
+
/** Key serialization. */
private final HadoopSerialization keySer;
@@ -37,6 +50,9 @@ public class HadoopDirectDataOutputContext {
/** Data output. */
private HadoopDirectDataOutput out;
+ /** Data output for GZIP. */
+ private HadoopDirectDataOutput gzipOut;
+
/** Number of keys written. */
private int cnt;
@@ -44,17 +60,22 @@ public class HadoopDirectDataOutputContext {
* Constructor.
*
* @param flushSize Flush size.
+ * @param gzip Whether to perform GZIP.
* @param taskCtx Task context.
* @throws IgniteCheckedException If failed.
*/
- public HadoopDirectDataOutputContext(int flushSize, HadoopTaskContext taskCtx)
+ public HadoopDirectDataOutputContext(int flushSize, boolean gzip, HadoopTaskContext taskCtx)
throws IgniteCheckedException {
this.flushSize = flushSize;
+ this.gzip = gzip;
keySer = taskCtx.keySerialization();
valSer = taskCtx.valueSerialization();
out = new HadoopDirectDataOutput(flushSize);
+
+ if (gzip)
+ gzipOut = new HadoopDirectDataOutput(Math.max(flushSize / 8, GZIP_OUT_MIN_ALLOC_SIZE));
}
/**
@@ -85,16 +106,35 @@ public class HadoopDirectDataOutputContext {
* @return State.
*/
public HadoopDirectDataOutputState state() {
- return new HadoopDirectDataOutputState(out.buffer(), out.position());
+ if (gzip) {
+ try {
+ try (GZIPOutputStream gzip = new GZIPOutputStream(gzipOut, GZIP_BUFFER_SIZE)) {
+ gzip.write(out.buffer(), 0, out.position());
+ }
+
+ return new HadoopDirectDataOutputState(gzipOut.buffer(), gzipOut.position(), out.position());
+ }
+ catch (IOException e) {
+ throw new IgniteException("Failed to compress.", e);
+ }
+ }
+ else
+ return new HadoopDirectDataOutputState(out.buffer(), out.position(), out.position());
}
/**
* Reset buffer.
*/
public void reset() {
- int allocSize = Math.max(flushSize, out.position());
+ if (gzip) {
+ // In GZIP mode we do not expose normal output to the outside. Hence, no need for reallocation, just reset.
+ out.reset();
+
+ gzipOut = new HadoopDirectDataOutput(gzipOut.bufferLength());
+ }
+ else
+ out = new HadoopDirectDataOutput(flushSize, out.bufferLength());
- out = new HadoopDirectDataOutput(flushSize, allocSize);
cnt = 0;
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d62542b9/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutputState.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutputState.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutputState.java
index a9c12e3..cadde7a 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutputState.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataOutputState.java
@@ -27,15 +27,20 @@ public class HadoopDirectDataOutputState {
/** Buffer length. */
private final int bufLen;
+ /** Data length. */
+ private final int dataLen;
+
/**
* Constructor.
*
* @param buf Buffer.
* @param bufLen Buffer length.
+ * @param dataLen Data length.
*/
- public HadoopDirectDataOutputState(byte[] buf, int bufLen) {
+ public HadoopDirectDataOutputState(byte[] buf, int bufLen, int dataLen) {
this.buf = buf;
this.bufLen = bufLen;
+ this.dataLen = dataLen;
}
/**
@@ -51,4 +56,11 @@ public class HadoopDirectDataOutputState {
public int bufferLength() {
return bufLen;
}
+
+ /**
+ * @return Original data length.
+ */
+ public int dataLength() {
+ return dataLen;
+ }
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d62542b9/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTeraSortTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTeraSortTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTeraSortTest.java
index b1fa91f..d237180 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTeraSortTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopTeraSortTest.java
@@ -137,8 +137,10 @@ public class HadoopTeraSortTest extends HadoopAbstractSelfTest {
/**
* Does actual test TeraSort job Through Ignite API
+ *
+ * @param gzip Whether to use GZIP.
*/
- protected final void teraSort() throws Exception {
+ protected final void teraSort(boolean gzip) throws Exception {
System.out.println("TeraSort ===============================================================");
getFileSystem().delete(new Path(sortOutDir), true);
@@ -164,6 +166,10 @@ public class HadoopTeraSortTest extends HadoopAbstractSelfTest {
jobConf.set("mapred.max.split.size", String.valueOf(splitSize));
jobConf.setBoolean(HadoopJobProperty.SHUFFLE_MAPPER_STRIPED_OUTPUT.propertyName(), true);
+ jobConf.setInt(HadoopJobProperty.SHUFFLE_MSG_SIZE.propertyName(), 4096);
+
+ if (gzip)
+ jobConf.setBoolean(HadoopJobProperty.SHUFFLE_MSG_GZIP.propertyName(), true);
jobConf.set(HadoopJobProperty.JOB_PARTIALLY_RAW_COMPARATOR.propertyName(),
TextPartiallyRawComparator.class.getName());
@@ -347,12 +353,32 @@ public class HadoopTeraSortTest extends HadoopAbstractSelfTest {
/**
* Runs generate/sort/validate phases of the terasort sample.
- * @throws Exception
+ *
+ * @throws Exception If failed.
*/
public void testTeraSort() throws Exception {
+ checkTeraSort(false);
+ }
+
+ /**
+ * Runs generate/sort/validate phases of the terasort sample.
+ *
+ * @throws Exception If failed.
+ */
+ public void testTeraSortGzip() throws Exception {
+ checkTeraSort(true);
+ }
+
+ /**
+ * Check terasort.
+ *
+ * @param gzip GZIP flag.
+ * @throws Exception If failed.
+ */
+ private void checkTeraSort(boolean gzip) throws Exception {
teraGenerate();
- teraSort();
+ teraSort(gzip);
teraValidate();
}
[38/50] [abbrv] ignite git commit: ignite-4293 Do not need store
deserialized value for BinaryMarshaller
Posted by ag...@apache.org.
ignite-4293 Do not need store deserialized value for BinaryMarshaller
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d10946b8
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d10946b8
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d10946b8
Branch: refs/heads/ignite-3477
Commit: d10946b8b107dee499a5798a4679ab5d14499764
Parents: abc8b90
Author: Alexandr Kuramshin <ak...@gridgain.com>
Authored: Fri Jan 13 12:26:39 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Jan 13 12:26:39 2017 +0300
----------------------------------------------------------------------
.../processors/cacheobject/IgniteCacheObjectProcessorImpl.java | 5 ++---
.../java/org/apache/ignite/cache/store/jdbc/model/Person.java | 2 +-
.../processors/cache/CacheEntryProcessorCopySelfTest.java | 6 ++++--
.../processors/cache/GridCacheBasicStoreAbstractTest.java | 2 +-
.../distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java | 5 +----
5 files changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d10946b8/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
index 208ec62..614c612 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
@@ -244,9 +244,8 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
CacheMemoryMode memMode = ccfg.getMemoryMode();
- boolean storeVal = ctx.config().isPeerClassLoadingEnabled() ||
- GridQueryProcessor.isEnabled(ccfg) ||
- !ccfg.isCopyOnRead();
+ boolean storeVal = !ccfg.isCopyOnRead() || (!isBinaryEnabled(ccfg) &&
+ (GridQueryProcessor.isEnabled(ccfg) || ctx.config().isPeerClassLoadingEnabled()));
CacheObjectContext res = new CacheObjectContext(ctx,
ccfg.getName(),
http://git-wip-us.apache.org/repos/asf/ignite/blob/d10946b8/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Person.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Person.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Person.java
index ddf309b..52ddfc8 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Person.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/Person.java
@@ -196,7 +196,7 @@ public class Person implements Serializable {
@Override public String toString() {
return "Person [id=" + id +
", orgId=" + orgId +
- ", birthday=" + birthday.getTime() +
+ ", birthday=" + (birthday == null ? null : birthday.getTime()) +
", name=" + name +
"]";
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d10946b8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheEntryProcessorCopySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheEntryProcessorCopySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheEntryProcessorCopySelfTest.java
index 21395e6..f44889b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheEntryProcessorCopySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheEntryProcessorCopySelfTest.java
@@ -30,6 +30,7 @@ import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CacheEntryProcessor;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
@@ -93,8 +94,9 @@ public class CacheEntryProcessorCopySelfTest extends GridCommonAbstractTest {
doTest(true, false, OLD_VAL, 1);
// One deserialization due to copyOnRead == true.
- // Additional deserialization in case p2p enabled due to storeValue == true on update entry.
- doTest(true, true, NEW_VAL, p2pEnabled ? 2 : 1);
+ // Additional deserialization in case p2p enabled and not BinaryMarshaller due to storeValue == true on update entry.
+ doTest(true, true, NEW_VAL, p2pEnabled &&
+ !(grid.configuration().getMarshaller() instanceof BinaryMarshaller) ? 2 : 1);
// No deserialization.
doTest(false, false, NEW_VAL, 0);
http://git-wip-us.apache.org/repos/asf/ignite/blob/d10946b8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicStoreAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicStoreAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicStoreAbstractTest.java
index 8ddd737..026b618 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicStoreAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicStoreAbstractTest.java
@@ -571,7 +571,7 @@ public abstract class GridCacheBasicStoreAbstractTest extends GridCommonAbstract
assert cached != null;
- assert cached == val : "Cached value mismatch [expected=" + val + ", cached=" + cached + ']';
+ assert cached.equals(val) : "Cached value mismatch [expected=" + val + ", cached=" + cached + ']';
// Make sure that value is coming from cache, not from store.
checkLastMethod(null);
http://git-wip-us.apache.org/repos/asf/ignite/blob/d10946b8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java
index 3f3f84f..e8a6cfb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java
@@ -117,10 +117,7 @@ public class GridCacheDhtEvictionsDisabledSelfTest extends GridCommonAbstractTes
assertNotNull(v1);
assertNotNull(v2);
- if (affinity(cache).mapKeyToNode(key).isLocal())
- assertSame(v1, v2);
- else
- assertEquals(v1, v2);
+ assertEquals(v1, v2);
}
}
}
\ No newline at end of file
[17/50] [abbrv] ignite git commit: IGNITE-4167: Changed
IGNITE_TO_STRING_INCLUDE_SENSITIVE default value to "true".
Posted by ag...@apache.org.
IGNITE-4167: Changed IGNITE_TO_STRING_INCLUDE_SENSITIVE default value to "true".
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6c38eb28
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6c38eb28
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6c38eb28
Branch: refs/heads/ignite-3477
Commit: 6c38eb28623271a3604ee8d966deb88677a3adb1
Parents: 5494dfb
Author: devozerov <vo...@gridgain.com>
Authored: Thu Dec 29 12:20:20 2016 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Dec 29 12:20:20 2016 +0300
----------------------------------------------------------------------
.../util/tostring/GridToStringBuilder.java | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6c38eb28/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java b/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
index 333f95e..6807b3f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
@@ -17,6 +17,13 @@
package org.apache.ignite.internal.util.tostring;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.IgniteSystemProperties;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.SB;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.jetbrains.annotations.Nullable;
+
import java.io.Externalizable;
import java.io.InputStream;
import java.io.OutputStream;
@@ -34,12 +41,8 @@ import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.IgniteSystemProperties;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.SB;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.jetbrains.annotations.Nullable;
+
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_TO_STRING_INCLUDE_SENSITIVE;
/**
* Provides auto-generation framework for {@code toString()} output.
@@ -87,7 +90,8 @@ public class GridToStringBuilder {
public static final int MAX_COL_SIZE = 100;
/** {@link IgniteSystemProperties#IGNITE_TO_STRING_INCLUDE_SENSITIVE} */
- public static final boolean INCLUDE_SENSITIVE = IgniteSystemProperties.getBoolean(IgniteSystemProperties.IGNITE_TO_STRING_INCLUDE_SENSITIVE, false);
+ public static final boolean INCLUDE_SENSITIVE =
+ IgniteSystemProperties.getBoolean(IGNITE_TO_STRING_INCLUDE_SENSITIVE, true);
/** */
private static ThreadLocal<Queue<GridToStringThreadLocal>> threadCache = new ThreadLocal<Queue<GridToStringThreadLocal>>() {
[26/50] [abbrv] ignite git commit: Merge branch 'master' into
ignite-2.0
Posted by ag...@apache.org.
Merge branch 'master' into ignite-2.0
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6090ebdf
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6090ebdf
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6090ebdf
Branch: refs/heads/ignite-3477
Commit: 6090ebdfcd0ea3840b0d32cb10197b43615e1e89
Parents: 1f74346 beb242b
Author: devozerov <vo...@gridgain.com>
Authored: Thu Jan 5 12:23:06 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Jan 5 12:23:06 2017 +0300
----------------------------------------------------------------------
modules/cloud/pom.xml | 6 +-
.../java/org/apache/ignite/IgniteLogger.java | 4 +-
.../apache/ignite/IgniteSystemProperties.java | 13 +
.../ignite/cache/affinity/AffinityKey.java | 4 +-
.../org/apache/ignite/events/CacheEvent.java | 6 +-
.../ignite/events/CacheQueryReadEvent.java | 8 +-
.../ignite/internal/binary/BinaryContext.java | 4 +-
.../internal/binary/BinaryEnumObjectImpl.java | 10 +-
.../ignite/internal/binary/BinaryMetadata.java | 5 +-
.../internal/binary/BinaryObjectExImpl.java | 8 +-
.../ignite/internal/binary/BinaryTypeProxy.java | 15 +-
.../ignite/internal/binary/BinaryUtils.java | 4 +-
.../cache/CacheInvokeDirectResult.java | 2 +-
.../processors/cache/CacheInvokeResult.java | 2 +-
.../processors/cache/CacheLazyEntry.java | 4 +-
.../processors/cache/CacheObjectAdapter.java | 7 +-
.../processors/cache/GridCacheAdapter.java | 5 +-
.../cache/GridCacheMvccCandidate.java | 9 +-
.../processors/cache/GridCacheReturn.java | 2 +-
.../processors/cache/IgniteCacheProxy.java | 2 +-
.../distributed/dht/GridDhtCacheAdapter.java | 2 +-
.../distributed/near/GridNearLockFuture.java | 2 +-
.../cache/query/GridCacheQueryAdapter.java | 4 +-
.../cache/query/GridCacheQueryManager.java | 13 +-
.../cache/query/GridCacheQueryRequest.java | 2 +
.../cache/query/GridCacheSqlQuery.java | 4 +-
.../continuous/CacheContinuousQueryEvent.java | 8 +-
.../continuous/CacheContinuousQueryManager.java | 4 +-
.../store/GridCacheStoreManagerAdapter.java | 30 +-
.../cache/store/GridCacheWriteBehindStore.java | 2 +-
.../transactions/IgniteTxLocalAdapter.java | 11 +-
.../GridCacheVersionConflictContext.java | 2 +-
.../closure/GridClosureProcessor.java | 4 +-
.../continuous/GridContinuousMessage.java | 2 +-
.../datastructures/CollocatedSetItemKey.java | 2 +-
.../GridCacheAtomicLongValue.java | 2 +
.../GridCacheAtomicSequenceImpl.java | 2 +
.../GridCacheAtomicSequenceValue.java | 2 +
.../GridCacheCountDownLatchValue.java | 3 +
.../datastructures/GridCacheSetItemKey.java | 2 +-
.../processors/hadoop/HadoopJobProperty.java | 7 +
.../shuffle/HadoopDirectShuffleMessage.java | 34 +-
.../internal/processors/job/GridJobWorker.java | 7 +-
.../odbc/OdbcQueryExecuteRequest.java | 6 +-
.../platform/PlatformNativeException.java | 3 +-
.../processors/query/GridQueryProcessor.java | 35 +-
.../processors/rest/GridRestResponse.java | 2 +-
.../internal/util/future/GridFutureAdapter.java | 2 +-
.../util/lang/GridMetadataAwareAdapter.java | 2 +-
.../ignite/internal/util/nio/GridNioServer.java | 159 ++++-
.../util/tostring/GridToStringBuilder.java | 656 +++++++++++++++++--
.../util/tostring/GridToStringInclude.java | 12 +-
.../util/tostring/GridToStringThreadLocal.java | 12 +-
.../query/VisorQueryScanSubstringFilter.java | 5 +-
.../internal/visor/query/VisorQueryUtils.java | 60 ++
.../communication/tcp/TcpCommunicationSpi.java | 20 +-
.../tcp/TcpCommunicationSpiMBean.java | 5 +-
.../apache/ignite/spi/indexing/IndexingSpi.java | 3 +
.../roundrobin/RoundRobinLoadBalancingSpi.java | 16 +-
.../resources/META-INF/classnames.properties | 1 +
.../internal/binary/BinaryEnumsSelfTest.java | 18 +
...mmunicationBalancePairedConnectionsTest.java | 28 +
.../IgniteCommunicationBalanceTest.java | 25 +-
.../GridCacheBinaryObjectsAbstractSelfTest.java | 7 +-
...cMessageRecoveryNoPairedConnectionsTest.java | 47 --
...micMessageRecoveryPairedConnectionsTest.java | 47 ++
.../cache/query/IndexingSpiQuerySelfTest.java | 199 +++++-
.../tostring/GridToStringBuilderSelfTest.java | 33 +-
.../ignite/testsuites/IgniteCacheTestSuite.java | 6 +-
modules/gce/pom.xml | 4 +-
.../hadoop/impl/igfs/HadoopIgfsJclLogger.java | 9 +-
.../hadoop/shuffle/HadoopShuffleJob.java | 57 +-
.../shuffle/direct/HadoopDirectDataOutput.java | 14 +
.../direct/HadoopDirectDataOutputContext.java | 48 +-
.../direct/HadoopDirectDataOutputState.java | 14 +-
.../hadoop/impl/HadoopTeraSortTest.java | 32 +-
.../org/apache/ignite/logger/jcl/JclLogger.java | 9 +-
.../Properties/AssemblyInfo.cs | 2 +-
.../Properties/AssemblyInfo.cs | 2 +-
.../Apache.Ignite.Core.Tests.csproj | 1 +
.../Cache/CacheAbstractTest.cs | 625 ------------------
.../Cache/CacheAbstractTransactionalTest.cs | 565 ++++++++++++++++
.../Cache/CacheLocalAtomicTest.cs | 5 -
.../Cache/CacheLocalTest.cs | 6 +-
.../CachePartitionedAtomicNearEnabledTest.cs | 5 -
.../Cache/CachePartitionedAtomicTest.cs | 5 -
.../Cache/CachePartitionedNearEnabledTest.cs | 7 +-
.../Cache/CachePartitionedTest.cs | 7 +-
.../Cache/CacheReplicatedAtomicTest.cs | 5 -
.../Cache/CacheReplicatedTest.cs | 7 +-
.../Query/CacheQueriesCodeConfigurationTest.cs | 4 +-
.../Properties/AssemblyInfo.cs | 2 +-
.../Impl/Transactions/TransactionsImpl.cs | 18 +
.../Transactions/ITransactions.cs | 19 +-
.../apache/ignite/logger/slf4j/Slf4jLogger.java | 11 +-
modules/web-console/backend/app/mongo.js | 19 +
.../generator/AbstractTransformer.js | 5 +
.../modules/configuration/generator/Beans.js | 4 +
.../generator/ConfigurationGenerator.js | 36 +
.../states/configuration/caches/affinity.jade | 82 +++
.../states/configuration/caches/memory.jade | 4 +-
.../frontend/views/configuration/caches.jade | 1 +
.../yardstick/cache/IgniteIoTestBenchmark.java | 73 ---
parent/pom.xml | 2 +-
104 files changed, 2351 insertions(+), 1038 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6090ebdf/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6090ebdf/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobProperty.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobProperty.java
index a3115bf,4dd3bf5..60992d5
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobProperty.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopJobProperty.java
@@@ -103,9 -103,16 +103,16 @@@ public enum HadoopJobProperty
SHUFFLE_MSG_SIZE("ignite.shuffle.message.size"),
/**
+ * Whether shuffle message should be compressed with GZIP.
+ * <p>
+ * Defaults to {@code false}.
+ */
+ SHUFFLE_MSG_GZIP("ignite.shuffle.message.gzip"),
+
+ /**
* Whether to stripe mapper output for remote reducers.
* <p>
- * Defaults to {@code false}.
+ * Defaults to {@code true}.
*/
SHUFFLE_MAPPER_STRIPED_OUTPUT("ignite.shuffle.mapper.striped.output"),
http://git-wip-us.apache.org/repos/asf/ignite/blob/6090ebdf/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java
----------------------------------------------------------------------
[08/50] [abbrv] ignite git commit: IGNITE-3875: Introduced separate
thread pool for data streamer. This closes #1173. This closes #1383.
Posted by ag...@apache.org.
IGNITE-3875: Introduced separate thread pool for data streamer. This closes #1173. This closes #1383.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7d82d6a0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7d82d6a0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7d82d6a0
Branch: refs/heads/ignite-3477
Commit: 7d82d6a06b5e9f1f8cd2909b865e37d46b8da03f
Parents: 7e73d02
Author: devozerov <vo...@gridgain.com>
Authored: Wed Dec 28 12:58:11 2016 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Wed Dec 28 12:58:11 2016 +0300
----------------------------------------------------------------------
.../configuration/IgniteConfiguration.java | 31 ++++++
.../ignite/internal/GridKernalContext.java | 7 ++
.../ignite/internal/GridKernalContextImpl.java | 12 +++
.../apache/ignite/internal/IgniteKernal.java | 3 +
.../org/apache/ignite/internal/IgnitionEx.java | 19 ++++
.../managers/communication/GridIoManager.java | 2 +
.../managers/communication/GridIoPolicy.java | 3 +
.../closure/GridClosureProcessor.java | 2 +-
.../datastreamer/DataStreamProcessor.java | 60 ++++++++---
.../datastreamer/DataStreamerImpl.java | 37 ++-----
.../internal/processors/pool/PoolProcessor.java | 5 +
.../DataStreamProcessorSelfTest.java | 104 +++++++++++++++++++
.../junits/GridTestKernalContext.java | 12 +--
13 files changed, 249 insertions(+), 48 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d82d6a0/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
index dcd8a80..e0ff9b9 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
@@ -148,6 +148,9 @@ public class IgniteConfiguration {
/** Default core size of public thread pool. */
public static final int DFLT_PUBLIC_THREAD_CNT = Math.max(8, AVAILABLE_PROC_CNT);
+ /** Default size of data streamer thread pool. */
+ public static final int DFLT_DATA_STREAMER_POOL_SIZE = DFLT_PUBLIC_THREAD_CNT;
+
/** Default keep alive time for public thread pool. */
@Deprecated
public static final long DFLT_PUBLIC_KEEP_ALIVE_TIME = 0;
@@ -251,6 +254,9 @@ public class IgniteConfiguration {
/** IGFS pool size. */
private int igfsPoolSize = AVAILABLE_PROC_CNT;
+ /** Data stream pool size. */
+ private int dataStreamerPoolSize = DFLT_DATA_STREAMER_POOL_SIZE;
+
/** Utility cache pool size. */
private int utilityCachePoolSize = DFLT_SYSTEM_CORE_THREAD_CNT;
@@ -514,6 +520,7 @@ public class IgniteConfiguration {
clockSyncFreq = cfg.getClockSyncFrequency();
clockSyncSamples = cfg.getClockSyncSamples();
consistentId = cfg.getConsistentId();
+ dataStreamerPoolSize = cfg.getDataStreamerThreadPoolSize();
deployMode = cfg.getDeploymentMode();
discoStartupDelay = cfg.getDiscoveryStartupDelay();
failureDetectionTimeout = cfg.getFailureDetectionTimeout();
@@ -837,6 +844,17 @@ public class IgniteConfiguration {
}
/**
+ * Size of thread pool that is in charge of processing data stream messages.
+ * <p>
+ * If not provided, executor service will have size {@link #DFLT_DATA_STREAMER_POOL_SIZE}.
+ *
+ * @return Thread pool size to be used for data stream messages.
+ */
+ public int getDataStreamerThreadPoolSize() {
+ return dataStreamerPoolSize;
+ }
+
+ /**
* Default size of thread pool that is in charge of processing utility cache messages.
* <p>
* If not provided, executor service will have size {@link #DFLT_SYSTEM_CORE_THREAD_CNT}.
@@ -960,6 +978,19 @@ public class IgniteConfiguration {
}
/**
+ * Set thread pool size that will be used to process data stream messages.
+ *
+ * @param poolSize Executor service to use for data stream messages.
+ * @see IgniteConfiguration#getDataStreamerThreadPoolSize()
+ * @return {@code this} for chaining.
+ */
+ public IgniteConfiguration setDataStreamerThreadPoolSize(int poolSize) {
+ dataStreamerPoolSize = poolSize;
+
+ return this;
+ }
+
+ /**
* Sets default thread pool size that will be used to process utility cache messages.
*
* @param poolSize Default executor service size to use for utility cache messages.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d82d6a0/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
index 927944f..9157fed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
@@ -542,6 +542,13 @@ public interface GridKernalContext extends Iterable<GridComponent> {
public ExecutorService getIgfsExecutorService();
/**
+ * Executor service that is in charge of processing data stream messages.
+ *
+ * @return Thread pool implementation to be used for data stream messages.
+ */
+ public ExecutorService getDataStreamerExecutorService();
+
+ /**
* Should return an instance of fully configured thread pool to be used for
* processing of client messages (REST requests).
*
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d82d6a0/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
index a2ad1b2..8fc5b36 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
@@ -317,6 +317,10 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
/** */
@GridToStringExclude
+ private ExecutorService dataStreamExecSvc;
+
+ /** */
+ @GridToStringExclude
protected ExecutorService restExecSvc;
/** */
@@ -390,6 +394,7 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
* @param p2pExecSvc P2P executor service.
* @param mgmtExecSvc Management executor service.
* @param igfsExecSvc IGFS executor service.
+ * @param dataStreamExecSvc data stream executor service.
* @param restExecSvc REST executor service.
* @param affExecSvc Affinity executor service.
* @param idxExecSvc Indexing executor service.
@@ -410,6 +415,7 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
ExecutorService p2pExecSvc,
ExecutorService mgmtExecSvc,
ExecutorService igfsExecSvc,
+ ExecutorService dataStreamExecSvc,
ExecutorService restExecSvc,
ExecutorService affExecSvc,
@Nullable ExecutorService idxExecSvc,
@@ -431,6 +437,7 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
this.p2pExecSvc = p2pExecSvc;
this.mgmtExecSvc = mgmtExecSvc;
this.igfsExecSvc = igfsExecSvc;
+ this.dataStreamExecSvc = dataStreamExecSvc;
this.restExecSvc = restExecSvc;
this.affExecSvc = affExecSvc;
this.idxExecSvc = idxExecSvc;
@@ -977,6 +984,11 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
}
/** {@inheritDoc} */
+ @Override public ExecutorService getDataStreamerExecutorService() {
+ return dataStreamExecSvc;
+ }
+
+ /** {@inheritDoc} */
@Override public ExecutorService getRestExecutorService() {
return restExecSvc;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d82d6a0/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 4972d1f..99c3dab 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -668,6 +668,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
* @param p2pExecSvc P2P executor service.
* @param mgmtExecSvc Management executor service.
* @param igfsExecSvc IGFS executor service.
+ * @param dataStreamExecSvc data stream executor service.
* @param restExecSvc Reset executor service.
* @param affExecSvc Affinity executor service.
* @param idxExecSvc Indexing executor service.
@@ -685,6 +686,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
ExecutorService p2pExecSvc,
ExecutorService mgmtExecSvc,
ExecutorService igfsExecSvc,
+ ExecutorService dataStreamExecSvc,
ExecutorService restExecSvc,
ExecutorService affExecSvc,
@Nullable ExecutorService idxExecSvc,
@@ -794,6 +796,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
p2pExecSvc,
mgmtExecSvc,
igfsExecSvc,
+ dataStreamExecSvc,
restExecSvc,
affExecSvc,
idxExecSvc,
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d82d6a0/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index f32a753..9fe6fd0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1472,6 +1472,9 @@ public class IgnitionEx {
/** IGFS executor service. */
private ThreadPoolExecutor igfsExecSvc;
+ /** Data streamer executor service. */
+ private ThreadPoolExecutor dataStreamerExecSvc;
+
/** REST requests executor service. */
private ThreadPoolExecutor restExecSvc;
@@ -1702,6 +1705,17 @@ public class IgnitionEx {
p2pExecSvc.allowCoreThreadTimeOut(true);
+ // Note that we do not pre-start threads here as this pool may not be needed.
+ dataStreamerExecSvc = new IgniteThreadPoolExecutor(
+ "data-streamer",
+ cfg.getGridName(),
+ cfg.getDataStreamerThreadPoolSize(),
+ cfg.getDataStreamerThreadPoolSize(),
+ DFLT_THREAD_KEEP_ALIVE_TIME,
+ new LinkedBlockingQueue<Runnable>());
+
+ dataStreamerExecSvc.allowCoreThreadTimeOut(true);
+
// Note that we do not pre-start threads here as igfs pool may not be needed.
validateThreadPoolSize(cfg.getIgfsThreadPoolSize(), "IGFS");
@@ -1806,6 +1820,7 @@ public class IgnitionEx {
p2pExecSvc,
mgmtExecSvc,
igfsExecSvc,
+ dataStreamerExecSvc,
restExecSvc,
affExecSvc,
idxExecSvc,
@@ -2445,6 +2460,10 @@ public class IgnitionEx {
p2pExecSvc = null;
+ U.shutdownNow(getClass(), dataStreamerExecSvc, log);
+
+ dataStreamerExecSvc = null;
+
U.shutdownNow(getClass(), igfsExecSvc, log);
igfsExecSvc = null;
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d82d6a0/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 7ef7bc0..de34adb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -90,6 +90,7 @@ import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
import static org.apache.ignite.internal.GridTopic.TOPIC_COMM_USER;
import static org.apache.ignite.internal.GridTopic.TOPIC_IO_TEST;
import static org.apache.ignite.internal.managers.communication.GridIoPolicy.AFFINITY_POOL;
+import static org.apache.ignite.internal.managers.communication.GridIoPolicy.DATA_STREAMER_POOL;
import static org.apache.ignite.internal.managers.communication.GridIoPolicy.IDX_POOL;
import static org.apache.ignite.internal.managers.communication.GridIoPolicy.IGFS_POOL;
import static org.apache.ignite.internal.managers.communication.GridIoPolicy.MANAGEMENT_POOL;
@@ -686,6 +687,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
case MARSH_CACHE_POOL:
case IDX_POOL:
case IGFS_POOL:
+ case DATA_STREAMER_POOL:
{
if (msg.isOrdered())
processOrderedMessage(nodeId, msg, plc, msgC);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d82d6a0/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java
index 70a7354..18235d2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoPolicy.java
@@ -49,6 +49,9 @@ public class GridIoPolicy {
/** Pool for handling distributed index range requests. */
public static final byte IDX_POOL = 8;
+ /** Data streamer execution pool. */
+ public static final byte DATA_STREAMER_POOL = 9;
+
/**
* Defines the range of reserved pools that are not available for plugins.
* @param key The key.
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d82d6a0/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
index a07dbf8..5ba21d7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
@@ -988,7 +988,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
* @param plc Policy to choose executor pool.
* @return Future.
*/
- private <R> IgniteInternalFuture<R> callLocalSafe(Callable<R> c, byte plc) {
+ public <R> IgniteInternalFuture<R> callLocalSafe(Callable<R> c, byte plc) {
try {
return callLocal(c, plc);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d82d6a0/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
index fee4dd6..5ebfd47 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
@@ -17,11 +17,8 @@
package org.apache.ignite.internal.processors.datastreamer;
-import java.util.Collection;
-import java.util.UUID;
-import java.util.concurrent.DelayQueue;
import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
@@ -40,6 +37,7 @@ import org.apache.ignite.internal.util.typedef.CI1;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.internal.util.worker.GridWorker;
+import org.apache.ignite.lang.IgniteClosure;
import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.lang.IgniteInClosure;
import org.apache.ignite.marshaller.Marshaller;
@@ -47,11 +45,15 @@ import org.apache.ignite.stream.StreamReceiver;
import org.apache.ignite.thread.IgniteThread;
import org.jetbrains.annotations.Nullable;
+import java.util.Collection;
+import java.util.UUID;
+import java.util.concurrent.DelayQueue;
+
import static org.apache.ignite.internal.GridTopic.TOPIC_DATASTREAM;
-import static org.apache.ignite.internal.managers.communication.GridIoPolicy.PUBLIC_POOL;
+import static org.apache.ignite.internal.managers.communication.GridIoPolicy.DATA_STREAMER_POOL;
/**
- *
+ * Data stream processor.
*/
public class DataStreamProcessor<K, V> extends GridProcessorAdapter {
/** Loaders map (access is not supposed to be highly concurrent). */
@@ -224,13 +226,15 @@ public class DataStreamProcessor<K, V> extends GridProcessorAdapter {
IgniteInternalFuture<?> fut = ctx.cache().context().exchange().affinityReadyFuture(rmtAffVer);
if (fut != null && !fut.isDone()) {
+ final byte plc = threadIoPolicy();
+
fut.listen(new CI1<IgniteInternalFuture<?>>() {
@Override public void apply(IgniteInternalFuture<?> t) {
ctx.closure().runLocalSafe(new Runnable() {
@Override public void run() {
processRequest(nodeId, req);
}
- }, false);
+ }, plc);
}
});
@@ -416,12 +420,7 @@ public class DataStreamProcessor<K, V> extends GridProcessorAdapter {
DataStreamerResponse res = new DataStreamerResponse(reqId, errBytes, forceLocDep);
try {
- Byte plc = GridIoManager.currentPolicy();
-
- if (plc == null)
- plc = PUBLIC_POOL;
-
- ctx.io().send(nodeId, resTopic, res, plc);
+ ctx.io().send(nodeId, resTopic, res, threadIoPolicy());
}
catch (IgniteCheckedException e) {
if (ctx.discovery().alive(nodeId))
@@ -431,6 +430,41 @@ public class DataStreamProcessor<K, V> extends GridProcessorAdapter {
}
}
+ /**
+ * Get IO policy.
+ *
+ * @return IO policy.
+ */
+ private static byte threadIoPolicy() {
+ Byte plc = GridIoManager.currentPolicy();
+
+ if (plc == null)
+ plc = DATA_STREAMER_POOL;
+
+ return plc;
+ }
+
+ /**
+ * Get IO policy for particular node with provided resolver.
+ *
+ * @param rslvr Resolver.
+ * @param node Node.
+ * @return IO policy.
+ */
+ public static byte ioPolicy(@Nullable IgniteClosure<ClusterNode, Byte> rslvr, ClusterNode node) {
+ assert node != null;
+
+ Byte res = null;
+
+ if (rslvr != null)
+ res = rslvr.apply(node);
+
+ if (res == null)
+ res = DATA_STREAMER_POOL;
+
+ return res;
+ }
+
/** {@inheritDoc} */
@Override public void printMemoryStats() {
X.println(">>>");
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d82d6a0/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
index bb9ffdd..0526162 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
@@ -61,7 +61,6 @@ import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
import org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException;
-import org.apache.ignite.internal.managers.communication.GridIoPolicy;
import org.apache.ignite.internal.managers.communication.GridMessageListener;
import org.apache.ignite.internal.managers.deployment.GridDeployment;
import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
@@ -112,16 +111,12 @@ import org.jsr166.LongAdder8;
import static org.apache.ignite.events.EventType.EVT_NODE_FAILED;
import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
import static org.apache.ignite.internal.GridTopic.TOPIC_DATASTREAM;
-import static org.apache.ignite.internal.managers.communication.GridIoPolicy.PUBLIC_POOL;
/**
* Data streamer implementation.
*/
@SuppressWarnings("unchecked")
public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed {
- /** Default policy resolver. */
- private static final DefaultIoPolicyResolver DFLT_IO_PLC_RSLVR = new DefaultIoPolicyResolver();
-
/** Isolated receiver. */
private static final StreamReceiver ISOLATED_UPDATER = new IsolatedUpdater();
@@ -135,7 +130,7 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
private byte[] updaterBytes;
/** IO policy resovler for data load request. */
- private IgniteClosure<ClusterNode, Byte> ioPlcRslvr = DFLT_IO_PLC_RSLVR;
+ private IgniteClosure<ClusterNode, Byte> ioPlcRslvr;
/** Max remap count before issuing an error. */
private static final int DFLT_MAX_REMAP_CNT = 32;
@@ -1509,10 +1504,12 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
* @param entries Entries.
* @param reqTopVer Request topology version.
* @param curFut Current future.
+ * @param plc Policy.
*/
private void localUpdate(final Collection<DataStreamerEntry> entries,
final AffinityTopologyVersion reqTopVer,
- final GridFutureAdapter<Object> curFut) {
+ final GridFutureAdapter<Object> curFut,
+ final byte plc) {
try {
GridCacheContext cctx = ctx.cache().internalCache(cacheName).context();
@@ -1543,7 +1540,7 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
skipStore,
keepBinary,
rcvr),
- false);
+ plc);
locFuts.add(callFut);
@@ -1573,7 +1570,7 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
else {
fut.listen(new IgniteInClosure<IgniteInternalFuture<AffinityTopologyVersion>>() {
@Override public void apply(IgniteInternalFuture<AffinityTopologyVersion> e) {
- localUpdate(entries, reqTopVer, curFut);
+ localUpdate(entries, reqTopVer, curFut, plc);
}
});
}
@@ -1617,13 +1614,10 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
IgniteInternalFuture<Object> fut;
- Byte plc = ioPlcRslvr.apply(node);
-
- if (plc == null)
- plc = PUBLIC_POOL;
+ byte plc = DataStreamProcessor.ioPolicy(ioPlcRslvr, node);
- if (isLocNode && plc == GridIoPolicy.PUBLIC_POOL)
- localUpdate(entries, topVer, curFut);
+ if (isLocNode)
+ localUpdate(entries, topVer, curFut, plc);
else {
try {
for (DataStreamerEntry e : entries) {
@@ -1975,19 +1969,6 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
}
/**
- * Default IO policy resolver.
- */
- private static class DefaultIoPolicyResolver implements IgniteClosure<ClusterNode, Byte> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override public Byte apply(ClusterNode gridNode) {
- return PUBLIC_POOL;
- }
- }
-
- /**
* Key object wrapper. Using identity equals prevents slow down in case of hash code collision.
*/
private static class KeyCacheObjectWrapper {
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d82d6a0/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
index 59e5e7d..89140b9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
@@ -128,6 +128,11 @@ public class PoolProcessor extends GridProcessorAdapter {
return ctx.getIgfsExecutorService();
+ case GridIoPolicy.DATA_STREAMER_POOL:
+ assert ctx.getDataStreamerExecutorService() != null : "Data streamer pool is not configured.";
+
+ return ctx.getDataStreamerExecutorService();
+
default: {
if (plc < 0)
throw new IgniteCheckedException("Policy cannot be negative: " + plc);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d82d6a0/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java
index 0f8ae29..d00e08b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java
@@ -33,6 +33,7 @@ import javax.cache.CacheException;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.IgniteException;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.CachePeekMode;
import org.apache.ignite.cache.affinity.Affinity;
@@ -49,6 +50,7 @@ import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearCacheAdapter;
+import org.apache.ignite.internal.util.lang.GridAbsPredicate;
import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteClosure;
@@ -59,6 +61,7 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.apache.ignite.stream.StreamReceiver;
+import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.jetbrains.annotations.Nullable;
@@ -949,6 +952,94 @@ public class DataStreamProcessorSelfTest extends GridCommonAbstractTest {
}
/**
+ * @throws Exception If failed.
+ */
+ public void testLocalDataStreamerDedicatedThreadPool() throws Exception {
+ try {
+ useCache = true;
+
+ Ignite ignite = startGrid(1);
+
+ final IgniteCache<String, String> cache = ignite.cache(null);
+
+ IgniteDataStreamer<String, String> ldr = ignite.dataStreamer(null);
+ try {
+ ldr.receiver(new StreamReceiver<String, String>() {
+ @Override public void receive(IgniteCache<String, String> cache,
+ Collection<Map.Entry<String, String>> entries) throws IgniteException {
+ String threadName = Thread.currentThread().getName();
+
+ cache.put("key", threadName);
+ }
+ });
+ ldr.addData("key", "value");
+
+ ldr.tryFlush();
+
+ GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ return cache.get("key") != null;
+ }
+ }, 3_000);
+ }
+ finally {
+ ldr.close(true);
+ }
+
+ assertNotNull(cache.get("key"));
+
+ assertTrue(cache.get("key").startsWith("data-streamer"));
+
+ }
+ finally {
+ stopAllGrids();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testRemoteDataStreamerDedicatedThreadPool() throws Exception {
+ try {
+ useCache = true;
+
+ Ignite ignite = startGrid(1);
+
+ useCache = false;
+
+ Ignite client = startGrid(0);
+
+ final IgniteCache<String, String> cache = ignite.cache(null);
+
+ IgniteDataStreamer<String, String> ldr = client.dataStreamer(null);
+
+ try {
+ ldr.receiver(new StringStringStreamReceiver());
+
+ ldr.addData("key", "value");
+
+ ldr.tryFlush();
+
+ GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ return cache.get("key") != null;
+ }
+ }, 3_000);
+ }
+ finally {
+ ldr.close(true);
+ }
+
+ assertNotNull(cache.get("key"));
+
+ assertTrue(cache.get("key").startsWith("data-streamer"));
+ }
+ finally {
+ stopAllGrids();
+ }
+ }
+
+ /**
*
*/
public static class TestObject {
@@ -1024,4 +1115,17 @@ public class DataStreamProcessorSelfTest extends GridCommonAbstractTest {
}
}
}
+
+ /**
+ *
+ */
+ private static class StringStringStreamReceiver implements StreamReceiver<String, String> {
+ /** {@inheritDoc} */
+ @Override public void receive(IgniteCache<String, String> cache,
+ Collection<Map.Entry<String, String>> entries) throws IgniteException {
+ String threadName = Thread.currentThread().getName();
+
+ cache.put("key", threadName);
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7d82d6a0/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
index 143159d..40f0e43 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
@@ -64,6 +64,7 @@ public class GridTestKernalContext extends GridKernalContextImpl {
null,
null,
null,
+ null,
U.allPluginProviders()
);
@@ -98,11 +99,6 @@ public class GridTestKernalContext extends GridKernalContextImpl {
}
}
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(GridTestKernalContext.class, this, super.toString());
- }
-
/**
* Sets system executor service.
*
@@ -112,7 +108,6 @@ public class GridTestKernalContext extends GridKernalContextImpl {
this.sysExecSvc = sysExecSvc;
}
-
/**
* Sets executor service.
*
@@ -121,4 +116,9 @@ public class GridTestKernalContext extends GridKernalContextImpl {
public void setExecutorService(ExecutorService execSvc){
this.execSvc = execSvc;
}
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(GridTestKernalContext.class, this, super.toString());
+ }
}
[44/50] [abbrv] ignite git commit: Merge branch 'master' into
ignite-2.0
Posted by ag...@apache.org.
Merge branch 'master' into ignite-2.0
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/77ca2e63
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/77ca2e63
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/77ca2e63
Branch: refs/heads/ignite-3477
Commit: 77ca2e636c73e464f833f227c4894df0785ae9e2
Parents: 6090ebd 82dd912
Author: devozerov <vo...@gridgain.com>
Authored: Mon Jan 16 16:07:49 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Mon Jan 16 16:07:49 2017 +0300
----------------------------------------------------------------------
.../ignite/cache/query/SqlFieldsQuery.java | 6 +
.../store/jdbc/dialect/BasicJdbcDialect.java | 31 +-
.../GridClientConnectionManagerAdapter.java | 7 +-
.../impl/connection/GridClientTopology.java | 53 +++-
.../GridNearAtomicAbstractUpdateFuture.java | 34 ++-
.../GridNearAtomicSingleUpdateFuture.java | 44 +--
.../dht/atomic/GridNearAtomicUpdateFuture.java | 57 ++--
.../IgniteCacheObjectProcessorImpl.java | 5 +-
.../processors/query/GridQueryProcessor.java | 2 +-
.../store/jdbc/CacheJdbcPojoStoreTest.java | 48 +++-
.../ignite/cache/store/jdbc/model/Person.java | 2 +-
.../cache/CacheEntryProcessorCopySelfTest.java | 6 +-
.../cache/GridCacheBasicStoreAbstractTest.java | 2 +-
.../GridCacheDhtEvictionsDisabledSelfTest.java | 5 +-
.../AtomicPutAllChangingTopologyTest.java | 212 ++++++++++++++
.../IgniteCacheFailoverTestSuite.java | 3 +
.../apache/ignite/stream/flume/IgniteSink.java | 7 +-
.../hadoop/impl/v2/HadoopV2TaskContext.java | 64 +++--
...niteCacheAbstractInsertSqlQuerySelfTest.java | 14 +-
.../IgniteCacheAbstractSqlDmlQuerySelfTest.java | 6 +-
.../IgniteCacheInsertSqlQuerySelfTest.java | 18 +-
.../cache/IgniteCacheMergeSqlQuerySelfTest.java | 14 +-
.../IgniteCacheUpdateSqlQuerySelfTest.java | 4 +-
.../cpp/common/project/vs/common.vcxproj | 1 +
.../platforms/cpp/jni/project/vs/jni.vcxproj | 1 +
.../cpp/odbc-test/src/api_robustness_test.cpp | 113 +++++++-
modules/platforms/cpp/odbc/Makefile.am | 3 +-
modules/platforms/cpp/odbc/include/Makefile.am | 3 +-
.../cpp/odbc/include/ignite/odbc/common_types.h | 29 +-
.../ignite/odbc/config/connection_info.h | 2 -
.../cpp/odbc/include/ignite/odbc/log.h | 123 ++++++++
.../odbc/include/ignite/odbc/meta/column_meta.h | 2 -
.../cpp/odbc/include/ignite/odbc/statement.h | 143 +++++++---
.../cpp/odbc/include/ignite/odbc/utility.h | 19 +-
.../odbc/os/linux/src/system/socket_client.cpp | 9 +-
.../odbc/os/win/src/system/socket_client.cpp | 9 +-
.../src/system/ui/dsn_configuration_window.cpp | 18 +-
.../cpp/odbc/os/win/src/system_dsn.cpp | 17 +-
.../platforms/cpp/odbc/project/vs/odbc.vcxproj | 2 +
.../cpp/odbc/project/vs/odbc.vcxproj.filters | 6 +
.../cpp/odbc/src/config/connection_info.cpp | 3 -
modules/platforms/cpp/odbc/src/connection.cpp | 21 +-
.../odbc/src/diagnostic/diagnosable_adapter.cpp | 3 +-
.../odbc/src/diagnostic/diagnostic_record.cpp | 38 +++
modules/platforms/cpp/odbc/src/entry_points.cpp | 52 ++--
modules/platforms/cpp/odbc/src/log.cpp | 83 ++++++
.../platforms/cpp/odbc/src/meta/column_meta.cpp | 4 -
modules/platforms/cpp/odbc/src/odbc.cpp | 283 ++++++++-----------
.../odbc/src/query/column_metadata_query.cpp | 13 +-
.../platforms/cpp/odbc/src/query/data_query.cpp | 23 +-
.../cpp/odbc/src/query/table_metadata_query.cpp | 12 +-
modules/platforms/cpp/odbc/src/statement.cpp | 187 ++++++++++--
modules/platforms/cpp/odbc/src/utility.cpp | 18 +-
.../Apache.Ignite.AspNet.Tests.csproj | 7 +-
.../Properties/AssemblyInfo.cs | 2 +-
.../Apache.Ignite.AspNet.csproj | 5 +
.../Properties/AssemblyInfo.cs | 2 +-
.../Apache.Ignite.Benchmarks.csproj | 5 +
.../Apache.Ignite.Core.Tests.TestDll.csproj | 5 +
.../Apache.Ignite.Core.Tests.csproj | 6 +
.../Cache/CacheAbstractTest.cs | 2 +
.../Log/ConcurrentMemoryTarget.cs | 73 +++++
.../Log/NLogLoggerTest.cs | 5 +-
.../Apache.Ignite.Core.Tests/MessagingTest.cs | 6 +-
.../Properties/AssemblyInfo.cs | 2 +-
.../Apache.Ignite.Core.Tests/TestUtils.cs | 1 -
.../Apache.Ignite.Core.csproj | 16 +-
.../Impl/Binary/BinaryReader.cs | 16 +-
.../Impl/Unmanaged/UnmanagedUtils.cs | 4 +-
.../Apache.Ignite.EntityFramework.Tests.csproj | 5 +
.../Apache.Ignite.EntityFramework.csproj | 9 +-
.../Impl/ArrayDbDataReader.cs | 5 +
.../Impl/DataReaderResult.cs | 2 +
.../Impl/DbCommandInfo.cs | 11 +
.../Impl/DbCommandProxy.cs | 1 +
.../Apache.Ignite.Linq.csproj | 5 +
.../Apache.Ignite.Log4Net.csproj | 5 +
.../IgniteLog4NetLogger.cs | 16 +-
.../Apache.Ignite.NLog.csproj | 5 +
modules/platforms/dotnet/Apache.Ignite.sln | 3 +
.../dotnet/Apache.Ignite/Apache.Ignite.csproj | 5 +
modules/platforms/dotnet/README.md | 6 +-
modules/platforms/dotnet/build.ps1 | 2 +-
.../Apache.Ignite.Examples.csproj | 3 +
.../Apache.Ignite.ExamplesDll.csproj | 4 +
.../Services/MapService.cs | 2 -
86 files changed, 1602 insertions(+), 528 deletions(-)
----------------------------------------------------------------------
[09/50] [abbrv] ignite git commit: IGNITE-3430 .NET: Refactor
transactional tests to a separate class
Posted by ag...@apache.org.
IGNITE-3430 .NET: Refactor transactional tests to a separate class
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/864af7eb
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/864af7eb
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/864af7eb
Branch: refs/heads/ignite-3477
Commit: 864af7eb48f19b8d6350332100f741fcdccdb5ad
Parents: 06ef846
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Dec 28 13:55:26 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Dec 28 13:55:26 2016 +0300
----------------------------------------------------------------------
.../Apache.Ignite.Core.Tests.csproj | 1 +
.../Cache/CacheAbstractTest.cs | 625 -------------------
.../Cache/CacheAbstractTransactionalTest.cs | 556 +++++++++++++++++
.../Cache/CacheLocalAtomicTest.cs | 5 -
.../Cache/CacheLocalTest.cs | 6 +-
.../CachePartitionedAtomicNearEnabledTest.cs | 5 -
.../Cache/CachePartitionedAtomicTest.cs | 5 -
.../Cache/CachePartitionedNearEnabledTest.cs | 7 +-
.../Cache/CachePartitionedTest.cs | 7 +-
.../Cache/CacheReplicatedAtomicTest.cs | 5 -
.../Cache/CacheReplicatedTest.cs | 7 +-
11 files changed, 561 insertions(+), 668 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/864af7eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
index f440c25..5948593 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
@@ -71,6 +71,7 @@
<Compile Include="Cache\CacheMetricsTest.cs" />
<Compile Include="Cache\CacheResultTest.cs" />
<Compile Include="Cache\CacheSwapSpaceTest.cs" />
+ <Compile Include="Cache\CacheAbstractTransactionalTest.cs" />
<Compile Include="Cache\Store\CacheStoreAdapterTest.cs" />
<Compile Include="Collections\MultiValueDictionaryTest.cs" />
<Compile Include="Collections\ReadOnlyCollectionTest.cs" />
http://git-wip-us.apache.org/repos/asf/ignite/blob/864af7eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
index 821a179..250f974 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTest.cs
@@ -1917,621 +1917,6 @@ namespace Apache.Ignite.Core.Tests.Cache
}
/// <summary>
- /// Simple cache lock test (while <see cref="TestLock"/> is ignored).
- /// </summary>
- [Test]
- public void TestLockSimple()
- {
- if (!LockingEnabled())
- return;
-
- var cache = Cache();
-
- const int key = 7;
-
- Action<ICacheLock> checkLock = lck =>
- {
- using (lck)
- {
- Assert.Throws<InvalidOperationException>(lck.Exit); // can't exit if not entered
-
- lck.Enter();
-
- Assert.IsTrue(cache.IsLocalLocked(key, true));
- Assert.IsTrue(cache.IsLocalLocked(key, false));
-
- lck.Exit();
-
- Assert.IsFalse(cache.IsLocalLocked(key, true));
- Assert.IsFalse(cache.IsLocalLocked(key, false));
-
- Assert.IsTrue(lck.TryEnter());
-
- Assert.IsTrue(cache.IsLocalLocked(key, true));
- Assert.IsTrue(cache.IsLocalLocked(key, false));
-
- lck.Exit();
- }
-
- Assert.Throws<ObjectDisposedException>(lck.Enter); // Can't enter disposed lock
- };
-
- checkLock(cache.Lock(key));
- checkLock(cache.LockAll(new[] {key, 1, 2, 3}));
- }
-
- [Test]
- [Ignore("IGNITE-835")]
- public void TestLock()
- {
- if (!LockingEnabled())
- return;
-
- var cache = Cache();
-
- const int key = 7;
-
- // Lock
- CheckLock(cache, key, () => cache.Lock(key));
-
- // LockAll
- CheckLock(cache, key, () => cache.LockAll(new[] { key, 2, 3, 4, 5 }));
- }
-
- /// <summary>
- /// Internal lock test routine.
- /// </summary>
- /// <param name="cache">Cache.</param>
- /// <param name="key">Key.</param>
- /// <param name="getLock">Function to get the lock.</param>
- private static void CheckLock(ICache<int, int> cache, int key, Func<ICacheLock> getLock)
- {
- var sharedLock = getLock();
-
- using (sharedLock)
- {
- Assert.Throws<InvalidOperationException>(() => sharedLock.Exit()); // can't exit if not entered
-
- sharedLock.Enter();
-
- try
- {
- Assert.IsTrue(cache.IsLocalLocked(key, true));
- Assert.IsTrue(cache.IsLocalLocked(key, false));
-
- EnsureCannotLock(getLock, sharedLock);
-
- sharedLock.Enter();
-
- try
- {
- Assert.IsTrue(cache.IsLocalLocked(key, true));
- Assert.IsTrue(cache.IsLocalLocked(key, false));
-
- EnsureCannotLock(getLock, sharedLock);
- }
- finally
- {
- sharedLock.Exit();
- }
-
- Assert.IsTrue(cache.IsLocalLocked(key, true));
- Assert.IsTrue(cache.IsLocalLocked(key, false));
-
- EnsureCannotLock(getLock, sharedLock);
-
- Assert.Throws<SynchronizationLockException>(() => sharedLock.Dispose()); // can't dispose while locked
- }
- finally
- {
- sharedLock.Exit();
- }
-
- Assert.IsFalse(cache.IsLocalLocked(key, true));
- Assert.IsFalse(cache.IsLocalLocked(key, false));
-
- var innerTask = new Task(() =>
- {
- Assert.IsTrue(sharedLock.TryEnter());
- sharedLock.Exit();
-
- using (var otherLock = getLock())
- {
- Assert.IsTrue(otherLock.TryEnter());
- otherLock.Exit();
- }
- });
-
- innerTask.Start();
- innerTask.Wait();
- }
-
- Assert.IsFalse(cache.IsLocalLocked(key, true));
- Assert.IsFalse(cache.IsLocalLocked(key, false));
-
- var outerTask = new Task(() =>
- {
- using (var otherLock = getLock())
- {
- Assert.IsTrue(otherLock.TryEnter());
- otherLock.Exit();
- }
- });
-
- outerTask.Start();
- outerTask.Wait();
-
- Assert.Throws<ObjectDisposedException>(() => sharedLock.Enter()); // Can't enter disposed lock
- }
-
- /// <summary>
- /// Ensure that lock cannot be obtained by other threads.
- /// </summary>
- /// <param name="getLock">Get lock function.</param>
- /// <param name="sharedLock">Shared lock.</param>
- private static void EnsureCannotLock(Func<ICacheLock> getLock, ICacheLock sharedLock)
- {
- var task = new Task(() =>
- {
- Assert.IsFalse(sharedLock.TryEnter());
- Assert.IsFalse(sharedLock.TryEnter(TimeSpan.FromMilliseconds(100)));
-
- using (var otherLock = getLock())
- {
- Assert.IsFalse(otherLock.TryEnter());
- Assert.IsFalse(otherLock.TryEnter(TimeSpan.FromMilliseconds(100)));
- }
- });
-
- task.Start();
- task.Wait();
- }
-
- [Test]
- public void TestTxCommit()
- {
- TestTxCommit(false);
- }
-
- [Test]
- public void TestTxCommitAsync()
- {
- TestTxCommit(true);
- }
-
- private void TestTxCommit(bool async)
- {
- if (!TxEnabled())
- return;
-
- var cache = Cache();
-
- ITransaction tx = Transactions.Tx;
-
- Assert.IsNull(tx);
-
- tx = Transactions.TxStart();
-
- try
- {
- cache.Put(1, 1);
-
- cache.Put(2, 2);
-
- if (async)
- {
- var task = tx.CommitAsync();
-
- task.Wait();
-
- Assert.IsTrue(task.IsCompleted);
- }
- else
- tx.Commit();
- }
- finally
- {
- tx.Dispose();
- }
-
- Assert.AreEqual(1, cache.Get(1));
-
- Assert.AreEqual(2, cache.Get(2));
-
- tx = Transactions.Tx;
-
- Assert.IsNull(tx);
- }
-
- [Test]
- public void TestTxRollback()
- {
- if (!TxEnabled())
- return;
-
- var cache = Cache();
-
- cache.Put(1, 1);
-
- cache.Put(2, 2);
-
- ITransaction tx = Transactions.Tx;
-
- Assert.IsNull(tx);
-
- tx = Transactions.TxStart();
-
- try {
- cache.Put(1, 10);
-
- cache.Put(2, 20);
- }
- finally {
- tx.Rollback();
- }
-
- Assert.AreEqual(1, cache.Get(1));
-
- Assert.AreEqual(2, cache.Get(2));
-
- Assert.IsNull(Transactions.Tx);
- }
-
- [Test]
- public void TestTxClose()
- {
- if (!TxEnabled())
- return;
-
- var cache = Cache();
-
- cache.Put(1, 1);
-
- cache.Put(2, 2);
-
- ITransaction tx = Transactions.Tx;
-
- Assert.IsNull(tx);
-
- tx = Transactions.TxStart();
-
- try
- {
- cache.Put(1, 10);
-
- cache.Put(2, 20);
- }
- finally
- {
- tx.Dispose();
- }
-
- Assert.AreEqual(1, cache.Get(1));
-
- Assert.AreEqual(2, cache.Get(2));
-
- tx = Transactions.Tx;
-
- Assert.IsNull(tx);
- }
-
- [Test]
- public void TestTxAllModes()
- {
- TestTxAllModes(false);
-
- TestTxAllModes(true);
-
- Console.WriteLine("Done");
- }
-
- protected void TestTxAllModes(bool withTimeout)
- {
- if (!TxEnabled())
- return;
-
- var cache = Cache();
-
- int cntr = 0;
-
- foreach (TransactionConcurrency concurrency in Enum.GetValues(typeof(TransactionConcurrency))) {
- foreach (TransactionIsolation isolation in Enum.GetValues(typeof(TransactionIsolation))) {
- Console.WriteLine("Test tx [concurrency=" + concurrency + ", isolation=" + isolation + "]");
-
- ITransaction tx = Transactions.Tx;
-
- Assert.IsNull(tx);
-
- tx = withTimeout
- ? Transactions.TxStart(concurrency, isolation, TimeSpan.FromMilliseconds(1100), 10)
- : Transactions.TxStart(concurrency, isolation);
-
- Assert.AreEqual(concurrency, tx.Concurrency);
- Assert.AreEqual(isolation, tx.Isolation);
-
- if (withTimeout)
- Assert.AreEqual(1100, tx.Timeout.TotalMilliseconds);
-
- try {
- cache.Put(1, cntr);
-
- tx.Commit();
- }
- finally {
- tx.Dispose();
- }
-
- tx = Transactions.Tx;
-
- Assert.IsNull(tx);
-
- Assert.AreEqual(cntr, cache.Get(1));
-
- cntr++;
- }
- }
- }
-
- [Test]
- public void TestTxAttributes()
- {
- if (!TxEnabled())
- return;
-
- ITransaction tx = Transactions.TxStart(TransactionConcurrency.Optimistic,
- TransactionIsolation.RepeatableRead, TimeSpan.FromMilliseconds(2500), 100);
-
- Assert.IsFalse(tx.IsRollbackOnly);
- Assert.AreEqual(TransactionConcurrency.Optimistic, tx.Concurrency);
- Assert.AreEqual(TransactionIsolation.RepeatableRead, tx.Isolation);
- Assert.AreEqual(2500, tx.Timeout.TotalMilliseconds);
- Assert.AreEqual(TransactionState.Active, tx.State);
- Assert.IsTrue(tx.StartTime.Ticks > 0);
- Assert.AreEqual(tx.NodeId, GetIgnite(0).GetCluster().GetLocalNode().Id);
-
- DateTime startTime1 = tx.StartTime;
-
- tx.Commit();
-
- Assert.IsFalse(tx.IsRollbackOnly);
- Assert.AreEqual(TransactionState.Committed, tx.State);
- Assert.AreEqual(TransactionConcurrency.Optimistic, tx.Concurrency);
- Assert.AreEqual(TransactionIsolation.RepeatableRead, tx.Isolation);
- Assert.AreEqual(2500, tx.Timeout.TotalMilliseconds);
- Assert.AreEqual(startTime1, tx.StartTime);
-
- Thread.Sleep(100);
-
- tx = Transactions.TxStart(TransactionConcurrency.Pessimistic, TransactionIsolation.ReadCommitted,
- TimeSpan.FromMilliseconds(3500), 200);
-
- Assert.IsFalse(tx.IsRollbackOnly);
- Assert.AreEqual(TransactionConcurrency.Pessimistic, tx.Concurrency);
- Assert.AreEqual(TransactionIsolation.ReadCommitted, tx.Isolation);
- Assert.AreEqual(3500, tx.Timeout.TotalMilliseconds);
- Assert.AreEqual(TransactionState.Active, tx.State);
- Assert.IsTrue(tx.StartTime.Ticks > 0);
- Assert.IsTrue(tx.StartTime > startTime1);
-
- DateTime startTime2 = tx.StartTime;
-
- tx.Rollback();
-
- Assert.AreEqual(TransactionState.RolledBack, tx.State);
- Assert.AreEqual(TransactionConcurrency.Pessimistic, tx.Concurrency);
- Assert.AreEqual(TransactionIsolation.ReadCommitted, tx.Isolation);
- Assert.AreEqual(3500, tx.Timeout.TotalMilliseconds);
- Assert.AreEqual(startTime2, tx.StartTime);
-
- Thread.Sleep(100);
-
- tx = Transactions.TxStart(TransactionConcurrency.Optimistic, TransactionIsolation.RepeatableRead,
- TimeSpan.FromMilliseconds(2500), 100);
-
- Assert.IsFalse(tx.IsRollbackOnly);
- Assert.AreEqual(TransactionConcurrency.Optimistic, tx.Concurrency);
- Assert.AreEqual(TransactionIsolation.RepeatableRead, tx.Isolation);
- Assert.AreEqual(2500, tx.Timeout.TotalMilliseconds);
- Assert.AreEqual(TransactionState.Active, tx.State);
- Assert.IsTrue(tx.StartTime > startTime2);
-
- DateTime startTime3 = tx.StartTime;
-
- tx.Commit();
-
- Assert.IsFalse(tx.IsRollbackOnly);
- Assert.AreEqual(TransactionState.Committed, tx.State);
- Assert.AreEqual(TransactionConcurrency.Optimistic, tx.Concurrency);
- Assert.AreEqual(TransactionIsolation.RepeatableRead, tx.Isolation);
- Assert.AreEqual(2500, tx.Timeout.TotalMilliseconds);
- Assert.AreEqual(startTime3, tx.StartTime);
- }
-
- [Test]
- public void TestTxRollbackOnly()
- {
- if (!TxEnabled())
- return;
-
- var cache = Cache();
-
- cache.Put(1, 1);
-
- cache.Put(2, 2);
-
- ITransaction tx = Transactions.TxStart();
-
- cache.Put(1, 10);
-
- cache.Put(2, 20);
-
- Assert.IsFalse(tx.IsRollbackOnly);
-
- tx.SetRollbackonly();
-
- Assert.IsTrue(tx.IsRollbackOnly);
-
- Assert.AreEqual(TransactionState.MarkedRollback, tx.State);
-
- try
- {
- tx.Commit();
-
- Assert.Fail("Commit must fail.");
- }
- catch (IgniteException e)
- {
- Console.WriteLine("Expected exception: " + e);
- }
-
- tx.Dispose();
-
- Assert.AreEqual(TransactionState.RolledBack, tx.State);
-
- Assert.IsTrue(tx.IsRollbackOnly);
-
- Assert.AreEqual(1, cache.Get(1));
-
- Assert.AreEqual(2, cache.Get(2));
-
- tx = Transactions.Tx;
-
- Assert.IsNull(tx);
- }
-
- [Test]
- public void TestTxMetrics()
- {
- if (!TxEnabled())
- return;
-
- var cache = Cache();
-
- var startTime = DateTime.UtcNow.AddSeconds(-1);
-
- Transactions.ResetMetrics();
-
- var metrics = Transactions.GetMetrics();
-
- Assert.AreEqual(0, metrics.TxCommits);
- Assert.AreEqual(0, metrics.TxRollbacks);
-
- using (Transactions.TxStart())
- {
- cache.Put(1, 1);
- }
-
- using (var tx = Transactions.TxStart())
- {
- cache.Put(1, 1);
- tx.Commit();
- }
-
- metrics = Transactions.GetMetrics();
-
- Assert.AreEqual(1, metrics.TxCommits);
- Assert.AreEqual(1, metrics.TxRollbacks);
-
- Assert.LessOrEqual(startTime, metrics.CommitTime);
- Assert.LessOrEqual(startTime, metrics.RollbackTime);
-
- Assert.GreaterOrEqual(DateTime.UtcNow, metrics.CommitTime);
- Assert.GreaterOrEqual(DateTime.UtcNow, metrics.RollbackTime);
- }
-
- [Test]
- public void TestTxStateAndExceptions()
- {
- if (!TxEnabled())
- return;
-
- var tx = Transactions.TxStart();
-
- Assert.AreEqual(TransactionState.Active, tx.State);
- Assert.AreEqual(Thread.CurrentThread.ManagedThreadId, tx.ThreadId);
-
- tx.AddMeta("myMeta", 42);
- Assert.AreEqual(42, tx.Meta<int>("myMeta"));
- Assert.AreEqual(42, tx.RemoveMeta<int>("myMeta"));
-
- tx.RollbackAsync().Wait();
-
- Assert.AreEqual(TransactionState.RolledBack, tx.State);
-
- try
- {
- tx.Commit();
- Assert.Fail();
- }
- catch (InvalidOperationException)
- {
- // Expected
- }
-
- tx = Transactions.TxStart();
-
- Assert.AreEqual(TransactionState.Active, tx.State);
-
- tx.CommitAsync().Wait();
-
- Assert.AreEqual(TransactionState.Committed, tx.State);
-
- var task = tx.RollbackAsync(); // Illegal, but should not fail here; will fail in task
-
- try
- {
- task.Wait();
- Assert.Fail();
- }
- catch (AggregateException)
- {
- // Expected
- }
- }
-
- /// <summary>
- /// Tests the transaction deadlock detection.
- /// </summary>
- [Test]
- public void TestTxDeadlockDetection()
- {
- if (!TxEnabled())
- return;
-
- var cache = Cache();
-
- var keys0 = Enumerable.Range(1, 100).ToArray();
-
- cache.PutAll(keys0.ToDictionary(x => x, x => x));
-
- var barrier = new Barrier(2);
-
- Action<int[]> increment = keys =>
- {
- using (var tx = Transactions.TxStart(TransactionConcurrency.Pessimistic,
- TransactionIsolation.RepeatableRead, TimeSpan.FromSeconds(0.5), 0))
- {
- foreach (var key in keys)
- cache[key]++;
-
- barrier.SignalAndWait(500);
-
- tx.Commit();
- }
- };
-
- // Increment keys within tx in different order to cause a deadlock.
- var aex = Assert.Throws<AggregateException>(() =>
- Task.WaitAll(Task.Factory.StartNew(() => increment(keys0)),
- Task.Factory.StartNew(() => increment(keys0.Reverse().ToArray()))));
-
- Assert.AreEqual(2, aex.InnerExceptions.Count);
-
- var deadlockEx = aex.InnerExceptions.OfType<TransactionDeadlockException>().First();
- Assert.IsTrue(deadlockEx.Message.Trim().StartsWith("Deadlock detected:"), deadlockEx.Message);
- }
-
- /// <summary>
/// Test thraed-locals leak.
/// </summary>
[Test]
@@ -3404,16 +2789,6 @@ namespace Apache.Ignite.Core.Tests.Cache
return false;
}
- protected virtual bool TxEnabled()
- {
- return true;
- }
-
- protected bool LockingEnabled()
- {
- return TxEnabled();
- }
-
protected virtual bool LocalCache()
{
return false;
http://git-wip-us.apache.org/repos/asf/ignite/blob/864af7eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs
new file mode 100644
index 0000000..e836ba2
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs
@@ -0,0 +1,556 @@
+/*
+ * 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.
+ */
+
+namespace Apache.Ignite.Core.Tests.Cache
+{
+ using System;
+ using System.Linq;
+ using System.Threading;
+ using System.Threading.Tasks;
+ using Apache.Ignite.Core.Cache;
+ using Apache.Ignite.Core.Transactions;
+ using NUnit.Framework;
+
+ /// <summary>
+ /// Transactional cache tests.
+ /// </summary>
+ public abstract class CacheAbstractTransactionalTest : CacheAbstractTest
+ {
+ /// <summary>
+ /// Simple cache lock test (while <see cref="TestLock"/> is ignored).
+ /// </summary>
+ [Test]
+ public void TestLockSimple()
+ {
+ var cache = Cache();
+
+ const int key = 7;
+
+ Action<ICacheLock> checkLock = lck =>
+ {
+ using (lck)
+ {
+ Assert.Throws<InvalidOperationException>(lck.Exit); // can't exit if not entered
+
+ lck.Enter();
+
+ Assert.IsTrue(cache.IsLocalLocked(key, true));
+ Assert.IsTrue(cache.IsLocalLocked(key, false));
+
+ lck.Exit();
+
+ Assert.IsFalse(cache.IsLocalLocked(key, true));
+ Assert.IsFalse(cache.IsLocalLocked(key, false));
+
+ Assert.IsTrue(lck.TryEnter());
+
+ Assert.IsTrue(cache.IsLocalLocked(key, true));
+ Assert.IsTrue(cache.IsLocalLocked(key, false));
+
+ lck.Exit();
+ }
+
+ Assert.Throws<ObjectDisposedException>(lck.Enter); // Can't enter disposed lock
+ };
+
+ checkLock(cache.Lock(key));
+ checkLock(cache.LockAll(new[] { key, 1, 2, 3 }));
+ }
+
+ /// <summary>
+ /// Tests cache locks.
+ /// </summary>
+ [Test]
+ [Ignore("IGNITE-835")]
+ public void TestLock()
+ {
+ var cache = Cache();
+
+ const int key = 7;
+
+ // Lock
+ CheckLock(cache, key, () => cache.Lock(key));
+
+ // LockAll
+ CheckLock(cache, key, () => cache.LockAll(new[] { key, 2, 3, 4, 5 }));
+ }
+
+ /// <summary>
+ /// Internal lock test routine.
+ /// </summary>
+ /// <param name="cache">Cache.</param>
+ /// <param name="key">Key.</param>
+ /// <param name="getLock">Function to get the lock.</param>
+ private static void CheckLock(ICache<int, int> cache, int key, Func<ICacheLock> getLock)
+ {
+ var sharedLock = getLock();
+
+ using (sharedLock)
+ {
+ Assert.Throws<InvalidOperationException>(() => sharedLock.Exit()); // can't exit if not entered
+
+ sharedLock.Enter();
+
+ try
+ {
+ Assert.IsTrue(cache.IsLocalLocked(key, true));
+ Assert.IsTrue(cache.IsLocalLocked(key, false));
+
+ EnsureCannotLock(getLock, sharedLock);
+
+ sharedLock.Enter();
+
+ try
+ {
+ Assert.IsTrue(cache.IsLocalLocked(key, true));
+ Assert.IsTrue(cache.IsLocalLocked(key, false));
+
+ EnsureCannotLock(getLock, sharedLock);
+ }
+ finally
+ {
+ sharedLock.Exit();
+ }
+
+ Assert.IsTrue(cache.IsLocalLocked(key, true));
+ Assert.IsTrue(cache.IsLocalLocked(key, false));
+
+ EnsureCannotLock(getLock, sharedLock);
+
+ Assert.Throws<SynchronizationLockException>(() => sharedLock.Dispose()); // can't dispose while locked
+ }
+ finally
+ {
+ sharedLock.Exit();
+ }
+
+ Assert.IsFalse(cache.IsLocalLocked(key, true));
+ Assert.IsFalse(cache.IsLocalLocked(key, false));
+
+ var innerTask = new Task(() =>
+ {
+ Assert.IsTrue(sharedLock.TryEnter());
+ sharedLock.Exit();
+
+ using (var otherLock = getLock())
+ {
+ Assert.IsTrue(otherLock.TryEnter());
+ otherLock.Exit();
+ }
+ });
+
+ innerTask.Start();
+ innerTask.Wait();
+ }
+
+ Assert.IsFalse(cache.IsLocalLocked(key, true));
+ Assert.IsFalse(cache.IsLocalLocked(key, false));
+
+ var outerTask = new Task(() =>
+ {
+ using (var otherLock = getLock())
+ {
+ Assert.IsTrue(otherLock.TryEnter());
+ otherLock.Exit();
+ }
+ });
+
+ outerTask.Start();
+ outerTask.Wait();
+
+ Assert.Throws<ObjectDisposedException>(() => sharedLock.Enter()); // Can't enter disposed lock
+ }
+
+ /// <summary>
+ /// Ensure that lock cannot be obtained by other threads.
+ /// </summary>
+ /// <param name="getLock">Get lock function.</param>
+ /// <param name="sharedLock">Shared lock.</param>
+ private static void EnsureCannotLock(Func<ICacheLock> getLock, ICacheLock sharedLock)
+ {
+ var task = new Task(() =>
+ {
+ Assert.IsFalse(sharedLock.TryEnter());
+ Assert.IsFalse(sharedLock.TryEnter(TimeSpan.FromMilliseconds(100)));
+
+ using (var otherLock = getLock())
+ {
+ Assert.IsFalse(otherLock.TryEnter());
+ Assert.IsFalse(otherLock.TryEnter(TimeSpan.FromMilliseconds(100)));
+ }
+ });
+
+ task.Start();
+ task.Wait();
+ }
+
+ /// <summary>
+ /// Tests that commit applies cache changes.
+ /// </summary>
+ [Test]
+ public void TestTxCommit([Values(true, false)] bool async)
+ {
+ var cache = Cache();
+
+ Assert.IsNull(Transactions.Tx);
+
+ using (var tx = Transactions.TxStart())
+ {
+ cache.Put(1, 1);
+ cache.Put(2, 2);
+
+ if (async)
+ {
+ var task = tx.CommitAsync();
+
+ task.Wait();
+
+ Assert.IsTrue(task.IsCompleted);
+ }
+ else
+ tx.Commit();
+ }
+
+ Assert.AreEqual(1, cache.Get(1));
+ Assert.AreEqual(2, cache.Get(2));
+
+ Assert.IsNull(Transactions.Tx);
+ }
+
+ /// <summary>
+ /// Tests that rollback reverts cache changes.
+ /// </summary>
+ [Test]
+ public void TestTxRollback()
+ {
+ var cache = Cache();
+
+ cache.Put(1, 1);
+ cache.Put(2, 2);
+
+ Assert.IsNull(Transactions.Tx);
+
+ using (var tx = Transactions.TxStart())
+ {
+ cache.Put(1, 10);
+ cache.Put(2, 20);
+
+ tx.Rollback();
+ }
+
+ Assert.AreEqual(1, cache.Get(1));
+ Assert.AreEqual(2, cache.Get(2));
+
+ Assert.IsNull(Transactions.Tx);
+ }
+
+ /// <summary>
+ /// Tests that Dispose without Commit reverts changes.
+ /// </summary>
+ [Test]
+ public void TestTxClose()
+ {
+ var cache = Cache();
+
+ cache.Put(1, 1);
+ cache.Put(2, 2);
+
+ Assert.IsNull(Transactions.Tx);
+
+ using (Transactions.TxStart())
+ {
+ cache.Put(1, 10);
+ cache.Put(2, 20);
+ }
+
+ Assert.AreEqual(1, cache.Get(1));
+ Assert.AreEqual(2, cache.Get(2));
+
+ Assert.IsNull(Transactions.Tx);
+ }
+
+ /// <summary>
+ /// Tests all concurrency and isolation modes with and without timeout.
+ /// </summary>
+ [Test]
+ public void TestTxAllModes([Values(true, false)] bool withTimeout)
+ {
+ var cache = Cache();
+
+ int cntr = 0;
+
+ foreach (TransactionConcurrency concurrency in Enum.GetValues(typeof(TransactionConcurrency)))
+ {
+ foreach (TransactionIsolation isolation in Enum.GetValues(typeof(TransactionIsolation)))
+ {
+ Console.WriteLine("Test tx [concurrency=" + concurrency + ", isolation=" + isolation + "]");
+
+ Assert.IsNull(Transactions.Tx);
+
+ using (var tx = withTimeout
+ ? Transactions.TxStart(concurrency, isolation, TimeSpan.FromMilliseconds(1100), 10)
+ : Transactions.TxStart(concurrency, isolation))
+ {
+
+ Assert.AreEqual(concurrency, tx.Concurrency);
+ Assert.AreEqual(isolation, tx.Isolation);
+
+ if (withTimeout)
+ Assert.AreEqual(1100, tx.Timeout.TotalMilliseconds);
+
+ cache.Put(1, cntr);
+
+ tx.Commit();
+ }
+
+ Assert.IsNull(Transactions.Tx);
+
+ Assert.AreEqual(cntr, cache.Get(1));
+
+ cntr++;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Tests that transaction properties are applied and propagated properly.
+ /// </summary>
+ [Test]
+ public void TestTxAttributes()
+ {
+ ITransaction tx = Transactions.TxStart(TransactionConcurrency.Optimistic,
+ TransactionIsolation.RepeatableRead, TimeSpan.FromMilliseconds(2500), 100);
+
+ Assert.IsFalse(tx.IsRollbackOnly);
+ Assert.AreEqual(TransactionConcurrency.Optimistic, tx.Concurrency);
+ Assert.AreEqual(TransactionIsolation.RepeatableRead, tx.Isolation);
+ Assert.AreEqual(2500, tx.Timeout.TotalMilliseconds);
+ Assert.AreEqual(TransactionState.Active, tx.State);
+ Assert.IsTrue(tx.StartTime.Ticks > 0);
+ Assert.AreEqual(tx.NodeId, GetIgnite(0).GetCluster().GetLocalNode().Id);
+
+ DateTime startTime1 = tx.StartTime;
+
+ tx.Commit();
+
+ Assert.IsFalse(tx.IsRollbackOnly);
+ Assert.AreEqual(TransactionState.Committed, tx.State);
+ Assert.AreEqual(TransactionConcurrency.Optimistic, tx.Concurrency);
+ Assert.AreEqual(TransactionIsolation.RepeatableRead, tx.Isolation);
+ Assert.AreEqual(2500, tx.Timeout.TotalMilliseconds);
+ Assert.AreEqual(startTime1, tx.StartTime);
+
+ Thread.Sleep(100);
+
+ tx = Transactions.TxStart(TransactionConcurrency.Pessimistic, TransactionIsolation.ReadCommitted,
+ TimeSpan.FromMilliseconds(3500), 200);
+
+ Assert.IsFalse(tx.IsRollbackOnly);
+ Assert.AreEqual(TransactionConcurrency.Pessimistic, tx.Concurrency);
+ Assert.AreEqual(TransactionIsolation.ReadCommitted, tx.Isolation);
+ Assert.AreEqual(3500, tx.Timeout.TotalMilliseconds);
+ Assert.AreEqual(TransactionState.Active, tx.State);
+ Assert.IsTrue(tx.StartTime.Ticks > 0);
+ Assert.IsTrue(tx.StartTime > startTime1);
+
+ DateTime startTime2 = tx.StartTime;
+
+ tx.Rollback();
+
+ Assert.AreEqual(TransactionState.RolledBack, tx.State);
+ Assert.AreEqual(TransactionConcurrency.Pessimistic, tx.Concurrency);
+ Assert.AreEqual(TransactionIsolation.ReadCommitted, tx.Isolation);
+ Assert.AreEqual(3500, tx.Timeout.TotalMilliseconds);
+ Assert.AreEqual(startTime2, tx.StartTime);
+
+ Thread.Sleep(100);
+
+ tx = Transactions.TxStart(TransactionConcurrency.Optimistic, TransactionIsolation.RepeatableRead,
+ TimeSpan.FromMilliseconds(2500), 100);
+
+ Assert.IsFalse(tx.IsRollbackOnly);
+ Assert.AreEqual(TransactionConcurrency.Optimistic, tx.Concurrency);
+ Assert.AreEqual(TransactionIsolation.RepeatableRead, tx.Isolation);
+ Assert.AreEqual(2500, tx.Timeout.TotalMilliseconds);
+ Assert.AreEqual(TransactionState.Active, tx.State);
+ Assert.IsTrue(tx.StartTime > startTime2);
+
+ DateTime startTime3 = tx.StartTime;
+
+ tx.Commit();
+
+ Assert.IsFalse(tx.IsRollbackOnly);
+ Assert.AreEqual(TransactionState.Committed, tx.State);
+ Assert.AreEqual(TransactionConcurrency.Optimistic, tx.Concurrency);
+ Assert.AreEqual(TransactionIsolation.RepeatableRead, tx.Isolation);
+ Assert.AreEqual(2500, tx.Timeout.TotalMilliseconds);
+ Assert.AreEqual(startTime3, tx.StartTime);
+ }
+
+ /// <summary>
+ /// Tests <see cref="ITransaction.IsRollbackOnly"/> flag.
+ /// </summary>
+ [Test]
+ public void TestTxRollbackOnly()
+ {
+ var cache = Cache();
+
+ cache.Put(1, 1);
+ cache.Put(2, 2);
+
+ var tx = Transactions.TxStart();
+
+ cache.Put(1, 10);
+ cache.Put(2, 20);
+
+ Assert.IsFalse(tx.IsRollbackOnly);
+
+ tx.SetRollbackonly();
+
+ Assert.IsTrue(tx.IsRollbackOnly);
+
+ Assert.AreEqual(TransactionState.MarkedRollback, tx.State);
+
+ var ex = Assert.Throws<TransactionRollbackException>(() => tx.Commit());
+ Assert.IsTrue(ex.Message.StartsWith("Invalid transaction state for prepare [state=MARKED_ROLLBACK"));
+
+ tx.Dispose();
+
+ Assert.AreEqual(TransactionState.RolledBack, tx.State);
+
+ Assert.IsTrue(tx.IsRollbackOnly);
+
+ Assert.AreEqual(1, cache.Get(1));
+ Assert.AreEqual(2, cache.Get(2));
+
+ Assert.IsNull(Transactions.Tx);
+ }
+
+ /// <summary>
+ /// Tests transaction metrics.
+ /// </summary>
+ [Test]
+ public void TestTxMetrics()
+ {
+ var cache = Cache();
+
+ var startTime = DateTime.UtcNow.AddSeconds(-1);
+
+ Transactions.ResetMetrics();
+
+ var metrics = Transactions.GetMetrics();
+
+ Assert.AreEqual(0, metrics.TxCommits);
+ Assert.AreEqual(0, metrics.TxRollbacks);
+
+ using (Transactions.TxStart())
+ {
+ cache.Put(1, 1);
+ }
+
+ using (var tx = Transactions.TxStart())
+ {
+ cache.Put(1, 1);
+ tx.Commit();
+ }
+
+ metrics = Transactions.GetMetrics();
+
+ Assert.AreEqual(1, metrics.TxCommits);
+ Assert.AreEqual(1, metrics.TxRollbacks);
+
+ Assert.LessOrEqual(startTime, metrics.CommitTime);
+ Assert.LessOrEqual(startTime, metrics.RollbackTime);
+
+ Assert.GreaterOrEqual(DateTime.UtcNow, metrics.CommitTime);
+ Assert.GreaterOrEqual(DateTime.UtcNow, metrics.RollbackTime);
+ }
+
+ /// <summary>
+ /// Tests transaction state transitions.
+ /// </summary>
+ [Test]
+ public void TestTxStateAndExceptions()
+ {
+ var tx = Transactions.TxStart();
+
+ Assert.AreEqual(TransactionState.Active, tx.State);
+ Assert.AreEqual(Thread.CurrentThread.ManagedThreadId, tx.ThreadId);
+
+ tx.AddMeta("myMeta", 42);
+ Assert.AreEqual(42, tx.Meta<int>("myMeta"));
+ Assert.AreEqual(42, tx.RemoveMeta<int>("myMeta"));
+
+ tx.RollbackAsync().Wait();
+
+ Assert.AreEqual(TransactionState.RolledBack, tx.State);
+
+ Assert.Throws<InvalidOperationException>(() => tx.Commit());
+
+ tx = Transactions.TxStart();
+
+ Assert.AreEqual(TransactionState.Active, tx.State);
+
+ tx.CommitAsync().Wait();
+
+ Assert.AreEqual(TransactionState.Committed, tx.State);
+
+ var task = tx.RollbackAsync(); // Illegal, but should not fail here; will fail in task
+
+ Assert.Throws<AggregateException>(() => task.Wait());
+ }
+
+ /// <summary>
+ /// Tests the transaction deadlock detection.
+ /// </summary>
+ [Test]
+ public void TestTxDeadlockDetection()
+ {
+ var cache = Cache();
+
+ var keys0 = Enumerable.Range(1, 100).ToArray();
+
+ cache.PutAll(keys0.ToDictionary(x => x, x => x));
+
+ var barrier = new Barrier(2);
+
+ Action<int[]> increment = keys =>
+ {
+ using (var tx = Transactions.TxStart(TransactionConcurrency.Pessimistic,
+ TransactionIsolation.RepeatableRead, TimeSpan.FromSeconds(0.5), 0))
+ {
+ foreach (var key in keys)
+ cache[key]++;
+
+ barrier.SignalAndWait(500);
+
+ tx.Commit();
+ }
+ };
+
+ // Increment keys within tx in different order to cause a deadlock.
+ var aex = Assert.Throws<AggregateException>(() =>
+ Task.WaitAll(Task.Factory.StartNew(() => increment(keys0)),
+ Task.Factory.StartNew(() => increment(keys0.Reverse().ToArray()))));
+
+ Assert.AreEqual(2, aex.InnerExceptions.Count);
+
+ var deadlockEx = aex.InnerExceptions.OfType<TransactionDeadlockException>().First();
+ Assert.IsTrue(deadlockEx.Message.Trim().StartsWith("Deadlock detected:"), deadlockEx.Message);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/864af7eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheLocalAtomicTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheLocalAtomicTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheLocalAtomicTest.cs
index b60c254..2c8c070 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheLocalAtomicTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheLocalAtomicTest.cs
@@ -39,11 +39,6 @@ namespace Apache.Ignite.Core.Tests.Cache
return false;
}
- protected override bool TxEnabled()
- {
- return false;
- }
-
protected override bool LocalCache()
{
return true;
http://git-wip-us.apache.org/repos/asf/ignite/blob/864af7eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheLocalTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheLocalTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheLocalTest.cs
index 02cb987..000218b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheLocalTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheLocalTest.cs
@@ -17,7 +17,7 @@
namespace Apache.Ignite.Core.Tests.Cache
{
- public class CacheLocalTest : CacheAbstractTest
+ public class CacheLocalTest : CacheAbstractTransactionalTest
{
protected override int CachePartitions()
{
@@ -39,10 +39,6 @@ namespace Apache.Ignite.Core.Tests.Cache
return false;
}
- protected override bool TxEnabled()
- {
- return true;
- }
protected override bool LocalCache()
{
return true;
http://git-wip-us.apache.org/repos/asf/ignite/blob/864af7eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedAtomicNearEnabledTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedAtomicNearEnabledTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedAtomicNearEnabledTest.cs
index 4f6e7a0..77cc77f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedAtomicNearEnabledTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedAtomicNearEnabledTest.cs
@@ -37,11 +37,6 @@ namespace Apache.Ignite.Core.Tests.Cache
return true;
}
- protected override bool TxEnabled()
- {
- return false;
- }
-
protected override int Backups()
{
return 1;
http://git-wip-us.apache.org/repos/asf/ignite/blob/864af7eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedAtomicTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedAtomicTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedAtomicTest.cs
index ab59c64..e6f851e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedAtomicTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedAtomicTest.cs
@@ -37,11 +37,6 @@ namespace Apache.Ignite.Core.Tests.Cache
return false;
}
- protected override bool TxEnabled()
- {
- return false;
- }
-
protected override int Backups()
{
return 1;
http://git-wip-us.apache.org/repos/asf/ignite/blob/864af7eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedNearEnabledTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedNearEnabledTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedNearEnabledTest.cs
index 830698b..81d2e5a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedNearEnabledTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedNearEnabledTest.cs
@@ -20,7 +20,7 @@ namespace Apache.Ignite.Core.Tests.Cache
using NUnit.Framework;
[Category(TestUtils.CategoryIntensive)]
- public class CachePartitionedNearEnabledTest : CacheAbstractTest
+ public class CachePartitionedNearEnabledTest : CacheAbstractTransactionalTest
{
protected override int GridCount()
{
@@ -37,11 +37,6 @@ namespace Apache.Ignite.Core.Tests.Cache
return true;
}
- protected override bool TxEnabled()
- {
- return true;
- }
-
protected override int Backups()
{
return 1;
http://git-wip-us.apache.org/repos/asf/ignite/blob/864af7eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedTest.cs
index 02d3208..68546b9 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CachePartitionedTest.cs
@@ -20,7 +20,7 @@ namespace Apache.Ignite.Core.Tests.Cache
using NUnit.Framework;
[Category(TestUtils.CategoryIntensive)]
- public class CachePartitionedTest : CacheAbstractTest
+ public class CachePartitionedTest : CacheAbstractTransactionalTest
{
protected override int GridCount()
{
@@ -37,11 +37,6 @@ namespace Apache.Ignite.Core.Tests.Cache
return false;
}
- protected override bool TxEnabled()
- {
- return true;
- }
-
protected override int Backups()
{
return 1;
http://git-wip-us.apache.org/repos/asf/ignite/blob/864af7eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheReplicatedAtomicTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheReplicatedAtomicTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheReplicatedAtomicTest.cs
index db6f5a5..bd31c77 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheReplicatedAtomicTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheReplicatedAtomicTest.cs
@@ -42,11 +42,6 @@ namespace Apache.Ignite.Core.Tests.Cache
return false;
}
- protected override bool TxEnabled()
- {
- return false;
- }
-
protected override int Backups()
{
return GridCount() - 1;
http://git-wip-us.apache.org/repos/asf/ignite/blob/864af7eb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheReplicatedTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheReplicatedTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheReplicatedTest.cs
index 7c70222..2d1c257 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheReplicatedTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheReplicatedTest.cs
@@ -20,7 +20,7 @@ namespace Apache.Ignite.Core.Tests.Cache
using NUnit.Framework;
[Category(TestUtils.CategoryIntensive)]
- public class CacheReplicatedTest : CacheAbstractTest
+ public class CacheReplicatedTest : CacheAbstractTransactionalTest
{
protected override int CachePartitions()
{
@@ -42,11 +42,6 @@ namespace Apache.Ignite.Core.Tests.Cache
return false;
}
- protected override bool TxEnabled()
- {
- return true;
- }
-
protected override int Backups()
{
return GridCount() - 1;
[21/50] [abbrv] ignite git commit: Merge remote-tracking branch
'remotes/community/ignite-1.8.2'
Posted by ag...@apache.org.
Merge remote-tracking branch 'remotes/community/ignite-1.8.2'
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/72f03ea7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/72f03ea7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/72f03ea7
Branch: refs/heads/ignite-3477
Commit: 72f03ea7d8bc92de624817655e21f05c268a3399
Parents: 228d97b da5b68c
Author: sboikov <sb...@gridgain.com>
Authored: Fri Dec 30 15:13:06 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Dec 30 15:13:06 2016 +0300
----------------------------------------------------------------------
.../ignite/internal/util/nio/GridNioServer.java | 159 ++++++++++++++++---
.../communication/tcp/TcpCommunicationSpi.java | 20 +--
.../tcp/TcpCommunicationSpiMBean.java | 5 +-
...mmunicationBalancePairedConnectionsTest.java | 28 ++++
.../IgniteCommunicationBalanceTest.java | 25 ++-
...cMessageRecoveryNoPairedConnectionsTest.java | 47 ------
...micMessageRecoveryPairedConnectionsTest.java | 47 ++++++
.../ignite/testsuites/IgniteCacheTestSuite.java | 6 +-
.../yardstick/cache/IgniteIoTestBenchmark.java | 73 ---------
9 files changed, 250 insertions(+), 160 deletions(-)
----------------------------------------------------------------------
[42/50] [abbrv] ignite git commit: IGNITE-4545 Added cache for router
hostnames. - Fixes #1428.
Posted by ag...@apache.org.
IGNITE-4545 Added cache for router hostnames. - Fixes #1428.
Signed-off-by: Andrey Novikov <an...@gridgain.com>
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/27ba69b5
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/27ba69b5
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/27ba69b5
Branch: refs/heads/ignite-3477
Commit: 27ba69b55f645a022f2e84cc4db76309b02850e3
Parents: 79401b2
Author: Andrey Novikov <an...@gridgain.com>
Authored: Mon Jan 16 11:22:34 2017 +0700
Committer: Andrey Novikov <an...@gridgain.com>
Committed: Mon Jan 16 11:22:34 2017 +0700
----------------------------------------------------------------------
.../GridClientConnectionManagerAdapter.java | 7 ++-
.../impl/connection/GridClientTopology.java | 53 ++++++++++++++++----
2 files changed, 49 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/27ba69b5/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java
index 12baee0..f714e7a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java
@@ -85,6 +85,9 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo
/** Class logger. */
private final Logger log;
+ /** All local enabled MACs. */
+ private final Collection<String> macs;
+
/** NIO server. */
private GridNioServer srv;
@@ -166,6 +169,8 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo
if (marshId == null && cfg.getMarshaller() == null)
throw new GridClientException("Failed to start client (marshaller is not configured).");
+ macs = U.allLocalMACs();
+
if (cfg.getProtocol() == GridClientProtocol.TCP) {
try {
IgniteLogger gridLog = new JavaLogger(false);
@@ -316,7 +321,7 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo
}
boolean sameHost = node.attributes().isEmpty() ||
- F.containsAny(U.allLocalMACs(), node.attribute(ATTR_MACS).toString().split(", "));
+ F.containsAny(macs, node.attribute(ATTR_MACS).toString().split(", "));
Collection<InetSocketAddress> srvs = new LinkedHashSet<>();
http://git-wip-us.apache.org/repos/asf/ignite/blob/27ba69b5/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientTopology.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientTopology.java
index effd5b3..97aa586 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientTopology.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientTopology.java
@@ -21,7 +21,6 @@ import java.net.InetSocketAddress;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
@@ -61,12 +60,18 @@ public class GridClientTopology {
/** Cached last error prevented topology from update. */
private GridClientException lastError;
+ /** Router addresses from configuration. */
+ private final String routers;
+
/**
* Set of router addresses to infer direct connectivity
* when client is working in router connection mode.
* {@code null} when client is working in direct connection node.
*/
- private final Set<String> routerAddrs;
+ private final Set<InetSocketAddress> routerAddrs;
+
+ /** List of all known local MACs */
+ private final Collection<String> macsCache;
/** Protocol. */
private final GridClientProtocol prot;
@@ -96,8 +101,38 @@ public class GridClientTopology {
metricsCache = cfg.isEnableMetricsCache();
attrCache = cfg.isEnableAttributesCache();
prot = cfg.getProtocol();
- routerAddrs = (!cfg.getRouters().isEmpty() && cfg.getServers().isEmpty()) ?
- new HashSet<>(cfg.getRouters()) : null;
+
+ if (!cfg.getRouters().isEmpty() && cfg.getServers().isEmpty()) {
+ routers = cfg.getRouters().toString();
+
+ routerAddrs = U.newHashSet(cfg.getRouters().size());
+
+ for (String router : cfg.getRouters()) {
+ int portIdx = router.lastIndexOf(":");
+
+ if (portIdx > 0) {
+ String hostName = router.substring(0, portIdx);
+
+ try {
+ int port = Integer.parseInt(router.substring(portIdx + 1));
+
+ InetSocketAddress inetSockAddr = new InetSocketAddress(hostName, port);
+
+ routerAddrs.add(inetSockAddr);
+ }
+ catch (Exception ignore) {
+ // No-op.
+ }
+ }
+ }
+ }
+ else {
+ routers = null;
+
+ routerAddrs = Collections.emptySet();
+ }
+
+ macsCache = U.allLocalMACs();
}
/**
@@ -279,7 +314,7 @@ public class GridClientTopology {
try {
if (lastError != null)
throw new GridClientDisconnectedException(
- "Topology is failed [protocol=" + prot + ", routers=" + routerAddrs + ']', lastError);
+ "Topology is failed [protocol=" + prot + ", routers=" + routers + ']', lastError);
else
return nodes.get(id);
}
@@ -376,19 +411,17 @@ public class GridClientTopology {
(metricsCache && attrCache) || (node.attributes().isEmpty() && node.metrics() == null);
// Try to bypass object copying.
- if (noAttrsAndMetrics && routerAddrs == null && node.connectable())
+ if (noAttrsAndMetrics && routerAddrs.isEmpty() && node.connectable())
return node;
// Return a new node instance based on the original one.
GridClientNodeImpl.Builder nodeBuilder = GridClientNodeImpl.builder(node, !attrCache, !metricsCache);
for (InetSocketAddress addr : node.availableAddresses(prot, true)) {
- boolean router = routerAddrs == null ||
- routerAddrs.contains(addr.getHostName() + ":" + addr.getPort()) ||
- routerAddrs.contains(addr.getAddress().getHostAddress() + ":" + addr.getPort());
+ boolean router = routerAddrs.isEmpty() || routerAddrs.contains(addr);
boolean reachable = noAttrsAndMetrics || !addr.getAddress().isLoopbackAddress() ||
- F.containsAny(U.allLocalMACs(), node.attribute(ATTR_MACS).toString().split(", "));
+ F.containsAny(macsCache, node.<String>attribute(ATTR_MACS).split(", "));
if (router && reachable) {
nodeBuilder.connectable(true);
[05/50] [abbrv] ignite git commit: IGNITE-4367 .NET: Fix flaky tests
- add topology checks to ReconnectTest.TestClusterRestart
Posted by ag...@apache.org.
IGNITE-4367 .NET: Fix flaky tests - add topology checks to ReconnectTest.TestClusterRestart
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8dd03222
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8dd03222
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8dd03222
Branch: refs/heads/ignite-3477
Commit: 8dd03222f87dc0b0b6b0f0a86adb5ec196592e38
Parents: 10b2b97
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Dec 27 20:11:37 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Dec 27 20:11:37 2016 +0300
----------------------------------------------------------------------
.../platforms/dotnet/Apache.Ignite.Core.Tests/ReconnectTest.cs | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/8dd03222/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ReconnectTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ReconnectTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ReconnectTest.cs
index 253a10f..5a2d2d0 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ReconnectTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ReconnectTest.cs
@@ -53,8 +53,13 @@ namespace Apache.Ignite.Core.Tests
};
var server = Ignition.Start(serverCfg);
+
+ Assert.AreEqual(1, server.GetCluster().GetNodes().Count);
+
var client = Ignition.Start(clientCfg);
+ Assert.AreEqual(2, client.GetCluster().GetNodes().Count);
+
ClientReconnectEventArgs eventArgs = null;
client.ClientReconnected += (sender, args) => { eventArgs = args; };
[10/50] [abbrv] ignite git commit: IGNITE-4405: Hadoop: implemented
"readLine" method for HadoopDataInStream and HadoopDirectDataInput classes.
This closes #1358.
Posted by ag...@apache.org.
IGNITE-4405: Hadoop: implemented "readLine" method for HadoopDataInStream and HadoopDirectDataInput classes. This closes #1358.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a61b0eaf
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a61b0eaf
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a61b0eaf
Branch: refs/heads/ignite-3477
Commit: a61b0eaff1817d84c0659e8a7e095f29e22800e1
Parents: 7d82d6a
Author: tledkov-gridgain <tl...@gridgain.com>
Authored: Wed Dec 28 14:09:38 2016 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Wed Dec 28 14:09:38 2016 +0300
----------------------------------------------------------------------
.../shuffle/direct/HadoopDirectDataInput.java | 34 +++-
.../shuffle/streams/HadoopDataInStream.java | 34 +++-
.../shuffle/streams/HadoopOffheapBuffer.java | 18 ++
.../streams/HadoopDataStreamSelfTest.java | 177 +++++++++++++++++--
4 files changed, 244 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a61b0eaf/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataInput.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataInput.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataInput.java
index e3a713a..6f0e2b0 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataInput.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/direct/HadoopDirectDataInput.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.processors.hadoop.shuffle.direct;
import org.apache.ignite.internal.util.GridUnsafe;
+import org.apache.ignite.internal.util.typedef.internal.SB;
import org.jetbrains.annotations.NotNull;
import java.io.DataInput;
@@ -150,8 +151,37 @@ public class HadoopDirectDataInput extends InputStream implements DataInput {
/** {@inheritDoc} */
@Override public String readLine() throws IOException {
- // TODO: Create ticket!
- throw new UnsupportedOperationException();
+ if (pos == buf.length)
+ return null;
+
+ SB sb = new SB();
+
+ while (pos < buf.length) {
+ char c = (char)readByte();
+
+ switch (c) {
+ case '\n':
+ return sb.toString();
+
+ case '\r':
+ if (pos == buf.length)
+ return sb.toString();
+
+ c = (char)readByte();
+
+ if (c == '\n')
+ return sb.toString();
+ else
+ pos--;
+
+ return sb.toString();
+
+ default:
+ sb.a(c);
+ }
+ }
+
+ return sb.toString();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/a61b0eaf/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopDataInStream.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopDataInStream.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopDataInStream.java
index 3b5fa15..261daee 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopDataInStream.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopDataInStream.java
@@ -22,6 +22,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory;
+import org.apache.ignite.internal.util.typedef.internal.SB;
/**
* Data input stream.
@@ -52,6 +53,7 @@ public class HadoopDataInStream extends InputStream implements DataInput {
/**
* @param size Size.
* @return Old pointer.
+ * @throws IOException On error.
*/
protected long move(long size) throws IOException {
long ptr = buf.move(size);
@@ -156,7 +158,37 @@ public class HadoopDataInStream extends InputStream implements DataInput {
/** {@inheritDoc} */
@Override public String readLine() throws IOException {
- throw new UnsupportedOperationException();
+ if (buf.remaining() == 0)
+ return null;
+
+ SB sb = new SB();
+
+ while (buf.remaining() > 0) {
+ char c = (char)readByte();
+
+ switch (c) {
+ case '\n':
+ return sb.toString();
+
+ case '\r':
+ if (buf.remaining() == 0)
+ return sb.toString();
+
+ c = (char)readByte();
+
+ if (c == '\n')
+ return sb.toString();
+ else
+ buf.moveBackward(1);
+
+ return sb.toString();
+
+ default:
+ sb.a(c);
+ }
+ }
+
+ return sb.toString();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/a61b0eaf/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopOffheapBuffer.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopOffheapBuffer.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopOffheapBuffer.java
index acc9be6..d15e7eb 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopOffheapBuffer.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopOffheapBuffer.java
@@ -106,6 +106,24 @@ public class HadoopOffheapBuffer {
}
/**
+ * @param size Size move on.
+ * @return Old position pointer or {@code 0} if move goes beyond the begin of the buffer.
+ */
+ public long moveBackward(long size) {
+ assert size > 0 : size;
+
+ long oldPos = posPtr;
+ long newPos = oldPos - size;
+
+ if (newPos < bufPtr)
+ return 0;
+
+ posPtr = newPos;
+
+ return oldPos;
+ }
+
+ /**
* @param ptr Pointer.
* @return {@code true} If the given pointer is inside of this buffer.
*/
http://git-wip-us.apache.org/repos/asf/ignite/blob/a61b0eaf/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/shuffle/streams/HadoopDataStreamSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/shuffle/streams/HadoopDataStreamSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/shuffle/streams/HadoopDataStreamSelfTest.java
index 612e892..c7d4dce 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/shuffle/streams/HadoopDataStreamSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/shuffle/streams/HadoopDataStreamSelfTest.java
@@ -17,30 +17,173 @@
package org.apache.ignite.internal.processors.hadoop.impl.shuffle.streams;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInput;
+import java.io.DataInputStream;
+import java.io.DataOutput;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
+import org.apache.ignite.internal.processors.hadoop.shuffle.direct.HadoopDirectDataInput;
+import org.apache.ignite.internal.processors.hadoop.shuffle.direct.HadoopDirectDataOutput;
import org.apache.ignite.internal.processors.hadoop.shuffle.streams.HadoopDataInStream;
import org.apache.ignite.internal.processors.hadoop.shuffle.streams.HadoopDataOutStream;
import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
/**
*
*/
public class HadoopDataStreamSelfTest extends GridCommonAbstractTest {
+ private static final int BUFF_SIZE = 4 * 1024;
+ /**
+ * @throws IOException If failed.
+ */
public void testStreams() throws IOException {
GridUnsafeMemory mem = new GridUnsafeMemory(0);
HadoopDataOutStream out = new HadoopDataOutStream(mem);
- int size = 4 * 1024;
+ final long ptr = mem.allocate(BUFF_SIZE);
- final long ptr = mem.allocate(size);
+ out.buffer().set(ptr, BUFF_SIZE);
- out.buffer().set(ptr, size);
+ write(out);
+ HadoopDataInStream in = new HadoopDataInStream(mem);
+
+ in.buffer().set(ptr, out.buffer().pointer() - ptr);
+
+ checkRead(in);
+ }
+
+ /**
+ * @throws IOException If failed.
+ */
+ public void testDirectStreams() throws IOException {
+ HadoopDirectDataOutput out = new HadoopDirectDataOutput(BUFF_SIZE);
+
+ write(out);
+
+ byte [] inBuf = Arrays.copyOf(out.buffer(), out.position());
+
+ HadoopDirectDataInput in = new HadoopDirectDataInput(inBuf);
+
+ checkRead(in);
+ }
+
+ /**
+ * @throws IOException If failed.
+ */
+ public void testReadline() throws IOException {
+ checkReadLine("String1\rString2\r\nString3\nString4");
+ checkReadLine("String1\rString2\r\nString3\nString4\r\n");
+ checkReadLine("String1\rString2\r\nString3\nString4\r");
+ checkReadLine("\nA\rB\r\nC\nD\n");
+ checkReadLine("\rA\rB\r\nC\nD\n");
+ checkReadLine("\r\nA\rB\r\nC\nD\n");
+ checkReadLine("\r\r\nA\r\r\nC\nD\n");
+ checkReadLine("\r\r\r\n\n\n");
+ checkReadLine("\r\n");
+ checkReadLine("\r");
+ checkReadLine("\n");
+ }
+
+ /**
+ * @param val String value.
+ * @throws IOException On error.
+ */
+ private void checkReadLine(String val) throws IOException {
+ List<String> expected = readLineByDataInputStream(val);
+ List<String> dataInp = readLineByHadoopDataInStream(val);
+ List<String> directDataInp = readLineByHadoopDirectDataInput(val);
+
+ assertEquals(expected, dataInp);
+ assertEquals(expected, directDataInp);
+ }
+
+ /**
+ * @param val String value.
+ * @return List of strings are returned by readLine().
+ * @throws IOException On error.
+ */
+ List<String> readLineByDataInputStream(String val) throws IOException {
+ ByteArrayOutputStream byteArrayOs = new ByteArrayOutputStream();
+
+ byteArrayOs.write(val.getBytes());
+
+ byteArrayOs.close();
+
+ try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(byteArrayOs.toByteArray()))) {
+ return readLineStrings(in);
+ }
+ }
+
+ /**
+ * @param val String value.
+ * @return List of strings are returned by readLine().
+ * @throws IOException On error.
+ */
+ List<String> readLineByHadoopDataInStream(String val) throws IOException {
+ GridUnsafeMemory mem = new GridUnsafeMemory(0);
+
+ HadoopDataOutStream out = new HadoopDataOutStream(mem);
+
+ final long ptr = mem.allocate(BUFF_SIZE);
+
+ out.buffer().set(ptr, BUFF_SIZE);
+
+ out.write(val.getBytes());
+
+ HadoopDataInStream in = new HadoopDataInStream(mem);
+
+ in.buffer().set(ptr, out.buffer().pointer() - ptr);
+
+ return readLineStrings(in);
+ }
+
+ /**
+ * @param val String value.
+ * @return List of strings are returned by readLine().
+ * @throws IOException On error.
+ */
+ List<String> readLineByHadoopDirectDataInput(String val) throws IOException {
+
+ HadoopDirectDataOutput out = new HadoopDirectDataOutput(BUFF_SIZE);
+
+ out.write(val.getBytes());
+
+ byte [] inBuf = Arrays.copyOf(out.buffer(), out.position());
+
+ HadoopDirectDataInput in = new HadoopDirectDataInput(inBuf);
+
+ return readLineStrings(in);
+ }
+
+ /**
+ * @param in Data input.
+ * @return List of strings are returned by readLine().
+ * @throws IOException On error.
+ */
+ @NotNull private List<String> readLineStrings(DataInput in) throws IOException {
+ List<String> strs = new ArrayList<>();
+
+ for (String str = in.readLine(); str != null; str = in.readLine())
+ strs.add(str);
+
+ return strs;
+ }
+
+ /**
+ * @param out Data output.
+ * @throws IOException On error.
+ */
+ private void write(DataOutput out) throws IOException {
out.writeBoolean(false);
out.writeBoolean(true);
out.writeBoolean(false);
@@ -84,20 +227,22 @@ public class HadoopDataStreamSelfTest extends GridCommonAbstractTest {
out.writeLong(Long.MIN_VALUE);
out.writeLong(0);
out.writeLong(-1L);
- out.write(new byte[]{1,2,3});
- out.write(new byte[]{0,1,2,3}, 1, 2);
+ out.write(new byte[] {1, 2, 3});
+ out.write(new byte[] {0, 1, 2, 3}, 1, 2);
out.writeUTF("mom washes rum");
+ }
- HadoopDataInStream in = new HadoopDataInStream(mem);
-
- in.buffer().set(ptr, out.buffer().pointer());
-
+ /**
+ * @param in Data input.
+ * @throws IOException On error.
+ */
+ private void checkRead(DataInput in) throws IOException {
assertEquals(false, in.readBoolean());
assertEquals(true, in.readBoolean());
assertEquals(false, in.readBoolean());
- assertEquals(17, in.read());
- assertEquals(121, in.read());
- assertEquals(0xfa, in.read());
+ assertEquals(17, in.readUnsignedByte());
+ assertEquals(121, in.readUnsignedByte());
+ assertEquals(0xfa, in.readUnsignedByte());
assertEquals(17, in.readByte());
assertEquals(121, in.readByte());
assertEquals((byte)0xfa, in.readByte());
@@ -138,15 +283,15 @@ public class HadoopDataStreamSelfTest extends GridCommonAbstractTest {
byte[] b = new byte[3];
- in.read(b);
+ in.readFully(b);
- assertTrue(Arrays.equals(new byte[]{1,2,3}, b));
+ assertTrue(Arrays.equals(new byte[] {1, 2, 3}, b));
b = new byte[4];
- in.read(b, 1, 2);
+ in.readFully(b, 1, 2);
- assertTrue(Arrays.equals(new byte[]{0, 1, 2, 0}, b));
+ assertTrue(Arrays.equals(new byte[] {0, 1, 2, 0}, b));
assertEquals("mom washes rum", in.readUTF());
}
[41/50] [abbrv] ignite git commit: IGNITE-4518 Fixed parallel load of
cache. - Fixes #1426.
Posted by ag...@apache.org.
IGNITE-4518 Fixed parallel load of cache. - Fixes #1426.
Signed-off-by: Andrey Novikov <an...@gridgain.com>
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/79401b2e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/79401b2e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/79401b2e
Branch: refs/heads/ignite-3477
Commit: 79401b2ebf814eeffa36d41a82d1238d8eccc7e9
Parents: 6045a24
Author: Andrey Novikov <an...@gridgain.com>
Authored: Mon Jan 16 10:33:16 2017 +0700
Committer: Andrey Novikov <an...@gridgain.com>
Committed: Mon Jan 16 10:33:16 2017 +0700
----------------------------------------------------------------------
.../store/jdbc/dialect/BasicJdbcDialect.java | 31 ++++++++-----
.../store/jdbc/CacheJdbcPojoStoreTest.java | 48 +++++++++++++++++++-
2 files changed, 66 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/79401b2e/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/BasicJdbcDialect.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/BasicJdbcDialect.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/BasicJdbcDialect.java
index 3ab112a..139f3fc 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/BasicJdbcDialect.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/BasicJdbcDialect.java
@@ -173,13 +173,15 @@ public class BasicJdbcDialect implements JdbcDialect {
if (appendLowerBound) {
sb.a("(");
- for (int cnt = keyCols.size(); cnt > 0; cnt--) {
- for (int j = 0; j < cnt; j++)
- if (j == cnt - 1)
- sb.a(cols[j]).a(" > ? ");
+ for (int keyCnt = keyCols.size(); keyCnt > 0; keyCnt--) {
+ for (int idx = 0; idx < keyCnt; idx++) {
+ if (idx == keyCnt - 1)
+ sb.a(cols[idx]).a(" > ? ");
else
- sb.a(cols[j]).a(" = ? AND ");
- if (cnt != 1)
+ sb.a(cols[idx]).a(" = ? AND ");
+ }
+
+ if (keyCnt != 1)
sb.a("OR ");
}
@@ -192,13 +194,18 @@ public class BasicJdbcDialect implements JdbcDialect {
if (appendUpperBound) {
sb.a("(");
- for (int cnt = keyCols.size(); cnt > 0; cnt--) {
- for (int j = 0; j < cnt; j++)
- if (j == cnt - 1)
- sb.a(cols[j]).a(" <= ? ");
+ for (int keyCnt = keyCols.size(); keyCnt > 0; keyCnt--) {
+ for (int idx = 0, lastIdx = keyCnt - 1; idx < keyCnt; idx++) {
+ sb.a(cols[idx]);
+
+ // For composite key when not all of the key columns are constrained should use < (strictly less).
+ if (idx == lastIdx)
+ sb.a(keyCnt == keyCols.size() ? " <= ? " : " < ? ");
else
- sb.a(cols[j]).a(" = ? AND ");
- if (cnt != 1)
+ sb.a(" = ? AND ");
+ }
+
+ if (keyCnt != 1)
sb.a(" OR ");
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/79401b2e/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java
index d8f75d3..4a0b1da 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java
@@ -216,7 +216,7 @@ public class CacheJdbcPojoStoreTest extends GridAbstractCacheStoreSelfTest<Cache
stmt.executeUpdate("CREATE TABLE IF NOT EXISTS " +
"Person_Complex (id integer not null, org_id integer not null, city_id integer not null, " +
- "name varchar(50), salary integer, PRIMARY KEY(id))");
+ "name varchar(50), salary integer, PRIMARY KEY(id, org_id, city_id))");
conn.commit();
@@ -352,6 +352,52 @@ public class CacheJdbcPojoStoreTest extends GridAbstractCacheStoreSelfTest<Cache
/**
* @throws Exception If failed.
*/
+ public void testParallelLoad() throws Exception {
+ Connection conn = store.openConnection(false);
+
+ PreparedStatement prnComplexStmt = conn.prepareStatement("INSERT INTO Person_Complex(id, org_id, city_id, name, salary) VALUES (?, ?, ?, ?, ?)");
+
+ for (int i = 0; i < 8; i++) {
+
+ prnComplexStmt.setInt(1, (i >> 2) & 1);
+ prnComplexStmt.setInt(2, (i >> 1) & 1);
+ prnComplexStmt.setInt(3, i % 2);
+
+ prnComplexStmt.setString(4, "name");
+ prnComplexStmt.setInt(5, 1000 + i * 500);
+
+ prnComplexStmt.addBatch();
+ }
+
+ prnComplexStmt.executeBatch();
+
+ U.closeQuiet(prnComplexStmt);
+
+ conn.commit();
+
+ U.closeQuiet(conn);
+
+ final Collection<PersonComplexKey> prnComplexKeys = new ConcurrentLinkedQueue<>();
+
+ IgniteBiInClosure<Object, Object> c = new CI2<Object, Object>() {
+ @Override public void apply(Object k, Object v) {
+ if (k instanceof PersonComplexKey && v instanceof Person)
+ prnComplexKeys.add((PersonComplexKey)k);
+ else
+ fail("Unexpected entry [key=" + k + ", value=" + v + "]");
+ }
+ };
+
+ store.setParallelLoadCacheMinimumThreshold(2);
+
+ store.loadCache(c);
+
+ assertEquals(8, prnComplexKeys.size());
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
public void testWriteRetry() throws Exception {
CacheJdbcPojoStore<Object, Object> store = store();
[50/50] [abbrv] ignite git commit: Merge ignite-3477 into ignite-db-x
Posted by ag...@apache.org.
Merge ignite-3477 into ignite-db-x
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ca373d78
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ca373d78
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ca373d78
Branch: refs/heads/ignite-3477
Commit: ca373d78694db25f0c6d233f4802d77fb3a7f654
Parents: 6f258b9 e7e0d87
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Jan 17 13:43:42 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Jan 17 13:43:42 2017 +0300
----------------------------------------------------------------------
.../JettyRestProcessorAbstractSelfTest.java | 2 +-
.../internal/managers/GridManagerAdapter.java | 3 +-
.../processors/cache/GridCacheAdapter.java | 7 +-
.../cache/GridCacheConcurrentMapImpl.java | 7 +-
.../processors/cache/GridCacheMapEntry.java | 8 ++
.../GridCachePartitionExchangeManager.java | 115 +++++++++----------
.../cache/GridCacheSharedContext.java | 23 +++-
.../distributed/dht/GridDhtCacheEntry.java | 2 +-
.../distributed/dht/GridDhtLocalPartition.java | 9 +-
.../dht/GridDhtPartitionTopologyImpl.java | 8 +-
.../dht/GridPartitionedGetFuture.java | 4 +-
.../dht/GridPartitionedSingleGetFuture.java | 4 +-
.../dht/atomic/GridDhtAtomicCache.java | 60 +++++-----
.../dht/preloader/GridDhtForceKeysFuture.java | 10 +-
.../GridDhtPartitionsExchangeFuture.java | 30 ++---
.../dht/preloader/GridDhtPreloader.java | 2 +-
.../extras/GridCacheAttributesEntryExtras.java | 4 +-
.../GridCacheAttributesMvccEntryExtras.java | 2 +-
...dCacheAttributesMvccObsoleteEntryExtras.java | 2 +-
...cheAttributesMvccObsoleteTtlEntryExtras.java | 4 +-
.../GridCacheAttributesMvccTtlEntryExtras.java | 4 +-
.../GridCacheAttributesObsoleteEntryExtras.java | 2 +-
...idCacheAttributesObsoleteTtlEntryExtras.java | 4 +-
.../GridCacheAttributesTtlEntryExtras.java | 4 +-
.../GridCacheMvccObsoleteEntryExtras.java | 2 +-
.../GridCacheMvccObsoleteTtlEntryExtras.java | 4 +-
.../extras/GridCacheMvccTtlEntryExtras.java | 3 +-
.../extras/GridCacheObsoleteTtlEntryExtras.java | 3 +-
.../cache/extras/GridCacheTtlEntryExtras.java | 2 +-
.../util/GridCursorIteratorWrapper.java | 24 +++-
.../cache/CacheConfigurationLeakTest.java | 4 +-
.../cache/GridCacheAbstractMetricsSelfTest.java | 28 ++---
.../GridCacheValueBytesPreloadingSelfTest.java | 17 +--
...CacheLoadingConcurrentGridStartSelfTest.java | 2 +
...tractPartitionedByteArrayValuesSelfTest.java | 1 +
...GridCachePreloadRestartAbstractSelfTest.java | 12 +-
.../GridCacheDhtEvictionsDisabledSelfTest.java | 6 +-
.../GridCacheReplicatedPreloadSelfTest.java | 25 ++--
.../testsuites/IgniteCacheTestSuite2.java | 15 +--
.../testsuites/IgniteCacheTestSuite3.java | 13 ++-
...niteCachePartitionedFieldsQuerySelfTest.java | 8 +-
...gniteCacheReplicatedFieldsQuerySelfTest.java | 6 +-
.../query/h2/opt/GridH2TableSelfTest.java | 6 +-
.../IgniteCacheQuerySelfTestSuite2.java | 5 +-
modules/yardstick/config/ignite-base-config.xml | 2 +-
.../yardstick/cache/IgniteGetAllBenchmark.java | 42 +++++++
.../yardstick/cache/IgniteGetBenchmark.java | 38 +++++-
.../cache/jdbc/JdbcAbstractBenchmark.java | 17 +++
.../yardstick/cache/jdbc/JdbcPutBenchmark.java | 17 +++
.../cache/jdbc/JdbcPutGetBenchmark.java | 17 +++
.../jdbc/JdbcPutIndexedValue8Benchmark.java | 17 +++
.../cache/jdbc/JdbcSqlQueryBenchmark.java | 17 +++
.../cache/jdbc/JdbcSqlQueryJoinBenchmark.java | 17 +++
53 files changed, 472 insertions(+), 218 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ca373d78/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ca373d78/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ca373d78/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
[13/50] [abbrv] ignite git commit: IGNITE-4442 Implemented cache
affinity configuration.
Posted by ag...@apache.org.
IGNITE-4442 Implemented cache affinity configuration.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f4a1e6ca
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f4a1e6ca
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f4a1e6ca
Branch: refs/heads/ignite-3477
Commit: f4a1e6ca86bcc6054ca6066107ad58b6b19d665a
Parents: 828b9b6
Author: Vasiliy Sisko <vs...@gridgain.com>
Authored: Thu Dec 29 14:48:45 2016 +0700
Committer: Andrey Novikov <an...@gridgain.com>
Committed: Thu Dec 29 14:48:45 2016 +0700
----------------------------------------------------------------------
modules/web-console/backend/app/mongo.js | 19 +++++
.../generator/AbstractTransformer.js | 5 ++
.../modules/configuration/generator/Beans.js | 4 +
.../generator/ConfigurationGenerator.js | 36 +++++++++
.../states/configuration/caches/affinity.jade | 82 ++++++++++++++++++++
.../states/configuration/caches/memory.jade | 4 +-
.../frontend/views/configuration/caches.jade | 1 +
7 files changed, 149 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f4a1e6ca/modules/web-console/backend/app/mongo.js
----------------------------------------------------------------------
diff --git a/modules/web-console/backend/app/mongo.js b/modules/web-console/backend/app/mongo.js
index 58ab119..dd71f3a 100644
--- a/modules/web-console/backend/app/mongo.js
+++ b/modules/web-console/backend/app/mongo.js
@@ -140,6 +140,25 @@ module.exports.factory = function(passportMongo, settings, pluginMongo, mongoose
cacheMode: {type: String, enum: ['PARTITIONED', 'REPLICATED', 'LOCAL']},
atomicityMode: {type: String, enum: ['ATOMIC', 'TRANSACTIONAL']},
+ affinity: {
+ kind: {type: String, enum: ['Default', 'Rendezvous', 'Fair', 'Custom']},
+ Rendezvous: {
+ affinityBackupFilter: String,
+ partitions: Number,
+ excludeNeighbors: Boolean
+ },
+ Fair: {
+ affinityBackupFilter: String,
+ partitions: Number,
+ excludeNeighbors: Boolean
+ },
+ Custom: {
+ className: String
+ }
+ },
+
+ affinityMapper: String,
+
nodeFilter: {
kind: {type: String, enum: ['Default', 'Exclude', 'IGFS', 'OnNodes', 'Custom']},
Exclude: {
http://git-wip-us.apache.org/repos/asf/ignite/blob/f4a1e6ca/modules/web-console/frontend/app/modules/configuration/generator/AbstractTransformer.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/AbstractTransformer.js b/modules/web-console/frontend/app/modules/configuration/generator/AbstractTransformer.js
index f5afe59..40d937e 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/AbstractTransformer.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/AbstractTransformer.js
@@ -211,6 +211,11 @@ export default class AbstractTransformer {
}
// Generate cache memory group.
+ static cacheAffinity(cache) {
+ return this.toSection(this.generator.cacheAffinity(cache));
+ }
+
+ // Generate cache memory group.
static cacheMemory(cache) {
return this.toSection(this.generator.cacheMemory(cache));
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/f4a1e6ca/modules/web-console/frontend/app/modules/configuration/generator/Beans.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/Beans.js b/modules/web-console/frontend/app/modules/configuration/generator/Beans.js
index ca19342..0972eac 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/Beans.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/Beans.js
@@ -116,6 +116,10 @@ export class Bean extends EmptyBean {
return this._property(this.arguments, 'int', model, null, _.nonNil);
}
+ boolConstructorArgument(model) {
+ return this._property(this.arguments, 'boolean', model, null, _.nonNil);
+ }
+
classConstructorArgument(model) {
return this._property(this.arguments, 'java.lang.Class', model, null, _.nonEmpty);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/f4a1e6ca/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js b/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
index 8770bf6..de2b750 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/ConfigurationGenerator.js
@@ -1453,6 +1453,41 @@ export default class IgniteConfigurationGenerator {
return ccfg;
}
+ // Generation of constructor for affinity function.
+ static cacheAffinityFunction(cls, func) {
+ const affBean = new Bean(cls, 'affinityFunction', func);
+
+ affBean.boolConstructorArgument('excludeNeighbors')
+ .intProperty('partitions')
+ .emptyBeanProperty('affinityBackupFilter');
+
+ return affBean;
+ }
+
+ // Generate cache memory group.
+ static cacheAffinity(cache, ccfg = this.cacheConfigurationBean(cache)) {
+ switch (_.get(cache, 'affinity.kind')) {
+ case 'Rendezvous':
+ ccfg.beanProperty('affinity', this.cacheAffinityFunction('org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction', cache.affinity.Rendezvous));
+
+ break;
+ case 'Fair':
+ ccfg.beanProperty('affinity', this.cacheAffinityFunction('org.apache.ignite.cache.affinity.fair.FairAffinityFunction', cache.affinity.Fair));
+
+ break;
+ case 'Custom':
+ ccfg.emptyBeanProperty('affinity.Custom.className', 'affinity');
+
+ break;
+ default:
+ // No-op.
+ }
+
+ ccfg.emptyBeanProperty('affinityMapper');
+
+ return ccfg;
+ }
+
// Generate cache memory group.
static cacheMemory(cache, ccfg = this.cacheConfigurationBean(cache)) {
ccfg.enumProperty('memoryMode');
@@ -1728,6 +1763,7 @@ export default class IgniteConfigurationGenerator {
static cacheConfiguration(cache, ccfg = this.cacheConfigurationBean(cache)) {
this.cacheGeneral(cache, ccfg);
+ this.cacheAffinity(cache, ccfg);
this.cacheMemory(cache, ccfg);
this.cacheQuery(cache, cache.domains, ccfg);
this.cacheStore(cache, cache.domains, ccfg);
http://git-wip-us.apache.org/repos/asf/ignite/blob/f4a1e6ca/modules/web-console/frontend/app/modules/states/configuration/caches/affinity.jade
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/states/configuration/caches/affinity.jade b/modules/web-console/frontend/app/modules/states/configuration/caches/affinity.jade
new file mode 100644
index 0000000..3c4746b
--- /dev/null
+++ b/modules/web-console/frontend/app/modules/states/configuration/caches/affinity.jade
@@ -0,0 +1,82 @@
+//-
+ 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.
+
+include /app/helpers/jade/mixins.jade
+
+-var form = 'affinity'
+-var model = 'backupItem'
+-var affModel = model + '.affinity'
+-var affMapModel = model + '.affinityMapper'
+-var rendezvousAff = affModel + '.kind === "Rendezvous"'
+-var fairAff = affModel + '.kind === "Fair"'
+-var customAff = affModel + '.kind === "Custom"'
+-var customAffMapper = affMapModel + '.kind === "Custom"'
+-var rendPartitionsRequired = rendezvousAff + ' && ' + affModel + '.Rendezvous.affinityBackupFilter'
+-var fairPartitionsRequired = fairAff + ' && ' + affModel + '.Fair.affinityBackupFilter'
+
+.panel.panel-default(ng-form=form novalidate)
+ .panel-heading(bs-collapse-toggle='' ng-click='ui.loadPanel("#{form}")')
+ ignite-form-panel-chevron
+ label Affinity Collocation
+ ignite-form-field-tooltip.tipLabel
+ | Collocate data with data to improve performance and scalability of your application#[br]
+ | #[a(href="http://apacheignite.gridgain.org/docs/affinity-collocation" target="_blank") More info]
+ ignite-form-revert
+ .panel-collapse(role='tabpanel' bs-collapse-target id=form)
+ .panel-body(ng-if='ui.isPanelLoaded("#{form}")')
+ .col-sm-6
+ .settings-row
+ +dropdown('Function:', affModel + '.kind', '"AffinityKind"', 'true', 'Default',
+ '[\
+ {value: "Rendezvous", label: "Rendezvous"},\
+ {value: "Fair", label: "Fair"},\
+ {value: "Custom", label: "Custom"},\
+ {value: undefined, label: "Default"}\
+ ]',
+ 'Key topology resolver to provide mapping from keys to nodes\
+ <ul>\
+ <li>Rendezvous - Based on Highest Random Weight algorithm<br/></li>\
+ <li>Fair - Tries to ensure that all nodes get equal number of partitions with minimum amount of reassignments between existing nodes<br/></li>\
+ <li>Custom - Custom implementation of key affinity fynction<br/></li>\
+ <li>Default - By default rendezvous affinity function with 1024 partitions is used<br/></li>\
+ </ul>')
+ .panel-details(ng-if=rendezvousAff)
+ .details-row
+ +number-required('Partitions', affModel + '.Rendezvous.partitions', '"RendPartitions"', 'true', rendPartitionsRequired, '1024', '1', 'Number of partitions')
+ .details-row
+ +java-class('Backup filter', affModel + '.Rendezvous.affinityBackupFilter', '"RendAffinityBackupFilter"', 'true', 'false',
+ 'Backups will be selected from all nodes that pass this filter')
+ .details-row
+ +checkbox('Exclude neighbors', affModel + '.Rendezvous.excludeNeighbors', '"RendExcludeNeighbors"',
+ 'Exclude same - host - neighbors from being backups of each other and specified number of backups')
+ .panel-details(ng-if=fairAff)
+ .details-row
+ +number-required('Partitions', affModel + '.Fair.partitions', '"FairPartitions"', 'true', fairPartitionsRequired, '256', '1', 'Number of partitions')
+ .details-row
+ +java-class('Backup filter', affModel + '.Fair.affinityBackupFilter', '"FairAffinityBackupFilter"', 'true', 'false',
+ 'Backups will be selected from all nodes that pass this filter')
+ .details-row
+ +checkbox('Exclude neighbors', affModel + '.Fair.excludeNeighbors', '"FairExcludeNeighbors"',
+ 'Exclude same - host - neighbors from being backups of each other and specified number of backups')
+ .panel-details(ng-if=customAff)
+ .details-row
+ +java-class('Class name:', affModel + '.Custom.className', '"AffCustomClassName"', 'true', customAff,
+ 'Custom key affinity function implementation class name')
+ .settings-row
+ +java-class('Mapper:', model + '.affinityMapper', '"AffMapCustomClassName"', 'true', 'false',
+ 'Provide custom affinity key for any given key')
+ .col-sm-6
+ +preview-xml-java(model, 'cacheAffinity')
http://git-wip-us.apache.org/repos/asf/ignite/blob/f4a1e6ca/modules/web-console/frontend/app/modules/states/configuration/caches/memory.jade
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/states/configuration/caches/memory.jade b/modules/web-console/frontend/app/modules/states/configuration/caches/memory.jade
index f2d3e2b..e8dfb3a 100644
--- a/modules/web-console/frontend/app/modules/states/configuration/caches/memory.jade
+++ b/modules/web-console/frontend/app/modules/states/configuration/caches/memory.jade
@@ -61,7 +61,7 @@ include /app/helpers/jade/mixins.jade
Note that in this mode entries can be evicted only to swap\
</li>\
</ul>')
- .settings-row(data-ng-show=model + '.memoryMode !== "OFFHEAP_VALUES"')
+ .settings-row(ng-show=model + '.memoryMode !== "OFFHEAP_VALUES"')
+dropdown-required('Off-heap memory:', model + '.offHeapMode', '"offHeapMode"', 'true',
model + '.memoryMode === "OFFHEAP_TIERED"',
'Disabled',
@@ -76,7 +76,7 @@ include /app/helpers/jade/mixins.jade
<li>Limited - Off-heap storage has limited size</li>\
<li>Unlimited - Off-heap storage grow infinitely (it is up to user to properly add and remove entries from cache to ensure that off-heap storage does not grow infinitely)</li>\
</ul>')
- .settings-row(data-ng-if=model + '.offHeapMode === 1 && ' + model + '.memoryMode !== "OFFHEAP_VALUES"')
+ .settings-row(ng-if=model + '.offHeapMode === 1 && ' + model + '.memoryMode !== "OFFHEAP_VALUES"')
+number-required('Off-heap memory max size:', model + '.offHeapMaxMemory', '"offHeapMaxMemory"', 'true',
model + '.offHeapMode === 1', 'Enter off-heap memory size', '1',
'Maximum amount of memory available to off-heap storage in bytes')
http://git-wip-us.apache.org/repos/asf/ignite/blob/f4a1e6ca/modules/web-console/frontend/views/configuration/caches.jade
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/views/configuration/caches.jade b/modules/web-console/frontend/views/configuration/caches.jade
index 4a4cf2e..73a6309 100644
--- a/modules/web-console/frontend/views/configuration/caches.jade
+++ b/modules/web-console/frontend/views/configuration/caches.jade
@@ -44,6 +44,7 @@ include /app/helpers/jade/mixins.jade
+advanced-options-toggle-default
div(ng-show='ui.expanded')
+ include /app/modules/states/configuration/caches/affinity.jade
include /app/modules/states/configuration/caches/concurrency.jade
include /app/modules/states/configuration/caches/near-cache-client.jade
include /app/modules/states/configuration/caches/near-cache-server.jade
[36/50] [abbrv] ignite git commit: updated 'setCollocated' flag
documentation
Posted by ag...@apache.org.
updated 'setCollocated' flag documentation
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1f358db1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1f358db1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1f358db1
Branch: refs/heads/ignite-3477
Commit: 1f358db1eb3c9a28dd1a66042539796c1ef5ac45
Parents: ff0caf8
Author: Denis Magda <dm...@gridgain.com>
Authored: Wed Jan 11 13:43:39 2017 -0800
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Jan 11 13:43:39 2017 -0800
----------------------------------------------------------------------
.../java/org/apache/ignite/cache/query/SqlFieldsQuery.java | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1f358db1/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java b/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java
index 9b17e78..eac8cfc 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java
@@ -164,6 +164,12 @@ public class SqlFieldsQuery extends Query<List<?>> {
/**
* Sets flag defining if this query is collocated.
*
+ * Collocation flag is used for optimization purposes of queries with GROUP BY statements.
+ * Whenever Ignite executes a distributed query, it sends sub-queries to individual cluster members.
+ * If you know in advance that the elements of your query selection are collocated together on the same node and
+ * you group by collocated key (primary or affinity key), then Ignite can make significant performance and network
+ * optimizations by grouping data on remote nodes.
+ *
* @param collocated Flag value.
* @return {@code this} For chaining.
*/
[03/50] [abbrv] ignite git commit: 2.0.0-SNAPSHOT
Posted by ag...@apache.org.
2.0.0-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/10b2b97a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/10b2b97a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/10b2b97a
Branch: refs/heads/ignite-3477
Commit: 10b2b97a38cf52e480785ebb041f51e562666ad6
Parents: 32d2629
Author: Ignite Teamcity <ig...@apache.org>
Authored: Tue Dec 27 14:04:05 2016 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Tue Dec 27 14:04:05 2016 +0300
----------------------------------------------------------------------
modules/platforms/cpp/configure.ac | 2 +-
modules/platforms/cpp/configure.acrel | 2 +-
modules/platforms/cpp/examples/configure.ac | 2 +-
modules/platforms/cpp/odbc/install/ignite-odbc-amd64.wxs | 2 +-
modules/platforms/cpp/odbc/install/ignite-odbc-x86.wxs | 2 +-
.../dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs | 4 ++--
.../Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs | 4 ++--
.../Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs | 4 ++--
.../Properties/AssemblyInfo.cs | 4 ++--
.../Apache.Ignite.EntityFramework/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.Log4Net/Properties/AssemblyInfo.cs | 4 ++--
.../dotnet/Apache.Ignite.NLog/Properties/AssemblyInfo.cs | 4 ++--
.../platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs | 4 ++--
.../examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs | 4 ++--
.../Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs | 4 ++--
20 files changed, 35 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/cpp/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/configure.ac b/modules/platforms/cpp/configure.ac
index 0c1f731..3c98225 100644
--- a/modules/platforms/cpp/configure.ac
+++ b/modules/platforms/cpp/configure.ac
@@ -19,7 +19,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++], [2.0.0.16263], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++], [2.0.0.16694], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
AC_CANONICAL_HOST
AC_CONFIG_MACRO_DIR([m4])
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/cpp/configure.acrel
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/configure.acrel b/modules/platforms/cpp/configure.acrel
index 9a0d87f..f73b57c 100644
--- a/modules/platforms/cpp/configure.acrel
+++ b/modules/platforms/cpp/configure.acrel
@@ -19,7 +19,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++], [2.0.0.16263], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++], [2.0.0.16694], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
AC_CANONICAL_HOST
AC_CONFIG_MACRO_DIR([m4])
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/cpp/examples/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/configure.ac b/modules/platforms/cpp/examples/configure.ac
index d167cf0..e15d186 100644
--- a/modules/platforms/cpp/examples/configure.ac
+++ b/modules/platforms/cpp/examples/configure.ac
@@ -19,7 +19,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([Apache Ignite C++ Examples], [2.0.0.16263], [dev@ignite.apache.org], [ignite-examples], [ignite.apache.org])
+AC_INIT([Apache Ignite C++ Examples], [2.0.0.16694], [dev@ignite.apache.org], [ignite-examples], [ignite.apache.org])
AC_CANONICAL_HOST
AC_CONFIG_MACRO_DIR([m4])
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/cpp/odbc/install/ignite-odbc-amd64.wxs
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/install/ignite-odbc-amd64.wxs b/modules/platforms/cpp/odbc/install/ignite-odbc-amd64.wxs
index 6ec1c31..eadbe88 100644
--- a/modules/platforms/cpp/odbc/install/ignite-odbc-amd64.wxs
+++ b/modules/platforms/cpp/odbc/install/ignite-odbc-amd64.wxs
@@ -21,7 +21,7 @@
<Product Name='Apache Ignite ODBC 64-bit Driver' Manufacturer='The Apache Software Foundation'
Id='F3E308E4-910C-4AF5-82DE-2ACF4D64830E'
UpgradeCode='1D7AEFDF-6CD2-4FB5-88F2-811A89832D6D'
- Language='1033' Codepage='1252' Version='2.0.0.16263'>
+ Language='1033' Codepage='1252' Version='2.0.0.16694'>
<Package Id='*' Keywords='Installer' Description="Apache Ignite ODBC 64-bit Driver Installer"
Comments='Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are trademarks of The Apache Software Foundation.'
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/cpp/odbc/install/ignite-odbc-x86.wxs
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/install/ignite-odbc-x86.wxs b/modules/platforms/cpp/odbc/install/ignite-odbc-x86.wxs
index c1aeca6..b50b5a3 100644
--- a/modules/platforms/cpp/odbc/install/ignite-odbc-x86.wxs
+++ b/modules/platforms/cpp/odbc/install/ignite-odbc-x86.wxs
@@ -21,7 +21,7 @@
<Product Name='Apache Ignite ODBC 32-bit Driver' Manufacturer='The Apache Software Foundation'
Id='D39CBABA-1E21-4701-AA5C-91EDA07B383B'
UpgradeCode='743902A4-365C-424E-B226-5B2898A3941E'
- Language='1033' Codepage='1252' Version='2.0.0.16263'>
+ Language='1033' Codepage='1252' Version='2.0.0.16694'>
<Package Id='*' Keywords='Installer' Description="Apache Ignite ODBC 32-bit Driver Installer"
Comments='Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are trademarks of The Apache Software Foundation.'
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
index d152218..1bca0e8 100644
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/Properties/AssemblyInfo.cs
@@ -35,8 +35,8 @@ using System.Runtime.InteropServices;
[assembly: Guid("18ea4c71-a11d-4ab1-8042-418f7559d84f")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: CLSCompliant(true)]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
index ce5fcbb..0926a46 100644
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet/Properties/AssemblyInfo.cs
@@ -33,8 +33,8 @@ using System.Runtime.InteropServices;
[assembly: Guid("13ea96fc-cc83-4164-a7c0-4f30ed797460")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: CLSCompliant(true)]
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
index 5685f78..7da0a1d 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
[assembly: Guid("8fae8395-7e91-411a-a78f-44d6d3fed0fc")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs
index cfb16a8..b7d8e09 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs
@@ -30,6 +30,6 @@ using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
[assembly: Guid("134707f6-155d-47f6-9eb2-c67abbf3c009")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
index 9c55a10..26caa82 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
@@ -45,6 +45,6 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
index 8010712..1fc6c59 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
[assembly: Guid("de8dd5cc-7c7f-4a09-80d5-7086d9416a7b")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
index 666c2fc..c0462db 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
@@ -33,8 +33,8 @@ using System.Runtime.InteropServices;
[assembly: Guid("97db45a8-f922-456a-a819-7b3c6e5e03ba")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: CLSCompliant(true)]
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Properties/AssemblyInfo.cs
index c7fada9..8aeec58 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework.Tests/Properties/AssemblyInfo.cs
@@ -32,8 +32,8 @@ using System.Runtime.InteropServices;
[assembly: Guid("cda5700e-78f3-4a9e-a9b0-704cbe94651c")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: CLSCompliant(true)]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Properties/AssemblyInfo.cs
index 3454f61..5346eba 100644
--- a/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.EntityFramework/Properties/AssemblyInfo.cs
@@ -32,8 +32,8 @@ using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
[assembly: Guid("c558518a-c1a0-4224-aaa9-a8688474b4dc")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: CLSCompliant(true)]
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs
index 29b1620..a1dae5e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs
@@ -33,8 +33,8 @@ using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5b571661-17f4-4f29-8c7d-0edb38ca9b55")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: CLSCompliant(true)]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/Apache.Ignite.Log4Net/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Log4Net/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.Log4Net/Properties/AssemblyInfo.cs
index 9b8eedc..cc37917 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Log4Net/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Log4Net/Properties/AssemblyInfo.cs
@@ -33,8 +33,8 @@ using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6f82d669-382e-4435-8092-68c4440146d8")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: CLSCompliant(true)]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/Apache.Ignite.NLog/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.NLog/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite.NLog/Properties/AssemblyInfo.cs
index 943065d..2f0d89f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.NLog/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.NLog/Properties/AssemblyInfo.cs
@@ -33,8 +33,8 @@ using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c6b58e4a-a2e9-4554-ad02-68ce6da5cfb7")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: CLSCompliant(true)]
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
index d8a8578..97a78d5 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
[assembly: Guid("0f9702ec-da7d-4ce5-b4b7-73310c885355")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
index ed09c6d..a75ee0e 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
[assembly: Guid("41a0cb95-3435-4c78-b867-900b28e2c9ee")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b2b97a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
index 1dc3bef..cc78a5c 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
[assembly: Guid("ce65ec7c-d3cf-41ad-8f45-f90d5af68d77")]
-[assembly: AssemblyVersion("2.0.0.16263")]
-[assembly: AssemblyFileVersion("2.0.0.16263")]
+[assembly: AssemblyVersion("2.0.0.16694")]
+[assembly: AssemblyFileVersion("2.0.0.16694")]
[assembly: AssemblyInformationalVersion("2.0.0")]
\ No newline at end of file
[29/50] [abbrv] ignite git commit: IGNITE-4412 fix NLogLoggerTest
thread safety issue
Posted by ag...@apache.org.
IGNITE-4412 fix NLogLoggerTest thread safety issue
This closes #1401
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bf118aad
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bf118aad
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bf118aad
Branch: refs/heads/ignite-3477
Commit: bf118aad8d8251144062d97c476fbe5f817d8018
Parents: d2e6007
Author: Sergey Stronchinskiy <se...@kraftvaerk.com>
Authored: Mon Jan 9 15:36:11 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Mon Jan 9 15:36:11 2017 +0300
----------------------------------------------------------------------
.../Apache.Ignite.Core.Tests.csproj | 1 +
.../Log/ConcurrentMemoryTarget.cs | 73 ++++++++++++++++++++
.../Log/NLogLoggerTest.cs | 5 +-
3 files changed, 76 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/bf118aad/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
index 5948593..55adfe4 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
@@ -77,6 +77,7 @@
<Compile Include="Collections\ReadOnlyCollectionTest.cs" />
<Compile Include="Collections\ReadOnlyDictionaryTest.cs" />
<Compile Include="Common\IgniteGuidTest.cs" />
+ <Compile Include="Log\ConcurrentMemoryTarget.cs" />
<Compile Include="Log\DefaultLoggerTest.cs" />
<Compile Include="Log\Log4NetLoggerTest.cs" />
<Compile Include="Log\NLogLoggerTest.cs" />
http://git-wip-us.apache.org/repos/asf/ignite/blob/bf118aad/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Log/ConcurrentMemoryTarget.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Log/ConcurrentMemoryTarget.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Log/ConcurrentMemoryTarget.cs
new file mode 100644
index 0000000..66bdbe2
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Log/ConcurrentMemoryTarget.cs
@@ -0,0 +1,73 @@
+\ufeff/*
+ * 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.
+ */
+
+namespace Apache.Ignite.Core.Tests.Log
+{
+ using System.Collections.Generic;
+ using System.Linq;
+ using global::NLog;
+ using global::NLog.Targets;
+
+ /// <summary>
+ /// NLog target which supports logging from multiple threads.
+ /// </summary>
+ public class ConcurrentMemoryTarget : TargetWithLayout
+ {
+ /// <summary> Object used for locking. </summary>
+ private readonly object _locker = new object();
+
+ /// <summary> Logs. </summary>
+ private readonly IList<string> _logs;
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ConcurrentMemoryTarget" /> class.
+ /// </summary>
+ public ConcurrentMemoryTarget()
+ {
+ _logs = new List<string>();
+ Name = "ConcurrentMemoryTarget";
+ }
+
+ /// <summary>
+ /// Gets the collection of logs gathered in the <see cref="ConcurrentMemoryTarget" />.
+ /// </summary>
+ public IEnumerable<string> Logs
+ {
+ get
+ {
+ lock (_locker)
+ {
+ return _logs.ToList();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Renders the logging event message and adds it to the internal ArrayList of log messages.
+ /// </summary>
+ /// <param name="logEvent">The logging event.</param>
+ protected override void Write(LogEventInfo logEvent)
+ {
+ lock (_locker)
+ {
+ var msg = Layout.Render(logEvent);
+
+ _logs.Add(msg);
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/bf118aad/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Log/NLogLoggerTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Log/NLogLoggerTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Log/NLogLoggerTest.cs
index 7806ecd..2743353 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Log/NLogLoggerTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Log/NLogLoggerTest.cs
@@ -25,7 +25,6 @@ namespace Apache.Ignite.Core.Tests.Log
using global::NLog;
using global::NLog.Config;
using global::NLog.Layouts;
- using global::NLog.Targets;
using NUnit.Framework;
using LogLevel = Apache.Ignite.Core.Log.LogLevel;
@@ -35,7 +34,7 @@ namespace Apache.Ignite.Core.Tests.Log
public class NLogLoggerTest
{
/** */
- private MemoryTarget _logTarget;
+ private ConcurrentMemoryTarget _logTarget;
/// <summary>
/// Test set up.
@@ -45,7 +44,7 @@ namespace Apache.Ignite.Core.Tests.Log
{
var cfg = new LoggingConfiguration();
- _logTarget = new MemoryTarget("mem")
+ _logTarget = new ConcurrentMemoryTarget
{
Layout = new SimpleLayout("${Logger}|${Level}|${Message}|${exception}|${all-event-properties}")
};
[37/50] [abbrv] ignite git commit: IGNITE-4531: SQL: Use correct
property name in BinaryProperty. This closes 1419.
Posted by ag...@apache.org.
IGNITE-4531: SQL: Use correct property name in BinaryProperty. This closes 1419.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/abc8b909
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/abc8b909
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/abc8b909
Branch: refs/heads/ignite-3477
Commit: abc8b9091e9eda8cc43f398939bf1fb6035f7a3f
Parents: 1f358db
Author: Alexander Paschenko <al...@gmail.com>
Authored: Thu Jan 12 10:50:14 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Jan 12 10:50:14 2017 +0300
----------------------------------------------------------------------
.../processors/query/GridQueryProcessor.java | 2 +-
...IgniteCacheAbstractInsertSqlQuerySelfTest.java | 14 +++++++-------
.../IgniteCacheAbstractSqlDmlQuerySelfTest.java | 6 +++---
.../cache/IgniteCacheInsertSqlQuerySelfTest.java | 18 ++++++++++--------
.../cache/IgniteCacheMergeSqlQuerySelfTest.java | 14 +++++++-------
.../cache/IgniteCacheUpdateSqlQuerySelfTest.java | 4 ++--
6 files changed, 30 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/abc8b909/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 58f94f4..3286bac 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -2147,7 +2147,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
if (!(obj instanceof BinaryObjectBuilder))
throw new UnsupportedOperationException("Individual properties can be set for binary builders only");
- setValue0((BinaryObjectBuilder) obj, name(), propVal, type());
+ setValue0((BinaryObjectBuilder) obj, propName, propVal, type());
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/abc8b909/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractInsertSqlQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractInsertSqlQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractInsertSqlQuerySelfTest.java
index df4259e..86d01c7 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractInsertSqlQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractInsertSqlQuerySelfTest.java
@@ -151,7 +151,7 @@ public abstract class IgniteCacheAbstractInsertSqlQuerySelfTest extends GridComm
LinkedHashMap<String, String> flds = new LinkedHashMap<>();
flds.put("id", Integer.class.getName());
- flds.put("name", String.class.getName());
+ flds.put("firstName", String.class.getName());
s2p.setFields(flds);
@@ -172,7 +172,7 @@ public abstract class IgniteCacheAbstractInsertSqlQuerySelfTest extends GridComm
LinkedHashMap<String, String> flds = new LinkedHashMap<>();
flds.put("id", Integer.class.getName());
- flds.put("name", String.class.getName());
+ flds.put("firstName", String.class.getName());
i2p.setFields(flds);
@@ -194,7 +194,7 @@ public abstract class IgniteCacheAbstractInsertSqlQuerySelfTest extends GridComm
flds.put("key", Integer.class.getName());
flds.put("id", Integer.class.getName());
- flds.put("name", String.class.getName());
+ flds.put("firstName", String.class.getName());
k2p.setFields(flds);
@@ -216,7 +216,7 @@ public abstract class IgniteCacheAbstractInsertSqlQuerySelfTest extends GridComm
flds.put("Id", Integer.class.getName());
flds.put("id", Integer.class.getName());
- flds.put("name", String.class.getName());
+ flds.put("firstName", String.class.getName());
flds.put("IntVal", Integer.class.getName());
k22p.setFields(flds);
@@ -240,7 +240,7 @@ public abstract class IgniteCacheAbstractInsertSqlQuerySelfTest extends GridComm
flds.put("key", Integer.class.getName());
flds.put("strKey", String.class.getName());
flds.put("id", Integer.class.getName());
- flds.put("name", String.class.getName());
+ flds.put("firstName", String.class.getName());
k32p.setFields(flds);
@@ -263,7 +263,7 @@ public abstract class IgniteCacheAbstractInsertSqlQuerySelfTest extends GridComm
flds.put("key", Integer.class.getName());
flds.put("strKey", String.class.getName());
flds.put("id", Integer.class.getName());
- flds.put("name", String.class.getName());
+ flds.put("firstName", String.class.getName());
k42p.setFields(flds);
@@ -515,7 +515,7 @@ public abstract class IgniteCacheAbstractInsertSqlQuerySelfTest extends GridComm
protected int id;
/** */
- @QuerySqlField
+ @QuerySqlField(name = "firstName")
protected String name;
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/abc8b909/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java
index 7f79ec4..649012f 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java
@@ -139,7 +139,7 @@ public abstract class IgniteCacheAbstractSqlDmlQuerySelfTest extends GridCommonA
BinaryObjectBuilder bldr = ignite(0).binary().builder("Person");
bldr.setField("id", id);
- bldr.setField("name", name);
+ bldr.setField("firstName", name);
bldr.setField("secondName", secondName);
return bldr.build();
@@ -186,7 +186,7 @@ public abstract class IgniteCacheAbstractSqlDmlQuerySelfTest extends GridCommonA
LinkedHashMap<String, String> flds = new LinkedHashMap<>();
flds.put("id", Integer.class.getName());
- flds.put("name", String.class.getName());
+ flds.put("firstName", String.class.getName());
flds.put("secondName", String.class.getName());
e.setFields(flds);
@@ -214,7 +214,7 @@ public abstract class IgniteCacheAbstractSqlDmlQuerySelfTest extends GridCommonA
protected int id;
/** */
- @QuerySqlField
+ @QuerySqlField(name = "firstName")
protected final String name;
/** */
http://git-wip-us.apache.org/repos/asf/ignite/blob/abc8b909/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInsertSqlQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInsertSqlQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInsertSqlQuerySelfTest.java
index 04a352f..e9c21dc 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInsertSqlQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInsertSqlQuerySelfTest.java
@@ -56,7 +56,7 @@ public class IgniteCacheInsertSqlQuerySelfTest extends IgniteCacheAbstractInsert
public void testInsertWithExplicitKey() {
IgniteCache<String, Person> p = ignite(0).cache("S2P").withKeepBinary();
- p.query(new SqlFieldsQuery("insert into Person (_key, id, name) values ('s', ?, ?), " +
+ p.query(new SqlFieldsQuery("insert into Person (_key, id, firstName) values ('s', ?, ?), " +
"('a', 2, 'Alex')").setArgs(1, "Sergi"));
assertEquals(createPerson(1, "Sergi"), p.get("s"));
@@ -76,7 +76,7 @@ public class IgniteCacheInsertSqlQuerySelfTest extends IgniteCacheAbstractInsert
assertEquals("Sergi", p.get("s"));
assertEquals("Alex", p.get("a"));
- p.query(new SqlFieldsQuery("insert into Person(_key, id, name) " +
+ p.query(new SqlFieldsQuery("insert into Person(_key, id, firstName) " +
"(select substring(lower(_val), 0, 2), cast(length(_val) as int), _val from String)"));
assertEquals(createPerson(5, "Sergi"), p.get("se"));
@@ -91,7 +91,7 @@ public class IgniteCacheInsertSqlQuerySelfTest extends IgniteCacheAbstractInsert
IgniteCache<Integer, Person> p = ignite(0).cache("I2P").withKeepBinary();
p.query(new SqlFieldsQuery(
- "insert into Person (_key, id, name) values (cast('1' as int), ?, ?), (2, (5 - 3), 'Alex')")
+ "insert into Person (_key, id, firstName) values (cast('1' as int), ?, ?), (2, (5 - 3), 'Alex')")
.setArgs(1, "Sergi"));
assertEquals(createPerson(1, "Sergi"), p.get(1));
@@ -106,7 +106,7 @@ public class IgniteCacheInsertSqlQuerySelfTest extends IgniteCacheAbstractInsert
IgniteCache<Key, Person> p = ignite(0).cache("K2P").withKeepBinary();
p.query(new SqlFieldsQuery(
- "insert into Person (key, id, name) values (1, ?, ?), (2, 2, 'Alex')").setArgs(1, "Sergi"));
+ "insert into Person (key, id, firstName) values (1, ?, ?), (2, 2, 'Alex')").setArgs(1, "Sergi"));
assertEquals(createPerson(1, "Sergi"), p.get(new Key(1)));
@@ -119,8 +119,8 @@ public class IgniteCacheInsertSqlQuerySelfTest extends IgniteCacheAbstractInsert
public void testFieldsCaseSensitivity() {
IgniteCache<Key2, Person> p = ignite(0).cache("K22P").withKeepBinary();
- p.query(new SqlFieldsQuery("insert into \"Person2\" (\"Id\", \"id\", \"name\", \"IntVal\") values (1, ?, ?, 5), " +
- "(2, 3, 'Alex', 6)").setArgs(4, "Sergi"));
+ p.query(new SqlFieldsQuery("insert into \"Person2\" (\"Id\", \"id\", \"firstName\", \"IntVal\") " +
+ "values (1, ?, ?, 5), (2, 3, 'Alex', 6)").setArgs(4, "Sergi"));
assertEquals(createPerson2(4, "Sergi", 5), p.get(new Key2(1)));
@@ -177,7 +177,8 @@ public class IgniteCacheInsertSqlQuerySelfTest extends IgniteCacheAbstractInsert
IgniteCache<Key3, Person> p = ignite(0).cache("K32P").withKeepBinary();
p.query(new SqlFieldsQuery(
- "insert into Person (key, strKey, id, name) values (1, 'aa', ?, ?), (2, 'bb', 2, 'Alex')").setArgs(1, "Sergi"));
+ "insert into Person (key, strKey, id, firstName) values (1, 'aa', ?, ?), (2, 'bb', 2, 'Alex')")
+ .setArgs(1, "Sergi"));
assertEquals(createPerson(1, "Sergi"), p.get(new Key3(1)));
@@ -194,7 +195,8 @@ public class IgniteCacheInsertSqlQuerySelfTest extends IgniteCacheAbstractInsert
IgniteCache<Key4, Person> p = ignite(0).cache("K42P").withKeepBinary();
p.query(new SqlFieldsQuery(
- "insert into Person (key, strKey, id, name) values (1, 'aa', ?, ?), (2, 'bb', 2, 'Alex')").setArgs(1, "Sergi"));
+ "insert into Person (key, strKey, id, firstName) values (1, 'aa', ?, ?), (2, 'bb', 2, 'Alex')")
+ .setArgs(1, "Sergi"));
assertEquals(createPerson(1, "Sergi"), p.get(new Key4(1)));
http://git-wip-us.apache.org/repos/asf/ignite/blob/abc8b909/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheMergeSqlQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheMergeSqlQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheMergeSqlQuerySelfTest.java
index 0ff3fda..58d07af 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheMergeSqlQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheMergeSqlQuerySelfTest.java
@@ -32,7 +32,7 @@ public class IgniteCacheMergeSqlQuerySelfTest extends IgniteCacheAbstractInsertS
public void testMergeWithExplicitKey() {
IgniteCache<String, Person> p = ignite(0).cache("S2P").withKeepBinary();
- p.query(new SqlFieldsQuery("merge into Person (_key, id, name) values ('s', ?, ?), " +
+ p.query(new SqlFieldsQuery("merge into Person (_key, id, firstName) values ('s', ?, ?), " +
"('a', 2, 'Alex')").setArgs(1, "Sergi"));
assertEquals(createPerson(1, "Sergi"), p.get("s"));
@@ -52,7 +52,7 @@ public class IgniteCacheMergeSqlQuerySelfTest extends IgniteCacheAbstractInsertS
assertEquals("Sergi", p.get("s"));
assertEquals("Alex", p.get("a"));
- p.query(new SqlFieldsQuery("merge into Person(_key, id, name) " +
+ p.query(new SqlFieldsQuery("merge into Person(_key, id, firstName) " +
"(select substring(lower(_val), 0, 2), cast(length(_val) as int), _val from String)"));
assertEquals(createPerson(5, "Sergi"), p.get("se"));
@@ -67,7 +67,7 @@ public class IgniteCacheMergeSqlQuerySelfTest extends IgniteCacheAbstractInsertS
IgniteCache<Integer, Person> p = ignite(0).cache("I2P").withKeepBinary();
p.query(new SqlFieldsQuery(
- "merge into Person (_key, id, name) values (cast(? as int), ?, ?), (2, (5 - 3), 'Alex')")
+ "merge into Person (_key, id, firstName) values (cast(? as int), ?, ?), (2, (5 - 3), 'Alex')")
.setArgs("1", 1, "Sergi"));
assertEquals(createPerson(1, "Sergi"), p.get(1));
@@ -82,7 +82,7 @@ public class IgniteCacheMergeSqlQuerySelfTest extends IgniteCacheAbstractInsertS
IgniteCache<Key, Person> p = ignite(0).cache("K2P").withKeepBinary();
p.query(new SqlFieldsQuery(
- "merge into Person (key, id, name) values (1, ?, ?), (2, 2, 'Alex')").setArgs(1, "Sergi"));
+ "merge into Person (key, id, firstName) values (1, ?, ?), (2, 2, 'Alex')").setArgs(1, "Sergi"));
assertEquals(createPerson(1, "Sergi"), p.get(new Key(1)));
@@ -95,7 +95,7 @@ public class IgniteCacheMergeSqlQuerySelfTest extends IgniteCacheAbstractInsertS
public void testFieldsCaseSensitivity() {
IgniteCache<Key2, Person> p = ignite(0).cache("K22P").withKeepBinary();
- p.query(new SqlFieldsQuery("merge into \"Person2\" (\"Id\", \"id\", \"name\", \"IntVal\") values (1, ?, ?, 5), " +
+ p.query(new SqlFieldsQuery("merge into \"Person2\" (\"Id\", \"id\", \"firstName\", \"IntVal\") values (1, ?, ?, 5), " +
"(2, 3, 'Alex', 6)").setArgs(4, "Sergi"));
assertEquals(createPerson2(4, "Sergi", 5), p.get(new Key2(1)));
@@ -127,7 +127,7 @@ public class IgniteCacheMergeSqlQuerySelfTest extends IgniteCacheAbstractInsertS
IgniteCache<Key3, Person> p = ignite(0).cache("K32P").withKeepBinary();
p.query(new SqlFieldsQuery(
- "merge into Person (key, strKey, id, name) values (1, 'aa', ?, ?), (2, 'bb', 2, 'Alex')").setArgs(1, "Sergi"));
+ "merge into Person (key, strKey, id, firstName) values (1, 'aa', ?, ?), (2, 'bb', 2, 'Alex')").setArgs(1, "Sergi"));
assertEquals(createPerson(1, "Sergi"), p.get(new Key3(1)));
@@ -144,7 +144,7 @@ public class IgniteCacheMergeSqlQuerySelfTest extends IgniteCacheAbstractInsertS
IgniteCache<Key4, Person> p = ignite(0).cache("K42P").withKeepBinary();
p.query(new SqlFieldsQuery(
- "merge into Person (key, strKey, id, name) values (1, 'aa', ?, ?), (2, 'bb', 2, 'Alex')").setArgs(1, "Sergi"));
+ "merge into Person (key, strKey, id, firstName) values (1, 'aa', ?, ?), (2, 'bb', 2, 'Alex')").setArgs(1, "Sergi"));
assertEquals(createPerson(1, "Sergi"), p.get(new Key4(1)));
http://git-wip-us.apache.org/repos/asf/ignite/blob/abc8b909/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUpdateSqlQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUpdateSqlQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUpdateSqlQuerySelfTest.java
index 332a082..58bcaac 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUpdateSqlQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUpdateSqlQuerySelfTest.java
@@ -61,8 +61,8 @@ public class IgniteCacheUpdateSqlQuerySelfTest extends IgniteCacheAbstractSqlDml
public void testUpdateSimple() {
IgniteCache p = cache();
- QueryCursor<List<?>> c = p.query(new SqlFieldsQuery("update Person p set p.id = p.id * 2, p.name = " +
- "substring(p.name, 0, 2) where length(p._key) = ? or p.secondName like ?").setArgs(2, "%ite"));
+ QueryCursor<List<?>> c = p.query(new SqlFieldsQuery("update Person p set p.id = p.id * 2, p.firstName = " +
+ "substring(p.firstName, 0, 2) where length(p._key) = ? or p.secondName like ?").setArgs(2, "%ite"));
c.iterator();
[19/50] [abbrv] ignite git commit: For communication spi disabled
pairedConnections by default,
implemented NIO sessions balancing for this mode.
Posted by ag...@apache.org.
For communication spi disabled pairedConnections by default, implemented NIO sessions balancing for this mode.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/da5b68cc
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/da5b68cc
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/da5b68cc
Branch: refs/heads/ignite-3477
Commit: da5b68cc89ba6eeff25beb66e3a4d8c2b9871ab3
Parents: 864a95e
Author: sboikov <sb...@gridgain.com>
Authored: Thu Dec 29 15:46:59 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Dec 29 15:46:59 2016 +0300
----------------------------------------------------------------------
.../ignite/internal/util/nio/GridNioServer.java | 159 ++++++++++++++++---
.../communication/tcp/TcpCommunicationSpi.java | 20 +--
.../tcp/TcpCommunicationSpiMBean.java | 5 +-
...mmunicationBalancePairedConnectionsTest.java | 28 ++++
.../IgniteCommunicationBalanceTest.java | 25 ++-
...cMessageRecoveryNoPairedConnectionsTest.java | 47 ------
...micMessageRecoveryPairedConnectionsTest.java | 47 ++++++
.../ignite/testsuites/IgniteCacheTestSuite.java | 6 +-
8 files changed, 250 insertions(+), 87 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/da5b68cc/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
index bc1f173..a59adba 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
@@ -227,6 +227,9 @@ public class GridNioServer<T> {
/** */
private final IgniteRunnable balancer;
+ /** */
+ private final boolean readWriteSelectorsAssign;
+
/**
* @param addr Address.
* @param port Port.
@@ -250,7 +253,7 @@ public class GridNioServer<T> {
* @param writerFactory Writer factory.
* @param skipRecoveryPred Skip recovery predicate.
* @param msgQueueLsnr Message queue size listener.
- * @param balancing NIO sessions balancing flag.
+ * @param readWriteSelectorsAssign If {@code true} then in/out connections are assigned to even/odd workers.
* @param filters Filters for this server.
* @throws IgniteCheckedException If failed.
*/
@@ -275,7 +278,7 @@ public class GridNioServer<T> {
GridNioMessageWriterFactory writerFactory,
IgnitePredicate<Message> skipRecoveryPred,
IgniteBiInClosure<GridNioSession, Integer> msgQueueLsnr,
- boolean balancing,
+ boolean readWriteSelectorsAssign,
GridNioFilter... filters
) throws IgniteCheckedException {
if (port != -1)
@@ -300,6 +303,7 @@ public class GridNioServer<T> {
this.sndQueueLimit = sndQueueLimit;
this.msgQueueLsnr = msgQueueLsnr;
this.selectorSpins = selectorSpins;
+ this.readWriteSelectorsAssign = readWriteSelectorsAssign;
filterChain = new GridNioFilterChain<>(log, lsnr, new HeadFilter(), filters);
@@ -359,10 +363,16 @@ public class GridNioServer<T> {
IgniteRunnable balancer0 = null;
- if (balancing && balancePeriod > 0) {
+ if (balancePeriod > 0) {
boolean rndBalance = IgniteSystemProperties.getBoolean(IGNITE_IO_BALANCE_RANDOM_BALANCE, false);
- balancer0 = rndBalance ? new RandomBalancer() : new SizeBasedBalancer(balancePeriod);
+ if (rndBalance)
+ balancer0 = new RandomBalancer();
+ else {
+ balancer0 = readWriteSelectorsAssign ?
+ new ReadWriteSizeBasedBalancer(balancePeriod) :
+ new SizeBasedBalancer(balancePeriod);
+ }
}
this.balancer = balancer0;
@@ -823,21 +833,31 @@ public class GridNioServer<T> {
int balanceIdx;
if (workers > 1) {
- if (req.accepted()) {
- balanceIdx = readBalanceIdx;
+ if (readWriteSelectorsAssign) {
+ if (req.accepted()) {
+ balanceIdx = readBalanceIdx;
- readBalanceIdx += 2;
+ readBalanceIdx += 2;
- if (readBalanceIdx >= workers)
- readBalanceIdx = 0;
+ if (readBalanceIdx >= workers)
+ readBalanceIdx = 0;
+ }
+ else {
+ balanceIdx = writeBalanceIdx;
+
+ writeBalanceIdx += 2;
+
+ if (writeBalanceIdx >= workers)
+ writeBalanceIdx = 1;
+ }
}
else {
- balanceIdx = writeBalanceIdx;
+ balanceIdx = readBalanceIdx;
- writeBalanceIdx += 2;
+ readBalanceIdx++;
- if (writeBalanceIdx >= workers)
- writeBalanceIdx = 1;
+ if (readBalanceIdx >= workers)
+ readBalanceIdx = 0;
}
}
else
@@ -3124,8 +3144,8 @@ public class GridNioServer<T> {
/** */
private long selectorSpins;
- /** NIO sessions balancing flag. */
- private boolean balancing;
+ /** */
+ private boolean readWriteSelectorsAssign;
/**
* Finishes building the instance.
@@ -3155,7 +3175,7 @@ public class GridNioServer<T> {
writerFactory,
skipRecoveryPred,
msgQueueLsnr,
- balancing,
+ readWriteSelectorsAssign,
filters != null ? Arrays.copyOf(filters, filters.length) : EMPTY_FILTERS
);
@@ -3169,11 +3189,11 @@ public class GridNioServer<T> {
}
/**
- * @param balancing NIO sessions balancing flag.
+ * @param readWriteSelectorsAssign {@code True} to assign in/out connections even/odd workers.
* @return This for chaining.
*/
- public Builder<T> balancing(boolean balancing) {
- this.balancing = balancing;
+ public Builder<T> readWriteSelectorsAssign(boolean readWriteSelectorsAssign) {
+ this.readWriteSelectorsAssign = readWriteSelectorsAssign;
return this;
}
@@ -3415,7 +3435,7 @@ public class GridNioServer<T> {
/**
*
*/
- private class SizeBasedBalancer implements IgniteRunnable {
+ private class ReadWriteSizeBasedBalancer implements IgniteRunnable {
/** */
private static final long serialVersionUID = 0L;
@@ -3428,7 +3448,7 @@ public class GridNioServer<T> {
/**
* @param balancePeriod Period.
*/
- SizeBasedBalancer(long balancePeriod) {
+ ReadWriteSizeBasedBalancer(long balancePeriod) {
this.balancePeriod = balancePeriod;
}
@@ -3559,6 +3579,100 @@ public class GridNioServer<T> {
}
/**
+ *
+ */
+ private class SizeBasedBalancer implements IgniteRunnable {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** */
+ private long lastBalance;
+
+ /** */
+ private final long balancePeriod;
+
+ /**
+ * @param balancePeriod Period.
+ */
+ SizeBasedBalancer(long balancePeriod) {
+ this.balancePeriod = balancePeriod;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void run() {
+ long now = U.currentTimeMillis();
+
+ if (lastBalance + balancePeriod < now) {
+ lastBalance = now;
+
+ long maxBytes0 = -1, minBytes0 = -1;
+ int maxBytesIdx = -1, minBytesIdx = -1;
+
+ for (int i = 0; i < clientWorkers.size(); i++) {
+ GridNioServer.AbstractNioClientWorker worker = clientWorkers.get(i);
+
+ int sesCnt = worker.workerSessions.size();
+
+ long bytes0 = worker.bytesRcvd0 + worker.bytesSent0;
+
+ if ((maxBytes0 == -1 || bytes0 > maxBytes0) && bytes0 > 0 && sesCnt > 1) {
+ maxBytes0 = bytes0;
+ maxBytesIdx = i;
+ }
+
+ if (minBytes0 == -1 || bytes0 < minBytes0) {
+ minBytes0 = bytes0;
+ minBytesIdx = i;
+ }
+ }
+
+ if (log.isDebugEnabled())
+ log.debug("Balancing data [min0=" + minBytes0 + ", minIdx=" + minBytesIdx +
+ ", max0=" + maxBytes0 + ", maxIdx=" + maxBytesIdx + ']');
+
+ if (maxBytes0 != -1 && minBytes0 != -1) {
+ GridSelectorNioSessionImpl ses = null;
+
+ long bytesDiff = maxBytes0 - minBytes0;
+ long delta = bytesDiff;
+ double threshold = bytesDiff * 0.9;
+
+ GridConcurrentHashSet<GridSelectorNioSessionImpl> sessions =
+ clientWorkers.get(maxBytesIdx).workerSessions;
+
+ for (GridSelectorNioSessionImpl ses0 : sessions) {
+ long bytesSent0 = ses0.bytesSent0();
+
+ if (bytesSent0 < threshold &&
+ (ses == null || delta > U.safeAbs(bytesSent0 - bytesDiff / 2))) {
+ ses = ses0;
+ delta = U.safeAbs(bytesSent0 - bytesDiff / 2);
+ }
+ }
+
+ if (ses != null) {
+ if (log.isDebugEnabled())
+ log.debug("Will move session to less loaded worker [ses=" + ses +
+ ", from=" + maxBytesIdx + ", to=" + minBytesIdx + ']');
+
+ moveSession(ses, maxBytesIdx, minBytesIdx);
+ }
+ else {
+ if (log.isDebugEnabled())
+ log.debug("Unable to find session to move.");
+ }
+ }
+
+ for (int i = 0; i < clientWorkers.size(); i++) {
+ GridNioServer.AbstractNioClientWorker worker = clientWorkers.get(i);
+
+ worker.reset0();
+ }
+ }
+ }
+ }
+
+ /**
* For tests only.
*/
@SuppressWarnings("unchecked")
@@ -3625,6 +3739,9 @@ public class GridNioServer<T> {
*
*/
interface SessionChangeRequest {
+ /**
+ * @return Session.
+ */
GridNioSession session();
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/da5b68cc/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index c35b5ef..ae0e6f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -293,7 +293,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
/**
* Default count of selectors for TCP server equals to
- * {@code "Math.min(8, Runtime.getRuntime().availableProcessors())"}.
+ * {@code "Math.max(4, Runtime.getRuntime().availableProcessors() / 2)"}.
*/
public static final int DFLT_SELECTORS_CNT = Math.max(4, Runtime.getRuntime().availableProcessors() / 2);
@@ -979,7 +979,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
private IpcSharedMemoryServerEndpoint shmemSrv;
/** */
- private boolean usePairedConnections = true;
+ private boolean usePairedConnections;
/** */
private int connectionsPerNode = DFLT_CONN_PER_NODE;
@@ -1193,10 +1193,8 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
* Set this to {@code false} if each connection of {@link #getConnectionsPerNode()}
* should be used for outgoing and incoming messages. In this case total number
* of connections between local and each remote node is {@link #getConnectionsPerNode()}.
- * In this case load NIO selectors load
- * balancing of {@link GridNioServer} will be disabled.
* <p>
- * Default is {@code true}.
+ * Default is {@code false}.
*
* @param usePairedConnections {@code true} to use paired connections and {@code false} otherwise.
* @see #getConnectionsPerNode()
@@ -2057,16 +2055,20 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
.writerFactory(writerFactory)
.skipRecoveryPredicate(skipRecoveryPred)
.messageQueueSizeListener(queueSizeMonitor)
- .balancing(usePairedConnections) // Current balancing logic assumes separate in/out connections.
+ .readWriteSelectorsAssign(usePairedConnections)
.build();
boundTcpPort = port;
// Ack Port the TCP server was bound to.
- if (log.isInfoEnabled())
+ if (log.isInfoEnabled()) {
log.info("Successfully bound communication NIO server to TCP port " +
- "[port=" + boundTcpPort + ", locHost=" + locHost + ", selectorsCnt=" + selectorsCnt +
- ", selectorSpins=" + srvr.selectorSpins() + ']');
+ "[port=" + boundTcpPort +
+ ", locHost=" + locHost +
+ ", selectorsCnt=" + selectorsCnt +
+ ", selectorSpins=" + srvr.selectorSpins() +
+ ", pairedConn=" + usePairedConnections + ']');
+ }
srvr.idleTimeout(idleConnTimeout);
http://git-wip-us.apache.org/repos/asf/ignite/blob/da5b68cc/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java
index c7a1a53..c56e18c 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java
@@ -51,10 +51,9 @@ public interface TcpCommunicationSpiMBean extends IgniteSpiManagementMBean {
* is {@link #getConnectionsPerNode()} * 2.
* <p>
* Returns {@code false} if each connection of {@link #getConnectionsPerNode()}
- * should be used for outgoing and incoming messages. In this case load NIO selectors load
- * balancing of {@link GridNioServer} will be disabled.
+ * should be used for outgoing and incoming messages.
* <p>
- * Default is {@code true}.
+ * Default is {@code false}.
*
* @return {@code true} to use paired connections and {@code false} otherwise.
* @see #getConnectionsPerNode()
http://git-wip-us.apache.org/repos/asf/ignite/blob/da5b68cc/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/IgniteCommunicationBalancePairedConnectionsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/IgniteCommunicationBalancePairedConnectionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/IgniteCommunicationBalancePairedConnectionsTest.java
new file mode 100644
index 0000000..4544030
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/IgniteCommunicationBalancePairedConnectionsTest.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.managers.communication;
+
+/**
+ *
+ */
+public class IgniteCommunicationBalancePairedConnectionsTest extends IgniteCommunicationBalanceTest {
+ /** {@inheritDoc} */
+ @Override protected boolean usePairedConnections() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/da5b68cc/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/IgniteCommunicationBalanceTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/IgniteCommunicationBalanceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/IgniteCommunicationBalanceTest.java
index e142aef..4271417 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/IgniteCommunicationBalanceTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/IgniteCommunicationBalanceTest.java
@@ -63,6 +63,7 @@ public class IgniteCommunicationBalanceTest extends GridCommonAbstractTest {
commSpi.setSharedMemoryPort(-1);
commSpi.setConnectionsPerNode(connectionsPerNode());
+ commSpi.setUsePairedConnections(usePairedConnections());
if (selectors > 0)
commSpi.setSelectorsCount(selectors);
@@ -75,6 +76,13 @@ public class IgniteCommunicationBalanceTest extends GridCommonAbstractTest {
}
/**
+ * @return Value for {@link TcpCommunicationSpi#setUsePairedConnections(boolean)}.
+ */
+ protected boolean usePairedConnections() {
+ return false;
+ }
+
+ /**
* @return Connections per node.
*/
protected int connectionsPerNode() {
@@ -97,7 +105,7 @@ public class IgniteCommunicationBalanceTest extends GridCommonAbstractTest {
try {
selectors = 4;
- final int SRVS = 4;
+ final int SRVS = 6;
startGridsMultiThreaded(SRVS);
@@ -105,7 +113,7 @@ public class IgniteCommunicationBalanceTest extends GridCommonAbstractTest {
final Ignite client = startGrid(SRVS);
- for (int i = 0; i < 4; i++) {
+ for (int i = 0; i < SRVS; i++) {
ClusterNode node = client.cluster().node(ignite(i).cluster().localNode().id());
client.compute(client.cluster().forNode(node)).call(new DummyCallable(null));
@@ -151,7 +159,10 @@ public class IgniteCommunicationBalanceTest extends GridCommonAbstractTest {
}
}
- return srv.readerMoveCount() > readMoveCnt && srv.writerMoveCount() > writeMoveCnt;
+ if (usePairedConnections())
+ return srv.readerMoveCount() > readMoveCnt && srv.writerMoveCount() > writeMoveCnt;
+ else
+ return srv.readerMoveCount() > readMoveCnt || srv.writerMoveCount() > writeMoveCnt;
}
}, 30_000);
@@ -165,8 +176,12 @@ public class IgniteCommunicationBalanceTest extends GridCommonAbstractTest {
", rc2=" + readMoveCnt2 +
", wc2=" + writeMoveCnt2 + ']');
- assertTrue(readMoveCnt2 > readMoveCnt1);
- assertTrue(writeMoveCnt2 > writeMoveCnt1);
+ if (usePairedConnections()) {
+ assertTrue(readMoveCnt2 > readMoveCnt1);
+ assertTrue(writeMoveCnt2 > writeMoveCnt1);
+ }
+ else
+ assertTrue(readMoveCnt2 > readMoveCnt1 || writeMoveCnt2 > writeMoveCnt1);
readMoveCnt1 = readMoveCnt2;
writeMoveCnt1 = writeMoveCnt2;
http://git-wip-us.apache.org/repos/asf/ignite/blob/da5b68cc/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheAtomicMessageRecoveryNoPairedConnectionsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheAtomicMessageRecoveryNoPairedConnectionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheAtomicMessageRecoveryNoPairedConnectionsTest.java
deleted file mode 100644
index 71772ef..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheAtomicMessageRecoveryNoPairedConnectionsTest.java
+++ /dev/null
@@ -1,47 +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;
-
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
-
-/**
- *
- */
-public class IgniteCacheAtomicMessageRecoveryNoPairedConnectionsTest extends IgniteCacheAtomicMessageRecoveryTest {
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(gridName);
-
- TcpCommunicationSpi commSpi = (TcpCommunicationSpi)cfg.getCommunicationSpi();
-
- assertTrue(commSpi.isUsePairedConnections());
-
- commSpi.setUsePairedConnections(false);
-
- return cfg;
- }
-
- /** {@inheritDoc} */
- @Override protected CacheAtomicityMode atomicityMode() {
- return ATOMIC;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/da5b68cc/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheAtomicMessageRecoveryPairedConnectionsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheAtomicMessageRecoveryPairedConnectionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheAtomicMessageRecoveryPairedConnectionsTest.java
new file mode 100644
index 0000000..dffb966
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheAtomicMessageRecoveryPairedConnectionsTest.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+
+/**
+ *
+ */
+public class IgniteCacheAtomicMessageRecoveryPairedConnectionsTest extends IgniteCacheAtomicMessageRecoveryTest {
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ TcpCommunicationSpi commSpi = (TcpCommunicationSpi)cfg.getCommunicationSpi();
+
+ assertFalse(commSpi.isUsePairedConnections());
+
+ commSpi.setUsePairedConnections(true);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return ATOMIC;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/da5b68cc/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 1e73e79..092d95e 100755
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -40,6 +40,7 @@ import org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreTest;
import org.apache.ignite.cache.store.jdbc.GridCacheJdbcBlobStoreMultithreadedSelfTest;
import org.apache.ignite.cache.store.jdbc.GridCacheJdbcBlobStoreSelfTest;
import org.apache.ignite.internal.managers.communication.IgniteCommunicationBalanceMultipleConnectionsTest;
+import org.apache.ignite.internal.managers.communication.IgniteCommunicationBalancePairedConnectionsTest;
import org.apache.ignite.internal.managers.communication.IgniteCommunicationBalanceTest;
import org.apache.ignite.internal.managers.communication.IgniteIoTestMessagesTest;
import org.apache.ignite.internal.managers.communication.IgniteVariousConnectionNumberTest;
@@ -134,7 +135,7 @@ import org.apache.ignite.internal.processors.cache.distributed.CacheAtomicNearUp
import org.apache.ignite.internal.processors.cache.distributed.CacheTxNearUpdateTopologyChangeTest;
import org.apache.ignite.internal.processors.cache.distributed.GridCacheEntrySetIterationPreloadingSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheAtomicMessageRecovery10ConnectionsTest;
-import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheAtomicMessageRecoveryNoPairedConnectionsTest;
+import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheAtomicMessageRecoveryPairedConnectionsTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheAtomicMessageRecoveryTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheConnectionRecovery10ConnectionsTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheConnectionRecoveryTest;
@@ -301,7 +302,7 @@ public class IgniteCacheTestSuite extends TestSuite {
suite.addTestSuite(GridCacheEntrySetIterationPreloadingSelfTest.class);
suite.addTestSuite(GridCacheMixedPartitionExchangeSelfTest.class);
suite.addTestSuite(IgniteCacheAtomicMessageRecoveryTest.class);
- suite.addTestSuite(IgniteCacheAtomicMessageRecoveryNoPairedConnectionsTest.class);
+ suite.addTestSuite(IgniteCacheAtomicMessageRecoveryPairedConnectionsTest.class);
suite.addTestSuite(IgniteCacheAtomicMessageRecovery10ConnectionsTest.class);
suite.addTestSuite(IgniteCacheTxMessageRecoveryTest.class);
suite.addTestSuite(IgniteCacheMessageWriteTimeoutTest.class);
@@ -339,6 +340,7 @@ public class IgniteCacheTestSuite extends TestSuite {
suite.addTestSuite(IgniteVariousConnectionNumberTest.class);
suite.addTestSuite(IgniteCommunicationBalanceTest.class);
+ suite.addTestSuite(IgniteCommunicationBalancePairedConnectionsTest.class);
suite.addTestSuite(IgniteCommunicationBalanceMultipleConnectionsTest.class);
suite.addTestSuite(IgniteIoTestMessagesTest.class);
[15/50] [abbrv] ignite git commit: IGNITE-4459: Hadoop: weighted
planned is default one from now on. This closes #1391.
Posted by ag...@apache.org.
IGNITE-4459: Hadoop: weighted planned is default one from now on. This closes #1391.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a9b1fc2b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a9b1fc2b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a9b1fc2b
Branch: refs/heads/ignite-3477
Commit: a9b1fc2b3840d47d7c978d9296e8ae6bdeb10be5
Parents: 2e691d8
Author: tledkov-gridgain <tl...@gridgain.com>
Authored: Thu Dec 29 11:07:22 2016 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Dec 29 11:07:22 2016 +0300
----------------------------------------------------------------------
.../mapreduce/IgniteHadoopMapReducePlanner.java | 414 -------------
.../processors/hadoop/HadoopProcessor.java | 4 +-
.../HadoopDefaultMapReducePlannerSelfTest.java | 619 -------------------
.../testsuites/IgniteHadoopTestSuite.java | 2 -
4 files changed, 2 insertions(+), 1037 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9b1fc2b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopMapReducePlanner.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopMapReducePlanner.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopMapReducePlanner.java
deleted file mode 100644
index ac42381..0000000
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/mapreduce/IgniteHadoopMapReducePlanner.java
+++ /dev/null
@@ -1,414 +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.hadoop.mapreduce;
-
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.igfs.IgfsBlockLocation;
-import org.apache.ignite.igfs.IgfsPath;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.processors.hadoop.HadoopFileBlock;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
-import org.apache.ignite.internal.processors.hadoop.HadoopJob;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlan;
-import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsEndpoint;
-import org.apache.ignite.internal.processors.hadoop.planner.HadoopAbstractMapReducePlanner;
-import org.apache.ignite.internal.processors.hadoop.planner.HadoopDefaultMapReducePlan;
-import org.apache.ignite.internal.processors.igfs.IgfsEx;
-import org.apache.ignite.internal.util.typedef.F;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.UUID;
-
-import static org.apache.ignite.IgniteFileSystem.IGFS_SCHEME;
-
-/**
- * Default map-reduce planner implementation.
- */
-public class IgniteHadoopMapReducePlanner extends HadoopAbstractMapReducePlanner {
- /** {@inheritDoc} */
- @Override public HadoopMapReducePlan preparePlan(HadoopJob job, Collection<ClusterNode> top,
- @Nullable HadoopMapReducePlan oldPlan) throws IgniteCheckedException {
- // Convert collection of topology nodes to collection of topology node IDs.
- Collection<UUID> topIds = new HashSet<>(top.size(), 1.0f);
-
- for (ClusterNode topNode : top)
- topIds.add(topNode.id());
-
- Map<UUID, Collection<HadoopInputSplit>> mappers = mappers(top, topIds, job.input());
-
- int rdcCnt = job.info().reducers();
-
- if (rdcCnt < 0)
- throw new IgniteCheckedException("Number of reducers must be non-negative, actual: " + rdcCnt);
-
- Map<UUID, int[]> reducers = reducers(top, mappers, rdcCnt);
-
- return new HadoopDefaultMapReducePlan(mappers, reducers);
- }
-
- /**
- * Create plan for mappers.
- *
- * @param top Topology nodes.
- * @param topIds Topology node IDs.
- * @param splits Splits.
- * @return Mappers map.
- * @throws IgniteCheckedException If failed.
- */
- private Map<UUID, Collection<HadoopInputSplit>> mappers(Collection<ClusterNode> top, Collection<UUID> topIds,
- Iterable<HadoopInputSplit> splits) throws IgniteCheckedException {
- Map<UUID, Collection<HadoopInputSplit>> mappers = new HashMap<>();
-
- Map<String, Collection<UUID>> nodes = groupByHost(top);
-
- Map<UUID, Integer> nodeLoads = new HashMap<>(top.size(), 1.0f); // Track node load.
-
- for (UUID nodeId : topIds)
- nodeLoads.put(nodeId, 0);
-
- for (HadoopInputSplit split : splits) {
- UUID nodeId = nodeForSplit(split, topIds, nodes, nodeLoads);
-
- if (log.isDebugEnabled())
- log.debug("Mapped split to node [split=" + split + ", nodeId=" + nodeId + ']');
-
- Collection<HadoopInputSplit> nodeSplits = mappers.get(nodeId);
-
- if (nodeSplits == null) {
- nodeSplits = new ArrayList<>();
-
- mappers.put(nodeId, nodeSplits);
- }
-
- nodeSplits.add(split);
-
- // Updated node load.
- nodeLoads.put(nodeId, nodeLoads.get(nodeId) + 1);
- }
-
- return mappers;
- }
-
- /**
- * Determine the best node for this split.
- *
- * @param split Split.
- * @param topIds Topology node IDs.
- * @param nodes Nodes.
- * @param nodeLoads Node load tracker.
- * @return Node ID.
- * @throws IgniteCheckedException On error.
- */
- @SuppressWarnings("unchecked")
- private UUID nodeForSplit(HadoopInputSplit split, Collection<UUID> topIds, Map<String, Collection<UUID>> nodes,
- Map<UUID, Integer> nodeLoads) throws IgniteCheckedException {
- if (split instanceof HadoopFileBlock) {
- HadoopFileBlock split0 = (HadoopFileBlock)split;
-
- if (IGFS_SCHEME.equalsIgnoreCase(split0.file().getScheme())) {
- HadoopIgfsEndpoint endpoint = new HadoopIgfsEndpoint(split0.file().getAuthority());
-
- IgfsEx igfs = (IgfsEx)((IgniteEx)ignite).igfsx(endpoint.igfs());
-
- if (igfs != null && !igfs.isProxy(split0.file())) {
- IgfsPath path = new IgfsPath(split0.file());
-
- if (igfs.exists(path)) {
- Collection<IgfsBlockLocation> blocks;
-
- try {
- blocks = igfs.affinity(path, split0.start(), split0.length());
- }
- catch (IgniteException e) {
- throw new IgniteCheckedException(e);
- }
-
- assert blocks != null;
-
- if (blocks.size() == 1)
- // Fast-path, split consists of one IGFS block (as in most cases).
- return bestNode(blocks.iterator().next().nodeIds(), topIds, nodeLoads, false);
- else {
- // Slow-path, file consists of multiple IGFS blocks. First, find the most co-located nodes.
- Map<UUID, Long> nodeMap = new HashMap<>();
-
- List<UUID> bestNodeIds = null;
- long bestLen = -1L;
-
- for (IgfsBlockLocation block : blocks) {
- for (UUID blockNodeId : block.nodeIds()) {
- if (topIds.contains(blockNodeId)) {
- Long oldLen = nodeMap.get(blockNodeId);
- long newLen = oldLen == null ? block.length() : oldLen + block.length();
-
- nodeMap.put(blockNodeId, newLen);
-
- if (bestNodeIds == null || bestLen < newLen) {
- bestNodeIds = new ArrayList<>(1);
-
- bestNodeIds.add(blockNodeId);
-
- bestLen = newLen;
- }
- else if (bestLen == newLen) {
- assert !F.isEmpty(bestNodeIds);
-
- bestNodeIds.add(blockNodeId);
- }
- }
- }
- }
-
- if (bestNodeIds != null) {
- return bestNodeIds.size() == 1 ? bestNodeIds.get(0) :
- bestNode(bestNodeIds, topIds, nodeLoads, true);
- }
- }
- }
- }
- }
- }
-
- // Cannot use local IGFS for some reason, try selecting the node by host.
- Collection<UUID> blockNodes = null;
-
- for (String host : split.hosts()) {
- Collection<UUID> hostNodes = nodes.get(host);
-
- if (!F.isEmpty(hostNodes)) {
- if (blockNodes == null)
- blockNodes = new ArrayList<>(hostNodes);
- else
- blockNodes.addAll(hostNodes);
- }
- }
-
- return bestNode(blockNodes, topIds, nodeLoads, false);
- }
-
- /**
- * Finds the best (the least loaded) node among the candidates.
- *
- * @param candidates Candidates.
- * @param topIds Topology node IDs.
- * @param nodeLoads Known node loads.
- * @param skipTopCheck Whether to skip topology check.
- * @return The best node.
- */
- private UUID bestNode(@Nullable Collection<UUID> candidates, Collection<UUID> topIds, Map<UUID, Integer> nodeLoads,
- boolean skipTopCheck) {
- UUID bestNode = null;
- int bestLoad = Integer.MAX_VALUE;
-
- if (candidates != null) {
- for (UUID candidate : candidates) {
- if (skipTopCheck || topIds.contains(candidate)) {
- int load = nodeLoads.get(candidate);
-
- if (bestNode == null || bestLoad > load) {
- bestNode = candidate;
- bestLoad = load;
-
- if (bestLoad == 0)
- break; // Minimum load possible, no need for further iterations.
- }
- }
- }
- }
-
- if (bestNode == null) {
- // Blocks are located on nodes which are not Hadoop-enabled, assign to the least loaded one.
- bestLoad = Integer.MAX_VALUE;
-
- for (UUID nodeId : topIds) {
- int load = nodeLoads.get(nodeId);
-
- if (bestNode == null || bestLoad > load) {
- bestNode = nodeId;
- bestLoad = load;
-
- if (bestLoad == 0)
- break; // Minimum load possible, no need for further iterations.
- }
- }
- }
-
- assert bestNode != null;
-
- return bestNode;
- }
-
- /**
- * Create plan for reducers.
- *
- * @param top Topology.
- * @param mappers Mappers map.
- * @param reducerCnt Reducers count.
- * @return Reducers map.
- */
- private Map<UUID, int[]> reducers(Collection<ClusterNode> top,
- Map<UUID, Collection<HadoopInputSplit>> mappers, int reducerCnt) {
- // Determine initial node weights.
- int totalWeight = 0;
-
- List<WeightedNode> nodes = new ArrayList<>(top.size());
-
- for (ClusterNode node : top) {
- Collection<HadoopInputSplit> split = mappers.get(node.id());
-
- int weight = reducerNodeWeight(node, split != null ? split.size() : 0);
-
- nodes.add(new WeightedNode(node.id(), weight, weight));
-
- totalWeight += weight;
- }
-
- // Adjust weights.
- int totalAdjustedWeight = 0;
-
- for (WeightedNode node : nodes) {
- node.floatWeight = ((float)node.weight * reducerCnt) / totalWeight;
-
- node.weight = Math.round(node.floatWeight);
-
- totalAdjustedWeight += node.weight;
- }
-
- // Apply redundant/lost reducers.
- Collections.sort(nodes);
-
- if (totalAdjustedWeight > reducerCnt) {
- // Too much reducers set.
- ListIterator<WeightedNode> iter = nodes.listIterator(nodes.size() - 1);
-
- while (totalAdjustedWeight != reducerCnt) {
- if (!iter.hasPrevious())
- iter = nodes.listIterator(nodes.size() - 1);
-
- WeightedNode node = iter.previous();
-
- if (node.weight > 0) {
- node.weight -= 1;
-
- totalAdjustedWeight--;
- }
- }
- }
- else if (totalAdjustedWeight < reducerCnt) {
- // Not enough reducers set.
- ListIterator<WeightedNode> iter = nodes.listIterator(0);
-
- while (totalAdjustedWeight != reducerCnt) {
- if (!iter.hasNext())
- iter = nodes.listIterator(0);
-
- WeightedNode node = iter.next();
-
- if (node.floatWeight > 0.0f) {
- node.weight += 1;
-
- totalAdjustedWeight++;
- }
- }
- }
-
- int idx = 0;
-
- Map<UUID, int[]> reducers = new HashMap<>(nodes.size(), 1.0f);
-
- for (WeightedNode node : nodes) {
- if (node.weight > 0) {
- int[] arr = new int[node.weight];
-
- for (int i = 0; i < arr.length; i++)
- arr[i] = idx++;
-
- reducers.put(node.nodeId, arr);
- }
- }
-
- return reducers;
- }
-
- /**
- * Calculate node weight based on node metrics and data co-location.
- *
- * @param node Node.
- * @param splitCnt Splits mapped to this node.
- * @return Node weight.
- */
- @SuppressWarnings("UnusedParameters")
- protected int reducerNodeWeight(ClusterNode node, int splitCnt) {
- return splitCnt;
- }
-
- /**
- * Weighted node.
- */
- private static class WeightedNode implements Comparable<WeightedNode> {
- /** Node ID. */
- private final UUID nodeId;
-
- /** Weight. */
- private int weight;
-
- /** Floating point weight. */
- private float floatWeight;
-
- /**
- * Constructor.
- *
- * @param nodeId Node ID.
- * @param weight Weight.
- * @param floatWeight Floating point weight.
- */
- private WeightedNode(UUID nodeId, int weight, float floatWeight) {
- this.nodeId = nodeId;
- this.weight = weight;
- this.floatWeight = floatWeight;
- }
-
- /** {@inheritDoc} */
- @Override public boolean equals(Object obj) {
- return obj != null && obj instanceof WeightedNode && F.eq(nodeId, ((WeightedNode)obj).nodeId);
- }
-
- /** {@inheritDoc} */
- @Override public int hashCode() {
- return nodeId.hashCode();
- }
-
- /** {@inheritDoc} */
- @Override public int compareTo(@NotNull WeightedNode other) {
- float res = other.floatWeight - floatWeight;
-
- return res > 0.0f ? 1 : res < 0.0f ? -1 : nodeId.compareTo(other.nodeId);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9b1fc2b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopProcessor.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopProcessor.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopProcessor.java
index f0df1e9..329d67f 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopProcessor.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopProcessor.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.processors.hadoop;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.configuration.HadoopConfiguration;
-import org.apache.ignite.hadoop.mapreduce.IgniteHadoopMapReducePlanner;
+import org.apache.ignite.hadoop.mapreduce.IgniteHadoopWeightedMapReducePlanner;
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.processors.hadoop.counter.HadoopCounters;
@@ -243,7 +243,7 @@ public class HadoopProcessor extends HadoopProcessorAdapter {
*/
private void initializeDefaults(HadoopConfiguration cfg) {
if (cfg.getMapReducePlanner() == null)
- cfg.setMapReducePlanner(new IgniteHadoopMapReducePlanner());
+ cfg.setMapReducePlanner(new IgniteHadoopWeightedMapReducePlanner());
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9b1fc2b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopDefaultMapReducePlannerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopDefaultMapReducePlannerSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopDefaultMapReducePlannerSelfTest.java
deleted file mode 100644
index ee1c88f..0000000
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopDefaultMapReducePlannerSelfTest.java
+++ /dev/null
@@ -1,619 +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.hadoop.impl;
-
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.IgniteFileSystem;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.hadoop.mapreduce.IgniteHadoopMapReducePlanner;
-import org.apache.ignite.igfs.IgfsBlockLocation;
-import org.apache.ignite.igfs.IgfsPath;
-import org.apache.ignite.internal.processors.hadoop.HadoopFileBlock;
-import org.apache.ignite.internal.processors.hadoop.HadoopInputSplit;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlan;
-import org.apache.ignite.internal.processors.hadoop.HadoopMapReducePlanner;
-import org.apache.ignite.internal.processors.hadoop.planner.HadoopAbstractMapReducePlanner;
-import org.apache.ignite.internal.processors.igfs.IgfsBlockLocationImpl;
-import org.apache.ignite.internal.processors.igfs.IgfsIgniteMock;
-import org.apache.ignite.internal.processors.igfs.IgfsMock;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.testframework.GridTestNode;
-import org.apache.ignite.testframework.GridTestUtils;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-/**
- *
- */
-public class HadoopDefaultMapReducePlannerSelfTest extends HadoopAbstractSelfTest {
- /** */
- private static final UUID ID_1 = new UUID(0, 1);
-
- /** */
- private static final UUID ID_2 = new UUID(0, 2);
-
- /** */
- private static final UUID ID_3 = new UUID(0, 3);
-
- /** */
- private static final String HOST_1 = "host1";
-
- /** */
- private static final String HOST_2 = "host2";
-
- /** */
- private static final String HOST_3 = "host3";
-
- /** */
- private static final String INVALID_HOST_1 = "invalid_host1";
-
- /** */
- private static final String INVALID_HOST_2 = "invalid_host2";
-
- /** */
- private static final String INVALID_HOST_3 = "invalid_host3";
-
- /** Mocked IGFS. */
- private static final IgniteFileSystem IGFS = new MockIgfs();
-
- /** Mocked Grid. */
- private static final IgfsIgniteMock GRID = new IgfsIgniteMock(null, IGFS);
-
- /** Planner. */
- private static final HadoopMapReducePlanner PLANNER = new IgniteHadoopMapReducePlanner();
-
- /** Block locations. */
- private static final Map<Block, Collection<IgfsBlockLocation>> BLOCK_MAP = new HashMap<>();
-
- /** Proxy map. */
- private static final Map<URI, Boolean> PROXY_MAP = new HashMap<>();
-
- /** Last created plan. */
- private static final ThreadLocal<HadoopMapReducePlan> PLAN = new ThreadLocal<>();
-
- /**
- * Static initializer.
- */
- static {
- GridTestUtils.setFieldValue(PLANNER, HadoopAbstractMapReducePlanner.class, "ignite", GRID);
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- GridTestUtils.setFieldValue(PLANNER, HadoopAbstractMapReducePlanner.class, "log", log());
-
- BLOCK_MAP.clear();
- PROXY_MAP.clear();
- }
-
- /**
- * @throws IgniteCheckedException If failed.
- */
- public void testIgfsOneBlockPerNode() throws IgniteCheckedException {
- HadoopFileBlock split1 = split(true, "/file1", 0, 100, HOST_1);
- HadoopFileBlock split2 = split(true, "/file2", 0, 100, HOST_2);
- HadoopFileBlock split3 = split(true, "/file3", 0, 100, HOST_3);
-
- mapIgfsBlock(split1.file(), 0, 100, location(0, 100, ID_1));
- mapIgfsBlock(split2.file(), 0, 100, location(0, 100, ID_2));
- mapIgfsBlock(split3.file(), 0, 100, location(0, 100, ID_3));
-
- plan(1, split1);
- assert ensureMappers(ID_1, split1);
- assert ensureReducers(ID_1, 1);
- assert ensureEmpty(ID_2);
- assert ensureEmpty(ID_3);
-
- plan(2, split1);
- assert ensureMappers(ID_1, split1);
- assert ensureReducers(ID_1, 2);
- assert ensureEmpty(ID_2);
- assert ensureEmpty(ID_3);
-
- plan(1, split1, split2);
- assert ensureMappers(ID_1, split1);
- assert ensureMappers(ID_2, split2);
- assert ensureReducers(ID_1, 1) && ensureReducers(ID_2, 0) || ensureReducers(ID_1, 0) && ensureReducers(ID_2, 1);
- assert ensureEmpty(ID_3);
-
- plan(2, split1, split2);
- assert ensureMappers(ID_1, split1);
- assert ensureMappers(ID_2, split2);
- assert ensureReducers(ID_1, 1);
- assert ensureReducers(ID_2, 1);
- assert ensureEmpty(ID_3);
-
- plan(3, split1, split2);
- assert ensureMappers(ID_1, split1);
- assert ensureMappers(ID_2, split2);
- assert ensureReducers(ID_1, 1) && ensureReducers(ID_2, 2) || ensureReducers(ID_1, 2) && ensureReducers(ID_2, 1);
- assert ensureEmpty(ID_3);
-
- plan(3, split1, split2, split3);
- assert ensureMappers(ID_1, split1);
- assert ensureMappers(ID_2, split2);
- assert ensureMappers(ID_3, split3);
- assert ensureReducers(ID_1, 1);
- assert ensureReducers(ID_2, 1);
- assert ensureReducers(ID_3, 1);
-
- plan(5, split1, split2, split3);
- assert ensureMappers(ID_1, split1);
- assert ensureMappers(ID_2, split2);
- assert ensureMappers(ID_3, split3);
- assert ensureReducers(ID_1, 1) && ensureReducers(ID_2, 2) && ensureReducers(ID_3, 2) ||
- ensureReducers(ID_1, 2) && ensureReducers(ID_2, 1) && ensureReducers(ID_3, 2) ||
- ensureReducers(ID_1, 2) && ensureReducers(ID_2, 2) && ensureReducers(ID_3, 1);
- }
-
- /**
- * @throws IgniteCheckedException If failed.
- */
- public void testNonIgfsOneBlockPerNode() throws IgniteCheckedException {
- HadoopFileBlock split1 = split(false, "/file1", 0, 100, HOST_1);
- HadoopFileBlock split2 = split(false, "/file2", 0, 100, HOST_2);
- HadoopFileBlock split3 = split(false, "/file3", 0, 100, HOST_3);
-
- plan(1, split1);
- assert ensureMappers(ID_1, split1);
- assert ensureReducers(ID_1, 1);
- assert ensureEmpty(ID_2);
- assert ensureEmpty(ID_3);
-
- plan(2, split1);
- assert ensureMappers(ID_1, split1);
- assert ensureReducers(ID_1, 2);
- assert ensureEmpty(ID_2);
- assert ensureEmpty(ID_3);
-
- plan(1, split1, split2);
- assert ensureMappers(ID_1, split1);
- assert ensureMappers(ID_2, split2);
- assert ensureReducers(ID_1, 1) && ensureReducers(ID_2, 0) || ensureReducers(ID_1, 0) && ensureReducers(ID_2, 1);
- assert ensureEmpty(ID_3);
-
- plan(2, split1, split2);
- assert ensureMappers(ID_1, split1);
- assert ensureMappers(ID_2, split2);
- assert ensureReducers(ID_1, 1);
- assert ensureReducers(ID_2, 1);
- assert ensureEmpty(ID_3);
-
- plan(3, split1, split2);
- assert ensureMappers(ID_1, split1);
- assert ensureMappers(ID_2, split2);
- assert ensureReducers(ID_1, 1) && ensureReducers(ID_2, 2) || ensureReducers(ID_1, 2) && ensureReducers(ID_2, 1);
- assert ensureEmpty(ID_3);
-
- plan(3, split1, split2, split3);
- assert ensureMappers(ID_1, split1);
- assert ensureMappers(ID_2, split2);
- assert ensureMappers(ID_3, split3);
- assert ensureReducers(ID_1, 1);
- assert ensureReducers(ID_2, 1);
- assert ensureReducers(ID_3, 1);
-
- plan(5, split1, split2, split3);
- assert ensureMappers(ID_1, split1);
- assert ensureMappers(ID_2, split2);
- assert ensureMappers(ID_3, split3);
- assert ensureReducers(ID_1, 1) && ensureReducers(ID_2, 2) && ensureReducers(ID_3, 2) ||
- ensureReducers(ID_1, 2) && ensureReducers(ID_2, 1) && ensureReducers(ID_3, 2) ||
- ensureReducers(ID_1, 2) && ensureReducers(ID_2, 2) && ensureReducers(ID_3, 1);
- }
-
- /**
- * @throws IgniteCheckedException If failed.
- */
- public void testIgfsSeveralBlocksPerNode() throws IgniteCheckedException {
- HadoopFileBlock split1 = split(true, "/file1", 0, 100, HOST_1, HOST_2);
- HadoopFileBlock split2 = split(true, "/file2", 0, 100, HOST_1, HOST_2);
- HadoopFileBlock split3 = split(true, "/file3", 0, 100, HOST_1, HOST_3);
-
- mapIgfsBlock(split1.file(), 0, 100, location(0, 100, ID_1, ID_2));
- mapIgfsBlock(split2.file(), 0, 100, location(0, 100, ID_1, ID_2));
- mapIgfsBlock(split3.file(), 0, 100, location(0, 100, ID_1, ID_3));
-
- plan(1, split1);
- assert ensureMappers(ID_1, split1) && ensureReducers(ID_1, 1) && ensureEmpty(ID_2) ||
- ensureEmpty(ID_1) && ensureMappers(ID_2, split1) && ensureReducers(ID_2, 1);
- assert ensureEmpty(ID_3);
-
- plan(2, split1);
- assert ensureMappers(ID_1, split1) && ensureReducers(ID_1, 2) && ensureEmpty(ID_2) ||
- ensureEmpty(ID_1) && ensureMappers(ID_2, split1) && ensureReducers(ID_2, 2);
- assert ensureEmpty(ID_3);
-
- plan(1, split1, split2);
- assert ensureMappers(ID_1, split1) && ensureMappers(ID_2, split2) ||
- ensureMappers(ID_1, split2) && ensureMappers(ID_2, split1);
- assert ensureReducers(ID_1, 1) && ensureReducers(ID_2, 0) || ensureReducers(ID_1, 0) && ensureReducers(ID_2, 1);
- assert ensureEmpty(ID_3);
-
- plan(2, split1, split2);
- assert ensureMappers(ID_1, split1) && ensureMappers(ID_2, split2) ||
- ensureMappers(ID_1, split2) && ensureMappers(ID_2, split1);
- assert ensureReducers(ID_1, 1);
- assert ensureReducers(ID_2, 1);
- assert ensureEmpty(ID_3);
-
- plan(3, split1, split2, split3);
- assert ensureReducers(ID_1, 1);
- assert ensureReducers(ID_2, 1);
- assert ensureReducers(ID_3, 1);
-
- plan(5, split1, split2, split3);
- assert ensureReducers(ID_1, 1) && ensureReducers(ID_2, 2) && ensureReducers(ID_3, 2) ||
- ensureReducers(ID_1, 2) && ensureReducers(ID_2, 1) && ensureReducers(ID_3, 2) ||
- ensureReducers(ID_1, 2) && ensureReducers(ID_2, 2) && ensureReducers(ID_3, 1);
- }
-
- /**
- * @throws IgniteCheckedException If failed.
- */
- public void testNonIgfsSeveralBlocksPerNode() throws IgniteCheckedException {
- HadoopFileBlock split1 = split(false, "/file1", 0, 100, HOST_1, HOST_2);
- HadoopFileBlock split2 = split(false, "/file2", 0, 100, HOST_1, HOST_2);
- HadoopFileBlock split3 = split(false, "/file3", 0, 100, HOST_1, HOST_3);
-
- plan(1, split1);
- assert ensureMappers(ID_1, split1) && ensureReducers(ID_1, 1) && ensureEmpty(ID_2) ||
- ensureEmpty(ID_1) && ensureMappers(ID_2, split1) && ensureReducers(ID_2, 1);
- assert ensureEmpty(ID_3);
-
- plan(2, split1);
- assert ensureMappers(ID_1, split1) && ensureReducers(ID_1, 2) && ensureEmpty(ID_2) ||
- ensureEmpty(ID_1) && ensureMappers(ID_2, split1) && ensureReducers(ID_2, 2);
- assert ensureEmpty(ID_3);
-
- plan(1, split1, split2);
- assert ensureMappers(ID_1, split1) && ensureMappers(ID_2, split2) ||
- ensureMappers(ID_1, split2) && ensureMappers(ID_2, split1);
- assert ensureReducers(ID_1, 1) && ensureReducers(ID_2, 0) || ensureReducers(ID_1, 0) && ensureReducers(ID_2, 1);
- assert ensureEmpty(ID_3);
-
- plan(2, split1, split2);
- assert ensureMappers(ID_1, split1) && ensureMappers(ID_2, split2) ||
- ensureMappers(ID_1, split2) && ensureMappers(ID_2, split1);
- assert ensureReducers(ID_1, 1);
- assert ensureReducers(ID_2, 1);
- assert ensureEmpty(ID_3);
-
- plan(3, split1, split2, split3);
- assert ensureReducers(ID_1, 1);
- assert ensureReducers(ID_2, 1);
- assert ensureReducers(ID_3, 1);
-
- plan(5, split1, split2, split3);
- assert ensureReducers(ID_1, 1) && ensureReducers(ID_2, 2) && ensureReducers(ID_3, 2) ||
- ensureReducers(ID_1, 2) && ensureReducers(ID_2, 1) && ensureReducers(ID_3, 2) ||
- ensureReducers(ID_1, 2) && ensureReducers(ID_2, 2) && ensureReducers(ID_3, 1);
- }
-
- /**
- * @throws IgniteCheckedException If failed.
- */
- public void testIgfsSeveralComplexBlocksPerNode() throws IgniteCheckedException {
- HadoopFileBlock split1 = split(true, "/file1", 0, 100, HOST_1, HOST_2, HOST_3);
- HadoopFileBlock split2 = split(true, "/file2", 0, 100, HOST_1, HOST_2, HOST_3);
-
- mapIgfsBlock(split1.file(), 0, 100, location(0, 50, ID_1, ID_2), location(51, 100, ID_1, ID_3));
- mapIgfsBlock(split2.file(), 0, 100, location(0, 50, ID_1, ID_2), location(51, 100, ID_2, ID_3));
-
- plan(1, split1);
- assert ensureMappers(ID_1, split1);
- assert ensureReducers(ID_1, 1);
- assert ensureEmpty(ID_2);
- assert ensureEmpty(ID_3);
-
- plan(1, split2);
- assert ensureMappers(ID_2, split2);
- assert ensureReducers(ID_2, 1);
- assert ensureEmpty(ID_1);
- assert ensureEmpty(ID_3);
-
- plan(1, split1, split2);
- assert ensureMappers(ID_1, split1);
- assert ensureMappers(ID_2, split2);
- assert ensureReducers(ID_1, 0) && ensureReducers(ID_2, 1) || ensureReducers(ID_1, 1) && ensureReducers(ID_2, 0);
- assert ensureEmpty(ID_3);
-
- plan(2, split1, split2);
- assert ensureMappers(ID_1, split1);
- assert ensureMappers(ID_2, split2);
- assert ensureReducers(ID_1, 1);
- assert ensureReducers(ID_2, 1);
- assert ensureEmpty(ID_3);
- }
-
- /**
- * @throws IgniteCheckedException If failed.
- */
- public void testNonIgfsOrphans() throws IgniteCheckedException {
- HadoopFileBlock split1 = split(false, "/file1", 0, 100, INVALID_HOST_1, INVALID_HOST_2);
- HadoopFileBlock split2 = split(false, "/file2", 0, 100, INVALID_HOST_1, INVALID_HOST_3);
- HadoopFileBlock split3 = split(false, "/file3", 0, 100, INVALID_HOST_2, INVALID_HOST_3);
-
- plan(1, split1);
- assert ensureMappers(ID_1, split1) && ensureReducers(ID_1, 1) && ensureEmpty(ID_2) && ensureEmpty(ID_3) ||
- ensureEmpty(ID_1) && ensureMappers(ID_2, split1) && ensureReducers(ID_2, 1) && ensureEmpty(ID_3) ||
- ensureEmpty(ID_1) && ensureEmpty(ID_2) && ensureMappers(ID_3, split1) && ensureReducers(ID_3, 1);
-
- plan(2, split1);
- assert ensureMappers(ID_1, split1) && ensureReducers(ID_1, 2) && ensureEmpty(ID_2) && ensureEmpty(ID_3) ||
- ensureEmpty(ID_1) && ensureMappers(ID_2, split1) && ensureReducers(ID_2, 2) && ensureEmpty(ID_3) ||
- ensureEmpty(ID_1) && ensureEmpty(ID_2) && ensureMappers(ID_3, split1) && ensureReducers(ID_3, 2);
-
- plan(1, split1, split2, split3);
- assert ensureMappers(ID_1, split1) && ensureMappers(ID_2, split2) && ensureMappers(ID_3, split3) ||
- ensureMappers(ID_1, split1) && ensureMappers(ID_2, split3) && ensureMappers(ID_3, split2) ||
- ensureMappers(ID_1, split2) && ensureMappers(ID_2, split1) && ensureMappers(ID_3, split3) ||
- ensureMappers(ID_1, split2) && ensureMappers(ID_2, split3) && ensureMappers(ID_3, split1) ||
- ensureMappers(ID_1, split3) && ensureMappers(ID_2, split1) && ensureMappers(ID_3, split2) ||
- ensureMappers(ID_1, split3) && ensureMappers(ID_2, split2) && ensureMappers(ID_3, split1);
- assert ensureReducers(ID_1, 1) && ensureReducers(ID_2, 0) && ensureReducers(ID_3, 0) ||
- ensureReducers(ID_1, 0) && ensureReducers(ID_2, 1) && ensureReducers(ID_3, 0) ||
- ensureReducers(ID_1, 0) && ensureReducers(ID_2, 0) && ensureReducers(ID_3, 1);
-
- plan(3, split1, split2, split3);
- assert ensureMappers(ID_1, split1) && ensureMappers(ID_2, split2) && ensureMappers(ID_3, split3) ||
- ensureMappers(ID_1, split1) && ensureMappers(ID_2, split3) && ensureMappers(ID_3, split2) ||
- ensureMappers(ID_1, split2) && ensureMappers(ID_2, split1) && ensureMappers(ID_3, split3) ||
- ensureMappers(ID_1, split2) && ensureMappers(ID_2, split3) && ensureMappers(ID_3, split1) ||
- ensureMappers(ID_1, split3) && ensureMappers(ID_2, split1) && ensureMappers(ID_3, split2) ||
- ensureMappers(ID_1, split3) && ensureMappers(ID_2, split2) && ensureMappers(ID_3, split1);
- assert ensureReducers(ID_1, 1);
- assert ensureReducers(ID_2, 1);
- assert ensureReducers(ID_3, 1);
-
- plan(5, split1, split2, split3);
- assert ensureMappers(ID_1, split1) && ensureMappers(ID_2, split2) && ensureMappers(ID_3, split3) ||
- ensureMappers(ID_1, split1) && ensureMappers(ID_2, split3) && ensureMappers(ID_3, split2) ||
- ensureMappers(ID_1, split2) && ensureMappers(ID_2, split1) && ensureMappers(ID_3, split3) ||
- ensureMappers(ID_1, split2) && ensureMappers(ID_2, split3) && ensureMappers(ID_3, split1) ||
- ensureMappers(ID_1, split3) && ensureMappers(ID_2, split1) && ensureMappers(ID_3, split2) ||
- ensureMappers(ID_1, split3) && ensureMappers(ID_2, split2) && ensureMappers(ID_3, split1);
- assert ensureReducers(ID_1, 1) && ensureReducers(ID_2, 2) && ensureReducers(ID_3, 2) ||
- ensureReducers(ID_1, 2) && ensureReducers(ID_2, 1) && ensureReducers(ID_3, 2) ||
- ensureReducers(ID_1, 2) && ensureReducers(ID_2, 2) && ensureReducers(ID_3, 1);
- }
-
- /**
- * Create plan.
- *
- * @param reducers Reducers count.
- * @param splits Splits.
- * @return Plan.
- * @throws IgniteCheckedException If failed.
- */
- private static HadoopMapReducePlan plan(int reducers, HadoopInputSplit... splits) throws IgniteCheckedException {
- assert reducers > 0;
- assert splits != null && splits.length > 0;
-
- Collection<HadoopInputSplit> splitList = new ArrayList<>(splits.length);
-
- Collections.addAll(splitList, splits);
-
- Collection<ClusterNode> top = new ArrayList<>();
-
- GridTestNode node1 = new GridTestNode(ID_1);
- GridTestNode node2 = new GridTestNode(ID_2);
- GridTestNode node3 = new GridTestNode(ID_3);
-
- node1.setHostName(HOST_1);
- node2.setHostName(HOST_2);
- node3.setHostName(HOST_3);
-
- top.add(node1);
- top.add(node2);
- top.add(node3);
-
- HadoopMapReducePlan plan = PLANNER.preparePlan(new HadoopPlannerMockJob(splitList, reducers), top, null);
-
- PLAN.set(plan);
-
- return plan;
- }
-
- /**
- * Ensure that node contains the given mappers.
- *
- * @param nodeId Node ID.
- * @param expSplits Expected splits.
- * @return {@code True} if this assumption is valid.
- */
- private static boolean ensureMappers(UUID nodeId, HadoopInputSplit... expSplits) {
- Collection<HadoopInputSplit> expSplitsCol = new ArrayList<>();
-
- Collections.addAll(expSplitsCol, expSplits);
-
- Collection<HadoopInputSplit> splits = PLAN.get().mappers(nodeId);
-
- return F.eq(expSplitsCol, splits);
- }
-
- /**
- * Ensure that node contains the given amount of reducers.
- *
- * @param nodeId Node ID.
- * @param reducers Reducers.
- * @return {@code True} if this assumption is valid.
- */
- private static boolean ensureReducers(UUID nodeId, int reducers) {
- int[] reducersArr = PLAN.get().reducers(nodeId);
-
- return reducers == 0 ? F.isEmpty(reducersArr) : (reducersArr != null && reducersArr.length == reducers);
- }
-
- /**
- * Ensure that no mappers and reducers is located on this node.
- *
- * @param nodeId Node ID.
- * @return {@code True} if this assumption is valid.
- */
- private static boolean ensureEmpty(UUID nodeId) {
- return F.isEmpty(PLAN.get().mappers(nodeId)) && F.isEmpty(PLAN.get().reducers(nodeId));
- }
-
- /**
- * Create split.
- *
- * @param igfs IGFS flag.
- * @param file File.
- * @param start Start.
- * @param len Length.
- * @param hosts Hosts.
- * @return Split.
- */
- private static HadoopFileBlock split(boolean igfs, String file, long start, long len, String... hosts) {
- URI uri = URI.create((igfs ? "igfs://igfs@" : "hdfs://") + file);
-
- return new HadoopFileBlock(hosts, uri, start, len);
- }
-
- /**
- * Create block location.
- *
- * @param start Start.
- * @param len Length.
- * @param nodeIds Node IDs.
- * @return Block location.
- */
- private static IgfsBlockLocation location(long start, long len, UUID... nodeIds) {
- assert nodeIds != null && nodeIds.length > 0;
-
- Collection<ClusterNode> nodes = new ArrayList<>(nodeIds.length);
-
- for (UUID id : nodeIds)
- nodes.add(new GridTestNode(id));
-
- return new IgfsBlockLocationImpl(start, len, nodes);
- }
-
- /**
- * Map IGFS block to nodes.
- *
- * @param file File.
- * @param start Start.
- * @param len Length.
- * @param locations Locations.
- */
- private static void mapIgfsBlock(URI file, long start, long len, IgfsBlockLocation... locations) {
- assert locations != null && locations.length > 0;
-
- IgfsPath path = new IgfsPath(file);
-
- Block block = new Block(path, start, len);
-
- Collection<IgfsBlockLocation> locationsList = new ArrayList<>();
-
- Collections.addAll(locationsList, locations);
-
- BLOCK_MAP.put(block, locationsList);
- }
-
- /**
- * Block.
- */
- private static class Block {
- /** */
- private final IgfsPath path;
-
- /** */
- private final long start;
-
- /** */
- private final long len;
-
- /**
- * Constructor.
- *
- * @param path Path.
- * @param start Start.
- * @param len Length.
- */
- private Block(IgfsPath path, long start, long len) {
- this.path = path;
- this.start = start;
- this.len = len;
- }
-
- /** {@inheritDoc} */
- @SuppressWarnings("RedundantIfStatement")
- @Override public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof Block)) return false;
-
- Block block = (Block) o;
-
- if (len != block.len)
- return false;
-
- if (start != block.start)
- return false;
-
- if (!path.equals(block.path))
- return false;
-
- return true;
- }
-
- /** {@inheritDoc} */
- @Override public int hashCode() {
- int res = path.hashCode();
-
- res = 31 * res + (int) (start ^ (start >>> 32));
- res = 31 * res + (int) (len ^ (len >>> 32));
-
- return res;
- }
- }
-
- /**
- * Mocked IGFS.
- */
- private static class MockIgfs extends IgfsMock {
- /**
- * Constructor.
- */
- public MockIgfs() {
- super("igfs");
- }
-
- /** {@inheritDoc} */
- @Override public boolean isProxy(URI path) {
- return PROXY_MAP.containsKey(path) && PROXY_MAP.get(path);
- }
-
- /** {@inheritDoc} */
- @Override public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len) {
- return BLOCK_MAP.get(new Block(path, start, len));
- }
-
- /** {@inheritDoc} */
- @Override public boolean exists(IgfsPath path) {
- return true;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a9b1fc2b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
index 01893fb..6c2d5c4 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
@@ -55,7 +55,6 @@ import org.apache.ignite.internal.processors.hadoop.impl.igfs.IgniteHadoopFileSy
import org.apache.ignite.internal.processors.hadoop.impl.igfs.IgniteHadoopFileSystemLoopbackExternalSecondarySelfTest;
import org.apache.ignite.internal.processors.hadoop.impl.igfs.IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest;
import org.apache.ignite.internal.processors.hadoop.impl.HadoopCommandLineTest;
-import org.apache.ignite.internal.processors.hadoop.impl.HadoopDefaultMapReducePlannerSelfTest;
import org.apache.ignite.internal.processors.hadoop.impl.HadoopFileSystemsTest;
import org.apache.ignite.internal.processors.hadoop.impl.HadoopGroupingTest;
import org.apache.ignite.internal.processors.hadoop.impl.HadoopJobTrackerSelfTest;
@@ -116,7 +115,6 @@ public class IgniteHadoopTestSuite extends TestSuite {
suite.addTest(new TestSuite(ldr.loadClass(HadoopUserLibsSelfTest.class.getName())));
- suite.addTest(new TestSuite(ldr.loadClass(HadoopDefaultMapReducePlannerSelfTest.class.getName())));
suite.addTest(new TestSuite(ldr.loadClass(HadoopWeightedMapReducePlannerTest.class.getName())));
suite.addTest(new TestSuite(ldr.loadClass(BasicUserNameMapperSelfTest.class.getName())));
[34/50] [abbrv] ignite git commit: IGNITE-3885 .NET: Add link to
Ignite.NET development page in readme.md
Posted by ag...@apache.org.
IGNITE-3885 .NET: Add link to Ignite.NET development page in readme.md
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/58188e81
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/58188e81
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/58188e81
Branch: refs/heads/ignite-3477
Commit: 58188e81b262c26f93b29f3facd3e77f4325e359
Parents: c4d67d2
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Jan 10 17:32:57 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Jan 10 17:32:57 2017 +0300
----------------------------------------------------------------------
modules/platforms/dotnet/README.md | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/58188e81/modules/platforms/dotnet/README.md
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/README.md b/modules/platforms/dotnet/README.md
index 528a219..cbdc7c9 100644
--- a/modules/platforms/dotnet/README.md
+++ b/modules/platforms/dotnet/README.md
@@ -147,4 +147,8 @@ You can find the full Apache Ignite documentation here: [Full documentation][doc
[apache-homepage]: https://ignite.apache.org/
[getting-started]: https://apacheignite-net.readme.io/docs/getting-started-2
-[docs]: https://apacheignite-net.readme.io/docs
\ No newline at end of file
+[docs]: https://apacheignite-net.readme.io/docs
+
+## Contribute to Ignite.NET
+
+See [Ignite.NET Development](https://cwiki.apache.org/confluence/display/IGNITE/Ignite.NET+Development) on wiki.
\ No newline at end of file
[49/50] [abbrv] ignite git commit: Merge branch ignite-2.0 into
ignite-db-x
Posted by ag...@apache.org.
Merge branch ignite-2.0 into ignite-db-x
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6f258b9d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6f258b9d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6f258b9d
Branch: refs/heads/ignite-3477
Commit: 6f258b9dd0c2d3aad6d30e09282da8b953d27a58
Parents: 0ee73fb f136542
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Jan 17 13:14:17 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Jan 17 13:14:17 2017 +0300
----------------------------------------------------------------------
modules/cloud/pom.xml | 6 +-
.../java/org/apache/ignite/IgniteLogger.java | 4 +-
.../apache/ignite/IgniteSystemProperties.java | 13 +
.../ignite/cache/affinity/AffinityKey.java | 4 +-
.../ignite/cache/query/SqlFieldsQuery.java | 6 +
.../configuration/HadoopConfiguration.java | 2 +-
.../configuration/IgniteConfiguration.java | 31 +
.../org/apache/ignite/events/CacheEvent.java | 6 +-
.../ignite/events/CacheQueryReadEvent.java | 8 +-
.../apache/ignite/hadoop/HadoopInputSplit.java | 54 ++
.../org/apache/ignite/hadoop/HadoopJob.java | 74 +++
.../ignite/hadoop/HadoopMapReducePlan.java | 80 +++
.../ignite/hadoop/HadoopMapReducePlanner.java | 40 ++
.../igfs/IgfsGroupDataBlocksKeyMapper.java | 17 +-
.../igfs/secondary/IgfsSecondaryFileSystem.java | 28 +
.../local/LocalIgfsSecondaryFileSystem.java | 130 +++-
.../ignite/internal/GridKernalContext.java | 7 +
.../ignite/internal/GridKernalContextImpl.java | 12 +
.../apache/ignite/internal/IgniteKernal.java | 3 +
.../org/apache/ignite/internal/IgnitionEx.java | 19 +
.../internal/binary/BinaryEnumObjectImpl.java | 10 +-
.../ignite/internal/binary/BinaryMetadata.java | 5 +-
.../internal/binary/BinaryObjectExImpl.java | 8 +-
.../igfs/common/IgfsHandshakeRequest.java | 17 -
.../internal/igfs/common/IgfsMarshaller.java | 2 -
.../managers/communication/GridIoManager.java | 2 +
.../managers/communication/GridIoPolicy.java | 3 +
.../cache/CacheInvokeDirectResult.java | 2 +-
.../processors/cache/CacheInvokeResult.java | 2 +-
.../processors/cache/CacheLazyEntry.java | 4 +-
.../processors/cache/CacheObjectAdapter.java | 7 +-
.../processors/cache/GridCacheAdapter.java | 5 +-
.../cache/GridCacheMvccCandidate.java | 9 +-
.../processors/cache/GridCacheReturn.java | 2 +-
.../processors/cache/IgniteCacheProxy.java | 2 +-
.../distributed/dht/GridDhtCacheAdapter.java | 2 +-
.../GridNearAtomicAbstractUpdateFuture.java | 34 +-
.../GridNearAtomicSingleUpdateFuture.java | 38 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 57 +-
.../distributed/near/GridNearLockFuture.java | 2 +-
.../cache/query/GridCacheQueryAdapter.java | 4 +-
.../cache/query/GridCacheQueryManager.java | 13 +-
.../cache/query/GridCacheQueryRequest.java | 2 +
.../cache/query/GridCacheSqlQuery.java | 6 +-
.../continuous/CacheContinuousQueryEvent.java | 10 +-
.../continuous/CacheContinuousQueryManager.java | 4 +-
.../store/GridCacheStoreManagerAdapter.java | 30 +-
.../cache/store/GridCacheWriteBehindStore.java | 2 +-
.../transactions/IgniteTxLocalAdapter.java | 11 +-
.../GridCacheVersionConflictContext.java | 2 +-
.../IgniteCacheObjectProcessorImpl.java | 5 +-
.../closure/GridClosureProcessor.java | 6 +-
.../continuous/GridContinuousMessage.java | 2 +-
.../datastreamer/DataStreamProcessor.java | 60 +-
.../datastreamer/DataStreamerImpl.java | 37 +-
.../datastructures/CollocatedSetItemKey.java | 2 +-
.../GridCacheAtomicLongValue.java | 2 +
.../GridCacheAtomicSequenceImpl.java | 2 +
.../GridCacheAtomicSequenceValue.java | 2 +
.../GridCacheCountDownLatchValue.java | 3 +
.../datastructures/GridCacheSetItemKey.java | 2 +-
.../processors/hadoop/HadoopDefaultJobInfo.java | 4 +-
.../processors/hadoop/HadoopFileBlock.java | 1 +
.../processors/hadoop/HadoopInputSplit.java | 54 --
.../internal/processors/hadoop/HadoopJob.java | 107 ---
.../internal/processors/hadoop/HadoopJobEx.java | 140 ++++
.../processors/hadoop/HadoopJobInfo.java | 54 +-
.../processors/hadoop/HadoopJobProperty.java | 9 +-
.../processors/hadoop/HadoopMapReducePlan.java | 80 ---
.../hadoop/HadoopMapReducePlanner.java | 40 --
.../processors/hadoop/HadoopTaskContext.java | 6 +-
.../processors/hadoop/HadoopTaskInfo.java | 1 +
.../hadoop/counter/HadoopCounterWriter.java | 4 +-
.../shuffle/HadoopDirectShuffleMessage.java | 34 +-
.../processors/igfs/IgfsBaseBlockKey.java | 42 ++
.../internal/processors/igfs/IgfsBlockKey.java | 26 +-
.../processors/igfs/IgfsBlockLocationImpl.java | 55 ++
.../processors/igfs/IgfsDataManager.java | 12 +-
.../internal/processors/igfs/IgfsImpl.java | 26 +-
.../processors/igfs/IgfsIpcHandler.java | 4 -
.../processors/igfs/IgfsKernalContextAware.java | 32 -
.../processors/igfs/IgfsMetaManager.java | 2 +-
.../igfs/IgfsSecondaryFileSystemImpl.java | 10 +-
.../igfs/IgfsSecondaryFileSystemV2.java | 40 --
.../local/LocalFileSystemBlockKey.java | 103 +++
.../local/LocalFileSystemIgfsFile.java | 10 +-
.../LocalFileSystemPositionedReadable.java | 65 ++
...fsSecondaryFileSystemPositionedReadable.java | 65 --
.../internal/processors/job/GridJobWorker.java | 7 +-
.../odbc/OdbcQueryExecuteRequest.java | 6 +-
.../platform/PlatformNativeException.java | 3 +-
.../internal/processors/pool/PoolProcessor.java | 5 +
.../processors/query/GridQueryProcessor.java | 37 +-
.../processors/resource/GridResourceIoc.java | 6 +-
.../resource/GridResourceProcessor.java | 31 +-
.../processors/rest/GridRestResponse.java | 2 +-
.../internal/util/future/GridFutureAdapter.java | 2 +-
.../util/lang/GridMetadataAwareAdapter.java | 2 +-
.../ignite/internal/util/nio/GridNioServer.java | 159 ++++-
.../util/tostring/GridToStringBuilder.java | 656 +++++++++++++++++--
.../util/tostring/GridToStringInclude.java | 12 +-
.../util/tostring/GridToStringThreadLocal.java | 12 +-
.../query/VisorQueryScanSubstringFilter.java | 5 +-
.../internal/visor/query/VisorQueryUtils.java | 60 ++
.../ignite/resources/FileSystemResource.java | 62 ++
.../communication/tcp/TcpCommunicationSpi.java | 20 +-
.../tcp/TcpCommunicationSpiMBean.java | 5 +-
.../apache/ignite/spi/indexing/IndexingSpi.java | 3 +
.../roundrobin/RoundRobinLoadBalancingSpi.java | 16 +-
.../resources/META-INF/classnames.properties | 5 +-
.../ignite/cache/store/jdbc/model/Person.java | 2 +-
...mmunicationBalancePairedConnectionsTest.java | 28 +
.../IgniteCommunicationBalanceTest.java | 25 +-
.../cache/CacheEntryProcessorCopySelfTest.java | 6 +-
.../GridCacheBinaryObjectsAbstractSelfTest.java | 7 +-
...cMessageRecoveryNoPairedConnectionsTest.java | 47 --
...micMessageRecoveryPairedConnectionsTest.java | 47 ++
.../GridCacheDhtEvictionsDisabledSelfTest.java | 5 +-
.../AtomicPutAllChangingTopologyTest.java | 212 ++++++
.../cache/query/IndexingSpiQuerySelfTest.java | 199 +++++-
.../DataStreamProcessorSelfTest.java | 104 +++
.../processors/igfs/IgfsAbstractSelfTest.java | 18 +-
.../igfs/IgfsDualAbstractSelfTest.java | 26 +-
...SecondaryFileSystemDualAbstractSelfTest.java | 5 -
...fsLocalSecondaryFileSystemProxySelfTest.java | 81 +++
...IgfsLocalSecondaryFileSystemTestAdapter.java | 7 +-
...gfsSecondaryFileSystemInjectionSelfTest.java | 270 ++++++++
.../tostring/GridToStringBuilderSelfTest.java | 33 +-
.../junits/GridTestKernalContext.java | 12 +-
.../IgniteCacheFailoverTestSuite.java | 3 +
.../ignite/testsuites/IgniteCacheTestSuite.java | 6 +-
.../ignite/testsuites/IgniteIgfsTestSuite.java | 3 +
.../apache/ignite/stream/flume/IgniteSink.java | 7 +-
modules/gce/pom.xml | 4 +-
.../fs/IgniteHadoopFileSystemCounterWriter.java | 6 +-
.../fs/IgniteHadoopIgfsSecondaryFileSystem.java | 23 +-
.../mapreduce/IgniteHadoopMapReducePlanner.java | 416 ------------
.../IgniteHadoopWeightedMapReducePlanner.java | 15 +-
.../planner/HadoopAbstractMapReducePlanner.java | 118 ++++
.../planner/HadoopTestRoundRobinMrPlanner.java | 75 +++
.../processors/hadoop/HadoopCommonUtils.java | 1 +
.../processors/hadoop/HadoopContext.java | 2 +
.../processors/hadoop/HadoopExternalSplit.java | 1 +
.../processors/hadoop/HadoopProcessor.java | 4 +-
.../processors/hadoop/HadoopSplitWrapper.java | 1 +
.../HadoopFileSystemCounterWriterDelegate.java | 4 +-
.../HadoopIgfsSecondaryFileSystemDelegate.java | 4 +-
.../hadoop/igfs/HadoopIgfsEndpoint.java | 38 +-
...doopFileSystemCounterWriterDelegateImpl.java | 4 +-
...doopIgfsSecondaryFileSystemDelegateImpl.java | 61 +-
.../hadoop/impl/igfs/HadoopIgfsJclLogger.java | 9 +-
.../hadoop/impl/igfs/HadoopIgfsOutProc.java | 24 +-
.../hadoop/impl/igfs/HadoopIgfsWrapper.java | 33 +-
.../hadoop/impl/v1/HadoopV1MapTask.java | 6 +-
.../hadoop/impl/v1/HadoopV1ReduceTask.java | 4 +-
.../hadoop/impl/v1/HadoopV1Splitter.java | 2 +-
.../hadoop/impl/v2/HadoopV2Context.java | 2 +-
.../processors/hadoop/impl/v2/HadoopV2Job.java | 15 +-
.../hadoop/impl/v2/HadoopV2Splitter.java | 2 +-
.../hadoop/impl/v2/HadoopV2TaskContext.java | 70 +-
.../hadoop/jobtracker/HadoopJobMetadata.java | 4 +-
.../hadoop/jobtracker/HadoopJobTracker.java | 32 +-
.../planner/HadoopAbstractMapReducePlanner.java | 116 ----
.../planner/HadoopDefaultMapReducePlan.java | 4 +-
.../hadoop/shuffle/HadoopShuffle.java | 4 +-
.../hadoop/shuffle/HadoopShuffleJob.java | 66 +-
.../shuffle/direct/HadoopDirectDataInput.java | 75 ++-
.../shuffle/direct/HadoopDirectDataOutput.java | 14 +
.../direct/HadoopDirectDataOutputContext.java | 48 +-
.../direct/HadoopDirectDataOutputState.java | 14 +-
.../shuffle/streams/HadoopDataInStream.java | 34 +-
.../shuffle/streams/HadoopOffheapBuffer.java | 18 +
.../HadoopEmbeddedTaskExecutor.java | 8 +-
.../hadoop/taskexecutor/HadoopRunnableTask.java | 6 +-
.../taskexecutor/HadoopTaskExecutorAdapter.java | 8 +-
.../external/HadoopExternalTaskExecutor.java | 16 +-
.../child/HadoopChildProcessRunner.java | 4 +-
.../resources/META-INF/classnames.properties | 8 +
.../impl/HadoopAbstractMapReduceTest.java | 2 +-
.../hadoop/impl/HadoopAbstractSelfTest.java | 3 +-
.../hadoop/impl/HadoopCommandLineTest.java | 4 +-
.../HadoopDefaultMapReducePlannerSelfTest.java | 619 -----------------
.../hadoop/impl/HadoopJobTrackerSelfTest.java | 1 +
.../hadoop/impl/HadoopPlannerMockJob.java | 10 +-
.../impl/HadoopTaskExecutionSelfTest.java | 19 +-
.../hadoop/impl/HadoopTasksAllVersionsTest.java | 16 +-
.../hadoop/impl/HadoopTasksV1Test.java | 4 +-
.../hadoop/impl/HadoopTasksV2Test.java | 4 +-
.../hadoop/impl/HadoopTeraSortTest.java | 32 +-
.../impl/HadoopTestRoundRobinMrPlanner.java | 75 ---
.../hadoop/impl/HadoopTestTaskContext.java | 6 +-
.../hadoop/impl/HadoopV2JobSelfTest.java | 6 +-
.../HadoopWeightedMapReducePlannerTest.java | 6 +-
.../client/HadoopClientProtocolSelfTest.java | 2 +-
.../impl/igfs/Hadoop1DualAbstractTest.java | 7 +-
.../impl/igfs/Hadoop1OverIgfsProxyTest.java | 67 ++
.../igfs/HadoopFIleSystemFactorySelfTest.java | 6 +-
...Igfs20FileSystemLoopbackPrimarySelfTest.java | 2 +-
...oopIgfs20FileSystemShmemPrimarySelfTest.java | 2 +-
.../igfs/HadoopIgfsDualAbstractSelfTest.java | 6 +-
...oopSecondaryFileSystemConfigurationTest.java | 4 +-
.../hadoop/impl/igfs/IgfsEventsTestSuite.java | 4 +-
.../IgniteHadoopFileSystemAbstractSelfTest.java | 4 +-
.../IgniteHadoopFileSystemClientSelfTest.java | 2 +-
...IgniteHadoopFileSystemHandshakeSelfTest.java | 32 +-
...niteHadoopFileSystemLoggerStateSelfTest.java | 6 +-
...condaryFileSystemInitializationSelfTest.java | 4 +-
.../collections/HadoopAbstractMapTest.java | 4 +-
.../streams/HadoopDataStreamSelfTest.java | 177 ++++-
.../testsuites/IgniteHadoopTestSuite.java | 4 +-
...niteCacheAbstractInsertSqlQuerySelfTest.java | 14 +-
.../IgniteCacheAbstractSqlDmlQuerySelfTest.java | 6 +-
.../IgniteCacheInsertSqlQuerySelfTest.java | 18 +-
.../cache/IgniteCacheMergeSqlQuerySelfTest.java | 14 +-
.../IgniteCacheUpdateSqlQuerySelfTest.java | 4 +-
.../org/apache/ignite/logger/jcl/JclLogger.java | 9 +-
modules/platforms/cpp/binary/Makefile.am | 2 +-
.../ignite/impl/binary/binary_type_manager.h | 2 +-
.../src/impl/binary/binary_type_manager.cpp | 6 +-
.../binary/src/impl/interop/interop_memory.cpp | 2 +-
modules/platforms/cpp/common/Makefile.am | 2 +-
.../include/ignite/common/dynamic_size_array.h | 2 +-
.../cpp/common/project/vs/common.vcxproj | 1 +
modules/platforms/cpp/configure.ac | 2 +-
modules/platforms/cpp/configure.acrel | 2 +-
modules/platforms/cpp/core-test/Makefile.am | 2 +-
.../cpp/core-test/src/cache_query_test.cpp | 8 +-
.../cpp/core-test/src/reference_test.cpp | 14 +-
modules/platforms/cpp/core/Makefile.am | 2 +-
.../cache/query/continuous/continuous_query.h | 8 +-
.../include/ignite/cache/query/query_cursor.h | 4 +-
.../query/continuous/continuous_query_impl.h | 8 +-
.../core/include/ignite/impl/handle_registry.h | 2 +-
.../cpp/core/include/ignite/impl/operations.h | 4 +-
.../cpp/core/src/impl/cache/cache_impl.cpp | 5 +-
.../cpp/core/src/impl/handle_registry.cpp | 2 +-
modules/platforms/cpp/examples/configure.ac | 2 +-
.../cpp/examples/odbc-example/Makefile.am | 2 +-
.../cpp/examples/putget-example/Makefile.am | 2 +-
.../cpp/examples/query-example/Makefile.am | 2 +-
modules/platforms/cpp/ignite/Makefile.am | 2 +-
modules/platforms/cpp/jni/Makefile.am | 2 +-
.../platforms/cpp/jni/project/vs/jni.vcxproj | 1 +
modules/platforms/cpp/jni/src/java.cpp | 2 +-
modules/platforms/cpp/odbc-test/Makefile.am | 2 +-
.../cpp/odbc-test/config/queries-default.xml | 1 +
.../odbc-test/include/sql_test_suite_fixture.h | 3 +
.../platforms/cpp/odbc-test/include/test_type.h | 20 +-
.../cpp/odbc-test/src/api_robustness_test.cpp | 113 +++-
.../platforms/cpp/odbc-test/src/column_test.cpp | 189 ++++++
.../odbc-test/src/sql_test_suite_fixture.cpp | 17 +
.../cpp/odbc-test/src/sql_types_test.cpp | 131 ++++
modules/platforms/cpp/odbc/Makefile.am | 5 +-
modules/platforms/cpp/odbc/include/Makefile.am | 3 +-
.../cpp/odbc/include/ignite/odbc/common_types.h | 29 +-
.../ignite/odbc/config/connection_info.h | 2 -
.../cpp/odbc/include/ignite/odbc/log.h | 123 ++++
.../odbc/include/ignite/odbc/meta/column_meta.h | 2 -
.../cpp/odbc/include/ignite/odbc/statement.h | 143 +++-
.../cpp/odbc/include/ignite/odbc/utility.h | 26 +-
.../cpp/odbc/install/ignite-odbc-amd64.wxs | 2 +-
.../cpp/odbc/install/ignite-odbc-x86.wxs | 2 +-
.../odbc/os/linux/src/system/socket_client.cpp | 9 +-
.../odbc/os/win/src/system/socket_client.cpp | 9 +-
.../src/system/ui/dsn_configuration_window.cpp | 18 +-
.../cpp/odbc/os/win/src/system_dsn.cpp | 17 +-
.../platforms/cpp/odbc/project/vs/odbc.vcxproj | 2 +
.../cpp/odbc/project/vs/odbc.vcxproj.filters | 6 +
modules/platforms/cpp/odbc/src/column.cpp | 28 +-
.../cpp/odbc/src/config/connection_info.cpp | 9 +-
modules/platforms/cpp/odbc/src/connection.cpp | 21 +-
.../odbc/src/diagnostic/diagnosable_adapter.cpp | 3 +-
.../odbc/src/diagnostic/diagnostic_record.cpp | 38 ++
modules/platforms/cpp/odbc/src/entry_points.cpp | 52 +-
modules/platforms/cpp/odbc/src/log.cpp | 83 +++
.../platforms/cpp/odbc/src/meta/column_meta.cpp | 4 -
modules/platforms/cpp/odbc/src/odbc.cpp | 286 ++++----
.../odbc/src/query/column_metadata_query.cpp | 13 +-
.../platforms/cpp/odbc/src/query/data_query.cpp | 23 +-
.../cpp/odbc/src/query/table_metadata_query.cpp | 12 +-
modules/platforms/cpp/odbc/src/statement.cpp | 187 +++++-
modules/platforms/cpp/odbc/src/utility.cpp | 29 +-
.../Apache.Ignite.AspNet.Tests.csproj | 7 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Apache.Ignite.AspNet.csproj | 5 +
.../Properties/AssemblyInfo.cs | 4 +-
.../Apache.Ignite.Benchmarks.csproj | 5 +
.../Properties/AssemblyInfo.cs | 4 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Apache.Ignite.Core.Tests.TestDll.csproj | 5 +
.../Properties/AssemblyInfo.cs | 4 +-
.../Apache.Ignite.Core.Tests.csproj | 7 +
.../Cache/CacheAbstractTest.cs | 627 +-----------------
.../Cache/CacheAbstractTransactionalTest.cs | 565 ++++++++++++++++
.../Cache/CacheLocalAtomicTest.cs | 5 -
.../Cache/CacheLocalTest.cs | 6 +-
.../CachePartitionedAtomicNearEnabledTest.cs | 5 -
.../Cache/CachePartitionedAtomicTest.cs | 5 -
.../Cache/CachePartitionedNearEnabledTest.cs | 7 +-
.../Cache/CachePartitionedTest.cs | 7 +-
.../Cache/CacheReplicatedAtomicTest.cs | 5 -
.../Cache/CacheReplicatedTest.cs | 7 +-
.../Query/CacheQueriesCodeConfigurationTest.cs | 4 +-
.../Log/ConcurrentMemoryTarget.cs | 73 +++
.../Log/NLogLoggerTest.cs | 5 +-
.../Apache.Ignite.Core.Tests/MessagingTest.cs | 6 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Apache.Ignite.Core.Tests/ReconnectTest.cs | 5 +
.../Apache.Ignite.Core.Tests/TestUtils.cs | 1 -
.../Apache.Ignite.Core.csproj | 16 +-
.../Impl/Binary/BinaryReader.cs | 16 +-
.../Impl/Transactions/TransactionsImpl.cs | 18 +
.../Impl/Unmanaged/UnmanagedUtils.cs | 4 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Transactions/ITransactions.cs | 19 +-
.../Apache.Ignite.EntityFramework.Tests.csproj | 5 +
.../Properties/AssemblyInfo.cs | 4 +-
.../Apache.Ignite.EntityFramework.csproj | 9 +-
.../Impl/ArrayDbDataReader.cs | 5 +
.../Impl/DataReaderResult.cs | 2 +
.../Impl/DbCommandInfo.cs | 11 +
.../Impl/DbCommandProxy.cs | 1 +
.../Properties/AssemblyInfo.cs | 4 +-
.../Apache.Ignite.Linq.csproj | 5 +
.../Properties/AssemblyInfo.cs | 4 +-
.../Apache.Ignite.Log4Net.csproj | 5 +
.../IgniteLog4NetLogger.cs | 16 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Apache.Ignite.NLog.csproj | 5 +
.../Properties/AssemblyInfo.cs | 4 +-
modules/platforms/dotnet/Apache.Ignite.sln | 3 +
.../dotnet/Apache.Ignite/Apache.Ignite.csproj | 5 +
.../Apache.Ignite/Properties/AssemblyInfo.cs | 4 +-
modules/platforms/dotnet/README.md | 6 +-
modules/platforms/dotnet/build.ps1 | 2 +-
.../Apache.Ignite.Examples.csproj | 3 +
.../examples/Apache.Ignite.Examples/App.config | 2 +
.../DataStructures/AtomicSequenceExample.cs | 26 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Apache.Ignite.ExamplesDll.csproj | 4 +
.../Properties/AssemblyInfo.cs | 4 +-
.../Services/MapService.cs | 2 -
.../apache/ignite/logger/slf4j/Slf4jLogger.java | 11 +-
modules/web-console/backend/app/mongo.js | 19 +
.../generator/AbstractTransformer.js | 5 +
.../modules/configuration/generator/Beans.js | 4 +
.../generator/ConfigurationGenerator.js | 36 +
.../states/configuration/caches/affinity.jade | 82 +++
.../states/configuration/caches/memory.jade | 4 +-
.../frontend/views/configuration/caches.jade | 1 +
.../yardstick/cache/IgniteIoTestBenchmark.java | 73 ---
parent/pom.xml | 2 +-
352 files changed, 6795 insertions(+), 3698 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
index 7f3f5e4,9fd6bc1..a17f755
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
@@@ -29,9 -29,9 +29,10 @@@ import org.apache.ignite.binary.BinaryO
import org.apache.ignite.binary.BinaryType;
import org.apache.ignite.internal.GridDirectTransient;
import org.apache.ignite.internal.processors.cache.CacheObject;
+import org.apache.ignite.internal.processors.cache.CacheObjectAdapter;
import org.apache.ignite.internal.processors.cache.CacheObjectContext;
import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
+ import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.SB;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.plugin.extensions.communication.MessageReader;
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectAdapter.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectAdapter.java
index a34e98d,09a5524..1f13c6f
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectAdapter.java
@@@ -22,9 -22,9 +22,10 @@@ import java.io.IOException
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.nio.ByteBuffer;
+import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.GridDirectTransient;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
+ import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.plugin.extensions.communication.MessageReader;
import org.apache.ignite.plugin.extensions.communication.MessageWriter;
@@@ -142,70 -120,8 +143,72 @@@ public abstract class CacheObjectAdapte
/** {@inheritDoc} */
public String toString() {
- return getClass().getSimpleName() + " [val=" + val + ", hasValBytes=" + (valBytes != null) + ']';
+ return S.toString(S.INCLUDE_SENSITIVE ? getClass().getSimpleName() : "CacheObject",
+ "val", val, true,
+ "hasValBytes", valBytes != null, false);
}
+
+ /**
+ * @param dataLen Serialized value length.
+ * @return Full size required to store cache object.
+ * @see #putValue(byte, ByteBuffer, int, int, byte[], int)
+ */
+ public static int objectPutSize(int dataLen) {
+ return dataLen + 5;
+ }
+
+ /**
+ * @param cacheObjType Cache object type.
+ * @param buf Buffer to write value to.
+ * @param off Offset in source binary data.
+ * @param len Length of the data to write.
+ * @param valBytes Binary data.
+ * @param start Start offset in binary data.
+ * @return {@code True} if data were successfully written.
+ * @throws IgniteCheckedException If failed.
+ */
+ public static boolean putValue(byte cacheObjType, final ByteBuffer buf, int off, int len,
+ byte[] valBytes, final int start) throws IgniteCheckedException {
+ int dataLen = valBytes.length;
+
+ if (buf.remaining() < len)
+ return false;
+
+ final int headSize = 5; // 4 bytes len + 1 byte type
+
+ if (off == 0 && len >= headSize) {
+ buf.putInt(dataLen);
+ buf.put(cacheObjType);
+
+ len -= headSize;
+ }
+ else if (off >= headSize)
+ off -= headSize;
+ else {
+ // Partial header write.
+ final ByteBuffer head = ByteBuffer.allocate(headSize);
+
+ head.order(buf.order());
+
+ head.putInt(dataLen);
+ head.put(cacheObjType);
+
+ head.position(off);
+
+ if (len < head.capacity())
+ head.limit(off + Math.min(len, head.capacity() - off));
+
+ buf.put(head);
+
+ if (head.limit() < headSize)
+ return true;
+
+ len -= headSize - off;
+ off = 0;
+ }
+
+ buf.put(valBytes, start + off, len);
+
+ return true;
+ }
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheSqlQuery.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEvent.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEvent.java
index 3922e3e,eddf302..e664554
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEvent.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEvent.java
@@@ -99,10 -99,9 +99,10 @@@ class CacheContinuousQueryEvent<K, V> e
/** {@inheritDoc} */
@Override public String toString() {
return S.toString(CacheContinuousQueryEvent.class, this,
- "evtType", getEventType(),
- "key", getKey(),
- "newVal", getValue(),
- "oldVal", getOldValue(),
- "partCntr", getPartitionUpdateCounter());
+ "evtType", getEventType(), false,
+ "key", getKey(), true,
+ "newVal", getValue(), true,
- "oldVal", getOldValue(), true);
++ "oldVal", getOldValue(), true,
++ "partCntr", getPartitionUpdateCounter(), false);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
index 253197d,a830186..b3645ea
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
@@@ -562,11 -562,14 +563,14 @@@ public abstract class GridCacheStoreMan
if (key instanceof GridCacheInternal)
return true;
- key = cctx.unwrapBinaryIfNeeded(key, !convertBinary());
- val = cctx.unwrapBinaryIfNeeded(val, !convertBinary());
+ Object key0 = cctx.unwrapBinaryIfNeeded(key, !convertBinary());
+ Object val0 = cctx.unwrapBinaryIfNeeded(val, !convertBinary());
- if (log.isDebugEnabled())
- log.debug("Storing value in cache store [key=" + key0 + ", val=" + val0 + ']');
+ if (log.isDebugEnabled()) {
+ log.debug(S.toString("Storing value in cache store",
- "key", key, true,
- "val", val, true));
++ "key", key0, true,
++ "val", val0, true));
+ }
sessionInit0(tx);
@@@ -590,8 -593,11 +594,11 @@@
sessionEnd0(tx, threwEx);
}
- if (log.isDebugEnabled())
- log.debug("Stored value in cache store [key=" + key0 + ", val=" + val0 + ']');
+ if (log.isDebugEnabled()) {
+ log.debug(S.toString("Stored value in cache store",
- "key", key, true,
- "val", val, true));
++ "key", key0, true,
++ "val", val0, true));
+ }
return true;
}
@@@ -668,10 -671,10 +675,10 @@@
if (key instanceof GridCacheInternal)
return false;
- key = cctx.unwrapBinaryIfNeeded(key, !convertBinary());
+ Object key0 = cctx.unwrapBinaryIfNeeded(key, !convertBinary());
if (log.isDebugEnabled())
- log.debug("Removing value from cache store [key=" + key0 + ']');
- log.debug(S.toString("Removing value from cache store", "key", key, true));
++ log.debug(S.toString("Removing value from cache store", "key", key0, true));
sessionInit0(tx);
@@@ -696,7 -699,7 +703,7 @@@
}
if (log.isDebugEnabled())
- log.debug("Removed value from cache store [key=" + key0 + ']');
- log.debug(S.toString("Removed value from cache store", "key", key, true));
++ log.debug(S.toString("Removed value from cache store", "key", key0, true));
return true;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
index c2692d0,614c612..ca6ef90
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
@@@ -299,9 -242,10 +299,8 @@@ public class IgniteCacheObjectProcessor
@Override public CacheObjectContext contextForCache(CacheConfiguration ccfg) throws IgniteCheckedException {
assert ccfg != null;
- boolean storeVal = ctx.config().isPeerClassLoadingEnabled() ||
- GridQueryProcessor.isEnabled(ccfg) ||
- !ccfg.isCopyOnRead();
- CacheMemoryMode memMode = ccfg.getMemoryMode();
-
+ boolean storeVal = !ccfg.isCopyOnRead() || (!isBinaryEnabled(ccfg) &&
+ (GridQueryProcessor.isEnabled(ccfg) || ctx.config().isPeerClassLoadingEnabled()));
CacheObjectContext res = new CacheObjectContext(ctx,
ccfg.getName(),
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 5200907,3286bac..cf85a52
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@@ -1128,16 -1055,15 +1143,18 @@@ public class GridQueryProcessor extend
if (log.isDebugEnabled())
log.debug("Remove [space=" + space + ", key=" + key + ", val=" + val + "]");
+ CacheObjectContext coctx = null;
+
if (ctx.indexing().enabled()) {
- CacheObjectContext coctx = cacheObjectContext(space);
+ coctx = cacheObjectContext(space);
- ctx.indexing().remove(space, key.value(coctx, false));
+ Object key0 = unwrap(key, coctx);
+
+ ctx.indexing().remove(space, key0);
}
- if (idx == null)
+ // If val == null we only need to call SPI.
+ if (idx == null || val == null)
return;
if (!busyLock.enterBusy())
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f258b9d/modules/hadoop/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --cc modules/hadoop/src/main/resources/META-INF/classnames.properties
index 051094d,f528107..d8848ac
--- a/modules/hadoop/src/main/resources/META-INF/classnames.properties
+++ b/modules/hadoop/src/main/resources/META-INF/classnames.properties
@@@ -26,9 -26,20 +26,17 @@@ org.apache.ignite.hadoop.util.KerberosU
org.apache.ignite.hadoop.util.KerberosUserNameMapper$State
org.apache.ignite.hadoop.util.UserNameMapper
org.apache.ignite.internal.processors.hadoop.HadoopAttributes
-org.apache.ignite.internal.processors.hadoop.HadoopDefaultJobInfo
org.apache.ignite.internal.processors.hadoop.HadoopExternalSplit
+ org.apache.ignite.internal.processors.hadoop.HadoopFileBlock
+ org.apache.ignite.hadoop.HadoopInputSplit
+ org.apache.ignite.internal.processors.hadoop.HadoopJobId
+ org.apache.ignite.internal.processors.hadoop.HadoopJobInfo
+ org.apache.ignite.internal.processors.hadoop.HadoopJobPhase
+ org.apache.ignite.internal.processors.hadoop.HadoopJobProperty
+ org.apache.ignite.internal.processors.hadoop.HadoopJobStatus
+ org.apache.ignite.hadoop.HadoopMapReducePlan
org.apache.ignite.internal.processors.hadoop.HadoopSplitWrapper
org.apache.ignite.internal.processors.hadoop.HadoopTaskCancelledException
-org.apache.ignite.internal.processors.hadoop.HadoopTaskInfo
-org.apache.ignite.internal.processors.hadoop.HadoopTaskType
org.apache.ignite.internal.processors.hadoop.counter.HadoopCounterAdapter
org.apache.ignite.internal.processors.hadoop.counter.HadoopCountersImpl
org.apache.ignite.internal.processors.hadoop.counter.HadoopCountersImpl$CounterKey
[11/50] [abbrv] ignite git commit: IGNITE-3961: IGFS: Added
IgfsSecondaryFileSystem.affintiy() method. This closes #1114. This closes
#1252.
Posted by ag...@apache.org.
IGNITE-3961: IGFS: Added IgfsSecondaryFileSystem.affintiy() method. This closes #1114. This closes #1252.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2df39a80
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2df39a80
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2df39a80
Branch: refs/heads/ignite-3477
Commit: 2df39a80d80e2575be61a902ccd48615796fcde9
Parents: a61b0ea
Author: tledkov-gridgain <tl...@gridgain.com>
Authored: Wed Dec 28 16:47:24 2016 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Wed Dec 28 16:47:24 2016 +0300
----------------------------------------------------------------------
.../igfs/IgfsGroupDataBlocksKeyMapper.java | 17 +-
.../igfs/secondary/IgfsSecondaryFileSystem.java | 18 ++
.../local/LocalIgfsSecondaryFileSystem.java | 96 ++++++-
.../processors/igfs/IgfsBaseBlockKey.java | 42 +++
.../internal/processors/igfs/IgfsBlockKey.java | 26 +-
.../processors/igfs/IgfsBlockLocationImpl.java | 55 ++++
.../processors/igfs/IgfsDataManager.java | 12 +-
.../internal/processors/igfs/IgfsImpl.java | 12 +-
.../processors/igfs/IgfsKernalContextAware.java | 32 ---
.../igfs/IgfsSecondaryFileSystemImpl.java | 7 +
.../local/LocalFileSystemBlockKey.java | 103 +++++++
.../LocalFileSystemPositionedReadable.java | 65 +++++
...fsSecondaryFileSystemPositionedReadable.java | 65 -----
.../processors/resource/GridResourceIoc.java | 6 +-
.../resource/GridResourceProcessor.java | 31 ++-
.../ignite/resources/FileSystemResource.java | 62 +++++
.../processors/igfs/IgfsAbstractSelfTest.java | 2 +-
.../igfs/IgfsDualAbstractSelfTest.java | 14 +-
...fsLocalSecondaryFileSystemProxySelfTest.java | 81 ++++++
...gfsSecondaryFileSystemInjectionSelfTest.java | 270 +++++++++++++++++++
.../ignite/testsuites/IgniteIgfsTestSuite.java | 3 +
.../fs/IgniteHadoopIgfsSecondaryFileSystem.java | 21 +-
...doopIgfsSecondaryFileSystemDelegateImpl.java | 61 ++++-
.../impl/igfs/Hadoop1OverIgfsProxyTest.java | 67 +++++
.../testsuites/IgniteHadoopTestSuite.java | 2 +
25 files changed, 1031 insertions(+), 139 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/igfs/IgfsGroupDataBlocksKeyMapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsGroupDataBlocksKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsGroupDataBlocksKeyMapper.java
index b35b692..09143d4 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsGroupDataBlocksKeyMapper.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsGroupDataBlocksKeyMapper.java
@@ -18,9 +18,10 @@
package org.apache.ignite.igfs;
import org.apache.ignite.internal.processors.cache.GridCacheDefaultAffinityKeyMapper;
-import org.apache.ignite.internal.processors.igfs.IgfsBlockKey;
+import org.apache.ignite.internal.processors.igfs.IgfsBaseBlockKey;
import org.apache.ignite.internal.util.typedef.internal.A;
import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteUuid;
/**
* {@code IGFS} class providing ability to group file's data blocks together on one node.
@@ -84,15 +85,17 @@ public class IgfsGroupDataBlocksKeyMapper extends GridCacheDefaultAffinityKeyMap
/** {@inheritDoc} */
@Override public Object affinityKey(Object key) {
- if (key != null && IgfsBlockKey.class.equals(key.getClass())) {
- IgfsBlockKey blockKey = (IgfsBlockKey)key;
+ if (key instanceof IgfsBaseBlockKey) {
+ IgfsBaseBlockKey blockKey = (IgfsBaseBlockKey)key;
- if (blockKey.affinityKey() != null)
- return blockKey.affinityKey();
+ IgniteUuid affKey = blockKey.affinityKey();
- long grpId = blockKey.getBlockId() / grpSize;
+ if (affKey != null)
+ return affKey;
- return blockKey.getFileId().hashCode() + (int)(grpId ^ (grpId >>> 32));
+ long grpId = blockKey.blockId() / grpSize;
+
+ return blockKey.fileHash() + (int)(grpId ^ (grpId >>> 32));
}
return super.affinityKey(key);
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java b/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java
index 37c9c7d..76ba454 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java
@@ -21,8 +21,10 @@ import java.io.OutputStream;
import java.util.Collection;
import java.util.Map;
import org.apache.ignite.IgniteException;
+import org.apache.ignite.igfs.IgfsBlockLocation;
import org.apache.ignite.igfs.IgfsFile;
import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.igfs.IgfsPathNotFoundException;
import org.jetbrains.annotations.Nullable;
/**
@@ -202,4 +204,20 @@ public interface IgfsSecondaryFileSystem {
* @throws IgniteException If failed.
*/
public void setTimes(IgfsPath path, long accessTime, long modificationTime) throws IgniteException;
+
+ /**
+ * Get affinity block locations for data blocks of the file. In case {@code maxLen} parameter is set and
+ * particular block location length is greater than this value, block locations will be split into smaller
+ * chunks.
+ *
+ * @param path File path to get affinity for.
+ * @param start Position in the file to start affinity resolution from.
+ * @param len Size of data in the file to resolve affinity for.
+ * @param maxLen Maximum length of a single returned block location length.
+ * @return Affinity block locations.
+ * @throws IgniteException In case of error.
+ * @throws IgfsPathNotFoundException If path doesn't exist.
+ */
+ public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len, long maxLen)
+ throws IgniteException;
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/igfs/secondary/local/LocalIgfsSecondaryFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/secondary/local/LocalIgfsSecondaryFileSystem.java b/modules/core/src/main/java/org/apache/ignite/igfs/secondary/local/LocalIgfsSecondaryFileSystem.java
index 18d31de..86f7387 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/secondary/local/LocalIgfsSecondaryFileSystem.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/secondary/local/LocalIgfsSecondaryFileSystem.java
@@ -17,10 +17,14 @@
package org.apache.ignite.igfs.secondary.local;
+import java.util.ArrayList;
import java.nio.file.attribute.BasicFileAttributeView;
import java.nio.file.attribute.FileTime;
import java.util.concurrent.TimeUnit;
import org.apache.ignite.IgniteException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.igfs.IgfsBlockLocation;
import org.apache.ignite.igfs.IgfsException;
import org.apache.ignite.igfs.IgfsFile;
import org.apache.ignite.igfs.IgfsPath;
@@ -29,14 +33,20 @@ import org.apache.ignite.igfs.IgfsPathIsNotDirectoryException;
import org.apache.ignite.igfs.IgfsPathNotFoundException;
import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystemPositionedReadable;
+import org.apache.ignite.internal.processors.igfs.IgfsDataManager;
+import org.apache.ignite.internal.processors.igfs.IgfsImpl;
+import org.apache.ignite.internal.processors.igfs.secondary.local.LocalFileSystemBlockKey;
import org.apache.ignite.internal.processors.igfs.IgfsUtils;
+import org.apache.ignite.internal.processors.igfs.IgfsBlockLocationImpl;
import org.apache.ignite.internal.processors.igfs.secondary.local.LocalFileSystemIgfsFile;
import org.apache.ignite.internal.processors.igfs.secondary.local.LocalFileSystemSizeVisitor;
import org.apache.ignite.internal.processors.igfs.secondary.local.LocalFileSystemUtils;
-import org.apache.ignite.internal.processors.igfs.secondary.local.LocalIgfsSecondaryFileSystemPositionedReadable;
+import org.apache.ignite.internal.processors.igfs.secondary.local.LocalFileSystemPositionedReadable;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lifecycle.LifecycleAware;
+import org.apache.ignite.resources.FileSystemResource;
+import org.apache.ignite.resources.LoggerResource;
import org.jetbrains.annotations.Nullable;
import java.io.File;
@@ -61,6 +71,16 @@ public class LocalIgfsSecondaryFileSystem implements IgfsSecondaryFileSystem, Li
/** Path that will be added to each passed path. */
private String workDir;
+ /** Logger. */
+ @SuppressWarnings("unused")
+ @LoggerResource
+ private IgniteLogger log;
+
+ /** IGFS instance. */
+ @SuppressWarnings("unused")
+ @FileSystemResource
+ private IgfsImpl igfs;
+
/**
* Heuristically checks if exception was caused by invalid HDFS version and returns appropriate exception.
*
@@ -258,7 +278,7 @@ public class LocalIgfsSecondaryFileSystem implements IgfsSecondaryFileSystem, Li
try {
FileInputStream in = new FileInputStream(fileForPath(path));
- return new LocalIgfsSecondaryFileSystemPositionedReadable(in, bufSize);
+ return new LocalFileSystemPositionedReadable(in, bufSize);
}
catch (IOException e) {
throw handleSecondaryFsError(e, "Failed to open file for read: " + path);
@@ -402,6 +422,78 @@ public class LocalIgfsSecondaryFileSystem implements IgfsSecondaryFileSystem, Li
// No-op.
}
+ /** {@inheritDoc} */
+ @Override public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len,
+ long maxLen) throws IgniteException {
+ File f = fileForPath(path);
+
+ if (!f.exists())
+ throw new IgfsPathNotFoundException("File not found: " + path);
+
+ // Create fake block & fake affinity for blocks
+ long blockSize = igfs.configuration().getBlockSize();
+
+ if (maxLen <= 0)
+ maxLen = Long.MAX_VALUE;
+
+ assert maxLen > 0 : "maxLen : " + maxLen;
+
+ long end = start + len;
+
+ Collection<IgfsBlockLocation> blocks = new ArrayList<>((int)(len / maxLen));
+
+ IgfsDataManager data = igfs.context().data();
+
+ Collection<ClusterNode> lastNodes = null;
+
+ long lastBlockIdx = -1;
+
+ IgfsBlockLocationImpl lastBlock = null;
+
+ for (long offset = start; offset < end; ) {
+ long blockIdx = offset / blockSize;
+
+ // Each step is min of maxLen and end of block.
+ long lenStep = Math.min(
+ maxLen - (lastBlock != null ? lastBlock.length() : 0),
+ (blockIdx + 1) * blockSize - offset);
+
+ lenStep = Math.min(lenStep, end - offset);
+
+ // Create fake affinity key to map blocks of secondary filesystem to nodes.
+ LocalFileSystemBlockKey affKey = new LocalFileSystemBlockKey(path, blockIdx);
+
+ if (blockIdx != lastBlockIdx) {
+ Collection<ClusterNode> nodes = data.affinityNodes(affKey);
+
+ if (!nodes.equals(lastNodes) && lastNodes != null && lastBlock != null) {
+ blocks.add(lastBlock);
+
+ lastBlock = null;
+ }
+
+ lastNodes = nodes;
+
+ lastBlockIdx = blockIdx;
+ }
+
+ if(lastBlock == null)
+ lastBlock = new IgfsBlockLocationImpl(offset, lenStep, lastNodes);
+ else
+ lastBlock.increaseLength(lenStep);
+
+ if (lastBlock.length() == maxLen || lastBlock.start() + lastBlock.length() == end) {
+ blocks.add(lastBlock);
+
+ lastBlock = null;
+ }
+
+ offset += lenStep;
+ }
+
+ return blocks;
+ }
+
/**
* Get work directory.
*
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBaseBlockKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBaseBlockKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBaseBlockKey.java
new file mode 100644
index 0000000..05ef086
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBaseBlockKey.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.igfs;
+
+import org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper;
+import org.apache.ignite.lang.IgniteUuid;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * The base class to block key that is used by the {@link IgfsGroupDataBlocksKeyMapper}
+ */
+public interface IgfsBaseBlockKey {
+ /**
+ * @return Block ID.
+ */
+ public long blockId();
+
+ /**
+ * @return Hash based on a file identifier (path, ID, etc).
+ */
+ public int fileHash();
+
+ /**
+ * @return Block affinity key (if any).
+ */
+ @Nullable public IgniteUuid affinityKey();
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
index c366ae3..414f6b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
@@ -44,8 +44,8 @@ import org.jetbrains.annotations.Nullable;
/**
* File's binary data block key.
*/
-@GridInternal
-public final class IgfsBlockKey implements Message, Externalizable, Binarylizable, Comparable<IgfsBlockKey> {
+public final class IgfsBlockKey implements IgfsBaseBlockKey, Message, Externalizable, Binarylizable,
+ Comparable<IgfsBlockKey> {
/** */
private static final long serialVersionUID = 0L;
@@ -93,13 +93,21 @@ public final class IgfsBlockKey implements Message, Externalizable, Binarylizabl
return fileId;
}
- /**
- * @return Block affinity key.
- */
- public IgniteUuid affinityKey() {
+ /** {@inheritDoc} */
+ @Override public IgniteUuid affinityKey() {
return affKey;
}
+ /** {@inheritDoc} */
+ @Override public long blockId() {
+ return blockId;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int fileHash() {
+ return fileId.hashCode();
+ }
+
/**
* @return Evict exclude flag.
*/
@@ -107,12 +115,6 @@ public final class IgfsBlockKey implements Message, Externalizable, Binarylizabl
return evictExclude;
}
- /**
- * @return Block ID.
- */
- public long getBlockId() {
- return blockId;
- }
/** {@inheritDoc} */
@Override public void onAckReceived() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockLocationImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockLocationImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockLocationImpl.java
index 2d4a0af..3f5d9fb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockLocationImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockLocationImpl.java
@@ -24,6 +24,7 @@ import java.io.ObjectOutput;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.UUID;
import org.apache.ignite.IgniteCheckedException;
@@ -39,6 +40,7 @@ import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
+import org.jetbrains.annotations.NotNull;
/**
* File block location in the grid.
@@ -61,6 +63,7 @@ public class IgfsBlockLocationImpl implements IgfsBlockLocation, Externalizable,
private Collection<String> names;
/** */
+ @GridToStringInclude
private Collection<String> hosts;
/**
@@ -102,6 +105,44 @@ public class IgfsBlockLocationImpl implements IgfsBlockLocation, Externalizable,
}
/**
+ * @param start Start.
+ * @param len Length.
+ * @param block Block.
+ */
+ public IgfsBlockLocationImpl(long start, long len, IgfsBlockLocation block) {
+ assert start >= 0;
+ assert len > 0;
+
+ this.start = start;
+ this.len = len;
+
+ nodeIds = block.nodeIds();
+ names = block.names();
+ hosts = block.hosts();
+ }
+
+ /**
+ * @param start Start.
+ * @param len Length.
+ * @param names Collection of host:port addresses.
+ * @param hosts Collection of host:port addresses.
+ */
+ public IgfsBlockLocationImpl(long start, long len, Collection<String> names, Collection<String> hosts) {
+ assert start >= 0;
+ assert len > 0;
+ assert names != null && !names.isEmpty();
+ assert hosts != null && !hosts.isEmpty();
+
+ this.start = start;
+ this.len = len;
+
+ nodeIds = Collections.emptySet();
+
+ this.names = names;
+ this.hosts = hosts;
+ }
+
+ /**
* @return Start position.
*/
@Override public long start() {
@@ -116,6 +157,20 @@ public class IgfsBlockLocationImpl implements IgfsBlockLocation, Externalizable,
}
/**
+ * @param addLen Length to increase.
+ */
+ public void increaseLength(long addLen) {
+ len += addLen;
+ }
+
+ /**
+ * @param len Block length.
+ */
+ public void length(long len) {
+ this.len = len;
+ }
+
+ /**
* @return Node IDs.
*/
@Override public Collection<UUID> nodeIds() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
index 4490a68..d6297b9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
@@ -278,6 +278,16 @@ public class IgfsDataManager extends IgfsManager {
}
/**
+ * Maps affinity key to node.
+ *
+ * @param affinityKey Affinity key to map.
+ * @return Primary node for this key.
+ */
+ public Collection<ClusterNode> affinityNodes(Object affinityKey) {
+ return dataCache.affinity().mapKeyToPrimaryAndBackups(affinityKey);
+ }
+
+ /**
* Creates new instance of explicit data streamer.
*
* @return New instance of data streamer.
@@ -1045,7 +1055,7 @@ public class IgfsDataManager extends IgfsManager {
// Create non-colocated key.
IgfsBlockKey key = new IgfsBlockKey(colocatedKey.getFileId(), null,
- colocatedKey.evictExclude(), colocatedKey.getBlockId());
+ colocatedKey.evictExclude(), colocatedKey.blockId());
try (IgniteInternalTx tx = dataCachePrj.txStartEx(PESSIMISTIC, REPEATABLE_READ)) {
// Lock keys.
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
index 01e434f..59674f8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
@@ -179,8 +179,11 @@ public final class IgfsImpl implements IgfsEx {
data = igfsCtx.data();
secondaryFs = cfg.getSecondaryFileSystem();
- if (secondaryFs instanceof IgfsKernalContextAware)
- ((IgfsKernalContextAware)secondaryFs).setKernalContext(igfsCtx.kernalContext());
+ if (secondaryFs != null) {
+ igfsCtx.kernalContext().resource().injectGeneric(secondaryFs);
+
+ igfsCtx.kernalContext().resource().injectFileSystem(secondaryFs, this);
+ }
if (secondaryFs instanceof LifecycleAware)
((LifecycleAware)secondaryFs).start();
@@ -635,7 +638,7 @@ public final class IgfsImpl implements IgfsEx {
IgfsFile file = secondaryFs.update(path, props);
if (file != null)
- return new IgfsFileImpl(secondaryFs.update(path, props), data.groupBlockSize());
+ return new IgfsFileImpl(file, data.groupBlockSize());
}
return null;
@@ -1263,6 +1266,9 @@ public final class IgfsImpl implements IgfsEx {
IgfsMode mode = resolveMode(path);
+ if (mode == PROXY)
+ return secondaryFs.affinity(path, start, len, maxLen);
+
// Check memory first.
IgfsEntryInfo info = meta.infoForPath(path);
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsKernalContextAware.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsKernalContextAware.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsKernalContextAware.java
deleted file mode 100644
index 7f59db4..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsKernalContextAware.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.igfs;
-
-import org.apache.ignite.internal.GridKernalContext;
-
-/**
- * Indicates whether particular file system accepts kernal context.
- */
-public interface IgfsKernalContextAware {
- /**
- * Set kernal context.
- *
- * @param ctx Kernal context.
- */
- public void setKernalContext(GridKernalContext ctx);
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java
index 4e14b46..1c135fe 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.processors.igfs;
import org.apache.ignite.IgniteException;
+import org.apache.ignite.igfs.IgfsBlockLocation;
import org.apache.ignite.igfs.IgfsFile;
import org.apache.ignite.igfs.IgfsPath;
import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
@@ -121,4 +122,10 @@ class IgfsSecondaryFileSystemImpl implements IgfsSecondaryFileSystem {
@Override public void setTimes(IgfsPath path, long accessTime, long modificationTime) throws IgniteException {
igfs.setTimes(path, accessTime, modificationTime);
}
+
+ /** {@inheritDoc} */
+ @Override public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len,
+ long maxLen) throws IgniteException {
+ return igfs.affinity(path, start, len, maxLen);
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/secondary/local/LocalFileSystemBlockKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/secondary/local/LocalFileSystemBlockKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/secondary/local/LocalFileSystemBlockKey.java
new file mode 100644
index 0000000..e3990df
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/secondary/local/LocalFileSystemBlockKey.java
@@ -0,0 +1,103 @@
+/*
+ * 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.igfs.secondary.local;
+
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsBaseBlockKey;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteUuid;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * File's binary data block key.
+ */
+public final class LocalFileSystemBlockKey implements IgfsBaseBlockKey, Comparable<LocalFileSystemBlockKey> {
+ /** IGFS path. */
+ private IgfsPath path;
+
+ /** Block ID. */
+ private long blockId;
+
+ /**
+ * Constructs file's binary data block key.
+ *
+ * @param path IGFS path.
+ * @param blockId Block ID.
+ */
+ public LocalFileSystemBlockKey(IgfsPath path, long blockId) {
+ assert path != null;
+ assert blockId >= 0;
+
+ this.path = path;
+ this.blockId = blockId;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long blockId() {
+ return blockId;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int fileHash() {
+ return path.hashCode();
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteUuid affinityKey() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int compareTo(@NotNull LocalFileSystemBlockKey o) {
+ int res = path.compareTo(o.path);
+
+ if (res != 0)
+ return res;
+
+ long v1 = blockId;
+ long v2 = o.blockId;
+
+ if (v1 != v2)
+ return v1 > v2 ? 1 : -1;
+
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ return path.hashCode() + (int)(blockId ^ (blockId >>> 32));
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ if (o == this)
+ return true;
+
+ if (o == null || !(o instanceof LocalFileSystemBlockKey))
+ return false;
+
+ LocalFileSystemBlockKey that = (LocalFileSystemBlockKey)o;
+
+ return blockId == that.blockId && path.equals(that.path);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(LocalFileSystemBlockKey.class, this);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/secondary/local/LocalFileSystemPositionedReadable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/secondary/local/LocalFileSystemPositionedReadable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/secondary/local/LocalFileSystemPositionedReadable.java
new file mode 100644
index 0000000..6bdba95
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/secondary/local/LocalFileSystemPositionedReadable.java
@@ -0,0 +1,65 @@
+/*
+ * 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.igfs.secondary.local;
+
+import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystemPositionedReadable;
+
+import java.io.BufferedInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+
+/**
+ * Positioned readable interface for local secondary file system.
+ */
+public class LocalFileSystemPositionedReadable extends BufferedInputStream
+ implements IgfsSecondaryFileSystemPositionedReadable {
+ /** Last read position. */
+ private long lastReadPos;
+
+ /**
+ * Constructor.
+ *
+ * @param in Input stream.
+ * @param bufSize Buffer size.
+ */
+ public LocalFileSystemPositionedReadable(FileInputStream in, int bufSize) {
+ super(in, bufSize);
+ }
+
+ /** {@inheritDoc} */
+ @Override public int read(long readPos, byte[] buf, int off, int len) throws IOException {
+ if (in == null)
+ throw new IOException("Stream is closed.");
+
+ if (readPos < lastReadPos || readPos + len > lastReadPos + this.buf.length) {
+ ((FileInputStream)in).getChannel().position(readPos);
+
+ pos = 0;
+ count = 0;
+ }
+
+ int bytesRead = read(buf, off, len);
+
+ if (bytesRead != -1) {
+ // Advance last read position only if we really read some bytes from the stream.
+ lastReadPos = readPos + bytesRead;
+ }
+
+ return bytesRead;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/secondary/local/LocalIgfsSecondaryFileSystemPositionedReadable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/secondary/local/LocalIgfsSecondaryFileSystemPositionedReadable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/secondary/local/LocalIgfsSecondaryFileSystemPositionedReadable.java
deleted file mode 100644
index ebf56ad..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/secondary/local/LocalIgfsSecondaryFileSystemPositionedReadable.java
+++ /dev/null
@@ -1,65 +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.igfs.secondary.local;
-
-import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystemPositionedReadable;
-
-import java.io.BufferedInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-
-/**
- * Positioned readable interface for local secondary file system.
- */
-public class LocalIgfsSecondaryFileSystemPositionedReadable extends BufferedInputStream
- implements IgfsSecondaryFileSystemPositionedReadable {
- /** Last read position. */
- private long lastReadPos;
-
- /**
- * Constructor.
- *
- * @param in Input stream.
- * @param bufSize Buffer size.
- */
- public LocalIgfsSecondaryFileSystemPositionedReadable(FileInputStream in, int bufSize) {
- super(in, bufSize);
- }
-
- /** {@inheritDoc} */
- @Override public int read(long readPos, byte[] buf, int off, int len) throws IOException {
- if (in == null)
- throw new IOException("Stream is closed.");
-
- if (readPos < lastReadPos || readPos + len > lastReadPos + this.buf.length) {
- ((FileInputStream)in).getChannel().position(readPos);
-
- pos = 0;
- count = 0;
- }
-
- int bytesRead = read(buf, off, len);
-
- if (bytesRead != -1) {
- // Advance last read position only if we really read some bytes from the stream.
- lastReadPos = readPos + bytesRead;
- }
-
- return bytesRead;
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java
index 0158973..07a4fff 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceIoc.java
@@ -37,6 +37,7 @@ import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.resources.CacheNameResource;
import org.apache.ignite.resources.CacheStoreSessionResource;
+import org.apache.ignite.resources.FileSystemResource;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.JobContextResource;
import org.apache.ignite.resources.LoadBalancerResource;
@@ -511,7 +512,10 @@ public class GridResourceIoc {
JOB_CONTEXT(JobContextResource.class),
/** */
- CACHE_STORE_SESSION(CacheStoreSessionResource.class);
+ CACHE_STORE_SESSION(CacheStoreSessionResource.class),
+
+ /** */
+ FILESYSTEM_RESOURCE(FileSystemResource.class);
/** */
public final Class<? extends Annotation> clazz;
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java
index 84d07b6..bdfbe50 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProcessor.java
@@ -20,8 +20,8 @@ package org.apache.ignite.internal.processors.resource;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.util.Collection;
import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteFileSystem;
import org.apache.ignite.cache.store.CacheStoreSession;
import org.apache.ignite.compute.ComputeJob;
import org.apache.ignite.compute.ComputeJobContext;
@@ -201,6 +201,26 @@ public class GridResourceProcessor extends GridProcessorAdapter {
}
/**
+ * Injects filesystem instance into given object.
+ *
+ * @param obj Object.
+ * @param igfs Ignite filesystem to inject.
+ * @return {@code True} if filesystem was injected.
+ * @throws IgniteCheckedException If failed to inject.
+ */
+ public boolean injectFileSystem(Object obj, IgniteFileSystem igfs) throws IgniteCheckedException {
+ assert obj != null;
+
+ if (log.isDebugEnabled())
+ log.debug("Injecting cache store session: " + obj);
+
+ // Unwrap Proxy object.
+ obj = unwrapTarget(obj);
+
+ return inject(obj, GridResourceIoc.ResourceAnnotation.FILESYSTEM_RESOURCE, null, null, igfs);
+ }
+
+ /**
* @param obj Object to inject.
* @throws IgniteCheckedException If failed to inject.
*/
@@ -308,6 +328,10 @@ public class GridResourceProcessor extends GridProcessorAdapter {
res = new GridResourceJobContextInjector((ComputeJobContext)param);
break;
+ case FILESYSTEM_RESOURCE:
+ res = new GridResourceBasicInjector<>(param);
+ break;
+
default:
res = injectorByAnnotation[ann.ordinal()];
break;
@@ -318,6 +342,11 @@ public class GridResourceProcessor extends GridProcessorAdapter {
/**
* @param obj Object to inject.
+ * @param ann Annotation enum.
+ * @param dep Grid deployment object.
+ * @param depCls Grid deployment class.
+ * @param param Resource to inject.
+ * @return {@code True} if resource was injected.
* @throws IgniteCheckedException If failed to inject.
*/
private boolean inject(Object obj, GridResourceIoc.ResourceAnnotation ann, @Nullable GridDeployment dep,
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/main/java/org/apache/ignite/resources/FileSystemResource.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/resources/FileSystemResource.java b/modules/core/src/main/java/org/apache/ignite/resources/FileSystemResource.java
new file mode 100644
index 0000000..e2aa06d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/resources/FileSystemResource.java
@@ -0,0 +1,62 @@
+/*
+ * 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;
+
+/**
+ * Annotates a field or a setter method for injection of primary Ignite filesystem to a secondary
+ * filesystem implementation.
+ *
+ * <p>
+ * Here is how injection would typically happen:
+ * <pre name="code" class="java">
+ * public class MySecondaryFS implements IgfsSecondaryFileSystem {
+ * ...
+ * // Inject instance of primary filesystem.
+ * @FileSystemResource
+ * private IgniteFileSystem igfs;
+ * ...
+ * }
+ * </pre>
+ * or attach the same annotations to methods:
+ * <pre name="code" class="java">
+ * public class MySecondaryFS implements IgfsSecondaryFileSystem {
+ * ...
+ * private IgniteFileSystem igfs;
+ * ...
+ * // Inject instance of primary filesystem.
+ * @FileSystemResource
+ * public void setIgfs(IgniteFileSystem igfs) {
+ * this.igfs = igfs;
+ * }
+ * ...
+ * }
+ * </pre>
+ * <p>
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD, ElementType.FIELD})
+public @interface FileSystemResource {
+ // No-op.
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
index 04f3c8e..d0b700e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
@@ -736,7 +736,7 @@ public abstract class IgfsAbstractSelfTest extends IgfsAbstractBaseSelfTest {
if(!propertiesSupported())
return;
- if (dual && !(igfsSecondaryFileSystem instanceof IgfsSecondaryFileSystemImpl)) {
+ if (mode != PRIMARY && !(igfsSecondaryFileSystem instanceof IgfsSecondaryFileSystemImpl)) {
// In case of Hadoop dual mode only user name, group name, and permission properties are updated,
// an arbitrary named property is just ignored:
checkRootPropertyUpdate("foo", "moo", null);
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAbstractSelfTest.java
index bea318d..7b83cfc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAbstractSelfTest.java
@@ -35,6 +35,7 @@ import java.util.concurrent.CyclicBarrier;
import static org.apache.ignite.igfs.IgfsMode.DUAL_ASYNC;
import static org.apache.ignite.igfs.IgfsMode.DUAL_SYNC;
+import static org.apache.ignite.igfs.IgfsMode.PROXY;
/**
* Tests for IGFS working in mode when remote file system exists: DUAL_SYNC, DUAL_ASYNC.
@@ -48,8 +49,6 @@ public abstract class IgfsDualAbstractSelfTest extends IgfsAbstractSelfTest {
*/
protected IgfsDualAbstractSelfTest(IgfsMode mode) {
super(mode);
-
- assert mode == DUAL_SYNC || mode == DUAL_ASYNC;
}
/** {@inheritDoc} */
@@ -72,10 +71,13 @@ public abstract class IgfsDualAbstractSelfTest extends IgfsAbstractSelfTest {
assert igfs.exists(p);
assert igfs.modeResolver().resolveMode(gg) == mode;
- assert igfs.modeResolver().resolveMode(new IgfsPath(gg, "sync")) == IgfsMode.DUAL_SYNC;
- assert igfs.modeResolver().resolveMode(new IgfsPath(gg, "async")) == IgfsMode.DUAL_ASYNC;
- assert igfs.modeResolver().resolveMode(new IgfsPath(gg, "primary")) == IgfsMode.PRIMARY;
- assert !igfsSecondary.exists("/ignite/primary"); // PRIMARY mode path must exist in upper level fs only.
+
+ if (mode != PROXY) {
+ assert igfs.modeResolver().resolveMode(new IgfsPath(gg, "sync")) == IgfsMode.DUAL_SYNC;
+ assert igfs.modeResolver().resolveMode(new IgfsPath(gg, "async")) == IgfsMode.DUAL_ASYNC;
+ assert igfs.modeResolver().resolveMode(new IgfsPath(gg, "primary")) == IgfsMode.PRIMARY;
+ assert !igfsSecondary.exists("/ignite/primary"); // PRIMARY mode path must exist in upper level fs only.
+ }
// All the child paths of "/ignite/" must be visible in listings:
assert igfs.listFiles(gg).size() == 3;
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsLocalSecondaryFileSystemProxySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsLocalSecondaryFileSystemProxySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsLocalSecondaryFileSystemProxySelfTest.java
index e7f9bbb..e7e3ac8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsLocalSecondaryFileSystemProxySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsLocalSecondaryFileSystemProxySelfTest.java
@@ -24,6 +24,7 @@ import java.io.OutputStream;
import java.nio.file.Files;
import java.util.Collection;
import java.util.concurrent.atomic.AtomicLong;
+import org.apache.ignite.igfs.IgfsBlockLocation;
import org.apache.ignite.igfs.IgfsFile;
import org.apache.ignite.igfs.IgfsPath;
import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
@@ -58,6 +59,11 @@ public class IgfsLocalSecondaryFileSystemProxySelfTest extends IgfsProxySelfTest
/** */
private final File fileLinkSrc = new File(FS_WORK_DIR + File.separatorChar + "file");
+ /** {@inheritDoc} */
+ @Override protected int nodeCount() {
+ return 3;
+ }
+
/**
* Creates secondary filesystems.
* @return IgfsSecondaryFileSystem
@@ -215,6 +221,81 @@ public class IgfsLocalSecondaryFileSystemProxySelfTest extends IgfsProxySelfTest
}
/**
+ * @throws Exception If failed.
+ */
+ public void testAffinityMaxLen() throws Exception {
+ awaitPartitionMapExchange();
+
+ long fileSize = 32 * 1024 * 1024;
+
+ IgfsPath filePath = new IgfsPath("/file");
+
+ try (OutputStream os = igfs.create(filePath, true)) {
+ for(int i = 0; i < fileSize / chunk.length; ++i)
+ os.write(chunk);
+ }
+
+ Collection<IgfsBlockLocation> blocks;
+
+ long len = igfs.info(filePath).length();
+ int start = 0;
+
+ // Check default maxLen (maxLen = 0)
+ for (int i = 0; i < igfs.context().data().groupBlockSize() / 1024; i++) {
+ Collection<IgfsBlockLocation> blocks0 =
+ igfs.affinity(filePath, start, len, 0);
+
+ blocks = igfs.affinity(filePath, start, len, Long.MAX_VALUE);
+
+ assertTrue(blocks0.size() > 1);
+ assertEquals(blocks0.size(), blocks.size());
+ assertEquals(F.first(blocks).start(), start);
+ assertEquals(start + len, F.last(blocks).start() + F.last(blocks).length());
+ assertEquals(blocks0, blocks);
+
+ len -= 1024 * 2;
+ start += 1024;
+ System.out.println("+++ ");
+ }
+
+ len = igfs.info(filePath).length();
+ start = 0;
+ long maxLen = igfs.context().data().groupBlockSize() * 2;
+
+ // Different cases of start, len and maxLen
+ for (int i = 0; i < igfs.context().data().groupBlockSize() / 1024; i++) {
+ blocks = igfs.affinity(filePath, start, len, maxLen);
+
+ assertEquals(F.first(blocks).start(), start);
+ assertEquals(start + len, F.last(blocks).start() + F.last(blocks).length());
+
+ long totalLen = 0;
+
+ for (IgfsBlockLocation block : blocks) {
+ totalLen += block.length();
+
+ assert block.length() <= maxLen : "block.length() <= maxLen. [block.length=" + block.length()
+ + ", maxLen=" + maxLen + ']';
+
+ assert block.length() + block.start() <= start + len : "block.length() + block.start() < start + len. [block.length=" + block.length()
+ + ", block.start()=" + block.start() + ", start=" + start +", len=" + len + ']';
+
+ for (IgfsBlockLocation block0 : blocks)
+ if (!block0.equals(block))
+ assert block.start() < block0.start() && block.start() + block.length() <= block0.start() ||
+ block.start() > block0.start() && block0.start() + block0.length() <= block.start()
+ : "Blocks cross each other: block0=" + block + ", block1= " + block0;
+ }
+
+ assert totalLen == len : "Summary length of blocks must be: " + len + " actual: " + totalLen;
+
+ len -= 1024 * 2;
+ start += 1024;
+ maxLen -= igfs.context().data().groupBlockSize() * 2 / 1024;
+ }
+ }
+
+ /**
*
* @throws Exception If failed.
*/
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemInjectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemInjectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemInjectionSelfTest.java
new file mode 100644
index 0000000..d4187cb
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemInjectionSelfTest.java
@@ -0,0 +1,270 @@
+/*
+ * 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.igfs;
+
+import java.io.OutputStream;
+import java.util.Collection;
+import java.util.Map;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.IgniteFileSystem;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.FileSystemConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.igfs.IgfsBlockLocation;
+import org.apache.ignite.igfs.IgfsFile;
+import org.apache.ignite.igfs.IgfsMode;
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
+import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystemPositionedReadable;
+import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.resources.FileSystemResource;
+import org.apache.ignite.resources.IgniteInstanceResource;
+import org.apache.ignite.resources.LoggerResource;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.Nullable;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+import static org.apache.ignite.cache.CacheMode.REPLICATED;
+
+/**
+ * Tests for resource injection to secondary file system.
+ */
+public class IgfsSecondaryFileSystemInjectionSelfTest extends GridCommonAbstractTest {
+ /** IGFS name. */
+ protected static final String IGFS_NAME = "igfs-test";
+
+ /** Test implementation of secondary filesystem. */
+ private TestBaseSecondaryFsMock secondary;
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ G.stopAll(true);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
+
+ igfsCfg.setDataCacheName("dataCache");
+ igfsCfg.setMetaCacheName("metaCache");
+ igfsCfg.setName(IGFS_NAME);
+ igfsCfg.setDefaultMode(IgfsMode.DUAL_SYNC);
+ igfsCfg.setSecondaryFileSystem(secondary);
+
+ CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
+
+ dataCacheCfg.setName("dataCache");
+ dataCacheCfg.setCacheMode(PARTITIONED);
+ dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+ dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+ CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+
+ metaCacheCfg.setName("metaCache");
+ metaCacheCfg.setCacheMode(REPLICATED);
+ metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+ metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+ cfg.setFileSystemConfiguration(igfsCfg);
+ cfg.setCacheConfiguration(metaCacheCfg, dataCacheCfg);
+
+ return cfg;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ @SuppressWarnings({"UnusedDeclaration"})
+ public void testInjectPrimaryByField() throws Exception {
+ secondary = new TestBaseSecondaryFsMock() {
+ @FileSystemResource
+ private IgfsImpl igfs;
+
+ @LoggerResource
+ private IgniteLogger log;
+
+ @IgniteInstanceResource
+ private Ignite ig;
+
+ @Override boolean checkInjection(Ignite ignite, IgniteFileSystem primary) {
+ return igfs == primary && log instanceof IgniteLogger && ig == ignite;
+ }
+ };
+
+ Ignite ig = startGrid(0);
+
+ IgniteFileSystem igfs = ig.fileSystem(IGFS_NAME);
+
+ assert secondary.checkInjection(ig, igfs);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ @SuppressWarnings({"UnusedDeclaration"})
+ public void testInjectPrimaryByMethods() throws Exception {
+ secondary = new TestBaseSecondaryFsMock() {
+ /** Ignite instance. */
+ private Ignite ig;
+
+ /** IGFS instance. */
+ private IgniteFileSystem igfs;
+
+ /** Logger injected flag */
+ private boolean logSet;
+
+ /**
+ * @param igfs Primary IGFS.
+ */
+ @FileSystemResource
+ void setPrimaryIgfs(IgfsImpl igfs) {
+ this.igfs = igfs;
+ }
+
+ /**
+ * @param log Ignite logger.
+ */
+ @LoggerResource
+ void setIgLogger(IgniteLogger log) {
+ logSet = log instanceof IgniteLogger;
+ }
+
+ /**
+ * @param ig Ignite instance.
+ */
+ @IgniteInstanceResource
+ void setIgniteInst(Ignite ig) {
+ this.ig = ig;
+ }
+
+ @Override boolean checkInjection(Ignite ignite, IgniteFileSystem primary) {
+ return ignite == ig && primary == igfs && logSet;
+ }
+ };
+
+ Ignite ig = startGrid(0);
+
+ IgniteFileSystem igfs = ig.fileSystem(IGFS_NAME);
+
+ assert secondary.checkInjection(ig, igfs);
+ }
+
+ /**
+ *
+ */
+ private static abstract class TestBaseSecondaryFsMock implements IgfsSecondaryFileSystem {
+
+ /** {@inheritDoc} */
+ @Override public boolean exists(IgfsPath path) {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgfsFile update(IgfsPath path, Map<String, String> props) throws IgniteException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void rename(IgfsPath src, IgfsPath dest) throws IgniteException {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean delete(IgfsPath path, boolean recursive) throws IgniteException {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void mkdirs(IgfsPath path) throws IgniteException {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void mkdirs(IgfsPath path, @Nullable Map<String, String> props) throws IgniteException {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<IgfsPath> listPaths(IgfsPath path) throws IgniteException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<IgfsFile> listFiles(IgfsPath path) throws IgniteException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public IgfsSecondaryFileSystemPositionedReadable open(IgfsPath path, int bufSize) throws IgniteException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public OutputStream create(IgfsPath path, boolean overwrite) throws IgniteException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public OutputStream create(IgfsPath path, int bufSize, boolean overwrite, int replication, long blockSize,
+ @Nullable Map<String, String> props) throws IgniteException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public OutputStream append(IgfsPath path, int bufSize, boolean create,
+ @Nullable Map<String, String> props) throws IgniteException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgfsFile info(IgfsPath path) throws IgniteException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long usedSpaceSize() throws IgniteException {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void setTimes(IgfsPath path, long accessTime, long modificationTime) throws IgniteException {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len,
+ long maxLen) throws IgniteException {
+ return null;
+ }
+
+ /**
+ * @param ignite Ignite instance.
+ * @param primary Primary IGFS.
+ * @return {@code True} if injection is correct.
+ */
+ abstract boolean checkInjection(Ignite ignite, IgniteFileSystem primary);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
index 775c2ce..76ed440 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
@@ -59,6 +59,7 @@ import org.apache.ignite.internal.processors.igfs.IgfsProcessorSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsProcessorValidationSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsProxySelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsLocalSecondaryFileSystemProxySelfTest;
+import org.apache.ignite.internal.processors.igfs.IgfsSecondaryFileSystemInjectionSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsServerManagerIpcEndpointRegistrationOnWindowsSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsSizeSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsStartCacheTest;
@@ -167,6 +168,8 @@ public class IgniteIgfsTestSuite extends TestSuite {
suite.addTestSuite(IgfsAtomicPrimaryOffheapTieredSelfTest.class);
suite.addTestSuite(IgfsAtomicPrimaryOffheapValuesSelfTest.class);
+ suite.addTestSuite(IgfsSecondaryFileSystemInjectionSelfTest.class);
+
return suite;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
index d9215db..674cca7 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
@@ -20,20 +20,22 @@ package org.apache.ignite.hadoop.fs;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteFileSystem;
+import org.apache.ignite.igfs.IgfsBlockLocation;
import org.apache.ignite.igfs.IgfsFile;
import org.apache.ignite.igfs.IgfsPath;
import org.apache.ignite.igfs.IgfsUserContext;
import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystemPositionedReadable;
import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.processors.hadoop.HadoopClassLoader;
import org.apache.ignite.internal.processors.hadoop.HadoopCommonUtils;
import org.apache.ignite.internal.processors.hadoop.HadoopPayloadAware;
import org.apache.ignite.internal.processors.hadoop.delegate.HadoopDelegateUtils;
import org.apache.ignite.internal.processors.hadoop.delegate.HadoopIgfsSecondaryFileSystemDelegate;
-import org.apache.ignite.internal.processors.igfs.IgfsKernalContextAware;
import org.apache.ignite.lang.IgniteOutClosure;
import org.apache.ignite.lifecycle.LifecycleAware;
+import org.apache.ignite.resources.IgniteInstanceResource;
import org.jetbrains.annotations.Nullable;
import java.io.OutputStream;
@@ -46,8 +48,8 @@ import java.util.concurrent.Callable;
* <p>
* Target {@code FileSystem}'s are created on per-user basis using passed {@link HadoopFileSystemFactory}.
*/
-public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSystem, IgfsKernalContextAware,
- LifecycleAware, HadoopPayloadAware {
+public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSystem, LifecycleAware,
+ HadoopPayloadAware {
/** The default user name. It is used if no user context is set. */
private String dfltUsrName;
@@ -245,8 +247,17 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
}
/** {@inheritDoc} */
- @Override public void setKernalContext(GridKernalContext ctx) {
- this.ctx = ctx;
+ @Override public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len,
+ long maxLen) throws IgniteException {
+ return target.affinity(path, start, len, maxLen);
+ }
+
+ /**
+ * @param ignite Ignite instance.
+ */
+ @IgniteInstanceResource
+ public void setIgniteInstance(IgniteEx ignite) {
+ ctx = ignite.context();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/delegate/HadoopIgfsSecondaryFileSystemDelegateImpl.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/delegate/HadoopIgfsSecondaryFileSystemDelegateImpl.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/delegate/HadoopIgfsSecondaryFileSystemDelegateImpl.java
index e336fad..fe6492e 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/delegate/HadoopIgfsSecondaryFileSystemDelegateImpl.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/delegate/HadoopIgfsSecondaryFileSystemDelegateImpl.java
@@ -17,6 +17,9 @@
package org.apache.ignite.internal.processors.hadoop.impl.delegate;
+import java.util.Arrays;
+import java.util.List;
+import org.apache.hadoop.fs.BlockLocation;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.ParentNotDirectoryException;
@@ -28,6 +31,7 @@ import org.apache.ignite.IgniteException;
import org.apache.ignite.hadoop.fs.CachingHadoopFileSystemFactory;
import org.apache.ignite.hadoop.fs.HadoopFileSystemFactory;
import org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem;
+import org.apache.ignite.igfs.IgfsBlockLocation;
import org.apache.ignite.igfs.IgfsDirectoryNotEmptyException;
import org.apache.ignite.igfs.IgfsException;
import org.apache.ignite.igfs.IgfsFile;
@@ -42,6 +46,7 @@ import org.apache.ignite.internal.processors.hadoop.delegate.HadoopFileSystemFac
import org.apache.ignite.internal.processors.hadoop.delegate.HadoopIgfsSecondaryFileSystemDelegate;
import org.apache.ignite.internal.processors.hadoop.impl.igfs.HadoopIgfsProperties;
import org.apache.ignite.internal.processors.hadoop.impl.igfs.HadoopIgfsSecondaryFileSystemPositionedReadable;
+import org.apache.ignite.internal.processors.igfs.IgfsBlockLocationImpl;
import org.apache.ignite.internal.processors.igfs.IgfsEntryInfo;
import org.apache.ignite.internal.processors.igfs.IgfsFileImpl;
import org.apache.ignite.internal.processors.igfs.IgfsUtils;
@@ -104,12 +109,17 @@ public class HadoopIgfsSecondaryFileSystemDelegateImpl implements HadoopIgfsSeco
final FileSystem fileSys = fileSystemForUser();
+ Path hadoopPath = convert(path);
+
try {
+ if (!fileSys.exists(hadoopPath))
+ return null;
+
if (props0.userName() != null || props0.groupName() != null)
- fileSys.setOwner(convert(path), props0.userName(), props0.groupName());
+ fileSys.setOwner(hadoopPath, props0.userName(), props0.groupName());
if (props0.permission() != null)
- fileSys.setPermission(convert(path), props0.permission());
+ fileSys.setPermission(hadoopPath, props0.permission());
}
catch (IOException e) {
throw handleSecondaryFsError(e, "Failed to update file properties [path=" + path + "]");
@@ -266,7 +276,14 @@ public class HadoopIgfsSecondaryFileSystemDelegateImpl implements HadoopIgfsSeco
@Override public OutputStream append(IgfsPath path, int bufSize, boolean create,
@Nullable Map<String, String> props) {
try {
- return fileSystemForUser().append(convert(path), bufSize);
+ Path hadoopPath = convert(path);
+
+ FileSystem fs = fileSystemForUser();
+
+ if (create && !fs.exists(hadoopPath))
+ return fs.create(hadoopPath, false, bufSize);
+ else
+ return fs.append(convert(path), bufSize);
}
catch (IOException e) {
throw handleSecondaryFsError(e, "Failed to append file [path=" + path + ", bufSize=" + bufSize + "]");
@@ -371,6 +388,24 @@ public class HadoopIgfsSecondaryFileSystemDelegateImpl implements HadoopIgfsSeco
}
/** {@inheritDoc} */
+ @Override public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len,
+ long maxLen) throws IgniteException {
+ try {
+ BlockLocation[] hadoopBlocks = fileSystemForUser().getFileBlockLocations(convert(path), start, len);
+
+ List<IgfsBlockLocation> blks = new ArrayList<>(hadoopBlocks.length);
+
+ for (int i = 0; i < hadoopBlocks.length; ++i)
+ blks.add(convertBlockLocation(hadoopBlocks[i]));
+
+ return blks;
+ }
+ catch (IOException e) {
+ throw handleSecondaryFsError(e, "Failed affinity for path: " + path);
+ }
+ }
+
+ /** {@inheritDoc} */
public void start() {
factory.start();
}
@@ -393,6 +428,25 @@ public class HadoopIgfsSecondaryFileSystemDelegateImpl implements HadoopIgfsSeco
}
/**
+ * Convert IGFS affinity block location into Hadoop affinity block location.
+ *
+ * @param block IGFS affinity block location.
+ * @return Hadoop affinity block location.
+ */
+ private IgfsBlockLocation convertBlockLocation(BlockLocation block) {
+ try {
+ String[] names = block.getNames();
+ String[] hosts = block.getHosts();
+
+ return new IgfsBlockLocationImpl(
+ block.getOffset(), block.getLength(),
+ Arrays.asList(names), Arrays.asList(hosts));
+ } catch (IOException e) {
+ throw handleSecondaryFsError(e, "Failed convert block location: " + block);
+ }
+ }
+
+ /**
* Heuristically checks if exception was caused by invalid HDFS version and returns appropriate exception.
*
* @param e Exception to check.
@@ -406,6 +460,7 @@ public class HadoopIgfsSecondaryFileSystemDelegateImpl implements HadoopIgfsSeco
/**
* Cast IO exception to IGFS exception.
*
+ * @param msg Error message.
* @param e IO exception.
* @return IGFS exception.
*/
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/Hadoop1OverIgfsProxyTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/Hadoop1OverIgfsProxyTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/Hadoop1OverIgfsProxyTest.java
new file mode 100644
index 0000000..c7c792d
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/Hadoop1OverIgfsProxyTest.java
@@ -0,0 +1,67 @@
+/*
+ * 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.hadoop.impl.igfs;
+
+import java.io.OutputStream;
+import java.util.Collection;
+import org.apache.ignite.igfs.IgfsBlockLocation;
+import org.apache.ignite.igfs.IgfsMode;
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.util.typedef.F;
+
+/**
+ * DUAL_ASYNC mode test.
+ */
+public class Hadoop1OverIgfsProxyTest extends Hadoop1DualAbstractTest {
+ /**
+ * Constructor.
+ */
+ public Hadoop1OverIgfsProxyTest() {
+ super(IgfsMode.PROXY);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAffinity() throws Exception {
+ long fileSize = 32 * 1024 * 1024;
+
+ IgfsPath filePath = new IgfsPath("/file");
+
+ try (OutputStream os = igfs.create(filePath, true)) {
+ for(int i = 0; i < fileSize / chunk.length; ++i)
+ os.write(chunk);
+ }
+
+ long len = igfs.info(filePath).length();
+ int start = 0;
+
+ // Check default maxLen (maxLen = 0)
+ for (int i = 0; i < igfs.context().data().groupBlockSize() / 1024; i++) {
+ Collection<IgfsBlockLocation> blocks = igfs.affinity(filePath, start, len);
+
+ assertEquals(F.first(blocks).start(), start);
+ assertEquals(start + len, F.last(blocks).start() + F.last(blocks).length());
+
+ len -= 1024 * 2;
+ start += 1024;
+ }
+
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/2df39a80/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
index 6046cc1..01893fb 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/testsuites/IgniteHadoopTestSuite.java
@@ -29,6 +29,7 @@ import org.apache.ignite.internal.processors.hadoop.impl.client.HadoopClientProt
import org.apache.ignite.internal.processors.hadoop.impl.client.HadoopClientProtocolSelfTest;
import org.apache.ignite.internal.processors.hadoop.impl.HadoopTxConfigCacheTest;
import org.apache.ignite.internal.processors.hadoop.impl.fs.KerberosHadoopFileSystemFactorySelfTest;
+import org.apache.ignite.internal.processors.hadoop.impl.igfs.Hadoop1OverIgfsProxyTest;
import org.apache.ignite.internal.processors.hadoop.impl.util.BasicUserNameMapperSelfTest;
import org.apache.ignite.internal.processors.hadoop.impl.util.ChainedUserNameMapperSelfTest;
import org.apache.ignite.internal.processors.hadoop.impl.util.KerberosUserNameMapperSelfTest;
@@ -136,6 +137,7 @@ public class IgniteHadoopTestSuite extends TestSuite {
suite.addTest(new TestSuite(ldr.loadClass(Hadoop1OverIgfsDualSyncTest.class.getName())));
suite.addTest(new TestSuite(ldr.loadClass(Hadoop1OverIgfsDualAsyncTest.class.getName())));
+ suite.addTest(new TestSuite(ldr.loadClass(Hadoop1OverIgfsProxyTest.class.getName())));
suite.addTest(new TestSuite(ldr.loadClass(HadoopFIleSystemFactorySelfTest.class.getName())));
[39/50] [abbrv] ignite git commit: .NET: Improve exception messages
for binary misconfiguration and missing assemblies
Posted by ag...@apache.org.
.NET: Improve exception messages for binary misconfiguration and missing assemblies
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e304b48b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e304b48b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e304b48b
Branch: refs/heads/ignite-3477
Commit: e304b48b92fe75027442b7f7cfb46b421d58ae49
Parents: d10946b
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Fri Jan 13 16:49:48 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Fri Jan 13 16:49:48 2017 +0300
----------------------------------------------------------------------
.../Apache.Ignite.Core/Impl/Binary/BinaryReader.cs | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e304b48b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs
index 100091f..d9facc3 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReader.cs
@@ -697,10 +697,18 @@ namespace Apache.Ignite.Core.Impl.Binary
if (desc.Type == null)
{
if (desc is BinarySurrogateTypeDescriptor)
- throw new BinaryObjectException("Unknown type ID: " + hdr.TypeId);
-
- throw new BinaryObjectException("No matching type found for object [typeId=" +
- desc.TypeId + ", typeName=" + desc.TypeName + ']');
+ {
+ throw new BinaryObjectException(string.Format(
+ "Unknown type ID: {0}. " +
+ "This usually indicates missing BinaryConfiguration." +
+ "Make sure that all nodes have the same BinaryConfiguration.", hdr.TypeId));
+ }
+
+ throw new BinaryObjectException(string.Format(
+ "No matching type found for object [typeId={0}, typeName={1}]." +
+ "This usually indicates that assembly with specified type is not loaded on a node." +
+ "When using Apache.Ignite.exe, make sure to load assemblies with -assembly parameter.",
+ desc.TypeId, desc.TypeName));
}
// Preserve old frame.
[07/50] [abbrv] ignite git commit: Merge branch 'master' into
ignite-2.0
Posted by ag...@apache.org.
Merge branch 'master' into ignite-2.0
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7e73d022
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7e73d022
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7e73d022
Branch: refs/heads/ignite-3477
Commit: 7e73d0223a3f09cbe0b7094a2c04bdf9d63ca9be
Parents: c5882a8 06ef846
Author: devozerov <vo...@gridgain.com>
Authored: Wed Dec 28 12:54:47 2016 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Wed Dec 28 12:54:47 2016 +0300
----------------------------------------------------------------------
modules/platforms/cpp/binary/Makefile.am | 2 +-
.../ignite/impl/binary/binary_type_manager.h | 2 +-
.../src/impl/binary/binary_type_manager.cpp | 6 +-
.../binary/src/impl/interop/interop_memory.cpp | 2 +-
modules/platforms/cpp/common/Makefile.am | 2 +-
.../include/ignite/common/dynamic_size_array.h | 2 +-
modules/platforms/cpp/configure.ac | 2 +-
modules/platforms/cpp/configure.acrel | 2 +-
modules/platforms/cpp/core-test/Makefile.am | 2 +-
.../cpp/core-test/src/cache_query_test.cpp | 8 +-
.../cpp/core-test/src/reference_test.cpp | 14 +-
modules/platforms/cpp/core/Makefile.am | 2 +-
.../cache/query/continuous/continuous_query.h | 8 +-
.../include/ignite/cache/query/query_cursor.h | 4 +-
.../query/continuous/continuous_query_impl.h | 8 +-
.../core/include/ignite/impl/handle_registry.h | 2 +-
.../cpp/core/include/ignite/impl/operations.h | 4 +-
.../cpp/core/src/impl/cache/cache_impl.cpp | 5 +-
.../cpp/core/src/impl/handle_registry.cpp | 2 +-
modules/platforms/cpp/examples/configure.ac | 2 +-
.../cpp/examples/odbc-example/Makefile.am | 2 +-
.../cpp/examples/putget-example/Makefile.am | 2 +-
.../cpp/examples/query-example/Makefile.am | 2 +-
modules/platforms/cpp/ignite/Makefile.am | 2 +-
modules/platforms/cpp/jni/Makefile.am | 2 +-
modules/platforms/cpp/jni/src/java.cpp | 2 +-
modules/platforms/cpp/odbc-test/Makefile.am | 2 +-
.../cpp/odbc-test/config/queries-default.xml | 1 +
.../odbc-test/include/sql_test_suite_fixture.h | 3 +
.../platforms/cpp/odbc-test/include/test_type.h | 20 +-
.../platforms/cpp/odbc-test/src/column_test.cpp | 189 +++++++++++++++++++
.../odbc-test/src/sql_test_suite_fixture.cpp | 17 ++
.../cpp/odbc-test/src/sql_types_test.cpp | 131 +++++++++++++
modules/platforms/cpp/odbc/Makefile.am | 2 +-
.../cpp/odbc/include/ignite/odbc/utility.h | 9 +-
.../cpp/odbc/install/ignite-odbc-amd64.wxs | 2 +-
.../cpp/odbc/install/ignite-odbc-x86.wxs | 2 +-
modules/platforms/cpp/odbc/src/column.cpp | 28 ++-
.../cpp/odbc/src/config/connection_info.cpp | 6 +-
modules/platforms/cpp/odbc/src/connection.cpp | 2 +
modules/platforms/cpp/odbc/src/odbc.cpp | 5 +-
modules/platforms/cpp/odbc/src/utility.cpp | 15 ++
.../Properties/AssemblyInfo.cs | 4 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Examples/Example.cs | 5 +-
.../Examples/ExamplesTest.cs | 107 ++++++++---
.../Properties/AssemblyInfo.cs | 4 +-
.../Apache.Ignite.Core.Tests/ReconnectTest.cs | 26 ++-
.../Properties/AssemblyInfo.cs | 4 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Properties/AssemblyInfo.cs | 4 +-
.../Apache.Ignite/Properties/AssemblyInfo.cs | 4 +-
.../examples/Apache.Ignite.Examples/App.config | 2 +
.../DataStructures/AtomicSequenceExample.cs | 26 +--
.../Properties/AssemblyInfo.cs | 4 +-
.../Properties/AssemblyInfo.cs | 4 +-
62 files changed, 612 insertions(+), 141 deletions(-)
----------------------------------------------------------------------
[12/50] [abbrv] ignite git commit: IGNITE-4504 .NET: Expose default
transaction settings on ITransactions
Posted by ag...@apache.org.
IGNITE-4504 .NET: Expose default transaction settings on ITransactions
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/828b9b61
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/828b9b61
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/828b9b61
Branch: refs/heads/ignite-3477
Commit: 828b9b614ba23d8316c8f0db173a2dc09a5bda27
Parents: 864af7e
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Dec 28 17:06:57 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Dec 28 17:06:57 2016 +0300
----------------------------------------------------------------------
.../Cache/CacheAbstractTransactionalTest.cs | 9 +++++++++
.../Impl/Transactions/TransactionsImpl.cs | 18 ++++++++++++++++++
.../Transactions/ITransactions.cs | 19 ++++++++++++++++++-
3 files changed, 45 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/828b9b61/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs
index e836ba2..5dcc560 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs
@@ -399,6 +399,15 @@ namespace Apache.Ignite.Core.Tests.Cache
Assert.AreEqual(TransactionIsolation.RepeatableRead, tx.Isolation);
Assert.AreEqual(2500, tx.Timeout.TotalMilliseconds);
Assert.AreEqual(startTime3, tx.StartTime);
+
+ // Check defaults.
+ tx = Transactions.TxStart();
+
+ Assert.AreEqual(Transactions.DefaultTransactionConcurrency, tx.Concurrency);
+ Assert.AreEqual(Transactions.DefaultTransactionIsolation, tx.Isolation);
+ Assert.AreEqual(Transactions.DefaultTimeout, tx.Timeout);
+
+ tx.Commit();
}
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/828b9b61/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs
index 6f8e5bf..5fa5db8 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs
@@ -158,6 +158,24 @@ namespace Apache.Ignite.Core.Impl.Transactions
DoOutInOp(OpResetMetrics);
}
+ /** <inheritDoc /> */
+ public TransactionConcurrency DefaultTransactionConcurrency
+ {
+ get { return _dfltConcurrency; }
+ }
+
+ /** <inheritDoc /> */
+ public TransactionIsolation DefaultTransactionIsolation
+ {
+ get { return _dfltIsolation; }
+ }
+
+ /** <inheritDoc /> */
+ public TimeSpan DefaultTimeout
+ {
+ get { return _dfltTimeout; }
+ }
+
/// <summary>
/// Commit transaction.
/// </summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/828b9b61/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs
index ddd2b21..d3b98da 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs
@@ -28,7 +28,9 @@ namespace Apache.Ignite.Core.Transactions
public interface ITransactions
{
/// <summary>
- /// Starts a transaction with default isolation, concurrency, timeout, and invalidation policy.
+ /// Starts a transaction with default isolation (<see cref="DefaultTransactionIsolation"/>,
+ /// concurrency (<see cref="DefaultTransactionConcurrency"/>), timeout (<see cref="DefaultTimeout"/>),
+ /// and invalidation policy.
/// All defaults are set in CacheConfiguration at startup.
/// </summary>
/// <returns>New transaction.</returns>
@@ -62,6 +64,21 @@ namespace Apache.Ignite.Core.Transactions
ITransaction Tx { get; }
/// <summary>
+ /// Gets the default transaction concurrency.
+ /// </summary>
+ TransactionConcurrency DefaultTransactionConcurrency { get; }
+
+ /// <summary>
+ /// Gets the default transaction isolation.
+ /// </summary>
+ TransactionIsolation DefaultTransactionIsolation { get; }
+
+ /// <summary>
+ /// Gets the default transaction timeout.
+ /// </summary>
+ TimeSpan DefaultTimeout { get; }
+
+ /// <summary>
/// Gets the metrics.
/// </summary>
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate",
[27/50] [abbrv] ignite git commit: IGNITE-4461: Hadoop: added
automatic resolution of "raw" comparator for Text class.
Posted by ag...@apache.org.
IGNITE-4461: Hadoop: added automatic resolution of "raw" comparator for Text class.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f406887c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f406887c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f406887c
Branch: refs/heads/ignite-3477
Commit: f406887c274550317e1b6fbbe1bb302f53a5eaad
Parents: beb242b
Author: devozerov <vo...@gridgain.com>
Authored: Thu Jan 5 14:48:06 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Jan 5 14:48:35 2017 +0300
----------------------------------------------------------------------
.../hadoop/impl/v2/HadoopV2TaskContext.java | 64 ++++++++++++++------
1 file changed, 46 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f406887c/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2TaskContext.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2TaskContext.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2TaskContext.java
index e9cae1c..d328550 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2TaskContext.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/v2/HadoopV2TaskContext.java
@@ -41,6 +41,7 @@ import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.util.ReflectionUtils;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.hadoop.io.PartiallyRawComparator;
+import org.apache.ignite.hadoop.io.TextPartiallyRawComparator;
import org.apache.ignite.internal.processors.hadoop.HadoopClassLoader;
import org.apache.ignite.internal.processors.hadoop.HadoopCommonUtils;
import org.apache.ignite.internal.processors.hadoop.HadoopExternalSplit;
@@ -76,6 +77,8 @@ import java.io.File;
import java.io.IOException;
import java.security.PrivilegedExceptionAction;
import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
import java.util.UUID;
import java.util.concurrent.Callable;
@@ -99,6 +102,9 @@ public class HadoopV2TaskContext extends HadoopTaskContext {
private static final HadoopLazyConcurrentMap<FsCacheKey, FileSystem> fsMap
= createHadoopLazyConcurrentMap();
+ /** Default partial comparator mappings. */
+ private static final Map<String, String> PARTIAL_COMPARATORS = new HashMap<>();
+
/**
* This method is called with reflection upon Job finish with class loader of each task.
* This will clean up all the Fs created for specific task.
@@ -111,24 +117,6 @@ public class HadoopV2TaskContext extends HadoopTaskContext {
fsMap.close();
}
- /**
- * Check for combiner grouping support (available since Hadoop 2.3).
- */
- static {
- boolean ok;
-
- try {
- JobContext.class.getDeclaredMethod("getCombinerKeyGroupingComparator");
-
- ok = true;
- }
- catch (NoSuchMethodException ignore) {
- ok = false;
- }
-
- COMBINE_KEY_GROUPING_SUPPORTED = ok;
- }
-
/** Flag is set if new context-object code is used for running the mapper. */
private final boolean useNewMapper;
@@ -153,6 +141,23 @@ public class HadoopV2TaskContext extends HadoopTaskContext {
/** Counters for task. */
private final HadoopCounters cntrs = new HadoopCountersImpl();
+ static {
+ boolean ok;
+
+ try {
+ JobContext.class.getDeclaredMethod("getCombinerKeyGroupingComparator");
+
+ ok = true;
+ }
+ catch (NoSuchMethodException ignore) {
+ ok = false;
+ }
+
+ COMBINE_KEY_GROUPING_SUPPORTED = ok;
+
+ PARTIAL_COMPARATORS.put(Text.class.getName(), TextPartiallyRawComparator.class.getName());
+ }
+
/**
* @param taskInfo Task info.
* @param job Job.
@@ -181,6 +186,8 @@ public class HadoopV2TaskContext extends HadoopTaskContext {
// For map-reduce jobs prefer local writes.
jobConf.setBooleanIfUnset(PARAM_IGFS_PREFER_LOCAL_WRITES, true);
+ initializePartiallyRawComparator(jobConf);
+
jobCtx = new JobContextImpl(jobConf, new JobID(jobId.globalId().toString(), jobId.localId()));
useNewMapper = jobConf.getUseNewMapper();
@@ -447,6 +454,7 @@ public class HadoopV2TaskContext extends HadoopTaskContext {
}
/** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
@Override public Comparator<Object> groupComparator() {
Comparator<?> res;
@@ -581,4 +589,24 @@ public class HadoopV2TaskContext extends HadoopTaskContext {
throw new IgniteCheckedException(e);
}
}
+
+ /**
+ * Try initializing partially raw comparator for job.
+ *
+ * @param conf Configuration.
+ */
+ private void initializePartiallyRawComparator(JobConf conf) {
+ String clsName = conf.get(HadoopJobProperty.JOB_PARTIALLY_RAW_COMPARATOR.propertyName(), null);
+
+ if (clsName == null) {
+ Class keyCls = conf.getMapOutputKeyClass();
+
+ if (keyCls != null) {
+ clsName = PARTIAL_COMPARATORS.get(keyCls.getName());
+
+ if (clsName != null)
+ conf.set(HadoopJobProperty.JOB_PARTIALLY_RAW_COMPARATOR.propertyName(), clsName);
+ }
+ }
+ }
}
\ No newline at end of file
[02/50] [abbrv] ignite git commit: IGNITE-2793 Added support for byte
arrays to ODBC
Posted by ag...@apache.org.
IGNITE-2793 Added support for byte arrays to ODBC
This closes #1371
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/32d2629e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/32d2629e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/32d2629e
Branch: refs/heads/ignite-3477
Commit: 32d2629e1a8f828b0a34e363e793a5add2639f2e
Parents: 300750f
Author: Sergey Kalashnikov <sk...@gridgain.com>
Authored: Tue Dec 27 13:08:34 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Dec 27 13:08:34 2016 +0300
----------------------------------------------------------------------
modules/platforms/cpp/binary/Makefile.am | 2 +-
.../ignite/impl/binary/binary_type_manager.h | 2 +-
.../src/impl/binary/binary_type_manager.cpp | 6 +-
.../binary/src/impl/interop/interop_memory.cpp | 2 +-
modules/platforms/cpp/common/Makefile.am | 2 +-
.../include/ignite/common/dynamic_size_array.h | 2 +-
modules/platforms/cpp/core-test/Makefile.am | 2 +-
.../cpp/core-test/src/cache_query_test.cpp | 8 +-
.../cpp/core-test/src/reference_test.cpp | 14 +-
modules/platforms/cpp/core/Makefile.am | 2 +-
.../cache/query/continuous/continuous_query.h | 8 +-
.../include/ignite/cache/query/query_cursor.h | 4 +-
.../query/continuous/continuous_query_impl.h | 8 +-
.../core/include/ignite/impl/handle_registry.h | 2 +-
.../cpp/core/include/ignite/impl/operations.h | 4 +-
.../cpp/core/src/impl/cache/cache_impl.cpp | 5 +-
.../cpp/core/src/impl/handle_registry.cpp | 2 +-
.../cpp/examples/odbc-example/Makefile.am | 2 +-
.../cpp/examples/putget-example/Makefile.am | 2 +-
.../cpp/examples/query-example/Makefile.am | 2 +-
modules/platforms/cpp/ignite/Makefile.am | 2 +-
modules/platforms/cpp/jni/Makefile.am | 2 +-
modules/platforms/cpp/jni/src/java.cpp | 2 +-
modules/platforms/cpp/odbc-test/Makefile.am | 2 +-
.../cpp/odbc-test/config/queries-default.xml | 1 +
.../odbc-test/include/sql_test_suite_fixture.h | 3 +
.../platforms/cpp/odbc-test/include/test_type.h | 20 +-
.../platforms/cpp/odbc-test/src/column_test.cpp | 189 +++++++++++++++++++
.../odbc-test/src/sql_test_suite_fixture.cpp | 17 ++
.../cpp/odbc-test/src/sql_types_test.cpp | 131 +++++++++++++
modules/platforms/cpp/odbc/Makefile.am | 2 +-
.../cpp/odbc/include/ignite/odbc/utility.h | 9 +-
modules/platforms/cpp/odbc/src/column.cpp | 28 ++-
.../cpp/odbc/src/config/connection_info.cpp | 6 +-
modules/platforms/cpp/odbc/src/connection.cpp | 2 +
modules/platforms/cpp/odbc/src/odbc.cpp | 5 +-
modules/platforms/cpp/odbc/src/utility.cpp | 15 ++
37 files changed, 469 insertions(+), 48 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/binary/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/Makefile.am b/modules/platforms/cpp/binary/Makefile.am
index ca301a6..5ffc4fd 100644
--- a/modules/platforms/cpp/binary/Makefile.am
+++ b/modules/platforms/cpp/binary/Makefile.am
@@ -32,7 +32,7 @@ AM_CPPFLAGS = \
AM_CXXFLAGS = \
-Wall \
- -std=c++0x
+ -std=c++03
libignite_binary_la_LIBADD = \
@top_srcdir@/common/libignite-common.la
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_type_manager.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_type_manager.h b/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_type_manager.h
index 8aca1a0..63853f8 100644
--- a/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_type_manager.h
+++ b/modules/platforms/cpp/binary/include/ignite/impl/binary/binary_type_manager.h
@@ -88,7 +88,7 @@ namespace ignite
private:
/** Current snapshots. */
- ignite::common::concurrent::SharedPointer<std::map<int32_t, SPSnap>> snapshots;
+ ignite::common::concurrent::SharedPointer<std::map<int32_t, SPSnap> > snapshots;
/** Pending snapshots. */
std::vector<SPSnap>* pending;
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/binary/src/impl/binary/binary_type_manager.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/impl/binary/binary_type_manager.cpp b/modules/platforms/cpp/binary/src/impl/binary/binary_type_manager.cpp
index 9bd115c..8b5dfc1 100644
--- a/modules/platforms/cpp/binary/src/impl/binary/binary_type_manager.cpp
+++ b/modules/platforms/cpp/binary/src/impl/binary/binary_type_manager.cpp
@@ -28,7 +28,7 @@ namespace ignite
namespace binary
{
BinaryTypeManager::BinaryTypeManager() :
- snapshots(SharedPointer<std::map<int32_t, SPSnap>>(new std::map<int32_t, SPSnap>)),
+ snapshots(SharedPointer<std::map<int32_t, SPSnap> >(new std::map<int32_t, SPSnap>)),
pending(new std::vector<SPSnap>()),
cs(new CriticalSection()),
pendingVer(0), ver(0)
@@ -46,7 +46,7 @@ namespace ignite
SharedPointer<BinaryTypeHandler> BinaryTypeManager::GetHandler(int32_t typeId)
{
- SharedPointer<std::map<int32_t, SPSnap>> snapshots0 = snapshots;
+ SharedPointer<std::map<int32_t, SPSnap> > snapshots0 = snapshots;
SPSnap snapshot = (*snapshots0.Get())[typeId];
@@ -156,7 +156,7 @@ namespace ignite
if (!snapshotFound)
(*newSnapshots)[pendingSnap->GetTypeId()] = *it;
- snapshots = SharedPointer<std::map<int32_t, SPSnap>>(newSnapshots);
+ snapshots = SharedPointer<std::map<int32_t, SPSnap> >(newSnapshots);
}
else
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/binary/src/impl/interop/interop_memory.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/impl/interop/interop_memory.cpp b/modules/platforms/cpp/binary/src/impl/interop/interop_memory.cpp
index 926b7fb..04b27ae 100644
--- a/modules/platforms/cpp/binary/src/impl/interop/interop_memory.cpp
+++ b/modules/platforms/cpp/binary/src/impl/interop/interop_memory.cpp
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+#include <cstdlib>
#include <ignite/ignite_error.h>
#include "ignite/impl/interop/interop_memory.h"
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/common/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/Makefile.am b/modules/platforms/cpp/common/Makefile.am
index 2d16c2d..9c27a57 100644
--- a/modules/platforms/cpp/common/Makefile.am
+++ b/modules/platforms/cpp/common/Makefile.am
@@ -32,7 +32,7 @@ AM_CPPFLAGS = \
AM_CXXFLAGS = \
-Wall \
- -std=c++0x
+ -std=c++03
libignite_common_la_LDFLAGS = \
-no-undefined \
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/common/include/ignite/common/dynamic_size_array.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/include/ignite/common/dynamic_size_array.h b/modules/platforms/cpp/common/include/ignite/common/dynamic_size_array.h
index a6bcc13..d233e44 100644
--- a/modules/platforms/cpp/common/include/ignite/common/dynamic_size_array.h
+++ b/modules/platforms/cpp/common/include/ignite/common/dynamic_size_array.h
@@ -36,7 +36,7 @@ namespace ignite
* This is the analogue of the standard vector. It is needed to be used
* in exported classes as we can't export standard library classes.
*/
- template<typename T, typename A = DefaultAllocator<T>>
+ template<typename T, typename A = DefaultAllocator<T> >
class IGNITE_IMPORT_EXPORT DynamicSizeArray
{
public:
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/core-test/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/Makefile.am b/modules/platforms/cpp/core-test/Makefile.am
index 3cf1d0e..a5a60ed 100644
--- a/modules/platforms/cpp/core-test/Makefile.am
+++ b/modules/platforms/cpp/core-test/Makefile.am
@@ -39,7 +39,7 @@ AM_CPPFLAGS = \
AM_CXXFLAGS = \
-Wall \
- -std=c++0x
+ -std=c++03
ignite_tests_LDADD = \
@top_srcdir@/core/libignite.la \
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/core-test/src/cache_query_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/cache_query_test.cpp b/modules/platforms/cpp/core-test/src/cache_query_test.cpp
index 928d29e..b5bb170 100644
--- a/modules/platforms/cpp/core-test/src/cache_query_test.cpp
+++ b/modules/platforms/cpp/core-test/src/cache_query_test.cpp
@@ -362,7 +362,7 @@ void CheckGetAllFail(QueryCursor<int, QueryPerson>& cur)
{
try
{
- std::vector<CacheEntry<int, QueryPerson>> res;
+ std::vector<CacheEntry<int, QueryPerson> > res;
cur.GetAll(res);
@@ -406,7 +406,7 @@ void CheckEmpty(QueryFieldsCursor& cur)
*/
void CheckEmptyGetAll(QueryCursor<int, QueryPerson>& cur)
{
- std::vector<CacheEntry<int, QueryPerson>> res;
+ std::vector<CacheEntry<int, QueryPerson> > res;
cur.GetAll(res);
@@ -478,7 +478,7 @@ void CheckSingle(QueryFieldsCursor& cur, int key, const std::string& name, int a
*/
void CheckSingleGetAll(QueryCursor<int, QueryPerson>& cur, int key, const std::string& name, int age)
{
- std::vector<CacheEntry<int, QueryPerson>> res;
+ std::vector<CacheEntry<int, QueryPerson> > res;
cur.GetAll(res);
@@ -555,7 +555,7 @@ void CheckMultiple(QueryCursor<int, QueryPerson>& cur, int key1, const std::stri
void CheckMultipleGetAll(QueryCursor<int, QueryPerson>& cur, int key1, const std::string& name1,
int age1, int key2, const std::string& name2, int age2)
{
- std::vector<CacheEntry<int, QueryPerson>> res;
+ std::vector<CacheEntry<int, QueryPerson> > res;
cur.GetAll(res);
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/core-test/src/reference_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/reference_test.cpp b/modules/platforms/cpp/core-test/src/reference_test.cpp
index f5c3e8d..b240e2e 100644
--- a/modules/platforms/cpp/core-test/src/reference_test.cpp
+++ b/modules/platforms/cpp/core-test/src/reference_test.cpp
@@ -148,8 +148,10 @@ void TestFunctionConst3(ConstReference<C3> c3, int expected)
BOOST_AUTO_TEST_SUITE(ReferenceTestSuite)
+
BOOST_AUTO_TEST_CASE(StdSharedPointerTestBefore)
{
+#if !defined(BOOST_NO_CXX11_SMART_PTR)
bool objAlive = false;
std::shared_ptr<LivenessMarker> shared = std::make_shared<LivenessMarker>(objAlive);
@@ -167,10 +169,12 @@ BOOST_AUTO_TEST_CASE(StdSharedPointerTestBefore)
}
BOOST_CHECK(!objAlive);
+#endif
}
BOOST_AUTO_TEST_CASE(StdSharedPointerTestAfter)
{
+#if !defined(BOOST_NO_CXX11_SMART_PTR)
bool objAlive = false;
std::shared_ptr<LivenessMarker> shared = std::make_shared<LivenessMarker>(objAlive);
@@ -188,6 +192,7 @@ BOOST_AUTO_TEST_CASE(StdSharedPointerTestAfter)
shared.reset();
BOOST_CHECK(!objAlive);
+#endif
}
BOOST_AUTO_TEST_CASE(StdAutoPointerTest)
@@ -209,6 +214,7 @@ BOOST_AUTO_TEST_CASE(StdAutoPointerTest)
BOOST_AUTO_TEST_CASE(StdUniquePointerTest)
{
+#if !defined(BOOST_NO_CXX11_SMART_PTR)
bool objAlive = false;
std::unique_ptr<LivenessMarker> unique(new LivenessMarker(objAlive));
@@ -222,13 +228,14 @@ BOOST_AUTO_TEST_CASE(StdUniquePointerTest)
}
BOOST_CHECK(!objAlive);
+#endif
}
BOOST_AUTO_TEST_CASE(BoostSharedPointerTestBefore)
{
bool objAlive = false;
- boost::shared_ptr<LivenessMarker> shared = boost::make_shared<LivenessMarker>(objAlive);
+ boost::shared_ptr<LivenessMarker> shared = boost::make_shared<LivenessMarker>(boost::ref(objAlive));
BOOST_CHECK(objAlive);
@@ -249,7 +256,7 @@ BOOST_AUTO_TEST_CASE(BoostSharedPointerTestAfter)
{
bool objAlive = false;
- boost::shared_ptr<LivenessMarker> shared = boost::make_shared<LivenessMarker>(objAlive);
+ boost::shared_ptr<LivenessMarker> shared = boost::make_shared<LivenessMarker>(boost::ref(objAlive));
BOOST_CHECK(objAlive);
@@ -266,8 +273,10 @@ BOOST_AUTO_TEST_CASE(BoostSharedPointerTestAfter)
BOOST_CHECK(!objAlive);
}
+
BOOST_AUTO_TEST_CASE(PassingToFunction)
{
+#if !defined(BOOST_NO_CXX11_SMART_PTR)
bool objAlive = false;
std::shared_ptr<LivenessMarker> stdShared = std::make_shared<LivenessMarker>(objAlive);
@@ -281,6 +290,7 @@ BOOST_AUTO_TEST_CASE(PassingToFunction)
TestFunction(MakeReferenceFromSmartPointer(stdAuto));
TestFunction(MakeReferenceFromSmartPointer(boostShared));
+#endif
}
BOOST_AUTO_TEST_CASE(CopyTest)
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/core/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/Makefile.am b/modules/platforms/cpp/core/Makefile.am
index 758e68d..56e0c0a 100644
--- a/modules/platforms/cpp/core/Makefile.am
+++ b/modules/platforms/cpp/core/Makefile.am
@@ -37,7 +37,7 @@ AM_CPPFLAGS = \
AM_CXXFLAGS = \
-Wall \
- -std=c++0x
+ -std=c++03
libignite_la_LIBADD = \
@top_srcdir@/jni/libignite-jni.la \
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/core/include/ignite/cache/query/continuous/continuous_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/continuous/continuous_query.h b/modules/platforms/cpp/core/include/ignite/cache/query/continuous/continuous_query.h
index 4bd9c46..781ce2e 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/continuous/continuous_query.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/continuous/continuous_query.h
@@ -82,7 +82,7 @@ namespace ignite
* @param lsnr Event listener. Invoked on the node where
* continuous query execution has been started.
*/
- ContinuousQuery(Reference<event::CacheEntryEventListener<K, V>> lsnr) :
+ ContinuousQuery(Reference<event::CacheEntryEventListener<K, V> > lsnr) :
impl(new impl::cache::query::continuous::ContinuousQueryImpl<K, V>(lsnr))
{
// No-op.
@@ -95,7 +95,7 @@ namespace ignite
* continuous query execution has been started.
* @param loc Whether query should be executed locally.
*/
- ContinuousQuery(Reference<event::CacheEntryEventListener<K, V>> lsnr, bool loc) :
+ ContinuousQuery(Reference<event::CacheEntryEventListener<K, V> > lsnr, bool loc) :
impl(new impl::cache::query::continuous::ContinuousQueryImpl<K, V>(lsnr, loc))
{
// No-op.
@@ -202,7 +202,7 @@ namespace ignite
* node where continuous query execution has been
* started.
*/
- void SetListener(Reference<event::CacheEntryEventListener<K, V>> lsnr)
+ void SetListener(Reference<event::CacheEntryEventListener<K, V> > lsnr)
{
impl.Get()->SetListener(lsnr);
}
@@ -229,7 +229,7 @@ namespace ignite
private:
/** Implementation. */
- common::concurrent::SharedPointer<impl::cache::query::continuous::ContinuousQueryImpl<K, V>> impl;
+ common::concurrent::SharedPointer<impl::cache::query::continuous::ContinuousQueryImpl<K, V> > impl;
};
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h
index 61c6813..9057a03 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h
@@ -190,7 +190,7 @@ namespace ignite
*
* @throw IgniteError class instance in case of failure.
*/
- void GetAll(std::vector<CacheEntry<K, V>>& res)
+ void GetAll(std::vector<CacheEntry<K, V> >& res)
{
IgniteError err;
@@ -208,7 +208,7 @@ namespace ignite
* @param Vector where query entries will be stored.
* @param err Used to set operation result.
*/
- void GetAll(std::vector<CacheEntry<K, V>>& res, IgniteError& err)
+ void GetAll(std::vector<CacheEntry<K, V> >& res, IgniteError& err)
{
impl::cache::query::QueryCursorImpl* impl0 = impl.Get();
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/core/include/ignite/impl/cache/query/continuous/continuous_query_impl.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/impl/cache/query/continuous/continuous_query_impl.h b/modules/platforms/cpp/core/include/ignite/impl/cache/query/continuous/continuous_query_impl.h
index 50ced12..2a24e5f 100644
--- a/modules/platforms/cpp/core/include/ignite/impl/cache/query/continuous/continuous_query_impl.h
+++ b/modules/platforms/cpp/core/include/ignite/impl/cache/query/continuous/continuous_query_impl.h
@@ -255,7 +255,7 @@ namespace ignite
* @param lsnr Event listener. Invoked on the node where
* continuous query execution has been started.
*/
- ContinuousQueryImpl(Reference<ignite::cache::event::CacheEntryEventListener<K, V>>& lsnr) :
+ ContinuousQueryImpl(Reference<ignite::cache::event::CacheEntryEventListener<K, V> >& lsnr) :
ContinuousQueryImplBase(false),
lsnr(lsnr)
{
@@ -269,7 +269,7 @@ namespace ignite
* continuous query execution has been started.
* @param loc Whether query should be executed locally.
*/
- ContinuousQueryImpl(Reference<ignite::cache::event::CacheEntryEventListener<K, V>>& lsnr, bool loc) :
+ ContinuousQueryImpl(Reference<ignite::cache::event::CacheEntryEventListener<K, V> >& lsnr, bool loc) :
ContinuousQueryImplBase(loc),
lsnr(lsnr)
{
@@ -283,7 +283,7 @@ namespace ignite
* node where continuous query execution has been
* started.
*/
- void SetListener(Reference<ignite::cache::event::CacheEntryEventListener<K, V>>& val)
+ void SetListener(Reference<ignite::cache::event::CacheEntryEventListener<K, V> >& val)
{
lsnr = val;
}
@@ -340,7 +340,7 @@ namespace ignite
private:
/** Cache entry event listener. */
- Reference<ignite::cache::event::CacheEntryEventListener<K, V>> lsnr;
+ Reference<ignite::cache::event::CacheEntryEventListener<K, V> > lsnr;
};
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/core/include/ignite/impl/handle_registry.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/impl/handle_registry.h b/modules/platforms/cpp/core/include/ignite/impl/handle_registry.h
index 3c4d123..ecaf3ee 100644
--- a/modules/platforms/cpp/core/include/ignite/impl/handle_registry.h
+++ b/modules/platforms/cpp/core/include/ignite/impl/handle_registry.h
@@ -72,7 +72,7 @@ namespace ignite
void Clear();
private:
/** Map with data. */
- std::map<int64_t, common::concurrent::SharedPointer<void>> map;
+ std::map<int64_t, common::concurrent::SharedPointer<void> > map;
/** Mutex. */
common::concurrent::CriticalSection mux;
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/core/include/ignite/impl/operations.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/impl/operations.h b/modules/platforms/cpp/core/include/ignite/impl/operations.h
index a8fef93..177529d 100644
--- a/modules/platforms/cpp/core/include/ignite/impl/operations.h
+++ b/modules/platforms/cpp/core/include/ignite/impl/operations.h
@@ -531,7 +531,7 @@ namespace ignite
/**
* Constructor.
*/
- OutQueryGetAllOperation(std::vector<ignite::cache::CacheEntry<K, V>>* res) : res(res)
+ OutQueryGetAllOperation(std::vector<ignite::cache::CacheEntry<K, V> >* res) : res(res)
{
// No-op.
}
@@ -556,7 +556,7 @@ namespace ignite
private:
/** Entries. */
- std::vector<ignite::cache::CacheEntry<K, V>>* res;
+ std::vector<ignite::cache::CacheEntry<K, V> >* res;
IGNITE_NO_COPY_ASSIGNMENT(OutQueryGetAllOperation)
};
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/core/src/impl/cache/cache_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/cache/cache_impl.cpp b/modules/platforms/cpp/core/src/impl/cache/cache_impl.cpp
index ad69d45..5d09e46 100644
--- a/modules/platforms/cpp/core/src/impl/cache/cache_impl.cpp
+++ b/modules/platforms/cpp/core/src/impl/cache/cache_impl.cpp
@@ -325,11 +325,12 @@ namespace ignite
return QueryContinuous(qry, initialQry, OP_QRY_SCAN, OP_QRY_CONTINUOUS, err);
}
+ struct DummyQry { void Write(BinaryRawWriter&) const { }};
+
ContinuousQueryHandleImpl* CacheImpl::QueryContinuous(const SharedPointer<ContinuousQueryImplBase> qry,
IgniteError& err)
{
- struct { void Write(BinaryRawWriter&) const { }} dummy;
-
+ DummyQry dummy;
return QueryContinuous(qry, dummy, -1, OP_QRY_CONTINUOUS, err);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/core/src/impl/handle_registry.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/handle_registry.cpp b/modules/platforms/cpp/core/src/impl/handle_registry.cpp
index 069e996..a279762 100644
--- a/modules/platforms/cpp/core/src/impl/handle_registry.cpp
+++ b/modules/platforms/cpp/core/src/impl/handle_registry.cpp
@@ -37,7 +37,7 @@ namespace ignite
SharedPointer<void> HandleRegistrySegment::Get(int64_t hnd)
{
- typedef std::map<int64_t, SharedPointer<void>> Map;
+ typedef std::map<int64_t, SharedPointer<void> > Map;
CsLockGuard guard(mux);
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/examples/odbc-example/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/odbc-example/Makefile.am b/modules/platforms/cpp/examples/odbc-example/Makefile.am
index 83cc63e..f3c9a50 100644
--- a/modules/platforms/cpp/examples/odbc-example/Makefile.am
+++ b/modules/platforms/cpp/examples/odbc-example/Makefile.am
@@ -36,7 +36,7 @@ AM_CPPFLAGS = \
AM_CXXFLAGS = \
-Wall \
- -std=c++0x
+ -std=c++03
ignite_odbcexample_LDADD = \
@top_srcdir@/../core/libignite.la \
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/examples/putget-example/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/putget-example/Makefile.am b/modules/platforms/cpp/examples/putget-example/Makefile.am
index cf39002..88edc81 100644
--- a/modules/platforms/cpp/examples/putget-example/Makefile.am
+++ b/modules/platforms/cpp/examples/putget-example/Makefile.am
@@ -36,7 +36,7 @@ AM_CPPFLAGS = \
AM_CXXFLAGS = \
-Wall \
- -std=c++0x
+ -std=c++03
ignite_putgetexample_LDADD = \
@top_srcdir@/../core/libignite.la \
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/examples/query-example/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/query-example/Makefile.am b/modules/platforms/cpp/examples/query-example/Makefile.am
index 01231ec..1d00bcf 100644
--- a/modules/platforms/cpp/examples/query-example/Makefile.am
+++ b/modules/platforms/cpp/examples/query-example/Makefile.am
@@ -36,7 +36,7 @@ AM_CPPFLAGS = \
AM_CXXFLAGS = \
-Wall \
- -std=c++0x
+ -std=c++03
ignite_queryexample_LDADD = \
@top_srcdir@/../core/libignite.la \
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/ignite/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/ignite/Makefile.am b/modules/platforms/cpp/ignite/Makefile.am
index 2dbc4d6..9b65f05 100644
--- a/modules/platforms/cpp/ignite/Makefile.am
+++ b/modules/platforms/cpp/ignite/Makefile.am
@@ -36,7 +36,7 @@ AM_CPPFLAGS = \
AM_CXXFLAGS = \
-Wall \
- -std=c++0x
+ -std=c++03
ignite_LDADD = \
@top_srcdir@/core/libignite.la \
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/jni/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/jni/Makefile.am b/modules/platforms/cpp/jni/Makefile.am
index 2cb4b90..56eaa6c 100644
--- a/modules/platforms/cpp/jni/Makefile.am
+++ b/modules/platforms/cpp/jni/Makefile.am
@@ -35,7 +35,7 @@ AM_CPPFLAGS = \
AM_CXXFLAGS = \
-Wall \
- -std=c++0x
+ -std=c++03
libignite_jni_la_LIBADD = \
-L$(JAVA_HOME)/jre/lib/amd64/server \
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/jni/src/java.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/jni/src/java.cpp b/modules/platforms/cpp/jni/src/java.cpp
index e6f2f88..2c8c76a 100644
--- a/modules/platforms/cpp/jni/src/java.cpp
+++ b/modules/platforms/cpp/jni/src/java.cpp
@@ -1552,7 +1552,7 @@ namespace ignite
if (consoleWriteHandlers.size() > 0) {
ConsoleWriteHandler consoleWrite = consoleWriteHandlers.at(0);
- const char* strChars = env->GetStringUTFChars(str, nullptr);
+ const char* strChars = env->GetStringUTFChars(str, 0);
const int strCharsLen = env->GetStringUTFLength(str);
consoleWrite(strChars, strCharsLen, isErr);
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/odbc-test/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/Makefile.am b/modules/platforms/cpp/odbc-test/Makefile.am
index e10ef7a..c2f3fa2 100644
--- a/modules/platforms/cpp/odbc-test/Makefile.am
+++ b/modules/platforms/cpp/odbc-test/Makefile.am
@@ -40,7 +40,7 @@ AM_CPPFLAGS = \
AM_CXXFLAGS = \
-Wall \
- -std=c++0x
+ -std=c++03
ignite_odbc_tests_LDADD = \
@top_srcdir@/core/libignite.la \
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/odbc-test/config/queries-default.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/config/queries-default.xml b/modules/platforms/cpp/odbc-test/config/queries-default.xml
index 6614e93..6dbc4f7 100644
--- a/modules/platforms/cpp/odbc-test/config/queries-default.xml
+++ b/modules/platforms/cpp/odbc-test/config/queries-default.xml
@@ -59,6 +59,7 @@
<entry key="guidField" value="java.util.UUID"/>
<entry key="dateField" value="java.util.Date"/>
<entry key="timestampField" value="java.sql.Timestamp"/>
+ <entry key="i8ArrayField" value="[B"/>
</map>
</property>
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/odbc-test/include/sql_test_suite_fixture.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/include/sql_test_suite_fixture.h b/modules/platforms/cpp/odbc-test/include/sql_test_suite_fixture.h
index 6d26818..55353e5 100644
--- a/modules/platforms/cpp/odbc-test/include/sql_test_suite_fixture.h
+++ b/modules/platforms/cpp/odbc-test/include/sql_test_suite_fixture.h
@@ -192,6 +192,9 @@ namespace ignite
template<>
void SqlTestSuiteFixture::CheckSingleResult<Timestamp>(const char* request);
+
+ template<>
+ void SqlTestSuiteFixture::CheckSingleResult<std::vector<int8_t> >(const char* request, const std::vector<int8_t>& expected);
}
#endif //_IGNITE_ODBC_TEST_SQL_TEST_SUIT_FIXTURE
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/odbc-test/include/test_type.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/include/test_type.h b/modules/platforms/cpp/odbc-test/include/test_type.h
index 0e08251..daeff83 100644
--- a/modules/platforms/cpp/odbc-test/include/test_type.h
+++ b/modules/platforms/cpp/odbc-test/include/test_type.h
@@ -74,6 +74,7 @@ namespace ignite
Guid guidField;
Date dateField;
Timestamp timestampField;
+ std::vector<int8_t> i8ArrayField;
};
}
@@ -107,6 +108,14 @@ namespace ignite
writer.WriteGuid("guidField", obj.guidField);
writer.WriteDate("dateField", obj.dateField);
writer.WriteTimestamp("timestampField", obj.timestampField);
+ if (obj.i8ArrayField.empty())
+ {
+ writer.WriteNull("i8ArrayField");
+ }
+ else
+ {
+ writer.WriteInt8Array("i8ArrayField", &obj.i8ArrayField[0], static_cast<int32_t>(obj.i8ArrayField.size()));
+ }
}
else
{
@@ -121,6 +130,7 @@ namespace ignite
writer.WriteNull("guidField");
writer.WriteNull("dateField");
writer.WriteNull("timestampField");
+ writer.WriteNull("i8ArrayField");
}
}
@@ -138,9 +148,17 @@ namespace ignite
Date dateField = reader.ReadDate("dateField");
Timestamp timestampField = reader.ReadTimestamp("timestampField");
- return TestType(i8Field, i16Field, i32Field, i64Field, strField,
+ TestType result(i8Field, i16Field, i32Field, i64Field, strField,
floatField, doubleField, boolField, guidField, dateField,
timestampField);
+
+ int32_t len = reader.ReadInt8Array("i8ArrayField", 0, 0);
+ if (len > 0)
+ {
+ result.i8ArrayField.resize(len);
+ reader.ReadInt8Array("i8ArrayField", &result.i8ArrayField[0], len);
+ }
+ return result;
}
IGNITE_BINARY_TYPE_END
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/odbc-test/src/column_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/column_test.cpp b/modules/platforms/cpp/odbc-test/src/column_test.cpp
index 6cbea8b..66d0214 100644
--- a/modules/platforms/cpp/odbc-test/src/column_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/column_test.cpp
@@ -287,4 +287,193 @@ BOOST_AUTO_TEST_CASE(TestColumnMultiString)
BOOST_REQUIRE(column2.GetUnreadDataLength() == 0);
}
+BOOST_AUTO_TEST_CASE(TestColumnByteArray)
+{
+ ignite::impl::interop::InteropUnpooledMemory mem(4096);
+ ignite::impl::interop::InteropOutputStream outStream(&mem);
+ ignite::impl::binary::BinaryWriterImpl writer(&outStream, 0);
+
+ const int8_t bytes[] = { 'A','B','C','D','E','F','G','H','I','J' };
+ std::vector<int8_t> data(bytes, bytes + sizeof(bytes) / sizeof(bytes[0]));
+ writer.WriteInt8Array(&data[0], static_cast<int32_t>(data.size()));
+
+ outStream.Synchronize();
+
+ ignite::impl::interop::InteropInputStream inStream(&mem);
+ ignite::impl::binary::BinaryReaderImpl reader(&inStream);
+
+ Column column(reader);
+
+ BOOST_REQUIRE(column.IsValid());
+
+ BOOST_REQUIRE(column.GetSize() == data.size());
+
+ BOOST_REQUIRE(column.GetUnreadDataLength() == data.size());
+
+ std::vector<int8_t> buf(data.size());
+ SqlLen reslen = 0;
+ int* offset = 0;
+
+ ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_BINARY, &buf[0], buf.size(), &reslen, &offset);
+
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+
+ BOOST_REQUIRE(column.IsValid());
+
+ BOOST_REQUIRE(column.GetSize() == data.size());
+
+ BOOST_REQUIRE(column.GetUnreadDataLength() == 0);
+
+ BOOST_REQUIRE_EQUAL_COLLECTIONS(buf.begin(), buf.end(), data.begin(), data.end());
+
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+
+ BOOST_REQUIRE(column.IsValid());
+
+ BOOST_REQUIRE(column.GetSize() == data.size());
+
+ BOOST_REQUIRE(column.GetUnreadDataLength() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(TestColumnByteArrayHalfBuffer)
+{
+ ignite::impl::interop::InteropUnpooledMemory mem(4096);
+ ignite::impl::interop::InteropOutputStream outStream(&mem);
+ ignite::impl::binary::BinaryWriterImpl writer(&outStream, 0);
+
+ const int8_t bytes[] = { 'A','B','C','D','E','F','G','H','I','J' };
+ std::vector<int8_t> data(bytes, bytes + sizeof(bytes)/sizeof(bytes[0]));
+ BOOST_REQUIRE(0 == data.size() % 2);
+
+ writer.WriteInt8Array(&data[0], static_cast<int32_t>(data.size()));
+
+ outStream.Synchronize();
+
+ ignite::impl::interop::InteropInputStream inStream(&mem);
+ ignite::impl::binary::BinaryReaderImpl reader(&inStream);
+
+ Column column(reader);
+
+ BOOST_REQUIRE(column.IsValid());
+
+ BOOST_REQUIRE(column.GetSize() == data.size());
+
+ BOOST_REQUIRE(column.GetUnreadDataLength() == data.size());
+
+ std::vector<int8_t> buf(data.size()/2);
+ SqlLen reslen = 0;
+ int* offset = 0;
+
+ ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_BINARY, &buf[0], buf.size(), &reslen, &offset);
+
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+
+ BOOST_REQUIRE(column.IsValid());
+
+ BOOST_REQUIRE(column.GetSize() == data.size());
+
+ BOOST_REQUIRE(column.GetUnreadDataLength() == data.size() - buf.size());
+
+ std::vector<int8_t> result;
+ result.reserve(data.size());
+ std::copy(buf.begin(), buf.end(), std::back_inserter(result));
+
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+
+ BOOST_REQUIRE(column.IsValid());
+
+ BOOST_REQUIRE(column.GetSize() == data.size());
+
+ BOOST_REQUIRE(column.GetUnreadDataLength() == 0);
+
+ std::copy(buf.begin(), buf.end(), std::back_inserter(result));
+
+ BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+
+ BOOST_REQUIRE(column.IsValid());
+
+ BOOST_REQUIRE(column.GetSize() == data.size());
+
+ BOOST_REQUIRE(column.GetUnreadDataLength() == 0);
+
+ BOOST_REQUIRE_EQUAL_COLLECTIONS(result.begin(), result.end(), data.begin(), data.end());
+}
+
+BOOST_AUTO_TEST_CASE(TestColumnByteArrayTwoColumns)
+{
+ ignite::impl::interop::InteropUnpooledMemory mem(4096);
+ ignite::impl::interop::InteropOutputStream outStream(&mem);
+ ignite::impl::binary::BinaryWriterImpl writer(&outStream, 0);
+
+ const int8_t bytes1[] = { 'A','B','C','D','E','F','G','H','I','J' };
+ const int8_t bytes2[] = { 'a','b','c','d','e','f','g','h','i','j' };
+ std::vector<int8_t> data1(bytes1, bytes1 + sizeof(bytes1)/sizeof(bytes1[0]));
+ std::vector<int8_t> data2(bytes2, bytes2 + sizeof(bytes2)/sizeof(bytes2[0]));
+ writer.WriteInt8Array(&data1[0], static_cast<int32_t>(data1.size()));
+ writer.WriteInt8Array(&data2[0], static_cast<int32_t>(data2.size()));
+
+ outStream.Synchronize();
+
+ ignite::impl::interop::InteropInputStream inStream(&mem);
+ ignite::impl::binary::BinaryReaderImpl reader(&inStream);
+
+ Column column1(reader);
+ inStream.Position(column1.GetEndPosition());
+ Column column2(reader);
+
+ BOOST_REQUIRE(column1.IsValid());
+
+ BOOST_REQUIRE(column1.GetSize() == data1.size());
+
+ BOOST_REQUIRE(column1.GetUnreadDataLength() == data1.size());
+
+ BOOST_REQUIRE(column2.IsValid());
+
+ BOOST_REQUIRE(column2.GetSize() == data2.size());
+
+ BOOST_REQUIRE(column2.GetUnreadDataLength() == data2.size());
+
+ int8_t buf[1024] = {};
+ SqlLen reslen = 0;
+ int* offset = 0;
+
+ ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_BINARY, &buf, sizeof(buf), &reslen, &offset);
+
+ BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+
+ BOOST_REQUIRE(column1.IsValid());
+
+ BOOST_REQUIRE(column1.GetSize() == data1.size());
+
+ BOOST_REQUIRE(column1.GetUnreadDataLength() == 0);
+
+ BOOST_REQUIRE_EQUAL_COLLECTIONS(buf, buf + reslen, data1.begin(), data1.end());
+
+ BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+
+ BOOST_REQUIRE(column1.IsValid());
+
+ BOOST_REQUIRE(column1.GetSize() == data1.size());
+
+ BOOST_REQUIRE(column1.GetUnreadDataLength() == 0);
+
+ BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+
+ BOOST_REQUIRE(column2.IsValid());
+
+ BOOST_REQUIRE(column2.GetSize() == data1.size());
+
+ BOOST_REQUIRE(column2.GetUnreadDataLength() == 0);
+
+ BOOST_REQUIRE_EQUAL_COLLECTIONS(buf, buf + reslen, data2.begin(), data2.end());
+
+ BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+
+ BOOST_REQUIRE(column2.IsValid());
+
+ BOOST_REQUIRE(column2.GetSize() == data1.size());
+
+ BOOST_REQUIRE(column2.GetUnreadDataLength() == 0);
+}
+
BOOST_AUTO_TEST_SUITE_END()
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp b/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp
index 29d1d18..b118ff8 100644
--- a/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp
+++ b/modules/platforms/cpp/odbc-test/src/sql_test_suite_fixture.cpp
@@ -285,4 +285,21 @@ namespace ignite
CheckSingleResult0(request, SQL_C_TIMESTAMP, &res, 0, 0);
}
+
+ template<>
+ void SqlTestSuiteFixture::CheckSingleResult<std::vector<int8_t> >(const char* request, const std::vector<int8_t>& expected)
+ {
+ SQLCHAR res[ODBC_BUFFER_SIZE] = { 0 };
+ SQLLEN resLen = 0;
+
+ CheckSingleResult0(request, SQL_C_BINARY, res, ODBC_BUFFER_SIZE, &resLen);
+
+ BOOST_REQUIRE_EQUAL(resLen, expected.size());
+
+ if (resLen > 0)
+ {
+ std::vector<int8_t> actual(res, res + resLen);
+ BOOST_REQUIRE_EQUAL_COLLECTIONS(expected.begin(), expected.end(), actual.begin(), actual.end());
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/odbc-test/src/sql_types_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/sql_types_test.cpp b/modules/platforms/cpp/odbc-test/src/sql_types_test.cpp
index ccbb917..33797b0 100644
--- a/modules/platforms/cpp/odbc-test/src/sql_types_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/sql_types_test.cpp
@@ -22,6 +22,7 @@
#include <boost/test/unit_test.hpp>
#include "sql_test_suite_fixture.h"
+#include "test_utils.h"
using namespace ignite;
@@ -56,5 +57,135 @@ BOOST_AUTO_TEST_CASE(TestGuidEqualsToColumn)
"SELECT i32Field FROM TestType WHERE guidField = {guid '04cc382a-0b82-f520-08d0-07a0620c0004'}", in2.i32Field);
}
+BOOST_AUTO_TEST_CASE(TestByteArraySelect)
+{
+ TestType in;
+ const int8_t data[] = { 'A','B','C','D','E','F','G','H','I','J' };
+ in.i8ArrayField.assign(data, data + sizeof(data)/sizeof(data[0]));
+ testCache.Put(1, in);
+
+ TestType out = testCache.Get(1);
+
+ BOOST_REQUIRE(in.i8ArrayField.size() == out.i8ArrayField.size());
+
+ BOOST_REQUIRE_EQUAL_COLLECTIONS(in.i8ArrayField.begin(), in.i8ArrayField.end(), out.i8ArrayField.begin(), out.i8ArrayField.end());
+
+ CheckSingleResult<std::vector<int8_t> >("SELECT i8ArrayField FROM TestType", in.i8ArrayField);
+}
+
+BOOST_AUTO_TEST_CASE(TestByteArrayParam)
+{
+ SQLRETURN ret;
+
+ TestType in;
+ in.i8Field = 101;
+
+ const int8_t data[] = { 'A','B','C','D','E','F','G','H','I','J' };
+ in.i8ArrayField.assign(data, data + sizeof(data) / sizeof(data[0]));
+
+ testCache.Put(1, in);
+
+ SQLLEN colLen = 0;
+ SQLCHAR colData = 0;
+
+ ret = SQLBindCol(stmt, 1, SQL_C_TINYINT, &colData, sizeof(colData), &colLen);
+ if (!SQL_SUCCEEDED(ret))
+ BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+ SQLCHAR request[] = "SELECT i8Field FROM TestType WHERE i8ArrayField = ?";
+
+ ret = SQLPrepare(stmt, request, SQL_NTS);
+ if (!SQL_SUCCEEDED(ret))
+ BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+ std::vector<int8_t> paramData(in.i8ArrayField);
+ SQLLEN paramLen = paramData.size();
+ ret = SQLBindParameter(stmt, 1, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_VARBINARY, paramData.size(), 0, ¶mData[0], paramData.size(), ¶mLen);
+
+ if (!SQL_SUCCEEDED(ret))
+ BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+ ret = SQLExecute(stmt);
+
+ if (!SQL_SUCCEEDED(ret))
+ BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+ ret = SQLFetch(stmt);
+ if (!SQL_SUCCEEDED(ret))
+ BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+ BOOST_REQUIRE_EQUAL(colData, in.i8Field);
+ BOOST_REQUIRE_EQUAL(colLen, sizeof(colData));
+
+ ret = SQLFetch(stmt);
+ BOOST_REQUIRE(ret == SQL_NO_DATA);
+}
+
+BOOST_AUTO_TEST_CASE(TestByteArrayParamInsert)
+{
+ SQLRETURN ret;
+
+ const int8_t data[] = { 'A','B','C','D','E','F','G','H','I','J' };
+ std::vector<int8_t> paramData(data, data + sizeof(data) / sizeof(data[0]));
+ SQLCHAR request[] = "INSERT INTO TestType(_key, i8ArrayField) VALUES(?, ?)";;
+
+ ret = SQLPrepare(stmt, request, SQL_NTS);
+
+ if (!SQL_SUCCEEDED(ret))
+ BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+ int64_t key = 1;
+ ret = SQLBindParameter(stmt, 1, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_BIGINT, 0, 0, &key, 0, 0);
+
+ if (!SQL_SUCCEEDED(ret))
+ BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+ SQLLEN paramLen = paramData.size();
+
+ ret = SQLBindParameter(stmt, 2, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_VARBINARY, paramData.size(), 0, ¶mData[0], paramData.size(), ¶mLen);
+
+ if (!SQL_SUCCEEDED(ret))
+ BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+ ret = SQLExecute(stmt);
+
+ if (!SQL_SUCCEEDED(ret))
+ BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+ TestType out = testCache.Get(key);
+ BOOST_REQUIRE_EQUAL_COLLECTIONS(out.i8ArrayField.begin(), out.i8ArrayField.end(), paramData.begin(), paramData.end());
+}
+
+BOOST_AUTO_TEST_CASE(TestByteParamInsert)
+{
+ SQLRETURN ret;
+
+ SQLCHAR request[] = "INSERT INTO TestType(_key, i8Field) VALUES(?, ?)";;
+
+ ret = SQLPrepare(stmt, request, SQL_NTS);
+
+ if (!SQL_SUCCEEDED(ret))
+ BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+ int64_t key = 1;
+ ret = SQLBindParameter(stmt, 1, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_BIGINT, 0, 0, &key, 0, 0);
+
+ if (!SQL_SUCCEEDED(ret))
+ BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+ int8_t data = 2;
+ ret = SQLBindParameter(stmt, 2, SQL_PARAM_INPUT, SQL_C_TINYINT, SQL_TINYINT, 0, 0, &data, 0, 0);
+
+ if (!SQL_SUCCEEDED(ret))
+ BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+ ret = SQLExecute(stmt);
+
+ if (!SQL_SUCCEEDED(ret))
+ BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
+ TestType out = testCache.Get(key);
+ BOOST_REQUIRE_EQUAL(out.i8Field, data);
+}
BOOST_AUTO_TEST_SUITE_END()
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/odbc/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/Makefile.am b/modules/platforms/cpp/odbc/Makefile.am
index b0cc5f8..1eb42d1 100644
--- a/modules/platforms/cpp/odbc/Makefile.am
+++ b/modules/platforms/cpp/odbc/Makefile.am
@@ -33,7 +33,7 @@ AM_CPPFLAGS = \
AM_CXXFLAGS = \
-Wall \
- -std=c++0x
+ -std=c++03
libignite_odbc_la_LIBADD = \
@top_srcdir@/binary/libignite-binary.la \
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h b/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h
index 37daa50..590e97c 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h
@@ -46,7 +46,6 @@ void logInit(const char*);
fprintf(log_file, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__); \
fflush(log_file); \
} while (false)
-
#else
# define LOG_MSG(...)
#endif
@@ -181,6 +180,14 @@ namespace ignite
* @return Standard string containing the same data.
*/
std::string SqlStringToString(const unsigned char* sqlStr, int32_t sqlStrLen);
+
+ /**
+ * Convert binary data to hex dump form
+ * @param data pointer to data
+ * @param count data length
+ * @return standard string containing the formated hex dump
+ */
+ std::string HexDump(const char* data, size_t count);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/odbc/src/column.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/column.cpp b/modules/platforms/cpp/odbc/src/column.cpp
index 3e6bbca..0ec8078 100644
--- a/modules/platforms/cpp/odbc/src/column.cpp
+++ b/modules/platforms/cpp/odbc/src/column.cpp
@@ -40,7 +40,7 @@ namespace
break;
}
-
+
case IGNITE_TYPE_OBJECT:
{
int8_t protoVer = stream.ReadInt8();
@@ -88,6 +88,7 @@ namespace
case IGNITE_TYPE_DOUBLE:
case IGNITE_TYPE_BOOL:
case IGNITE_HDR_NULL:
+ case IGNITE_TYPE_ARRAY_BYTE:
{
// No-op.
break;
@@ -290,6 +291,17 @@ namespace ignite
break;
}
+ case IGNITE_TYPE_ARRAY_BYTE:
+ {
+ sizeTmp = reader.ReadInt32();
+ assert(sizeTmp >= 0);
+
+ startPosTmp = stream->Position();
+ stream->Position(stream->Position() + sizeTmp);
+
+ break;
+ }
+
default:
{
// This is a fail case.
@@ -473,6 +485,20 @@ namespace ignite
break;
}
+ case IGNITE_TYPE_ARRAY_BYTE:
+ {
+ stream->Position(startPos + offset);
+ int32_t maxRead = std::min(GetUnreadDataLength(), static_cast<int32_t>(dataBuf.GetSize()));
+ std::vector<int8_t> data(maxRead);
+
+ stream->ReadInt8Array(&data[0], static_cast<int32_t>(data.size()));
+
+ int32_t written = dataBuf.PutBinaryData(data.data(), data.size());
+
+ IncreaseOffset(written);
+ break;
+ }
+
default:
{
// This is a fail case. Return false.
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/odbc/src/config/connection_info.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/config/connection_info.cpp b/modules/platforms/cpp/odbc/src/config/connection_info.cpp
index 341ab7f..7c612bc 100644
--- a/modules/platforms/cpp/odbc/src/config/connection_info.cpp
+++ b/modules/platforms/cpp/odbc/src/config/connection_info.cpp
@@ -412,7 +412,7 @@ namespace ignite
StringInfoMap::const_iterator itStr = strParams.find(type);
- if (itStr != strParams.cend())
+ if (itStr != strParams.end())
{
unsigned short strlen = static_cast<short>(
utility::CopyStringToBuffer(itStr->second,
@@ -426,7 +426,7 @@ namespace ignite
UintInfoMap::const_iterator itInt = intParams.find(type);
- if (itInt != intParams.cend())
+ if (itInt != intParams.end())
{
unsigned int *res = reinterpret_cast<unsigned int*>(buf);
@@ -437,7 +437,7 @@ namespace ignite
UshortInfoMap::const_iterator itShort = shortParams.find(type);
- if (itShort != shortParams.cend())
+ if (itShort != shortParams.end())
{
unsigned short *res = reinterpret_cast<unsigned short*>(buf);
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/odbc/src/connection.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/connection.cpp b/modules/platforms/cpp/odbc/src/connection.cpp
index 38f8cba..2afa42d 100644
--- a/modules/platforms/cpp/odbc/src/connection.cpp
+++ b/modules/platforms/cpp/odbc/src/connection.cpp
@@ -194,6 +194,8 @@ namespace ignite
if (sent != len + sizeof(OdbcProtocolHeader))
IGNITE_ERROR_1(IgniteError::IGNITE_ERR_GENERIC, "Can not send message");
+
+ LOG_MSG("message sent: (%d bytes)%s\n", msg.GetSize(), utility::HexDump((char*)msg.GetData(), msg.GetSize()).c_str());
}
size_t Connection::SendAll(const int8_t* data, size_t len)
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/odbc/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/odbc.cpp b/modules/platforms/cpp/odbc/src/odbc.cpp
index 0b18a11..dbec55f 100644
--- a/modules/platforms/cpp/odbc/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/src/odbc.cpp
@@ -512,9 +512,10 @@ namespace ignite
int32_t res = statement->GetColumnNumber();
if (columnNum)
+ {
*columnNum = static_cast<SQLSMALLINT>(res);
-
- LOG_MSG("columnNum: %d\n", *columnNum);
+ LOG_MSG("columnNum: %d\n", *columnNum);
+ }
return statement->GetDiagnosticRecords().GetReturnCode();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/32d2629e/modules/platforms/cpp/odbc/src/utility.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/utility.cpp b/modules/platforms/cpp/odbc/src/utility.cpp
index 756ab36..c15c23c 100644
--- a/modules/platforms/cpp/odbc/src/utility.cpp
+++ b/modules/platforms/cpp/odbc/src/utility.cpp
@@ -154,6 +154,21 @@ namespace ignite
else
res.clear();
}
+
+ std::string HexDump(const char* data, size_t count)
+ {
+ std::stringstream dump;
+ size_t cnt = 0;
+ for(const char* p = data, *e = data + count; p != e; ++p)
+ {
+ if (cnt++ % 16 == 0)
+ {
+ dump << std::endl;
+ }
+ dump << std::hex << std::setfill('0') << std::setw(2) << (int)*p << " ";
+ }
+ return dump.str();
+ }
}
}
[35/50] [abbrv] ignite git commit: IGNITE-3886 .NET: Fix build script
to use latest build tools
Posted by ag...@apache.org.
IGNITE-3886 .NET: Fix build script to use latest build tools
This fixes C++ compilation issue with retargeted projects
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ff0caf81
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ff0caf81
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ff0caf81
Branch: refs/heads/ignite-3477
Commit: ff0caf810f3bb76f284555dd37f93706c9edf1e7
Parents: 58188e8
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Jan 10 17:49:07 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Jan 10 17:49:07 2017 +0300
----------------------------------------------------------------------
modules/platforms/dotnet/build.ps1 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ff0caf81/modules/platforms/dotnet/build.ps1
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/build.ps1 b/modules/platforms/dotnet/build.ps1
index be7e638..4b5d937 100644
--- a/modules/platforms/dotnet/build.ps1
+++ b/modules/platforms/dotnet/build.ps1
@@ -127,7 +127,7 @@ else {
# 2) Build .NET
# Detect MSBuild 4.0+
-for ($i=4; $i -le 20; $i++) {
+for ($i=20; $i -ge 4; $i--) {
$regKey = "HKLM:\software\Microsoft\MSBuild\ToolsVersions\$i.0"
if (Test-Path $regKey) { break }
}
[22/50] [abbrv] ignite git commit: IGNITE-4519 Updating ignite-aws
java sdk pom version
Posted by ag...@apache.org.
IGNITE-4519 Updating ignite-aws java sdk pom version
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6c1cd162
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6c1cd162
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6c1cd162
Branch: refs/heads/ignite-3477
Commit: 6c1cd162e60af37c9d380d801a6d2ce7f3b448b1
Parents: 72f03ea
Author: chandresh.pancholi <ch...@arvindinternet.com>
Authored: Wed Jan 4 18:21:41 2017 +0530
Committer: chandresh.pancholi <ch...@arvindinternet.com>
Committed: Wed Jan 4 18:21:41 2017 +0530
----------------------------------------------------------------------
parent/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6c1cd162/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 682efa2..2cb88b0 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -53,7 +53,7 @@
<aspectj.bundle.version>1.7.2_1</aspectj.bundle.version>
<aspectj.version>1.7.2</aspectj.version>
<aws.sdk.bundle.version>1.10.12_1</aws.sdk.bundle.version>
- <aws.sdk.version>1.10.29</aws.sdk.version>
+ <aws.sdk.version>1.11.75</aws.sdk.version>
<camel.version>2.16.0</camel.version>
<commons.beanutils.bundle.version>1.8.3_1</commons.beanutils.bundle.version>
<commons.beanutils.version>1.8.3</commons.beanutils.version>