You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bs...@apache.org on 2018/04/05 16:20:55 UTC

[geode] 01/02: Revert "GEODE-4989 CQ reply message fromData method deserializes query results"

This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 400c76203a5732c33d96ec6f20a73157efd0f5b1
Author: Bruce Schuchardt <bs...@pivotal.io>
AuthorDate: Thu Apr 5 09:02:18 2018 -0700

    Revert "GEODE-4989 CQ reply message fromData method deserializes query results"
    
    This reverts commit 3c263e9220cd56486e3ec4d39cdd0a694482fb49.
---
 .../apache/geode/cache/query/internal/CqEntry.java |  2 +-
 .../internal/streaming/StreamingOperation.java     |  8 +++---
 .../apache/geode/pdx/internal/TypeRegistry.java    |  6 -----
 .../QueryObjectSerializationJUnitTest.java         | 30 +---------------------
 4 files changed, 6 insertions(+), 40 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/CqEntry.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/CqEntry.java
index 9b09682..fb01a07 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/CqEntry.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/CqEntry.java
@@ -92,7 +92,7 @@ public class CqEntry implements DataSerializableFixedID {
 
   public void fromData(DataInput in) throws IOException, ClassNotFoundException {
     this.key = InternalDataSerializer.readUserObject(in);
-    this.value = InternalDataSerializer.readUserObject(in);
+    this.value = DataSerializer.readObject(in);
   }
 
 
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/streaming/StreamingOperation.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/streaming/StreamingOperation.java
index 4cfba1d..391c366 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/streaming/StreamingOperation.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/streaming/StreamingOperation.java
@@ -554,17 +554,17 @@ public abstract class StreamingOperation {
               lowMemoryDetected = true;
               break;
             }
-            Object theObject = DataSerializer.readObject(in);
+            Object o = InternalDataSerializer.readUserObject(in);
             if (isQueryMessageProcessor && elementType != null && elementType.isStructType()) {
               boolean convertToStruct = isSenderAbove_8_1;
               if (convertToStruct && i == 0) {
-                convertToStruct = !(theObject instanceof PRQueryTraceInfo);
+                convertToStruct = !(o instanceof PRQueryTraceInfo);
               }
               if (convertToStruct) {
-                theObject = new StructImpl((StructTypeImpl) elementType, (Object[]) theObject);
+                o = new StructImpl((StructTypeImpl) elementType, (Object[]) o);
               }
             }
-            this.objectList.add(theObject);
+            this.objectList.add(o);
           }
           if (lowMemoryDetected) {
             isCanceled = true;
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/TypeRegistry.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/TypeRegistry.java
index 00a64b3..76aed3e 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/TypeRegistry.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/TypeRegistry.java
@@ -95,12 +95,6 @@ public class TypeRegistry {
     }
   }
 
-  /**
-   * When this returns true pdx-read-serialized should be respected, which is the
-   * default. Setting this to false disables pdx-read-serialized while deserializing
-   * objects. This takes precendence over setPdxReadSerializedOverride, which affects
-   * the cache's setting of that attribute.
-   */
   public static boolean getPdxReadSerialized() {
     return disablePdxReadSerialized.get() == null;
   }
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/internal/QueryObjectSerializationJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/internal/QueryObjectSerializationJUnitTest.java
index e0dff0a..bf36757 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/internal/QueryObjectSerializationJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/internal/QueryObjectSerializationJUnitTest.java
@@ -14,7 +14,7 @@
  */
 package org.apache.geode.cache.query.internal;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -32,14 +32,9 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.DataSerializer;
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.cache.query.types.ObjectType;
-import org.apache.geode.distributed.ConfigurationProperties;
 import org.apache.geode.internal.cache.CachePerfStats;
-import org.apache.geode.pdx.PdxSerializableDUnitTest;
-import org.apache.geode.pdx.internal.PdxInstanceImpl;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 /**
@@ -137,29 +132,6 @@ public class QueryObjectSerializationJUnitTest implements Serializable {
     // checkRoundTrip(sssWithoutData);
   }
 
-  /**
-   * Ensure that a CqEntry respects pdx-read-serialized=true
-   */
-  @Test
-  public void testPdxReadSerializedWithCQEntry() throws IOException, ClassNotFoundException {
-    Cache cache = new CacheFactory().set(ConfigurationProperties.LOCATORS, "")
-        .set(ConfigurationProperties.MCAST_PORT, "0").setPdxReadSerialized(true).create();
-
-    try {
-      Object key = "APdxSerializableObject";
-      Object value = new PdxSerializableDUnitTest.TestPdxObject();
-      CqEntry entry = new CqEntry(key, value);
-      DataOutputStream out = getDataOutput();
-      DataSerializer.writeObject(entry, out);
-      out.flush();
-      DataInput in = getDataInput();
-      CqEntry newEntry = DataSerializer.readObject(in);
-      assertEquals(PdxInstanceImpl.class, newEntry.getValue().getClass());
-    } finally {
-      cache.close();
-    }
-  }
-
   private static class SimpleObjectType implements ObjectType {
     public SimpleObjectType() {}
 

-- 
To stop receiving notification emails like this one, please contact
bschuchardt@apache.org.