@Override public Object deserialize(Object reuse, TProtocol iprot) throws SerDeException, TException, IllegalAccessException { if (thrift_mode) { iprot.readStructBegin(); } Object o = fieldList.deserialize(reuse, iprot); if (thrift_mode) { iprot.readStructEnd(); } return o; }
@Override public String toString() { StringBuilder result = new StringBuilder(); String prefix = ""; for (DynamicSerDeField t : getChildren()) { result.append(prefix + t.fieldid + ":" + t.getFieldType().getMyType().toString() + " " + t.name); prefix = ","; } return result.toString(); } }
struct = new ArrayList<Object>(getNumFields()); for (DynamicSerDeTypeBase orderedType : ordered_types) { struct.add(null); for (int i = 0; i < getNumFields(); i++) { DynamicSerDeTypeBase mt = null; TField field = null; if (!isRealThrift && getField(i).isSkippable()) { break; mt = getFieldByFieldId(field.id); if (mt == null) { System.err.println("ERROR for fieldid: " + field.id
public final DynamicSerDeField[] getChildren() { int size = jjtGetNumChildren(); DynamicSerDeField[] result = new DynamicSerDeField[size]; for (int i = 0; i < size; i++) { result[i] = (DynamicSerDeField) jjtGetChild(i); } return result; }
public void initialize() { if (types_by_id == null) { // multiple means of lookup types_by_id = new HashMap<Integer, DynamicSerDeTypeBase>(); types_by_column_name = new HashMap<String, DynamicSerDeTypeBase>(); ordered_types = new DynamicSerDeTypeBase[jjtGetNumChildren()]; ordered_column_id_by_name = new HashMap<String, Integer>(); // put them in and also roll them up while we're at it // a Field contains a FieldType which in turn contains a type for (int i = 0; i < jjtGetNumChildren(); i++) { DynamicSerDeField mt = getField(i); DynamicSerDeTypeBase type = mt.getFieldType().getMyType(); // types get initialized in case they need to setup any // internal data structures - e.g., DynamicSerDeStructBase type.initialize(); type.fieldid = mt.fieldid; type.name = mt.name; types_by_id.put(Integer.valueOf(mt.fieldid), type); types_by_column_name.put(mt.name, type); ordered_types[i] = type; ordered_column_id_by_name.put(mt.name, i); } } }
@Override public void initialize() { fieldList = getFieldList(); fieldList.initialize(); }
private DynamicSerDeField getField(int i) { return (DynamicSerDeField) jjtGetChild(i); }
private int getNumFields() { return jjtGetNumChildren(); }
/** * serialize * * The way to serialize a Thrift "table" which in thrift land is really a * function and thus this class's name. * * @param o * - this list should be in the order of the function's params for * now. If we wanted to remove this requirement, we'd need to make it * a List<Pair<String, Object>> with the String being the field name. * */ @Override public void serialize(Object o, ObjectInspector oi, TProtocol oprot) throws TException, SerDeException, NoSuchFieldException, IllegalAccessException { if (thrift_mode) { oprot.writeStructBegin(new TStruct(name)); } fieldList.serialize(o, oi, oprot); if (thrift_mode) { oprot.writeStructEnd(); } }
final public DynamicSerDeFieldList FieldList() throws ParseException { DynamicSerDeFieldList jjtn000 = new DynamicSerDeFieldList(JJTFIELDLIST); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);
public final DynamicSerDeField[] getChildren() { int size = jjtGetNumChildren(); DynamicSerDeField[] result = new DynamicSerDeField[size]; for (int i = 0; i < size; i++) { result[i] = (DynamicSerDeField) jjtGetChild(i); } return result; }
public void initialize() { if (types_by_id == null) { // multiple means of lookup types_by_id = new HashMap<Integer, DynamicSerDeTypeBase>(); types_by_column_name = new HashMap<String, DynamicSerDeTypeBase>(); ordered_types = new DynamicSerDeTypeBase[jjtGetNumChildren()]; ordered_column_id_by_name = new HashMap<String, Integer>(); // put them in and also roll them up while we're at it // a Field contains a FieldType which in turn contains a type for (int i = 0; i < jjtGetNumChildren(); i++) { DynamicSerDeField mt = getField(i); DynamicSerDeTypeBase type = mt.getFieldType().getMyType(); // types get initialized in case they need to setup any // internal data structures - e.g., DynamicSerDeStructBase type.initialize(); type.fieldid = mt.fieldid; type.name = mt.name; types_by_id.put(Integer.valueOf(mt.fieldid), type); types_by_column_name.put(mt.name, type); ordered_types[i] = type; ordered_column_id_by_name.put(mt.name, i); } } }
@Override public void initialize() { fieldList = getFieldList(); fieldList.initialize(); }
private DynamicSerDeField getField(int i) { return (DynamicSerDeField) jjtGetChild(i); }
private int getNumFields() { return jjtGetNumChildren(); }
/** * serialize * * The way to serialize a Thrift "table" which in thrift land is really a * function and thus this class's name. * * @param o * - this list should be in the order of the function's params for * now. If we wanted to remove this requirement, we'd need to make it * a List<Pair<String, Object>> with the String being the field name. * */ @Override public void serialize(Object o, ObjectInspector oi, TProtocol oprot) throws TException, SerDeException, NoSuchFieldException, IllegalAccessException { if (thrift_mode) { oprot.writeStructBegin(new TStruct(name)); } fieldList.serialize(o, oi, oprot); if (thrift_mode) { oprot.writeStructEnd(); } }
final public DynamicSerDeFieldList FieldList() throws ParseException { DynamicSerDeFieldList jjtn000 = new DynamicSerDeFieldList(JJTFIELDLIST); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);
struct = new ArrayList<Object>(getNumFields()); for (DynamicSerDeTypeBase orderedType : ordered_types) { struct.add(null); for (int i = 0; i < getNumFields(); i++) { DynamicSerDeTypeBase mt = null; TField field = null; if (!isRealThrift && getField(i).isSkippable()) { break; mt = getFieldByFieldId(field.id); if (mt == null) { System.err.println("ERROR for fieldid: " + field.id
public final DynamicSerDeField[] getChildren() { int size = jjtGetNumChildren(); DynamicSerDeField[] result = new DynamicSerDeField[size]; for (int i = 0; i < size; i++) { result[i] = (DynamicSerDeField) jjtGetChild(i); } return result; }
public void initialize() { if (types_by_id == null) { // multiple means of lookup types_by_id = new HashMap<Integer, DynamicSerDeTypeBase>(); types_by_column_name = new HashMap<String, DynamicSerDeTypeBase>(); ordered_types = new DynamicSerDeTypeBase[jjtGetNumChildren()]; ordered_column_id_by_name = new HashMap<String, Integer>(); // put them in and also roll them up while we're at it // a Field contains a FieldType which in turn contains a type for (int i = 0; i < jjtGetNumChildren(); i++) { DynamicSerDeField mt = getField(i); DynamicSerDeTypeBase type = mt.getFieldType().getMyType(); // types get initialized in case they need to setup any // internal data structures - e.g., DynamicSerDeStructBase type.initialize(); type.fieldid = mt.fieldid; type.name = mt.name; types_by_id.put(Integer.valueOf(mt.fieldid), type); types_by_column_name.put(mt.name, type); ordered_types[i] = type; ordered_column_id_by_name.put(mt.name, i); } } }