GRID::Cluster::Result - The object managing the result of a GRID::Cluster remote command execution
The result of a call to a remote command,
for example using methods
chdir of GRID::Cluster,
is a reference to a GRID::Cluster::Result object.
This kind of object is responsible for obtaining the results for each machine that is part of a
These results allow to identify which machines has finished the execution of a remote command satisfactorily, and in which ones a failure has occurred.
GRID::Cluster::Result object contains,
a hash with keys the names of the different machines and values the corresponding GRID::Machine::Result objects.
my $r = GRID::Cluster::Result->new();
It builds a new result object. No parameters are required.
$r->add( host_name => $_, machine_result => $machine_result );
This method adds a
GRID::Machine::Result object to an existing
GRID::Cluster::Result object. The parameters are:
host_name: A string containing the name of a machine.
machine_result: A reference to a
This method returns a reference to a list of trues or falses, depending on there were / weren't errors during the execution of a remote command in every machine.
This method returns true if all the values of the list returned by the method
result are true. Moreover, this method is used to overload the operator bool.
This method returns the string made of concatenating stdout, stderr and errmsg of every machine. The resulting string of calling this method looks like:
host1: host2: file not found host3:
Furthermore, this method is used to overload the Perl operator q(""). Thus, wherever a
GRID::Cluster::Result object is used on a scalar string context the method
str will be called.
Eduardo Segredo Gonzalez <email@example.com> and Casiano Rodriguez Leon <firstname.lastname@example.org>
This work has been supported by the EC (FEDER) and the Spanish Ministry of Science and Innovation inside the 'Plan Nacional de I+D+i' with the contract number TIN2008-06491-C04-02.
Also, it has been supported by the Canary Government project number PI2007/015.
The work of Eduardo Segredo was funded by grant FPU-AP2009-0457.
Copyright (C) 2010 by Casiano Rodriguez Leon and Eduardo Segredo Gonzalez. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.2 or, at your option, any later version of Perl 5 you may have available.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.