当前位置: 首页>>代码示例>>Java>>正文


Java IntWritable.readFields方法代码示例

本文整理汇总了Java中org.apache.hadoop.io.IntWritable.readFields方法的典型用法代码示例。如果您正苦于以下问题:Java IntWritable.readFields方法的具体用法?Java IntWritable.readFields怎么用?Java IntWritable.readFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.io.IntWritable的用法示例。


在下文中一共展示了IntWritable.readFields方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readFields

import org.apache.hadoop.io.IntWritable; //导入方法依赖的package包/类
public void readFields(DataInput dataInput) throws IOException {
    Text text = new Text();
    text.readFields(dataInput);

    Logger.println("value wrapper read class:"+text.toString());
    String className = text.toString();

    if (className.equals(IntWritable.class.getSimpleName())) {
        value = new IntWritable();
    } else if (className.equals(NewOldCustomElement.class.getSimpleName())) {
        value = new NewOldCustomElement();
    } else if (className.equals(CustomerFlowElement.class.getSimpleName())) {
        value = new CustomerFlowElement();
    } else {
       throw new IOException("can not read fields "+className);
    }
    value.readFields(dataInput);
}
 
开发者ID:cuiods,项目名称:WIFIProbe,代码行数:19,代码来源:ValueWrapper.java

示例2: readFields

import org.apache.hadoop.io.IntWritable; //导入方法依赖的package包/类
public void readFields(DataInput dataInput) throws IOException {
    Text text = new Text();
    text.readFields(dataInput);
    wifiProb = text.toString();

    IntWritable intReader = new IntWritable();

    intReader.readFields(dataInput);
    inNoOutWifi = intReader.get();
    intReader.readFields(dataInput);
    inNoOutStore = intReader.get();

    intReader.readFields(dataInput);
    outNoInWifi = intReader.get();
    intReader.readFields(dataInput);
    outNoInStore = intReader.get();


    intReader.readFields(dataInput);
    inAndOutWifi = intReader.get();
    intReader.readFields(dataInput);
    inAndOutStore = intReader.get();

    intReader.readFields(dataInput);
    stayInWifi = intReader.get();
    intReader.readFields(dataInput);
    stayInStore = intReader.get();


    DoubleWritable doubleWritable = new DoubleWritable();
    doubleWritable.readFields(dataInput);
    jumpRate = doubleWritable.get();
    doubleWritable.readFields(dataInput);
    deepVisit = doubleWritable.get();
    doubleWritable.readFields(dataInput);
    inStoreRate = doubleWritable.get();

}
 
开发者ID:cuiods,项目名称:WIFIProbe,代码行数:39,代码来源:CustomerFlowElement.java

示例3: readInt

import org.apache.hadoop.io.IntWritable; //导入方法依赖的package包/类
/** read the int value */
static int readInt(DataInput in) throws IOException {
  IntWritable uInt = TL_DATA.get().U_INT;
  uInt.readFields(in);
  return uInt.get();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:FSImageSerialization.java

示例4: readInt

import org.apache.hadoop.io.IntWritable; //导入方法依赖的package包/类
private int readInt() throws IOException {
  dis.readInt(); // ignore (we know it's 4)
  IntWritable iw = new IntWritable();
  iw.readFields(dis);
  return iw.get();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:RawBytesReduceApp.java


注:本文中的org.apache.hadoop.io.IntWritable.readFields方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。