Author: edwardyoon
Date: Mon Aug 11 05:12:43 2008
New Revision: 684733
URL: http://svn.apache.org/viewvc?rev=684733&view=rev
Log:
Replace table.get(Text, Text) to table.get(String, String)
Modified:
incubator/hama/trunk/CHANGES.txt
incubator/hama/trunk/src/java/org/apache/hama/AbstractMatrix.java
incubator/hama/trunk/src/java/org/apache/hama/Constants.java
Modified: incubator/hama/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/hama/trunk/CHANGES.txt?rev=684733&r1=684732&r2=684733&view=diff
==============================================================================
--- incubator/hama/trunk/CHANGES.txt (original)
+++ incubator/hama/trunk/CHANGES.txt Mon Aug 11 05:12:43 2008
@@ -13,6 +13,7 @@
IMPROVEMENTS
+ HAMA-27: Replace table.get(Text, Text) to table.get(String, String)
(edwardyoon)
HAMA-12: Matrix interface re-arrangement (edwardyoon)
HAMA-21: Implement get(int index) method (edwardyoon)
HAMA-19: Remove vector-norms enum to interface from implementation
(edwardyoon)
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=684733&r1=684732&r2=684733&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:12:43 2008
@@ -49,10 +49,6 @@
protected HTable table;
/** Matrix attribute description */
protected HTableDescriptor tableDesc;
- /** The parallel degree of map function */
- protected int mapper;
- /** The parallel degree of reduce function */
- protected int reducer;
/**
* Sets the job configuration
@@ -66,8 +62,6 @@
} catch (MasterNotRunningException e) {
LOG.info(e);
}
- mapper = conf.getInt("mapred.map.tasks", 1);
- reducer = conf.getInt("mapred.reduce.tasks", 1);
}
/**
@@ -85,8 +79,8 @@
/** [EMAIL PROTECTED] */
public double get(int i, int j) {
- Text row = new Text(String.valueOf(i));
- Text column = new Text(Constants.COLUMN + String.valueOf(j));
+ String row = String.valueOf(i);
+ String column = Constants.COLUMN + String.valueOf(j);
Cell c;
double result = -1;
try {
@@ -105,8 +99,7 @@
try {
return new Vector(row, table.getRow(String.valueOf(row)));
} catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ LOG.error(e, e);
}
return null;
}
@@ -116,7 +109,7 @@
try {
return new Vector(bytesToInt(row), table.getRow(row));
} catch (IOException e) {
- e.printStackTrace();
+ LOG.error(e, e);
}
return null;
}
@@ -156,7 +149,7 @@
}
/** [EMAIL PROTECTED] */
- public void add(int i, int j, double d) {
+ public void add(int i, int j, double value) {
// TODO Auto-generated method stub
}
Modified: incubator/hama/trunk/src/java/org/apache/hama/Constants.java
URL:
http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/Constants.java?rev=684733&r1=684732&r2=684733&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/Constants.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/Constants.java Mon Aug 11
05:12:43 2008
@@ -19,20 +19,18 @@
*/
package org.apache.hama;
-import org.apache.hadoop.io.Text;
-
/**
* Some constants used in the hama
*/
public class Constants {
/** Meta-columnfamily to store the matrix-info */
- public final static Text METADATA = new Text("metadata:");
+ public final static String METADATA = "metadata:";
/** The number of the matrix rows */
- public final static Text METADATA_ROWS = new Text("metadata:rows");
+ public final static String METADATA_ROWS = "metadata:rows";
/** The number of the matrix columns */
- public final static Text METADATA_COLUMNS = new Text("metadata:columns");
+ public final static String METADATA_COLUMNS = "metadata:columns";
/** The type of the matrix */
- public final static Text METADATA_TYPE = new Text("metadata:type");
+ public final static String METADATA_TYPE = "metadata:type";
/** Default columnfamily name */
public final static String COLUMN = "column:";