You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/02/22 22:39:23 UTC

[GitHub] [geode-native] pdxcodemonkey commented on a change in pull request #891: GEODE-9753: Solve PDX serialization coredump

pdxcodemonkey commented on a change in pull request #891:
URL: https://github.com/apache/geode-native/pull/891#discussion_r812415266



##########
File path: cppcache/src/PdxRemoteWriterFactoryImpl.hpp
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#ifndef GEODE_PDXREMOTEWRITERFACTORYIMPL_H_
+#define GEODE_PDXREMOTEWRITERFACTORYIMPL_H_
+
+#include "PdxRemoteWriterFactory.hpp"
+
+
+namespace apache {
+namespace geode {
+namespace client {
+
+class APACHE_GEODE_EXPORT PdxRemoteWriterFactoryImpl : public virtual PdxRemoteWriterFactory {

Review comment:
       Again, please don't export.

##########
File path: cppcache/src/PdxHelper.cpp
##########
@@ -137,28 +136,18 @@ void PdxHelper::serializePdx(
     // so we don't know whether user has used those or not;; Can we do some
     // trick here?
 
-    auto createPdxRemoteWriter = [&]() -> PdxRemoteWriter {
-      if (auto pd = pdxTypeRegistry->getPreserveData(pdxObject)) {
-        auto mergedPdxType = pdxTypeRegistry->getPdxType(pd->getMergedTypeId());
-        return PdxRemoteWriter(output, mergedPdxType, pd, pdxTypeRegistry);
-      } else {
-        return PdxRemoteWriter(output, className, pdxTypeRegistry);
-      }
-    };
+    auto prw = cacheImpl->getPdxRemoteWriterFactory().create(

Review comment:
       Can we use a slightly longer, meaningful name?  like `remoteWriter` for instance?

##########
File path: cppcache/src/PdxRemoteWriter.hpp
##########
@@ -22,11 +22,13 @@
 
 #include "PdxLocalWriter.hpp"
 
+#include <geode/internal/geode_globals.hpp>
+
 namespace apache {
 namespace geode {
 namespace client {
 
-class PdxRemoteWriter : public PdxLocalWriter {
+class APACHE_GEODE_EXPORT PdxRemoteWriter : public PdxLocalWriter {

Review comment:
       Please don't export this, we can't change the ABI and anyway we don't want any more publicly-accessible things than we already have(!).




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org