Skip to content

Conversation

@HeartSaVioR
Copy link
Contributor

@HeartSaVioR HeartSaVioR commented Dec 14, 2017

  • 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
  • open possibility to extend FileBasedEventLogger and provide different format of log message
  • document the change

For master branch: #2457

@HeartSaVioR
Copy link
Contributor Author

Tested manually with FileBasedEventLogger.

@HeartSaVioR HeartSaVioR force-pushed the STORM-2854-1.x branch 2 times, most recently from f6b9152 to a0d297d Compare December 14, 2017 11:30
Copy link
Member

@ptgoetz ptgoetz left a comment

Choose a reason for hiding this comment

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

Two minor comments.

# topology.event.logger.register:
# - class: "org.apache.storm.metric.FileBasedEventLogger"
# - class: "org.mycompany.MyEventLogger"
# argument:
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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) + ","
Copy link
Member

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()?

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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"
Copy link
Contributor

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

Copy link
Contributor Author

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.

@arunmahadevan
Copy link
Contributor

+1, once the minor nits are addressed.

@HeartSaVioR
Copy link
Contributor Author

@ptgoetz @arunmahadevan
Addressed or left comments. Please take a look again.

@arunmahadevan
Copy link
Contributor

+1

* 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
@asfgit asfgit merged commit 78e7077 into apache:1.x-branch Dec 18, 2017
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.

4 participants