hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Hama Wiki] Trivial Update of "InterfaceConsiderations" by udanax
Date Thu, 07 Aug 2008 07:03:46 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hama Wiki" for change notification.

The following page has been changed by udanax:
http://wiki.apache.org/hama/InterfaceConsiderations

------------------------------------------------------------------------------
  Let's make Hama interfaces with BDD(Behavior Driven Development) style.
  
- == Flat file to Matrix Conversion ==
+ == Input/Output Formatters ==
  
- We need Input/Output Formatters which convert Text File/Sequence File to Matrix.
+ {{{
+   public void map(ImmutableBytesWritable key, VectorWritable value,
+       OutputCollector<ImmutableBytesWritable, VectorWritable> output,
+       Reporter reporter) throws IOException {
  
- For example, 
- 
- {{{ 
-   public void map(LongWritable key, Text value,
-     OutputCollector<ImmutableBytesWritable, VectorWritable> output, Reporter reporter)
-     throws IOException {
-       
-     String line = value.toString();
- 
-     /* Do something  */
+     /* Do something */
- 
-     output.collect(rowKey, vector);
+     output.collect(key, value);
    }
  
    public void reduce(ImmutableBytesWritable key, Iterator<VectorWritable> values,
@@ -34, +27 @@

    }
  }}}
  
- == Matrix Input/Outpu Formatters ==
+ === Flat file to Matrix Conversion ===
  
+ We also need Input/Output Formatters which convert Text File/Sequence File to Matrix.
+ 
+ For example, 
+ 
+ {{{ 
+   public void map(LongWritable key, Text value,
+     OutputCollector<ImmutableBytesWritable, VectorWritable> output, Reporter reporter)
+     throws IOException {
+       
+     String line = value.toString();
+ 
+     /* Do something */
+ 
+     output.collect(rowKey, vector);
+   }
+ }}}
+ 

Mime
View raw message