sentric/hannibal — pull request #14 by alexandre-normand (2013-02-09 02:21:49+00:00)
Title: Replace log file url pattern configuration by a regex-based discovery of that pattern (issue #11)

So this works like this:
* compactions.logfile-path-pattern defines the regex for a region server log file.
* on init(), we now iterate over region servers to discover the main log file that matches the regex. On first match, we build the logFileUrlPattern by replacing the current region server's attributes by the tokens (same as before).
* once we've got the logFileUrlPattern, everything works as it used to

I've also jammed into this change a rearrangement of the way the compaction metrics is scheduled. Instead of having the init and update be completely disjoint, the init now schedules the update (my reasoning is that the update needs the init to have happened first, especially now). Also, to prevent updates from piling up on top of each other (imagine an update that would take longer than the interval between refreshes), an update schedules the next one as it completes. I'm hoping that having put the scheduling of the next update in a finally block will address concerns that we might have an update that fails causing that feature from stopping.