當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。