本文整理匯總了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);
}
示例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();
}
示例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();
}
示例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();
}