Skip to content
New issue

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

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

Already on GitHub? # to your account

Spout to accept a metric registration function #60

Merged
merged 5 commits into from
Oct 21, 2014
Merged

Conversation

egonina
Copy link
Contributor

@egonina egonina commented Oct 16, 2014

This is needed for Summingbird platform-independent counters to work. We need to pass a function that registers the metrics with the StormStatProvider that the counters use.

@@ -29,19 +29,23 @@ trait BaseSpout[+T] extends BaseRichSpout with Spout[T] { self =>

var collector: SpoutOutputCollector = null

override def registerMetrics(metrics: () => TraversableOnce[Metric[_]]) =
override def registerMetricHandlers(metrics: () => TraversableOnce[Metric[_]], rf: TopologyContext => Unit) =
Copy link
Collaborator

Choose a reason for hiding this comment

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

change to be an def openHook(fn: => TopologyContext => Unit)

* Passes metrics to register with storm and a function to run on the storm runtime context
* when the spout is opened.
*/
def openHook(fn: => TopologyContext => Unit) = self
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks wrong? as did the old one. Why is the function defined rather than being abstract? or a sys.error at the least

@ianoc
Copy link
Collaborator

ianoc commented Oct 17, 2014

Minor thing, other than that LGTM

@egonina
Copy link
Contributor Author

egonina commented Oct 20, 2014

Tested this branch internally, all looks good for merge.

ianoc added a commit that referenced this pull request Oct 21, 2014
Spout to accept a metric registration function
@ianoc ianoc merged commit ea48b41 into develop Oct 21, 2014
@ianoc ianoc deleted the spout_metrics branch October 21, 2014 16:23
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants