ml.shifu.guagua.unit
类 GuaguaUnitDriver<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>

java.lang.Object
  继承者 ml.shifu.guagua.unit.GuaguaUnitDriver<MASTER_RESULT,WORKER_RESULT>
类型参数:
MASTER_RESULT - master result for computation in each iteration.
WORKER_RESULT - worker result for computation in each iteration.

public abstract class GuaguaUnitDriver<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable>
extends Object

GuaguaUnitDriver is a helper class to run master, worker and intercepters in one jvm instance.

One should provide all the properties by using GuaguaUnitDriver(Properties)


构造方法摘要
GuaguaUnitDriver(Properties props)
          Constructor with props setting.
 
方法摘要
protected  void doRun()
          Real running logic
abstract  List<GuaguaFileSplit[]> generateWorkerSplits(String inputs)
          Generate file splits according to inputs.
 void run()
          To run master-workers iteration.
protected  void setUp()
           
protected  void tearDown()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

GuaguaUnitDriver

public GuaguaUnitDriver(Properties props)
Constructor with props setting.

To make it work, please make sure you set parameters in below:

 props.setProperty(GuaguaConstants.MASTER_COMPUTABLE_CLASS, SumMaster.class.getName());
 props.setProperty(GuaguaConstants.WORKER_COMPUTABLE_CLASS, SumWorker.class.getName());
 props.setProperty(GuaguaConstants.GUAGUA_ITERATION_COUNT, "10");
 props.setProperty(GuaguaConstants.GUAGUA_WORKER_NUMBER, "3");
 props.setProperty(GuaguaConstants.GUAGUA_MASTER_RESULT_CLASS, LongWritable.class.getName());
 props.setProperty(GuaguaConstants.GUAGUA_WORKER_RESULT_CLASS, LongWritable.class.getName());
 props.setProperty(GuaguaConstants.GUAGUA_WORKER_RESULT_CLASS, LongWritable.class.getName());
 

方法详细信息

generateWorkerSplits

public abstract List<GuaguaFileSplit[]> generateWorkerSplits(String inputs)
                                                      throws IOException
Generate file splits according to inputs. It is like hadoop mapper splits.

抛出:
IOException

setUp

protected void setUp()

run

public void run()
To run master-workers iteration.


doRun

protected void doRun()
Real running logic


tearDown

protected void tearDown()


Copyright © 2014. All Rights Reserved.