本文整理汇总了Java中org.apache.hadoop.record.RecordInput.startRecord方法的典型用法代码示例。如果您正苦于以下问题:Java RecordInput.startRecord方法的具体用法?Java RecordInput.startRecord怎么用?Java RecordInput.startRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.record.RecordInput
的用法示例。
在下文中一共展示了RecordInput.startRecord方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserialize
import org.apache.hadoop.record.RecordInput; //导入方法依赖的package包/类
/**
* Deserialize the type information for a record
*/
@Override
public void deserialize(RecordInput rin, String tag) throws IOException {
// read in any header, version info
rin.startRecord(tag);
// name
this.name = rin.readString(tag);
sTid.read(rin, tag);
rin.endRecord(tag);
}
示例2: deserialize
import org.apache.hadoop.record.RecordInput; //导入方法依赖的package包/类
/**
* Deserialize the type information for a record
*/
public void deserialize(RecordInput rin, String tag) throws IOException {
// read in any header, version info
rin.startRecord(tag);
// name
this.name = rin.readString(tag);
sTid.read(rin, tag);
rin.endRecord(tag);
}
示例3: skip
import org.apache.hadoop.record.RecordInput; //导入方法依赖的package包/类
/**
* read/skip bytes from stream based on a type
*/
public static void skip(RecordInput rin, String tag, TypeID typeID) throws IOException {
switch (typeID.typeVal) {
case TypeID.RIOType.BOOL:
rin.readBool(tag);
break;
case TypeID.RIOType.BUFFER:
rin.readBuffer(tag);
break;
case TypeID.RIOType.BYTE:
rin.readByte(tag);
break;
case TypeID.RIOType.DOUBLE:
rin.readDouble(tag);
break;
case TypeID.RIOType.FLOAT:
rin.readFloat(tag);
break;
case TypeID.RIOType.INT:
rin.readInt(tag);
break;
case TypeID.RIOType.LONG:
rin.readLong(tag);
break;
case TypeID.RIOType.MAP:
org.apache.hadoop.record.Index midx1 = rin.startMap(tag);
MapTypeID mtID = (MapTypeID) typeID;
for (; !midx1.done(); midx1.incr()) {
skip(rin, tag, mtID.getKeyTypeID());
skip(rin, tag, mtID.getValueTypeID());
}
rin.endMap(tag);
break;
case TypeID.RIOType.STRING:
rin.readString(tag);
break;
case TypeID.RIOType.STRUCT:
rin.startRecord(tag);
// read past each field in the struct
StructTypeID stID = (StructTypeID) typeID;
Iterator<FieldTypeInfo> it = stID.getFieldTypeInfos().iterator();
while (it.hasNext()) {
FieldTypeInfo tInfo = it.next();
skip(rin, tag, tInfo.getTypeID());
}
rin.endRecord(tag);
break;
case TypeID.RIOType.VECTOR:
org.apache.hadoop.record.Index vidx1 = rin.startVector(tag);
VectorTypeID vtID = (VectorTypeID) typeID;
for (; !vidx1.done(); vidx1.incr()) {
skip(rin, tag, vtID.getElementTypeID());
}
rin.endVector(tag);
break;
default:
// shouldn't be here
throw new IOException("Unknown typeID when skipping bytes");
}
}