8000 METRON-197: Validation should be the last step in the ParserBolt by cestella · Pull Request #143 · apache/metron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

METRON-197: Validation should be the last step in the ParserBolt #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from

Conversation

cestella
Copy link
Member
@cestella cestella commented Jun 3, 2016

Right now we are doing the validation prior to the messageFilter. We should only validate the parsed messages which passes through the filter.

@james-sirota
Copy link

+1. This is a simple code change in the order of method calls. Builds and all tests pass

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)) {
else {
ackTuple = !isBulk;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the tuple get acked regardless of whether it passed the validations or not?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tuple will be acked. Note that ackTuple is initialized to true and is only set to false if we are in a situation where we are doing a bulk write, in which case the tuple will be acked in the bulk writer upon the writing of a batch of entries. So, when this loop is ended, it will ack on line 164.

@merrimanr
Copy link
Contributor

I was under the impression that validations should happen after the field transformations. Is that not the case?

@james-sirota
Copy link

If a message or a tuple fails validation then the associated message should get routed to a dead letter queue. I believe there is a different PR that is required to get the dead letter queue established. The tuple should be acked, though. We need to differentiate between if the tuple is failed due to not being able to be parsed vs. not validated. So if we fail based on parser issues then we need to ack for validation issues and then land the message in the dead letter queue. The important thing is for the messages that fail validation not to go through the rest of the pipeline.

@cestella
Copy link
Member Author
cestella commented Jun 8, 2016

@merrimanr @james-sirota I tend to agree, validations should happen prior to field transformations since the transformation may affect the validity of the message. I'll adjust that. Good feedback!

@merrimanr
Copy link
Contributor

+1

@asfgit asfgit closed this in e15ed56 Jun 8, 2016
asfgit pushed a commit that referenced this pull request Jun 24, 2016
asfgit pushed a commit that referenced this pull request Jun 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0