You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 46 Next »

This page describes the Hama Shell.

Commands

Load      load the matrix from the matrix file using user specified !MapReduce class. 
          for example:
 
          hama> a = load "fileA" as Matrix using MyMapReduce.class MAP 10 REDUCE 1; 
          hama> b = load "fileB" as Matrix using MyMapReduce.class;

Add      the matrix addition. 
          such as : 

          hama> c = a + b.

Multiply   the matrix multiplication. 
          such as : 

          hama> d = a * b.

Save      save the matrix as a file. 
          such as :
          
          hama> save c as "fileC".

Grammar

<hamascript> := <expr> ";"

<expr> := [<alias> "="] <baseexpr> ["MAP" <integer>] ["REDUCE" <integer>] | "SAVE" <saveexpr>

<baseexpr> := <operationexpr> | "LOAD" <loadexpr>

<operationexpr> := <alias> | <operationexpr> <operations> <operationexpr> | "(" <operationexpr> ")" 

<operations> := "+" | "-" | "*"

<loadexpr> := <filename> "as" <type> ["USING" <loadclass> ["MAP" <integer>] ["REDUCE" <integer>] ]

<type> := "matrix"

<loadclass> := <quotedstring>

<saveexpr> := <alias> "as" <filename>

<filename> := <quotedstring>

<quotedstring> := "'"<string>"'"

_ Still in work..._

  • No labels