From 2141f213f8d27acdcb35ba44c951f4427e0299c4 Mon Sep 17 00:00:00 2001 From: Klay Date: Thu, 14 Oct 2021 22:24:36 -0700 Subject: [PATCH 01/11] update thrift code --- .../com/vesoft/nebula/Constants.java | 23 + .../com/vesoft/nebula/Coordinate.java | 349 +++++ .../generated/com/vesoft/nebula/DirInfo.java | 20 +- .../generated/com/vesoft/nebula/Edge.java | 28 +- .../com/vesoft/nebula/ErrorCode.java | 5 + .../com/vesoft/nebula/Geography.java | 281 ++++ .../com/vesoft/nebula/LineString.java | 286 ++++ .../vesoft/nebula/PartitionBackupInfo.java | 28 +- .../generated/com/vesoft/nebula/Path.java | 22 +- .../generated/com/vesoft/nebula/Point.java | 266 ++++ .../generated/com/vesoft/nebula/Polygon.java | 305 ++++ .../generated/com/vesoft/nebula/Step.java | 28 +- .../main/generated/com/vesoft/nebula/Tag.java | 28 +- .../generated/com/vesoft/nebula/Value.java | 42 + .../generated/com/vesoft/nebula/Vertex.java | 22 +- .../com/vesoft/nebula/graph/GraphService.java | 570 +++++++- .../nebula/graph/VerifyClientVersionReq.java | 275 ++++ .../nebula/graph/VerifyClientVersionResp.java | 389 +++++ .../com/vesoft/nebula/meta/ColumnTypeDef.java | 114 +- .../com/vesoft/nebula/meta/GeoShape.java | 52 + .../com/vesoft/nebula/meta/MetaService.java | 1250 ++++++++++++----- .../com/vesoft/nebula/meta/PropertyType.java | 5 +- .../nebula/meta/VerifyClientVersionReq.java | 275 ++++ .../nebula/meta/VerifyClientVersionResp.java | 474 +++++++ .../nebula/storage/ChainAddEdgesRequest.java | 705 ++++++++++ .../storage/ChainUpdateEdgeRequest.java | 595 ++++++++ .../nebula/storage/GeneralStorageService.java | 24 +- .../nebula/storage/GetValueRequest.java | 439 ------ .../nebula/storage/GetValueResponse.java | 365 ----- .../nebula/storage/GraphStorageService.java | 724 ++++++++-- .../storage/InternalStorageService.java | 363 ++--- .../nebula/storage/InternalTxnRequest.java | 545 +++---- .../vesoft/nebula/storage/RequestCommon.java | 95 +- .../nebula/storage/StorageAdminService.java | 128 +- 34 files changed, 7172 insertions(+), 1948 deletions(-) create mode 100644 client/src/main/generated/com/vesoft/nebula/Constants.java create mode 100644 client/src/main/generated/com/vesoft/nebula/Coordinate.java create mode 100644 client/src/main/generated/com/vesoft/nebula/Geography.java create mode 100644 client/src/main/generated/com/vesoft/nebula/LineString.java create mode 100644 client/src/main/generated/com/vesoft/nebula/Point.java create mode 100644 client/src/main/generated/com/vesoft/nebula/Polygon.java create mode 100644 client/src/main/generated/com/vesoft/nebula/graph/VerifyClientVersionReq.java create mode 100644 client/src/main/generated/com/vesoft/nebula/graph/VerifyClientVersionResp.java create mode 100644 client/src/main/generated/com/vesoft/nebula/meta/GeoShape.java create mode 100644 client/src/main/generated/com/vesoft/nebula/meta/VerifyClientVersionReq.java create mode 100644 client/src/main/generated/com/vesoft/nebula/meta/VerifyClientVersionResp.java create mode 100644 client/src/main/generated/com/vesoft/nebula/storage/ChainAddEdgesRequest.java create mode 100644 client/src/main/generated/com/vesoft/nebula/storage/ChainUpdateEdgeRequest.java delete mode 100644 client/src/main/generated/com/vesoft/nebula/storage/GetValueRequest.java delete mode 100644 client/src/main/generated/com/vesoft/nebula/storage/GetValueResponse.java diff --git a/client/src/main/generated/com/vesoft/nebula/Constants.java b/client/src/main/generated/com/vesoft/nebula/Constants.java new file mode 100644 index 000000000..b83205264 --- /dev/null +++ b/client/src/main/generated/com/vesoft/nebula/Constants.java @@ -0,0 +1,23 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.vesoft.nebula; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import java.util.BitSet; +import java.util.Arrays; +@SuppressWarnings({ "unused" }) +public class Constants { + + public static final byte[] version = "2.6.0".getBytes(); + +} diff --git a/client/src/main/generated/com/vesoft/nebula/Coordinate.java b/client/src/main/generated/com/vesoft/nebula/Coordinate.java new file mode 100644 index 000000000..8d026e1d1 --- /dev/null +++ b/client/src/main/generated/com/vesoft/nebula/Coordinate.java @@ -0,0 +1,349 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.vesoft.nebula; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import java.util.BitSet; +import java.util.Arrays; +import com.facebook.thrift.*; +import com.facebook.thrift.annotations.*; +import com.facebook.thrift.async.*; +import com.facebook.thrift.meta_data.*; +import com.facebook.thrift.server.*; +import com.facebook.thrift.transport.*; +import com.facebook.thrift.protocol.*; + +@SuppressWarnings({ "unused", "serial" }) +public class Coordinate implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("Coordinate"); + private static final TField X_FIELD_DESC = new TField("x", TType.DOUBLE, (short)1); + private static final TField Y_FIELD_DESC = new TField("y", TType.DOUBLE, (short)2); + + public double x; + public double y; + public static final int X = 1; + public static final int Y = 2; + + // isset id assignments + private static final int __X_ISSET_ID = 0; + private static final int __Y_ISSET_ID = 1; + private BitSet __isset_bit_vector = new BitSet(2); + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(X, new FieldMetaData("x", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.DOUBLE))); + tmpMetaDataMap.put(Y, new FieldMetaData("y", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.DOUBLE))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(Coordinate.class, metaDataMap); + } + + public Coordinate() { + } + + public Coordinate( + double x, + double y) { + this(); + this.x = x; + setXIsSet(true); + this.y = y; + setYIsSet(true); + } + + public static class Builder { + private double x; + private double y; + + BitSet __optional_isset = new BitSet(2); + + public Builder() { + } + + public Builder setX(final double x) { + this.x = x; + __optional_isset.set(__X_ISSET_ID, true); + return this; + } + + public Builder setY(final double y) { + this.y = y; + __optional_isset.set(__Y_ISSET_ID, true); + return this; + } + + public Coordinate build() { + Coordinate result = new Coordinate(); + if (__optional_isset.get(__X_ISSET_ID)) { + result.setX(this.x); + } + if (__optional_isset.get(__Y_ISSET_ID)) { + result.setY(this.y); + } + return result; + } + } + + public static Builder builder() { + return new Builder(); + } + + /** + * Performs a deep copy on other. + */ + public Coordinate(Coordinate other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + this.x = TBaseHelper.deepCopy(other.x); + this.y = TBaseHelper.deepCopy(other.y); + } + + public Coordinate deepCopy() { + return new Coordinate(this); + } + + public double getX() { + return this.x; + } + + public Coordinate setX(double x) { + this.x = x; + setXIsSet(true); + return this; + } + + public void unsetX() { + __isset_bit_vector.clear(__X_ISSET_ID); + } + + // Returns true if field x is set (has been assigned a value) and false otherwise + public boolean isSetX() { + return __isset_bit_vector.get(__X_ISSET_ID); + } + + public void setXIsSet(boolean __value) { + __isset_bit_vector.set(__X_ISSET_ID, __value); + } + + public double getY() { + return this.y; + } + + public Coordinate setY(double y) { + this.y = y; + setYIsSet(true); + return this; + } + + public void unsetY() { + __isset_bit_vector.clear(__Y_ISSET_ID); + } + + // Returns true if field y is set (has been assigned a value) and false otherwise + public boolean isSetY() { + return __isset_bit_vector.get(__Y_ISSET_ID); + } + + public void setYIsSet(boolean __value) { + __isset_bit_vector.set(__Y_ISSET_ID, __value); + } + + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case X: + if (__value == null) { + unsetX(); + } else { + setX((Double)__value); + } + break; + + case Y: + if (__value == null) { + unsetY(); + } else { + setY((Double)__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case X: + return new Double(getX()); + + case Y: + return new Double(getY()); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof Coordinate)) + return false; + Coordinate that = (Coordinate)_that; + + if (!TBaseHelper.equalsNobinary(this.x, that.x)) { return false; } + + if (!TBaseHelper.equalsNobinary(this.y, that.y)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {x, y}); + } + + @Override + public int compareTo(Coordinate other) { + if (other == null) { + // See java.lang.Comparable docs + throw new NullPointerException(); + } + + if (other == this) { + return 0; + } + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetX()).compareTo(other.isSetX()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(x, other.x); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = Boolean.valueOf(isSetY()).compareTo(other.isSetY()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(y, other.y); + if (lastComparison != 0) { + return lastComparison; + } + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case X: + if (__field.type == TType.DOUBLE) { + this.x = iprot.readDouble(); + setXIsSet(true); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case Y: + if (__field.type == TType.DOUBLE) { + this.y = iprot.readDouble(); + setYIsSet(true); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(X_FIELD_DESC); + oprot.writeDouble(this.x); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(Y_FIELD_DESC); + oprot.writeDouble(this.y); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("Coordinate"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("x"); + sb.append(space); + sb.append(":").append(space); + sb.append(TBaseHelper.toString(this.getX(), indent + 1, prettyPrint)); + first = false; + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("y"); + sb.append(space); + sb.append(":").append(space); + sb.append(TBaseHelper.toString(this.getY(), indent + 1, prettyPrint)); + first = false; + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + +} + diff --git a/client/src/main/generated/com/vesoft/nebula/DirInfo.java b/client/src/main/generated/com/vesoft/nebula/DirInfo.java index baf43efcb..d61d0c209 100644 --- a/client/src/main/generated/com/vesoft/nebula/DirInfo.java +++ b/client/src/main/generated/com/vesoft/nebula/DirInfo.java @@ -267,15 +267,15 @@ public void read(TProtocol iprot) throws TException { case DATA: if (__field.type == TType.LIST) { { - TList _list48 = iprot.readListBegin(); - this.data = new ArrayList(Math.max(0, _list48.size)); - for (int _i49 = 0; - (_list48.size < 0) ? iprot.peekList() : (_i49 < _list48.size); - ++_i49) + TList _list60 = iprot.readListBegin(); + this.data = new ArrayList(Math.max(0, _list60.size)); + for (int _i61 = 0; + (_list60.size < 0) ? iprot.peekList() : (_i61 < _list60.size); + ++_i61) { - byte[] _elem50; - _elem50 = iprot.readBinary(); - this.data.add(_elem50); + byte[] _elem62; + _elem62 = iprot.readBinary(); + this.data.add(_elem62); } iprot.readListEnd(); } @@ -309,8 +309,8 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(DATA_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.data.size())); - for (byte[] _iter51 : this.data) { - oprot.writeBinary(_iter51); + for (byte[] _iter63 : this.data) { + oprot.writeBinary(_iter63); } oprot.writeListEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/Edge.java b/client/src/main/generated/com/vesoft/nebula/Edge.java index 7518c45e0..19fc60326 100644 --- a/client/src/main/generated/com/vesoft/nebula/Edge.java +++ b/client/src/main/generated/com/vesoft/nebula/Edge.java @@ -494,18 +494,18 @@ public void read(TProtocol iprot) throws TException { case PROPS: if (__field.type == TType.MAP) { { - TMap _map34 = iprot.readMapBegin(); - this.props = new HashMap(Math.max(0, 2*_map34.size)); - for (int _i35 = 0; - (_map34.size < 0) ? iprot.peekMap() : (_i35 < _map34.size); - ++_i35) + TMap _map46 = iprot.readMapBegin(); + this.props = new HashMap(Math.max(0, 2*_map46.size)); + for (int _i47 = 0; + (_map46.size < 0) ? iprot.peekMap() : (_i47 < _map46.size); + ++_i47) { - byte[] _key36; - Value _val37; - _key36 = iprot.readBinary(); - _val37 = new Value(); - _val37.read(iprot); - this.props.put(_key36, _val37); + byte[] _key48; + Value _val49; + _key48 = iprot.readBinary(); + _val49 = new Value(); + _val49.read(iprot); + this.props.put(_key48, _val49); } iprot.readMapEnd(); } @@ -555,9 +555,9 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(PROPS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRUCT, this.props.size())); - for (Map.Entry _iter38 : this.props.entrySet()) { - oprot.writeBinary(_iter38.getKey()); - _iter38.getValue().write(oprot); + for (Map.Entry _iter50 : this.props.entrySet()) { + oprot.writeBinary(_iter50.getKey()); + _iter50.getValue().write(oprot); } oprot.writeMapEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/ErrorCode.java b/client/src/main/generated/com/vesoft/nebula/ErrorCode.java index b8ccc0b8f..c31b591bd 100644 --- a/client/src/main/generated/com/vesoft/nebula/ErrorCode.java +++ b/client/src/main/generated/com/vesoft/nebula/ErrorCode.java @@ -128,6 +128,11 @@ public enum ErrorCode implements com.facebook.thrift.TEnum { E_USER_CANCEL(-3052), E_TASK_EXECUTION_FAILED(-3053), E_PLAN_IS_KILLED(-3060), + E_NO_TERM(-3070), + E_OUTDATED_TERM(-3071), + E_OUTDATED_EDGE(-3072), + E_WRITE_WRITE_CONFLICT(-3073), + E_CLIENT_SERVER_INCOMPATIBLE(-3061), E_UNKNOWN(-8000); private static final Map INDEXED_VALUES = new HashMap(); diff --git a/client/src/main/generated/com/vesoft/nebula/Geography.java b/client/src/main/generated/com/vesoft/nebula/Geography.java new file mode 100644 index 000000000..d1a9c550f --- /dev/null +++ b/client/src/main/generated/com/vesoft/nebula/Geography.java @@ -0,0 +1,281 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.vesoft.nebula; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import java.util.BitSet; +import java.util.Arrays; +import com.facebook.thrift.*; +import com.facebook.thrift.annotations.*; +import com.facebook.thrift.async.*; +import com.facebook.thrift.meta_data.*; +import com.facebook.thrift.server.*; +import com.facebook.thrift.transport.*; +import com.facebook.thrift.protocol.*; + +@SuppressWarnings({ "unused", "serial", "unchecked" }) +public class Geography extends TUnion implements Comparable { + private static final TStruct STRUCT_DESC = new TStruct("Geography"); + private static final TField PT_VAL_FIELD_DESC = new TField("ptVal", TType.STRUCT, (short)1); + private static final TField LS_VAL_FIELD_DESC = new TField("lsVal", TType.STRUCT, (short)2); + private static final TField PG_VAL_FIELD_DESC = new TField("pgVal", TType.STRUCT, (short)3); + + public static final int PTVAL = 1; + public static final int LSVAL = 2; + public static final int PGVAL = 3; + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(PTVAL, new FieldMetaData("ptVal", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Point.class))); + tmpMetaDataMap.put(LSVAL, new FieldMetaData("lsVal", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, LineString.class))); + tmpMetaDataMap.put(PGVAL, new FieldMetaData("pgVal", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Polygon.class))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + public Geography() { + super(); + } + + public Geography(int setField, Object __value) { + super(setField, __value); + } + + public Geography(Geography other) { + super(other); + } + + public Geography deepCopy() { + return new Geography(this); + } + + public static Geography ptVal(Point __value) { + Geography x = new Geography(); + x.setPtVal(__value); + return x; + } + + public static Geography lsVal(LineString __value) { + Geography x = new Geography(); + x.setLsVal(__value); + return x; + } + + public static Geography pgVal(Polygon __value) { + Geography x = new Geography(); + x.setPgVal(__value); + return x; + } + + + @Override + protected void checkType(short setField, Object __value) throws ClassCastException { + switch (setField) { + case PTVAL: + if (__value instanceof Point) { + break; + } + throw new ClassCastException("Was expecting value of type Point for field 'ptVal', but got " + __value.getClass().getSimpleName()); + case LSVAL: + if (__value instanceof LineString) { + break; + } + throw new ClassCastException("Was expecting value of type LineString for field 'lsVal', but got " + __value.getClass().getSimpleName()); + case PGVAL: + if (__value instanceof Polygon) { + break; + } + throw new ClassCastException("Was expecting value of type Polygon for field 'pgVal', but got " + __value.getClass().getSimpleName()); + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + public void read(TProtocol iprot) throws TException { + setField_ = 0; + value_ = null; + iprot.readStructBegin(metaDataMap); + TField __field = iprot.readFieldBegin(); + if (__field.type != TType.STOP) + { + value_ = readValue(iprot, __field); + if (value_ != null) + { + switch (__field.id) { + case PTVAL: + if (__field.type == PT_VAL_FIELD_DESC.type) { + setField_ = __field.id; + } + break; + case LSVAL: + if (__field.type == LS_VAL_FIELD_DESC.type) { + setField_ = __field.id; + } + break; + case PGVAL: + if (__field.type == PG_VAL_FIELD_DESC.type) { + setField_ = __field.id; + } + break; + } + } + iprot.readFieldEnd(); + TField __stopField = iprot.readFieldBegin(); + if (__stopField.type != TType.STOP) { + throw new TProtocolException(TProtocolException.INVALID_DATA, "Union 'Geography' is missing a STOP byte"); + } + } + iprot.readStructEnd(); + } + + @Override + protected Object readValue(TProtocol iprot, TField __field) throws TException { + switch (__field.id) { + case PTVAL: + if (__field.type == PT_VAL_FIELD_DESC.type) { + Point ptVal; + ptVal = new Point(); + ptVal.read(iprot); + return ptVal; + } + break; + case LSVAL: + if (__field.type == LS_VAL_FIELD_DESC.type) { + LineString lsVal; + lsVal = new LineString(); + lsVal.read(iprot); + return lsVal; + } + break; + case PGVAL: + if (__field.type == PG_VAL_FIELD_DESC.type) { + Polygon pgVal; + pgVal = new Polygon(); + pgVal.read(iprot); + return pgVal; + } + break; + } + TProtocolUtil.skip(iprot, __field.type); + return null; + } + + @Override + protected void writeValue(TProtocol oprot, short setField, Object __value) throws TException { + switch (setField) { + case PTVAL: + Point ptVal = (Point)getFieldValue(); + ptVal.write(oprot); + return; + case LSVAL: + LineString lsVal = (LineString)getFieldValue(); + lsVal.write(oprot); + return; + case PGVAL: + Polygon pgVal = (Polygon)getFieldValue(); + pgVal.write(oprot); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField); + } + } + + @Override + protected TField getFieldDesc(int setField) { + switch (setField) { + case PTVAL: + return PT_VAL_FIELD_DESC; + case LSVAL: + return LS_VAL_FIELD_DESC; + case PGVAL: + return PG_VAL_FIELD_DESC; + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected Map getMetaDataMap() { return metaDataMap; } + + private Object __getValue(int expectedFieldId) { + if (getSetField() == expectedFieldId) { + return getFieldValue(); + } else { + throw new RuntimeException("Cannot get field '" + getFieldDesc(expectedFieldId).name + "' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + private void __setValue(int fieldId, Object __value) { + if (__value == null) throw new NullPointerException(); + setField_ = fieldId; + value_ = __value; + } + + public Point getPtVal() { + return (Point) __getValue(PTVAL); + } + + public void setPtVal(Point __value) { + __setValue(PTVAL, __value); + } + + public LineString getLsVal() { + return (LineString) __getValue(LSVAL); + } + + public void setLsVal(LineString __value) { + __setValue(LSVAL, __value); + } + + public Polygon getPgVal() { + return (Polygon) __getValue(PGVAL); + } + + public void setPgVal(Polygon __value) { + __setValue(PGVAL, __value); + } + + public boolean equals(Object other) { + if (other instanceof Geography) { + return equals((Geography)other); + } else { + return false; + } + } + + public boolean equals(Geography other) { + return equalsNobinaryImpl(other); + } + + @Override + public int compareTo(Geography other) { + return compareToImpl(other); + } + + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {getSetField(), getFieldValue()}); + } + +} diff --git a/client/src/main/generated/com/vesoft/nebula/LineString.java b/client/src/main/generated/com/vesoft/nebula/LineString.java new file mode 100644 index 000000000..91c7599bf --- /dev/null +++ b/client/src/main/generated/com/vesoft/nebula/LineString.java @@ -0,0 +1,286 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.vesoft.nebula; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import java.util.BitSet; +import java.util.Arrays; +import com.facebook.thrift.*; +import com.facebook.thrift.annotations.*; +import com.facebook.thrift.async.*; +import com.facebook.thrift.meta_data.*; +import com.facebook.thrift.server.*; +import com.facebook.thrift.transport.*; +import com.facebook.thrift.protocol.*; + +@SuppressWarnings({ "unused", "serial" }) +public class LineString implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("LineString"); + private static final TField COORD_LIST_FIELD_DESC = new TField("coordList", TType.LIST, (short)1); + + public List coordList; + public static final int COORDLIST = 1; + + // isset id assignments + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(COORDLIST, new FieldMetaData("coordList", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, Coordinate.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(LineString.class, metaDataMap); + } + + public LineString() { + } + + public LineString( + List coordList) { + this(); + this.coordList = coordList; + } + + public static class Builder { + private List coordList; + + public Builder() { + } + + public Builder setCoordList(final List coordList) { + this.coordList = coordList; + return this; + } + + public LineString build() { + LineString result = new LineString(); + result.setCoordList(this.coordList); + return result; + } + } + + public static Builder builder() { + return new Builder(); + } + + /** + * Performs a deep copy on other. + */ + public LineString(LineString other) { + if (other.isSetCoordList()) { + this.coordList = TBaseHelper.deepCopy(other.coordList); + } + } + + public LineString deepCopy() { + return new LineString(this); + } + + public List getCoordList() { + return this.coordList; + } + + public LineString setCoordList(List coordList) { + this.coordList = coordList; + return this; + } + + public void unsetCoordList() { + this.coordList = null; + } + + // Returns true if field coordList is set (has been assigned a value) and false otherwise + public boolean isSetCoordList() { + return this.coordList != null; + } + + public void setCoordListIsSet(boolean __value) { + if (!__value) { + this.coordList = null; + } + } + + @SuppressWarnings("unchecked") + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case COORDLIST: + if (__value == null) { + unsetCoordList(); + } else { + setCoordList((List)__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case COORDLIST: + return getCoordList(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof LineString)) + return false; + LineString that = (LineString)_that; + + if (!TBaseHelper.equalsNobinary(this.isSetCoordList(), that.isSetCoordList(), this.coordList, that.coordList)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {coordList}); + } + + @Override + public int compareTo(LineString other) { + if (other == null) { + // See java.lang.Comparable docs + throw new NullPointerException(); + } + + if (other == this) { + return 0; + } + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetCoordList()).compareTo(other.isSetCoordList()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(coordList, other.coordList); + if (lastComparison != 0) { + return lastComparison; + } + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case COORDLIST: + if (__field.type == TType.LIST) { + { + TList _list25 = iprot.readListBegin(); + this.coordList = new ArrayList(Math.max(0, _list25.size)); + for (int _i26 = 0; + (_list25.size < 0) ? iprot.peekList() : (_i26 < _list25.size); + ++_i26) + { + Coordinate _elem27; + _elem27 = new Coordinate(); + _elem27.read(iprot); + this.coordList.add(_elem27); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.coordList != null) { + oprot.writeFieldBegin(COORD_LIST_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.coordList.size())); + for (Coordinate _iter28 : this.coordList) { + _iter28.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("LineString"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("coordList"); + sb.append(space); + sb.append(":").append(space); + if (this.getCoordList() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getCoordList(), indent + 1, prettyPrint)); + } + first = false; + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + +} + diff --git a/client/src/main/generated/com/vesoft/nebula/PartitionBackupInfo.java b/client/src/main/generated/com/vesoft/nebula/PartitionBackupInfo.java index 1d7c08a37..917e3d168 100644 --- a/client/src/main/generated/com/vesoft/nebula/PartitionBackupInfo.java +++ b/client/src/main/generated/com/vesoft/nebula/PartitionBackupInfo.java @@ -199,18 +199,18 @@ public void read(TProtocol iprot) throws TException { case INFO: if (__field.type == TType.MAP) { { - TMap _map52 = iprot.readMapBegin(); - this.info = new HashMap(Math.max(0, 2*_map52.size)); - for (int _i53 = 0; - (_map52.size < 0) ? iprot.peekMap() : (_i53 < _map52.size); - ++_i53) + TMap _map64 = iprot.readMapBegin(); + this.info = new HashMap(Math.max(0, 2*_map64.size)); + for (int _i65 = 0; + (_map64.size < 0) ? iprot.peekMap() : (_i65 < _map64.size); + ++_i65) { - int _key54; - LogInfo _val55; - _key54 = iprot.readI32(); - _val55 = new LogInfo(); - _val55.read(iprot); - this.info.put(_key54, _val55); + int _key66; + LogInfo _val67; + _key66 = iprot.readI32(); + _val67 = new LogInfo(); + _val67.read(iprot); + this.info.put(_key66, _val67); } iprot.readMapEnd(); } @@ -239,9 +239,9 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(INFO_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.I32, TType.STRUCT, this.info.size())); - for (Map.Entry _iter56 : this.info.entrySet()) { - oprot.writeI32(_iter56.getKey()); - _iter56.getValue().write(oprot); + for (Map.Entry _iter68 : this.info.entrySet()) { + oprot.writeI32(_iter68.getKey()); + _iter68.getValue().write(oprot); } oprot.writeMapEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/Path.java b/client/src/main/generated/com/vesoft/nebula/Path.java index f3b404d41..d03234536 100644 --- a/client/src/main/generated/com/vesoft/nebula/Path.java +++ b/client/src/main/generated/com/vesoft/nebula/Path.java @@ -237,16 +237,16 @@ public void read(TProtocol iprot) throws TException { case STEPS: if (__field.type == TType.LIST) { { - TList _list44 = iprot.readListBegin(); - this.steps = new ArrayList(Math.max(0, _list44.size)); - for (int _i45 = 0; - (_list44.size < 0) ? iprot.peekList() : (_i45 < _list44.size); - ++_i45) + TList _list56 = iprot.readListBegin(); + this.steps = new ArrayList(Math.max(0, _list56.size)); + for (int _i57 = 0; + (_list56.size < 0) ? iprot.peekList() : (_i57 < _list56.size); + ++_i57) { - Step _elem46; - _elem46 = new Step(); - _elem46.read(iprot); - this.steps.add(_elem46); + Step _elem58; + _elem58 = new Step(); + _elem58.read(iprot); + this.steps.add(_elem58); } iprot.readListEnd(); } @@ -280,8 +280,8 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(STEPS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.steps.size())); - for (Step _iter47 : this.steps) { - _iter47.write(oprot); + for (Step _iter59 : this.steps) { + _iter59.write(oprot); } oprot.writeListEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/Point.java b/client/src/main/generated/com/vesoft/nebula/Point.java new file mode 100644 index 000000000..943352d07 --- /dev/null +++ b/client/src/main/generated/com/vesoft/nebula/Point.java @@ -0,0 +1,266 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.vesoft.nebula; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import java.util.BitSet; +import java.util.Arrays; +import com.facebook.thrift.*; +import com.facebook.thrift.annotations.*; +import com.facebook.thrift.async.*; +import com.facebook.thrift.meta_data.*; +import com.facebook.thrift.server.*; +import com.facebook.thrift.transport.*; +import com.facebook.thrift.protocol.*; + +@SuppressWarnings({ "unused", "serial" }) +public class Point implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("Point"); + private static final TField COORD_FIELD_DESC = new TField("coord", TType.STRUCT, (short)1); + + public Coordinate coord; + public static final int COORD = 1; + + // isset id assignments + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(COORD, new FieldMetaData("coord", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Coordinate.class))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(Point.class, metaDataMap); + } + + public Point() { + } + + public Point( + Coordinate coord) { + this(); + this.coord = coord; + } + + public static class Builder { + private Coordinate coord; + + public Builder() { + } + + public Builder setCoord(final Coordinate coord) { + this.coord = coord; + return this; + } + + public Point build() { + Point result = new Point(); + result.setCoord(this.coord); + return result; + } + } + + public static Builder builder() { + return new Builder(); + } + + /** + * Performs a deep copy on other. + */ + public Point(Point other) { + if (other.isSetCoord()) { + this.coord = TBaseHelper.deepCopy(other.coord); + } + } + + public Point deepCopy() { + return new Point(this); + } + + public Coordinate getCoord() { + return this.coord; + } + + public Point setCoord(Coordinate coord) { + this.coord = coord; + return this; + } + + public void unsetCoord() { + this.coord = null; + } + + // Returns true if field coord is set (has been assigned a value) and false otherwise + public boolean isSetCoord() { + return this.coord != null; + } + + public void setCoordIsSet(boolean __value) { + if (!__value) { + this.coord = null; + } + } + + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case COORD: + if (__value == null) { + unsetCoord(); + } else { + setCoord((Coordinate)__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case COORD: + return getCoord(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof Point)) + return false; + Point that = (Point)_that; + + if (!TBaseHelper.equalsNobinary(this.isSetCoord(), that.isSetCoord(), this.coord, that.coord)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {coord}); + } + + @Override + public int compareTo(Point other) { + if (other == null) { + // See java.lang.Comparable docs + throw new NullPointerException(); + } + + if (other == this) { + return 0; + } + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetCoord()).compareTo(other.isSetCoord()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(coord, other.coord); + if (lastComparison != 0) { + return lastComparison; + } + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case COORD: + if (__field.type == TType.STRUCT) { + this.coord = new Coordinate(); + this.coord.read(iprot); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.coord != null) { + oprot.writeFieldBegin(COORD_FIELD_DESC); + this.coord.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("Point"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("coord"); + sb.append(space); + sb.append(":").append(space); + if (this.getCoord() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getCoord(), indent + 1, prettyPrint)); + } + first = false; + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + +} + diff --git a/client/src/main/generated/com/vesoft/nebula/Polygon.java b/client/src/main/generated/com/vesoft/nebula/Polygon.java new file mode 100644 index 000000000..9894aab00 --- /dev/null +++ b/client/src/main/generated/com/vesoft/nebula/Polygon.java @@ -0,0 +1,305 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.vesoft.nebula; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import java.util.BitSet; +import java.util.Arrays; +import com.facebook.thrift.*; +import com.facebook.thrift.annotations.*; +import com.facebook.thrift.async.*; +import com.facebook.thrift.meta_data.*; +import com.facebook.thrift.server.*; +import com.facebook.thrift.transport.*; +import com.facebook.thrift.protocol.*; + +@SuppressWarnings({ "unused", "serial" }) +public class Polygon implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("Polygon"); + private static final TField COORD_LIST_LIST_FIELD_DESC = new TField("coordListList", TType.LIST, (short)1); + + public List> coordListList; + public static final int COORDLISTLIST = 1; + + // isset id assignments + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(COORDLISTLIST, new FieldMetaData("coordListList", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, Coordinate.class))))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(Polygon.class, metaDataMap); + } + + public Polygon() { + } + + public Polygon( + List> coordListList) { + this(); + this.coordListList = coordListList; + } + + public static class Builder { + private List> coordListList; + + public Builder() { + } + + public Builder setCoordListList(final List> coordListList) { + this.coordListList = coordListList; + return this; + } + + public Polygon build() { + Polygon result = new Polygon(); + result.setCoordListList(this.coordListList); + return result; + } + } + + public static Builder builder() { + return new Builder(); + } + + /** + * Performs a deep copy on other. + */ + public Polygon(Polygon other) { + if (other.isSetCoordListList()) { + this.coordListList = TBaseHelper.deepCopy(other.coordListList); + } + } + + public Polygon deepCopy() { + return new Polygon(this); + } + + public List> getCoordListList() { + return this.coordListList; + } + + public Polygon setCoordListList(List> coordListList) { + this.coordListList = coordListList; + return this; + } + + public void unsetCoordListList() { + this.coordListList = null; + } + + // Returns true if field coordListList is set (has been assigned a value) and false otherwise + public boolean isSetCoordListList() { + return this.coordListList != null; + } + + public void setCoordListListIsSet(boolean __value) { + if (!__value) { + this.coordListList = null; + } + } + + @SuppressWarnings("unchecked") + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case COORDLISTLIST: + if (__value == null) { + unsetCoordListList(); + } else { + setCoordListList((List>)__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case COORDLISTLIST: + return getCoordListList(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof Polygon)) + return false; + Polygon that = (Polygon)_that; + + if (!TBaseHelper.equalsNobinary(this.isSetCoordListList(), that.isSetCoordListList(), this.coordListList, that.coordListList)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {coordListList}); + } + + @Override + public int compareTo(Polygon other) { + if (other == null) { + // See java.lang.Comparable docs + throw new NullPointerException(); + } + + if (other == this) { + return 0; + } + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetCoordListList()).compareTo(other.isSetCoordListList()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(coordListList, other.coordListList); + if (lastComparison != 0) { + return lastComparison; + } + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case COORDLISTLIST: + if (__field.type == TType.LIST) { + { + TList _list29 = iprot.readListBegin(); + this.coordListList = new ArrayList>(Math.max(0, _list29.size)); + for (int _i30 = 0; + (_list29.size < 0) ? iprot.peekList() : (_i30 < _list29.size); + ++_i30) + { + List _elem31; + { + TList _list32 = iprot.readListBegin(); + _elem31 = new ArrayList(Math.max(0, _list32.size)); + for (int _i33 = 0; + (_list32.size < 0) ? iprot.peekList() : (_i33 < _list32.size); + ++_i33) + { + Coordinate _elem34; + _elem34 = new Coordinate(); + _elem34.read(iprot); + _elem31.add(_elem34); + } + iprot.readListEnd(); + } + this.coordListList.add(_elem31); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.coordListList != null) { + oprot.writeFieldBegin(COORD_LIST_LIST_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.LIST, this.coordListList.size())); + for (List _iter35 : this.coordListList) { + { + oprot.writeListBegin(new TList(TType.STRUCT, _iter35.size())); + for (Coordinate _iter36 : _iter35) { + _iter36.write(oprot); + } + oprot.writeListEnd(); + } + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("Polygon"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("coordListList"); + sb.append(space); + sb.append(":").append(space); + if (this.getCoordListList() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getCoordListList(), indent + 1, prettyPrint)); + } + first = false; + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + +} + diff --git a/client/src/main/generated/com/vesoft/nebula/Step.java b/client/src/main/generated/com/vesoft/nebula/Step.java index f657a49a1..b2c1c0588 100644 --- a/client/src/main/generated/com/vesoft/nebula/Step.java +++ b/client/src/main/generated/com/vesoft/nebula/Step.java @@ -432,18 +432,18 @@ public void read(TProtocol iprot) throws TException { case PROPS: if (__field.type == TType.MAP) { { - TMap _map39 = iprot.readMapBegin(); - this.props = new HashMap(Math.max(0, 2*_map39.size)); - for (int _i40 = 0; - (_map39.size < 0) ? iprot.peekMap() : (_i40 < _map39.size); - ++_i40) + TMap _map51 = iprot.readMapBegin(); + this.props = new HashMap(Math.max(0, 2*_map51.size)); + for (int _i52 = 0; + (_map51.size < 0) ? iprot.peekMap() : (_i52 < _map51.size); + ++_i52) { - byte[] _key41; - Value _val42; - _key41 = iprot.readBinary(); - _val42 = new Value(); - _val42.read(iprot); - this.props.put(_key41, _val42); + byte[] _key53; + Value _val54; + _key53 = iprot.readBinary(); + _val54 = new Value(); + _val54.read(iprot); + this.props.put(_key53, _val54); } iprot.readMapEnd(); } @@ -488,9 +488,9 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(PROPS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRUCT, this.props.size())); - for (Map.Entry _iter43 : this.props.entrySet()) { - oprot.writeBinary(_iter43.getKey()); - _iter43.getValue().write(oprot); + for (Map.Entry _iter55 : this.props.entrySet()) { + oprot.writeBinary(_iter55.getKey()); + _iter55.getValue().write(oprot); } oprot.writeMapEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/Tag.java b/client/src/main/generated/com/vesoft/nebula/Tag.java index 11164e1fa..6b548622a 100644 --- a/client/src/main/generated/com/vesoft/nebula/Tag.java +++ b/client/src/main/generated/com/vesoft/nebula/Tag.java @@ -237,18 +237,18 @@ public void read(TProtocol iprot) throws TException { case PROPS: if (__field.type == TType.MAP) { { - TMap _map25 = iprot.readMapBegin(); - this.props = new HashMap(Math.max(0, 2*_map25.size)); - for (int _i26 = 0; - (_map25.size < 0) ? iprot.peekMap() : (_i26 < _map25.size); - ++_i26) + TMap _map37 = iprot.readMapBegin(); + this.props = new HashMap(Math.max(0, 2*_map37.size)); + for (int _i38 = 0; + (_map37.size < 0) ? iprot.peekMap() : (_i38 < _map37.size); + ++_i38) { - byte[] _key27; - Value _val28; - _key27 = iprot.readBinary(); - _val28 = new Value(); - _val28.read(iprot); - this.props.put(_key27, _val28); + byte[] _key39; + Value _val40; + _key39 = iprot.readBinary(); + _val40 = new Value(); + _val40.read(iprot); + this.props.put(_key39, _val40); } iprot.readMapEnd(); } @@ -282,9 +282,9 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(PROPS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRUCT, this.props.size())); - for (Map.Entry _iter29 : this.props.entrySet()) { - oprot.writeBinary(_iter29.getKey()); - _iter29.getValue().write(oprot); + for (Map.Entry _iter41 : this.props.entrySet()) { + oprot.writeBinary(_iter41.getKey()); + _iter41.getValue().write(oprot); } oprot.writeMapEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/Value.java b/client/src/main/generated/com/vesoft/nebula/Value.java index 36d4ea691..628946385 100644 --- a/client/src/main/generated/com/vesoft/nebula/Value.java +++ b/client/src/main/generated/com/vesoft/nebula/Value.java @@ -41,6 +41,7 @@ public class Value extends TUnion { private static final TField M_VAL_FIELD_DESC = new TField("mVal", TType.STRUCT, (short)13); private static final TField U_VAL_FIELD_DESC = new TField("uVal", TType.STRUCT, (short)14); private static final TField G_VAL_FIELD_DESC = new TField("gVal", TType.STRUCT, (short)15); + private static final TField GG_VAL_FIELD_DESC = new TField("ggVal", TType.STRUCT, (short)16); public static final int NVAL = 1; public static final int BVAL = 2; @@ -57,6 +58,7 @@ public class Value extends TUnion { public static final int MVAL = 13; public static final int UVAL = 14; public static final int GVAL = 15; + public static final int GGVAL = 16; public static final Map metaDataMap; @@ -92,6 +94,8 @@ public class Value extends TUnion { new StructMetaData(TType.STRUCT, NSet.class))); tmpMetaDataMap.put(GVAL, new FieldMetaData("gVal", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, DataSet.class))); + tmpMetaDataMap.put(GGVAL, new FieldMetaData("ggVal", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Geography.class))); metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); } @@ -201,6 +205,12 @@ public static Value gVal(DataSet __value) { return x; } + public static Value ggVal(Geography __value) { + Value x = new Value(); + x.setGgVal(__value); + return x; + } + @Override protected void checkType(short setField, Object __value) throws ClassCastException { @@ -280,6 +290,11 @@ protected void checkType(short setField, Object __value) throws ClassCastExcepti break; } throw new ClassCastException("Was expecting value of type DataSet for field 'gVal', but got " + __value.getClass().getSimpleName()); + case GGVAL: + if (__value instanceof Geography) { + break; + } + throw new ClassCastException("Was expecting value of type Geography for field 'ggVal', but got " + __value.getClass().getSimpleName()); default: throw new IllegalArgumentException("Unknown field id " + setField); } @@ -372,6 +387,11 @@ public void read(TProtocol iprot) throws TException { setField_ = __field.id; } break; + case GGVAL: + if (__field.type == GG_VAL_FIELD_DESC.type) { + setField_ = __field.id; + } + break; } } iprot.readFieldEnd(); @@ -501,6 +521,14 @@ protected Object readValue(TProtocol iprot, TField __field) throws TException { return gVal; } break; + case GGVAL: + if (__field.type == GG_VAL_FIELD_DESC.type) { + Geography ggVal; + ggVal = new Geography(); + ggVal.read(iprot); + return ggVal; + } + break; } TProtocolUtil.skip(iprot, __field.type); return null; @@ -569,6 +597,10 @@ protected void writeValue(TProtocol oprot, short setField, Object __value) throw DataSet gVal = (DataSet)getFieldValue(); gVal.write(oprot); return; + case GGVAL: + Geography ggVal = (Geography)getFieldValue(); + ggVal.write(oprot); + return; default: throw new IllegalStateException("Cannot write union with unknown field " + setField); } @@ -607,6 +639,8 @@ protected TField getFieldDesc(int setField) { return U_VAL_FIELD_DESC; case GVAL: return G_VAL_FIELD_DESC; + case GGVAL: + return GG_VAL_FIELD_DESC; default: throw new IllegalArgumentException("Unknown field id " + setField); } @@ -765,6 +799,14 @@ public void setGVal(DataSet __value) { __setValue(GVAL, __value); } + public Geography getGgVal() { + return (Geography) __getValue(GGVAL); + } + + public void setGgVal(Geography __value) { + __setValue(GGVAL, __value); + } + public boolean equals(Object other) { if (other instanceof Value) { return equals((Value)other); diff --git a/client/src/main/generated/com/vesoft/nebula/Vertex.java b/client/src/main/generated/com/vesoft/nebula/Vertex.java index 1dfffe876..ed3d7c581 100644 --- a/client/src/main/generated/com/vesoft/nebula/Vertex.java +++ b/client/src/main/generated/com/vesoft/nebula/Vertex.java @@ -237,16 +237,16 @@ public void read(TProtocol iprot) throws TException { case TAGS: if (__field.type == TType.LIST) { { - TList _list30 = iprot.readListBegin(); - this.tags = new ArrayList(Math.max(0, _list30.size)); - for (int _i31 = 0; - (_list30.size < 0) ? iprot.peekList() : (_i31 < _list30.size); - ++_i31) + TList _list42 = iprot.readListBegin(); + this.tags = new ArrayList(Math.max(0, _list42.size)); + for (int _i43 = 0; + (_list42.size < 0) ? iprot.peekList() : (_i43 < _list42.size); + ++_i43) { - Tag _elem32; - _elem32 = new Tag(); - _elem32.read(iprot); - this.tags.add(_elem32); + Tag _elem44; + _elem44 = new Tag(); + _elem44.read(iprot); + this.tags.add(_elem44); } iprot.readListEnd(); } @@ -280,8 +280,8 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(TAGS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.tags.size())); - for (Tag _iter33 : this.tags) { - _iter33.write(oprot); + for (Tag _iter45 : this.tags) { + _iter45.write(oprot); } oprot.writeListEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/graph/GraphService.java b/client/src/main/generated/com/vesoft/nebula/graph/GraphService.java index 9db127bf8..4083c3390 100644 --- a/client/src/main/generated/com/vesoft/nebula/graph/GraphService.java +++ b/client/src/main/generated/com/vesoft/nebula/graph/GraphService.java @@ -39,6 +39,8 @@ public interface Iface { public byte[] executeJson(long sessionId, byte[] stmt) throws TException; + public VerifyClientVersionResp verifyClientVersion(VerifyClientVersionReq req) throws TException; + } public interface AsyncIface { @@ -51,6 +53,8 @@ public interface AsyncIface { public void executeJson(long sessionId, byte[] stmt, AsyncMethodCallback resultHandler) throws TException; + public void verifyClientVersion(VerifyClientVersionReq req, AsyncMethodCallback resultHandler) throws TException; + } public static class Client extends EventHandlerBase implements Iface, TClientIf { @@ -241,6 +245,51 @@ public byte[] recv_executeJson() throws TException throw new TApplicationException(TApplicationException.MISSING_RESULT, "executeJson failed: unknown result"); } + public VerifyClientVersionResp verifyClientVersion(VerifyClientVersionReq req) throws TException + { + ContextStack ctx = getContextStack("GraphService.verifyClientVersion", null); + this.setContextStack(ctx); + send_verifyClientVersion(req); + return recv_verifyClientVersion(); + } + + public void send_verifyClientVersion(VerifyClientVersionReq req) throws TException + { + ContextStack ctx = this.getContextStack(); + super.preWrite(ctx, "GraphService.verifyClientVersion", null); + oprot_.writeMessageBegin(new TMessage("verifyClientVersion", TMessageType.CALL, seqid_)); + verifyClientVersion_args args = new verifyClientVersion_args(); + args.req = req; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + super.postWrite(ctx, "GraphService.verifyClientVersion", args); + return; + } + + public VerifyClientVersionResp recv_verifyClientVersion() throws TException + { + ContextStack ctx = super.getContextStack(); + long bytes; + TMessageType mtype; + super.preRead(ctx, "GraphService.verifyClientVersion"); + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + verifyClientVersion_result result = new verifyClientVersion_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + super.postRead(ctx, "GraphService.verifyClientVersion", result); + + if (result.isSetSuccess()) { + return result.success; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "verifyClientVersion failed: unknown result"); + } + } public static class AsyncClient extends TAsyncClient implements AsyncIface { public static class Factory implements TAsyncClientFactory { @@ -259,9 +308,9 @@ public AsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager clientM super(protocolFactory, clientManager, transport); } - public void authenticate(byte[] username, byte[] password, AsyncMethodCallback resultHandler33) throws TException { + public void authenticate(byte[] username, byte[] password, AsyncMethodCallback resultHandler34) throws TException { checkReady(); - authenticate_call method_call = new authenticate_call(username, password, resultHandler33, this, ___protocolFactory, ___transport); + authenticate_call method_call = new authenticate_call(username, password, resultHandler34, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } @@ -269,8 +318,8 @@ public void authenticate(byte[] username, byte[] password, AsyncMethodCallback r public static class authenticate_call extends TAsyncMethodCall { private byte[] username; private byte[] password; - public authenticate_call(byte[] username, byte[] password, AsyncMethodCallback resultHandler34, TAsyncClient client30, TProtocolFactory protocolFactory31, TNonblockingTransport transport32) throws TException { - super(client30, protocolFactory31, transport32, resultHandler34, false); + public authenticate_call(byte[] username, byte[] password, AsyncMethodCallback resultHandler35, TAsyncClient client31, TProtocolFactory protocolFactory32, TNonblockingTransport transport33) throws TException { + super(client31, protocolFactory32, transport33, resultHandler35, false); this.username = username; this.password = password; } @@ -294,17 +343,17 @@ public AuthResponse getResult() throws TException { } } - public void signout(long sessionId, AsyncMethodCallback resultHandler38) throws TException { + public void signout(long sessionId, AsyncMethodCallback resultHandler39) throws TException { checkReady(); - signout_call method_call = new signout_call(sessionId, resultHandler38, this, ___protocolFactory, ___transport); + signout_call method_call = new signout_call(sessionId, resultHandler39, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class signout_call extends TAsyncMethodCall { private long sessionId; - public signout_call(long sessionId, AsyncMethodCallback resultHandler39, TAsyncClient client35, TProtocolFactory protocolFactory36, TNonblockingTransport transport37) throws TException { - super(client35, protocolFactory36, transport37, resultHandler39, true); + public signout_call(long sessionId, AsyncMethodCallback resultHandler40, TAsyncClient client36, TProtocolFactory protocolFactory37, TNonblockingTransport transport38) throws TException { + super(client36, protocolFactory37, transport38, resultHandler40, true); this.sessionId = sessionId; } @@ -325,9 +374,9 @@ public void getResult() throws TException { } } - public void execute(long sessionId, byte[] stmt, AsyncMethodCallback resultHandler43) throws TException { + public void execute(long sessionId, byte[] stmt, AsyncMethodCallback resultHandler44) throws TException { checkReady(); - execute_call method_call = new execute_call(sessionId, stmt, resultHandler43, this, ___protocolFactory, ___transport); + execute_call method_call = new execute_call(sessionId, stmt, resultHandler44, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } @@ -335,8 +384,8 @@ public void execute(long sessionId, byte[] stmt, AsyncMethodCallback resultHandl public static class execute_call extends TAsyncMethodCall { private long sessionId; private byte[] stmt; - public execute_call(long sessionId, byte[] stmt, AsyncMethodCallback resultHandler44, TAsyncClient client40, TProtocolFactory protocolFactory41, TNonblockingTransport transport42) throws TException { - super(client40, protocolFactory41, transport42, resultHandler44, false); + public execute_call(long sessionId, byte[] stmt, AsyncMethodCallback resultHandler45, TAsyncClient client41, TProtocolFactory protocolFactory42, TNonblockingTransport transport43) throws TException { + super(client41, protocolFactory42, transport43, resultHandler45, false); this.sessionId = sessionId; this.stmt = stmt; } @@ -360,9 +409,9 @@ public ExecutionResponse getResult() throws TException { } } - public void executeJson(long sessionId, byte[] stmt, AsyncMethodCallback resultHandler48) throws TException { + public void executeJson(long sessionId, byte[] stmt, AsyncMethodCallback resultHandler49) throws TException { checkReady(); - executeJson_call method_call = new executeJson_call(sessionId, stmt, resultHandler48, this, ___protocolFactory, ___transport); + executeJson_call method_call = new executeJson_call(sessionId, stmt, resultHandler49, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } @@ -370,8 +419,8 @@ public void executeJson(long sessionId, byte[] stmt, AsyncMethodCallback resultH public static class executeJson_call extends TAsyncMethodCall { private long sessionId; private byte[] stmt; - public executeJson_call(long sessionId, byte[] stmt, AsyncMethodCallback resultHandler49, TAsyncClient client45, TProtocolFactory protocolFactory46, TNonblockingTransport transport47) throws TException { - super(client45, protocolFactory46, transport47, resultHandler49, false); + public executeJson_call(long sessionId, byte[] stmt, AsyncMethodCallback resultHandler50, TAsyncClient client46, TProtocolFactory protocolFactory47, TNonblockingTransport transport48) throws TException { + super(client46, protocolFactory47, transport48, resultHandler50, false); this.sessionId = sessionId; this.stmt = stmt; } @@ -395,6 +444,38 @@ public byte[] getResult() throws TException { } } + public void verifyClientVersion(VerifyClientVersionReq req, AsyncMethodCallback resultHandler54) throws TException { + checkReady(); + verifyClientVersion_call method_call = new verifyClientVersion_call(req, resultHandler54, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class verifyClientVersion_call extends TAsyncMethodCall { + private VerifyClientVersionReq req; + public verifyClientVersion_call(VerifyClientVersionReq req, AsyncMethodCallback resultHandler55, TAsyncClient client51, TProtocolFactory protocolFactory52, TNonblockingTransport transport53) throws TException { + super(client51, protocolFactory52, transport53, resultHandler55, false); + this.req = req; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("verifyClientVersion", TMessageType.CALL, 0)); + verifyClientVersion_args args = new verifyClientVersion_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public VerifyClientVersionResp getResult() throws TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = super.client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_verifyClientVersion(); + } + } + } public static class Processor implements TProcessor { @@ -407,6 +488,7 @@ public Processor(Iface iface) processMap_.put("signout", new signout()); processMap_.put("execute", new execute()); processMap_.put("executeJson", new executeJson()); + processMap_.put("verifyClientVersion", new verifyClientVersion()); } protected static interface ProcessFunction { @@ -516,6 +598,27 @@ public void process(int seqid, TProtocol iprot, TProtocol oprot, TConnectionCont } + private class verifyClientVersion implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot, TConnectionContext server_ctx) throws TException + { + Object handler_ctx = event_handler_.getContext("GraphService.verifyClientVersion", server_ctx); + verifyClientVersion_args args = new verifyClientVersion_args(); + event_handler_.preRead(handler_ctx, "GraphService.verifyClientVersion"); + args.read(iprot); + iprot.readMessageEnd(); + event_handler_.postRead(handler_ctx, "GraphService.verifyClientVersion", args); + verifyClientVersion_result result = new verifyClientVersion_result(); + result.success = iface_.verifyClientVersion(args.req); + event_handler_.preWrite(handler_ctx, "GraphService.verifyClientVersion", result); + oprot.writeMessageBegin(new TMessage("verifyClientVersion", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + event_handler_.postWrite(handler_ctx, "GraphService.verifyClientVersion", result); + } + + } + } public static class authenticate_args implements TBase, java.io.Serializable, Cloneable, Comparable { @@ -2263,4 +2366,439 @@ public void validate() throws TException { } + public static class verifyClientVersion_args implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("verifyClientVersion_args"); + private static final TField REQ_FIELD_DESC = new TField("req", TType.STRUCT, (short)1); + + public VerifyClientVersionReq req; + public static final int REQ = 1; + + // isset id assignments + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(REQ, new FieldMetaData("req", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, VerifyClientVersionReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(verifyClientVersion_args.class, metaDataMap); + } + + public verifyClientVersion_args() { + } + + public verifyClientVersion_args( + VerifyClientVersionReq req) { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public verifyClientVersion_args(verifyClientVersion_args other) { + if (other.isSetReq()) { + this.req = TBaseHelper.deepCopy(other.req); + } + } + + public verifyClientVersion_args deepCopy() { + return new verifyClientVersion_args(this); + } + + public VerifyClientVersionReq getReq() { + return this.req; + } + + public verifyClientVersion_args setReq(VerifyClientVersionReq req) { + this.req = req; + return this; + } + + public void unsetReq() { + this.req = null; + } + + // Returns true if field req is set (has been assigned a value) and false otherwise + public boolean isSetReq() { + return this.req != null; + } + + public void setReqIsSet(boolean __value) { + if (!__value) { + this.req = null; + } + } + + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case REQ: + if (__value == null) { + unsetReq(); + } else { + setReq((VerifyClientVersionReq)__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case REQ: + return getReq(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof verifyClientVersion_args)) + return false; + verifyClientVersion_args that = (verifyClientVersion_args)_that; + + if (!TBaseHelper.equalsNobinary(this.isSetReq(), that.isSetReq(), this.req, that.req)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {req}); + } + + @Override + public int compareTo(verifyClientVersion_args other) { + if (other == null) { + // See java.lang.Comparable docs + throw new NullPointerException(); + } + + if (other == this) { + return 0; + } + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case REQ: + if (__field.type == TType.STRUCT) { + this.req = new VerifyClientVersionReq(); + this.req.read(iprot); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.req != null) { + oprot.writeFieldBegin(REQ_FIELD_DESC); + this.req.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("verifyClientVersion_args"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("req"); + sb.append(space); + sb.append(":").append(space); + if (this.getReq() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getReq(), indent + 1, prettyPrint)); + } + first = false; + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + + public static class verifyClientVersion_result implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("verifyClientVersion_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); + + public VerifyClientVersionResp success; + public static final int SUCCESS = 0; + + // isset id assignments + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, VerifyClientVersionResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(verifyClientVersion_result.class, metaDataMap); + } + + public verifyClientVersion_result() { + } + + public verifyClientVersion_result( + VerifyClientVersionResp success) { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public verifyClientVersion_result(verifyClientVersion_result other) { + if (other.isSetSuccess()) { + this.success = TBaseHelper.deepCopy(other.success); + } + } + + public verifyClientVersion_result deepCopy() { + return new verifyClientVersion_result(this); + } + + public VerifyClientVersionResp getSuccess() { + return this.success; + } + + public verifyClientVersion_result setSuccess(VerifyClientVersionResp success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been assigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean __value) { + if (!__value) { + this.success = null; + } + } + + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case SUCCESS: + if (__value == null) { + unsetSuccess(); + } else { + setSuccess((VerifyClientVersionResp)__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof verifyClientVersion_result)) + return false; + verifyClientVersion_result that = (verifyClientVersion_result)_that; + + if (!TBaseHelper.equalsNobinary(this.isSetSuccess(), that.isSetSuccess(), this.success, that.success)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {success}); + } + + @Override + public int compareTo(verifyClientVersion_result other) { + if (other == null) { + // See java.lang.Comparable docs + throw new NullPointerException(); + } + + if (other == this) { + return 0; + } + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case SUCCESS: + if (__field.type == TType.STRUCT) { + this.success = new VerifyClientVersionResp(); + this.success.read(iprot); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + this.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("verifyClientVersion_result"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("success"); + sb.append(space); + sb.append(":").append(space); + if (this.getSuccess() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getSuccess(), indent + 1, prettyPrint)); + } + first = false; + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + } diff --git a/client/src/main/generated/com/vesoft/nebula/graph/VerifyClientVersionReq.java b/client/src/main/generated/com/vesoft/nebula/graph/VerifyClientVersionReq.java new file mode 100644 index 000000000..077897126 --- /dev/null +++ b/client/src/main/generated/com/vesoft/nebula/graph/VerifyClientVersionReq.java @@ -0,0 +1,275 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.vesoft.nebula.graph; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import java.util.BitSet; +import java.util.Arrays; +import com.facebook.thrift.*; +import com.facebook.thrift.annotations.*; +import com.facebook.thrift.async.*; +import com.facebook.thrift.meta_data.*; +import com.facebook.thrift.server.*; +import com.facebook.thrift.transport.*; +import com.facebook.thrift.protocol.*; + +@SuppressWarnings({ "unused", "serial" }) +public class VerifyClientVersionReq implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("VerifyClientVersionReq"); + private static final TField VERSION_FIELD_DESC = new TField("version", TType.STRING, (short)1); + + public byte[] version; + public static final int VERSION = 1; + + // isset id assignments + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(VERSION, new FieldMetaData("version", TFieldRequirementType.REQUIRED, + new FieldValueMetaData(TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(VerifyClientVersionReq.class, metaDataMap); + } + + public VerifyClientVersionReq() { + this.version = "2.6.0".getBytes(); + + } + + public VerifyClientVersionReq( + byte[] version) { + this(); + this.version = version; + } + + public static class Builder { + private byte[] version; + + public Builder() { + } + + public Builder setVersion(final byte[] version) { + this.version = version; + return this; + } + + public VerifyClientVersionReq build() { + VerifyClientVersionReq result = new VerifyClientVersionReq(); + result.setVersion(this.version); + return result; + } + } + + public static Builder builder() { + return new Builder(); + } + + /** + * Performs a deep copy on other. + */ + public VerifyClientVersionReq(VerifyClientVersionReq other) { + if (other.isSetVersion()) { + this.version = TBaseHelper.deepCopy(other.version); + } + } + + public VerifyClientVersionReq deepCopy() { + return new VerifyClientVersionReq(this); + } + + public byte[] getVersion() { + return this.version; + } + + public VerifyClientVersionReq setVersion(byte[] version) { + this.version = version; + return this; + } + + public void unsetVersion() { + this.version = null; + } + + // Returns true if field version is set (has been assigned a value) and false otherwise + public boolean isSetVersion() { + return this.version != null; + } + + public void setVersionIsSet(boolean __value) { + if (!__value) { + this.version = null; + } + } + + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case VERSION: + if (__value == null) { + unsetVersion(); + } else { + setVersion((byte[])__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case VERSION: + return getVersion(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof VerifyClientVersionReq)) + return false; + VerifyClientVersionReq that = (VerifyClientVersionReq)_that; + + if (!TBaseHelper.equalsSlow(this.isSetVersion(), that.isSetVersion(), this.version, that.version)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {version}); + } + + @Override + public int compareTo(VerifyClientVersionReq other) { + if (other == null) { + // See java.lang.Comparable docs + throw new NullPointerException(); + } + + if (other == this) { + return 0; + } + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(version, other.version); + if (lastComparison != 0) { + return lastComparison; + } + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case VERSION: + if (__field.type == TType.STRING) { + this.version = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.version != null) { + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeBinary(this.version); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("VerifyClientVersionReq"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("version"); + sb.append(space); + sb.append(":").append(space); + if (this.getVersion() == null) { + sb.append("null"); + } else { + int __version_size = Math.min(this.getVersion().length, 128); + for (int i = 0; i < __version_size; i++) { + if (i != 0) sb.append(" "); + sb.append(Integer.toHexString(this.getVersion()[i]).length() > 1 ? Integer.toHexString(this.getVersion()[i]).substring(Integer.toHexString(this.getVersion()[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.getVersion()[i]).toUpperCase()); + } + if (this.getVersion().length > 128) sb.append(" ..."); + } + first = false; + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + if (version == null) { + throw new TProtocolException(TProtocolException.MISSING_REQUIRED_FIELD, "Required field 'version' was not present! Struct: " + toString()); + } + } + +} + diff --git a/client/src/main/generated/com/vesoft/nebula/graph/VerifyClientVersionResp.java b/client/src/main/generated/com/vesoft/nebula/graph/VerifyClientVersionResp.java new file mode 100644 index 000000000..ae4c21a62 --- /dev/null +++ b/client/src/main/generated/com/vesoft/nebula/graph/VerifyClientVersionResp.java @@ -0,0 +1,389 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.vesoft.nebula.graph; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import java.util.BitSet; +import java.util.Arrays; +import com.facebook.thrift.*; +import com.facebook.thrift.annotations.*; +import com.facebook.thrift.async.*; +import com.facebook.thrift.meta_data.*; +import com.facebook.thrift.server.*; +import com.facebook.thrift.transport.*; +import com.facebook.thrift.protocol.*; + +@SuppressWarnings({ "unused", "serial" }) +public class VerifyClientVersionResp implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("VerifyClientVersionResp"); + private static final TField ERROR_CODE_FIELD_DESC = new TField("error_code", TType.I32, (short)1); + private static final TField ERROR_MSG_FIELD_DESC = new TField("error_msg", TType.STRING, (short)2); + + /** + * + * @see com.vesoft.nebula.ErrorCode + */ + public com.vesoft.nebula.ErrorCode error_code; + public byte[] error_msg; + public static final int ERROR_CODE = 1; + public static final int ERROR_MSG = 2; + + // isset id assignments + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(ERROR_CODE, new FieldMetaData("error_code", TFieldRequirementType.REQUIRED, + new FieldValueMetaData(TType.I32))); + tmpMetaDataMap.put(ERROR_MSG, new FieldMetaData("error_msg", TFieldRequirementType.OPTIONAL, + new FieldValueMetaData(TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(VerifyClientVersionResp.class, metaDataMap); + } + + public VerifyClientVersionResp() { + } + + public VerifyClientVersionResp( + com.vesoft.nebula.ErrorCode error_code) { + this(); + this.error_code = error_code; + } + + public VerifyClientVersionResp( + com.vesoft.nebula.ErrorCode error_code, + byte[] error_msg) { + this(); + this.error_code = error_code; + this.error_msg = error_msg; + } + + public static class Builder { + private com.vesoft.nebula.ErrorCode error_code; + private byte[] error_msg; + + public Builder() { + } + + public Builder setError_code(final com.vesoft.nebula.ErrorCode error_code) { + this.error_code = error_code; + return this; + } + + public Builder setError_msg(final byte[] error_msg) { + this.error_msg = error_msg; + return this; + } + + public VerifyClientVersionResp build() { + VerifyClientVersionResp result = new VerifyClientVersionResp(); + result.setError_code(this.error_code); + result.setError_msg(this.error_msg); + return result; + } + } + + public static Builder builder() { + return new Builder(); + } + + /** + * Performs a deep copy on other. + */ + public VerifyClientVersionResp(VerifyClientVersionResp other) { + if (other.isSetError_code()) { + this.error_code = TBaseHelper.deepCopy(other.error_code); + } + if (other.isSetError_msg()) { + this.error_msg = TBaseHelper.deepCopy(other.error_msg); + } + } + + public VerifyClientVersionResp deepCopy() { + return new VerifyClientVersionResp(this); + } + + /** + * + * @see com.vesoft.nebula.ErrorCode + */ + public com.vesoft.nebula.ErrorCode getError_code() { + return this.error_code; + } + + /** + * + * @see com.vesoft.nebula.ErrorCode + */ + public VerifyClientVersionResp setError_code(com.vesoft.nebula.ErrorCode error_code) { + this.error_code = error_code; + return this; + } + + public void unsetError_code() { + this.error_code = null; + } + + // Returns true if field error_code is set (has been assigned a value) and false otherwise + public boolean isSetError_code() { + return this.error_code != null; + } + + public void setError_codeIsSet(boolean __value) { + if (!__value) { + this.error_code = null; + } + } + + public byte[] getError_msg() { + return this.error_msg; + } + + public VerifyClientVersionResp setError_msg(byte[] error_msg) { + this.error_msg = error_msg; + return this; + } + + public void unsetError_msg() { + this.error_msg = null; + } + + // Returns true if field error_msg is set (has been assigned a value) and false otherwise + public boolean isSetError_msg() { + return this.error_msg != null; + } + + public void setError_msgIsSet(boolean __value) { + if (!__value) { + this.error_msg = null; + } + } + + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case ERROR_CODE: + if (__value == null) { + unsetError_code(); + } else { + setError_code((com.vesoft.nebula.ErrorCode)__value); + } + break; + + case ERROR_MSG: + if (__value == null) { + unsetError_msg(); + } else { + setError_msg((byte[])__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case ERROR_CODE: + return getError_code(); + + case ERROR_MSG: + return getError_msg(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof VerifyClientVersionResp)) + return false; + VerifyClientVersionResp that = (VerifyClientVersionResp)_that; + + if (!TBaseHelper.equalsNobinary(this.isSetError_code(), that.isSetError_code(), this.error_code, that.error_code)) { return false; } + + if (!TBaseHelper.equalsSlow(this.isSetError_msg(), that.isSetError_msg(), this.error_msg, that.error_msg)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {error_code, error_msg}); + } + + @Override + public int compareTo(VerifyClientVersionResp other) { + if (other == null) { + // See java.lang.Comparable docs + throw new NullPointerException(); + } + + if (other == this) { + return 0; + } + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetError_code()).compareTo(other.isSetError_code()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(error_code, other.error_code); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = Boolean.valueOf(isSetError_msg()).compareTo(other.isSetError_msg()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(error_msg, other.error_msg); + if (lastComparison != 0) { + return lastComparison; + } + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case ERROR_CODE: + if (__field.type == TType.I32) { + this.error_code = com.vesoft.nebula.ErrorCode.findByValue(iprot.readI32()); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case ERROR_MSG: + if (__field.type == TType.STRING) { + this.error_msg = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.error_code != null) { + oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); + oprot.writeI32(this.error_code == null ? 0 : this.error_code.getValue()); + oprot.writeFieldEnd(); + } + if (this.error_msg != null) { + if (isSetError_msg()) { + oprot.writeFieldBegin(ERROR_MSG_FIELD_DESC); + oprot.writeBinary(this.error_msg); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("VerifyClientVersionResp"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("error_code"); + sb.append(space); + sb.append(":").append(space); + if (this.getError_code() == null) { + sb.append("null"); + } else { + String error_code_name = this.getError_code() == null ? "null" : this.getError_code().name(); + if (error_code_name != null) { + sb.append(error_code_name); + sb.append(" ("); + } + sb.append(this.getError_code()); + if (error_code_name != null) { + sb.append(")"); + } + } + first = false; + if (isSetError_msg()) + { + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("error_msg"); + sb.append(space); + sb.append(":").append(space); + if (this.getError_msg() == null) { + sb.append("null"); + } else { + int __error_msg_size = Math.min(this.getError_msg().length, 128); + for (int i = 0; i < __error_msg_size; i++) { + if (i != 0) sb.append(" "); + sb.append(Integer.toHexString(this.getError_msg()[i]).length() > 1 ? Integer.toHexString(this.getError_msg()[i]).substring(Integer.toHexString(this.getError_msg()[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.getError_msg()[i]).toUpperCase()); + } + if (this.getError_msg().length > 128) sb.append(" ..."); + } + first = false; + } + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + if (error_code == null) { + throw new TProtocolException(TProtocolException.MISSING_REQUIRED_FIELD, "Required field 'error_code' was not present! Struct: " + toString()); + } + } + +} + diff --git a/client/src/main/generated/com/vesoft/nebula/meta/ColumnTypeDef.java b/client/src/main/generated/com/vesoft/nebula/meta/ColumnTypeDef.java index e8a990f60..48b144908 100644 --- a/client/src/main/generated/com/vesoft/nebula/meta/ColumnTypeDef.java +++ b/client/src/main/generated/com/vesoft/nebula/meta/ColumnTypeDef.java @@ -28,6 +28,7 @@ public class ColumnTypeDef implements TBase, java.io.Serializable, Cloneable, Co private static final TStruct STRUCT_DESC = new TStruct("ColumnTypeDef"); private static final TField TYPE_FIELD_DESC = new TField("type", TType.I32, (short)1); private static final TField TYPE_LENGTH_FIELD_DESC = new TField("type_length", TType.I16, (short)2); + private static final TField GEO_SHAPE_FIELD_DESC = new TField("geo_shape", TType.I32, (short)3); /** * @@ -35,8 +36,14 @@ public class ColumnTypeDef implements TBase, java.io.Serializable, Cloneable, Co */ public PropertyType type; public short type_length; + /** + * + * @see GeoShape + */ + public GeoShape geo_shape; public static final int TYPE = 1; public static final int TYPE_LENGTH = 2; + public static final int GEO_SHAPE = 3; // isset id assignments private static final int __TYPE_LENGTH_ISSET_ID = 0; @@ -50,6 +57,8 @@ public class ColumnTypeDef implements TBase, java.io.Serializable, Cloneable, Co new FieldValueMetaData(TType.I32))); tmpMetaDataMap.put(TYPE_LENGTH, new FieldMetaData("type_length", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.I16))); + tmpMetaDataMap.put(GEO_SHAPE, new FieldMetaData("geo_shape", TFieldRequirementType.OPTIONAL, + new FieldValueMetaData(TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); } @@ -70,16 +79,19 @@ public ColumnTypeDef( public ColumnTypeDef( PropertyType type, - short type_length) { + short type_length, + GeoShape geo_shape) { this(); this.type = type; this.type_length = type_length; setType_lengthIsSet(true); + this.geo_shape = geo_shape; } public static class Builder { private PropertyType type; private short type_length; + private GeoShape geo_shape; BitSet __optional_isset = new BitSet(1); @@ -97,12 +109,18 @@ public Builder setType_length(final short type_length) { return this; } + public Builder setGeo_shape(final GeoShape geo_shape) { + this.geo_shape = geo_shape; + return this; + } + public ColumnTypeDef build() { ColumnTypeDef result = new ColumnTypeDef(); result.setType(this.type); if (__optional_isset.get(__TYPE_LENGTH_ISSET_ID)) { result.setType_length(this.type_length); } + result.setGeo_shape(this.geo_shape); return result; } } @@ -121,6 +139,9 @@ public ColumnTypeDef(ColumnTypeDef other) { this.type = TBaseHelper.deepCopy(other.type); } this.type_length = TBaseHelper.deepCopy(other.type_length); + if (other.isSetGeo_shape()) { + this.geo_shape = TBaseHelper.deepCopy(other.geo_shape); + } } public ColumnTypeDef deepCopy() { @@ -182,6 +203,38 @@ public void setType_lengthIsSet(boolean __value) { __isset_bit_vector.set(__TYPE_LENGTH_ISSET_ID, __value); } + /** + * + * @see GeoShape + */ + public GeoShape getGeo_shape() { + return this.geo_shape; + } + + /** + * + * @see GeoShape + */ + public ColumnTypeDef setGeo_shape(GeoShape geo_shape) { + this.geo_shape = geo_shape; + return this; + } + + public void unsetGeo_shape() { + this.geo_shape = null; + } + + // Returns true if field geo_shape is set (has been assigned a value) and false otherwise + public boolean isSetGeo_shape() { + return this.geo_shape != null; + } + + public void setGeo_shapeIsSet(boolean __value) { + if (!__value) { + this.geo_shape = null; + } + } + public void setFieldValue(int fieldID, Object __value) { switch (fieldID) { case TYPE: @@ -200,6 +253,14 @@ public void setFieldValue(int fieldID, Object __value) { } break; + case GEO_SHAPE: + if (__value == null) { + unsetGeo_shape(); + } else { + setGeo_shape((GeoShape)__value); + } + break; + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -213,6 +274,9 @@ public Object getFieldValue(int fieldID) { case TYPE_LENGTH: return new Short(getType_length()); + case GEO_SHAPE: + return getGeo_shape(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -232,12 +296,14 @@ public boolean equals(Object _that) { if (!TBaseHelper.equalsNobinary(this.isSetType_length(), that.isSetType_length(), this.type_length, that.type_length)) { return false; } + if (!TBaseHelper.equalsNobinary(this.isSetGeo_shape(), that.isSetGeo_shape(), this.geo_shape, that.geo_shape)) { return false; } + return true; } @Override public int hashCode() { - return Arrays.deepHashCode(new Object[] {type, type_length}); + return Arrays.deepHashCode(new Object[] {type, type_length, geo_shape}); } @Override @@ -268,6 +334,14 @@ public int compareTo(ColumnTypeDef other) { if (lastComparison != 0) { return lastComparison; } + lastComparison = Boolean.valueOf(isSetGeo_shape()).compareTo(other.isSetGeo_shape()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(geo_shape, other.geo_shape); + if (lastComparison != 0) { + return lastComparison; + } return 0; } @@ -297,6 +371,13 @@ public void read(TProtocol iprot) throws TException { TProtocolUtil.skip(iprot, __field.type); } break; + case GEO_SHAPE: + if (__field.type == TType.I32) { + this.geo_shape = GeoShape.findByValue(iprot.readI32()); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; default: TProtocolUtil.skip(iprot, __field.type); break; @@ -324,6 +405,13 @@ public void write(TProtocol oprot) throws TException { oprot.writeI16(this.type_length); oprot.writeFieldEnd(); } + if (this.geo_shape != null) { + if (isSetGeo_shape()) { + oprot.writeFieldBegin(GEO_SHAPE_FIELD_DESC); + oprot.writeI32(this.geo_shape == null ? 0 : this.geo_shape.getValue()); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -372,6 +460,28 @@ public String toString(int indent, boolean prettyPrint) { sb.append(TBaseHelper.toString(this.getType_length(), indent + 1, prettyPrint)); first = false; } + if (isSetGeo_shape()) + { + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("geo_shape"); + sb.append(space); + sb.append(":").append(space); + if (this.getGeo_shape() == null) { + sb.append("null"); + } else { + String geo_shape_name = this.getGeo_shape() == null ? "null" : this.getGeo_shape().name(); + if (geo_shape_name != null) { + sb.append(geo_shape_name); + sb.append(" ("); + } + sb.append(this.getGeo_shape()); + if (geo_shape_name != null) { + sb.append(")"); + } + } + first = false; + } sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); sb.append(")"); return sb.toString(); diff --git a/client/src/main/generated/com/vesoft/nebula/meta/GeoShape.java b/client/src/main/generated/com/vesoft/nebula/meta/GeoShape.java new file mode 100644 index 000000000..6110f3ec0 --- /dev/null +++ b/client/src/main/generated/com/vesoft/nebula/meta/GeoShape.java @@ -0,0 +1,52 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.vesoft.nebula.meta; + + +import com.facebook.thrift.IntRangeSet; +import java.util.Map; +import java.util.HashMap; + +@SuppressWarnings({ "unused" }) +public enum GeoShape implements com.facebook.thrift.TEnum { + ANY(0), + POINT(1), + LINESTRING(2), + POLYGON(3); + + private final int value; + + private GeoShape(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static GeoShape findByValue(int value) { + switch (value) { + case 0: + return ANY; + case 1: + return POINT; + case 2: + return LINESTRING; + case 3: + return POLYGON; + default: + return null; + } + } +} diff --git a/client/src/main/generated/com/vesoft/nebula/meta/MetaService.java b/client/src/main/generated/com/vesoft/nebula/meta/MetaService.java index 5f5fa84ac..818acaa9e 100644 --- a/client/src/main/generated/com/vesoft/nebula/meta/MetaService.java +++ b/client/src/main/generated/com/vesoft/nebula/meta/MetaService.java @@ -209,6 +209,8 @@ public interface Iface { public GetMetaDirInfoResp getMetaDirInfo(GetMetaDirInfoReq req) throws TException; + public VerifyClientVersionResp verifyClientVersion(VerifyClientVersionReq req) throws TException; + } public interface AsyncIface { @@ -391,6 +393,8 @@ public interface AsyncIface { public void getMetaDirInfo(GetMetaDirInfoReq req, AsyncMethodCallback resultHandler) throws TException; + public void verifyClientVersion(VerifyClientVersionReq req, AsyncMethodCallback resultHandler) throws TException; + } public static class Client extends EventHandlerBase implements Iface, TClientIf { @@ -4427,6 +4431,51 @@ public GetMetaDirInfoResp recv_getMetaDirInfo() throws TException throw new TApplicationException(TApplicationException.MISSING_RESULT, "getMetaDirInfo failed: unknown result"); } + public VerifyClientVersionResp verifyClientVersion(VerifyClientVersionReq req) throws TException + { + ContextStack ctx = getContextStack("MetaService.verifyClientVersion", null); + this.setContextStack(ctx); + send_verifyClientVersion(req); + return recv_verifyClientVersion(); + } + + public void send_verifyClientVersion(VerifyClientVersionReq req) throws TException + { + ContextStack ctx = this.getContextStack(); + super.preWrite(ctx, "MetaService.verifyClientVersion", null); + oprot_.writeMessageBegin(new TMessage("verifyClientVersion", TMessageType.CALL, seqid_)); + verifyClientVersion_args args = new verifyClientVersion_args(); + args.req = req; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + super.postWrite(ctx, "MetaService.verifyClientVersion", args); + return; + } + + public VerifyClientVersionResp recv_verifyClientVersion() throws TException + { + ContextStack ctx = super.getContextStack(); + long bytes; + TMessageType mtype; + super.preRead(ctx, "MetaService.verifyClientVersion"); + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + verifyClientVersion_result result = new verifyClientVersion_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + super.postRead(ctx, "MetaService.verifyClientVersion", result); + + if (result.isSetSuccess()) { + return result.success; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "verifyClientVersion failed: unknown result"); + } + } public static class AsyncClient extends TAsyncClient implements AsyncIface { public static class Factory implements TAsyncClientFactory { @@ -4445,17 +4494,17 @@ public AsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager clientM super(protocolFactory, clientManager, transport); } - public void createSpace(CreateSpaceReq req, AsyncMethodCallback resultHandler425) throws TException { + public void createSpace(CreateSpaceReq req, AsyncMethodCallback resultHandler426) throws TException { checkReady(); - createSpace_call method_call = new createSpace_call(req, resultHandler425, this, ___protocolFactory, ___transport); + createSpace_call method_call = new createSpace_call(req, resultHandler426, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class createSpace_call extends TAsyncMethodCall { private CreateSpaceReq req; - public createSpace_call(CreateSpaceReq req, AsyncMethodCallback resultHandler426, TAsyncClient client422, TProtocolFactory protocolFactory423, TNonblockingTransport transport424) throws TException { - super(client422, protocolFactory423, transport424, resultHandler426, false); + public createSpace_call(CreateSpaceReq req, AsyncMethodCallback resultHandler427, TAsyncClient client423, TProtocolFactory protocolFactory424, TNonblockingTransport transport425) throws TException { + super(client423, protocolFactory424, transport425, resultHandler427, false); this.req = req; } @@ -4477,17 +4526,17 @@ public ExecResp getResult() throws TException { } } - public void dropSpace(DropSpaceReq req, AsyncMethodCallback resultHandler430) throws TException { + public void dropSpace(DropSpaceReq req, AsyncMethodCallback resultHandler431) throws TException { checkReady(); - dropSpace_call method_call = new dropSpace_call(req, resultHandler430, this, ___protocolFactory, ___transport); + dropSpace_call method_call = new dropSpace_call(req, resultHandler431, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class dropSpace_call extends TAsyncMethodCall { private DropSpaceReq req; - public dropSpace_call(DropSpaceReq req, AsyncMethodCallback resultHandler431, TAsyncClient client427, TProtocolFactory protocolFactory428, TNonblockingTransport transport429) throws TException { - super(client427, protocolFactory428, transport429, resultHandler431, false); + public dropSpace_call(DropSpaceReq req, AsyncMethodCallback resultHandler432, TAsyncClient client428, TProtocolFactory protocolFactory429, TNonblockingTransport transport430) throws TException { + super(client428, protocolFactory429, transport430, resultHandler432, false); this.req = req; } @@ -4509,17 +4558,17 @@ public ExecResp getResult() throws TException { } } - public void getSpace(GetSpaceReq req, AsyncMethodCallback resultHandler435) throws TException { + public void getSpace(GetSpaceReq req, AsyncMethodCallback resultHandler436) throws TException { checkReady(); - getSpace_call method_call = new getSpace_call(req, resultHandler435, this, ___protocolFactory, ___transport); + getSpace_call method_call = new getSpace_call(req, resultHandler436, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getSpace_call extends TAsyncMethodCall { private GetSpaceReq req; - public getSpace_call(GetSpaceReq req, AsyncMethodCallback resultHandler436, TAsyncClient client432, TProtocolFactory protocolFactory433, TNonblockingTransport transport434) throws TException { - super(client432, protocolFactory433, transport434, resultHandler436, false); + public getSpace_call(GetSpaceReq req, AsyncMethodCallback resultHandler437, TAsyncClient client433, TProtocolFactory protocolFactory434, TNonblockingTransport transport435) throws TException { + super(client433, protocolFactory434, transport435, resultHandler437, false); this.req = req; } @@ -4541,17 +4590,17 @@ public GetSpaceResp getResult() throws TException { } } - public void listSpaces(ListSpacesReq req, AsyncMethodCallback resultHandler440) throws TException { + public void listSpaces(ListSpacesReq req, AsyncMethodCallback resultHandler441) throws TException { checkReady(); - listSpaces_call method_call = new listSpaces_call(req, resultHandler440, this, ___protocolFactory, ___transport); + listSpaces_call method_call = new listSpaces_call(req, resultHandler441, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listSpaces_call extends TAsyncMethodCall { private ListSpacesReq req; - public listSpaces_call(ListSpacesReq req, AsyncMethodCallback resultHandler441, TAsyncClient client437, TProtocolFactory protocolFactory438, TNonblockingTransport transport439) throws TException { - super(client437, protocolFactory438, transport439, resultHandler441, false); + public listSpaces_call(ListSpacesReq req, AsyncMethodCallback resultHandler442, TAsyncClient client438, TProtocolFactory protocolFactory439, TNonblockingTransport transport440) throws TException { + super(client438, protocolFactory439, transport440, resultHandler442, false); this.req = req; } @@ -4573,17 +4622,17 @@ public ListSpacesResp getResult() throws TException { } } - public void createSpaceAs(CreateSpaceAsReq req, AsyncMethodCallback resultHandler445) throws TException { + public void createSpaceAs(CreateSpaceAsReq req, AsyncMethodCallback resultHandler446) throws TException { checkReady(); - createSpaceAs_call method_call = new createSpaceAs_call(req, resultHandler445, this, ___protocolFactory, ___transport); + createSpaceAs_call method_call = new createSpaceAs_call(req, resultHandler446, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class createSpaceAs_call extends TAsyncMethodCall { private CreateSpaceAsReq req; - public createSpaceAs_call(CreateSpaceAsReq req, AsyncMethodCallback resultHandler446, TAsyncClient client442, TProtocolFactory protocolFactory443, TNonblockingTransport transport444) throws TException { - super(client442, protocolFactory443, transport444, resultHandler446, false); + public createSpaceAs_call(CreateSpaceAsReq req, AsyncMethodCallback resultHandler447, TAsyncClient client443, TProtocolFactory protocolFactory444, TNonblockingTransport transport445) throws TException { + super(client443, protocolFactory444, transport445, resultHandler447, false); this.req = req; } @@ -4605,17 +4654,17 @@ public ExecResp getResult() throws TException { } } - public void createTag(CreateTagReq req, AsyncMethodCallback resultHandler450) throws TException { + public void createTag(CreateTagReq req, AsyncMethodCallback resultHandler451) throws TException { checkReady(); - createTag_call method_call = new createTag_call(req, resultHandler450, this, ___protocolFactory, ___transport); + createTag_call method_call = new createTag_call(req, resultHandler451, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class createTag_call extends TAsyncMethodCall { private CreateTagReq req; - public createTag_call(CreateTagReq req, AsyncMethodCallback resultHandler451, TAsyncClient client447, TProtocolFactory protocolFactory448, TNonblockingTransport transport449) throws TException { - super(client447, protocolFactory448, transport449, resultHandler451, false); + public createTag_call(CreateTagReq req, AsyncMethodCallback resultHandler452, TAsyncClient client448, TProtocolFactory protocolFactory449, TNonblockingTransport transport450) throws TException { + super(client448, protocolFactory449, transport450, resultHandler452, false); this.req = req; } @@ -4637,17 +4686,17 @@ public ExecResp getResult() throws TException { } } - public void alterTag(AlterTagReq req, AsyncMethodCallback resultHandler455) throws TException { + public void alterTag(AlterTagReq req, AsyncMethodCallback resultHandler456) throws TException { checkReady(); - alterTag_call method_call = new alterTag_call(req, resultHandler455, this, ___protocolFactory, ___transport); + alterTag_call method_call = new alterTag_call(req, resultHandler456, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class alterTag_call extends TAsyncMethodCall { private AlterTagReq req; - public alterTag_call(AlterTagReq req, AsyncMethodCallback resultHandler456, TAsyncClient client452, TProtocolFactory protocolFactory453, TNonblockingTransport transport454) throws TException { - super(client452, protocolFactory453, transport454, resultHandler456, false); + public alterTag_call(AlterTagReq req, AsyncMethodCallback resultHandler457, TAsyncClient client453, TProtocolFactory protocolFactory454, TNonblockingTransport transport455) throws TException { + super(client453, protocolFactory454, transport455, resultHandler457, false); this.req = req; } @@ -4669,17 +4718,17 @@ public ExecResp getResult() throws TException { } } - public void dropTag(DropTagReq req, AsyncMethodCallback resultHandler460) throws TException { + public void dropTag(DropTagReq req, AsyncMethodCallback resultHandler461) throws TException { checkReady(); - dropTag_call method_call = new dropTag_call(req, resultHandler460, this, ___protocolFactory, ___transport); + dropTag_call method_call = new dropTag_call(req, resultHandler461, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class dropTag_call extends TAsyncMethodCall { private DropTagReq req; - public dropTag_call(DropTagReq req, AsyncMethodCallback resultHandler461, TAsyncClient client457, TProtocolFactory protocolFactory458, TNonblockingTransport transport459) throws TException { - super(client457, protocolFactory458, transport459, resultHandler461, false); + public dropTag_call(DropTagReq req, AsyncMethodCallback resultHandler462, TAsyncClient client458, TProtocolFactory protocolFactory459, TNonblockingTransport transport460) throws TException { + super(client458, protocolFactory459, transport460, resultHandler462, false); this.req = req; } @@ -4701,17 +4750,17 @@ public ExecResp getResult() throws TException { } } - public void getTag(GetTagReq req, AsyncMethodCallback resultHandler465) throws TException { + public void getTag(GetTagReq req, AsyncMethodCallback resultHandler466) throws TException { checkReady(); - getTag_call method_call = new getTag_call(req, resultHandler465, this, ___protocolFactory, ___transport); + getTag_call method_call = new getTag_call(req, resultHandler466, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getTag_call extends TAsyncMethodCall { private GetTagReq req; - public getTag_call(GetTagReq req, AsyncMethodCallback resultHandler466, TAsyncClient client462, TProtocolFactory protocolFactory463, TNonblockingTransport transport464) throws TException { - super(client462, protocolFactory463, transport464, resultHandler466, false); + public getTag_call(GetTagReq req, AsyncMethodCallback resultHandler467, TAsyncClient client463, TProtocolFactory protocolFactory464, TNonblockingTransport transport465) throws TException { + super(client463, protocolFactory464, transport465, resultHandler467, false); this.req = req; } @@ -4733,17 +4782,17 @@ public GetTagResp getResult() throws TException { } } - public void listTags(ListTagsReq req, AsyncMethodCallback resultHandler470) throws TException { + public void listTags(ListTagsReq req, AsyncMethodCallback resultHandler471) throws TException { checkReady(); - listTags_call method_call = new listTags_call(req, resultHandler470, this, ___protocolFactory, ___transport); + listTags_call method_call = new listTags_call(req, resultHandler471, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listTags_call extends TAsyncMethodCall { private ListTagsReq req; - public listTags_call(ListTagsReq req, AsyncMethodCallback resultHandler471, TAsyncClient client467, TProtocolFactory protocolFactory468, TNonblockingTransport transport469) throws TException { - super(client467, protocolFactory468, transport469, resultHandler471, false); + public listTags_call(ListTagsReq req, AsyncMethodCallback resultHandler472, TAsyncClient client468, TProtocolFactory protocolFactory469, TNonblockingTransport transport470) throws TException { + super(client468, protocolFactory469, transport470, resultHandler472, false); this.req = req; } @@ -4765,17 +4814,17 @@ public ListTagsResp getResult() throws TException { } } - public void createEdge(CreateEdgeReq req, AsyncMethodCallback resultHandler475) throws TException { + public void createEdge(CreateEdgeReq req, AsyncMethodCallback resultHandler476) throws TException { checkReady(); - createEdge_call method_call = new createEdge_call(req, resultHandler475, this, ___protocolFactory, ___transport); + createEdge_call method_call = new createEdge_call(req, resultHandler476, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class createEdge_call extends TAsyncMethodCall { private CreateEdgeReq req; - public createEdge_call(CreateEdgeReq req, AsyncMethodCallback resultHandler476, TAsyncClient client472, TProtocolFactory protocolFactory473, TNonblockingTransport transport474) throws TException { - super(client472, protocolFactory473, transport474, resultHandler476, false); + public createEdge_call(CreateEdgeReq req, AsyncMethodCallback resultHandler477, TAsyncClient client473, TProtocolFactory protocolFactory474, TNonblockingTransport transport475) throws TException { + super(client473, protocolFactory474, transport475, resultHandler477, false); this.req = req; } @@ -4797,17 +4846,17 @@ public ExecResp getResult() throws TException { } } - public void alterEdge(AlterEdgeReq req, AsyncMethodCallback resultHandler480) throws TException { + public void alterEdge(AlterEdgeReq req, AsyncMethodCallback resultHandler481) throws TException { checkReady(); - alterEdge_call method_call = new alterEdge_call(req, resultHandler480, this, ___protocolFactory, ___transport); + alterEdge_call method_call = new alterEdge_call(req, resultHandler481, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class alterEdge_call extends TAsyncMethodCall { private AlterEdgeReq req; - public alterEdge_call(AlterEdgeReq req, AsyncMethodCallback resultHandler481, TAsyncClient client477, TProtocolFactory protocolFactory478, TNonblockingTransport transport479) throws TException { - super(client477, protocolFactory478, transport479, resultHandler481, false); + public alterEdge_call(AlterEdgeReq req, AsyncMethodCallback resultHandler482, TAsyncClient client478, TProtocolFactory protocolFactory479, TNonblockingTransport transport480) throws TException { + super(client478, protocolFactory479, transport480, resultHandler482, false); this.req = req; } @@ -4829,17 +4878,17 @@ public ExecResp getResult() throws TException { } } - public void dropEdge(DropEdgeReq req, AsyncMethodCallback resultHandler485) throws TException { + public void dropEdge(DropEdgeReq req, AsyncMethodCallback resultHandler486) throws TException { checkReady(); - dropEdge_call method_call = new dropEdge_call(req, resultHandler485, this, ___protocolFactory, ___transport); + dropEdge_call method_call = new dropEdge_call(req, resultHandler486, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class dropEdge_call extends TAsyncMethodCall { private DropEdgeReq req; - public dropEdge_call(DropEdgeReq req, AsyncMethodCallback resultHandler486, TAsyncClient client482, TProtocolFactory protocolFactory483, TNonblockingTransport transport484) throws TException { - super(client482, protocolFactory483, transport484, resultHandler486, false); + public dropEdge_call(DropEdgeReq req, AsyncMethodCallback resultHandler487, TAsyncClient client483, TProtocolFactory protocolFactory484, TNonblockingTransport transport485) throws TException { + super(client483, protocolFactory484, transport485, resultHandler487, false); this.req = req; } @@ -4861,17 +4910,17 @@ public ExecResp getResult() throws TException { } } - public void getEdge(GetEdgeReq req, AsyncMethodCallback resultHandler490) throws TException { + public void getEdge(GetEdgeReq req, AsyncMethodCallback resultHandler491) throws TException { checkReady(); - getEdge_call method_call = new getEdge_call(req, resultHandler490, this, ___protocolFactory, ___transport); + getEdge_call method_call = new getEdge_call(req, resultHandler491, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getEdge_call extends TAsyncMethodCall { private GetEdgeReq req; - public getEdge_call(GetEdgeReq req, AsyncMethodCallback resultHandler491, TAsyncClient client487, TProtocolFactory protocolFactory488, TNonblockingTransport transport489) throws TException { - super(client487, protocolFactory488, transport489, resultHandler491, false); + public getEdge_call(GetEdgeReq req, AsyncMethodCallback resultHandler492, TAsyncClient client488, TProtocolFactory protocolFactory489, TNonblockingTransport transport490) throws TException { + super(client488, protocolFactory489, transport490, resultHandler492, false); this.req = req; } @@ -4893,17 +4942,17 @@ public GetEdgeResp getResult() throws TException { } } - public void listEdges(ListEdgesReq req, AsyncMethodCallback resultHandler495) throws TException { + public void listEdges(ListEdgesReq req, AsyncMethodCallback resultHandler496) throws TException { checkReady(); - listEdges_call method_call = new listEdges_call(req, resultHandler495, this, ___protocolFactory, ___transport); + listEdges_call method_call = new listEdges_call(req, resultHandler496, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listEdges_call extends TAsyncMethodCall { private ListEdgesReq req; - public listEdges_call(ListEdgesReq req, AsyncMethodCallback resultHandler496, TAsyncClient client492, TProtocolFactory protocolFactory493, TNonblockingTransport transport494) throws TException { - super(client492, protocolFactory493, transport494, resultHandler496, false); + public listEdges_call(ListEdgesReq req, AsyncMethodCallback resultHandler497, TAsyncClient client493, TProtocolFactory protocolFactory494, TNonblockingTransport transport495) throws TException { + super(client493, protocolFactory494, transport495, resultHandler497, false); this.req = req; } @@ -4925,17 +4974,17 @@ public ListEdgesResp getResult() throws TException { } } - public void listHosts(ListHostsReq req, AsyncMethodCallback resultHandler500) throws TException { + public void listHosts(ListHostsReq req, AsyncMethodCallback resultHandler501) throws TException { checkReady(); - listHosts_call method_call = new listHosts_call(req, resultHandler500, this, ___protocolFactory, ___transport); + listHosts_call method_call = new listHosts_call(req, resultHandler501, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listHosts_call extends TAsyncMethodCall { private ListHostsReq req; - public listHosts_call(ListHostsReq req, AsyncMethodCallback resultHandler501, TAsyncClient client497, TProtocolFactory protocolFactory498, TNonblockingTransport transport499) throws TException { - super(client497, protocolFactory498, transport499, resultHandler501, false); + public listHosts_call(ListHostsReq req, AsyncMethodCallback resultHandler502, TAsyncClient client498, TProtocolFactory protocolFactory499, TNonblockingTransport transport500) throws TException { + super(client498, protocolFactory499, transport500, resultHandler502, false); this.req = req; } @@ -4957,17 +5006,17 @@ public ListHostsResp getResult() throws TException { } } - public void getPartsAlloc(GetPartsAllocReq req, AsyncMethodCallback resultHandler505) throws TException { + public void getPartsAlloc(GetPartsAllocReq req, AsyncMethodCallback resultHandler506) throws TException { checkReady(); - getPartsAlloc_call method_call = new getPartsAlloc_call(req, resultHandler505, this, ___protocolFactory, ___transport); + getPartsAlloc_call method_call = new getPartsAlloc_call(req, resultHandler506, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getPartsAlloc_call extends TAsyncMethodCall { private GetPartsAllocReq req; - public getPartsAlloc_call(GetPartsAllocReq req, AsyncMethodCallback resultHandler506, TAsyncClient client502, TProtocolFactory protocolFactory503, TNonblockingTransport transport504) throws TException { - super(client502, protocolFactory503, transport504, resultHandler506, false); + public getPartsAlloc_call(GetPartsAllocReq req, AsyncMethodCallback resultHandler507, TAsyncClient client503, TProtocolFactory protocolFactory504, TNonblockingTransport transport505) throws TException { + super(client503, protocolFactory504, transport505, resultHandler507, false); this.req = req; } @@ -4989,17 +5038,17 @@ public GetPartsAllocResp getResult() throws TException { } } - public void listParts(ListPartsReq req, AsyncMethodCallback resultHandler510) throws TException { + public void listParts(ListPartsReq req, AsyncMethodCallback resultHandler511) throws TException { checkReady(); - listParts_call method_call = new listParts_call(req, resultHandler510, this, ___protocolFactory, ___transport); + listParts_call method_call = new listParts_call(req, resultHandler511, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listParts_call extends TAsyncMethodCall { private ListPartsReq req; - public listParts_call(ListPartsReq req, AsyncMethodCallback resultHandler511, TAsyncClient client507, TProtocolFactory protocolFactory508, TNonblockingTransport transport509) throws TException { - super(client507, protocolFactory508, transport509, resultHandler511, false); + public listParts_call(ListPartsReq req, AsyncMethodCallback resultHandler512, TAsyncClient client508, TProtocolFactory protocolFactory509, TNonblockingTransport transport510) throws TException { + super(client508, protocolFactory509, transport510, resultHandler512, false); this.req = req; } @@ -5021,17 +5070,17 @@ public ListPartsResp getResult() throws TException { } } - public void multiPut(MultiPutReq req, AsyncMethodCallback resultHandler515) throws TException { + public void multiPut(MultiPutReq req, AsyncMethodCallback resultHandler516) throws TException { checkReady(); - multiPut_call method_call = new multiPut_call(req, resultHandler515, this, ___protocolFactory, ___transport); + multiPut_call method_call = new multiPut_call(req, resultHandler516, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class multiPut_call extends TAsyncMethodCall { private MultiPutReq req; - public multiPut_call(MultiPutReq req, AsyncMethodCallback resultHandler516, TAsyncClient client512, TProtocolFactory protocolFactory513, TNonblockingTransport transport514) throws TException { - super(client512, protocolFactory513, transport514, resultHandler516, false); + public multiPut_call(MultiPutReq req, AsyncMethodCallback resultHandler517, TAsyncClient client513, TProtocolFactory protocolFactory514, TNonblockingTransport transport515) throws TException { + super(client513, protocolFactory514, transport515, resultHandler517, false); this.req = req; } @@ -5053,17 +5102,17 @@ public ExecResp getResult() throws TException { } } - public void get(GetReq req, AsyncMethodCallback resultHandler520) throws TException { + public void get(GetReq req, AsyncMethodCallback resultHandler521) throws TException { checkReady(); - get_call method_call = new get_call(req, resultHandler520, this, ___protocolFactory, ___transport); + get_call method_call = new get_call(req, resultHandler521, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class get_call extends TAsyncMethodCall { private GetReq req; - public get_call(GetReq req, AsyncMethodCallback resultHandler521, TAsyncClient client517, TProtocolFactory protocolFactory518, TNonblockingTransport transport519) throws TException { - super(client517, protocolFactory518, transport519, resultHandler521, false); + public get_call(GetReq req, AsyncMethodCallback resultHandler522, TAsyncClient client518, TProtocolFactory protocolFactory519, TNonblockingTransport transport520) throws TException { + super(client518, protocolFactory519, transport520, resultHandler522, false); this.req = req; } @@ -5085,17 +5134,17 @@ public GetResp getResult() throws TException { } } - public void multiGet(MultiGetReq req, AsyncMethodCallback resultHandler525) throws TException { + public void multiGet(MultiGetReq req, AsyncMethodCallback resultHandler526) throws TException { checkReady(); - multiGet_call method_call = new multiGet_call(req, resultHandler525, this, ___protocolFactory, ___transport); + multiGet_call method_call = new multiGet_call(req, resultHandler526, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class multiGet_call extends TAsyncMethodCall { private MultiGetReq req; - public multiGet_call(MultiGetReq req, AsyncMethodCallback resultHandler526, TAsyncClient client522, TProtocolFactory protocolFactory523, TNonblockingTransport transport524) throws TException { - super(client522, protocolFactory523, transport524, resultHandler526, false); + public multiGet_call(MultiGetReq req, AsyncMethodCallback resultHandler527, TAsyncClient client523, TProtocolFactory protocolFactory524, TNonblockingTransport transport525) throws TException { + super(client523, protocolFactory524, transport525, resultHandler527, false); this.req = req; } @@ -5117,17 +5166,17 @@ public MultiGetResp getResult() throws TException { } } - public void remove(RemoveReq req, AsyncMethodCallback resultHandler530) throws TException { + public void remove(RemoveReq req, AsyncMethodCallback resultHandler531) throws TException { checkReady(); - remove_call method_call = new remove_call(req, resultHandler530, this, ___protocolFactory, ___transport); + remove_call method_call = new remove_call(req, resultHandler531, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class remove_call extends TAsyncMethodCall { private RemoveReq req; - public remove_call(RemoveReq req, AsyncMethodCallback resultHandler531, TAsyncClient client527, TProtocolFactory protocolFactory528, TNonblockingTransport transport529) throws TException { - super(client527, protocolFactory528, transport529, resultHandler531, false); + public remove_call(RemoveReq req, AsyncMethodCallback resultHandler532, TAsyncClient client528, TProtocolFactory protocolFactory529, TNonblockingTransport transport530) throws TException { + super(client528, protocolFactory529, transport530, resultHandler532, false); this.req = req; } @@ -5149,17 +5198,17 @@ public ExecResp getResult() throws TException { } } - public void removeRange(RemoveRangeReq req, AsyncMethodCallback resultHandler535) throws TException { + public void removeRange(RemoveRangeReq req, AsyncMethodCallback resultHandler536) throws TException { checkReady(); - removeRange_call method_call = new removeRange_call(req, resultHandler535, this, ___protocolFactory, ___transport); + removeRange_call method_call = new removeRange_call(req, resultHandler536, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class removeRange_call extends TAsyncMethodCall { private RemoveRangeReq req; - public removeRange_call(RemoveRangeReq req, AsyncMethodCallback resultHandler536, TAsyncClient client532, TProtocolFactory protocolFactory533, TNonblockingTransport transport534) throws TException { - super(client532, protocolFactory533, transport534, resultHandler536, false); + public removeRange_call(RemoveRangeReq req, AsyncMethodCallback resultHandler537, TAsyncClient client533, TProtocolFactory protocolFactory534, TNonblockingTransport transport535) throws TException { + super(client533, protocolFactory534, transport535, resultHandler537, false); this.req = req; } @@ -5181,17 +5230,17 @@ public ExecResp getResult() throws TException { } } - public void scan(ScanReq req, AsyncMethodCallback resultHandler540) throws TException { + public void scan(ScanReq req, AsyncMethodCallback resultHandler541) throws TException { checkReady(); - scan_call method_call = new scan_call(req, resultHandler540, this, ___protocolFactory, ___transport); + scan_call method_call = new scan_call(req, resultHandler541, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class scan_call extends TAsyncMethodCall { private ScanReq req; - public scan_call(ScanReq req, AsyncMethodCallback resultHandler541, TAsyncClient client537, TProtocolFactory protocolFactory538, TNonblockingTransport transport539) throws TException { - super(client537, protocolFactory538, transport539, resultHandler541, false); + public scan_call(ScanReq req, AsyncMethodCallback resultHandler542, TAsyncClient client538, TProtocolFactory protocolFactory539, TNonblockingTransport transport540) throws TException { + super(client538, protocolFactory539, transport540, resultHandler542, false); this.req = req; } @@ -5213,17 +5262,17 @@ public ScanResp getResult() throws TException { } } - public void createTagIndex(CreateTagIndexReq req, AsyncMethodCallback resultHandler545) throws TException { + public void createTagIndex(CreateTagIndexReq req, AsyncMethodCallback resultHandler546) throws TException { checkReady(); - createTagIndex_call method_call = new createTagIndex_call(req, resultHandler545, this, ___protocolFactory, ___transport); + createTagIndex_call method_call = new createTagIndex_call(req, resultHandler546, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class createTagIndex_call extends TAsyncMethodCall { private CreateTagIndexReq req; - public createTagIndex_call(CreateTagIndexReq req, AsyncMethodCallback resultHandler546, TAsyncClient client542, TProtocolFactory protocolFactory543, TNonblockingTransport transport544) throws TException { - super(client542, protocolFactory543, transport544, resultHandler546, false); + public createTagIndex_call(CreateTagIndexReq req, AsyncMethodCallback resultHandler547, TAsyncClient client543, TProtocolFactory protocolFactory544, TNonblockingTransport transport545) throws TException { + super(client543, protocolFactory544, transport545, resultHandler547, false); this.req = req; } @@ -5245,17 +5294,17 @@ public ExecResp getResult() throws TException { } } - public void dropTagIndex(DropTagIndexReq req, AsyncMethodCallback resultHandler550) throws TException { + public void dropTagIndex(DropTagIndexReq req, AsyncMethodCallback resultHandler551) throws TException { checkReady(); - dropTagIndex_call method_call = new dropTagIndex_call(req, resultHandler550, this, ___protocolFactory, ___transport); + dropTagIndex_call method_call = new dropTagIndex_call(req, resultHandler551, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class dropTagIndex_call extends TAsyncMethodCall { private DropTagIndexReq req; - public dropTagIndex_call(DropTagIndexReq req, AsyncMethodCallback resultHandler551, TAsyncClient client547, TProtocolFactory protocolFactory548, TNonblockingTransport transport549) throws TException { - super(client547, protocolFactory548, transport549, resultHandler551, false); + public dropTagIndex_call(DropTagIndexReq req, AsyncMethodCallback resultHandler552, TAsyncClient client548, TProtocolFactory protocolFactory549, TNonblockingTransport transport550) throws TException { + super(client548, protocolFactory549, transport550, resultHandler552, false); this.req = req; } @@ -5277,17 +5326,17 @@ public ExecResp getResult() throws TException { } } - public void getTagIndex(GetTagIndexReq req, AsyncMethodCallback resultHandler555) throws TException { + public void getTagIndex(GetTagIndexReq req, AsyncMethodCallback resultHandler556) throws TException { checkReady(); - getTagIndex_call method_call = new getTagIndex_call(req, resultHandler555, this, ___protocolFactory, ___transport); + getTagIndex_call method_call = new getTagIndex_call(req, resultHandler556, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getTagIndex_call extends TAsyncMethodCall { private GetTagIndexReq req; - public getTagIndex_call(GetTagIndexReq req, AsyncMethodCallback resultHandler556, TAsyncClient client552, TProtocolFactory protocolFactory553, TNonblockingTransport transport554) throws TException { - super(client552, protocolFactory553, transport554, resultHandler556, false); + public getTagIndex_call(GetTagIndexReq req, AsyncMethodCallback resultHandler557, TAsyncClient client553, TProtocolFactory protocolFactory554, TNonblockingTransport transport555) throws TException { + super(client553, protocolFactory554, transport555, resultHandler557, false); this.req = req; } @@ -5309,17 +5358,17 @@ public GetTagIndexResp getResult() throws TException { } } - public void listTagIndexes(ListTagIndexesReq req, AsyncMethodCallback resultHandler560) throws TException { + public void listTagIndexes(ListTagIndexesReq req, AsyncMethodCallback resultHandler561) throws TException { checkReady(); - listTagIndexes_call method_call = new listTagIndexes_call(req, resultHandler560, this, ___protocolFactory, ___transport); + listTagIndexes_call method_call = new listTagIndexes_call(req, resultHandler561, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listTagIndexes_call extends TAsyncMethodCall { private ListTagIndexesReq req; - public listTagIndexes_call(ListTagIndexesReq req, AsyncMethodCallback resultHandler561, TAsyncClient client557, TProtocolFactory protocolFactory558, TNonblockingTransport transport559) throws TException { - super(client557, protocolFactory558, transport559, resultHandler561, false); + public listTagIndexes_call(ListTagIndexesReq req, AsyncMethodCallback resultHandler562, TAsyncClient client558, TProtocolFactory protocolFactory559, TNonblockingTransport transport560) throws TException { + super(client558, protocolFactory559, transport560, resultHandler562, false); this.req = req; } @@ -5341,17 +5390,17 @@ public ListTagIndexesResp getResult() throws TException { } } - public void rebuildTagIndex(RebuildIndexReq req, AsyncMethodCallback resultHandler565) throws TException { + public void rebuildTagIndex(RebuildIndexReq req, AsyncMethodCallback resultHandler566) throws TException { checkReady(); - rebuildTagIndex_call method_call = new rebuildTagIndex_call(req, resultHandler565, this, ___protocolFactory, ___transport); + rebuildTagIndex_call method_call = new rebuildTagIndex_call(req, resultHandler566, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class rebuildTagIndex_call extends TAsyncMethodCall { private RebuildIndexReq req; - public rebuildTagIndex_call(RebuildIndexReq req, AsyncMethodCallback resultHandler566, TAsyncClient client562, TProtocolFactory protocolFactory563, TNonblockingTransport transport564) throws TException { - super(client562, protocolFactory563, transport564, resultHandler566, false); + public rebuildTagIndex_call(RebuildIndexReq req, AsyncMethodCallback resultHandler567, TAsyncClient client563, TProtocolFactory protocolFactory564, TNonblockingTransport transport565) throws TException { + super(client563, protocolFactory564, transport565, resultHandler567, false); this.req = req; } @@ -5373,17 +5422,17 @@ public ExecResp getResult() throws TException { } } - public void listTagIndexStatus(ListIndexStatusReq req, AsyncMethodCallback resultHandler570) throws TException { + public void listTagIndexStatus(ListIndexStatusReq req, AsyncMethodCallback resultHandler571) throws TException { checkReady(); - listTagIndexStatus_call method_call = new listTagIndexStatus_call(req, resultHandler570, this, ___protocolFactory, ___transport); + listTagIndexStatus_call method_call = new listTagIndexStatus_call(req, resultHandler571, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listTagIndexStatus_call extends TAsyncMethodCall { private ListIndexStatusReq req; - public listTagIndexStatus_call(ListIndexStatusReq req, AsyncMethodCallback resultHandler571, TAsyncClient client567, TProtocolFactory protocolFactory568, TNonblockingTransport transport569) throws TException { - super(client567, protocolFactory568, transport569, resultHandler571, false); + public listTagIndexStatus_call(ListIndexStatusReq req, AsyncMethodCallback resultHandler572, TAsyncClient client568, TProtocolFactory protocolFactory569, TNonblockingTransport transport570) throws TException { + super(client568, protocolFactory569, transport570, resultHandler572, false); this.req = req; } @@ -5405,17 +5454,17 @@ public ListIndexStatusResp getResult() throws TException { } } - public void createEdgeIndex(CreateEdgeIndexReq req, AsyncMethodCallback resultHandler575) throws TException { + public void createEdgeIndex(CreateEdgeIndexReq req, AsyncMethodCallback resultHandler576) throws TException { checkReady(); - createEdgeIndex_call method_call = new createEdgeIndex_call(req, resultHandler575, this, ___protocolFactory, ___transport); + createEdgeIndex_call method_call = new createEdgeIndex_call(req, resultHandler576, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class createEdgeIndex_call extends TAsyncMethodCall { private CreateEdgeIndexReq req; - public createEdgeIndex_call(CreateEdgeIndexReq req, AsyncMethodCallback resultHandler576, TAsyncClient client572, TProtocolFactory protocolFactory573, TNonblockingTransport transport574) throws TException { - super(client572, protocolFactory573, transport574, resultHandler576, false); + public createEdgeIndex_call(CreateEdgeIndexReq req, AsyncMethodCallback resultHandler577, TAsyncClient client573, TProtocolFactory protocolFactory574, TNonblockingTransport transport575) throws TException { + super(client573, protocolFactory574, transport575, resultHandler577, false); this.req = req; } @@ -5437,17 +5486,17 @@ public ExecResp getResult() throws TException { } } - public void dropEdgeIndex(DropEdgeIndexReq req, AsyncMethodCallback resultHandler580) throws TException { + public void dropEdgeIndex(DropEdgeIndexReq req, AsyncMethodCallback resultHandler581) throws TException { checkReady(); - dropEdgeIndex_call method_call = new dropEdgeIndex_call(req, resultHandler580, this, ___protocolFactory, ___transport); + dropEdgeIndex_call method_call = new dropEdgeIndex_call(req, resultHandler581, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class dropEdgeIndex_call extends TAsyncMethodCall { private DropEdgeIndexReq req; - public dropEdgeIndex_call(DropEdgeIndexReq req, AsyncMethodCallback resultHandler581, TAsyncClient client577, TProtocolFactory protocolFactory578, TNonblockingTransport transport579) throws TException { - super(client577, protocolFactory578, transport579, resultHandler581, false); + public dropEdgeIndex_call(DropEdgeIndexReq req, AsyncMethodCallback resultHandler582, TAsyncClient client578, TProtocolFactory protocolFactory579, TNonblockingTransport transport580) throws TException { + super(client578, protocolFactory579, transport580, resultHandler582, false); this.req = req; } @@ -5469,17 +5518,17 @@ public ExecResp getResult() throws TException { } } - public void getEdgeIndex(GetEdgeIndexReq req, AsyncMethodCallback resultHandler585) throws TException { + public void getEdgeIndex(GetEdgeIndexReq req, AsyncMethodCallback resultHandler586) throws TException { checkReady(); - getEdgeIndex_call method_call = new getEdgeIndex_call(req, resultHandler585, this, ___protocolFactory, ___transport); + getEdgeIndex_call method_call = new getEdgeIndex_call(req, resultHandler586, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getEdgeIndex_call extends TAsyncMethodCall { private GetEdgeIndexReq req; - public getEdgeIndex_call(GetEdgeIndexReq req, AsyncMethodCallback resultHandler586, TAsyncClient client582, TProtocolFactory protocolFactory583, TNonblockingTransport transport584) throws TException { - super(client582, protocolFactory583, transport584, resultHandler586, false); + public getEdgeIndex_call(GetEdgeIndexReq req, AsyncMethodCallback resultHandler587, TAsyncClient client583, TProtocolFactory protocolFactory584, TNonblockingTransport transport585) throws TException { + super(client583, protocolFactory584, transport585, resultHandler587, false); this.req = req; } @@ -5501,17 +5550,17 @@ public GetEdgeIndexResp getResult() throws TException { } } - public void listEdgeIndexes(ListEdgeIndexesReq req, AsyncMethodCallback resultHandler590) throws TException { + public void listEdgeIndexes(ListEdgeIndexesReq req, AsyncMethodCallback resultHandler591) throws TException { checkReady(); - listEdgeIndexes_call method_call = new listEdgeIndexes_call(req, resultHandler590, this, ___protocolFactory, ___transport); + listEdgeIndexes_call method_call = new listEdgeIndexes_call(req, resultHandler591, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listEdgeIndexes_call extends TAsyncMethodCall { private ListEdgeIndexesReq req; - public listEdgeIndexes_call(ListEdgeIndexesReq req, AsyncMethodCallback resultHandler591, TAsyncClient client587, TProtocolFactory protocolFactory588, TNonblockingTransport transport589) throws TException { - super(client587, protocolFactory588, transport589, resultHandler591, false); + public listEdgeIndexes_call(ListEdgeIndexesReq req, AsyncMethodCallback resultHandler592, TAsyncClient client588, TProtocolFactory protocolFactory589, TNonblockingTransport transport590) throws TException { + super(client588, protocolFactory589, transport590, resultHandler592, false); this.req = req; } @@ -5533,17 +5582,17 @@ public ListEdgeIndexesResp getResult() throws TException { } } - public void rebuildEdgeIndex(RebuildIndexReq req, AsyncMethodCallback resultHandler595) throws TException { + public void rebuildEdgeIndex(RebuildIndexReq req, AsyncMethodCallback resultHandler596) throws TException { checkReady(); - rebuildEdgeIndex_call method_call = new rebuildEdgeIndex_call(req, resultHandler595, this, ___protocolFactory, ___transport); + rebuildEdgeIndex_call method_call = new rebuildEdgeIndex_call(req, resultHandler596, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class rebuildEdgeIndex_call extends TAsyncMethodCall { private RebuildIndexReq req; - public rebuildEdgeIndex_call(RebuildIndexReq req, AsyncMethodCallback resultHandler596, TAsyncClient client592, TProtocolFactory protocolFactory593, TNonblockingTransport transport594) throws TException { - super(client592, protocolFactory593, transport594, resultHandler596, false); + public rebuildEdgeIndex_call(RebuildIndexReq req, AsyncMethodCallback resultHandler597, TAsyncClient client593, TProtocolFactory protocolFactory594, TNonblockingTransport transport595) throws TException { + super(client593, protocolFactory594, transport595, resultHandler597, false); this.req = req; } @@ -5565,17 +5614,17 @@ public ExecResp getResult() throws TException { } } - public void listEdgeIndexStatus(ListIndexStatusReq req, AsyncMethodCallback resultHandler600) throws TException { + public void listEdgeIndexStatus(ListIndexStatusReq req, AsyncMethodCallback resultHandler601) throws TException { checkReady(); - listEdgeIndexStatus_call method_call = new listEdgeIndexStatus_call(req, resultHandler600, this, ___protocolFactory, ___transport); + listEdgeIndexStatus_call method_call = new listEdgeIndexStatus_call(req, resultHandler601, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listEdgeIndexStatus_call extends TAsyncMethodCall { private ListIndexStatusReq req; - public listEdgeIndexStatus_call(ListIndexStatusReq req, AsyncMethodCallback resultHandler601, TAsyncClient client597, TProtocolFactory protocolFactory598, TNonblockingTransport transport599) throws TException { - super(client597, protocolFactory598, transport599, resultHandler601, false); + public listEdgeIndexStatus_call(ListIndexStatusReq req, AsyncMethodCallback resultHandler602, TAsyncClient client598, TProtocolFactory protocolFactory599, TNonblockingTransport transport600) throws TException { + super(client598, protocolFactory599, transport600, resultHandler602, false); this.req = req; } @@ -5597,17 +5646,17 @@ public ListIndexStatusResp getResult() throws TException { } } - public void createUser(CreateUserReq req, AsyncMethodCallback resultHandler605) throws TException { + public void createUser(CreateUserReq req, AsyncMethodCallback resultHandler606) throws TException { checkReady(); - createUser_call method_call = new createUser_call(req, resultHandler605, this, ___protocolFactory, ___transport); + createUser_call method_call = new createUser_call(req, resultHandler606, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class createUser_call extends TAsyncMethodCall { private CreateUserReq req; - public createUser_call(CreateUserReq req, AsyncMethodCallback resultHandler606, TAsyncClient client602, TProtocolFactory protocolFactory603, TNonblockingTransport transport604) throws TException { - super(client602, protocolFactory603, transport604, resultHandler606, false); + public createUser_call(CreateUserReq req, AsyncMethodCallback resultHandler607, TAsyncClient client603, TProtocolFactory protocolFactory604, TNonblockingTransport transport605) throws TException { + super(client603, protocolFactory604, transport605, resultHandler607, false); this.req = req; } @@ -5629,17 +5678,17 @@ public ExecResp getResult() throws TException { } } - public void dropUser(DropUserReq req, AsyncMethodCallback resultHandler610) throws TException { + public void dropUser(DropUserReq req, AsyncMethodCallback resultHandler611) throws TException { checkReady(); - dropUser_call method_call = new dropUser_call(req, resultHandler610, this, ___protocolFactory, ___transport); + dropUser_call method_call = new dropUser_call(req, resultHandler611, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class dropUser_call extends TAsyncMethodCall { private DropUserReq req; - public dropUser_call(DropUserReq req, AsyncMethodCallback resultHandler611, TAsyncClient client607, TProtocolFactory protocolFactory608, TNonblockingTransport transport609) throws TException { - super(client607, protocolFactory608, transport609, resultHandler611, false); + public dropUser_call(DropUserReq req, AsyncMethodCallback resultHandler612, TAsyncClient client608, TProtocolFactory protocolFactory609, TNonblockingTransport transport610) throws TException { + super(client608, protocolFactory609, transport610, resultHandler612, false); this.req = req; } @@ -5661,17 +5710,17 @@ public ExecResp getResult() throws TException { } } - public void alterUser(AlterUserReq req, AsyncMethodCallback resultHandler615) throws TException { + public void alterUser(AlterUserReq req, AsyncMethodCallback resultHandler616) throws TException { checkReady(); - alterUser_call method_call = new alterUser_call(req, resultHandler615, this, ___protocolFactory, ___transport); + alterUser_call method_call = new alterUser_call(req, resultHandler616, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class alterUser_call extends TAsyncMethodCall { private AlterUserReq req; - public alterUser_call(AlterUserReq req, AsyncMethodCallback resultHandler616, TAsyncClient client612, TProtocolFactory protocolFactory613, TNonblockingTransport transport614) throws TException { - super(client612, protocolFactory613, transport614, resultHandler616, false); + public alterUser_call(AlterUserReq req, AsyncMethodCallback resultHandler617, TAsyncClient client613, TProtocolFactory protocolFactory614, TNonblockingTransport transport615) throws TException { + super(client613, protocolFactory614, transport615, resultHandler617, false); this.req = req; } @@ -5693,17 +5742,17 @@ public ExecResp getResult() throws TException { } } - public void grantRole(GrantRoleReq req, AsyncMethodCallback resultHandler620) throws TException { + public void grantRole(GrantRoleReq req, AsyncMethodCallback resultHandler621) throws TException { checkReady(); - grantRole_call method_call = new grantRole_call(req, resultHandler620, this, ___protocolFactory, ___transport); + grantRole_call method_call = new grantRole_call(req, resultHandler621, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class grantRole_call extends TAsyncMethodCall { private GrantRoleReq req; - public grantRole_call(GrantRoleReq req, AsyncMethodCallback resultHandler621, TAsyncClient client617, TProtocolFactory protocolFactory618, TNonblockingTransport transport619) throws TException { - super(client617, protocolFactory618, transport619, resultHandler621, false); + public grantRole_call(GrantRoleReq req, AsyncMethodCallback resultHandler622, TAsyncClient client618, TProtocolFactory protocolFactory619, TNonblockingTransport transport620) throws TException { + super(client618, protocolFactory619, transport620, resultHandler622, false); this.req = req; } @@ -5725,17 +5774,17 @@ public ExecResp getResult() throws TException { } } - public void revokeRole(RevokeRoleReq req, AsyncMethodCallback resultHandler625) throws TException { + public void revokeRole(RevokeRoleReq req, AsyncMethodCallback resultHandler626) throws TException { checkReady(); - revokeRole_call method_call = new revokeRole_call(req, resultHandler625, this, ___protocolFactory, ___transport); + revokeRole_call method_call = new revokeRole_call(req, resultHandler626, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class revokeRole_call extends TAsyncMethodCall { private RevokeRoleReq req; - public revokeRole_call(RevokeRoleReq req, AsyncMethodCallback resultHandler626, TAsyncClient client622, TProtocolFactory protocolFactory623, TNonblockingTransport transport624) throws TException { - super(client622, protocolFactory623, transport624, resultHandler626, false); + public revokeRole_call(RevokeRoleReq req, AsyncMethodCallback resultHandler627, TAsyncClient client623, TProtocolFactory protocolFactory624, TNonblockingTransport transport625) throws TException { + super(client623, protocolFactory624, transport625, resultHandler627, false); this.req = req; } @@ -5757,17 +5806,17 @@ public ExecResp getResult() throws TException { } } - public void listUsers(ListUsersReq req, AsyncMethodCallback resultHandler630) throws TException { + public void listUsers(ListUsersReq req, AsyncMethodCallback resultHandler631) throws TException { checkReady(); - listUsers_call method_call = new listUsers_call(req, resultHandler630, this, ___protocolFactory, ___transport); + listUsers_call method_call = new listUsers_call(req, resultHandler631, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listUsers_call extends TAsyncMethodCall { private ListUsersReq req; - public listUsers_call(ListUsersReq req, AsyncMethodCallback resultHandler631, TAsyncClient client627, TProtocolFactory protocolFactory628, TNonblockingTransport transport629) throws TException { - super(client627, protocolFactory628, transport629, resultHandler631, false); + public listUsers_call(ListUsersReq req, AsyncMethodCallback resultHandler632, TAsyncClient client628, TProtocolFactory protocolFactory629, TNonblockingTransport transport630) throws TException { + super(client628, protocolFactory629, transport630, resultHandler632, false); this.req = req; } @@ -5789,17 +5838,17 @@ public ListUsersResp getResult() throws TException { } } - public void listRoles(ListRolesReq req, AsyncMethodCallback resultHandler635) throws TException { + public void listRoles(ListRolesReq req, AsyncMethodCallback resultHandler636) throws TException { checkReady(); - listRoles_call method_call = new listRoles_call(req, resultHandler635, this, ___protocolFactory, ___transport); + listRoles_call method_call = new listRoles_call(req, resultHandler636, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listRoles_call extends TAsyncMethodCall { private ListRolesReq req; - public listRoles_call(ListRolesReq req, AsyncMethodCallback resultHandler636, TAsyncClient client632, TProtocolFactory protocolFactory633, TNonblockingTransport transport634) throws TException { - super(client632, protocolFactory633, transport634, resultHandler636, false); + public listRoles_call(ListRolesReq req, AsyncMethodCallback resultHandler637, TAsyncClient client633, TProtocolFactory protocolFactory634, TNonblockingTransport transport635) throws TException { + super(client633, protocolFactory634, transport635, resultHandler637, false); this.req = req; } @@ -5821,17 +5870,17 @@ public ListRolesResp getResult() throws TException { } } - public void getUserRoles(GetUserRolesReq req, AsyncMethodCallback resultHandler640) throws TException { + public void getUserRoles(GetUserRolesReq req, AsyncMethodCallback resultHandler641) throws TException { checkReady(); - getUserRoles_call method_call = new getUserRoles_call(req, resultHandler640, this, ___protocolFactory, ___transport); + getUserRoles_call method_call = new getUserRoles_call(req, resultHandler641, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getUserRoles_call extends TAsyncMethodCall { private GetUserRolesReq req; - public getUserRoles_call(GetUserRolesReq req, AsyncMethodCallback resultHandler641, TAsyncClient client637, TProtocolFactory protocolFactory638, TNonblockingTransport transport639) throws TException { - super(client637, protocolFactory638, transport639, resultHandler641, false); + public getUserRoles_call(GetUserRolesReq req, AsyncMethodCallback resultHandler642, TAsyncClient client638, TProtocolFactory protocolFactory639, TNonblockingTransport transport640) throws TException { + super(client638, protocolFactory639, transport640, resultHandler642, false); this.req = req; } @@ -5853,17 +5902,17 @@ public ListRolesResp getResult() throws TException { } } - public void changePassword(ChangePasswordReq req, AsyncMethodCallback resultHandler645) throws TException { + public void changePassword(ChangePasswordReq req, AsyncMethodCallback resultHandler646) throws TException { checkReady(); - changePassword_call method_call = new changePassword_call(req, resultHandler645, this, ___protocolFactory, ___transport); + changePassword_call method_call = new changePassword_call(req, resultHandler646, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class changePassword_call extends TAsyncMethodCall { private ChangePasswordReq req; - public changePassword_call(ChangePasswordReq req, AsyncMethodCallback resultHandler646, TAsyncClient client642, TProtocolFactory protocolFactory643, TNonblockingTransport transport644) throws TException { - super(client642, protocolFactory643, transport644, resultHandler646, false); + public changePassword_call(ChangePasswordReq req, AsyncMethodCallback resultHandler647, TAsyncClient client643, TProtocolFactory protocolFactory644, TNonblockingTransport transport645) throws TException { + super(client643, protocolFactory644, transport645, resultHandler647, false); this.req = req; } @@ -5885,17 +5934,17 @@ public ExecResp getResult() throws TException { } } - public void heartBeat(HBReq req, AsyncMethodCallback resultHandler650) throws TException { + public void heartBeat(HBReq req, AsyncMethodCallback resultHandler651) throws TException { checkReady(); - heartBeat_call method_call = new heartBeat_call(req, resultHandler650, this, ___protocolFactory, ___transport); + heartBeat_call method_call = new heartBeat_call(req, resultHandler651, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class heartBeat_call extends TAsyncMethodCall { private HBReq req; - public heartBeat_call(HBReq req, AsyncMethodCallback resultHandler651, TAsyncClient client647, TProtocolFactory protocolFactory648, TNonblockingTransport transport649) throws TException { - super(client647, protocolFactory648, transport649, resultHandler651, false); + public heartBeat_call(HBReq req, AsyncMethodCallback resultHandler652, TAsyncClient client648, TProtocolFactory protocolFactory649, TNonblockingTransport transport650) throws TException { + super(client648, protocolFactory649, transport650, resultHandler652, false); this.req = req; } @@ -5917,17 +5966,17 @@ public HBResp getResult() throws TException { } } - public void balance(BalanceReq req, AsyncMethodCallback resultHandler655) throws TException { + public void balance(BalanceReq req, AsyncMethodCallback resultHandler656) throws TException { checkReady(); - balance_call method_call = new balance_call(req, resultHandler655, this, ___protocolFactory, ___transport); + balance_call method_call = new balance_call(req, resultHandler656, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class balance_call extends TAsyncMethodCall { private BalanceReq req; - public balance_call(BalanceReq req, AsyncMethodCallback resultHandler656, TAsyncClient client652, TProtocolFactory protocolFactory653, TNonblockingTransport transport654) throws TException { - super(client652, protocolFactory653, transport654, resultHandler656, false); + public balance_call(BalanceReq req, AsyncMethodCallback resultHandler657, TAsyncClient client653, TProtocolFactory protocolFactory654, TNonblockingTransport transport655) throws TException { + super(client653, protocolFactory654, transport655, resultHandler657, false); this.req = req; } @@ -5949,17 +5998,17 @@ public BalanceResp getResult() throws TException { } } - public void leaderBalance(LeaderBalanceReq req, AsyncMethodCallback resultHandler660) throws TException { + public void leaderBalance(LeaderBalanceReq req, AsyncMethodCallback resultHandler661) throws TException { checkReady(); - leaderBalance_call method_call = new leaderBalance_call(req, resultHandler660, this, ___protocolFactory, ___transport); + leaderBalance_call method_call = new leaderBalance_call(req, resultHandler661, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class leaderBalance_call extends TAsyncMethodCall { private LeaderBalanceReq req; - public leaderBalance_call(LeaderBalanceReq req, AsyncMethodCallback resultHandler661, TAsyncClient client657, TProtocolFactory protocolFactory658, TNonblockingTransport transport659) throws TException { - super(client657, protocolFactory658, transport659, resultHandler661, false); + public leaderBalance_call(LeaderBalanceReq req, AsyncMethodCallback resultHandler662, TAsyncClient client658, TProtocolFactory protocolFactory659, TNonblockingTransport transport660) throws TException { + super(client658, protocolFactory659, transport660, resultHandler662, false); this.req = req; } @@ -5981,17 +6030,17 @@ public ExecResp getResult() throws TException { } } - public void regConfig(RegConfigReq req, AsyncMethodCallback resultHandler665) throws TException { + public void regConfig(RegConfigReq req, AsyncMethodCallback resultHandler666) throws TException { checkReady(); - regConfig_call method_call = new regConfig_call(req, resultHandler665, this, ___protocolFactory, ___transport); + regConfig_call method_call = new regConfig_call(req, resultHandler666, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class regConfig_call extends TAsyncMethodCall { private RegConfigReq req; - public regConfig_call(RegConfigReq req, AsyncMethodCallback resultHandler666, TAsyncClient client662, TProtocolFactory protocolFactory663, TNonblockingTransport transport664) throws TException { - super(client662, protocolFactory663, transport664, resultHandler666, false); + public regConfig_call(RegConfigReq req, AsyncMethodCallback resultHandler667, TAsyncClient client663, TProtocolFactory protocolFactory664, TNonblockingTransport transport665) throws TException { + super(client663, protocolFactory664, transport665, resultHandler667, false); this.req = req; } @@ -6013,17 +6062,17 @@ public ExecResp getResult() throws TException { } } - public void getConfig(GetConfigReq req, AsyncMethodCallback resultHandler670) throws TException { + public void getConfig(GetConfigReq req, AsyncMethodCallback resultHandler671) throws TException { checkReady(); - getConfig_call method_call = new getConfig_call(req, resultHandler670, this, ___protocolFactory, ___transport); + getConfig_call method_call = new getConfig_call(req, resultHandler671, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getConfig_call extends TAsyncMethodCall { private GetConfigReq req; - public getConfig_call(GetConfigReq req, AsyncMethodCallback resultHandler671, TAsyncClient client667, TProtocolFactory protocolFactory668, TNonblockingTransport transport669) throws TException { - super(client667, protocolFactory668, transport669, resultHandler671, false); + public getConfig_call(GetConfigReq req, AsyncMethodCallback resultHandler672, TAsyncClient client668, TProtocolFactory protocolFactory669, TNonblockingTransport transport670) throws TException { + super(client668, protocolFactory669, transport670, resultHandler672, false); this.req = req; } @@ -6045,17 +6094,17 @@ public GetConfigResp getResult() throws TException { } } - public void setConfig(SetConfigReq req, AsyncMethodCallback resultHandler675) throws TException { + public void setConfig(SetConfigReq req, AsyncMethodCallback resultHandler676) throws TException { checkReady(); - setConfig_call method_call = new setConfig_call(req, resultHandler675, this, ___protocolFactory, ___transport); + setConfig_call method_call = new setConfig_call(req, resultHandler676, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class setConfig_call extends TAsyncMethodCall { private SetConfigReq req; - public setConfig_call(SetConfigReq req, AsyncMethodCallback resultHandler676, TAsyncClient client672, TProtocolFactory protocolFactory673, TNonblockingTransport transport674) throws TException { - super(client672, protocolFactory673, transport674, resultHandler676, false); + public setConfig_call(SetConfigReq req, AsyncMethodCallback resultHandler677, TAsyncClient client673, TProtocolFactory protocolFactory674, TNonblockingTransport transport675) throws TException { + super(client673, protocolFactory674, transport675, resultHandler677, false); this.req = req; } @@ -6077,17 +6126,17 @@ public ExecResp getResult() throws TException { } } - public void listConfigs(ListConfigsReq req, AsyncMethodCallback resultHandler680) throws TException { + public void listConfigs(ListConfigsReq req, AsyncMethodCallback resultHandler681) throws TException { checkReady(); - listConfigs_call method_call = new listConfigs_call(req, resultHandler680, this, ___protocolFactory, ___transport); + listConfigs_call method_call = new listConfigs_call(req, resultHandler681, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listConfigs_call extends TAsyncMethodCall { private ListConfigsReq req; - public listConfigs_call(ListConfigsReq req, AsyncMethodCallback resultHandler681, TAsyncClient client677, TProtocolFactory protocolFactory678, TNonblockingTransport transport679) throws TException { - super(client677, protocolFactory678, transport679, resultHandler681, false); + public listConfigs_call(ListConfigsReq req, AsyncMethodCallback resultHandler682, TAsyncClient client678, TProtocolFactory protocolFactory679, TNonblockingTransport transport680) throws TException { + super(client678, protocolFactory679, transport680, resultHandler682, false); this.req = req; } @@ -6109,17 +6158,17 @@ public ListConfigsResp getResult() throws TException { } } - public void createSnapshot(CreateSnapshotReq req, AsyncMethodCallback resultHandler685) throws TException { + public void createSnapshot(CreateSnapshotReq req, AsyncMethodCallback resultHandler686) throws TException { checkReady(); - createSnapshot_call method_call = new createSnapshot_call(req, resultHandler685, this, ___protocolFactory, ___transport); + createSnapshot_call method_call = new createSnapshot_call(req, resultHandler686, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class createSnapshot_call extends TAsyncMethodCall { private CreateSnapshotReq req; - public createSnapshot_call(CreateSnapshotReq req, AsyncMethodCallback resultHandler686, TAsyncClient client682, TProtocolFactory protocolFactory683, TNonblockingTransport transport684) throws TException { - super(client682, protocolFactory683, transport684, resultHandler686, false); + public createSnapshot_call(CreateSnapshotReq req, AsyncMethodCallback resultHandler687, TAsyncClient client683, TProtocolFactory protocolFactory684, TNonblockingTransport transport685) throws TException { + super(client683, protocolFactory684, transport685, resultHandler687, false); this.req = req; } @@ -6141,17 +6190,17 @@ public ExecResp getResult() throws TException { } } - public void dropSnapshot(DropSnapshotReq req, AsyncMethodCallback resultHandler690) throws TException { + public void dropSnapshot(DropSnapshotReq req, AsyncMethodCallback resultHandler691) throws TException { checkReady(); - dropSnapshot_call method_call = new dropSnapshot_call(req, resultHandler690, this, ___protocolFactory, ___transport); + dropSnapshot_call method_call = new dropSnapshot_call(req, resultHandler691, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class dropSnapshot_call extends TAsyncMethodCall { private DropSnapshotReq req; - public dropSnapshot_call(DropSnapshotReq req, AsyncMethodCallback resultHandler691, TAsyncClient client687, TProtocolFactory protocolFactory688, TNonblockingTransport transport689) throws TException { - super(client687, protocolFactory688, transport689, resultHandler691, false); + public dropSnapshot_call(DropSnapshotReq req, AsyncMethodCallback resultHandler692, TAsyncClient client688, TProtocolFactory protocolFactory689, TNonblockingTransport transport690) throws TException { + super(client688, protocolFactory689, transport690, resultHandler692, false); this.req = req; } @@ -6173,17 +6222,17 @@ public ExecResp getResult() throws TException { } } - public void listSnapshots(ListSnapshotsReq req, AsyncMethodCallback resultHandler695) throws TException { + public void listSnapshots(ListSnapshotsReq req, AsyncMethodCallback resultHandler696) throws TException { checkReady(); - listSnapshots_call method_call = new listSnapshots_call(req, resultHandler695, this, ___protocolFactory, ___transport); + listSnapshots_call method_call = new listSnapshots_call(req, resultHandler696, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listSnapshots_call extends TAsyncMethodCall { private ListSnapshotsReq req; - public listSnapshots_call(ListSnapshotsReq req, AsyncMethodCallback resultHandler696, TAsyncClient client692, TProtocolFactory protocolFactory693, TNonblockingTransport transport694) throws TException { - super(client692, protocolFactory693, transport694, resultHandler696, false); + public listSnapshots_call(ListSnapshotsReq req, AsyncMethodCallback resultHandler697, TAsyncClient client693, TProtocolFactory protocolFactory694, TNonblockingTransport transport695) throws TException { + super(client693, protocolFactory694, transport695, resultHandler697, false); this.req = req; } @@ -6205,17 +6254,17 @@ public ListSnapshotsResp getResult() throws TException { } } - public void runAdminJob(AdminJobReq req, AsyncMethodCallback resultHandler700) throws TException { + public void runAdminJob(AdminJobReq req, AsyncMethodCallback resultHandler701) throws TException { checkReady(); - runAdminJob_call method_call = new runAdminJob_call(req, resultHandler700, this, ___protocolFactory, ___transport); + runAdminJob_call method_call = new runAdminJob_call(req, resultHandler701, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class runAdminJob_call extends TAsyncMethodCall { private AdminJobReq req; - public runAdminJob_call(AdminJobReq req, AsyncMethodCallback resultHandler701, TAsyncClient client697, TProtocolFactory protocolFactory698, TNonblockingTransport transport699) throws TException { - super(client697, protocolFactory698, transport699, resultHandler701, false); + public runAdminJob_call(AdminJobReq req, AsyncMethodCallback resultHandler702, TAsyncClient client698, TProtocolFactory protocolFactory699, TNonblockingTransport transport700) throws TException { + super(client698, protocolFactory699, transport700, resultHandler702, false); this.req = req; } @@ -6237,17 +6286,17 @@ public AdminJobResp getResult() throws TException { } } - public void addZone(AddZoneReq req, AsyncMethodCallback resultHandler705) throws TException { + public void addZone(AddZoneReq req, AsyncMethodCallback resultHandler706) throws TException { checkReady(); - addZone_call method_call = new addZone_call(req, resultHandler705, this, ___protocolFactory, ___transport); + addZone_call method_call = new addZone_call(req, resultHandler706, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class addZone_call extends TAsyncMethodCall { private AddZoneReq req; - public addZone_call(AddZoneReq req, AsyncMethodCallback resultHandler706, TAsyncClient client702, TProtocolFactory protocolFactory703, TNonblockingTransport transport704) throws TException { - super(client702, protocolFactory703, transport704, resultHandler706, false); + public addZone_call(AddZoneReq req, AsyncMethodCallback resultHandler707, TAsyncClient client703, TProtocolFactory protocolFactory704, TNonblockingTransport transport705) throws TException { + super(client703, protocolFactory704, transport705, resultHandler707, false); this.req = req; } @@ -6269,17 +6318,17 @@ public ExecResp getResult() throws TException { } } - public void dropZone(DropZoneReq req, AsyncMethodCallback resultHandler710) throws TException { + public void dropZone(DropZoneReq req, AsyncMethodCallback resultHandler711) throws TException { checkReady(); - dropZone_call method_call = new dropZone_call(req, resultHandler710, this, ___protocolFactory, ___transport); + dropZone_call method_call = new dropZone_call(req, resultHandler711, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class dropZone_call extends TAsyncMethodCall { private DropZoneReq req; - public dropZone_call(DropZoneReq req, AsyncMethodCallback resultHandler711, TAsyncClient client707, TProtocolFactory protocolFactory708, TNonblockingTransport transport709) throws TException { - super(client707, protocolFactory708, transport709, resultHandler711, false); + public dropZone_call(DropZoneReq req, AsyncMethodCallback resultHandler712, TAsyncClient client708, TProtocolFactory protocolFactory709, TNonblockingTransport transport710) throws TException { + super(client708, protocolFactory709, transport710, resultHandler712, false); this.req = req; } @@ -6301,17 +6350,17 @@ public ExecResp getResult() throws TException { } } - public void addHostIntoZone(AddHostIntoZoneReq req, AsyncMethodCallback resultHandler715) throws TException { + public void addHostIntoZone(AddHostIntoZoneReq req, AsyncMethodCallback resultHandler716) throws TException { checkReady(); - addHostIntoZone_call method_call = new addHostIntoZone_call(req, resultHandler715, this, ___protocolFactory, ___transport); + addHostIntoZone_call method_call = new addHostIntoZone_call(req, resultHandler716, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class addHostIntoZone_call extends TAsyncMethodCall { private AddHostIntoZoneReq req; - public addHostIntoZone_call(AddHostIntoZoneReq req, AsyncMethodCallback resultHandler716, TAsyncClient client712, TProtocolFactory protocolFactory713, TNonblockingTransport transport714) throws TException { - super(client712, protocolFactory713, transport714, resultHandler716, false); + public addHostIntoZone_call(AddHostIntoZoneReq req, AsyncMethodCallback resultHandler717, TAsyncClient client713, TProtocolFactory protocolFactory714, TNonblockingTransport transport715) throws TException { + super(client713, protocolFactory714, transport715, resultHandler717, false); this.req = req; } @@ -6333,17 +6382,17 @@ public ExecResp getResult() throws TException { } } - public void dropHostFromZone(DropHostFromZoneReq req, AsyncMethodCallback resultHandler720) throws TException { + public void dropHostFromZone(DropHostFromZoneReq req, AsyncMethodCallback resultHandler721) throws TException { checkReady(); - dropHostFromZone_call method_call = new dropHostFromZone_call(req, resultHandler720, this, ___protocolFactory, ___transport); + dropHostFromZone_call method_call = new dropHostFromZone_call(req, resultHandler721, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class dropHostFromZone_call extends TAsyncMethodCall { private DropHostFromZoneReq req; - public dropHostFromZone_call(DropHostFromZoneReq req, AsyncMethodCallback resultHandler721, TAsyncClient client717, TProtocolFactory protocolFactory718, TNonblockingTransport transport719) throws TException { - super(client717, protocolFactory718, transport719, resultHandler721, false); + public dropHostFromZone_call(DropHostFromZoneReq req, AsyncMethodCallback resultHandler722, TAsyncClient client718, TProtocolFactory protocolFactory719, TNonblockingTransport transport720) throws TException { + super(client718, protocolFactory719, transport720, resultHandler722, false); this.req = req; } @@ -6365,17 +6414,17 @@ public ExecResp getResult() throws TException { } } - public void getZone(GetZoneReq req, AsyncMethodCallback resultHandler725) throws TException { + public void getZone(GetZoneReq req, AsyncMethodCallback resultHandler726) throws TException { checkReady(); - getZone_call method_call = new getZone_call(req, resultHandler725, this, ___protocolFactory, ___transport); + getZone_call method_call = new getZone_call(req, resultHandler726, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getZone_call extends TAsyncMethodCall { private GetZoneReq req; - public getZone_call(GetZoneReq req, AsyncMethodCallback resultHandler726, TAsyncClient client722, TProtocolFactory protocolFactory723, TNonblockingTransport transport724) throws TException { - super(client722, protocolFactory723, transport724, resultHandler726, false); + public getZone_call(GetZoneReq req, AsyncMethodCallback resultHandler727, TAsyncClient client723, TProtocolFactory protocolFactory724, TNonblockingTransport transport725) throws TException { + super(client723, protocolFactory724, transport725, resultHandler727, false); this.req = req; } @@ -6397,17 +6446,17 @@ public GetZoneResp getResult() throws TException { } } - public void listZones(ListZonesReq req, AsyncMethodCallback resultHandler730) throws TException { + public void listZones(ListZonesReq req, AsyncMethodCallback resultHandler731) throws TException { checkReady(); - listZones_call method_call = new listZones_call(req, resultHandler730, this, ___protocolFactory, ___transport); + listZones_call method_call = new listZones_call(req, resultHandler731, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listZones_call extends TAsyncMethodCall { private ListZonesReq req; - public listZones_call(ListZonesReq req, AsyncMethodCallback resultHandler731, TAsyncClient client727, TProtocolFactory protocolFactory728, TNonblockingTransport transport729) throws TException { - super(client727, protocolFactory728, transport729, resultHandler731, false); + public listZones_call(ListZonesReq req, AsyncMethodCallback resultHandler732, TAsyncClient client728, TProtocolFactory protocolFactory729, TNonblockingTransport transport730) throws TException { + super(client728, protocolFactory729, transport730, resultHandler732, false); this.req = req; } @@ -6429,17 +6478,17 @@ public ListZonesResp getResult() throws TException { } } - public void addGroup(AddGroupReq req, AsyncMethodCallback resultHandler735) throws TException { + public void addGroup(AddGroupReq req, AsyncMethodCallback resultHandler736) throws TException { checkReady(); - addGroup_call method_call = new addGroup_call(req, resultHandler735, this, ___protocolFactory, ___transport); + addGroup_call method_call = new addGroup_call(req, resultHandler736, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class addGroup_call extends TAsyncMethodCall { private AddGroupReq req; - public addGroup_call(AddGroupReq req, AsyncMethodCallback resultHandler736, TAsyncClient client732, TProtocolFactory protocolFactory733, TNonblockingTransport transport734) throws TException { - super(client732, protocolFactory733, transport734, resultHandler736, false); + public addGroup_call(AddGroupReq req, AsyncMethodCallback resultHandler737, TAsyncClient client733, TProtocolFactory protocolFactory734, TNonblockingTransport transport735) throws TException { + super(client733, protocolFactory734, transport735, resultHandler737, false); this.req = req; } @@ -6461,17 +6510,17 @@ public ExecResp getResult() throws TException { } } - public void dropGroup(DropGroupReq req, AsyncMethodCallback resultHandler740) throws TException { + public void dropGroup(DropGroupReq req, AsyncMethodCallback resultHandler741) throws TException { checkReady(); - dropGroup_call method_call = new dropGroup_call(req, resultHandler740, this, ___protocolFactory, ___transport); + dropGroup_call method_call = new dropGroup_call(req, resultHandler741, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class dropGroup_call extends TAsyncMethodCall { private DropGroupReq req; - public dropGroup_call(DropGroupReq req, AsyncMethodCallback resultHandler741, TAsyncClient client737, TProtocolFactory protocolFactory738, TNonblockingTransport transport739) throws TException { - super(client737, protocolFactory738, transport739, resultHandler741, false); + public dropGroup_call(DropGroupReq req, AsyncMethodCallback resultHandler742, TAsyncClient client738, TProtocolFactory protocolFactory739, TNonblockingTransport transport740) throws TException { + super(client738, protocolFactory739, transport740, resultHandler742, false); this.req = req; } @@ -6493,17 +6542,17 @@ public ExecResp getResult() throws TException { } } - public void addZoneIntoGroup(AddZoneIntoGroupReq req, AsyncMethodCallback resultHandler745) throws TException { + public void addZoneIntoGroup(AddZoneIntoGroupReq req, AsyncMethodCallback resultHandler746) throws TException { checkReady(); - addZoneIntoGroup_call method_call = new addZoneIntoGroup_call(req, resultHandler745, this, ___protocolFactory, ___transport); + addZoneIntoGroup_call method_call = new addZoneIntoGroup_call(req, resultHandler746, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class addZoneIntoGroup_call extends TAsyncMethodCall { private AddZoneIntoGroupReq req; - public addZoneIntoGroup_call(AddZoneIntoGroupReq req, AsyncMethodCallback resultHandler746, TAsyncClient client742, TProtocolFactory protocolFactory743, TNonblockingTransport transport744) throws TException { - super(client742, protocolFactory743, transport744, resultHandler746, false); + public addZoneIntoGroup_call(AddZoneIntoGroupReq req, AsyncMethodCallback resultHandler747, TAsyncClient client743, TProtocolFactory protocolFactory744, TNonblockingTransport transport745) throws TException { + super(client743, protocolFactory744, transport745, resultHandler747, false); this.req = req; } @@ -6525,17 +6574,17 @@ public ExecResp getResult() throws TException { } } - public void dropZoneFromGroup(DropZoneFromGroupReq req, AsyncMethodCallback resultHandler750) throws TException { + public void dropZoneFromGroup(DropZoneFromGroupReq req, AsyncMethodCallback resultHandler751) throws TException { checkReady(); - dropZoneFromGroup_call method_call = new dropZoneFromGroup_call(req, resultHandler750, this, ___protocolFactory, ___transport); + dropZoneFromGroup_call method_call = new dropZoneFromGroup_call(req, resultHandler751, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class dropZoneFromGroup_call extends TAsyncMethodCall { private DropZoneFromGroupReq req; - public dropZoneFromGroup_call(DropZoneFromGroupReq req, AsyncMethodCallback resultHandler751, TAsyncClient client747, TProtocolFactory protocolFactory748, TNonblockingTransport transport749) throws TException { - super(client747, protocolFactory748, transport749, resultHandler751, false); + public dropZoneFromGroup_call(DropZoneFromGroupReq req, AsyncMethodCallback resultHandler752, TAsyncClient client748, TProtocolFactory protocolFactory749, TNonblockingTransport transport750) throws TException { + super(client748, protocolFactory749, transport750, resultHandler752, false); this.req = req; } @@ -6557,17 +6606,17 @@ public ExecResp getResult() throws TException { } } - public void getGroup(GetGroupReq req, AsyncMethodCallback resultHandler755) throws TException { + public void getGroup(GetGroupReq req, AsyncMethodCallback resultHandler756) throws TException { checkReady(); - getGroup_call method_call = new getGroup_call(req, resultHandler755, this, ___protocolFactory, ___transport); + getGroup_call method_call = new getGroup_call(req, resultHandler756, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getGroup_call extends TAsyncMethodCall { private GetGroupReq req; - public getGroup_call(GetGroupReq req, AsyncMethodCallback resultHandler756, TAsyncClient client752, TProtocolFactory protocolFactory753, TNonblockingTransport transport754) throws TException { - super(client752, protocolFactory753, transport754, resultHandler756, false); + public getGroup_call(GetGroupReq req, AsyncMethodCallback resultHandler757, TAsyncClient client753, TProtocolFactory protocolFactory754, TNonblockingTransport transport755) throws TException { + super(client753, protocolFactory754, transport755, resultHandler757, false); this.req = req; } @@ -6589,17 +6638,17 @@ public GetGroupResp getResult() throws TException { } } - public void listGroups(ListGroupsReq req, AsyncMethodCallback resultHandler760) throws TException { + public void listGroups(ListGroupsReq req, AsyncMethodCallback resultHandler761) throws TException { checkReady(); - listGroups_call method_call = new listGroups_call(req, resultHandler760, this, ___protocolFactory, ___transport); + listGroups_call method_call = new listGroups_call(req, resultHandler761, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listGroups_call extends TAsyncMethodCall { private ListGroupsReq req; - public listGroups_call(ListGroupsReq req, AsyncMethodCallback resultHandler761, TAsyncClient client757, TProtocolFactory protocolFactory758, TNonblockingTransport transport759) throws TException { - super(client757, protocolFactory758, transport759, resultHandler761, false); + public listGroups_call(ListGroupsReq req, AsyncMethodCallback resultHandler762, TAsyncClient client758, TProtocolFactory protocolFactory759, TNonblockingTransport transport760) throws TException { + super(client758, protocolFactory759, transport760, resultHandler762, false); this.req = req; } @@ -6621,17 +6670,17 @@ public ListGroupsResp getResult() throws TException { } } - public void createBackup(CreateBackupReq req, AsyncMethodCallback resultHandler765) throws TException { + public void createBackup(CreateBackupReq req, AsyncMethodCallback resultHandler766) throws TException { checkReady(); - createBackup_call method_call = new createBackup_call(req, resultHandler765, this, ___protocolFactory, ___transport); + createBackup_call method_call = new createBackup_call(req, resultHandler766, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class createBackup_call extends TAsyncMethodCall { private CreateBackupReq req; - public createBackup_call(CreateBackupReq req, AsyncMethodCallback resultHandler766, TAsyncClient client762, TProtocolFactory protocolFactory763, TNonblockingTransport transport764) throws TException { - super(client762, protocolFactory763, transport764, resultHandler766, false); + public createBackup_call(CreateBackupReq req, AsyncMethodCallback resultHandler767, TAsyncClient client763, TProtocolFactory protocolFactory764, TNonblockingTransport transport765) throws TException { + super(client763, protocolFactory764, transport765, resultHandler767, false); this.req = req; } @@ -6653,17 +6702,17 @@ public CreateBackupResp getResult() throws TException { } } - public void restoreMeta(RestoreMetaReq req, AsyncMethodCallback resultHandler770) throws TException { + public void restoreMeta(RestoreMetaReq req, AsyncMethodCallback resultHandler771) throws TException { checkReady(); - restoreMeta_call method_call = new restoreMeta_call(req, resultHandler770, this, ___protocolFactory, ___transport); + restoreMeta_call method_call = new restoreMeta_call(req, resultHandler771, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class restoreMeta_call extends TAsyncMethodCall { private RestoreMetaReq req; - public restoreMeta_call(RestoreMetaReq req, AsyncMethodCallback resultHandler771, TAsyncClient client767, TProtocolFactory protocolFactory768, TNonblockingTransport transport769) throws TException { - super(client767, protocolFactory768, transport769, resultHandler771, false); + public restoreMeta_call(RestoreMetaReq req, AsyncMethodCallback resultHandler772, TAsyncClient client768, TProtocolFactory protocolFactory769, TNonblockingTransport transport770) throws TException { + super(client768, protocolFactory769, transport770, resultHandler772, false); this.req = req; } @@ -6685,17 +6734,17 @@ public ExecResp getResult() throws TException { } } - public void addListener(AddListenerReq req, AsyncMethodCallback resultHandler775) throws TException { + public void addListener(AddListenerReq req, AsyncMethodCallback resultHandler776) throws TException { checkReady(); - addListener_call method_call = new addListener_call(req, resultHandler775, this, ___protocolFactory, ___transport); + addListener_call method_call = new addListener_call(req, resultHandler776, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class addListener_call extends TAsyncMethodCall { private AddListenerReq req; - public addListener_call(AddListenerReq req, AsyncMethodCallback resultHandler776, TAsyncClient client772, TProtocolFactory protocolFactory773, TNonblockingTransport transport774) throws TException { - super(client772, protocolFactory773, transport774, resultHandler776, false); + public addListener_call(AddListenerReq req, AsyncMethodCallback resultHandler777, TAsyncClient client773, TProtocolFactory protocolFactory774, TNonblockingTransport transport775) throws TException { + super(client773, protocolFactory774, transport775, resultHandler777, false); this.req = req; } @@ -6717,17 +6766,17 @@ public ExecResp getResult() throws TException { } } - public void removeListener(RemoveListenerReq req, AsyncMethodCallback resultHandler780) throws TException { + public void removeListener(RemoveListenerReq req, AsyncMethodCallback resultHandler781) throws TException { checkReady(); - removeListener_call method_call = new removeListener_call(req, resultHandler780, this, ___protocolFactory, ___transport); + removeListener_call method_call = new removeListener_call(req, resultHandler781, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class removeListener_call extends TAsyncMethodCall { private RemoveListenerReq req; - public removeListener_call(RemoveListenerReq req, AsyncMethodCallback resultHandler781, TAsyncClient client777, TProtocolFactory protocolFactory778, TNonblockingTransport transport779) throws TException { - super(client777, protocolFactory778, transport779, resultHandler781, false); + public removeListener_call(RemoveListenerReq req, AsyncMethodCallback resultHandler782, TAsyncClient client778, TProtocolFactory protocolFactory779, TNonblockingTransport transport780) throws TException { + super(client778, protocolFactory779, transport780, resultHandler782, false); this.req = req; } @@ -6749,17 +6798,17 @@ public ExecResp getResult() throws TException { } } - public void listListener(ListListenerReq req, AsyncMethodCallback resultHandler785) throws TException { + public void listListener(ListListenerReq req, AsyncMethodCallback resultHandler786) throws TException { checkReady(); - listListener_call method_call = new listListener_call(req, resultHandler785, this, ___protocolFactory, ___transport); + listListener_call method_call = new listListener_call(req, resultHandler786, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listListener_call extends TAsyncMethodCall { private ListListenerReq req; - public listListener_call(ListListenerReq req, AsyncMethodCallback resultHandler786, TAsyncClient client782, TProtocolFactory protocolFactory783, TNonblockingTransport transport784) throws TException { - super(client782, protocolFactory783, transport784, resultHandler786, false); + public listListener_call(ListListenerReq req, AsyncMethodCallback resultHandler787, TAsyncClient client783, TProtocolFactory protocolFactory784, TNonblockingTransport transport785) throws TException { + super(client783, protocolFactory784, transport785, resultHandler787, false); this.req = req; } @@ -6781,17 +6830,17 @@ public ListListenerResp getResult() throws TException { } } - public void getStats(GetStatsReq req, AsyncMethodCallback resultHandler790) throws TException { + public void getStats(GetStatsReq req, AsyncMethodCallback resultHandler791) throws TException { checkReady(); - getStats_call method_call = new getStats_call(req, resultHandler790, this, ___protocolFactory, ___transport); + getStats_call method_call = new getStats_call(req, resultHandler791, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getStats_call extends TAsyncMethodCall { private GetStatsReq req; - public getStats_call(GetStatsReq req, AsyncMethodCallback resultHandler791, TAsyncClient client787, TProtocolFactory protocolFactory788, TNonblockingTransport transport789) throws TException { - super(client787, protocolFactory788, transport789, resultHandler791, false); + public getStats_call(GetStatsReq req, AsyncMethodCallback resultHandler792, TAsyncClient client788, TProtocolFactory protocolFactory789, TNonblockingTransport transport790) throws TException { + super(client788, protocolFactory789, transport790, resultHandler792, false); this.req = req; } @@ -6813,17 +6862,17 @@ public GetStatsResp getResult() throws TException { } } - public void signInFTService(SignInFTServiceReq req, AsyncMethodCallback resultHandler795) throws TException { + public void signInFTService(SignInFTServiceReq req, AsyncMethodCallback resultHandler796) throws TException { checkReady(); - signInFTService_call method_call = new signInFTService_call(req, resultHandler795, this, ___protocolFactory, ___transport); + signInFTService_call method_call = new signInFTService_call(req, resultHandler796, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class signInFTService_call extends TAsyncMethodCall { private SignInFTServiceReq req; - public signInFTService_call(SignInFTServiceReq req, AsyncMethodCallback resultHandler796, TAsyncClient client792, TProtocolFactory protocolFactory793, TNonblockingTransport transport794) throws TException { - super(client792, protocolFactory793, transport794, resultHandler796, false); + public signInFTService_call(SignInFTServiceReq req, AsyncMethodCallback resultHandler797, TAsyncClient client793, TProtocolFactory protocolFactory794, TNonblockingTransport transport795) throws TException { + super(client793, protocolFactory794, transport795, resultHandler797, false); this.req = req; } @@ -6845,17 +6894,17 @@ public ExecResp getResult() throws TException { } } - public void signOutFTService(SignOutFTServiceReq req, AsyncMethodCallback resultHandler800) throws TException { + public void signOutFTService(SignOutFTServiceReq req, AsyncMethodCallback resultHandler801) throws TException { checkReady(); - signOutFTService_call method_call = new signOutFTService_call(req, resultHandler800, this, ___protocolFactory, ___transport); + signOutFTService_call method_call = new signOutFTService_call(req, resultHandler801, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class signOutFTService_call extends TAsyncMethodCall { private SignOutFTServiceReq req; - public signOutFTService_call(SignOutFTServiceReq req, AsyncMethodCallback resultHandler801, TAsyncClient client797, TProtocolFactory protocolFactory798, TNonblockingTransport transport799) throws TException { - super(client797, protocolFactory798, transport799, resultHandler801, false); + public signOutFTService_call(SignOutFTServiceReq req, AsyncMethodCallback resultHandler802, TAsyncClient client798, TProtocolFactory protocolFactory799, TNonblockingTransport transport800) throws TException { + super(client798, protocolFactory799, transport800, resultHandler802, false); this.req = req; } @@ -6877,17 +6926,17 @@ public ExecResp getResult() throws TException { } } - public void listFTClients(ListFTClientsReq req, AsyncMethodCallback resultHandler805) throws TException { + public void listFTClients(ListFTClientsReq req, AsyncMethodCallback resultHandler806) throws TException { checkReady(); - listFTClients_call method_call = new listFTClients_call(req, resultHandler805, this, ___protocolFactory, ___transport); + listFTClients_call method_call = new listFTClients_call(req, resultHandler806, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listFTClients_call extends TAsyncMethodCall { private ListFTClientsReq req; - public listFTClients_call(ListFTClientsReq req, AsyncMethodCallback resultHandler806, TAsyncClient client802, TProtocolFactory protocolFactory803, TNonblockingTransport transport804) throws TException { - super(client802, protocolFactory803, transport804, resultHandler806, false); + public listFTClients_call(ListFTClientsReq req, AsyncMethodCallback resultHandler807, TAsyncClient client803, TProtocolFactory protocolFactory804, TNonblockingTransport transport805) throws TException { + super(client803, protocolFactory804, transport805, resultHandler807, false); this.req = req; } @@ -6909,17 +6958,17 @@ public ListFTClientsResp getResult() throws TException { } } - public void createFTIndex(CreateFTIndexReq req, AsyncMethodCallback resultHandler810) throws TException { + public void createFTIndex(CreateFTIndexReq req, AsyncMethodCallback resultHandler811) throws TException { checkReady(); - createFTIndex_call method_call = new createFTIndex_call(req, resultHandler810, this, ___protocolFactory, ___transport); + createFTIndex_call method_call = new createFTIndex_call(req, resultHandler811, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class createFTIndex_call extends TAsyncMethodCall { private CreateFTIndexReq req; - public createFTIndex_call(CreateFTIndexReq req, AsyncMethodCallback resultHandler811, TAsyncClient client807, TProtocolFactory protocolFactory808, TNonblockingTransport transport809) throws TException { - super(client807, protocolFactory808, transport809, resultHandler811, false); + public createFTIndex_call(CreateFTIndexReq req, AsyncMethodCallback resultHandler812, TAsyncClient client808, TProtocolFactory protocolFactory809, TNonblockingTransport transport810) throws TException { + super(client808, protocolFactory809, transport810, resultHandler812, false); this.req = req; } @@ -6941,17 +6990,17 @@ public ExecResp getResult() throws TException { } } - public void dropFTIndex(DropFTIndexReq req, AsyncMethodCallback resultHandler815) throws TException { + public void dropFTIndex(DropFTIndexReq req, AsyncMethodCallback resultHandler816) throws TException { checkReady(); - dropFTIndex_call method_call = new dropFTIndex_call(req, resultHandler815, this, ___protocolFactory, ___transport); + dropFTIndex_call method_call = new dropFTIndex_call(req, resultHandler816, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class dropFTIndex_call extends TAsyncMethodCall { private DropFTIndexReq req; - public dropFTIndex_call(DropFTIndexReq req, AsyncMethodCallback resultHandler816, TAsyncClient client812, TProtocolFactory protocolFactory813, TNonblockingTransport transport814) throws TException { - super(client812, protocolFactory813, transport814, resultHandler816, false); + public dropFTIndex_call(DropFTIndexReq req, AsyncMethodCallback resultHandler817, TAsyncClient client813, TProtocolFactory protocolFactory814, TNonblockingTransport transport815) throws TException { + super(client813, protocolFactory814, transport815, resultHandler817, false); this.req = req; } @@ -6973,17 +7022,17 @@ public ExecResp getResult() throws TException { } } - public void listFTIndexes(ListFTIndexesReq req, AsyncMethodCallback resultHandler820) throws TException { + public void listFTIndexes(ListFTIndexesReq req, AsyncMethodCallback resultHandler821) throws TException { checkReady(); - listFTIndexes_call method_call = new listFTIndexes_call(req, resultHandler820, this, ___protocolFactory, ___transport); + listFTIndexes_call method_call = new listFTIndexes_call(req, resultHandler821, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listFTIndexes_call extends TAsyncMethodCall { private ListFTIndexesReq req; - public listFTIndexes_call(ListFTIndexesReq req, AsyncMethodCallback resultHandler821, TAsyncClient client817, TProtocolFactory protocolFactory818, TNonblockingTransport transport819) throws TException { - super(client817, protocolFactory818, transport819, resultHandler821, false); + public listFTIndexes_call(ListFTIndexesReq req, AsyncMethodCallback resultHandler822, TAsyncClient client818, TProtocolFactory protocolFactory819, TNonblockingTransport transport820) throws TException { + super(client818, protocolFactory819, transport820, resultHandler822, false); this.req = req; } @@ -7005,17 +7054,17 @@ public ListFTIndexesResp getResult() throws TException { } } - public void createSession(CreateSessionReq req, AsyncMethodCallback resultHandler825) throws TException { + public void createSession(CreateSessionReq req, AsyncMethodCallback resultHandler826) throws TException { checkReady(); - createSession_call method_call = new createSession_call(req, resultHandler825, this, ___protocolFactory, ___transport); + createSession_call method_call = new createSession_call(req, resultHandler826, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class createSession_call extends TAsyncMethodCall { private CreateSessionReq req; - public createSession_call(CreateSessionReq req, AsyncMethodCallback resultHandler826, TAsyncClient client822, TProtocolFactory protocolFactory823, TNonblockingTransport transport824) throws TException { - super(client822, protocolFactory823, transport824, resultHandler826, false); + public createSession_call(CreateSessionReq req, AsyncMethodCallback resultHandler827, TAsyncClient client823, TProtocolFactory protocolFactory824, TNonblockingTransport transport825) throws TException { + super(client823, protocolFactory824, transport825, resultHandler827, false); this.req = req; } @@ -7037,17 +7086,17 @@ public CreateSessionResp getResult() throws TException { } } - public void updateSessions(UpdateSessionsReq req, AsyncMethodCallback resultHandler830) throws TException { + public void updateSessions(UpdateSessionsReq req, AsyncMethodCallback resultHandler831) throws TException { checkReady(); - updateSessions_call method_call = new updateSessions_call(req, resultHandler830, this, ___protocolFactory, ___transport); + updateSessions_call method_call = new updateSessions_call(req, resultHandler831, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class updateSessions_call extends TAsyncMethodCall { private UpdateSessionsReq req; - public updateSessions_call(UpdateSessionsReq req, AsyncMethodCallback resultHandler831, TAsyncClient client827, TProtocolFactory protocolFactory828, TNonblockingTransport transport829) throws TException { - super(client827, protocolFactory828, transport829, resultHandler831, false); + public updateSessions_call(UpdateSessionsReq req, AsyncMethodCallback resultHandler832, TAsyncClient client828, TProtocolFactory protocolFactory829, TNonblockingTransport transport830) throws TException { + super(client828, protocolFactory829, transport830, resultHandler832, false); this.req = req; } @@ -7069,17 +7118,17 @@ public UpdateSessionsResp getResult() throws TException { } } - public void listSessions(ListSessionsReq req, AsyncMethodCallback resultHandler835) throws TException { + public void listSessions(ListSessionsReq req, AsyncMethodCallback resultHandler836) throws TException { checkReady(); - listSessions_call method_call = new listSessions_call(req, resultHandler835, this, ___protocolFactory, ___transport); + listSessions_call method_call = new listSessions_call(req, resultHandler836, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listSessions_call extends TAsyncMethodCall { private ListSessionsReq req; - public listSessions_call(ListSessionsReq req, AsyncMethodCallback resultHandler836, TAsyncClient client832, TProtocolFactory protocolFactory833, TNonblockingTransport transport834) throws TException { - super(client832, protocolFactory833, transport834, resultHandler836, false); + public listSessions_call(ListSessionsReq req, AsyncMethodCallback resultHandler837, TAsyncClient client833, TProtocolFactory protocolFactory834, TNonblockingTransport transport835) throws TException { + super(client833, protocolFactory834, transport835, resultHandler837, false); this.req = req; } @@ -7101,17 +7150,17 @@ public ListSessionsResp getResult() throws TException { } } - public void getSession(GetSessionReq req, AsyncMethodCallback resultHandler840) throws TException { + public void getSession(GetSessionReq req, AsyncMethodCallback resultHandler841) throws TException { checkReady(); - getSession_call method_call = new getSession_call(req, resultHandler840, this, ___protocolFactory, ___transport); + getSession_call method_call = new getSession_call(req, resultHandler841, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getSession_call extends TAsyncMethodCall { private GetSessionReq req; - public getSession_call(GetSessionReq req, AsyncMethodCallback resultHandler841, TAsyncClient client837, TProtocolFactory protocolFactory838, TNonblockingTransport transport839) throws TException { - super(client837, protocolFactory838, transport839, resultHandler841, false); + public getSession_call(GetSessionReq req, AsyncMethodCallback resultHandler842, TAsyncClient client838, TProtocolFactory protocolFactory839, TNonblockingTransport transport840) throws TException { + super(client838, protocolFactory839, transport840, resultHandler842, false); this.req = req; } @@ -7133,17 +7182,17 @@ public GetSessionResp getResult() throws TException { } } - public void removeSession(RemoveSessionReq req, AsyncMethodCallback resultHandler845) throws TException { + public void removeSession(RemoveSessionReq req, AsyncMethodCallback resultHandler846) throws TException { checkReady(); - removeSession_call method_call = new removeSession_call(req, resultHandler845, this, ___protocolFactory, ___transport); + removeSession_call method_call = new removeSession_call(req, resultHandler846, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class removeSession_call extends TAsyncMethodCall { private RemoveSessionReq req; - public removeSession_call(RemoveSessionReq req, AsyncMethodCallback resultHandler846, TAsyncClient client842, TProtocolFactory protocolFactory843, TNonblockingTransport transport844) throws TException { - super(client842, protocolFactory843, transport844, resultHandler846, false); + public removeSession_call(RemoveSessionReq req, AsyncMethodCallback resultHandler847, TAsyncClient client843, TProtocolFactory protocolFactory844, TNonblockingTransport transport845) throws TException { + super(client843, protocolFactory844, transport845, resultHandler847, false); this.req = req; } @@ -7165,17 +7214,17 @@ public ExecResp getResult() throws TException { } } - public void killQuery(KillQueryReq req, AsyncMethodCallback resultHandler850) throws TException { + public void killQuery(KillQueryReq req, AsyncMethodCallback resultHandler851) throws TException { checkReady(); - killQuery_call method_call = new killQuery_call(req, resultHandler850, this, ___protocolFactory, ___transport); + killQuery_call method_call = new killQuery_call(req, resultHandler851, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class killQuery_call extends TAsyncMethodCall { private KillQueryReq req; - public killQuery_call(KillQueryReq req, AsyncMethodCallback resultHandler851, TAsyncClient client847, TProtocolFactory protocolFactory848, TNonblockingTransport transport849) throws TException { - super(client847, protocolFactory848, transport849, resultHandler851, false); + public killQuery_call(KillQueryReq req, AsyncMethodCallback resultHandler852, TAsyncClient client848, TProtocolFactory protocolFactory849, TNonblockingTransport transport850) throws TException { + super(client848, protocolFactory849, transport850, resultHandler852, false); this.req = req; } @@ -7197,17 +7246,17 @@ public ExecResp getResult() throws TException { } } - public void reportTaskFinish(ReportTaskReq req, AsyncMethodCallback resultHandler855) throws TException { + public void reportTaskFinish(ReportTaskReq req, AsyncMethodCallback resultHandler856) throws TException { checkReady(); - reportTaskFinish_call method_call = new reportTaskFinish_call(req, resultHandler855, this, ___protocolFactory, ___transport); + reportTaskFinish_call method_call = new reportTaskFinish_call(req, resultHandler856, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class reportTaskFinish_call extends TAsyncMethodCall { private ReportTaskReq req; - public reportTaskFinish_call(ReportTaskReq req, AsyncMethodCallback resultHandler856, TAsyncClient client852, TProtocolFactory protocolFactory853, TNonblockingTransport transport854) throws TException { - super(client852, protocolFactory853, transport854, resultHandler856, false); + public reportTaskFinish_call(ReportTaskReq req, AsyncMethodCallback resultHandler857, TAsyncClient client853, TProtocolFactory protocolFactory854, TNonblockingTransport transport855) throws TException { + super(client853, protocolFactory854, transport855, resultHandler857, false); this.req = req; } @@ -7229,17 +7278,17 @@ public ExecResp getResult() throws TException { } } - public void listCluster(ListClusterInfoReq req, AsyncMethodCallback resultHandler860) throws TException { + public void listCluster(ListClusterInfoReq req, AsyncMethodCallback resultHandler861) throws TException { checkReady(); - listCluster_call method_call = new listCluster_call(req, resultHandler860, this, ___protocolFactory, ___transport); + listCluster_call method_call = new listCluster_call(req, resultHandler861, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listCluster_call extends TAsyncMethodCall { private ListClusterInfoReq req; - public listCluster_call(ListClusterInfoReq req, AsyncMethodCallback resultHandler861, TAsyncClient client857, TProtocolFactory protocolFactory858, TNonblockingTransport transport859) throws TException { - super(client857, protocolFactory858, transport859, resultHandler861, false); + public listCluster_call(ListClusterInfoReq req, AsyncMethodCallback resultHandler862, TAsyncClient client858, TProtocolFactory protocolFactory859, TNonblockingTransport transport860) throws TException { + super(client858, protocolFactory859, transport860, resultHandler862, false); this.req = req; } @@ -7261,17 +7310,17 @@ public ListClusterInfoResp getResult() throws TException { } } - public void getMetaDirInfo(GetMetaDirInfoReq req, AsyncMethodCallback resultHandler865) throws TException { + public void getMetaDirInfo(GetMetaDirInfoReq req, AsyncMethodCallback resultHandler866) throws TException { checkReady(); - getMetaDirInfo_call method_call = new getMetaDirInfo_call(req, resultHandler865, this, ___protocolFactory, ___transport); + getMetaDirInfo_call method_call = new getMetaDirInfo_call(req, resultHandler866, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getMetaDirInfo_call extends TAsyncMethodCall { private GetMetaDirInfoReq req; - public getMetaDirInfo_call(GetMetaDirInfoReq req, AsyncMethodCallback resultHandler866, TAsyncClient client862, TProtocolFactory protocolFactory863, TNonblockingTransport transport864) throws TException { - super(client862, protocolFactory863, transport864, resultHandler866, false); + public getMetaDirInfo_call(GetMetaDirInfoReq req, AsyncMethodCallback resultHandler867, TAsyncClient client863, TProtocolFactory protocolFactory864, TNonblockingTransport transport865) throws TException { + super(client863, protocolFactory864, transport865, resultHandler867, false); this.req = req; } @@ -7293,6 +7342,38 @@ public GetMetaDirInfoResp getResult() throws TException { } } + public void verifyClientVersion(VerifyClientVersionReq req, AsyncMethodCallback resultHandler871) throws TException { + checkReady(); + verifyClientVersion_call method_call = new verifyClientVersion_call(req, resultHandler871, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class verifyClientVersion_call extends TAsyncMethodCall { + private VerifyClientVersionReq req; + public verifyClientVersion_call(VerifyClientVersionReq req, AsyncMethodCallback resultHandler872, TAsyncClient client868, TProtocolFactory protocolFactory869, TNonblockingTransport transport870) throws TException { + super(client868, protocolFactory869, transport870, resultHandler872, false); + this.req = req; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("verifyClientVersion", TMessageType.CALL, 0)); + verifyClientVersion_args args = new verifyClientVersion_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public VerifyClientVersionResp getResult() throws TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = super.client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_verifyClientVersion(); + } + } + } public static class Processor implements TProcessor { @@ -7390,6 +7471,7 @@ public Processor(Iface iface) processMap_.put("reportTaskFinish", new reportTaskFinish()); processMap_.put("listCluster", new listCluster()); processMap_.put("getMetaDirInfo", new getMetaDirInfo()); + processMap_.put("verifyClientVersion", new verifyClientVersion()); } protected static interface ProcessFunction { @@ -9291,6 +9373,27 @@ public void process(int seqid, TProtocol iprot, TProtocol oprot, TConnectionCont } + private class verifyClientVersion implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot, TConnectionContext server_ctx) throws TException + { + Object handler_ctx = event_handler_.getContext("MetaService.verifyClientVersion", server_ctx); + verifyClientVersion_args args = new verifyClientVersion_args(); + event_handler_.preRead(handler_ctx, "MetaService.verifyClientVersion"); + args.read(iprot); + iprot.readMessageEnd(); + event_handler_.postRead(handler_ctx, "MetaService.verifyClientVersion", args); + verifyClientVersion_result result = new verifyClientVersion_result(); + result.success = iface_.verifyClientVersion(args.req); + event_handler_.preWrite(handler_ctx, "MetaService.verifyClientVersion", result); + oprot.writeMessageBegin(new TMessage("verifyClientVersion", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + event_handler_.postWrite(handler_ctx, "MetaService.verifyClientVersion", result); + } + + } + } public static class createSpace_args implements TBase, java.io.Serializable, Cloneable, Comparable { @@ -47801,4 +47904,439 @@ public void validate() throws TException { } + public static class verifyClientVersion_args implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("verifyClientVersion_args"); + private static final TField REQ_FIELD_DESC = new TField("req", TType.STRUCT, (short)1); + + public VerifyClientVersionReq req; + public static final int REQ = 1; + + // isset id assignments + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(REQ, new FieldMetaData("req", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, VerifyClientVersionReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(verifyClientVersion_args.class, metaDataMap); + } + + public verifyClientVersion_args() { + } + + public verifyClientVersion_args( + VerifyClientVersionReq req) { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public verifyClientVersion_args(verifyClientVersion_args other) { + if (other.isSetReq()) { + this.req = TBaseHelper.deepCopy(other.req); + } + } + + public verifyClientVersion_args deepCopy() { + return new verifyClientVersion_args(this); + } + + public VerifyClientVersionReq getReq() { + return this.req; + } + + public verifyClientVersion_args setReq(VerifyClientVersionReq req) { + this.req = req; + return this; + } + + public void unsetReq() { + this.req = null; + } + + // Returns true if field req is set (has been assigned a value) and false otherwise + public boolean isSetReq() { + return this.req != null; + } + + public void setReqIsSet(boolean __value) { + if (!__value) { + this.req = null; + } + } + + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case REQ: + if (__value == null) { + unsetReq(); + } else { + setReq((VerifyClientVersionReq)__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case REQ: + return getReq(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof verifyClientVersion_args)) + return false; + verifyClientVersion_args that = (verifyClientVersion_args)_that; + + if (!TBaseHelper.equalsNobinary(this.isSetReq(), that.isSetReq(), this.req, that.req)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {req}); + } + + @Override + public int compareTo(verifyClientVersion_args other) { + if (other == null) { + // See java.lang.Comparable docs + throw new NullPointerException(); + } + + if (other == this) { + return 0; + } + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case REQ: + if (__field.type == TType.STRUCT) { + this.req = new VerifyClientVersionReq(); + this.req.read(iprot); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.req != null) { + oprot.writeFieldBegin(REQ_FIELD_DESC); + this.req.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("verifyClientVersion_args"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("req"); + sb.append(space); + sb.append(":").append(space); + if (this.getReq() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getReq(), indent + 1, prettyPrint)); + } + first = false; + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + + public static class verifyClientVersion_result implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("verifyClientVersion_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); + + public VerifyClientVersionResp success; + public static final int SUCCESS = 0; + + // isset id assignments + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, VerifyClientVersionResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(verifyClientVersion_result.class, metaDataMap); + } + + public verifyClientVersion_result() { + } + + public verifyClientVersion_result( + VerifyClientVersionResp success) { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public verifyClientVersion_result(verifyClientVersion_result other) { + if (other.isSetSuccess()) { + this.success = TBaseHelper.deepCopy(other.success); + } + } + + public verifyClientVersion_result deepCopy() { + return new verifyClientVersion_result(this); + } + + public VerifyClientVersionResp getSuccess() { + return this.success; + } + + public verifyClientVersion_result setSuccess(VerifyClientVersionResp success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been assigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean __value) { + if (!__value) { + this.success = null; + } + } + + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case SUCCESS: + if (__value == null) { + unsetSuccess(); + } else { + setSuccess((VerifyClientVersionResp)__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof verifyClientVersion_result)) + return false; + verifyClientVersion_result that = (verifyClientVersion_result)_that; + + if (!TBaseHelper.equalsNobinary(this.isSetSuccess(), that.isSetSuccess(), this.success, that.success)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {success}); + } + + @Override + public int compareTo(verifyClientVersion_result other) { + if (other == null) { + // See java.lang.Comparable docs + throw new NullPointerException(); + } + + if (other == this) { + return 0; + } + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case SUCCESS: + if (__field.type == TType.STRUCT) { + this.success = new VerifyClientVersionResp(); + this.success.read(iprot); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + this.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("verifyClientVersion_result"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("success"); + sb.append(space); + sb.append(":").append(space); + if (this.getSuccess() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getSuccess(), indent + 1, prettyPrint)); + } + first = false; + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + } diff --git a/client/src/main/generated/com/vesoft/nebula/meta/PropertyType.java b/client/src/main/generated/com/vesoft/nebula/meta/PropertyType.java index 52262fbe4..fc77cc24b 100644 --- a/client/src/main/generated/com/vesoft/nebula/meta/PropertyType.java +++ b/client/src/main/generated/com/vesoft/nebula/meta/PropertyType.java @@ -27,7 +27,8 @@ public enum PropertyType implements com.facebook.thrift.TEnum { TIMESTAMP(21), DATE(24), DATETIME(25), - TIME(26); + TIME(26), + GEOGRAPHY(31); private final int value; @@ -78,6 +79,8 @@ public static PropertyType findByValue(int value) { return DATETIME; case 26: return TIME; + case 31: + return GEOGRAPHY; default: return null; } diff --git a/client/src/main/generated/com/vesoft/nebula/meta/VerifyClientVersionReq.java b/client/src/main/generated/com/vesoft/nebula/meta/VerifyClientVersionReq.java new file mode 100644 index 000000000..384c0e95c --- /dev/null +++ b/client/src/main/generated/com/vesoft/nebula/meta/VerifyClientVersionReq.java @@ -0,0 +1,275 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.vesoft.nebula.meta; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import java.util.BitSet; +import java.util.Arrays; +import com.facebook.thrift.*; +import com.facebook.thrift.annotations.*; +import com.facebook.thrift.async.*; +import com.facebook.thrift.meta_data.*; +import com.facebook.thrift.server.*; +import com.facebook.thrift.transport.*; +import com.facebook.thrift.protocol.*; + +@SuppressWarnings({ "unused", "serial" }) +public class VerifyClientVersionReq implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("VerifyClientVersionReq"); + private static final TField VERSION_FIELD_DESC = new TField("version", TType.STRING, (short)1); + + public byte[] version; + public static final int VERSION = 1; + + // isset id assignments + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(VERSION, new FieldMetaData("version", TFieldRequirementType.REQUIRED, + new FieldValueMetaData(TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(VerifyClientVersionReq.class, metaDataMap); + } + + public VerifyClientVersionReq() { + this.version = "2.6.0".getBytes(); + + } + + public VerifyClientVersionReq( + byte[] version) { + this(); + this.version = version; + } + + public static class Builder { + private byte[] version; + + public Builder() { + } + + public Builder setVersion(final byte[] version) { + this.version = version; + return this; + } + + public VerifyClientVersionReq build() { + VerifyClientVersionReq result = new VerifyClientVersionReq(); + result.setVersion(this.version); + return result; + } + } + + public static Builder builder() { + return new Builder(); + } + + /** + * Performs a deep copy on other. + */ + public VerifyClientVersionReq(VerifyClientVersionReq other) { + if (other.isSetVersion()) { + this.version = TBaseHelper.deepCopy(other.version); + } + } + + public VerifyClientVersionReq deepCopy() { + return new VerifyClientVersionReq(this); + } + + public byte[] getVersion() { + return this.version; + } + + public VerifyClientVersionReq setVersion(byte[] version) { + this.version = version; + return this; + } + + public void unsetVersion() { + this.version = null; + } + + // Returns true if field version is set (has been assigned a value) and false otherwise + public boolean isSetVersion() { + return this.version != null; + } + + public void setVersionIsSet(boolean __value) { + if (!__value) { + this.version = null; + } + } + + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case VERSION: + if (__value == null) { + unsetVersion(); + } else { + setVersion((byte[])__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case VERSION: + return getVersion(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof VerifyClientVersionReq)) + return false; + VerifyClientVersionReq that = (VerifyClientVersionReq)_that; + + if (!TBaseHelper.equalsSlow(this.isSetVersion(), that.isSetVersion(), this.version, that.version)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {version}); + } + + @Override + public int compareTo(VerifyClientVersionReq other) { + if (other == null) { + // See java.lang.Comparable docs + throw new NullPointerException(); + } + + if (other == this) { + return 0; + } + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(version, other.version); + if (lastComparison != 0) { + return lastComparison; + } + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case VERSION: + if (__field.type == TType.STRING) { + this.version = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.version != null) { + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeBinary(this.version); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("VerifyClientVersionReq"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("version"); + sb.append(space); + sb.append(":").append(space); + if (this.getVersion() == null) { + sb.append("null"); + } else { + int __version_size = Math.min(this.getVersion().length, 128); + for (int i = 0; i < __version_size; i++) { + if (i != 0) sb.append(" "); + sb.append(Integer.toHexString(this.getVersion()[i]).length() > 1 ? Integer.toHexString(this.getVersion()[i]).substring(Integer.toHexString(this.getVersion()[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.getVersion()[i]).toUpperCase()); + } + if (this.getVersion().length > 128) sb.append(" ..."); + } + first = false; + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + if (version == null) { + throw new TProtocolException(TProtocolException.MISSING_REQUIRED_FIELD, "Required field 'version' was not present! Struct: " + toString()); + } + } + +} + diff --git a/client/src/main/generated/com/vesoft/nebula/meta/VerifyClientVersionResp.java b/client/src/main/generated/com/vesoft/nebula/meta/VerifyClientVersionResp.java new file mode 100644 index 000000000..aec55d70f --- /dev/null +++ b/client/src/main/generated/com/vesoft/nebula/meta/VerifyClientVersionResp.java @@ -0,0 +1,474 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.vesoft.nebula.meta; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import java.util.BitSet; +import java.util.Arrays; +import com.facebook.thrift.*; +import com.facebook.thrift.annotations.*; +import com.facebook.thrift.async.*; +import com.facebook.thrift.meta_data.*; +import com.facebook.thrift.server.*; +import com.facebook.thrift.transport.*; +import com.facebook.thrift.protocol.*; + +@SuppressWarnings({ "unused", "serial" }) +public class VerifyClientVersionResp implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("VerifyClientVersionResp"); + private static final TField CODE_FIELD_DESC = new TField("code", TType.I32, (short)1); + private static final TField LEADER_FIELD_DESC = new TField("leader", TType.STRUCT, (short)2); + private static final TField ERROR_MSG_FIELD_DESC = new TField("error_msg", TType.STRING, (short)3); + + /** + * + * @see com.vesoft.nebula.ErrorCode + */ + public com.vesoft.nebula.ErrorCode code; + public com.vesoft.nebula.HostAddr leader; + public byte[] error_msg; + public static final int CODE = 1; + public static final int LEADER = 2; + public static final int ERROR_MSG = 3; + + // isset id assignments + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(CODE, new FieldMetaData("code", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + tmpMetaDataMap.put(LEADER, new FieldMetaData("leader", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, com.vesoft.nebula.HostAddr.class))); + tmpMetaDataMap.put(ERROR_MSG, new FieldMetaData("error_msg", TFieldRequirementType.OPTIONAL, + new FieldValueMetaData(TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(VerifyClientVersionResp.class, metaDataMap); + } + + public VerifyClientVersionResp() { + } + + public VerifyClientVersionResp( + com.vesoft.nebula.ErrorCode code, + com.vesoft.nebula.HostAddr leader) { + this(); + this.code = code; + this.leader = leader; + } + + public VerifyClientVersionResp( + com.vesoft.nebula.ErrorCode code, + com.vesoft.nebula.HostAddr leader, + byte[] error_msg) { + this(); + this.code = code; + this.leader = leader; + this.error_msg = error_msg; + } + + public static class Builder { + private com.vesoft.nebula.ErrorCode code; + private com.vesoft.nebula.HostAddr leader; + private byte[] error_msg; + + public Builder() { + } + + public Builder setCode(final com.vesoft.nebula.ErrorCode code) { + this.code = code; + return this; + } + + public Builder setLeader(final com.vesoft.nebula.HostAddr leader) { + this.leader = leader; + return this; + } + + public Builder setError_msg(final byte[] error_msg) { + this.error_msg = error_msg; + return this; + } + + public VerifyClientVersionResp build() { + VerifyClientVersionResp result = new VerifyClientVersionResp(); + result.setCode(this.code); + result.setLeader(this.leader); + result.setError_msg(this.error_msg); + return result; + } + } + + public static Builder builder() { + return new Builder(); + } + + /** + * Performs a deep copy on other. + */ + public VerifyClientVersionResp(VerifyClientVersionResp other) { + if (other.isSetCode()) { + this.code = TBaseHelper.deepCopy(other.code); + } + if (other.isSetLeader()) { + this.leader = TBaseHelper.deepCopy(other.leader); + } + if (other.isSetError_msg()) { + this.error_msg = TBaseHelper.deepCopy(other.error_msg); + } + } + + public VerifyClientVersionResp deepCopy() { + return new VerifyClientVersionResp(this); + } + + /** + * + * @see com.vesoft.nebula.ErrorCode + */ + public com.vesoft.nebula.ErrorCode getCode() { + return this.code; + } + + /** + * + * @see com.vesoft.nebula.ErrorCode + */ + public VerifyClientVersionResp setCode(com.vesoft.nebula.ErrorCode code) { + this.code = code; + return this; + } + + public void unsetCode() { + this.code = null; + } + + // Returns true if field code is set (has been assigned a value) and false otherwise + public boolean isSetCode() { + return this.code != null; + } + + public void setCodeIsSet(boolean __value) { + if (!__value) { + this.code = null; + } + } + + public com.vesoft.nebula.HostAddr getLeader() { + return this.leader; + } + + public VerifyClientVersionResp setLeader(com.vesoft.nebula.HostAddr leader) { + this.leader = leader; + return this; + } + + public void unsetLeader() { + this.leader = null; + } + + // Returns true if field leader is set (has been assigned a value) and false otherwise + public boolean isSetLeader() { + return this.leader != null; + } + + public void setLeaderIsSet(boolean __value) { + if (!__value) { + this.leader = null; + } + } + + public byte[] getError_msg() { + return this.error_msg; + } + + public VerifyClientVersionResp setError_msg(byte[] error_msg) { + this.error_msg = error_msg; + return this; + } + + public void unsetError_msg() { + this.error_msg = null; + } + + // Returns true if field error_msg is set (has been assigned a value) and false otherwise + public boolean isSetError_msg() { + return this.error_msg != null; + } + + public void setError_msgIsSet(boolean __value) { + if (!__value) { + this.error_msg = null; + } + } + + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case CODE: + if (__value == null) { + unsetCode(); + } else { + setCode((com.vesoft.nebula.ErrorCode)__value); + } + break; + + case LEADER: + if (__value == null) { + unsetLeader(); + } else { + setLeader((com.vesoft.nebula.HostAddr)__value); + } + break; + + case ERROR_MSG: + if (__value == null) { + unsetError_msg(); + } else { + setError_msg((byte[])__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case CODE: + return getCode(); + + case LEADER: + return getLeader(); + + case ERROR_MSG: + return getError_msg(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof VerifyClientVersionResp)) + return false; + VerifyClientVersionResp that = (VerifyClientVersionResp)_that; + + if (!TBaseHelper.equalsNobinary(this.isSetCode(), that.isSetCode(), this.code, that.code)) { return false; } + + if (!TBaseHelper.equalsNobinary(this.isSetLeader(), that.isSetLeader(), this.leader, that.leader)) { return false; } + + if (!TBaseHelper.equalsSlow(this.isSetError_msg(), that.isSetError_msg(), this.error_msg, that.error_msg)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {code, leader, error_msg}); + } + + @Override + public int compareTo(VerifyClientVersionResp other) { + if (other == null) { + // See java.lang.Comparable docs + throw new NullPointerException(); + } + + if (other == this) { + return 0; + } + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetCode()).compareTo(other.isSetCode()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(code, other.code); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = Boolean.valueOf(isSetLeader()).compareTo(other.isSetLeader()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(leader, other.leader); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = Boolean.valueOf(isSetError_msg()).compareTo(other.isSetError_msg()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(error_msg, other.error_msg); + if (lastComparison != 0) { + return lastComparison; + } + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case CODE: + if (__field.type == TType.I32) { + this.code = com.vesoft.nebula.ErrorCode.findByValue(iprot.readI32()); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case LEADER: + if (__field.type == TType.STRUCT) { + this.leader = new com.vesoft.nebula.HostAddr(); + this.leader.read(iprot); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case ERROR_MSG: + if (__field.type == TType.STRING) { + this.error_msg = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.code != null) { + oprot.writeFieldBegin(CODE_FIELD_DESC); + oprot.writeI32(this.code == null ? 0 : this.code.getValue()); + oprot.writeFieldEnd(); + } + if (this.leader != null) { + oprot.writeFieldBegin(LEADER_FIELD_DESC); + this.leader.write(oprot); + oprot.writeFieldEnd(); + } + if (this.error_msg != null) { + if (isSetError_msg()) { + oprot.writeFieldBegin(ERROR_MSG_FIELD_DESC); + oprot.writeBinary(this.error_msg); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("VerifyClientVersionResp"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("code"); + sb.append(space); + sb.append(":").append(space); + if (this.getCode() == null) { + sb.append("null"); + } else { + String code_name = this.getCode() == null ? "null" : this.getCode().name(); + if (code_name != null) { + sb.append(code_name); + sb.append(" ("); + } + sb.append(this.getCode()); + if (code_name != null) { + sb.append(")"); + } + } + first = false; + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("leader"); + sb.append(space); + sb.append(":").append(space); + if (this.getLeader() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getLeader(), indent + 1, prettyPrint)); + } + first = false; + if (isSetError_msg()) + { + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("error_msg"); + sb.append(space); + sb.append(":").append(space); + if (this.getError_msg() == null) { + sb.append("null"); + } else { + int __error_msg_size = Math.min(this.getError_msg().length, 128); + for (int i = 0; i < __error_msg_size; i++) { + if (i != 0) sb.append(" "); + sb.append(Integer.toHexString(this.getError_msg()[i]).length() > 1 ? Integer.toHexString(this.getError_msg()[i]).substring(Integer.toHexString(this.getError_msg()[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.getError_msg()[i]).toUpperCase()); + } + if (this.getError_msg().length > 128) sb.append(" ..."); + } + first = false; + } + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + +} + diff --git a/client/src/main/generated/com/vesoft/nebula/storage/ChainAddEdgesRequest.java b/client/src/main/generated/com/vesoft/nebula/storage/ChainAddEdgesRequest.java new file mode 100644 index 000000000..60e78656c --- /dev/null +++ b/client/src/main/generated/com/vesoft/nebula/storage/ChainAddEdgesRequest.java @@ -0,0 +1,705 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.vesoft.nebula.storage; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import java.util.BitSet; +import java.util.Arrays; +import com.facebook.thrift.*; +import com.facebook.thrift.annotations.*; +import com.facebook.thrift.async.*; +import com.facebook.thrift.meta_data.*; +import com.facebook.thrift.server.*; +import com.facebook.thrift.transport.*; +import com.facebook.thrift.protocol.*; + +@SuppressWarnings({ "unused", "serial" }) +public class ChainAddEdgesRequest implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("ChainAddEdgesRequest"); + private static final TField SPACE_ID_FIELD_DESC = new TField("space_id", TType.I32, (short)1); + private static final TField PARTS_FIELD_DESC = new TField("parts", TType.MAP, (short)2); + private static final TField PROP_NAMES_FIELD_DESC = new TField("prop_names", TType.LIST, (short)3); + private static final TField IF_NOT_EXISTS_FIELD_DESC = new TField("if_not_exists", TType.BOOL, (short)4); + private static final TField TERM_FIELD_DESC = new TField("term", TType.I64, (short)5); + private static final TField EDGE_VERSION_FIELD_DESC = new TField("edge_version", TType.I64, (short)6); + + public int space_id; + public Map> parts; + public List prop_names; + public boolean if_not_exists; + public long term; + public long edge_version; + public static final int SPACE_ID = 1; + public static final int PARTS = 2; + public static final int PROP_NAMES = 3; + public static final int IF_NOT_EXISTS = 4; + public static final int TERM = 5; + public static final int EDGE_VERSION = 6; + + // isset id assignments + private static final int __SPACE_ID_ISSET_ID = 0; + private static final int __IF_NOT_EXISTS_ISSET_ID = 1; + private static final int __TERM_ISSET_ID = 2; + private static final int __EDGE_VERSION_ISSET_ID = 3; + private BitSet __isset_bit_vector = new BitSet(4); + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(SPACE_ID, new FieldMetaData("space_id", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + tmpMetaDataMap.put(PARTS, new FieldMetaData("parts", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.I32), + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, NewEdge.class))))); + tmpMetaDataMap.put(PROP_NAMES, new FieldMetaData("prop_names", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + tmpMetaDataMap.put(IF_NOT_EXISTS, new FieldMetaData("if_not_exists", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + tmpMetaDataMap.put(TERM, new FieldMetaData("term", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I64))); + tmpMetaDataMap.put(EDGE_VERSION, new FieldMetaData("edge_version", TFieldRequirementType.OPTIONAL, + new FieldValueMetaData(TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(ChainAddEdgesRequest.class, metaDataMap); + } + + public ChainAddEdgesRequest() { + } + + public ChainAddEdgesRequest( + int space_id, + Map> parts, + List prop_names, + boolean if_not_exists, + long term) { + this(); + this.space_id = space_id; + setSpace_idIsSet(true); + this.parts = parts; + this.prop_names = prop_names; + this.if_not_exists = if_not_exists; + setIf_not_existsIsSet(true); + this.term = term; + setTermIsSet(true); + } + + public ChainAddEdgesRequest( + int space_id, + Map> parts, + List prop_names, + boolean if_not_exists, + long term, + long edge_version) { + this(); + this.space_id = space_id; + setSpace_idIsSet(true); + this.parts = parts; + this.prop_names = prop_names; + this.if_not_exists = if_not_exists; + setIf_not_existsIsSet(true); + this.term = term; + setTermIsSet(true); + this.edge_version = edge_version; + setEdge_versionIsSet(true); + } + + public static class Builder { + private int space_id; + private Map> parts; + private List prop_names; + private boolean if_not_exists; + private long term; + private long edge_version; + + BitSet __optional_isset = new BitSet(4); + + public Builder() { + } + + public Builder setSpace_id(final int space_id) { + this.space_id = space_id; + __optional_isset.set(__SPACE_ID_ISSET_ID, true); + return this; + } + + public Builder setParts(final Map> parts) { + this.parts = parts; + return this; + } + + public Builder setProp_names(final List prop_names) { + this.prop_names = prop_names; + return this; + } + + public Builder setIf_not_exists(final boolean if_not_exists) { + this.if_not_exists = if_not_exists; + __optional_isset.set(__IF_NOT_EXISTS_ISSET_ID, true); + return this; + } + + public Builder setTerm(final long term) { + this.term = term; + __optional_isset.set(__TERM_ISSET_ID, true); + return this; + } + + public Builder setEdge_version(final long edge_version) { + this.edge_version = edge_version; + __optional_isset.set(__EDGE_VERSION_ISSET_ID, true); + return this; + } + + public ChainAddEdgesRequest build() { + ChainAddEdgesRequest result = new ChainAddEdgesRequest(); + if (__optional_isset.get(__SPACE_ID_ISSET_ID)) { + result.setSpace_id(this.space_id); + } + result.setParts(this.parts); + result.setProp_names(this.prop_names); + if (__optional_isset.get(__IF_NOT_EXISTS_ISSET_ID)) { + result.setIf_not_exists(this.if_not_exists); + } + if (__optional_isset.get(__TERM_ISSET_ID)) { + result.setTerm(this.term); + } + if (__optional_isset.get(__EDGE_VERSION_ISSET_ID)) { + result.setEdge_version(this.edge_version); + } + return result; + } + } + + public static Builder builder() { + return new Builder(); + } + + /** + * Performs a deep copy on other. + */ + public ChainAddEdgesRequest(ChainAddEdgesRequest other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + this.space_id = TBaseHelper.deepCopy(other.space_id); + if (other.isSetParts()) { + this.parts = TBaseHelper.deepCopy(other.parts); + } + if (other.isSetProp_names()) { + this.prop_names = TBaseHelper.deepCopy(other.prop_names); + } + this.if_not_exists = TBaseHelper.deepCopy(other.if_not_exists); + this.term = TBaseHelper.deepCopy(other.term); + this.edge_version = TBaseHelper.deepCopy(other.edge_version); + } + + public ChainAddEdgesRequest deepCopy() { + return new ChainAddEdgesRequest(this); + } + + public int getSpace_id() { + return this.space_id; + } + + public ChainAddEdgesRequest setSpace_id(int space_id) { + this.space_id = space_id; + setSpace_idIsSet(true); + return this; + } + + public void unsetSpace_id() { + __isset_bit_vector.clear(__SPACE_ID_ISSET_ID); + } + + // Returns true if field space_id is set (has been assigned a value) and false otherwise + public boolean isSetSpace_id() { + return __isset_bit_vector.get(__SPACE_ID_ISSET_ID); + } + + public void setSpace_idIsSet(boolean __value) { + __isset_bit_vector.set(__SPACE_ID_ISSET_ID, __value); + } + + public Map> getParts() { + return this.parts; + } + + public ChainAddEdgesRequest setParts(Map> parts) { + this.parts = parts; + return this; + } + + public void unsetParts() { + this.parts = null; + } + + // Returns true if field parts is set (has been assigned a value) and false otherwise + public boolean isSetParts() { + return this.parts != null; + } + + public void setPartsIsSet(boolean __value) { + if (!__value) { + this.parts = null; + } + } + + public List getProp_names() { + return this.prop_names; + } + + public ChainAddEdgesRequest setProp_names(List prop_names) { + this.prop_names = prop_names; + return this; + } + + public void unsetProp_names() { + this.prop_names = null; + } + + // Returns true if field prop_names is set (has been assigned a value) and false otherwise + public boolean isSetProp_names() { + return this.prop_names != null; + } + + public void setProp_namesIsSet(boolean __value) { + if (!__value) { + this.prop_names = null; + } + } + + public boolean isIf_not_exists() { + return this.if_not_exists; + } + + public ChainAddEdgesRequest setIf_not_exists(boolean if_not_exists) { + this.if_not_exists = if_not_exists; + setIf_not_existsIsSet(true); + return this; + } + + public void unsetIf_not_exists() { + __isset_bit_vector.clear(__IF_NOT_EXISTS_ISSET_ID); + } + + // Returns true if field if_not_exists is set (has been assigned a value) and false otherwise + public boolean isSetIf_not_exists() { + return __isset_bit_vector.get(__IF_NOT_EXISTS_ISSET_ID); + } + + public void setIf_not_existsIsSet(boolean __value) { + __isset_bit_vector.set(__IF_NOT_EXISTS_ISSET_ID, __value); + } + + public long getTerm() { + return this.term; + } + + public ChainAddEdgesRequest setTerm(long term) { + this.term = term; + setTermIsSet(true); + return this; + } + + public void unsetTerm() { + __isset_bit_vector.clear(__TERM_ISSET_ID); + } + + // Returns true if field term is set (has been assigned a value) and false otherwise + public boolean isSetTerm() { + return __isset_bit_vector.get(__TERM_ISSET_ID); + } + + public void setTermIsSet(boolean __value) { + __isset_bit_vector.set(__TERM_ISSET_ID, __value); + } + + public long getEdge_version() { + return this.edge_version; + } + + public ChainAddEdgesRequest setEdge_version(long edge_version) { + this.edge_version = edge_version; + setEdge_versionIsSet(true); + return this; + } + + public void unsetEdge_version() { + __isset_bit_vector.clear(__EDGE_VERSION_ISSET_ID); + } + + // Returns true if field edge_version is set (has been assigned a value) and false otherwise + public boolean isSetEdge_version() { + return __isset_bit_vector.get(__EDGE_VERSION_ISSET_ID); + } + + public void setEdge_versionIsSet(boolean __value) { + __isset_bit_vector.set(__EDGE_VERSION_ISSET_ID, __value); + } + + @SuppressWarnings("unchecked") + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case SPACE_ID: + if (__value == null) { + unsetSpace_id(); + } else { + setSpace_id((Integer)__value); + } + break; + + case PARTS: + if (__value == null) { + unsetParts(); + } else { + setParts((Map>)__value); + } + break; + + case PROP_NAMES: + if (__value == null) { + unsetProp_names(); + } else { + setProp_names((List)__value); + } + break; + + case IF_NOT_EXISTS: + if (__value == null) { + unsetIf_not_exists(); + } else { + setIf_not_exists((Boolean)__value); + } + break; + + case TERM: + if (__value == null) { + unsetTerm(); + } else { + setTerm((Long)__value); + } + break; + + case EDGE_VERSION: + if (__value == null) { + unsetEdge_version(); + } else { + setEdge_version((Long)__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SPACE_ID: + return new Integer(getSpace_id()); + + case PARTS: + return getParts(); + + case PROP_NAMES: + return getProp_names(); + + case IF_NOT_EXISTS: + return new Boolean(isIf_not_exists()); + + case TERM: + return new Long(getTerm()); + + case EDGE_VERSION: + return new Long(getEdge_version()); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof ChainAddEdgesRequest)) + return false; + ChainAddEdgesRequest that = (ChainAddEdgesRequest)_that; + + if (!TBaseHelper.equalsNobinary(this.space_id, that.space_id)) { return false; } + + if (!TBaseHelper.equalsNobinary(this.isSetParts(), that.isSetParts(), this.parts, that.parts)) { return false; } + + if (!TBaseHelper.equalsSlow(this.isSetProp_names(), that.isSetProp_names(), this.prop_names, that.prop_names)) { return false; } + + if (!TBaseHelper.equalsNobinary(this.if_not_exists, that.if_not_exists)) { return false; } + + if (!TBaseHelper.equalsNobinary(this.term, that.term)) { return false; } + + if (!TBaseHelper.equalsNobinary(this.isSetEdge_version(), that.isSetEdge_version(), this.edge_version, that.edge_version)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {space_id, parts, prop_names, if_not_exists, term, edge_version}); + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case SPACE_ID: + if (__field.type == TType.I32) { + this.space_id = iprot.readI32(); + setSpace_idIsSet(true); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case PARTS: + if (__field.type == TType.MAP) { + { + TMap _map268 = iprot.readMapBegin(); + this.parts = new HashMap>(Math.max(0, 2*_map268.size)); + for (int _i269 = 0; + (_map268.size < 0) ? iprot.peekMap() : (_i269 < _map268.size); + ++_i269) + { + int _key270; + List _val271; + _key270 = iprot.readI32(); + { + TList _list272 = iprot.readListBegin(); + _val271 = new ArrayList(Math.max(0, _list272.size)); + for (int _i273 = 0; + (_list272.size < 0) ? iprot.peekList() : (_i273 < _list272.size); + ++_i273) + { + NewEdge _elem274; + _elem274 = new NewEdge(); + _elem274.read(iprot); + _val271.add(_elem274); + } + iprot.readListEnd(); + } + this.parts.put(_key270, _val271); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case PROP_NAMES: + if (__field.type == TType.LIST) { + { + TList _list275 = iprot.readListBegin(); + this.prop_names = new ArrayList(Math.max(0, _list275.size)); + for (int _i276 = 0; + (_list275.size < 0) ? iprot.peekList() : (_i276 < _list275.size); + ++_i276) + { + byte[] _elem277; + _elem277 = iprot.readBinary(); + this.prop_names.add(_elem277); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case IF_NOT_EXISTS: + if (__field.type == TType.BOOL) { + this.if_not_exists = iprot.readBool(); + setIf_not_existsIsSet(true); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case TERM: + if (__field.type == TType.I64) { + this.term = iprot.readI64(); + setTermIsSet(true); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case EDGE_VERSION: + if (__field.type == TType.I64) { + this.edge_version = iprot.readI64(); + setEdge_versionIsSet(true); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(SPACE_ID_FIELD_DESC); + oprot.writeI32(this.space_id); + oprot.writeFieldEnd(); + if (this.parts != null) { + oprot.writeFieldBegin(PARTS_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.I32, TType.LIST, this.parts.size())); + for (Map.Entry> _iter278 : this.parts.entrySet()) { + oprot.writeI32(_iter278.getKey()); + { + oprot.writeListBegin(new TList(TType.STRUCT, _iter278.getValue().size())); + for (NewEdge _iter279 : _iter278.getValue()) { + _iter279.write(oprot); + } + oprot.writeListEnd(); + } + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (this.prop_names != null) { + oprot.writeFieldBegin(PROP_NAMES_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.prop_names.size())); + for (byte[] _iter280 : this.prop_names) { + oprot.writeBinary(_iter280); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(IF_NOT_EXISTS_FIELD_DESC); + oprot.writeBool(this.if_not_exists); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(TERM_FIELD_DESC); + oprot.writeI64(this.term); + oprot.writeFieldEnd(); + if (isSetEdge_version()) { + oprot.writeFieldBegin(EDGE_VERSION_FIELD_DESC); + oprot.writeI64(this.edge_version); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("ChainAddEdgesRequest"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("space_id"); + sb.append(space); + sb.append(":").append(space); + sb.append(TBaseHelper.toString(this.getSpace_id(), indent + 1, prettyPrint)); + first = false; + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("parts"); + sb.append(space); + sb.append(":").append(space); + if (this.getParts() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getParts(), indent + 1, prettyPrint)); + } + first = false; + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("prop_names"); + sb.append(space); + sb.append(":").append(space); + if (this.getProp_names() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getProp_names(), indent + 1, prettyPrint)); + } + first = false; + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("if_not_exists"); + sb.append(space); + sb.append(":").append(space); + sb.append(TBaseHelper.toString(this.isIf_not_exists(), indent + 1, prettyPrint)); + first = false; + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("term"); + sb.append(space); + sb.append(":").append(space); + sb.append(TBaseHelper.toString(this.getTerm(), indent + 1, prettyPrint)); + first = false; + if (isSetEdge_version()) + { + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("edge_version"); + sb.append(space); + sb.append(":").append(space); + sb.append(TBaseHelper.toString(this.getEdge_version(), indent + 1, prettyPrint)); + first = false; + } + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + +} + diff --git a/client/src/main/generated/com/vesoft/nebula/storage/ChainUpdateEdgeRequest.java b/client/src/main/generated/com/vesoft/nebula/storage/ChainUpdateEdgeRequest.java new file mode 100644 index 000000000..ef8fad589 --- /dev/null +++ b/client/src/main/generated/com/vesoft/nebula/storage/ChainUpdateEdgeRequest.java @@ -0,0 +1,595 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.vesoft.nebula.storage; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import java.util.BitSet; +import java.util.Arrays; +import com.facebook.thrift.*; +import com.facebook.thrift.annotations.*; +import com.facebook.thrift.async.*; +import com.facebook.thrift.meta_data.*; +import com.facebook.thrift.server.*; +import com.facebook.thrift.transport.*; +import com.facebook.thrift.protocol.*; + +@SuppressWarnings({ "unused", "serial" }) +public class ChainUpdateEdgeRequest implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("ChainUpdateEdgeRequest"); + private static final TField UPDATE_EDGE_REQUEST_FIELD_DESC = new TField("update_edge_request", TType.STRUCT, (short)1); + private static final TField TERM_FIELD_DESC = new TField("term", TType.I64, (short)2); + private static final TField EDGE_VERSION_FIELD_DESC = new TField("edge_version", TType.I64, (short)3); + private static final TField SPACE_ID_FIELD_DESC = new TField("space_id", TType.I32, (short)4); + private static final TField PARTS_FIELD_DESC = new TField("parts", TType.LIST, (short)5); + + public UpdateEdgeRequest update_edge_request; + public long term; + public long edge_version; + public int space_id; + public List parts; + public static final int UPDATE_EDGE_REQUEST = 1; + public static final int TERM = 2; + public static final int EDGE_VERSION = 3; + public static final int SPACE_ID = 4; + public static final int PARTS = 5; + + // isset id assignments + private static final int __TERM_ISSET_ID = 0; + private static final int __EDGE_VERSION_ISSET_ID = 1; + private static final int __SPACE_ID_ISSET_ID = 2; + private BitSet __isset_bit_vector = new BitSet(3); + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(UPDATE_EDGE_REQUEST, new FieldMetaData("update_edge_request", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, UpdateEdgeRequest.class))); + tmpMetaDataMap.put(TERM, new FieldMetaData("term", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I64))); + tmpMetaDataMap.put(EDGE_VERSION, new FieldMetaData("edge_version", TFieldRequirementType.OPTIONAL, + new FieldValueMetaData(TType.I64))); + tmpMetaDataMap.put(SPACE_ID, new FieldMetaData("space_id", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + tmpMetaDataMap.put(PARTS, new FieldMetaData("parts", TFieldRequirementType.REQUIRED, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.I32)))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(ChainUpdateEdgeRequest.class, metaDataMap); + } + + public ChainUpdateEdgeRequest() { + } + + public ChainUpdateEdgeRequest( + List parts) { + this(); + this.parts = parts; + } + + public ChainUpdateEdgeRequest( + UpdateEdgeRequest update_edge_request, + long term, + int space_id, + List parts) { + this(); + this.update_edge_request = update_edge_request; + this.term = term; + setTermIsSet(true); + this.space_id = space_id; + setSpace_idIsSet(true); + this.parts = parts; + } + + public ChainUpdateEdgeRequest( + UpdateEdgeRequest update_edge_request, + long term, + long edge_version, + int space_id, + List parts) { + this(); + this.update_edge_request = update_edge_request; + this.term = term; + setTermIsSet(true); + this.edge_version = edge_version; + setEdge_versionIsSet(true); + this.space_id = space_id; + setSpace_idIsSet(true); + this.parts = parts; + } + + public static class Builder { + private UpdateEdgeRequest update_edge_request; + private long term; + private long edge_version; + private int space_id; + private List parts; + + BitSet __optional_isset = new BitSet(3); + + public Builder() { + } + + public Builder setUpdate_edge_request(final UpdateEdgeRequest update_edge_request) { + this.update_edge_request = update_edge_request; + return this; + } + + public Builder setTerm(final long term) { + this.term = term; + __optional_isset.set(__TERM_ISSET_ID, true); + return this; + } + + public Builder setEdge_version(final long edge_version) { + this.edge_version = edge_version; + __optional_isset.set(__EDGE_VERSION_ISSET_ID, true); + return this; + } + + public Builder setSpace_id(final int space_id) { + this.space_id = space_id; + __optional_isset.set(__SPACE_ID_ISSET_ID, true); + return this; + } + + public Builder setParts(final List parts) { + this.parts = parts; + return this; + } + + public ChainUpdateEdgeRequest build() { + ChainUpdateEdgeRequest result = new ChainUpdateEdgeRequest(); + result.setUpdate_edge_request(this.update_edge_request); + if (__optional_isset.get(__TERM_ISSET_ID)) { + result.setTerm(this.term); + } + if (__optional_isset.get(__EDGE_VERSION_ISSET_ID)) { + result.setEdge_version(this.edge_version); + } + if (__optional_isset.get(__SPACE_ID_ISSET_ID)) { + result.setSpace_id(this.space_id); + } + result.setParts(this.parts); + return result; + } + } + + public static Builder builder() { + return new Builder(); + } + + /** + * Performs a deep copy on other. + */ + public ChainUpdateEdgeRequest(ChainUpdateEdgeRequest other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.isSetUpdate_edge_request()) { + this.update_edge_request = TBaseHelper.deepCopy(other.update_edge_request); + } + this.term = TBaseHelper.deepCopy(other.term); + this.edge_version = TBaseHelper.deepCopy(other.edge_version); + this.space_id = TBaseHelper.deepCopy(other.space_id); + if (other.isSetParts()) { + this.parts = TBaseHelper.deepCopy(other.parts); + } + } + + public ChainUpdateEdgeRequest deepCopy() { + return new ChainUpdateEdgeRequest(this); + } + + public UpdateEdgeRequest getUpdate_edge_request() { + return this.update_edge_request; + } + + public ChainUpdateEdgeRequest setUpdate_edge_request(UpdateEdgeRequest update_edge_request) { + this.update_edge_request = update_edge_request; + return this; + } + + public void unsetUpdate_edge_request() { + this.update_edge_request = null; + } + + // Returns true if field update_edge_request is set (has been assigned a value) and false otherwise + public boolean isSetUpdate_edge_request() { + return this.update_edge_request != null; + } + + public void setUpdate_edge_requestIsSet(boolean __value) { + if (!__value) { + this.update_edge_request = null; + } + } + + public long getTerm() { + return this.term; + } + + public ChainUpdateEdgeRequest setTerm(long term) { + this.term = term; + setTermIsSet(true); + return this; + } + + public void unsetTerm() { + __isset_bit_vector.clear(__TERM_ISSET_ID); + } + + // Returns true if field term is set (has been assigned a value) and false otherwise + public boolean isSetTerm() { + return __isset_bit_vector.get(__TERM_ISSET_ID); + } + + public void setTermIsSet(boolean __value) { + __isset_bit_vector.set(__TERM_ISSET_ID, __value); + } + + public long getEdge_version() { + return this.edge_version; + } + + public ChainUpdateEdgeRequest setEdge_version(long edge_version) { + this.edge_version = edge_version; + setEdge_versionIsSet(true); + return this; + } + + public void unsetEdge_version() { + __isset_bit_vector.clear(__EDGE_VERSION_ISSET_ID); + } + + // Returns true if field edge_version is set (has been assigned a value) and false otherwise + public boolean isSetEdge_version() { + return __isset_bit_vector.get(__EDGE_VERSION_ISSET_ID); + } + + public void setEdge_versionIsSet(boolean __value) { + __isset_bit_vector.set(__EDGE_VERSION_ISSET_ID, __value); + } + + public int getSpace_id() { + return this.space_id; + } + + public ChainUpdateEdgeRequest setSpace_id(int space_id) { + this.space_id = space_id; + setSpace_idIsSet(true); + return this; + } + + public void unsetSpace_id() { + __isset_bit_vector.clear(__SPACE_ID_ISSET_ID); + } + + // Returns true if field space_id is set (has been assigned a value) and false otherwise + public boolean isSetSpace_id() { + return __isset_bit_vector.get(__SPACE_ID_ISSET_ID); + } + + public void setSpace_idIsSet(boolean __value) { + __isset_bit_vector.set(__SPACE_ID_ISSET_ID, __value); + } + + public List getParts() { + return this.parts; + } + + public ChainUpdateEdgeRequest setParts(List parts) { + this.parts = parts; + return this; + } + + public void unsetParts() { + this.parts = null; + } + + // Returns true if field parts is set (has been assigned a value) and false otherwise + public boolean isSetParts() { + return this.parts != null; + } + + public void setPartsIsSet(boolean __value) { + if (!__value) { + this.parts = null; + } + } + + @SuppressWarnings("unchecked") + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case UPDATE_EDGE_REQUEST: + if (__value == null) { + unsetUpdate_edge_request(); + } else { + setUpdate_edge_request((UpdateEdgeRequest)__value); + } + break; + + case TERM: + if (__value == null) { + unsetTerm(); + } else { + setTerm((Long)__value); + } + break; + + case EDGE_VERSION: + if (__value == null) { + unsetEdge_version(); + } else { + setEdge_version((Long)__value); + } + break; + + case SPACE_ID: + if (__value == null) { + unsetSpace_id(); + } else { + setSpace_id((Integer)__value); + } + break; + + case PARTS: + if (__value == null) { + unsetParts(); + } else { + setParts((List)__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case UPDATE_EDGE_REQUEST: + return getUpdate_edge_request(); + + case TERM: + return new Long(getTerm()); + + case EDGE_VERSION: + return new Long(getEdge_version()); + + case SPACE_ID: + return new Integer(getSpace_id()); + + case PARTS: + return getParts(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof ChainUpdateEdgeRequest)) + return false; + ChainUpdateEdgeRequest that = (ChainUpdateEdgeRequest)_that; + + if (!TBaseHelper.equalsNobinary(this.isSetUpdate_edge_request(), that.isSetUpdate_edge_request(), this.update_edge_request, that.update_edge_request)) { return false; } + + if (!TBaseHelper.equalsNobinary(this.term, that.term)) { return false; } + + if (!TBaseHelper.equalsNobinary(this.isSetEdge_version(), that.isSetEdge_version(), this.edge_version, that.edge_version)) { return false; } + + if (!TBaseHelper.equalsNobinary(this.space_id, that.space_id)) { return false; } + + if (!TBaseHelper.equalsNobinary(this.isSetParts(), that.isSetParts(), this.parts, that.parts)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {update_edge_request, term, edge_version, space_id, parts}); + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case UPDATE_EDGE_REQUEST: + if (__field.type == TType.STRUCT) { + this.update_edge_request = new UpdateEdgeRequest(); + this.update_edge_request.read(iprot); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case TERM: + if (__field.type == TType.I64) { + this.term = iprot.readI64(); + setTermIsSet(true); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case EDGE_VERSION: + if (__field.type == TType.I64) { + this.edge_version = iprot.readI64(); + setEdge_versionIsSet(true); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case SPACE_ID: + if (__field.type == TType.I32) { + this.space_id = iprot.readI32(); + setSpace_idIsSet(true); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case PARTS: + if (__field.type == TType.LIST) { + { + TList _list281 = iprot.readListBegin(); + this.parts = new ArrayList(Math.max(0, _list281.size)); + for (int _i282 = 0; + (_list281.size < 0) ? iprot.peekList() : (_i282 < _list281.size); + ++_i282) + { + int _elem283; + _elem283 = iprot.readI32(); + this.parts.add(_elem283); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.update_edge_request != null) { + oprot.writeFieldBegin(UPDATE_EDGE_REQUEST_FIELD_DESC); + this.update_edge_request.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TERM_FIELD_DESC); + oprot.writeI64(this.term); + oprot.writeFieldEnd(); + if (isSetEdge_version()) { + oprot.writeFieldBegin(EDGE_VERSION_FIELD_DESC); + oprot.writeI64(this.edge_version); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(SPACE_ID_FIELD_DESC); + oprot.writeI32(this.space_id); + oprot.writeFieldEnd(); + if (this.parts != null) { + oprot.writeFieldBegin(PARTS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.I32, this.parts.size())); + for (int _iter284 : this.parts) { + oprot.writeI32(_iter284); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("ChainUpdateEdgeRequest"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("update_edge_request"); + sb.append(space); + sb.append(":").append(space); + if (this.getUpdate_edge_request() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getUpdate_edge_request(), indent + 1, prettyPrint)); + } + first = false; + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("term"); + sb.append(space); + sb.append(":").append(space); + sb.append(TBaseHelper.toString(this.getTerm(), indent + 1, prettyPrint)); + first = false; + if (isSetEdge_version()) + { + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("edge_version"); + sb.append(space); + sb.append(":").append(space); + sb.append(TBaseHelper.toString(this.getEdge_version(), indent + 1, prettyPrint)); + first = false; + } + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("space_id"); + sb.append(space); + sb.append(":").append(space); + sb.append(TBaseHelper.toString(this.getSpace_id(), indent + 1, prettyPrint)); + first = false; + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("parts"); + sb.append(space); + sb.append(":").append(space); + if (this.getParts() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getParts(), indent + 1, prettyPrint)); + } + first = false; + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + if (parts == null) { + throw new TProtocolException(TProtocolException.MISSING_REQUIRED_FIELD, "Required field 'parts' was not present! Struct: " + toString()); + } + } + +} + diff --git a/client/src/main/generated/com/vesoft/nebula/storage/GeneralStorageService.java b/client/src/main/generated/com/vesoft/nebula/storage/GeneralStorageService.java index faea62896..351d4458e 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/GeneralStorageService.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/GeneralStorageService.java @@ -231,17 +231,17 @@ public AsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager clientM super(protocolFactory, clientManager, transport); } - public void get(KVGetRequest req, AsyncMethodCallback resultHandler454) throws TException { + public void get(KVGetRequest req, AsyncMethodCallback resultHandler483) throws TException { checkReady(); - get_call method_call = new get_call(req, resultHandler454, this, ___protocolFactory, ___transport); + get_call method_call = new get_call(req, resultHandler483, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class get_call extends TAsyncMethodCall { private KVGetRequest req; - public get_call(KVGetRequest req, AsyncMethodCallback resultHandler455, TAsyncClient client451, TProtocolFactory protocolFactory452, TNonblockingTransport transport453) throws TException { - super(client451, protocolFactory452, transport453, resultHandler455, false); + public get_call(KVGetRequest req, AsyncMethodCallback resultHandler484, TAsyncClient client480, TProtocolFactory protocolFactory481, TNonblockingTransport transport482) throws TException { + super(client480, protocolFactory481, transport482, resultHandler484, false); this.req = req; } @@ -263,17 +263,17 @@ public KVGetResponse getResult() throws TException { } } - public void put(KVPutRequest req, AsyncMethodCallback resultHandler459) throws TException { + public void put(KVPutRequest req, AsyncMethodCallback resultHandler488) throws TException { checkReady(); - put_call method_call = new put_call(req, resultHandler459, this, ___protocolFactory, ___transport); + put_call method_call = new put_call(req, resultHandler488, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class put_call extends TAsyncMethodCall { private KVPutRequest req; - public put_call(KVPutRequest req, AsyncMethodCallback resultHandler460, TAsyncClient client456, TProtocolFactory protocolFactory457, TNonblockingTransport transport458) throws TException { - super(client456, protocolFactory457, transport458, resultHandler460, false); + public put_call(KVPutRequest req, AsyncMethodCallback resultHandler489, TAsyncClient client485, TProtocolFactory protocolFactory486, TNonblockingTransport transport487) throws TException { + super(client485, protocolFactory486, transport487, resultHandler489, false); this.req = req; } @@ -295,17 +295,17 @@ public ExecResponse getResult() throws TException { } } - public void remove(KVRemoveRequest req, AsyncMethodCallback resultHandler464) throws TException { + public void remove(KVRemoveRequest req, AsyncMethodCallback resultHandler493) throws TException { checkReady(); - remove_call method_call = new remove_call(req, resultHandler464, this, ___protocolFactory, ___transport); + remove_call method_call = new remove_call(req, resultHandler493, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class remove_call extends TAsyncMethodCall { private KVRemoveRequest req; - public remove_call(KVRemoveRequest req, AsyncMethodCallback resultHandler465, TAsyncClient client461, TProtocolFactory protocolFactory462, TNonblockingTransport transport463) throws TException { - super(client461, protocolFactory462, transport463, resultHandler465, false); + public remove_call(KVRemoveRequest req, AsyncMethodCallback resultHandler494, TAsyncClient client490, TProtocolFactory protocolFactory491, TNonblockingTransport transport492) throws TException { + super(client490, protocolFactory491, transport492, resultHandler494, false); this.req = req; } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/GetValueRequest.java b/client/src/main/generated/com/vesoft/nebula/storage/GetValueRequest.java deleted file mode 100644 index 4712c0e7f..000000000 --- a/client/src/main/generated/com/vesoft/nebula/storage/GetValueRequest.java +++ /dev/null @@ -1,439 +0,0 @@ -/** - * Autogenerated by Thrift - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.vesoft.nebula.storage; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.Set; -import java.util.HashSet; -import java.util.Collections; -import java.util.BitSet; -import java.util.Arrays; -import com.facebook.thrift.*; -import com.facebook.thrift.annotations.*; -import com.facebook.thrift.async.*; -import com.facebook.thrift.meta_data.*; -import com.facebook.thrift.server.*; -import com.facebook.thrift.transport.*; -import com.facebook.thrift.protocol.*; - -@SuppressWarnings({ "unused", "serial" }) -public class GetValueRequest implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("GetValueRequest"); - private static final TField SPACE_ID_FIELD_DESC = new TField("space_id", TType.I32, (short)1); - private static final TField PART_ID_FIELD_DESC = new TField("part_id", TType.I32, (short)2); - private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)3); - - public int space_id; - public int part_id; - public byte[] key; - public static final int SPACE_ID = 1; - public static final int PART_ID = 2; - public static final int KEY = 3; - - // isset id assignments - private static final int __SPACE_ID_ISSET_ID = 0; - private static final int __PART_ID_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - - public static final Map metaDataMap; - - static { - Map tmpMetaDataMap = new HashMap(); - tmpMetaDataMap.put(SPACE_ID, new FieldMetaData("space_id", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - tmpMetaDataMap.put(PART_ID, new FieldMetaData("part_id", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - tmpMetaDataMap.put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); - } - - static { - FieldMetaData.addStructMetaDataMap(GetValueRequest.class, metaDataMap); - } - - public GetValueRequest() { - } - - public GetValueRequest( - int space_id, - int part_id, - byte[] key) { - this(); - this.space_id = space_id; - setSpace_idIsSet(true); - this.part_id = part_id; - setPart_idIsSet(true); - this.key = key; - } - - public static class Builder { - private int space_id; - private int part_id; - private byte[] key; - - BitSet __optional_isset = new BitSet(2); - - public Builder() { - } - - public Builder setSpace_id(final int space_id) { - this.space_id = space_id; - __optional_isset.set(__SPACE_ID_ISSET_ID, true); - return this; - } - - public Builder setPart_id(final int part_id) { - this.part_id = part_id; - __optional_isset.set(__PART_ID_ISSET_ID, true); - return this; - } - - public Builder setKey(final byte[] key) { - this.key = key; - return this; - } - - public GetValueRequest build() { - GetValueRequest result = new GetValueRequest(); - if (__optional_isset.get(__SPACE_ID_ISSET_ID)) { - result.setSpace_id(this.space_id); - } - if (__optional_isset.get(__PART_ID_ISSET_ID)) { - result.setPart_id(this.part_id); - } - result.setKey(this.key); - return result; - } - } - - public static Builder builder() { - return new Builder(); - } - - /** - * Performs a deep copy on other. - */ - public GetValueRequest(GetValueRequest other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.space_id = TBaseHelper.deepCopy(other.space_id); - this.part_id = TBaseHelper.deepCopy(other.part_id); - if (other.isSetKey()) { - this.key = TBaseHelper.deepCopy(other.key); - } - } - - public GetValueRequest deepCopy() { - return new GetValueRequest(this); - } - - public int getSpace_id() { - return this.space_id; - } - - public GetValueRequest setSpace_id(int space_id) { - this.space_id = space_id; - setSpace_idIsSet(true); - return this; - } - - public void unsetSpace_id() { - __isset_bit_vector.clear(__SPACE_ID_ISSET_ID); - } - - // Returns true if field space_id is set (has been assigned a value) and false otherwise - public boolean isSetSpace_id() { - return __isset_bit_vector.get(__SPACE_ID_ISSET_ID); - } - - public void setSpace_idIsSet(boolean __value) { - __isset_bit_vector.set(__SPACE_ID_ISSET_ID, __value); - } - - public int getPart_id() { - return this.part_id; - } - - public GetValueRequest setPart_id(int part_id) { - this.part_id = part_id; - setPart_idIsSet(true); - return this; - } - - public void unsetPart_id() { - __isset_bit_vector.clear(__PART_ID_ISSET_ID); - } - - // Returns true if field part_id is set (has been assigned a value) and false otherwise - public boolean isSetPart_id() { - return __isset_bit_vector.get(__PART_ID_ISSET_ID); - } - - public void setPart_idIsSet(boolean __value) { - __isset_bit_vector.set(__PART_ID_ISSET_ID, __value); - } - - public byte[] getKey() { - return this.key; - } - - public GetValueRequest setKey(byte[] key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - // Returns true if field key is set (has been assigned a value) and false otherwise - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean __value) { - if (!__value) { - this.key = null; - } - } - - public void setFieldValue(int fieldID, Object __value) { - switch (fieldID) { - case SPACE_ID: - if (__value == null) { - unsetSpace_id(); - } else { - setSpace_id((Integer)__value); - } - break; - - case PART_ID: - if (__value == null) { - unsetPart_id(); - } else { - setPart_id((Integer)__value); - } - break; - - case KEY: - if (__value == null) { - unsetKey(); - } else { - setKey((byte[])__value); - } - break; - - default: - throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); - } - } - - public Object getFieldValue(int fieldID) { - switch (fieldID) { - case SPACE_ID: - return new Integer(getSpace_id()); - - case PART_ID: - return new Integer(getPart_id()); - - case KEY: - return getKey(); - - default: - throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); - } - } - - @Override - public boolean equals(Object _that) { - if (_that == null) - return false; - if (this == _that) - return true; - if (!(_that instanceof GetValueRequest)) - return false; - GetValueRequest that = (GetValueRequest)_that; - - if (!TBaseHelper.equalsNobinary(this.space_id, that.space_id)) { return false; } - - if (!TBaseHelper.equalsNobinary(this.part_id, that.part_id)) { return false; } - - if (!TBaseHelper.equalsSlow(this.isSetKey(), that.isSetKey(), this.key, that.key)) { return false; } - - return true; - } - - @Override - public int hashCode() { - return Arrays.deepHashCode(new Object[] {space_id, part_id, key}); - } - - @Override - public int compareTo(GetValueRequest other) { - if (other == null) { - // See java.lang.Comparable docs - throw new NullPointerException(); - } - - if (other == this) { - return 0; - } - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSpace_id()).compareTo(other.isSetSpace_id()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(space_id, other.space_id); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = Boolean.valueOf(isSetPart_id()).compareTo(other.isSetPart_id()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(part_id, other.part_id); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = Boolean.valueOf(isSetKey()).compareTo(other.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(key, other.key); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField __field; - iprot.readStructBegin(metaDataMap); - while (true) - { - __field = iprot.readFieldBegin(); - if (__field.type == TType.STOP) { - break; - } - switch (__field.id) - { - case SPACE_ID: - if (__field.type == TType.I32) { - this.space_id = iprot.readI32(); - setSpace_idIsSet(true); - } else { - TProtocolUtil.skip(iprot, __field.type); - } - break; - case PART_ID: - if (__field.type == TType.I32) { - this.part_id = iprot.readI32(); - setPart_idIsSet(true); - } else { - TProtocolUtil.skip(iprot, __field.type); - } - break; - case KEY: - if (__field.type == TType.STRING) { - this.key = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, __field.type); - } - break; - default: - TProtocolUtil.skip(iprot, __field.type); - break; - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(SPACE_ID_FIELD_DESC); - oprot.writeI32(this.space_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PART_ID_FIELD_DESC); - oprot.writeI32(this.part_id); - oprot.writeFieldEnd(); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeBinary(this.key); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - return toString(1, true); - } - - @Override - public String toString(int indent, boolean prettyPrint) { - String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; - String newLine = prettyPrint ? "\n" : ""; - String space = prettyPrint ? " " : ""; - StringBuilder sb = new StringBuilder("GetValueRequest"); - sb.append(space); - sb.append("("); - sb.append(newLine); - boolean first = true; - - sb.append(indentStr); - sb.append("space_id"); - sb.append(space); - sb.append(":").append(space); - sb.append(TBaseHelper.toString(this.getSpace_id(), indent + 1, prettyPrint)); - first = false; - if (!first) sb.append("," + newLine); - sb.append(indentStr); - sb.append("part_id"); - sb.append(space); - sb.append(":").append(space); - sb.append(TBaseHelper.toString(this.getPart_id(), indent + 1, prettyPrint)); - first = false; - if (!first) sb.append("," + newLine); - sb.append(indentStr); - sb.append("key"); - sb.append(space); - sb.append(":").append(space); - if (this.getKey() == null) { - sb.append("null"); - } else { - int __key_size = Math.min(this.getKey().length, 128); - for (int i = 0; i < __key_size; i++) { - if (i != 0) sb.append(" "); - sb.append(Integer.toHexString(this.getKey()[i]).length() > 1 ? Integer.toHexString(this.getKey()[i]).substring(Integer.toHexString(this.getKey()[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.getKey()[i]).toUpperCase()); - } - if (this.getKey().length > 128) sb.append(" ..."); - } - first = false; - sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - -} - diff --git a/client/src/main/generated/com/vesoft/nebula/storage/GetValueResponse.java b/client/src/main/generated/com/vesoft/nebula/storage/GetValueResponse.java deleted file mode 100644 index 8a0b704b8..000000000 --- a/client/src/main/generated/com/vesoft/nebula/storage/GetValueResponse.java +++ /dev/null @@ -1,365 +0,0 @@ -/** - * Autogenerated by Thrift - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package com.vesoft.nebula.storage; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.Set; -import java.util.HashSet; -import java.util.Collections; -import java.util.BitSet; -import java.util.Arrays; -import com.facebook.thrift.*; -import com.facebook.thrift.annotations.*; -import com.facebook.thrift.async.*; -import com.facebook.thrift.meta_data.*; -import com.facebook.thrift.server.*; -import com.facebook.thrift.transport.*; -import com.facebook.thrift.protocol.*; - -@SuppressWarnings({ "unused", "serial" }) -public class GetValueResponse implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("GetValueResponse"); - private static final TField RESULT_FIELD_DESC = new TField("result", TType.STRUCT, (short)1); - private static final TField VALUE_FIELD_DESC = new TField("value", TType.STRING, (short)2); - - public ResponseCommon result; - public byte[] value; - public static final int RESULT = 1; - public static final int VALUE = 2; - - // isset id assignments - - public static final Map metaDataMap; - - static { - Map tmpMetaDataMap = new HashMap(); - tmpMetaDataMap.put(RESULT, new FieldMetaData("result", TFieldRequirementType.REQUIRED, - new StructMetaData(TType.STRUCT, ResponseCommon.class))); - tmpMetaDataMap.put(VALUE, new FieldMetaData("value", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); - } - - static { - FieldMetaData.addStructMetaDataMap(GetValueResponse.class, metaDataMap); - } - - public GetValueResponse() { - } - - public GetValueResponse( - ResponseCommon result) { - this(); - this.result = result; - } - - public GetValueResponse( - ResponseCommon result, - byte[] value) { - this(); - this.result = result; - this.value = value; - } - - public static class Builder { - private ResponseCommon result; - private byte[] value; - - public Builder() { - } - - public Builder setResult(final ResponseCommon result) { - this.result = result; - return this; - } - - public Builder setValue(final byte[] value) { - this.value = value; - return this; - } - - public GetValueResponse build() { - GetValueResponse result = new GetValueResponse(); - result.setResult(this.result); - result.setValue(this.value); - return result; - } - } - - public static Builder builder() { - return new Builder(); - } - - /** - * Performs a deep copy on other. - */ - public GetValueResponse(GetValueResponse other) { - if (other.isSetResult()) { - this.result = TBaseHelper.deepCopy(other.result); - } - if (other.isSetValue()) { - this.value = TBaseHelper.deepCopy(other.value); - } - } - - public GetValueResponse deepCopy() { - return new GetValueResponse(this); - } - - public ResponseCommon getResult() { - return this.result; - } - - public GetValueResponse setResult(ResponseCommon result) { - this.result = result; - return this; - } - - public void unsetResult() { - this.result = null; - } - - // Returns true if field result is set (has been assigned a value) and false otherwise - public boolean isSetResult() { - return this.result != null; - } - - public void setResultIsSet(boolean __value) { - if (!__value) { - this.result = null; - } - } - - public byte[] getValue() { - return this.value; - } - - public GetValueResponse setValue(byte[] value) { - this.value = value; - return this; - } - - public void unsetValue() { - this.value = null; - } - - // Returns true if field value is set (has been assigned a value) and false otherwise - public boolean isSetValue() { - return this.value != null; - } - - public void setValueIsSet(boolean __value) { - if (!__value) { - this.value = null; - } - } - - public void setFieldValue(int fieldID, Object __value) { - switch (fieldID) { - case RESULT: - if (__value == null) { - unsetResult(); - } else { - setResult((ResponseCommon)__value); - } - break; - - case VALUE: - if (__value == null) { - unsetValue(); - } else { - setValue((byte[])__value); - } - break; - - default: - throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); - } - } - - public Object getFieldValue(int fieldID) { - switch (fieldID) { - case RESULT: - return getResult(); - - case VALUE: - return getValue(); - - default: - throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); - } - } - - @Override - public boolean equals(Object _that) { - if (_that == null) - return false; - if (this == _that) - return true; - if (!(_that instanceof GetValueResponse)) - return false; - GetValueResponse that = (GetValueResponse)_that; - - if (!TBaseHelper.equalsNobinary(this.isSetResult(), that.isSetResult(), this.result, that.result)) { return false; } - - if (!TBaseHelper.equalsSlow(this.isSetValue(), that.isSetValue(), this.value, that.value)) { return false; } - - return true; - } - - @Override - public int hashCode() { - return Arrays.deepHashCode(new Object[] {result, value}); - } - - @Override - public int compareTo(GetValueResponse other) { - if (other == null) { - // See java.lang.Comparable docs - throw new NullPointerException(); - } - - if (other == this) { - return 0; - } - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetResult()).compareTo(other.isSetResult()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(result, other.result); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField __field; - iprot.readStructBegin(metaDataMap); - while (true) - { - __field = iprot.readFieldBegin(); - if (__field.type == TType.STOP) { - break; - } - switch (__field.id) - { - case RESULT: - if (__field.type == TType.STRUCT) { - this.result = new ResponseCommon(); - this.result.read(iprot); - } else { - TProtocolUtil.skip(iprot, __field.type); - } - break; - case VALUE: - if (__field.type == TType.STRING) { - this.value = iprot.readBinary(); - } else { - TProtocolUtil.skip(iprot, __field.type); - } - break; - default: - TProtocolUtil.skip(iprot, __field.type); - break; - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.result != null) { - oprot.writeFieldBegin(RESULT_FIELD_DESC); - this.result.write(oprot); - oprot.writeFieldEnd(); - } - if (this.value != null) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeBinary(this.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - return toString(1, true); - } - - @Override - public String toString(int indent, boolean prettyPrint) { - String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; - String newLine = prettyPrint ? "\n" : ""; - String space = prettyPrint ? " " : ""; - StringBuilder sb = new StringBuilder("GetValueResponse"); - sb.append(space); - sb.append("("); - sb.append(newLine); - boolean first = true; - - sb.append(indentStr); - sb.append("result"); - sb.append(space); - sb.append(":").append(space); - if (this.getResult() == null) { - sb.append("null"); - } else { - sb.append(TBaseHelper.toString(this.getResult(), indent + 1, prettyPrint)); - } - first = false; - if (!first) sb.append("," + newLine); - sb.append(indentStr); - sb.append("value"); - sb.append(space); - sb.append(":").append(space); - if (this.getValue() == null) { - sb.append("null"); - } else { - int __value_size = Math.min(this.getValue().length, 128); - for (int i = 0; i < __value_size; i++) { - if (i != 0) sb.append(" "); - sb.append(Integer.toHexString(this.getValue()[i]).length() > 1 ? Integer.toHexString(this.getValue()[i]).substring(Integer.toHexString(this.getValue()[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.getValue()[i]).toUpperCase()); - } - if (this.getValue().length > 128) sb.append(" ..."); - } - first = false; - sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - if (result == null) { - throw new TProtocolException(TProtocolException.MISSING_REQUIRED_FIELD, "Required field 'result' was not present! Struct: " + toString()); - } - } - -} - diff --git a/client/src/main/generated/com/vesoft/nebula/storage/GraphStorageService.java b/client/src/main/generated/com/vesoft/nebula/storage/GraphStorageService.java index 844249043..99ea338d6 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/GraphStorageService.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/GraphStorageService.java @@ -59,7 +59,9 @@ public interface Iface { public GetNeighborsResponse lookupAndTraverse(LookupAndTraverseRequest req) throws TException; - public ExecResponse addEdgesAtomic(AddEdgesRequest req) throws TException; + public UpdateResponse chainUpdateEdge(UpdateEdgeRequest req) throws TException; + + public ExecResponse chainAddEdges(AddEdgesRequest req) throws TException; } @@ -93,7 +95,9 @@ public interface AsyncIface { public void lookupAndTraverse(LookupAndTraverseRequest req, AsyncMethodCallback resultHandler) throws TException; - public void addEdgesAtomic(AddEdgesRequest req, AsyncMethodCallback resultHandler) throws TException; + public void chainUpdateEdge(UpdateEdgeRequest req, AsyncMethodCallback resultHandler) throws TException; + + public void chainAddEdges(AddEdgesRequest req, AsyncMethodCallback resultHandler) throws TException; } @@ -756,49 +760,94 @@ public GetNeighborsResponse recv_lookupAndTraverse() throws TException throw new TApplicationException(TApplicationException.MISSING_RESULT, "lookupAndTraverse failed: unknown result"); } - public ExecResponse addEdgesAtomic(AddEdgesRequest req) throws TException + public UpdateResponse chainUpdateEdge(UpdateEdgeRequest req) throws TException { - ContextStack ctx = getContextStack("GraphStorageService.addEdgesAtomic", null); + ContextStack ctx = getContextStack("GraphStorageService.chainUpdateEdge", null); this.setContextStack(ctx); - send_addEdgesAtomic(req); - return recv_addEdgesAtomic(); + send_chainUpdateEdge(req); + return recv_chainUpdateEdge(); } - public void send_addEdgesAtomic(AddEdgesRequest req) throws TException + public void send_chainUpdateEdge(UpdateEdgeRequest req) throws TException { ContextStack ctx = this.getContextStack(); - super.preWrite(ctx, "GraphStorageService.addEdgesAtomic", null); - oprot_.writeMessageBegin(new TMessage("addEdgesAtomic", TMessageType.CALL, seqid_)); - addEdgesAtomic_args args = new addEdgesAtomic_args(); + super.preWrite(ctx, "GraphStorageService.chainUpdateEdge", null); + oprot_.writeMessageBegin(new TMessage("chainUpdateEdge", TMessageType.CALL, seqid_)); + chainUpdateEdge_args args = new chainUpdateEdge_args(); args.req = req; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); - super.postWrite(ctx, "GraphStorageService.addEdgesAtomic", args); + super.postWrite(ctx, "GraphStorageService.chainUpdateEdge", args); return; } - public ExecResponse recv_addEdgesAtomic() throws TException + public UpdateResponse recv_chainUpdateEdge() throws TException { ContextStack ctx = super.getContextStack(); long bytes; TMessageType mtype; - super.preRead(ctx, "GraphStorageService.addEdgesAtomic"); + super.preRead(ctx, "GraphStorageService.chainUpdateEdge"); TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } - addEdgesAtomic_result result = new addEdgesAtomic_result(); + chainUpdateEdge_result result = new chainUpdateEdge_result(); result.read(iprot_); iprot_.readMessageEnd(); - super.postRead(ctx, "GraphStorageService.addEdgesAtomic", result); + super.postRead(ctx, "GraphStorageService.chainUpdateEdge", result); if (result.isSetSuccess()) { return result.success; } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "addEdgesAtomic failed: unknown result"); + throw new TApplicationException(TApplicationException.MISSING_RESULT, "chainUpdateEdge failed: unknown result"); + } + + public ExecResponse chainAddEdges(AddEdgesRequest req) throws TException + { + ContextStack ctx = getContextStack("GraphStorageService.chainAddEdges", null); + this.setContextStack(ctx); + send_chainAddEdges(req); + return recv_chainAddEdges(); + } + + public void send_chainAddEdges(AddEdgesRequest req) throws TException + { + ContextStack ctx = this.getContextStack(); + super.preWrite(ctx, "GraphStorageService.chainAddEdges", null); + oprot_.writeMessageBegin(new TMessage("chainAddEdges", TMessageType.CALL, seqid_)); + chainAddEdges_args args = new chainAddEdges_args(); + args.req = req; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + super.postWrite(ctx, "GraphStorageService.chainAddEdges", args); + return; + } + + public ExecResponse recv_chainAddEdges() throws TException + { + ContextStack ctx = super.getContextStack(); + long bytes; + TMessageType mtype; + super.preRead(ctx, "GraphStorageService.chainAddEdges"); + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + chainAddEdges_result result = new chainAddEdges_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + super.postRead(ctx, "GraphStorageService.chainAddEdges", result); + + if (result.isSetSuccess()) { + return result.success; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "chainAddEdges failed: unknown result"); } } @@ -819,17 +868,17 @@ public AsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager clientM super(protocolFactory, clientManager, transport); } - public void getNeighbors(GetNeighborsRequest req, AsyncMethodCallback resultHandler280) throws TException { + public void getNeighbors(GetNeighborsRequest req, AsyncMethodCallback resultHandler304) throws TException { checkReady(); - getNeighbors_call method_call = new getNeighbors_call(req, resultHandler280, this, ___protocolFactory, ___transport); + getNeighbors_call method_call = new getNeighbors_call(req, resultHandler304, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getNeighbors_call extends TAsyncMethodCall { private GetNeighborsRequest req; - public getNeighbors_call(GetNeighborsRequest req, AsyncMethodCallback resultHandler281, TAsyncClient client277, TProtocolFactory protocolFactory278, TNonblockingTransport transport279) throws TException { - super(client277, protocolFactory278, transport279, resultHandler281, false); + public getNeighbors_call(GetNeighborsRequest req, AsyncMethodCallback resultHandler305, TAsyncClient client301, TProtocolFactory protocolFactory302, TNonblockingTransport transport303) throws TException { + super(client301, protocolFactory302, transport303, resultHandler305, false); this.req = req; } @@ -851,17 +900,17 @@ public GetNeighborsResponse getResult() throws TException { } } - public void getProps(GetPropRequest req, AsyncMethodCallback resultHandler285) throws TException { + public void getProps(GetPropRequest req, AsyncMethodCallback resultHandler309) throws TException { checkReady(); - getProps_call method_call = new getProps_call(req, resultHandler285, this, ___protocolFactory, ___transport); + getProps_call method_call = new getProps_call(req, resultHandler309, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getProps_call extends TAsyncMethodCall { private GetPropRequest req; - public getProps_call(GetPropRequest req, AsyncMethodCallback resultHandler286, TAsyncClient client282, TProtocolFactory protocolFactory283, TNonblockingTransport transport284) throws TException { - super(client282, protocolFactory283, transport284, resultHandler286, false); + public getProps_call(GetPropRequest req, AsyncMethodCallback resultHandler310, TAsyncClient client306, TProtocolFactory protocolFactory307, TNonblockingTransport transport308) throws TException { + super(client306, protocolFactory307, transport308, resultHandler310, false); this.req = req; } @@ -883,17 +932,17 @@ public GetPropResponse getResult() throws TException { } } - public void addVertices(AddVerticesRequest req, AsyncMethodCallback resultHandler290) throws TException { + public void addVertices(AddVerticesRequest req, AsyncMethodCallback resultHandler314) throws TException { checkReady(); - addVertices_call method_call = new addVertices_call(req, resultHandler290, this, ___protocolFactory, ___transport); + addVertices_call method_call = new addVertices_call(req, resultHandler314, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class addVertices_call extends TAsyncMethodCall { private AddVerticesRequest req; - public addVertices_call(AddVerticesRequest req, AsyncMethodCallback resultHandler291, TAsyncClient client287, TProtocolFactory protocolFactory288, TNonblockingTransport transport289) throws TException { - super(client287, protocolFactory288, transport289, resultHandler291, false); + public addVertices_call(AddVerticesRequest req, AsyncMethodCallback resultHandler315, TAsyncClient client311, TProtocolFactory protocolFactory312, TNonblockingTransport transport313) throws TException { + super(client311, protocolFactory312, transport313, resultHandler315, false); this.req = req; } @@ -915,17 +964,17 @@ public ExecResponse getResult() throws TException { } } - public void addEdges(AddEdgesRequest req, AsyncMethodCallback resultHandler295) throws TException { + public void addEdges(AddEdgesRequest req, AsyncMethodCallback resultHandler319) throws TException { checkReady(); - addEdges_call method_call = new addEdges_call(req, resultHandler295, this, ___protocolFactory, ___transport); + addEdges_call method_call = new addEdges_call(req, resultHandler319, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class addEdges_call extends TAsyncMethodCall { private AddEdgesRequest req; - public addEdges_call(AddEdgesRequest req, AsyncMethodCallback resultHandler296, TAsyncClient client292, TProtocolFactory protocolFactory293, TNonblockingTransport transport294) throws TException { - super(client292, protocolFactory293, transport294, resultHandler296, false); + public addEdges_call(AddEdgesRequest req, AsyncMethodCallback resultHandler320, TAsyncClient client316, TProtocolFactory protocolFactory317, TNonblockingTransport transport318) throws TException { + super(client316, protocolFactory317, transport318, resultHandler320, false); this.req = req; } @@ -947,17 +996,17 @@ public ExecResponse getResult() throws TException { } } - public void deleteEdges(DeleteEdgesRequest req, AsyncMethodCallback resultHandler300) throws TException { + public void deleteEdges(DeleteEdgesRequest req, AsyncMethodCallback resultHandler324) throws TException { checkReady(); - deleteEdges_call method_call = new deleteEdges_call(req, resultHandler300, this, ___protocolFactory, ___transport); + deleteEdges_call method_call = new deleteEdges_call(req, resultHandler324, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class deleteEdges_call extends TAsyncMethodCall { private DeleteEdgesRequest req; - public deleteEdges_call(DeleteEdgesRequest req, AsyncMethodCallback resultHandler301, TAsyncClient client297, TProtocolFactory protocolFactory298, TNonblockingTransport transport299) throws TException { - super(client297, protocolFactory298, transport299, resultHandler301, false); + public deleteEdges_call(DeleteEdgesRequest req, AsyncMethodCallback resultHandler325, TAsyncClient client321, TProtocolFactory protocolFactory322, TNonblockingTransport transport323) throws TException { + super(client321, protocolFactory322, transport323, resultHandler325, false); this.req = req; } @@ -979,17 +1028,17 @@ public ExecResponse getResult() throws TException { } } - public void deleteVertices(DeleteVerticesRequest req, AsyncMethodCallback resultHandler305) throws TException { + public void deleteVertices(DeleteVerticesRequest req, AsyncMethodCallback resultHandler329) throws TException { checkReady(); - deleteVertices_call method_call = new deleteVertices_call(req, resultHandler305, this, ___protocolFactory, ___transport); + deleteVertices_call method_call = new deleteVertices_call(req, resultHandler329, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class deleteVertices_call extends TAsyncMethodCall { private DeleteVerticesRequest req; - public deleteVertices_call(DeleteVerticesRequest req, AsyncMethodCallback resultHandler306, TAsyncClient client302, TProtocolFactory protocolFactory303, TNonblockingTransport transport304) throws TException { - super(client302, protocolFactory303, transport304, resultHandler306, false); + public deleteVertices_call(DeleteVerticesRequest req, AsyncMethodCallback resultHandler330, TAsyncClient client326, TProtocolFactory protocolFactory327, TNonblockingTransport transport328) throws TException { + super(client326, protocolFactory327, transport328, resultHandler330, false); this.req = req; } @@ -1011,17 +1060,17 @@ public ExecResponse getResult() throws TException { } } - public void deleteTags(DeleteTagsRequest req, AsyncMethodCallback resultHandler310) throws TException { + public void deleteTags(DeleteTagsRequest req, AsyncMethodCallback resultHandler334) throws TException { checkReady(); - deleteTags_call method_call = new deleteTags_call(req, resultHandler310, this, ___protocolFactory, ___transport); + deleteTags_call method_call = new deleteTags_call(req, resultHandler334, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class deleteTags_call extends TAsyncMethodCall { private DeleteTagsRequest req; - public deleteTags_call(DeleteTagsRequest req, AsyncMethodCallback resultHandler311, TAsyncClient client307, TProtocolFactory protocolFactory308, TNonblockingTransport transport309) throws TException { - super(client307, protocolFactory308, transport309, resultHandler311, false); + public deleteTags_call(DeleteTagsRequest req, AsyncMethodCallback resultHandler335, TAsyncClient client331, TProtocolFactory protocolFactory332, TNonblockingTransport transport333) throws TException { + super(client331, protocolFactory332, transport333, resultHandler335, false); this.req = req; } @@ -1043,17 +1092,17 @@ public ExecResponse getResult() throws TException { } } - public void updateVertex(UpdateVertexRequest req, AsyncMethodCallback resultHandler315) throws TException { + public void updateVertex(UpdateVertexRequest req, AsyncMethodCallback resultHandler339) throws TException { checkReady(); - updateVertex_call method_call = new updateVertex_call(req, resultHandler315, this, ___protocolFactory, ___transport); + updateVertex_call method_call = new updateVertex_call(req, resultHandler339, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class updateVertex_call extends TAsyncMethodCall { private UpdateVertexRequest req; - public updateVertex_call(UpdateVertexRequest req, AsyncMethodCallback resultHandler316, TAsyncClient client312, TProtocolFactory protocolFactory313, TNonblockingTransport transport314) throws TException { - super(client312, protocolFactory313, transport314, resultHandler316, false); + public updateVertex_call(UpdateVertexRequest req, AsyncMethodCallback resultHandler340, TAsyncClient client336, TProtocolFactory protocolFactory337, TNonblockingTransport transport338) throws TException { + super(client336, protocolFactory337, transport338, resultHandler340, false); this.req = req; } @@ -1075,17 +1124,17 @@ public UpdateResponse getResult() throws TException { } } - public void updateEdge(UpdateEdgeRequest req, AsyncMethodCallback resultHandler320) throws TException { + public void updateEdge(UpdateEdgeRequest req, AsyncMethodCallback resultHandler344) throws TException { checkReady(); - updateEdge_call method_call = new updateEdge_call(req, resultHandler320, this, ___protocolFactory, ___transport); + updateEdge_call method_call = new updateEdge_call(req, resultHandler344, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class updateEdge_call extends TAsyncMethodCall { private UpdateEdgeRequest req; - public updateEdge_call(UpdateEdgeRequest req, AsyncMethodCallback resultHandler321, TAsyncClient client317, TProtocolFactory protocolFactory318, TNonblockingTransport transport319) throws TException { - super(client317, protocolFactory318, transport319, resultHandler321, false); + public updateEdge_call(UpdateEdgeRequest req, AsyncMethodCallback resultHandler345, TAsyncClient client341, TProtocolFactory protocolFactory342, TNonblockingTransport transport343) throws TException { + super(client341, protocolFactory342, transport343, resultHandler345, false); this.req = req; } @@ -1107,17 +1156,17 @@ public UpdateResponse getResult() throws TException { } } - public void scanVertex(ScanVertexRequest req, AsyncMethodCallback resultHandler325) throws TException { + public void scanVertex(ScanVertexRequest req, AsyncMethodCallback resultHandler349) throws TException { checkReady(); - scanVertex_call method_call = new scanVertex_call(req, resultHandler325, this, ___protocolFactory, ___transport); + scanVertex_call method_call = new scanVertex_call(req, resultHandler349, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class scanVertex_call extends TAsyncMethodCall { private ScanVertexRequest req; - public scanVertex_call(ScanVertexRequest req, AsyncMethodCallback resultHandler326, TAsyncClient client322, TProtocolFactory protocolFactory323, TNonblockingTransport transport324) throws TException { - super(client322, protocolFactory323, transport324, resultHandler326, false); + public scanVertex_call(ScanVertexRequest req, AsyncMethodCallback resultHandler350, TAsyncClient client346, TProtocolFactory protocolFactory347, TNonblockingTransport transport348) throws TException { + super(client346, protocolFactory347, transport348, resultHandler350, false); this.req = req; } @@ -1139,17 +1188,17 @@ public ScanVertexResponse getResult() throws TException { } } - public void scanEdge(ScanEdgeRequest req, AsyncMethodCallback resultHandler330) throws TException { + public void scanEdge(ScanEdgeRequest req, AsyncMethodCallback resultHandler354) throws TException { checkReady(); - scanEdge_call method_call = new scanEdge_call(req, resultHandler330, this, ___protocolFactory, ___transport); + scanEdge_call method_call = new scanEdge_call(req, resultHandler354, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class scanEdge_call extends TAsyncMethodCall { private ScanEdgeRequest req; - public scanEdge_call(ScanEdgeRequest req, AsyncMethodCallback resultHandler331, TAsyncClient client327, TProtocolFactory protocolFactory328, TNonblockingTransport transport329) throws TException { - super(client327, protocolFactory328, transport329, resultHandler331, false); + public scanEdge_call(ScanEdgeRequest req, AsyncMethodCallback resultHandler355, TAsyncClient client351, TProtocolFactory protocolFactory352, TNonblockingTransport transport353) throws TException { + super(client351, protocolFactory352, transport353, resultHandler355, false); this.req = req; } @@ -1171,17 +1220,17 @@ public ScanEdgeResponse getResult() throws TException { } } - public void getUUID(GetUUIDReq req, AsyncMethodCallback resultHandler335) throws TException { + public void getUUID(GetUUIDReq req, AsyncMethodCallback resultHandler359) throws TException { checkReady(); - getUUID_call method_call = new getUUID_call(req, resultHandler335, this, ___protocolFactory, ___transport); + getUUID_call method_call = new getUUID_call(req, resultHandler359, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getUUID_call extends TAsyncMethodCall { private GetUUIDReq req; - public getUUID_call(GetUUIDReq req, AsyncMethodCallback resultHandler336, TAsyncClient client332, TProtocolFactory protocolFactory333, TNonblockingTransport transport334) throws TException { - super(client332, protocolFactory333, transport334, resultHandler336, false); + public getUUID_call(GetUUIDReq req, AsyncMethodCallback resultHandler360, TAsyncClient client356, TProtocolFactory protocolFactory357, TNonblockingTransport transport358) throws TException { + super(client356, protocolFactory357, transport358, resultHandler360, false); this.req = req; } @@ -1203,17 +1252,17 @@ public GetUUIDResp getResult() throws TException { } } - public void lookupIndex(LookupIndexRequest req, AsyncMethodCallback resultHandler340) throws TException { + public void lookupIndex(LookupIndexRequest req, AsyncMethodCallback resultHandler364) throws TException { checkReady(); - lookupIndex_call method_call = new lookupIndex_call(req, resultHandler340, this, ___protocolFactory, ___transport); + lookupIndex_call method_call = new lookupIndex_call(req, resultHandler364, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class lookupIndex_call extends TAsyncMethodCall { private LookupIndexRequest req; - public lookupIndex_call(LookupIndexRequest req, AsyncMethodCallback resultHandler341, TAsyncClient client337, TProtocolFactory protocolFactory338, TNonblockingTransport transport339) throws TException { - super(client337, protocolFactory338, transport339, resultHandler341, false); + public lookupIndex_call(LookupIndexRequest req, AsyncMethodCallback resultHandler365, TAsyncClient client361, TProtocolFactory protocolFactory362, TNonblockingTransport transport363) throws TException { + super(client361, protocolFactory362, transport363, resultHandler365, false); this.req = req; } @@ -1235,17 +1284,17 @@ public LookupIndexResp getResult() throws TException { } } - public void lookupAndTraverse(LookupAndTraverseRequest req, AsyncMethodCallback resultHandler345) throws TException { + public void lookupAndTraverse(LookupAndTraverseRequest req, AsyncMethodCallback resultHandler369) throws TException { checkReady(); - lookupAndTraverse_call method_call = new lookupAndTraverse_call(req, resultHandler345, this, ___protocolFactory, ___transport); + lookupAndTraverse_call method_call = new lookupAndTraverse_call(req, resultHandler369, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class lookupAndTraverse_call extends TAsyncMethodCall { private LookupAndTraverseRequest req; - public lookupAndTraverse_call(LookupAndTraverseRequest req, AsyncMethodCallback resultHandler346, TAsyncClient client342, TProtocolFactory protocolFactory343, TNonblockingTransport transport344) throws TException { - super(client342, protocolFactory343, transport344, resultHandler346, false); + public lookupAndTraverse_call(LookupAndTraverseRequest req, AsyncMethodCallback resultHandler370, TAsyncClient client366, TProtocolFactory protocolFactory367, TNonblockingTransport transport368) throws TException { + super(client366, protocolFactory367, transport368, resultHandler370, false); this.req = req; } @@ -1267,23 +1316,55 @@ public GetNeighborsResponse getResult() throws TException { } } - public void addEdgesAtomic(AddEdgesRequest req, AsyncMethodCallback resultHandler350) throws TException { + public void chainUpdateEdge(UpdateEdgeRequest req, AsyncMethodCallback resultHandler374) throws TException { checkReady(); - addEdgesAtomic_call method_call = new addEdgesAtomic_call(req, resultHandler350, this, ___protocolFactory, ___transport); + chainUpdateEdge_call method_call = new chainUpdateEdge_call(req, resultHandler374, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class addEdgesAtomic_call extends TAsyncMethodCall { + public static class chainUpdateEdge_call extends TAsyncMethodCall { + private UpdateEdgeRequest req; + public chainUpdateEdge_call(UpdateEdgeRequest req, AsyncMethodCallback resultHandler375, TAsyncClient client371, TProtocolFactory protocolFactory372, TNonblockingTransport transport373) throws TException { + super(client371, protocolFactory372, transport373, resultHandler375, false); + this.req = req; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("chainUpdateEdge", TMessageType.CALL, 0)); + chainUpdateEdge_args args = new chainUpdateEdge_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public UpdateResponse getResult() throws TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = super.client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_chainUpdateEdge(); + } + } + + public void chainAddEdges(AddEdgesRequest req, AsyncMethodCallback resultHandler379) throws TException { + checkReady(); + chainAddEdges_call method_call = new chainAddEdges_call(req, resultHandler379, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class chainAddEdges_call extends TAsyncMethodCall { private AddEdgesRequest req; - public addEdgesAtomic_call(AddEdgesRequest req, AsyncMethodCallback resultHandler351, TAsyncClient client347, TProtocolFactory protocolFactory348, TNonblockingTransport transport349) throws TException { - super(client347, protocolFactory348, transport349, resultHandler351, false); + public chainAddEdges_call(AddEdgesRequest req, AsyncMethodCallback resultHandler380, TAsyncClient client376, TProtocolFactory protocolFactory377, TNonblockingTransport transport378) throws TException { + super(client376, protocolFactory377, transport378, resultHandler380, false); this.req = req; } public void write_args(TProtocol prot) throws TException { - prot.writeMessageBegin(new TMessage("addEdgesAtomic", TMessageType.CALL, 0)); - addEdgesAtomic_args args = new addEdgesAtomic_args(); + prot.writeMessageBegin(new TMessage("chainAddEdges", TMessageType.CALL, 0)); + chainAddEdges_args args = new chainAddEdges_args(); args.setReq(req); args.write(prot); prot.writeMessageEnd(); @@ -1295,7 +1376,7 @@ public ExecResponse getResult() throws TException { } TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); TProtocol prot = super.client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_addEdgesAtomic(); + return (new Client(prot)).recv_chainAddEdges(); } } @@ -1321,7 +1402,8 @@ public Processor(Iface iface) processMap_.put("getUUID", new getUUID()); processMap_.put("lookupIndex", new lookupIndex()); processMap_.put("lookupAndTraverse", new lookupAndTraverse()); - processMap_.put("addEdgesAtomic", new addEdgesAtomic()); + processMap_.put("chainUpdateEdge", new chainUpdateEdge()); + processMap_.put("chainAddEdges", new chainAddEdges()); } protected static interface ProcessFunction { @@ -1648,23 +1730,44 @@ public void process(int seqid, TProtocol iprot, TProtocol oprot, TConnectionCont } - private class addEdgesAtomic implements ProcessFunction { + private class chainUpdateEdge implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot, TConnectionContext server_ctx) throws TException + { + Object handler_ctx = event_handler_.getContext("GraphStorageService.chainUpdateEdge", server_ctx); + chainUpdateEdge_args args = new chainUpdateEdge_args(); + event_handler_.preRead(handler_ctx, "GraphStorageService.chainUpdateEdge"); + args.read(iprot); + iprot.readMessageEnd(); + event_handler_.postRead(handler_ctx, "GraphStorageService.chainUpdateEdge", args); + chainUpdateEdge_result result = new chainUpdateEdge_result(); + result.success = iface_.chainUpdateEdge(args.req); + event_handler_.preWrite(handler_ctx, "GraphStorageService.chainUpdateEdge", result); + oprot.writeMessageBegin(new TMessage("chainUpdateEdge", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + event_handler_.postWrite(handler_ctx, "GraphStorageService.chainUpdateEdge", result); + } + + } + + private class chainAddEdges implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot, TConnectionContext server_ctx) throws TException { - Object handler_ctx = event_handler_.getContext("GraphStorageService.addEdgesAtomic", server_ctx); - addEdgesAtomic_args args = new addEdgesAtomic_args(); - event_handler_.preRead(handler_ctx, "GraphStorageService.addEdgesAtomic"); + Object handler_ctx = event_handler_.getContext("GraphStorageService.chainAddEdges", server_ctx); + chainAddEdges_args args = new chainAddEdges_args(); + event_handler_.preRead(handler_ctx, "GraphStorageService.chainAddEdges"); args.read(iprot); iprot.readMessageEnd(); - event_handler_.postRead(handler_ctx, "GraphStorageService.addEdgesAtomic", args); - addEdgesAtomic_result result = new addEdgesAtomic_result(); - result.success = iface_.addEdgesAtomic(args.req); - event_handler_.preWrite(handler_ctx, "GraphStorageService.addEdgesAtomic", result); - oprot.writeMessageBegin(new TMessage("addEdgesAtomic", TMessageType.REPLY, seqid)); + event_handler_.postRead(handler_ctx, "GraphStorageService.chainAddEdges", args); + chainAddEdges_result result = new chainAddEdges_result(); + result.success = iface_.chainAddEdges(args.req); + event_handler_.preWrite(handler_ctx, "GraphStorageService.chainAddEdges", result); + oprot.writeMessageBegin(new TMessage("chainAddEdges", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); - event_handler_.postWrite(handler_ctx, "GraphStorageService.addEdgesAtomic", result); + event_handler_.postWrite(handler_ctx, "GraphStorageService.chainAddEdges", result); } } @@ -7301,8 +7404,397 @@ public void validate() throws TException { } - public static class addEdgesAtomic_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("addEdgesAtomic_args"); + public static class chainUpdateEdge_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("chainUpdateEdge_args"); + private static final TField REQ_FIELD_DESC = new TField("req", TType.STRUCT, (short)1); + + public UpdateEdgeRequest req; + public static final int REQ = 1; + + // isset id assignments + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(REQ, new FieldMetaData("req", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, UpdateEdgeRequest.class))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(chainUpdateEdge_args.class, metaDataMap); + } + + public chainUpdateEdge_args() { + } + + public chainUpdateEdge_args( + UpdateEdgeRequest req) { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public chainUpdateEdge_args(chainUpdateEdge_args other) { + if (other.isSetReq()) { + this.req = TBaseHelper.deepCopy(other.req); + } + } + + public chainUpdateEdge_args deepCopy() { + return new chainUpdateEdge_args(this); + } + + public UpdateEdgeRequest getReq() { + return this.req; + } + + public chainUpdateEdge_args setReq(UpdateEdgeRequest req) { + this.req = req; + return this; + } + + public void unsetReq() { + this.req = null; + } + + // Returns true if field req is set (has been assigned a value) and false otherwise + public boolean isSetReq() { + return this.req != null; + } + + public void setReqIsSet(boolean __value) { + if (!__value) { + this.req = null; + } + } + + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case REQ: + if (__value == null) { + unsetReq(); + } else { + setReq((UpdateEdgeRequest)__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case REQ: + return getReq(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof chainUpdateEdge_args)) + return false; + chainUpdateEdge_args that = (chainUpdateEdge_args)_that; + + if (!TBaseHelper.equalsNobinary(this.isSetReq(), that.isSetReq(), this.req, that.req)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {req}); + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case REQ: + if (__field.type == TType.STRUCT) { + this.req = new UpdateEdgeRequest(); + this.req.read(iprot); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.req != null) { + oprot.writeFieldBegin(REQ_FIELD_DESC); + this.req.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("chainUpdateEdge_args"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("req"); + sb.append(space); + sb.append(":").append(space); + if (this.getReq() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getReq(), indent + 1, prettyPrint)); + } + first = false; + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + + public static class chainUpdateEdge_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("chainUpdateEdge_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); + + public UpdateResponse success; + public static final int SUCCESS = 0; + + // isset id assignments + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, UpdateResponse.class))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(chainUpdateEdge_result.class, metaDataMap); + } + + public chainUpdateEdge_result() { + } + + public chainUpdateEdge_result( + UpdateResponse success) { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public chainUpdateEdge_result(chainUpdateEdge_result other) { + if (other.isSetSuccess()) { + this.success = TBaseHelper.deepCopy(other.success); + } + } + + public chainUpdateEdge_result deepCopy() { + return new chainUpdateEdge_result(this); + } + + public UpdateResponse getSuccess() { + return this.success; + } + + public chainUpdateEdge_result setSuccess(UpdateResponse success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been assigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean __value) { + if (!__value) { + this.success = null; + } + } + + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case SUCCESS: + if (__value == null) { + unsetSuccess(); + } else { + setSuccess((UpdateResponse)__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object _that) { + if (_that == null) + return false; + if (this == _that) + return true; + if (!(_that instanceof chainUpdateEdge_result)) + return false; + chainUpdateEdge_result that = (chainUpdateEdge_result)_that; + + if (!TBaseHelper.equalsNobinary(this.isSetSuccess(), that.isSetSuccess(), this.success, that.success)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {success}); + } + + public void read(TProtocol iprot) throws TException { + TField __field; + iprot.readStructBegin(metaDataMap); + while (true) + { + __field = iprot.readFieldBegin(); + if (__field.type == TType.STOP) { + break; + } + switch (__field.id) + { + case SUCCESS: + if (__field.type == TType.STRUCT) { + this.success = new UpdateResponse(); + this.success.read(iprot); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + default: + TProtocolUtil.skip(iprot, __field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + this.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + return toString(1, true); + } + + @Override + public String toString(int indent, boolean prettyPrint) { + String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; + String newLine = prettyPrint ? "\n" : ""; + String space = prettyPrint ? " " : ""; + StringBuilder sb = new StringBuilder("chainUpdateEdge_result"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("success"); + sb.append(space); + sb.append(":").append(space); + if (this.getSuccess() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getSuccess(), indent + 1, prettyPrint)); + } + first = false; + sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + + public static class chainAddEdges_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("chainAddEdges_args"); private static final TField REQ_FIELD_DESC = new TField("req", TType.STRUCT, (short)1); public AddEdgesRequest req; @@ -7320,13 +7812,13 @@ public static class addEdgesAtomic_args implements TBase, java.io.Serializable, } static { - FieldMetaData.addStructMetaDataMap(addEdgesAtomic_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(chainAddEdges_args.class, metaDataMap); } - public addEdgesAtomic_args() { + public chainAddEdges_args() { } - public addEdgesAtomic_args( + public chainAddEdges_args( AddEdgesRequest req) { this(); this.req = req; @@ -7335,21 +7827,21 @@ public addEdgesAtomic_args( /** * Performs a deep copy on other. */ - public addEdgesAtomic_args(addEdgesAtomic_args other) { + public chainAddEdges_args(chainAddEdges_args other) { if (other.isSetReq()) { this.req = TBaseHelper.deepCopy(other.req); } } - public addEdgesAtomic_args deepCopy() { - return new addEdgesAtomic_args(this); + public chainAddEdges_args deepCopy() { + return new chainAddEdges_args(this); } public AddEdgesRequest getReq() { return this.req; } - public addEdgesAtomic_args setReq(AddEdgesRequest req) { + public chainAddEdges_args setReq(AddEdgesRequest req) { this.req = req; return this; } @@ -7400,9 +7892,9 @@ public boolean equals(Object _that) { return false; if (this == _that) return true; - if (!(_that instanceof addEdgesAtomic_args)) + if (!(_that instanceof chainAddEdges_args)) return false; - addEdgesAtomic_args that = (addEdgesAtomic_args)_that; + chainAddEdges_args that = (chainAddEdges_args)_that; if (!TBaseHelper.equalsNobinary(this.isSetReq(), that.isSetReq(), this.req, that.req)) { return false; } @@ -7469,7 +7961,7 @@ public String toString(int indent, boolean prettyPrint) { String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; String newLine = prettyPrint ? "\n" : ""; String space = prettyPrint ? " " : ""; - StringBuilder sb = new StringBuilder("addEdgesAtomic_args"); + StringBuilder sb = new StringBuilder("chainAddEdges_args"); sb.append(space); sb.append("("); sb.append(newLine); @@ -7496,8 +7988,8 @@ public void validate() throws TException { } - public static class addEdgesAtomic_result implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("addEdgesAtomic_result"); + public static class chainAddEdges_result implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("chainAddEdges_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); public ExecResponse success; @@ -7515,13 +8007,13 @@ public static class addEdgesAtomic_result implements TBase, java.io.Serializable } static { - FieldMetaData.addStructMetaDataMap(addEdgesAtomic_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(chainAddEdges_result.class, metaDataMap); } - public addEdgesAtomic_result() { + public chainAddEdges_result() { } - public addEdgesAtomic_result( + public chainAddEdges_result( ExecResponse success) { this(); this.success = success; @@ -7530,21 +8022,21 @@ public addEdgesAtomic_result( /** * Performs a deep copy on other. */ - public addEdgesAtomic_result(addEdgesAtomic_result other) { + public chainAddEdges_result(chainAddEdges_result other) { if (other.isSetSuccess()) { this.success = TBaseHelper.deepCopy(other.success); } } - public addEdgesAtomic_result deepCopy() { - return new addEdgesAtomic_result(this); + public chainAddEdges_result deepCopy() { + return new chainAddEdges_result(this); } public ExecResponse getSuccess() { return this.success; } - public addEdgesAtomic_result setSuccess(ExecResponse success) { + public chainAddEdges_result setSuccess(ExecResponse success) { this.success = success; return this; } @@ -7595,9 +8087,9 @@ public boolean equals(Object _that) { return false; if (this == _that) return true; - if (!(_that instanceof addEdgesAtomic_result)) + if (!(_that instanceof chainAddEdges_result)) return false; - addEdgesAtomic_result that = (addEdgesAtomic_result)_that; + chainAddEdges_result that = (chainAddEdges_result)_that; if (!TBaseHelper.equalsNobinary(this.isSetSuccess(), that.isSetSuccess(), this.success, that.success)) { return false; } @@ -7610,7 +8102,7 @@ public int hashCode() { } @Override - public int compareTo(addEdgesAtomic_result other) { + public int compareTo(chainAddEdges_result other) { if (other == null) { // See java.lang.Comparable docs throw new NullPointerException(); @@ -7686,7 +8178,7 @@ public String toString(int indent, boolean prettyPrint) { String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; String newLine = prettyPrint ? "\n" : ""; String space = prettyPrint ? " " : ""; - StringBuilder sb = new StringBuilder("addEdgesAtomic_result"); + StringBuilder sb = new StringBuilder("chainAddEdges_result"); sb.append(space); sb.append("("); sb.append(newLine); diff --git a/client/src/main/generated/com/vesoft/nebula/storage/InternalStorageService.java b/client/src/main/generated/com/vesoft/nebula/storage/InternalStorageService.java index 0b7b04369..dc8f229b4 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/InternalStorageService.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/InternalStorageService.java @@ -31,17 +31,17 @@ public class InternalStorageService { public interface Iface { - public GetValueResponse getValue(GetValueRequest req) throws TException; + public ExecResponse chainAddEdges(ChainAddEdgesRequest req) throws TException; - public ExecResponse forwardTransaction(InternalTxnRequest req) throws TException; + public UpdateResponse chainUpdateEdge(ChainUpdateEdgeRequest req) throws TException; } public interface AsyncIface { - public void getValue(GetValueRequest req, AsyncMethodCallback resultHandler) throws TException; + public void chainAddEdges(ChainAddEdgesRequest req, AsyncMethodCallback resultHandler) throws TException; - public void forwardTransaction(InternalTxnRequest req, AsyncMethodCallback resultHandler) throws TException; + public void chainUpdateEdge(ChainUpdateEdgeRequest req, AsyncMethodCallback resultHandler) throws TException; } @@ -74,94 +74,94 @@ public TProtocol getOutputProtocol() return this.oprot_; } - public GetValueResponse getValue(GetValueRequest req) throws TException + public ExecResponse chainAddEdges(ChainAddEdgesRequest req) throws TException { - ContextStack ctx = getContextStack("InternalStorageService.getValue", null); + ContextStack ctx = getContextStack("InternalStorageService.chainAddEdges", null); this.setContextStack(ctx); - send_getValue(req); - return recv_getValue(); + send_chainAddEdges(req); + return recv_chainAddEdges(); } - public void send_getValue(GetValueRequest req) throws TException + public void send_chainAddEdges(ChainAddEdgesRequest req) throws TException { ContextStack ctx = this.getContextStack(); - super.preWrite(ctx, "InternalStorageService.getValue", null); - oprot_.writeMessageBegin(new TMessage("getValue", TMessageType.CALL, seqid_)); - getValue_args args = new getValue_args(); + super.preWrite(ctx, "InternalStorageService.chainAddEdges", null); + oprot_.writeMessageBegin(new TMessage("chainAddEdges", TMessageType.CALL, seqid_)); + chainAddEdges_args args = new chainAddEdges_args(); args.req = req; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); - super.postWrite(ctx, "InternalStorageService.getValue", args); + super.postWrite(ctx, "InternalStorageService.chainAddEdges", args); return; } - public GetValueResponse recv_getValue() throws TException + public ExecResponse recv_chainAddEdges() throws TException { ContextStack ctx = super.getContextStack(); long bytes; TMessageType mtype; - super.preRead(ctx, "InternalStorageService.getValue"); + super.preRead(ctx, "InternalStorageService.chainAddEdges"); TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } - getValue_result result = new getValue_result(); + chainAddEdges_result result = new chainAddEdges_result(); result.read(iprot_); iprot_.readMessageEnd(); - super.postRead(ctx, "InternalStorageService.getValue", result); + super.postRead(ctx, "InternalStorageService.chainAddEdges", result); if (result.isSetSuccess()) { return result.success; } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "getValue failed: unknown result"); + throw new TApplicationException(TApplicationException.MISSING_RESULT, "chainAddEdges failed: unknown result"); } - public ExecResponse forwardTransaction(InternalTxnRequest req) throws TException + public UpdateResponse chainUpdateEdge(ChainUpdateEdgeRequest req) throws TException { - ContextStack ctx = getContextStack("InternalStorageService.forwardTransaction", null); + ContextStack ctx = getContextStack("InternalStorageService.chainUpdateEdge", null); this.setContextStack(ctx); - send_forwardTransaction(req); - return recv_forwardTransaction(); + send_chainUpdateEdge(req); + return recv_chainUpdateEdge(); } - public void send_forwardTransaction(InternalTxnRequest req) throws TException + public void send_chainUpdateEdge(ChainUpdateEdgeRequest req) throws TException { ContextStack ctx = this.getContextStack(); - super.preWrite(ctx, "InternalStorageService.forwardTransaction", null); - oprot_.writeMessageBegin(new TMessage("forwardTransaction", TMessageType.CALL, seqid_)); - forwardTransaction_args args = new forwardTransaction_args(); + super.preWrite(ctx, "InternalStorageService.chainUpdateEdge", null); + oprot_.writeMessageBegin(new TMessage("chainUpdateEdge", TMessageType.CALL, seqid_)); + chainUpdateEdge_args args = new chainUpdateEdge_args(); args.req = req; args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); - super.postWrite(ctx, "InternalStorageService.forwardTransaction", args); + super.postWrite(ctx, "InternalStorageService.chainUpdateEdge", args); return; } - public ExecResponse recv_forwardTransaction() throws TException + public UpdateResponse recv_chainUpdateEdge() throws TException { ContextStack ctx = super.getContextStack(); long bytes; TMessageType mtype; - super.preRead(ctx, "InternalStorageService.forwardTransaction"); + super.preRead(ctx, "InternalStorageService.chainUpdateEdge"); TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } - forwardTransaction_result result = new forwardTransaction_result(); + chainUpdateEdge_result result = new chainUpdateEdge_result(); result.read(iprot_); iprot_.readMessageEnd(); - super.postRead(ctx, "InternalStorageService.forwardTransaction", result); + super.postRead(ctx, "InternalStorageService.chainUpdateEdge", result); if (result.isSetSuccess()) { return result.success; } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "forwardTransaction failed: unknown result"); + throw new TApplicationException(TApplicationException.MISSING_RESULT, "chainUpdateEdge failed: unknown result"); } } @@ -182,67 +182,67 @@ public AsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager clientM super(protocolFactory, clientManager, transport); } - public void getValue(GetValueRequest req, AsyncMethodCallback resultHandler471) throws TException { + public void chainAddEdges(ChainAddEdgesRequest req, AsyncMethodCallback resultHandler500) throws TException { checkReady(); - getValue_call method_call = new getValue_call(req, resultHandler471, this, ___protocolFactory, ___transport); + chainAddEdges_call method_call = new chainAddEdges_call(req, resultHandler500, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class getValue_call extends TAsyncMethodCall { - private GetValueRequest req; - public getValue_call(GetValueRequest req, AsyncMethodCallback resultHandler472, TAsyncClient client468, TProtocolFactory protocolFactory469, TNonblockingTransport transport470) throws TException { - super(client468, protocolFactory469, transport470, resultHandler472, false); + public static class chainAddEdges_call extends TAsyncMethodCall { + private ChainAddEdgesRequest req; + public chainAddEdges_call(ChainAddEdgesRequest req, AsyncMethodCallback resultHandler501, TAsyncClient client497, TProtocolFactory protocolFactory498, TNonblockingTransport transport499) throws TException { + super(client497, protocolFactory498, transport499, resultHandler501, false); this.req = req; } public void write_args(TProtocol prot) throws TException { - prot.writeMessageBegin(new TMessage("getValue", TMessageType.CALL, 0)); - getValue_args args = new getValue_args(); + prot.writeMessageBegin(new TMessage("chainAddEdges", TMessageType.CALL, 0)); + chainAddEdges_args args = new chainAddEdges_args(); args.setReq(req); args.write(prot); prot.writeMessageEnd(); } - public GetValueResponse getResult() throws TException { + public ExecResponse getResult() throws TException { if (getState() != State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); TProtocol prot = super.client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getValue(); + return (new Client(prot)).recv_chainAddEdges(); } } - public void forwardTransaction(InternalTxnRequest req, AsyncMethodCallback resultHandler476) throws TException { + public void chainUpdateEdge(ChainUpdateEdgeRequest req, AsyncMethodCallback resultHandler505) throws TException { checkReady(); - forwardTransaction_call method_call = new forwardTransaction_call(req, resultHandler476, this, ___protocolFactory, ___transport); + chainUpdateEdge_call method_call = new chainUpdateEdge_call(req, resultHandler505, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class forwardTransaction_call extends TAsyncMethodCall { - private InternalTxnRequest req; - public forwardTransaction_call(InternalTxnRequest req, AsyncMethodCallback resultHandler477, TAsyncClient client473, TProtocolFactory protocolFactory474, TNonblockingTransport transport475) throws TException { - super(client473, protocolFactory474, transport475, resultHandler477, false); + public static class chainUpdateEdge_call extends TAsyncMethodCall { + private ChainUpdateEdgeRequest req; + public chainUpdateEdge_call(ChainUpdateEdgeRequest req, AsyncMethodCallback resultHandler506, TAsyncClient client502, TProtocolFactory protocolFactory503, TNonblockingTransport transport504) throws TException { + super(client502, protocolFactory503, transport504, resultHandler506, false); this.req = req; } public void write_args(TProtocol prot) throws TException { - prot.writeMessageBegin(new TMessage("forwardTransaction", TMessageType.CALL, 0)); - forwardTransaction_args args = new forwardTransaction_args(); + prot.writeMessageBegin(new TMessage("chainUpdateEdge", TMessageType.CALL, 0)); + chainUpdateEdge_args args = new chainUpdateEdge_args(); args.setReq(req); args.write(prot); prot.writeMessageEnd(); } - public ExecResponse getResult() throws TException { + public UpdateResponse getResult() throws TException { if (getState() != State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); TProtocol prot = super.client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_forwardTransaction(); + return (new Client(prot)).recv_chainUpdateEdge(); } } @@ -254,8 +254,8 @@ public Processor(Iface iface) { iface_ = iface; event_handler_ = new TProcessorEventHandler(); // Empty handler - processMap_.put("getValue", new getValue()); - processMap_.put("forwardTransaction", new forwardTransaction()); + processMap_.put("chainAddEdges", new chainAddEdges()); + processMap_.put("chainUpdateEdge", new chainUpdateEdge()); } protected static interface ProcessFunction { @@ -288,55 +288,55 @@ public boolean process(TProtocol iprot, TProtocol oprot, TConnectionContext serv return true; } - private class getValue implements ProcessFunction { + private class chainAddEdges implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot, TConnectionContext server_ctx) throws TException { - Object handler_ctx = event_handler_.getContext("InternalStorageService.getValue", server_ctx); - getValue_args args = new getValue_args(); - event_handler_.preRead(handler_ctx, "InternalStorageService.getValue"); + Object handler_ctx = event_handler_.getContext("InternalStorageService.chainAddEdges", server_ctx); + chainAddEdges_args args = new chainAddEdges_args(); + event_handler_.preRead(handler_ctx, "InternalStorageService.chainAddEdges"); args.read(iprot); iprot.readMessageEnd(); - event_handler_.postRead(handler_ctx, "InternalStorageService.getValue", args); - getValue_result result = new getValue_result(); - result.success = iface_.getValue(args.req); - event_handler_.preWrite(handler_ctx, "InternalStorageService.getValue", result); - oprot.writeMessageBegin(new TMessage("getValue", TMessageType.REPLY, seqid)); + event_handler_.postRead(handler_ctx, "InternalStorageService.chainAddEdges", args); + chainAddEdges_result result = new chainAddEdges_result(); + result.success = iface_.chainAddEdges(args.req); + event_handler_.preWrite(handler_ctx, "InternalStorageService.chainAddEdges", result); + oprot.writeMessageBegin(new TMessage("chainAddEdges", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); - event_handler_.postWrite(handler_ctx, "InternalStorageService.getValue", result); + event_handler_.postWrite(handler_ctx, "InternalStorageService.chainAddEdges", result); } } - private class forwardTransaction implements ProcessFunction { + private class chainUpdateEdge implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot, TConnectionContext server_ctx) throws TException { - Object handler_ctx = event_handler_.getContext("InternalStorageService.forwardTransaction", server_ctx); - forwardTransaction_args args = new forwardTransaction_args(); - event_handler_.preRead(handler_ctx, "InternalStorageService.forwardTransaction"); + Object handler_ctx = event_handler_.getContext("InternalStorageService.chainUpdateEdge", server_ctx); + chainUpdateEdge_args args = new chainUpdateEdge_args(); + event_handler_.preRead(handler_ctx, "InternalStorageService.chainUpdateEdge"); args.read(iprot); iprot.readMessageEnd(); - event_handler_.postRead(handler_ctx, "InternalStorageService.forwardTransaction", args); - forwardTransaction_result result = new forwardTransaction_result(); - result.success = iface_.forwardTransaction(args.req); - event_handler_.preWrite(handler_ctx, "InternalStorageService.forwardTransaction", result); - oprot.writeMessageBegin(new TMessage("forwardTransaction", TMessageType.REPLY, seqid)); + event_handler_.postRead(handler_ctx, "InternalStorageService.chainUpdateEdge", args); + chainUpdateEdge_result result = new chainUpdateEdge_result(); + result.success = iface_.chainUpdateEdge(args.req); + event_handler_.preWrite(handler_ctx, "InternalStorageService.chainUpdateEdge", result); + oprot.writeMessageBegin(new TMessage("chainUpdateEdge", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); - event_handler_.postWrite(handler_ctx, "InternalStorageService.forwardTransaction", result); + event_handler_.postWrite(handler_ctx, "InternalStorageService.chainUpdateEdge", result); } } } - public static class getValue_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getValue_args"); + public static class chainAddEdges_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("chainAddEdges_args"); private static final TField REQ_FIELD_DESC = new TField("req", TType.STRUCT, (short)1); - public GetValueRequest req; + public ChainAddEdgesRequest req; public static final int REQ = 1; // isset id assignments @@ -346,19 +346,19 @@ public static class getValue_args implements TBase, java.io.Serializable, Clonea static { Map tmpMetaDataMap = new HashMap(); tmpMetaDataMap.put(REQ, new FieldMetaData("req", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, GetValueRequest.class))); + new StructMetaData(TType.STRUCT, ChainAddEdgesRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); } static { - FieldMetaData.addStructMetaDataMap(getValue_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(chainAddEdges_args.class, metaDataMap); } - public getValue_args() { + public chainAddEdges_args() { } - public getValue_args( - GetValueRequest req) { + public chainAddEdges_args( + ChainAddEdgesRequest req) { this(); this.req = req; } @@ -366,21 +366,21 @@ public getValue_args( /** * Performs a deep copy on other. */ - public getValue_args(getValue_args other) { + public chainAddEdges_args(chainAddEdges_args other) { if (other.isSetReq()) { this.req = TBaseHelper.deepCopy(other.req); } } - public getValue_args deepCopy() { - return new getValue_args(this); + public chainAddEdges_args deepCopy() { + return new chainAddEdges_args(this); } - public GetValueRequest getReq() { + public ChainAddEdgesRequest getReq() { return this.req; } - public getValue_args setReq(GetValueRequest req) { + public chainAddEdges_args setReq(ChainAddEdgesRequest req) { this.req = req; return this; } @@ -406,7 +406,7 @@ public void setFieldValue(int fieldID, Object __value) { if (__value == null) { unsetReq(); } else { - setReq((GetValueRequest)__value); + setReq((ChainAddEdgesRequest)__value); } break; @@ -431,9 +431,9 @@ public boolean equals(Object _that) { return false; if (this == _that) return true; - if (!(_that instanceof getValue_args)) + if (!(_that instanceof chainAddEdges_args)) return false; - getValue_args that = (getValue_args)_that; + chainAddEdges_args that = (chainAddEdges_args)_that; if (!TBaseHelper.equalsNobinary(this.isSetReq(), that.isSetReq(), this.req, that.req)) { return false; } @@ -445,29 +445,6 @@ public int hashCode() { return Arrays.deepHashCode(new Object[] {req}); } - @Override - public int compareTo(getValue_args other) { - if (other == null) { - // See java.lang.Comparable docs - throw new NullPointerException(); - } - - if (other == this) { - return 0; - } - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - public void read(TProtocol iprot) throws TException { TField __field; iprot.readStructBegin(metaDataMap); @@ -481,7 +458,7 @@ public void read(TProtocol iprot) throws TException { { case REQ: if (__field.type == TType.STRUCT) { - this.req = new GetValueRequest(); + this.req = new ChainAddEdgesRequest(); this.req.read(iprot); } else { TProtocolUtil.skip(iprot, __field.type); @@ -523,7 +500,7 @@ public String toString(int indent, boolean prettyPrint) { String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; String newLine = prettyPrint ? "\n" : ""; String space = prettyPrint ? " " : ""; - StringBuilder sb = new StringBuilder("getValue_args"); + StringBuilder sb = new StringBuilder("chainAddEdges_args"); sb.append(space); sb.append("("); sb.append(newLine); @@ -550,11 +527,11 @@ public void validate() throws TException { } - public static class getValue_result implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getValue_result"); + public static class chainAddEdges_result implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("chainAddEdges_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); - public GetValueResponse success; + public ExecResponse success; public static final int SUCCESS = 0; // isset id assignments @@ -564,19 +541,19 @@ public static class getValue_result implements TBase, java.io.Serializable, Clon static { Map tmpMetaDataMap = new HashMap(); tmpMetaDataMap.put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, GetValueResponse.class))); + new StructMetaData(TType.STRUCT, ExecResponse.class))); metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); } static { - FieldMetaData.addStructMetaDataMap(getValue_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(chainAddEdges_result.class, metaDataMap); } - public getValue_result() { + public chainAddEdges_result() { } - public getValue_result( - GetValueResponse success) { + public chainAddEdges_result( + ExecResponse success) { this(); this.success = success; } @@ -584,21 +561,21 @@ public getValue_result( /** * Performs a deep copy on other. */ - public getValue_result(getValue_result other) { + public chainAddEdges_result(chainAddEdges_result other) { if (other.isSetSuccess()) { this.success = TBaseHelper.deepCopy(other.success); } } - public getValue_result deepCopy() { - return new getValue_result(this); + public chainAddEdges_result deepCopy() { + return new chainAddEdges_result(this); } - public GetValueResponse getSuccess() { + public ExecResponse getSuccess() { return this.success; } - public getValue_result setSuccess(GetValueResponse success) { + public chainAddEdges_result setSuccess(ExecResponse success) { this.success = success; return this; } @@ -624,7 +601,7 @@ public void setFieldValue(int fieldID, Object __value) { if (__value == null) { unsetSuccess(); } else { - setSuccess((GetValueResponse)__value); + setSuccess((ExecResponse)__value); } break; @@ -649,9 +626,9 @@ public boolean equals(Object _that) { return false; if (this == _that) return true; - if (!(_that instanceof getValue_result)) + if (!(_that instanceof chainAddEdges_result)) return false; - getValue_result that = (getValue_result)_that; + chainAddEdges_result that = (chainAddEdges_result)_that; if (!TBaseHelper.equalsNobinary(this.isSetSuccess(), that.isSetSuccess(), this.success, that.success)) { return false; } @@ -664,7 +641,7 @@ public int hashCode() { } @Override - public int compareTo(getValue_result other) { + public int compareTo(chainAddEdges_result other) { if (other == null) { // See java.lang.Comparable docs throw new NullPointerException(); @@ -699,7 +676,7 @@ public void read(TProtocol iprot) throws TException { { case SUCCESS: if (__field.type == TType.STRUCT) { - this.success = new GetValueResponse(); + this.success = new ExecResponse(); this.success.read(iprot); } else { TProtocolUtil.skip(iprot, __field.type); @@ -740,7 +717,7 @@ public String toString(int indent, boolean prettyPrint) { String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; String newLine = prettyPrint ? "\n" : ""; String space = prettyPrint ? " " : ""; - StringBuilder sb = new StringBuilder("getValue_result"); + StringBuilder sb = new StringBuilder("chainAddEdges_result"); sb.append(space); sb.append("("); sb.append(newLine); @@ -767,11 +744,11 @@ public void validate() throws TException { } - public static class forwardTransaction_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("forwardTransaction_args"); + public static class chainUpdateEdge_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("chainUpdateEdge_args"); private static final TField REQ_FIELD_DESC = new TField("req", TType.STRUCT, (short)1); - public InternalTxnRequest req; + public ChainUpdateEdgeRequest req; public static final int REQ = 1; // isset id assignments @@ -781,19 +758,19 @@ public static class forwardTransaction_args implements TBase, java.io.Serializab static { Map tmpMetaDataMap = new HashMap(); tmpMetaDataMap.put(REQ, new FieldMetaData("req", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, InternalTxnRequest.class))); + new StructMetaData(TType.STRUCT, ChainUpdateEdgeRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); } static { - FieldMetaData.addStructMetaDataMap(forwardTransaction_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(chainUpdateEdge_args.class, metaDataMap); } - public forwardTransaction_args() { + public chainUpdateEdge_args() { } - public forwardTransaction_args( - InternalTxnRequest req) { + public chainUpdateEdge_args( + ChainUpdateEdgeRequest req) { this(); this.req = req; } @@ -801,21 +778,21 @@ public forwardTransaction_args( /** * Performs a deep copy on other. */ - public forwardTransaction_args(forwardTransaction_args other) { + public chainUpdateEdge_args(chainUpdateEdge_args other) { if (other.isSetReq()) { this.req = TBaseHelper.deepCopy(other.req); } } - public forwardTransaction_args deepCopy() { - return new forwardTransaction_args(this); + public chainUpdateEdge_args deepCopy() { + return new chainUpdateEdge_args(this); } - public InternalTxnRequest getReq() { + public ChainUpdateEdgeRequest getReq() { return this.req; } - public forwardTransaction_args setReq(InternalTxnRequest req) { + public chainUpdateEdge_args setReq(ChainUpdateEdgeRequest req) { this.req = req; return this; } @@ -841,7 +818,7 @@ public void setFieldValue(int fieldID, Object __value) { if (__value == null) { unsetReq(); } else { - setReq((InternalTxnRequest)__value); + setReq((ChainUpdateEdgeRequest)__value); } break; @@ -866,9 +843,9 @@ public boolean equals(Object _that) { return false; if (this == _that) return true; - if (!(_that instanceof forwardTransaction_args)) + if (!(_that instanceof chainUpdateEdge_args)) return false; - forwardTransaction_args that = (forwardTransaction_args)_that; + chainUpdateEdge_args that = (chainUpdateEdge_args)_that; if (!TBaseHelper.equalsNobinary(this.isSetReq(), that.isSetReq(), this.req, that.req)) { return false; } @@ -880,29 +857,6 @@ public int hashCode() { return Arrays.deepHashCode(new Object[] {req}); } - @Override - public int compareTo(forwardTransaction_args other) { - if (other == null) { - // See java.lang.Comparable docs - throw new NullPointerException(); - } - - if (other == this) { - return 0; - } - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - public void read(TProtocol iprot) throws TException { TField __field; iprot.readStructBegin(metaDataMap); @@ -916,7 +870,7 @@ public void read(TProtocol iprot) throws TException { { case REQ: if (__field.type == TType.STRUCT) { - this.req = new InternalTxnRequest(); + this.req = new ChainUpdateEdgeRequest(); this.req.read(iprot); } else { TProtocolUtil.skip(iprot, __field.type); @@ -958,7 +912,7 @@ public String toString(int indent, boolean prettyPrint) { String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; String newLine = prettyPrint ? "\n" : ""; String space = prettyPrint ? " " : ""; - StringBuilder sb = new StringBuilder("forwardTransaction_args"); + StringBuilder sb = new StringBuilder("chainUpdateEdge_args"); sb.append(space); sb.append("("); sb.append(newLine); @@ -985,11 +939,11 @@ public void validate() throws TException { } - public static class forwardTransaction_result implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("forwardTransaction_result"); + public static class chainUpdateEdge_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("chainUpdateEdge_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); - public ExecResponse success; + public UpdateResponse success; public static final int SUCCESS = 0; // isset id assignments @@ -999,19 +953,19 @@ public static class forwardTransaction_result implements TBase, java.io.Serializ static { Map tmpMetaDataMap = new HashMap(); tmpMetaDataMap.put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, ExecResponse.class))); + new StructMetaData(TType.STRUCT, UpdateResponse.class))); metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); } static { - FieldMetaData.addStructMetaDataMap(forwardTransaction_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(chainUpdateEdge_result.class, metaDataMap); } - public forwardTransaction_result() { + public chainUpdateEdge_result() { } - public forwardTransaction_result( - ExecResponse success) { + public chainUpdateEdge_result( + UpdateResponse success) { this(); this.success = success; } @@ -1019,21 +973,21 @@ public forwardTransaction_result( /** * Performs a deep copy on other. */ - public forwardTransaction_result(forwardTransaction_result other) { + public chainUpdateEdge_result(chainUpdateEdge_result other) { if (other.isSetSuccess()) { this.success = TBaseHelper.deepCopy(other.success); } } - public forwardTransaction_result deepCopy() { - return new forwardTransaction_result(this); + public chainUpdateEdge_result deepCopy() { + return new chainUpdateEdge_result(this); } - public ExecResponse getSuccess() { + public UpdateResponse getSuccess() { return this.success; } - public forwardTransaction_result setSuccess(ExecResponse success) { + public chainUpdateEdge_result setSuccess(UpdateResponse success) { this.success = success; return this; } @@ -1059,7 +1013,7 @@ public void setFieldValue(int fieldID, Object __value) { if (__value == null) { unsetSuccess(); } else { - setSuccess((ExecResponse)__value); + setSuccess((UpdateResponse)__value); } break; @@ -1084,9 +1038,9 @@ public boolean equals(Object _that) { return false; if (this == _that) return true; - if (!(_that instanceof forwardTransaction_result)) + if (!(_that instanceof chainUpdateEdge_result)) return false; - forwardTransaction_result that = (forwardTransaction_result)_that; + chainUpdateEdge_result that = (chainUpdateEdge_result)_that; if (!TBaseHelper.equalsNobinary(this.isSetSuccess(), that.isSetSuccess(), this.success, that.success)) { return false; } @@ -1098,29 +1052,6 @@ public int hashCode() { return Arrays.deepHashCode(new Object[] {success}); } - @Override - public int compareTo(forwardTransaction_result other) { - if (other == null) { - // See java.lang.Comparable docs - throw new NullPointerException(); - } - - if (other == this) { - return 0; - } - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - public void read(TProtocol iprot) throws TException { TField __field; iprot.readStructBegin(metaDataMap); @@ -1134,7 +1065,7 @@ public void read(TProtocol iprot) throws TException { { case SUCCESS: if (__field.type == TType.STRUCT) { - this.success = new ExecResponse(); + this.success = new UpdateResponse(); this.success.read(iprot); } else { TProtocolUtil.skip(iprot, __field.type); @@ -1175,7 +1106,7 @@ public String toString(int indent, boolean prettyPrint) { String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; String newLine = prettyPrint ? "\n" : ""; String space = prettyPrint ? " " : ""; - StringBuilder sb = new StringBuilder("forwardTransaction_result"); + StringBuilder sb = new StringBuilder("chainUpdateEdge_result"); sb.append(space); sb.append("("); sb.append(newLine); diff --git a/client/src/main/generated/com/vesoft/nebula/storage/InternalTxnRequest.java b/client/src/main/generated/com/vesoft/nebula/storage/InternalTxnRequest.java index 36b4e5cd5..1fc752175 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/InternalTxnRequest.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/InternalTxnRequest.java @@ -24,31 +24,28 @@ import com.facebook.thrift.protocol.*; @SuppressWarnings({ "unused", "serial" }) -public class InternalTxnRequest implements TBase, java.io.Serializable, Cloneable, Comparable { +public class InternalTxnRequest implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("InternalTxnRequest"); private static final TField TXN_ID_FIELD_DESC = new TField("txn_id", TType.I64, (short)1); - private static final TField SPACE_ID_FIELD_DESC = new TField("space_id", TType.I32, (short)2); - private static final TField PART_ID_FIELD_DESC = new TField("part_id", TType.I32, (short)3); - private static final TField POSITION_FIELD_DESC = new TField("position", TType.I32, (short)4); - private static final TField DATA_FIELD_DESC = new TField("data", TType.LIST, (short)5); + private static final TField TERM_OF_PARTS_FIELD_DESC = new TField("term_of_parts", TType.MAP, (short)2); + private static final TField ADD_EDGE_REQ_FIELD_DESC = new TField("add_edge_req", TType.STRUCT, (short)3); + private static final TField UPD_EDGE_REQ_FIELD_DESC = new TField("upd_edge_req", TType.STRUCT, (short)4); + private static final TField EDGE_VER_FIELD_DESC = new TField("edge_ver", TType.MAP, (short)5); public long txn_id; - public int space_id; - public int part_id; - public int position; - public List> data; + public Map term_of_parts; + public AddEdgesRequest add_edge_req; + public UpdateEdgeRequest upd_edge_req; + public Map> edge_ver; public static final int TXN_ID = 1; - public static final int SPACE_ID = 2; - public static final int PART_ID = 3; - public static final int POSITION = 4; - public static final int DATA = 5; + public static final int TERM_OF_PARTS = 2; + public static final int ADD_EDGE_REQ = 3; + public static final int UPD_EDGE_REQ = 4; + public static final int EDGE_VER = 5; // isset id assignments private static final int __TXN_ID_ISSET_ID = 0; - private static final int __SPACE_ID_ISSET_ID = 1; - private static final int __PART_ID_ISSET_ID = 2; - private static final int __POSITION_ISSET_ID = 3; - private BitSet __isset_bit_vector = new BitSet(4); + private BitSet __isset_bit_vector = new BitSet(1); public static final Map metaDataMap; @@ -56,16 +53,19 @@ public class InternalTxnRequest implements TBase, java.io.Serializable, Cloneabl Map tmpMetaDataMap = new HashMap(); tmpMetaDataMap.put(TXN_ID, new FieldMetaData("txn_id", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I64))); - tmpMetaDataMap.put(SPACE_ID, new FieldMetaData("space_id", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - tmpMetaDataMap.put(PART_ID, new FieldMetaData("part_id", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - tmpMetaDataMap.put(POSITION, new FieldMetaData("position", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - tmpMetaDataMap.put(DATA, new FieldMetaData("data", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, + tmpMetaDataMap.put(TERM_OF_PARTS, new FieldMetaData("term_of_parts", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.I32), + new FieldValueMetaData(TType.I64)))); + tmpMetaDataMap.put(ADD_EDGE_REQ, new FieldMetaData("add_edge_req", TFieldRequirementType.OPTIONAL, + new StructMetaData(TType.STRUCT, AddEdgesRequest.class))); + tmpMetaDataMap.put(UPD_EDGE_REQ, new FieldMetaData("upd_edge_req", TFieldRequirementType.OPTIONAL, + new StructMetaData(TType.STRUCT, UpdateEdgeRequest.class))); + tmpMetaDataMap.put(EDGE_VER, new FieldMetaData("edge_ver", TFieldRequirementType.OPTIONAL, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.I32), new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING))))); + new FieldValueMetaData(TType.I64))))); metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); } @@ -78,30 +78,36 @@ public InternalTxnRequest() { public InternalTxnRequest( long txn_id, - int space_id, - int part_id, - int position, - List> data) { + Map term_of_parts) { this(); this.txn_id = txn_id; setTxn_idIsSet(true); - this.space_id = space_id; - setSpace_idIsSet(true); - this.part_id = part_id; - setPart_idIsSet(true); - this.position = position; - setPositionIsSet(true); - this.data = data; + this.term_of_parts = term_of_parts; + } + + public InternalTxnRequest( + long txn_id, + Map term_of_parts, + AddEdgesRequest add_edge_req, + UpdateEdgeRequest upd_edge_req, + Map> edge_ver) { + this(); + this.txn_id = txn_id; + setTxn_idIsSet(true); + this.term_of_parts = term_of_parts; + this.add_edge_req = add_edge_req; + this.upd_edge_req = upd_edge_req; + this.edge_ver = edge_ver; } public static class Builder { private long txn_id; - private int space_id; - private int part_id; - private int position; - private List> data; + private Map term_of_parts; + private AddEdgesRequest add_edge_req; + private UpdateEdgeRequest upd_edge_req; + private Map> edge_ver; - BitSet __optional_isset = new BitSet(4); + BitSet __optional_isset = new BitSet(1); public Builder() { } @@ -112,26 +118,23 @@ public Builder setTxn_id(final long txn_id) { return this; } - public Builder setSpace_id(final int space_id) { - this.space_id = space_id; - __optional_isset.set(__SPACE_ID_ISSET_ID, true); + public Builder setTerm_of_parts(final Map term_of_parts) { + this.term_of_parts = term_of_parts; return this; } - public Builder setPart_id(final int part_id) { - this.part_id = part_id; - __optional_isset.set(__PART_ID_ISSET_ID, true); + public Builder setAdd_edge_req(final AddEdgesRequest add_edge_req) { + this.add_edge_req = add_edge_req; return this; } - public Builder setPosition(final int position) { - this.position = position; - __optional_isset.set(__POSITION_ISSET_ID, true); + public Builder setUpd_edge_req(final UpdateEdgeRequest upd_edge_req) { + this.upd_edge_req = upd_edge_req; return this; } - public Builder setData(final List> data) { - this.data = data; + public Builder setEdge_ver(final Map> edge_ver) { + this.edge_ver = edge_ver; return this; } @@ -140,16 +143,10 @@ public InternalTxnRequest build() { if (__optional_isset.get(__TXN_ID_ISSET_ID)) { result.setTxn_id(this.txn_id); } - if (__optional_isset.get(__SPACE_ID_ISSET_ID)) { - result.setSpace_id(this.space_id); - } - if (__optional_isset.get(__PART_ID_ISSET_ID)) { - result.setPart_id(this.part_id); - } - if (__optional_isset.get(__POSITION_ISSET_ID)) { - result.setPosition(this.position); - } - result.setData(this.data); + result.setTerm_of_parts(this.term_of_parts); + result.setAdd_edge_req(this.add_edge_req); + result.setUpd_edge_req(this.upd_edge_req); + result.setEdge_ver(this.edge_ver); return result; } } @@ -165,11 +162,17 @@ public InternalTxnRequest(InternalTxnRequest other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); this.txn_id = TBaseHelper.deepCopy(other.txn_id); - this.space_id = TBaseHelper.deepCopy(other.space_id); - this.part_id = TBaseHelper.deepCopy(other.part_id); - this.position = TBaseHelper.deepCopy(other.position); - if (other.isSetData()) { - this.data = TBaseHelper.deepCopy(other.data); + if (other.isSetTerm_of_parts()) { + this.term_of_parts = TBaseHelper.deepCopy(other.term_of_parts); + } + if (other.isSetAdd_edge_req()) { + this.add_edge_req = TBaseHelper.deepCopy(other.add_edge_req); + } + if (other.isSetUpd_edge_req()) { + this.upd_edge_req = TBaseHelper.deepCopy(other.upd_edge_req); + } + if (other.isSetEdge_ver()) { + this.edge_ver = TBaseHelper.deepCopy(other.edge_ver); } } @@ -200,96 +203,99 @@ public void setTxn_idIsSet(boolean __value) { __isset_bit_vector.set(__TXN_ID_ISSET_ID, __value); } - public int getSpace_id() { - return this.space_id; + public Map getTerm_of_parts() { + return this.term_of_parts; } - public InternalTxnRequest setSpace_id(int space_id) { - this.space_id = space_id; - setSpace_idIsSet(true); + public InternalTxnRequest setTerm_of_parts(Map term_of_parts) { + this.term_of_parts = term_of_parts; return this; } - public void unsetSpace_id() { - __isset_bit_vector.clear(__SPACE_ID_ISSET_ID); + public void unsetTerm_of_parts() { + this.term_of_parts = null; } - // Returns true if field space_id is set (has been assigned a value) and false otherwise - public boolean isSetSpace_id() { - return __isset_bit_vector.get(__SPACE_ID_ISSET_ID); + // Returns true if field term_of_parts is set (has been assigned a value) and false otherwise + public boolean isSetTerm_of_parts() { + return this.term_of_parts != null; } - public void setSpace_idIsSet(boolean __value) { - __isset_bit_vector.set(__SPACE_ID_ISSET_ID, __value); + public void setTerm_of_partsIsSet(boolean __value) { + if (!__value) { + this.term_of_parts = null; + } } - public int getPart_id() { - return this.part_id; + public AddEdgesRequest getAdd_edge_req() { + return this.add_edge_req; } - public InternalTxnRequest setPart_id(int part_id) { - this.part_id = part_id; - setPart_idIsSet(true); + public InternalTxnRequest setAdd_edge_req(AddEdgesRequest add_edge_req) { + this.add_edge_req = add_edge_req; return this; } - public void unsetPart_id() { - __isset_bit_vector.clear(__PART_ID_ISSET_ID); + public void unsetAdd_edge_req() { + this.add_edge_req = null; } - // Returns true if field part_id is set (has been assigned a value) and false otherwise - public boolean isSetPart_id() { - return __isset_bit_vector.get(__PART_ID_ISSET_ID); + // Returns true if field add_edge_req is set (has been assigned a value) and false otherwise + public boolean isSetAdd_edge_req() { + return this.add_edge_req != null; } - public void setPart_idIsSet(boolean __value) { - __isset_bit_vector.set(__PART_ID_ISSET_ID, __value); + public void setAdd_edge_reqIsSet(boolean __value) { + if (!__value) { + this.add_edge_req = null; + } } - public int getPosition() { - return this.position; + public UpdateEdgeRequest getUpd_edge_req() { + return this.upd_edge_req; } - public InternalTxnRequest setPosition(int position) { - this.position = position; - setPositionIsSet(true); + public InternalTxnRequest setUpd_edge_req(UpdateEdgeRequest upd_edge_req) { + this.upd_edge_req = upd_edge_req; return this; } - public void unsetPosition() { - __isset_bit_vector.clear(__POSITION_ISSET_ID); + public void unsetUpd_edge_req() { + this.upd_edge_req = null; } - // Returns true if field position is set (has been assigned a value) and false otherwise - public boolean isSetPosition() { - return __isset_bit_vector.get(__POSITION_ISSET_ID); + // Returns true if field upd_edge_req is set (has been assigned a value) and false otherwise + public boolean isSetUpd_edge_req() { + return this.upd_edge_req != null; } - public void setPositionIsSet(boolean __value) { - __isset_bit_vector.set(__POSITION_ISSET_ID, __value); + public void setUpd_edge_reqIsSet(boolean __value) { + if (!__value) { + this.upd_edge_req = null; + } } - public List> getData() { - return this.data; + public Map> getEdge_ver() { + return this.edge_ver; } - public InternalTxnRequest setData(List> data) { - this.data = data; + public InternalTxnRequest setEdge_ver(Map> edge_ver) { + this.edge_ver = edge_ver; return this; } - public void unsetData() { - this.data = null; + public void unsetEdge_ver() { + this.edge_ver = null; } - // Returns true if field data is set (has been assigned a value) and false otherwise - public boolean isSetData() { - return this.data != null; + // Returns true if field edge_ver is set (has been assigned a value) and false otherwise + public boolean isSetEdge_ver() { + return this.edge_ver != null; } - public void setDataIsSet(boolean __value) { + public void setEdge_verIsSet(boolean __value) { if (!__value) { - this.data = null; + this.edge_ver = null; } } @@ -304,35 +310,35 @@ public void setFieldValue(int fieldID, Object __value) { } break; - case SPACE_ID: + case TERM_OF_PARTS: if (__value == null) { - unsetSpace_id(); + unsetTerm_of_parts(); } else { - setSpace_id((Integer)__value); + setTerm_of_parts((Map)__value); } break; - case PART_ID: + case ADD_EDGE_REQ: if (__value == null) { - unsetPart_id(); + unsetAdd_edge_req(); } else { - setPart_id((Integer)__value); + setAdd_edge_req((AddEdgesRequest)__value); } break; - case POSITION: + case UPD_EDGE_REQ: if (__value == null) { - unsetPosition(); + unsetUpd_edge_req(); } else { - setPosition((Integer)__value); + setUpd_edge_req((UpdateEdgeRequest)__value); } break; - case DATA: + case EDGE_VER: if (__value == null) { - unsetData(); + unsetEdge_ver(); } else { - setData((List>)__value); + setEdge_ver((Map>)__value); } break; @@ -346,17 +352,17 @@ public Object getFieldValue(int fieldID) { case TXN_ID: return new Long(getTxn_id()); - case SPACE_ID: - return new Integer(getSpace_id()); + case TERM_OF_PARTS: + return getTerm_of_parts(); - case PART_ID: - return new Integer(getPart_id()); + case ADD_EDGE_REQ: + return getAdd_edge_req(); - case POSITION: - return new Integer(getPosition()); + case UPD_EDGE_REQ: + return getUpd_edge_req(); - case DATA: - return getData(); + case EDGE_VER: + return getEdge_ver(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -375,75 +381,20 @@ public boolean equals(Object _that) { if (!TBaseHelper.equalsNobinary(this.txn_id, that.txn_id)) { return false; } - if (!TBaseHelper.equalsNobinary(this.space_id, that.space_id)) { return false; } + if (!TBaseHelper.equalsNobinary(this.isSetTerm_of_parts(), that.isSetTerm_of_parts(), this.term_of_parts, that.term_of_parts)) { return false; } - if (!TBaseHelper.equalsNobinary(this.part_id, that.part_id)) { return false; } + if (!TBaseHelper.equalsNobinary(this.isSetAdd_edge_req(), that.isSetAdd_edge_req(), this.add_edge_req, that.add_edge_req)) { return false; } - if (!TBaseHelper.equalsNobinary(this.position, that.position)) { return false; } + if (!TBaseHelper.equalsNobinary(this.isSetUpd_edge_req(), that.isSetUpd_edge_req(), this.upd_edge_req, that.upd_edge_req)) { return false; } - if (!TBaseHelper.equalsSlow(this.isSetData(), that.isSetData(), this.data, that.data)) { return false; } + if (!TBaseHelper.equalsNobinary(this.isSetEdge_ver(), that.isSetEdge_ver(), this.edge_ver, that.edge_ver)) { return false; } return true; } @Override public int hashCode() { - return Arrays.deepHashCode(new Object[] {txn_id, space_id, part_id, position, data}); - } - - @Override - public int compareTo(InternalTxnRequest other) { - if (other == null) { - // See java.lang.Comparable docs - throw new NullPointerException(); - } - - if (other == this) { - return 0; - } - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetTxn_id()).compareTo(other.isSetTxn_id()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(txn_id, other.txn_id); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = Boolean.valueOf(isSetSpace_id()).compareTo(other.isSetSpace_id()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(space_id, other.space_id); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = Boolean.valueOf(isSetPart_id()).compareTo(other.isSetPart_id()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(part_id, other.part_id); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = Boolean.valueOf(isSetPosition()).compareTo(other.isSetPosition()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(position, other.position); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = Boolean.valueOf(isSetData()).compareTo(other.isSetData()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(data, other.data); - if (lastComparison != 0) { - return lastComparison; - } - return 0; + return Arrays.deepHashCode(new Object[] {txn_id, term_of_parts, add_edge_req, upd_edge_req, edge_ver}); } public void read(TProtocol iprot) throws TException { @@ -465,56 +416,71 @@ public void read(TProtocol iprot) throws TException { TProtocolUtil.skip(iprot, __field.type); } break; - case SPACE_ID: - if (__field.type == TType.I32) { - this.space_id = iprot.readI32(); - setSpace_idIsSet(true); + case TERM_OF_PARTS: + if (__field.type == TType.MAP) { + { + TMap _map254 = iprot.readMapBegin(); + this.term_of_parts = new HashMap(Math.max(0, 2*_map254.size)); + for (int _i255 = 0; + (_map254.size < 0) ? iprot.peekMap() : (_i255 < _map254.size); + ++_i255) + { + int _key256; + long _val257; + _key256 = iprot.readI32(); + _val257 = iprot.readI64(); + this.term_of_parts.put(_key256, _val257); + } + iprot.readMapEnd(); + } } else { TProtocolUtil.skip(iprot, __field.type); } break; - case PART_ID: - if (__field.type == TType.I32) { - this.part_id = iprot.readI32(); - setPart_idIsSet(true); + case ADD_EDGE_REQ: + if (__field.type == TType.STRUCT) { + this.add_edge_req = new AddEdgesRequest(); + this.add_edge_req.read(iprot); } else { TProtocolUtil.skip(iprot, __field.type); } break; - case POSITION: - if (__field.type == TType.I32) { - this.position = iprot.readI32(); - setPositionIsSet(true); + case UPD_EDGE_REQ: + if (__field.type == TType.STRUCT) { + this.upd_edge_req = new UpdateEdgeRequest(); + this.upd_edge_req.read(iprot); } else { TProtocolUtil.skip(iprot, __field.type); } break; - case DATA: - if (__field.type == TType.LIST) { + case EDGE_VER: + if (__field.type == TType.MAP) { { - TList _list254 = iprot.readListBegin(); - this.data = new ArrayList>(Math.max(0, _list254.size)); - for (int _i255 = 0; - (_list254.size < 0) ? iprot.peekList() : (_i255 < _list254.size); - ++_i255) + TMap _map258 = iprot.readMapBegin(); + this.edge_ver = new HashMap>(Math.max(0, 2*_map258.size)); + for (int _i259 = 0; + (_map258.size < 0) ? iprot.peekMap() : (_i259 < _map258.size); + ++_i259) { - List _elem256; + int _key260; + List _val261; + _key260 = iprot.readI32(); { - TList _list257 = iprot.readListBegin(); - _elem256 = new ArrayList(Math.max(0, _list257.size)); - for (int _i258 = 0; - (_list257.size < 0) ? iprot.peekList() : (_i258 < _list257.size); - ++_i258) + TList _list262 = iprot.readListBegin(); + _val261 = new ArrayList(Math.max(0, _list262.size)); + for (int _i263 = 0; + (_list262.size < 0) ? iprot.peekList() : (_i263 < _list262.size); + ++_i263) { - byte[] _elem259; - _elem259 = iprot.readBinary(); - _elem256.add(_elem259); + long _elem264; + _elem264 = iprot.readI64(); + _val261.add(_elem264); } iprot.readListEnd(); } - this.data.add(_elem256); + this.edge_ver.put(_key260, _val261); } - iprot.readListEnd(); + iprot.readMapEnd(); } } else { TProtocolUtil.skip(iprot, __field.type); @@ -540,31 +506,51 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(TXN_ID_FIELD_DESC); oprot.writeI64(this.txn_id); oprot.writeFieldEnd(); - oprot.writeFieldBegin(SPACE_ID_FIELD_DESC); - oprot.writeI32(this.space_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(PART_ID_FIELD_DESC); - oprot.writeI32(this.part_id); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(POSITION_FIELD_DESC); - oprot.writeI32(this.position); - oprot.writeFieldEnd(); - if (this.data != null) { - oprot.writeFieldBegin(DATA_FIELD_DESC); + if (this.term_of_parts != null) { + oprot.writeFieldBegin(TERM_OF_PARTS_FIELD_DESC); { - oprot.writeListBegin(new TList(TType.LIST, this.data.size())); - for (List _iter260 : this.data) { - { - oprot.writeListBegin(new TList(TType.STRING, _iter260.size())); - for (byte[] _iter261 : _iter260) { - oprot.writeBinary(_iter261); + oprot.writeMapBegin(new TMap(TType.I32, TType.I64, this.term_of_parts.size())); + for (Map.Entry _iter265 : this.term_of_parts.entrySet()) { + oprot.writeI32(_iter265.getKey()); + oprot.writeI64(_iter265.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (this.add_edge_req != null) { + if (isSetAdd_edge_req()) { + oprot.writeFieldBegin(ADD_EDGE_REQ_FIELD_DESC); + this.add_edge_req.write(oprot); + oprot.writeFieldEnd(); + } + } + if (this.upd_edge_req != null) { + if (isSetUpd_edge_req()) { + oprot.writeFieldBegin(UPD_EDGE_REQ_FIELD_DESC); + this.upd_edge_req.write(oprot); + oprot.writeFieldEnd(); + } + } + if (this.edge_ver != null) { + if (isSetEdge_ver()) { + oprot.writeFieldBegin(EDGE_VER_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.I32, TType.LIST, this.edge_ver.size())); + for (Map.Entry> _iter266 : this.edge_ver.entrySet()) { + oprot.writeI32(_iter266.getKey()); + { + oprot.writeListBegin(new TList(TType.I64, _iter266.getValue().size())); + for (long _iter267 : _iter266.getValue()) { + oprot.writeI64(_iter267); + } + oprot.writeListEnd(); } - oprot.writeListEnd(); } + oprot.writeMapEnd(); } - oprot.writeListEnd(); + oprot.writeFieldEnd(); } - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -594,36 +580,57 @@ public String toString(int indent, boolean prettyPrint) { first = false; if (!first) sb.append("," + newLine); sb.append(indentStr); - sb.append("space_id"); - sb.append(space); - sb.append(":").append(space); - sb.append(TBaseHelper.toString(this.getSpace_id(), indent + 1, prettyPrint)); - first = false; - if (!first) sb.append("," + newLine); - sb.append(indentStr); - sb.append("part_id"); - sb.append(space); - sb.append(":").append(space); - sb.append(TBaseHelper.toString(this.getPart_id(), indent + 1, prettyPrint)); - first = false; - if (!first) sb.append("," + newLine); - sb.append(indentStr); - sb.append("position"); + sb.append("term_of_parts"); sb.append(space); sb.append(":").append(space); - sb.append(TBaseHelper.toString(this.getPosition(), indent + 1, prettyPrint)); - first = false; - if (!first) sb.append("," + newLine); - sb.append(indentStr); - sb.append("data"); - sb.append(space); - sb.append(":").append(space); - if (this.getData() == null) { + if (this.getTerm_of_parts() == null) { sb.append("null"); } else { - sb.append(TBaseHelper.toString(this.getData(), indent + 1, prettyPrint)); + sb.append(TBaseHelper.toString(this.getTerm_of_parts(), indent + 1, prettyPrint)); } first = false; + if (isSetAdd_edge_req()) + { + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("add_edge_req"); + sb.append(space); + sb.append(":").append(space); + if (this.getAdd_edge_req() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getAdd_edge_req(), indent + 1, prettyPrint)); + } + first = false; + } + if (isSetUpd_edge_req()) + { + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("upd_edge_req"); + sb.append(space); + sb.append(":").append(space); + if (this.getUpd_edge_req() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getUpd_edge_req(), indent + 1, prettyPrint)); + } + first = false; + } + if (isSetEdge_ver()) + { + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("edge_ver"); + sb.append(space); + sb.append(":").append(space); + if (this.getEdge_ver() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getEdge_ver(), indent + 1, prettyPrint)); + } + first = false; + } sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); sb.append(")"); return sb.toString(); diff --git a/client/src/main/generated/com/vesoft/nebula/storage/RequestCommon.java b/client/src/main/generated/com/vesoft/nebula/storage/RequestCommon.java index 96a5a568e..94c7bcb37 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/RequestCommon.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/RequestCommon.java @@ -28,16 +28,20 @@ public class RequestCommon implements TBase, java.io.Serializable, Cloneable, Co private static final TStruct STRUCT_DESC = new TStruct("RequestCommon"); private static final TField SESSION_ID_FIELD_DESC = new TField("session_id", TType.I64, (short)1); private static final TField PLAN_ID_FIELD_DESC = new TField("plan_id", TType.I64, (short)2); + private static final TField PROFILE_DETAIL_FIELD_DESC = new TField("profile_detail", TType.BOOL, (short)3); public long session_id; public long plan_id; + public boolean profile_detail; public static final int SESSION_ID = 1; public static final int PLAN_ID = 2; + public static final int PROFILE_DETAIL = 3; // isset id assignments private static final int __SESSION_ID_ISSET_ID = 0; private static final int __PLAN_ID_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); + private static final int __PROFILE_DETAIL_ISSET_ID = 2; + private BitSet __isset_bit_vector = new BitSet(3); public static final Map metaDataMap; @@ -47,6 +51,8 @@ public class RequestCommon implements TBase, java.io.Serializable, Cloneable, Co new FieldValueMetaData(TType.I64))); tmpMetaDataMap.put(PLAN_ID, new FieldMetaData("plan_id", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.I64))); + tmpMetaDataMap.put(PROFILE_DETAIL, new FieldMetaData("profile_detail", TFieldRequirementType.OPTIONAL, + new FieldValueMetaData(TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); } @@ -59,19 +65,23 @@ public RequestCommon() { public RequestCommon( long session_id, - long plan_id) { + long plan_id, + boolean profile_detail) { this(); this.session_id = session_id; setSession_idIsSet(true); this.plan_id = plan_id; setPlan_idIsSet(true); + this.profile_detail = profile_detail; + setProfile_detailIsSet(true); } public static class Builder { private long session_id; private long plan_id; + private boolean profile_detail; - BitSet __optional_isset = new BitSet(2); + BitSet __optional_isset = new BitSet(3); public Builder() { } @@ -88,6 +98,12 @@ public Builder setPlan_id(final long plan_id) { return this; } + public Builder setProfile_detail(final boolean profile_detail) { + this.profile_detail = profile_detail; + __optional_isset.set(__PROFILE_DETAIL_ISSET_ID, true); + return this; + } + public RequestCommon build() { RequestCommon result = new RequestCommon(); if (__optional_isset.get(__SESSION_ID_ISSET_ID)) { @@ -96,6 +112,9 @@ public RequestCommon build() { if (__optional_isset.get(__PLAN_ID_ISSET_ID)) { result.setPlan_id(this.plan_id); } + if (__optional_isset.get(__PROFILE_DETAIL_ISSET_ID)) { + result.setProfile_detail(this.profile_detail); + } return result; } } @@ -112,6 +131,7 @@ public RequestCommon(RequestCommon other) { __isset_bit_vector.or(other.__isset_bit_vector); this.session_id = TBaseHelper.deepCopy(other.session_id); this.plan_id = TBaseHelper.deepCopy(other.plan_id); + this.profile_detail = TBaseHelper.deepCopy(other.profile_detail); } public RequestCommon deepCopy() { @@ -164,6 +184,29 @@ public void setPlan_idIsSet(boolean __value) { __isset_bit_vector.set(__PLAN_ID_ISSET_ID, __value); } + public boolean isProfile_detail() { + return this.profile_detail; + } + + public RequestCommon setProfile_detail(boolean profile_detail) { + this.profile_detail = profile_detail; + setProfile_detailIsSet(true); + return this; + } + + public void unsetProfile_detail() { + __isset_bit_vector.clear(__PROFILE_DETAIL_ISSET_ID); + } + + // Returns true if field profile_detail is set (has been assigned a value) and false otherwise + public boolean isSetProfile_detail() { + return __isset_bit_vector.get(__PROFILE_DETAIL_ISSET_ID); + } + + public void setProfile_detailIsSet(boolean __value) { + __isset_bit_vector.set(__PROFILE_DETAIL_ISSET_ID, __value); + } + public void setFieldValue(int fieldID, Object __value) { switch (fieldID) { case SESSION_ID: @@ -182,6 +225,14 @@ public void setFieldValue(int fieldID, Object __value) { } break; + case PROFILE_DETAIL: + if (__value == null) { + unsetProfile_detail(); + } else { + setProfile_detail((Boolean)__value); + } + break; + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -195,6 +246,9 @@ public Object getFieldValue(int fieldID) { case PLAN_ID: return new Long(getPlan_id()); + case PROFILE_DETAIL: + return new Boolean(isProfile_detail()); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -214,12 +268,14 @@ public boolean equals(Object _that) { if (!TBaseHelper.equalsNobinary(this.isSetPlan_id(), that.isSetPlan_id(), this.plan_id, that.plan_id)) { return false; } + if (!TBaseHelper.equalsNobinary(this.isSetProfile_detail(), that.isSetProfile_detail(), this.profile_detail, that.profile_detail)) { return false; } + return true; } @Override public int hashCode() { - return Arrays.deepHashCode(new Object[] {session_id, plan_id}); + return Arrays.deepHashCode(new Object[] {session_id, plan_id, profile_detail}); } @Override @@ -250,6 +306,14 @@ public int compareTo(RequestCommon other) { if (lastComparison != 0) { return lastComparison; } + lastComparison = Boolean.valueOf(isSetProfile_detail()).compareTo(other.isSetProfile_detail()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(profile_detail, other.profile_detail); + if (lastComparison != 0) { + return lastComparison; + } return 0; } @@ -280,6 +344,14 @@ public void read(TProtocol iprot) throws TException { TProtocolUtil.skip(iprot, __field.type); } break; + case PROFILE_DETAIL: + if (__field.type == TType.BOOL) { + this.profile_detail = iprot.readBool(); + setProfile_detailIsSet(true); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; default: TProtocolUtil.skip(iprot, __field.type); break; @@ -307,6 +379,11 @@ public void write(TProtocol oprot) throws TException { oprot.writeI64(this.plan_id); oprot.writeFieldEnd(); } + if (isSetProfile_detail()) { + oprot.writeFieldBegin(PROFILE_DETAIL_FIELD_DESC); + oprot.writeBool(this.profile_detail); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -346,6 +423,16 @@ public String toString(int indent, boolean prettyPrint) { sb.append(TBaseHelper.toString(this.getPlan_id(), indent + 1, prettyPrint)); first = false; } + if (isSetProfile_detail()) + { + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("profile_detail"); + sb.append(space); + sb.append(":").append(space); + sb.append(TBaseHelper.toString(this.isProfile_detail(), indent + 1, prettyPrint)); + first = false; + } sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); sb.append(")"); return sb.toString(); diff --git a/client/src/main/generated/com/vesoft/nebula/storage/StorageAdminService.java b/client/src/main/generated/com/vesoft/nebula/storage/StorageAdminService.java index 8b6e3019c..04627c6a4 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/StorageAdminService.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/StorageAdminService.java @@ -868,17 +868,17 @@ public AsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager clientM super(protocolFactory, clientManager, transport); } - public void transLeader(TransLeaderReq req, AsyncMethodCallback resultHandler371) throws TException { + public void transLeader(TransLeaderReq req, AsyncMethodCallback resultHandler400) throws TException { checkReady(); - transLeader_call method_call = new transLeader_call(req, resultHandler371, this, ___protocolFactory, ___transport); + transLeader_call method_call = new transLeader_call(req, resultHandler400, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class transLeader_call extends TAsyncMethodCall { private TransLeaderReq req; - public transLeader_call(TransLeaderReq req, AsyncMethodCallback resultHandler372, TAsyncClient client368, TProtocolFactory protocolFactory369, TNonblockingTransport transport370) throws TException { - super(client368, protocolFactory369, transport370, resultHandler372, false); + public transLeader_call(TransLeaderReq req, AsyncMethodCallback resultHandler401, TAsyncClient client397, TProtocolFactory protocolFactory398, TNonblockingTransport transport399) throws TException { + super(client397, protocolFactory398, transport399, resultHandler401, false); this.req = req; } @@ -900,17 +900,17 @@ public AdminExecResp getResult() throws TException { } } - public void addPart(AddPartReq req, AsyncMethodCallback resultHandler376) throws TException { + public void addPart(AddPartReq req, AsyncMethodCallback resultHandler405) throws TException { checkReady(); - addPart_call method_call = new addPart_call(req, resultHandler376, this, ___protocolFactory, ___transport); + addPart_call method_call = new addPart_call(req, resultHandler405, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class addPart_call extends TAsyncMethodCall { private AddPartReq req; - public addPart_call(AddPartReq req, AsyncMethodCallback resultHandler377, TAsyncClient client373, TProtocolFactory protocolFactory374, TNonblockingTransport transport375) throws TException { - super(client373, protocolFactory374, transport375, resultHandler377, false); + public addPart_call(AddPartReq req, AsyncMethodCallback resultHandler406, TAsyncClient client402, TProtocolFactory protocolFactory403, TNonblockingTransport transport404) throws TException { + super(client402, protocolFactory403, transport404, resultHandler406, false); this.req = req; } @@ -932,17 +932,17 @@ public AdminExecResp getResult() throws TException { } } - public void addLearner(AddLearnerReq req, AsyncMethodCallback resultHandler381) throws TException { + public void addLearner(AddLearnerReq req, AsyncMethodCallback resultHandler410) throws TException { checkReady(); - addLearner_call method_call = new addLearner_call(req, resultHandler381, this, ___protocolFactory, ___transport); + addLearner_call method_call = new addLearner_call(req, resultHandler410, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class addLearner_call extends TAsyncMethodCall { private AddLearnerReq req; - public addLearner_call(AddLearnerReq req, AsyncMethodCallback resultHandler382, TAsyncClient client378, TProtocolFactory protocolFactory379, TNonblockingTransport transport380) throws TException { - super(client378, protocolFactory379, transport380, resultHandler382, false); + public addLearner_call(AddLearnerReq req, AsyncMethodCallback resultHandler411, TAsyncClient client407, TProtocolFactory protocolFactory408, TNonblockingTransport transport409) throws TException { + super(client407, protocolFactory408, transport409, resultHandler411, false); this.req = req; } @@ -964,17 +964,17 @@ public AdminExecResp getResult() throws TException { } } - public void removePart(RemovePartReq req, AsyncMethodCallback resultHandler386) throws TException { + public void removePart(RemovePartReq req, AsyncMethodCallback resultHandler415) throws TException { checkReady(); - removePart_call method_call = new removePart_call(req, resultHandler386, this, ___protocolFactory, ___transport); + removePart_call method_call = new removePart_call(req, resultHandler415, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class removePart_call extends TAsyncMethodCall { private RemovePartReq req; - public removePart_call(RemovePartReq req, AsyncMethodCallback resultHandler387, TAsyncClient client383, TProtocolFactory protocolFactory384, TNonblockingTransport transport385) throws TException { - super(client383, protocolFactory384, transport385, resultHandler387, false); + public removePart_call(RemovePartReq req, AsyncMethodCallback resultHandler416, TAsyncClient client412, TProtocolFactory protocolFactory413, TNonblockingTransport transport414) throws TException { + super(client412, protocolFactory413, transport414, resultHandler416, false); this.req = req; } @@ -996,17 +996,17 @@ public AdminExecResp getResult() throws TException { } } - public void memberChange(MemberChangeReq req, AsyncMethodCallback resultHandler391) throws TException { + public void memberChange(MemberChangeReq req, AsyncMethodCallback resultHandler420) throws TException { checkReady(); - memberChange_call method_call = new memberChange_call(req, resultHandler391, this, ___protocolFactory, ___transport); + memberChange_call method_call = new memberChange_call(req, resultHandler420, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class memberChange_call extends TAsyncMethodCall { private MemberChangeReq req; - public memberChange_call(MemberChangeReq req, AsyncMethodCallback resultHandler392, TAsyncClient client388, TProtocolFactory protocolFactory389, TNonblockingTransport transport390) throws TException { - super(client388, protocolFactory389, transport390, resultHandler392, false); + public memberChange_call(MemberChangeReq req, AsyncMethodCallback resultHandler421, TAsyncClient client417, TProtocolFactory protocolFactory418, TNonblockingTransport transport419) throws TException { + super(client417, protocolFactory418, transport419, resultHandler421, false); this.req = req; } @@ -1028,17 +1028,17 @@ public AdminExecResp getResult() throws TException { } } - public void waitingForCatchUpData(CatchUpDataReq req, AsyncMethodCallback resultHandler396) throws TException { + public void waitingForCatchUpData(CatchUpDataReq req, AsyncMethodCallback resultHandler425) throws TException { checkReady(); - waitingForCatchUpData_call method_call = new waitingForCatchUpData_call(req, resultHandler396, this, ___protocolFactory, ___transport); + waitingForCatchUpData_call method_call = new waitingForCatchUpData_call(req, resultHandler425, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class waitingForCatchUpData_call extends TAsyncMethodCall { private CatchUpDataReq req; - public waitingForCatchUpData_call(CatchUpDataReq req, AsyncMethodCallback resultHandler397, TAsyncClient client393, TProtocolFactory protocolFactory394, TNonblockingTransport transport395) throws TException { - super(client393, protocolFactory394, transport395, resultHandler397, false); + public waitingForCatchUpData_call(CatchUpDataReq req, AsyncMethodCallback resultHandler426, TAsyncClient client422, TProtocolFactory protocolFactory423, TNonblockingTransport transport424) throws TException { + super(client422, protocolFactory423, transport424, resultHandler426, false); this.req = req; } @@ -1060,17 +1060,17 @@ public AdminExecResp getResult() throws TException { } } - public void createCheckpoint(CreateCPRequest req, AsyncMethodCallback resultHandler401) throws TException { + public void createCheckpoint(CreateCPRequest req, AsyncMethodCallback resultHandler430) throws TException { checkReady(); - createCheckpoint_call method_call = new createCheckpoint_call(req, resultHandler401, this, ___protocolFactory, ___transport); + createCheckpoint_call method_call = new createCheckpoint_call(req, resultHandler430, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class createCheckpoint_call extends TAsyncMethodCall { private CreateCPRequest req; - public createCheckpoint_call(CreateCPRequest req, AsyncMethodCallback resultHandler402, TAsyncClient client398, TProtocolFactory protocolFactory399, TNonblockingTransport transport400) throws TException { - super(client398, protocolFactory399, transport400, resultHandler402, false); + public createCheckpoint_call(CreateCPRequest req, AsyncMethodCallback resultHandler431, TAsyncClient client427, TProtocolFactory protocolFactory428, TNonblockingTransport transport429) throws TException { + super(client427, protocolFactory428, transport429, resultHandler431, false); this.req = req; } @@ -1092,17 +1092,17 @@ public CreateCPResp getResult() throws TException { } } - public void dropCheckpoint(DropCPRequest req, AsyncMethodCallback resultHandler406) throws TException { + public void dropCheckpoint(DropCPRequest req, AsyncMethodCallback resultHandler435) throws TException { checkReady(); - dropCheckpoint_call method_call = new dropCheckpoint_call(req, resultHandler406, this, ___protocolFactory, ___transport); + dropCheckpoint_call method_call = new dropCheckpoint_call(req, resultHandler435, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class dropCheckpoint_call extends TAsyncMethodCall { private DropCPRequest req; - public dropCheckpoint_call(DropCPRequest req, AsyncMethodCallback resultHandler407, TAsyncClient client403, TProtocolFactory protocolFactory404, TNonblockingTransport transport405) throws TException { - super(client403, protocolFactory404, transport405, resultHandler407, false); + public dropCheckpoint_call(DropCPRequest req, AsyncMethodCallback resultHandler436, TAsyncClient client432, TProtocolFactory protocolFactory433, TNonblockingTransport transport434) throws TException { + super(client432, protocolFactory433, transport434, resultHandler436, false); this.req = req; } @@ -1124,17 +1124,17 @@ public AdminExecResp getResult() throws TException { } } - public void blockingWrites(BlockingSignRequest req, AsyncMethodCallback resultHandler411) throws TException { + public void blockingWrites(BlockingSignRequest req, AsyncMethodCallback resultHandler440) throws TException { checkReady(); - blockingWrites_call method_call = new blockingWrites_call(req, resultHandler411, this, ___protocolFactory, ___transport); + blockingWrites_call method_call = new blockingWrites_call(req, resultHandler440, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class blockingWrites_call extends TAsyncMethodCall { private BlockingSignRequest req; - public blockingWrites_call(BlockingSignRequest req, AsyncMethodCallback resultHandler412, TAsyncClient client408, TProtocolFactory protocolFactory409, TNonblockingTransport transport410) throws TException { - super(client408, protocolFactory409, transport410, resultHandler412, false); + public blockingWrites_call(BlockingSignRequest req, AsyncMethodCallback resultHandler441, TAsyncClient client437, TProtocolFactory protocolFactory438, TNonblockingTransport transport439) throws TException { + super(client437, protocolFactory438, transport439, resultHandler441, false); this.req = req; } @@ -1156,17 +1156,17 @@ public AdminExecResp getResult() throws TException { } } - public void rebuildTagIndex(RebuildIndexRequest req, AsyncMethodCallback resultHandler416) throws TException { + public void rebuildTagIndex(RebuildIndexRequest req, AsyncMethodCallback resultHandler445) throws TException { checkReady(); - rebuildTagIndex_call method_call = new rebuildTagIndex_call(req, resultHandler416, this, ___protocolFactory, ___transport); + rebuildTagIndex_call method_call = new rebuildTagIndex_call(req, resultHandler445, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class rebuildTagIndex_call extends TAsyncMethodCall { private RebuildIndexRequest req; - public rebuildTagIndex_call(RebuildIndexRequest req, AsyncMethodCallback resultHandler417, TAsyncClient client413, TProtocolFactory protocolFactory414, TNonblockingTransport transport415) throws TException { - super(client413, protocolFactory414, transport415, resultHandler417, false); + public rebuildTagIndex_call(RebuildIndexRequest req, AsyncMethodCallback resultHandler446, TAsyncClient client442, TProtocolFactory protocolFactory443, TNonblockingTransport transport444) throws TException { + super(client442, protocolFactory443, transport444, resultHandler446, false); this.req = req; } @@ -1188,17 +1188,17 @@ public AdminExecResp getResult() throws TException { } } - public void rebuildEdgeIndex(RebuildIndexRequest req, AsyncMethodCallback resultHandler421) throws TException { + public void rebuildEdgeIndex(RebuildIndexRequest req, AsyncMethodCallback resultHandler450) throws TException { checkReady(); - rebuildEdgeIndex_call method_call = new rebuildEdgeIndex_call(req, resultHandler421, this, ___protocolFactory, ___transport); + rebuildEdgeIndex_call method_call = new rebuildEdgeIndex_call(req, resultHandler450, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class rebuildEdgeIndex_call extends TAsyncMethodCall { private RebuildIndexRequest req; - public rebuildEdgeIndex_call(RebuildIndexRequest req, AsyncMethodCallback resultHandler422, TAsyncClient client418, TProtocolFactory protocolFactory419, TNonblockingTransport transport420) throws TException { - super(client418, protocolFactory419, transport420, resultHandler422, false); + public rebuildEdgeIndex_call(RebuildIndexRequest req, AsyncMethodCallback resultHandler451, TAsyncClient client447, TProtocolFactory protocolFactory448, TNonblockingTransport transport449) throws TException { + super(client447, protocolFactory448, transport449, resultHandler451, false); this.req = req; } @@ -1220,17 +1220,17 @@ public AdminExecResp getResult() throws TException { } } - public void getLeaderParts(GetLeaderReq req, AsyncMethodCallback resultHandler426) throws TException { + public void getLeaderParts(GetLeaderReq req, AsyncMethodCallback resultHandler455) throws TException { checkReady(); - getLeaderParts_call method_call = new getLeaderParts_call(req, resultHandler426, this, ___protocolFactory, ___transport); + getLeaderParts_call method_call = new getLeaderParts_call(req, resultHandler455, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getLeaderParts_call extends TAsyncMethodCall { private GetLeaderReq req; - public getLeaderParts_call(GetLeaderReq req, AsyncMethodCallback resultHandler427, TAsyncClient client423, TProtocolFactory protocolFactory424, TNonblockingTransport transport425) throws TException { - super(client423, protocolFactory424, transport425, resultHandler427, false); + public getLeaderParts_call(GetLeaderReq req, AsyncMethodCallback resultHandler456, TAsyncClient client452, TProtocolFactory protocolFactory453, TNonblockingTransport transport454) throws TException { + super(client452, protocolFactory453, transport454, resultHandler456, false); this.req = req; } @@ -1252,17 +1252,17 @@ public GetLeaderPartsResp getResult() throws TException { } } - public void checkPeers(CheckPeersReq req, AsyncMethodCallback resultHandler431) throws TException { + public void checkPeers(CheckPeersReq req, AsyncMethodCallback resultHandler460) throws TException { checkReady(); - checkPeers_call method_call = new checkPeers_call(req, resultHandler431, this, ___protocolFactory, ___transport); + checkPeers_call method_call = new checkPeers_call(req, resultHandler460, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class checkPeers_call extends TAsyncMethodCall { private CheckPeersReq req; - public checkPeers_call(CheckPeersReq req, AsyncMethodCallback resultHandler432, TAsyncClient client428, TProtocolFactory protocolFactory429, TNonblockingTransport transport430) throws TException { - super(client428, protocolFactory429, transport430, resultHandler432, false); + public checkPeers_call(CheckPeersReq req, AsyncMethodCallback resultHandler461, TAsyncClient client457, TProtocolFactory protocolFactory458, TNonblockingTransport transport459) throws TException { + super(client457, protocolFactory458, transport459, resultHandler461, false); this.req = req; } @@ -1284,17 +1284,17 @@ public AdminExecResp getResult() throws TException { } } - public void addAdminTask(AddAdminTaskRequest req, AsyncMethodCallback resultHandler436) throws TException { + public void addAdminTask(AddAdminTaskRequest req, AsyncMethodCallback resultHandler465) throws TException { checkReady(); - addAdminTask_call method_call = new addAdminTask_call(req, resultHandler436, this, ___protocolFactory, ___transport); + addAdminTask_call method_call = new addAdminTask_call(req, resultHandler465, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class addAdminTask_call extends TAsyncMethodCall { private AddAdminTaskRequest req; - public addAdminTask_call(AddAdminTaskRequest req, AsyncMethodCallback resultHandler437, TAsyncClient client433, TProtocolFactory protocolFactory434, TNonblockingTransport transport435) throws TException { - super(client433, protocolFactory434, transport435, resultHandler437, false); + public addAdminTask_call(AddAdminTaskRequest req, AsyncMethodCallback resultHandler466, TAsyncClient client462, TProtocolFactory protocolFactory463, TNonblockingTransport transport464) throws TException { + super(client462, protocolFactory463, transport464, resultHandler466, false); this.req = req; } @@ -1316,17 +1316,17 @@ public AdminExecResp getResult() throws TException { } } - public void stopAdminTask(StopAdminTaskRequest req, AsyncMethodCallback resultHandler441) throws TException { + public void stopAdminTask(StopAdminTaskRequest req, AsyncMethodCallback resultHandler470) throws TException { checkReady(); - stopAdminTask_call method_call = new stopAdminTask_call(req, resultHandler441, this, ___protocolFactory, ___transport); + stopAdminTask_call method_call = new stopAdminTask_call(req, resultHandler470, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class stopAdminTask_call extends TAsyncMethodCall { private StopAdminTaskRequest req; - public stopAdminTask_call(StopAdminTaskRequest req, AsyncMethodCallback resultHandler442, TAsyncClient client438, TProtocolFactory protocolFactory439, TNonblockingTransport transport440) throws TException { - super(client438, protocolFactory439, transport440, resultHandler442, false); + public stopAdminTask_call(StopAdminTaskRequest req, AsyncMethodCallback resultHandler471, TAsyncClient client467, TProtocolFactory protocolFactory468, TNonblockingTransport transport469) throws TException { + super(client467, protocolFactory468, transport469, resultHandler471, false); this.req = req; } @@ -1348,17 +1348,17 @@ public AdminExecResp getResult() throws TException { } } - public void listClusterInfo(ListClusterInfoReq req, AsyncMethodCallback resultHandler446) throws TException { + public void listClusterInfo(ListClusterInfoReq req, AsyncMethodCallback resultHandler475) throws TException { checkReady(); - listClusterInfo_call method_call = new listClusterInfo_call(req, resultHandler446, this, ___protocolFactory, ___transport); + listClusterInfo_call method_call = new listClusterInfo_call(req, resultHandler475, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listClusterInfo_call extends TAsyncMethodCall { private ListClusterInfoReq req; - public listClusterInfo_call(ListClusterInfoReq req, AsyncMethodCallback resultHandler447, TAsyncClient client443, TProtocolFactory protocolFactory444, TNonblockingTransport transport445) throws TException { - super(client443, protocolFactory444, transport445, resultHandler447, false); + public listClusterInfo_call(ListClusterInfoReq req, AsyncMethodCallback resultHandler476, TAsyncClient client472, TProtocolFactory protocolFactory473, TNonblockingTransport transport474) throws TException { + super(client472, protocolFactory473, transport474, resultHandler476, false); this.req = req; } From bdd30658ac6f03c0ebb3febcd716f8385cbfc7aa Mon Sep 17 00:00:00 2001 From: Klay Date: Tue, 12 Oct 2021 20:54:21 -0700 Subject: [PATCH 02/11] add version verification --- .../ClientServerIncompatibleException.java | 18 ++++++++ .../client/graph/net/ConnObjectPool.java | 7 +-- .../nebula/client/graph/net/Connection.java | 8 ++-- .../nebula/client/graph/net/LoadBalancer.java | 5 ++- .../nebula/client/graph/net/NebulaPool.java | 8 ++-- .../graph/net/RoundRobinLoadBalancer.java | 15 ++++--- .../nebula/client/graph/net/Session.java | 7 ++- .../client/graph/net/SessionWrapper.java | 4 +- .../client/graph/net/SessionsManager.java | 6 ++- .../client/graph/net/SyncConnection.java | 44 ++++++++++++++----- .../client/graph/data/TestDataFromServer.java | 33 +++++++++----- .../client/graph/net/TestConnectionPool.java | 11 ++--- .../nebula/client/graph/net/TestSession.java | 6 +-- .../client/graph/net/TestSessionsManager.java | 6 ++- .../nebula/client/meta/MockNebulaGraph.java | 3 +- .../client/storage/MockStorageData.java | 3 +- .../nebula/encoder/MetaCacheImplTest.java | 4 +- 17 files changed, 128 insertions(+), 60 deletions(-) create mode 100644 client/src/main/java/com/vesoft/nebula/client/graph/exception/ClientServerIncompatibleException.java diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/exception/ClientServerIncompatibleException.java b/client/src/main/java/com/vesoft/nebula/client/graph/exception/ClientServerIncompatibleException.java new file mode 100644 index 000000000..9eb59a443 --- /dev/null +++ b/client/src/main/java/com/vesoft/nebula/client/graph/exception/ClientServerIncompatibleException.java @@ -0,0 +1,18 @@ +/* Copyright (c) 2020 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License, + * attached with Common Clause Condition 1.0, found in the LICENSES directory. + */ + +package com.vesoft.nebula.client.graph.exception; + +/** + * + */ +public class ClientServerIncompatibleException extends Exception { + public ClientServerIncompatibleException(String message) { + super("Current client is not compatible with the remote server, please check the " + + "version: " + message); + } +} + diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/ConnObjectPool.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/ConnObjectPool.java index 9e2ebd4ab..d8d4978d9 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/ConnObjectPool.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/ConnObjectPool.java @@ -2,6 +2,7 @@ import com.vesoft.nebula.client.graph.NebulaPoolConfig; import com.vesoft.nebula.client.graph.data.HostAddress; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import org.apache.commons.pool2.BasePooledObjectFactory; import org.apache.commons.pool2.PooledObject; @@ -18,7 +19,7 @@ public ConnObjectPool(LoadBalancer loadBalancer, NebulaPoolConfig config) { } @Override - public SyncConnection create() throws IOErrorException { + public SyncConnection create() throws IOErrorException, ClientServerIncompatibleException { HostAddress address = loadBalancer.getAddress(); if (address == null) { throw new IOErrorException(IOErrorException.E_ALL_BROKEN, @@ -83,11 +84,11 @@ public void activateObject(PooledObject p) throws Exception { super.activateObject(p); } - public boolean init() { + public boolean init() throws ClientServerIncompatibleException { return loadBalancer.isServersOK(); } - public void updateServerStatus() { + public void updateServerStatus() throws ClientServerIncompatibleException { loadBalancer.updateServersStatus(); } } diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/Connection.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/Connection.java index 5f94f1c84..40e43951e 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/Connection.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/Connection.java @@ -2,6 +2,7 @@ import com.vesoft.nebula.client.graph.data.HostAddress; import com.vesoft.nebula.client.graph.data.SSLParam; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; public abstract class Connection { @@ -12,11 +13,12 @@ public HostAddress getServerAddress() { } public abstract void open(HostAddress address, int timeout, SSLParam sslParam) - throws IOErrorException; + throws IOErrorException, ClientServerIncompatibleException; - public abstract void open(HostAddress address, int timeout) throws IOErrorException; + public abstract void open(HostAddress address, int timeout) throws IOErrorException, + ClientServerIncompatibleException; - public abstract void reopen() throws IOErrorException; + public abstract void reopen() throws IOErrorException, ClientServerIncompatibleException; public abstract void close(); diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/LoadBalancer.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/LoadBalancer.java index d586c12d1..d2cfa954d 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/LoadBalancer.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/LoadBalancer.java @@ -1,13 +1,14 @@ package com.vesoft.nebula.client.graph.net; import com.vesoft.nebula.client.graph.data.HostAddress; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; public interface LoadBalancer { HostAddress getAddress(); void close(); - void updateServersStatus(); + void updateServersStatus() throws ClientServerIncompatibleException; - boolean isServersOK(); + boolean isServersOK() throws ClientServerIncompatibleException; } diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java index 6fe80a2ba..285a15fd7 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java @@ -9,6 +9,7 @@ import com.vesoft.nebula.client.graph.NebulaPoolConfig; import com.vesoft.nebula.client.graph.data.HostAddress; import com.vesoft.nebula.client.graph.exception.AuthFailedException; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.client.graph.exception.InvalidConfigException; import com.vesoft.nebula.client.graph.exception.NotValidConnectionException; @@ -79,7 +80,7 @@ private void checkConfig(NebulaPoolConfig config) { * @throws InvalidConfigException if config is illegal */ public boolean init(List addresses, NebulaPoolConfig config) - throws UnknownHostException, InvalidConfigException { + throws UnknownHostException, InvalidConfigException, ClientServerIncompatibleException { checkInit(); hasInit.set(true); checkConfig(config); @@ -129,7 +130,8 @@ public void close() { * @throws AuthFailedException if authenticate failed */ public Session getSession(String userName, String password, boolean reconnect) - throws NotValidConnectionException, IOErrorException, AuthFailedException { + throws NotValidConnectionException, IOErrorException, AuthFailedException, + ClientServerIncompatibleException { checkNoInitAndClosed(); SyncConnection connection = null; try { @@ -177,7 +179,7 @@ public int getWaitersNum() { * Update the services' status when the connection is broken, * it is called by Session and NebulaPool */ - protected void updateServerStatus() { + protected void updateServerStatus() throws ClientServerIncompatibleException { checkNoInitAndClosed(); if (objectPool.getFactory() instanceof ConnObjectPool) { ((ConnObjectPool)objectPool.getFactory()).updateServerStatus(); diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/RoundRobinLoadBalancer.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/RoundRobinLoadBalancer.java index 9e7c9402a..4c444f1e7 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/RoundRobinLoadBalancer.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/RoundRobinLoadBalancer.java @@ -2,6 +2,7 @@ import com.vesoft.nebula.client.graph.data.HostAddress; import com.vesoft.nebula.client.graph.data.SSLParam; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import java.util.ArrayList; import java.util.HashMap; @@ -59,7 +60,7 @@ public HostAddress getAddress() { return null; } - public void updateServersStatus() { + public void updateServersStatus() throws ClientServerIncompatibleException { for (HostAddress addr : addresses) { if (ping(addr)) { serversStatus.put(addr, S_OK); @@ -69,7 +70,7 @@ public void updateServersStatus() { } } - public boolean ping(HostAddress addr) { + public boolean ping(HostAddress addr) throws ClientServerIncompatibleException { try { Connection connection = new SyncConnection(); if (enabledSsl) { @@ -84,7 +85,7 @@ public boolean ping(HostAddress addr) { } } - public boolean isServersOK() { + public boolean isServersOK() throws ClientServerIncompatibleException { this.updateServersStatus(); for (HostAddress addr : addresses) { if (serversStatus.get(addr) == S_BAD) { @@ -94,7 +95,11 @@ public boolean isServersOK() { return true; } - private void scheduleTask() { - updateServersStatus(); + private void scheduleTask() { + try { + updateServersStatus(); + } catch (ClientServerIncompatibleException e) { + e.printStackTrace(); + } } } diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/Session.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/Session.java index 76d5dd83b..220fc317a 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/Session.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/Session.java @@ -8,6 +8,7 @@ import com.vesoft.nebula.client.graph.data.HostAddress; import com.vesoft.nebula.client.graph.data.ResultSet; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.graph.ExecutionResponse; import java.util.concurrent.atomic.AtomicBoolean; @@ -60,7 +61,8 @@ public Session(SyncConnection connection, * such as insert ngql `INSERT VERTEX person(name) VALUES "Tom":("Tom");` * @return The ResultSet */ - public synchronized ResultSet execute(String stmt) throws IOErrorException { + public synchronized ResultSet execute(String stmt) throws + IOErrorException, ClientServerIncompatibleException { if (connection == null) { throw new IOErrorException(IOErrorException.E_CONNECT_BROKEN, "The session was released, couldn't use again."); @@ -158,7 +160,8 @@ public synchronized ResultSet execute(String stmt) throws IOErrorException { * such as insert ngql `INSERT VERTEX person(name) VALUES "Tom":("Tom");` * @return The JSON string */ - public synchronized String executeJson(String stmt) throws IOErrorException { + public synchronized String executeJson(String stmt) throws + IOErrorException, ClientServerIncompatibleException { if (connection == null) { throw new IOErrorException(IOErrorException.E_CONNECT_BROKEN, "The session was released, couldn't use again."); diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionWrapper.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionWrapper.java index 87e95cb4a..f33fc34b7 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionWrapper.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionWrapper.java @@ -7,6 +7,7 @@ package com.vesoft.nebula.client.graph.net; import com.vesoft.nebula.client.graph.data.ResultSet; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.client.graph.exception.InvalidSessionException; import java.util.concurrent.atomic.AtomicBoolean; @@ -25,7 +26,8 @@ public SessionWrapper(Session session) { * @param stmt The query sentence. * @return The ResultSet. */ - public ResultSet execute(String stmt) throws IOErrorException { + public ResultSet execute(String stmt) + throws IOErrorException, ClientServerIncompatibleException { if (!available()) { throw new InvalidSessionException(); } diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionsManager.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionsManager.java index 059199209..8c2a962aa 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionsManager.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionsManager.java @@ -9,6 +9,7 @@ import com.vesoft.nebula.client.graph.SessionsManagerConfig; import com.vesoft.nebula.client.graph.data.ResultSet; import com.vesoft.nebula.client.graph.exception.AuthFailedException; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.client.graph.exception.NotValidConnectionException; import java.net.UnknownHostException; @@ -44,7 +45,8 @@ private void checkConfig() { * @return SessionWrapper * @throws RuntimeException the exception when get SessionWrapper */ - public synchronized SessionWrapper getSessionWrapper() throws RuntimeException { + public synchronized SessionWrapper getSessionWrapper() throws RuntimeException, + ClientServerIncompatibleException { checkClose(); if (pool == null) { init(); @@ -113,7 +115,7 @@ public synchronized void close() { isClose = true; } - private void init() throws RuntimeException { + private void init() throws RuntimeException, ClientServerIncompatibleException { try { pool = new NebulaPool(); if (!pool.init(config.getAddresses(), config.getPoolConfig())) { diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java index 4e6a77161..ba97c6b13 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java @@ -14,16 +14,20 @@ import com.facebook.thrift.transport.TTransport; import com.facebook.thrift.transport.TTransportException; import com.facebook.thrift.utils.StandardCharsets; +import com.google.common.base.Charsets; import com.vesoft.nebula.ErrorCode; import com.vesoft.nebula.client.graph.data.CASignedSSLParam; import com.vesoft.nebula.client.graph.data.HostAddress; import com.vesoft.nebula.client.graph.data.SSLParam; import com.vesoft.nebula.client.graph.data.SelfSignedSSLParam; import com.vesoft.nebula.client.graph.exception.AuthFailedException; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.graph.AuthResponse; import com.vesoft.nebula.graph.ExecutionResponse; import com.vesoft.nebula.graph.GraphService; +import com.vesoft.nebula.graph.VerifyClientVersionReq; +import com.vesoft.nebula.graph.VerifyClientVersionResp; import com.vesoft.nebula.util.SslUtil; import java.io.IOException; import javax.net.ssl.SSLSocketFactory; @@ -37,7 +41,8 @@ public class SyncConnection extends Connection { private boolean enabledSsl = false; @Override - public void open(HostAddress address, int timeout, SSLParam sslParam) throws IOErrorException { + public void open(HostAddress address, int timeout, SSLParam sslParam) + throws IOErrorException, ClientServerIncompatibleException { try { SSLSocketFactory sslSocketFactory; @@ -61,17 +66,24 @@ public void open(HostAddress address, int timeout, SSLParam sslParam) throws IOE address.getPort()), this.timeout, this.timeout); this.protocol = new TCompactProtocol(transport); client = new GraphService.Client(protocol); - } catch (TException e) { + + // check if client version matches server version + VerifyClientVersionResp resp = + client.verifyClientVersion(new VerifyClientVersionReq()); + if (resp.error_code != ErrorCode.SUCCEEDED) { + client.getInputProtocol().getTransport().close(); + throw new ClientServerIncompatibleException(new String(resp.getError_msg(), + Charsets.UTF_8)); + } + } catch (TException | IOException e) { throw new IOErrorException(IOErrorException.E_UNKNOWN, e.getMessage()); - } catch (IOException e) { - e.printStackTrace(); } } @Override - public void open(HostAddress address, int timeout) throws IOErrorException { + public void open(HostAddress address, int timeout) + throws IOErrorException, ClientServerIncompatibleException { try { - this.enabledSsl = false; this.serverAddr = address; this.timeout = timeout <= 0 ? Integer.MAX_VALUE : timeout; this.transport = new TSocket( @@ -79,6 +91,15 @@ public void open(HostAddress address, int timeout) throws IOErrorException { this.transport.open(); this.protocol = new TCompactProtocol(transport); client = new GraphService.Client(protocol); + + // check if client version matches server version + VerifyClientVersionResp resp = + client.verifyClientVersion(new VerifyClientVersionReq()); + if (resp.error_code != ErrorCode.SUCCEEDED) { + client.getInputProtocol().getTransport().close(); + throw new ClientServerIncompatibleException(new String(resp.getError_msg(), + Charsets.UTF_8)); + } } catch (TException e) { throw new IOErrorException(IOErrorException.E_UNKNOWN, e.getMessage()); } @@ -95,7 +116,7 @@ public void open(HostAddress address, int timeout) throws IOErrorException { * @throws IOErrorException if io problem happen */ @Override - public void reopen() throws IOErrorException { + public void reopen() throws IOErrorException, ClientServerIncompatibleException { close(); if (enabledSsl) { open(serverAddr, timeout, sslParam); @@ -105,7 +126,7 @@ public void reopen() throws IOErrorException { } public AuthResult authenticate(String user, String password) - throws AuthFailedException, IOErrorException { + throws AuthFailedException, IOErrorException, ClientServerIncompatibleException { try { AuthResponse resp = client.authenticate(user.getBytes(), password.getBytes()); if (resp.error_code != ErrorCode.SUCCEEDED) { @@ -136,7 +157,7 @@ public AuthResult authenticate(String user, String password) } public ExecutionResponse execute(long sessionID, String stmt) - throws IOErrorException { + throws IOErrorException, ClientServerIncompatibleException { try { return client.execute(sessionID, stmt.getBytes()); } catch (TException e) { @@ -157,7 +178,7 @@ public ExecutionResponse execute(long sessionID, String stmt) } public String executeJson(long sessionID, String stmt) - throws IOErrorException { + throws IOErrorException, ClientServerIncompatibleException { try { byte[] result = client.executeJson(sessionID, stmt.getBytes()); return new String(result, StandardCharsets.UTF_8); @@ -187,8 +208,7 @@ public boolean ping() { try { execute(0, "YIELD 1;"); return true; - } catch (IOErrorException e) { - e.printStackTrace(); + } catch (IOErrorException | ClientServerIncompatibleException e) { return false; } } diff --git a/client/src/test/java/com/vesoft/nebula/client/graph/data/TestDataFromServer.java b/client/src/test/java/com/vesoft/nebula/client/graph/data/TestDataFromServer.java index d71442857..fb3ad8036 100644 --- a/client/src/test/java/com/vesoft/nebula/client/graph/data/TestDataFromServer.java +++ b/client/src/test/java/com/vesoft/nebula/client/graph/data/TestDataFromServer.java @@ -13,6 +13,7 @@ import com.vesoft.nebula.ErrorCode; import com.vesoft.nebula.Time; import com.vesoft.nebula.client.graph.NebulaPoolConfig; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.client.graph.net.NebulaPool; import com.vesoft.nebula.client.graph.net.Session; @@ -172,7 +173,8 @@ public void testAllSchemaType() { Assert.assertEquals(ValueWrapper.NullType.__NULL__, properties.get("hobby").asNull().getNullType()); - } catch (IOErrorException | UnsupportedEncodingException e) { + } catch (IOErrorException | UnsupportedEncodingException + | ClientServerIncompatibleException e) { e.printStackTrace(); assert false; } @@ -193,7 +195,8 @@ public void testList() { } Assert.assertEquals(names.stream().sorted().collect(Collectors.toList()), listVal.stream().sorted().collect(Collectors.toList())); - } catch (IOErrorException | UnsupportedEncodingException e) { + } catch (IOErrorException | UnsupportedEncodingException + | ClientServerIncompatibleException e) { e.printStackTrace(); assert false; } @@ -219,7 +222,8 @@ public void testSet() { Assert.assertEquals(result.toString(), "ColumnName: [{\"name\",\"name\",\"age\",\"birthday\"}], " + "Rows: [[\"name\", \"birthday\", \"age\"]]"); - } catch (IOErrorException | UnsupportedEncodingException e) { + } catch (IOErrorException | UnsupportedEncodingException + | ClientServerIncompatibleException e) { e.printStackTrace(); assert false; } @@ -244,7 +248,8 @@ public void testMap() { assert mapVals.containsKey("birthday"); assert mapVals.get("birthday").isString(); Assert.assertEquals("2010-10-10", mapVals.get("birthday").asString()); - } catch (IOErrorException | UnsupportedEncodingException e) { + } catch (IOErrorException | UnsupportedEncodingException + | ClientServerIncompatibleException e) { e.printStackTrace(); assert false; } @@ -270,7 +275,8 @@ public void testNode() { node.keys("student").stream().sorted().collect(Collectors.toList())); Assert.assertEquals(14, node.properties("person").keySet().size()); Assert.assertEquals(1, node.properties("student").keySet().size()); - } catch (IOErrorException | UnsupportedEncodingException e) { + } catch (IOErrorException | UnsupportedEncodingException + | ClientServerIncompatibleException e) { e.printStackTrace(); assert false; } @@ -307,7 +313,8 @@ public void testRelationship() { Assert.assertEquals( "(\"Bob\")-[:friend@100{start_year: 2018, end_year: 2020}]->(\"Lily\")", result2.rowValues(0).get(0).asRelationship().toString()); - } catch (IOErrorException | UnsupportedEncodingException e) { + } catch (IOErrorException | UnsupportedEncodingException + | ClientServerIncompatibleException e) { e.printStackTrace(); assert false; } @@ -336,7 +343,8 @@ public void testPath() { Assert.assertEquals("Bob", path.getStartNode().getId().asString()); Assert.assertEquals("Jerry", path.getEndNode().getId().asString()); Assert.assertEquals(2, path.length()); - } catch (IOErrorException | UnsupportedEncodingException e) { + } catch (IOErrorException | UnsupportedEncodingException + | ClientServerIncompatibleException e) { e.printStackTrace(); assert false; } @@ -376,7 +384,8 @@ public void tesDataset() { + "(\"a\" )<-[:like@0{}]-(\"b\" )<-[:like@0{}]-(\"c\" ), " + "(\"a\" )-[:like@0{}]->(\"f\" )<-[:like@0{}]-(\"c\" )]"; Assert.assertEquals(expectString, result.toString()); - } catch (IOErrorException | InterruptedException e) { + } catch (IOErrorException | InterruptedException + | ClientServerIncompatibleException e) { e.printStackTrace(); assert false; } @@ -387,7 +396,7 @@ public void testErrorResult() { try { ResultSet result = session.execute("FETCH PROP ON no_exist_tag \"nobody\""); Assert.assertTrue(result.toString().contains("ExecutionResponse")); - } catch (IOErrorException e) { + } catch (IOErrorException | ClientServerIncompatibleException e) { e.printStackTrace(); assert false; } @@ -407,7 +416,7 @@ public void testBasicTypeForJson() { // check space name String spaceName = resp.getJSONArray("results").getJSONObject(0).getString("spaceName"); Assert.assertEquals(spaceName, "test_data"); - } catch (IOErrorException e) { + } catch (IOErrorException | ClientServerIncompatibleException e) { e.printStackTrace(); assert false; } @@ -426,7 +435,7 @@ public void testComplexTypeForJson() { + "-09-10T02:08:02.0Z\",\"student.name\":\"Bob\",\"person.child_name\":\"Hello" + " Worl\",\"person.property\":1000,\"person.morning\":\"23:10:00.000000Z\",\"" + "person.start_school\":\"2017-09-10\",\"person.friends\":10}]"); - } catch (IOErrorException e) { + } catch (IOErrorException | ClientServerIncompatibleException e) { e.printStackTrace(); assert false; } @@ -446,7 +455,7 @@ public void testErrorForJson() { // check error message Assert.assertEquals(message, "SemanticError: `invalidTag': Unknown tag"); - } catch (IOErrorException e) { + } catch (IOErrorException | ClientServerIncompatibleException e) { e.printStackTrace(); assert false; } diff --git a/client/src/test/java/com/vesoft/nebula/client/graph/net/TestConnectionPool.java b/client/src/test/java/com/vesoft/nebula/client/graph/net/TestConnectionPool.java index d74845504..769e7bb40 100644 --- a/client/src/test/java/com/vesoft/nebula/client/graph/net/TestConnectionPool.java +++ b/client/src/test/java/com/vesoft/nebula/client/graph/net/TestConnectionPool.java @@ -10,6 +10,7 @@ import com.vesoft.nebula.client.graph.NebulaPoolConfig; import com.vesoft.nebula.client.graph.data.HostAddress; import com.vesoft.nebula.client.graph.data.ResultSet; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.client.graph.exception.InvalidConfigException; import java.net.UnknownHostException; @@ -33,7 +34,7 @@ public void testInitFailed() { Collections.singletonList(new HostAddress("127.0.0.1", 3777)), config); assert false; - } catch (UnknownHostException e) { + } catch (UnknownHostException | ClientServerIncompatibleException e) { System.out.println("We expect must reach here: init pool failed."); assert false; } catch (InvalidConfigException e) { @@ -50,7 +51,7 @@ public void testInitFailed() { Collections.singletonList(new HostAddress("127.0.0.1", 3777)), config); assert false; - } catch (UnknownHostException e) { + } catch (UnknownHostException | ClientServerIncompatibleException e) { System.out.println("We expect must reach here: init pool failed."); assert false; } catch (InvalidConfigException e) { @@ -68,7 +69,7 @@ public void testInitFailed() { Collections.singletonList(new HostAddress("127.0.0.1", 3777)), config); assert false; - } catch (UnknownHostException e) { + } catch (UnknownHostException | ClientServerIncompatibleException e) { System.out.println("We expect must reach here: init pool failed."); assert false; } catch (InvalidConfigException e) { @@ -85,7 +86,7 @@ public void testInitFailed() { Collections.singletonList(new HostAddress("127.0.0.1", 3777)), config); assert false; - } catch (UnknownHostException e) { + } catch (UnknownHostException | ClientServerIncompatibleException e) { System.out.println("We expect must reach here: init pool failed."); assert false; } catch (InvalidConfigException e) { @@ -99,7 +100,7 @@ public void testInitFailed() { new HostAddress("hostname", 3888)); NebulaPool pool = new NebulaPool(); Assert.assertFalse(pool.init(addresses, new NebulaPoolConfig())); - } catch (UnknownHostException e) { + } catch (UnknownHostException | ClientServerIncompatibleException e) { System.out.println("We expect must reach here: init pool failed."); Assert.assertTrue(true); } diff --git a/client/src/test/java/com/vesoft/nebula/client/graph/net/TestSession.java b/client/src/test/java/com/vesoft/nebula/client/graph/net/TestSession.java index 64a55b3e1..e598d6132 100644 --- a/client/src/test/java/com/vesoft/nebula/client/graph/net/TestSession.java +++ b/client/src/test/java/com/vesoft/nebula/client/graph/net/TestSession.java @@ -6,21 +6,17 @@ package com.vesoft.nebula.client.graph.net; -import com.vesoft.nebula.ErrorCode; import com.vesoft.nebula.client.graph.NebulaPoolConfig; import com.vesoft.nebula.client.graph.data.HostAddress; import com.vesoft.nebula.client.graph.data.ResultSet; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.client.util.ProcessUtil; -import java.io.BufferedReader; -import java.io.InputStreamReader; import java.util.Arrays; import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicReference; import org.junit.Assert; import org.junit.Test; @@ -110,7 +106,9 @@ public void testReconnectWithMultiServices() { new HostAddress("127.0.0.1", 9669), new HostAddress("127.0.0.1", 9670), new HostAddress("127.0.0.1", 9671)); + TimeUnit.SECONDS.sleep(15); Assert.assertTrue(pool.init(addresses, nebulaPoolConfig)); + TimeUnit.SECONDS.sleep(15); Session session = pool.getSession("root", "nebula", true); System.out.println("The address of session is " + session.getGraphHost()); diff --git a/client/src/test/java/com/vesoft/nebula/client/graph/net/TestSessionsManager.java b/client/src/test/java/com/vesoft/nebula/client/graph/net/TestSessionsManager.java index 03b017091..7f1fc6704 100644 --- a/client/src/test/java/com/vesoft/nebula/client/graph/net/TestSessionsManager.java +++ b/client/src/test/java/com/vesoft/nebula/client/graph/net/TestSessionsManager.java @@ -11,6 +11,7 @@ import com.vesoft.nebula.client.graph.data.HostAddress; import com.vesoft.nebula.client.graph.data.ResultSet; import com.vesoft.nebula.client.graph.exception.AuthFailedException; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.client.graph.exception.InvalidConfigException; import com.vesoft.nebula.client.graph.exception.InvalidSessionException; @@ -45,7 +46,8 @@ public void testBase() { } catch (UnknownHostException | NotValidConnectionException | AuthFailedException - | InterruptedException e) { + | InterruptedException + | ClientServerIncompatibleException e) { Assert.assertFalse(e.getMessage(), false); } @@ -120,7 +122,7 @@ public void testBase() { assert false; } - } catch (InvalidConfigException | IOErrorException e) { + } catch (InvalidConfigException | IOErrorException | ClientServerIncompatibleException e) { Assert.fail(); } } diff --git a/client/src/test/java/com/vesoft/nebula/client/meta/MockNebulaGraph.java b/client/src/test/java/com/vesoft/nebula/client/meta/MockNebulaGraph.java index 5c80bc114..2643824e4 100644 --- a/client/src/test/java/com/vesoft/nebula/client/meta/MockNebulaGraph.java +++ b/client/src/test/java/com/vesoft/nebula/client/meta/MockNebulaGraph.java @@ -10,6 +10,7 @@ import com.vesoft.nebula.client.graph.data.HostAddress; import com.vesoft.nebula.client.graph.data.ResultSet; import com.vesoft.nebula.client.graph.exception.AuthFailedException; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.client.graph.exception.NotValidConnectionException; import com.vesoft.nebula.client.graph.net.NebulaPool; @@ -44,7 +45,7 @@ public static void initGraph() { System.exit(1); } } catch (UnknownHostException | NotValidConnectionException - | IOErrorException | AuthFailedException e) { + | IOErrorException | AuthFailedException | ClientServerIncompatibleException e) { e.printStackTrace(); } finally { pool.close(); diff --git a/client/src/test/java/com/vesoft/nebula/client/storage/MockStorageData.java b/client/src/test/java/com/vesoft/nebula/client/storage/MockStorageData.java index da9f98601..8a376b506 100644 --- a/client/src/test/java/com/vesoft/nebula/client/storage/MockStorageData.java +++ b/client/src/test/java/com/vesoft/nebula/client/storage/MockStorageData.java @@ -10,6 +10,7 @@ import com.vesoft.nebula.client.graph.data.HostAddress; import com.vesoft.nebula.client.graph.data.ResultSet; import com.vesoft.nebula.client.graph.exception.AuthFailedException; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.client.graph.exception.NotValidConnectionException; import com.vesoft.nebula.client.graph.net.NebulaPool; @@ -49,7 +50,7 @@ public static void initGraph() { assert (false); } } catch (UnknownHostException | NotValidConnectionException - | IOErrorException | AuthFailedException e) { + | IOErrorException | AuthFailedException | ClientServerIncompatibleException e) { e.printStackTrace(); } finally { pool.close(); diff --git a/client/src/test/java/com/vesoft/nebula/encoder/MetaCacheImplTest.java b/client/src/test/java/com/vesoft/nebula/encoder/MetaCacheImplTest.java index ccfdff3f0..09bda6469 100644 --- a/client/src/test/java/com/vesoft/nebula/encoder/MetaCacheImplTest.java +++ b/client/src/test/java/com/vesoft/nebula/encoder/MetaCacheImplTest.java @@ -61,7 +61,7 @@ private Schema genNoDefaultVal() { new ColumnTypeDef(PropertyType.STRING)); columns.add(columnDef); columnDef = new ColumnDef(("Col09").getBytes(), - new ColumnTypeDef(PropertyType.FIXED_STRING, (short)12)); + new ColumnTypeDef(PropertyType.FIXED_STRING, (short)12, null)); columns.add(columnDef); columnDef = new ColumnDef(("Col10").getBytes(), new ColumnTypeDef(PropertyType.TIMESTAMP)); @@ -178,7 +178,7 @@ public MetaCacheImplTest() { "utf-8".getBytes(), "utf-8".getBytes(), new ColumnTypeDef( - PropertyType.FIXED_STRING, (short)20)); + PropertyType.FIXED_STRING, (short)20, null)); this.spaceItem = spaceItem; this.spaceItem.properties = spaceDesc; From c81b2accece0f529c817ecc99ab09edc1f4518b4 Mon Sep 17 00:00:00 2001 From: Klay Date: Thu, 14 Oct 2021 23:04:23 -0700 Subject: [PATCH 03/11] add meta client version check --- .../vesoft/nebula/client/meta/MetaClient.java | 42 +++++++++++++------ .../nebula/client/meta/MetaManager.java | 14 +++++-- .../nebula/client/meta/TestMetaClient.java | 22 ++++++---- .../nebula/client/meta/TestMetaManager.java | 3 +- 4 files changed, 57 insertions(+), 24 deletions(-) diff --git a/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java b/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java index 47f7c14ed..7334455af 100644 --- a/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java +++ b/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java @@ -10,9 +10,11 @@ import com.facebook.thrift.protocol.TCompactProtocol; import com.facebook.thrift.transport.TSocket; import com.facebook.thrift.transport.TTransportException; +import com.google.common.base.Charsets; import com.vesoft.nebula.ErrorCode; import com.vesoft.nebula.HostAddr; import com.vesoft.nebula.client.graph.data.HostAddress; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.meta.exception.ExecuteFailedException; import com.vesoft.nebula.meta.EdgeItem; import com.vesoft.nebula.meta.GetEdgeReq; @@ -39,6 +41,8 @@ import com.vesoft.nebula.meta.Schema; import com.vesoft.nebula.meta.SpaceItem; import com.vesoft.nebula.meta.TagItem; +import com.vesoft.nebula.meta.VerifyClientVersionReq; +import com.vesoft.nebula.meta.VerifyClientVersionResp; import java.util.Arrays; import java.util.HashSet; import java.util.List; @@ -85,28 +89,41 @@ public MetaClient(List addresses, int timeout, int connectionRetry, this.addresses = addresses; } - public void connect() throws TException { + public void connect() + throws TException, ClientServerIncompatibleException { doConnect(); } /** * connect nebula meta server */ - private void doConnect() throws TTransportException { + private void doConnect() + throws TTransportException, ClientServerIncompatibleException { Random random = new Random(System.currentTimeMillis()); int position = random.nextInt(addresses.size()); HostAddress address = addresses.get(position); getClient(address.getHost(), address.getPort()); } - private void getClient(String host, int port) throws TTransportException { + private void getClient(String host, int port) + throws TTransportException, ClientServerIncompatibleException { transport = new TSocket(host, port, timeout, timeout); transport.open(); protocol = new TCompactProtocol(transport); client = new MetaService.Client(protocol); + + // check if client version matches server version + VerifyClientVersionResp resp = + client.verifyClientVersion(new VerifyClientVersionReq()); + if (resp.getCode() != ErrorCode.SUCCEEDED) { + client.getInputProtocol().getTransport().close(); + throw new ClientServerIncompatibleException(new String(resp.getError_msg(), + Charsets.UTF_8)); + } } - private void freshClient(HostAddr leader) throws TTransportException { + private void freshClient(HostAddr leader) + throws TTransportException, ClientServerIncompatibleException { close(); getClient(leader.getHost(), leader.getPort()); } @@ -125,7 +142,8 @@ public void close() { * * @return */ - public synchronized List getSpaces() throws TException, ExecuteFailedException { + public synchronized List getSpaces() + throws TException, ExecuteFailedException, ClientServerIncompatibleException { int retry = RETRY_TIMES; ListSpacesReq request = new ListSpacesReq(); ListSpacesResp response = null; @@ -158,7 +176,7 @@ public synchronized List getSpaces() throws TException, ExecuteFailedExc * @return SpaceItem */ public synchronized SpaceItem getSpace(String spaceName) throws TException, - ExecuteFailedException { + ExecuteFailedException, ClientServerIncompatibleException { int retry = RETRY_TIMES; GetSpaceReq request = new GetSpaceReq(); request.setSpace_name(spaceName.getBytes()); @@ -192,7 +210,7 @@ public synchronized SpaceItem getSpace(String spaceName) throws TException, * @return TagItem list */ public synchronized List getTags(String spaceName) - throws TException, ExecuteFailedException { + throws TException, ExecuteFailedException, ClientServerIncompatibleException { int retry = RETRY_TIMES; int spaceID = getSpace(spaceName).space_id; @@ -229,7 +247,7 @@ public synchronized List getTags(String spaceName) * @return Schema */ public synchronized Schema getTag(String spaceName, String tagName) - throws TException, ExecuteFailedException { + throws TException, ExecuteFailedException, ClientServerIncompatibleException { int retry = RETRY_TIMES; GetTagReq request = new GetTagReq(); int spaceID = getSpace(spaceName).getSpace_id(); @@ -268,7 +286,7 @@ public synchronized Schema getTag(String spaceName, String tagName) * @return EdgeItem list */ public synchronized List getEdges(String spaceName) - throws TException, ExecuteFailedException { + throws TException, ExecuteFailedException, ClientServerIncompatibleException { int retry = RETRY_TIMES; int spaceID = getSpace(spaceName).getSpace_id(); ListEdgesReq request = new ListEdgesReq(spaceID); @@ -303,7 +321,7 @@ public synchronized List getEdges(String spaceName) * @return Schema */ public synchronized Schema getEdge(String spaceName, String edgeName) - throws TException, ExecuteFailedException { + throws TException, ExecuteFailedException, ClientServerIncompatibleException { int retry = RETRY_TIMES; GetEdgeReq request = new GetEdgeReq(); int spaceID = getSpace(spaceName).getSpace_id(); @@ -343,7 +361,7 @@ public synchronized Schema getEdge(String spaceName, String edgeName) * @return */ public synchronized Map> getPartsAlloc(String spaceName) - throws ExecuteFailedException, TException { + throws ExecuteFailedException, TException, ClientServerIncompatibleException { int retry = RETRY_TIMES; GetPartsAllocReq request = new GetPartsAllocReq(); int spaceID = getSpace(spaceName).getSpace_id(); @@ -375,7 +393,7 @@ public synchronized Map> getPartsAlloc(String spaceName) /** * get all Storaged servers */ - public synchronized Set listHosts() { + public synchronized Set listHosts() throws ClientServerIncompatibleException { int retry = RETRY_TIMES; ListHostsReq request = new ListHostsReq(); request.setType(ListHostType.STORAGE); diff --git a/client/src/main/java/com/vesoft/nebula/client/meta/MetaManager.java b/client/src/main/java/com/vesoft/nebula/client/meta/MetaManager.java index a68b79e18..b8425872f 100644 --- a/client/src/main/java/com/vesoft/nebula/client/meta/MetaManager.java +++ b/client/src/main/java/com/vesoft/nebula/client/meta/MetaManager.java @@ -10,6 +10,7 @@ import com.google.common.collect.Maps; import com.vesoft.nebula.HostAddr; import com.vesoft.nebula.client.graph.data.HostAddress; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.meta.exception.ExecuteFailedException; import com.vesoft.nebula.meta.EdgeItem; import com.vesoft.nebula.meta.IdName; @@ -49,7 +50,8 @@ private class SpaceInfo { /** * init the meta info cache */ - public MetaManager(List address) throws TException { + public MetaManager(List address) + throws TException, ClientServerIncompatibleException { metaClient = new MetaClient(address); metaClient.connect(); fillMetaInfo(); @@ -120,7 +122,7 @@ private void fillMetaInfo() { } finally { lock.writeLock().unlock(); } - } catch (TException | ExecuteFailedException e) { + } catch (TException | ExecuteFailedException | ClientServerIncompatibleException e) { LOGGER.error(e.getMessage()); } } @@ -330,7 +332,13 @@ public void updateLeader(String spaceName, int part, HostAddr newLeader) * get all storage addresses */ public Set listHosts() { - Set hosts = metaClient.listHosts(); + Set hosts; + try { + hosts = metaClient.listHosts(); + } catch (ClientServerIncompatibleException e) { + LOGGER.error("client version does not match server version"); + return new HashSet<>(); + } if (hosts == null) { return new HashSet<>(); } diff --git a/client/src/test/java/com/vesoft/nebula/client/meta/TestMetaClient.java b/client/src/test/java/com/vesoft/nebula/client/meta/TestMetaClient.java index 6d3a06a2e..1c5f32906 100644 --- a/client/src/test/java/com/vesoft/nebula/client/meta/TestMetaClient.java +++ b/client/src/test/java/com/vesoft/nebula/client/meta/TestMetaClient.java @@ -7,6 +7,7 @@ package com.vesoft.nebula.client.meta; import com.facebook.thrift.TException; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.meta.exception.ExecuteFailedException; import com.vesoft.nebula.client.util.ProcessUtil; import com.vesoft.nebula.meta.EdgeItem; @@ -40,7 +41,7 @@ private void connect() { metaClient = new MetaClient(address, port); try { metaClient.connect(); - } catch (TException e) { + } catch (TException | ClientServerIncompatibleException e) { e.printStackTrace(); assert (false); } @@ -51,7 +52,7 @@ public void testFailConnect() { MetaClient client = new MetaClient(address, port); try { client.connect(); - } catch (TException e) { + } catch (TException | ClientServerIncompatibleException e) { assert (true); } } @@ -61,7 +62,7 @@ public void testGetSpaces() { List spaces = metaClient.getSpaces(); assert (spaces.size() >= 1); assert (metaClient.getSpace("testMeta") != null); - } catch (TException | ExecuteFailedException e) { + } catch (TException | ExecuteFailedException | ClientServerIncompatibleException e) { LOGGER.error(e.getMessage()); e.printStackTrace(); assert (false); @@ -73,7 +74,7 @@ public void testGetTags() { List tags = metaClient.getTags("testMeta"); Assert.assertTrue(tags.size() >= 1); assert (metaClient.getTag("testMeta", "person") != null); - } catch (TException | ExecuteFailedException e) { + } catch (TException | ExecuteFailedException | ClientServerIncompatibleException e) { e.printStackTrace(); assert (false); } @@ -84,7 +85,7 @@ public void testGetEdges() { List edges = metaClient.getEdges("testMeta"); Assert.assertTrue(edges.size() >= 1); assert (metaClient.getEdge("testMeta", "friend") != null); - } catch (TException | ExecuteFailedException e) { + } catch (TException | ExecuteFailedException | ClientServerIncompatibleException e) { e.printStackTrace(); assert (false); } @@ -93,13 +94,13 @@ public void testGetEdges() { public void testGetPartsAlloc() { try { assert (metaClient.getPartsAlloc("testMeta").size() == 10); - } catch (ExecuteFailedException | TException e) { + } catch (ExecuteFailedException | TException | ClientServerIncompatibleException e) { e.printStackTrace(); assert (false); } } - public void testListHosts() { + public void testListHosts() throws ClientServerIncompatibleException { if (metaClient == null) { metaClient = new MetaClient(address, port); } @@ -122,7 +123,12 @@ public void testListOnlineHosts() { if (metaClient == null) { metaClient = new MetaClient(address, port); } - assert (metaClient.listHosts().size() == 2); + try { + assert (metaClient.listHosts().size() == 2); + } catch (ClientServerIncompatibleException e) { + LOGGER.error("client version does not match server version", e); + assert (false); + } try { runtime.exec("docker start nebula-docker-compose_storaged0_1") diff --git a/client/src/test/java/com/vesoft/nebula/client/meta/TestMetaManager.java b/client/src/test/java/com/vesoft/nebula/client/meta/TestMetaManager.java index ac3cf8ed9..9782a3924 100644 --- a/client/src/test/java/com/vesoft/nebula/client/meta/TestMetaManager.java +++ b/client/src/test/java/com/vesoft/nebula/client/meta/TestMetaManager.java @@ -8,6 +8,7 @@ import com.vesoft.nebula.HostAddr; import com.vesoft.nebula.client.graph.data.HostAddress; +import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.meta.EdgeItem; import com.vesoft.nebula.meta.SpaceItem; import com.vesoft.nebula.meta.TagItem; @@ -97,7 +98,7 @@ public void testGetSpaceParts() { Assert.assertEquals(hostAddr.port, 4400); } - public void testMultiVersionSchema() { + public void testMultiVersionSchema() throws ClientServerIncompatibleException { MockNebulaGraph.createMultiVersionTagAndEdge(); metaManager.close(); metaManager = new MetaManager( From fceb9cefbb6e43234e765691ade8bd7a33727fa6 Mon Sep 17 00:00:00 2001 From: Klay Date: Fri, 15 Oct 2021 11:17:03 -0700 Subject: [PATCH 04/11] catch ClientServerIncompatibleException in ping --- .../ClientServerIncompatibleException.java | 2 +- .../client/graph/net/ConnObjectPool.java | 4 ++-- .../nebula/client/graph/net/LoadBalancer.java | 4 ++-- .../nebula/client/graph/net/NebulaPool.java | 4 ++-- .../graph/net/RoundRobinLoadBalancer.java | 18 +++++++++--------- .../client/graph/net/SessionsManager.java | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/exception/ClientServerIncompatibleException.java b/client/src/main/java/com/vesoft/nebula/client/graph/exception/ClientServerIncompatibleException.java index 9eb59a443..6287a381f 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/exception/ClientServerIncompatibleException.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/exception/ClientServerIncompatibleException.java @@ -1,4 +1,4 @@ -/* Copyright (c) 2020 vesoft inc. All rights reserved. +/* Copyright (c) 2021 vesoft inc. All rights reserved. * * This source code is licensed under Apache 2.0 License, * attached with Common Clause Condition 1.0, found in the LICENSES directory. diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/ConnObjectPool.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/ConnObjectPool.java index d8d4978d9..b9f088b89 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/ConnObjectPool.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/ConnObjectPool.java @@ -84,11 +84,11 @@ public void activateObject(PooledObject p) throws Exception { super.activateObject(p); } - public boolean init() throws ClientServerIncompatibleException { + public boolean init() { return loadBalancer.isServersOK(); } - public void updateServerStatus() throws ClientServerIncompatibleException { + public void updateServerStatus() { loadBalancer.updateServersStatus(); } } diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/LoadBalancer.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/LoadBalancer.java index d2cfa954d..b26eeaeae 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/LoadBalancer.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/LoadBalancer.java @@ -8,7 +8,7 @@ public interface LoadBalancer { void close(); - void updateServersStatus() throws ClientServerIncompatibleException; + void updateServersStatus(); - boolean isServersOK() throws ClientServerIncompatibleException; + boolean isServersOK(); } diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java index 285a15fd7..54c0c4670 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java @@ -80,7 +80,7 @@ private void checkConfig(NebulaPoolConfig config) { * @throws InvalidConfigException if config is illegal */ public boolean init(List addresses, NebulaPoolConfig config) - throws UnknownHostException, InvalidConfigException, ClientServerIncompatibleException { + throws UnknownHostException, InvalidConfigException { checkInit(); hasInit.set(true); checkConfig(config); @@ -179,7 +179,7 @@ public int getWaitersNum() { * Update the services' status when the connection is broken, * it is called by Session and NebulaPool */ - protected void updateServerStatus() throws ClientServerIncompatibleException { + protected void updateServerStatus() { checkNoInitAndClosed(); if (objectPool.getFactory() instanceof ConnObjectPool) { ((ConnObjectPool)objectPool.getFactory()).updateServerStatus(); diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/RoundRobinLoadBalancer.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/RoundRobinLoadBalancer.java index 4c444f1e7..bf6dd2381 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/RoundRobinLoadBalancer.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/RoundRobinLoadBalancer.java @@ -4,6 +4,8 @@ import com.vesoft.nebula.client.graph.data.SSLParam; import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -15,6 +17,7 @@ public class RoundRobinLoadBalancer implements LoadBalancer { + private static final Logger LOGGER = LoggerFactory.getLogger(RoundRobinLoadBalancer.class); private static final int S_OK = 0; private static final int S_BAD = 1; private final List addresses = new ArrayList<>(); @@ -60,7 +63,7 @@ public HostAddress getAddress() { return null; } - public void updateServersStatus() throws ClientServerIncompatibleException { + public void updateServersStatus() { for (HostAddress addr : addresses) { if (ping(addr)) { serversStatus.put(addr, S_OK); @@ -70,7 +73,7 @@ public void updateServersStatus() throws ClientServerIncompatibleException { } } - public boolean ping(HostAddress addr) throws ClientServerIncompatibleException { + public boolean ping(HostAddress addr) { try { Connection connection = new SyncConnection(); if (enabledSsl) { @@ -80,12 +83,13 @@ public boolean ping(HostAddress addr) throws ClientServerIncompatibleException { } connection.close(); return true; - } catch (IOErrorException e) { + } catch (IOErrorException | ClientServerIncompatibleException e) { + LOGGER.error("ping failed", e); return false; } } - public boolean isServersOK() throws ClientServerIncompatibleException { + public boolean isServersOK() { this.updateServersStatus(); for (HostAddress addr : addresses) { if (serversStatus.get(addr) == S_BAD) { @@ -96,10 +100,6 @@ public boolean isServersOK() throws ClientServerIncompatibleException { } private void scheduleTask() { - try { - updateServersStatus(); - } catch (ClientServerIncompatibleException e) { - e.printStackTrace(); - } + updateServersStatus(); } } diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionsManager.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionsManager.java index 8c2a962aa..9c1aa9a88 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionsManager.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionsManager.java @@ -115,7 +115,7 @@ public synchronized void close() { isClose = true; } - private void init() throws RuntimeException, ClientServerIncompatibleException { + private void init() throws RuntimeException { try { pool = new NebulaPool(); if (!pool.init(config.getAddresses(), config.getPoolConfig())) { From 25f74b2395ded43017164f9eeb2e1f8c9763eff0 Mon Sep 17 00:00:00 2001 From: Klay Date: Sun, 17 Oct 2021 19:25:26 -0700 Subject: [PATCH 05/11] fix typo --- .../graph/net/RoundRobinLoadBalancer.java | 5 ++--- .../client/graph/net/SyncConnection.java | 18 +++++++++++++----- .../client/graph/net/TestConnectionPool.java | 11 +++++------ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/RoundRobinLoadBalancer.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/RoundRobinLoadBalancer.java index bf6dd2381..395eca3a0 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/RoundRobinLoadBalancer.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/RoundRobinLoadBalancer.java @@ -4,8 +4,6 @@ import com.vesoft.nebula.client.graph.data.SSLParam; import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -14,7 +12,8 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; - +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class RoundRobinLoadBalancer implements LoadBalancer { private static final Logger LOGGER = LoggerFactory.getLogger(RoundRobinLoadBalancer.class); diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java index ba97c6b13..86db487d6 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java @@ -157,7 +157,7 @@ public AuthResult authenticate(String user, String password) } public ExecutionResponse execute(long sessionID, String stmt) - throws IOErrorException, ClientServerIncompatibleException { + throws IOErrorException { try { return client.execute(sessionID, stmt.getBytes()); } catch (TException e) { @@ -169,7 +169,11 @@ public ExecutionResponse execute(long sessionID, String stmt) throw new IOErrorException(IOErrorException.E_NO_OPEN, te.getMessage()); } else if (te.getType() == TTransportException.TIMED_OUT || te.getMessage().contains("Read timed out")) { - reopen(); + try { + reopen(); + } catch (ClientServerIncompatibleException ex) { + throw new IOErrorException(IOErrorException.E_TIME_OUT, te.getMessage()); + } throw new IOErrorException(IOErrorException.E_TIME_OUT, te.getMessage()); } } @@ -178,7 +182,7 @@ public ExecutionResponse execute(long sessionID, String stmt) } public String executeJson(long sessionID, String stmt) - throws IOErrorException, ClientServerIncompatibleException { + throws IOErrorException { try { byte[] result = client.executeJson(sessionID, stmt.getBytes()); return new String(result, StandardCharsets.UTF_8); @@ -191,7 +195,11 @@ public String executeJson(long sessionID, String stmt) throw new IOErrorException(IOErrorException.E_NO_OPEN, te.getMessage()); } else if (te.getType() == TTransportException.TIMED_OUT || te.getMessage().contains("Read timed out")) { - reopen(); + try { + reopen(); + } catch (ClientServerIncompatibleException ex) { + throw new IOErrorException(IOErrorException.E_TIME_OUT, te.getMessage()); + } throw new IOErrorException(IOErrorException.E_TIME_OUT, te.getMessage()); } } @@ -208,7 +216,7 @@ public boolean ping() { try { execute(0, "YIELD 1;"); return true; - } catch (IOErrorException | ClientServerIncompatibleException e) { + } catch (IOErrorException e) { return false; } } diff --git a/client/src/test/java/com/vesoft/nebula/client/graph/net/TestConnectionPool.java b/client/src/test/java/com/vesoft/nebula/client/graph/net/TestConnectionPool.java index 769e7bb40..ba7a972a9 100644 --- a/client/src/test/java/com/vesoft/nebula/client/graph/net/TestConnectionPool.java +++ b/client/src/test/java/com/vesoft/nebula/client/graph/net/TestConnectionPool.java @@ -10,7 +10,6 @@ import com.vesoft.nebula.client.graph.NebulaPoolConfig; import com.vesoft.nebula.client.graph.data.HostAddress; import com.vesoft.nebula.client.graph.data.ResultSet; -import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.client.graph.exception.InvalidConfigException; import java.net.UnknownHostException; @@ -34,7 +33,7 @@ public void testInitFailed() { Collections.singletonList(new HostAddress("127.0.0.1", 3777)), config); assert false; - } catch (UnknownHostException | ClientServerIncompatibleException e) { + } catch (UnknownHostException e) { System.out.println("We expect must reach here: init pool failed."); assert false; } catch (InvalidConfigException e) { @@ -51,7 +50,7 @@ public void testInitFailed() { Collections.singletonList(new HostAddress("127.0.0.1", 3777)), config); assert false; - } catch (UnknownHostException | ClientServerIncompatibleException e) { + } catch (UnknownHostException e) { System.out.println("We expect must reach here: init pool failed."); assert false; } catch (InvalidConfigException e) { @@ -69,7 +68,7 @@ public void testInitFailed() { Collections.singletonList(new HostAddress("127.0.0.1", 3777)), config); assert false; - } catch (UnknownHostException | ClientServerIncompatibleException e) { + } catch (UnknownHostException e) { System.out.println("We expect must reach here: init pool failed."); assert false; } catch (InvalidConfigException e) { @@ -86,7 +85,7 @@ public void testInitFailed() { Collections.singletonList(new HostAddress("127.0.0.1", 3777)), config); assert false; - } catch (UnknownHostException | ClientServerIncompatibleException e) { + } catch (UnknownHostException e) { System.out.println("We expect must reach here: init pool failed."); assert false; } catch (InvalidConfigException e) { @@ -100,7 +99,7 @@ public void testInitFailed() { new HostAddress("hostname", 3888)); NebulaPool pool = new NebulaPool(); Assert.assertFalse(pool.init(addresses, new NebulaPoolConfig())); - } catch (UnknownHostException | ClientServerIncompatibleException e) { + } catch (UnknownHostException e) { System.out.println("We expect must reach here: init pool failed."); Assert.assertTrue(true); } From 227ffce9978bfa3b23c53998c3d3369c4bd86503 Mon Sep 17 00:00:00 2001 From: Klay Date: Sun, 17 Oct 2021 20:51:56 -0700 Subject: [PATCH 06/11] Update TestDataFromServer.java --- .../vesoft/nebula/client/graph/data/TestDataFromServer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/test/java/com/vesoft/nebula/client/graph/data/TestDataFromServer.java b/client/src/test/java/com/vesoft/nebula/client/graph/data/TestDataFromServer.java index fb3ad8036..25a46856e 100644 --- a/client/src/test/java/com/vesoft/nebula/client/graph/data/TestDataFromServer.java +++ b/client/src/test/java/com/vesoft/nebula/client/graph/data/TestDataFromServer.java @@ -468,7 +468,7 @@ public void testSelfSignedSsl() { try { Runtime runtime = Runtime.getRuntime(); runtime.exec("docker-compose -f src/test/resources/docker-compose" - + "-selfsigned.yaml up -d").waitFor(20,TimeUnit.SECONDS); + + "-selfsigned.yaml up -d"); NebulaPoolConfig nebulaSslPoolConfig = new NebulaPoolConfig(); nebulaSslPoolConfig.setMaxConnSize(100); @@ -477,6 +477,7 @@ public void testSelfSignedSsl() { "src/test/resources/ssl/selfsigned.pem", "src/test/resources/ssl/selfsigned.key", "vesoft")); + TimeUnit.SECONDS.sleep(45); Assert.assertTrue(sslPool.init(Arrays.asList(new HostAddress("127.0.0.1", 8669)), nebulaSslPoolConfig)); sslSession = sslPool.getSession("root", "nebula", true); @@ -508,7 +509,7 @@ public void testCASignedSsl() { try { Runtime runtime = Runtime.getRuntime(); runtime.exec("docker-compose -f src/test/resources/docker-compose" - + "-casigned.yaml up -d").waitFor(20,TimeUnit.SECONDS); + + "-casigned.yaml up -d"); NebulaPoolConfig nebulaSslPoolConfig = new NebulaPoolConfig(); nebulaSslPoolConfig.setMaxConnSize(100); @@ -517,6 +518,7 @@ public void testCASignedSsl() { "src/test/resources/ssl/casigned.pem", "src/test/resources/ssl/casigned.crt", "src/test/resources/ssl/casigned.key")); + TimeUnit.SECONDS.sleep(45); Assert.assertTrue(sslPool.init(Arrays.asList(new HostAddress("127.0.0.1", 8669)), nebulaSslPoolConfig)); sslSession = sslPool.getSession("root", "nebula", true); From dc38de0b6737014dedf4d3457152e6b55b6cb53f Mon Sep 17 00:00:00 2001 From: Klay Date: Sun, 17 Oct 2021 21:55:45 -0700 Subject: [PATCH 07/11] optimize sslSocketFactory creation in SyncConnection --- .../client/graph/net/SyncConnection.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java index 86db487d6..4affed347 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java @@ -39,27 +39,25 @@ public class SyncConnection extends Connection { private int timeout = 0; private SSLParam sslParam = null; private boolean enabledSsl = false; + private SSLSocketFactory sslSocketFactory = null; @Override public void open(HostAddress address, int timeout, SSLParam sslParam) throws IOErrorException, ClientServerIncompatibleException { try { - SSLSocketFactory sslSocketFactory; this.serverAddr = address; this.timeout = timeout <= 0 ? Integer.MAX_VALUE : timeout; this.enabledSsl = true; this.sslParam = sslParam; - if (sslParam.getSignMode() == SSLParam.SignMode.CA_SIGNED) { - sslSocketFactory = - SslUtil.getSSLSocketFactoryWithCA((CASignedSSLParam) sslParam); - } else { - sslSocketFactory = - SslUtil.getSSLSocketFactoryWithoutCA((SelfSignedSSLParam) sslParam); - } if (sslSocketFactory == null) { - throw new IOErrorException(IOErrorException.E_UNKNOWN, - "SSL Socket Factory Creation failed"); + if (sslParam.getSignMode() == SSLParam.SignMode.CA_SIGNED) { + sslSocketFactory = + SslUtil.getSSLSocketFactoryWithCA((CASignedSSLParam) sslParam); + } else { + sslSocketFactory = + SslUtil.getSSLSocketFactoryWithoutCA((SelfSignedSSLParam) sslParam); + } } this.transport = new TSocket( sslSocketFactory.createSocket(address.getHost(), From 923192e455c30868a5191600033955d41b8cb808 Mon Sep 17 00:00:00 2001 From: Klay Date: Sun, 17 Oct 2021 23:10:20 -0700 Subject: [PATCH 08/11] update meta client ClientServerIncompatibleException handling --- .../vesoft/nebula/client/meta/MetaClient.java | 33 +++++++++++++------ .../nebula/client/meta/MetaManager.java | 10 ++---- .../nebula/client/meta/TestMetaClient.java | 17 ++++------ 3 files changed, 31 insertions(+), 29 deletions(-) diff --git a/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java b/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java index 7334455af..e4e8c9046 100644 --- a/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java +++ b/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java @@ -142,8 +142,7 @@ public void close() { * * @return */ - public synchronized List getSpaces() - throws TException, ExecuteFailedException, ClientServerIncompatibleException { + public synchronized List getSpaces() throws TException, ExecuteFailedException { int retry = RETRY_TIMES; ListSpacesReq request = new ListSpacesReq(); ListSpacesResp response = null; @@ -159,6 +158,8 @@ public synchronized List getSpaces() } catch (TException e) { LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); throw e; + } catch (ClientServerIncompatibleException e) { + LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); } if (response.getCode() == ErrorCode.SUCCEEDED) { return response.getSpaces(); @@ -176,7 +177,7 @@ public synchronized List getSpaces() * @return SpaceItem */ public synchronized SpaceItem getSpace(String spaceName) throws TException, - ExecuteFailedException, ClientServerIncompatibleException { + ExecuteFailedException { int retry = RETRY_TIMES; GetSpaceReq request = new GetSpaceReq(); request.setSpace_name(spaceName.getBytes()); @@ -193,6 +194,8 @@ public synchronized SpaceItem getSpace(String spaceName) throws TException, } catch (TException e) { LOGGER.error(String.format("Get Space Error: %s", e.getMessage())); throw e; + } catch (ClientServerIncompatibleException e) { + LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); } if (response.getCode() == ErrorCode.SUCCEEDED) { return response.getItem(); @@ -210,7 +213,7 @@ public synchronized SpaceItem getSpace(String spaceName) throws TException, * @return TagItem list */ public synchronized List getTags(String spaceName) - throws TException, ExecuteFailedException, ClientServerIncompatibleException { + throws TException, ExecuteFailedException { int retry = RETRY_TIMES; int spaceID = getSpace(spaceName).space_id; @@ -228,6 +231,8 @@ public synchronized List getTags(String spaceName) } catch (TException e) { LOGGER.error(String.format("Get Tag Error: %s", e.getMessage())); throw e; + } catch (ClientServerIncompatibleException e) { + LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); } if (response.getCode() == ErrorCode.SUCCEEDED) { return response.getTags(); @@ -247,7 +252,7 @@ public synchronized List getTags(String spaceName) * @return Schema */ public synchronized Schema getTag(String spaceName, String tagName) - throws TException, ExecuteFailedException, ClientServerIncompatibleException { + throws TException, ExecuteFailedException { int retry = RETRY_TIMES; GetTagReq request = new GetTagReq(); int spaceID = getSpace(spaceName).getSpace_id(); @@ -268,6 +273,8 @@ public synchronized Schema getTag(String spaceName, String tagName) } catch (TException e) { LOGGER.error(String.format("Get Tag Error: %s", e.getMessage())); throw e; + } catch (ClientServerIncompatibleException e) { + LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); } if (response.getCode() == ErrorCode.SUCCEEDED) { return response.getSchema(); @@ -286,7 +293,7 @@ public synchronized Schema getTag(String spaceName, String tagName) * @return EdgeItem list */ public synchronized List getEdges(String spaceName) - throws TException, ExecuteFailedException, ClientServerIncompatibleException { + throws TException, ExecuteFailedException { int retry = RETRY_TIMES; int spaceID = getSpace(spaceName).getSpace_id(); ListEdgesReq request = new ListEdgesReq(spaceID); @@ -303,6 +310,8 @@ public synchronized List getEdges(String spaceName) } catch (TException e) { LOGGER.error(String.format("Get Edge Error: %s", e.getMessage())); throw e; + } catch (ClientServerIncompatibleException e) { + LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); } if (response.getCode() == ErrorCode.SUCCEEDED) { return response.getEdges(); @@ -321,7 +330,7 @@ public synchronized List getEdges(String spaceName) * @return Schema */ public synchronized Schema getEdge(String spaceName, String edgeName) - throws TException, ExecuteFailedException, ClientServerIncompatibleException { + throws TException, ExecuteFailedException { int retry = RETRY_TIMES; GetEdgeReq request = new GetEdgeReq(); int spaceID = getSpace(spaceName).getSpace_id(); @@ -342,6 +351,8 @@ public synchronized Schema getEdge(String spaceName, String edgeName) } catch (TException e) { LOGGER.error(String.format("Get Edge Error: %s", e.getMessage())); throw e; + } catch (ClientServerIncompatibleException e) { + LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); } if (response.getCode() == ErrorCode.SUCCEEDED) { return response.getSchema(); @@ -361,7 +372,7 @@ public synchronized Schema getEdge(String spaceName, String edgeName) * @return */ public synchronized Map> getPartsAlloc(String spaceName) - throws ExecuteFailedException, TException, ClientServerIncompatibleException { + throws ExecuteFailedException, TException { int retry = RETRY_TIMES; GetPartsAllocReq request = new GetPartsAllocReq(); int spaceID = getSpace(spaceName).getSpace_id(); @@ -380,6 +391,8 @@ public synchronized Map> getPartsAlloc(String spaceName) } catch (TException e) { LOGGER.error(String.format("Get Parts Error: %s", e.getMessage())); throw e; + } catch (ClientServerIncompatibleException e) { + LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); } if (response.getCode() == ErrorCode.SUCCEEDED) { return response.getParts(); @@ -393,7 +406,7 @@ public synchronized Map> getPartsAlloc(String spaceName) /** * get all Storaged servers */ - public synchronized Set listHosts() throws ClientServerIncompatibleException { + public synchronized Set listHosts() { int retry = RETRY_TIMES; ListHostsReq request = new ListHostsReq(); request.setType(ListHostType.STORAGE); @@ -407,7 +420,7 @@ public synchronized Set listHosts() throws ClientServerIncompatibleExc break; } } - } catch (TException e) { + } catch (TException | ClientServerIncompatibleException e) { LOGGER.error("listHosts error", e); return null; } diff --git a/client/src/main/java/com/vesoft/nebula/client/meta/MetaManager.java b/client/src/main/java/com/vesoft/nebula/client/meta/MetaManager.java index b8425872f..e26d389b2 100644 --- a/client/src/main/java/com/vesoft/nebula/client/meta/MetaManager.java +++ b/client/src/main/java/com/vesoft/nebula/client/meta/MetaManager.java @@ -122,7 +122,7 @@ private void fillMetaInfo() { } finally { lock.writeLock().unlock(); } - } catch (TException | ExecuteFailedException | ClientServerIncompatibleException e) { + } catch (TException | ExecuteFailedException e) { LOGGER.error(e.getMessage()); } } @@ -332,13 +332,7 @@ public void updateLeader(String spaceName, int part, HostAddr newLeader) * get all storage addresses */ public Set listHosts() { - Set hosts; - try { - hosts = metaClient.listHosts(); - } catch (ClientServerIncompatibleException e) { - LOGGER.error("client version does not match server version"); - return new HashSet<>(); - } + Set hosts = metaClient.listHosts(); if (hosts == null) { return new HashSet<>(); } diff --git a/client/src/test/java/com/vesoft/nebula/client/meta/TestMetaClient.java b/client/src/test/java/com/vesoft/nebula/client/meta/TestMetaClient.java index 1c5f32906..6a0a53660 100644 --- a/client/src/test/java/com/vesoft/nebula/client/meta/TestMetaClient.java +++ b/client/src/test/java/com/vesoft/nebula/client/meta/TestMetaClient.java @@ -62,7 +62,7 @@ public void testGetSpaces() { List spaces = metaClient.getSpaces(); assert (spaces.size() >= 1); assert (metaClient.getSpace("testMeta") != null); - } catch (TException | ExecuteFailedException | ClientServerIncompatibleException e) { + } catch (TException | ExecuteFailedException e) { LOGGER.error(e.getMessage()); e.printStackTrace(); assert (false); @@ -74,7 +74,7 @@ public void testGetTags() { List tags = metaClient.getTags("testMeta"); Assert.assertTrue(tags.size() >= 1); assert (metaClient.getTag("testMeta", "person") != null); - } catch (TException | ExecuteFailedException | ClientServerIncompatibleException e) { + } catch (TException | ExecuteFailedException e) { e.printStackTrace(); assert (false); } @@ -85,7 +85,7 @@ public void testGetEdges() { List edges = metaClient.getEdges("testMeta"); Assert.assertTrue(edges.size() >= 1); assert (metaClient.getEdge("testMeta", "friend") != null); - } catch (TException | ExecuteFailedException | ClientServerIncompatibleException e) { + } catch (TException | ExecuteFailedException e) { e.printStackTrace(); assert (false); } @@ -94,13 +94,13 @@ public void testGetEdges() { public void testGetPartsAlloc() { try { assert (metaClient.getPartsAlloc("testMeta").size() == 10); - } catch (ExecuteFailedException | TException | ClientServerIncompatibleException e) { + } catch (ExecuteFailedException | TException e) { e.printStackTrace(); assert (false); } } - public void testListHosts() throws ClientServerIncompatibleException { + public void testListHosts() { if (metaClient == null) { metaClient = new MetaClient(address, port); } @@ -123,12 +123,7 @@ public void testListOnlineHosts() { if (metaClient == null) { metaClient = new MetaClient(address, port); } - try { - assert (metaClient.listHosts().size() == 2); - } catch (ClientServerIncompatibleException e) { - LOGGER.error("client version does not match server version", e); - assert (false); - } + assert (metaClient.listHosts().size() == 2); try { runtime.exec("docker start nebula-docker-compose_storaged0_1") From 7354514a81776c72fca0726bfada54ecd9c0a521 Mon Sep 17 00:00:00 2001 From: Klay Date: Mon, 18 Oct 2021 21:31:27 -0700 Subject: [PATCH 09/11] fix per comments --- .../nebula/client/graph/net/Session.java | 5 ++-- .../client/graph/net/SessionWrapper.java | 3 +-- .../client/graph/net/SyncConnection.java | 10 ++++++-- .../vesoft/nebula/client/meta/MetaClient.java | 25 ++++++------------- 4 files changed, 18 insertions(+), 25 deletions(-) diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/Session.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/Session.java index 220fc317a..3b216910a 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/Session.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/Session.java @@ -8,7 +8,6 @@ import com.vesoft.nebula.client.graph.data.HostAddress; import com.vesoft.nebula.client.graph.data.ResultSet; -import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.graph.ExecutionResponse; import java.util.concurrent.atomic.AtomicBoolean; @@ -62,7 +61,7 @@ public Session(SyncConnection connection, * @return The ResultSet */ public synchronized ResultSet execute(String stmt) throws - IOErrorException, ClientServerIncompatibleException { + IOErrorException { if (connection == null) { throw new IOErrorException(IOErrorException.E_CONNECT_BROKEN, "The session was released, couldn't use again."); @@ -161,7 +160,7 @@ public synchronized ResultSet execute(String stmt) throws * @return The JSON string */ public synchronized String executeJson(String stmt) throws - IOErrorException, ClientServerIncompatibleException { + IOErrorException { if (connection == null) { throw new IOErrorException(IOErrorException.E_CONNECT_BROKEN, "The session was released, couldn't use again."); diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionWrapper.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionWrapper.java index f33fc34b7..c514264a2 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionWrapper.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionWrapper.java @@ -7,7 +7,6 @@ package com.vesoft.nebula.client.graph.net; import com.vesoft.nebula.client.graph.data.ResultSet; -import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.client.graph.exception.InvalidSessionException; import java.util.concurrent.atomic.AtomicBoolean; @@ -27,7 +26,7 @@ public SessionWrapper(Session session) { * @return The ResultSet. */ public ResultSet execute(String stmt) - throws IOErrorException, ClientServerIncompatibleException { + throws IOErrorException { if (!available()) { throw new InvalidSessionException(); } diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java index 4affed347..1e73006ea 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java @@ -29,10 +29,16 @@ import com.vesoft.nebula.graph.VerifyClientVersionReq; import com.vesoft.nebula.graph.VerifyClientVersionResp; import com.vesoft.nebula.util.SslUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import javax.net.ssl.SSLSocketFactory; public class SyncConnection extends Connection { + + private static final Logger LOGGER = LoggerFactory.getLogger(SyncConnection.class); + protected TTransport transport = null; protected TProtocol protocol = null; private GraphService.Client client = null; @@ -170,7 +176,7 @@ public ExecutionResponse execute(long sessionID, String stmt) try { reopen(); } catch (ClientServerIncompatibleException ex) { - throw new IOErrorException(IOErrorException.E_TIME_OUT, te.getMessage()); + LOGGER.error(ex.getMessage()); } throw new IOErrorException(IOErrorException.E_TIME_OUT, te.getMessage()); } @@ -196,7 +202,7 @@ public String executeJson(long sessionID, String stmt) try { reopen(); } catch (ClientServerIncompatibleException ex) { - throw new IOErrorException(IOErrorException.E_TIME_OUT, te.getMessage()); + LOGGER.error(ex.getMessage()); } throw new IOErrorException(IOErrorException.E_TIME_OUT, te.getMessage()); } diff --git a/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java b/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java index e4e8c9046..41c74e478 100644 --- a/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java +++ b/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java @@ -61,7 +61,6 @@ public class MetaClient extends AbstractMetaClient { private static final int DEFAULT_TIMEOUT_MS = 1000; private static final int DEFAULT_CONNECTION_RETRY_SIZE = 3; private static final int DEFAULT_EXECUTION_RETRY_SIZE = 3; - private static final int RETRY_TIMES = 1; private MetaService.Client client; @@ -123,9 +122,13 @@ private void getClient(String host, int port) } private void freshClient(HostAddr leader) - throws TTransportException, ClientServerIncompatibleException { + throws TTransportException { close(); - getClient(leader.getHost(), leader.getPort()); + try { + getClient(leader.getHost(), leader.getPort()); + } catch (ClientServerIncompatibleException e) { + LOGGER.error(e.getMessage()); + } } /** @@ -158,8 +161,6 @@ public synchronized List getSpaces() throws TException, ExecuteFailedExc } catch (TException e) { LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); throw e; - } catch (ClientServerIncompatibleException e) { - LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); } if (response.getCode() == ErrorCode.SUCCEEDED) { return response.getSpaces(); @@ -194,8 +195,6 @@ public synchronized SpaceItem getSpace(String spaceName) throws TException, } catch (TException e) { LOGGER.error(String.format("Get Space Error: %s", e.getMessage())); throw e; - } catch (ClientServerIncompatibleException e) { - LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); } if (response.getCode() == ErrorCode.SUCCEEDED) { return response.getItem(); @@ -231,8 +230,6 @@ public synchronized List getTags(String spaceName) } catch (TException e) { LOGGER.error(String.format("Get Tag Error: %s", e.getMessage())); throw e; - } catch (ClientServerIncompatibleException e) { - LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); } if (response.getCode() == ErrorCode.SUCCEEDED) { return response.getTags(); @@ -273,8 +270,6 @@ public synchronized Schema getTag(String spaceName, String tagName) } catch (TException e) { LOGGER.error(String.format("Get Tag Error: %s", e.getMessage())); throw e; - } catch (ClientServerIncompatibleException e) { - LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); } if (response.getCode() == ErrorCode.SUCCEEDED) { return response.getSchema(); @@ -310,8 +305,6 @@ public synchronized List getEdges(String spaceName) } catch (TException e) { LOGGER.error(String.format("Get Edge Error: %s", e.getMessage())); throw e; - } catch (ClientServerIncompatibleException e) { - LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); } if (response.getCode() == ErrorCode.SUCCEEDED) { return response.getEdges(); @@ -351,8 +344,6 @@ public synchronized Schema getEdge(String spaceName, String edgeName) } catch (TException e) { LOGGER.error(String.format("Get Edge Error: %s", e.getMessage())); throw e; - } catch (ClientServerIncompatibleException e) { - LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); } if (response.getCode() == ErrorCode.SUCCEEDED) { return response.getSchema(); @@ -391,8 +382,6 @@ public synchronized Map> getPartsAlloc(String spaceName) } catch (TException e) { LOGGER.error(String.format("Get Parts Error: %s", e.getMessage())); throw e; - } catch (ClientServerIncompatibleException e) { - LOGGER.error(String.format("List Spaces Error: %s", e.getMessage())); } if (response.getCode() == ErrorCode.SUCCEEDED) { return response.getParts(); @@ -420,7 +409,7 @@ public synchronized Set listHosts() { break; } } - } catch (TException | ClientServerIncompatibleException e) { + } catch (TException e) { LOGGER.error("listHosts error", e); return null; } From b5b6998838fbdb56e419501dacdf081ec1443bd4 Mon Sep 17 00:00:00 2001 From: Klay Date: Mon, 18 Oct 2021 21:55:14 -0700 Subject: [PATCH 10/11] Update SyncConnection.java --- .../com/vesoft/nebula/client/graph/net/SyncConnection.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java index 1e73006ea..d07bf5ae1 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/SyncConnection.java @@ -29,11 +29,10 @@ import com.vesoft.nebula.graph.VerifyClientVersionReq; import com.vesoft.nebula.graph.VerifyClientVersionResp; import com.vesoft.nebula.util.SslUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.io.IOException; import javax.net.ssl.SSLSocketFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SyncConnection extends Connection { From a66400286ce2baa981904d66a45d8bf9ef69a6bc Mon Sep 17 00:00:00 2001 From: Klay Date: Mon, 18 Oct 2021 22:10:52 -0700 Subject: [PATCH 11/11] Update TestDataFromServer.java --- .../client/graph/data/TestDataFromServer.java | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/client/src/test/java/com/vesoft/nebula/client/graph/data/TestDataFromServer.java b/client/src/test/java/com/vesoft/nebula/client/graph/data/TestDataFromServer.java index 25a46856e..ca6926b3c 100644 --- a/client/src/test/java/com/vesoft/nebula/client/graph/data/TestDataFromServer.java +++ b/client/src/test/java/com/vesoft/nebula/client/graph/data/TestDataFromServer.java @@ -173,8 +173,7 @@ public void testAllSchemaType() { Assert.assertEquals(ValueWrapper.NullType.__NULL__, properties.get("hobby").asNull().getNullType()); - } catch (IOErrorException | UnsupportedEncodingException - | ClientServerIncompatibleException e) { + } catch (IOErrorException | UnsupportedEncodingException e) { e.printStackTrace(); assert false; } @@ -195,8 +194,7 @@ public void testList() { } Assert.assertEquals(names.stream().sorted().collect(Collectors.toList()), listVal.stream().sorted().collect(Collectors.toList())); - } catch (IOErrorException | UnsupportedEncodingException - | ClientServerIncompatibleException e) { + } catch (IOErrorException | UnsupportedEncodingException e) { e.printStackTrace(); assert false; } @@ -222,8 +220,7 @@ public void testSet() { Assert.assertEquals(result.toString(), "ColumnName: [{\"name\",\"name\",\"age\",\"birthday\"}], " + "Rows: [[\"name\", \"birthday\", \"age\"]]"); - } catch (IOErrorException | UnsupportedEncodingException - | ClientServerIncompatibleException e) { + } catch (IOErrorException | UnsupportedEncodingException e) { e.printStackTrace(); assert false; } @@ -248,8 +245,7 @@ public void testMap() { assert mapVals.containsKey("birthday"); assert mapVals.get("birthday").isString(); Assert.assertEquals("2010-10-10", mapVals.get("birthday").asString()); - } catch (IOErrorException | UnsupportedEncodingException - | ClientServerIncompatibleException e) { + } catch (IOErrorException | UnsupportedEncodingException e) { e.printStackTrace(); assert false; } @@ -275,8 +271,7 @@ public void testNode() { node.keys("student").stream().sorted().collect(Collectors.toList())); Assert.assertEquals(14, node.properties("person").keySet().size()); Assert.assertEquals(1, node.properties("student").keySet().size()); - } catch (IOErrorException | UnsupportedEncodingException - | ClientServerIncompatibleException e) { + } catch (IOErrorException | UnsupportedEncodingException e) { e.printStackTrace(); assert false; } @@ -313,8 +308,7 @@ public void testRelationship() { Assert.assertEquals( "(\"Bob\")-[:friend@100{start_year: 2018, end_year: 2020}]->(\"Lily\")", result2.rowValues(0).get(0).asRelationship().toString()); - } catch (IOErrorException | UnsupportedEncodingException - | ClientServerIncompatibleException e) { + } catch (IOErrorException | UnsupportedEncodingException e) { e.printStackTrace(); assert false; } @@ -343,8 +337,7 @@ public void testPath() { Assert.assertEquals("Bob", path.getStartNode().getId().asString()); Assert.assertEquals("Jerry", path.getEndNode().getId().asString()); Assert.assertEquals(2, path.length()); - } catch (IOErrorException | UnsupportedEncodingException - | ClientServerIncompatibleException e) { + } catch (IOErrorException | UnsupportedEncodingException e) { e.printStackTrace(); assert false; } @@ -384,8 +377,7 @@ public void tesDataset() { + "(\"a\" )<-[:like@0{}]-(\"b\" )<-[:like@0{}]-(\"c\" ), " + "(\"a\" )-[:like@0{}]->(\"f\" )<-[:like@0{}]-(\"c\" )]"; Assert.assertEquals(expectString, result.toString()); - } catch (IOErrorException | InterruptedException - | ClientServerIncompatibleException e) { + } catch (IOErrorException | InterruptedException e) { e.printStackTrace(); assert false; } @@ -396,7 +388,7 @@ public void testErrorResult() { try { ResultSet result = session.execute("FETCH PROP ON no_exist_tag \"nobody\""); Assert.assertTrue(result.toString().contains("ExecutionResponse")); - } catch (IOErrorException | ClientServerIncompatibleException e) { + } catch (IOErrorException e) { e.printStackTrace(); assert false; } @@ -416,7 +408,7 @@ public void testBasicTypeForJson() { // check space name String spaceName = resp.getJSONArray("results").getJSONObject(0).getString("spaceName"); Assert.assertEquals(spaceName, "test_data"); - } catch (IOErrorException | ClientServerIncompatibleException e) { + } catch (IOErrorException e) { e.printStackTrace(); assert false; } @@ -435,7 +427,7 @@ public void testComplexTypeForJson() { + "-09-10T02:08:02.0Z\",\"student.name\":\"Bob\",\"person.child_name\":\"Hello" + " Worl\",\"person.property\":1000,\"person.morning\":\"23:10:00.000000Z\",\"" + "person.start_school\":\"2017-09-10\",\"person.friends\":10}]"); - } catch (IOErrorException | ClientServerIncompatibleException e) { + } catch (IOErrorException e) { e.printStackTrace(); assert false; } @@ -455,7 +447,7 @@ public void testErrorForJson() { // check error message Assert.assertEquals(message, "SemanticError: `invalidTag': Unknown tag"); - } catch (IOErrorException | ClientServerIncompatibleException e) { + } catch (IOErrorException e) { e.printStackTrace(); assert false; }