@Override public void write(org.apache.thrift.protocol.TProtocol prot, THdfsFileDesc struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeString(struct.file_name); oprot.writeI64(struct.length); oprot.writeI32(struct.compression.getValue()); oprot.writeI64(struct.last_modification_time); { oprot.writeI32(struct.file_blocks.size()); for (THdfsFileBlock _iter38 : struct.file_blocks) { _iter38.write(oprot); } } }
public void write(org.apache.thrift.protocol.TProtocol oprot, THdfsFileDesc struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.file_name != null) { oprot.writeFieldBegin(FILE_NAME_FIELD_DESC); oprot.writeString(struct.file_name); oprot.writeFieldEnd(); } oprot.writeFieldBegin(LENGTH_FIELD_DESC); oprot.writeI64(struct.length); oprot.writeFieldEnd(); if (struct.compression != null) { oprot.writeFieldBegin(COMPRESSION_FIELD_DESC); oprot.writeI32(struct.compression.getValue()); oprot.writeFieldEnd(); } oprot.writeFieldBegin(LAST_MODIFICATION_TIME_FIELD_DESC); oprot.writeI64(struct.last_modification_time); oprot.writeFieldEnd(); if (struct.file_blocks != null) { oprot.writeFieldBegin(FILE_BLOCKS_FIELD_DESC); { oprot.writeListBegin( new org.apache.thrift.protocol.TList( org.apache.thrift.protocol.TType.STRUCT, struct.file_blocks.size())); for (THdfsFileBlock _iter37 : struct.file_blocks) { _iter37.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }