ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: ignite-950: tests fixes
Date Fri, 19 Jun 2015 12:58:09 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-950 38a763b94 -> 5fe19ff97


ignite-950: tests fixes


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

Branch: refs/heads/ignite-950
Commit: 5fe19ff975dcd3e18cde0406640e3c4af6429fcc
Parents: 38a763b
Author: Denis Magda <dmagda@gridgain.com>
Authored: Fri Jun 19 15:57:55 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Fri Jun 19 15:57:55 2015 +0300

----------------------------------------------------------------------
 .../marshaller/optimized/OptimizedObjectOutputStream.java |  2 +-
 .../marshaller/optimized/ext/OptimizedMarshallerExt.java  |  9 +++++++--
 .../optimized/ext/OptimizedObjectInputStreamExt.java      |  3 ++-
 .../optimized/ext/OptimizedObjectOutputStreamExt.java     | 10 ++++++++--
 .../ignite/testsuites/IgniteMarshallerSelfTestSuite.java  |  2 ++
 .../ignite/testsuites/IgniteCacheQuerySelfTestSuite.java  |  5 ++++-
 6 files changed, 24 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5fe19ff9/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStream.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStream.java
index 17a29f0..84b8351 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStream.java
@@ -978,7 +978,7 @@ public class OptimizedObjectOutputStream extends ObjectOutputStream {
     }
 
     /**
-     *
+     * Footer that is written at the end of object's serialization.
      */
     protected interface Footer {
         /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5fe19ff9/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedMarshallerExt.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedMarshallerExt.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedMarshallerExt.java
index 45506f5..da803d1 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedMarshallerExt.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedMarshallerExt.java
@@ -50,7 +50,7 @@ public class OptimizedMarshallerExt extends OptimizedMarshaller {
     static final byte VARIABLE_LEN = -1;
 
     /** */
-    private OptimizedMarshallerExtMetaHandler metaHandler;
+    private volatile OptimizedMarshallerExtMetaHandler metaHandler;
 
     /**
      * Creates new marshaller will all defaults.
@@ -102,6 +102,9 @@ public class OptimizedMarshallerExt extends OptimizedMarshaller {
     public boolean enableFieldsIndexing(Class<?> cls) throws IgniteCheckedException
{
         assert metaHandler != null;
 
+        if (ctx.isSystemType(cls.getName()))
+            return false;
+
         try {
             OptimizedClassDescriptor desc = OptimizedMarshallerUtils.classDescriptor(clsMap,
cls, ctx, mapper);
 
@@ -136,7 +139,9 @@ public class OptimizedMarshallerExt extends OptimizedMarshaller {
      * @return {@code true} if fields indexing is enabled.
      */
     public boolean fieldsIndexingEnabled(Class<?> cls) {
-        if (cls == OptimizedObjectMetadataKey.class)
+        assert metaHandler != null;
+
+        if (ctx.isSystemType(cls.getName()))
             return false;
 
         try {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5fe19ff9/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedObjectInputStreamExt.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedObjectInputStreamExt.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedObjectInputStreamExt.java
index a25dafc..7eb1fe6 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedObjectInputStreamExt.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedObjectInputStreamExt.java
@@ -55,7 +55,8 @@ public class OptimizedObjectInputStreamExt extends OptimizedObjectInputStream
{
 
     /** {@inheritDoc} */
     @Override protected void skipFooter(Class<?> cls) throws IOException {
-        if (metaHandler.metadata(resolveTypeId(cls.getName(), mapper)) != null) {
+        if (!ctx.isSystemType(cls.getName()) && 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/5fe19ff9/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedObjectOutputStreamExt.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedObjectOutputStreamExt.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedObjectOutputStreamExt.java
index 02783a3..7ccb4b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedObjectOutputStreamExt.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/ext/OptimizedObjectOutputStreamExt.java
@@ -36,7 +36,12 @@ public class OptimizedObjectOutputStreamExt extends OptimizedObjectOutputStream
     /** */
     private OptimizedMarshallerExtMetaHandler metaHandler;
 
-    /** {@inheritDoc} */
+    /**
+     * Constructor.
+     *
+     * @param out Output stream.
+     * @throws IOException In case of error.
+     */
     protected OptimizedObjectOutputStreamExt(GridDataOutput out) throws IOException {
         super(out);
     }
@@ -62,7 +67,8 @@ public class OptimizedObjectOutputStreamExt extends OptimizedObjectOutputStream
 
     /** {@inheritDoc} */
     @Override protected Footer createFooter(Class<?> cls) {
-        if (metaHandler.metadata(resolveTypeId(cls.getName(), mapper)) != null)
+        if (!ctx.isSystemType(cls.getName()) && metaHandler != null &&
+            metaHandler.metadata(resolveTypeId(cls.getName(), mapper)) != null)
             return new FooterImpl();
         else
             return null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5fe19ff9/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMarshallerSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMarshallerSelfTestSuite.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMarshallerSelfTestSuite.java
index 40c32a2..f3047f2 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMarshallerSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteMarshallerSelfTestSuite.java
@@ -21,6 +21,7 @@ import junit.framework.*;
 import org.apache.ignite.internal.util.io.*;
 import org.apache.ignite.marshaller.jdk.*;
 import org.apache.ignite.marshaller.optimized.*;
+import org.apache.ignite.marshaller.optimized.ext.*;
 import org.apache.ignite.testframework.*;
 
 import java.util.*;
@@ -49,6 +50,7 @@ public class IgniteMarshallerSelfTestSuite extends TestSuite {
         GridTestUtils.addTestIfNeeded(suite, OptimizedMarshallerEnumSelfTest.class, ignoredTests);
         GridTestUtils.addTestIfNeeded(suite, OptimizedMarshallerSelfTest.class, ignoredTests);
         GridTestUtils.addTestIfNeeded(suite, OptimizedMarshallerTest.class, ignoredTests);
+        GridTestUtils.addTestIfNeeded(suite, OptimizedMarshallerExtSelfTest.class, ignoredTests);
         GridTestUtils.addTestIfNeeded(suite, OptimizedObjectStreamSelfTest.class, ignoredTests);
         GridTestUtils.addTestIfNeeded(suite, GridUnsafeDataOutputArraySizingSelfTest.class,
ignoredTests);
         GridTestUtils.addTestIfNeeded(suite, OptimizedMarshallerNodeFailoverTest.class, ignoredTests);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5fe19ff9/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
index dee3078..e4f3d12 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
@@ -118,9 +118,12 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
         suite.addTestSuite(CachePartitionedQueryMetricsSelfTest.class);
         suite.addTestSuite(CacheReplicatedQueryMetricsSelfTest.class);
 
-        //Unmarshallig query test.
+        // Unmarshallig query test.
         suite.addTestSuite(IgniteCacheP2pUnmarshallingQueryErrorTest.class);
 
+        // Optimized extended marshaller query tests
+        suite.addTestSuite(IgniteCacheOptimizedMarshallerExtQuerySelfTest.class);
+
         return suite;
     }
 }


Mime
View raw message