| App-Hachero documentation | view source | Contained in the App-Hachero distribution. |
App::Hachero::Plugin::Base - base class of plugin for App::Hachero
package App::Hachero::Plugin::Analyze::MyAnalyzer;
use base App::Hachero::Plugin::Base;
sub init {
my ($self, $app) = @_;
# prepare something
}
sub analyzer : Hook {
my ($self, $context) = @_;
# do something
}
1;
base class of App::Hachero plugin. You can subclass this to implement your analyzer or other plugins.
you can setup your plugin in init method.
$self is instanciated plugin object and so you can setup your plugin before running hooks. $app is not application instance but classname "App::Hachero" string.
called once after the application is instancieated. you can access to $context->conf->{global} and setup your plugins.
called once at the begining of the application. See App::Hachero::Plugin::Fetch::FTP for detailed example.
called to set the current log line. See App::Hachero::Plugin::Input::Stdin for detailed example.
called in each line to parse the current log line. See App::Hachero::Plugin::Parse::Common for detailed example.
called to distingwish the log type (for example, whether robot access or not). See App::Hachero::Plugin::Classify::Robot for detailed example.
called to exclude needless log. See App::Hachero::Plugin::Filter::AccessTime for detailed example.
called to analyze the log and store result. See App::Hachero::Plugin::Analyze::AccessCount for detailed example.
called to output result of the current log line. See App::Hachero::Plugin::OutputLine::HadoopMap for detailed example.
called once the end of process to output calculated result. See App::Hachero::Plugin::Output::Dump for detailed example.
called once after the process to cleanup.
Constructor. You don't need to think about it.
Takaaki Mizuno <cpan@takaaki.info>
Nobuo Danjou <nobuo.danjou@gmail.com>
| App-Hachero documentation | view source | Contained in the App-Hachero distribution. |