ml.shifu.guagua.yarn
类 GuaguaWritableAdapter<W extends org.apache.hadoop.io.Writable>

java.lang.Object
  继承者 ml.shifu.guagua.io.HaltBytable
      继承者 ml.shifu.guagua.yarn.GuaguaWritableAdapter<W>
所有已实现的接口:
Bytable

已过时。 use GuaguaWritableAdapter

@Deprecated
public class GuaguaWritableAdapter<W extends org.apache.hadoop.io.Writable>
extends HaltBytable

GuaguaWritableAdapter is used to adapt hadoop io to Bytable interface.

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_CLASS or GuaguaConstants.GUAGUA_WORKER_RESULT_CLASS setting. 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 &lt;input&gt; \ -z &lt;zkhost:zkport&gt; \ -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_opts

If you set your own main class, not use GuaguaYarnClient, 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());
 
 

另请参见:
GuaguaWritableSerializer

构造方法摘要
GuaguaWritableAdapter(W writable)
          已过时。 Contructor with Hadoop Writable setting.
 
方法摘要
 void doReadFields(DataInput in)
          已过时。  
 void doWrite(DataOutput out)
          已过时。  
 W getWritable()
          已过时。  
 void setWritable(W writable)
          已过时。  
 String toString()
          已过时。  
 
从类 ml.shifu.guagua.io.HaltBytable 继承的方法
isHalt, readFields, setHalt, write
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

GuaguaWritableAdapter

public GuaguaWritableAdapter(W writable)
已过时。 
Contructor with Hadoop Writable setting.

参数:
writable - Hadoop Writable instance
方法详细信息

doWrite

public void doWrite(DataOutput out)
             throws IOException
已过时。 
指定者:
HaltBytable 中的 doWrite
抛出:
IOException

doReadFields

public void doReadFields(DataInput in)
                  throws IOException
已过时。 
指定者:
HaltBytable 中的 doReadFields
抛出:
IOException

getWritable

public W getWritable()
已过时。 

setWritable

public void setWritable(W writable)
已过时。 

toString

public String toString()
已过时。 
覆盖:
Object 中的 toString


Copyright © 2015. All Rights Reserved.