Refine search
@Override public void read(org.apache.thrift.protocol.TProtocol prot, SetIntString struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TSet _set87 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.sIntString = new HashSet<IntString>(2*_set87.size); IntString _elem88; for (int _i89 = 0; _i89 < _set87.size; ++_i89) { _elem88 = new IntString(); _elem88.read(iprot); struct.sIntString.add(_elem88); } } struct.setSIntStringIsSet(true); } if (incoming.get(1)) { struct.aString = iprot.readString(); struct.setAStringIsSet(true); } } }
public void write(org.apache.thrift.protocol.TProtocol oprot, MegaStruct struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetMy_bool()) { oprot.writeFieldBegin(MY_BOOL_FIELD_DESC); oprot.writeBool(struct.my_bool); oprot.writeFieldEnd(); oprot.writeFieldBegin(MY_STRINGSET_FIELD_DESC); oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.my_stringset.size())); for (String _iter59 : struct.my_stringset) oprot.writeFieldBegin(MY_ENUMSET_FIELD_DESC); oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.my_enumset.size())); for (MyEnum _iter60 : struct.my_enumset) oprot.writeFieldBegin(MY_STRUCTSET_FIELD_DESC); oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, struct.my_structset.size())); for (MiniStruct _iter61 : struct.my_structset)
public void write(org.apache.thrift.protocol.TProtocol oprot, HeartbeatTxnRangeResponse struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.aborted != null) { oprot.writeFieldBegin(ABORTED_FIELD_DESC); { oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, struct.aborted.size())); for (long _iter712 : struct.aborted) { oprot.writeI64(_iter712); } oprot.writeSetEnd(); } oprot.writeFieldEnd(); } if (struct.nosuch != null) { oprot.writeFieldBegin(NOSUCH_FIELD_DESC); { oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, struct.nosuch.size())); for (long _iter713 : struct.nosuch) { oprot.writeI64(_iter713); } oprot.writeSetEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
if (incoming.get(1)) { struct.my_byte = iprot.readByte(); struct.setMy_byteIsSet(true); if (incoming.get(2)) { struct.my_16bit_int = iprot.readI16(); struct.setMy_16bit_intIsSet(true); if (incoming.get(17)) { org.apache.thrift.protocol.TSet _set115 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.my_stringset = new HashSet<String>(2*_set115.size); String _elem116; if (incoming.get(18)) { org.apache.thrift.protocol.TSet _set118 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32()); struct.my_enumset = new HashSet<MyEnum>(2*_set118.size); MyEnum _elem119; if (incoming.get(19)) { org.apache.thrift.protocol.TSet _set121 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.my_structset = new HashSet<MiniStruct>(2*_set121.size); MiniStruct _elem122;
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TSentryActiveRoleSet struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.all = iprot.readBool(); struct.setAllIsSet(true); { org.apache.thrift.protocol.TSet _set85 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.roles = new HashSet<String>(2*_set85.size); String _elem86; for (int _i87 = 0; _i87 < _set85.size; ++_i87) { _elem86 = iprot.readString(); struct.roles.add(_elem86); } } struct.setRolesIsSet(true); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TSentryRole struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.roleName = iprot.readString(); struct.setRoleNameIsSet(true); { org.apache.thrift.protocol.TSet _set29 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.groups = new HashSet<String>(2*_set29.size); String _elem30; for (int _i31 = 0; _i31 < _set29.size; ++_i31) { _elem30 = iprot.readString(); struct.groups.add(_elem30); } } struct.setGroupsIsSet(true); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, HeartbeatTxnRangeResponse struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TSet _set716 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, iprot.readI32()); struct.aborted = new HashSet<Long>(2*_set716.size); long _elem717; for (int _i718 = 0; _i718 < _set716.size; ++_i718) { _elem717 = iprot.readI64(); struct.aborted.add(_elem717); } } struct.setAbortedIsSet(true); { org.apache.thrift.protocol.TSet _set719 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, iprot.readI32()); struct.nosuch = new HashSet<Long>(2*_set719.size); long _elem720; for (int _i721 = 0; _i721 < _set719.size; ++_i721) { _elem720 = iprot.readI64(); struct.nosuch.add(_elem720); } } struct.setNosuchIsSet(true); } }
@Override public void serialize(Object o, ObjectInspector oi, TProtocol oprot) throws TException, SerDeException, NoSuchFieldException, IllegalAccessException { ListObjectInspector loi = (ListObjectInspector) oi; Set<Object> set = (Set<Object>) o; DynamicSerDeTypeBase mt = getElementType(); tset = new TSet(mt.getType(), set.size()); oprot.writeSetBegin(tset); for (Object element : set) { mt.serialize(element, loi.getListElementObjectInspector(), oprot); } // in theory, the below call isn't needed in non thrift_mode, but let's not // get too crazy oprot.writeSetEnd(); } }
@Override public TSet readSetBegin() throws TException { assert (!inner); TSet set = new TSet(); if (columns[index] == null || columns[index].equals(nullString)) { index++; if (returnNulls) { return null; } } else if (columns[index].isEmpty()) { index++; } else { fields = secondaryPattern.split(columns[index++]); set = new TSet(ORDERED_TYPE, fields.length); } inner = true; innerIndex = 0; return set; }
@Override public void writeSetBegin(TSet set) throws TException { try { protocol.writeSetBegin(new org.apache.thrift.protocol.TSet(set.getType(), set.getSize())); } catch (org.apache.thrift.TException e) { throw new TException(e); } }
public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if(this.name != null) { oprot.writeFieldBegin(NAME_FIELD_DESC); oprot.writeString(this.name); oprot.writeFieldEnd(); oprot.writeFieldBegin(STR_SET_FIELD_DESC); oprot.writeSetBegin(new TSet(TType.STRING, this.strSet.size())); for(String _iter17: this.strSet) { oprot.writeString(_iter17);
public void write(org.apache.thrift.protocol.TProtocol oprot, SetIntString struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.sIntString != null) { oprot.writeFieldBegin(S_INT_STRING_FIELD_DESC); { oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, struct.sIntString.size())); for (IntString _iter85 : struct.sIntString) { _iter85.write(oprot); } oprot.writeSetEnd(); } oprot.writeFieldEnd(); } if (struct.aString != null) { oprot.writeFieldBegin(A_STRING_FIELD_DESC); oprot.writeString(struct.aString); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
public void read(TProtocol prot, ThriftSampleData struct) throws TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(7); if (incoming.get(0)) { struct.id = iprot.readI32(); struct.setIdIsSet(true); if (incoming.get(1)) { struct.name = iprot.readString(); struct.setNameIsSet(true); if (incoming.get(2)) { struct.created_at = iprot.readI64(); struct.setCreated_atIsSet(true); if (incoming.get(6)) { TSet _set23 = new TSet((byte) 11, iprot.readI32()); struct.set_values = new HashSet(2 * _set23.size);
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TSentryActiveRoleSet struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.all = iprot.readBool(); struct.setAllIsSet(true); { org.apache.thrift.protocol.TSet _set77 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.roles = new HashSet<String>(2*_set77.size); for (int _i78 = 0; _i78 < _set77.size; ++_i78) { String _elem79; // required _elem79 = iprot.readString(); struct.roles.add(_elem79); } } struct.setRolesIsSet(true); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TSentryRole struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.roleName = iprot.readString(); struct.setRoleNameIsSet(true); { org.apache.thrift.protocol.TSet _set29 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.groups = new HashSet<String>(2*_set29.size); for (int _i30 = 0; _i30 < _set29.size; ++_i30) { String _elem31; // required _elem31 = iprot.readString(); struct.groups.add(_elem31); } } struct.setGroupsIsSet(true); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, GetOpenTxnsResponse struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.txn_high_water_mark = iprot.readI64(); struct.setTxn_high_water_markIsSet(true); { org.apache.thrift.protocol.TSet _set441 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, iprot.readI32()); struct.open_txns = new HashSet<Long>(2*_set441.size); for (int _i442 = 0; _i442 < _set441.size; ++_i442) { long _elem443; // optional _elem443 = iprot.readI64(); struct.open_txns.add(_elem443); } } struct.setOpen_txnsIsSet(true); } }
public <T> void writeSet(ThriftCodec<T> elementCodec, Set<T> set) throws Exception { if (set == null) { return; } protocol.writeSetBegin(new TSet(elementCodec.getType().getProtocolType().getType(), set.size())); for (T element : set) { elementCodec.write(element, protocol); } protocol.writeSetEnd(); }
@Override public TSet readSetBegin() throws TException { final int size = readSequenceBegin(); return new TSet(UNUSED_TYPE, size); }
@Override public void writeSetBegin(TSet set) throws TException { try { protocol.writeSetBegin(new org.apache.thrift.protocol.TSet(set.getType(), set.getSize())); } catch (org.apache.thrift.TException e) { throw new TException(e); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, CreationMetadata struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.catName = iprot.readString(); struct.setCatNameIsSet(true); struct.dbName = iprot.readString(); struct.setDbNameIsSet(true); struct.tblName = iprot.readString(); struct.setTblNameIsSet(true); org.apache.thrift.protocol.TSet _set753 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.tablesUsed = new HashSet<String>(2*_set753.size); String _elem754; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.validTxnList = iprot.readString(); struct.setValidTxnListIsSet(true); if (incoming.get(1)) { struct.materializationTime = iprot.readI64(); struct.setMaterializationTimeIsSet(true);