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

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

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

    https://github.com/apache/metron/pull/1146#discussion_r208916394
  
    --- Diff: 
metron-analytics/metron-profiler-common/src/main/java/org/apache/metron/profiler/DefaultMessageRouter.java
 ---
    @@ -86,20 +96,24 @@ public DefaultMessageRouter(Context context) {
        * @param profile The profile that may need the message.
        * @return A MessageRoute if the message is needed by the profile.
        */
    -  private Optional<MessageRoute> routeToProfile(JSONObject message, 
ProfileConfig profile) {
    +  private Optional<MessageRoute> routeToProfile(JSONObject message, 
ProfileConfig profile, Clock clock) {
         Optional<MessageRoute> route = Optional.empty();
     
         // allow the profile to access the fields defined within the message
         @SuppressWarnings("unchecked")
         final Map<String, Object> state = (Map<String, Object>) message;
    -
         try {
           // is this message needed by this profile?
           if (executor.execute(profile.getOnlyif(), state, Boolean.class)) {
     
    -        // what is the name of the entity in this message?
    -        String entity = executor.execute(profile.getForeach(), state, 
String.class);
    -        route = Optional.of(new MessageRoute(profile, entity));
    +        // what time is is? could be either system or event time
    --- End diff --
    
    The timestamp logic now lives here.  This allows it to be shared by all of 
the Profiler ports; Storm, REPL, and Spark.


> Message Timestamp Logic Should be Shared
> ----------------------------------------
>
>                 Key: METRON-1704
>                 URL: https://issues.apache.org/jira/browse/METRON-1704
>             Project: Metron
>          Issue Type: Sub-task
>            Reporter: Nick Allen
>            Assignee: Nick Allen
>            Priority: Major
>
> The message timestamp logic is currently duplicated across both ports of the 
> Profiler; the REPL and Storm.  This should be pulled into 
> metron-profiler-common so that the logic can be shared and also used by the 
> Spark port.



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

Reply via email to