Index: src/java/org/apache/hama/matrix/AbstractMatrix.java =================================================================== --- src/java/org/apache/hama/matrix/AbstractMatrix.java (revision 829720) +++ src/java/org/apache/hama/matrix/AbstractMatrix.java (working copy) @@ -47,6 +47,7 @@ import org.apache.hadoop.io.MapWritable; import org.apache.hadoop.io.SequenceFile; import org.apache.hadoop.mapred.FileOutputFormat; +import org.apache.hadoop.mapred.JobClient; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapreduce.Job; import org.apache.hama.Constants; @@ -69,7 +70,6 @@ import org.apache.hama.matrix.algebra.MatrixNormMapRed.MatrixOneNormMapper; import org.apache.hama.matrix.algebra.MatrixNormMapRed.MatrixOneNormReducer; import org.apache.hama.util.BytesUtil; -import org.apache.hama.util.JobManager; import org.apache.hama.util.RandomVariable; import org.apache.log4j.Logger; @@ -200,7 +200,7 @@ // update the out put dir of the job outDir = FileOutputFormat.getOutputPath(jobConf); - JobManager.execute(jobConf); + JobClient.runJob(jobConf); // read outputs Path inFile = new Path(outDir, "reduce-out"); @@ -236,7 +236,7 @@ // update the out put dir of the job outDir = FileOutputFormat.getOutputPath(jobConf); - JobManager.execute(jobConf); + JobClient.runJob(jobConf); // read outputs Path inFile = new Path(outDir, "part-00000"); @@ -273,7 +273,7 @@ // update the out put dir of the job outDir = FileOutputFormat.getOutputPath(jobConf); - JobManager.execute(jobConf); + JobClient.runJob(jobConf); // read outputs Path inFile = new Path(outDir, "part-00000"); @@ -310,7 +310,7 @@ // update the out put dir of the job outDir = FileOutputFormat.getOutputPath(jobConf); - JobManager.execute(jobConf); + JobClient.runJob(jobConf); // read outputs Path inFile = new Path(outDir, "part-00000"); Index: src/java/org/apache/hama/matrix/DenseMatrix.java =================================================================== --- src/java/org/apache/hama/matrix/DenseMatrix.java (revision 829720) +++ src/java/org/apache/hama/matrix/DenseMatrix.java (working copy) @@ -43,6 +43,7 @@ import org.apache.hadoop.io.Writable; import org.apache.hadoop.io.SequenceFile.CompressionType; import org.apache.hadoop.mapred.FileOutputFormat; +import org.apache.hadoop.mapred.JobClient; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.SequenceFileOutputFormat; import org.apache.hadoop.mapred.lib.NullOutputFormat; @@ -69,7 +70,6 @@ import org.apache.hama.matrix.algebra.RowCyclicAdditionMap; import org.apache.hama.matrix.algebra.RowCyclicAdditionReduce; import org.apache.hama.util.BytesUtil; -import org.apache.hama.util.JobManager; import org.apache.hama.util.RandomVariable; /** @@ -454,8 +454,7 @@ MapWritable.class, jobConf); RowCyclicAdditionReduce.initJob(result.getPath(), RowCyclicAdditionReduce.class, jobConf); - - JobManager.execute(jobConf); + JobClient.runJob(jobConf); return result; } @@ -501,7 +500,7 @@ RowCyclicAdditionReduce.initJob(result.getPath(), RowCyclicAdditionReduce.class, jobConf); - JobManager.execute(jobConf); + JobClient.runJob(jobConf); return result; } @@ -542,7 +541,7 @@ jobConf); DenseMatrixVectorMultReduce.initJob(result.getPath(), DenseMatrixVectorMultReduce.class, jobConf); - JobManager.execute(jobConf); + JobClient.runJob(jobConf); } return result; @@ -582,7 +581,7 @@ BlockMultiplyReduce.initJob(result.getPath(), BlockMultiplyReduce.class, jobConf); - JobManager.execute(jobConf); + JobClient.runJob(jobConf); hamaAdmin.delete(collectionTable); return result; } @@ -703,7 +702,7 @@ CollectBlocksMapper.initJob(collectionTable, bool, block_size, this .getRows(), this.getColumns(), jobConf); - JobManager.execute(jobConf); + JobClient.runJob(jobConf); } /** @@ -739,7 +738,7 @@ jobConf.setMapOutputKeyClass(IntWritable.class); jobConf.setMapOutputValueClass(MapWritable.class); - JobManager.execute(jobConf); + JobClient.runJob(jobConf); final FileSystem fs = FileSystem.get(jobConf); Pair pivotPair = new Pair(); @@ -788,7 +787,7 @@ // update the out put dir of the job outDir = FileOutputFormat.getOutputPath(jobConf); - JobManager.execute(jobConf); + JobClient.runJob(jobConf); // read outputs Path inFile = new Path(outDir, "part-00000"); @@ -867,7 +866,7 @@ .addInputPaths(jobConf, getPath()); jobConf.setOutputFormat(NullOutputFormat.class); - JobManager.execute(jobConf); + JobClient.runJob(jobConf); // rotate eigenvectors LOG.info("rotating eigenvector"); Index: src/java/org/apache/hama/matrix/SparseMatrix.java =================================================================== --- src/java/org/apache/hama/matrix/SparseMatrix.java (revision 829720) +++ src/java/org/apache/hama/matrix/SparseMatrix.java (working copy) @@ -35,6 +35,7 @@ import org.apache.hadoop.io.SequenceFile; import org.apache.hadoop.io.Writable; import org.apache.hadoop.io.SequenceFile.CompressionType; +import org.apache.hadoop.mapred.JobClient; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; @@ -47,7 +48,6 @@ import org.apache.hama.matrix.algebra.SparseMatrixVectorMultMap; import org.apache.hama.matrix.algebra.SparseMatrixVectorMultReduce; import org.apache.hama.util.BytesUtil; -import org.apache.hama.util.JobManager; import org.apache.hama.util.RandomVariable; public class SparseMatrix extends AbstractMatrix implements Matrix { @@ -262,7 +262,7 @@ MapWritable.class, jobConf); SparseMatrixVectorMultReduce.initJob(result.getPath(), SparseMatrixVectorMultReduce.class, jobConf); - JobManager.execute(jobConf); + JobClient.runJob(jobConf); } return result; Index: src/java/org/apache/hama/util/JobManager.java =================================================================== --- src/java/org/apache/hama/util/JobManager.java (revision 829698) +++ src/java/org/apache/hama/util/JobManager.java (working copy) @@ -1,83 +0,0 @@ -/** - * Copyright 2007 The Apache Software Foundation - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.hama.util; - -import java.io.IOException; - -import org.apache.hadoop.mapred.JobClient; -import org.apache.hadoop.mapred.JobConf; -import org.apache.hadoop.mapreduce.Job; -import org.apache.hama.matrix.Matrix; - -/** - * A map/reduce job manager - */ -public class JobManager { - public static void execute(JobConf jobConf, Matrix result) throws IOException { - try { - JobClient.runJob(jobConf); - // TODO : Thinking about more efficient method. - int rows = result.getColumn(0).size(); - int columns = result.getRow(0).size(); - result.setDimension(rows, columns); - } catch (IOException e) { - result.close(); - throw new IOException(e); - } - } - - /** - * a help method to execute a job - * - * @param jobConf - * @throws IOException - */ - public static void execute(JobConf jobConf) throws IOException { - JobClient.runJob(jobConf); - } - - public static void execute(Job job) throws IOException { - try { - job.waitForCompletion(true); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - public static class MultipleJob extends Thread { - private JobConf jobConf; - - public MultipleJob(JobConf jobConf) { - this.jobConf = jobConf; - } - - public void run() { - try { - JobClient.runJob(this.jobConf); - } catch (IOException e) { - e.printStackTrace(); - } - } - } -}