Repository: samza
Updated Branches:
  refs/heads/master e2335bd56 -> d28f0c857


SAMZA-1733: Defaulting to non-null serde, in case none is specified

Currently, if no system or stream serde is specified the SnapshotReporter 
simply crashes
because a MetricsSnapshot cannot be serialized using a
ByteArraySerializer (what it defaults to).

This change ensures that in this case the MetricsSnapshotReporter defaults to a 
valid constructor.

Author: rmath...@linkedin.com <rmath...@linkedin.com>

Reviewers: Jagadish <jagad...@apache.org>

Closes #596 from rmatharu/defaultserde


Project: http://git-wip-us.apache.org/repos/asf/samza/repo
Commit: http://git-wip-us.apache.org/repos/asf/samza/commit/d28f0c85
Tree: http://git-wip-us.apache.org/repos/asf/samza/tree/d28f0c85
Diff: http://git-wip-us.apache.org/repos/asf/samza/diff/d28f0c85

Branch: refs/heads/master
Commit: d28f0c857ea01682690c18b89d79fb2e327458c0
Parents: e2335bd
Author: rmath...@linkedin.com <rmath...@linkedin.com>
Authored: Tue Aug 7 17:43:15 2018 -0700
Committer: Jagadish <jvenkatra...@linkedin.com>
Committed: Tue Aug 7 17:43:15 2018 -0700

----------------------------------------------------------------------
 .../samza/metrics/reporter/MetricsSnapshotReporterFactory.scala  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/samza/blob/d28f0c85/samza-core/src/main/scala/org/apache/samza/metrics/reporter/MetricsSnapshotReporterFactory.scala
----------------------------------------------------------------------
diff --git 
a/samza-core/src/main/scala/org/apache/samza/metrics/reporter/MetricsSnapshotReporterFactory.scala
 
b/samza-core/src/main/scala/org/apache/samza/metrics/reporter/MetricsSnapshotReporterFactory.scala
index 6155f98..3fd66da 100644
--- 
a/samza-core/src/main/scala/org/apache/samza/metrics/reporter/MetricsSnapshotReporterFactory.scala
+++ 
b/samza-core/src/main/scala/org/apache/samza/metrics/reporter/MetricsSnapshotReporterFactory.scala
@@ -31,7 +31,7 @@ import org.apache.samza.config.TaskConfig.Config2Task
 import org.apache.samza.metrics.MetricsReporter
 import org.apache.samza.metrics.MetricsReporterFactory
 import org.apache.samza.metrics.MetricsRegistryMap
-import org.apache.samza.serializers.SerdeFactory
+import org.apache.samza.serializers.{MetricsSnapshotSerdeV2, SerdeFactory}
 import org.apache.samza.system.SystemFactory
 
 class MetricsSnapshotReporterFactory extends MetricsReporterFactory with 
Logging {
@@ -97,7 +97,7 @@ class MetricsSnapshotReporterFactory extends 
MetricsReporterFactory with Logging
         case _ => null
       }
     } else {
-      null
+      new MetricsSnapshotSerdeV2
     }
 
     info("Got serde %s." format serde)

Reply via email to