incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r684734 - in /incubator/hama/trunk/src/java/org/apache/hama: AbstractMatrix.java Matrix.java RandomVariable.java
Date Mon, 11 Aug 2008 12:18:17 GMT
Author: edwardyoon
Date: Mon Aug 11 05:18:16 2008
New Revision: 684734

URL: http://svn.apache.org/viewvc?rev=684734&view=rev
Log:
Remove deprecated methods.

Modified:
    incubator/hama/trunk/src/java/org/apache/hama/AbstractMatrix.java
    incubator/hama/trunk/src/java/org/apache/hama/Matrix.java
    incubator/hama/trunk/src/java/org/apache/hama/RandomVariable.java

Modified: incubator/hama/trunk/src/java/org/apache/hama/AbstractMatrix.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/AbstractMatrix.java?rev=684734&r1=684733&r2=684734&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/AbstractMatrix.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/AbstractMatrix.java Mon Aug 11 05:18:16
2008
@@ -44,7 +44,7 @@
   /** Hbase admin object */
   protected HBaseAdmin admin;
   /** The name of Matrix */
-  protected Text matrixName;
+  protected String matrixName;
   /** Hbase table object */
   protected HTable table;
   /** Matrix attribute description */

Modified: incubator/hama/trunk/src/java/org/apache/hama/Matrix.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/Matrix.java?rev=684734&r1=684733&r2=684734&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/Matrix.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/Matrix.java Mon Aug 11 05:18:16 2008
@@ -25,7 +25,6 @@
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapred.JobClient;
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.hama.algebra.AdditionMap;
@@ -53,7 +52,7 @@
    * @param conf configuration object
    * @param matrixName the name of the matrix
    */
-  public Matrix(HamaConfiguration conf, Text matrixName) {
+  public Matrix(HamaConfiguration conf, String matrixName) {
     try {
       setConfiguration(conf);
       this.matrixName = matrixName;
@@ -65,7 +64,6 @@
       }
 
       table = new HTable(config, matrixName);
-
     } catch (Exception e) {
       e.printStackTrace();
     }
@@ -113,7 +111,7 @@
    * @return an m-by-n matrix with uniformly distributed random elements.
    */
   public static Matrix random(HamaConfiguration conf, int m, int n) {
-    Text name = RandomVariable.randMatrixName();
+    String name = RandomVariable.randMatrixName();
     Matrix rand = new Matrix(conf, name);
     for (int i = 0; i < m; i++) {
       for (int j = 0; j < n; j++) {
@@ -127,7 +125,7 @@
   }
 
   public Matrix add(Matrix B) {
-    Text output = RandomVariable.randMatrixName();
+    String output = RandomVariable.randMatrixName();
     Matrix C = new Matrix(config, output);
 
     JobConf jobConf = new JobConf(config);
@@ -137,9 +135,6 @@
         ImmutableBytesWritable.class, Vector.class, jobConf);
     MatrixReduce.initJob(C.getName(), AdditionReduce.class, jobConf);
 
-    jobConf.setNumMapTasks(1);
-    jobConf.setNumReduceTasks(1);
-
     try {
       JobClient.runJob(jobConf);
     } catch (IOException e) {

Modified: incubator/hama/trunk/src/java/org/apache/hama/RandomVariable.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/RandomVariable.java?rev=684734&r1=684733&r2=684734&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/RandomVariable.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/RandomVariable.java Mon Aug 11 05:18:16
2008
@@ -19,8 +19,6 @@
  */
 package org.apache.hama;
 
-import org.apache.hadoop.io.Text;
-
 /**
  * The RandomVaraibale Class provides static methods for generating random
  * numbers.
@@ -55,14 +53,14 @@
    * 
    * @return random name
    */
-  protected static Text randMatrixName() {
+  protected static String randMatrixName() {
     String rName = Constants.RANDOM;
     for (int i = 1; i <= 5; i++) {
       char ch = (char) ((Math.random() * 26) + 97);
       rName += ch;
     }
 
-    return new Text(rName);
+    return rName;
   }
 
   /**



Mime
View raw message