You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2016/06/06 11:57:00 UTC
[01/32] ignite git commit: IGNITE-3200: Resolved classloader leak.
Repository: ignite
Updated Branches:
refs/heads/ignite-3212 7e3ecb955 -> 335de5496
IGNITE-3200: Resolved classloader leak.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/56c60562
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/56c60562
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/56c60562
Branch: refs/heads/ignite-3212
Commit: 56c605622dbecf71f3ee87cc41a16d2ee87e92d3
Parents: a28e16e
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu May 26 11:15:48 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue May 31 11:28:18 2016 +0300
----------------------------------------------------------------------
.../apache/ignite/internal/util/ClassCache.java | 32 ++++++++++++++++++++
.../ignite/internal/util/IgniteUtils.java | 6 +++-
.../processors/hadoop/HadoopClassLoader.java | 23 +++++++++++++-
3 files changed, 59 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/56c60562/modules/core/src/main/java/org/apache/ignite/internal/util/ClassCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/ClassCache.java b/modules/core/src/main/java/org/apache/ignite/internal/util/ClassCache.java
new file mode 100644
index 0000000..7d6edbe
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/ClassCache.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util;
+
+/**
+ * Class cache.
+ */
+public interface ClassCache {
+ /**
+ * Get class for the given name.
+ *
+ * @param clsName Class name.
+ * @return Class.
+ * @throws ClassNotFoundException If not found.
+ */
+ public Class<?> getFromCache(String clsName) throws ClassNotFoundException;
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/56c60562/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index ed8e100..cbefd7d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -8232,7 +8232,11 @@ public abstract class IgniteUtils {
if (cls != null)
return cls;
- if (ldr == null)
+ if (ldr != null) {
+ if (ldr instanceof ClassCache)
+ return ((ClassCache)ldr).getFromCache(clsName);
+ }
+ else
ldr = gridClassLoader;
ConcurrentMap<String, Class> ldrMap = classCache.get(ldr);
http://git-wip-us.apache.org/repos/asf/ignite/blob/56c60562/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
index 270b31d..4448b2d 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopClassLoader.java
@@ -31,10 +31,14 @@ import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.Vector;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
import org.apache.hadoop.util.NativeCodeLoader;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.processors.hadoop.v2.HadoopDaemon;
import org.apache.ignite.internal.processors.hadoop.v2.HadoopShutdownHookManager;
+import org.apache.ignite.internal.util.ClassCache;
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;
@@ -59,7 +63,7 @@ import org.objectweb.asm.commons.RemappingClassAdapter;
* Also supports class parsing for finding dependencies which contain transitive dependencies
* unavailable for parent.
*/
-public class HadoopClassLoader extends URLClassLoader {
+public class HadoopClassLoader extends URLClassLoader implements ClassCache {
/**
* We are very parallel capable.
*/
@@ -88,6 +92,9 @@ public class HadoopClassLoader extends URLClassLoader {
/** */
private static final Map<String, byte[]> bytesCache = new ConcurrentHashMap8<>();
+ /** Class cache. */
+ private final ConcurrentMap<String, Class> cacheMap = new ConcurrentHashMap<>();
+
/** Diagnostic name of this class loader. */
@SuppressWarnings({"FieldCanBeLocal", "UnusedDeclaration"})
private final String name;
@@ -282,6 +289,20 @@ public class HadoopClassLoader extends URLClassLoader {
}
}
+ /** {@inheritDoc} */
+ @Override public Class<?> getFromCache(String clsName) throws ClassNotFoundException {
+ Class<?> cls = cacheMap.get(clsName);
+
+ if (cls == null) {
+ Class old = cacheMap.putIfAbsent(clsName, cls = Class.forName(clsName, true, this));
+
+ if (old != null)
+ cls = old;
+ }
+
+ return cls;
+ }
+
/**
* @param name Class name.
* @param resolve Resolve class.
[05/32] ignite git commit: Added pacajge info for
java.org.apache.ignite.hadoop.util package.
Posted by sb...@apache.org.
Added pacajge info for java.org.apache.ignite.hadoop.util package.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/21bdf314
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/21bdf314
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/21bdf314
Branch: refs/heads/ignite-3212
Commit: 21bdf3148f05481d86e77e13b282ac44c6c3a059
Parents: 421cf03
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue May 31 13:54:32 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue May 31 14:03:30 2016 +0300
----------------------------------------------------------------------
.../apache/ignite/hadoop/util/package-info.java | 22 ++++++++++++++++++++
1 file changed, 22 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/21bdf314/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/package-info.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/package-info.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/package-info.java
new file mode 100644
index 0000000..d84c0ba
--- /dev/null
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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 description. -->
+ * Ignite Hadoop Accelerator utility classes.
+ */
+package org.apache.ignite.hadoop.util;
\ No newline at end of file
[06/32] ignite git commit: Merge remote-tracking branch
'upstream/gridgain-7.6.1' into gridgain-7.6.1
Posted by sb...@apache.org.
Merge remote-tracking branch 'upstream/gridgain-7.6.1' into gridgain-7.6.1
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3ca9febe
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3ca9febe
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3ca9febe
Branch: refs/heads/ignite-3212
Commit: 3ca9febeb2bf53d17b6dea739938cff40c5fa67d
Parents: 21bdf31 167e477
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue May 31 14:03:48 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue May 31 14:03:48 2016 +0300
----------------------------------------------------------------------
.../IgniteTxExceptionAbstractSelfTest.java | 43 ++++++++++++--------
1 file changed, 27 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
[30/32] ignite git commit: Merge branch 'gridgain-7.6.1'
Posted by sb...@apache.org.
Merge branch 'gridgain-7.6.1'
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/38ac8fb4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/38ac8fb4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/38ac8fb4
Branch: refs/heads/ignite-3212
Commit: 38ac8fb4230436e3983aade5faba3a84bd2e27e2
Parents: 919e28a 4799b26
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Jun 6 13:04:39 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Jun 6 13:04:39 2016 +0300
----------------------------------------------------------------------
.../ignite/internal/processors/igfs/IgfsAbstractSelfTest.java | 3 ++-
.../java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[27/32] ignite git commit: Merge remote-tracking branch
'remotes/community/gridgain-7.6.1'
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/community/gridgain-7.6.1'
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/919e28a7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/919e28a7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/919e28a7
Branch: refs/heads/ignite-3212
Commit: 919e28a77a2962e8a6f2fca13435ecda841af7c4
Parents: 11f7909 dc34b6f
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Jun 6 10:36:14 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Jun 6 10:36:14 2016 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/igfs/IgfsPath.java | 26 +++-
.../org/apache/ignite/igfs/IgfsPathSummary.java | 32 ++++-
.../ignite/internal/binary/BinaryUtils.java | 16 +++
.../internal/cluster/ClusterGroupAdapter.java | 6 +
.../ignite/internal/cluster/ClusterGroupEx.java | 14 +-
.../processors/cache/CacheObjectContext.java | 3 +
.../processors/igfs/IgfsBlockLocationImpl.java | 87 ++++++++++--
.../internal/processors/igfs/IgfsContext.java | 14 +-
.../internal/processors/igfs/IgfsFileImpl.java | 34 ++++-
.../internal/processors/igfs/IgfsImpl.java | 81 +++++++++--
.../processors/igfs/IgfsInputStreamImpl.java | 2 +-
.../processors/igfs/IgfsMetaManager.java | 95 ++++++++++++-
.../processors/igfs/IgfsNodePredicate.java | 80 +++++++++++
.../internal/processors/igfs/IgfsProcessor.java | 39 ++++--
.../internal/processors/igfs/IgfsUtils.java | 55 ++++++++
.../igfs/client/IgfsClientAbstractCallable.java | 125 +++++++++++++++++
.../igfs/client/IgfsClientAffinityCallable.java | 95 +++++++++++++
.../igfs/client/IgfsClientDeleteCallable.java | 77 ++++++++++
.../igfs/client/IgfsClientExistsCallable.java | 58 ++++++++
.../igfs/client/IgfsClientInfoCallable.java | 59 ++++++++
.../client/IgfsClientListFilesCallable.java | 61 ++++++++
.../client/IgfsClientListPathsCallable.java | 60 ++++++++
.../igfs/client/IgfsClientMkdirsCallable.java | 82 +++++++++++
.../igfs/client/IgfsClientRenameCallable.java | 80 +++++++++++
.../igfs/client/IgfsClientSetTimesCallable.java | 87 ++++++++++++
.../igfs/client/IgfsClientSizeCallable.java | 59 ++++++++
.../igfs/client/IgfsClientSummaryCallable.java | 59 ++++++++
.../igfs/client/IgfsClientUpdateCallable.java | 81 +++++++++++
.../meta/IgfsClientMetaIdsForPathCallable.java | 65 +++++++++
.../meta/IgfsClientMetaInfoForPathCallable.java | 63 +++++++++
.../ignite/internal/util/IgniteUtils.java | 40 ++++++
.../GridCacheBinaryObjectsAbstractSelfTest.java | 78 ++++++++++-
.../processors/igfs/IgfsAbstractSelfTest.java | 35 ++++-
.../igfs/IgfsClientCacheSelfTest.java | 139 -------------------
.../igfs/IgfsDualAsyncClientSelfTest.java | 28 ++++
.../igfs/IgfsDualSyncClientSelfTest.java | 28 ++++
.../processors/igfs/IgfsOneClientNodeTest.java | 7 +-
.../igfs/IgfsPrimaryClientSelfTest.java | 30 ++++
...PrimaryRelaxedConsistencyClientSelfTest.java | 28 ++++
.../multijvm/IgniteClusterProcessProxy.java | 5 +
.../ignite/testsuites/IgniteIgfsTestSuite.java | 11 +-
.../shuffle/collections/HadoopMultimapBase.java | 90 ++++++++++--
.../ignite/igfs/Hadoop1DualAbstractTest.java | 2 +-
.../org/apache/ignite/spark/IgniteRDD.scala | 81 ++++++++++-
.../org/apache/ignite/spark/JavaIgniteRDD.scala | 13 +-
.../spark/JavaStandaloneIgniteRDDSelfTest.java | 9 +-
.../ignite/spark/EntityTestAllTypeFields.scala | 7 +-
.../org/apache/ignite/spark/IgniteRDDSpec.scala | 77 +++++++++-
48 files changed, 2161 insertions(+), 242 deletions(-)
----------------------------------------------------------------------
[28/32] ignite git commit: IGNITE-3247: IGFS: Minor fixes after merge.
Posted by sb...@apache.org.
IGNITE-3247: IGFS: Minor fixes after merge.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3d3bf080
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3d3bf080
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3d3bf080
Branch: refs/heads/ignite-3212
Commit: 3d3bf080bbb5d5a35a9a6cb641a7b1b11867b538
Parents: 6f99b14
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Jun 6 10:36:26 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Jun 6 10:36:26 2016 +0300
----------------------------------------------------------------------
.../ignite/internal/processors/igfs/IgfsAbstractSelfTest.java | 3 ++-
.../java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/3d3bf080/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 48d6d98..001868f 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
@@ -288,7 +288,8 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
for (int i = 0; i < nodes.length; i++) {
String nodeName = i == 0 ? "ignite" : "ignite" + i;
- nodes[i] = startGridWithIgfs(nodeName, "igfs", mode, igfsSecondaryFileSystem, PRIMARY_REST_CFG, ipFinder);
+ nodes[i] = startGridWithIgfs(nodeName, "igfs", mode, igfsSecondaryFileSystem, PRIMARY_REST_CFG,
+ primaryIpFinder);
}
igfs = (IgfsImpl) nodes[0].fileSystem("igfs");
http://git-wip-us.apache.org/repos/asf/ignite/blob/3d3bf080/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 3e80614..dc1379f 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
@@ -45,7 +45,7 @@ import org.apache.ignite.internal.processors.igfs.IgfsOneClientNodeTest;
import org.apache.ignite.internal.processors.igfs.IgfsPrimaryOffheapTieredSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsPrimaryOffheapValuesSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsPrimaryOptimziedMarshallerSelfTest;
-import org.apache.ignite.internal.processors.igfs.IgfsPrimaryRelaxedClientSelfTest;
+import org.apache.ignite.internal.processors.igfs.IgfsPrimaryRelaxedConsistencyClientSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsPrimaryRelaxedConsistencyMultiNodeSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsPrimaryRelaxedConsistencySelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsPrimarySelfTest;
@@ -107,7 +107,7 @@ public class IgniteIgfsTestSuite extends TestSuite {
suite.addTest(new TestSuite(IgfsMetricsSelfTest.class));
suite.addTest(new TestSuite(IgfsPrimaryClientSelfTest.class));
- suite.addTest(new TestSuite(IgfsPrimaryRelaxedClientSelfTest.class));
+ suite.addTest(new TestSuite(IgfsPrimaryRelaxedConsistencyClientSelfTest.class));
suite.addTest(new TestSuite(IgfsDualSyncClientSelfTest.class));
suite.addTest(new TestSuite(IgfsDualAsyncClientSelfTest.class));
[11/32] ignite git commit: 1.7.0-SNAPSHOT
Posted by sb...@apache.org.
1.7.0-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e0cf0fcc
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e0cf0fcc
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e0cf0fcc
Branch: refs/heads/ignite-3212
Commit: e0cf0fcc954a39dad5b0f1969488a7b372ef8f94
Parents: 1da1436
Author: Ignite Teamcity <ig...@apache.org>
Authored: Thu Jun 2 19:16:31 2016 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Thu Jun 2 19:16:31 2016 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
examples/schema-import/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/apache-license-gen/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/benchmarks/pom.xml | 2 +-
modules/camel/pom.xml | 2 +-
modules/cassandra/pom.xml | 35 +++++++++-----------
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
.../core/src/main/resources/ignite.properties | 2 +-
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 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jms11/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/kafka/pom.xml | 5 ++-
modules/log4j/pom.xml | 2 +-
modules/log4j2/pom.xml | 2 +-
modules/mesos/pom.xml | 9 +++--
modules/mqtt/pom.xml | 2 +-
modules/osgi-karaf/pom.xml | 2 +-
modules/osgi-paxlogging/pom.xml | 2 +-
modules/osgi/pom.xml | 2 +-
modules/platforms/cpp/configure.ac | 2 +-
modules/platforms/cpp/examples/configure.ac | 2 +-
.../Properties/AssemblyInfo.cs | 6 ++--
.../Properties/AssemblyInfo.cs | 6 ++--
.../Properties/AssemblyInfo.cs | 6 ++--
.../Properties/AssemblyInfo.cs | 6 ++--
.../Properties/AssemblyInfo.cs | 6 ++--
.../Properties/AssemblyInfo.cs | 6 ++--
.../Apache.Ignite/Properties/AssemblyInfo.cs | 6 ++--
.../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 +-
modules/schema-import-db/pom.xml | 5 ++-
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 +-
modules/twitter/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console-2.10/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web-agent/pom.xml | 4 +--
modules/web-console/pom.xml | 4 +--
modules/web/ignite-appserver-test/pom.xml | 5 ++-
modules/web/ignite-websphere-test/pom.xml | 5 ++-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
modules/yarn/pom.xml | 2 +-
modules/zookeeper/pom.xml | 5 ++-
pom.xml | 2 +-
72 files changed, 115 insertions(+), 124 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index d8a38d8..979a46f 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/examples/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/examples/schema-import/pom.xml b/examples/schema-import/pom.xml
index 62bb773..b6e36ef 100644
--- a/examples/schema-import/pom.xml
+++ b/examples/schema-import/pom.xml
@@ -35,7 +35,7 @@
</properties>
<artifactId>ignite-schema-import-demo</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index e34c6a5..eaebaf2 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/apache-license-gen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/apache-license-gen/pom.xml b/modules/apache-license-gen/pom.xml
index 99490cf..53b1a8f 100644
--- a/modules/apache-license-gen/pom.xml
+++ b/modules/apache-license-gen/pom.xml
@@ -31,7 +31,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-apache-license-gen</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<build>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 481e897..2aee655 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/modules/benchmarks/pom.xml b/modules/benchmarks/pom.xml
index 7dbc66f..a7d823d 100644
--- a/modules/benchmarks/pom.xml
+++ b/modules/benchmarks/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-benchmarks</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/camel/pom.xml
----------------------------------------------------------------------
diff --git a/modules/camel/pom.xml b/modules/camel/pom.xml
index df9a3d5..f40ff62 100644
--- a/modules/camel/pom.xml
+++ b/modules/camel/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-camel</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/cassandra/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cassandra/pom.xml b/modules/cassandra/pom.xml
index d2a7f25..7f9f876 100644
--- a/modules/cassandra/pom.xml
+++ b/modules/cassandra/pom.xml
@@ -20,8 +20,7 @@
<!--
POM file.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -32,7 +31,7 @@
</parent>
<artifactId>ignite-cassandra</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
@@ -272,59 +271,57 @@
</goals>
<configuration>
<target>
- <taskdef resource="net/sf/antcontrib/antlib.xml"/>
+ <taskdef resource="net/sf/antcontrib/antlib.xml" />
<if>
- <available file="${project.build.directory}/test-classes" type="dir"/>
+ <available file="${project.build.directory}/test-classes" type="dir" />
<then>
<copy todir="${project.build.directory}/tests-package/lib">
<fileset dir="${project.build.directory}">
- <include name="*.jar"/>
+ <include name="*.jar" />
</fileset>
</copy>
<jar destfile="${project.build.directory}/tests-package/lib/${project.artifactId}-${project.version}-tests.jar">
<fileset dir="${project.build.directory}/test-classes">
- <include name="**/*.class"/>
+ <include name="**/*.class" />
</fileset>
</jar>
<copy todir="${project.build.directory}/tests-package/settings">
<fileset dir="${project.build.directory}/test-classes">
- <include name="**/*.properties"/>
- <include name="**/*.xml"/>
+ <include name="**/*.properties" />
+ <include name="**/*.xml" />
</fileset>
</copy>
<copy todir="${project.build.directory}/tests-package">
<fileset dir="${project.build.testSourceDirectory}/../scripts">
- <include name="**/*"/>
+ <include name="**/*" />
</fileset>
</copy>
<fixcrlf srcdir="${project.build.directory}/tests-package" eol="lf" eof="remove">
- <include name="*.sh"/>
+ <include name="*.sh" />
</fixcrlf>
- <copy todir="${project.build.directory}/tests-package" >
+ <copy todir="${project.build.directory}/tests-package">
<fileset dir="${project.build.testSourceDirectory}/..">
- <include name="bootstrap/**"/>
+ <include name="bootstrap/**" />
</fileset>
</copy>
<fixcrlf srcdir="${project.build.directory}/tests-package/bootstrap" eol="lf" eof="remove">
- <include name="**"/>
+ <include name="**" />
</fixcrlf>
- <zip destfile="${project.build.directory}/ignite-cassandra-tests-${project.version}.zip"
- compress="true" whenempty="create" level="9" encoding="UTF-8"
- useLanguageEncodingFlag="true" createUnicodeExtraFields="not-encodeable">
+ <zip destfile="${project.build.directory}/ignite-cassandra-tests-${project.version}.zip" compress="true" whenempty="create" level="9" encoding="UTF-8" useLanguageEncodingFlag="true" createUnicodeExtraFields="not-encodeable">
<zipfileset dir="${project.build.directory}/tests-package" prefix="ignite-cassandra-tests">
- <exclude name="**/*.sh"/>
+ <exclude name="**/*.sh" />
</zipfileset>
<zipfileset dir="${project.build.directory}/tests-package" prefix="ignite-cassandra-tests" filemode="555">
- <include name="**/*.sh"/>
+ <include name="**/*.sh" />
</zipfileset>
</zip>
</then>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index 73a2161..5b328e0 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 11b9a14..8232d00 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index e88a797..aff0d3a 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 3c16366..34368c8 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<repositories>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/core/src/main/resources/ignite.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/ignite.properties b/modules/core/src/main/resources/ignite.properties
index fb57498..4d5780a 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
# limitations under the License.
#
-ignite.version=1.6.0-SNAPSHOT
+ignite.version=1.7.0-SNAPSHOT
ignite.build=0
ignite.revision=DEV
ignite.rel.date=01011970
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index 4f79bee..9bebf74 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-p2p</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/extdata/uri/modules/uri-dependency/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/modules/uri-dependency/pom.xml b/modules/extdata/uri/modules/uri-dependency/pom.xml
index 7df32f2..1d9da24 100644
--- a/modules/extdata/uri/modules/uri-dependency/pom.xml
+++ b/modules/extdata/uri/modules/uri-dependency/pom.xml
@@ -27,7 +27,7 @@
<artifactId>ignite-extdata-uri-dep</artifactId>
<packaging>jar</packaging>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<modelVersion>4.0.0</modelVersion>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index 3d460ce..1cef7f9 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -32,7 +32,7 @@
</parent>
<artifactId>ignite-extdata-uri</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/flink/pom.xml
----------------------------------------------------------------------
diff --git a/modules/flink/pom.xml b/modules/flink/pom.xml
index 5d9ac24..118c175 100644
--- a/modules/flink/pom.xml
+++ b/modules/flink/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-flink</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/flume/pom.xml
----------------------------------------------------------------------
diff --git a/modules/flume/pom.xml b/modules/flume/pom.xml
index 91a4841..f9d36e9 100644
--- a/modules/flume/pom.xml
+++ b/modules/flume/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-flume</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index b543083..8c7bed4 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-gce</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index d68f68a..eeef657 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-geospatial</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index 27466f4..a3f40e5 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hadoop</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index 50b7082..b0ea68d 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 899d4a7..d667531 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-indexing</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index f518a4c..fbc9441 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jcl</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/jms11/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jms11/pom.xml b/modules/jms11/pom.xml
index 65cc94c..a4222a0 100644
--- a/modules/jms11/pom.xml
+++ b/modules/jms11/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jms11</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index 9418c9c..64ad26d 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jta</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
index 0ac0487..07d031e 100644
--- a/modules/kafka/pom.xml
+++ b/modules/kafka/pom.xml
@@ -20,8 +20,7 @@
<!--
POM file.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -32,7 +31,7 @@
</parent>
<artifactId>ignite-kafka</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index de422d6..f74e59b 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/log4j2/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j2/pom.xml b/modules/log4j2/pom.xml
index 0de9801..ac99196 100644
--- a/modules/log4j2/pom.xml
+++ b/modules/log4j2/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j2</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index f2f1acd..660b046 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -20,8 +20,7 @@
<!--
POM file.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -32,7 +31,7 @@
</parent>
<artifactId>ignite-mesos</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
@@ -94,7 +93,7 @@
<replaceregexp byline="true" encoding="UTF-8">
<regexp pattern="(.*DOWNLOAD_LINK = ")(.*)(".*)" />
- <substitution expression="\1${ignite.latest.url}\3"/>
+ <substitution expression="\1${ignite.latest.url}\3" />
<fileset dir="${basedir}/">
<include name="**/IgniteProvider.java" />
</fileset>
@@ -102,7 +101,7 @@
<replaceregexp byline="true" encoding="UTF-8">
<regexp pattern="(.*DOWNLOAD_URL_PATTERN = ")(.*)(".*)" />
- <substitution expression="\1${ignite.direct.url}\3"/>
+ <substitution expression="\1${ignite.direct.url}\3" />
<fileset dir="${basedir}/">
<include name="**/IgniteProvider.java" />
</fileset>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/mqtt/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mqtt/pom.xml b/modules/mqtt/pom.xml
index 23f204c..ae984eb 100644
--- a/modules/mqtt/pom.xml
+++ b/modules/mqtt/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-mqtt</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/osgi-karaf/pom.xml
----------------------------------------------------------------------
diff --git a/modules/osgi-karaf/pom.xml b/modules/osgi-karaf/pom.xml
index f12ca45..f4e0113 100644
--- a/modules/osgi-karaf/pom.xml
+++ b/modules/osgi-karaf/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-osgi-karaf</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/osgi-paxlogging/pom.xml
----------------------------------------------------------------------
diff --git a/modules/osgi-paxlogging/pom.xml b/modules/osgi-paxlogging/pom.xml
index 32fb9c6..779c9a9 100644
--- a/modules/osgi-paxlogging/pom.xml
+++ b/modules/osgi-paxlogging/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-osgi-paxlogging</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/osgi/pom.xml
----------------------------------------------------------------------
diff --git a/modules/osgi/pom.xml b/modules/osgi/pom.xml
index f238a14..041fbd1 100644
--- a/modules/osgi/pom.xml
+++ b/modules/osgi/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-osgi</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/platforms/cpp/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/configure.ac b/modules/platforms/cpp/configure.ac
index bc5e24f..8d7987a 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.6.0.8653], [dev@ignite.apache.org], [ignite], [ignite.apache.org])
+AC_INIT([Apache Ignite C++], [1.7.0.11707], [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/e0cf0fcc/modules/platforms/cpp/examples/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/examples/configure.ac b/modules/platforms/cpp/examples/configure.ac
index 94519af..85313ab 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.6.0.8653], [dev@ignite.apache.org], [ignite-examples], [ignite.apache.org])
+AC_INIT([Apache Ignite C++ Examples], [1.7.0.11707], [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/e0cf0fcc/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 e60e4a3..b7eb064 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.6.0.8653")]
-[assembly: AssemblyFileVersion("1.6.0.8653")]
-[assembly: AssemblyInformationalVersion("1.6.0")]
+[assembly: AssemblyVersion("1.7.0.11707")]
+[assembly: AssemblyFileVersion("1.7.0.11707")]
+[assembly: AssemblyInformationalVersion("1.7.0")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/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 b270b5e..41b141e 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.6.0.8653")]
-[assembly: AssemblyFileVersion("1.6.0.8653")]
-[assembly: AssemblyInformationalVersion("1.6.0")]
+[assembly: AssemblyVersion("1.7.0.11707")]
+[assembly: AssemblyFileVersion("1.7.0.11707")]
+[assembly: AssemblyInformationalVersion("1.7.0")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/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 d6e2175..d1fcc88 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.6.0.8653")]
-[assembly: AssemblyFileVersion("1.6.0.8653")]
-[assembly: AssemblyInformationalVersion("1.6.0")]
+[assembly: AssemblyVersion("1.7.0.11707")]
+[assembly: AssemblyFileVersion("1.7.0.11707")]
+[assembly: AssemblyInformationalVersion("1.7.0")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/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 d27ffc8..f17315a 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.6.0.8653")]
-[assembly: AssemblyFileVersion("1.6.0.8653")]
-[assembly: AssemblyInformationalVersion("1.6.0")]
+[assembly: AssemblyVersion("1.7.0.11707")]
+[assembly: AssemblyFileVersion("1.7.0.11707")]
+[assembly: AssemblyInformationalVersion("1.7.0")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/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 71ee88d..afc2aef 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
@@ -33,9 +33,9 @@ using System.Runtime.InteropServices;
[assembly: Guid("97db45a8-f922-456a-a819-7b3c6e5e03ba")]
-[assembly: AssemblyVersion("1.6.0.8653")]
-[assembly: AssemblyFileVersion("1.6.0.8653")]
-[assembly: AssemblyInformationalVersion("1.6.0")]
+[assembly: AssemblyVersion("1.7.0.11707")]
+[assembly: AssemblyFileVersion("1.7.0.11707")]
+[assembly: AssemblyInformationalVersion("1.7.0")]
[assembly: CLSCompliant(true)]
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/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 945e107..e182f65 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.6.0.8653")]
-[assembly: AssemblyFileVersion("1.6.0.8653")]
-[assembly: AssemblyInformationalVersion("1.6.0")]
+[assembly: AssemblyVersion("1.7.0.11707")]
+[assembly: AssemblyFileVersion("1.7.0.11707")]
+[assembly: AssemblyInformationalVersion("1.7.0")]
[assembly: CLSCompliant(true)]
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/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 2fce9ea..57c4b95 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.6.0.8653")]
-[assembly: AssemblyFileVersion("1.6.0.8653")]
-[assembly: AssemblyInformationalVersion("1.6.0")]
+[assembly: AssemblyVersion("1.7.0.11707")]
+[assembly: AssemblyFileVersion("1.7.0.11707")]
+[assembly: AssemblyInformationalVersion("1.7.0")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/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 e84c8e1..92bfd0d 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.6.0.8653")]
-[assembly: AssemblyFileVersion("1.6.0.8653")]
-[assembly: AssemblyInformationalVersion("1.6.0")]
+[assembly: AssemblyVersion("1.7.0.11707")]
+[assembly: AssemblyFileVersion("1.7.0.11707")]
+[assembly: AssemblyInformationalVersion("1.7.0")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/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 008fa09..0169fb9 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.6.0.8653")]
-[assembly: AssemblyFileVersion("1.6.0.8653")]
-[assembly: AssemblyInformationalVersion("1.6.0")]
+[assembly: AssemblyVersion("1.7.0.11707")]
+[assembly: AssemblyFileVersion("1.7.0.11707")]
+[assembly: AssemblyInformationalVersion("1.7.0")]
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index a0a5471..c97d670 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-rest-http</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
index e7a241e..06f43b9 100644
--- a/modules/scalar-2.10/pom.xml
+++ b/modules/scalar-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar_2.10</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 91a1152..e42c710 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 43d48ac..e06f051 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schedule</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/schema-import-db/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import-db/pom.xml b/modules/schema-import-db/pom.xml
index 337f39a..d3bcdec 100644
--- a/modules/schema-import-db/pom.xml
+++ b/modules/schema-import-db/pom.xml
@@ -20,8 +20,7 @@
<!--
POM file.
-->
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -32,7 +31,7 @@
</parent>
<artifactId>ignite-schema-import-db</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 7e83a84..b1c8b1c 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schema-import</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 4182f24..85195b0 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-slf4j</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
index 9ba5fdd..c02599b 100644
--- a/modules/spark-2.10/pom.xml
+++ b/modules/spark-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spark_2.10</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index effcf1e..4bde34f 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spark</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index 65ea6d0..397b209 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index bb08220..aec0948 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-ssh</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/storm/pom.xml
----------------------------------------------------------------------
diff --git a/modules/storm/pom.xml b/modules/storm/pom.xml
index 1c180b8..712f910 100644
--- a/modules/storm/pom.xml
+++ b/modules/storm/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-storm</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index a3ed0f3..4f65542 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-tools</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/twitter/pom.xml
----------------------------------------------------------------------
diff --git a/modules/twitter/pom.xml b/modules/twitter/pom.xml
index f041bdb..8f0d917 100644
--- a/modules/twitter/pom.xml
+++ b/modules/twitter/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-twitter</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index 143e7a5..a621017 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-urideploy</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/visor-console-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console-2.10/pom.xml b/modules/visor-console-2.10/pom.xml
index e8ae547..a1d2987 100644
--- a/modules/visor-console-2.10/pom.xml
+++ b/modules/visor-console-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console_2.10</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 0b628c8..3dd9bd8 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 61bd4ac..d095650 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-plugins</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/web-agent/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web-agent/pom.xml b/modules/web-agent/pom.xml
index afca554..cb55319 100644
--- a/modules/web-agent/pom.xml
+++ b/modules/web-agent/pom.xml
@@ -20,7 +20,7 @@
<!--
POM file.
-->
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web-agent</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<properties>
<maven.build.timestamp.format>yyMMddHHmmss</maven.build.timestamp.format>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/web-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web-console/pom.xml b/modules/web-console/pom.xml
index 1639ec1..5c5cac0 100644
--- a/modules/web-console/pom.xml
+++ b/modules/web-console/pom.xml
@@ -20,7 +20,7 @@
<!--
POM file.
-->
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web-console</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<build>
<plugins>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/web/ignite-appserver-test/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/ignite-appserver-test/pom.xml b/modules/web/ignite-appserver-test/pom.xml
index 8dbe1ee..045bbfa 100644
--- a/modules/web/ignite-appserver-test/pom.xml
+++ b/modules/web/ignite-appserver-test/pom.xml
@@ -18,8 +18,7 @@
<!--
POM file.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -31,7 +30,7 @@
<artifactId>ignite-appserver-test</artifactId>
<packaging>jar</packaging>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/web/ignite-websphere-test/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/ignite-websphere-test/pom.xml b/modules/web/ignite-websphere-test/pom.xml
index b2d9045..9127560 100644
--- a/modules/web/ignite-websphere-test/pom.xml
+++ b/modules/web/ignite-websphere-test/pom.xml
@@ -18,8 +18,7 @@
<!--
POM file.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -31,7 +30,7 @@
<artifactId>ignite-websphere-test</artifactId>
<packaging>war</packaging>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index 360bdfc..710c803 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 52418d9..a0f7de5 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yardstick</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/yarn/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yarn/pom.xml b/modules/yarn/pom.xml
index efd365f..884176a 100644
--- a/modules/yarn/pom.xml
+++ b/modules/yarn/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yarn</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/modules/zookeeper/pom.xml
----------------------------------------------------------------------
diff --git a/modules/zookeeper/pom.xml b/modules/zookeeper/pom.xml
index b749c30..41c381b 100644
--- a/modules/zookeeper/pom.xml
+++ b/modules/zookeeper/pom.xml
@@ -20,8 +20,7 @@
<!--
POM file.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -32,7 +31,7 @@
</parent>
<artifactId>ignite-zookeeper</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/e0cf0fcc/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 269462f..2c7bad1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>apache-ignite</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.7.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
[17/32] ignite git commit: IGNITE-3232 - Fixed the number of
iterations to find an affinity key.
Posted by sb...@apache.org.
IGNITE-3232 - Fixed the number of iterations to find an affinity key.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7fc1a7f8
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7fc1a7f8
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7fc1a7f8
Branch: refs/heads/ignite-3212
Commit: 7fc1a7f8ecba07869f8706091f076079dd83cb8e
Parents: 9df1b90
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Jun 2 22:52:39 2016 +0300
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Fri Jun 3 20:12:24 2016 +0300
----------------------------------------------------------------------
.../spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/7fc1a7f8/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
index 036dfe6..9ef9846 100644
--- a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
@@ -334,7 +334,8 @@ class IgniteRDD[K, V] (
private def affinityKeyFunc(value: V, node: ClusterNode): IgniteUuid = {
val aff = ic.ignite().affinity[IgniteUuid](cacheName)
- Stream.from(1, 1000).map(_ \u21d2 IgniteUuid.randomUuid()).find(node == null || aff.mapKeyToNode(_).eq(node))
+ Stream.from(1, Math.max(1000, aff.partitions() * 2))
+ .map(_ \u21d2 IgniteUuid.randomUuid()).find(node == null || aff.mapKeyToNode(_).eq(node))
.getOrElse(IgniteUuid.randomUuid())
}
}
[10/32] ignite git commit: Merge remote-tracking branch
'remotes/upstream/gridgain-7.6.1'
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/upstream/gridgain-7.6.1'
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f633eea5
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f633eea5
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f633eea5
Branch: refs/heads/ignite-3212
Commit: f633eea5acfb669933f1e13f1f3e709ae5111720
Parents: 4cc1098 1da1436
Author: Anton Vinogradov <av...@apache.org>
Authored: Thu Jun 2 17:03:12 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Thu Jun 2 17:03:12 2016 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheAdapter.java | 43 +-
.../processors/cache/GridCacheContext.java | 7 +-
.../processors/cache/GridCacheEntryEx.java | 3 +-
.../cache/GridCacheEvictionManager.java | 2 +-
.../processors/cache/GridCacheMapEntry.java | 4 +-
.../processors/cache/GridCacheSwapManager.java | 67 ++-
.../distributed/dht/GridDhtCacheAdapter.java | 11 +-
.../cache/query/GridCacheQueryManager.java | 9 +-
.../processors/cache/GridCacheTestEntryEx.java | 2 +-
.../cache/IgniteCachePeekModesAbstractTest.java | 8 +-
...CacheKeepBinaryIterationNearEnabledTest.java | 44 ++
...acheKeepBinaryIterationStoreEnabledTest.java | 90 ++++
...CacheKeepBinaryIterationSwapEnabledTest.java | 56 +++
.../CacheKeepBinaryIterationTest.java | 471 +++++++++++++++++++
.../IgniteCacheQuerySelfTestSuite3.java | 8 +
15 files changed, 762 insertions(+), 63 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f633eea5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
[16/32] ignite git commit: IGNITE-3232 - Inline transformers for
IgniteRDD.savePairs and IgniteRDD.saveValues
Posted by sb...@apache.org.
IGNITE-3232 - Inline transformers for IgniteRDD.savePairs and IgniteRDD.saveValues
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9df1b905
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9df1b905
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9df1b905
Branch: refs/heads/ignite-3212
Commit: 9df1b905cd86384c1d191785d70a8e5c8e741e48
Parents: 91862c7
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Thu Jun 2 16:03:12 2016 +0300
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Fri Jun 3 20:12:11 2016 +0300
----------------------------------------------------------------------
.../org/apache/ignite/spark/IgniteRDD.scala | 75 +++++++++++++++++++
.../org/apache/ignite/spark/JavaIgniteRDD.scala | 9 +++
.../org/apache/ignite/spark/IgniteRDDSpec.scala | 77 +++++++++++++++++++-
3 files changed, 160 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/9df1b905/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
index 0d8e730..036dfe6 100644
--- a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
@@ -180,6 +180,39 @@ class IgniteRDD[K, V] (
}
/**
+ * Saves values from given RDD into Ignite. A unique key will be generated for each value of the given RDD.
+ *
+ * @param rdd RDD instance to save values from.
+ * @param f Transformation function.
+ */
+ def saveValues[T](rdd: RDD[T], f: (T, IgniteContext[K, V]) \u21d2 V) = {
+ rdd.foreachPartition(it \u21d2 {
+ val ig = ic.ignite()
+
+ ensureCache()
+
+ val locNode = ig.cluster().localNode()
+
+ val node: Option[ClusterNode] = ig.cluster().forHost(locNode).nodes().find(!_.eq(locNode))
+
+ val streamer = ig.dataStreamer[Object, V](cacheName)
+
+ try {
+ it.foreach(t \u21d2 {
+ val value = f(t, ic)
+
+ val key = affinityKeyFunc(value, node.orNull)
+
+ streamer.addData(key, value)
+ })
+ }
+ finally {
+ streamer.close()
+ }
+ })
+ }
+
+ /**
* Saves values from the given key-value RDD into Ignite.
*
* @param rdd RDD instance to save values from.
@@ -209,6 +242,48 @@ class IgniteRDD[K, V] (
}
/**
+ * Saves values from the given RDD into Ignite.
+ *
+ * @param rdd RDD instance to save values from.
+ * @param f Transformation function.
+ * @param overwrite Boolean flag indicating whether the call on this method should overwrite existing
+ * values in Ignite cache.
+ */
+ def savePairs[T](rdd: RDD[T], f: (T, IgniteContext[K, V]) \u21d2 (K, V), overwrite: Boolean) = {
+ rdd.foreachPartition(it \u21d2 {
+ val ig = ic.ignite()
+
+ // Make sure to deploy the cache
+ ensureCache()
+
+ val streamer = ig.dataStreamer[K, V](cacheName)
+
+ try {
+ streamer.allowOverwrite(overwrite)
+
+ it.foreach(t \u21d2 {
+ val tup = f(t, ic)
+
+ streamer.addData(tup._1, tup._2)
+ })
+ }
+ finally {
+ streamer.close()
+ }
+ })
+ }
+
+ /**
+ * Saves values from the given RDD into Ignite.
+ *
+ * @param rdd RDD instance to save values from.
+ * @param f Transformation function.
+ */
+ def savePairs[T](rdd: RDD[T], f: (T, IgniteContext[K, V]) \u21d2 (K, V)): Unit = {
+ savePairs(rdd, f, overwrite = false)
+ }
+
+ /**
* Removes all values from the underlying Ignite cache.
*/
def clear(): Unit = {
http://git-wip-us.apache.org/repos/asf/ignite/blob/9df1b905/modules/spark/src/main/scala/org/apache/ignite/spark/JavaIgniteRDD.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/JavaIgniteRDD.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/JavaIgniteRDD.scala
index 2e8702e..cac0e15 100644
--- a/modules/spark/src/main/scala/org/apache/ignite/spark/JavaIgniteRDD.scala
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/JavaIgniteRDD.scala
@@ -80,12 +80,21 @@ class JavaIgniteRDD[K, V](override val rdd: IgniteRDD[K, V])
def saveValues(jrdd: JavaRDD[V]) = rdd.saveValues(JavaRDD.toRDD(jrdd))
+ def saveValues[T](jrdd: JavaRDD[T], f: (T, IgniteContext[K, V]) \u21d2 V) = rdd.saveValues(JavaRDD.toRDD(jrdd), f)
+
def savePairs(jrdd: JavaPairRDD[K, V]) = {
val rrdd: RDD[(K, V)] = JavaPairRDD.toRDD(jrdd)
rdd.savePairs(rrdd)
}
+ def savePairs[T](jrdd: JavaRDD[T], f: (T, IgniteContext[K, V]) \u21d2 (K, V), overwrite: Boolean = false) = {
+ rdd.savePairs(JavaRDD.toRDD(jrdd), f, overwrite)
+ }
+
+ def savePairs[T](jrdd: JavaRDD[T], f: (T, IgniteContext[K, V]) \u21d2 (K, V)): Unit =
+ savePairs(jrdd, f, overwrite = false)
+
def clear(): Unit = rdd.clear()
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/9df1b905/modules/spark/src/test/scala/org/apache/ignite/spark/IgniteRDDSpec.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/test/scala/org/apache/ignite/spark/IgniteRDDSpec.scala b/modules/spark/src/test/scala/org/apache/ignite/spark/IgniteRDDSpec.scala
index 8e36275..15a51ae 100644
--- a/modules/spark/src/test/scala/org/apache/ignite/spark/IgniteRDDSpec.scala
+++ b/modules/spark/src/test/scala/org/apache/ignite/spark/IgniteRDDSpec.scala
@@ -26,6 +26,7 @@ import org.apache.spark.SparkContext
import org.junit.runner.RunWith
import org.scalatest._
import org.scalatest.junit.JUnitRunner
+import scala.collection.JavaConversions._
import IgniteRDDSpec._
@@ -34,7 +35,7 @@ import scala.annotation.meta.field
@RunWith(classOf[JUnitRunner])
class IgniteRDDSpec extends FunSpec with Matchers with BeforeAndAfterAll with BeforeAndAfterEach {
describe("IgniteRDD") {
- it("should successfully store data to ignite") {
+ it("should successfully store data to ignite using savePairs") {
val sc = new SparkContext("local[*]", "test")
try {
@@ -59,6 +60,80 @@ class IgniteRDDSpec extends FunSpec with Matchers with BeforeAndAfterAll with Be
}
}
+ it("should successfully store data to ignite using savePairs with inline transformation") {
+ val sc = new SparkContext("local[*]", "test")
+
+ try {
+ val ic = new IgniteContext[String, String](sc,
+ () \u21d2 configuration("client", client = true))
+
+ // Save pairs ("0", "val0"), ("1", "val1"), ... to Ignite cache.
+ ic.fromCache(PARTITIONED_CACHE_NAME).savePairs(
+ sc.parallelize(0 to 10000, 2), (i: Int, ic) \u21d2 (String.valueOf(i), "val" + i))
+
+ // Check cache contents.
+ val ignite = Ignition.ignite("grid-0")
+
+ for (i \u2190 0 to 10000) {
+ val res = ignite.cache[String, String](PARTITIONED_CACHE_NAME).get(String.valueOf(i))
+
+ assert(res != null, "Value was not put to cache for key: " + i)
+ assert("val" + i == res, "Invalid value stored for key: " + i)
+ }
+ }
+ finally {
+ sc.stop()
+ }
+ }
+
+ it("should successfully store data to ignite using saveValues") {
+ val sc = new SparkContext("local[*]", "test")
+
+ try {
+ val ic = new IgniteContext[String, String](sc,
+ () \u21d2 configuration("client", client = true))
+
+ // Save pairs ("0", "val0"), ("1", "val1"), ... to Ignite cache.
+ ic.fromCache(PARTITIONED_CACHE_NAME).saveValues(
+ sc.parallelize(0 to 10000, 2).map(i \u21d2 "val" + i))
+
+ // Check cache contents.
+ val ignite = Ignition.ignite("grid-0")
+
+ val values = ignite.cache[String, String](PARTITIONED_CACHE_NAME).toList.map(e \u21d2 e.getValue)
+
+ for (i \u2190 0 to 10000)
+ assert(values.contains("val" + i), "Value not found for index: " + i)
+ }
+ finally {
+ sc.stop()
+ }
+ }
+
+ it("should successfully store data to ignite using saveValues with inline transformation") {
+ val sc = new SparkContext("local[*]", "test")
+
+ try {
+ val ic = new IgniteContext[String, String](sc,
+ () \u21d2 configuration("client", client = true))
+
+ // Save pairs ("0", "val0"), ("1", "val1"), ... to Ignite cache.
+ ic.fromCache(PARTITIONED_CACHE_NAME).saveValues(
+ sc.parallelize(0 to 10000, 2), (i: Int, ic) \u21d2 "val" + i)
+
+ // Check cache contents.
+ val ignite = Ignition.ignite("grid-0")
+
+ val values = ignite.cache[String, String](PARTITIONED_CACHE_NAME).toList.map(e \u21d2 e.getValue)
+
+ for (i \u2190 0 to 10000)
+ assert(values.contains("val" + i), "Value not found for index: " + i)
+ }
+ finally {
+ sc.stop()
+ }
+ }
+
it("should successfully read data from ignite") {
val sc = new SparkContext("local[*]", "test")
[12/32] ignite git commit: Merge remote-tracking branch
'remotes/origin/gridgain-7.6.1'
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/gridgain-7.6.1'
# Conflicts:
# benchmarks/yardstick/src/main/dotnet/gridgain-benchmarks/Properties/AssemblyInfo.cs
# modules/platforms/cpp/configure.ac
# modules/platforms/cpp/examples/configure.ac
# modules/platforms/dotnet/examples/GridGainExamples/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/examples/GridGainExamplesDll/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/gridgain-examples-test/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/gridgain-exe/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/gridgain-test-compatibility/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/gridgain-test-dll/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/gridgain-test-runner/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/gridgain-test/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/gridgain/Properties/AssemblyInfo.cs
# modules/yardstick/dotnet/Properties/AssemblyInfo.cs
Merge remote-tracking branch 'remotes/upstream/gridgain-7.6.1'
# Conflicts:
# modules/platforms/cpp/configure.ac
# modules/platforms/cpp/examples/configure.ac
# 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/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/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
# modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/265d1248
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/265d1248
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/265d1248
Branch: refs/heads/ignite-3212
Commit: 265d1248df8bf04024a6cc68f3d344313d83e9f6
Parents: f633eea e0cf0fc
Author: Anton Vinogradov <av...@apache.org>
Authored: Thu Jun 2 19:25:09 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Thu Jun 2 19:25:09 2016 +0300
----------------------------------------------------------------------
modules/platforms/cpp/configure.ac | 2 +-
modules/platforms/cpp/examples/configure.ac | 2 +-
.../dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs | 6 +++---
.../Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs | 6 +++---
.../Properties/AssemblyInfo.cs | 6 +++---
.../dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs | 6 +++---
.../dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs | 6 +++---
.../dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs | 6 +++---
.../platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs | 6 +++---
.../examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs | 6 +++---
.../Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs | 6 +++---
modules/web-agent/pom.xml | 2 +-
modules/web-console/pom.xml | 2 +-
13 files changed, 31 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/265d1248/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
index f08deb4,b7eb064..1366829
--- a/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--\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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/265d1248/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs
index eaffcb5,41b141e..fa30ff6
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/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/265d1248/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
index 0d4c88a,d1fcc88..d04fd69
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.TestDll/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--\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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/265d1248/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs
index 535763b,f17315a..f1953e3
--- 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 +1,4 @@@
--\ufeff\ufeff\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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/265d1248/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
index fc9dfcc,afc2aef..955f205
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--\ufeff\ufeff\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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/265d1248/modules/platforms/dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs
index b975dcf,e182f65..8a4b342
--- a/modules/platforms/dotnet/Apache.Ignite.Linq/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Linq/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/265d1248/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
index 4073613,57c4b95..48310a7
--- a/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--\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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/265d1248/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
index 8a545bc,92bfd0d..2423f2d
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--\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.
http://git-wip-us.apache.org/repos/asf/ignite/blob/265d1248/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
index 3ebf511,0169fb9..4cb86b5
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
@@@ -1,4 -1,4 +1,4 @@@
--\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.
[19/32] ignite git commit: IGNITE-3228: Hadoop: workaround/fix for
inefficient memory usage.
Posted by sb...@apache.org.
IGNITE-3228: Hadoop: workaround/fix for inefficient memory usage.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8ea0598c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8ea0598c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8ea0598c
Branch: refs/heads/ignite-3212
Commit: 8ea0598c6b5ce9e81ccd114df7246ba17e26817e
Parents: 91862c7
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Jun 2 09:11:09 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Sun Jun 5 21:14:44 2016 +0300
----------------------------------------------------------------------
.../shuffle/collections/HadoopMultimapBase.java | 90 +++++++++++++++++---
1 file changed, 76 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/8ea0598c/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopMultimapBase.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopMultimapBase.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopMultimapBase.java
index e6995ca..7dcff3d 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopMultimapBase.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopMultimapBase.java
@@ -30,7 +30,6 @@ import org.apache.ignite.internal.processors.hadoop.HadoopTaskContext;
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.processors.hadoop.shuffle.streams.HadoopOffheapBuffer;
-import org.apache.ignite.internal.util.GridLongList;
import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory;
import org.jetbrains.annotations.Nullable;
@@ -48,7 +47,7 @@ public abstract class HadoopMultimapBase implements HadoopMultimap {
protected final int pageSize;
/** */
- private final Collection<GridLongList> allPages = new ConcurrentLinkedQueue<>();
+ private final Collection<Page> allPages = new ConcurrentLinkedQueue<>();
/**
* @param jobInfo Job info.
@@ -64,11 +63,12 @@ public abstract class HadoopMultimapBase implements HadoopMultimap {
}
/**
- * @param ptrs Page pointers.
+ * @param page Page.
*/
- private void deallocate(GridLongList ptrs) {
- while (!ptrs.isEmpty())
- mem.release(ptrs.remove(), ptrs.remove());
+ private void deallocate(Page page) {
+ assert page != null;
+
+ mem.release(page.ptr, page.size);
}
/**
@@ -105,8 +105,8 @@ public abstract class HadoopMultimapBase implements HadoopMultimap {
/** {@inheritDoc} */
@Override public void close() {
- for (GridLongList list : allPages)
- deallocate(list);
+ for (Page page : allPages)
+ deallocate(page);
}
/**
@@ -190,8 +190,8 @@ public abstract class HadoopMultimapBase implements HadoopMultimap {
/** */
private long writeStart;
- /** Size and pointer pairs list. */
- private final GridLongList pages = new GridLongList(16);
+ /** Current page. */
+ private Page curPage;
/**
* @param ctx Task context.
@@ -222,11 +222,10 @@ public abstract class HadoopMultimapBase implements HadoopMultimap {
private long allocateNextPage(long requestedSize) {
int writtenSize = writtenSize();
- long newPageSize = Math.max(writtenSize + requestedSize, pageSize);
+ long newPageSize = nextPageSize(writtenSize + requestedSize);
long newPagePtr = mem.allocate(newPageSize);
- pages.add(newPageSize);
- pages.add(newPagePtr);
+ System.out.println("ALLOCATED: " + newPageSize);
HadoopOffheapBuffer b = out.buffer();
@@ -240,10 +239,50 @@ public abstract class HadoopMultimapBase implements HadoopMultimap {
writeStart = newPagePtr;
+ // At this point old page is not needed, so we release it.
+ Page oldPage = curPage;
+
+ curPage = new Page(newPagePtr, newPageSize);
+
+ if (oldPage != null)
+ allPages.add(oldPage);
+
return b.move(requestedSize);
}
/**
+ * Get next page size.
+ *
+ * @param required Required amount of data.
+ * @return Next page size.
+ */
+ private long nextPageSize(long required) {
+ long pages = (required / pageSize) + 1;
+
+ long pagesPow2 = nextPowerOfTwo(pages);
+
+ return pagesPow2 * pageSize;
+ }
+
+ /**
+ * Get next power of two which greater or equal to the given number. Naive implementation.
+ *
+ * @param val Number
+ * @return Nearest pow2.
+ */
+ private long nextPowerOfTwo(long val) {
+ long res = 1;
+
+ while (res < val)
+ res = res << 1;
+
+ if (res < 0)
+ throw new IllegalArgumentException("Value is too big to find positive pow2: " + val);
+
+ return res;
+ }
+
+ /**
* @return Fixed pointer.
*/
private long fixAlignment() {
@@ -317,7 +356,8 @@ public abstract class HadoopMultimapBase implements HadoopMultimap {
/** {@inheritDoc} */
@Override public void close() throws IgniteCheckedException {
- allPages.add(pages);
+ if (curPage != null)
+ allPages.add(curPage);
keySer.close();
valSer.close();
@@ -372,4 +412,26 @@ public abstract class HadoopMultimapBase implements HadoopMultimap {
throw new UnsupportedOperationException();
}
}
+
+ /**
+ * Page.
+ */
+ private static class Page {
+ /** Pointer. */
+ private final long ptr;
+
+ /** Size. */
+ private final long size;
+
+ /**
+ * Constructor.
+ *
+ * @param ptr Pointer.
+ * @param size Size.
+ */
+ public Page(long ptr, long size) {
+ this.ptr = ptr;
+ this.size = size;
+ }
+ }
}
\ No newline at end of file
[31/32] ignite git commit: ignite-gg-11181 - scanCount with offheap
index fix
Posted by sb...@apache.org.
ignite-gg-11181 - scanCount with offheap index fix
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/83f9fd08
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/83f9fd08
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/83f9fd08
Branch: refs/heads/ignite-3212
Commit: 83f9fd08b811a84580f8f517c32c628ec838af3c
Parents: 38ac8fb
Author: Sergi Vladykin <se...@gmail.com>
Authored: Mon Jun 6 00:14:05 2016 +0300
Committer: Sergi Vladykin <se...@gmail.com>
Committed: Mon Jun 6 14:08:15 2016 +0300
----------------------------------------------------------------------
.../unsafe/GridOffheapSnapTreeSelfTest.java | 2 +-
.../query/h2/opt/GridH2AbstractKeyValueRow.java | 23 +--
.../query/h2/opt/GridH2KeyValueRowOffheap.java | 17 +-
.../cache/IgniteCacheOffheapIndexScanTest.java | 195 +++++++++++++++++++
.../IgniteCacheQuerySelfTestSuite.java | 2 +
5 files changed, 226 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/83f9fd08/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridOffheapSnapTreeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridOffheapSnapTreeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridOffheapSnapTreeSelfTest.java
index 463b6dc..92d9ec2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridOffheapSnapTreeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/unsafe/GridOffheapSnapTreeSelfTest.java
@@ -313,7 +313,7 @@ public class GridOffheapSnapTreeSelfTest extends GridCommonAbstractTest {
}
@Override public int hashCode() {
- return ptr;
+ throw new IllegalStateException();
}
@Override public String toString() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/83f9fd08/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java
index ca5442a..fe6851d 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java
@@ -351,41 +351,37 @@ public abstract class GridH2AbstractKeyValueRow extends GridH2Row {
/** {@inheritDoc} */
@Override public void setKeyAndVersion(SearchRow old) {
- assert false;
+ throw new IllegalStateException();
}
/** {@inheritDoc} */
@Override public void setKey(long key) {
- assert false;
+ throw new IllegalStateException();
}
/** {@inheritDoc} */
@Override public Row getCopy() {
- assert false;
-
- return null;
+ throw new IllegalStateException();
}
/** {@inheritDoc} */
@Override public void setDeleted(boolean deleted) {
- assert false;
+ throw new IllegalStateException();
}
/** {@inheritDoc} */
@Override public long getKey() {
- assert false;
-
- return 0;
+ throw new IllegalStateException();
}
/** {@inheritDoc} */
@Override public void setSessionId(int sesId) {
- assert false;
+ throw new IllegalStateException();
}
/** {@inheritDoc} */
@Override public void setVersion(int ver) {
- assert false;
+ throw new IllegalStateException();
}
/**
@@ -469,4 +465,9 @@ public abstract class GridH2AbstractKeyValueRow extends GridH2Row {
throw new IllegalStateException();
}
}
+
+ /** {@inheritDoc} */
+ @Override public final int hashCode() {
+ throw new IllegalStateException();
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/83f9fd08/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java
index 2dd9f25..ee68431 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2KeyValueRowOffheap.java
@@ -170,7 +170,7 @@ public class GridH2KeyValueRowOffheap extends GridH2AbstractKeyValueRow {
}
}
else
- assert false : col;
+ throw new IllegalStateException("Column: " + col);
Data data = Data.create(null, bytes);
@@ -378,4 +378,19 @@ public class GridH2KeyValueRowOffheap extends GridH2AbstractKeyValueRow {
@Override protected void addOffheapRowId(SB sb) {
sb.a('-').a(ptr);
}
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+
+ if (obj instanceof GridH2KeyValueRowOffheap) {
+ GridH2KeyValueRowOffheap row = (GridH2KeyValueRowOffheap)obj;
+
+ if (pointer() == row.pointer())
+ return true;
+ }
+
+ return false;
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/83f9fd08/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapIndexScanTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapIndexScanTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapIndexScanTest.java
new file mode 100644
index 0000000..dbc8a65
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapIndexScanTest.java
@@ -0,0 +1,195 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import java.io.Serializable;
+import java.util.concurrent.Callable;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheMemoryMode;
+import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.cache.query.annotations.QuerySqlField;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.cache.CacheMode.LOCAL;
+
+/**
+ * Based scanCount with offheap index issue.
+ */
+public class IgniteCacheOffheapIndexScanTest extends GridCommonAbstractTest {
+ /** */
+ private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+ /** */
+ private static IgniteCache<Integer, Object> cache;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+ disco.setIpFinder(ipFinder);
+
+ cfg.setDiscoverySpi(disco);
+
+ CacheConfiguration<?,?> cacheCfg = new CacheConfiguration<>();
+
+ cacheCfg.setCacheMode(LOCAL);
+ cacheCfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
+ cacheCfg.setSqlOnheapRowCacheSize(256);
+ cacheCfg.setIndexedTypes(
+ Integer.class, Person.class
+ );
+
+ cfg.setCacheConfiguration(cacheCfg);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ startGridsMultiThreaded(1, false);
+
+ cache = grid(0).cache(null);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testQueryPlan() throws Exception {
+ for (int i = 0 ; i < 1000; i++)
+ cache.put(i, new Person(i, "firstName" + i, "lastName" + i, i % 100));
+
+ final AtomicBoolean end = new AtomicBoolean();
+
+ IgniteInternalFuture<?> fut = multithreadedAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ while(!end.get())
+ cache.query(new SqlFieldsQuery("select _val from Person")).getAll();
+
+ return null;
+ }
+ }, 5);
+
+ for (int i = 0; i < 150; i++) {
+ String plan = (String)cache.query(new SqlFieldsQuery(
+ "explain analyze select count(*) from Person where salary = 50")).getAll().get(0).get(0);
+
+ assertTrue(plan, plan.contains("scanCount: 11 "));
+
+ Thread.sleep(100);
+ }
+
+ end.set(true);
+
+ fut.get();
+ }
+
+ /**
+ * Person record used for query test.
+ */
+ public static class Person implements Serializable {
+ /** Person ID. */
+ @QuerySqlField(index = true)
+ private int id;
+
+ /** Organization ID. */
+ @QuerySqlField(index = true)
+ private int orgId;
+
+ /** First name (not-indexed). */
+ @QuerySqlField
+ private String firstName;
+
+ /** Last name (not indexed). */
+ @QuerySqlField
+ private String lastName;
+
+ /** Salary. */
+ @QuerySqlField(index = true)
+ private double salary;
+
+ /**
+ * Constructs empty person.
+ */
+ public Person() {
+ // No-op.
+ }
+
+ /**
+ * Constructs person record that is not linked to any organization.
+ *
+ * @param id Person ID.
+ * @param firstName First name.
+ * @param lastName Last name.
+ * @param salary Salary.
+ */
+ public Person(int id, String firstName, String lastName, double salary) {
+ this(id, 0, firstName, lastName, salary);
+ }
+
+ /**
+ * Constructs person record.
+ *
+ * @param id Person ID.
+ * @param orgId Organization ID.
+ * @param firstName First name.
+ * @param lastName Last name.
+ * @param salary Salary.
+ */
+ public Person(int id, int orgId, String firstName, String lastName, double salary) {
+ this.id = id;
+ this.orgId = orgId;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.salary = salary;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ return this == o || (o instanceof Person) && id == ((Person)o).id;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ return id;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return "Person [firstName=" + firstName +
+ ", id=" + id +
+ ", orgId=" + orgId +
+ ", lastName=" + lastName +
+ ", salary=" + salary +
+ ']';
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/83f9fd08/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
index ebad581..7b39453 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
@@ -29,6 +29,7 @@ import org.apache.ignite.internal.processors.cache.IgniteCacheCollocatedQuerySel
import org.apache.ignite.internal.processors.cache.IgniteCacheDuplicateEntityConfigurationSelfTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheLargeResultSelfTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheOffheapEvictQueryTest;
+import org.apache.ignite.internal.processors.cache.IgniteCacheOffheapIndexScanTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheOffheapTieredMultithreadedSelfTest;
import org.apache.ignite.internal.processors.cache.IgniteCachePartitionedQueryMultiThreadedSelfTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheQueryEvictsMultiThreadedSelfTest;
@@ -101,6 +102,7 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
suite.addTestSuite(IgniteCacheOffheapEvictQueryTest.class);
suite.addTestSuite(IgniteCacheSqlQueryMultiThreadedSelfTest.class);
suite.addTestSuite(IgniteCacheOffheapTieredMultithreadedSelfTest.class);
+ suite.addTestSuite(IgniteCacheOffheapIndexScanTest.class);
suite.addTestSuite(IgniteCacheQueryNodeRestartSelfTest.class);
suite.addTestSuite(IgniteCacheQueryNodeRestartSelfTest2.class);
suite.addTestSuite(IgniteCacheQueryNodeFailTest.class);
[08/32] ignite git commit: Merge remote-tracking branch
'remotes/community/gridgain-7.6.1'
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/community/gridgain-7.6.1'
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4cc10982
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4cc10982
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4cc10982
Branch: refs/heads/ignite-3212
Commit: 4cc10982e06fa521ed93f5930b2ccddcce405c56
Parents: 3c3ed05 f175d3c
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu Jun 2 16:25:43 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu Jun 2 16:25:43 2016 +0300
----------------------------------------------------------------------
.../affinity/fair/FairAffinityFunction.java | 81 ++++++++++-
.../rendezvous/RendezvousAffinityFunction.java | 39 +++++-
.../apache/ignite/internal/util/ClassCache.java | 32 +++++
.../ignite/internal/util/IgniteUtils.java | 6 +-
...ityFunctionBackupFilterAbstractSelfTest.java | 131 +++++++++++++++++-
...airAffinityFunctionBackupFilterSelfTest.java | 9 ++
...ousAffinityFunctionBackupFilterSelfTest.java | 9 ++
.../IgniteTxExceptionAbstractSelfTest.java | 3 +-
.../hadoop/fs/BasicHadoopFileSystemFactory.java | 56 +++++++-
.../fs/CachingHadoopFileSystemFactory.java | 7 +-
.../fs/KerberosHadoopFileSystemFactory.java | 4 +-
.../ignite/hadoop/util/BasicUserNameMapper.java | 114 +++++++++++++++
.../hadoop/util/ChainedUserNameMapper.java | 94 +++++++++++++
.../hadoop/util/KerberosUserNameMapper.java | 137 +++++++++++++++++++
.../ignite/hadoop/util/UserNameMapper.java | 37 +++++
.../apache/ignite/hadoop/util/package-info.java | 22 +++
.../processors/hadoop/HadoopClassLoader.java | 23 +++-
.../util/BasicUserNameMapperSelfTest.java | 116 ++++++++++++++++
.../util/ChainedUserNameMapperSelfTest.java | 107 +++++++++++++++
.../util/KerberosUserNameMapperSelfTest.java | 99 ++++++++++++++
.../ignite/igfs/Hadoop1DualAbstractTest.java | 46 +++++++
.../testsuites/IgniteHadoopTestSuite.java | 8 ++
22 files changed, 1156 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4cc10982/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
index 95f1740,c867d52..6c7f7ac
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
@@@ -53,7 -54,7 +54,7 @@@ import static org.apache.ignite.cache.C
/**
* Tests that transaction is invalidated in case of {@link IgniteTxHeuristicCheckedException}.
*/
--public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstractSelfTest {
++public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstractSelfTest
/** */
private static final int PRIMARY = 0;
[04/32] ignite git commit: IGNITE-2708: fix tests that don't create
unique IndexingSPI per node (cherry picked from commit f90e424)
Posted by sb...@apache.org.
IGNITE-2708: fix tests that don't create unique IndexingSPI per node
(cherry picked from commit f90e424)
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/167e4778
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/167e4778
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/167e4778
Branch: refs/heads/ignite-3212
Commit: 167e47781f65c056b9d273eea52d268bc9a8fa0b
Parents: 421cf03
Author: Denis Magda <dm...@gridgain.com>
Authored: Tue May 31 13:50:06 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Tue May 31 13:55:35 2016 +0300
----------------------------------------------------------------------
.../IgniteTxExceptionAbstractSelfTest.java | 43 ++++++++++++--------
1 file changed, 27 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/167e4778/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
index 4826c68..c867d52 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
@@ -28,6 +28,7 @@ import javax.cache.processor.EntryProcessor;
import javax.cache.processor.MutableEntry;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
+import org.apache.ignite.Ignition;
import org.apache.ignite.cache.CachePeekMode;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
@@ -54,9 +55,6 @@ import static org.apache.ignite.cache.CacheMode.REPLICATED;
* Tests that transaction is invalidated in case of {@link IgniteTxHeuristicCheckedException}.
*/
public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstractSelfTest {
- /** Index SPI throwing exception. */
- private static TestIndexingSpi idxSpi = new TestIndexingSpi();
-
/** */
private static final int PRIMARY = 0;
@@ -78,7 +76,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
- cfg.setIndexingSpi(idxSpi);
+ cfg.setIndexingSpi(new TestIndexingSpi());
cfg.getTransactionConfiguration().setTxSerializableEnabled(true);
@@ -108,7 +106,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
- idxSpi.forceFail(false);
+ failIndexingSpi(false);
Transaction tx = jcache().unwrap(Ignite.class).transactions().tx();
@@ -321,7 +319,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
IgniteCache<Integer, Integer> cache = grid(0).cache(null);
if (putBefore) {
- idxSpi.forceFail(false);
+ failIndexingSpi(false);
info("Start transaction.");
@@ -344,7 +342,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
grid(i).cache(null).get(key);
}
- idxSpi.forceFail(true);
+ failIndexingSpi(true);
try {
info("Start transaction.");
@@ -380,7 +378,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
*/
@SuppressWarnings("unchecked")
private void checkUnlocked(final Integer key) throws Exception {
- idxSpi.forceFail(false);
+ failIndexingSpi(false);
awaitPartitionMapExchange();
@@ -448,7 +446,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
*/
private void checkPut(boolean putBefore, final Integer key) throws Exception {
if (putBefore) {
- idxSpi.forceFail(false);
+ failIndexingSpi(false);
info("Put key: " + key);
@@ -459,7 +457,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
for (int i = 0; i < gridCount(); i++)
grid(i).cache(null).get(key);
- idxSpi.forceFail(true);
+ failIndexingSpi(true);
info("Going to put: " + key);
@@ -481,7 +479,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
*/
private void checkTransform(boolean putBefore, final Integer key) throws Exception {
if (putBefore) {
- idxSpi.forceFail(false);
+ failIndexingSpi(false);
info("Put key: " + key);
@@ -492,7 +490,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
for (int i = 0; i < gridCount(); i++)
grid(i).cache(null).get(key);
- idxSpi.forceFail(true);
+ failIndexingSpi(true);
info("Going to transform: " + key);
@@ -524,7 +522,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
assert keys.length > 1;
if (putBefore) {
- idxSpi.forceFail(false);
+ failIndexingSpi(false);
Map<Integer, Integer> m = new HashMap<>();
@@ -542,7 +540,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
grid(i).cache(null).get(key);
}
- idxSpi.forceFail(true);
+ failIndexingSpi(true);
final Map<Integer, Integer> m = new HashMap<>();
@@ -570,7 +568,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
*/
private void checkRemove(boolean putBefore, final Integer key) throws Exception {
if (putBefore) {
- idxSpi.forceFail(false);
+ failIndexingSpi(false);
info("Put key: " + key);
@@ -581,7 +579,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
for (int i = 0; i < gridCount(); i++)
grid(i).cache(null).get(key);
- idxSpi.forceFail(true);
+ failIndexingSpi(true);
info("Going to remove: " + key);
@@ -653,6 +651,19 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
}
/**
+ * Controls indexing SPI behavior.
+ *
+ * @param fail fail the SPI or not.
+ */
+ private void failIndexingSpi(boolean fail) {
+ for (Ignite ignite : Ignition.allGrids()) {
+ TestIndexingSpi idxSpi = (TestIndexingSpi)ignite.configuration().getIndexingSpi();
+
+ idxSpi.forceFail(fail);
+ }
+ }
+
+ /**
* Indexing SPI that can fail on demand.
*/
private static class TestIndexingSpi extends IgniteSpiAdapter implements IndexingSpi {
[02/32] ignite git commit: IGNITE-3202: Hadoop: Implemented user name
mappers.
Posted by sb...@apache.org.
IGNITE-3202: Hadoop: Implemented user name mappers.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a815067a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a815067a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a815067a
Branch: refs/heads/ignite-3212
Commit: a815067a0e8e7cfc9f49c57efe2b2eba562e9071
Parents: 56c6056
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue May 31 10:23:00 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue May 31 11:36:08 2016 +0300
----------------------------------------------------------------------
.../hadoop/fs/BasicHadoopFileSystemFactory.java | 56 +++++++-
.../fs/CachingHadoopFileSystemFactory.java | 7 +-
.../fs/KerberosHadoopFileSystemFactory.java | 4 +-
.../ignite/hadoop/util/BasicUserNameMapper.java | 114 +++++++++++++++
.../hadoop/util/ChainedUserNameMapper.java | 94 +++++++++++++
.../hadoop/util/KerberosUserNameMapper.java | 137 +++++++++++++++++++
.../ignite/hadoop/util/UserNameMapper.java | 37 +++++
.../util/BasicUserNameMapperSelfTest.java | 116 ++++++++++++++++
.../util/ChainedUserNameMapperSelfTest.java | 90 ++++++++++++
.../util/KerberosUserNameMapperSelfTest.java | 99 ++++++++++++++
.../ignite/igfs/Hadoop1DualAbstractTest.java | 46 +++++++
.../testsuites/IgniteHadoopTestSuite.java | 8 ++
12 files changed, 796 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a815067a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/BasicHadoopFileSystemFactory.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/BasicHadoopFileSystemFactory.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/BasicHadoopFileSystemFactory.java
index 01fe6c9..06f76c3 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/BasicHadoopFileSystemFactory.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/BasicHadoopFileSystemFactory.java
@@ -21,6 +21,8 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.ignite.IgniteException;
import org.apache.ignite.hadoop.fs.v1.IgniteHadoopFileSystem;
+import org.apache.ignite.hadoop.util.KerberosUserNameMapper;
+import org.apache.ignite.hadoop.util.UserNameMapper;
import org.apache.ignite.internal.processors.hadoop.HadoopUtils;
import org.apache.ignite.internal.processors.igfs.IgfsUtils;
import org.apache.ignite.internal.util.typedef.internal.U;
@@ -46,10 +48,13 @@ public class BasicHadoopFileSystemFactory implements HadoopFileSystemFactory, Ex
private static final long serialVersionUID = 0L;
/** File system URI. */
- protected String uri;
+ private String uri;
/** File system config paths. */
- protected String[] cfgPaths;
+ private String[] cfgPaths;
+
+ /** User name mapper. */
+ private UserNameMapper usrNameMapper;
/** Configuration of the secondary filesystem, never null. */
protected transient Configuration cfg;
@@ -65,8 +70,13 @@ public class BasicHadoopFileSystemFactory implements HadoopFileSystemFactory, Ex
}
/** {@inheritDoc} */
- @Override public FileSystem get(String usrName) throws IOException {
- return get0(IgfsUtils.fixUserName(usrName));
+ @Override public final FileSystem get(String name) throws IOException {
+ String name0 = IgfsUtils.fixUserName(name);
+
+ if (usrNameMapper != null)
+ name0 = IgfsUtils.fixUserName(usrNameMapper.map(name0));
+
+ return getWithMappedName(name0);
}
/**
@@ -76,7 +86,7 @@ public class BasicHadoopFileSystemFactory implements HadoopFileSystemFactory, Ex
* @return File system.
* @throws IOException If failed.
*/
- protected FileSystem get0(String usrName) throws IOException {
+ protected FileSystem getWithMappedName(String usrName) throws IOException {
assert cfg != null;
try {
@@ -168,6 +178,32 @@ public class BasicHadoopFileSystemFactory implements HadoopFileSystemFactory, Ex
this.cfgPaths = cfgPaths;
}
+ /**
+ * Get optional user name mapper.
+ * <p>
+ * When IGFS is invoked from Hadoop, user name is passed along the way to ensure that request will be performed
+ * with proper user context. User name is passed in a simple form and doesn't contain any extended information,
+ * such as host, domain or Kerberos realm. You may use name mapper to translate plain user name to full user
+ * name required by security engine of the underlying file system.
+ * <p>
+ * For example you may want to use {@link KerberosUserNameMapper} to user name from {@code "johndoe"} to
+ * {@code "johndoe@YOUR.REALM.COM"}.
+ *
+ * @return User name mapper.
+ */
+ @Nullable public UserNameMapper getUserNameMapper() {
+ return usrNameMapper;
+ }
+
+ /**
+ * Set optional user name mapper. See {@link #getUserNameMapper()} for more information.
+ *
+ * @param usrNameMapper User name mapper.
+ */
+ public void setUserNameMapper(@Nullable UserNameMapper usrNameMapper) {
+ this.usrNameMapper = usrNameMapper;
+ }
+
/** {@inheritDoc} */
@Override public void start() throws IgniteException {
cfg = HadoopUtils.safeCreateConfiguration();
@@ -201,11 +237,15 @@ public class BasicHadoopFileSystemFactory implements HadoopFileSystemFactory, Ex
throw new IgniteException("Failed to resolve secondary file system URI: " + uri);
}
}
+
+ if (usrNameMapper != null && usrNameMapper instanceof LifecycleAware)
+ ((LifecycleAware)usrNameMapper).start();
}
/** {@inheritDoc} */
@Override public void stop() throws IgniteException {
- // No-op.
+ if (usrNameMapper != null && usrNameMapper instanceof LifecycleAware)
+ ((LifecycleAware)usrNameMapper).stop();
}
/** {@inheritDoc} */
@@ -220,6 +260,8 @@ public class BasicHadoopFileSystemFactory implements HadoopFileSystemFactory, Ex
}
else
out.writeInt(-1);
+
+ out.writeObject(usrNameMapper);
}
/** {@inheritDoc} */
@@ -234,5 +276,7 @@ public class BasicHadoopFileSystemFactory implements HadoopFileSystemFactory, Ex
for (int i = 0; i < cfgPathsCnt; i++)
cfgPaths[i] = U.readString(in);
}
+
+ usrNameMapper = (UserNameMapper)in.readObject();
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a815067a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/CachingHadoopFileSystemFactory.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/CachingHadoopFileSystemFactory.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/CachingHadoopFileSystemFactory.java
index e1b30c4..bcbb082 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/CachingHadoopFileSystemFactory.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/CachingHadoopFileSystemFactory.java
@@ -23,7 +23,6 @@ import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.internal.processors.hadoop.fs.HadoopFileSystemsUtils;
import org.apache.ignite.internal.processors.hadoop.fs.HadoopLazyConcurrentMap;
-import org.apache.ignite.internal.processors.igfs.IgfsUtils;
import java.io.IOException;
import java.net.URI;
@@ -47,7 +46,7 @@ public class CachingHadoopFileSystemFactory extends BasicHadoopFileSystemFactory
private final transient HadoopLazyConcurrentMap<String, FileSystem> cache = new HadoopLazyConcurrentMap<>(
new HadoopLazyConcurrentMap.ValueFactory<String, FileSystem>() {
@Override public FileSystem createValue(String key) throws IOException {
- return get0(key);
+ return CachingHadoopFileSystemFactory.super.getWithMappedName(key);
}
}
);
@@ -60,8 +59,8 @@ public class CachingHadoopFileSystemFactory extends BasicHadoopFileSystemFactory
}
/** {@inheritDoc} */
- @Override public FileSystem get(String usrName) throws IOException {
- return cache.getOrCreate(IgfsUtils.fixUserName(usrName));
+ @Override public FileSystem getWithMappedName(String name) throws IOException {
+ return cache.getOrCreate(name);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/a815067a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/KerberosHadoopFileSystemFactory.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/KerberosHadoopFileSystemFactory.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/KerberosHadoopFileSystemFactory.java
index a78cabc..bbfbc59 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/KerberosHadoopFileSystemFactory.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/KerberosHadoopFileSystemFactory.java
@@ -68,10 +68,10 @@ public class KerberosHadoopFileSystemFactory extends BasicHadoopFileSystemFactor
}
/** {@inheritDoc} */
- @Override public FileSystem get(String userName) throws IOException {
+ @Override public FileSystem getWithMappedName(String name) throws IOException {
reloginIfNeeded();
- return super.get(userName);
+ return super.getWithMappedName(name);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/a815067a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/BasicUserNameMapper.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/BasicUserNameMapper.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/BasicUserNameMapper.java
new file mode 100644
index 0000000..aea7196
--- /dev/null
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/BasicUserNameMapper.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.hadoop.util;
+
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+
+/**
+ * Name mapper which maps one user name to another based on predefined dictionary. If name is not found in the
+ * dictionary, or dictionary is not defined, either passed user name or some default value could be returned.
+ */
+public class BasicUserNameMapper implements UserNameMapper {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Mappings. */
+ private Map<String, String> mappings;
+
+ /** Whether to use default user name. */
+ private boolean useDfltUsrName;;
+
+ /** Default user name. */
+ private String dfltUsrName;
+
+ /** {@inheritDoc} */
+ @Nullable @Override public String map(String name) {
+ assert mappings != null;
+
+ String res = mappings.get(name);
+
+ return res != null ? res : useDfltUsrName ? dfltUsrName : name;
+ }
+
+ /**
+ * Get mappings.
+ *
+ * @return Mappings.
+ */
+ @Nullable public Map<String, String> getMappings() {
+ return mappings;
+ }
+
+ /**
+ * Set mappings.
+ *
+ * @param mappings Mappings.
+ */
+ public void setMappings(@Nullable Map<String, String> mappings) {
+ this.mappings = mappings;
+ }
+
+ /**
+ * Get whether to use default user name when there is no mapping for current user name.
+ *
+ * @return Whether to use default user name.
+ */
+ public boolean isUseDefaultUserName() {
+ return useDfltUsrName;
+ }
+
+ /**
+ * Set whether to use default user name when there is no mapping for current user name.
+ *
+ * @param useDfltUsrName Whether to use default user name.
+ */
+ public void setUseDefaultUserName(boolean useDfltUsrName) {
+ this.useDfltUsrName = useDfltUsrName;
+ }
+
+ /**
+ * Get default user name (optional).
+ * <p>
+ * This user name will be used if provided mappings doesn't contain mapping for the given user name and
+ * {#isUseDefaultUserName} is set to {@code true}.
+ * <p>
+ * Defaults to {@code null}.
+ *
+ * @return Default user name.
+ */
+ @Nullable public String getDefaultUserName() {
+ return dfltUsrName;
+ }
+
+ /**
+ * Set default user name (optional). See {@link #getDefaultUserName()} for more information.
+ *
+ * @param dfltUsrName Default user name.
+ */
+ public void setDefaultUserName(@Nullable String dfltUsrName) {
+ this.dfltUsrName = dfltUsrName;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(BasicUserNameMapper.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a815067a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/ChainedUserNameMapper.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/ChainedUserNameMapper.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/ChainedUserNameMapper.java
new file mode 100644
index 0000000..7635e25
--- /dev/null
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/ChainedUserNameMapper.java
@@ -0,0 +1,94 @@
+/*
+ * 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.util;
+
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lifecycle.LifecycleAware;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+
+/**
+ * Chained user name mapper. Delegate name conversion to child mappers.
+ */
+public class ChainedUserNameMapper implements UserNameMapper, LifecycleAware {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Child mappers. */
+ private UserNameMapper[] mappers;
+
+ /** {@inheritDoc} */
+ @Nullable @Override public String map(String name) {
+ for (UserNameMapper mapper : mappers)
+ name = mapper.map(name);
+
+ return name;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void start() throws IgniteException {
+ if (mappers == null)
+ throw new IgniteException("Mappers cannot be null.");
+
+ for (int i = 0; i < mappers.length; i++) {
+ if (mappers[i] == null)
+ throw new IgniteException("Mapper cannot be null [index=" + i + ']');
+ }
+
+ for (UserNameMapper mapper : mappers) {
+ if (mapper instanceof LifecycleAware)
+ ((LifecycleAware)mapper).start();
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public void stop() throws IgniteException {
+ assert mappers != null;
+
+ for (UserNameMapper mapper : mappers) {
+ if (mapper instanceof LifecycleAware)
+ ((LifecycleAware)mapper).stop();
+ }
+ }
+
+ /**
+ * Get child mappers.
+ *
+ * @return Child mappers.
+ */
+ public UserNameMapper[] getMappers() {
+ return mappers;
+ }
+
+ /**
+ * Set child mappers.
+ *
+ * @param mappers Child mappers.
+ */
+ public void setMappers(UserNameMapper... mappers) {
+ this.mappers = mappers;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(ChainedUserNameMapper.class, this,
+ "mappers", mappers != null ? Arrays.toString(mappers) : null);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a815067a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/KerberosUserNameMapper.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/KerberosUserNameMapper.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/KerberosUserNameMapper.java
new file mode 100644
index 0000000..433fb82
--- /dev/null
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/KerberosUserNameMapper.java
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.hadoop.util;
+
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.internal.processors.igfs.IgfsUtils;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lifecycle.LifecycleAware;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Kerberos user name mapper. Use it when you need to map simple user name to Kerberos principal.
+ * E.g. from {@code johndoe} to {@code johndoe@YOUR.REALM.COM} or {@code johndoe/admin@YOUR.REALM.COM}.
+ */
+public class KerberosUserNameMapper implements UserNameMapper, LifecycleAware {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Instance. */
+ private String instance;
+
+ /** Realm. */
+ private String realm;
+
+ /** State. */
+ private volatile State state;
+
+ /** {@inheritDoc} */
+ @Nullable @Override public String map(String name) {
+ assert state != null;
+
+ name = IgfsUtils.fixUserName(name);
+
+ switch (state) {
+ case NAME:
+ return name;
+
+ case NAME_REALM:
+ return name + '@' + realm;
+
+ case NAME_INSTANCE:
+ return name + '/' + instance;
+
+ default:
+ assert state == State.NAME_INSTANCE_REALM;
+
+ return name + '/' + instance + '@' + realm;
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public void start() throws IgniteException {
+ if (!F.isEmpty(instance))
+ state = F.isEmpty(realm) ? State.NAME_INSTANCE : State.NAME_INSTANCE_REALM;
+ else
+ state = F.isEmpty(realm) ? State.NAME : State.NAME_REALM;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void stop() throws IgniteException {
+ // No-op.
+ }
+
+ /**
+ * Get Kerberos instance (optional).
+ *
+ * @return Instance.
+ */
+ @Nullable public String getInstance() {
+ return instance;
+ }
+
+ /**
+ * Set Kerberos instance (optional).
+ *
+ * @param instance Kerberos instance.
+ */
+ public void setInstance(@Nullable String instance) {
+ this.instance = instance;
+ }
+
+ /**
+ * Get Kerberos realm (optional).
+ *
+ * @return Kerberos realm.
+ */
+ @Nullable public String getRealm() {
+ return realm;
+ }
+
+ /**
+ * Set Kerberos realm (optional).
+ *
+ * @param realm Kerberos realm.
+ */
+ public void setRealm(@Nullable String realm) {
+ this.realm = realm;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(KerberosUserNameMapper.class, this);
+ }
+
+ /**
+ * State enumeration.
+ */
+ private enum State {
+ /** Name only. */
+ NAME,
+
+ /** Name and realm. */
+ NAME_REALM,
+
+ /** Name and host. */
+ NAME_INSTANCE,
+
+ /** Name, host and realm. */
+ NAME_INSTANCE_REALM,
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a815067a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/UserNameMapper.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/UserNameMapper.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/UserNameMapper.java
new file mode 100644
index 0000000..26dc4b2
--- /dev/null
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/util/UserNameMapper.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.hadoop.util;
+
+import org.apache.ignite.hadoop.fs.HadoopFileSystemFactory;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.Serializable;
+
+/**
+ * Hadoop file system name mapper. Used by {@link HadoopFileSystemFactory} implementation to pass proper user names
+ * to the underlying Hadoop file system.
+ */
+public interface UserNameMapper extends Serializable {
+ /**
+ * Map user name.
+ *
+ * @param name User name.
+ * @return Mapped user name.
+ */
+ @Nullable public String map(String name);
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a815067a/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/BasicUserNameMapperSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/BasicUserNameMapperSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/BasicUserNameMapperSelfTest.java
new file mode 100644
index 0000000..54b03f9
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/BasicUserNameMapperSelfTest.java
@@ -0,0 +1,116 @@
+/*
+ * 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.util;
+
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Test for basic user name mapper.
+ */
+public class BasicUserNameMapperSelfTest extends GridCommonAbstractTest {
+ /**
+ * Test empty mappings.
+ *
+ * @throws Exception If failed.
+ */
+ public void testEmptyMappings() throws Exception {
+ Map<String, String> map = new HashMap<>();
+
+ BasicUserNameMapper mapper = create(map, false, null);
+
+ assertNull(mapper.map(null));
+ assertEquals("1", mapper.map("1"));
+ assertEquals("2", mapper.map("2"));
+
+ mapper = create(map, true, null);
+
+ assertNull(mapper.map(null));
+ assertNull(mapper.map("1"));
+ assertNull(mapper.map("2"));
+
+ mapper = create(map, false, "A");
+
+ assertNull(mapper.map(null));
+ assertEquals("1", mapper.map("1"));
+ assertEquals("2", mapper.map("2"));
+
+ mapper = create(map, true, "A");
+
+ assertEquals("A", mapper.map(null));
+ assertEquals("A", mapper.map("1"));
+ assertEquals("A", mapper.map("2"));
+ }
+
+ /**
+ * Test regular mappings.
+ *
+ * @throws Exception If failed.
+ */
+ public void testMappings() throws Exception {
+ Map<String, String> map = new HashMap<>();
+
+ map.put("1", "101");
+
+ BasicUserNameMapper mapper = create(map, false, null);
+
+ assertNull(mapper.map(null));
+ assertEquals("101", mapper.map("1"));
+ assertEquals("2", mapper.map("2"));
+
+ mapper = create(map, true, null);
+
+ assertNull(mapper.map(null));
+ assertEquals("101", mapper.map("1"));
+ assertNull(mapper.map("2"));
+
+ mapper = create(map, false, "A");
+
+ assertNull(mapper.map(null));
+ assertEquals("101", mapper.map("1"));
+ assertEquals("2", mapper.map("2"));
+
+ mapper = create(map, true, "A");
+
+ assertEquals("A", mapper.map(null));
+ assertEquals("101", mapper.map("1"));
+ assertEquals("A", mapper.map("2"));
+ }
+
+ /**
+ * Create mapper.
+ *
+ * @param dictionary Dictionary.
+ * @param useDfltUsrName Whether to use default user name.
+ * @param dfltUsrName Default user name.
+ * @return Mapper.
+ */
+ private BasicUserNameMapper create(@Nullable Map<String, String> dictionary, boolean useDfltUsrName,
+ @Nullable String dfltUsrName) {
+ BasicUserNameMapper mapper = new BasicUserNameMapper();
+
+ mapper.setMappings(dictionary);
+ mapper.setUseDefaultUserName(useDfltUsrName);
+ mapper.setDefaultUserName(dfltUsrName);
+
+ return mapper;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a815067a/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/ChainedUserNameMapperSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/ChainedUserNameMapperSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/ChainedUserNameMapperSelfTest.java
new file mode 100644
index 0000000..5bdac8f
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/ChainedUserNameMapperSelfTest.java
@@ -0,0 +1,90 @@
+package org.apache.ignite.hadoop.util;
+
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.internal.processors.igfs.IgfsUtils;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import java.util.Collections;
+import java.util.concurrent.Callable;
+
+/**
+ * Tests for chained user name mapper.
+ */
+public class ChainedUserNameMapperSelfTest extends GridCommonAbstractTest {
+ /** Test instance. */
+ private static final String INSTANCE = "test_instance";
+
+ /** Test realm. */
+ private static final String REALM = "test_realm";
+
+ /**
+ * Test case when mappers are null.
+ *
+ * @throws Exception If failed.
+ */
+ @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
+ public void testNullMappers() throws Exception {
+ GridTestUtils.assertThrows(null, new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ create((UserNameMapper[])null);
+
+ return null;
+ }
+ }, IgniteException.class, null);
+ }
+
+ /**
+ * Test case when one of mappers is null.
+ *
+ * @throws Exception If failed.
+ */
+ @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
+ public void testNullMapperElement() throws Exception {
+ GridTestUtils.assertThrows(null, new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ create(new BasicUserNameMapper(), null);
+
+ return null;
+ }
+ }, IgniteException.class, null);
+ }
+
+ /**
+ * Test actual chaining logic.
+ *
+ * @throws Exception If failed.
+ */
+ public void testChaining() throws Exception {
+ BasicUserNameMapper mapper1 = new BasicUserNameMapper();
+
+ mapper1.setMappings(Collections.singletonMap("1", "101"));
+
+ KerberosUserNameMapper mapper2 = new KerberosUserNameMapper();
+
+ mapper2.setInstance(INSTANCE);
+ mapper2.setRealm(REALM);
+
+ ChainedUserNameMapper mapper = create(mapper1, mapper2);
+
+ assertEquals("101" + "/" + INSTANCE + "@" + REALM, mapper.map("1"));
+ assertEquals("2" + "/" + INSTANCE + "@" + REALM, mapper.map("2"));
+ assertEquals(IgfsUtils.fixUserName(null) + "/" + INSTANCE + "@" + REALM, mapper.map(null));
+ }
+
+ /**
+ * Create chained mapper.
+ *
+ * @param mappers Child mappers.
+ * @return Chained mapper.
+ */
+ private ChainedUserNameMapper create(UserNameMapper... mappers) {
+ ChainedUserNameMapper mapper = new ChainedUserNameMapper();
+
+ mapper.setMappers(mappers);
+
+ mapper.start();
+
+ return mapper;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a815067a/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/KerberosUserNameMapperSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/KerberosUserNameMapperSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/KerberosUserNameMapperSelfTest.java
new file mode 100644
index 0000000..cc685bb
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/KerberosUserNameMapperSelfTest.java
@@ -0,0 +1,99 @@
+/*
+ * 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.util;
+
+import org.apache.ignite.internal.processors.igfs.IgfsUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Tests for Kerberos name mapper.
+ */
+public class KerberosUserNameMapperSelfTest extends GridCommonAbstractTest {
+ /** Test instance. */
+ private static final String INSTANCE = "test_instance";
+
+ /** Test realm. */
+ private static final String REALM = "test_realm";
+
+ /**
+ * Test mapper without instance and realm components.
+ *
+ * @throws Exception If failed.
+ */
+ public void testMapper() throws Exception {
+ KerberosUserNameMapper mapper = create(null, null);
+
+ assertEquals(IgfsUtils.fixUserName(null), mapper.map(null));
+ assertEquals("test", mapper.map("test"));
+ }
+
+ /**
+ * Test mapper with instance component.
+ *
+ * @throws Exception If failed.
+ */
+ public void testMapperInstance() throws Exception {
+ KerberosUserNameMapper mapper = create(INSTANCE, null);
+
+ assertEquals(IgfsUtils.fixUserName(null) + "/" + INSTANCE, mapper.map(null));
+ assertEquals("test" + "/" + INSTANCE, mapper.map("test"));
+ }
+
+ /**
+ * Test mapper with realm.
+ *
+ * @throws Exception If failed.
+ */
+ public void testMapperRealm() throws Exception {
+ KerberosUserNameMapper mapper = create(null, REALM);
+
+ assertEquals(IgfsUtils.fixUserName(null) + "@" + REALM, mapper.map(null));
+ assertEquals("test" + "@" + REALM, mapper.map("test"));
+ }
+
+ /**
+ * Test mapper with instance and realm components.
+ *
+ * @throws Exception If failed.
+ */
+ public void testMapperInstanceAndRealm() throws Exception {
+ KerberosUserNameMapper mapper = create(INSTANCE, REALM);
+
+ assertEquals(IgfsUtils.fixUserName(null) + "/" + INSTANCE + "@" + REALM, mapper.map(null));
+ assertEquals("test" + "/" + INSTANCE + "@" + REALM, mapper.map("test"));
+ }
+
+ /**
+ * Create mapper.
+ *
+ * @param instance Instance.
+ * @param realm Realm.
+ * @return Mapper.
+ */
+ private KerberosUserNameMapper create(@Nullable String instance, @Nullable String realm) {
+ KerberosUserNameMapper mapper = new KerberosUserNameMapper();
+
+ mapper.setInstance(instance);
+ mapper.setRealm(realm);
+
+ mapper.start();
+
+ return mapper;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a815067a/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java
index d1d7c10..4ee0b75 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java
@@ -19,11 +19,17 @@ package org.apache.ignite.igfs;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
+import org.apache.ignite.IgniteException;
import org.apache.ignite.hadoop.fs.CachingHadoopFileSystemFactory;
import org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem;
+import org.apache.ignite.hadoop.util.ChainedUserNameMapper;
+import org.apache.ignite.hadoop.util.KerberosUserNameMapper;
+import org.apache.ignite.hadoop.util.UserNameMapper;
import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
import org.apache.ignite.internal.processors.igfs.IgfsDualAbstractSelfTest;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.lifecycle.LifecycleAware;
+import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.IgniteFileSystem.IGFS_SCHEME;
import static org.apache.ignite.igfs.HadoopSecondaryFileSystemConfigurationTest.SECONDARY_CFG_PATH;
@@ -75,10 +81,21 @@ public abstract class Hadoop1DualAbstractTest extends IgfsDualAbstractSelfTest {
prepareConfiguration();
+ KerberosUserNameMapper mapper1 = new KerberosUserNameMapper();
+
+ mapper1.setRealm("TEST.COM");
+
+ TestUserNameMapper mapper2 = new TestUserNameMapper();
+
+ ChainedUserNameMapper mapper = new ChainedUserNameMapper();
+
+ mapper.setMappers(mapper1, mapper2);
+
CachingHadoopFileSystemFactory factory = new CachingHadoopFileSystemFactory();
factory.setUri(secondaryUri);
factory.setConfigPaths(secondaryConfFullPath);
+ factory.setUserNameMapper(mapper);
IgniteHadoopIgfsSecondaryFileSystem second = new IgniteHadoopIgfsSecondaryFileSystem();
@@ -110,4 +127,33 @@ public abstract class Hadoop1DualAbstractTest extends IgfsDualAbstractSelfTest {
secondaryUri = mkUri(IGFS_SCHEME, SECONDARY_AUTHORITY);
}
+
+ /**
+ * Test user name mapper.
+ */
+ private static class TestUserNameMapper implements UserNameMapper, LifecycleAware {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Started flag. */
+ private boolean started;
+
+ /** {@inheritDoc} */
+ @Nullable @Override public String map(String name) {
+ assert started;
+ assert name != null && name.contains("@");
+
+ return name.substring(0, name.indexOf("@"));
+ }
+
+ /** {@inheritDoc} */
+ @Override public void start() throws IgniteException {
+ started = true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void stop() throws IgniteException {
+ // No-op.
+ }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a815067a/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 554cbc7..7d877ab 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
@@ -26,6 +26,10 @@ import org.apache.ignite.client.hadoop.HadoopClientProtocolEmbeddedSelfTest;
import org.apache.ignite.client.hadoop.HadoopClientProtocolSelfTest;
import org.apache.ignite.hadoop.cache.HadoopTxConfigCacheTest;
import org.apache.ignite.hadoop.fs.KerberosHadoopFileSystemFactorySelfTest;
+import org.apache.ignite.hadoop.util.BasicUserNameMapperSelfTest;
+import org.apache.ignite.hadoop.util.ChainedUserNameMapperSelfTest;
+import org.apache.ignite.hadoop.util.KerberosUserNameMapper;
+import org.apache.ignite.hadoop.util.KerberosUserNameMapperSelfTest;
import org.apache.ignite.igfs.Hadoop1OverIgfsDualAsyncTest;
import org.apache.ignite.igfs.Hadoop1OverIgfsDualSyncTest;
import org.apache.ignite.igfs.HadoopFIleSystemFactorySelfTest;
@@ -106,6 +110,10 @@ public class IgniteHadoopTestSuite extends TestSuite {
TestSuite suite = new TestSuite("Ignite Hadoop MR Test Suite");
+ suite.addTest(new TestSuite(ldr.loadClass(BasicUserNameMapperSelfTest.class.getName())));
+ suite.addTest(new TestSuite(ldr.loadClass(KerberosUserNameMapperSelfTest.class.getName())));
+ suite.addTest(new TestSuite(ldr.loadClass(ChainedUserNameMapperSelfTest.class.getName())));
+
suite.addTest(new TestSuite(ldr.loadClass(KerberosHadoopFileSystemFactorySelfTest.class.getName())));
suite.addTest(new TestSuite(ldr.loadClass(HadoopSnappyTest.class.getName())));
[32/32] ignite git commit: Merge remote-tracking branch
'remotes/origin/master' into ignite-3212
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-3212
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/335de549
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/335de549
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/335de549
Branch: refs/heads/ignite-3212
Commit: 335de549688ff3724ee34d2b9d7b26c68e51fe01
Parents: 7e3ecb9 83f9fd0
Author: sboikov <sb...@gridgain.com>
Authored: Mon Jun 6 14:54:40 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jun 6 14:54:40 2016 +0300
----------------------------------------------------------------------
.../affinity/fair/FairAffinityFunction.java | 81 +++-
.../rendezvous/RendezvousAffinityFunction.java | 39 +-
.../java/org/apache/ignite/igfs/IgfsPath.java | 26 +-
.../org/apache/ignite/igfs/IgfsPathSummary.java | 32 +-
.../ignite/internal/binary/BinaryUtils.java | 16 +
.../internal/cluster/ClusterGroupAdapter.java | 6 +
.../ignite/internal/cluster/ClusterGroupEx.java | 14 +-
.../processors/cache/CacheObjectContext.java | 3 +
.../processors/cache/GridCacheAdapter.java | 43 +-
.../processors/cache/GridCacheContext.java | 7 +-
.../processors/cache/GridCacheEntryEx.java | 3 +-
.../cache/GridCacheEvictionManager.java | 2 +-
.../processors/cache/GridCacheMapEntry.java | 4 +-
.../processors/cache/GridCacheSwapManager.java | 67 ++-
.../distributed/dht/GridDhtCacheAdapter.java | 11 +-
.../cache/query/GridCacheQueryManager.java | 9 +-
.../processors/igfs/IgfsBlockLocationImpl.java | 87 +++-
.../internal/processors/igfs/IgfsContext.java | 14 +-
.../internal/processors/igfs/IgfsFileImpl.java | 34 +-
.../internal/processors/igfs/IgfsImpl.java | 81 +++-
.../processors/igfs/IgfsInputStreamImpl.java | 2 +-
.../processors/igfs/IgfsMetaManager.java | 95 +++-
.../processors/igfs/IgfsNodePredicate.java | 80 ++++
.../internal/processors/igfs/IgfsProcessor.java | 39 +-
.../internal/processors/igfs/IgfsUtils.java | 55 +++
.../igfs/client/IgfsClientAbstractCallable.java | 125 +++++
.../igfs/client/IgfsClientAffinityCallable.java | 95 ++++
.../igfs/client/IgfsClientDeleteCallable.java | 77 +++
.../igfs/client/IgfsClientExistsCallable.java | 58 +++
.../igfs/client/IgfsClientInfoCallable.java | 59 +++
.../client/IgfsClientListFilesCallable.java | 61 +++
.../client/IgfsClientListPathsCallable.java | 60 +++
.../igfs/client/IgfsClientMkdirsCallable.java | 82 ++++
.../igfs/client/IgfsClientRenameCallable.java | 80 ++++
.../igfs/client/IgfsClientSetTimesCallable.java | 87 ++++
.../igfs/client/IgfsClientSizeCallable.java | 59 +++
.../igfs/client/IgfsClientSummaryCallable.java | 59 +++
.../igfs/client/IgfsClientUpdateCallable.java | 81 ++++
.../meta/IgfsClientMetaIdsForPathCallable.java | 65 +++
.../meta/IgfsClientMetaInfoForPathCallable.java | 63 +++
.../apache/ignite/internal/util/ClassCache.java | 32 ++
.../ignite/internal/util/IgniteUtils.java | 46 +-
...ityFunctionBackupFilterAbstractSelfTest.java | 131 +++++-
...airAffinityFunctionBackupFilterSelfTest.java | 9 +
...ousAffinityFunctionBackupFilterSelfTest.java | 9 +
.../cache/GridCacheStoreValueBytesSelfTest.java | 2 +-
.../processors/cache/GridCacheTestEntryEx.java | 2 +-
.../cache/IgniteCachePeekModesAbstractTest.java | 8 +-
.../IgniteTxExceptionAbstractSelfTest.java | 1 +
.../GridCacheBinaryObjectsAbstractSelfTest.java | 78 ++-
...CacheKeepBinaryIterationNearEnabledTest.java | 44 ++
...acheKeepBinaryIterationStoreEnabledTest.java | 90 ++++
...CacheKeepBinaryIterationSwapEnabledTest.java | 56 +++
.../CacheKeepBinaryIterationTest.java | 471 +++++++++++++++++++
.../processors/igfs/IgfsAbstractSelfTest.java | 38 +-
.../igfs/IgfsClientCacheSelfTest.java | 139 ------
.../igfs/IgfsDualAsyncClientSelfTest.java | 28 ++
.../igfs/IgfsDualSyncClientSelfTest.java | 28 ++
.../processors/igfs/IgfsOneClientNodeTest.java | 7 +-
.../igfs/IgfsPrimaryClientSelfTest.java | 30 ++
...PrimaryRelaxedConsistencyClientSelfTest.java | 28 ++
.../unsafe/GridOffheapSnapTreeSelfTest.java | 2 +-
.../multijvm/IgniteClusterProcessProxy.java | 5 +
.../ignite/testsuites/IgniteIgfsTestSuite.java | 11 +-
.../hadoop/fs/BasicHadoopFileSystemFactory.java | 56 ++-
.../fs/CachingHadoopFileSystemFactory.java | 7 +-
.../fs/KerberosHadoopFileSystemFactory.java | 4 +-
.../ignite/hadoop/util/BasicUserNameMapper.java | 114 +++++
.../hadoop/util/ChainedUserNameMapper.java | 94 ++++
.../hadoop/util/KerberosUserNameMapper.java | 137 ++++++
.../ignite/hadoop/util/UserNameMapper.java | 37 ++
.../apache/ignite/hadoop/util/package-info.java | 22 +
.../processors/hadoop/HadoopClassLoader.java | 23 +-
.../shuffle/collections/HadoopMultimapBase.java | 90 +++-
.../util/BasicUserNameMapperSelfTest.java | 116 +++++
.../util/ChainedUserNameMapperSelfTest.java | 107 +++++
.../util/KerberosUserNameMapperSelfTest.java | 99 ++++
.../ignite/igfs/Hadoop1DualAbstractTest.java | 48 +-
.../testsuites/IgniteHadoopTestSuite.java | 8 +
.../query/h2/opt/GridH2AbstractKeyValueRow.java | 23 +-
.../query/h2/opt/GridH2KeyValueRowOffheap.java | 17 +-
.../cache/IgniteCacheOffheapIndexScanTest.java | 195 ++++++++
.../IgniteCacheQuerySelfTestSuite.java | 2 +
.../IgniteCacheQuerySelfTestSuite3.java | 8 +
modules/platforms/cpp/configure.ac | 2 +-
modules/platforms/cpp/examples/configure.ac | 2 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Apache.Ignite/Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../Properties/AssemblyInfo.cs | 6 +-
.../org/apache/ignite/spark/IgniteRDD.scala | 81 +++-
.../org/apache/ignite/spark/JavaIgniteRDD.scala | 13 +-
.../spark/JavaStandaloneIgniteRDDSelfTest.java | 9 +-
.../ignite/spark/EntityTestAllTypeFields.scala | 7 +-
.../org/apache/ignite/spark/IgniteRDDSpec.scala | 77 ++-
modules/web-agent/pom.xml | 2 +-
modules/web-console/pom.xml | 2 +-
102 files changed, 4338 insertions(+), 374 deletions(-)
----------------------------------------------------------------------
[03/32] ignite git commit: 7.5.24: Added missing JavaDocs.
Posted by sb...@apache.org.
7.5.24: Added missing JavaDocs.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/421cf03b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/421cf03b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/421cf03b
Branch: refs/heads/ignite-3212
Commit: 421cf03b03276d0ab6c32ef6665d547746446dfc
Parents: a815067
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue May 31 10:40:24 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue May 31 11:36:47 2016 +0300
----------------------------------------------------------------------
.../hadoop/util/ChainedUserNameMapperSelfTest.java | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/421cf03b/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/ChainedUserNameMapperSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/ChainedUserNameMapperSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/ChainedUserNameMapperSelfTest.java
index 5bdac8f..bfac49c 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/ChainedUserNameMapperSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/hadoop/util/ChainedUserNameMapperSelfTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.ignite.hadoop.util;
import org.apache.ignite.IgniteException;
[23/32] ignite git commit: IGNITE-3247: IGFS: Optimized non-stream
client operations.
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java
index 4ee0b75..6b83a3e 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/Hadoop1DualAbstractTest.java
@@ -111,7 +111,7 @@ public abstract class Hadoop1DualAbstractTest extends IgfsDualAbstractSelfTest {
* @throws IOException On failure.
*/
protected void startUnderlying() throws Exception {
- startGridWithIgfs(GRID_NAME, IGFS_NAME, PRIMARY, null, SECONDARY_REST_CFG, new TcpDiscoveryVmIpFinder(true));
+ startGridWithIgfs(GRID_NAME, IGFS_NAME, PRIMARY, null, SECONDARY_REST_CFG, secondaryIpFinder);
}
/**
[21/32] ignite git commit: IGFS-3246: IGFS: Infrastructure for client
optimizations.
Posted by sb...@apache.org.
IGFS-3246: IGFS: Infrastructure for client optimizations.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0d623830
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0d623830
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0d623830
Branch: refs/heads/ignite-3212
Commit: 0d623830e0d67be5f0874f704155367d2d9de45b
Parents: 150e0d3
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Sun Jun 5 20:57:15 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Sun Jun 5 21:17:21 2016 +0300
----------------------------------------------------------------------
.../internal/cluster/ClusterGroupAdapter.java | 6 +
.../ignite/internal/cluster/ClusterGroupEx.java | 14 ++-
.../internal/processors/igfs/IgfsContext.java | 14 +--
.../processors/igfs/IgfsMetaManager.java | 62 +++++++++-
.../processors/igfs/IgfsNodePredicate.java | 80 +++++++++++++
.../internal/processors/igfs/IgfsProcessor.java | 39 +++++--
.../internal/processors/igfs/IgfsUtils.java | 21 ++++
.../igfs/client/IgfsClientAbstractCallable.java | 112 +++++++++++++++++++
.../multijvm/IgniteClusterProcessProxy.java | 5 +
9 files changed, 326 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d623830/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
index 75168a1..c664f1e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
@@ -51,6 +51,7 @@ import org.apache.ignite.internal.IgniteServicesImpl;
import org.apache.ignite.internal.IgnitionEx;
import org.apache.ignite.internal.executor.GridExecutorService;
import org.apache.ignite.internal.managers.discovery.GridDiscoveryManager;
+import org.apache.ignite.internal.processors.igfs.IgfsNodePredicate;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.A;
import org.apache.ignite.internal.util.typedef.internal.U;
@@ -602,6 +603,11 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
}
/** {@inheritDoc} */
+ @Override public ClusterGroup forIgfsMetadataDataNodes(@Nullable String igfsName, @Nullable String metaCacheName) {
+ return forPredicate(new IgfsNodePredicate(igfsName)).forDataNodes(metaCacheName);
+ }
+
+ /** {@inheritDoc} */
@Override public final ClusterGroup forHost(ClusterNode node) {
A.notNull(node, "node");
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d623830/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupEx.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupEx.java
index 59da7cf..21533a0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupEx.java
@@ -29,7 +29,7 @@ public interface ClusterGroupEx extends ClusterGroup {
* Creates projection for specified subject ID.
*
* @param subjId Subject ID.
- * @return Internal projection.
+ * @return Cluster group.
*/
public ClusterGroupEx forSubjectId(UUID subjId);
@@ -40,5 +40,15 @@ public interface ClusterGroupEx extends ClusterGroup {
* @param clientNodes Flag to include client nodes.
* @return Cluster group.
*/
- public ClusterGroup forCacheNodes(@Nullable String cacheName, boolean affNodes, boolean nearNodes, boolean clientNodes);
+ public ClusterGroup forCacheNodes(@Nullable String cacheName, boolean affNodes, boolean nearNodes,
+ boolean clientNodes);
+
+ /**
+ * Create projection for IGFS server nodes.
+ *
+ * @param igfsName IGFS name.
+ * @param metaCacheName Metadata cache name.
+ * @return Cluster group.
+ */
+ public ClusterGroup forIgfsMetadataDataNodes(@Nullable String igfsName, @Nullable String metaCacheName);
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d623830/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsContext.java
index 2b08f28..a638bf3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsContext.java
@@ -24,11 +24,8 @@ import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.FileSystemConfiguration;
import org.apache.ignite.internal.GridKernalContext;
-import org.apache.ignite.internal.util.typedef.F;
import org.jetbrains.annotations.Nullable;
-import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_IGFS;
-
/**
* IGFS context holding all required components for IGFS instance.
*/
@@ -178,16 +175,7 @@ public class IgfsContext {
* @return {@code True} if node has IGFS with this name, {@code false} otherwise.
*/
public boolean igfsNode(ClusterNode node) {
- assert node != null;
-
- IgfsAttributes[] igfs = node.attribute(ATTR_IGFS);
-
- if (igfs != null)
- for (IgfsAttributes attrs : igfs)
- if (F.eq(cfg.getName(), attrs.igfsName()))
- return true;
-
- return false;
+ return IgfsUtils.isIgfsNode(node, cfg.getName());
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d623830/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index 73d0887..8569305 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -18,10 +18,13 @@
package org.apache.ignite.internal.processors.igfs;
import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteCompute;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteInterruptedException;
import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.cluster.ClusterGroup;
import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.cluster.ClusterTopologyException;
import org.apache.ignite.configuration.FileSystemConfiguration;
import org.apache.ignite.events.EventType;
import org.apache.ignite.events.IgfsEvent;
@@ -37,6 +40,7 @@ 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.IgniteEx;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager;
@@ -44,6 +48,7 @@ import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.GridCacheInternal;
import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientAbstractCallable;
import org.apache.ignite.internal.processors.igfs.meta.IgfsMetaDirectoryCreateProcessor;
import org.apache.ignite.internal.processors.igfs.meta.IgfsMetaFileCreateProcessor;
import org.apache.ignite.internal.processors.igfs.meta.IgfsMetaFileLockProcessor;
@@ -140,13 +145,21 @@ public class IgfsMetaManager extends IgfsManager {
/** Relaxed flag. */
private final boolean relaxed;
+ /** Client flag. */
+ private final boolean client;
+
+ /** Compute facade for client tasks. */
+ private IgniteCompute cliCompute;
+
/**
* Constructor.
*
* @param relaxed Relaxed mode flag.
+ * @param client Client flag.
*/
- public IgfsMetaManager(boolean relaxed) {
+ public IgfsMetaManager(boolean relaxed, boolean client) {
this.relaxed = relaxed;
+ this.client = client;
}
/**
@@ -218,6 +231,53 @@ public class IgfsMetaManager extends IgfsManager {
}
/**
+ * @return Client flag.
+ */
+ boolean isClient() {
+ return client;
+ }
+
+ /**
+ * Run client task.
+ *
+ * @param task Task.
+ * @return Result.
+ */
+ <T> T runClientTask(IgfsClientAbstractCallable<T> task) {
+ try {
+ return clientCompute().call(task);
+ }
+ catch (ClusterTopologyException e) {
+ throw new IgfsException("Failed to execute operation because there are no IGFS metadata nodes left." , e);
+ }
+ }
+
+ /**
+ * Get compute facade for client tasks.
+ *
+ * @return Compute facade.
+ */
+ private IgniteCompute clientCompute() {
+ assert client;
+
+ IgniteCompute cliCompute0 = cliCompute;
+
+ if (cliCompute0 == null) {
+ IgniteEx ignite = igfsCtx.kernalContext().grid();
+
+ ClusterGroup cluster = ignite.cluster().forIgfsMetadataDataNodes(cfg.getName(), cfg.getMetaCacheName());
+
+ cliCompute0 = ignite.compute(cluster);
+
+ cliCompute = cliCompute0;
+ }
+
+ assert cliCompute0 != null;
+
+ return cliCompute0;
+ }
+
+ /**
* Return nodes where meta cache is defined.
*
* @return Nodes where meta cache is defined.
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d623830/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsNodePredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsNodePredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsNodePredicate.java
new file mode 100644
index 0000000..e3a658a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsNodePredicate.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.internal.processors.igfs;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * IGFS node predicate.
+ */
+public class IgfsNodePredicate implements IgnitePredicate<ClusterNode>, Binarylizable {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** IGFS name. */
+ private String igfsName;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsNodePredicate() {
+ // No-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ */
+ public IgfsNodePredicate(@Nullable String igfsName) {
+ this.igfsName = igfsName;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean apply(ClusterNode node) {
+ return IgfsUtils.isIgfsNode(node, igfsName);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+ BinaryRawWriter rawWriter = writer.rawWriter();
+
+ rawWriter.writeString(igfsName);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+ BinaryRawReader rawReader = reader.rawReader();
+
+ igfsName = rawReader.readString();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsNodePredicate.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d623830/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
index 82404e7..6df9986 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
@@ -94,10 +94,12 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
/** {@inheritDoc} */
@Override public void start() throws IgniteCheckedException {
- if (ctx.config().isDaemon())
+ IgniteConfiguration igniteCfg = ctx.config();
+
+ if (igniteCfg.isDaemon())
return;
- FileSystemConfiguration[] cfgs = ctx.config().getFileSystemConfiguration();
+ FileSystemConfiguration[] cfgs = igniteCfg.getFileSystemConfiguration();
assert cfgs != null && cfgs.length > 0;
@@ -107,10 +109,27 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
for (FileSystemConfiguration cfg : cfgs) {
FileSystemConfiguration cfg0 = new FileSystemConfiguration(cfg);
+ boolean metaClient = true;
+
+ CacheConfiguration[] cacheCfgs = igniteCfg.getCacheConfiguration();
+
+ if (cacheCfgs != null) {
+ for (CacheConfiguration cacheCfg : cacheCfgs) {
+ if (F.eq(cacheCfg.getName(), cfg.getMetaCacheName())) {
+ metaClient = false;
+
+ break;
+ }
+ }
+ }
+
+ if (igniteCfg.isClientMode() != null && igniteCfg.isClientMode())
+ metaClient = true;
+
IgfsContext igfsCtx = new IgfsContext(
ctx,
cfg0,
- new IgfsMetaManager(cfg0.isRelaxedConsistency()),
+ new IgfsMetaManager(cfg0.isRelaxedConsistency(), metaClient),
new IgfsDataManager(),
new IgfsServerManager(),
new IgfsFragmentizerManager());
@@ -125,28 +144,26 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
if (log.isDebugEnabled())
log.debug("IGFS processor started.");
- IgniteConfiguration gridCfg = ctx.config();
-
// Node doesn't have IGFS if it:
// is daemon;
// doesn't have configured IGFS;
// doesn't have configured caches.
- if (gridCfg.isDaemon() || F.isEmpty(gridCfg.getFileSystemConfiguration()) ||
- F.isEmpty(gridCfg.getCacheConfiguration()))
+ if (igniteCfg.isDaemon() || F.isEmpty(igniteCfg.getFileSystemConfiguration()) ||
+ F.isEmpty(igniteCfg.getCacheConfiguration()))
return;
final Map<String, CacheConfiguration> cacheCfgs = new HashMap<>();
- assert gridCfg.getCacheConfiguration() != null;
+ assert igniteCfg.getCacheConfiguration() != null;
- for (CacheConfiguration ccfg : gridCfg.getCacheConfiguration())
+ for (CacheConfiguration ccfg : igniteCfg.getCacheConfiguration())
cacheCfgs.put(ccfg.getName(), ccfg);
Collection<IgfsAttributes> attrVals = new ArrayList<>();
- assert gridCfg.getFileSystemConfiguration() != null;
+ assert igniteCfg.getFileSystemConfiguration() != null;
- for (FileSystemConfiguration igfsCfg : gridCfg.getFileSystemConfiguration()) {
+ for (FileSystemConfiguration igfsCfg : igniteCfg.getFileSystemConfiguration()) {
CacheConfiguration cacheCfg = cacheCfgs.get(igfsCfg.getDataCacheName());
if (cacheCfg == null)
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d623830/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
index 45d4bb6..340fb97 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
@@ -58,6 +58,7 @@ import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_CACHE_RETRIES_COUNT;
+import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_IGFS;
import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
@@ -729,4 +730,24 @@ public class IgfsUtils {
static String composeNameForTrash(IgfsPath path, IgniteUuid id) {
return id.toString() + TRASH_NAME_SEPARATOR + path.toString();
}
+
+ /**
+ * Check whether provided node contains IGFS with the given name.
+ *
+ * @param node Node.
+ * @param igfsName IGFS name.
+ * @return {@code True} if it contains IGFS.
+ */
+ public static boolean isIgfsNode(ClusterNode node, String igfsName) {
+ assert node != null;
+
+ IgfsAttributes[] igfs = node.attribute(ATTR_IGFS);
+
+ if (igfs != null)
+ for (IgfsAttributes attrs : igfs)
+ if (F.eq(igfsName, attrs.igfsName()))
+ return true;
+
+ return false;
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d623830/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
new file mode 100644
index 0000000..b83ed13
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
@@ -0,0 +1,112 @@
+/*
+ * 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.client;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.processors.igfs.IgfsEx;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Abstract callable for IGFS tasks initiated on client node and passed to data node.
+ */
+public abstract class IgfsClientAbstractCallable<T> implements IgniteCallable<T>, Binarylizable {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** IGFS name. */
+ protected String igfsName;
+
+ /** Injected instance. */
+ @IgniteInstanceResource
+ private transient Ignite ignite;
+
+ /**
+ * Default constructor.
+ */
+ protected IgfsClientAbstractCallable() {
+ // No-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ */
+ protected IgfsClientAbstractCallable(@Nullable String igfsName) {
+ this.igfsName = igfsName;
+ }
+
+ /** {@inheritDoc} */
+ @Override public final T call() throws Exception {
+ assert ignite != null;
+
+ IgfsEx igfs = (IgfsEx)ignite.fileSystem(igfsName);
+
+ return call0(igfs.context());
+ }
+
+ /**
+ * Execute task.
+ *
+ * @param ctx IGFS ocntext.
+ * @return Result.
+ * @throws Exception If failed.
+ */
+ protected abstract T call0(IgfsContext ctx) throws Exception;
+
+ /** {@inheritDoc} */
+ @Override public final void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+ BinaryRawWriter rawWriter = writer.rawWriter();
+
+ rawWriter.writeString(igfsName);
+
+ writeBinary0(rawWriter);
+ }
+
+ /** {@inheritDoc} */
+ @Override public final void readBinary(BinaryReader reader) throws BinaryObjectException {
+ BinaryRawReader rawReader = reader.rawReader();
+
+ igfsName = rawReader.readString();
+
+ readBinary0(rawReader);
+ }
+
+ /**
+ * Write binary.
+ *
+ * @param rawWriter Raw writer.
+ */
+ protected abstract void writeBinary0(BinaryRawWriter rawWriter);
+
+ /**
+ * Read binary.
+ *
+ * @param rawReader Raw reader.
+ */
+ protected abstract void readBinary0(BinaryRawReader rawReader);
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/0d623830/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
index 633e9d0..76a88d9 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
@@ -69,6 +69,11 @@ public class IgniteClusterProcessProxy implements IgniteClusterEx {
}
/** {@inheritDoc} */
+ @Override public ClusterGroup forIgfsMetadataDataNodes(@Nullable String igfsName, @Nullable String metaCacheName) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
@Override public ClusterNode localNode() {
return compute.call(new LocalNodeTask());
}
[13/32] ignite git commit: IGNITE-3229: fixing link in Class
GridCacheStoreValueBytesSelfTest. This closes #770.
Posted by sb...@apache.org.
IGNITE-3229: fixing link in Class GridCacheStoreValueBytesSelfTest. This closes #770.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/91862c7c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/91862c7c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/91862c7c
Branch: refs/heads/ignite-3212
Commit: 91862c7c05bd37e287df1b2b6fb00e5cd2cfbb71
Parents: e0cf0fc
Author: MaBiao <ma...@gmail.com>
Authored: Fri Jun 3 11:55:14 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri Jun 3 11:55:14 2016 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheStoreValueBytesSelfTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/91862c7c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreValueBytesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreValueBytesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreValueBytesSelfTest.java
index 35a43b9..919ffad 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreValueBytesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreValueBytesSelfTest.java
@@ -31,7 +31,7 @@ import static org.apache.ignite.cache.CacheMode.REPLICATED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
/**
- * Test for {@link org.apache.ignite.configuration.CacheConfiguration#isStoreValueBytes()}.
+ * Test for {@link CacheConfiguration#isStoreKeepBinary()}.
*/
public class GridCacheStoreValueBytesSelfTest extends GridCommonAbstractTest {
/** */
[24/32] ignite git commit: IGNITE-3247: IGFS: Optimized non-stream
client operations.
Posted by sb...@apache.org.
IGNITE-3247: IGFS: Optimized non-stream client operations.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fdc3aa6e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fdc3aa6e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fdc3aa6e
Branch: refs/heads/ignite-3212
Commit: fdc3aa6e6f1f163351ef1200e18faed7db96d218
Parents: 14c80a1
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Sun Jun 5 21:00:53 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Jun 6 09:47:07 2016 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/igfs/IgfsPath.java | 26 +++-
.../org/apache/ignite/igfs/IgfsPathSummary.java | 32 ++++-
.../processors/igfs/IgfsBlockLocationImpl.java | 87 ++++++++++--
.../internal/processors/igfs/IgfsFileImpl.java | 34 ++++-
.../internal/processors/igfs/IgfsImpl.java | 63 ++++++++-
.../processors/igfs/IgfsMetaManager.java | 2 +-
.../internal/processors/igfs/IgfsUtils.java | 34 +++++
.../igfs/client/IgfsClientAbstractCallable.java | 19 ++-
.../igfs/client/IgfsClientAffinityCallable.java | 95 +++++++++++++
.../igfs/client/IgfsClientDeleteCallable.java | 77 ++++++++++
.../igfs/client/IgfsClientExistsCallable.java | 58 ++++++++
.../igfs/client/IgfsClientInfoCallable.java | 59 ++++++++
.../client/IgfsClientListFilesCallable.java | 61 ++++++++
.../client/IgfsClientListPathsCallable.java | 60 ++++++++
.../igfs/client/IgfsClientMkdirsCallable.java | 82 +++++++++++
.../igfs/client/IgfsClientRenameCallable.java | 80 +++++++++++
.../igfs/client/IgfsClientSetTimesCallable.java | 87 ++++++++++++
.../igfs/client/IgfsClientSizeCallable.java | 59 ++++++++
.../igfs/client/IgfsClientSummaryCallable.java | 59 ++++++++
.../igfs/client/IgfsClientUpdateCallable.java | 81 +++++++++++
.../ignite/internal/util/IgniteUtils.java | 40 ++++++
.../processors/igfs/IgfsAbstractSelfTest.java | 35 ++++-
.../igfs/IgfsClientCacheSelfTest.java | 139 -------------------
.../igfs/IgfsDualAsyncClientSelfTest.java | 28 ++++
.../igfs/IgfsDualSyncClientSelfTest.java | 28 ++++
.../processors/igfs/IgfsOneClientNodeTest.java | 5 +-
.../igfs/IgfsPrimaryClientSelfTest.java | 30 ++++
...PrimaryRelaxedConsistencyClientSelfTest.java | 28 ++++
.../ignite/testsuites/IgniteIgfsTestSuite.java | 11 +-
.../ignite/igfs/Hadoop1DualAbstractTest.java | 2 +-
30 files changed, 1324 insertions(+), 177 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
index f1ceb2e..c705274 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
@@ -268,16 +268,32 @@ public final class IgfsPath implements Comparable<IgfsPath>, Externalizable, Bin
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
- BinaryRawWriter out = writer.rawWriter();
-
- out.writeString(path);
+ writeRawBinary(writer.rawWriter());
}
/** {@inheritDoc} */
@Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
- BinaryRawReader in = reader.rawReader();
+ readRawBinary(reader.rawReader());
+ }
+
+ /**
+ * Write raw binary.
+ *
+ * @param writer Raw writer.
+ * @throws BinaryObjectException If failed.
+ */
+ public void writeRawBinary(BinaryRawWriter writer) throws BinaryObjectException {
+ writer.writeString(path);
+ }
- path = in.readString();
+ /**
+ * Read raw binary.
+ *
+ * @param reader Raw reader.
+ * @throws BinaryObjectException If failed.
+ */
+ public void readRawBinary(BinaryRawReader reader) throws BinaryObjectException {
+ path = reader.readString();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathSummary.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathSummary.java b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathSummary.java
index e84e128..7d60b95 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathSummary.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathSummary.java
@@ -21,12 +21,20 @@ import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.internal.processors.igfs.IgfsUtils;
import org.apache.ignite.internal.util.typedef.internal.S;
/**
* Path summary: total files count, total directories count, total length.
*/
-public class IgfsPathSummary implements Externalizable {
+public class IgfsPathSummary implements Externalizable, Binarylizable {
/** */
private static final long serialVersionUID = 0L;
@@ -134,6 +142,28 @@ public class IgfsPathSummary implements Externalizable {
}
/** {@inheritDoc} */
+ @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+ BinaryRawWriter rawWriter = writer.rawWriter();
+
+ rawWriter.writeInt(filesCnt);
+ rawWriter.writeInt(dirCnt);
+ rawWriter.writeLong(totalLen);
+
+ IgfsUtils.writePath(rawWriter, path);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+ BinaryRawReader rawReader = reader.rawReader();
+
+ filesCnt = rawReader.readInt();
+ dirCnt = rawReader.readInt();
+ totalLen = rawReader.readLong();
+
+ path = IgfsUtils.readPath(rawReader);
+ }
+
+ /** {@inheritDoc} */
@Override public String toString() {
return S.toString(IgfsPathSummary.class, this);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/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 0ec31ba..2d4a0af 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
@@ -27,6 +27,12 @@ import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.UUID;
import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.igfs.IgfsBlockLocation;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
@@ -37,7 +43,7 @@ import org.apache.ignite.internal.util.typedef.internal.U;
/**
* File block location in the grid.
*/
-public class IgfsBlockLocationImpl implements IgfsBlockLocation, Externalizable {
+public class IgfsBlockLocationImpl implements IgfsBlockLocation, Externalizable, Binarylizable {
/** */
private static final long serialVersionUID = 0L;
@@ -155,13 +161,7 @@ public class IgfsBlockLocationImpl implements IgfsBlockLocation, Externalizable
return S.toString(IgfsBlockLocationImpl.class, this);
}
- /**
- * Writes this object to data output. Note that this is not externalizable
- * interface because we want to eliminate any marshaller.
- *
- * @param out Data output to write.
- * @throws IOException If write failed.
- */
+ /** {@inheritDoc} */
@Override public void writeExternal(ObjectOutput out) throws IOException {
assert names != null;
assert hosts != null;
@@ -189,13 +189,7 @@ public class IgfsBlockLocationImpl implements IgfsBlockLocation, Externalizable
out.writeUTF(host);
}
- /**
- * Reads object from data input. Note we do not use externalizable interface
- * to eliminate marshaller.
- *
- * @param in Data input.
- * @throws IOException If read failed.
- */
+ /** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException {
start = in.readLong();
len = in.readLong();
@@ -226,6 +220,69 @@ public class IgfsBlockLocationImpl implements IgfsBlockLocation, Externalizable
hosts.add(in.readUTF());
}
+ /** {@inheritDoc} */
+ @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+ BinaryRawWriter rawWriter = writer.rawWriter();
+
+ assert names != null;
+ assert hosts != null;
+
+ rawWriter.writeLong(start);
+ rawWriter.writeLong(len);
+
+ rawWriter.writeBoolean(nodeIds != null);
+
+ if (nodeIds != null) {
+ rawWriter.writeInt(nodeIds.size());
+
+ for (UUID nodeId : nodeIds)
+ U.writeUuid(rawWriter, nodeId);
+ }
+
+ rawWriter.writeInt(names.size());
+
+ for (String name : names)
+ rawWriter.writeString(name);
+
+ rawWriter.writeInt(hosts.size());
+
+ for (String host : hosts)
+ rawWriter.writeString(host);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+ BinaryRawReader rawReader = reader.rawReader();
+
+ start = rawReader.readLong();
+ len = rawReader.readLong();
+
+ int size;
+
+ if (rawReader.readBoolean()) {
+ size = rawReader.readInt();
+
+ nodeIds = new ArrayList<>(size);
+
+ for (int i = 0; i < size; i++)
+ nodeIds.add(U.readUuid(rawReader));
+ }
+
+ size = rawReader.readInt();
+
+ names = new ArrayList<>(size);
+
+ for (int i = 0; i < size; i++)
+ names.add(rawReader.readString());
+
+ size = rawReader.readInt();
+
+ hosts = new ArrayList<>(size);
+
+ for (int i = 0; i < size; i++)
+ hosts.add(rawReader.readString());
+ }
+
/**
* Converts collection of rich nodes to block location data.
*
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileImpl.java
index be8d0fc..9f79f42 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileImpl.java
@@ -17,6 +17,12 @@
package org.apache.ignite.internal.processors.igfs;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
import org.apache.ignite.igfs.IgfsFile;
import org.apache.ignite.igfs.IgfsPath;
import org.apache.ignite.internal.util.typedef.internal.A;
@@ -35,7 +41,7 @@ import java.util.Map;
/**
* File or directory information.
*/
-public final class IgfsFileImpl implements IgfsFile, Externalizable {
+public final class IgfsFileImpl implements IgfsFile, Externalizable, Binarylizable {
/** */
private static final long serialVersionUID = 0L;
@@ -229,6 +235,32 @@ public final class IgfsFileImpl implements IgfsFile, Externalizable {
}
/** {@inheritDoc} */
+ @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+ BinaryRawWriter rawWriter = writer.rawWriter();
+
+ IgfsUtils.writePath(rawWriter, path);
+ rawWriter.writeInt(blockSize);
+ rawWriter.writeLong(grpBlockSize);
+ rawWriter.writeLong(len);
+ IgfsUtils.writeProperties(rawWriter, props);
+ rawWriter.writeLong(accessTime);
+ rawWriter.writeLong(modificationTime);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+ BinaryRawReader rawReader = reader.rawReader();
+
+ path = IgfsUtils.readPath(rawReader);
+ blockSize = rawReader.readInt();
+ grpBlockSize = rawReader.readLong();
+ len = rawReader.readLong();
+ props = IgfsUtils.readProperties(rawReader);
+ accessTime = rawReader.readLong();
+ modificationTime = rawReader.readLong();
+ }
+
+ /** {@inheritDoc} */
@Override public int hashCode() {
return path.hashCode();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/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 e9ddf89..d9e4ba4 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
@@ -55,6 +55,18 @@ import org.apache.ignite.internal.managers.communication.GridMessageListener;
import org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager;
import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
import org.apache.ignite.internal.processors.hadoop.HadoopPayloadAware;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientAffinityCallable;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientDeleteCallable;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientExistsCallable;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientInfoCallable;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientListFilesCallable;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientListPathsCallable;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientMkdirsCallable;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientRenameCallable;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientSetTimesCallable;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientSizeCallable;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientSummaryCallable;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientUpdateCallable;
import org.apache.ignite.internal.processors.task.GridInternal;
import org.apache.ignite.internal.util.GridSpinBusyLock;
import org.apache.ignite.internal.util.future.GridCompoundFuture;
@@ -530,6 +542,9 @@ public final class IgfsImpl implements IgfsEx {
@Override public boolean exists(final IgfsPath path) {
A.notNull(path, "path");
+ if (meta.isClient())
+ return meta.runClientTask(new IgfsClientExistsCallable(cfg.getName(), path));
+
return safeOp(new Callable<Boolean>() {
@Override public Boolean call() throws Exception {
if (log.isDebugEnabled())
@@ -575,6 +590,9 @@ public final class IgfsImpl implements IgfsEx {
@Override @Nullable public IgfsFile info(final IgfsPath path) {
A.notNull(path, "path");
+ if (meta.isClient())
+ return meta.runClientTask(new IgfsClientInfoCallable(cfg.getName(), path));
+
return safeOp(new Callable<IgfsFile>() {
@Override public IgfsFile call() throws Exception {
if (log.isDebugEnabled())
@@ -591,6 +609,9 @@ public final class IgfsImpl implements IgfsEx {
@Override public IgfsPathSummary summary(final IgfsPath path) {
A.notNull(path, "path");
+ if (meta.isClient())
+ return meta.runClientTask(new IgfsClientSummaryCallable(cfg.getName(), path));
+
return safeOp(new Callable<IgfsPathSummary>() {
@Override public IgfsPathSummary call() throws Exception {
if (log.isDebugEnabled())
@@ -616,6 +637,9 @@ public final class IgfsImpl implements IgfsEx {
A.notNull(props, "props");
A.ensure(!props.isEmpty(), "!props.isEmpty()");
+ if (meta.isClient())
+ return meta.runClientTask(new IgfsClientUpdateCallable(cfg.getName(), path, props));
+
return safeOp(new Callable<IgfsFile>() {
@Override public IgfsFile call() throws Exception {
if (log.isDebugEnabled())
@@ -662,6 +686,12 @@ public final class IgfsImpl implements IgfsEx {
A.notNull(src, "src");
A.notNull(dest, "dest");
+ if (meta.isClient()) {
+ meta.runClientTask(new IgfsClientRenameCallable(cfg.getName(), src, dest));
+
+ return;
+ }
+
safeOp(new Callable<Void>() {
@Override public Void call() throws Exception {
if (log.isDebugEnabled())
@@ -708,6 +738,9 @@ public final class IgfsImpl implements IgfsEx {
@Override public boolean delete(final IgfsPath path, final boolean recursive) {
A.notNull(path, "path");
+ if (meta.isClient())
+ return meta.runClientTask(new IgfsClientDeleteCallable(cfg.getName(), path, recursive));
+
return safeOp(new Callable<Boolean>() {
@Override public Boolean call() throws Exception {
if (log.isDebugEnabled())
@@ -761,6 +794,12 @@ public final class IgfsImpl implements IgfsEx {
@Override public void mkdirs(final IgfsPath path, @Nullable final Map<String, String> props) {
A.notNull(path, "path");
+ if (meta.isClient()) {
+ meta.runClientTask(new IgfsClientMkdirsCallable(cfg.getName(), path, props));
+
+ return ;
+ }
+
safeOp(new Callable<Void>() {
@Override public Void call() throws Exception {
if (log.isDebugEnabled())
@@ -790,6 +829,9 @@ public final class IgfsImpl implements IgfsEx {
@Override public Collection<IgfsPath> listPaths(final IgfsPath path) {
A.notNull(path, "path");
+ if (meta.isClient())
+ meta.runClientTask(new IgfsClientListPathsCallable(cfg.getName(), path));
+
return safeOp(new Callable<Collection<IgfsPath>>() {
@Override public Collection<IgfsPath> call() throws Exception {
if (log.isDebugEnabled())
@@ -840,6 +882,9 @@ public final class IgfsImpl implements IgfsEx {
@Override public Collection<IgfsFile> listFiles(final IgfsPath path) {
A.notNull(path, "path");
+ if (meta.isClient())
+ meta.runClientTask(new IgfsClientListFilesCallable(cfg.getName(), path));
+
return safeOp(new Callable<Collection<IgfsFile>>() {
@Override public Collection<IgfsFile> call() throws Exception {
if (log.isDebugEnabled())
@@ -1146,11 +1191,17 @@ public final class IgfsImpl implements IgfsEx {
@Override public void setTimes(final IgfsPath path, final long accessTime, final long modificationTime) {
A.notNull(path, "path");
+ if (accessTime == -1 && modificationTime == -1)
+ return;
+
+ if (meta.isClient()) {
+ meta.runClientTask(new IgfsClientSetTimesCallable(cfg.getName(), path, accessTime, modificationTime));
+
+ return;
+ }
+
safeOp(new Callable<Void>() {
@Override public Void call() throws Exception {
- if (accessTime == -1 && modificationTime == -1)
- return null;
-
FileDescriptor desc = getFileDescriptor(path);
if (desc == null) {
@@ -1197,6 +1248,9 @@ public final class IgfsImpl implements IgfsEx {
A.ensure(start >= 0, "start >= 0");
A.ensure(len >= 0, "len >= 0");
+ if (meta.isClient())
+ return meta.runClientTask(new IgfsClientAffinityCallable(cfg.getName(), path, start, len, maxLen));
+
return safeOp(new Callable<Collection<IgfsBlockLocation>>() {
@Override public Collection<IgfsBlockLocation> call() throws Exception {
if (log.isDebugEnabled())
@@ -1278,6 +1332,9 @@ public final class IgfsImpl implements IgfsEx {
@Override public long size(final IgfsPath path) {
A.notNull(path, "path");
+ if (meta.isClient())
+ return meta.runClientTask(new IgfsClientSizeCallable(cfg.getName(), path));
+
return safeOp(new Callable<Long>() {
@Override public Long call() throws Exception {
IgniteUuid nextId = meta.fileId(path);
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index 8569305..d46a381 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -248,7 +248,7 @@ public class IgfsMetaManager extends IgfsManager {
return clientCompute().call(task);
}
catch (ClusterTopologyException e) {
- throw new IgfsException("Failed to execute operation because there are no IGFS metadata nodes left." , e);
+ throw new IgfsException("Failed to execute operation because there are no IGFS metadata nodes." , e);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
index 340fb97..d7aae5c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
@@ -702,6 +702,40 @@ public class IgfsUtils {
}
/**
+ * Write IGFS path.
+ *
+ * @param writer Writer.
+ * @param path Path.
+ */
+ public static void writePath(BinaryRawWriter writer, @Nullable IgfsPath path) {
+ if (path != null) {
+ writer.writeBoolean(true);
+
+ path.writeRawBinary(writer);
+ }
+ else
+ writer.writeBoolean(false);
+ }
+
+ /**
+ * Read IGFS path.
+ *
+ * @param reader Reader.
+ * @return Path.
+ */
+ @Nullable public static IgfsPath readPath(BinaryRawReader reader) {
+ if (reader.readBoolean()) {
+ IgfsPath path = new IgfsPath();
+
+ path.readRawBinary(reader);
+
+ return path;
+ }
+ else
+ return null;
+ }
+
+ /**
* Parses the TRASH file name to extract the original path.
*
* @param name The TRASH short (entry) name.
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
index b83ed13..d9c3456 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAbstractCallable.java
@@ -24,8 +24,10 @@ import org.apache.ignite.binary.BinaryRawWriter;
import org.apache.ignite.binary.BinaryReader;
import org.apache.ignite.binary.BinaryWriter;
import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.igfs.IgfsPath;
import org.apache.ignite.internal.processors.igfs.IgfsContext;
import org.apache.ignite.internal.processors.igfs.IgfsEx;
+import org.apache.ignite.internal.processors.igfs.IgfsUtils;
import org.apache.ignite.lang.IgniteCallable;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.jetbrains.annotations.Nullable;
@@ -40,6 +42,9 @@ public abstract class IgfsClientAbstractCallable<T> implements IgniteCallable<T>
/** IGFS name. */
protected String igfsName;
+ /** Path for operation. */
+ protected IgfsPath path;
+
/** Injected instance. */
@IgniteInstanceResource
private transient Ignite ignite;
@@ -55,9 +60,11 @@ public abstract class IgfsClientAbstractCallable<T> implements IgniteCallable<T>
* Constructor.
*
* @param igfsName IGFS name.
+ * @param path Path.
*/
- protected IgfsClientAbstractCallable(@Nullable String igfsName) {
+ protected IgfsClientAbstractCallable(@Nullable String igfsName, @Nullable IgfsPath path) {
this.igfsName = igfsName;
+ this.path = path;
}
/** {@inheritDoc} */
@@ -83,6 +90,7 @@ public abstract class IgfsClientAbstractCallable<T> implements IgniteCallable<T>
BinaryRawWriter rawWriter = writer.rawWriter();
rawWriter.writeString(igfsName);
+ IgfsUtils.writePath(rawWriter, path);
writeBinary0(rawWriter);
}
@@ -92,6 +100,7 @@ public abstract class IgfsClientAbstractCallable<T> implements IgniteCallable<T>
BinaryRawReader rawReader = reader.rawReader();
igfsName = rawReader.readString();
+ path = IgfsUtils.readPath(rawReader);
readBinary0(rawReader);
}
@@ -101,12 +110,16 @@ public abstract class IgfsClientAbstractCallable<T> implements IgniteCallable<T>
*
* @param rawWriter Raw writer.
*/
- protected abstract void writeBinary0(BinaryRawWriter rawWriter);
+ protected void writeBinary0(BinaryRawWriter rawWriter) {
+ // No-op.
+ }
/**
* Read binary.
*
* @param rawReader Raw reader.
*/
- protected abstract void readBinary0(BinaryRawReader rawReader);
+ protected void readBinary0(BinaryRawReader rawReader) {
+ // No-op.
+ }
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAffinityCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAffinityCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAffinityCallable.java
new file mode 100644
index 0000000..1668f36
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientAffinityCallable.java
@@ -0,0 +1,95 @@
+/*
+ * 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.client;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.igfs.IgfsBlockLocation;
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collection;
+
+/**
+ * IGFS client affinity callable.
+ */
+public class IgfsClientAffinityCallable extends IgfsClientAbstractCallable<Collection<IgfsBlockLocation>> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Start. */
+ private long start;
+
+ /** Length. */
+ private long len;
+
+ /** Maximum length. */
+ private long maxLen;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsClientAffinityCallable() {
+ // NO-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ * @param path Path.
+ * @param start Start.
+ * @param len Length.
+ * @param maxLen Maximum length.
+ */
+ public IgfsClientAffinityCallable(@Nullable String igfsName, IgfsPath path, long start, long len, long maxLen) {
+ super(igfsName, path);
+
+ this.start = start;
+ this.len = len;
+ this.maxLen = maxLen;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected Collection<IgfsBlockLocation> call0(IgfsContext ctx) throws Exception {
+ return ctx.igfs().affinity(path, start, len, maxLen);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeBinary0(BinaryRawWriter writer) throws BinaryObjectException {
+ writer.writeLong(start);
+ writer.writeLong(len);
+ writer.writeLong(maxLen);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readBinary0(BinaryRawReader reader) throws BinaryObjectException {
+ start = reader.readLong();
+ len = reader.readLong();
+ maxLen = reader.readLong();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsClientAffinityCallable.class, this);
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientDeleteCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientDeleteCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientDeleteCallable.java
new file mode 100644
index 0000000..c1b8be8
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientDeleteCallable.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.igfs.client;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * IGFS client delete callable.
+ */
+public class IgfsClientDeleteCallable extends IgfsClientAbstractCallable<Boolean> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Recursion flag. */
+ private boolean recursive;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsClientDeleteCallable() {
+ // NO-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ * @param path Path.
+ * @param recursive Recursive flag.
+ */
+ public IgfsClientDeleteCallable(@Nullable String igfsName, IgfsPath path, boolean recursive) {
+ super(igfsName, path);
+
+ this.recursive = recursive;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected Boolean call0(IgfsContext ctx) throws Exception {
+ return ctx.igfs().delete(path, recursive);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeBinary0(BinaryRawWriter writer) throws BinaryObjectException {
+ writer.writeBoolean(recursive);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readBinary0(BinaryRawReader reader) throws BinaryObjectException {
+ recursive = reader.readBoolean();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsClientDeleteCallable.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientExistsCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientExistsCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientExistsCallable.java
new file mode 100644
index 0000000..04b63d8
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientExistsCallable.java
@@ -0,0 +1,58 @@
+/*
+ * 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.client;
+
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * IGFS client exists callable.
+ */
+public class IgfsClientExistsCallable extends IgfsClientAbstractCallable<Boolean> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsClientExistsCallable() {
+ // NO-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ * @param path Path.
+ */
+ public IgfsClientExistsCallable(@Nullable String igfsName, IgfsPath path) {
+ super(igfsName, path);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected Boolean call0(IgfsContext ctx) throws Exception {
+ return ctx.igfs().exists(path);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsClientExistsCallable.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientInfoCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientInfoCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientInfoCallable.java
new file mode 100644
index 0000000..f97c3c4
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientInfoCallable.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.igfs.client;
+
+import org.apache.ignite.igfs.IgfsFile;
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * IGFS client info callable.
+ */
+public class IgfsClientInfoCallable extends IgfsClientAbstractCallable<IgfsFile> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsClientInfoCallable() {
+ // NO-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ * @param path Path.
+ */
+ public IgfsClientInfoCallable(@Nullable String igfsName, IgfsPath path) {
+ super(igfsName, path);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgfsFile call0(IgfsContext ctx) throws Exception {
+ return ctx.igfs().info(path);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsClientInfoCallable.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListFilesCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListFilesCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListFilesCallable.java
new file mode 100644
index 0000000..325e714
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListFilesCallable.java
@@ -0,0 +1,61 @@
+/*
+ * 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.client;
+
+import org.apache.ignite.igfs.IgfsFile;
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collection;
+
+/**
+ * IGFS client list files callable.
+ */
+public class IgfsClientListFilesCallable extends IgfsClientAbstractCallable<Collection<IgfsFile>> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsClientListFilesCallable() {
+ // NO-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ * @param path Path.
+ */
+ public IgfsClientListFilesCallable(@Nullable String igfsName, IgfsPath path) {
+ super(igfsName, path);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected Collection<IgfsFile> call0(IgfsContext ctx) throws Exception {
+ return ctx.igfs().listFiles(path);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsClientListFilesCallable.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListPathsCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListPathsCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListPathsCallable.java
new file mode 100644
index 0000000..78b4c84
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientListPathsCallable.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.igfs.client;
+
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collection;
+
+/**
+ * IGFS client list paths callable.
+ */
+public class IgfsClientListPathsCallable extends IgfsClientAbstractCallable<Collection<IgfsPath>> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsClientListPathsCallable() {
+ // NO-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ * @param path Path.
+ */
+ public IgfsClientListPathsCallable(@Nullable String igfsName, IgfsPath path) {
+ super(igfsName, path);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected Collection<IgfsPath> call0(IgfsContext ctx) throws Exception {
+ return ctx.igfs().listPaths(path);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsClientListPathsCallable.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientMkdirsCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientMkdirsCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientMkdirsCallable.java
new file mode 100644
index 0000000..944da6f
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientMkdirsCallable.java
@@ -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.
+ */
+
+package org.apache.ignite.internal.processors.igfs.client;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.processors.igfs.IgfsUtils;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+
+/**
+ * IGFS client mkdirs callable.
+ */
+public class IgfsClientMkdirsCallable extends IgfsClientAbstractCallable<Void> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Properties. */
+ private Map<String, String> props;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsClientMkdirsCallable() {
+ // NO-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ * @param path Path.
+ * @param props Properties.
+ */
+ public IgfsClientMkdirsCallable(@Nullable String igfsName, IgfsPath path, @Nullable Map<String, String> props) {
+ super(igfsName, path);
+
+ this.props = props;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected Void call0(IgfsContext ctx) throws Exception {
+ ctx.igfs().mkdirs(path, props);
+
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeBinary0(BinaryRawWriter writer) throws BinaryObjectException {
+ IgfsUtils.writeProperties(writer, props);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readBinary0(BinaryRawReader reader) throws BinaryObjectException {
+ props = IgfsUtils.readProperties(reader);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsClientMkdirsCallable.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientRenameCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientRenameCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientRenameCallable.java
new file mode 100644
index 0000000..55afb83
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientRenameCallable.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.internal.processors.igfs.client;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.processors.igfs.IgfsUtils;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * IGFS client rename callable.
+ */
+public class IgfsClientRenameCallable extends IgfsClientAbstractCallable<Void> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Destination path. */
+ private IgfsPath destPath;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsClientRenameCallable() {
+ // NO-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ * @param srcPath Source path.
+ * @param destPath Destination path.
+ */
+ public IgfsClientRenameCallable(@Nullable String igfsName, IgfsPath srcPath, IgfsPath destPath) {
+ super(igfsName, srcPath);
+
+ this.destPath = destPath;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected Void call0(IgfsContext ctx) throws Exception {
+ ctx.igfs().rename(path, destPath);
+
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeBinary0(BinaryRawWriter writer) throws BinaryObjectException {
+ IgfsUtils.writePath(writer, destPath);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readBinary0(BinaryRawReader reader) throws BinaryObjectException {
+ destPath = IgfsUtils.readPath(reader);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsClientRenameCallable.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSetTimesCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSetTimesCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSetTimesCallable.java
new file mode 100644
index 0000000..277effc
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSetTimesCallable.java
@@ -0,0 +1,87 @@
+/*
+ * 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.client;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * IGFS client set times callable.
+ */
+public class IgfsClientSetTimesCallable extends IgfsClientAbstractCallable<Void> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Access time. */
+ private long accessTime;
+
+ /** Modification time. */
+ private long modificationTime;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsClientSetTimesCallable() {
+ // NO-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ * @param path Path.
+ * @param accessTime Access time.
+ * @param modificationTime Modification time.
+ */
+ public IgfsClientSetTimesCallable(@Nullable String igfsName, IgfsPath path, long accessTime,
+ long modificationTime) {
+ super(igfsName, path);
+
+ this.accessTime = accessTime;
+ this.modificationTime = modificationTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected Void call0(IgfsContext ctx) throws Exception {
+ ctx.igfs().setTimes(path, accessTime, modificationTime);
+
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeBinary0(BinaryRawWriter writer) throws BinaryObjectException {
+ writer.writeLong(accessTime);
+ writer.writeLong(modificationTime);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readBinary0(BinaryRawReader reader) throws BinaryObjectException {
+ accessTime = reader.readLong();
+ modificationTime = reader.readLong();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsClientSetTimesCallable.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSizeCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSizeCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSizeCallable.java
new file mode 100644
index 0000000..474a940
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSizeCallable.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.igfs.client;
+
+import org.apache.ignite.igfs.IgfsFile;
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * IGFS client size callable.
+ */
+public class IgfsClientSizeCallable extends IgfsClientAbstractCallable<Long> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsClientSizeCallable() {
+ // NO-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ * @param path Path.
+ */
+ public IgfsClientSizeCallable(@Nullable String igfsName, IgfsPath path) {
+ super(igfsName, path);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected Long call0(IgfsContext ctx) throws Exception {
+ return ctx.igfs().size(path);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsClientSizeCallable.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSummaryCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSummaryCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSummaryCallable.java
new file mode 100644
index 0000000..7e29029
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientSummaryCallable.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.igfs.client;
+
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.igfs.IgfsPathSummary;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * IGFS client summary callable.
+ */
+public class IgfsClientSummaryCallable extends IgfsClientAbstractCallable<IgfsPathSummary> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsClientSummaryCallable() {
+ // NO-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ * @param path Path.
+ */
+ public IgfsClientSummaryCallable(@Nullable String igfsName, IgfsPath path) {
+ super(igfsName, path);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgfsPathSummary call0(IgfsContext ctx) throws Exception {
+ return ctx.igfs().summary(path);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsClientSummaryCallable.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientUpdateCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientUpdateCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientUpdateCallable.java
new file mode 100644
index 0000000..4acf4eb
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/IgfsClientUpdateCallable.java
@@ -0,0 +1,81 @@
+/*
+ * 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.client;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.igfs.IgfsFile;
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.processors.igfs.IgfsUtils;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+
+/**
+ * IGFS client update callable.
+ */
+public class IgfsClientUpdateCallable extends IgfsClientAbstractCallable<IgfsFile> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Properties. */
+ private Map<String, String> props;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsClientUpdateCallable() {
+ // NO-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ * @param path Path.
+ * @param props Properties.
+ */
+ public IgfsClientUpdateCallable(@Nullable String igfsName, IgfsPath path, @Nullable Map<String, String> props) {
+ super(igfsName, path);
+
+ this.props = props;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgfsFile call0(IgfsContext ctx) throws Exception {
+ return ctx.igfs().update(path, props);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeBinary0(BinaryRawWriter writer) throws BinaryObjectException {
+ IgfsUtils.writeProperties(writer, props);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readBinary0(BinaryRawReader reader) throws BinaryObjectException {
+ props = IgfsUtils.readProperties(reader);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsClientUpdateCallable.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index cbefd7d..1147124 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -149,6 +149,8 @@ import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteInterruptedException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.IgniteSystemProperties;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
import org.apache.ignite.cluster.ClusterGroupEmptyException;
import org.apache.ignite.cluster.ClusterMetrics;
import org.apache.ignite.cluster.ClusterNode;
@@ -4723,6 +4725,44 @@ public abstract class IgniteUtils {
}
/**
+ * Writes UUID to binary writer.
+ *
+ * @param out Output Binary writer.
+ * @param uid UUID to write.
+ * @throws IOException If write failed.
+ */
+ public static void writeUuid(BinaryRawWriter out, UUID uid) {
+ // Write null flag.
+ if (uid != null) {
+ out.writeBoolean(true);
+
+ out.writeLong(uid.getMostSignificantBits());
+ out.writeLong(uid.getLeastSignificantBits());
+ }
+ else
+ out.writeBoolean(false);
+ }
+
+ /**
+ * Reads UUID from binary reader.
+ *
+ * @param in Binary reader.
+ * @return Read UUID.
+ * @throws IOException If read failed.
+ */
+ @Nullable public static UUID readUuid(BinaryRawReader in) {
+ // If UUID is not null.
+ if (in.readBoolean()) {
+ long most = in.readLong();
+ long least = in.readLong();
+
+ return new UUID(most, least);
+ }
+ else
+ return null;
+ }
+
+ /**
* Writes {@link org.apache.ignite.lang.IgniteUuid} to output stream. This method is meant to be used by
* implementations of {@link Externalizable} interface.
*
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/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 d67092f..48d6d98 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
@@ -21,6 +21,7 @@ import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteFileSystem;
+import org.apache.ignite.Ignition;
import org.apache.ignite.cache.CacheMemoryMode;
import org.apache.ignite.cache.CachePeekMode;
import org.apache.ignite.cache.CacheWriteSynchronizationMode;
@@ -190,6 +191,12 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
/** Memory mode. */
protected final CacheMemoryMode memoryMode;
+ /** IP finder for primary topology. */
+ protected final TcpDiscoveryVmIpFinder primaryIpFinder = new TcpDiscoveryVmIpFinder(true);
+
+ /** IP finder for secondary topology. */
+ protected final TcpDiscoveryVmIpFinder secondaryIpFinder = new TcpDiscoveryVmIpFinder(true);
+
/** Ignite nodes of cluster, excluding the secondary file system node, if any. */
protected Ignite[] nodes;
@@ -237,6 +244,13 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
}
/**
+ * @return Client flag.
+ */
+ protected boolean client() {
+ return false;
+ }
+
+ /**
* @return Use optimized marshaller flag.
*/
protected boolean useOptimizedMarshaller() {
@@ -269,8 +283,6 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
@Override protected void beforeTestsStarted() throws Exception {
igfsSecondaryFileSystem = createSecondaryFileSystemStack();
- TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
nodes = new Ignite[nodeCount()];
for (int i = 0; i < nodes.length; i++) {
@@ -280,6 +292,21 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
}
igfs = (IgfsImpl) nodes[0].fileSystem("igfs");
+
+ if (client()) {
+ // Start client.
+ Ignition.setClientMode(true);
+
+ try {
+ Ignite ignite = startGridWithIgfs("ignite-client", "igfs", mode, igfsSecondaryFileSystem,
+ PRIMARY_REST_CFG, primaryIpFinder);
+
+ igfs = (IgfsImpl) ignite.fileSystem("igfs");
+ }
+ finally {
+ Ignition.setClientMode(false);
+ }
+ }
}
/**
@@ -290,7 +317,7 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
*/
protected IgfsSecondaryFileSystem createSecondaryFileSystemStack() throws Exception {
Ignite igniteSecondary = startGridWithIgfs("ignite-secondary", "igfs-secondary", PRIMARY, null,
- SECONDARY_REST_CFG, new TcpDiscoveryVmIpFinder(true));
+ SECONDARY_REST_CFG, secondaryIpFinder);
IgfsEx secondaryIgfsImpl = (IgfsEx) igniteSecondary.fileSystem("igfs-secondary");
@@ -343,6 +370,7 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
dataCacheCfg.setName("dataCache");
+ dataCacheCfg.setNearConfiguration(null);
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setNearConfiguration(null);
dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
@@ -355,6 +383,7 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
metaCacheCfg.setName("metaCache");
+ metaCacheCfg.setNearConfiguration(null);
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsClientCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsClientCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsClientCacheSelfTest.java
deleted file mode 100644
index 8e8eac1..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsClientCacheSelfTest.java
+++ /dev/null
@@ -1,139 +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.Ignite;
-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.IgfsGroupDataBlocksKeyMapper;
-import org.apache.ignite.igfs.IgfsMode;
-import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
-import org.apache.ignite.internal.util.typedef.G;
-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 static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheMode.PARTITIONED;
-import static org.apache.ignite.cache.CacheMode.REPLICATED;
-
-/**
- * Test for igfs with nodes in client mode (see {@link IgniteConfiguration#setClientMode(boolean)}.
- */
-public class IgfsClientCacheSelfTest extends IgfsAbstractSelfTest {
- /** */
- private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
- /** Meta-information cache name. */
- private static final String META_CACHE_NAME = "meta";
-
- /** Data cache name. */
- private static final String DATA_CACHE_NAME = null;
-
- /**
- * Constructor.
- */
- public IgfsClientCacheSelfTest() {
- super(IgfsMode.PRIMARY);
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- igfsSecondaryFileSystem = createSecondaryFileSystemStack();
-
- Ignite ignitePrimary = G.start(getConfiguration(getTestGridName(1)));
-
- igfs = (IgfsImpl) ignitePrimary.fileSystem("igfs");
- }
-
- /**{@inheritDoc} */
- protected IgfsSecondaryFileSystem createSecondaryFileSystemStack() throws Exception {
- Ignite igniteSecondary = G.start(getConfiguration(getTestGridName(0)));
-
- IgfsEx secondaryIgfsImpl = (IgfsEx)igniteSecondary.fileSystem("igfs");
-
- igfsSecondary = new IgfsExUniversalFileSystemAdapter(secondaryIgfsImpl);
-
- return secondaryIgfsImpl.asSecondary();
- }
-
- /**
- *
- * @param gridName Grid name.
- * @return Ignite configuration.
- * @throws Exception If failed.
- */
- protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(gridName);
-
- cfg.setCacheConfiguration(
- cacheConfiguration(META_CACHE_NAME),
- cacheConfiguration(DATA_CACHE_NAME)
- );
-
- TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
- disco.setIpFinder(IP_FINDER);
-
- if (!gridName.equals(getTestGridName(0))) {
- cfg.setClientMode(true);
-
- disco.setForceServerMode(true);
- }
-
- cfg.setDiscoverySpi(disco);
-
- FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
-
- igfsCfg.setMetaCacheName(META_CACHE_NAME);
- igfsCfg.setDataCacheName(DATA_CACHE_NAME);
- igfsCfg.setName("igfs");
-
- cfg.setFileSystemConfiguration(igfsCfg);
-
- return cfg;
- }
-
- /**
- * @param cacheName Cache name.
- * @return Cache configuration.
- */
- protected CacheConfiguration cacheConfiguration(String cacheName) {
- CacheConfiguration<?,?> cacheCfg = defaultCacheConfiguration();
-
- cacheCfg.setName(cacheName);
-
- cacheCfg.setNearConfiguration(null);
-
- if (META_CACHE_NAME.equals(cacheName))
- cacheCfg.setCacheMode(REPLICATED);
- else {
- cacheCfg.setCacheMode(PARTITIONED);
-
- cacheCfg.setBackups(0);
- cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
- }
-
- cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
- cacheCfg.setAtomicityMode(TRANSACTIONAL);
-
- return cacheCfg;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAsyncClientSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAsyncClientSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAsyncClientSelfTest.java
new file mode 100644
index 0000000..e453346
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAsyncClientSelfTest.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.processors.igfs;
+
+/**
+ * Tests for DUAL_ASYNC mode and client cache.
+ */
+public class IgfsDualAsyncClientSelfTest extends IgfsDualAsyncSelfTest {
+ /** {@inheritDoc} */
+ @Override protected boolean client() {
+ return true;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualSyncClientSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualSyncClientSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualSyncClientSelfTest.java
new file mode 100644
index 0000000..bb3da32
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualSyncClientSelfTest.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.processors.igfs;
+
+/**
+ * Tests for DUAL_SYNC mode and client cache.
+ */
+public class IgfsDualSyncClientSelfTest extends IgfsDualSyncSelfTest {
+ /** {@inheritDoc} */
+ @Override protected boolean client() {
+ return true;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
index 25d75a2..3bfd372 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
@@ -101,7 +101,6 @@ public class IgfsOneClientNodeTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testStartIgfs() throws Exception {
-
final IgfsImpl igfs = (IgfsImpl) grid(0).fileSystem("igfs");
GridTestUtils.assertThrows(log, new Callable<Object>() {
@@ -109,7 +108,7 @@ public class IgfsOneClientNodeTest extends GridCommonAbstractTest {
IgfsAbstractSelfTest.create(igfs, new IgfsPath[]{new IgfsPath("/dir")}, null);
return null;
}
- }, IgfsException.class, "Cache server nodes not found.");
+ }, IgfsException.class, "Failed to execute operation because there are no IGFS metadata nodes.");
GridTestUtils.assertThrows(log, new Callable<Object>() {
@Override public Object call() throws Exception {
@@ -119,7 +118,7 @@ public class IgfsOneClientNodeTest extends GridCommonAbstractTest {
return null;
}
- }, IgfsException.class, "Cache server nodes not found.");
+ }, IgfsException.class, "Failed to execute operation because there are no IGFS metadata nodes.");
GridTestUtils.assertThrows(log, new Callable<Object>() {
@Override public Object call() throws Exception {
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryClientSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryClientSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryClientSelfTest.java
new file mode 100644
index 0000000..12fd93c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryClientSelfTest.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.igfs;
+
+import org.apache.ignite.configuration.IgniteConfiguration;
+
+/**
+ * Test for IGFS with nodes in client mode (see {@link IgniteConfiguration#setClientMode(boolean)}.
+ */
+public class IgfsPrimaryClientSelfTest extends IgfsPrimarySelfTest {
+ /** {@inheritDoc} */
+ @Override protected boolean client() {
+ return true;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedConsistencyClientSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedConsistencyClientSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedConsistencyClientSelfTest.java
new file mode 100644
index 0000000..54c742d
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsPrimaryRelaxedConsistencyClientSelfTest.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.processors.igfs;
+
+/**
+ * Tests for PRIMARY mode and relaxed consistency model with client cache.
+ */
+public class IgfsPrimaryRelaxedConsistencyClientSelfTest extends IgfsPrimaryRelaxedConsistencySelfTest {
+ /** {@inheritDoc} */
+ @Override protected boolean client() {
+ return true;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/fdc3aa6e/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 0047edb..3e80614 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
@@ -27,7 +27,9 @@ import org.apache.ignite.internal.processors.igfs.IgfsBackupsPrimarySelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsBlockMessageSystemPoolStarvationSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsCachePerBlockLruEvictionPolicySelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsCacheSelfTest;
-import org.apache.ignite.internal.processors.igfs.IgfsClientCacheSelfTest;
+import org.apache.ignite.internal.processors.igfs.IgfsDualAsyncClientSelfTest;
+import org.apache.ignite.internal.processors.igfs.IgfsDualSyncClientSelfTest;
+import org.apache.ignite.internal.processors.igfs.IgfsPrimaryClientSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsDataManagerSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsDualAsyncSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsDualSyncSelfTest;
@@ -43,6 +45,7 @@ import org.apache.ignite.internal.processors.igfs.IgfsOneClientNodeTest;
import org.apache.ignite.internal.processors.igfs.IgfsPrimaryOffheapTieredSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsPrimaryOffheapValuesSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsPrimaryOptimziedMarshallerSelfTest;
+import org.apache.ignite.internal.processors.igfs.IgfsPrimaryRelaxedClientSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsPrimaryRelaxedConsistencyMultiNodeSelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsPrimaryRelaxedConsistencySelfTest;
import org.apache.ignite.internal.processors.igfs.IgfsPrimarySelfTest;
@@ -103,7 +106,11 @@ public class IgniteIgfsTestSuite extends TestSuite {
suite.addTest(new TestSuite(IgfsModesSelfTest.class));
suite.addTest(new TestSuite(IgfsMetricsSelfTest.class));
- suite.addTest(new TestSuite(IgfsClientCacheSelfTest.class));
+ suite.addTest(new TestSuite(IgfsPrimaryClientSelfTest.class));
+ suite.addTest(new TestSuite(IgfsPrimaryRelaxedClientSelfTest.class));
+ suite.addTest(new TestSuite(IgfsDualSyncClientSelfTest.class));
+ suite.addTest(new TestSuite(IgfsDualAsyncClientSelfTest.class));
+
suite.addTest(new TestSuite(IgfsOneClientNodeTest.class));
suite.addTest(new TestSuite(IgfsModeResolverSelfTest.class));
[07/32] ignite git commit: IGNITE-2655: AffinityFunction: primary and
backup copies in different locations Reviewed and merged by Denis Magda
(dmagda@gridgain.com)
Posted by sb...@apache.org.
IGNITE-2655: AffinityFunction: primary and backup copies in different locations
Reviewed and merged by Denis Magda (dmagda@gridgain.com)
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f175d3c6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f175d3c6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f175d3c6
Branch: refs/heads/ignite-3212
Commit: f175d3c670025bd619ec347dba2a5c5f68f4cc32
Parents: 3ca9feb
Author: Vladislav Pyatkov <vl...@gmail.com>
Authored: Thu Jun 2 16:14:10 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu Jun 2 16:14:10 2016 +0300
----------------------------------------------------------------------
.../affinity/fair/FairAffinityFunction.java | 81 +++++++++++-
.../rendezvous/RendezvousAffinityFunction.java | 39 +++++-
...ityFunctionBackupFilterAbstractSelfTest.java | 131 ++++++++++++++++++-
...airAffinityFunctionBackupFilterSelfTest.java | 9 ++
...ousAffinityFunctionBackupFilterSelfTest.java | 9 ++
5 files changed, 260 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f175d3c6/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java
index b42b683..b6b14ec 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java
@@ -102,6 +102,9 @@ public class FairAffinityFunction implements AffinityFunction {
/** Optional backup filter. First node is primary, second node is a node being tested. */
private IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter;
+ /** Optional affinity backups filter. The first node is a node being tested, the second is a list of nodes that are already assigned for a given partition (primary node is the first in the list). */
+ private IgniteBiPredicate<ClusterNode, List<ClusterNode>> affinityBackupFilter;
+
/**
* Empty constructor with all defaults.
*/
@@ -220,12 +223,40 @@ public class FairAffinityFunction implements AffinityFunction {
* Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
*
* @param backupFilter Optional backup filter.
+ * @deprecated Use {@code affinityBackupFilter} instead.
*/
+ @Deprecated
public void setBackupFilter(@Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
this.backupFilter = backupFilter;
}
/**
+ * Gets optional backup filter. If not {@code null}, backups will be selected
+ * from all nodes that pass this filter. First node passed to this filter is a node being tested,
+ * and the second parameter is a list of nodes that are already assigned for a given partition (primary node is the first in the list).
+ * <p>
+ * Note that {@code affinityBackupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @return Optional backup filter.
+ */
+ @Nullable public IgniteBiPredicate<ClusterNode, List<ClusterNode>> getAffinityBackupFilter() {
+ return affinityBackupFilter;
+ }
+
+ /**
+ * Sets optional backup filter. If provided, then backups will be selected from all
+ * nodes that pass this filter. First node being passed to this filter is a node being tested,
+ * and the second parameter is a list of nodes that are already assigned for a given partition (primary node is the first in the list).
+ * <p>
+ * Note that {@code affinityBackupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @param affinityBackupFilter Optional backup filter.
+ */
+ public void setAffinityBackupFilter(@Nullable IgniteBiPredicate<ClusterNode, List<ClusterNode>> affinityBackupFilter) {
+ this.affinityBackupFilter = affinityBackupFilter;
+ }
+
+ /**
* Checks flag to exclude same-host-neighbors from being backups of each other (default is {@code false}).
* <p>
* Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
@@ -865,6 +896,7 @@ public class FairAffinityFunction implements AffinityFunction {
* @param tier Tier.
* @param node Node.
* @param allowNeighbors Allow neighbors.
+ * @return {@code true} if the partition is assignable to the node.
*/
private boolean isAssignable(int part, int tier, final ClusterNode node, boolean allowNeighbors) {
if (containsPartition(part, node))
@@ -872,9 +904,50 @@ public class FairAffinityFunction implements AffinityFunction {
if (exclNeighbors)
return allowNeighbors || !neighborsContainPartition(node, part);
- else if (backupFilter == null)
- return true;
- else {
+ else if (affinityBackupFilter != null) {
+ List<ClusterNode> assigment = assignments.get(part);
+
+ assert assigment.size() > 0;
+
+ List<ClusterNode> newAssignment;
+
+ if (tier == 0) {
+ for (int t = 1; t < assigment.size(); t++) {
+ newAssignment = new ArrayList<>(assigment.size() - 1);
+
+ newAssignment.add(node);
+
+ if (t != 1)
+ newAssignment.addAll(assigment.subList(1, t));
+
+ if (t + 1 < assigment.size())
+ newAssignment.addAll(assigment.subList(t + 1, assigment.size()));
+
+ if (!affinityBackupFilter.apply(assigment.get(t), newAssignment))
+ return false;
+
+ }
+
+ return true;
+ }
+ else if (tier < assigment.size()) {
+ newAssignment = new ArrayList<>(assigment.size() - 1);
+
+ int i = 0;
+
+ for (ClusterNode assignmentNode: assigment) {
+ if (i != tier)
+ newAssignment.add(assignmentNode);
+
+ i++;
+ }
+ }
+ else
+ newAssignment = assigment;
+
+ return affinityBackupFilter.apply(node, newAssignment);
+ }
+ else if (backupFilter != null) {
if (tier == 0) {
List<ClusterNode> assigment = assignments.get(part);
@@ -891,6 +964,8 @@ public class FairAffinityFunction implements AffinityFunction {
else
return (backupFilter.apply(assignments.get(part).get(0), node));
}
+ else
+ return true;
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/f175d3c6/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
index 37258d4..990eba1 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
@@ -111,6 +111,11 @@ public class RendezvousAffinityFunction implements AffinityFunction, Externaliza
/** Optional backup filter. First node is primary, second node is a node being tested. */
private IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter;
+ /** Optional affinity backups filter. The first node is a node being tested,
+ * the second is a list of nodes that are already assigned for a given partition (the first node in the list
+ * is primary). */
+ private IgniteBiPredicate<ClusterNode, List<ClusterNode>> affinityBackupFilter;
+
/** Hash ID resolver. */
private AffinityNodeHashResolver hashIdRslvr = null;
@@ -277,12 +282,40 @@ public class RendezvousAffinityFunction implements AffinityFunction, Externaliza
* Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
*
* @param backupFilter Optional backup filter.
+ * @deprecated Use {@code affinityBackupFilter} instead.
*/
+ @Deprecated
public void setBackupFilter(@Nullable IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter) {
this.backupFilter = backupFilter;
}
/**
+ * Gets optional backup filter. If not {@code null}, backups will be selected
+ * from all nodes that pass this filter. First node passed to this filter is a node being tested,
+ * and the second parameter is a list of nodes that are already assigned for a given partition (primary node is the first in the list).
+ * <p>
+ * Note that {@code affinityBackupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @return Optional backup filter.
+ */
+ @Nullable public IgniteBiPredicate<ClusterNode, List<ClusterNode>> getAffinityBackupFilter() {
+ return affinityBackupFilter;
+ }
+
+ /**
+ * Sets optional backup filter. If provided, then backups will be selected from all
+ * nodes that pass this filter. First node being passed to this filter is a node being tested,
+ * and the second parameter is a list of nodes that are already assigned for a given partition (primary node is the first in the list).
+ * <p>
+ * Note that {@code affinityBackupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
+ *
+ * @param affinityBackupFilter Optional backup filter.
+ */
+ public void setAffinityBackupFilter(@Nullable IgniteBiPredicate<ClusterNode, List<ClusterNode>> affinityBackupFilter) {
+ this.affinityBackupFilter = affinityBackupFilter;
+ }
+
+ /**
* Checks flag to exclude same-host-neighbors from being backups of each other (default is {@code false}).
* <p>
* Note that {@code backupFilter} is ignored if {@code excludeNeighbors} is set to {@code true}.
@@ -384,7 +417,11 @@ public class RendezvousAffinityFunction implements AffinityFunction, Externaliza
if (!allNeighbors.contains(node))
res.add(node);
}
- else if (backupFilter == null || backupFilter.apply(primary, node))
+ else if (affinityBackupFilter != null && affinityBackupFilter.apply(node, res))
+ res.add(next.get2());
+ else if (backupFilter != null && backupFilter.apply(primary, node))
+ res.add(next.get2());
+ else if (affinityBackupFilter == null && backupFilter == null)
res.add(next.get2());
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/f175d3c6/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java
index 3bf41c1..f01f5d9 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java
@@ -18,6 +18,10 @@
package org.apache.ignite.cache.affinity;
import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.CacheWriteSynchronizationMode;
import org.apache.ignite.cluster.ClusterNode;
@@ -29,6 +33,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.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
@@ -41,15 +46,18 @@ public abstract class AffinityFunctionBackupFilterAbstractSelfTest extends GridC
/** Ip finder. */
private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
- /** Backup count. */
- private static final int BACKUPS = 1;
-
/** Split attribute name. */
private static final String SPLIT_ATTRIBUTE_NAME = "split-attribute";
/** Split attribute value. */
private String splitAttrVal;
+ /** Attribute value for first node group. */
+ public static final String FIRST_NODE_GROUP = "A";
+
+ /** Backup count. */
+ private int backups = 1;
+
/** Test backup filter. */
protected static final IgniteBiPredicate<ClusterNode, ClusterNode> backupFilter =
new IgniteBiPredicate<ClusterNode, ClusterNode>() {
@@ -61,13 +69,63 @@ public abstract class AffinityFunctionBackupFilterAbstractSelfTest extends GridC
}
};
+ /** Test backup filter. */
+ protected static final IgniteBiPredicate<ClusterNode, List<ClusterNode>> affinityBackupFilter =
+ new IgniteBiPredicate<ClusterNode, List<ClusterNode>>() {
+ @Override public boolean apply(ClusterNode node, List<ClusterNode> assigned) {
+ assert node != null : "primary is null";
+ assert assigned != null : "backup is null";
+
+ Map<String, Integer> backupAssignedAttribute = getAttributeStatistic(assigned);
+
+ String nodeAttributeValue = node.attribute(SPLIT_ATTRIBUTE_NAME);
+
+ if (FIRST_NODE_GROUP.equals(nodeAttributeValue)
+ && backupAssignedAttribute.get(FIRST_NODE_GROUP) < 2)
+ return true;
+
+ return backupAssignedAttribute.get(nodeAttributeValue).equals(0);
+ }
+ };
+
+ /**
+ * @param nodes List of cluster nodes.
+ * @return Statistic.
+ */
+ @NotNull private static Map<String, Integer> getAttributeStatistic(Collection<ClusterNode> nodes) {
+ Map<String, Integer> backupAssignedAttribute = new HashMap<>();
+
+ backupAssignedAttribute.put(FIRST_NODE_GROUP, 0);
+
+ backupAssignedAttribute.put("B", 0);
+
+ backupAssignedAttribute.put("C", 0);
+
+ for (ClusterNode assignedNode: nodes) {
+ if (assignedNode == null)
+ continue;
+
+ String val = assignedNode.attribute(SPLIT_ATTRIBUTE_NAME);
+
+ Integer count = backupAssignedAttribute.get(val);
+
+ backupAssignedAttribute.put(val, count + 1);
+ }
+ return backupAssignedAttribute;
+ }
+
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(PARTITIONED);
- cacheCfg.setBackups(BACKUPS);
- cacheCfg.setAffinity(affinityFunction());
+ cacheCfg.setBackups(backups);
+
+ if (backups < 2)
+ cacheCfg.setAffinity(affinityFunction());
+ else
+ cacheCfg.setAffinity(affinityFunctionWithAffinityBackupFilter());
+
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cacheCfg.setRebalanceMode(SYNC);
cacheCfg.setAtomicityMode(TRANSACTIONAL);
@@ -90,9 +148,15 @@ public abstract class AffinityFunctionBackupFilterAbstractSelfTest extends GridC
protected abstract AffinityFunction affinityFunction();
/**
+ * @return Affinity function for test.
+ */
+ protected abstract AffinityFunction affinityFunctionWithAffinityBackupFilter();
+
+ /**
* @throws Exception If failed.
*/
public void testPartitionDistribution() throws Exception {
+ backups = 1;
try {
for (int i = 0; i < 3; i++) {
splitAttrVal = "A";
@@ -135,4 +199,61 @@ public abstract class AffinityFunctionBackupFilterAbstractSelfTest extends GridC
assertFalse(F.eq(primary.attribute(SPLIT_ATTRIBUTE_NAME), backup.attribute(SPLIT_ATTRIBUTE_NAME)));
}
}
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testPartitionDistributionWithAffinityBackupFilter() throws Exception {
+ backups = 3;
+ try {
+ for (int i = 0; i < 2; i++) {
+ splitAttrVal = FIRST_NODE_GROUP;
+
+ startGrid(4 * i);
+
+ startGrid(4 * i + 3);
+
+ splitAttrVal = "B";
+
+ startGrid(4 * i + 1);
+
+ splitAttrVal = "C";
+
+ startGrid(4 * i + 2);
+
+ awaitPartitionMapExchange();
+
+ checkPartitionsWithAffinityBackupFilter();
+ }
+ }
+ finally {
+ stopAllGrids();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ @SuppressWarnings("ConstantConditions")
+ private void checkPartitionsWithAffinityBackupFilter() throws Exception {
+ AffinityFunction aff = cacheConfiguration(grid(0).configuration(), null).getAffinity();
+
+ int partCnt = aff.partitions();
+
+ IgniteCache<Object, Object> cache = grid(0).cache(null);
+
+ for (int i = 0; i < partCnt; i++) {
+ Collection<ClusterNode> nodes = affinity(cache).mapKeyToPrimaryAndBackups(i);
+
+ assertEquals(backups + 1, nodes.size());
+
+ Map<String, Integer> stat = getAttributeStatistic(nodes);
+
+ assertEquals(stat.get(FIRST_NODE_GROUP), new Integer(2));
+
+ assertEquals(stat.get("B"), new Integer(1));
+
+ assertEquals(stat.get("C"), new Integer(1));
+ }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/f175d3c6/modules/core/src/test/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunctionBackupFilterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunctionBackupFilterSelfTest.java b/modules/core/src/test/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunctionBackupFilterSelfTest.java
index eedc9e4..7fddf30 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunctionBackupFilterSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunctionBackupFilterSelfTest.java
@@ -32,4 +32,13 @@ public class FairAffinityFunctionBackupFilterSelfTest extends AffinityFunctionBa
return aff;
}
+
+ /** {@inheritDoc} */
+ @Override protected AffinityFunction affinityFunctionWithAffinityBackupFilter() {
+ FairAffinityFunction aff = new FairAffinityFunction(false);
+
+ aff.setAffinityBackupFilter(affinityBackupFilter);
+
+ return aff;
+ }
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/f175d3c6/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionBackupFilterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionBackupFilterSelfTest.java b/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionBackupFilterSelfTest.java
index d5d8b8f..a78c383 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionBackupFilterSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunctionBackupFilterSelfTest.java
@@ -32,4 +32,13 @@ public class RendezvousAffinityFunctionBackupFilterSelfTest extends AffinityFunc
return aff;
}
+
+ /** {@inheritDoc} */
+ @Override protected AffinityFunction affinityFunctionWithAffinityBackupFilter() {
+ RendezvousAffinityFunction aff = new RendezvousAffinityFunction(false);
+
+ aff.setAffinityBackupFilter(affinityBackupFilter);
+
+ return aff;
+ }
}
[09/32] ignite git commit: IGNITE-3183 ScanQuery and localEntries are
ignored keepBinary flag in OFFHEAP_TIERED mode
Posted by sb...@apache.org.
IGNITE-3183 ScanQuery and localEntries are ignored keepBinary flag in OFFHEAP_TIERED mode
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1da14369
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1da14369
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1da14369
Branch: refs/heads/ignite-3212
Commit: 1da14369c886ed12dbe0fc9b2c4d5a568c76b6b2
Parents: f175d3c
Author: Anton Vinogradov <av...@apache.org>
Authored: Thu Jun 2 17:02:09 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Thu Jun 2 17:02:09 2016 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheAdapter.java | 43 +-
.../processors/cache/GridCacheContext.java | 7 +-
.../processors/cache/GridCacheEntryEx.java | 3 +-
.../cache/GridCacheEvictionManager.java | 2 +-
.../processors/cache/GridCacheMapEntry.java | 4 +-
.../processors/cache/GridCacheSwapManager.java | 67 ++-
.../distributed/dht/GridDhtCacheAdapter.java | 11 +-
.../cache/query/GridCacheQueryManager.java | 9 +-
.../processors/cache/GridCacheTestEntryEx.java | 2 +-
.../cache/IgniteCachePeekModesAbstractTest.java | 8 +-
...CacheKeepBinaryIterationNearEnabledTest.java | 44 ++
...acheKeepBinaryIterationStoreEnabledTest.java | 90 ++++
...CacheKeepBinaryIterationSwapEnabledTest.java | 56 +++
.../CacheKeepBinaryIterationTest.java | 471 +++++++++++++++++++
.../IgniteCacheQuerySelfTestSuite3.java | 8 +
15 files changed, 762 insertions(+), 63 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 3a72ba2..0b3b2da 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -707,12 +707,14 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
Collection<Iterator<Cache.Entry<K, V>>> its = new ArrayList<>();
+ final boolean keepBinary = ctx.keepBinary();
+
if (ctx.isLocal()) {
modes.primary = true;
modes.backup = true;
if (modes.heap)
- its.add(iterator(map.entries().iterator(), !ctx.keepBinary()));
+ its.add(iterator(map.entries().iterator(), !keepBinary));
}
else if (modes.heap) {
if (modes.near && ctx.isNear())
@@ -721,7 +723,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
if (modes.primary || modes.backup) {
GridDhtCacheAdapter<K, V> cache = ctx.isNear() ? ctx.near().dht() : ctx.dht();
- its.add(cache.localEntriesIterator(modes.primary, modes.backup));
+ its.add(cache.localEntriesIterator(modes.primary, modes.backup, keepBinary));
}
}
@@ -732,10 +734,10 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
GridCacheSwapManager swapMgr = ctx.isNear() ? ctx.near().dht().context().swap() : ctx.swap();
if (modes.swap)
- its.add(swapMgr.<K, V>swapIterator(modes.primary, modes.backup, topVer));
+ its.add(swapMgr.<K, V>swapIterator(modes.primary, modes.backup, topVer, keepBinary));
if (modes.offheap)
- its.add(swapMgr.<K, V>offheapIterator(modes.primary, modes.backup, topVer));
+ its.add(swapMgr.<K, V>offheapIterator(modes.primary, modes.backup, topVer, keepBinary));
}
final Iterator<Cache.Entry<K, V>> it = F.flatIterators(its);
@@ -1002,7 +1004,9 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/** {@inheritDoc} */
@Override public Set<Cache.Entry<K, V>> entrySetx(final CacheEntryPredicate... filter) {
- return new EntrySet(map.entrySet(filter));
+ boolean keepBinary = ctx.keepBinary();
+
+ return new EntrySet(map.entrySet(filter), keepBinary);
}
/** {@inheritDoc} */
@@ -3806,7 +3810,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
Iterator<Cache.Entry<K, V>> it;
try {
- it = ctx.swap().offheapIterator(true, true, ctx.affinity().affinityTopologyVersion());
+ it = ctx.swap().offheapIterator(true, true, ctx.affinity().affinityTopologyVersion(), ctx.keepBinary());
}
catch (IgniteCheckedException e) {
throw CU.convertToCacheException(e);
@@ -3817,7 +3821,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
else
entry = map.randomEntry();
- return entry == null || entry.obsolete() ? null : entry.<K, V>wrapLazyValue();
+ return entry == null || entry.obsolete() ? null : entry.<K, V>wrapLazyValue(ctx.keepBinary());
}
/** {@inheritDoc} */
@@ -4672,13 +4676,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/**
- * @return Primary entry set.
- */
- public Set<Cache.Entry<K, V>> primaryEntrySet() {
- return new EntrySet(map.entrySet(CU.cachePrimary(ctx.grid().affinity(ctx.name()), ctx.localNode())));
- }
-
- /**
* @param key Key.
* @param deserializeBinary Deserialize binary flag.
* @param needVer Need version.
@@ -6689,12 +6686,16 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/** Current entry. */
private GridCacheMapEntry current;
+ /** Keep binary flag. */
+ private final boolean keepBinary;
+
/**
* Constructor.
* @param internalIterator Internal iterator.
*/
- private EntryIterator(Iterator<GridCacheMapEntry> internalIterator) {
+ private EntryIterator(Iterator<GridCacheMapEntry> internalIterator, boolean keepBinary) {
this.internalIterator = internalIterator;
+ this.keepBinary = keepBinary;
}
/** {@inheritDoc} */
@@ -6706,7 +6707,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
@Override public Cache.Entry<K, V> next() {
current = internalIterator.next();
- return current.wrapLazyValue();
+ return current.wrapLazyValue(keepBinary);
}
/** {@inheritDoc} */
@@ -6715,7 +6716,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
throw new IllegalStateException();
try {
- GridCacheAdapter.this.getAndRemove((K)current.wrapLazyValue().getKey());
+ GridCacheAdapter.this.getAndRemove((K)current.wrapLazyValue(keepBinary).getKey());
}
catch (IgniteCheckedException e) {
throw new IgniteException(e);
@@ -6733,14 +6734,18 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/** Internal set. */
private final Set<GridCacheMapEntry> internalSet;
+ /** Keep binary flag. */
+ private final boolean keepBinary;
+
/** Constructor. */
- private EntrySet(Set<GridCacheMapEntry> internalSet) {
+ private EntrySet(Set<GridCacheMapEntry> internalSet, boolean keepBinary) {
this.internalSet = internalSet;
+ this.keepBinary = keepBinary;
}
/** {@inheritDoc} */
@Override public Iterator<Cache.Entry<K, V>> iterator() {
- return new EntryIterator(internalSet.iterator());
+ return new EntryIterator(internalSet.iterator(), keepBinary);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index 7ad6c77..36d9104 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -1155,7 +1155,7 @@ public class GridCacheContext<K, V> implements Externalizable {
GridCacheEntryEx e,
@Nullable IgnitePredicate<Cache.Entry<K1, V1>>[] p
) throws IgniteCheckedException {
- return F.isEmpty(p) || isAll(e.<K1, V1>wrapLazyValue(), p);
+ return F.isEmpty(p) || isAll(e.<K1, V1>wrapLazyValue(keepBinary()), p);
}
/**
@@ -1687,14 +1687,15 @@ public class GridCacheContext<K, V> implements Externalizable {
* @return {@code True} if OFFHEAP_TIERED memory mode is enabled.
*/
public boolean offheapTiered() {
- return cacheCfg.getMemoryMode() == OFFHEAP_TIERED && isOffHeapEnabled();
+ return cacheCfg != null && cacheCfg.getMemoryMode() == OFFHEAP_TIERED && isOffHeapEnabled();
}
/**
* @return {@code True} if should use entry with offheap value pointer.
*/
public boolean useOffheapEntry() {
- return cacheCfg.getMemoryMode() == OFFHEAP_TIERED || cacheCfg.getMemoryMode() == OFFHEAP_VALUES;
+ return cacheCfg != null &&
+ (cacheCfg.getMemoryMode() == OFFHEAP_TIERED || cacheCfg.getMemoryMode() == OFFHEAP_VALUES);
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
index da9108c..646e6bc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
@@ -146,10 +146,11 @@ public interface GridCacheEntryEx {
/**
* Wraps entry to an entry with lazy value get.
+ * @param keepBinary Keep binary flag.
*
* @return Entry.
*/
- public <K, V> Cache.Entry<K, V> wrapLazyValue();
+ public <K, V> Cache.Entry<K, V> wrapLazyValue(boolean keepBinary);
/**
* Peeks value provided to public API entries and to entry filters.
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index c102c58..134e743 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -1389,7 +1389,7 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
if (log.isDebugEnabled())
log.debug("Notifying eviction policy with entry: " + e);
- if (filter == null || filter.evictAllowed(e.wrapLazyValue()))
+ if (filter == null || filter.evictAllowed(e.wrapLazyValue(cctx.keepBinary())))
plc.onEntryAccessed(e.obsoleteOrDeleted(), e.wrapEviction());
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index ee615b8..12bd556 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -4096,10 +4096,10 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
}
/** {@inheritDoc} */
- @Override public <K, V> Cache.Entry<K, V> wrapLazyValue() {
+ @Override public <K, V> Cache.Entry<K, V> wrapLazyValue(boolean keepBinary) {
CacheOperationContext opCtx = cctx.operationContextPerCall();
- return new LazyValueEntry<>(key, opCtx != null && opCtx.isKeepBinary());
+ return new LazyValueEntry<>(key, keepBinary);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
index 30159fa..cc3261c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
@@ -1607,14 +1607,15 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
}
/**
+ * @param keepBinary Keep binary flag.
* @return Lazy swap iterator.
* @throws IgniteCheckedException If failed.
*/
- public <K, V> Iterator<Map.Entry<K, V>> lazySwapIterator() throws IgniteCheckedException {
+ public <K, V> Iterator<Map.Entry<K, V>> lazySwapIterator(boolean keepBinary) throws IgniteCheckedException {
if (!swapEnabled)
return new GridEmptyIterator<>();
- return lazyIterator(cctx.gridSwap().rawIterator(spaceName));
+ return lazyIterator(cctx.gridSwap().rawIterator(spaceName), keepBinary);
}
/**
@@ -1667,13 +1668,14 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
}
/**
+ * @param keepBinary Keep binary flag.
* @return Lazy off-heap iterator.
*/
- public <K, V> Iterator<Map.Entry<K, V>> lazyOffHeapIterator() {
+ public <K, V> Iterator<Map.Entry<K, V>> lazyOffHeapIterator(boolean keepBinary) {
if (!offheapEnabled)
return new GridEmptyCloseableIterator<>();
- return lazyIterator(offheap.iterator(spaceName));
+ return lazyIterator(offheap.iterator(spaceName), keepBinary);
}
/**
@@ -1698,10 +1700,11 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
* Gets lazy iterator for which key and value are lazily deserialized.
*
* @param it Closeable iterator.
+ * @param keepBinary Keep binary.
* @return Lazy iterator.
*/
private <K, V> Iterator<Map.Entry<K, V>> lazyIterator(
- final GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> it) {
+ final GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> it, final boolean keepBinary) {
if (it == null)
return new GridEmptyIterator<>();
@@ -1714,7 +1717,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
@Override protected Map.Entry<K, V> onNext() {
final Map.Entry<byte[], byte[]> cur0 = it.next();
- cur = new GridVersionedMapEntry<K, V>(cur0);
+ cur = new GridVersionedMapEntry<K, V>(cur0, keepBinary);
return cur;
}
@@ -2043,11 +2046,14 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
* @param primary If {@code true} includes primary entries.
* @param backup If {@code true} includes backup entries.
* @param topVer Topology version.
+ * @param keepBinary Keep binary flag.
* @return Swap entries iterator.
* @throws IgniteCheckedException If failed.
*/
- public <K, V> Iterator<Cache.Entry<K, V>> swapIterator(boolean primary, boolean backup, AffinityTopologyVersion topVer)
- throws IgniteCheckedException
+ public <K, V> Iterator<Cache.Entry<K, V>> swapIterator(boolean primary,
+ boolean backup,
+ AffinityTopologyVersion topVer,
+ boolean keepBinary) throws IgniteCheckedException
{
assert primary || backup;
@@ -2055,12 +2061,12 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
return new GridEmptyIterator<>();
if (primary && backup)
- return cacheEntryIterator(this.<K, V>lazySwapIterator());
+ return cacheEntryIterator(this.<K, V>lazySwapIterator(keepBinary));
Set<Integer> parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), topVer) :
cctx.affinity().backupPartitions(cctx.localNodeId(), topVer);
- return new PartitionsIterator<K, V>(parts) {
+ return new PartitionsIterator<K, V>(parts, keepBinary) {
@Override protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> nextPartition(int part)
throws IgniteCheckedException
{
@@ -2073,12 +2079,14 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
* @param primary If {@code true} includes primary entries.
* @param backup If {@code true} includes backup entries.
* @param topVer Topology version.
+ * @param keepBinary Keep binary flag.
* @return Offheap entries iterator.
* @throws IgniteCheckedException If failed.
*/
public <K, V> Iterator<Cache.Entry<K, V>> offheapIterator(boolean primary,
boolean backup,
- AffinityTopologyVersion topVer)
+ AffinityTopologyVersion topVer,
+ boolean keepBinary)
throws IgniteCheckedException
{
assert primary || backup;
@@ -2087,12 +2095,12 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
return new GridEmptyIterator<>();
if (primary && backup)
- return cacheEntryIterator(this.<K, V>lazyOffHeapIterator());
+ return cacheEntryIterator(this.<K, V>lazyOffHeapIterator(keepBinary));
Set<Integer> parts = primary ? cctx.affinity().primaryPartitions(cctx.localNodeId(), topVer) :
cctx.affinity().backupPartitions(cctx.localNodeId(), topVer);
- return new PartitionsIterator<K, V>(parts) {
+ return new PartitionsIterator<K, V>(parts, keepBinary) {
@Override protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>> nextPartition(int part) {
return offheap.iterator(spaceName, part);
}
@@ -2314,17 +2322,25 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
*
*/
private abstract class PartitionsIterator<K, V> extends PartitionsAbstractIterator<Cache.Entry<K, V>> {
+ /** */
+ private final boolean keepBinary;
+
/**
* @param parts Partitions
+ * @param keepBinary Keep binary flag.
*/
- public PartitionsIterator(Collection<Integer> parts) {
+ public PartitionsIterator(Collection<Integer> parts, boolean keepBinary) {
super(parts);
+
+ this.keepBinary = keepBinary;
+
+ advance();
}
/** {@inheritDoc} */
@Override protected Iterator<Cache.Entry<K, V>> partitionIterator(int part)
throws IgniteCheckedException {
- return cacheEntryIterator(GridCacheSwapManager.this.<K, V>lazyIterator(nextPartition(part)));
+ return cacheEntryIterator(GridCacheSwapManager.this.<K, V>lazyIterator(nextPartition(part), keepBinary));
}
/**
@@ -2350,12 +2366,10 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
private T next;
/**
- * @param parts Partitions
+ * @param parts Partitions.
*/
public PartitionsAbstractIterator(Collection<Integer> parts) {
this.partIt = parts.iterator();
-
- advance();
}
/** {@inheritDoc} */
@@ -2383,7 +2397,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
/**
* Switches to next element.
*/
- private void advance() {
+ protected final void advance() {
next = null;
do {
@@ -2527,23 +2541,26 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
*/
private class GridVersionedMapEntry<K,V> implements Map.Entry<K,V>, GridCacheVersionAware {
/** */
- private Map.Entry<byte[], byte[]> entry;
+ final private Map.Entry<byte[], byte[]> entry;
+
+ /** */
+ final private boolean keepBinary;
/**
* Constructor.
*
* @param entry Entry.
+ * @param keepBinary Keep binary.
*/
- public GridVersionedMapEntry(Map.Entry<byte[], byte[]> entry) {
+ public GridVersionedMapEntry(Map.Entry<byte[], byte[]> entry, boolean keepBinary) {
this.entry = entry;
+ this.keepBinary = keepBinary;
}
/** {@inheritDoc} */
@Override public K getKey() {
try {
- KeyCacheObject key = cctx.toCacheKeyObject(entry.getKey());
-
- return key.value(cctx.cacheObjectContext(), false);
+ return (K)cctx.unwrapBinaryIfNeeded(cctx.toCacheKeyObject(entry.getKey()), keepBinary);
}
catch (IgniteCheckedException e) {
throw new IgniteException(e);
@@ -2557,7 +2574,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
assert e != null;
- return e.value().value(cctx.cacheObjectContext(), false);
+ return (V)cctx.unwrapBinaryIfNeeded(e.value(), keepBinary);
}
catch (IgniteCheckedException ex) {
throw new IgniteException(ex);
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index 5688b61..2ab6303 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -1217,13 +1217,16 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
/**
* @param primary If {@code true} includes primary entries.
* @param backup If {@code true} includes backup entries.
+ * @param keepBinary Keep binary flag.
* @return Local entries iterator.
*/
- public Iterator<Cache.Entry<K, V>> localEntriesIterator(final boolean primary, final boolean backup) {
+ public Iterator<Cache.Entry<K, V>> localEntriesIterator(final boolean primary,
+ final boolean backup,
+ final boolean keepBinary) {
assert primary || backup;
if (primary && backup)
- return iterator(entries().iterator(), !ctx.keepBinary());
+ return iterator(entries().iterator(), !keepBinary);
else {
final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion();
@@ -1287,7 +1290,7 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
}
};
- return iterator(it, !ctx.keepBinary());
+ return iterator(it, !keepBinary);
}
}
@@ -1352,7 +1355,7 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
if (next instanceof GridCacheMapEntry && (!((GridCacheMapEntry)next).visitable(CU.empty0())))
continue;
- entry = next.wrapLazyValue();
+ entry = next.wrapLazyValue(ctx.keepBinary());
return;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index be2a85c..6729d41 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -977,7 +977,9 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
if (locNode && plc == null && !cctx.isLocal()) {
GridDhtCacheAdapter<K, V> cache = cctx.isNear() ? cctx.near().dht() : cctx.dht();
- final Iterator<Cache.Entry<K, V>> iter = cache.localEntriesIterator(true, backups);
+ final Iterator<Cache.Entry<K, V>> iter = cache.localEntriesIterator(true,
+ backups,
+ cache.context().keepBinary());
return new GridIteratorAdapter<IgniteBiTuple<K, V>>() {
/** */
@@ -1157,8 +1159,9 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
K key = e.key();
V val = e.value();
+ key = (K)cctx.unwrapBinaryIfNeeded(key, keepBinary);
+
if (filter != null || locNode) {
- key = (K)cctx.unwrapBinaryIfNeeded(key, keepBinary);
val = (V)cctx.unwrapBinaryIfNeeded(val, keepBinary);
}
@@ -2673,7 +2676,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
if (key != null)
return key;
- key = cctx.toCacheKeyObject(keyBytes()).value(cctx.cacheObjectContext(), false);
+ key = (K)cctx.toCacheKeyObject(keyBytes());
return key;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
index a1153cd..348b6c9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
@@ -349,7 +349,7 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr
}
/** @inheritDoc */
- @Override public Cache.Entry wrapLazyValue() {
+ @Override public Cache.Entry wrapLazyValue(boolean keepBinary) {
assert false;
return null;
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
index 056affc..c27cccb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
@@ -292,9 +292,9 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
Iterator<Map.Entry<Integer, String>> offheapIt;
if (internalCache.context().isNear())
- offheapIt = internalCache.context().near().dht().context().swap().lazyOffHeapIterator();
+ offheapIt = internalCache.context().near().dht().context().swap().lazyOffHeapIterator(false);
else
- offheapIt = internalCache.context().swap().lazyOffHeapIterator();
+ offheapIt = internalCache.context().swap().lazyOffHeapIterator(false);
while (offheapIt.hasNext()) {
Map.Entry<Integer, String> e = offheapIt.next();
@@ -704,9 +704,9 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
Iterator<Map.Entry<Integer, String>> offheapIt;
if (internalCache.context().isNear())
- offheapIt = internalCache.context().near().dht().context().swap().lazyOffHeapIterator();
+ offheapIt = internalCache.context().near().dht().context().swap().lazyOffHeapIterator(false);
else
- offheapIt = internalCache.context().swap().lazyOffHeapIterator();
+ offheapIt = internalCache.context().swap().lazyOffHeapIterator(false);
Affinity aff = ignite(nodeIdx).affinity(null);
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationNearEnabledTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationNearEnabledTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationNearEnabledTest.java
new file mode 100644
index 0000000..02d72b8
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationNearEnabledTest.java
@@ -0,0 +1,44 @@
+/*
+ * 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.query.continuous;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMemoryMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.NearCacheConfiguration;
+
+/**
+ *
+ */
+public class CacheKeepBinaryIterationNearEnabledTest extends CacheKeepBinaryIterationTest {
+ /** {@inheritDoc} */
+ @Override protected CacheConfiguration<Object, Object> cacheConfiguration(
+ CacheMode cacheMode,
+ int backups,
+ CacheAtomicityMode atomicityMode,
+ CacheMemoryMode memoryMode) {
+ CacheConfiguration<Object, Object> ccfg =
+ super.cacheConfiguration(cacheMode, backups, atomicityMode, memoryMode);
+
+ ccfg.setNearConfiguration(new NearCacheConfiguration<>());
+
+ return ccfg;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationStoreEnabledTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationStoreEnabledTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationStoreEnabledTest.java
new file mode 100644
index 0000000..f345611
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationStoreEnabledTest.java
@@ -0,0 +1,90 @@
+/*
+ * 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.query.continuous;
+
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMemoryMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.cache.store.CacheStoreAdapter;
+import org.apache.ignite.configuration.CacheConfiguration;
+
+/**
+ *
+ */
+public class CacheKeepBinaryIterationStoreEnabledTest extends CacheKeepBinaryIterationTest {
+ /** Cache store. */
+ private static TestStore store = new TestStore();
+
+ /** {@inheritDoc} */
+ @Override protected CacheConfiguration<Object, Object> cacheConfiguration(
+ CacheMode cacheMode,
+ int backups,
+ CacheAtomicityMode atomicityMode,
+ CacheMemoryMode memoryMode) {
+ CacheConfiguration<Object, Object> ccfg =
+ super.cacheConfiguration(cacheMode, backups, atomicityMode, memoryMode);
+
+ ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+
+ ccfg.setCacheStoreFactory(singletonFactory(store));
+ ccfg.setReadThrough(true);
+ ccfg.setWriteThrough(true);
+ ccfg.setLoadPreviousValue(true);
+
+ return ccfg;
+ }
+
+ /**
+ *
+ */
+ private static class TestStore extends CacheStoreAdapter<Object, Object> {
+ /** Map. */
+ private ConcurrentMap<Object, Object> map = new ConcurrentHashMap<>();
+
+ /**
+ * @param key Key.
+ * @return Value.
+ */
+ Object value(Object key) {
+ return map.get(key);
+ }
+
+ /** @return {@code True} if empty. */
+ boolean isEmpty() {
+ return map.isEmpty();
+ }
+
+ /** {@inheritDoc} */
+ @Override public Object load(Object key) {
+ return map.get(key);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void write(javax.cache.Cache.Entry<? extends Object, ? extends Object> e) {
+ map.put(e.getKey(), e.getValue());
+ }
+
+ /** {@inheritDoc} */
+ @Override public void delete(Object key) {
+ map.remove(key);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationSwapEnabledTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationSwapEnabledTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationSwapEnabledTest.java
new file mode 100644
index 0000000..fe619c4
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationSwapEnabledTest.java
@@ -0,0 +1,56 @@
+/*
+ * 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.query.continuous;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMemoryMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.eviction.lru.LruEvictionPolicy;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.spi.swapspace.file.FileSwapSpaceSpi;
+
+/**
+ *
+ */
+public class CacheKeepBinaryIterationSwapEnabledTest extends CacheKeepBinaryIterationTest {
+ /** {@inheritDoc} */
+ @Override protected CacheConfiguration<Object, Object> cacheConfiguration(
+ CacheMode cacheMode,
+ int backups,
+ CacheAtomicityMode atomicityMode,
+ CacheMemoryMode memoryMode) {
+ CacheConfiguration<Object, Object> ccfg =
+ super.cacheConfiguration(cacheMode, backups, atomicityMode, memoryMode);
+
+ ccfg.setSwapEnabled(true);
+ ccfg.setOffHeapMaxMemory(1000);
+ ccfg.setEvictionPolicy(new LruEvictionPolicy(10));
+
+ return ccfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());
+
+ return cfg;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationTest.java
new file mode 100644
index 0000000..a775d21
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationTest.java
@@ -0,0 +1,471 @@
+/*
+ * 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.query.continuous;
+
+import java.io.Serializable;
+import javax.cache.Cache;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMemoryMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.CachePeekMode;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.cache.query.ScanQuery;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+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.spi.communication.tcp.TcpCommunicationSpi;
+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.config.GridTestProperties;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.PRIMARY;
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED;
+import static org.apache.ignite.cache.CacheMemoryMode.ONHEAP_TIERED;
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+
+/**
+ *
+ */
+public class CacheKeepBinaryIterationTest extends GridCommonAbstractTest {
+ /** */
+ private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+ /** */
+ private static final int NODES = 3;
+
+ /** */
+ private static final int KEYS = 1025;
+
+ static {
+ GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+ ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ super.beforeTestsStarted();
+
+ startGridsMultiThreaded(getServerNodeCount());
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ stopAllGrids();
+
+ super.afterTestsStopped();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicOnHeap() throws Exception {
+ CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+ 1,
+ ATOMIC,
+ ONHEAP_TIERED
+ );
+
+ doTestScanQuery(ccfg, true, true);
+ doTestScanQuery(ccfg, true, false);
+ doTestScanQuery(ccfg, false, true);
+ doTestScanQuery(ccfg, false, false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicOffHeap() throws Exception {
+ CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+ 1,
+ ATOMIC,
+ OFFHEAP_TIERED
+ );
+
+ doTestScanQuery(ccfg, true, true);
+ doTestScanQuery(ccfg, true, false);
+ doTestScanQuery(ccfg, false, true);
+ doTestScanQuery(ccfg, false, false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testTxOnHeap() throws Exception {
+ CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+ 1,
+ TRANSACTIONAL,
+ ONHEAP_TIERED
+ );
+
+ doTestScanQuery(ccfg, true, true);
+ doTestScanQuery(ccfg, true, false);
+ doTestScanQuery(ccfg, false, true);
+ doTestScanQuery(ccfg, false, false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testTxOffHeap() throws Exception {
+ CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+ 1,
+ TRANSACTIONAL,
+ OFFHEAP_TIERED
+ );
+
+ doTestScanQuery(ccfg, true, true);
+ doTestScanQuery(ccfg, true, false);
+ doTestScanQuery(ccfg, false, true);
+ doTestScanQuery(ccfg, false, false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicOnHeapLocalEntries() throws Exception {
+ CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+ 1,
+ ATOMIC,
+ ONHEAP_TIERED
+ );
+
+ doTestLocalEntries(ccfg, true, true);
+ doTestLocalEntries(ccfg, true, false);
+ doTestLocalEntries(ccfg, false, true);
+ doTestLocalEntries(ccfg, false, false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicOffHeapLocalEntries() throws Exception {
+ CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+ 1,
+ ATOMIC,
+ OFFHEAP_TIERED
+ );
+
+ doTestLocalEntries(ccfg, true, true);
+ doTestLocalEntries(ccfg, true, false);
+ doTestLocalEntries(ccfg, false, true);
+ doTestLocalEntries(ccfg, false, false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testTxOnHeapLocalEntries() throws Exception {
+ CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+ 1,
+ TRANSACTIONAL,
+ ONHEAP_TIERED
+ );
+
+ doTestLocalEntries(ccfg, true, true);
+ doTestLocalEntries(ccfg, true, false);
+ doTestLocalEntries(ccfg, false, true);
+ doTestLocalEntries(ccfg, false, false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testTxOffHeapLocalEntries() throws Exception {
+ CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+ 1,
+ TRANSACTIONAL,
+ OFFHEAP_TIERED
+ );
+
+ doTestLocalEntries(ccfg, true, true);
+ doTestLocalEntries(ccfg, true, false);
+ doTestLocalEntries(ccfg, false, true);
+ doTestLocalEntries(ccfg, false, false);
+ }
+
+ /**
+ * @param ccfg Cache configuration.
+ */
+ private void doTestScanQuery(CacheConfiguration<Object, Object> ccfg, boolean keepBinary,
+ boolean primitives) throws IgniteInterruptedCheckedException {
+ IgniteCache<Object, Object> cache = grid(0).createCache(ccfg);
+
+ assertTrue(cache.size() == 0);
+
+ try {
+ for (int i = 0; i < KEYS; i++)
+ if (primitives)
+ cache.put(i, i);
+ else
+ cache.put(new QueryTestKey(i), new QueryTestValue(i));
+
+ for (int i = 0; i < getServerNodeCount(); i++) {
+ IgniteCache<Object, Object> cache0 = grid(i).cache(ccfg.getName());
+
+ if (keepBinary)
+ cache0 = cache0.withKeepBinary();
+
+ ScanQuery<Object, Object> qry = new ScanQuery<>();
+
+ qry.setLocal(true);
+
+ int size = 0;
+
+ try (QueryCursor<Cache.Entry<Object, Object>> cur = cache0.query(qry)) {
+ for (Cache.Entry<Object, Object> e : cur) {
+ Object key = e.getKey();
+ Object val = e.getValue();
+
+ if (!primitives) {
+ assertTrue("Got unexpected object: " + key.getClass() + ", keepBinary: " + keepBinary,
+ keepBinary == key instanceof BinaryObject);
+ assertTrue("Got unexpected object: " + val.getClass() + ", keepBinary: " + keepBinary,
+ keepBinary == val instanceof BinaryObject);
+ }
+ else {
+ assertTrue("Got unexpected object: " + key.getClass() + ", keepBinary: " + keepBinary,
+ key instanceof Integer);
+ assertTrue("Got unexpected object: " + val.getClass() + ", keepBinary: " + keepBinary,
+ val instanceof Integer);
+ }
+
+ ++size;
+ }
+ }
+
+ assertTrue(size > 0);
+ }
+ }
+ finally {
+ cache.removeAll();
+
+ if (ccfg.getEvictionPolicy() != null)
+ U.sleep(1000); // Fixes evictionPolicy issues at cache destroy.
+
+ grid(0).destroyCache(ccfg.getName());
+ }
+ }
+
+ /**
+ * @param ccfg Cache configuration.
+ */
+ private void doTestLocalEntries(CacheConfiguration<Object, Object> ccfg,
+ boolean keepBinary,
+ boolean primitives) throws IgniteInterruptedCheckedException {
+ IgniteCache<Object, Object> cache = grid(0).createCache(ccfg);
+
+ assertTrue(cache.size() == 0);
+
+ try {
+ for (int i = 0; i < KEYS; i++)
+ if (primitives)
+ cache.put(i, i);
+ else
+ cache.put(new QueryTestKey(i), new QueryTestValue(i));
+
+ for (int i = 0; i < getServerNodeCount(); i++) {
+ IgniteCache<Object, Object> cache0 = grid(i).cache(ccfg.getName());
+
+ if (keepBinary)
+ cache0 = cache0.withKeepBinary();
+
+ for (CachePeekMode mode : CachePeekMode.values()) {
+ int size = 0;
+
+ for (Cache.Entry<Object, Object> e : cache0.localEntries(mode)) {
+ Object key = e.getKey();
+ Object val = e.getValue();
+
+ if (!primitives) {
+ assertTrue("Got unexpected object: " + key.getClass() + ", keepBinary: " + keepBinary,
+ keepBinary == key instanceof BinaryObject);
+ assertTrue("Got unexpected object: " + key.getClass() + ", keepBinary: " + keepBinary,
+ keepBinary == val instanceof BinaryObject);
+ }
+ else {
+ assertTrue("Got unexpected object: " + key.getClass() + ", keepBinary: " + keepBinary,
+ key instanceof Integer);
+ assertTrue("Got unexpected object: " + key.getClass() + ", keepBinary: " + keepBinary,
+ val instanceof Integer);
+ }
+
+ ++size;
+ }
+
+ if (mode == CachePeekMode.ALL ||
+ mode == CachePeekMode.PRIMARY ||
+ mode == CachePeekMode.BACKUP ||
+ (mode == CachePeekMode.NEAR && i == 0 &&
+ ccfg.getMemoryMode() == CacheMemoryMode.ONHEAP_TIERED &&
+ ccfg.getNearConfiguration() != null) ||
+ (mode == CachePeekMode.ONHEAP && ccfg.getMemoryMode() == CacheMemoryMode.ONHEAP_TIERED) ||
+ (mode == CachePeekMode.OFFHEAP && ccfg.getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED) ||
+ (mode == CachePeekMode.SWAP && ccfg.isSwapEnabled()))
+ assertTrue("Zero result at mode: " + mode, size > 0);
+ }
+ }
+ }
+ finally {
+ cache.removeAll();
+
+ if (ccfg.getEvictionPolicy() != null)
+ U.sleep(1000); // Fixes evictionPolicy issues at cache destroy.
+
+ grid(0).destroyCache(ccfg.getName());
+ }
+ }
+
+ /**
+ * @return Count nodes.
+ */
+ protected int getServerNodeCount() {
+ return NODES;
+ }
+
+ /**
+ * @param cacheMode Cache mode.
+ * @param backups Number of backups.
+ * @param atomicityMode Cache atomicity mode.
+ * @param memoryMode Cache memory mode.
+ * @return Cache configuration.
+ */
+ protected CacheConfiguration<Object, Object> cacheConfiguration(
+ CacheMode cacheMode,
+ int backups,
+ CacheAtomicityMode atomicityMode,
+ CacheMemoryMode memoryMode) {
+ CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+
+ ccfg.setAtomicityMode(atomicityMode);
+ ccfg.setCacheMode(cacheMode);
+ ccfg.setMemoryMode(memoryMode);
+ ccfg.setWriteSynchronizationMode(FULL_SYNC);
+ ccfg.setAtomicWriteOrderMode(PRIMARY);
+
+ if (cacheMode == PARTITIONED)
+ ccfg.setBackups(backups);
+
+ return ccfg;
+ }
+
+ /**
+ *
+ */
+ public static class QueryTestKey implements Serializable {
+ /** */
+ private final Integer key;
+
+ /**
+ * @param key Key.
+ */
+ public QueryTestKey(Integer key) {
+ this.key = key;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ if (this == o)
+ return true;
+
+ if (o == null || getClass() != o.getClass())
+ return false;
+
+ QueryTestKey that = (QueryTestKey)o;
+
+ return key.equals(that.key);
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ return key.hashCode();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(QueryTestKey.class, this);
+ }
+ }
+
+ /**
+ *
+ */
+ public static class QueryTestValue implements Serializable {
+ /** */
+ @GridToStringInclude
+ protected final Integer val1;
+
+ /** */
+ @GridToStringInclude
+ protected final String val2;
+
+ /**
+ * @param val Value.
+ */
+ public QueryTestValue(Integer val) {
+ this.val1 = val;
+ this.val2 = String.valueOf(val);
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ if (this == o)
+ return true;
+
+ if (o == null || getClass() != o.getClass())
+ return false;
+
+ QueryTestValue that = (QueryTestValue)o;
+
+ return val1.equals(that.val1) && val2.equals(that.val2);
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ int res = val1.hashCode();
+
+ res = 31 * res + val2.hashCode();
+
+ return res;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(QueryTestValue.class, this);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/1da14369/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
index dbbb3ed..ce02823 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
@@ -30,6 +30,10 @@ import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinu
import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryOrderingEventTest;
import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTest;
import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTwoNodesTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheKeepBinaryIterationNearEnabledTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheKeepBinaryIterationTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheKeepBinaryIterationStoreEnabledTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheKeepBinaryIterationSwapEnabledTest;
import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicNearEnabledSelfTest;
import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicOffheapTieredTest;
import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicOffheapValuesTest;
@@ -105,6 +109,10 @@ public class IgniteCacheQuerySelfTestSuite3 extends TestSuite {
suite.addTestSuite(CacheContinuousQueryExecuteInPrimaryTest.class);
suite.addTestSuite(CacheContinuousQueryLostPartitionTest.class);
suite.addTestSuite(IgniteCacheContinuousQueryImmutableEntryTest.class);
+ suite.addTestSuite(CacheKeepBinaryIterationTest.class);
+ suite.addTestSuite(CacheKeepBinaryIterationStoreEnabledTest.class);
+ suite.addTestSuite(CacheKeepBinaryIterationSwapEnabledTest.class);
+ suite.addTestSuite(CacheKeepBinaryIterationNearEnabledTest.class);
return suite;
}
[14/32] ignite git commit: Merge remote-tracking branch
'remotes/community/gridgain-7.6.1'
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/community/gridgain-7.6.1'
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c834ae02
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c834ae02
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c834ae02
Branch: refs/heads/ignite-3212
Commit: c834ae02d1f9adc9604d3515625891e72a3047eb
Parents: 265d124 91862c7
Author: Denis Magda <dm...@gridgain.com>
Authored: Fri Jun 3 11:56:45 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri Jun 3 11:56:45 2016 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheStoreValueBytesSelfTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
[20/32] ignite git commit: IGNITE-3228: Minor fix.
Posted by sb...@apache.org.
IGNITE-3228: Minor fix.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/150e0d3b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/150e0d3b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/150e0d3b
Branch: refs/heads/ignite-3212
Commit: 150e0d3b3ab1b01483b5e44ff28198a51fa35e68
Parents: 8ea0598
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Jun 2 11:47:38 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Sun Jun 5 21:14:54 2016 +0300
----------------------------------------------------------------------
.../processors/hadoop/shuffle/collections/HadoopMultimapBase.java | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/150e0d3b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopMultimapBase.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopMultimapBase.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopMultimapBase.java
index 7dcff3d..39b7c51 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopMultimapBase.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/collections/HadoopMultimapBase.java
@@ -225,8 +225,6 @@ public abstract class HadoopMultimapBase implements HadoopMultimap {
long newPageSize = nextPageSize(writtenSize + requestedSize);
long newPagePtr = mem.allocate(newPageSize);
- System.out.println("ALLOCATED: " + newPageSize);
-
HadoopOffheapBuffer b = out.buffer();
b.set(newPagePtr, newPageSize);
[29/32] ignite git commit: Merge remote-tracking branch
'upstream/gridgain-7.6.1' into gridgain-7.6.1
Posted by sb...@apache.org.
Merge remote-tracking branch 'upstream/gridgain-7.6.1' into gridgain-7.6.1
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4799b260
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4799b260
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4799b260
Branch: refs/heads/ignite-3212
Commit: 4799b2601e5928bbb6854f462ae02a6f8935852d
Parents: 3d3bf08 dc34b6f
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Jun 6 10:36:45 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Jun 6 10:36:45 2016 +0300
----------------------------------------------------------------------
.../ignite/internal/binary/BinaryUtils.java | 16 ++++
.../processors/cache/CacheObjectContext.java | 3 +
.../GridCacheBinaryObjectsAbstractSelfTest.java | 78 +++++++++++++++++++-
3 files changed, 95 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[22/32] ignite git commit: Merge remote-tracking branch
'upstream/gridgain-7.6.1' into gridgain-7.6.1
Posted by sb...@apache.org.
Merge remote-tracking branch 'upstream/gridgain-7.6.1' into gridgain-7.6.1
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/14c80a16
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/14c80a16
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/14c80a16
Branch: refs/heads/ignite-3212
Commit: 14c80a162419931f589f23dae60f2590f0f425a6
Parents: 0d62383 2485d86
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Sun Jun 5 21:19:40 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Sun Jun 5 21:19:40 2016 +0300
----------------------------------------------------------------------
.../org/apache/ignite/spark/IgniteRDD.scala | 81 +++++++++++++++++++-
.../org/apache/ignite/spark/JavaIgniteRDD.scala | 9 +++
.../spark/JavaStandaloneIgniteRDDSelfTest.java | 9 ++-
.../ignite/spark/EntityTestAllTypeFields.scala | 7 +-
.../org/apache/ignite/spark/IgniteRDDSpec.scala | 77 ++++++++++++++++++-
5 files changed, 177 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
[25/32] ignite git commit: IGNITE-3248: Optimized fileIds() usage.
Posted by sb...@apache.org.
IGNITE-3248: Optimized fileIds() usage.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6f99b14e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6f99b14e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6f99b14e
Branch: refs/heads/ignite-3212
Commit: 6f99b14ea00bd99ec07014f4cda3f43edc562da7
Parents: fdc3aa6
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Sun Jun 5 21:04:03 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Jun 6 09:47:42 2016 +0300
----------------------------------------------------------------------
.../internal/processors/igfs/IgfsImpl.java | 18 +++---
.../processors/igfs/IgfsInputStreamImpl.java | 2 +-
.../processors/igfs/IgfsMetaManager.java | 33 ++++++++--
.../meta/IgfsClientMetaIdsForPathCallable.java | 65 ++++++++++++++++++++
.../meta/IgfsClientMetaInfoForPathCallable.java | 63 +++++++++++++++++++
.../processors/igfs/IgfsOneClientNodeTest.java | 2 +-
6 files changed, 167 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f99b14e/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 d9e4ba4..b2b031e 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
@@ -660,7 +660,7 @@ public final class IgfsImpl implements IgfsEx {
return new IgfsFileImpl(path, info, data.groupBlockSize());
}
- List<IgniteUuid> fileIds = meta.fileIds(path);
+ List<IgniteUuid> fileIds = meta.idsForPath(path);
IgniteUuid fileId = fileIds.get(fileIds.size() - 1);
@@ -938,7 +938,8 @@ public final class IgfsImpl implements IgfsEx {
}
}
}
- } else if (mode == PRIMARY) {
+ }
+ else if (mode == PRIMARY) {
checkConflictWithPrimary(path);
throw new IgfsPathNotFoundException("Failed to list files (path not found): " + path);
@@ -993,7 +994,7 @@ public final class IgfsImpl implements IgfsEx {
return os;
}
- IgfsEntryInfo info = meta.info(meta.fileId(path));
+ IgfsEntryInfo info = meta.infoForPath(path);
if (info == null) {
checkConflictWithPrimary(path);
@@ -1144,7 +1145,7 @@ public final class IgfsImpl implements IgfsEx {
return new IgfsEventAwareOutputStream(path, desc.info(), bufferSize(bufSize), mode, batch);
}
- final List<IgniteUuid> ids = meta.fileIds(path);
+ final List<IgniteUuid> ids = meta.idsForPath(path);
final IgniteUuid id = ids.get(ids.size() - 1);
@@ -1259,8 +1260,7 @@ public final class IgfsImpl implements IgfsEx {
IgfsMode mode = resolveMode(path);
// Check memory first.
- IgniteUuid fileId = meta.fileId(path);
- IgfsEntryInfo info = meta.info(fileId);
+ IgfsEntryInfo info = meta.infoForPath(path);
if (info == null && mode != PRIMARY) {
assert mode == DUAL_SYNC || mode == DUAL_ASYNC;
@@ -1469,7 +1469,7 @@ public final class IgfsImpl implements IgfsEx {
@Nullable private FileDescriptor getFileDescriptor(IgfsPath path) throws IgniteCheckedException {
assert path != null;
- List<IgniteUuid> ids = meta.fileIds(path);
+ List<IgniteUuid> ids = meta.idsForPath(path);
IgfsEntryInfo fileInfo = meta.info(ids.get(ids.size() - 1));
@@ -1645,13 +1645,13 @@ public final class IgfsImpl implements IgfsEx {
switch (mode) {
case PRIMARY:
- info = meta.info(meta.fileId(path));
+ info = meta.infoForPath(path);
break;
case DUAL_SYNC:
case DUAL_ASYNC:
- info = meta.info(meta.fileId(path));
+ info = meta.infoForPath(path);
if (info == null) {
try {
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f99b14e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java
index 447be93..de7071a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java
@@ -319,7 +319,7 @@ public class IgfsInputStreamImpl extends IgfsInputStreamAdapter {
}
// Safety to ensure no orphaned data blocks exist in case file was concurrently deleted.
- if (!meta.exists(fileInfo.id()))
+ if (!meta.exists(fileInfo.id()))
data.delete(fileInfo);
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f99b14e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index d46a381..c3783b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -49,6 +49,8 @@ import org.apache.ignite.internal.processors.cache.GridCacheInternal;
import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
import org.apache.ignite.internal.processors.igfs.client.IgfsClientAbstractCallable;
+import org.apache.ignite.internal.processors.igfs.client.meta.IgfsClientMetaIdsForPathCallable;
+import org.apache.ignite.internal.processors.igfs.client.meta.IgfsClientMetaInfoForPathCallable;
import org.apache.ignite.internal.processors.igfs.meta.IgfsMetaDirectoryCreateProcessor;
import org.apache.ignite.internal.processors.igfs.meta.IgfsMetaFileCreateProcessor;
import org.apache.ignite.internal.processors.igfs.meta.IgfsMetaFileLockProcessor;
@@ -2145,6 +2147,28 @@ public class IgfsMetaManager extends IgfsManager {
}
/**
+ * Get info for the given path.
+ *
+ * @param path Path.
+ * @return Info.
+ * @throws IgniteCheckedException If failed.
+ */
+ @Nullable public IgfsEntryInfo infoForPath(IgfsPath path) throws IgniteCheckedException {
+ return client ? runClientTask(new IgfsClientMetaInfoForPathCallable(cfg.getName(), path)) : info(fileId(path));
+ }
+
+ /**
+ * Get IDs for the given path.
+ *
+ * @param path Path.
+ * @return IDs.
+ * @throws IgniteCheckedException If failed.
+ */
+ public List<IgniteUuid> idsForPath(IgfsPath path) throws IgniteCheckedException {
+ return client ? runClientTask(new IgfsClientMetaIdsForPathCallable(cfg.getName(), path)) : fileIds(path);
+ }
+
+ /**
* Open file in DUAL mode.
*
* @param fs Secondary file system.
@@ -2154,15 +2178,14 @@ public class IgfsMetaManager extends IgfsManager {
* @throws IgniteCheckedException If input stream open has failed.
*/
public IgfsSecondaryInputStreamDescriptor openDual(final IgfsSecondaryFileSystem fs, final IgfsPath path,
- final int bufSize)
- throws IgniteCheckedException {
+ final int bufSize) throws IgniteCheckedException {
if (busyLock.enterBusy()) {
try {
assert fs != null;
assert path != null;
// First, try getting file info without any transactions and synchronization.
- IgfsEntryInfo info = info(fileId(path));
+ IgfsEntryInfo info = infoForPath(path);
if (info != null) {
if (!info.isFile())
@@ -2224,7 +2247,7 @@ public class IgfsMetaManager extends IgfsManager {
if (busyLock.enterBusy()) {
try {
// First, try getting file info without any transactions and synchronization.
- IgfsEntryInfo info = info(fileId(path));
+ IgfsEntryInfo info = infoForPath(path);
if (info != null)
return info;
@@ -2700,7 +2723,7 @@ public class IgfsMetaManager extends IgfsManager {
List<List<IgniteUuid>> pathIds = new ArrayList<>(paths.length);
for (IgfsPath path : paths)
- pathIds.add(fileIds(path));
+ pathIds.add(idsForPath(path));
// Start pessimistic.
try (IgniteInternalTx tx = startTx()) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f99b14e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaIdsForPathCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaIdsForPathCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaIdsForPathCallable.java
new file mode 100644
index 0000000..7b3d142
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaIdsForPathCallable.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.client.meta;
+
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.processors.igfs.IgfsMetaManager;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientAbstractCallable;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.lang.IgniteUuid;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * Get entry info for the given path.
+ */
+public class IgfsClientMetaIdsForPathCallable extends IgfsClientAbstractCallable<List<IgniteUuid>> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsClientMetaIdsForPathCallable() {
+ // NO-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ * @param path Path.
+ */
+ public IgfsClientMetaIdsForPathCallable(@Nullable String igfsName, IgfsPath path) {
+ super(igfsName, path);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected List<IgniteUuid> call0(IgfsContext ctx) throws Exception {
+ IgfsMetaManager meta = ctx.meta();
+
+ return meta.idsForPath(path);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsClientMetaIdsForPathCallable.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f99b14e/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaInfoForPathCallable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaInfoForPathCallable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaInfoForPathCallable.java
new file mode 100644
index 0000000..cb31663
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/client/meta/IgfsClientMetaInfoForPathCallable.java
@@ -0,0 +1,63 @@
+/*
+ * 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.client.meta;
+
+import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.processors.igfs.IgfsContext;
+import org.apache.ignite.internal.processors.igfs.IgfsEntryInfo;
+import org.apache.ignite.internal.processors.igfs.IgfsMetaManager;
+import org.apache.ignite.internal.processors.igfs.client.IgfsClientAbstractCallable;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Get entry info for the given path.
+ */
+public class IgfsClientMetaInfoForPathCallable extends IgfsClientAbstractCallable<IgfsEntryInfo> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * Default constructor.
+ */
+ public IgfsClientMetaInfoForPathCallable() {
+ // NO-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param igfsName IGFS name.
+ * @param path Path.
+ */
+ public IgfsClientMetaInfoForPathCallable(@Nullable String igfsName, IgfsPath path) {
+ super(igfsName, path);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgfsEntryInfo call0(IgfsContext ctx) throws Exception {
+ IgfsMetaManager meta = ctx.meta();
+
+ return meta.infoForPath(path);
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgfsClientMetaInfoForPathCallable.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/6f99b14e/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
index 3bfd372..c5f85bc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
@@ -128,6 +128,6 @@ public class IgfsOneClientNodeTest extends GridCommonAbstractTest {
return null;
}
- }, IgfsException.class, "Cache server nodes not found.");
+ }, IgfsException.class, "Failed to execute operation because there are no IGFS metadata nodes.");
}
}
\ No newline at end of file
[26/32] ignite git commit: IGNITE-3240: fixed serialization of String
and other primitive arrays by CacheObjectBinaryProcessorImpl
Posted by sb...@apache.org.
IGNITE-3240: fixed serialization of String and other primitive arrays by CacheObjectBinaryProcessorImpl
(cherry picked from commit 9e9252c2e4ed7380b3933909ac297f6618708980)
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/dc34b6f1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/dc34b6f1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/dc34b6f1
Branch: refs/heads/ignite-3212
Commit: dc34b6f11b1b850ad6cdfcaa3d34e27e9c6deebf
Parents: 6f99b14
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Jun 6 10:31:59 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Jun 6 10:31:59 2016 +0300
----------------------------------------------------------------------
.../ignite/internal/binary/BinaryUtils.java | 16 ++++
.../processors/cache/CacheObjectContext.java | 3 +
.../GridCacheBinaryObjectsAbstractSelfTest.java | 78 +++++++++++++++++++-
3 files changed, 95 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/dc34b6f1/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
index f1a7759..a9ae64e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
@@ -655,6 +655,22 @@ public class BinaryUtils {
}
/**
+ * @param arr Array to check.
+ * @return {@code true} if this array is of a known type.
+ */
+ public static boolean knownArray(Object arr) {
+ if (arr == null)
+ return false;
+
+ Class<?> cls = arr.getClass();
+
+ return cls == byte[].class || cls == short[].class || cls == int[].class || cls == long[].class ||
+ cls == float[].class || cls == double[].class || cls == char[].class || cls == boolean[].class ||
+ cls == String[].class || cls == UUID[].class || cls == Date[].class || cls == Timestamp[].class ||
+ cls == BigDecimal[].class;
+ }
+
+ /**
* Attempts to create a new collection of the same known type. Will return null if collection type is unknown.
*
* @param col Collection.
http://git-wip-us.apache.org/repos/asf/ignite/blob/dc34b6f1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
index d22bc75..d7fdb83 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
@@ -199,6 +199,9 @@ import org.apache.ignite.internal.util.typedef.F;
* @return Result.
*/
public Object[] unwrapBinariesInArrayIfNeeded(Object[] arr, boolean keepBinary, boolean cpy) {
+ if (BinaryUtils.knownArray(arr))
+ return arr;
+
Object[] res = new Object[arr.length];
for (int i = 0; i < arr.length; i++)
http://git-wip-us.apache.org/repos/asf/ignite/blob/dc34b6f1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git 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
index be20b68..3a510c3 100644
--- 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
@@ -17,13 +17,17 @@
package org.apache.ignite.internal.processors.cache.binary;
+import java.math.BigDecimal;
+import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import java.util.UUID;
import javax.cache.Cache;
import javax.cache.processor.EntryProcessor;
import javax.cache.processor.EntryProcessorException;
@@ -60,6 +64,7 @@ import org.apache.ignite.lang.IgniteBiInClosure;
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 org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
@@ -422,6 +427,75 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
/**
* @throws Exception If failed.
*/
+ public void testBasicArrays() throws Exception {
+ IgniteCache<Integer, Object> cache = jcache(0);
+
+ checkArrayClass(cache, new String[] {"abc"});
+
+ checkArrayClass(cache, new byte[] {1});
+
+ checkArrayClass(cache, new short[] {1});
+
+ checkArrayClass(cache, new int[] {1});
+
+ checkArrayClass(cache, new long[] {1});
+
+ checkArrayClass(cache, new float[] {1});
+
+ checkArrayClass(cache, new double[] {1});
+
+ checkArrayClass(cache, new char[] {'a'});
+
+ checkArrayClass(cache, new boolean[] {false});
+
+ checkArrayClass(cache, new UUID[] {UUID.randomUUID()});
+
+ checkArrayClass(cache, new Date[] {new Date()});
+
+ checkArrayClass(cache, new Timestamp[] {new Timestamp(System.currentTimeMillis())});
+
+ checkArrayClass(cache, new BigDecimal[] {new BigDecimal(100)});
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testCustomArrays() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-3244");
+
+ IgniteCache<Integer, TestObject[]> cache = jcache(0);
+
+ for (int i = 0; i < ENTRY_CNT; i++) {
+ TestObject[] arr = new TestObject[] {new TestObject(i)};
+
+ cache.put(0, arr);
+ }
+
+
+ for (int i = 0; i < ENTRY_CNT; i++) {
+ TestObject[] obj = cache.get(i);
+
+ assertEquals(1, obj.length);
+ assertEquals(i, obj[0].val);
+ }
+ }
+
+ /**
+ * @param cache Ignite cache.
+ * @param arr Array to check.
+ */
+ private void checkArrayClass(IgniteCache<Integer, Object> cache, Object arr) {
+ cache.put(0, arr);
+
+ Object res = cache.get(0);
+
+ assertEquals(arr.getClass(), res.getClass());
+ GridTestUtils.deepEquals(arr, res);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
public void testGetTx1() throws Exception {
checkGetTx(PESSIMISTIC, REPEATABLE_READ);
}
@@ -651,7 +725,6 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
for (int j = 0; j < 10; j++)
keys.add(i++);
-
cacheBinaryAsync.getAll(keys);
Map<Integer, BinaryObject> objs = cacheBinaryAsync.<Map<Integer, BinaryObject>>future().get();
@@ -1045,7 +1118,8 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
* No-op entry processor.
*/
private static class ObjectEntryProcessor implements EntryProcessor<Integer, TestObject, Boolean> {
- @Override public Boolean process(MutableEntry<Integer, TestObject> entry, Object... args) throws EntryProcessorException {
+ @Override
+ public Boolean process(MutableEntry<Integer, TestObject> entry, Object... args) throws EntryProcessorException {
TestObject obj = entry.getValue();
entry.setValue(new TestObject(obj.val));
[18/32] ignite git commit: IGNITE-3175 BigDecimal fields are not
supported if query is executed from IgniteRDD: fix java.sql.Date mapping
Posted by sb...@apache.org.
IGNITE-3175 BigDecimal fields are not supported if query is executed from IgniteRDD: fix java.sql.Date mapping
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2485d86f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2485d86f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2485d86f
Branch: refs/heads/ignite-3212
Commit: 2485d86f63bb2149e8881d3f48c13fb7784c29b0
Parents: 7fc1a7f
Author: tledkov-gridgain <tl...@gridgain.com>
Authored: Thu Jun 2 16:56:20 2016 +0300
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Fri Jun 3 20:12:44 2016 +0300
----------------------------------------------------------------------
.../src/main/scala/org/apache/ignite/spark/IgniteRDD.scala | 3 ++-
.../ignite/spark/JavaStandaloneIgniteRDDSelfTest.java | 9 ++++++++-
.../org/apache/ignite/spark/EntityTestAllTypeFields.scala | 7 +++++--
3 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/2485d86f/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
index 9ef9846..fa96212 100644
--- a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
@@ -315,9 +315,10 @@ class IgniteRDD[K, V] (
case "java.lang.Long" \u21d2 LongType
case "java.lang.Float" \u21d2 FloatType
case "java.lang.Double" \u21d2 DoubleType
- case "java.math.BigDecimal" \u21d2 DecimalType.SYSTEM_DEFAULT
+ case "java.math.BigDecimal" \u21d2 DataTypes.createDecimalType()
case "java.lang.String" \u21d2 StringType
case "java.util.Date" \u21d2 DateType
+ case "java.sql.Date" \u21d2 DateType
case "java.sql.Timestamp" \u21d2 TimestampType
case "[B" \u21d2 BinaryType
http://git-wip-us.apache.org/repos/asf/ignite/blob/2485d86f/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java b/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java
index e600c6c..343158b 100644
--- a/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java
+++ b/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java
@@ -39,6 +39,7 @@ import org.apache.spark.sql.DataFrame;
import org.apache.spark.sql.Row;
import scala.Tuple2;
+import java.io.Serializable;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.List;
@@ -279,10 +280,16 @@ public class JavaStandaloneIgniteRDDSelfTest extends GridCommonAbstractTest {
assertTrue(String.format("+++ Fail on %s field", fieldName),
((Comparable<BigDecimal>)val).compareTo((BigDecimal)res) == 0);
}
+ else if (val instanceof java.sql.Date)
+ assertEquals(String.format("+++ Fail on %s field", fieldName),
+ val.toString(), df.collect()[0].get(0).toString());
else if (val.getClass().isArray())
assertTrue(String.format("+++ Fail on %s field", fieldName), 1 <= df.count());
- else
+ else {
+ assertTrue(String.format("+++ Fail on %s field", fieldName), df.collect().length > 0);
+ assertTrue(String.format("+++ Fail on %s field", fieldName), df.collect()[0].size() > 0);
assertEquals(String.format("+++ Fail on %s field", fieldName), val, df.collect()[0].get(0));
+ }
info(String.format("+++ Query on the filed: %s : %s passed", fieldName, f.getType().getSimpleName()));
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/2485d86f/modules/spark/src/test/scala/org/apache/ignite/spark/EntityTestAllTypeFields.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/test/scala/org/apache/ignite/spark/EntityTestAllTypeFields.scala b/modules/spark/src/test/scala/org/apache/ignite/spark/EntityTestAllTypeFields.scala
index a936091..36d8274 100644
--- a/modules/spark/src/test/scala/org/apache/ignite/spark/EntityTestAllTypeFields.scala
+++ b/modules/spark/src/test/scala/org/apache/ignite/spark/EntityTestAllTypeFields.scala
@@ -35,7 +35,9 @@ class EntityTestAllTypeFields(
@ScalarCacheQuerySqlField(index = true) val dateVal: Date,
@ScalarCacheQuerySqlField(index = true) val timestampVal: Timestamp,
@ScalarCacheQuerySqlField(index = true) val byteArrVal: Array[Byte],
- @ScalarCacheQuerySqlField(index = true) val bigDecVal: java.math.BigDecimal
+ @ScalarCacheQuerySqlField(index = true) val bigDecVal: java.math.BigDecimal,
+ @ScalarCacheQuerySqlField(index = true) val javaSqlDate: java.sql.Date
+
) extends Serializable {
def this(
i: Int
@@ -52,6 +54,7 @@ class EntityTestAllTypeFields(
new Date(i),
new Timestamp(i),
Array(i.toByte, i.toByte),
- new java.math.BigDecimal(i.toString))
+ new java.math.BigDecimal(i.toString),
+ new java.sql.Date(i))
}
}
[15/32] ignite git commit: compilation fix
Posted by sb...@apache.org.
compilation fix
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/11f79092
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/11f79092
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/11f79092
Branch: refs/heads/ignite-3212
Commit: 11f79092b0f20bfe0ebe7a8fc7a18ec06e612e31
Parents: c834ae0
Author: Denis Magda <dm...@gridgain.com>
Authored: Fri Jun 3 12:57:40 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri Jun 3 12:57:40 2016 +0300
----------------------------------------------------------------------
.../processors/cache/IgniteTxExceptionAbstractSelfTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/11f79092/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
index 6c7f7ac..95161c3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
@@ -54,7 +54,7 @@ import static org.apache.ignite.cache.CacheMode.REPLICATED;
/**
* Tests that transaction is invalidated in case of {@link IgniteTxHeuristicCheckedException}.
*/
-public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstractSelfTest
+public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstractSelfTest {
/** */
private static final int PRIMARY = 0;