rmatharu commented on a change in pull request #978: SAMZA-1733 : Making MetricsSnapshotReporter look for appclass then taskclass URL: https://github.com/apache/samza/pull/978#discussion_r269684095
########## File path: samza-core/src/main/scala/org/apache/samza/metrics/reporter/MetricsSnapshotReporterFactory.scala ########## @@ -45,10 +45,8 @@ class MetricsSnapshotReporterFactory extends MetricsReporterFactory with Logging val jobId = config .getJobId - val taskClass = config - .getTaskClass - .orElse(Option(new ApplicationConfig(config).getAppClass())) - .getOrElse(throw new SamzaException("No task or app class defined for config.")) + val taskClass = Option(new ApplicationConfig(config).getAppClass()) Review comment: At LI, task.class is defined to empty in the global-app-def, but app.class is not predefined. That necessitates this fix. The logic here is simple, if there is an app.class, use it. If there is none, use task.class, if there is no task.class (and no app.class), raise an exception. I dont see any point in logging a warning, since we can't improve-upon/act-upon it. Task.subtask.class is not valid post samza 1.0. This change only impacts 1.0 and beyond users. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services