Created
January 31, 2009 00:42
-
-
Save dougm/55377 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
#hadoop-metric-gen.pl | |
use strict; | |
#generate some test data for hadoop-collectd | |
#http://hadoop.apache.org/core/docs/current/quickstart.html | |
#svn co http://svn.apache.org/repos/asf/hadoop/core/trunk hadoop-core-trunk | |
#cd hadoop-core-trunk | |
#ant jar examples | |
my $hadoop = "./bin/hadoop"; | |
chdir "$ENV{HOME}/hadoop-core-trunk" unless -x $hadoop; | |
my $in = shift || "input"; | |
my $out = shift || "output"; | |
my $dir = -d 'build' ? 'build' : '.'; | |
my(@cmds) = ( | |
"$hadoop fs -rmr $in", | |
"$hadoop fs -put conf $in", | |
"$hadoop fs -rmr $out", | |
"$hadoop jar $dir/hadoop-*-examples.jar grep $in $out 'dfs[a-z.]+'", | |
"$hadoop fs -get $out $out", | |
"rm -rf ./$out", | |
); | |
while (1) { | |
for my $cmd (@cmds) { | |
print "$cmd\n"; | |
system $cmd; | |
} | |
sleep int rand 600; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment