You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hama.apache.org by ed...@apache.org on 2008/12/03 13:05:26 UTC
svn commit: r722851 - in /incubator/hama/trunk/src/java/org/apache/hama:
AbstractVector.java HamaAdmin.java HamaConfiguration.java
Author: edwardyoon
Date: Wed Dec 3 04:05:26 2008
New Revision: 722851
URL: http://svn.apache.org/viewvc?rev=722851&view=rev
Log:
Fix some javadoc error.
Modified:
incubator/hama/trunk/src/java/org/apache/hama/AbstractVector.java
incubator/hama/trunk/src/java/org/apache/hama/HamaAdmin.java
incubator/hama/trunk/src/java/org/apache/hama/HamaConfiguration.java
Modified: incubator/hama/trunk/src/java/org/apache/hama/AbstractVector.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/AbstractVector.java?rev=722851&r1=722850&r2=722851&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/AbstractVector.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/AbstractVector.java Wed Dec 3 04:05:26 2008
@@ -24,13 +24,29 @@
import org.apache.hama.io.DoubleEntry;
import org.apache.hama.io.MapWritable;
+/**
+ * Methods of the vector classes
+ */
public abstract class AbstractVector {
public MapWritable<Integer, DoubleEntry> entries;
+ /**
+ * Gets the value of index
+ *
+ * @param index
+ * @return the value of v(index)
+ * @throws NullPointerException
+ */
public double get(int index) throws NullPointerException {
return this.entries.get(index).getValue();
}
+ /**
+ * Sets the value of index
+ *
+ * @param index
+ * @param value
+ */
public void set(int index, double value) {
// If entries are null, create new object
if(this.entries == null) {
@@ -40,6 +56,12 @@
this.entries.put(index, new DoubleEntry(value));
}
+ /**
+ * Adds the value to v(index)
+ *
+ * @param index
+ * @param value
+ */
public void add(int index, double value) {
set(index, get(index) + value);
}
@@ -62,6 +84,11 @@
return (this.entries != null) ? this.entries.size() : 0;
}
+ /**
+ * Returns the {@link org.apache.hama.io.MapWritable}
+ *
+ * @return the entries of vector
+ */
public MapWritable<Integer, DoubleEntry> getEntries() {
return this.entries;
}
Modified: incubator/hama/trunk/src/java/org/apache/hama/HamaAdmin.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/HamaAdmin.java?rev=722851&r1=722850&r2=722851&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/HamaAdmin.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/HamaAdmin.java Wed Dec 3 04:05:26 2008
@@ -21,16 +21,20 @@
import java.io.IOException;
+/**
+ * A administration interface to manage the matrix's namespace, and table
+ * allocation & garbage collection.
+ */
public interface HamaAdmin {
/**
* Saves matrix as name 'AliaseName'
- *
+ *
* @param matrix
* @param aliaseName
* @return true if it saved
*/
- public boolean save(Matrix matrix, String aliaseName);
+ public boolean save(Matrix matrix, String aliaseName);
/**
* @param name
@@ -51,5 +55,5 @@
* @throws IOException
*/
public void delete(String matrixName) throws IOException;
-
+
}
Modified: incubator/hama/trunk/src/java/org/apache/hama/HamaConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/HamaConfiguration.java?rev=722851&r1=722850&r2=722851&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/HamaConfiguration.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/HamaConfiguration.java Wed Dec 3 04:05:26 2008
@@ -58,7 +58,7 @@
/**
* Sets the number of reduce task
*
- * @param map
+ * @param reduce
*/
public void setNumReduceTasks(int reduce) {
set("mapred.reduce.tasks",String.valueOf(reduce));
@@ -66,8 +66,6 @@
/**
* Gets the number of map task
- *
- * @param map
*/
public int getNumMapTasks() {
return Integer.parseInt(get("mapred.map.tasks"));
@@ -75,15 +73,13 @@
/**
* Gets the number of reduce task
- *
- * @param map
*/
public int getNumReduceTasks() {
return Integer.parseInt(get("mapred.reduce.tasks"));
}
/**
- * Adds Hama configurations
+ * Adds Hama configuration files to a Configuration
*/
private void addHamaResources() {
addResource("hama-site.xml");