ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [25/27] incubator-ignite git commit: ignite-950: fixed hangning detected by Service related tests
Date Wed, 24 Jun 2015 07:03:33 GMT
ignite-950: fixed hangning detected by Service related tests


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

Branch: refs/heads/ignite-950
Commit: 8d8900f77d6d1428309e256edb5b6f09d98b92a6
Parents: 9a46a71
Author: Denis Magda <dmagda@gridgain.com>
Authored: Wed Jun 24 09:06:36 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Wed Jun 24 09:06:36 2015 +0300

----------------------------------------------------------------------
 .../optimized/OptimizedMarshallerExt.java          | 17 +++++++++++++++--
 .../optimized/OptimizedObjectInputStreamExt.java   |  6 ++++--
 .../optimized/OptimizedObjectOutputStreamExt.java  | 11 +++++++----
 .../GridServiceProcessorMultiNodeSelfTest.java     |  2 +-
 4 files changed, 27 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8d8900f7/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerExt.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerExt.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerExt.java
index 7d90581..ce9b9db 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerExt.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerExt.java
@@ -19,9 +19,12 @@ package org.apache.ignite.marshaller.optimized;
 
 import org.apache.ignite.*;
 import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.marshaller.*;
+import org.apache.ignite.services.*;
 import org.jetbrains.annotations.*;
 
 import java.io.*;
+import java.util.*;
 
 import static org.apache.ignite.marshaller.optimized.OptimizedClassDescriptor.*;
 
@@ -88,6 +91,16 @@ public class OptimizedMarshallerExt extends OptimizedMarshaller {
     }
 
     /**
+     * Checks whether fields indexing is excluded for class.
+     *
+     * @param cls Class.
+     * @return {@code true} if excluded.
+     */
+    static boolean isFieldsIndexingExcludedForClass(MarshallerContext ctx, Class<?>
cls) {
+        return ctx.isSystemType(cls.getName()) || Service.class.isAssignableFrom(cls);
+    }
+
+    /**
      * Enables fields indexing for the object of the given {@code cls}.
      *
      * If enabled then a footer will be added during marshalling of an object of the given
{@code cls} to the end of
@@ -100,7 +113,7 @@ public class OptimizedMarshallerExt extends OptimizedMarshaller {
     public boolean enableFieldsIndexing(Class<?> cls) throws IgniteCheckedException
{
         assert metaHandler != null;
 
-        if (ctx.isSystemType(cls.getName()))
+        if (isFieldsIndexingExcludedForClass(ctx, cls))
             return false;
 
         if (OptimizedMarshalAware.class.isAssignableFrom(cls))
@@ -142,7 +155,7 @@ public class OptimizedMarshallerExt extends OptimizedMarshaller {
     public boolean fieldsIndexingEnabled(Class<?> cls) {
         assert metaHandler != null;
 
-        if (ctx.isSystemType(cls.getName()))
+        if (isFieldsIndexingExcludedForClass(ctx, cls))
             return false;
 
         if (OptimizedMarshalAware.class.isAssignableFrom(cls))

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8d8900f7/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStreamExt.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStreamExt.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStreamExt.java
index 34ca279..49c9339 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStreamExt.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStreamExt.java
@@ -35,8 +35,10 @@ public class OptimizedObjectInputStreamExt extends OptimizedObjectInputStream
{
 
     /** {@inheritDoc} */
     @Override protected void skipFooter(Class<?> cls) throws IOException {
-        if (!ctx.isSystemType(cls.getName()) && metaHandler != null &&
-            metaHandler.metadata(resolveTypeId(cls.getName(), mapper)) != null) {
+        if (isFieldsIndexingExcludedForClass(ctx, cls))
+            return;
+
+        if (metaHandler != null && metaHandler.metadata(resolveTypeId(cls.getName(),
mapper)) != null) {
             short footerLen = in.readShort();
 
             if (footerLen != EMPTY_FOOTER)

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8d8900f7/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStreamExt.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStreamExt.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStreamExt.java
index d1e5dd0..b7dfda2 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStreamExt.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStreamExt.java
@@ -47,11 +47,14 @@ public class OptimizedObjectOutputStreamExt extends OptimizedObjectOutputStream
 
     /** {@inheritDoc} */
     @Override protected Footer createFooter(Class<?> cls) {
-        if (!ctx.isSystemType(cls.getName()) && (OptimizedMarshalAware.class.isAssignableFrom(cls)
||
-            (metaHandler != null && metaHandler.metadata(resolveTypeId(cls.getName(),
mapper)) != null)))
-            return new FooterImpl();
-        else
+        if (OptimizedMarshallerExt.isFieldsIndexingExcludedForClass(ctx, cls))
             return null;
+
+        if (OptimizedMarshalAware.class.isAssignableFrom(cls) || (metaHandler != null &&
+            metaHandler.metadata(resolveTypeId(cls.getName(), mapper)) != null))
+            return new FooterImpl();
+
+        return null;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8d8900f7/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java
index 77b2ea5..447d103 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java
@@ -29,7 +29,7 @@ import java.util.concurrent.*;
 public class GridServiceProcessorMultiNodeSelfTest extends GridServiceProcessorAbstractSelfTest
{
     /** {@inheritDoc} */
     @Override protected int nodeCount() {
-        return 4;
+        return 2;
     }
 
     /**


Mime
View raw message