You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/03/10 13:40:43 UTC

[01/12] ignite git commit: IGNITE-2621: Correct handling for tasks in mixed-platform cluster - minors

Repository: ignite
Updated Branches:
  refs/heads/ignite-1786 b0c7e2c5e -> 23d3a181a


IGNITE-2621: Correct handling for tasks in mixed-platform cluster - minors


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/157ef53e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/157ef53e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/157ef53e

Branch: refs/heads/ignite-1786
Commit: 157ef53ea3d826db8c2455658d8694d60472e80d
Parents: c6c9389
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Wed Mar 9 18:12:39 2016 +0300
Committer: Pavel Tupitsyn <pt...@gridgain.com>
Committed: Wed Mar 9 18:12:39 2016 +0300

----------------------------------------------------------------------
 .../internal/processors/platform/PlatformProcessorImpl.java   | 2 +-
 .../internal/processors/platform/compute/PlatformCompute.java | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/157ef53e/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessorImpl.java
index 95daa4d..ff7bbd7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessorImpl.java
@@ -303,7 +303,7 @@ public class PlatformProcessorImpl extends GridProcessorAdapter implements Platf
     @Override public PlatformTarget compute(PlatformTarget grp) {
         PlatformClusterGroup grp0 = (PlatformClusterGroup)grp;
 
-        return new PlatformCompute(platformCtx, grp0.projection());
+        return new PlatformCompute(platformCtx, grp0.projection(), PlatformUtils.ATTR_PLATFORM);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/157ef53e/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
index a1a82ae..9eb746c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
@@ -78,12 +78,15 @@ public class PlatformCompute extends PlatformAbstractTarget {
      * @param platformCtx Context.
      * @param grp Cluster group.
      */
-    public PlatformCompute(PlatformContext platformCtx, ClusterGroup grp) {
+    public PlatformCompute(PlatformContext platformCtx, ClusterGroup grp, String platformAttr) {
         super(platformCtx);
 
+        assert grp != null;
+        assert platformAttr != null;
+
         compute = (IgniteComputeImpl)grp.ignite().compute(grp);
 
-        ClusterGroup platformGrp = grp.forAttribute(PlatformUtils.ATTR_PLATFORM, platformCtx.platform());
+        ClusterGroup platformGrp = grp.forAttribute(platformAttr, platformCtx.platform());
 
         computeForPlatform = (IgniteComputeImpl)grp.ignite().compute(platformGrp);
     }


[05/12] ignite git commit: IGNITE-2749 - Fixed web session clustering in WebLogic

Posted by vo...@apache.org.
IGNITE-2749 - Fixed web session clustering in WebLogic


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5377dde2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5377dde2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5377dde2

Branch: refs/heads/ignite-1786
Commit: 5377dde21e4aa32ca9da4963015b15da4d2e2b13
Parents: a579d45
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Wed Mar 9 20:16:49 2016 -0800
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Wed Mar 9 20:16:49 2016 -0800

----------------------------------------------------------------------
 modules/web/ignite-weblogic-test/pom.xml        | 100 +++++++++++++++++++
 .../webapp/META-INF/config/default-config.xml   |  20 ++++
 .../src/main/webapp/WEB-INF/web.xml             |  69 +++++++++++++
 .../src/main/webapp/index.jsp                   |  53 ++++++++++
 .../ignite/cache/websession/WebSession.java     |  26 ++---
 .../cache/websession/WebSessionFilter.java      |  17 ++--
 .../cache/websession/WebSessionListener.java    |   8 +-
 pom.xml                                         |   1 +
 8 files changed, 267 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5377dde2/modules/web/ignite-weblogic-test/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/ignite-weblogic-test/pom.xml b/modules/web/ignite-weblogic-test/pom.xml
new file mode 100644
index 0000000..4746f1f
--- /dev/null
+++ b/modules/web/ignite-weblogic-test/pom.xml
@@ -0,0 +1,100 @@
+<!--
+  ~ 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.
+  -->
+
+<!--
+  ~ 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.
+  -->
+
+<!--
+  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.
+-->
+
+<!--
+    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">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.ignite</groupId>
+    <artifactId>ignite-weblogic-test</artifactId>
+    <packaging>war</packaging>
+    <version>1.0-SNAPSHOT</version>
+    <name>ignite-weblogic-test Maven Webapp</name>
+    <url>http://maven.apache.org</url>
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-core</artifactId>
+            <version>1.6.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-web</artifactId>
+            <version>1.6.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-log4j</artifactId>
+            <version>1.6.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-spring</artifactId>
+            <version>1.6.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>ignite-weblogic-test</finalName>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/5377dde2/modules/web/ignite-weblogic-test/src/main/webapp/META-INF/config/default-config.xml
----------------------------------------------------------------------
diff --git a/modules/web/ignite-weblogic-test/src/main/webapp/META-INF/config/default-config.xml b/modules/web/ignite-weblogic-test/src/main/webapp/META-INF/config/default-config.xml
new file mode 100644
index 0000000..daa466d
--- /dev/null
+++ b/modules/web/ignite-weblogic-test/src/main/webapp/META-INF/config/default-config.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                            http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <bean class="org.apache.ignite.configuration.IgniteConfiguration">
+        <property name="cacheConfiguration">
+            <list>
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <property name="name" value="atomic"/>
+
+                    <property name="cacheMode" value="PARTITIONED"/>
+
+                    <property name="atomicityMode" value="ATOMIC"/>
+                </bean>
+            </list>
+        </property>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/5377dde2/modules/web/ignite-weblogic-test/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/modules/web/ignite-weblogic-test/src/main/webapp/WEB-INF/web.xml b/modules/web/ignite-weblogic-test/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..054eab4
--- /dev/null
+++ b/modules/web/ignite-weblogic-test/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,69 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+  <display-name>Archetype Created Web Application</display-name>
+
+    <listener>
+        <listener-class>org.apache.ignite.startup.servlet.ServletContextListenerStartup</listener-class>
+    </listener>
+
+    <filter>
+        <filter-name>IgniteWebSessionsFilter</filter-name>
+        <filter-class>org.apache.ignite.cache.websession.WebSessionFilter</filter-class>
+    </filter>
+
+    <!-- You can also specify a custom URL pattern. -->
+    <filter-mapping>
+        <filter-name>IgniteWebSessionsFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <!-- Specify Ignite configuration (relative to META-INF folder or Ignite_HOME). -->
+    <context-param>
+        <param-name>IgniteConfigurationFilePath</param-name>
+        <param-value>config/default-config.xml </param-value>
+    </context-param>
+
+    <!-- Specify the name of Ignite cache for web sessions. -->
+    <context-param>
+        <param-name>IgniteWebSessionsCacheName</param-name>
+        <param-value>atomic</param-value>
+    </context-param>
+
+</web-app>

http://git-wip-us.apache.org/repos/asf/ignite/blob/5377dde2/modules/web/ignite-weblogic-test/src/main/webapp/index.jsp
----------------------------------------------------------------------
diff --git a/modules/web/ignite-weblogic-test/src/main/webapp/index.jsp b/modules/web/ignite-weblogic-test/src/main/webapp/index.jsp
new file mode 100644
index 0000000..0cc090d
--- /dev/null
+++ b/modules/web/ignite-weblogic-test/src/main/webapp/index.jsp
@@ -0,0 +1,53 @@
+<%--
+  ~ 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.
+  --%>
+
+<%--
+  ~ 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.
+  --%>
+
+<%@ page import="org.apache.ignite.Ignition" %>
+<%@ page import="java.util.UUID" %>
+<html>
+<body>
+<h2>Session ID</h2>
+<%= request.getSession().getId() %>
+<h2>Session content</h2>
+<%= Ignition.ignite().cache("atomic").get(request.getSession().getId()) %>
+<h2>Cache size</h2>
+<%= Ignition.ignite().cache("atomic").size() %>
+
+<%
+    HttpSession ses = request.getSession();
+
+    ses.setAttribute(UUID.randomUUID().toString(), "Value");
+%>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/ignite/blob/5377dde2/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSession.java
----------------------------------------------------------------------
diff --git a/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSession.java b/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSession.java
index 7441a1a..8b944e5 100644
--- a/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSession.java
+++ b/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSession.java
@@ -100,12 +100,15 @@ class WebSession implements HttpSession, Externalizable {
     }
 
     /**
+     * @param id Session ID.
      * @param ses Session.
      */
-    WebSession(HttpSession ses) {
+    WebSession(String id, HttpSession ses) {
+        assert id != null;
         assert ses != null;
 
-        id = ses.getId();
+        this.id = id;
+
         createTime = ses.getCreationTime();
         accessTime = ses.getLastAccessedTime();
         maxInactiveInterval = ses.getMaxInactiveInterval();
@@ -125,23 +128,17 @@ class WebSession implements HttpSession, Externalizable {
     }
 
     /**
+     * @param id Session ID.
      * @param ses Session.
      * @param isNew Is new flag.
      */
-    WebSession(HttpSession ses, boolean isNew) {
-        this(ses);
+    WebSession(String id, HttpSession ses, boolean isNew) {
+        this(id, ses);
 
         this.isNew = isNew;
     }
 
     /**
-     * @param accessTime Last access time.
-     */
-    void accessTime(long accessTime) {
-        this.accessTime = accessTime;
-    }
-
-    /**
      * @param ctx Servlet context.
      */
     public void servletContext(ServletContext ctx) {
@@ -299,13 +296,6 @@ class WebSession implements HttpSession, Externalizable {
         isValid = false;
     }
 
-    /**
-     * @param isNew New session flag.
-     */
-    void setNew(boolean isNew) {
-        this.isNew = isNew;
-    }
-
     /** {@inheritDoc} */
     @Override public boolean isNew() {
         if (!isValid)

http://git-wip-us.apache.org/repos/asf/ignite/blob/5377dde2/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java
----------------------------------------------------------------------
diff --git a/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java b/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java
index 6e6be33..3dedee3 100644
--- a/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java
+++ b/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java
@@ -166,7 +166,7 @@ public class WebSessionFilter implements Filter {
     /** Web sessions caching cache name parameter name. */
     public static final String WEB_SES_CACHE_NAME_PARAM = "IgniteWebSessionsCacheName";
 
-    /** Web sessions caching retry on fail parameter name (valid for ATOMIC */
+    /** Web sessions caching retry on fail parameter name (valid for ATOMIC cache only). */
     public static final String WEB_SES_MAX_RETRIES_ON_FAIL_NAME_PARAM = "IgniteWebSessionsMaximumRetriesOnFail";
 
     /** Default retry on fail flag value. */
@@ -338,6 +338,9 @@ public class WebSessionFilter implements Filter {
         String sesId = httpReq.getRequestedSessionId();
 
         if (sesId != null) {
+            if (sesIdTransformer != null)
+                sesId = sesIdTransformer.apply(sesId);
+
             cached = cache.get(sesId);
 
             if (cached != null) {
@@ -345,7 +348,7 @@ public class WebSessionFilter implements Filter {
                     log.debug("Using cached session for ID: " + sesId);
 
                 if (cached.isNew())
-                    cached = new WebSession(cached, false);
+                    cached = new WebSession(cached.getId(), cached, false);
             }
             else {
                 if (log.isDebugEnabled())
@@ -386,8 +389,10 @@ public class WebSessionFilter implements Filter {
         if (ses != null && ses instanceof WebSession) {
             Collection<T2<String, Object>> updates = ((WebSession)ses).updates();
 
-            if (updates != null)
-                lsnr.updateAttributes(ses.getId(), updates, ses.getMaxInactiveInterval());
+            if (updates != null) {
+                lsnr.updateAttributes(sesIdTransformer != null ? sesIdTransformer.apply(ses.getId()) : ses.getId(),
+                    updates, ses.getMaxInactiveInterval());
+            }
         }
 
         return sesId;
@@ -406,7 +411,7 @@ public class WebSessionFilter implements Filter {
         if (log.isDebugEnabled())
             log.debug("Session created: " + sesId);
 
-        WebSession cached = new WebSession(ses, true);
+        WebSession cached = new WebSession(sesId, ses, true);
 
         for (int i = 0; i < retries; i++) {
             try {
@@ -428,7 +433,7 @@ public class WebSessionFilter implements Filter {
                     cached = old;
 
                     if (cached.isNew())
-                        cached = new WebSession(cached, false);
+                        cached = new WebSession(cached.getId(), cached, false);
                 }
 
                 break;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5377dde2/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionListener.java
----------------------------------------------------------------------
diff --git a/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionListener.java b/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionListener.java
index b826031..0d7c44e 100644
--- a/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionListener.java
+++ b/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionListener.java
@@ -46,7 +46,7 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS;
  */
 class WebSessionListener {
     /** */
-    private static final long RETRY_DELAY = 1;
+    private static final long RETRY_DELAY = 1000;
 
     /** Cache. */
     private final IgniteCache<String, WebSession> cache;
@@ -186,7 +186,9 @@ class WebSessionListener {
             if (!entry.exists())
                 return null;
 
-            WebSession ses = new WebSession(entry.getValue());
+            WebSession ses0 = entry.getValue();
+
+            WebSession ses = new WebSession(ses0.getId(), ses0);
 
             for (T2<String, Object> update : updates) {
                 String name = update.get1();
@@ -216,4 +218,4 @@ class WebSessionListener {
             updates = U.readCollection(in);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/5377dde2/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index ccfd471..bde8a2c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,6 +84,7 @@
         <module>modules/osgi-paxlogging</module>
         <module>modules/osgi-karaf</module>
         <module>modules/osgi</module>
+        <module>modules/web/ignite-weblogic-test</module>
     </modules>
 
     <profiles>


[12/12] ignite git commit: Merge branch 'master' into ignite-1786

Posted by vo...@apache.org.
Merge branch 'master' into ignite-1786


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/23d3a181
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/23d3a181
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/23d3a181

Branch: refs/heads/ignite-1786
Commit: 23d3a181a305cb2717f59762be52e9fec9ef9423
Parents: b0c7e2c 215e8a1
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Mar 10 15:40:35 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 10 15:40:35 2016 +0300

----------------------------------------------------------------------
 .../streaming/StreamVisitorExample.java         |  31 +-
 modules/aws/pom.xml                             |  24 +-
 .../configuration/TransactionConfiguration.java |  32 ++
 .../ignite/internal/binary/BinaryContext.java   |  29 +-
 .../internal/binary/BinaryFieldAccessor.java    |   1 +
 .../processors/cache/GridCacheMapEntry.java     |  25 +-
 .../distributed/dht/GridDhtCacheEntry.java      |   2 +-
 .../closure/GridClosureProcessor.java           | 375 ++++++++++++++++-
 .../platform/PlatformProcessorImpl.java         |   2 +-
 .../platform/compute/PlatformCompute.java       |   7 +-
 .../resources/META-INF/classnames.properties    |   6 +
 .../ignite/internal/GridAffinitySelfTest.java   |   4 +-
 ...omputationBinarylizableClosuresSelfTest.java | 413 +++++++++++++++++++
 .../binary/BinaryMarshallerSelfTest.java        |  50 +++
 ...ridCacheStoreManagerDeserializationTest.java | 345 ++++++++++++++++
 ...calCacheStoreManagerDeserializationTest.java | 101 +++++
 ...IgniteBinaryObjectsComputeGridTestSuite.java |   7 +-
 .../testsuites/IgniteCacheTestSuite4.java       |  11 +-
 .../HibernateL2CacheTransactionalSelfTest.java  |   9 +
 ...nateL2CacheTransactionalUseSyncSelfTest.java |  31 ++
 .../testsuites/IgniteHibernateTestSuite.java    |   4 +-
 .../processors/cache/jta/CacheJtaManager.java   |  26 +-
 .../processors/cache/jta/CacheJtaResource.java  | 304 ++++++++++++++
 .../cache/jta/GridCacheXAResource.java          | 251 -----------
 .../cache/AbstarctCacheJtaSelfTest.java         | 183 --------
 .../cache/AbstractCacheJtaSelfTest.java         | 183 ++++++++
 .../GridPartitionedCacheJtaFactorySelfTest.java |   2 +-
 ...rtitionedCacheJtaFactoryUseSyncSelfTest.java |  32 ++
 ...titionedCacheJtaLookupClassNameSelfTest.java |   2 +-
 ...eplicatedCacheJtaFactoryUseSyncSelfTest.java |  32 ++
 .../ignite/testsuites/IgniteJtaTestSuite.java   |   5 +
 .../install-package.cmd                         |  11 +-
 .../Apache.Ignite.Core.nuspec                   |   6 +-
 .../NuGet/LINQPad/ComputeExample.linq           |   2 +-
 .../NuGet/LINQPad/PutGetExample.linq            |   2 +-
 .../NuGet/LINQPad/QueryExample.linq             |   2 +-
 modules/web/ignite-weblogic-test/pom.xml        |  76 ++++
 .../webapp/META-INF/config/default-config.xml   |  20 +
 .../src/main/webapp/WEB-INF/web.xml             |  52 +++
 .../src/main/webapp/index.jsp                   |  36 ++
 .../ignite/cache/websession/WebSession.java     |  42 +-
 .../cache/websession/WebSessionFilter.java      |  56 ++-
 .../cache/websession/WebSessionListener.java    |   8 +-
 .../internal/websession/WebSessionSelfTest.java | 136 ++++++
 pom.xml                                         |   1 +
 45 files changed, 2434 insertions(+), 545 deletions(-)
----------------------------------------------------------------------



[06/12] ignite git commit: IGNITE-2775: Fixed HttpRequest.changeSessionId() to create a new id. - Fixes #539.

Posted by vo...@apache.org.
IGNITE-2775: Fixed HttpRequest.changeSessionId() to create a new id. - Fixes #539.

Signed-off-by: shtykh_roman <rs...@yahoo.com>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a8d16bd1
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a8d16bd1
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a8d16bd1

Branch: refs/heads/ignite-1786
Commit: a8d16bd1fbdd59d76454dbbce834f9ab87b54724
Parents: 5377dde
Author: shtykh_roman <rs...@yahoo.com>
Authored: Thu Mar 10 16:38:10 2016 +0900
Committer: shtykh_roman <rs...@yahoo.com>
Committed: Thu Mar 10 16:38:10 2016 +0900

----------------------------------------------------------------------
 .../ignite/cache/websession/WebSession.java     |  24 +++-
 .../cache/websession/WebSessionFilter.java      |  41 +++++-
 .../internal/websession/WebSessionSelfTest.java | 136 +++++++++++++++++++
 3 files changed, 193 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a8d16bd1/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSession.java
----------------------------------------------------------------------
diff --git a/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSession.java b/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSession.java
index 8b944e5..5e0d49b 100644
--- a/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSession.java
+++ b/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSession.java
@@ -90,7 +90,7 @@ class WebSession implements HttpSession, Externalizable {
     private transient Collection<T2<String, Object>> updates;
 
     /** Genuine http session. */
-    private transient HttpSession genuineSession;
+    private transient HttpSession genSes;
 
     /**
      * Required by {@link Externalizable}.
@@ -123,8 +123,6 @@ class WebSession implements HttpSession, Externalizable {
 
             attrs.put(name, ses.getAttribute(name));
         }
-
-        genuineSession = ses;
     }
 
     /**
@@ -139,6 +137,15 @@ class WebSession implements HttpSession, Externalizable {
     }
 
     /**
+     * Sets the genuine http session.
+     *
+     * @param genSes Genuine http session.
+     */
+    protected void genSes(HttpSession genSes) {
+        this.genSes = genSes;
+    }
+
+    /**
      * @param ctx Servlet context.
      */
     public void servletContext(ServletContext ctx) {
@@ -188,6 +195,15 @@ class WebSession implements HttpSession, Externalizable {
         return id;
     }
 
+    /**
+     * Sets a session id.
+     *
+     * @param id Session id.
+     */
+    protected void setId(String id) {
+        this.id = id;
+    }
+
     /** {@inheritDoc} */
     @Override public ServletContext getServletContext() {
         return ctx;
@@ -291,7 +307,7 @@ class WebSession implements HttpSession, Externalizable {
 
         lsnr.destroySession(id);
 
-        genuineSession.invalidate();
+        genSes.invalidate();
 
         isValid = false;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/a8d16bd1/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java
----------------------------------------------------------------------
diff --git a/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java b/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java
index 3dedee3..42de43b 100644
--- a/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java
+++ b/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java
@@ -379,6 +379,7 @@ public class WebSessionFilter implements Filter {
         cached.servletContext(ctx);
         cached.listener(lsnr);
         cached.resetUpdates();
+        cached.genSes(httpReq.getSession(false));
 
         httpReq = new RequestWrapper(httpReq, cached);
 
@@ -399,8 +400,10 @@ public class WebSessionFilter implements Filter {
     }
 
     /**
-     * @param httpReq HTTP request.
-     * @return Cached session.
+     * Creates a new session from http request.
+     *
+     * @param httpReq Request.
+     * @return New session.
      */
     @SuppressWarnings("unchecked")
     private WebSession createSession(HttpServletRequest httpReq) {
@@ -408,11 +411,25 @@ public class WebSessionFilter implements Filter {
 
         String sesId = sesIdTransformer != null ? sesIdTransformer.apply(ses.getId()) : ses.getId();
 
-        if (log.isDebugEnabled())
-            log.debug("Session created: " + sesId);
+        return createSession(ses, sesId);
+    }
 
+    /**
+     * Creates a new web session with the specified id.
+     *
+     * @param ses Base session.
+     * @param sesId Session id.
+     * @return New session.
+     */
+    @SuppressWarnings("unchecked")
+    private WebSession createSession(HttpSession ses, String sesId) {
         WebSession cached = new WebSession(sesId, ses, true);
 
+        cached.genSes(ses);
+
+        if (log.isDebugEnabled())
+            log.debug("Session created: " + sesId);
+
         for (int i = 0; i < retries; i++) {
             try {
                 IgniteCache<String, WebSession> cache0;
@@ -517,5 +534,21 @@ public class WebSessionFilter implements Filter {
         @Override public HttpSession getSession() {
             return getSession(true);
         }
+
+        /** {@inheritDoc} */
+        @Override public String changeSessionId() {
+            HttpServletRequest req = (HttpServletRequest)getRequest();
+
+            String newId = req.changeSessionId();
+
+            this.ses.setId(newId);
+
+            this.ses = createSession(ses, newId);
+            this.ses.servletContext(ctx);
+            this.ses.listener(lsnr);
+            this.ses.resetUpdates();
+
+            return newId;
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/a8d16bd1/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java b/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
index e2fda37..298baf1 100644
--- a/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
+++ b/modules/web/src/test/java/org/apache/ignite/internal/websession/WebSessionSelfTest.java
@@ -202,6 +202,88 @@ public class WebSessionSelfTest extends GridCommonAbstractTest {
     }
 
     /**
+     * Tests session id change.
+     *
+     * @throws Exception Exception If failed.
+     */
+    public void testChangeSessionId() throws Exception {
+        String newWebSesId;
+        Server srv = null;
+
+        try {
+            srv = startServer(TEST_JETTY_PORT, "/modules/core/src/test/config/websession/example-cache.xml",
+                null, new SessionIdChangeServlet());
+
+            Ignite ignite = G.ignite();
+
+            URLConnection conn = new URL("http://localhost:" + TEST_JETTY_PORT + "/ignitetest/chngsesid").openConnection();
+
+            conn.connect();
+
+            try (BufferedReader rdr = new BufferedReader(new InputStreamReader(conn.getInputStream()))) {
+
+                // checks if the old session object is invalidated.
+                String oldId = rdr.readLine();
+
+                assertNotNull(oldId);
+
+                // id from genuine session
+                String newGenSesId = rdr.readLine();
+
+                assertNotNull(newGenSesId);
+
+                assertFalse(newGenSesId.equals(oldId));
+
+                // id from replicated session
+                newWebSesId = rdr.readLine();
+
+                assertNotNull(newWebSesId);
+
+                assertTrue(newGenSesId.equals(newWebSesId));
+
+                IgniteCache<String, HttpSession> cache = ignite.cache(getCacheName());
+
+                assertNotNull(cache);
+
+                Thread.sleep(1000);
+
+                HttpSession ses = cache.get(newWebSesId);
+
+                assertNotNull(ses);
+
+                assertEquals("val1", ses.getAttribute("key1"));
+            }
+
+            conn = new URL("http://localhost:" + TEST_JETTY_PORT + "/ignitetest/simple").openConnection();
+
+            conn.addRequestProperty("Cookie", "JSESSIONID=" + newWebSesId);
+
+            conn.connect();
+
+            try (BufferedReader rdr = new BufferedReader(new InputStreamReader(conn.getInputStream()))) {
+
+                // checks if it can be handled with the subsequent request.
+                String sesId = rdr.readLine();
+
+                assertTrue(newWebSesId.equals(sesId));
+
+                String attr = rdr.readLine();
+
+                assertEquals("val1", attr);
+
+                String reqSesValid = rdr.readLine();
+
+                assertEquals("true", reqSesValid);
+
+                assertEquals("invalidated", rdr.readLine());
+            }
+        }
+        finally {
+            stopServer(srv);
+        }
+    }
+
+    /**
      * @throws Exception If failed.
      */
     public void testRestarts() throws Exception {
@@ -404,6 +486,9 @@ public class WebSessionSelfTest extends GridCommonAbstractTest {
                 ses.invalidate();
 
                 res.getWriter().println(ses.getId());
+
+                // invalidates again.
+                req.getSession().invalidate();
             }
             else if (req.getPathInfo().equals("/valid")) {
                 X.println(">>>", "Created session: " + ses.getId(), ">>>");
@@ -418,6 +503,57 @@ public class WebSessionSelfTest extends GridCommonAbstractTest {
     }
 
     /**
+     * Test session behavior on id change.
+     */
+    private static class SessionIdChangeServlet extends HttpServlet {
+        /** {@inheritDoc} */
+        @Override protected void doGet(HttpServletRequest req, HttpServletResponse res)
+            throws ServletException, IOException {
+            HttpSession ses = req.getSession();
+
+            assertNotNull(ses);
+
+            if (req.getPathInfo().equals("/chngsesid")) {
+
+                ses.setAttribute("key1", "val1");
+
+                X.println(">>>", "Created session: " + ses.getId(), ">>>");
+
+                res.getWriter().println(req.getSession().getId());
+
+                String newId = req.changeSessionId();
+
+                // new id from genuine session.
+                res.getWriter().println(newId);
+
+                // new id from WebSession.
+                res.getWriter().println(req.getSession().getId());
+
+                res.getWriter().flush();
+            }
+            else if (req.getPathInfo().equals("/simple")) {
+                res.getWriter().println(req.getSession().getId());
+
+                res.getWriter().println(req.getSession().getAttribute("key1"));
+
+                res.getWriter().println(req.isRequestedSessionIdValid());
+
+                try {
+                    req.getSession().invalidate();
+                    res.getWriter().println("invalidated");
+                }
+                catch (Exception e) {
+                    res.getWriter().println("failed");
+                }
+
+                res.getWriter().flush();
+            }
+            else
+                throw new ServletException("Nonexisting path: " + req.getPathInfo());
+        }
+    }
+
+    /**
      * Servlet for restarts test.
      */
     private static class RestartsTestServlet extends HttpServlet {


[02/12] ignite git commit: IGNITE-2776 - An option to enlist into JTA transaction using sync callback instead of XA resource

Posted by vo...@apache.org.
IGNITE-2776 - An option to enlist into JTA transaction using sync callback instead of XA resource


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/334ce4c9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/334ce4c9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/334ce4c9

Branch: refs/heads/ignite-1786
Commit: 334ce4c92dc398b0a9870d41493cb14c4ddf891a
Parents: 157ef53
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Wed Mar 9 16:18:36 2016 -0800
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Wed Mar 9 16:18:36 2016 -0800

----------------------------------------------------------------------
 .../configuration/TransactionConfiguration.java |  32 ++
 .../HibernateL2CacheTransactionalSelfTest.java  |   9 +
 ...nateL2CacheTransactionalUseSyncSelfTest.java |  31 ++
 .../testsuites/IgniteHibernateTestSuite.java    |   4 +-
 .../processors/cache/jta/CacheJtaManager.java   |  26 +-
 .../processors/cache/jta/CacheJtaResource.java  | 304 +++++++++++++++++++
 .../cache/jta/GridCacheXAResource.java          | 251 ---------------
 .../cache/AbstarctCacheJtaSelfTest.java         | 183 -----------
 .../cache/AbstractCacheJtaSelfTest.java         | 183 +++++++++++
 .../GridPartitionedCacheJtaFactorySelfTest.java |   2 +-
 ...rtitionedCacheJtaFactoryUseSyncSelfTest.java |  32 ++
 ...titionedCacheJtaLookupClassNameSelfTest.java |   2 +-
 ...eplicatedCacheJtaFactoryUseSyncSelfTest.java |  32 ++
 .../ignite/testsuites/IgniteJtaTestSuite.java   |   5 +
 14 files changed, 649 insertions(+), 447 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/334ce4c9/modules/core/src/main/java/org/apache/ignite/configuration/TransactionConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/TransactionConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/TransactionConfiguration.java
index b3d294d..95050a7 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/TransactionConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/TransactionConfiguration.java
@@ -70,6 +70,12 @@ public class TransactionConfiguration implements Serializable {
     private Factory txManagerFactory;
 
     /**
+     * Whether to use JTA {@code javax.transaction.Synchronization}
+     * instead of {@code javax.transaction.xa.XAResource}.
+     */
+    private boolean useJtaSync;
+
+    /**
      * Empty constructor.
      */
     public TransactionConfiguration() {
@@ -88,6 +94,7 @@ public class TransactionConfiguration implements Serializable {
         txSerEnabled = cfg.isTxSerializableEnabled();
         tmLookupClsName = cfg.getTxManagerLookupClassName();
         txManagerFactory = cfg.getTxManagerFactory();
+        useJtaSync = cfg.isUseJtaSynchronization();
     }
 
     /**
@@ -243,6 +250,7 @@ public class TransactionConfiguration implements Serializable {
      *
      * @param <T> Instance of {@code javax.transaction.TransactionManager}.
      * @return Transaction manager factory.
+     * @see #isUseJtaSynchronization()
      */
     @SuppressWarnings("unchecked")
     public <T> Factory<T> getTxManagerFactory() {
@@ -269,8 +277,32 @@ public class TransactionConfiguration implements Serializable {
      *
      * @param factory Transaction manager factory.
      * @param <T> Instance of {@code javax.transaction.TransactionManager}.
+     * @see #setUseJtaSynchronization(boolean)
      */
     public <T> void setTxManagerFactory(Factory<T> factory) {
         txManagerFactory = factory;
     }
+
+    /**
+     * @return Whether to use JTA {@code javax.transaction.Synchronization}
+     *      instead of {@code javax.transaction.xa.XAResource}.
+     * @see #getTxManagerFactory()
+     */
+    public boolean isUseJtaSynchronization() {
+        return useJtaSync;
+    }
+
+    /**
+     * Sets the flag that defines whether to use lightweight JTA synchronization callback to enlist
+     * into JTA transaction instead of creating a separate XA resource. In some cases this can give
+     * performance improvement, but keep in mind that most of the transaction managers do not allow
+     * to add more that one callback to a single transaction.
+     *
+     * @param useJtaSync Whether to use JTA {@code javax.transaction.Synchronization}
+     *      instead of {@code javax.transaction.xa.XAResource}.
+     * @see #setTxManagerFactory(Factory)
+     */
+    public void setUseJtaSynchronization(boolean useJtaSync) {
+        this.useJtaSync = useJtaSync;
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/334ce4c9/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheTransactionalSelfTest.java b/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheTransactionalSelfTest.java
index 9141be2..e6117c0 100644
--- a/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheTransactionalSelfTest.java
+++ b/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheTransactionalSelfTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.cache.hibernate;
 
 import java.util.Collections;
 import javax.cache.configuration.Factory;
+import javax.transaction.Synchronization;
 import javax.transaction.TransactionManager;
 import javax.transaction.UserTransaction;
 import org.apache.commons.dbcp.managed.BasicManagedDataSource;
@@ -94,6 +95,7 @@ public class HibernateL2CacheTransactionalSelfTest extends HibernateL2CacheSelfT
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
         cfg.getTransactionConfiguration().setTxManagerFactory(new TestTmFactory());
+        cfg.getTransactionConfiguration().setUseJtaSynchronization(useJtaSynchronization());
 
         return cfg;
     }
@@ -142,4 +144,11 @@ public class HibernateL2CacheTransactionalSelfTest extends HibernateL2CacheSelfT
     @Override protected AccessType[] accessTypes() {
         return new AccessType[]{AccessType.TRANSACTIONAL};
     }
+
+    /**
+     * @return Whether to use {@link Synchronization}.
+     */
+    protected boolean useJtaSynchronization() {
+        return false;
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/334ce4c9/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheTransactionalUseSyncSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheTransactionalUseSyncSelfTest.java b/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheTransactionalUseSyncSelfTest.java
new file mode 100644
index 0000000..44899f9
--- /dev/null
+++ b/modules/hibernate/src/test/java/org/apache/ignite/cache/hibernate/HibernateL2CacheTransactionalUseSyncSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.cache.hibernate;
+
+import javax.transaction.Synchronization;
+
+/**
+ * Tests Hibernate L2 cache with TRANSACTIONAL access mode and {@link Synchronization}
+ * instead of XA resource.
+ */
+public class HibernateL2CacheTransactionalUseSyncSelfTest extends HibernateL2CacheTransactionalSelfTest {
+    /** {@inheritDoc} */
+    @Override protected boolean useJtaSynchronization() {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/334ce4c9/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java b/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
index 309ed3b..99fea56 100644
--- a/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
+++ b/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
@@ -21,6 +21,7 @@ import junit.framework.TestSuite;
 import org.apache.ignite.cache.hibernate.HibernateL2CacheConfigurationSelfTest;
 import org.apache.ignite.cache.hibernate.HibernateL2CacheSelfTest;
 import org.apache.ignite.cache.hibernate.HibernateL2CacheTransactionalSelfTest;
+import org.apache.ignite.cache.hibernate.HibernateL2CacheTransactionalUseSyncSelfTest;
 import org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreNodeRestartTest;
 import org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreSelfTest;
 import org.apache.ignite.cache.store.hibernate.CacheHibernateStoreFactorySelfTest;
@@ -40,6 +41,7 @@ public class IgniteHibernateTestSuite extends TestSuite {
         // Hibernate L2 cache.
         suite.addTestSuite(HibernateL2CacheSelfTest.class);
         suite.addTestSuite(HibernateL2CacheTransactionalSelfTest.class);
+        suite.addTestSuite(HibernateL2CacheTransactionalUseSyncSelfTest.class);
         suite.addTestSuite(HibernateL2CacheConfigurationSelfTest.class);
 
         suite.addTestSuite(CacheHibernateBlobStoreSelfTest.class);
@@ -52,4 +54,4 @@ public class IgniteHibernateTestSuite extends TestSuite {
 
         return suite;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/334ce4c9/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java b/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
index a65a4f8..f581ebb 100644
--- a/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
+++ b/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
@@ -36,7 +36,7 @@ import org.jetbrains.annotations.Nullable;
  */
 public class CacheJtaManager extends CacheJtaManagerAdapter {
     /** */
-    private final ThreadLocal<GridCacheXAResource> xaRsrc = new ThreadLocal<>();
+    private final ThreadLocal<CacheJtaResource> rsrc = new ThreadLocal<>();
 
     /** */
     private TransactionManager jtaTm;
@@ -47,6 +47,9 @@ public class CacheJtaManager extends CacheJtaManagerAdapter {
     /** */
     private Factory<TransactionManager> tmFactory;
 
+    /** */
+    private boolean useJtaSync;
+
     /** {@inheritDoc} */
     @Override protected void start0() throws IgniteCheckedException {
         super.start0();
@@ -80,14 +83,15 @@ public class CacheJtaManager extends CacheJtaManagerAdapter {
                         + tmFactory + ", txMgr=" + txMgr + "]");
 
                 jtaTm = (TransactionManager)txMgr;
-
-                return;
             }
+            else {
+                String txLookupClsName = cctx.txConfig().getTxManagerLookupClassName();
 
-            String txLookupClsName = cctx.txConfig().getTxManagerLookupClassName();
+                if (txLookupClsName != null)
+                    tmLookupRef.set(createTmLookup(txLookupClsName));
+            }
 
-            if (txLookupClsName != null)
-                tmLookupRef.set(createTmLookup(txLookupClsName));
+            useJtaSync = cctx.txConfig().isUseJtaSynchronization();
         }
     }
 
@@ -140,7 +144,7 @@ public class CacheJtaManager extends CacheJtaManagerAdapter {
         }
 
         if (jtaTm != null) {
-            GridCacheXAResource rsrc = xaRsrc.get();
+            CacheJtaResource rsrc = this.rsrc.get();
 
             if (rsrc == null || rsrc.isFinished()) {
                 try {
@@ -165,12 +169,14 @@ public class CacheJtaManager extends CacheJtaManagerAdapter {
                             );
                         }
 
-                        rsrc = new GridCacheXAResource(tx, cctx.kernalContext());
+                        rsrc = new CacheJtaResource(tx, cctx.kernalContext());
 
-                        if (!jtaTx.enlistResource(rsrc))
+                        if (useJtaSync)
+                            jtaTx.registerSynchronization(rsrc);
+                        else if (!jtaTx.enlistResource(rsrc))
                             throw new IgniteCheckedException("Failed to enlist XA resource to JTA user transaction.");
 
-                        xaRsrc.set(rsrc);
+                        this.rsrc.set(rsrc);
                     }
                 }
                 catch (SystemException e) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/334ce4c9/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaResource.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaResource.java b/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaResource.java
new file mode 100644
index 0000000..f43981e
--- /dev/null
+++ b/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaResource.java
@@ -0,0 +1,304 @@
+/*
+ * 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.jta;
+
+import java.util.concurrent.atomic.AtomicReference;
+import javax.cache.CacheException;
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.transactions.TransactionState;
+
+import static org.apache.ignite.transactions.TransactionState.ACTIVE;
+import static org.apache.ignite.transactions.TransactionState.COMMITTED;
+import static org.apache.ignite.transactions.TransactionState.PREPARED;
+import static org.apache.ignite.transactions.TransactionState.ROLLED_BACK;
+
+/**
+ * Cache {@link XAResource} and {@link Synchronization} implementation.
+ */
+final class CacheJtaResource implements XAResource, Synchronization {
+    /** Logger reference. */
+    private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
+
+    /** */
+    private static IgniteLogger log;
+
+    /** */
+    private static final Xid[] NO_XID = new Xid[] {};
+
+    /** Cache transaction. */
+    private IgniteInternalTx cacheTx;
+
+    /** */
+    private Xid xid;
+
+    /**
+     * @param cacheTx Cache jta.
+     * @param ctx Kernal context.
+     */
+    public CacheJtaResource(IgniteInternalTx cacheTx, GridKernalContext ctx) {
+        assert cacheTx != null;
+        assert ctx != null;
+
+        this.cacheTx = cacheTx;
+
+        if (log == null)
+            log = U.logger(ctx, logRef, CacheJtaResource.class);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void start(Xid xid, int flags) {
+        if (log.isDebugEnabled())
+            log.debug("XA resource start(...) [xid=" + xid + ", flags=<" + flags(flags) + ">]");
+
+        // Simply save global transaction id.
+        this.xid = xid;
+    }
+
+    /**
+     * @param msg Message.
+     * @param cause Cause.
+     * @throws XAException XA exception.
+     */
+    private void throwException(String msg, Throwable cause) throws XAException {
+        XAException ex = new XAException(msg);
+
+        ex.initCause(cause);
+
+        throw ex;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void rollback(Xid xid) throws XAException {
+        assert this.xid.equals(xid);
+
+        if (log.isDebugEnabled())
+            log.debug("XA resource rollback(...) [xid=" + xid + "]");
+
+        try {
+            cacheTx.rollback();
+        }
+        catch (IgniteCheckedException e) {
+            throwException("Failed to rollback cache transaction: " + e.getMessage(), e);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public int prepare(Xid xid) throws XAException {
+        assert this.xid.equals(xid);
+
+        if (log.isDebugEnabled())
+            log.debug("XA resource prepare(...) [xid=" + xid + "]");
+
+        if (cacheTx.state() != ACTIVE)
+            throw new XAException("Cache transaction is not in active state.");
+
+        try {
+            cacheTx.prepare();
+        }
+        catch (IgniteCheckedException e) {
+            throwException("Failed to prepare cache transaction.", e);
+        }
+
+        return XA_OK;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void end(Xid xid, int flags) {
+        assert this.xid.equals(xid);
+
+        if (log.isDebugEnabled())
+            log.debug("XA resource end(...) [xid=" + xid + ", flags=<" + flags(flags) + ">]");
+
+        if ((flags & TMFAIL) > 0)
+            cacheTx.setRollbackOnly();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void commit(Xid xid, boolean onePhase) throws XAException {
+        assert this.xid.equals(xid);
+
+        if (log.isDebugEnabled())
+            log.debug("XA resource commit(...) [xid=" + xid + ", onePhase=" + onePhase + "]");
+
+        try {
+            cacheTx.commit();
+        }
+        catch (IgniteCheckedException e) {
+            throwException("Failed to commit cache transaction: " + e.getMessage(), e);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void forget(Xid xid) throws XAException {
+        assert this.xid.equals(xid);
+
+        if (log.isDebugEnabled())
+            log.debug("XA resource forget(...) [xid=" + xid + "]");
+
+        try {
+            cacheTx.invalidate(true);
+
+            cacheTx.commit();
+        }
+        catch (IgniteCheckedException e) {
+            throwException("Failed to forget cache transaction: " + e.getMessage(), e);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public Xid[] recover(int i) {
+        if (cacheTx.state() == PREPARED)
+            return new Xid[] { xid };
+
+        return NO_XID;
+    }
+
+    /**
+     * @param flags JTA Flags.
+     * @return Comma-separated flags string.
+     */
+    private String flags(int flags) {
+        StringBuilder res = new StringBuilder();
+
+        addFlag(res, flags, TMENDRSCAN, "TMENDRSCAN");
+        addFlag(res, flags, TMFAIL, "TMFAIL");
+        addFlag(res, flags, TMJOIN, "TMJOIN");
+        addFlag(res, flags, TMNOFLAGS, "TMNOFLAGS");
+        addFlag(res, flags, TMONEPHASE, "TMONEPHASE");
+        addFlag(res, flags, TMRESUME, "TMRESUME");
+        addFlag(res, flags, TMSTARTRSCAN, "TMSTARTRSCAN");
+        addFlag(res, flags, TMSUCCESS, "TMSUCCESS");
+        addFlag(res, flags, TMSUSPEND, "TMSUSPEND");
+
+        return res.toString();
+    }
+
+    /**
+     * @param sb String builder.
+     * @param flags Flags bit set.
+     * @param mask Bit mask.
+     * @param flagName String name of the flag specified by given mask.
+     * @return String builder appended by flag if it's presented in bit set.
+     */
+    private StringBuilder addFlag(StringBuilder sb, int flags, int mask, String flagName) {
+        if ((flags & mask) > 0)
+            sb.append(sb.length() > 0 ? "," : "").append(flagName);
+
+        return sb;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTransactionTimeout() {
+        return (int)(cacheTx.timeout() / 1000);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean setTransactionTimeout(int i) {
+        cacheTx.timeout(i * 1000);
+
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isSameRM(XAResource xar) {
+        if (xar == this)
+            return true;
+
+        if (!(xar instanceof CacheJtaResource))
+            return false;
+
+        CacheJtaResource other = (CacheJtaResource)xar;
+
+        return cacheTx == other.cacheTx;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void beforeCompletion() {
+        if (log.isDebugEnabled())
+            log.debug("Synchronization.beforeCompletion() [xid=" + cacheTx.xid() + "]");
+
+        if (cacheTx.state() != ACTIVE)
+            throw new CacheException("Cache transaction is not in active state.");
+
+        try {
+            cacheTx.prepare();
+        }
+        catch (IgniteCheckedException e) {
+            throw new CacheException("Failed to prepare cache transaction.", e);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void afterCompletion(int status) {
+        switch (status) {
+            case Status.STATUS_COMMITTED:
+                if (log.isDebugEnabled())
+                    log.debug("Synchronization.afterCompletion(STATUS_COMMITTED) [xid=" + cacheTx.xid() + "]");
+
+                try {
+                    cacheTx.commit();
+                }
+                catch (IgniteCheckedException e) {
+                    throw new CacheException("Failed to commit cache transaction.", e);
+                }
+
+                break;
+
+            case Status.STATUS_ROLLEDBACK:
+                if (log.isDebugEnabled())
+                    log.debug("Synchronization.afterCompletion(STATUS_ROLLEDBACK) [xid=" + cacheTx.xid() + "]");
+
+                try {
+                    cacheTx.rollback();
+                }
+                catch (IgniteCheckedException e) {
+                    throw new CacheException("Failed to rollback cache transaction.", e);
+                }
+
+                break;
+
+            default:
+                throw new IllegalArgumentException("Unknown transaction status: " + status);
+        }
+    }
+
+    /**
+     *
+     * @return {@code true} if jta was already committed or rolled back.
+     */
+    public boolean isFinished() {
+        TransactionState state = cacheTx.state();
+
+        return state == COMMITTED || state == ROLLED_BACK;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(CacheJtaResource.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/334ce4c9/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/GridCacheXAResource.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/GridCacheXAResource.java b/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/GridCacheXAResource.java
deleted file mode 100644
index 2cb4695..0000000
--- a/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/GridCacheXAResource.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache.jta;
-
-import java.util.concurrent.atomic.AtomicReference;
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.IgniteLogger;
-import org.apache.ignite.internal.GridKernalContext;
-import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.transactions.TransactionState;
-
-import static org.apache.ignite.transactions.TransactionState.ACTIVE;
-import static org.apache.ignite.transactions.TransactionState.COMMITTED;
-import static org.apache.ignite.transactions.TransactionState.PREPARED;
-import static org.apache.ignite.transactions.TransactionState.ROLLED_BACK;
-
-/**
- * Cache XA resource implementation.
- */
-public final class GridCacheXAResource implements XAResource {
-    /** Logger reference. */
-    private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
-
-    /** */
-    private static IgniteLogger log;
-
-    /** */
-    private static final Xid[] NO_XID = new Xid[] {};
-
-    /** Cache transaction. */
-    private IgniteInternalTx cacheTx;
-
-    /** */
-    private Xid xid;
-
-    /**
-     * @param cacheTx Cache jta.
-     * @param ctx Kernal context.
-     */
-    public GridCacheXAResource(IgniteInternalTx cacheTx, GridKernalContext ctx) {
-        assert cacheTx != null;
-        assert ctx != null;
-
-        this.cacheTx = cacheTx;
-
-        if (log == null)
-            log = U.logger(ctx, logRef, GridCacheXAResource.class);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void start(Xid xid, int flags) {
-        if (log.isDebugEnabled())
-            log.debug("XA resource start(...) [xid=" + xid + ", flags=<" + flags(flags) + ">]");
-
-        // Simply save global transaction id.
-        this.xid = xid;
-    }
-
-    /**
-     * @param msg Message.
-     * @param cause Cause.
-     * @throws XAException XA exception.
-     */
-    private void throwException(String msg, Throwable cause) throws XAException {
-        XAException ex = new XAException(msg);
-
-        ex.initCause(cause);
-
-        throw ex;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void rollback(Xid xid) throws XAException {
-        assert this.xid.equals(xid);
-
-        if (log.isDebugEnabled())
-            log.debug("XA resource rollback(...) [xid=" + xid + "]");
-
-        try {
-            cacheTx.rollback();
-        }
-        catch (IgniteCheckedException e) {
-            throwException("Failed to rollback cache transaction: " + e.getMessage(), e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public int prepare(Xid xid) throws XAException {
-        assert this.xid.equals(xid);
-
-        if (log.isDebugEnabled())
-            log.debug("XA resource prepare(...) [xid=" + xid + "]");
-
-        if (cacheTx.state() != ACTIVE)
-            throw new XAException("Cache transaction is not in active state.");
-
-        try {
-            cacheTx.prepare();
-        }
-        catch (IgniteCheckedException e) {
-            throwException("Failed to prepare cache transaction.", e);
-        }
-
-        return XA_OK;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void end(Xid xid, int flags) {
-        assert this.xid.equals(xid);
-
-        if (log.isDebugEnabled())
-            log.debug("XA resource end(...) [xid=" + xid + ", flags=<" + flags(flags) + ">]");
-
-        if ((flags & TMFAIL) > 0)
-            cacheTx.setRollbackOnly();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void commit(Xid xid, boolean onePhase) throws XAException {
-        assert this.xid.equals(xid);
-
-        if (log.isDebugEnabled())
-            log.debug("XA resource commit(...) [xid=" + xid + ", onePhase=" + onePhase + "]");
-
-        try {
-            cacheTx.commit();
-        }
-        catch (IgniteCheckedException e) {
-            throwException("Failed to commit cache transaction: " + e.getMessage(), e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void forget(Xid xid) throws XAException {
-        assert this.xid.equals(xid);
-
-        if (log.isDebugEnabled())
-            log.debug("XA resource forget(...) [xid=" + xid + "]");
-
-        try {
-            cacheTx.invalidate(true);
-
-            cacheTx.commit();
-        }
-        catch (IgniteCheckedException e) {
-            throwException("Failed to forget cache transaction: " + e.getMessage(), e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public Xid[] recover(int i) {
-        if (cacheTx.state() == PREPARED)
-            return new Xid[] { xid };
-
-        return NO_XID;
-    }
-
-    /**
-     * @param flags JTA Flags.
-     * @return Comma-separated flags string.
-     */
-    private String flags(int flags) {
-        StringBuilder res = new StringBuilder();
-
-        addFlag(res, flags, TMENDRSCAN, "TMENDRSCAN");
-        addFlag(res, flags, TMFAIL, "TMFAIL");
-        addFlag(res, flags, TMJOIN, "TMJOIN");
-        addFlag(res, flags, TMNOFLAGS, "TMNOFLAGS");
-        addFlag(res, flags, TMONEPHASE, "TMONEPHASE");
-        addFlag(res, flags, TMRESUME, "TMRESUME");
-        addFlag(res, flags, TMSTARTRSCAN, "TMSTARTRSCAN");
-        addFlag(res, flags, TMSUCCESS, "TMSUCCESS");
-        addFlag(res, flags, TMSUSPEND, "TMSUSPEND");
-
-        return res.toString();
-    }
-
-    /**
-     * @param sb String builder.
-     * @param flags Flags bit set.
-     * @param mask Bit mask.
-     * @param flagName String name of the flag specified by given mask.
-     * @return String builder appended by flag if it's presented in bit set.
-     */
-    private StringBuilder addFlag(StringBuilder sb, int flags, int mask, String flagName) {
-        if ((flags & mask) > 0)
-            sb.append(sb.length() > 0 ? "," : "").append(flagName);
-
-        return sb;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTransactionTimeout() {
-        return (int)(cacheTx.timeout() / 1000);
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean setTransactionTimeout(int i) {
-        cacheTx.timeout(i * 1000);
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isSameRM(XAResource xar) {
-        if (xar == this)
-            return true;
-
-        if (!(xar instanceof GridCacheXAResource))
-            return false;
-
-        GridCacheXAResource other = (GridCacheXAResource)xar;
-
-        return cacheTx == other.cacheTx;
-    }
-
-    /**
-     *
-     * @return {@code true} if jta was already committed or rolled back.
-     */
-    public boolean isFinished() {
-        TransactionState state = cacheTx.state();
-
-        return state == COMMITTED || state == ROLLED_BACK;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridCacheXAResource.class, this);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/334ce4c9/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/AbstarctCacheJtaSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/AbstarctCacheJtaSelfTest.java b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/AbstarctCacheJtaSelfTest.java
deleted file mode 100644
index 41c4565..0000000
--- a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/AbstarctCacheJtaSelfTest.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import javax.transaction.Status;
-import javax.transaction.UserTransaction;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.transactions.Transaction;
-import org.objectweb.jotm.Jotm;
-
-import static org.apache.ignite.cache.CacheMode.PARTITIONED;
-import static org.apache.ignite.transactions.TransactionState.ACTIVE;
-
-/**
- * Abstract class for cache tests.
- */
-public abstract class AbstarctCacheJtaSelfTest extends GridCacheAbstractSelfTest {
-    /** */
-    private static final int GRID_CNT = 1;
-
-    /** Java Open Transaction Manager facade. */
-    protected static Jotm jotm;
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTestsStarted() throws Exception {
-        jotm = new Jotm(true, false);
-
-        super.beforeTestsStarted();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        super.afterTestsStopped();
-
-        jotm.stop();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return GRID_CNT;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheMode cacheMode() {
-        return PARTITIONED;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        configureJta(cfg);
-
-        CacheConfiguration cfg1 = cacheConfiguration(gridName);
-
-        CacheConfiguration cfg2 = cacheConfiguration(gridName);
-
-        cfg2.setName("cache-2");
-
-        cfg.setCacheConfiguration(cfg1, cfg2);
-
-        return cfg;
-    }
-
-    /**
-     * @param cfg Ignite Configuration.
-     */
-    protected abstract void configureJta(IgniteConfiguration cfg);
-
-    /**
-     * JUnit.
-     *
-     * @throws Exception If failed.
-     */
-    public void testJta() throws Exception {
-        UserTransaction jtaTx = jotm.getUserTransaction();
-
-        IgniteCache<String, Integer> cache = jcache();
-
-        assert ignite(0).transactions().tx() == null;
-
-        jtaTx.begin();
-
-        try {
-            assert ignite(0).transactions().tx() == null;
-
-            assert cache.getAndPut("key", 1) == null;
-
-            Transaction tx = ignite(0).transactions().tx();
-
-            assert tx != null;
-            assert tx.state() == ACTIVE;
-
-            Integer one = 1;
-
-            assertEquals(one, cache.get("key"));
-
-            tx = ignite(0).transactions().tx();
-
-            assert tx != null;
-            assert tx.state() == ACTIVE;
-
-            jtaTx.commit();
-
-            assert ignite(0).transactions().tx() == null;
-        }
-        finally {
-            if (jtaTx.getStatus() == Status.STATUS_ACTIVE)
-                jtaTx.rollback();
-        }
-
-        assertEquals((Integer)1, cache.get("key"));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    @SuppressWarnings("ConstantConditions")
-    public void testJtaTwoCaches() throws Exception {
-        UserTransaction jtaTx = jotm.getUserTransaction();
-
-        IgniteEx ignite = grid(0);
-
-        IgniteCache<String, Integer> cache1 = jcache();
-
-        IgniteCache<Object, Object> cache2 = ignite.cache("cache-2");
-
-        assertNull(ignite.transactions().tx());
-
-        jtaTx.begin();
-
-        try {
-            cache1.put("key", 0);
-            cache2.put("key", 0);
-            cache1.put("key1", 1);
-            cache2.put("key2", 2);
-
-            assertEquals(0, (int)cache1.get("key"));
-            assertEquals(0, (int)cache1.get("key"));
-            assertEquals(1, (int)cache1.get("key1"));
-            assertEquals(2, (int)cache2.get("key2"));
-
-            assertEquals(ignite.transactions().tx().state(), ACTIVE);
-
-            jtaTx.commit();
-
-            assertNull(ignite.transactions().tx());
-
-            assertEquals(0, (int)cache1.get("key"));
-            assertEquals(0, (int)cache2.get("key"));
-            assertEquals(1, (int)cache1.get("key1"));
-            assertEquals(2, (int)cache2.get("key2"));
-        }
-        finally {
-            if (jtaTx.getStatus() == Status.STATUS_ACTIVE)
-                jtaTx.rollback();
-        }
-
-        assertEquals(0, (int)cache1.get("key"));
-        assertEquals(0, (int)cache2.get("key"));
-        assertEquals(1, (int)cache1.get("key1"));
-        assertEquals(2, (int)cache2.get("key2"));
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/334ce4c9/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/AbstractCacheJtaSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/AbstractCacheJtaSelfTest.java b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/AbstractCacheJtaSelfTest.java
new file mode 100644
index 0000000..96e3258
--- /dev/null
+++ b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/AbstractCacheJtaSelfTest.java
@@ -0,0 +1,183 @@
+/*
+ * 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 javax.transaction.Status;
+import javax.transaction.UserTransaction;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.transactions.Transaction;
+import org.objectweb.jotm.Jotm;
+
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+import static org.apache.ignite.transactions.TransactionState.ACTIVE;
+
+/**
+ * Abstract class for cache tests.
+ */
+public abstract class AbstractCacheJtaSelfTest extends GridCacheAbstractSelfTest {
+    /** */
+    private static final int GRID_CNT = 1;
+
+    /** Java Open Transaction Manager facade. */
+    protected static Jotm jotm;
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        jotm = new Jotm(true, false);
+
+        super.beforeTestsStarted();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        jotm.stop();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return GRID_CNT;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return PARTITIONED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        configureJta(cfg);
+
+        CacheConfiguration cfg1 = cacheConfiguration(gridName);
+
+        CacheConfiguration cfg2 = cacheConfiguration(gridName);
+
+        cfg2.setName("cache-2");
+
+        cfg.setCacheConfiguration(cfg1, cfg2);
+
+        return cfg;
+    }
+
+    /**
+     * @param cfg Ignite Configuration.
+     */
+    protected abstract void configureJta(IgniteConfiguration cfg);
+
+    /**
+     * JUnit.
+     *
+     * @throws Exception If failed.
+     */
+    public void testJta() throws Exception {
+        UserTransaction jtaTx = jotm.getUserTransaction();
+
+        IgniteCache<String, Integer> cache = jcache();
+
+        assert ignite(0).transactions().tx() == null;
+
+        jtaTx.begin();
+
+        try {
+            assert ignite(0).transactions().tx() == null;
+
+            assert cache.getAndPut("key", 1) == null;
+
+            Transaction tx = ignite(0).transactions().tx();
+
+            assert tx != null;
+            assert tx.state() == ACTIVE;
+
+            Integer one = 1;
+
+            assertEquals(one, cache.get("key"));
+
+            tx = ignite(0).transactions().tx();
+
+            assert tx != null;
+            assert tx.state() == ACTIVE;
+
+            jtaTx.commit();
+
+            assert ignite(0).transactions().tx() == null;
+        }
+        finally {
+            if (jtaTx.getStatus() == Status.STATUS_ACTIVE)
+                jtaTx.rollback();
+        }
+
+        assertEquals((Integer)1, cache.get("key"));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    @SuppressWarnings("ConstantConditions")
+    public void testJtaTwoCaches() throws Exception {
+        UserTransaction jtaTx = jotm.getUserTransaction();
+
+        IgniteEx ignite = grid(0);
+
+        IgniteCache<String, Integer> cache1 = jcache();
+
+        IgniteCache<Object, Object> cache2 = ignite.cache("cache-2");
+
+        assertNull(ignite.transactions().tx());
+
+        jtaTx.begin();
+
+        try {
+            cache1.put("key", 0);
+            cache2.put("key", 0);
+            cache1.put("key1", 1);
+            cache2.put("key2", 2);
+
+            assertEquals(0, (int)cache1.get("key"));
+            assertEquals(0, (int)cache1.get("key"));
+            assertEquals(1, (int)cache1.get("key1"));
+            assertEquals(2, (int)cache2.get("key2"));
+
+            assertEquals(ignite.transactions().tx().state(), ACTIVE);
+
+            jtaTx.commit();
+
+            assertNull(ignite.transactions().tx());
+
+            assertEquals(0, (int)cache1.get("key"));
+            assertEquals(0, (int)cache2.get("key"));
+            assertEquals(1, (int)cache1.get("key1"));
+            assertEquals(2, (int)cache2.get("key2"));
+        }
+        finally {
+            if (jtaTx.getStatus() == Status.STATUS_ACTIVE)
+                jtaTx.rollback();
+        }
+
+        assertEquals(0, (int)cache1.get("key"));
+        assertEquals(0, (int)cache2.get("key"));
+        assertEquals(1, (int)cache1.get("key1"));
+        assertEquals(2, (int)cache2.get("key2"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/334ce4c9/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaFactorySelfTest.java b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaFactorySelfTest.java
index 8d53d7f..f079974 100644
--- a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaFactorySelfTest.java
+++ b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaFactorySelfTest.java
@@ -25,7 +25,7 @@ import org.objectweb.transaction.jta.TransactionManager;
 /**
  * Factory JTA integration test using PARTITIONED cache.
  */
-public class GridPartitionedCacheJtaFactorySelfTest extends AbstarctCacheJtaSelfTest {
+public class GridPartitionedCacheJtaFactorySelfTest extends AbstractCacheJtaSelfTest {
     /** {@inheritDoc} */
     @Override protected void configureJta(IgniteConfiguration cfg) {
         TransactionConfiguration txCfg = cfg.getTransactionConfiguration();

http://git-wip-us.apache.org/repos/asf/ignite/blob/334ce4c9/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaFactoryUseSyncSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaFactoryUseSyncSelfTest.java b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaFactoryUseSyncSelfTest.java
new file mode 100644
index 0000000..5e6deee
--- /dev/null
+++ b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaFactoryUseSyncSelfTest.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.processors.cache;
+
+import org.apache.ignite.configuration.IgniteConfiguration;
+
+/**
+ * Factory JTA integration test using PARTITIONED cache.
+ */
+public class GridPartitionedCacheJtaFactoryUseSyncSelfTest extends GridPartitionedCacheJtaFactorySelfTest {
+    /** {@inheritDoc} */
+    @Override protected void configureJta(IgniteConfiguration cfg) {
+        super.configureJta(cfg);
+
+        cfg.getTransactionConfiguration().setUseJtaSynchronization(true);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/334ce4c9/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaLookupClassNameSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaLookupClassNameSelfTest.java b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaLookupClassNameSelfTest.java
index ccebb9f..2e322f8 100644
--- a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaLookupClassNameSelfTest.java
+++ b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaLookupClassNameSelfTest.java
@@ -30,7 +30,7 @@ import org.apache.ignite.testframework.GridTestUtils;
 /**
  * Lookup class name based JTA integration test using PARTITIONED cache.
  */
-public class GridPartitionedCacheJtaLookupClassNameSelfTest extends AbstarctCacheJtaSelfTest {
+public class GridPartitionedCacheJtaLookupClassNameSelfTest extends AbstractCacheJtaSelfTest {
     /** {@inheritDoc} */
     @Override protected void configureJta(IgniteConfiguration cfg) {
         cfg.getTransactionConfiguration().setTxManagerLookupClassName(TestTmLookup.class.getName());

http://git-wip-us.apache.org/repos/asf/ignite/blob/334ce4c9/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridReplicatedCacheJtaFactoryUseSyncSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridReplicatedCacheJtaFactoryUseSyncSelfTest.java b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridReplicatedCacheJtaFactoryUseSyncSelfTest.java
new file mode 100644
index 0000000..e25f5e8
--- /dev/null
+++ b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridReplicatedCacheJtaFactoryUseSyncSelfTest.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.processors.cache;
+
+import org.apache.ignite.configuration.IgniteConfiguration;
+
+/**
+ * Factory JTA integration test using REPLICATED cache.
+ */
+public class GridReplicatedCacheJtaFactoryUseSyncSelfTest extends GridReplicatedCacheJtaFactorySelfTest {
+    /** {@inheritDoc} */
+    @Override protected void configureJta(IgniteConfiguration cfg) {
+        super.configureJta(cfg);
+
+        cfg.getTransactionConfiguration().setUseJtaSynchronization(true);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/334ce4c9/modules/jta/src/test/java/org/apache/ignite/testsuites/IgniteJtaTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/test/java/org/apache/ignite/testsuites/IgniteJtaTestSuite.java b/modules/jta/src/test/java/org/apache/ignite/testsuites/IgniteJtaTestSuite.java
index 6e0c096..60c20dd 100644
--- a/modules/jta/src/test/java/org/apache/ignite/testsuites/IgniteJtaTestSuite.java
+++ b/modules/jta/src/test/java/org/apache/ignite/testsuites/IgniteJtaTestSuite.java
@@ -22,8 +22,10 @@ import org.apache.ignite.internal.processors.cache.CacheJndiTmFactorySelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheJtaConfigurationValidationSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheJtaFactoryConfigValidationSelfTest;
 import org.apache.ignite.internal.processors.cache.GridPartitionedCacheJtaFactorySelfTest;
+import org.apache.ignite.internal.processors.cache.GridPartitionedCacheJtaFactoryUseSyncSelfTest;
 import org.apache.ignite.internal.processors.cache.GridPartitionedCacheJtaLookupClassNameSelfTest;
 import org.apache.ignite.internal.processors.cache.GridReplicatedCacheJtaFactorySelfTest;
+import org.apache.ignite.internal.processors.cache.GridReplicatedCacheJtaFactoryUseSyncSelfTest;
 import org.apache.ignite.internal.processors.cache.GridReplicatedCacheJtaLookupClassNameSelfTest;
 import org.apache.ignite.internal.processors.cache.GridJtaLifecycleAwareSelfTest;
 
@@ -44,6 +46,9 @@ public class IgniteJtaTestSuite extends TestSuite {
         suite.addTestSuite(GridPartitionedCacheJtaLookupClassNameSelfTest.class);
         suite.addTestSuite(GridReplicatedCacheJtaLookupClassNameSelfTest.class);
 
+        suite.addTestSuite(GridPartitionedCacheJtaFactoryUseSyncSelfTest.class);
+        suite.addTestSuite(GridReplicatedCacheJtaFactoryUseSyncSelfTest.class);
+
         suite.addTestSuite(GridJtaLifecycleAwareSelfTest.class);
         suite.addTestSuite(GridCacheJtaConfigurationValidationSelfTest.class);
         suite.addTestSuite(GridCacheJtaFactoryConfigValidationSelfTest.class);


[09/12] ignite git commit: IGNITE-2753: Removed unnecessary deserialization of keys and values passed to store manager. This closes #537.

Posted by vo...@apache.org.
IGNITE-2753: Removed unnecessary deserialization of keys and values passed to store manager. This closes #537.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b46ed10a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b46ed10a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b46ed10a

Branch: refs/heads/ignite-1786
Commit: b46ed10acfc46117dd597c1e7e986e4216bfd047
Parents: a8d16bd
Author: dkarachentsev <dk...@gridgain.com>
Authored: Thu Mar 10 14:05:40 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 10 14:05:40 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     |  25 +-
 .../distributed/dht/GridDhtCacheEntry.java      |   2 +-
 ...ridCacheStoreManagerDeserializationTest.java | 345 +++++++++++++++++++
 ...calCacheStoreManagerDeserializationTest.java | 101 ++++++
 .../testsuites/IgniteCacheTestSuite4.java       |  11 +-
 5 files changed, 468 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b46ed10a/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 1658b85..16ff153 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
@@ -208,7 +208,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
         // In case we deal with IGFS cache, count updated data
         if (cctx.cache().isIgfsDataCache() &&
-            cctx.kernalContext().igfsHelper().isIgfsBlockKey(key.value(cctx.cacheObjectContext(), false))) {
+            cctx.kernalContext().igfsHelper().isIgfsBlockKey(keyValue(false))) {
             int newSize = valueLength0(val, null);
             int oldSize = valueLength0(this.val, (this.val == null && hasOffHeapPointer()) ? valueBytes0() : null);
 
@@ -591,7 +591,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                 }
 
                 keyClsLdrId = cctx.deploy().getClassLoaderId(
-                    U.detectObjectClassLoader(key.value(cctx.cacheObjectContext(), false)));
+                    U.detectObjectClassLoader(keyValue(false)));
             }
 
             IgniteBiTuple<byte[], Byte> valBytes = valueBytes0();
@@ -1250,7 +1250,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
         // Persist outside of synchronization. The correctness of the
         // value will be handled by current transaction.
         if (writeThrough)
-            cctx.store().put(tx, keyValue(false), CU.value(val, cctx, false), newVer);
+            cctx.store().put(tx, key, val, newVer);
 
         if (intercept)
             cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepBinary));
@@ -1718,7 +1718,8 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
                 if (writeThrough)
                     // Must persist inside synchronization in non-tx mode.
-                    cctx.store().put(null, keyValue(false), CU.value(updated, cctx, false), ver);
+                    cctx.store().put(null, key, updated, ver);
+
 
                 // Update index inside synchronization since it can be updated
                 // in load methods without actually holding entry lock.
@@ -1752,7 +1753,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
             else {
                 if (writeThrough)
                     // Must persist inside synchronization in non-tx mode.
-                    cctx.store().remove(null, keyValue(false));
+                    cctx.store().remove(null, key);
 
                 boolean hasValPtr = hasOffHeapPointer();
 
@@ -1978,10 +1979,10 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                             if (val == null) {
                                 assert deletedUnlocked();
 
-                                cctx.store().remove(null, keyValue(false));
+                                cctx.store().remove(null, key);
                             }
                             else
-                                cctx.store().put(null, keyValue(false), CU.value(val, cctx, false), ver);
+                                cctx.store().put(null, key, val, ver);
                         }
 
                         return new GridCacheUpdateAtomicResult(false,
@@ -2031,10 +2032,10 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                             if (val == null) {
                                 assert deletedUnlocked();
 
-                                cctx.store().remove(null, keyValue(false));
+                                cctx.store().remove(null, key);
                             }
                             else
-                                cctx.store().put(null, keyValue(false), CU.value(val, cctx, false), ver);
+                                cctx.store().put(null, key, val, ver);
                         }
                         else {
                             if (log.isDebugEnabled())
@@ -3295,7 +3296,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
                 if (cctx.store().isLocal()) {
                     if (val != null)
-                        cctx.store().put(null, keyValue(false), CU.value(val, cctx, false), ver);
+                        cctx.store().put(null, key, val, ver);
                 }
 
                 return true;
@@ -3358,7 +3359,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
         CacheObject val = isNew ? unswap(true) : rawGetOrUnmarshalUnlocked(false);
 
-        return new GridCachePlainVersionedEntry<>(key.value(cctx.cacheObjectContext(), true),
+        return new GridCachePlainVersionedEntry<>(keyValue(true),
             CU.value(val, cctx, true),
             ttlExtras(),
             expireTimeExtras(),
@@ -4106,7 +4107,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                         }
 
                         keyClsLdrId = cctx.deploy().getClassLoaderId(
-                            U.detectObjectClassLoader(key.value(cctx.cacheObjectContext(), false)));
+                            U.detectObjectClassLoader(keyValue(false)));
                     }
 
                     IgniteBiTuple<byte[], Byte> valBytes = valueBytes0();

http://git-wip-us.apache.org/repos/asf/ignite/blob/b46ed10a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
index fae8219..ab51bdb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
@@ -590,7 +590,7 @@ public class GridDhtCacheEntry extends GridDistributedCacheEntry {
                 }
 
                 if (cctx.store().isLocal())
-                    cctx.store().remove(null, keyValue(false));
+                    cctx.store().remove(null, key);
 
                 rmv = true;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b46ed10a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManagerDeserializationTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManagerDeserializationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManagerDeserializationTest.java
new file mode 100644
index 0000000..9fe60e0
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManagerDeserializationTest.java
@@ -0,0 +1,345 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.binary.BinaryObjectBuilder;
+import org.apache.ignite.cache.CacheAtomicWriteOrderMode;
+import org.apache.ignite.cache.CacheAtomicityMode;
+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;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.internal.processors.cache.extras.GridCacheObsoleteEntryExtras;
+import org.apache.ignite.internal.processors.cache.store.CacheLocalStore;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
+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.jsr166.ConcurrentHashMap8;
+
+import javax.cache.Cache;
+import javax.cache.integration.CacheLoaderException;
+import javax.cache.integration.CacheWriterException;
+import java.io.Serializable;
+import java.util.Map;
+
+import static org.apache.ignite.cache.CacheRebalanceMode.SYNC;
+
+/**
+ * Checks whether storing to local store doesn't cause binary objects unmarshalling,
+ * and as a consequence {@link ClassNotFoundException} to be thrown.
+ *
+ * @see <a href="https://issues.apache.org/jira/browse/IGNITE-2753">
+ *     https://issues.apache.org/jira/browse/IGNITE-2753
+ *     </a>
+ */
+public class GridCacheStoreManagerDeserializationTest extends GridCommonAbstractTest {
+    /** IP finder. */
+    protected static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /** Cache store. */
+    protected static final GridCacheLocalTestStore store = new GridCacheLocalTestStore();
+
+    /** Test cache name. */
+    protected static final String CACHE_NAME = "cache_name";
+
+    /** Cache mode. */
+    protected CacheMode cacheMode() {
+        return CacheMode.PARTITIONED;
+    }
+
+    /** Cache write order mode. */
+    protected CacheAtomicWriteOrderMode cacheAtomicWriteOrderMode() {
+        return CacheAtomicWriteOrderMode.PRIMARY;
+    }
+
+    /** Cache synchronization mode. */
+    private CacheWriteSynchronizationMode cacheWriteSynchronizationMode() {
+        return CacheWriteSynchronizationMode.FULL_SYNC;
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
+    @Override protected IgniteConfiguration getConfiguration(final String gridName) throws Exception {
+        IgniteConfiguration c = super.getConfiguration(gridName);
+
+        if (gridName != null && gridName.toLowerCase().startsWith("binary"))
+            c.setMarshaller(new BinaryMarshaller());
+        else
+            c.setMarshaller(new OptimizedMarshaller());
+
+        TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+        disco.setIpFinder(IP_FINDER);
+
+        c.setDiscoverySpi(disco);
+
+        c.setCacheConfiguration(cacheConfiguration());
+
+        return c;
+    }
+
+    /**
+     * @return Cache configuration.
+     */
+    @SuppressWarnings("unchecked")
+    protected CacheConfiguration cacheConfiguration() {
+        CacheConfiguration cc = defaultCacheConfiguration();
+
+        cc.setSwapEnabled(false);
+        cc.setRebalanceMode(SYNC);
+
+        cc.setCacheStoreFactory(singletonFactory(store));
+        cc.setReadThrough(true);
+        cc.setWriteThrough(true);
+        cc.setLoadPreviousValue(true);
+        cc.setStoreKeepBinary(true);
+
+        cc.setCacheMode(cacheMode());
+        cc.setAtomicWriteOrderMode(cacheAtomicWriteOrderMode());
+        cc.setWriteSynchronizationMode(cacheWriteSynchronizationMode());
+
+        cc.setBackups(0);
+
+        cc.setAtomicityMode(CacheAtomicityMode.ATOMIC);
+
+        return cc;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        store.map.clear();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        stopAllGrids();
+    }
+
+    /**
+     * Check whether test objects are stored correctly via stream API.
+     *
+     * @throws Exception
+     */
+    public void testStream() throws Exception {
+        final Ignite grid = startGrid();
+
+        final IgniteCache<TestObj, TestObj> cache = grid.createCache(CACHE_NAME);
+
+        final TestObj testObj = streamData(grid);
+
+        cache.destroy();
+        cache.close();
+
+        assert store.map.containsKey(testObj);
+
+        final IgniteCache<TestObj, TestObj> cache2 = grid.createCache(CACHE_NAME);
+
+        assert testObj.equals(cache2.get(testObj));
+        assert store.map.containsKey(testObj);
+    }
+
+    /**
+     * Simulate case where is called
+     * {@link org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheEntry#clearInternal(
+     * GridCacheVersion, boolean, GridCacheObsoleteEntryExtras)}
+     *
+     * @throws Exception
+     */
+    public void testPartitionMove() throws Exception {
+        final Ignite grid = startGrid("binaryGrid1");
+
+        grid.createCache(CACHE_NAME);
+
+        final BinaryObjectBuilder builder = grid.binary().builder("custom_type");
+
+        final IgniteDataStreamer<BinaryObject, BinaryObject> streamer = grid.dataStreamer(CACHE_NAME);
+
+        streamer.keepBinary(true);
+
+        final int itemsNum = 10_000;
+
+        for (int i = 0; i < itemsNum; i++) {
+            final BinaryObject key = builder.setField("id", i).build();
+
+            streamer.addData(key, key);
+        }
+
+        streamer.close();
+
+        streamer.future().get();
+
+        assert store.map.size() == itemsNum;
+
+        startGrid("binaryGrid2");
+        startGrid("binaryGrid3");
+        startGrid("binaryGrid4");
+
+        Thread.sleep(10_000);
+    }
+
+    /**
+     * Check whether binary objects are stored without unmarshalling via stream API.
+     *
+     * @throws Exception
+     */
+    public void testBinaryStream() throws Exception {
+        final Ignite grid = startGrid("binaryGrid");
+
+        final IgniteCache<BinaryObject, BinaryObject> cache = grid.createCache(CACHE_NAME).withKeepBinary();
+
+        final BinaryObject key = streamBinaryData(grid);
+
+        assert cache.containsKey(key);
+        assert store.map.containsKey(key);
+
+        cache.destroy();
+        cache.close();
+
+        assert store.map.containsKey(key);
+
+        final IgniteCache<BinaryObject, BinaryObject> cache2 = grid.createCache(CACHE_NAME).withKeepBinary();
+
+        final BinaryObject loaded = cache2.get(key);
+
+        assert loaded == key;
+        assert store.map.containsKey(key);
+    }
+
+    /**
+     * Create and add test data via Streamer API.
+     *
+     * @param grid to get streamer.
+     * @return test object (it is key and val).
+     */
+    private TestObj streamData(final Ignite grid) {
+        final IgniteDataStreamer<TestObj, TestObj> streamer = grid.dataStreamer(CACHE_NAME);
+
+        TestObj entity = null;
+
+        for (int i = 0; i < 1; i++) {
+            entity = new TestObj(i);
+
+            streamer.addData(entity, entity);
+        }
+
+        streamer.flush();
+        streamer.close();
+        streamer.future().get();
+
+        return entity;
+    }
+
+    /**
+     * Create and add binary data via Streamer API.
+     *
+     * @param grid to get streamer.
+     * @return test object (it is key and val).
+     */
+    private BinaryObject streamBinaryData(final Ignite grid) {
+        final IgniteDataStreamer<BinaryObject, BinaryObject> streamer = grid.dataStreamer(CACHE_NAME);
+
+        streamer.keepBinary(true);
+
+        final BinaryObjectBuilder builder = grid.binary().builder("custom_type");
+
+        BinaryObject entity = null;
+
+        for (int i = 0; i < 1; i++) {
+            builder.setField("id", i);
+
+            entity = builder.build();
+
+            streamer.addData(entity, entity);
+        }
+
+        streamer.flush();
+        streamer.close();
+        streamer.future().get();
+
+        return entity;
+    }
+
+    /**
+     * Local store mock.
+     *
+     * @param <K>
+     * @param <V>
+     */
+    @CacheLocalStore
+    protected static class GridCacheLocalTestStore<K, V> extends CacheStoreAdapter<K, V> {
+        /** */
+        public final Map<K, V> map = new ConcurrentHashMap8<>();
+
+        /** {@inheritDoc} */
+        @Override public V load(final K key) throws CacheLoaderException {
+            return map.get(key);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void write(final Cache.Entry<? extends K, ? extends V> entry) throws CacheWriterException {
+            map.put(entry.getKey(), entry.getValue());
+        }
+
+        /** {@inheritDoc} */
+        @Override public void delete(final Object key) throws CacheWriterException {
+            map.remove(key);
+        }
+    }
+
+    /**
+     * Test object.
+     */
+    static class TestObj implements Serializable {
+        /** */
+        Integer val;
+
+        /** */
+        public TestObj() {
+        }
+
+        /** */
+        public TestObj(final Integer val) {
+            this.val = val;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean equals(final Object o) {
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;
+
+            final TestObj testObj = (TestObj) o;
+
+            return val != null ? val.equals(testObj.val) : testObj.val == null;
+
+        }
+
+        /** {@inheritDoc} */
+        @Override public int hashCode() {
+            return val != null ? val.hashCode() : 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/b46ed10a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridLocalCacheStoreManagerDeserializationTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridLocalCacheStoreManagerDeserializationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridLocalCacheStoreManagerDeserializationTest.java
new file mode 100644
index 0000000..827b3cf
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridLocalCacheStoreManagerDeserializationTest.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.binary.BinaryObjectBuilder;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+
+import javax.cache.expiry.ExpiryPolicy;
+import java.util.UUID;
+
+/**
+ * Checks whether storing to local store doesn't cause binary objects unmarshalling,
+ * and as a consequence {@link ClassNotFoundException} to be thrown.
+ *
+ * @see <a href="https://issues.apache.org/jira/browse/IGNITE-2753">
+ *     https://issues.apache.org/jira/browse/IGNITE-2753
+ *     </a>
+ */
+public class GridLocalCacheStoreManagerDeserializationTest extends GridCacheStoreManagerDeserializationTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return CacheMode.LOCAL;
+    }
+
+    /**
+     * Checks no additional unmarshalling happens in calling
+     * {@link GridCacheMapEntry#innerUpdateLocal(GridCacheVersion, GridCacheOperation, Object, Object[],
+     * boolean, boolean, boolean, boolean, ExpiryPolicy, boolean, boolean, CacheEntryPredicate[],
+     * boolean, UUID, String)}.
+     *
+     * @throws Exception
+     */
+    public void testUpdate() throws Exception {
+        // Goal is to check correct saving to store (no exception must be thrown)
+
+        final Ignite grid = startGrid();
+
+        final IgniteCache<TestObj, TestObj> cache = grid.createCache(CACHE_NAME);
+
+        final TestObj testObj = new TestObj(0);
+
+        cache.put(testObj, testObj);
+
+        assert testObj.equals(cache.get(testObj));
+        assert store.map.containsKey(testObj);
+
+        cache.remove(testObj);
+
+        assert cache.get(testObj) == null;
+        assert !store.map.containsKey(testObj);
+    }
+
+    /**
+     * Checks no additional unmarshalling happens in calling
+     * {@link GridCacheMapEntry#innerUpdateLocal(GridCacheVersion, GridCacheOperation, Object, Object[],
+     * boolean, boolean, boolean, boolean, ExpiryPolicy, boolean, boolean, CacheEntryPredicate[],
+     * boolean, UUID, String)} for binary objects.
+     *
+     * @throws Exception
+     */
+    public void testBinaryUpdate() throws Exception {
+        // Goal is to check correct saving to store (no exception must be thrown)
+        final Ignite grid = startGrid("binaryGrid");
+
+        final IgniteCache<BinaryObject, BinaryObject> cache = grid.createCache(CACHE_NAME).withKeepBinary();
+
+        final BinaryObjectBuilder builder = grid.binary().builder("custom_type");
+
+        final BinaryObject entity = builder.setField("id", 0).build();
+
+        cache.put(entity, entity);
+
+        assert entity.equals(cache.get(entity));
+        assert store.map.containsKey(entity);
+
+        cache.remove(entity);
+
+        assert cache.get(entity) == null;
+        assert !store.map.containsKey(entity);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/b46ed10a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index 45679dd..7aab990 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -19,15 +19,14 @@ package org.apache.ignite.testsuites;
 
 import junit.framework.TestSuite;
 import org.apache.ignite.cache.store.jdbc.CacheJdbcStoreSessionListenerSelfTest;
+import org.apache.ignite.internal.processors.GridCacheTxLoadFromStoreOnLockSelfTest;
+import org.apache.ignite.internal.processors.cache.CacheClientStoreSelfTest;
 import org.apache.ignite.internal.processors.cache.CacheGetEntryOptimisticReadCommittedSeltTest;
 import org.apache.ignite.internal.processors.cache.CacheGetEntryOptimisticRepeatableReadSeltTest;
 import org.apache.ignite.internal.processors.cache.CacheGetEntryOptimisticSerializableSeltTest;
 import org.apache.ignite.internal.processors.cache.CacheGetEntryPessimisticReadCommittedSeltTest;
 import org.apache.ignite.internal.processors.cache.CacheGetEntryPessimisticRepeatableReadSeltTest;
 import org.apache.ignite.internal.processors.cache.CacheGetEntryPessimisticSerializableSeltTest;
-import org.apache.ignite.internal.processors.cache.IgniteCacheGetCustomCollectionsSelfTest;
-import org.apache.ignite.internal.processors.GridCacheTxLoadFromStoreOnLockSelfTest;
-import org.apache.ignite.internal.processors.cache.CacheClientStoreSelfTest;
 import org.apache.ignite.internal.processors.cache.CacheOffheapMapEntrySelfTest;
 import org.apache.ignite.internal.processors.cache.CacheReadThroughAtomicRestartSelfTest;
 import org.apache.ignite.internal.processors.cache.CacheReadThroughLocalAtomicRestartSelfTest;
@@ -49,7 +48,9 @@ import org.apache.ignite.internal.processors.cache.GridCacheMultinodeUpdateAtomi
 import org.apache.ignite.internal.processors.cache.GridCacheMultinodeUpdateNearEnabledNoBackupsSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheMultinodeUpdateNearEnabledSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheMultinodeUpdateSelfTest;
+import org.apache.ignite.internal.processors.cache.GridCacheStoreManagerDeserializationTest;
 import org.apache.ignite.internal.processors.cache.GridCacheVersionMultinodeTest;
+import org.apache.ignite.internal.processors.cache.GridLocalCacheStoreManagerDeserializationTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheAtomicCopyOnReadDisabledTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheAtomicLocalPeekModesTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheAtomicLocalStoreValueTest;
@@ -63,6 +64,7 @@ import org.apache.ignite.internal.processors.cache.IgniteCacheAtomicStoreValueTe
 import org.apache.ignite.internal.processors.cache.IgniteCacheConfigurationDefaultTemplateTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheConfigurationTemplateTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheDynamicStopSelfTest;
+import org.apache.ignite.internal.processors.cache.IgniteCacheGetCustomCollectionsSelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheInvokeReadThroughTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheLoadRebalanceEvictionSelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheTxCopyOnReadDisabledTest;
@@ -266,6 +268,9 @@ public class IgniteCacheTestSuite4 extends TestSuite {
         suite.addTestSuite(CacheStoreUsageMultinodeDynamicStartAtomicTest.class);
         suite.addTestSuite(CacheStoreUsageMultinodeDynamicStartTxTest.class);
 
+        suite.addTestSuite(GridCacheStoreManagerDeserializationTest.class);
+        suite.addTestSuite(GridLocalCacheStoreManagerDeserializationTest.class);
+
         suite.addTestSuite(IgniteStartCacheInTransactionSelfTest.class);
         suite.addTestSuite(IgniteStartCacheInTransactionAtomicSelfTest.class);
 


[11/12] ignite git commit: IGNITE-2700: Closures are now written using binary marshaller. This closes #518.

Posted by vo...@apache.org.
IGNITE-2700: Closures are now written using binary marshaller. This closes #518.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/215e8a1e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/215e8a1e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/215e8a1e

Branch: refs/heads/ignite-1786
Commit: 215e8a1e3143bf22d792fdefbd4e6a65b372ae24
Parents: 8cf71d4
Author: Ilya Lantukh <il...@gridgain.com>
Authored: Thu Mar 10 15:37:14 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 10 15:37:14 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/binary/BinaryContext.java   |  29 +-
 .../internal/binary/BinaryFieldAccessor.java    |   1 +
 .../closure/GridClosureProcessor.java           | 375 ++++++++++++++++-
 .../resources/META-INF/classnames.properties    |   6 +
 .../ignite/internal/GridAffinitySelfTest.java   |   4 +-
 ...omputationBinarylizableClosuresSelfTest.java | 413 +++++++++++++++++++
 .../binary/BinaryMarshallerSelfTest.java        |  50 +++
 ...IgniteBinaryObjectsComputeGridTestSuite.java |   7 +-
 8 files changed, 858 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/215e8a1e/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
index 4df9ba2..b9b633f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
@@ -61,6 +61,7 @@ import org.apache.ignite.cache.affinity.AffinityKeyMapped;
 import org.apache.ignite.configuration.BinaryConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.processors.cache.binary.BinaryMetadataKey;
+import org.apache.ignite.internal.processors.closure.GridClosureProcessor;
 import org.apache.ignite.internal.processors.datastructures.CollocatedQueueItemKey;
 import org.apache.ignite.internal.processors.datastructures.CollocatedSetItemKey;
 import org.apache.ignite.internal.util.IgniteUtils;
@@ -89,6 +90,23 @@ public class BinaryContext {
     static final BinaryInternalMapper SIMPLE_NAME_LOWER_CASE_MAPPER =
         new BinaryInternalMapper(new BinaryBasicNameMapper(true), new BinaryBasicIdMapper(true), false);
 
+    /** Set of system classes that should be marshalled with BinaryMarshaller. */
+    private static final Set<String> BINARYLIZABLE_SYS_CLSS;
+
+    /** Binarylizable system classes set initialization. */
+    static {
+        Set<String> sysClss = new HashSet<>();
+
+        sysClss.add(GridClosureProcessor.C1V2.class.getName());
+        sysClss.add(GridClosureProcessor.C1MLAV2.class.getName());
+        sysClss.add(GridClosureProcessor.C2V2.class.getName());
+        sysClss.add(GridClosureProcessor.C2MLAV2.class.getName());
+        sysClss.add(GridClosureProcessor.C4V2.class.getName());
+        sysClss.add(GridClosureProcessor.C4MLAV2.class.getName());
+
+        BINARYLIZABLE_SYS_CLSS = Collections.unmodifiableSet(sysClss);
+    }
+
     /** */
     private final ConcurrentMap<Class<?>, BinaryClassDescriptor> descByCls = new ConcurrentHashMap8<>();
 
@@ -255,7 +273,7 @@ public class BinaryContext {
     /**
      * @return Ignite configuration.
      */
-    public IgniteConfiguration configuration(){
+    public IgniteConfiguration configuration() {
         return igniteCfg;
     }
 
@@ -587,6 +605,11 @@ public class BinaryContext {
         String clsName = cls.getName();
 
         if (marshCtx.isSystemType(clsName)) {
+            BinarySerializer serializer = null;
+
+            if (BINARYLIZABLE_SYS_CLSS.contains(clsName))
+                serializer = new BinaryReflectiveSerializer();
+
             desc = new BinaryClassDescriptor(this,
                 cls,
                 false,
@@ -594,7 +617,7 @@ public class BinaryContext {
                 clsName,
                 null,
                 SIMPLE_NAME_LOWER_CASE_MAPPER,
-                null,
+                serializer,
                 false,
                 true /* registered */
             );
@@ -775,7 +798,7 @@ public class BinaryContext {
 
         if (prevMap != null && !mapper.equals(prevMap))
             throw new IgniteException("Different mappers [clsName=" + clsName + ", newMapper=" + mapper
-            + ", prevMap=" + prevMap + "]");
+                + ", prevMap=" + prevMap + "]");
 
         prevMap = typeId2Mapper.putIfAbsent(mapper.typeId(clsName), mapper);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/215e8a1e/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java
index 8c8bf27..af33b63 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java
@@ -619,6 +619,7 @@ public abstract class BinaryFieldAccessor {
 
                 case BINARY:
                 case OBJECT:
+                case PROXY:
                     writer.writeObjectField(val);
 
                     break;

http://git-wip-us.apache.org/repos/asf/ignite/blob/215e8a1e/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
index 043f754..c6883dc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
@@ -31,6 +31,12 @@ import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.TimeUnit;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
+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.compute.ComputeJob;
 import org.apache.ignite.compute.ComputeJobMasterLeaveAware;
@@ -61,6 +67,7 @@ import org.apache.ignite.internal.util.worker.GridWorker;
 import org.apache.ignite.internal.util.worker.GridWorkerFuture;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgniteProductVersion;
 import org.apache.ignite.lang.IgniteReducer;
 import org.apache.ignite.marshaller.Marshaller;
 import org.apache.ignite.resources.LoadBalancerResource;
@@ -76,6 +83,9 @@ import static org.apache.ignite.internal.processors.task.GridTaskThreadContextKe
  *
  */
 public class GridClosureProcessor extends GridProcessorAdapter {
+    /** Ignite version in which binarylizable versions of closures were introduced. */
+    public static final IgniteProductVersion BINARYLIZABLE_CLOSURES_SINCE = IgniteProductVersion.fromString("1.6.0");
+
     /** */
     private final Executor sysPool;
 
@@ -254,7 +264,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
                     case BROADCAST: {
                         for (ClusterNode n : nodes)
                             for (Runnable r : jobs)
-                                mapper.map(job(r), n);
+                                mapper.map(downgradeJobIfNeeded(job(r), n), n);
 
                         break;
                     }
@@ -263,7 +273,9 @@ public class GridClosureProcessor extends GridProcessorAdapter {
                         for (Runnable r : jobs) {
                             ComputeJob job = job(r);
 
-                            mapper.map(job, lb.getBalancedNode(job, null));
+                            ClusterNode n = lb.getBalancedNode(job, null);
+
+                            mapper.map(downgradeJobIfNeeded(job, n), n);
                         }
 
                         break;
@@ -306,7 +318,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
                     case BROADCAST: {
                         for (ClusterNode n : nodes)
                             for (Callable<R> c : jobs)
-                                mapper.map(job(c), n);
+                                mapper.map(downgradeJobIfNeeded(job(c), n), n);
 
                         break;
                     }
@@ -315,7 +327,9 @@ public class GridClosureProcessor extends GridProcessorAdapter {
                         for (Callable<R> c : jobs) {
                             ComputeJob job = job(c);
 
-                            mapper.map(job, lb.getBalancedNode(job, null));
+                            ClusterNode n = lb.getBalancedNode(job, null);
+
+                            mapper.map(downgradeJobIfNeeded(job, n), n);
                         }
 
                         break;
@@ -1025,7 +1039,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
     private static <T, R> ComputeJob job(final IgniteClosure<T, R> job, @Nullable final T arg) {
         A.notNull(job, "job");
 
-        return job instanceof ComputeJobMasterLeaveAware ? new C1MLA<>(job, arg) : new C1<>(job, arg);
+        return job instanceof ComputeJobMasterLeaveAware ? new C1MLAV2<>(job, arg) : new C1V2<>(job, arg);
     }
 
     /**
@@ -1037,7 +1051,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
     private static <R> ComputeJob job(final Callable<R> c) {
         A.notNull(c, "job");
 
-        return c instanceof ComputeJobMasterLeaveAware ? new C2MLA<>(c) : new C2<>(c);
+        return c instanceof ComputeJobMasterLeaveAware ? new C2MLAV2<>(c) : new C2V2<>(c);
     }
 
     /**
@@ -1049,7 +1063,46 @@ public class GridClosureProcessor extends GridProcessorAdapter {
     private static ComputeJob job(final Runnable r) {
         A.notNull(r, "job");
 
-       return r instanceof ComputeJobMasterLeaveAware ? new C4MLA(r) : new C4(r);
+        return r instanceof ComputeJobMasterLeaveAware ? new C4MLAV2(r) : new C4V2(r);
+    }
+
+    /**
+     * Downgrades provided job to older version if target does not support it.
+     *
+     * @param job Job.
+     * @param node Node.
+     * @return Provided or downgraded job.
+     */
+    private static ComputeJob downgradeJobIfNeeded(ComputeJob job, ClusterNode node) {
+        A.notNull(job, "job");
+
+        assert node != null;
+
+        IgniteProductVersion nodeVer = node.version();
+
+        if (nodeVer.compareTo(BINARYLIZABLE_CLOSURES_SINCE) >= 0)
+            return job;
+
+        if (job instanceof C1V2) {
+            if (job instanceof C1MLAV2)
+                return new C1MLA<>(((C1MLAV2)job).job, ((C1MLAV2)job).arg);
+            else
+                return new C1<>(((C1V2)job).job, ((C1V2)job).arg);
+        }
+        else if (job instanceof C2V2) {
+            if (job instanceof C2MLAV2)
+                return new C2MLA<>(((C2MLAV2)job).c);
+            else
+                return new C2<>(((C2V2)job).c);
+        }
+        else if (job instanceof C4V2) {
+            if (job instanceof C4MLAV2)
+                return new C4MLA(((C4MLAV2)job).r);
+            else
+                return new C4(((C4V2)job).r);
+        }
+
+        return job;
     }
 
     /**
@@ -1294,9 +1347,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
         /** {@inheritDoc} */
         @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
-            ComputeJob job = job(this.job);
-
-            return Collections.singletonMap(job, node);
+            return Collections.singletonMap(downgradeJobIfNeeded(job(this.job), node), node);
         }
 
         /** {@inheritDoc} */
@@ -1348,9 +1399,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
         /** {@inheritDoc} */
         @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
-            ComputeJob job = job(this.job);
-
-            return Collections.singletonMap(job, node);
+            return Collections.singletonMap(downgradeJobIfNeeded(job(this.job), node), node);
         }
 
         /** {@inheritDoc} */
@@ -1488,7 +1537,9 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
             ComputeJob job = job(this.job, this.arg);
 
-            return Collections.singletonMap(job, lb.getBalancedNode(job, null));
+            ClusterNode node = lb.getBalancedNode(job, null);
+
+            return Collections.singletonMap(downgradeJobIfNeeded(job, node), node);
         }
 
         /** {@inheritDoc} */
@@ -1537,7 +1588,9 @@ public class GridClosureProcessor extends GridProcessorAdapter {
                 for (T jobArg : args) {
                     ComputeJob job = job(this.job, jobArg);
 
-                    mapper.map(job, lb.getBalancedNode(job, null));
+                    ClusterNode node = lb.getBalancedNode(job, null);
+
+                    mapper.map(downgradeJobIfNeeded(job, node), node);
                 }
 
                 return mapper.map();
@@ -1593,7 +1646,9 @@ public class GridClosureProcessor extends GridProcessorAdapter {
                 for (T jobArg : args) {
                     ComputeJob job = job(this.job, jobArg);
 
-                    mapper.map(job, lb.getBalancedNode(job, null));
+                    ClusterNode node = lb.getBalancedNode(job, null);
+
+                    mapper.map(downgradeJobIfNeeded(job, node), node);
                 }
 
                 return mapper.map();
@@ -1607,7 +1662,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         @Override public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) {
             ComputeJobResultPolicy resPlc = super.result(res, rcvd);
 
-            if (res.getException() == null && resPlc != FAILOVER && !rdc.collect((R1) res.getData()))
+            if (res.getException() == null && resPlc != FAILOVER && !rdc.collect((R1)res.getData()))
                 resPlc = REDUCE; // If reducer returned false - reduce right away.
 
             return resPlc;
@@ -1647,7 +1702,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
                 JobMapper mapper = new JobMapper(subgrid.size());
 
                 for (ClusterNode n : subgrid)
-                    mapper.map(job(job, arg), n);
+                    mapper.map(downgradeJobIfNeeded(job(job, arg), n), n);
 
                 return mapper.map();
             }
@@ -1680,7 +1735,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         /**
          *
          */
-        public C1(){
+        public C1() {
             // No-op.
         }
 
@@ -1729,6 +1784,72 @@ public class GridClosureProcessor extends GridProcessorAdapter {
     /**
      *
      */
+    public static class C1V2<T, R> implements ComputeJob, Binarylizable, GridNoImplicitInjection,
+        GridInternalWrapper<IgniteClosure> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /** */
+        protected IgniteClosure<T, R> job;
+
+        /** */
+        @GridToStringInclude
+        protected T arg;
+
+        /**
+         *
+         */
+        public C1V2() {
+            // No-op.
+        }
+
+        /**
+         * @param job Job.
+         * @param arg Argument.
+         */
+        C1V2(IgniteClosure<T, R> job, T arg) {
+            this.job = job;
+            this.arg = arg;
+        }
+
+        /** {@inheritDoc} */
+        @Nullable @Override public Object execute() {
+            return job.apply(arg);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void cancel() {
+            // No-op.
+        }
+
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            BinaryRawWriter rawWriter = writer.rawWriter();
+
+            rawWriter.writeObject(job);
+            rawWriter.writeObject(arg);
+        }
+
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            BinaryRawReader rawReader = reader.rawReader();
+
+            job = rawReader.readObject();
+            arg = rawReader.readObject();
+        }
+
+        /** {@inheritDoc} */
+        @Override public IgniteClosure userObject() {
+            return job;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(C1V2.class, this);
+        }
+    }
+
+    /**
+     *
+     */
     private static class C1MLA<T, R> extends C1<T, R> implements ComputeJobMasterLeaveAware {
         /** */
         private static final long serialVersionUID = 0L;
@@ -1762,6 +1883,39 @@ public class GridClosureProcessor extends GridProcessorAdapter {
     /**
      *
      */
+    public static class C1MLAV2<T, R> extends C1V2<T, R> implements ComputeJobMasterLeaveAware {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /**
+         *
+         */
+        public C1MLAV2() {
+            // No-op.
+        }
+
+        /**
+         * @param job Job.
+         * @param arg Argument.
+         */
+        private C1MLAV2(IgniteClosure<T, R> job, T arg) {
+            super(job, arg);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void onMasterNodeLeft(ComputeTaskSession ses) {
+            ((ComputeJobMasterLeaveAware)job).onMasterNodeLeft(ses);
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(C1MLAV2.class, this, super.toString());
+        }
+    }
+
+    /**
+     *
+     */
     private static class C2<R> implements ComputeJob, Externalizable, GridNoImplicitInjection, GridInternalWrapper<Callable> {
         /** */
         private static final long serialVersionUID = 0L;
@@ -1772,7 +1926,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         /**
          *
          */
-        public C2(){
+        public C2() {
             // No-op.
         }
 
@@ -1822,7 +1976,66 @@ public class GridClosureProcessor extends GridProcessorAdapter {
     /**
      *
      */
-    private static class C2MLA<R> extends C2<R> implements ComputeJobMasterLeaveAware{
+    public static class C2V2<R> implements ComputeJob, Binarylizable, GridNoImplicitInjection,
+        GridInternalWrapper<Callable> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /** */
+        protected Callable<R> c;
+
+        /**
+         *
+         */
+        public C2V2() {
+            // No-op.
+        }
+
+        /**
+         * @param c Callable.
+         */
+        private C2V2(Callable<R> c) {
+            this.c = c;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Object execute() {
+            try {
+                return c.call();
+            }
+            catch (Exception e) {
+                throw new IgniteException(e);
+            }
+        }
+
+        /** {@inheritDoc} */
+        @Override public void cancel() {
+            // No-op.
+        }
+
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            writer.rawWriter().writeObject(c);
+        }
+
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            c = reader.rawReader().readObject();
+        }
+
+        /** {@inheritDoc} */
+        @Override public Callable userObject() {
+            return c;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(C2V2.class, this);
+        }
+    }
+
+    /**
+     *
+     */
+    private static class C2MLA<R> extends C2<R> implements ComputeJobMasterLeaveAware {
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -1852,6 +2065,38 @@ public class GridClosureProcessor extends GridProcessorAdapter {
     }
 
     /**
+     *
+     */
+    public static class C2MLAV2<R> extends C2V2<R> implements ComputeJobMasterLeaveAware {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /**
+         *
+         */
+        public C2MLAV2() {
+            // No-op.
+        }
+
+        /**
+         * @param c Callable.
+         */
+        private C2MLAV2(Callable<R> c) {
+            super(c);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void onMasterNodeLeft(ComputeTaskSession ses) {
+            ((ComputeJobMasterLeaveAware)c).onMasterNodeLeft(ses);
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(C2MLAV2.class, this, super.toString());
+        }
+    }
+
+    /**
      */
     private static class C4 implements ComputeJob, Externalizable, GridNoImplicitInjection, GridInternalWrapper<Runnable> {
         /** */
@@ -1863,7 +2108,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         /**
          *
          */
-        public C4(){
+        public C4() {
             // No-op.
         }
 
@@ -1908,6 +2153,60 @@ public class GridClosureProcessor extends GridProcessorAdapter {
     }
 
     /**
+     */
+    public static class C4V2 implements ComputeJob, Binarylizable, GridNoImplicitInjection, GridInternalWrapper<Runnable> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /** */
+        protected Runnable r;
+
+        /**
+         *
+         */
+        public C4V2() {
+            // No-op.
+        }
+
+        /**
+         * @param r Runnable.
+         */
+        private C4V2(Runnable r) {
+            this.r = r;
+        }
+
+        /** {@inheritDoc} */
+        @Nullable @Override public Object execute() {
+            r.run();
+
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void cancel() {
+            // No-op.
+        }
+
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            writer.rawWriter().writeObject(r);
+        }
+
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            r = reader.rawReader().readObject();
+        }
+
+        /** {@inheritDoc} */
+        @Override public Runnable userObject() {
+            return r;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(C4V2.class, this);
+        }
+    }
+
+    /**
      *
      */
     private static class C4MLA extends C4 implements ComputeJobMasterLeaveAware {
@@ -1938,4 +2237,36 @@ public class GridClosureProcessor extends GridProcessorAdapter {
             return S.toString(C4MLA.class, this, super.toString());
         }
     }
+
+    /**
+     *
+     */
+    public static class C4MLAV2 extends C4V2 implements ComputeJobMasterLeaveAware {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /**
+         *
+         */
+        public C4MLAV2() {
+            // No-op.
+        }
+
+        /**
+         * @param r Runnable.
+         */
+        private C4MLAV2(Runnable r) {
+            super(r);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void onMasterNodeLeft(ComputeTaskSession ses) {
+            ((ComputeJobMasterLeaveAware)r).onMasterNodeLeft(ses);
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(C4MLAV2.class, this, super.toString());
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/215e8a1e/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index 8c3ad88..9728d9c 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -900,11 +900,17 @@ org.apache.ignite.internal.processors.clock.GridClockDeltaSnapshotMessage
 org.apache.ignite.internal.processors.clock.GridClockDeltaVersion
 org.apache.ignite.internal.processors.closure.GridClosurePolicy
 org.apache.ignite.internal.processors.closure.GridClosureProcessor$C1
+org.apache.ignite.internal.processors.closure.GridClosureProcessor$C1V2
 org.apache.ignite.internal.processors.closure.GridClosureProcessor$C1MLA
+org.apache.ignite.internal.processors.closure.GridClosureProcessor$C1MLAV2
 org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2
+org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2V2
 org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2MLA
+org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2MLAV2
 org.apache.ignite.internal.processors.closure.GridClosureProcessor$C4
+org.apache.ignite.internal.processors.closure.GridClosureProcessor$C4V2
 org.apache.ignite.internal.processors.closure.GridClosureProcessor$C4MLA
+org.apache.ignite.internal.processors.closure.GridClosureProcessor$C4MLAV2
 org.apache.ignite.internal.processors.closure.GridClosureProcessor$T1
 org.apache.ignite.internal.processors.closure.GridClosureProcessor$T10
 org.apache.ignite.internal.processors.closure.GridClosureProcessor$T11

http://git-wip-us.apache.org/repos/asf/ignite/blob/215e8a1e/modules/core/src/test/java/org/apache/ignite/internal/GridAffinitySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridAffinitySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridAffinitySelfTest.java
index a75023f..9e438e9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridAffinitySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridAffinitySelfTest.java
@@ -84,13 +84,15 @@ public class GridAffinitySelfTest extends GridCommonAbstractTest {
     /**
      * @throws IgniteCheckedException If failed.
      */
-    public void testAffinity() throws IgniteCheckedException {
+    public void testAffinity() throws Exception {
         Ignite g1 = grid(1);
         Ignite g2 = grid(2);
 
         assert caches(g1).size() == 0;
         assert F.first(caches(g2)).getCacheMode() == PARTITIONED;
 
+        awaitPartitionMapExchange();
+
         Map<ClusterNode, Collection<String>> map = g1.<String>affinity(null).mapKeysToNodes(F.asList("1"));
 
         assertNotNull(map);

http://git-wip-us.apache.org/repos/asf/ignite/blob/215e8a1e/modules/core/src/test/java/org/apache/ignite/internal/GridComputationBinarylizableClosuresSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridComputationBinarylizableClosuresSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridComputationBinarylizableClosuresSelfTest.java
new file mode 100644
index 0000000..96f0277
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridComputationBinarylizableClosuresSelfTest.java
@@ -0,0 +1,413 @@
+/*
+ * 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;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.compute.ComputeJobMasterLeaveAware;
+import org.apache.ignite.compute.ComputeTaskSession;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteClosure;
+import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ * Test ensuring that correct closures are serialized.
+ */
+public class GridComputationBinarylizableClosuresSelfTest extends GridCommonAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        cfg.setMarshaller(new BinaryMarshaller());
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        super.beforeTest();
+
+        TestBinarylizableClosure.writeCalled.set(false);
+        TestBinarylizableClosure.readCalled.set(false);
+        TestBinarylizableClosure.executed.set(false);
+
+        TestBinarylizableMasterLeaveAwareClosure.writeCalled.set(false);
+        TestBinarylizableMasterLeaveAwareClosure.readCalled.set(false);
+
+        TestBinarylizableCallable.writeCalled.set(false);
+        TestBinarylizableCallable.readCalled.set(false);
+        TestBinarylizableCallable.executed.set(false);
+
+        TestBinarylizableMasterLeaveAwareCallable.writeCalled.set(false);
+        TestBinarylizableMasterLeaveAwareCallable.readCalled.set(false);
+
+        TestBinarylizableRunnable.writeCalled.set(false);
+        TestBinarylizableRunnable.readCalled.set(false);
+        TestBinarylizableRunnable.executed.set(false);
+
+        TestBinarylizableMasterLeaveAwareRunnable.writeCalled.set(false);
+        TestBinarylizableMasterLeaveAwareRunnable.readCalled.set(false);
+
+        TestBinarylizableObject.writeCalled.set(false);
+        TestBinarylizableObject.readCalled.set(false);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        stopAllGrids();
+    }
+
+    /**
+     * Test that Binarylizable IgniteClosure is serialized using BinaryMarshaller.
+     *
+     * @throws Exception If failed.
+     */
+    public void testJob() throws Exception {
+        Ignite ignite = startGrid(1);
+        startGrid(2);
+
+        final TestBinarylizableClosure closure = new TestBinarylizableClosure();
+
+        ignite.compute(ignite.cluster().forRemotes()).apply(closure, new TestBinarylizableObject());
+
+        assert TestBinarylizableClosure.executed.get();
+        assert TestBinarylizableClosure.writeCalled.get();
+        assert TestBinarylizableClosure.readCalled.get();
+
+        assert TestBinarylizableObject.writeCalled.get();
+        assert TestBinarylizableObject.readCalled.get();
+    }
+
+    /**
+     * Test that Binarylizable IgniteClosure with ComputeJobMasterLeaveAware interface is serialized
+     * using BinaryMarshaller.
+     *
+     * @throws Exception If failed.
+     */
+    public void testMasterLeaveAwareJob() throws Exception {
+        Ignite ignite = startGrid(1);
+        startGrid(2);
+
+        final TestBinarylizableMasterLeaveAwareClosure job = new TestBinarylizableMasterLeaveAwareClosure();
+
+        ignite.compute(ignite.cluster().forRemotes()).apply(job, new TestBinarylizableObject());
+
+        assert TestBinarylizableClosure.executed.get();
+        assert TestBinarylizableClosure.writeCalled.get();
+        assert TestBinarylizableClosure.readCalled.get();
+
+        assert TestBinarylizableMasterLeaveAwareClosure.writeCalled.get();
+        assert TestBinarylizableMasterLeaveAwareClosure.readCalled.get();
+
+        assert TestBinarylizableObject.writeCalled.get();
+        assert TestBinarylizableObject.readCalled.get();
+    }
+
+    /**
+     * Test that Binarylizable IgniteCallable is serialized using BinaryMarshaller.
+     *
+     * @throws Exception If failed.
+     */
+    public void testCallable() throws Exception {
+        Ignite ignite = startGrid(1);
+        startGrid(2);
+
+        final TestBinarylizableCallable callable = new TestBinarylizableCallable();
+
+        ignite.compute(ignite.cluster().forRemotes()).call(callable);
+
+        assert TestBinarylizableCallable.executed.get();
+        assert TestBinarylizableCallable.writeCalled.get();
+        assert TestBinarylizableCallable.readCalled.get();
+    }
+
+    /**
+     * Test that Binarylizable IgniteCallable with ComputeJobMasterLeaveAware interface is serialized
+     * using BinaryMarshaller.
+     *
+     * @throws Exception If failed.
+     */
+    public void testMasterLeaveAwareCallable() throws Exception {
+        Ignite ignite = startGrid(1);
+        startGrid(2);
+
+        final TestBinarylizableMasterLeaveAwareCallable callable = new TestBinarylizableMasterLeaveAwareCallable();
+
+        ignite.compute(ignite.cluster().forRemotes()).call(callable);
+
+        assert TestBinarylizableCallable.executed.get();
+        assert TestBinarylizableCallable.writeCalled.get();
+        assert TestBinarylizableCallable.readCalled.get();
+
+        assert TestBinarylizableMasterLeaveAwareCallable.writeCalled.get();
+        assert TestBinarylizableMasterLeaveAwareCallable.readCalled.get();
+    }
+
+    /**
+     * Test that Binarylizable IgniteRunnable is serialized using BinaryMarshaller.
+     *
+     * @throws Exception If failed.
+     */
+    public void testRunnable() throws Exception {
+        Ignite ignite = startGrid(1);
+        startGrid(2);
+
+        final TestBinarylizableRunnable runnable = new TestBinarylizableRunnable();
+
+        ignite.compute(ignite.cluster().forRemotes()).run(runnable);
+
+        assert TestBinarylizableRunnable.executed.get();
+        assert TestBinarylizableRunnable.writeCalled.get();
+        assert TestBinarylizableRunnable.readCalled.get();
+    }
+
+    /**
+     * Test that Binarylizable IgniteRunnable with ComputeJobMasterLeaveAware interface is serialized
+     * using BinaryMarshaller.
+     *
+     * @throws Exception If failed.
+     */
+    public void testMasterLeaveAwareRunnable() throws Exception {
+        Ignite ignite = startGrid(1);
+        startGrid(2);
+
+        final TestBinarylizableMasterLeaveAwareRunnable runnable = new TestBinarylizableMasterLeaveAwareRunnable();
+
+        ignite.compute(ignite.cluster().forRemotes()).run(runnable);
+
+        assert TestBinarylizableRunnable.executed.get();
+        assert TestBinarylizableRunnable.writeCalled.get();
+        assert TestBinarylizableRunnable.readCalled.get();
+
+        assert TestBinarylizableMasterLeaveAwareRunnable.writeCalled.get();
+        assert TestBinarylizableMasterLeaveAwareRunnable.readCalled.get();
+    }
+
+    /**
+     * Test Binarylizable IgniteClosure.
+     */
+    private static class TestBinarylizableClosure implements IgniteClosure, Binarylizable {
+
+        /** Tracks {@link TestBinarylizableClosure::writeBinary(BinaryWriter writer)} calls. */
+        private static AtomicBoolean writeCalled = new AtomicBoolean();
+
+        /** Tracks {@link TestBinarylizableClosure::readBinary(BinaryReader reader)} calls. */
+        private static AtomicBoolean readCalled = new AtomicBoolean();
+
+        /** Tracks {@link TestBinarylizableClosure::apply(Object o)} calls. */
+        private static AtomicBoolean executed = new AtomicBoolean();
+
+        /** {@inheritDoc} */
+        @Override public Object apply(Object o) {
+            executed.set(true);
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            writeCalled.set(true);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            readCalled.set(true);
+        }
+    }
+
+    /**
+     * Test Binarylizable IgniteClosure with ComputeJobMasterLeaveAware interface.
+     */
+    private static class TestBinarylizableMasterLeaveAwareClosure extends TestBinarylizableClosure
+        implements ComputeJobMasterLeaveAware {
+
+        /** Tracks {@link TestBinarylizableMasterLeaveAwareClosure::writeBinary(BinaryWriter writer)} calls. */
+        private static AtomicBoolean writeCalled = new AtomicBoolean();
+
+        /** Tracks {@link TestBinarylizableMasterLeaveAwareClosure::readBinary(BinaryReader reader)} calls. */
+        private static AtomicBoolean readCalled = new AtomicBoolean();
+
+        /** {@inheritDoc} */
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            super.writeBinary(writer);
+            writeCalled.set(true);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            super.readBinary(reader);
+            readCalled.set(true);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void onMasterNodeLeft(ComputeTaskSession ses) throws IgniteException {
+        }
+    }
+
+    /**
+     * Test Binarylizable object.
+     */
+    private static class TestBinarylizableObject implements Binarylizable {
+
+        /** Tracks {@link TestBinarylizableObject::writeBinary(BinaryWriter writer)} calls. */
+        private static AtomicBoolean writeCalled = new AtomicBoolean();
+
+        /** Tracks {@link TestBinarylizableObject::readBinary(BinaryReader reader)} calls. */
+        private static AtomicBoolean readCalled = new AtomicBoolean();
+
+        /** {@inheritDoc} */
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            writeCalled.set(true);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            readCalled.set(true);
+        }
+    }
+
+    /**
+     * Test Binarylizable Callable.
+     */
+    private static class TestBinarylizableCallable implements IgniteCallable, Binarylizable {
+
+        /** Tracks {@link TestBinarylizableCallable::writeBinary(BinaryWriter writer)} calls. */
+        private static AtomicBoolean writeCalled = new AtomicBoolean();
+
+        /** Tracks {@link TestBinarylizableCallable::readBinary(BinaryReader reader)} calls. */
+        private static AtomicBoolean readCalled = new AtomicBoolean();
+
+        /** Tracks {@link TestBinarylizableCallable::call()} calls. */
+        private static AtomicBoolean executed = new AtomicBoolean();
+
+        /** {@inheritDoc} */
+        @Override public Object call() throws Exception {
+            executed.set(true);
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            writeCalled.set(true);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            readCalled.set(true);
+        }
+    }
+
+    /**
+     * Test Binarylizable Callable with ComputeJobMasterLeaveAware interface.
+     */
+    private static class TestBinarylizableMasterLeaveAwareCallable extends TestBinarylizableCallable
+        implements ComputeJobMasterLeaveAware {
+
+        /** Tracks {@link TestBinarylizableMasterLeaveAwareCallable::writeBinary(BinaryWriter writer)} calls. */
+        private static AtomicBoolean writeCalled = new AtomicBoolean();
+
+        /** Tracks {@link TestBinarylizableMasterLeaveAwareCallable::readBinary(BinaryReader reader)} calls. */
+        private static AtomicBoolean readCalled = new AtomicBoolean();
+
+        /** {@inheritDoc} */
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            super.writeBinary(writer);
+            writeCalled.set(true);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            super.readBinary(reader);
+            readCalled.set(true);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void onMasterNodeLeft(ComputeTaskSession ses) throws IgniteException {
+        }
+    }
+
+    /**
+     * Test Binarylizable Runnable.
+     */
+    private static class TestBinarylizableRunnable implements IgniteRunnable, Binarylizable {
+
+        /** Tracks {@link TestBinarylizableRunnable::writeBinary(BinaryWriter writer)} calls. */
+        private static AtomicBoolean writeCalled = new AtomicBoolean();
+
+        /** Tracks {@link TestBinarylizableRunnable::readBinary(BinaryReader reader)} calls. */
+        private static AtomicBoolean readCalled = new AtomicBoolean();
+
+        /** Tracks {@link TestBinarylizableRunnable::run()} calls. */
+        private static AtomicBoolean executed = new AtomicBoolean();
+
+        /** {@inheritDoc} */
+        @Override public void run() {
+            executed.set(true);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            writeCalled.set(true);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            readCalled.set(true);
+        }
+    }
+
+    /**
+     * Test Binarylizable Runnable with ComputeJobMasterLeaveAware interface.
+     */
+    private static class TestBinarylizableMasterLeaveAwareRunnable extends TestBinarylizableRunnable
+        implements ComputeJobMasterLeaveAware {
+
+        /** Tracks {@link TestBinarylizableMasterLeaveAwareRunnable::writeBinary(BinaryWriter writer)} calls. */
+        private static AtomicBoolean writeCalled = new AtomicBoolean();
+
+        /** Tracks {@link TestBinarylizableMasterLeaveAwareRunnable::readBinary(BinaryReader reader)} calls. */
+        private static AtomicBoolean readCalled = new AtomicBoolean();
+
+        /** {@inheritDoc} */
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            super.writeBinary(writer);
+            writeCalled.set(true);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            super.readBinary(reader);
+            readCalled.set(true);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void onMasterNodeLeft(ComputeTaskSession ses) throws IgniteException {
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/215e8a1e/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
index 37b908a..eefe66c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
@@ -2690,6 +2690,35 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     }
 
     /**
+     * Test object with {@link Proxy} field.
+     *
+     * @throws Exception If fails.
+     */
+    public void testObjectContainingProxy() throws Exception {
+        BinaryMarshaller marsh = binaryMarshaller();
+
+        SomeItf inItf = (SomeItf)Proxy.newProxyInstance(
+            BinaryMarshallerSelfTest.class.getClassLoader(), new Class[] {SomeItf.class},
+            new InvocationHandler() {
+                private NonSerializable obj = new NonSerializable(null);
+
+                @Override public Object invoke(Object proxy, Method mtd, Object[] args) throws Throwable {
+                    if ("hashCode".equals(mtd.getName()))
+                        return obj.hashCode();
+
+                    obj.checkAfterUnmarshalled();
+
+                    return 17;
+                }
+            }
+        );
+
+        SomeItf outItf = marsh.unmarshal(marsh.marshal(inItf), null);
+
+        assertEquals(outItf.checkAfterUnmarshalled(), 17);
+    }
+
+    /**
      * Test duplicate fields.
      *
      * @throws Exception If failed.
@@ -4676,4 +4705,25 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
             rawValArr = rawReader.readDecimalArray();
         }
     }
+
+    /**
+     * Wrapper object.
+     */
+    private static class Wrapper {
+
+        /** Value. */
+        private final Object value;
+
+        /** Constructor. */
+        public Wrapper(Object value) {
+            this.value = value;
+        }
+
+        /**
+         * @return Value.
+         */
+        public Object getValue() {
+            return value;
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/215e8a1e/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsComputeGridTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsComputeGridTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsComputeGridTestSuite.java
index 35be98d..e659966 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsComputeGridTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsComputeGridTestSuite.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.testsuites;
 
 import junit.framework.TestSuite;
+import org.apache.ignite.internal.GridComputationBinarylizableClosuresSelfTest;
 import org.apache.ignite.internal.binary.BinaryMarshaller;
 import org.apache.ignite.testframework.config.GridTestProperties;
 
@@ -32,6 +33,10 @@ public class IgniteBinaryObjectsComputeGridTestSuite {
     public static TestSuite suite() throws Exception {
         GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
 
-        return IgniteComputeGridTestSuite.suite();
+        TestSuite suite = IgniteComputeGridTestSuite.suite();
+
+        suite.addTestSuite(GridComputationBinarylizableClosuresSelfTest.class);
+
+        return suite;
     }
 }


[07/12] ignite git commit: compilation fix (cherry picked from commit 95a4175)

Posted by vo...@apache.org.
compilation fix
(cherry picked from commit 95a4175)


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/70abaa36
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/70abaa36
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/70abaa36

Branch: refs/heads/ignite-1786
Commit: 70abaa36ad4a801d00a8e5088dd803b3dc9dbf25
Parents: a8d16bd
Author: Anton Vinogradov <av...@apache.org>
Authored: Thu Mar 10 11:11:56 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Thu Mar 10 12:03:09 2016 +0300

----------------------------------------------------------------------
 modules/web/ignite-weblogic-test/pom.xml        | 74 +++++++-------------
 .../src/main/webapp/WEB-INF/web.xml             | 17 -----
 .../src/main/webapp/index.jsp                   | 17 -----
 3 files changed, 25 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/70abaa36/modules/web/ignite-weblogic-test/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/ignite-weblogic-test/pom.xml b/modules/web/ignite-weblogic-test/pom.xml
index 4746f1f..622b798 100644
--- a/modules/web/ignite-weblogic-test/pom.xml
+++ b/modules/web/ignite-weblogic-test/pom.xml
@@ -1,38 +1,4 @@
 <!--
-  ~ 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.
-  -->
-
-<!--
-  ~ 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.
-  -->
-
-<!--
   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.
@@ -55,46 +21,56 @@
 <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>
-    <groupId>org.apache.ignite</groupId>
+
+    <parent>
+        <groupId>org.apache.ignite</groupId>
+        <artifactId>ignite-parent</artifactId>
+        <version>1</version>
+        <relativePath>../../../parent</relativePath>
+    </parent>
+
     <artifactId>ignite-weblogic-test</artifactId>
     <packaging>war</packaging>
-    <version>1.0-SNAPSHOT</version>
-    <name>ignite-weblogic-test Maven Webapp</name>
-    <url>http://maven.apache.org</url>
-    <dependencies>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>3.8.1</version>
-            <scope>test</scope>
-        </dependency>
+    <version>1.6.0-SNAPSHOT</version>
+    <url>http://ignite.apache.org</url>
 
+    <dependencies>
         <dependency>
             <groupId>org.apache.ignite</groupId>
             <artifactId>ignite-core</artifactId>
-            <version>1.6.0-SNAPSHOT</version>
+            <version>${project.version}</version>
         </dependency>
 
         <dependency>
             <groupId>org.apache.ignite</groupId>
             <artifactId>ignite-web</artifactId>
-            <version>1.6.0-SNAPSHOT</version>
+            <version>${project.version}</version>
         </dependency>
 
         <dependency>
             <groupId>org.apache.ignite</groupId>
             <artifactId>ignite-log4j</artifactId>
-            <version>1.6.0-SNAPSHOT</version>
+            <version>${project.version}</version>
         </dependency>
 
         <dependency>
             <groupId>org.apache.ignite</groupId>
             <artifactId>ignite-spring</artifactId>
-            <version>1.6.0-SNAPSHOT</version>
+            <version>${project.version}</version>
         </dependency>
     </dependencies>
 
     <build>
         <finalName>ignite-weblogic-test</finalName>
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+        </plugins>
     </build>
 </project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/70abaa36/modules/web/ignite-weblogic-test/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/modules/web/ignite-weblogic-test/src/main/webapp/WEB-INF/web.xml b/modules/web/ignite-weblogic-test/src/main/webapp/WEB-INF/web.xml
index 054eab4..6fe7358 100644
--- a/modules/web/ignite-weblogic-test/src/main/webapp/WEB-INF/web.xml
+++ b/modules/web/ignite-weblogic-test/src/main/webapp/WEB-INF/web.xml
@@ -15,23 +15,6 @@
   ~ limitations under the License.
   -->
 
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~      http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
 <!DOCTYPE web-app PUBLIC
  "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
  "http://java.sun.com/dtd/web-app_2_3.dtd" >

http://git-wip-us.apache.org/repos/asf/ignite/blob/70abaa36/modules/web/ignite-weblogic-test/src/main/webapp/index.jsp
----------------------------------------------------------------------
diff --git a/modules/web/ignite-weblogic-test/src/main/webapp/index.jsp b/modules/web/ignite-weblogic-test/src/main/webapp/index.jsp
index 0cc090d..4ca0be1 100644
--- a/modules/web/ignite-weblogic-test/src/main/webapp/index.jsp
+++ b/modules/web/ignite-weblogic-test/src/main/webapp/index.jsp
@@ -15,23 +15,6 @@
   ~ limitations under the License.
   --%>
 
-<%--
-  ~ 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.
-  --%>
-
 <%@ page import="org.apache.ignite.Ignition" %>
 <%@ page import="java.util.UUID" %>
 <html>


[04/12] ignite git commit: IGNITE-2756 - Fixed StreamVisitorExample

Posted by vo...@apache.org.
IGNITE-2756 - Fixed StreamVisitorExample


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a579d454
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a579d454
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a579d454

Branch: refs/heads/ignite-1786
Commit: a579d45415b3063ac72069924a15e87beda0447c
Parents: c31f384
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Wed Mar 9 18:53:30 2016 -0800
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Wed Mar 9 18:53:30 2016 -0800

----------------------------------------------------------------------
 .../streaming/StreamVisitorExample.java         | 31 +++++++++++++-------
 1 file changed, 20 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a579d454/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
index 29781bc..c3d8c64 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamVisitorExample.java
@@ -35,12 +35,16 @@ import org.apache.ignite.examples.ExamplesUtils;
 import org.apache.ignite.stream.StreamVisitor;
 
 /**
- * Stream random numbers into the streaming cache.
- * To start the example, you should:
- * <ul>
- *     <li>Start a few nodes using {@link ExampleNodeStartup}.</li>
- *     <li>Start streaming using {@link StreamVisitorExample}.</li>
- * </ul>
+ * This examples demonstrates the stream visitor which allows to customize the processing
+ * of the streamed data on the server side. Instead of populating the cache for which the
+ * streamer is created, we will calculate aggregated data on the fly and save results in
+ * another cache.
+ * <p>
+ * Remote nodes should always be started with special configuration file which
+ * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-ignite.xml'}.
+ * <p>
+ * Alternatively you can run {@link ExampleNodeStartup} in another JVM which will
+ * start node with {@code examples/config/example-ignite.xml} configuration.
  */
 public class StreamVisitorExample {
     /** Random number generator. */
@@ -53,7 +57,7 @@ public class StreamVisitorExample {
     private static final double[] INITIAL_PRICES = {194.9, 893.49, 34.21, 23.24, 57.93, 45.03, 44.41, 28.44, 378.49, 69.50};
 
     /** Caches' names. */
-    private static final String CACHE_NAME = "instCache";
+    private static final String INSTRUMENTS_CACHE_NAME = "instCache";
     private static final String MARKET_TICKS_CACHE_NAME = "marketTicks";
 
     public static void main(String[] args) throws Exception {
@@ -65,7 +69,7 @@ public class StreamVisitorExample {
                 return;
 
             // Financial instrument cache configuration.
-            CacheConfiguration<String, Instrument> instCfg = new CacheConfiguration<>(CACHE_NAME);
+            CacheConfiguration<String, Instrument> instCfg = new CacheConfiguration<>(INSTRUMENTS_CACHE_NAME);
 
             // Index key and value for querying financial instruments.
             // Note that Instrument class has @QuerySqlField annotation for secondary field indexing.
@@ -77,6 +81,10 @@ public class StreamVisitorExample {
                 IgniteCache<String, Instrument> instCache = ignite.getOrCreateCache(instCfg)
             ) {
                 try (IgniteDataStreamer<String, Double> mktStmr = ignite.dataStreamer(mktCache.getName())) {
+                    // To achieve proper indexing we should use fully-qualified name
+                    // of the class as a type name when binary object is created.
+                    final String instTypeName = Instrument.class.getName();
+
                     // Note that we receive market data, but do not populate 'mktCache' (it remains empty).
                     // Instead we update the instruments in the 'instCache'.
                     // Since both, 'instCache' and 'mktCache' use the same key, updates are collocated.
@@ -85,14 +93,15 @@ public class StreamVisitorExample {
                             String symbol = e.getKey();
                             Double tick = e.getValue();
 
-                            IgniteCache<String, BinaryObject> binInstCache = ignite.cache("instCache").withKeepBinary();
+                            IgniteCache<String, BinaryObject> binInstCache =
+                                ignite.cache(INSTRUMENTS_CACHE_NAME).withKeepBinary();
 
                             BinaryObject inst = binInstCache.get(symbol);
 
                             BinaryObjectBuilder instBuilder;
 
                             if (inst == null) {
-                                instBuilder = ignite.binary().builder("Instrument");
+                                instBuilder = ignite.binary().builder(instTypeName);
 
                                 // Constructor logic.
                                 instBuilder.setField(
@@ -146,7 +155,7 @@ public class StreamVisitorExample {
             }
             finally {
                 // Distributed cache could be removed from cluster only by #destroyCache() call.
-                ignite.destroyCache(CACHE_NAME);
+                ignite.destroyCache(INSTRUMENTS_CACHE_NAME);
                 ignite.destroyCache(MARKET_TICKS_CACHE_NAME);
             }
         }


[08/12] ignite git commit: .NET: Fix NuGet package name to 'Apache.Ignite' instead of 'Apache.Ignite.NET'

Posted by vo...@apache.org.
.NET: Fix NuGet package name to 'Apache.Ignite' instead of 'Apache.Ignite.NET'


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/648b10c8
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/648b10c8
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/648b10c8

Branch: refs/heads/ignite-1786
Commit: 648b10c8cf0372dce552b8ff1506884044f86312
Parents: 70abaa3
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Thu Mar 10 12:39:38 2016 +0300
Committer: Pavel Tupitsyn <pt...@gridgain.com>
Committed: Thu Mar 10 12:39:38 2016 +0300

----------------------------------------------------------------------
 .../Apache.Ignite.Core.Tests.NuGet/install-package.cmd   | 11 +++++++++--
 .../dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec  |  6 +++---
 .../Apache.Ignite.Core/NuGet/LINQPad/ComputeExample.linq |  2 +-
 .../Apache.Ignite.Core/NuGet/LINQPad/PutGetExample.linq  |  2 +-
 .../Apache.Ignite.Core/NuGet/LINQPad/QueryExample.linq   |  2 +-
 5 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/648b10c8/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/install-package.cmd
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/install-package.cmd b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/install-package.cmd
index e1b57a8..5af7607 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/install-package.cmd
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests.NuGet/install-package.cmd
@@ -1,3 +1,10 @@
+rem Install NuGet package to a 'pkg' folder no matter what version it is
+
 rmdir pkg /S /Q
-nuget install Apache.Ignite.NET
-move Apache.Ignite.NET* pkg
\ No newline at end of file
+rmdir tmp1 /S /Q
+mkdir tmp1
+cd tmp1
+nuget install Apache.Ignite
+cd ..
+move tmp1\Apache.Ignite.* pkg
+rmdir tmp1 /S /Q
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/648b10c8/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec
index 54a4a9e..ff3ce34 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec
@@ -29,8 +29,8 @@ Creating NuGet package:
 
 <package >
     <metadata>
-        <id>Apache.Ignite.NET</id>
-        <title>Apache Ignite.NET x64</title>
+        <id>Apache.Ignite</id>
+        <title>Apache Ignite x64</title>
         <!-- -->
         <version>$version$</version>
         <authors>Apache Ignite</authors>
@@ -40,7 +40,7 @@ Creating NuGet package:
         <iconUrl>https://ignite.apache.org/images/logo_ignite_32_32.png</iconUrl>
         <requireLicenseAcceptance>false</requireLicenseAcceptance>
         <description>
-Apache Ignite.NET In-Memory Data Fabric is a high-performance, integrated and distributed in-memory platform for computing and transacting on large-scale data sets in real-time, orders of magnitude faster than possible with traditional disk-based or flash technologies.
+Apache Ignite In-Memory Data Fabric is a high-performance, integrated and distributed in-memory platform for computing and transacting on large-scale data sets in real-time, orders of magnitude faster than possible with traditional disk-based or flash technologies.
             
 More info: https://apacheignite-net.readme.io/
             

http://git-wip-us.apache.org/repos/asf/ignite/blob/648b10c8/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/ComputeExample.linq
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/ComputeExample.linq b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/ComputeExample.linq
index 194858c..921af3e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/ComputeExample.linq
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/ComputeExample.linq
@@ -1,5 +1,5 @@
 <Query Kind="Program">
-  <NuGetReference>Apache.Ignite.NET</NuGetReference>
+  <NuGetReference>Apache.Ignite</NuGetReference>
   <Namespace>Apache.Ignite.Core</Namespace>
   <Namespace>Apache.Ignite.Core.Binary</Namespace>
   <Namespace>Apache.Ignite.Core.Cache.Configuration</Namespace>

http://git-wip-us.apache.org/repos/asf/ignite/blob/648b10c8/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/PutGetExample.linq
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/PutGetExample.linq b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/PutGetExample.linq
index 0569da6..2995f01 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/PutGetExample.linq
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/PutGetExample.linq
@@ -1,5 +1,5 @@
 <Query Kind="Program">
-    <NuGetReference>Apache.Ignite.NET</NuGetReference>
+    <NuGetReference>Apache.Ignite</NuGetReference>
     <Namespace>Apache.Ignite.Core</Namespace>
     <Namespace>Apache.Ignite.Core.Binary</Namespace>
 </Query>

http://git-wip-us.apache.org/repos/asf/ignite/blob/648b10c8/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/QueryExample.linq
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/QueryExample.linq b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/QueryExample.linq
index b13e1e9..5a37f36 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/QueryExample.linq
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/LINQPad/QueryExample.linq
@@ -1,5 +1,5 @@
 <Query Kind="Program">
-  <NuGetReference>Apache.Ignite.NET</NuGetReference>
+  <NuGetReference>Apache.Ignite</NuGetReference>
   <Namespace>Apache.Ignite.Core</Namespace>
   <Namespace>Apache.Ignite.Core.Binary</Namespace>
   <Namespace>Apache.Ignite.Core.Cache.Configuration</Namespace>


[10/12] ignite git commit: Merge remote-tracking branch 'origin/master'

Posted by vo...@apache.org.
Merge remote-tracking branch 'origin/master'


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8cf71d46
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8cf71d46
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8cf71d46

Branch: refs/heads/ignite-1786
Commit: 8cf71d463d9f2baa7651286a6524ec5d6d286b5b
Parents: b46ed10 648b10c
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Mar 10 14:05:53 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 10 14:05:53 2016 +0300

----------------------------------------------------------------------
 .../install-package.cmd                         | 11 ++-
 .../Apache.Ignite.Core.nuspec                   |  6 +-
 .../NuGet/LINQPad/ComputeExample.linq           |  2 +-
 .../NuGet/LINQPad/PutGetExample.linq            |  2 +-
 .../NuGet/LINQPad/QueryExample.linq             |  2 +-
 modules/web/ignite-weblogic-test/pom.xml        | 74 +++++++-------------
 .../src/main/webapp/WEB-INF/web.xml             | 17 -----
 .../src/main/webapp/index.jsp                   | 17 -----
 8 files changed, 40 insertions(+), 91 deletions(-)
----------------------------------------------------------------------



[03/12] ignite git commit: IGNITE-2758 - Fixed ignite-aws dependencies

Posted by vo...@apache.org.
IGNITE-2758 - Fixed ignite-aws dependencies


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c31f384d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c31f384d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c31f384d

Branch: refs/heads/ignite-1786
Commit: c31f384d56e5939b9ae8bf45fa30184f3a14bc50
Parents: 334ce4c
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Wed Mar 9 18:06:44 2016 -0800
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Wed Mar 9 18:06:44 2016 -0800

----------------------------------------------------------------------
 modules/aws/pom.xml | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c31f384d/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 4de5506..481e897 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -43,23 +43,41 @@
 
         <dependency>
             <groupId>com.amazonaws</groupId>
-            <artifactId>aws-java-sdk</artifactId>
+            <artifactId>aws-java-sdk-core</artifactId>
             <version>${aws.sdk.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.amazonaws</groupId>
-            <artifactId>aws-java-sdk-core</artifactId>
+            <artifactId>aws-java-sdk-s3</artifactId>
             <version>${aws.sdk.version}</version>
         </dependency>
 
         <dependency>
             <groupId>com.amazonaws</groupId>
-            <artifactId>aws-java-sdk-s3</artifactId>
+            <artifactId>aws-java-sdk-kms</artifactId>
             <version>${aws.sdk.version}</version>
         </dependency>
 
         <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+            <version>2.5.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-annotations</artifactId>
+            <version>2.5.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>2.5.3</version>
+        </dependency>
+
+        <dependency>
             <groupId>joda-time</groupId>
             <artifactId>joda-time</artifactId>
             <version>2.8.1</version>