You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metron.apache.org by merrimanr <gi...@git.apache.org> on 2016/06/01 23:34:09 UTC

[GitHub] incubator-metron pull request #138: METRON-189: Add the ability to do global...

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

    https://github.com/apache/incubator-metron/pull/138#discussion_r65461745
  
    --- Diff: metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/bolt/ParserBolt.java ---
    @@ -140,18 +142,25 @@ public void execute(Tuple tuple) {
         try {
           boolean ackTuple = true;
           if(sensorParserConfig != null) {
    +        List<FieldValidator> fieldValidations = getConfigurations().getFieldValidations();
             List<JSONObject> messages = parser.parse(originalMessage);
             for (JSONObject message : messages) {
               if (parser.validate(message)) {
    -            if (filter != null && filter.emitTuple(message)) {
    -              ackTuple = !isBulk;
    -              message.put(Constants.SENSOR_TYPE, getSensorType());
    -              for (FieldTransformer handler : sensorParserConfig.getFieldTransformations()) {
    -                if (handler != null) {
    -                  handler.transformAndUpdate(message, sensorParserConfig.getParserConfig());
    +            if(!isGloballyValid(message, fieldValidations)) {
    +              message.put(Constants.SENSOR_TYPE, getSensorType()+ ".invalid");
    +              collector.emit(Constants.INVALID_STREAM, new Values(message));
    +            }
    +            else if (filter != null && filter.emitTuple(message)) {
    +              if (filter != null && filter.emitTuple(message)) {
    --- End diff --
    
    Isn't this a duplicate of the previous line?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---