Skip to content

Commit

Permalink
feat(java-client): java client add class host_port for fqdn compile
Browse files Browse the repository at this point in the history
  • Loading branch information
yujingwei committed Apr 16, 2024
1 parent 9d4b7e7 commit adea686
Showing 1 changed file with 15 additions and 125 deletions.
140 changes: 15 additions & 125 deletions java-client/src/main/java/org/apache/pegasus/base/host_port.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,23 @@
* specific language governing permissions and limitations
* under the License.
*/
/**
* Autogenerated by Thrift Compiler (0.11.0)
*
* <p>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<host_port, host_port._Fields>,
implements TBase<host_port, host_port._Fields>,
java.io.Serializable,
Cloneable,
Comparable<host_port> {
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
Expand Down Expand Up @@ -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 <i>other</i>. */
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() {
Expand All @@ -137,7 +123,7 @@ public short getPort() {
}

public int getHyType() {
return this.hyType;
return this.hpTye;
}

public void setHost(String host) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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
Expand All @@ -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<host_port> {

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<host_port> {

@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 extends org.apache.thrift.scheme.IScheme> 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();
}
}

0 comments on commit adea686

Please sign in to comment.