dnishimura commented on a change in pull request #1027: SAMZA-2046: Startpoint 
fan out implementation
URL: https://github.com/apache/samza/pull/1027#discussion_r284799604
 
 

 ##########
 File path: 
samza-core/src/main/java/org/apache/samza/startpoint/StartpointObjectMapper.java
 ##########
 @@ -39,12 +40,16 @@ static ObjectMapper getObjectMapper() {
     SimpleModule module = new SimpleModule("StartpointModule", new Version(1, 
0, 0, ""));
     module.addSerializer(Instant.class, new CustomInstantSerializer());
     module.addDeserializer(Instant.class, new CustomInstantDeserializer());
-
     objectMapper.registerModule(module);
-    objectMapper.registerSubtypes(StartpointSpecific.class);
-    objectMapper.registerSubtypes(StartpointTimestamp.class);
-    objectMapper.registerSubtypes(StartpointUpcoming.class);
-    objectMapper.registerSubtypes(StartpointOldest.class);
+
+    // 1. To support polymorphism for serialization, the Startpoint subtypes 
must be registered here.
+    // 2. The NamedType container class provides a logical name as an external 
identifier so that the full canonical
 
 Review comment:
   Not necessarily easier, but it seems to be a best practice based on the 
examples I've seen. Underneath the hood, it just uses the simple class name and 
not the full canonical name, so ordering doesn't matter. The `NamedType` 
container constructor also has a 2nd optional parameter where we can specify 
the logical name ourselves too.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to