<commit_before>use MooseX::Declare;

class Artemis::MCP::Scheduler::Queue {
        use Artemis::Exception::Param;
        use Artemis::MCP::Scheduler::Host;
        use Artemis::MCP::Scheduler::TestRequest;

=head1 NAME
        
   Artemis::MCP::Scheduler::Queue - Object for test queue abstraction

=head1 VERSION

Version 0.01

=cut

=head1 SYNOPSIS

=cut
        

        has name         => (is => 'rw', default => '');
        has producer     => (is => 'rw');
        has share        => (is => 'rw', isa => 'Num');
        has testrequests => (is => 'rw', isa => 'ArrayRef');
        has runcount     => (is => 'rw', default => 0); # WFQ specific

=head1 FUNCTIONS

=cut


=head2 get_test_request

Get a testrequest for one of the free hosts provided as parameter.

@param array ref - list of hostnames

@return success               - Job
@return no fitting tr found   - 0

=cut

        method get_test_request(ArrayRef $free_hosts) {
                return 0 if not $self->testrequests and ref $self->testrequests eq 'ARRAY';
                foreach my $testrequest(@{$self->testrequests}) {
                        if ($testrequest->fits($free_hosts)) {
                                my $job = $self->produce($testrequest);
                                return $job;
                        }
                }
                return 0;
        }

=head2 produce


Call the producer method associated with this object.

@param string - hostname

@return success - test run id
@return error   - exception

=cut

        method produce(Artemis::MCP::Scheduler::TestRequest $request) {
                die Artemis::Exception::Param->new("Client ".$self->name."does not have an associated producer")
                    if not $self->producer ;
                return $self->producer->produce($request);
        }



}

{
        # just for CPAN
        package Artemis::MCP::Scheduler::Queue;
        our $VERSION = '0.01';
}


=head1 AUTHOR

<NAME>, C<< <maik.hentsche at amd.com> >>

=head1 COPYRIGHT & LICENSE

Copyright 2009 <NAME>, all rights reserved.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.


=cut

# Idea: provide functions that map to feature has

1;

<commit_msg>Scheduler: relocate docs<commit_after>use MooseX::Declare;

use 5.010;

class Artemis::MCP::Scheduler::Queue {

        use Artemis::Exception::Param;
        use Artemis::MCP::Scheduler::Host;
        use Artemis::MCP::Scheduler::TestRequest;


        has name         => (is => 'rw', default => '');
        has producer     => (is => 'rw');
        has share        => (is => 'rw', isa => 'Num');
        has testrequests => (is => 'rw', isa => 'ArrayRef');
        has runcount     => (is => 'rw', default => 0); # WFQ specific


=head2 get_test_request

Get a testrequest for one of the free hosts provided as parameter.

@param array ref - list of hostnames

@return success               - Job
@return no fitting tr found   - 0

=cut

        method get_test_request(ArrayRef $free_hosts) {
                return 0 if not $self->testrequests and ref $self->testrequests eq 'ARRAY';
                foreach my $testrequest(@{$self->testrequests}) {
                        if ($testrequest->fits($free_hosts)) {
                                my $job = $self->produce($testrequest);
                                return $job;
                        }
                }
                return 0;
        }

=head2 produce


Call the producer method associated with this object.

@param string - hostname

@return success - test run id
@return error   - exception

=cut

        method produce(Artemis::MCP::Scheduler::TestRequest $request) {
                die Artemis::Exception::Param->new("Client ".$self->name."does not have an associated producer")
                    if not $self->producer ;
                return $self->producer->produce($request);
        }



}

{
        # just for CPAN
        package Artemis::MCP::Scheduler::Queue;
        our $VERSION = '0.01';
}

=head1 NAME

Artemis::MCP::Scheduler::Queue - Object for test queue abstraction

=head1 VERSION

Version 0.01

=head1 SYNOPSIS

=head1 FUNCTIONS


=head1 AUTHOR

<NAME>, C<< <maik.hentsche at amd.com> >>

=head1 COPYRIGHT & LICENSE

Copyright 2009 <NAME>, all rights reserved.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.


=cut

# Idea: provide functions that map to feature has

1;


{'fraction_non_alphanumeric': 0.1150855365474339, 'fraction_numerical': 0.01110864252388358, 'mean_word_length': 2.1504548635409377, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5267062', 'n_tokens_mistral': 1381, 'n_tokens_neox': 1281, 'n_words': 409}