-
Notifications
You must be signed in to change notification settings - Fork 4.1k
(1.x) STORM-2854 Expose IEventLogger to make event logging pluggable #2458
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
Conversation
|
Tested manually with FileBasedEventLogger. |
f6b9152 to
a0d297d
Compare
ptgoetz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor comments.
conf/storm.yaml.example
Outdated
| # topology.event.logger.register: | ||
| # - class: "org.apache.storm.metric.FileBasedEventLogger" | ||
| # - class: "org.mycompany.MyEventLogger" | ||
| # argument: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: May want to make this "arguments" if it is a list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm following the name for metrics consumer, but I think it is worth to fix. Moreover we're deprecating metrics consumer so it looks OK. I'll fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah also it is a Map<String,Object>. I think I should remove -. Will remove.
| @Override | ||
| public String toString() { | ||
| return new Date(Long.parseLong(ts)).toString() + "," + component + "," + task + "," + messageId + "," + values; | ||
| return new Date(ts).toString() + "," + component + "," + String.valueOf(task) + "," |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to support configurable date formats or default to Date.toString()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of doing that, I just open possibility to extend FileBasedEventLogger easily. Users can simply extend FileBasedEventLogger and override buildLogMessage(EventInfo) to provide the log line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. I think it would be helpful to document that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good suggestion. I'll address.
|
|
||
| # Event Logger | ||
| # topology.event.logger.register: | ||
| # - class: "org.apache.storm.metric.FileBasedEventLogger" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove the metric package name reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventlogging classes are in org.apache.storm.metric package. I don't know why, but if we can't move them to another package, I think it should be this value since this requires full class name.
|
+1, once the minor nits are addressed. |
|
@ptgoetz @arunmahadevan |
|
+1 |
cf62f74 to
91d3cae
Compare
* expose option to register IEventLogger similar to metrics consumer
* change the interface of IEventLogger slightly
* allow argument
* the change is technically not backward compatible but in real we can treat it's OK
* cause we don't provide a chance to implement custom IEventLogger and plug to topology
* Fix EventInfo to contain origin type of values instead of String-converted values
* open possibility to extend FileBasedEventLogger and provide different format of log message
* document the change
* address review comments
91d3cae to
78e7077
Compare
For master branch: #2457