Package ml.shifu.guagua.mapreduce
Class GuaguaWritableAdapter<W extends org.apache.hadoop.io.Writable>
- java.lang.Object
-
- ml.shifu.guagua.io.HaltBytable
-
- ml.shifu.guagua.mapreduce.GuaguaWritableAdapter<W>
-
- All Implemented Interfaces:
ml.shifu.guagua.io.Bytable
@Deprecated public class GuaguaWritableAdapter<W extends org.apache.hadoop.io.Writable> extends ml.shifu.guagua.io.HaltBytable
Deprecated.GuaguaWritableAdapteris used to adapt hadoop io toBytableinterface.The reason we use our own writable interface is that we'd like to not depend on hadoop io on guagua core service.
By using this adapter we don't need to implement such as IntWritable, LongWritable, Text and other common writable implementations.
Notice: If you use GuaguaWritableAdapter as your result class, you should provide the inner writable class name to
GuaguaConstants.GUAGUA_MASTER_RESULT_CLASSorGuaguaConstants.GUAGUA_WORKER_RESULT_CLASSsetting. That means to set '-mr' or 'wr' to hadoop writable class name. Here is a sample:hadoop jar ../lib/guagua-mapreduce-0.0.1-SNAPSHOT.jar \ ml.shifu.guagua.mapreduce.GuaguaMapReduceClient \ -libjars ../lib/guagua-mapreduce-examples-0.0.1-SNAPSHOT.jar,../lib/guava-r09-jarjar.jar,../lib/encog-core-3.1.0.jar,../lib/guagua-mapreduce-0.0.1-SNAPSHOT.jar,../lib/guagua-core-0.0.1-SNAPSHOT.jar,../lib/zookeeper-3.4.5.jar \ -i <input> \ -z <zkhost:zkport> \ -w ml.shifu.guagua.example.sum.SumWorker \ -m ml.shifu.guagua.example.sum.SumMaster \ -c 10 \ -n "Guagua Sum Master-Workers Job" \ -mr org.apache.hadoop.io.LongWritable \ -wr org.apache.hadoop.io.LongWritable \ $queue_optsIf you set your own main class, not use
GuaguaMapReduceClient, you can set the result class like this.conf.set(GuaguaConstants.GUAGUA_MASTER_RESULT_CLASS, LongWritable.class.getName()); conf.set(GuaguaConstants.GUAGUA_WORKER_RESULT_CLASS, LongWritable.class.getName());- See Also:
GuaguaWritableSerializer
-
-
Constructor Summary
Constructors Constructor Description GuaguaWritableAdapter(W writable)Deprecated.Constructor with Hadoop Writable setting.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddoReadFields(DataInput in)Deprecated.voiddoWrite(DataOutput out)Deprecated.booleanequals(Object obj)Deprecated.WgetWritable()Deprecated.inthashCode()Deprecated.voidsetWritable(W writable)Deprecated.StringtoString()Deprecated.
-
-
-
Constructor Detail
-
GuaguaWritableAdapter
public GuaguaWritableAdapter(W writable)
Deprecated.Constructor with Hadoop Writable setting.- Parameters:
writable- Hadoop Writable instance
-
-
Method Detail
-
doWrite
public void doWrite(DataOutput out) throws IOException
Deprecated.- Specified by:
doWritein classml.shifu.guagua.io.HaltBytable- Throws:
IOException
-
doReadFields
public void doReadFields(DataInput in) throws IOException
Deprecated.- Specified by:
doReadFieldsin classml.shifu.guagua.io.HaltBytable- Throws:
IOException
-
getWritable
public W getWritable()
Deprecated.
-
setWritable
public void setWritable(W writable)
Deprecated.
-
-