NAME
App::Hachero::Plugin::Base - base class of plugin for App::Hachero
SYNOPSYS
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;
DESCRIPTION
base class of App::Hachero plugin. You can subclass this to implement your analyzer or other plugins.
preparation
you can setup your plugin in init method.
init($self, $app)
$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.
available hooks
initialize
called once after the application is instancieated. you can access to $context->conf->{global} and setup your plugins.
fetch
called once at the begining of the application. See App::Hachero::Plugin::Fetch::FTP for detailed example.
input
called to set the current log line. See App::Hachero::Plugin::Input::Stdin for detailed example.
parse
called in each line to parse the current log line. See App::Hachero::Plugin::Parse::Common for detailed example.
classify
called to distingwish the log type (for example, whether robot access or not). See App::Hachero::Plugin::Classify::Robot for detailed example.
filter
called to exclude needless log. See App::Hachero::Plugin::Filter::AccessTime for detailed example.
analyze
called to analyze the log and store result. See App::Hachero::Plugin::Analyze::AccessCount for detailed example.
output_line
called to output result of the current log line. See App::Hachero::Plugin::OutputLine::HadoopMap for detailed example.
output
called once the end of process to output calculated result. See App::Hachero::Plugin::Output::Dump for detailed example.
cleanup
called once after the process to cleanup.
METHODS
new
Constructor. You don't need to think about it.
AUTHOR
Takaaki Mizuno <cpan@takaaki.info>
Nobuo Danjou <nobuo.danjou@gmail.com>