You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by GitBox <gi...@apache.org> on 2019/07/26 20:26:31 UTC

[GitHub] [samza] rmatharu commented on a change in pull request #1109: SAMZA-2279: [Scala cleanup] Convert JobConfig to Java

rmatharu commented on a change in pull request #1109: SAMZA-2279: [Scala cleanup] Convert JobConfig to Java
URL: https://github.com/apache/samza/pull/1109#discussion_r307898223
 
 

 ##########
 File path: samza-core/src/main/java/org/apache/samza/context/JobContextImpl.java
 ##########
 @@ -44,12 +43,10 @@ private JobContextImpl(Config config, String jobName, String jobId) {
    */
   public static JobContextImpl fromConfigWithDefaults(Config config) {
     JobConfig jobConfig = new JobConfig(config);
-    Option<String> jobName = jobConfig.getName();
-    if (jobName.isEmpty()) {
-      throw new IllegalArgumentException("Job name is not defined in configuration");
-    }
+    String jobName =
+        jobConfig.getName().orElseThrow(() -> new IllegalArgumentException("Job name is not defined in configuration"));
 
 Review comment:
   Maybe use message
   "Config job.name is missing" ?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services