[ 
https://issues.apache.org/jira/browse/METRON-1728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16573711#comment-16573711
 ] 

ASF GitHub Bot commented on METRON-1728:
----------------------------------------

Github user mmiklavc commented on a diff in the pull request:

    https://github.com/apache/metron/pull/1151#discussion_r208697541
  
    --- Diff: 
metron-platform/metron-pcap/src/main/java/org/apache/metron/pcap/mr/PcapJob.java
 ---
    @@ -216,20 +218,22 @@ public void setCompleteCheckInterval(long interval) {
         Configuration hadoopConf = PcapOptions.HADOOP_CONF.get(configuration, 
Configuration.class);
         FileSystem fileSystem = PcapOptions.FILESYSTEM.get(configuration, 
FileSystem.class);
         Path basePath = PcapOptions.BASE_PATH.getTransformed(configuration, 
Path.class);
    -    Path baseInterimResultPath = 
PcapOptions.BASE_INTERIM_RESULT_PATH.getTransformed(configuration, Path.class);
    +    Path baseInterimResultPath = PcapOptions.BASE_INTERIM_RESULT_PATH
    +        .getTransformedOrDefault(configuration, Path.class,
    +            new Path(PcapGlobalDefaults.BASE_INTERIM_RESULT_PATH_DEFAULT));
         long startTime;
         if (configuration.containsKey(PcapOptions.START_TIME_NS.getKey())) {
    -      startTime = PcapOptions.START_TIME_NS.get(configuration, Long.class);
    +      startTime = PcapOptions.START_TIME_NS.getOrDefault(configuration, 
Long.class, 0L);
         } else {
    -      startTime = PcapOptions.START_TIME_MS.get(configuration, Long.class) 
* 1000000;
    +      startTime = PcapOptions.START_TIME_MS.getOrDefault(configuration, 
Long.class, 0L) * 1000000;
         }
         long endTime;
         if (configuration.containsKey(PcapOptions.END_TIME_NS.getKey())) {
    -      endTime = PcapOptions.END_TIME_NS.get(configuration, Long.class);
    +      endTime = PcapOptions.END_TIME_NS.getOrDefault(configuration, 
Long.class, System.nanoTime());
    --- End diff --
    
    @justinleet good catch! Thanks.


> Handle null values in config in Pcap backend more gracefully
> ------------------------------------------------------------
>
>                 Key: METRON-1728
>                 URL: https://issues.apache.org/jira/browse/METRON-1728
>             Project: Metron
>          Issue Type: Sub-task
>            Reporter: Michael Miklavcic
>            Assignee: Michael Miklavcic
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to