From adea68625e8210c23baa1509491b1cbb88f68629 Mon Sep 17 00:00:00 2001 From: yujingwei Date: Tue, 16 Apr 2024 11:55:56 +0800 Subject: [PATCH] feat(java-client): java client add class host_port for fqdn compile --- .../org/apache/pegasus/base/host_port.java | 140 ++---------------- 1 file changed, 15 insertions(+), 125 deletions(-) diff --git a/java-client/src/main/java/org/apache/pegasus/base/host_port.java b/java-client/src/main/java/org/apache/pegasus/base/host_port.java index 52b1c3b0c4..4996abb298 100644 --- a/java-client/src/main/java/org/apache/pegasus/base/host_port.java +++ b/java-client/src/main/java/org/apache/pegasus/base/host_port.java @@ -16,37 +16,23 @@ * specific language governing permissions and limitations * under the License. */ -/** - * Autogenerated by Thrift Compiler (0.11.0) - * - *

DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * - * @generated - */ package org.apache.pegasus.base; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated( - value = "Autogenerated by Thrift Compiler (0.11.0)", - date = "2024-04-15") +import org.apache.thrift.TBase; + public class host_port - implements org.apache.thrift.TBase, + implements TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("host_port"); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = - new host_portStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = - new host_portTupleSchemeFactory(); - public String host; public short port; - public int hyType; + public int hpTye; /** * The set of fields this struct contains, along with convenience methods for finding and @@ -114,14 +100,14 @@ public java.lang.String getFieldName() { public host_port() { this.host = null; this.port = 0; - this.hyType = 0; + this.hpTye = 0; } /** Performs a deep copy on other. */ public host_port(host_port other) { this.host = other.host; this.port = other.port; - this.hyType = other.hyType; + this.hpTye = other.hpTye; } public host_port deepCopy() { @@ -137,7 +123,7 @@ public short getPort() { } public int getHyType() { - return this.hyType; + return this.hpTye; } public void setHost(String host) { @@ -148,15 +134,15 @@ public void setPort(short port) { this.port = port; } - public void setHyType(int hyType) { - this.hyType = hyType; + public void setHyType(int hpTye) { + this.hpTye = hpTye; } @Override public void clear() { this.host = null; this.port = 0; - this.hyType = 0; + this.hpTye = 0; } public void setFieldValue(_Fields field, java.lang.Object value) { @@ -221,20 +207,19 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + validate(); host = iprot.readString(); port = iprot.readI16(); - hyType = iprot.readByte(); - - validate(); + hpTye = iprot.readByte(); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + validate(); oprot.writeString(host); oprot.writeI16(port); - byte byte_hyType = (byte) (hyType); - oprot.writeByte(byte_hyType); + byte byte_hpTye = (byte) (hpTye); + oprot.writeByte(byte_hpTye); } @Override @@ -250,99 +235,4 @@ public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write( - new org.apache.thrift.protocol.TCompactProtocol( - new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) - throws java.io.IOException, java.lang.ClassNotFoundException { - try { - read( - new org.apache.thrift.protocol.TCompactProtocol( - new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class host_portStandardSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public host_portStandardScheme getScheme() { - return new host_portStandardScheme(); - } - } - - private static class host_portStandardScheme - extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, host_port 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) { - 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, host_port struct) - throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - } - - private static class host_portTupleSchemeFactory - implements org.apache.thrift.scheme.SchemeFactory { - public host_portTupleScheme getScheme() { - return new host_portTupleScheme(); - } - } - - private static class host_portTupleScheme - extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, host_port struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, host_port struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = - (org.apache.thrift.protocol.TTupleProtocol) prot; - } - } - - private static S scheme( - org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) - ? STANDARD_SCHEME_FACTORY - : TUPLE_SCHEME_FACTORY) - .getScheme(); - } }