#------------------------------------------------------------
# Copyright (C) 2008 RoyaltyShare, Inc.   All Rights Reserved
#------------------------------------------------------------
package RPS::MapFace::Job::Mapper;

use strict;
use warnings;

use Sys::Hostname;

use lib '/app/tools/common/lib';
use Common::Log;
use Common::Assert;
use Common::RSApp;

use lib '/app/tools/rps/lib';
use RPS::Config;

use lib '/app/tools/job/lib';
use Job::Job;

use base 'Job::Job';

sub _generateCommandLine {
    my ($self) = @_;

    # Let's go ahead and construct everything now.
    #

    my $clientID = $self->getCommandLineArg('clientID');

    my $config     = RPS::Config->new();
    my $scriptPath = $config->get('mapface_script_dir');

    my $commandLine = "nice $scriptPath/mapper.pl -c $clientID";
    return $commandLine;
}

sub generateLogBasePath {
    my ($self) = @_;

    my $config = RPS::Config->new();
    return $config->get('mapface_log_dir');
}

sub _defaultClass    { return 'Tracker'; }
sub _defaultSubclass { return 'MapFace'; }

#sub _defaultHostname    { return hostname(); }
sub _defaultPriority { return Job::Job::kPriorityHigh; }

sub enqueue {
    my ( $self, %queueArgs ) = @_;

    my $clientID = $self->getCommandLineArg('clientID');
    $self->SUPER::enqueue(client_id => $clientID);
}

###
1;    #
###

