Github user nickwallen commented on a diff in the pull request:
https://github.com/apache/incubator-metron/pull/352#discussion_r87669665
--- Diff:
metron-analytics/metron-profiler/src/main/java/org/apache/metron/profiler/bolt/ProfileBuilderBolt.java
---
@@ -243,8 +244,18 @@ private void flush(Tuple tickTuple) {
measurement.setValue(result);
emit(measurement, tickTuple);
+ // Execute the update with the old state
+ Map<String, String> tickUpdate = profileConfig.getTickUpdate();
+ Map<String, Object> state = executor.getState();
+ if(tickUpdate != null) {
+ tickUpdate.forEach((var, expr) -> executor.assign(var, expr,
executor.getState()));
+ }
// clear the execution state to prepare for the next window
executor.clearState();
+ //make sure that we bring along the update state
+ if(tickUpdate != null) {
+ tickUpdate.forEach((var, expr) -> executor.getState().put(var,
state.get(var)));
--- End diff --
The effect of this is to carry forward the values of all 'tick' expressions
past a flush. So you effectively have a set of variables that are never
cleared or reset.
I thought you had said that you did not want to take this approach due to
the risk of losing that state if a worker dies. Am I misunderstanding this?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---