/** * Create an empty RecordTypeInfo object. */ public RecordTypeInfo() { sTid = new StructTypeID(); }
/** * Return a collection of field type infos */ public Collection<FieldTypeInfo> getFieldTypeInfos() { return sTid.getFieldTypeInfos(); }
case TypeID.RIOType.MAP: TypeID tIDKey = genericReadTypeID(rin, tag); TypeID tIDValue = genericReadTypeID(rin, tag); return new MapTypeID(tIDKey, tIDValue); case TypeID.RIOType.STRUCT: StructTypeID stID = new StructTypeID(); int numElems = rin.readInt(tag); for (int i=0; i<numElems; i++) { stID.add(genericReadTypeInfo(rin, tag)); TypeID tID = genericReadTypeID(rin, tag); return new VectorTypeID(tID);
@Override void write(RecordOutput rout, String tag) throws IOException { rout.writeByte(typeVal, tag); writeRest(rout, tag); }
/** * 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); }
private FieldTypeInfo genericReadTypeInfo(RecordInput rin, String tag) throws IOException { String fieldName = rin.readString(tag); TypeID id = genericReadTypeID(rin, tag); return new FieldTypeInfo(fieldName, id); }
void read(RecordInput rin, String tag) throws IOException { // number of elements int numElems = rin.readInt(tag); for (int i=0; i<numElems; i++) { typeInfos.add(genericReadTypeInfo(rin, tag)); } }
/** * Return the type info of a nested record. We only consider nesting * to one level. * @param name Name of the nested record */ public RecordTypeInfo getNestedStructTypeInfo(String name) { StructTypeID stid = sTid.findStruct(name); if (null == stid) return null; return new RecordTypeInfo(name, stid); }
case TypeID.RIOType.MAP: TypeID tIDKey = genericReadTypeID(rin, tag); TypeID tIDValue = genericReadTypeID(rin, tag); return new MapTypeID(tIDKey, tIDValue); case TypeID.RIOType.STRUCT: StructTypeID stID = new StructTypeID(); int numElems = rin.readInt(tag); for (int i=0; i<numElems; i++) { stID.add(genericReadTypeInfo(rin, tag)); TypeID tID = genericReadTypeID(rin, tag); return new VectorTypeID(tID);
@Override void write(RecordOutput rout, String tag) throws IOException { rout.writeByte(typeVal, tag); writeRest(rout, tag); }
/** * 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); }
private FieldTypeInfo genericReadTypeInfo(RecordInput rin, String tag) throws IOException { String fieldName = rin.readString(tag); TypeID id = genericReadTypeID(rin, tag); return new FieldTypeInfo(fieldName, id); }
void read(RecordInput rin, String tag) throws IOException { // number of elements int numElems = rin.readInt(tag); for (int i=0; i<numElems; i++) { typeInfos.add(genericReadTypeInfo(rin, tag)); } }
/** * Return the type info of a nested record. We only consider nesting * to one level. * @param name Name of the nested record */ public RecordTypeInfo getNestedStructTypeInfo(String name) { StructTypeID stid = sTid.findStruct(name); if (null == stid) return null; return new RecordTypeInfo(name, stid); }
case TypeID.RIOType.MAP: TypeID tIDKey = genericReadTypeID(rin, tag); TypeID tIDValue = genericReadTypeID(rin, tag); return new MapTypeID(tIDKey, tIDValue); case TypeID.RIOType.STRUCT: StructTypeID stID = new StructTypeID(); int numElems = rin.readInt(tag); for (int i=0; i<numElems; i++) { stID.add(genericReadTypeInfo(rin, tag)); TypeID tID = genericReadTypeID(rin, tag); return new VectorTypeID(tID);
/** * Return a collection of field type infos */ public Collection<FieldTypeInfo> getFieldTypeInfos() { return sTid.getFieldTypeInfos(); }
@Override void write(RecordOutput rout, String tag) throws IOException { rout.writeByte(typeVal, tag); writeRest(rout, tag); }
/** * Create a RecordTypeInfo object representing a record with the given name * @param name Name of the record */ public RecordTypeInfo(String name) { this.name = name; sTid = new StructTypeID(); }
/** * 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); }
private FieldTypeInfo genericReadTypeInfo(RecordInput rin, String tag) throws IOException { String fieldName = rin.readString(tag); TypeID id = genericReadTypeID(rin, tag); return new FieldTypeInfo(fieldName, id); }