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.
---