dnishimura commented on a change in pull request #1027: SAMZA-2046: Startpoint
fan out implementation
URL: https://github.com/apache/samza/pull/1027#discussion_r284753684
##########
File path:
samza-core/src/main/java/org/apache/samza/startpoint/StartpointFanOutPerTask.java
##########
@@ -20,33 +20,45 @@
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
-import org.apache.samza.container.TaskName;
+import java.time.Instant;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.samza.serializers.model.SamzaObjectMapper;
import org.apache.samza.system.SystemStreamPartition;
+import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonSerialize;
-@JsonSerialize(using = StartpointKeySerializer.class)
-class StartpointKey {
- private final SystemStreamPartition systemStreamPartition;
- private final TaskName taskName;
+/**
+ * Holds the {@link Startpoint} fan outs for each {@link
SystemStreamPartition}. Each StartpointFanOutPerTask maps to a
+ * {@link org.apache.samza.container.TaskName}
+ */
+class StartpointFanOutPerTask {
+ @JsonSerialize
+ @JsonDeserialize
+ private final Instant timestamp;
+
+ @JsonDeserialize(keyUsing =
SamzaObjectMapper.SystemStreamPartitionKeyDeserializer.class)
Review comment:
Related to the above comment, adding it to the `StartpointObjectMapper` via
`SimpleModule#addKeySerializer` and `SimpleModule#addKeyDeserializer` doesn't
seem to work when the map is nested in an object. Again, might be due to the
old version of `jackson` we're on. I'll let comments to remove the annotations
if we can consolidate all serialization code into the `StartpointObjectMapper`
with a newer version of `jackson`.
----------------------------------------------------------------
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