我正在使用级联来执行 HashJoin 两个 300MB 文件。我执行以下级联工作流程:
// select the field which I need from the first file
Fields f1 = new Fields("id_1");
docPipe1 = new Each( docPipe1, scrubArguments, new ScrubFunction( f1 ), Fields.RESULTS );
// select the fields which I need from the second file
Fields f2 = new Fields("id_2","category");
docPipe2 = new Each( docPipe2, scrubArguments, new ScrubFunction( f2), Fields.RESULTS );
// hashJoin
Pipe tokenPipe = new HashJoin( docPipe1, new Fields("id_1"),
docPipe2, new Fields("id_2"), new LeftJoin());
// count the number of each "category" based on the id_1 matching id_2
Pipe pipe = new Pipe(tokenPipe );
pipe = new GroupBy( pipe , new Fields("category"));
pipe = new Every( pipe, Fields.ALL, new Count(), Fields.ALL );
我在一个 Hadoop 集群上运行这个级联程序,它有 3 个数据节点,每个是 8 个 RAM 和 4 个内核(我将 mapred.child.java.opts 设置为 4096MB。);但我需要大约 30 分钟才能得到最终结果。我认为它太慢了,但是我认为我的程序和集群中没有问题。我怎样才能使这个级联加入更快?