@Override public void read(org.apache.thrift.protocol.TProtocol prot, KsDef struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.name = iprot.readString(); struct.setNameIsSet(true); struct.strategy_class = iprot.readString(); struct.setStrategy_classIsSet(true); { org.apache.thrift.protocol.TList _list85 = new org.apache.thrift.protocol.TList( org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.cf_defs = new ArrayList<CfDef>(_list85.size); for (int _i86 = 0; _i86 < _list85.size; ++_i86) { CfDef _elem87; // required _elem87 = new CfDef(); _elem87.read(iprot); struct.cf_defs.add(_elem87); } } struct.setCf_defsIsSet(true); BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { org.apache.thrift.protocol.TMap _map88 = new org.apache.thrift.protocol.TMap( org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.strategy_options = new HashMap<String, String>(2 * _map88.size); for (int _i89 = 0; _i89 < _map88.size; ++_i89) { String _key90; // required String _val91; // required _key90 = iprot.readString(); _val91 = iprot.readString(); struct.strategy_options.put(_key90, _val91); } } struct.setStrategy_optionsIsSet(true); } if (incoming.get(1)) { struct.replication_factor = iprot.readI32(); struct.setReplication_factorIsSet(true); } if (incoming.get(2)) { struct.durable_writes = iprot.readBool(); struct.setDurable_writesIsSet(true); } }
public void read(org.apache.thrift.protocol.TProtocol iprot, KsDef struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.name = iprot.readString(); struct.setNameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // STRATEGY_CLASS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.strategy_class = iprot.readString(); struct.setStrategy_classIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // STRATEGY_OPTIONS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map74 = iprot.readMapBegin(); struct.strategy_options = new HashMap<String, String>(2 * _map74.size); for (int _i75 = 0; _i75 < _map74.size; ++_i75) { String _key76; // required String _val77; // required _key76 = iprot.readString(); _val77 = iprot.readString(); struct.strategy_options.put(_key76, _val77); } iprot.readMapEnd(); } struct.setStrategy_optionsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // REPLICATION_FACTOR if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.replication_factor = iprot.readI32(); struct.setReplication_factorIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // CF_DEFS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list78 = iprot.readListBegin(); struct.cf_defs = new ArrayList<CfDef>(_list78.size); for (int _i79 = 0; _i79 < _list78.size; ++_i79) { CfDef _elem80; // required _elem80 = new CfDef(); _elem80.read(iprot); struct.cf_defs.add(_elem80); } iprot.readListEnd(); } struct.setCf_defsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // DURABLE_WRITES if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.durable_writes = iprot.readBool(); struct.setDurable_writesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); }