Skip to content

Commit

Permalink
PIG-2588: e2e harness: use pig command for cluster deploy
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/pig/trunk@1300783 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Jianyong Dai committed Mar 14, 2012
1 parent 87fb449 commit 4f83a79
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ Release 0.9.3 - Unreleased

BUG FIXES

PIG-2588: e2e harness: use pig command for cluster deploy (thw via daijy)

PIG-2572: e2e harness deploy fails when using pig that does not bundle hadoop (thw via daijy)

PIG-2568: PigOutputCommitter hide exception in commitJob (daijy)
Expand Down
21 changes: 11 additions & 10 deletions test/e2e/pig/deployers/ExistingClusterDeployer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ sub checkPrerequisites
}

# Run a quick and easy Hadoop command to make sure we can
$self->runHadoopCmd($cfg, $log, "fs -ls /");
$self->runPigCmd($cfg, $log, "fs -ls /");

}

Expand Down Expand Up @@ -217,7 +217,7 @@ sub generateData
);

# Create the HDFS directories
$self->runHadoopCmd($cfg, $log, "fs -mkdir $cfg->{'inpathbase'}");
$self->runPigCmd($cfg, $log, "fs -mkdir $cfg->{'inpathbase'}");

foreach my $table (@tables) {
print "Generating data for $table->{'name'}\n";
Expand All @@ -227,9 +227,9 @@ sub generateData
$self->runCmd($log, \@cmd);

# Copy the data to HDFS
my $hadoop = "fs -copyFromLocal $table->{'name'} ".
my $hadoop = "copyFromLocal $table->{'name'} ".
"$cfg->{'inpathbase'}/$table->{'hdfs'}";
$self->runHadoopCmd($cfg, $log, $hadoop);
$self->runPigCmd($cfg, $log, $hadoop);

}
}
Expand Down Expand Up @@ -323,17 +323,18 @@ sub confirmUndeployment
# it can use the existing utilities to build Pig commands and switch
# naturally to local mode with everything else.

sub runHadoopCmd($$$$)
sub runPigCmd($$$$)
{
my ($self, $cfg, $log, $c) = @_;

my @pigCmd = ("$cfg->{'pigpath'}/bin/pig");
push(@pigCmd, '-e');
push(@pigCmd, split(' ', $c));

# set the PIG_CLASSPATH environment variable
$ENV{'HADOOP_CLASSPATH'} = "$cfg->{'hadoopconfdir'}";
$ENV{'PIG_CLASSPATH'} = "$cfg->{'hadoopconfdir'}";

my @cmd = ("$cfg->{'hadoopbin'}");
push(@cmd, split(' ', $c));

$self->runCmd($log, \@cmd);
$self->runCmd($log, \@pigCmd);
}

sub runCmd($$$)
Expand Down

0 comments on commit 4f83a79

Please sign in to comment.