From 7ac6a3e6945bca33ff0fd1487c19b6541da78c93 Mon Sep 17 00:00:00 2001 From: Nicole00 Date: Mon, 15 Nov 2021 20:01:32 +0800 Subject: [PATCH 1/4] update thrift --- .../nebula/{meta => }/PropertyType.java | 2 +- .../com/vesoft/nebula/meta/ColumnTypeDef.java | 24 +- .../com/vesoft/nebula/meta/SpaceDesc.java | 2 +- .../com/vesoft/nebula/storage/AddPartReq.java | 22 +- .../nebula/storage/ChainAddEdgesRequest.java | 66 ++-- .../storage/ChainUpdateEdgeRequest.java | 20 +- .../vesoft/nebula/storage/CheckPeersReq.java | 22 +- .../vesoft/nebula/storage/CreateCPResp.java | 22 +- .../nebula/storage/GeneralStorageService.java | 24 +- .../nebula/storage/GetLeaderPartsResp.java | 44 +-- .../nebula/storage/GraphStorageService.java | 128 +++--- .../nebula/storage/IndexColumnHint.java | 161 +++++++- .../storage/InternalStorageService.java | 16 +- .../nebula/storage/InternalTxnRequest.java | 70 ++-- .../vesoft/nebula/storage/KVGetRequest.java | 44 +-- .../vesoft/nebula/storage/KVGetResponse.java | 26 +- .../vesoft/nebula/storage/KVPutRequest.java | 46 +-- .../nebula/storage/KVRemoveRequest.java | 44 +-- .../nebula/storage/RebuildIndexRequest.java | 20 +- .../com/vesoft/nebula/storage/ScanCursor.java | 369 ++++++++++++++++++ .../nebula/storage/ScanEdgeRequest.java | 258 +++++------- .../nebula/storage/ScanEdgeResponse.java | 211 ++++------ .../nebula/storage/ScanVertexRequest.java | 303 ++++++-------- .../nebula/storage/ScanVertexResponse.java | 211 ++++------ .../nebula/storage/StorageAdminService.java | 128 +++--- .../com/vesoft/nebula/storage/TaskPara.java | 40 +- 26 files changed, 1291 insertions(+), 1032 deletions(-) rename client/src/main/generated/com/vesoft/nebula/{meta => }/PropertyType.java (98%) create mode 100644 client/src/main/generated/com/vesoft/nebula/storage/ScanCursor.java diff --git a/client/src/main/generated/com/vesoft/nebula/meta/PropertyType.java b/client/src/main/generated/com/vesoft/nebula/PropertyType.java similarity index 98% rename from client/src/main/generated/com/vesoft/nebula/meta/PropertyType.java rename to client/src/main/generated/com/vesoft/nebula/PropertyType.java index fc77cc24b..9d9671e8d 100644 --- a/client/src/main/generated/com/vesoft/nebula/meta/PropertyType.java +++ b/client/src/main/generated/com/vesoft/nebula/PropertyType.java @@ -4,7 +4,7 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package com.vesoft.nebula.meta; +package com.vesoft.nebula; import com.facebook.thrift.IntRangeSet; 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 48b144908..d017d7241 100644 --- a/client/src/main/generated/com/vesoft/nebula/meta/ColumnTypeDef.java +++ b/client/src/main/generated/com/vesoft/nebula/meta/ColumnTypeDef.java @@ -32,9 +32,9 @@ public class ColumnTypeDef implements TBase, java.io.Serializable, Cloneable, Co /** * - * @see PropertyType + * @see com.vesoft.nebula.PropertyType */ - public PropertyType type; + public com.vesoft.nebula.PropertyType type; public short type_length; /** * @@ -72,13 +72,13 @@ public ColumnTypeDef() { } public ColumnTypeDef( - PropertyType type) { + com.vesoft.nebula.PropertyType type) { this(); this.type = type; } public ColumnTypeDef( - PropertyType type, + com.vesoft.nebula.PropertyType type, short type_length, GeoShape geo_shape) { this(); @@ -89,7 +89,7 @@ public ColumnTypeDef( } public static class Builder { - private PropertyType type; + private com.vesoft.nebula.PropertyType type; private short type_length; private GeoShape geo_shape; @@ -98,7 +98,7 @@ public static class Builder { public Builder() { } - public Builder setType(final PropertyType type) { + public Builder setType(final com.vesoft.nebula.PropertyType type) { this.type = type; return this; } @@ -150,17 +150,17 @@ public ColumnTypeDef deepCopy() { /** * - * @see PropertyType + * @see com.vesoft.nebula.PropertyType */ - public PropertyType getType() { + public com.vesoft.nebula.PropertyType getType() { return this.type; } /** * - * @see PropertyType + * @see com.vesoft.nebula.PropertyType */ - public ColumnTypeDef setType(PropertyType type) { + public ColumnTypeDef setType(com.vesoft.nebula.PropertyType type) { this.type = type; return this; } @@ -241,7 +241,7 @@ public void setFieldValue(int fieldID, Object __value) { if (__value == null) { unsetType(); } else { - setType((PropertyType)__value); + setType((com.vesoft.nebula.PropertyType)__value); } break; @@ -358,7 +358,7 @@ public void read(TProtocol iprot) throws TException { { case TYPE: if (__field.type == TType.I32) { - this.type = PropertyType.findByValue(iprot.readI32()); + this.type = com.vesoft.nebula.PropertyType.findByValue(iprot.readI32()); } else { TProtocolUtil.skip(iprot, __field.type); } diff --git a/client/src/main/generated/com/vesoft/nebula/meta/SpaceDesc.java b/client/src/main/generated/com/vesoft/nebula/meta/SpaceDesc.java index 5ee972c57..3f786dacb 100644 --- a/client/src/main/generated/com/vesoft/nebula/meta/SpaceDesc.java +++ b/client/src/main/generated/com/vesoft/nebula/meta/SpaceDesc.java @@ -99,7 +99,7 @@ public SpaceDesc() { this.replica_factor = 0; this.vid_type = new ColumnTypeDef(); - this.vid_type.setType(com.vesoft.nebula.meta.PropertyType.FIXED_STRING); + this.vid_type.setType(com.vesoft.nebula.PropertyType.FIXED_STRING); this.vid_type.setType_length((short)8); } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/AddPartReq.java b/client/src/main/generated/com/vesoft/nebula/storage/AddPartReq.java index fffba1d5a..55a0410fe 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/AddPartReq.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/AddPartReq.java @@ -419,16 +419,16 @@ public void read(TProtocol iprot) throws TException { case PEERS: if (__field.type == TType.LIST) { { - TList _list197 = iprot.readListBegin(); - this.peers = new ArrayList(Math.max(0, _list197.size)); - for (int _i198 = 0; - (_list197.size < 0) ? iprot.peekList() : (_i198 < _list197.size); - ++_i198) + TList _list221 = iprot.readListBegin(); + this.peers = new ArrayList(Math.max(0, _list221.size)); + for (int _i222 = 0; + (_list221.size < 0) ? iprot.peekList() : (_i222 < _list221.size); + ++_i222) { - com.vesoft.nebula.HostAddr _elem199; - _elem199 = new com.vesoft.nebula.HostAddr(); - _elem199.read(iprot); - this.peers.add(_elem199); + com.vesoft.nebula.HostAddr _elem223; + _elem223 = new com.vesoft.nebula.HostAddr(); + _elem223.read(iprot); + this.peers.add(_elem223); } iprot.readListEnd(); } @@ -466,8 +466,8 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(PEERS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.peers.size())); - for (com.vesoft.nebula.HostAddr _iter200 : this.peers) { - _iter200.write(oprot); + for (com.vesoft.nebula.HostAddr _iter224 : this.peers) { + _iter224.write(oprot); } oprot.writeListEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/ChainAddEdgesRequest.java b/client/src/main/generated/com/vesoft/nebula/storage/ChainAddEdgesRequest.java index 60e78656c..24ef64348 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/ChainAddEdgesRequest.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/ChainAddEdgesRequest.java @@ -486,30 +486,30 @@ public void read(TProtocol iprot) throws TException { 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) + TMap _map292 = iprot.readMapBegin(); + this.parts = new HashMap>(Math.max(0, 2*_map292.size)); + for (int _i293 = 0; + (_map292.size < 0) ? iprot.peekMap() : (_i293 < _map292.size); + ++_i293) { - int _key270; - List _val271; - _key270 = iprot.readI32(); + int _key294; + List _val295; + _key294 = 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) + TList _list296 = iprot.readListBegin(); + _val295 = new ArrayList(Math.max(0, _list296.size)); + for (int _i297 = 0; + (_list296.size < 0) ? iprot.peekList() : (_i297 < _list296.size); + ++_i297) { - NewEdge _elem274; - _elem274 = new NewEdge(); - _elem274.read(iprot); - _val271.add(_elem274); + NewEdge _elem298; + _elem298 = new NewEdge(); + _elem298.read(iprot); + _val295.add(_elem298); } iprot.readListEnd(); } - this.parts.put(_key270, _val271); + this.parts.put(_key294, _val295); } iprot.readMapEnd(); } @@ -520,15 +520,15 @@ public void read(TProtocol iprot) throws TException { 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) + TList _list299 = iprot.readListBegin(); + this.prop_names = new ArrayList(Math.max(0, _list299.size)); + for (int _i300 = 0; + (_list299.size < 0) ? iprot.peekList() : (_i300 < _list299.size); + ++_i300) { - byte[] _elem277; - _elem277 = iprot.readBinary(); - this.prop_names.add(_elem277); + byte[] _elem301; + _elem301 = iprot.readBinary(); + this.prop_names.add(_elem301); } iprot.readListEnd(); } @@ -584,12 +584,12 @@ public void write(TProtocol oprot) throws TException { 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()); + for (Map.Entry> _iter302 : this.parts.entrySet()) { + oprot.writeI32(_iter302.getKey()); { - oprot.writeListBegin(new TList(TType.STRUCT, _iter278.getValue().size())); - for (NewEdge _iter279 : _iter278.getValue()) { - _iter279.write(oprot); + oprot.writeListBegin(new TList(TType.STRUCT, _iter302.getValue().size())); + for (NewEdge _iter303 : _iter302.getValue()) { + _iter303.write(oprot); } oprot.writeListEnd(); } @@ -602,8 +602,8 @@ public void write(TProtocol oprot) throws TException { 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); + for (byte[] _iter304 : this.prop_names) { + oprot.writeBinary(_iter304); } oprot.writeListEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/ChainUpdateEdgeRequest.java b/client/src/main/generated/com/vesoft/nebula/storage/ChainUpdateEdgeRequest.java index ef8fad589..a59c6066e 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/ChainUpdateEdgeRequest.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/ChainUpdateEdgeRequest.java @@ -454,15 +454,15 @@ public void read(TProtocol iprot) throws TException { 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) + TList _list305 = iprot.readListBegin(); + this.parts = new ArrayList(Math.max(0, _list305.size)); + for (int _i306 = 0; + (_list305.size < 0) ? iprot.peekList() : (_i306 < _list305.size); + ++_i306) { - int _elem283; - _elem283 = iprot.readI32(); - this.parts.add(_elem283); + int _elem307; + _elem307 = iprot.readI32(); + this.parts.add(_elem307); } iprot.readListEnd(); } @@ -507,8 +507,8 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(PARTS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.I32, this.parts.size())); - for (int _iter284 : this.parts) { - oprot.writeI32(_iter284); + for (int _iter308 : this.parts) { + oprot.writeI32(_iter308); } oprot.writeListEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/CheckPeersReq.java b/client/src/main/generated/com/vesoft/nebula/storage/CheckPeersReq.java index d49344245..6f79c0c30 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/CheckPeersReq.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/CheckPeersReq.java @@ -347,16 +347,16 @@ public void read(TProtocol iprot) throws TException { case PEERS: if (__field.type == TType.LIST) { { - TList _list210 = iprot.readListBegin(); - this.peers = new ArrayList(Math.max(0, _list210.size)); - for (int _i211 = 0; - (_list210.size < 0) ? iprot.peekList() : (_i211 < _list210.size); - ++_i211) + TList _list234 = iprot.readListBegin(); + this.peers = new ArrayList(Math.max(0, _list234.size)); + for (int _i235 = 0; + (_list234.size < 0) ? iprot.peekList() : (_i235 < _list234.size); + ++_i235) { - com.vesoft.nebula.HostAddr _elem212; - _elem212 = new com.vesoft.nebula.HostAddr(); - _elem212.read(iprot); - this.peers.add(_elem212); + com.vesoft.nebula.HostAddr _elem236; + _elem236 = new com.vesoft.nebula.HostAddr(); + _elem236.read(iprot); + this.peers.add(_elem236); } iprot.readListEnd(); } @@ -391,8 +391,8 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(PEERS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.peers.size())); - for (com.vesoft.nebula.HostAddr _iter213 : this.peers) { - _iter213.write(oprot); + for (com.vesoft.nebula.HostAddr _iter237 : this.peers) { + _iter237.write(oprot); } oprot.writeListEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/CreateCPResp.java b/client/src/main/generated/com/vesoft/nebula/storage/CreateCPResp.java index d0915204b..0a945b9b1 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/CreateCPResp.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/CreateCPResp.java @@ -274,16 +274,16 @@ public void read(TProtocol iprot) throws TException { case INFO: if (__field.type == TType.LIST) { { - TList _list218 = iprot.readListBegin(); - this.info = new ArrayList(Math.max(0, _list218.size)); - for (int _i219 = 0; - (_list218.size < 0) ? iprot.peekList() : (_i219 < _list218.size); - ++_i219) + TList _list242 = iprot.readListBegin(); + this.info = new ArrayList(Math.max(0, _list242.size)); + for (int _i243 = 0; + (_list242.size < 0) ? iprot.peekList() : (_i243 < _list242.size); + ++_i243) { - com.vesoft.nebula.CheckpointInfo _elem220; - _elem220 = new com.vesoft.nebula.CheckpointInfo(); - _elem220.read(iprot); - this.info.add(_elem220); + com.vesoft.nebula.CheckpointInfo _elem244; + _elem244 = new com.vesoft.nebula.CheckpointInfo(); + _elem244.read(iprot); + this.info.add(_elem244); } iprot.readListEnd(); } @@ -317,8 +317,8 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(INFO_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.info.size())); - for (com.vesoft.nebula.CheckpointInfo _iter221 : this.info) { - _iter221.write(oprot); + for (com.vesoft.nebula.CheckpointInfo _iter245 : this.info) { + _iter245.write(oprot); } oprot.writeListEnd(); } 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 351d4458e..752c8b08e 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 resultHandler483) throws TException { + public void get(KVGetRequest req, AsyncMethodCallback resultHandler507) throws TException { checkReady(); - get_call method_call = new get_call(req, resultHandler483, this, ___protocolFactory, ___transport); + get_call method_call = new get_call(req, resultHandler507, 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 resultHandler484, TAsyncClient client480, TProtocolFactory protocolFactory481, TNonblockingTransport transport482) throws TException { - super(client480, protocolFactory481, transport482, resultHandler484, false); + public get_call(KVGetRequest req, AsyncMethodCallback resultHandler508, TAsyncClient client504, TProtocolFactory protocolFactory505, TNonblockingTransport transport506) throws TException { + super(client504, protocolFactory505, transport506, resultHandler508, false); this.req = req; } @@ -263,17 +263,17 @@ public KVGetResponse getResult() throws TException { } } - public void put(KVPutRequest req, AsyncMethodCallback resultHandler488) throws TException { + public void put(KVPutRequest req, AsyncMethodCallback resultHandler512) throws TException { checkReady(); - put_call method_call = new put_call(req, resultHandler488, this, ___protocolFactory, ___transport); + put_call method_call = new put_call(req, resultHandler512, 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 resultHandler489, TAsyncClient client485, TProtocolFactory protocolFactory486, TNonblockingTransport transport487) throws TException { - super(client485, protocolFactory486, transport487, resultHandler489, false); + public put_call(KVPutRequest req, AsyncMethodCallback resultHandler513, TAsyncClient client509, TProtocolFactory protocolFactory510, TNonblockingTransport transport511) throws TException { + super(client509, protocolFactory510, transport511, resultHandler513, false); this.req = req; } @@ -295,17 +295,17 @@ public ExecResponse getResult() throws TException { } } - public void remove(KVRemoveRequest req, AsyncMethodCallback resultHandler493) throws TException { + public void remove(KVRemoveRequest req, AsyncMethodCallback resultHandler517) throws TException { checkReady(); - remove_call method_call = new remove_call(req, resultHandler493, this, ___protocolFactory, ___transport); + remove_call method_call = new remove_call(req, resultHandler517, 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 resultHandler494, TAsyncClient client490, TProtocolFactory protocolFactory491, TNonblockingTransport transport492) throws TException { - super(client490, protocolFactory491, transport492, resultHandler494, false); + public remove_call(KVRemoveRequest req, AsyncMethodCallback resultHandler518, TAsyncClient client514, TProtocolFactory protocolFactory515, TNonblockingTransport transport516) throws TException { + super(client514, protocolFactory515, transport516, resultHandler518, false); this.req = req; } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/GetLeaderPartsResp.java b/client/src/main/generated/com/vesoft/nebula/storage/GetLeaderPartsResp.java index 831072bd8..6b4bfaecd 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/GetLeaderPartsResp.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/GetLeaderPartsResp.java @@ -276,29 +276,29 @@ public void read(TProtocol iprot) throws TException { case LEADER_PARTS: if (__field.type == TType.MAP) { { - TMap _map201 = iprot.readMapBegin(); - this.leader_parts = new HashMap>(Math.max(0, 2*_map201.size)); - for (int _i202 = 0; - (_map201.size < 0) ? iprot.peekMap() : (_i202 < _map201.size); - ++_i202) + TMap _map225 = iprot.readMapBegin(); + this.leader_parts = new HashMap>(Math.max(0, 2*_map225.size)); + for (int _i226 = 0; + (_map225.size < 0) ? iprot.peekMap() : (_i226 < _map225.size); + ++_i226) { - int _key203; - List _val204; - _key203 = iprot.readI32(); + int _key227; + List _val228; + _key227 = iprot.readI32(); { - TList _list205 = iprot.readListBegin(); - _val204 = new ArrayList(Math.max(0, _list205.size)); - for (int _i206 = 0; - (_list205.size < 0) ? iprot.peekList() : (_i206 < _list205.size); - ++_i206) + TList _list229 = iprot.readListBegin(); + _val228 = new ArrayList(Math.max(0, _list229.size)); + for (int _i230 = 0; + (_list229.size < 0) ? iprot.peekList() : (_i230 < _list229.size); + ++_i230) { - int _elem207; - _elem207 = iprot.readI32(); - _val204.add(_elem207); + int _elem231; + _elem231 = iprot.readI32(); + _val228.add(_elem231); } iprot.readListEnd(); } - this.leader_parts.put(_key203, _val204); + this.leader_parts.put(_key227, _val228); } iprot.readMapEnd(); } @@ -332,12 +332,12 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(LEADER_PARTS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.I32, TType.LIST, this.leader_parts.size())); - for (Map.Entry> _iter208 : this.leader_parts.entrySet()) { - oprot.writeI32(_iter208.getKey()); + for (Map.Entry> _iter232 : this.leader_parts.entrySet()) { + oprot.writeI32(_iter232.getKey()); { - oprot.writeListBegin(new TList(TType.I32, _iter208.getValue().size())); - for (int _iter209 : _iter208.getValue()) { - oprot.writeI32(_iter209); + oprot.writeListBegin(new TList(TType.I32, _iter232.getValue().size())); + for (int _iter233 : _iter232.getValue()) { + oprot.writeI32(_iter233); } oprot.writeListEnd(); } 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 99ea338d6..c5be51355 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/GraphStorageService.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/GraphStorageService.java @@ -868,17 +868,17 @@ public AsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager clientM super(protocolFactory, clientManager, transport); } - public void getNeighbors(GetNeighborsRequest req, AsyncMethodCallback resultHandler304) throws TException { + public void getNeighbors(GetNeighborsRequest req, AsyncMethodCallback resultHandler328) throws TException { checkReady(); - getNeighbors_call method_call = new getNeighbors_call(req, resultHandler304, this, ___protocolFactory, ___transport); + getNeighbors_call method_call = new getNeighbors_call(req, resultHandler328, 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 resultHandler305, TAsyncClient client301, TProtocolFactory protocolFactory302, TNonblockingTransport transport303) throws TException { - super(client301, protocolFactory302, transport303, resultHandler305, false); + public getNeighbors_call(GetNeighborsRequest req, AsyncMethodCallback resultHandler329, TAsyncClient client325, TProtocolFactory protocolFactory326, TNonblockingTransport transport327) throws TException { + super(client325, protocolFactory326, transport327, resultHandler329, false); this.req = req; } @@ -900,17 +900,17 @@ public GetNeighborsResponse getResult() throws TException { } } - public void getProps(GetPropRequest req, AsyncMethodCallback resultHandler309) throws TException { + public void getProps(GetPropRequest req, AsyncMethodCallback resultHandler333) throws TException { checkReady(); - getProps_call method_call = new getProps_call(req, resultHandler309, this, ___protocolFactory, ___transport); + getProps_call method_call = new getProps_call(req, resultHandler333, 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 resultHandler310, TAsyncClient client306, TProtocolFactory protocolFactory307, TNonblockingTransport transport308) throws TException { - super(client306, protocolFactory307, transport308, resultHandler310, false); + public getProps_call(GetPropRequest req, AsyncMethodCallback resultHandler334, TAsyncClient client330, TProtocolFactory protocolFactory331, TNonblockingTransport transport332) throws TException { + super(client330, protocolFactory331, transport332, resultHandler334, false); this.req = req; } @@ -932,17 +932,17 @@ public GetPropResponse getResult() throws TException { } } - public void addVertices(AddVerticesRequest req, AsyncMethodCallback resultHandler314) throws TException { + public void addVertices(AddVerticesRequest req, AsyncMethodCallback resultHandler338) throws TException { checkReady(); - addVertices_call method_call = new addVertices_call(req, resultHandler314, this, ___protocolFactory, ___transport); + addVertices_call method_call = new addVertices_call(req, resultHandler338, 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 resultHandler315, TAsyncClient client311, TProtocolFactory protocolFactory312, TNonblockingTransport transport313) throws TException { - super(client311, protocolFactory312, transport313, resultHandler315, false); + public addVertices_call(AddVerticesRequest req, AsyncMethodCallback resultHandler339, TAsyncClient client335, TProtocolFactory protocolFactory336, TNonblockingTransport transport337) throws TException { + super(client335, protocolFactory336, transport337, resultHandler339, false); this.req = req; } @@ -964,17 +964,17 @@ public ExecResponse getResult() throws TException { } } - public void addEdges(AddEdgesRequest req, AsyncMethodCallback resultHandler319) throws TException { + public void addEdges(AddEdgesRequest req, AsyncMethodCallback resultHandler343) throws TException { checkReady(); - addEdges_call method_call = new addEdges_call(req, resultHandler319, this, ___protocolFactory, ___transport); + addEdges_call method_call = new addEdges_call(req, resultHandler343, 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 resultHandler320, TAsyncClient client316, TProtocolFactory protocolFactory317, TNonblockingTransport transport318) throws TException { - super(client316, protocolFactory317, transport318, resultHandler320, false); + public addEdges_call(AddEdgesRequest req, AsyncMethodCallback resultHandler344, TAsyncClient client340, TProtocolFactory protocolFactory341, TNonblockingTransport transport342) throws TException { + super(client340, protocolFactory341, transport342, resultHandler344, false); this.req = req; } @@ -996,17 +996,17 @@ public ExecResponse getResult() throws TException { } } - public void deleteEdges(DeleteEdgesRequest req, AsyncMethodCallback resultHandler324) throws TException { + public void deleteEdges(DeleteEdgesRequest req, AsyncMethodCallback resultHandler348) throws TException { checkReady(); - deleteEdges_call method_call = new deleteEdges_call(req, resultHandler324, this, ___protocolFactory, ___transport); + deleteEdges_call method_call = new deleteEdges_call(req, resultHandler348, 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 resultHandler325, TAsyncClient client321, TProtocolFactory protocolFactory322, TNonblockingTransport transport323) throws TException { - super(client321, protocolFactory322, transport323, resultHandler325, false); + public deleteEdges_call(DeleteEdgesRequest req, AsyncMethodCallback resultHandler349, TAsyncClient client345, TProtocolFactory protocolFactory346, TNonblockingTransport transport347) throws TException { + super(client345, protocolFactory346, transport347, resultHandler349, false); this.req = req; } @@ -1028,17 +1028,17 @@ public ExecResponse getResult() throws TException { } } - public void deleteVertices(DeleteVerticesRequest req, AsyncMethodCallback resultHandler329) throws TException { + public void deleteVertices(DeleteVerticesRequest req, AsyncMethodCallback resultHandler353) throws TException { checkReady(); - deleteVertices_call method_call = new deleteVertices_call(req, resultHandler329, this, ___protocolFactory, ___transport); + deleteVertices_call method_call = new deleteVertices_call(req, resultHandler353, 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 resultHandler330, TAsyncClient client326, TProtocolFactory protocolFactory327, TNonblockingTransport transport328) throws TException { - super(client326, protocolFactory327, transport328, resultHandler330, false); + public deleteVertices_call(DeleteVerticesRequest req, AsyncMethodCallback resultHandler354, TAsyncClient client350, TProtocolFactory protocolFactory351, TNonblockingTransport transport352) throws TException { + super(client350, protocolFactory351, transport352, resultHandler354, false); this.req = req; } @@ -1060,17 +1060,17 @@ public ExecResponse getResult() throws TException { } } - public void deleteTags(DeleteTagsRequest req, AsyncMethodCallback resultHandler334) throws TException { + public void deleteTags(DeleteTagsRequest req, AsyncMethodCallback resultHandler358) throws TException { checkReady(); - deleteTags_call method_call = new deleteTags_call(req, resultHandler334, this, ___protocolFactory, ___transport); + deleteTags_call method_call = new deleteTags_call(req, resultHandler358, 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 resultHandler335, TAsyncClient client331, TProtocolFactory protocolFactory332, TNonblockingTransport transport333) throws TException { - super(client331, protocolFactory332, transport333, resultHandler335, false); + public deleteTags_call(DeleteTagsRequest req, AsyncMethodCallback resultHandler359, TAsyncClient client355, TProtocolFactory protocolFactory356, TNonblockingTransport transport357) throws TException { + super(client355, protocolFactory356, transport357, resultHandler359, false); this.req = req; } @@ -1092,17 +1092,17 @@ public ExecResponse getResult() throws TException { } } - public void updateVertex(UpdateVertexRequest req, AsyncMethodCallback resultHandler339) throws TException { + public void updateVertex(UpdateVertexRequest req, AsyncMethodCallback resultHandler363) throws TException { checkReady(); - updateVertex_call method_call = new updateVertex_call(req, resultHandler339, this, ___protocolFactory, ___transport); + updateVertex_call method_call = new updateVertex_call(req, resultHandler363, 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 resultHandler340, TAsyncClient client336, TProtocolFactory protocolFactory337, TNonblockingTransport transport338) throws TException { - super(client336, protocolFactory337, transport338, resultHandler340, false); + public updateVertex_call(UpdateVertexRequest req, AsyncMethodCallback resultHandler364, TAsyncClient client360, TProtocolFactory protocolFactory361, TNonblockingTransport transport362) throws TException { + super(client360, protocolFactory361, transport362, resultHandler364, false); this.req = req; } @@ -1124,17 +1124,17 @@ public UpdateResponse getResult() throws TException { } } - public void updateEdge(UpdateEdgeRequest req, AsyncMethodCallback resultHandler344) throws TException { + public void updateEdge(UpdateEdgeRequest req, AsyncMethodCallback resultHandler368) throws TException { checkReady(); - updateEdge_call method_call = new updateEdge_call(req, resultHandler344, this, ___protocolFactory, ___transport); + updateEdge_call method_call = new updateEdge_call(req, resultHandler368, 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 resultHandler345, TAsyncClient client341, TProtocolFactory protocolFactory342, TNonblockingTransport transport343) throws TException { - super(client341, protocolFactory342, transport343, resultHandler345, false); + public updateEdge_call(UpdateEdgeRequest req, AsyncMethodCallback resultHandler369, TAsyncClient client365, TProtocolFactory protocolFactory366, TNonblockingTransport transport367) throws TException { + super(client365, protocolFactory366, transport367, resultHandler369, false); this.req = req; } @@ -1156,17 +1156,17 @@ public UpdateResponse getResult() throws TException { } } - public void scanVertex(ScanVertexRequest req, AsyncMethodCallback resultHandler349) throws TException { + public void scanVertex(ScanVertexRequest req, AsyncMethodCallback resultHandler373) throws TException { checkReady(); - scanVertex_call method_call = new scanVertex_call(req, resultHandler349, this, ___protocolFactory, ___transport); + scanVertex_call method_call = new scanVertex_call(req, resultHandler373, 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 resultHandler350, TAsyncClient client346, TProtocolFactory protocolFactory347, TNonblockingTransport transport348) throws TException { - super(client346, protocolFactory347, transport348, resultHandler350, false); + public scanVertex_call(ScanVertexRequest req, AsyncMethodCallback resultHandler374, TAsyncClient client370, TProtocolFactory protocolFactory371, TNonblockingTransport transport372) throws TException { + super(client370, protocolFactory371, transport372, resultHandler374, false); this.req = req; } @@ -1188,17 +1188,17 @@ public ScanVertexResponse getResult() throws TException { } } - public void scanEdge(ScanEdgeRequest req, AsyncMethodCallback resultHandler354) throws TException { + public void scanEdge(ScanEdgeRequest req, AsyncMethodCallback resultHandler378) throws TException { checkReady(); - scanEdge_call method_call = new scanEdge_call(req, resultHandler354, this, ___protocolFactory, ___transport); + scanEdge_call method_call = new scanEdge_call(req, resultHandler378, 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 resultHandler355, TAsyncClient client351, TProtocolFactory protocolFactory352, TNonblockingTransport transport353) throws TException { - super(client351, protocolFactory352, transport353, resultHandler355, false); + public scanEdge_call(ScanEdgeRequest req, AsyncMethodCallback resultHandler379, TAsyncClient client375, TProtocolFactory protocolFactory376, TNonblockingTransport transport377) throws TException { + super(client375, protocolFactory376, transport377, resultHandler379, false); this.req = req; } @@ -1220,17 +1220,17 @@ public ScanEdgeResponse getResult() throws TException { } } - public void getUUID(GetUUIDReq req, AsyncMethodCallback resultHandler359) throws TException { + public void getUUID(GetUUIDReq req, AsyncMethodCallback resultHandler383) throws TException { checkReady(); - getUUID_call method_call = new getUUID_call(req, resultHandler359, this, ___protocolFactory, ___transport); + getUUID_call method_call = new getUUID_call(req, resultHandler383, 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 resultHandler360, TAsyncClient client356, TProtocolFactory protocolFactory357, TNonblockingTransport transport358) throws TException { - super(client356, protocolFactory357, transport358, resultHandler360, false); + public getUUID_call(GetUUIDReq req, AsyncMethodCallback resultHandler384, TAsyncClient client380, TProtocolFactory protocolFactory381, TNonblockingTransport transport382) throws TException { + super(client380, protocolFactory381, transport382, resultHandler384, false); this.req = req; } @@ -1252,17 +1252,17 @@ public GetUUIDResp getResult() throws TException { } } - public void lookupIndex(LookupIndexRequest req, AsyncMethodCallback resultHandler364) throws TException { + public void lookupIndex(LookupIndexRequest req, AsyncMethodCallback resultHandler388) throws TException { checkReady(); - lookupIndex_call method_call = new lookupIndex_call(req, resultHandler364, this, ___protocolFactory, ___transport); + lookupIndex_call method_call = new lookupIndex_call(req, resultHandler388, 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 resultHandler365, TAsyncClient client361, TProtocolFactory protocolFactory362, TNonblockingTransport transport363) throws TException { - super(client361, protocolFactory362, transport363, resultHandler365, false); + public lookupIndex_call(LookupIndexRequest req, AsyncMethodCallback resultHandler389, TAsyncClient client385, TProtocolFactory protocolFactory386, TNonblockingTransport transport387) throws TException { + super(client385, protocolFactory386, transport387, resultHandler389, false); this.req = req; } @@ -1284,17 +1284,17 @@ public LookupIndexResp getResult() throws TException { } } - public void lookupAndTraverse(LookupAndTraverseRequest req, AsyncMethodCallback resultHandler369) throws TException { + public void lookupAndTraverse(LookupAndTraverseRequest req, AsyncMethodCallback resultHandler393) throws TException { checkReady(); - lookupAndTraverse_call method_call = new lookupAndTraverse_call(req, resultHandler369, this, ___protocolFactory, ___transport); + lookupAndTraverse_call method_call = new lookupAndTraverse_call(req, resultHandler393, 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 resultHandler370, TAsyncClient client366, TProtocolFactory protocolFactory367, TNonblockingTransport transport368) throws TException { - super(client366, protocolFactory367, transport368, resultHandler370, false); + public lookupAndTraverse_call(LookupAndTraverseRequest req, AsyncMethodCallback resultHandler394, TAsyncClient client390, TProtocolFactory protocolFactory391, TNonblockingTransport transport392) throws TException { + super(client390, protocolFactory391, transport392, resultHandler394, false); this.req = req; } @@ -1316,17 +1316,17 @@ public GetNeighborsResponse getResult() throws TException { } } - public void chainUpdateEdge(UpdateEdgeRequest req, AsyncMethodCallback resultHandler374) throws TException { + public void chainUpdateEdge(UpdateEdgeRequest req, AsyncMethodCallback resultHandler398) throws TException { checkReady(); - chainUpdateEdge_call method_call = new chainUpdateEdge_call(req, resultHandler374, this, ___protocolFactory, ___transport); + chainUpdateEdge_call method_call = new chainUpdateEdge_call(req, resultHandler398, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } 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); + public chainUpdateEdge_call(UpdateEdgeRequest req, AsyncMethodCallback resultHandler399, TAsyncClient client395, TProtocolFactory protocolFactory396, TNonblockingTransport transport397) throws TException { + super(client395, protocolFactory396, transport397, resultHandler399, false); this.req = req; } @@ -1348,17 +1348,17 @@ public UpdateResponse getResult() throws TException { } } - public void chainAddEdges(AddEdgesRequest req, AsyncMethodCallback resultHandler379) throws TException { + public void chainAddEdges(AddEdgesRequest req, AsyncMethodCallback resultHandler403) throws TException { checkReady(); - chainAddEdges_call method_call = new chainAddEdges_call(req, resultHandler379, this, ___protocolFactory, ___transport); + chainAddEdges_call method_call = new chainAddEdges_call(req, resultHandler403, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class chainAddEdges_call extends TAsyncMethodCall { private AddEdgesRequest req; - public chainAddEdges_call(AddEdgesRequest req, AsyncMethodCallback resultHandler380, TAsyncClient client376, TProtocolFactory protocolFactory377, TNonblockingTransport transport378) throws TException { - super(client376, protocolFactory377, transport378, resultHandler380, false); + public chainAddEdges_call(AddEdgesRequest req, AsyncMethodCallback resultHandler404, TAsyncClient client400, TProtocolFactory protocolFactory401, TNonblockingTransport transport402) throws TException { + super(client400, protocolFactory401, transport402, resultHandler404, false); this.req = req; } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/IndexColumnHint.java b/client/src/main/generated/com/vesoft/nebula/storage/IndexColumnHint.java index 1651adcb4..44b163ddf 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/IndexColumnHint.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/IndexColumnHint.java @@ -30,6 +30,8 @@ public class IndexColumnHint implements TBase, java.io.Serializable, Cloneable { private static final TField SCAN_TYPE_FIELD_DESC = new TField("scan_type", TType.I32, (short)2); private static final TField BEGIN_VALUE_FIELD_DESC = new TField("begin_value", TType.STRUCT, (short)3); private static final TField END_VALUE_FIELD_DESC = new TField("end_value", TType.STRUCT, (short)4); + private static final TField INCLUDE_BEGIN_FIELD_DESC = new TField("include_begin", TType.BOOL, (short)5); + private static final TField INCLUDE_END_FIELD_DESC = new TField("include_end", TType.BOOL, (short)6); public byte[] column_name; /** @@ -39,12 +41,19 @@ public class IndexColumnHint implements TBase, java.io.Serializable, Cloneable { public ScanType scan_type; public com.vesoft.nebula.Value begin_value; public com.vesoft.nebula.Value end_value; + public boolean include_begin; + public boolean include_end; public static final int COLUMN_NAME = 1; public static final int SCAN_TYPE = 2; public static final int BEGIN_VALUE = 3; public static final int END_VALUE = 4; + public static final int INCLUDE_BEGIN = 5; + public static final int INCLUDE_END = 6; // isset id assignments + private static final int __INCLUDE_BEGIN_ISSET_ID = 0; + private static final int __INCLUDE_END_ISSET_ID = 1; + private BitSet __isset_bit_vector = new BitSet(2); public static final Map metaDataMap; @@ -58,6 +67,10 @@ public class IndexColumnHint implements TBase, java.io.Serializable, Cloneable { new StructMetaData(TType.STRUCT, com.vesoft.nebula.Value.class))); tmpMetaDataMap.put(END_VALUE, new FieldMetaData("end_value", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, com.vesoft.nebula.Value.class))); + tmpMetaDataMap.put(INCLUDE_BEGIN, new FieldMetaData("include_begin", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + tmpMetaDataMap.put(INCLUDE_END, new FieldMetaData("include_end", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); } @@ -66,18 +79,28 @@ public class IndexColumnHint implements TBase, java.io.Serializable, Cloneable { } public IndexColumnHint() { + this.include_begin = true; + + this.include_end = false; + } public IndexColumnHint( byte[] column_name, ScanType scan_type, com.vesoft.nebula.Value begin_value, - com.vesoft.nebula.Value end_value) { + com.vesoft.nebula.Value end_value, + boolean include_begin, + boolean include_end) { this(); this.column_name = column_name; this.scan_type = scan_type; this.begin_value = begin_value; this.end_value = end_value; + this.include_begin = include_begin; + setInclude_beginIsSet(true); + this.include_end = include_end; + setInclude_endIsSet(true); } public static class Builder { @@ -85,6 +108,10 @@ public static class Builder { private ScanType scan_type; private com.vesoft.nebula.Value begin_value; private com.vesoft.nebula.Value end_value; + private boolean include_begin; + private boolean include_end; + + BitSet __optional_isset = new BitSet(2); public Builder() { } @@ -109,12 +136,30 @@ public Builder setEnd_value(final com.vesoft.nebula.Value end_value) { return this; } + public Builder setInclude_begin(final boolean include_begin) { + this.include_begin = include_begin; + __optional_isset.set(__INCLUDE_BEGIN_ISSET_ID, true); + return this; + } + + public Builder setInclude_end(final boolean include_end) { + this.include_end = include_end; + __optional_isset.set(__INCLUDE_END_ISSET_ID, true); + return this; + } + public IndexColumnHint build() { IndexColumnHint result = new IndexColumnHint(); result.setColumn_name(this.column_name); result.setScan_type(this.scan_type); result.setBegin_value(this.begin_value); result.setEnd_value(this.end_value); + if (__optional_isset.get(__INCLUDE_BEGIN_ISSET_ID)) { + result.setInclude_begin(this.include_begin); + } + if (__optional_isset.get(__INCLUDE_END_ISSET_ID)) { + result.setInclude_end(this.include_end); + } return result; } } @@ -127,6 +172,8 @@ public static Builder builder() { * Performs a deep copy on other. */ public IndexColumnHint(IndexColumnHint other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); if (other.isSetColumn_name()) { this.column_name = TBaseHelper.deepCopy(other.column_name); } @@ -139,6 +186,8 @@ public IndexColumnHint(IndexColumnHint other) { if (other.isSetEnd_value()) { this.end_value = TBaseHelper.deepCopy(other.end_value); } + this.include_begin = TBaseHelper.deepCopy(other.include_begin); + this.include_end = TBaseHelper.deepCopy(other.include_end); } public IndexColumnHint deepCopy() { @@ -249,6 +298,52 @@ public void setEnd_valueIsSet(boolean __value) { } } + public boolean isInclude_begin() { + return this.include_begin; + } + + public IndexColumnHint setInclude_begin(boolean include_begin) { + this.include_begin = include_begin; + setInclude_beginIsSet(true); + return this; + } + + public void unsetInclude_begin() { + __isset_bit_vector.clear(__INCLUDE_BEGIN_ISSET_ID); + } + + // Returns true if field include_begin is set (has been assigned a value) and false otherwise + public boolean isSetInclude_begin() { + return __isset_bit_vector.get(__INCLUDE_BEGIN_ISSET_ID); + } + + public void setInclude_beginIsSet(boolean __value) { + __isset_bit_vector.set(__INCLUDE_BEGIN_ISSET_ID, __value); + } + + public boolean isInclude_end() { + return this.include_end; + } + + public IndexColumnHint setInclude_end(boolean include_end) { + this.include_end = include_end; + setInclude_endIsSet(true); + return this; + } + + public void unsetInclude_end() { + __isset_bit_vector.clear(__INCLUDE_END_ISSET_ID); + } + + // Returns true if field include_end is set (has been assigned a value) and false otherwise + public boolean isSetInclude_end() { + return __isset_bit_vector.get(__INCLUDE_END_ISSET_ID); + } + + public void setInclude_endIsSet(boolean __value) { + __isset_bit_vector.set(__INCLUDE_END_ISSET_ID, __value); + } + public void setFieldValue(int fieldID, Object __value) { switch (fieldID) { case COLUMN_NAME: @@ -283,6 +378,22 @@ public void setFieldValue(int fieldID, Object __value) { } break; + case INCLUDE_BEGIN: + if (__value == null) { + unsetInclude_begin(); + } else { + setInclude_begin((Boolean)__value); + } + break; + + case INCLUDE_END: + if (__value == null) { + unsetInclude_end(); + } else { + setInclude_end((Boolean)__value); + } + break; + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -302,6 +413,12 @@ public Object getFieldValue(int fieldID) { case END_VALUE: return getEnd_value(); + case INCLUDE_BEGIN: + return new Boolean(isInclude_begin()); + + case INCLUDE_END: + return new Boolean(isInclude_end()); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -325,12 +442,16 @@ public boolean equals(Object _that) { if (!TBaseHelper.equalsNobinary(this.isSetEnd_value(), that.isSetEnd_value(), this.end_value, that.end_value)) { return false; } + if (!TBaseHelper.equalsNobinary(this.include_begin, that.include_begin)) { return false; } + + if (!TBaseHelper.equalsNobinary(this.include_end, that.include_end)) { return false; } + return true; } @Override public int hashCode() { - return Arrays.deepHashCode(new Object[] {column_name, scan_type, begin_value, end_value}); + return Arrays.deepHashCode(new Object[] {column_name, scan_type, begin_value, end_value, include_begin, include_end}); } public void read(TProtocol iprot) throws TException { @@ -374,6 +495,22 @@ public void read(TProtocol iprot) throws TException { TProtocolUtil.skip(iprot, __field.type); } break; + case INCLUDE_BEGIN: + if (__field.type == TType.BOOL) { + this.include_begin = iprot.readBool(); + setInclude_beginIsSet(true); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case INCLUDE_END: + if (__field.type == TType.BOOL) { + this.include_end = iprot.readBool(); + setInclude_endIsSet(true); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; default: TProtocolUtil.skip(iprot, __field.type); break; @@ -411,6 +548,12 @@ public void write(TProtocol oprot) throws TException { this.end_value.write(oprot); oprot.writeFieldEnd(); } + oprot.writeFieldBegin(INCLUDE_BEGIN_FIELD_DESC); + oprot.writeBool(this.include_begin); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(INCLUDE_END_FIELD_DESC); + oprot.writeBool(this.include_end); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -487,6 +630,20 @@ public String toString(int indent, boolean prettyPrint) { sb.append(TBaseHelper.toString(this.getEnd_value(), indent + 1, prettyPrint)); } first = false; + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("include_begin"); + sb.append(space); + sb.append(":").append(space); + sb.append(TBaseHelper.toString(this.isInclude_begin(), indent + 1, prettyPrint)); + first = false; + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("include_end"); + sb.append(space); + sb.append(":").append(space); + sb.append(TBaseHelper.toString(this.isInclude_end(), 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/InternalStorageService.java b/client/src/main/generated/com/vesoft/nebula/storage/InternalStorageService.java index dc8f229b4..ae3ee00b2 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/InternalStorageService.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/InternalStorageService.java @@ -182,17 +182,17 @@ public AsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager clientM super(protocolFactory, clientManager, transport); } - public void chainAddEdges(ChainAddEdgesRequest req, AsyncMethodCallback resultHandler500) throws TException { + public void chainAddEdges(ChainAddEdgesRequest req, AsyncMethodCallback resultHandler524) throws TException { checkReady(); - chainAddEdges_call method_call = new chainAddEdges_call(req, resultHandler500, this, ___protocolFactory, ___transport); + chainAddEdges_call method_call = new chainAddEdges_call(req, resultHandler524, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } 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); + public chainAddEdges_call(ChainAddEdgesRequest req, AsyncMethodCallback resultHandler525, TAsyncClient client521, TProtocolFactory protocolFactory522, TNonblockingTransport transport523) throws TException { + super(client521, protocolFactory522, transport523, resultHandler525, false); this.req = req; } @@ -214,17 +214,17 @@ public ExecResponse getResult() throws TException { } } - public void chainUpdateEdge(ChainUpdateEdgeRequest req, AsyncMethodCallback resultHandler505) throws TException { + public void chainUpdateEdge(ChainUpdateEdgeRequest req, AsyncMethodCallback resultHandler529) throws TException { checkReady(); - chainUpdateEdge_call method_call = new chainUpdateEdge_call(req, resultHandler505, this, ___protocolFactory, ___transport); + chainUpdateEdge_call method_call = new chainUpdateEdge_call(req, resultHandler529, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } 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); + public chainUpdateEdge_call(ChainUpdateEdgeRequest req, AsyncMethodCallback resultHandler530, TAsyncClient client526, TProtocolFactory protocolFactory527, TNonblockingTransport transport528) throws TException { + super(client526, protocolFactory527, transport528, resultHandler530, false); this.req = req; } 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 1fc752175..357a6fe2b 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/InternalTxnRequest.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/InternalTxnRequest.java @@ -419,17 +419,17 @@ public void read(TProtocol iprot) throws TException { 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) + TMap _map278 = iprot.readMapBegin(); + this.term_of_parts = new HashMap(Math.max(0, 2*_map278.size)); + for (int _i279 = 0; + (_map278.size < 0) ? iprot.peekMap() : (_i279 < _map278.size); + ++_i279) { - int _key256; - long _val257; - _key256 = iprot.readI32(); - _val257 = iprot.readI64(); - this.term_of_parts.put(_key256, _val257); + int _key280; + long _val281; + _key280 = iprot.readI32(); + _val281 = iprot.readI64(); + this.term_of_parts.put(_key280, _val281); } iprot.readMapEnd(); } @@ -456,29 +456,29 @@ public void read(TProtocol iprot) throws TException { case EDGE_VER: if (__field.type == TType.MAP) { { - 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) + TMap _map282 = iprot.readMapBegin(); + this.edge_ver = new HashMap>(Math.max(0, 2*_map282.size)); + for (int _i283 = 0; + (_map282.size < 0) ? iprot.peekMap() : (_i283 < _map282.size); + ++_i283) { - int _key260; - List _val261; - _key260 = iprot.readI32(); + int _key284; + List _val285; + _key284 = iprot.readI32(); { - 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) + TList _list286 = iprot.readListBegin(); + _val285 = new ArrayList(Math.max(0, _list286.size)); + for (int _i287 = 0; + (_list286.size < 0) ? iprot.peekList() : (_i287 < _list286.size); + ++_i287) { - long _elem264; - _elem264 = iprot.readI64(); - _val261.add(_elem264); + long _elem288; + _elem288 = iprot.readI64(); + _val285.add(_elem288); } iprot.readListEnd(); } - this.edge_ver.put(_key260, _val261); + this.edge_ver.put(_key284, _val285); } iprot.readMapEnd(); } @@ -510,9 +510,9 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(TERM_OF_PARTS_FIELD_DESC); { 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()); + for (Map.Entry _iter289 : this.term_of_parts.entrySet()) { + oprot.writeI32(_iter289.getKey()); + oprot.writeI64(_iter289.getValue()); } oprot.writeMapEnd(); } @@ -537,12 +537,12 @@ public void write(TProtocol oprot) throws TException { 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()); + for (Map.Entry> _iter290 : this.edge_ver.entrySet()) { + oprot.writeI32(_iter290.getKey()); { - oprot.writeListBegin(new TList(TType.I64, _iter266.getValue().size())); - for (long _iter267 : _iter266.getValue()) { - oprot.writeI64(_iter267); + oprot.writeListBegin(new TList(TType.I64, _iter290.getValue().size())); + for (long _iter291 : _iter290.getValue()) { + oprot.writeI64(_iter291); } oprot.writeListEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/KVGetRequest.java b/client/src/main/generated/com/vesoft/nebula/storage/KVGetRequest.java index a02c3ec93..641b74622 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/KVGetRequest.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/KVGetRequest.java @@ -341,29 +341,29 @@ public void read(TProtocol iprot) throws TException { case PARTS: if (__field.type == TType.MAP) { { - TMap _map222 = iprot.readMapBegin(); - this.parts = new HashMap>(Math.max(0, 2*_map222.size)); - for (int _i223 = 0; - (_map222.size < 0) ? iprot.peekMap() : (_i223 < _map222.size); - ++_i223) + TMap _map246 = iprot.readMapBegin(); + this.parts = new HashMap>(Math.max(0, 2*_map246.size)); + for (int _i247 = 0; + (_map246.size < 0) ? iprot.peekMap() : (_i247 < _map246.size); + ++_i247) { - int _key224; - List _val225; - _key224 = iprot.readI32(); + int _key248; + List _val249; + _key248 = iprot.readI32(); { - TList _list226 = iprot.readListBegin(); - _val225 = new ArrayList(Math.max(0, _list226.size)); - for (int _i227 = 0; - (_list226.size < 0) ? iprot.peekList() : (_i227 < _list226.size); - ++_i227) + TList _list250 = iprot.readListBegin(); + _val249 = new ArrayList(Math.max(0, _list250.size)); + for (int _i251 = 0; + (_list250.size < 0) ? iprot.peekList() : (_i251 < _list250.size); + ++_i251) { - byte[] _elem228; - _elem228 = iprot.readBinary(); - _val225.add(_elem228); + byte[] _elem252; + _elem252 = iprot.readBinary(); + _val249.add(_elem252); } iprot.readListEnd(); } - this.parts.put(_key224, _val225); + this.parts.put(_key248, _val249); } iprot.readMapEnd(); } @@ -403,12 +403,12 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(PARTS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.I32, TType.LIST, this.parts.size())); - for (Map.Entry> _iter229 : this.parts.entrySet()) { - oprot.writeI32(_iter229.getKey()); + for (Map.Entry> _iter253 : this.parts.entrySet()) { + oprot.writeI32(_iter253.getKey()); { - oprot.writeListBegin(new TList(TType.STRING, _iter229.getValue().size())); - for (byte[] _iter230 : _iter229.getValue()) { - oprot.writeBinary(_iter230); + oprot.writeListBegin(new TList(TType.STRING, _iter253.getValue().size())); + for (byte[] _iter254 : _iter253.getValue()) { + oprot.writeBinary(_iter254); } oprot.writeListEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/KVGetResponse.java b/client/src/main/generated/com/vesoft/nebula/storage/KVGetResponse.java index 0a5f6ede2..34849519a 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/KVGetResponse.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/KVGetResponse.java @@ -275,17 +275,17 @@ public void read(TProtocol iprot) throws TException { case KEY_VALUES: if (__field.type == TType.MAP) { { - TMap _map231 = iprot.readMapBegin(); - this.key_values = new HashMap(Math.max(0, 2*_map231.size)); - for (int _i232 = 0; - (_map231.size < 0) ? iprot.peekMap() : (_i232 < _map231.size); - ++_i232) + TMap _map255 = iprot.readMapBegin(); + this.key_values = new HashMap(Math.max(0, 2*_map255.size)); + for (int _i256 = 0; + (_map255.size < 0) ? iprot.peekMap() : (_i256 < _map255.size); + ++_i256) { - byte[] _key233; - byte[] _val234; - _key233 = iprot.readBinary(); - _val234 = iprot.readBinary(); - this.key_values.put(_key233, _val234); + byte[] _key257; + byte[] _val258; + _key257 = iprot.readBinary(); + _val258 = iprot.readBinary(); + this.key_values.put(_key257, _val258); } iprot.readMapEnd(); } @@ -319,9 +319,9 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(KEY_VALUES_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.key_values.size())); - for (Map.Entry _iter235 : this.key_values.entrySet()) { - oprot.writeBinary(_iter235.getKey()); - oprot.writeBinary(_iter235.getValue()); + for (Map.Entry _iter259 : this.key_values.entrySet()) { + oprot.writeBinary(_iter259.getKey()); + oprot.writeBinary(_iter259.getValue()); } oprot.writeMapEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/KVPutRequest.java b/client/src/main/generated/com/vesoft/nebula/storage/KVPutRequest.java index 74f10c522..17ebf8c94 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/KVPutRequest.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/KVPutRequest.java @@ -277,30 +277,30 @@ public void read(TProtocol iprot) throws TException { case PARTS: if (__field.type == TType.MAP) { { - TMap _map236 = iprot.readMapBegin(); - this.parts = new HashMap>(Math.max(0, 2*_map236.size)); - for (int _i237 = 0; - (_map236.size < 0) ? iprot.peekMap() : (_i237 < _map236.size); - ++_i237) + TMap _map260 = iprot.readMapBegin(); + this.parts = new HashMap>(Math.max(0, 2*_map260.size)); + for (int _i261 = 0; + (_map260.size < 0) ? iprot.peekMap() : (_i261 < _map260.size); + ++_i261) { - int _key238; - List _val239; - _key238 = iprot.readI32(); + int _key262; + List _val263; + _key262 = iprot.readI32(); { - TList _list240 = iprot.readListBegin(); - _val239 = new ArrayList(Math.max(0, _list240.size)); - for (int _i241 = 0; - (_list240.size < 0) ? iprot.peekList() : (_i241 < _list240.size); - ++_i241) + TList _list264 = iprot.readListBegin(); + _val263 = new ArrayList(Math.max(0, _list264.size)); + for (int _i265 = 0; + (_list264.size < 0) ? iprot.peekList() : (_i265 < _list264.size); + ++_i265) { - com.vesoft.nebula.KeyValue _elem242; - _elem242 = new com.vesoft.nebula.KeyValue(); - _elem242.read(iprot); - _val239.add(_elem242); + com.vesoft.nebula.KeyValue _elem266; + _elem266 = new com.vesoft.nebula.KeyValue(); + _elem266.read(iprot); + _val263.add(_elem266); } iprot.readListEnd(); } - this.parts.put(_key238, _val239); + this.parts.put(_key262, _val263); } iprot.readMapEnd(); } @@ -332,12 +332,12 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(PARTS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.I32, TType.LIST, this.parts.size())); - for (Map.Entry> _iter243 : this.parts.entrySet()) { - oprot.writeI32(_iter243.getKey()); + for (Map.Entry> _iter267 : this.parts.entrySet()) { + oprot.writeI32(_iter267.getKey()); { - oprot.writeListBegin(new TList(TType.STRUCT, _iter243.getValue().size())); - for (com.vesoft.nebula.KeyValue _iter244 : _iter243.getValue()) { - _iter244.write(oprot); + oprot.writeListBegin(new TList(TType.STRUCT, _iter267.getValue().size())); + for (com.vesoft.nebula.KeyValue _iter268 : _iter267.getValue()) { + _iter268.write(oprot); } oprot.writeListEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/KVRemoveRequest.java b/client/src/main/generated/com/vesoft/nebula/storage/KVRemoveRequest.java index 7e8a38843..3fb9d63f8 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/KVRemoveRequest.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/KVRemoveRequest.java @@ -277,29 +277,29 @@ public void read(TProtocol iprot) throws TException { case PARTS: if (__field.type == TType.MAP) { { - TMap _map245 = iprot.readMapBegin(); - this.parts = new HashMap>(Math.max(0, 2*_map245.size)); - for (int _i246 = 0; - (_map245.size < 0) ? iprot.peekMap() : (_i246 < _map245.size); - ++_i246) + TMap _map269 = iprot.readMapBegin(); + this.parts = new HashMap>(Math.max(0, 2*_map269.size)); + for (int _i270 = 0; + (_map269.size < 0) ? iprot.peekMap() : (_i270 < _map269.size); + ++_i270) { - int _key247; - List _val248; - _key247 = iprot.readI32(); + int _key271; + List _val272; + _key271 = iprot.readI32(); { - TList _list249 = iprot.readListBegin(); - _val248 = new ArrayList(Math.max(0, _list249.size)); - for (int _i250 = 0; - (_list249.size < 0) ? iprot.peekList() : (_i250 < _list249.size); - ++_i250) + TList _list273 = iprot.readListBegin(); + _val272 = new ArrayList(Math.max(0, _list273.size)); + for (int _i274 = 0; + (_list273.size < 0) ? iprot.peekList() : (_i274 < _list273.size); + ++_i274) { - byte[] _elem251; - _elem251 = iprot.readBinary(); - _val248.add(_elem251); + byte[] _elem275; + _elem275 = iprot.readBinary(); + _val272.add(_elem275); } iprot.readListEnd(); } - this.parts.put(_key247, _val248); + this.parts.put(_key271, _val272); } iprot.readMapEnd(); } @@ -331,12 +331,12 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(PARTS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.I32, TType.LIST, this.parts.size())); - for (Map.Entry> _iter252 : this.parts.entrySet()) { - oprot.writeI32(_iter252.getKey()); + for (Map.Entry> _iter276 : this.parts.entrySet()) { + oprot.writeI32(_iter276.getKey()); { - oprot.writeListBegin(new TList(TType.STRING, _iter252.getValue().size())); - for (byte[] _iter253 : _iter252.getValue()) { - oprot.writeBinary(_iter253); + oprot.writeListBegin(new TList(TType.STRING, _iter276.getValue().size())); + for (byte[] _iter277 : _iter276.getValue()) { + oprot.writeBinary(_iter277); } oprot.writeListEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/RebuildIndexRequest.java b/client/src/main/generated/com/vesoft/nebula/storage/RebuildIndexRequest.java index 905ce8be5..f715bcaa8 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/RebuildIndexRequest.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/RebuildIndexRequest.java @@ -339,15 +339,15 @@ public void read(TProtocol iprot) throws TException { case PARTS: if (__field.type == TType.LIST) { { - TList _list214 = iprot.readListBegin(); - this.parts = new ArrayList(Math.max(0, _list214.size)); - for (int _i215 = 0; - (_list214.size < 0) ? iprot.peekList() : (_i215 < _list214.size); - ++_i215) + TList _list238 = iprot.readListBegin(); + this.parts = new ArrayList(Math.max(0, _list238.size)); + for (int _i239 = 0; + (_list238.size < 0) ? iprot.peekList() : (_i239 < _list238.size); + ++_i239) { - int _elem216; - _elem216 = iprot.readI32(); - this.parts.add(_elem216); + int _elem240; + _elem240 = iprot.readI32(); + this.parts.add(_elem240); } iprot.readListEnd(); } @@ -387,8 +387,8 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(PARTS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.I32, this.parts.size())); - for (int _iter217 : this.parts) { - oprot.writeI32(_iter217); + for (int _iter241 : this.parts) { + oprot.writeI32(_iter241); } oprot.writeListEnd(); } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/ScanCursor.java b/client/src/main/generated/com/vesoft/nebula/storage/ScanCursor.java new file mode 100644 index 000000000..abb83cebe --- /dev/null +++ b/client/src/main/generated/com/vesoft/nebula/storage/ScanCursor.java @@ -0,0 +1,369 @@ +/** + * 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 ScanCursor implements TBase, java.io.Serializable, Cloneable, Comparable { + private static final TStruct STRUCT_DESC = new TStruct("ScanCursor"); + private static final TField HAS_NEXT_FIELD_DESC = new TField("has_next", TType.BOOL, (short)3); + private static final TField NEXT_CURSOR_FIELD_DESC = new TField("next_cursor", TType.STRING, (short)4); + + public boolean has_next; + public byte[] next_cursor; + public static final int HAS_NEXT = 3; + public static final int NEXT_CURSOR = 4; + + // isset id assignments + private static final int __HAS_NEXT_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); + + public static final Map metaDataMap; + + static { + Map tmpMetaDataMap = new HashMap(); + tmpMetaDataMap.put(HAS_NEXT, new FieldMetaData("has_next", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + tmpMetaDataMap.put(NEXT_CURSOR, new FieldMetaData("next_cursor", TFieldRequirementType.OPTIONAL, + new FieldValueMetaData(TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); + } + + static { + FieldMetaData.addStructMetaDataMap(ScanCursor.class, metaDataMap); + } + + public ScanCursor() { + } + + public ScanCursor( + boolean has_next) { + this(); + this.has_next = has_next; + setHas_nextIsSet(true); + } + + public ScanCursor( + boolean has_next, + byte[] next_cursor) { + this(); + this.has_next = has_next; + setHas_nextIsSet(true); + this.next_cursor = next_cursor; + } + + public static class Builder { + private boolean has_next; + private byte[] next_cursor; + + BitSet __optional_isset = new BitSet(1); + + public Builder() { + } + + public Builder setHas_next(final boolean has_next) { + this.has_next = has_next; + __optional_isset.set(__HAS_NEXT_ISSET_ID, true); + return this; + } + + public Builder setNext_cursor(final byte[] next_cursor) { + this.next_cursor = next_cursor; + return this; + } + + public ScanCursor build() { + ScanCursor result = new ScanCursor(); + if (__optional_isset.get(__HAS_NEXT_ISSET_ID)) { + result.setHas_next(this.has_next); + } + result.setNext_cursor(this.next_cursor); + return result; + } + } + + public static Builder builder() { + return new Builder(); + } + + /** + * Performs a deep copy on other. + */ + public ScanCursor(ScanCursor other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + this.has_next = TBaseHelper.deepCopy(other.has_next); + if (other.isSetNext_cursor()) { + this.next_cursor = TBaseHelper.deepCopy(other.next_cursor); + } + } + + public ScanCursor deepCopy() { + return new ScanCursor(this); + } + + public boolean isHas_next() { + return this.has_next; + } + + public ScanCursor setHas_next(boolean has_next) { + this.has_next = has_next; + setHas_nextIsSet(true); + return this; + } + + public void unsetHas_next() { + __isset_bit_vector.clear(__HAS_NEXT_ISSET_ID); + } + + // Returns true if field has_next is set (has been assigned a value) and false otherwise + public boolean isSetHas_next() { + return __isset_bit_vector.get(__HAS_NEXT_ISSET_ID); + } + + public void setHas_nextIsSet(boolean __value) { + __isset_bit_vector.set(__HAS_NEXT_ISSET_ID, __value); + } + + public byte[] getNext_cursor() { + return this.next_cursor; + } + + public ScanCursor setNext_cursor(byte[] next_cursor) { + this.next_cursor = next_cursor; + return this; + } + + public void unsetNext_cursor() { + this.next_cursor = null; + } + + // Returns true if field next_cursor is set (has been assigned a value) and false otherwise + public boolean isSetNext_cursor() { + return this.next_cursor != null; + } + + public void setNext_cursorIsSet(boolean __value) { + if (!__value) { + this.next_cursor = null; + } + } + + public void setFieldValue(int fieldID, Object __value) { + switch (fieldID) { + case HAS_NEXT: + if (__value == null) { + unsetHas_next(); + } else { + setHas_next((Boolean)__value); + } + break; + + case NEXT_CURSOR: + if (__value == null) { + unsetNext_cursor(); + } else { + setNext_cursor((byte[])__value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case HAS_NEXT: + return new Boolean(isHas_next()); + + case NEXT_CURSOR: + return getNext_cursor(); + + 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 ScanCursor)) + return false; + ScanCursor that = (ScanCursor)_that; + + if (!TBaseHelper.equalsNobinary(this.has_next, that.has_next)) { return false; } + + if (!TBaseHelper.equalsSlow(this.isSetNext_cursor(), that.isSetNext_cursor(), this.next_cursor, that.next_cursor)) { return false; } + + return true; + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(new Object[] {has_next, next_cursor}); + } + + @Override + public int compareTo(ScanCursor other) { + if (other == null) { + // See java.lang.Comparable docs + throw new NullPointerException(); + } + + if (other == this) { + return 0; + } + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetHas_next()).compareTo(other.isSetHas_next()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(has_next, other.has_next); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = Boolean.valueOf(isSetNext_cursor()).compareTo(other.isSetNext_cursor()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(next_cursor, other.next_cursor); + 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 HAS_NEXT: + if (__field.type == TType.BOOL) { + this.has_next = iprot.readBool(); + setHas_nextIsSet(true); + } else { + TProtocolUtil.skip(iprot, __field.type); + } + break; + case NEXT_CURSOR: + if (__field.type == TType.STRING) { + this.next_cursor = 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(HAS_NEXT_FIELD_DESC); + oprot.writeBool(this.has_next); + oprot.writeFieldEnd(); + if (this.next_cursor != null) { + if (isSetNext_cursor()) { + oprot.writeFieldBegin(NEXT_CURSOR_FIELD_DESC); + oprot.writeBinary(this.next_cursor); + 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("ScanCursor"); + sb.append(space); + sb.append("("); + sb.append(newLine); + boolean first = true; + + sb.append(indentStr); + sb.append("has_next"); + sb.append(space); + sb.append(":").append(space); + sb.append(TBaseHelper.toString(this.isHas_next(), indent + 1, prettyPrint)); + first = false; + if (isSetNext_cursor()) + { + if (!first) sb.append("," + newLine); + sb.append(indentStr); + sb.append("next_cursor"); + sb.append(space); + sb.append(":").append(space); + if (this.getNext_cursor() == null) { + sb.append("null"); + } else { + int __next_cursor_size = Math.min(this.getNext_cursor().length, 128); + for (int i = 0; i < __next_cursor_size; i++) { + if (i != 0) sb.append(" "); + sb.append(Integer.toHexString(this.getNext_cursor()[i]).length() > 1 ? Integer.toHexString(this.getNext_cursor()[i]).substring(Integer.toHexString(this.getNext_cursor()[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.getNext_cursor()[i]).toUpperCase()); + } + if (this.getNext_cursor().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/ScanEdgeRequest.java b/client/src/main/generated/com/vesoft/nebula/storage/ScanEdgeRequest.java index 39bb5df67..163c33195 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/ScanEdgeRequest.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/ScanEdgeRequest.java @@ -27,20 +27,18 @@ public class ScanEdgeRequest implements TBase, java.io.Serializable, Cloneable, Comparable { private static final TStruct STRUCT_DESC = new TStruct("ScanEdgeRequest"); 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 CURSOR_FIELD_DESC = new TField("cursor", TType.STRING, (short)3); - private static final TField RETURN_COLUMNS_FIELD_DESC = new TField("return_columns", TType.STRUCT, (short)4); - private static final TField LIMIT_FIELD_DESC = new TField("limit", TType.I64, (short)5); - private static final TField START_TIME_FIELD_DESC = new TField("start_time", TType.I64, (short)6); - private static final TField END_TIME_FIELD_DESC = new TField("end_time", TType.I64, (short)7); - private static final TField FILTER_FIELD_DESC = new TField("filter", TType.STRING, (short)8); - private static final TField ONLY_LATEST_VERSION_FIELD_DESC = new TField("only_latest_version", TType.BOOL, (short)9); - private static final TField ENABLE_READ_FROM_FOLLOWER_FIELD_DESC = new TField("enable_read_from_follower", TType.BOOL, (short)10); - private static final TField COMMON_FIELD_DESC = new TField("common", TType.STRUCT, (short)11); + private static final TField PARTS_FIELD_DESC = new TField("parts", TType.MAP, (short)2); + private static final TField RETURN_COLUMNS_FIELD_DESC = new TField("return_columns", TType.STRUCT, (short)3); + private static final TField LIMIT_FIELD_DESC = new TField("limit", TType.I64, (short)4); + private static final TField START_TIME_FIELD_DESC = new TField("start_time", TType.I64, (short)5); + private static final TField END_TIME_FIELD_DESC = new TField("end_time", TType.I64, (short)6); + private static final TField FILTER_FIELD_DESC = new TField("filter", TType.STRING, (short)7); + private static final TField ONLY_LATEST_VERSION_FIELD_DESC = new TField("only_latest_version", TType.BOOL, (short)8); + private static final TField ENABLE_READ_FROM_FOLLOWER_FIELD_DESC = new TField("enable_read_from_follower", TType.BOOL, (short)9); + private static final TField COMMON_FIELD_DESC = new TField("common", TType.STRUCT, (short)10); public int space_id; - public int part_id; - public byte[] cursor; + public Map parts; public EdgeProp return_columns; public long limit; public long start_time; @@ -50,26 +48,24 @@ public class ScanEdgeRequest implements TBase, java.io.Serializable, Cloneable, public boolean enable_read_from_follower; public RequestCommon common; public static final int SPACE_ID = 1; - public static final int PART_ID = 2; - public static final int CURSOR = 3; - public static final int RETURN_COLUMNS = 4; - public static final int LIMIT = 5; - public static final int START_TIME = 6; - public static final int END_TIME = 7; - public static final int FILTER = 8; - public static final int ONLY_LATEST_VERSION = 9; - public static final int ENABLE_READ_FROM_FOLLOWER = 10; - public static final int COMMON = 11; + public static final int PARTS = 2; + public static final int RETURN_COLUMNS = 3; + public static final int LIMIT = 4; + public static final int START_TIME = 5; + public static final int END_TIME = 6; + public static final int FILTER = 7; + public static final int ONLY_LATEST_VERSION = 8; + public static final int ENABLE_READ_FROM_FOLLOWER = 9; + public static final int COMMON = 10; // isset id assignments private static final int __SPACE_ID_ISSET_ID = 0; - private static final int __PART_ID_ISSET_ID = 1; - private static final int __LIMIT_ISSET_ID = 2; - private static final int __START_TIME_ISSET_ID = 3; - private static final int __END_TIME_ISSET_ID = 4; - private static final int __ONLY_LATEST_VERSION_ISSET_ID = 5; - private static final int __ENABLE_READ_FROM_FOLLOWER_ISSET_ID = 6; - private BitSet __isset_bit_vector = new BitSet(7); + private static final int __LIMIT_ISSET_ID = 1; + private static final int __START_TIME_ISSET_ID = 2; + private static final int __END_TIME_ISSET_ID = 3; + private static final int __ONLY_LATEST_VERSION_ISSET_ID = 4; + private static final int __ENABLE_READ_FROM_FOLLOWER_ISSET_ID = 5; + private BitSet __isset_bit_vector = new BitSet(6); public static final Map metaDataMap; @@ -77,10 +73,10 @@ public class ScanEdgeRequest implements TBase, java.io.Serializable, Cloneable, 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(CURSOR, new FieldMetaData("cursor", TFieldRequirementType.OPTIONAL, - new FieldValueMetaData(TType.STRING))); + tmpMetaDataMap.put(PARTS, new FieldMetaData("parts", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.I32), + new StructMetaData(TType.STRUCT, ScanCursor.class)))); tmpMetaDataMap.put(RETURN_COLUMNS, new FieldMetaData("return_columns", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, EdgeProp.class))); tmpMetaDataMap.put(LIMIT, new FieldMetaData("limit", TFieldRequirementType.DEFAULT, @@ -113,7 +109,7 @@ public ScanEdgeRequest() { public ScanEdgeRequest( int space_id, - int part_id, + Map parts, EdgeProp return_columns, long limit, boolean only_latest_version, @@ -121,8 +117,7 @@ public ScanEdgeRequest( this(); this.space_id = space_id; setSpace_idIsSet(true); - this.part_id = part_id; - setPart_idIsSet(true); + this.parts = parts; this.return_columns = return_columns; this.limit = limit; setLimitIsSet(true); @@ -134,8 +129,7 @@ public ScanEdgeRequest( public ScanEdgeRequest( int space_id, - int part_id, - byte[] cursor, + Map parts, EdgeProp return_columns, long limit, long start_time, @@ -147,9 +141,7 @@ public ScanEdgeRequest( this(); this.space_id = space_id; setSpace_idIsSet(true); - this.part_id = part_id; - setPart_idIsSet(true); - this.cursor = cursor; + this.parts = parts; this.return_columns = return_columns; this.limit = limit; setLimitIsSet(true); @@ -167,8 +159,7 @@ public ScanEdgeRequest( public static class Builder { private int space_id; - private int part_id; - private byte[] cursor; + private Map parts; private EdgeProp return_columns; private long limit; private long start_time; @@ -178,7 +169,7 @@ public static class Builder { private boolean enable_read_from_follower; private RequestCommon common; - BitSet __optional_isset = new BitSet(7); + BitSet __optional_isset = new BitSet(6); public Builder() { } @@ -189,14 +180,8 @@ public Builder setSpace_id(final int space_id) { 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 setCursor(final byte[] cursor) { - this.cursor = cursor; + public Builder setParts(final Map parts) { + this.parts = parts; return this; } @@ -250,10 +235,7 @@ public ScanEdgeRequest build() { 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.setCursor(this.cursor); + result.setParts(this.parts); result.setReturn_columns(this.return_columns); if (__optional_isset.get(__LIMIT_ISSET_ID)) { result.setLimit(this.limit); @@ -287,9 +269,8 @@ public ScanEdgeRequest(ScanEdgeRequest 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.isSetCursor()) { - this.cursor = TBaseHelper.deepCopy(other.cursor); + if (other.isSetParts()) { + this.parts = TBaseHelper.deepCopy(other.parts); } if (other.isSetReturn_columns()) { this.return_columns = TBaseHelper.deepCopy(other.return_columns); @@ -334,50 +315,27 @@ public void setSpace_idIsSet(boolean __value) { __isset_bit_vector.set(__SPACE_ID_ISSET_ID, __value); } - public int getPart_id() { - return this.part_id; - } - - public ScanEdgeRequest 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[] getCursor() { - return this.cursor; + public Map getParts() { + return this.parts; } - public ScanEdgeRequest setCursor(byte[] cursor) { - this.cursor = cursor; + public ScanEdgeRequest setParts(Map parts) { + this.parts = parts; return this; } - public void unsetCursor() { - this.cursor = null; + public void unsetParts() { + this.parts = null; } - // Returns true if field cursor is set (has been assigned a value) and false otherwise - public boolean isSetCursor() { - return this.cursor != 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 setCursorIsSet(boolean __value) { + public void setPartsIsSet(boolean __value) { if (!__value) { - this.cursor = null; + this.parts = null; } } @@ -568,6 +526,7 @@ public void setCommonIsSet(boolean __value) { } } + @SuppressWarnings("unchecked") public void setFieldValue(int fieldID, Object __value) { switch (fieldID) { case SPACE_ID: @@ -578,19 +537,11 @@ public void setFieldValue(int fieldID, Object __value) { } break; - case PART_ID: - if (__value == null) { - unsetPart_id(); - } else { - setPart_id((Integer)__value); - } - break; - - case CURSOR: + case PARTS: if (__value == null) { - unsetCursor(); + unsetParts(); } else { - setCursor((byte[])__value); + setParts((Map)__value); } break; @@ -668,11 +619,8 @@ public Object getFieldValue(int fieldID) { case SPACE_ID: return new Integer(getSpace_id()); - case PART_ID: - return new Integer(getPart_id()); - - case CURSOR: - return getCursor(); + case PARTS: + return getParts(); case RETURN_COLUMNS: return getReturn_columns(); @@ -715,9 +663,7 @@ public boolean equals(Object _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.isSetCursor(), that.isSetCursor(), this.cursor, that.cursor)) { return false; } + if (!TBaseHelper.equalsNobinary(this.isSetParts(), that.isSetParts(), this.parts, that.parts)) { return false; } if (!TBaseHelper.equalsNobinary(this.isSetReturn_columns(), that.isSetReturn_columns(), this.return_columns, that.return_columns)) { return false; } @@ -740,7 +686,7 @@ public boolean equals(Object _that) { @Override public int hashCode() { - return Arrays.deepHashCode(new Object[] {space_id, part_id, cursor, return_columns, limit, start_time, end_time, filter, only_latest_version, enable_read_from_follower, common}); + return Arrays.deepHashCode(new Object[] {space_id, parts, return_columns, limit, start_time, end_time, filter, only_latest_version, enable_read_from_follower, common}); } @Override @@ -763,19 +709,11 @@ public int compareTo(ScanEdgeRequest other) { if (lastComparison != 0) { return lastComparison; } - lastComparison = Boolean.valueOf(isSetPart_id()).compareTo(other.isSetPart_id()); + lastComparison = Boolean.valueOf(isSetParts()).compareTo(other.isSetParts()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(part_id, other.part_id); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = Boolean.valueOf(isSetCursor()).compareTo(other.isSetCursor()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(cursor, other.cursor); + lastComparison = TBaseHelper.compareTo(parts, other.parts); if (lastComparison != 0) { return lastComparison; } @@ -865,17 +803,24 @@ public void read(TProtocol iprot) throws TException { 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 CURSOR: - if (__field.type == TType.STRING) { - this.cursor = iprot.readBinary(); + case PARTS: + if (__field.type == TType.MAP) { + { + TMap _map203 = iprot.readMapBegin(); + this.parts = new HashMap(Math.max(0, 2*_map203.size)); + for (int _i204 = 0; + (_map203.size < 0) ? iprot.peekMap() : (_i204 < _map203.size); + ++_i204) + { + int _key205; + ScanCursor _val206; + _key205 = iprot.readI32(); + _val206 = new ScanCursor(); + _val206.read(iprot); + this.parts.put(_key205, _val206); + } + iprot.readMapEnd(); + } } else { TProtocolUtil.skip(iprot, __field.type); } @@ -963,15 +908,17 @@ public void write(TProtocol oprot) throws TException { 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.cursor != null) { - if (isSetCursor()) { - oprot.writeFieldBegin(CURSOR_FIELD_DESC); - oprot.writeBinary(this.cursor); - oprot.writeFieldEnd(); + if (this.parts != null) { + oprot.writeFieldBegin(PARTS_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.I32, TType.STRUCT, this.parts.size())); + for (Map.Entry _iter207 : this.parts.entrySet()) { + oprot.writeI32(_iter207.getKey()); + _iter207.getValue().write(oprot); + } + oprot.writeMapEnd(); } + oprot.writeFieldEnd(); } if (this.return_columns != null) { oprot.writeFieldBegin(RETURN_COLUMNS_FIELD_DESC); @@ -1039,30 +986,15 @@ public String toString(int indent, boolean prettyPrint) { first = false; if (!first) sb.append("," + newLine); sb.append(indentStr); - sb.append("part_id"); + sb.append("parts"); sb.append(space); sb.append(":").append(space); - sb.append(TBaseHelper.toString(this.getPart_id(), indent + 1, prettyPrint)); - first = false; - if (isSetCursor()) - { - if (!first) sb.append("," + newLine); - sb.append(indentStr); - sb.append("cursor"); - sb.append(space); - sb.append(":").append(space); - if (this.getCursor() == null) { - sb.append("null"); - } else { - int __cursor_size = Math.min(this.getCursor().length, 128); - for (int i = 0; i < __cursor_size; i++) { - if (i != 0) sb.append(" "); - sb.append(Integer.toHexString(this.getCursor()[i]).length() > 1 ? Integer.toHexString(this.getCursor()[i]).substring(Integer.toHexString(this.getCursor()[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.getCursor()[i]).toUpperCase()); - } - if (this.getCursor().length > 128) sb.append(" ..."); - } - first = false; + 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("return_columns"); diff --git a/client/src/main/generated/com/vesoft/nebula/storage/ScanEdgeResponse.java b/client/src/main/generated/com/vesoft/nebula/storage/ScanEdgeResponse.java index 6b2b56fb4..36a6c53df 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/ScanEdgeResponse.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/ScanEdgeResponse.java @@ -28,21 +28,16 @@ public class ScanEdgeResponse implements TBase, java.io.Serializable, Cloneable private static final TStruct STRUCT_DESC = new TStruct("ScanEdgeResponse"); private static final TField RESULT_FIELD_DESC = new TField("result", TType.STRUCT, (short)1); private static final TField EDGE_DATA_FIELD_DESC = new TField("edge_data", TType.STRUCT, (short)2); - private static final TField HAS_NEXT_FIELD_DESC = new TField("has_next", TType.BOOL, (short)3); - private static final TField NEXT_CURSOR_FIELD_DESC = new TField("next_cursor", TType.STRING, (short)4); + private static final TField CURSORS_FIELD_DESC = new TField("cursors", TType.MAP, (short)3); public ResponseCommon result; public com.vesoft.nebula.DataSet edge_data; - public boolean has_next; - public byte[] next_cursor; + public Map cursors; public static final int RESULT = 1; public static final int EDGE_DATA = 2; - public static final int HAS_NEXT = 3; - public static final int NEXT_CURSOR = 4; + public static final int CURSORS = 3; // isset id assignments - private static final int __HAS_NEXT_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); public static final Map metaDataMap; @@ -52,10 +47,10 @@ public class ScanEdgeResponse implements TBase, java.io.Serializable, Cloneable new StructMetaData(TType.STRUCT, ResponseCommon.class))); tmpMetaDataMap.put(EDGE_DATA, new FieldMetaData("edge_data", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, com.vesoft.nebula.DataSet.class))); - tmpMetaDataMap.put(HAS_NEXT, new FieldMetaData("has_next", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); - tmpMetaDataMap.put(NEXT_CURSOR, new FieldMetaData("next_cursor", TFieldRequirementType.OPTIONAL, - new FieldValueMetaData(TType.STRING))); + tmpMetaDataMap.put(CURSORS, new FieldMetaData("cursors", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.I32), + new StructMetaData(TType.STRUCT, ScanCursor.class)))); metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); } @@ -75,34 +70,17 @@ public ScanEdgeResponse( public ScanEdgeResponse( ResponseCommon result, com.vesoft.nebula.DataSet edge_data, - boolean has_next) { + Map cursors) { this(); this.result = result; this.edge_data = edge_data; - this.has_next = has_next; - setHas_nextIsSet(true); - } - - public ScanEdgeResponse( - ResponseCommon result, - com.vesoft.nebula.DataSet edge_data, - boolean has_next, - byte[] next_cursor) { - this(); - this.result = result; - this.edge_data = edge_data; - this.has_next = has_next; - setHas_nextIsSet(true); - this.next_cursor = next_cursor; + this.cursors = cursors; } public static class Builder { private ResponseCommon result; private com.vesoft.nebula.DataSet edge_data; - private boolean has_next; - private byte[] next_cursor; - - BitSet __optional_isset = new BitSet(1); + private Map cursors; public Builder() { } @@ -117,14 +95,8 @@ public Builder setEdge_data(final com.vesoft.nebula.DataSet edge_data) { return this; } - public Builder setHas_next(final boolean has_next) { - this.has_next = has_next; - __optional_isset.set(__HAS_NEXT_ISSET_ID, true); - return this; - } - - public Builder setNext_cursor(final byte[] next_cursor) { - this.next_cursor = next_cursor; + public Builder setCursors(final Map cursors) { + this.cursors = cursors; return this; } @@ -132,10 +104,7 @@ public ScanEdgeResponse build() { ScanEdgeResponse result = new ScanEdgeResponse(); result.setResult(this.result); result.setEdge_data(this.edge_data); - if (__optional_isset.get(__HAS_NEXT_ISSET_ID)) { - result.setHas_next(this.has_next); - } - result.setNext_cursor(this.next_cursor); + result.setCursors(this.cursors); return result; } } @@ -148,17 +117,14 @@ public static Builder builder() { * Performs a deep copy on other. */ public ScanEdgeResponse(ScanEdgeResponse other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); if (other.isSetResult()) { this.result = TBaseHelper.deepCopy(other.result); } if (other.isSetEdge_data()) { this.edge_data = TBaseHelper.deepCopy(other.edge_data); } - this.has_next = TBaseHelper.deepCopy(other.has_next); - if (other.isSetNext_cursor()) { - this.next_cursor = TBaseHelper.deepCopy(other.next_cursor); + if (other.isSetCursors()) { + this.cursors = TBaseHelper.deepCopy(other.cursors); } } @@ -214,53 +180,31 @@ public void setEdge_dataIsSet(boolean __value) { } } - public boolean isHas_next() { - return this.has_next; + public Map getCursors() { + return this.cursors; } - public ScanEdgeResponse setHas_next(boolean has_next) { - this.has_next = has_next; - setHas_nextIsSet(true); + public ScanEdgeResponse setCursors(Map cursors) { + this.cursors = cursors; return this; } - public void unsetHas_next() { - __isset_bit_vector.clear(__HAS_NEXT_ISSET_ID); - } - - // Returns true if field has_next is set (has been assigned a value) and false otherwise - public boolean isSetHas_next() { - return __isset_bit_vector.get(__HAS_NEXT_ISSET_ID); + public void unsetCursors() { + this.cursors = null; } - public void setHas_nextIsSet(boolean __value) { - __isset_bit_vector.set(__HAS_NEXT_ISSET_ID, __value); + // Returns true if field cursors is set (has been assigned a value) and false otherwise + public boolean isSetCursors() { + return this.cursors != null; } - public byte[] getNext_cursor() { - return this.next_cursor; - } - - public ScanEdgeResponse setNext_cursor(byte[] next_cursor) { - this.next_cursor = next_cursor; - return this; - } - - public void unsetNext_cursor() { - this.next_cursor = null; - } - - // Returns true if field next_cursor is set (has been assigned a value) and false otherwise - public boolean isSetNext_cursor() { - return this.next_cursor != null; - } - - public void setNext_cursorIsSet(boolean __value) { + public void setCursorsIsSet(boolean __value) { if (!__value) { - this.next_cursor = null; + this.cursors = null; } } + @SuppressWarnings("unchecked") public void setFieldValue(int fieldID, Object __value) { switch (fieldID) { case RESULT: @@ -279,19 +223,11 @@ public void setFieldValue(int fieldID, Object __value) { } break; - case HAS_NEXT: - if (__value == null) { - unsetHas_next(); - } else { - setHas_next((Boolean)__value); - } - break; - - case NEXT_CURSOR: + case CURSORS: if (__value == null) { - unsetNext_cursor(); + unsetCursors(); } else { - setNext_cursor((byte[])__value); + setCursors((Map)__value); } break; @@ -308,11 +244,8 @@ public Object getFieldValue(int fieldID) { case EDGE_DATA: return getEdge_data(); - case HAS_NEXT: - return new Boolean(isHas_next()); - - case NEXT_CURSOR: - return getNext_cursor(); + case CURSORS: + return getCursors(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -333,16 +266,14 @@ public boolean equals(Object _that) { if (!TBaseHelper.equalsNobinary(this.isSetEdge_data(), that.isSetEdge_data(), this.edge_data, that.edge_data)) { return false; } - if (!TBaseHelper.equalsNobinary(this.has_next, that.has_next)) { return false; } - - if (!TBaseHelper.equalsSlow(this.isSetNext_cursor(), that.isSetNext_cursor(), this.next_cursor, that.next_cursor)) { return false; } + if (!TBaseHelper.equalsNobinary(this.isSetCursors(), that.isSetCursors(), this.cursors, that.cursors)) { return false; } return true; } @Override public int hashCode() { - return Arrays.deepHashCode(new Object[] {result, edge_data, has_next, next_cursor}); + return Arrays.deepHashCode(new Object[] {result, edge_data, cursors}); } public void read(TProtocol iprot) throws TException { @@ -372,17 +303,24 @@ public void read(TProtocol iprot) throws TException { TProtocolUtil.skip(iprot, __field.type); } break; - case HAS_NEXT: - if (__field.type == TType.BOOL) { - this.has_next = iprot.readBool(); - setHas_nextIsSet(true); - } else { - TProtocolUtil.skip(iprot, __field.type); - } - break; - case NEXT_CURSOR: - if (__field.type == TType.STRING) { - this.next_cursor = iprot.readBinary(); + case CURSORS: + if (__field.type == TType.MAP) { + { + TMap _map208 = iprot.readMapBegin(); + this.cursors = new HashMap(Math.max(0, 2*_map208.size)); + for (int _i209 = 0; + (_map208.size < 0) ? iprot.peekMap() : (_i209 < _map208.size); + ++_i209) + { + int _key210; + ScanCursor _val211; + _key210 = iprot.readI32(); + _val211 = new ScanCursor(); + _val211.read(iprot); + this.cursors.put(_key210, _val211); + } + iprot.readMapEnd(); + } } else { TProtocolUtil.skip(iprot, __field.type); } @@ -414,15 +352,17 @@ public void write(TProtocol oprot) throws TException { this.edge_data.write(oprot); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(HAS_NEXT_FIELD_DESC); - oprot.writeBool(this.has_next); - oprot.writeFieldEnd(); - if (this.next_cursor != null) { - if (isSetNext_cursor()) { - oprot.writeFieldBegin(NEXT_CURSOR_FIELD_DESC); - oprot.writeBinary(this.next_cursor); - oprot.writeFieldEnd(); + if (this.cursors != null) { + oprot.writeFieldBegin(CURSORS_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.I32, TType.STRUCT, this.cursors.size())); + for (Map.Entry _iter212 : this.cursors.entrySet()) { + oprot.writeI32(_iter212.getKey()); + _iter212.getValue().write(oprot); + } + oprot.writeMapEnd(); } + oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -467,30 +407,15 @@ public String toString(int indent, boolean prettyPrint) { first = false; if (!first) sb.append("," + newLine); sb.append(indentStr); - sb.append("has_next"); + sb.append("cursors"); sb.append(space); sb.append(":").append(space); - sb.append(TBaseHelper.toString(this.isHas_next(), indent + 1, prettyPrint)); - first = false; - if (isSetNext_cursor()) - { - if (!first) sb.append("," + newLine); - sb.append(indentStr); - sb.append("next_cursor"); - sb.append(space); - sb.append(":").append(space); - if (this.getNext_cursor() == null) { - sb.append("null"); - } else { - int __next_cursor_size = Math.min(this.getNext_cursor().length, 128); - for (int i = 0; i < __next_cursor_size; i++) { - if (i != 0) sb.append(" "); - sb.append(Integer.toHexString(this.getNext_cursor()[i]).length() > 1 ? Integer.toHexString(this.getNext_cursor()[i]).substring(Integer.toHexString(this.getNext_cursor()[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.getNext_cursor()[i]).toUpperCase()); - } - if (this.getNext_cursor().length > 128) sb.append(" ..."); - } - first = false; + if (this.getCursors() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getCursors(), 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/ScanVertexRequest.java b/client/src/main/generated/com/vesoft/nebula/storage/ScanVertexRequest.java index 73fb4532b..204fbdf50 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/ScanVertexRequest.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/ScanVertexRequest.java @@ -27,21 +27,19 @@ public class ScanVertexRequest implements TBase, java.io.Serializable, Cloneable, Comparable { private static final TStruct STRUCT_DESC = new TStruct("ScanVertexRequest"); 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 CURSOR_FIELD_DESC = new TField("cursor", TType.STRING, (short)3); - private static final TField RETURN_COLUMNS_FIELD_DESC = new TField("return_columns", TType.STRUCT, (short)4); - private static final TField LIMIT_FIELD_DESC = new TField("limit", TType.I64, (short)5); - private static final TField START_TIME_FIELD_DESC = new TField("start_time", TType.I64, (short)6); - private static final TField END_TIME_FIELD_DESC = new TField("end_time", TType.I64, (short)7); - private static final TField FILTER_FIELD_DESC = new TField("filter", TType.STRING, (short)8); - private static final TField ONLY_LATEST_VERSION_FIELD_DESC = new TField("only_latest_version", TType.BOOL, (short)9); - private static final TField ENABLE_READ_FROM_FOLLOWER_FIELD_DESC = new TField("enable_read_from_follower", TType.BOOL, (short)10); - private static final TField COMMON_FIELD_DESC = new TField("common", TType.STRUCT, (short)11); + private static final TField PARTS_FIELD_DESC = new TField("parts", TType.MAP, (short)2); + private static final TField RETURN_COLUMNS_FIELD_DESC = new TField("return_columns", TType.LIST, (short)3); + private static final TField LIMIT_FIELD_DESC = new TField("limit", TType.I64, (short)4); + private static final TField START_TIME_FIELD_DESC = new TField("start_time", TType.I64, (short)5); + private static final TField END_TIME_FIELD_DESC = new TField("end_time", TType.I64, (short)6); + private static final TField FILTER_FIELD_DESC = new TField("filter", TType.STRING, (short)7); + private static final TField ONLY_LATEST_VERSION_FIELD_DESC = new TField("only_latest_version", TType.BOOL, (short)8); + private static final TField ENABLE_READ_FROM_FOLLOWER_FIELD_DESC = new TField("enable_read_from_follower", TType.BOOL, (short)9); + private static final TField COMMON_FIELD_DESC = new TField("common", TType.STRUCT, (short)10); public int space_id; - public int part_id; - public byte[] cursor; - public VertexProp return_columns; + public Map parts; + public List return_columns; public long limit; public long start_time; public long end_time; @@ -50,26 +48,24 @@ public class ScanVertexRequest implements TBase, java.io.Serializable, Cloneable public boolean enable_read_from_follower; public RequestCommon common; public static final int SPACE_ID = 1; - public static final int PART_ID = 2; - public static final int CURSOR = 3; - public static final int RETURN_COLUMNS = 4; - public static final int LIMIT = 5; - public static final int START_TIME = 6; - public static final int END_TIME = 7; - public static final int FILTER = 8; - public static final int ONLY_LATEST_VERSION = 9; - public static final int ENABLE_READ_FROM_FOLLOWER = 10; - public static final int COMMON = 11; + public static final int PARTS = 2; + public static final int RETURN_COLUMNS = 3; + public static final int LIMIT = 4; + public static final int START_TIME = 5; + public static final int END_TIME = 6; + public static final int FILTER = 7; + public static final int ONLY_LATEST_VERSION = 8; + public static final int ENABLE_READ_FROM_FOLLOWER = 9; + public static final int COMMON = 10; // isset id assignments private static final int __SPACE_ID_ISSET_ID = 0; - private static final int __PART_ID_ISSET_ID = 1; - private static final int __LIMIT_ISSET_ID = 2; - private static final int __START_TIME_ISSET_ID = 3; - private static final int __END_TIME_ISSET_ID = 4; - private static final int __ONLY_LATEST_VERSION_ISSET_ID = 5; - private static final int __ENABLE_READ_FROM_FOLLOWER_ISSET_ID = 6; - private BitSet __isset_bit_vector = new BitSet(7); + private static final int __LIMIT_ISSET_ID = 1; + private static final int __START_TIME_ISSET_ID = 2; + private static final int __END_TIME_ISSET_ID = 3; + private static final int __ONLY_LATEST_VERSION_ISSET_ID = 4; + private static final int __ENABLE_READ_FROM_FOLLOWER_ISSET_ID = 5; + private BitSet __isset_bit_vector = new BitSet(6); public static final Map metaDataMap; @@ -77,12 +73,13 @@ public class ScanVertexRequest implements TBase, java.io.Serializable, Cloneable 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(CURSOR, new FieldMetaData("cursor", TFieldRequirementType.OPTIONAL, - new FieldValueMetaData(TType.STRING))); + tmpMetaDataMap.put(PARTS, new FieldMetaData("parts", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.I32), + new StructMetaData(TType.STRUCT, ScanCursor.class)))); tmpMetaDataMap.put(RETURN_COLUMNS, new FieldMetaData("return_columns", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, VertexProp.class))); + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, VertexProp.class)))); tmpMetaDataMap.put(LIMIT, new FieldMetaData("limit", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I64))); tmpMetaDataMap.put(START_TIME, new FieldMetaData("start_time", TFieldRequirementType.OPTIONAL, @@ -113,16 +110,15 @@ public ScanVertexRequest() { public ScanVertexRequest( int space_id, - int part_id, - VertexProp return_columns, + Map parts, + List return_columns, long limit, boolean only_latest_version, boolean enable_read_from_follower) { this(); this.space_id = space_id; setSpace_idIsSet(true); - this.part_id = part_id; - setPart_idIsSet(true); + this.parts = parts; this.return_columns = return_columns; this.limit = limit; setLimitIsSet(true); @@ -134,9 +130,8 @@ public ScanVertexRequest( public ScanVertexRequest( int space_id, - int part_id, - byte[] cursor, - VertexProp return_columns, + Map parts, + List return_columns, long limit, long start_time, long end_time, @@ -147,9 +142,7 @@ public ScanVertexRequest( this(); this.space_id = space_id; setSpace_idIsSet(true); - this.part_id = part_id; - setPart_idIsSet(true); - this.cursor = cursor; + this.parts = parts; this.return_columns = return_columns; this.limit = limit; setLimitIsSet(true); @@ -167,9 +160,8 @@ public ScanVertexRequest( public static class Builder { private int space_id; - private int part_id; - private byte[] cursor; - private VertexProp return_columns; + private Map parts; + private List return_columns; private long limit; private long start_time; private long end_time; @@ -178,7 +170,7 @@ public static class Builder { private boolean enable_read_from_follower; private RequestCommon common; - BitSet __optional_isset = new BitSet(7); + BitSet __optional_isset = new BitSet(6); public Builder() { } @@ -189,18 +181,12 @@ public Builder setSpace_id(final int space_id) { 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 setCursor(final byte[] cursor) { - this.cursor = cursor; + public Builder setParts(final Map parts) { + this.parts = parts; return this; } - public Builder setReturn_columns(final VertexProp return_columns) { + public Builder setReturn_columns(final List return_columns) { this.return_columns = return_columns; return this; } @@ -250,10 +236,7 @@ public ScanVertexRequest build() { 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.setCursor(this.cursor); + result.setParts(this.parts); result.setReturn_columns(this.return_columns); if (__optional_isset.get(__LIMIT_ISSET_ID)) { result.setLimit(this.limit); @@ -287,9 +270,8 @@ public ScanVertexRequest(ScanVertexRequest 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.isSetCursor()) { - this.cursor = TBaseHelper.deepCopy(other.cursor); + if (other.isSetParts()) { + this.parts = TBaseHelper.deepCopy(other.parts); } if (other.isSetReturn_columns()) { this.return_columns = TBaseHelper.deepCopy(other.return_columns); @@ -334,58 +316,35 @@ public void setSpace_idIsSet(boolean __value) { __isset_bit_vector.set(__SPACE_ID_ISSET_ID, __value); } - public int getPart_id() { - return this.part_id; + public Map getParts() { + return this.parts; } - public ScanVertexRequest setPart_id(int part_id) { - this.part_id = part_id; - setPart_idIsSet(true); + public ScanVertexRequest setParts(Map parts) { + this.parts = parts; 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[] getCursor() { - return this.cursor; - } - - public ScanVertexRequest setCursor(byte[] cursor) { - this.cursor = cursor; - return this; + public void unsetParts() { + this.parts = null; } - public void unsetCursor() { - this.cursor = null; + // Returns true if field parts is set (has been assigned a value) and false otherwise + public boolean isSetParts() { + return this.parts != null; } - // Returns true if field cursor is set (has been assigned a value) and false otherwise - public boolean isSetCursor() { - return this.cursor != null; - } - - public void setCursorIsSet(boolean __value) { + public void setPartsIsSet(boolean __value) { if (!__value) { - this.cursor = null; + this.parts = null; } } - public VertexProp getReturn_columns() { + public List getReturn_columns() { return this.return_columns; } - public ScanVertexRequest setReturn_columns(VertexProp return_columns) { + public ScanVertexRequest setReturn_columns(List return_columns) { this.return_columns = return_columns; return this; } @@ -568,6 +527,7 @@ public void setCommonIsSet(boolean __value) { } } + @SuppressWarnings("unchecked") public void setFieldValue(int fieldID, Object __value) { switch (fieldID) { case SPACE_ID: @@ -578,19 +538,11 @@ public void setFieldValue(int fieldID, Object __value) { } break; - case PART_ID: - if (__value == null) { - unsetPart_id(); - } else { - setPart_id((Integer)__value); - } - break; - - case CURSOR: + case PARTS: if (__value == null) { - unsetCursor(); + unsetParts(); } else { - setCursor((byte[])__value); + setParts((Map)__value); } break; @@ -598,7 +550,7 @@ public void setFieldValue(int fieldID, Object __value) { if (__value == null) { unsetReturn_columns(); } else { - setReturn_columns((VertexProp)__value); + setReturn_columns((List)__value); } break; @@ -668,11 +620,8 @@ public Object getFieldValue(int fieldID) { case SPACE_ID: return new Integer(getSpace_id()); - case PART_ID: - return new Integer(getPart_id()); - - case CURSOR: - return getCursor(); + case PARTS: + return getParts(); case RETURN_COLUMNS: return getReturn_columns(); @@ -715,9 +664,7 @@ public boolean equals(Object _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.isSetCursor(), that.isSetCursor(), this.cursor, that.cursor)) { return false; } + if (!TBaseHelper.equalsNobinary(this.isSetParts(), that.isSetParts(), this.parts, that.parts)) { return false; } if (!TBaseHelper.equalsNobinary(this.isSetReturn_columns(), that.isSetReturn_columns(), this.return_columns, that.return_columns)) { return false; } @@ -740,7 +687,7 @@ public boolean equals(Object _that) { @Override public int hashCode() { - return Arrays.deepHashCode(new Object[] {space_id, part_id, cursor, return_columns, limit, start_time, end_time, filter, only_latest_version, enable_read_from_follower, common}); + return Arrays.deepHashCode(new Object[] {space_id, parts, return_columns, limit, start_time, end_time, filter, only_latest_version, enable_read_from_follower, common}); } @Override @@ -763,19 +710,11 @@ public int compareTo(ScanVertexRequest other) { 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(isSetCursor()).compareTo(other.isSetCursor()); + lastComparison = Boolean.valueOf(isSetParts()).compareTo(other.isSetParts()); if (lastComparison != 0) { return lastComparison; } - lastComparison = TBaseHelper.compareTo(cursor, other.cursor); + lastComparison = TBaseHelper.compareTo(parts, other.parts); if (lastComparison != 0) { return lastComparison; } @@ -865,25 +804,44 @@ public void read(TProtocol iprot) throws TException { 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 CURSOR: - if (__field.type == TType.STRING) { - this.cursor = iprot.readBinary(); + case PARTS: + if (__field.type == TType.MAP) { + { + TMap _map189 = iprot.readMapBegin(); + this.parts = new HashMap(Math.max(0, 2*_map189.size)); + for (int _i190 = 0; + (_map189.size < 0) ? iprot.peekMap() : (_i190 < _map189.size); + ++_i190) + { + int _key191; + ScanCursor _val192; + _key191 = iprot.readI32(); + _val192 = new ScanCursor(); + _val192.read(iprot); + this.parts.put(_key191, _val192); + } + iprot.readMapEnd(); + } } else { TProtocolUtil.skip(iprot, __field.type); } break; case RETURN_COLUMNS: - if (__field.type == TType.STRUCT) { - this.return_columns = new VertexProp(); - this.return_columns.read(iprot); + if (__field.type == TType.LIST) { + { + TList _list193 = iprot.readListBegin(); + this.return_columns = new ArrayList(Math.max(0, _list193.size)); + for (int _i194 = 0; + (_list193.size < 0) ? iprot.peekList() : (_i194 < _list193.size); + ++_i194) + { + VertexProp _elem195; + _elem195 = new VertexProp(); + _elem195.read(iprot); + this.return_columns.add(_elem195); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, __field.type); } @@ -963,19 +921,27 @@ public void write(TProtocol oprot) throws TException { 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.cursor != null) { - if (isSetCursor()) { - oprot.writeFieldBegin(CURSOR_FIELD_DESC); - oprot.writeBinary(this.cursor); - oprot.writeFieldEnd(); + if (this.parts != null) { + oprot.writeFieldBegin(PARTS_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.I32, TType.STRUCT, this.parts.size())); + for (Map.Entry _iter196 : this.parts.entrySet()) { + oprot.writeI32(_iter196.getKey()); + _iter196.getValue().write(oprot); + } + oprot.writeMapEnd(); } + oprot.writeFieldEnd(); } if (this.return_columns != null) { oprot.writeFieldBegin(RETURN_COLUMNS_FIELD_DESC); - this.return_columns.write(oprot); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.return_columns.size())); + for (VertexProp _iter197 : this.return_columns) { + _iter197.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } oprot.writeFieldBegin(LIMIT_FIELD_DESC); @@ -1039,30 +1005,15 @@ public String toString(int indent, boolean prettyPrint) { first = false; if (!first) sb.append("," + newLine); sb.append(indentStr); - sb.append("part_id"); + sb.append("parts"); sb.append(space); sb.append(":").append(space); - sb.append(TBaseHelper.toString(this.getPart_id(), indent + 1, prettyPrint)); - first = false; - if (isSetCursor()) - { - if (!first) sb.append("," + newLine); - sb.append(indentStr); - sb.append("cursor"); - sb.append(space); - sb.append(":").append(space); - if (this.getCursor() == null) { - sb.append("null"); - } else { - int __cursor_size = Math.min(this.getCursor().length, 128); - for (int i = 0; i < __cursor_size; i++) { - if (i != 0) sb.append(" "); - sb.append(Integer.toHexString(this.getCursor()[i]).length() > 1 ? Integer.toHexString(this.getCursor()[i]).substring(Integer.toHexString(this.getCursor()[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.getCursor()[i]).toUpperCase()); - } - if (this.getCursor().length > 128) sb.append(" ..."); - } - first = false; + 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("return_columns"); diff --git a/client/src/main/generated/com/vesoft/nebula/storage/ScanVertexResponse.java b/client/src/main/generated/com/vesoft/nebula/storage/ScanVertexResponse.java index 5f1713209..377ff3c26 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/ScanVertexResponse.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/ScanVertexResponse.java @@ -28,21 +28,16 @@ public class ScanVertexResponse implements TBase, java.io.Serializable, Cloneabl private static final TStruct STRUCT_DESC = new TStruct("ScanVertexResponse"); private static final TField RESULT_FIELD_DESC = new TField("result", TType.STRUCT, (short)1); private static final TField VERTEX_DATA_FIELD_DESC = new TField("vertex_data", TType.STRUCT, (short)2); - private static final TField HAS_NEXT_FIELD_DESC = new TField("has_next", TType.BOOL, (short)3); - private static final TField NEXT_CURSOR_FIELD_DESC = new TField("next_cursor", TType.STRING, (short)4); + private static final TField CURSORS_FIELD_DESC = new TField("cursors", TType.MAP, (short)3); public ResponseCommon result; public com.vesoft.nebula.DataSet vertex_data; - public boolean has_next; - public byte[] next_cursor; + public Map cursors; public static final int RESULT = 1; public static final int VERTEX_DATA = 2; - public static final int HAS_NEXT = 3; - public static final int NEXT_CURSOR = 4; + public static final int CURSORS = 3; // isset id assignments - private static final int __HAS_NEXT_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); public static final Map metaDataMap; @@ -52,10 +47,10 @@ public class ScanVertexResponse implements TBase, java.io.Serializable, Cloneabl new StructMetaData(TType.STRUCT, ResponseCommon.class))); tmpMetaDataMap.put(VERTEX_DATA, new FieldMetaData("vertex_data", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, com.vesoft.nebula.DataSet.class))); - tmpMetaDataMap.put(HAS_NEXT, new FieldMetaData("has_next", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); - tmpMetaDataMap.put(NEXT_CURSOR, new FieldMetaData("next_cursor", TFieldRequirementType.OPTIONAL, - new FieldValueMetaData(TType.STRING))); + tmpMetaDataMap.put(CURSORS, new FieldMetaData("cursors", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.I32), + new StructMetaData(TType.STRUCT, ScanCursor.class)))); metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); } @@ -75,34 +70,17 @@ public ScanVertexResponse( public ScanVertexResponse( ResponseCommon result, com.vesoft.nebula.DataSet vertex_data, - boolean has_next) { + Map cursors) { this(); this.result = result; this.vertex_data = vertex_data; - this.has_next = has_next; - setHas_nextIsSet(true); - } - - public ScanVertexResponse( - ResponseCommon result, - com.vesoft.nebula.DataSet vertex_data, - boolean has_next, - byte[] next_cursor) { - this(); - this.result = result; - this.vertex_data = vertex_data; - this.has_next = has_next; - setHas_nextIsSet(true); - this.next_cursor = next_cursor; + this.cursors = cursors; } public static class Builder { private ResponseCommon result; private com.vesoft.nebula.DataSet vertex_data; - private boolean has_next; - private byte[] next_cursor; - - BitSet __optional_isset = new BitSet(1); + private Map cursors; public Builder() { } @@ -117,14 +95,8 @@ public Builder setVertex_data(final com.vesoft.nebula.DataSet vertex_data) { return this; } - public Builder setHas_next(final boolean has_next) { - this.has_next = has_next; - __optional_isset.set(__HAS_NEXT_ISSET_ID, true); - return this; - } - - public Builder setNext_cursor(final byte[] next_cursor) { - this.next_cursor = next_cursor; + public Builder setCursors(final Map cursors) { + this.cursors = cursors; return this; } @@ -132,10 +104,7 @@ public ScanVertexResponse build() { ScanVertexResponse result = new ScanVertexResponse(); result.setResult(this.result); result.setVertex_data(this.vertex_data); - if (__optional_isset.get(__HAS_NEXT_ISSET_ID)) { - result.setHas_next(this.has_next); - } - result.setNext_cursor(this.next_cursor); + result.setCursors(this.cursors); return result; } } @@ -148,17 +117,14 @@ public static Builder builder() { * Performs a deep copy on other. */ public ScanVertexResponse(ScanVertexResponse other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); if (other.isSetResult()) { this.result = TBaseHelper.deepCopy(other.result); } if (other.isSetVertex_data()) { this.vertex_data = TBaseHelper.deepCopy(other.vertex_data); } - this.has_next = TBaseHelper.deepCopy(other.has_next); - if (other.isSetNext_cursor()) { - this.next_cursor = TBaseHelper.deepCopy(other.next_cursor); + if (other.isSetCursors()) { + this.cursors = TBaseHelper.deepCopy(other.cursors); } } @@ -214,53 +180,31 @@ public void setVertex_dataIsSet(boolean __value) { } } - public boolean isHas_next() { - return this.has_next; + public Map getCursors() { + return this.cursors; } - public ScanVertexResponse setHas_next(boolean has_next) { - this.has_next = has_next; - setHas_nextIsSet(true); + public ScanVertexResponse setCursors(Map cursors) { + this.cursors = cursors; return this; } - public void unsetHas_next() { - __isset_bit_vector.clear(__HAS_NEXT_ISSET_ID); - } - - // Returns true if field has_next is set (has been assigned a value) and false otherwise - public boolean isSetHas_next() { - return __isset_bit_vector.get(__HAS_NEXT_ISSET_ID); + public void unsetCursors() { + this.cursors = null; } - public void setHas_nextIsSet(boolean __value) { - __isset_bit_vector.set(__HAS_NEXT_ISSET_ID, __value); + // Returns true if field cursors is set (has been assigned a value) and false otherwise + public boolean isSetCursors() { + return this.cursors != null; } - public byte[] getNext_cursor() { - return this.next_cursor; - } - - public ScanVertexResponse setNext_cursor(byte[] next_cursor) { - this.next_cursor = next_cursor; - return this; - } - - public void unsetNext_cursor() { - this.next_cursor = null; - } - - // Returns true if field next_cursor is set (has been assigned a value) and false otherwise - public boolean isSetNext_cursor() { - return this.next_cursor != null; - } - - public void setNext_cursorIsSet(boolean __value) { + public void setCursorsIsSet(boolean __value) { if (!__value) { - this.next_cursor = null; + this.cursors = null; } } + @SuppressWarnings("unchecked") public void setFieldValue(int fieldID, Object __value) { switch (fieldID) { case RESULT: @@ -279,19 +223,11 @@ public void setFieldValue(int fieldID, Object __value) { } break; - case HAS_NEXT: - if (__value == null) { - unsetHas_next(); - } else { - setHas_next((Boolean)__value); - } - break; - - case NEXT_CURSOR: + case CURSORS: if (__value == null) { - unsetNext_cursor(); + unsetCursors(); } else { - setNext_cursor((byte[])__value); + setCursors((Map)__value); } break; @@ -308,11 +244,8 @@ public Object getFieldValue(int fieldID) { case VERTEX_DATA: return getVertex_data(); - case HAS_NEXT: - return new Boolean(isHas_next()); - - case NEXT_CURSOR: - return getNext_cursor(); + case CURSORS: + return getCursors(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -333,16 +266,14 @@ public boolean equals(Object _that) { if (!TBaseHelper.equalsNobinary(this.isSetVertex_data(), that.isSetVertex_data(), this.vertex_data, that.vertex_data)) { return false; } - if (!TBaseHelper.equalsNobinary(this.has_next, that.has_next)) { return false; } - - if (!TBaseHelper.equalsSlow(this.isSetNext_cursor(), that.isSetNext_cursor(), this.next_cursor, that.next_cursor)) { return false; } + if (!TBaseHelper.equalsNobinary(this.isSetCursors(), that.isSetCursors(), this.cursors, that.cursors)) { return false; } return true; } @Override public int hashCode() { - return Arrays.deepHashCode(new Object[] {result, vertex_data, has_next, next_cursor}); + return Arrays.deepHashCode(new Object[] {result, vertex_data, cursors}); } public void read(TProtocol iprot) throws TException { @@ -372,17 +303,24 @@ public void read(TProtocol iprot) throws TException { TProtocolUtil.skip(iprot, __field.type); } break; - case HAS_NEXT: - if (__field.type == TType.BOOL) { - this.has_next = iprot.readBool(); - setHas_nextIsSet(true); - } else { - TProtocolUtil.skip(iprot, __field.type); - } - break; - case NEXT_CURSOR: - if (__field.type == TType.STRING) { - this.next_cursor = iprot.readBinary(); + case CURSORS: + if (__field.type == TType.MAP) { + { + TMap _map198 = iprot.readMapBegin(); + this.cursors = new HashMap(Math.max(0, 2*_map198.size)); + for (int _i199 = 0; + (_map198.size < 0) ? iprot.peekMap() : (_i199 < _map198.size); + ++_i199) + { + int _key200; + ScanCursor _val201; + _key200 = iprot.readI32(); + _val201 = new ScanCursor(); + _val201.read(iprot); + this.cursors.put(_key200, _val201); + } + iprot.readMapEnd(); + } } else { TProtocolUtil.skip(iprot, __field.type); } @@ -414,15 +352,17 @@ public void write(TProtocol oprot) throws TException { this.vertex_data.write(oprot); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(HAS_NEXT_FIELD_DESC); - oprot.writeBool(this.has_next); - oprot.writeFieldEnd(); - if (this.next_cursor != null) { - if (isSetNext_cursor()) { - oprot.writeFieldBegin(NEXT_CURSOR_FIELD_DESC); - oprot.writeBinary(this.next_cursor); - oprot.writeFieldEnd(); + if (this.cursors != null) { + oprot.writeFieldBegin(CURSORS_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.I32, TType.STRUCT, this.cursors.size())); + for (Map.Entry _iter202 : this.cursors.entrySet()) { + oprot.writeI32(_iter202.getKey()); + _iter202.getValue().write(oprot); + } + oprot.writeMapEnd(); } + oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -467,30 +407,15 @@ public String toString(int indent, boolean prettyPrint) { first = false; if (!first) sb.append("," + newLine); sb.append(indentStr); - sb.append("has_next"); + sb.append("cursors"); sb.append(space); sb.append(":").append(space); - sb.append(TBaseHelper.toString(this.isHas_next(), indent + 1, prettyPrint)); - first = false; - if (isSetNext_cursor()) - { - if (!first) sb.append("," + newLine); - sb.append(indentStr); - sb.append("next_cursor"); - sb.append(space); - sb.append(":").append(space); - if (this.getNext_cursor() == null) { - sb.append("null"); - } else { - int __next_cursor_size = Math.min(this.getNext_cursor().length, 128); - for (int i = 0; i < __next_cursor_size; i++) { - if (i != 0) sb.append(" "); - sb.append(Integer.toHexString(this.getNext_cursor()[i]).length() > 1 ? Integer.toHexString(this.getNext_cursor()[i]).substring(Integer.toHexString(this.getNext_cursor()[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.getNext_cursor()[i]).toUpperCase()); - } - if (this.getNext_cursor().length > 128) sb.append(" ..."); - } - first = false; + if (this.getCursors() == null) { + sb.append("null"); + } else { + sb.append(TBaseHelper.toString(this.getCursors(), 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 04627c6a4..026a16de0 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 resultHandler400) throws TException { + public void transLeader(TransLeaderReq req, AsyncMethodCallback resultHandler424) throws TException { checkReady(); - transLeader_call method_call = new transLeader_call(req, resultHandler400, this, ___protocolFactory, ___transport); + transLeader_call method_call = new transLeader_call(req, resultHandler424, 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 resultHandler401, TAsyncClient client397, TProtocolFactory protocolFactory398, TNonblockingTransport transport399) throws TException { - super(client397, protocolFactory398, transport399, resultHandler401, false); + public transLeader_call(TransLeaderReq req, AsyncMethodCallback resultHandler425, TAsyncClient client421, TProtocolFactory protocolFactory422, TNonblockingTransport transport423) throws TException { + super(client421, protocolFactory422, transport423, resultHandler425, false); this.req = req; } @@ -900,17 +900,17 @@ public AdminExecResp getResult() throws TException { } } - public void addPart(AddPartReq req, AsyncMethodCallback resultHandler405) throws TException { + public void addPart(AddPartReq req, AsyncMethodCallback resultHandler429) throws TException { checkReady(); - addPart_call method_call = new addPart_call(req, resultHandler405, this, ___protocolFactory, ___transport); + addPart_call method_call = new addPart_call(req, resultHandler429, 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 resultHandler406, TAsyncClient client402, TProtocolFactory protocolFactory403, TNonblockingTransport transport404) throws TException { - super(client402, protocolFactory403, transport404, resultHandler406, false); + public addPart_call(AddPartReq req, AsyncMethodCallback resultHandler430, TAsyncClient client426, TProtocolFactory protocolFactory427, TNonblockingTransport transport428) throws TException { + super(client426, protocolFactory427, transport428, resultHandler430, false); this.req = req; } @@ -932,17 +932,17 @@ public AdminExecResp getResult() throws TException { } } - public void addLearner(AddLearnerReq req, AsyncMethodCallback resultHandler410) throws TException { + public void addLearner(AddLearnerReq req, AsyncMethodCallback resultHandler434) throws TException { checkReady(); - addLearner_call method_call = new addLearner_call(req, resultHandler410, this, ___protocolFactory, ___transport); + addLearner_call method_call = new addLearner_call(req, resultHandler434, 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 resultHandler411, TAsyncClient client407, TProtocolFactory protocolFactory408, TNonblockingTransport transport409) throws TException { - super(client407, protocolFactory408, transport409, resultHandler411, false); + public addLearner_call(AddLearnerReq req, AsyncMethodCallback resultHandler435, TAsyncClient client431, TProtocolFactory protocolFactory432, TNonblockingTransport transport433) throws TException { + super(client431, protocolFactory432, transport433, resultHandler435, false); this.req = req; } @@ -964,17 +964,17 @@ public AdminExecResp getResult() throws TException { } } - public void removePart(RemovePartReq req, AsyncMethodCallback resultHandler415) throws TException { + public void removePart(RemovePartReq req, AsyncMethodCallback resultHandler439) throws TException { checkReady(); - removePart_call method_call = new removePart_call(req, resultHandler415, this, ___protocolFactory, ___transport); + removePart_call method_call = new removePart_call(req, resultHandler439, 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 resultHandler416, TAsyncClient client412, TProtocolFactory protocolFactory413, TNonblockingTransport transport414) throws TException { - super(client412, protocolFactory413, transport414, resultHandler416, false); + public removePart_call(RemovePartReq req, AsyncMethodCallback resultHandler440, TAsyncClient client436, TProtocolFactory protocolFactory437, TNonblockingTransport transport438) throws TException { + super(client436, protocolFactory437, transport438, resultHandler440, false); this.req = req; } @@ -996,17 +996,17 @@ public AdminExecResp getResult() throws TException { } } - public void memberChange(MemberChangeReq req, AsyncMethodCallback resultHandler420) throws TException { + public void memberChange(MemberChangeReq req, AsyncMethodCallback resultHandler444) throws TException { checkReady(); - memberChange_call method_call = new memberChange_call(req, resultHandler420, this, ___protocolFactory, ___transport); + memberChange_call method_call = new memberChange_call(req, resultHandler444, 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 resultHandler421, TAsyncClient client417, TProtocolFactory protocolFactory418, TNonblockingTransport transport419) throws TException { - super(client417, protocolFactory418, transport419, resultHandler421, false); + public memberChange_call(MemberChangeReq req, AsyncMethodCallback resultHandler445, TAsyncClient client441, TProtocolFactory protocolFactory442, TNonblockingTransport transport443) throws TException { + super(client441, protocolFactory442, transport443, resultHandler445, false); this.req = req; } @@ -1028,17 +1028,17 @@ public AdminExecResp getResult() throws TException { } } - public void waitingForCatchUpData(CatchUpDataReq req, AsyncMethodCallback resultHandler425) throws TException { + public void waitingForCatchUpData(CatchUpDataReq req, AsyncMethodCallback resultHandler449) throws TException { checkReady(); - waitingForCatchUpData_call method_call = new waitingForCatchUpData_call(req, resultHandler425, this, ___protocolFactory, ___transport); + waitingForCatchUpData_call method_call = new waitingForCatchUpData_call(req, resultHandler449, 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 resultHandler426, TAsyncClient client422, TProtocolFactory protocolFactory423, TNonblockingTransport transport424) throws TException { - super(client422, protocolFactory423, transport424, resultHandler426, false); + public waitingForCatchUpData_call(CatchUpDataReq req, AsyncMethodCallback resultHandler450, TAsyncClient client446, TProtocolFactory protocolFactory447, TNonblockingTransport transport448) throws TException { + super(client446, protocolFactory447, transport448, resultHandler450, false); this.req = req; } @@ -1060,17 +1060,17 @@ public AdminExecResp getResult() throws TException { } } - public void createCheckpoint(CreateCPRequest req, AsyncMethodCallback resultHandler430) throws TException { + public void createCheckpoint(CreateCPRequest req, AsyncMethodCallback resultHandler454) throws TException { checkReady(); - createCheckpoint_call method_call = new createCheckpoint_call(req, resultHandler430, this, ___protocolFactory, ___transport); + createCheckpoint_call method_call = new createCheckpoint_call(req, resultHandler454, 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 resultHandler431, TAsyncClient client427, TProtocolFactory protocolFactory428, TNonblockingTransport transport429) throws TException { - super(client427, protocolFactory428, transport429, resultHandler431, false); + public createCheckpoint_call(CreateCPRequest req, AsyncMethodCallback resultHandler455, TAsyncClient client451, TProtocolFactory protocolFactory452, TNonblockingTransport transport453) throws TException { + super(client451, protocolFactory452, transport453, resultHandler455, false); this.req = req; } @@ -1092,17 +1092,17 @@ public CreateCPResp getResult() throws TException { } } - public void dropCheckpoint(DropCPRequest req, AsyncMethodCallback resultHandler435) throws TException { + public void dropCheckpoint(DropCPRequest req, AsyncMethodCallback resultHandler459) throws TException { checkReady(); - dropCheckpoint_call method_call = new dropCheckpoint_call(req, resultHandler435, this, ___protocolFactory, ___transport); + dropCheckpoint_call method_call = new dropCheckpoint_call(req, resultHandler459, 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 resultHandler436, TAsyncClient client432, TProtocolFactory protocolFactory433, TNonblockingTransport transport434) throws TException { - super(client432, protocolFactory433, transport434, resultHandler436, false); + public dropCheckpoint_call(DropCPRequest req, AsyncMethodCallback resultHandler460, TAsyncClient client456, TProtocolFactory protocolFactory457, TNonblockingTransport transport458) throws TException { + super(client456, protocolFactory457, transport458, resultHandler460, false); this.req = req; } @@ -1124,17 +1124,17 @@ public AdminExecResp getResult() throws TException { } } - public void blockingWrites(BlockingSignRequest req, AsyncMethodCallback resultHandler440) throws TException { + public void blockingWrites(BlockingSignRequest req, AsyncMethodCallback resultHandler464) throws TException { checkReady(); - blockingWrites_call method_call = new blockingWrites_call(req, resultHandler440, this, ___protocolFactory, ___transport); + blockingWrites_call method_call = new blockingWrites_call(req, resultHandler464, 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 resultHandler441, TAsyncClient client437, TProtocolFactory protocolFactory438, TNonblockingTransport transport439) throws TException { - super(client437, protocolFactory438, transport439, resultHandler441, false); + public blockingWrites_call(BlockingSignRequest req, AsyncMethodCallback resultHandler465, TAsyncClient client461, TProtocolFactory protocolFactory462, TNonblockingTransport transport463) throws TException { + super(client461, protocolFactory462, transport463, resultHandler465, false); this.req = req; } @@ -1156,17 +1156,17 @@ public AdminExecResp getResult() throws TException { } } - public void rebuildTagIndex(RebuildIndexRequest req, AsyncMethodCallback resultHandler445) throws TException { + public void rebuildTagIndex(RebuildIndexRequest req, AsyncMethodCallback resultHandler469) throws TException { checkReady(); - rebuildTagIndex_call method_call = new rebuildTagIndex_call(req, resultHandler445, this, ___protocolFactory, ___transport); + rebuildTagIndex_call method_call = new rebuildTagIndex_call(req, resultHandler469, 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 resultHandler446, TAsyncClient client442, TProtocolFactory protocolFactory443, TNonblockingTransport transport444) throws TException { - super(client442, protocolFactory443, transport444, resultHandler446, false); + public rebuildTagIndex_call(RebuildIndexRequest req, AsyncMethodCallback resultHandler470, TAsyncClient client466, TProtocolFactory protocolFactory467, TNonblockingTransport transport468) throws TException { + super(client466, protocolFactory467, transport468, resultHandler470, false); this.req = req; } @@ -1188,17 +1188,17 @@ public AdminExecResp getResult() throws TException { } } - public void rebuildEdgeIndex(RebuildIndexRequest req, AsyncMethodCallback resultHandler450) throws TException { + public void rebuildEdgeIndex(RebuildIndexRequest req, AsyncMethodCallback resultHandler474) throws TException { checkReady(); - rebuildEdgeIndex_call method_call = new rebuildEdgeIndex_call(req, resultHandler450, this, ___protocolFactory, ___transport); + rebuildEdgeIndex_call method_call = new rebuildEdgeIndex_call(req, resultHandler474, 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 resultHandler451, TAsyncClient client447, TProtocolFactory protocolFactory448, TNonblockingTransport transport449) throws TException { - super(client447, protocolFactory448, transport449, resultHandler451, false); + public rebuildEdgeIndex_call(RebuildIndexRequest req, AsyncMethodCallback resultHandler475, TAsyncClient client471, TProtocolFactory protocolFactory472, TNonblockingTransport transport473) throws TException { + super(client471, protocolFactory472, transport473, resultHandler475, false); this.req = req; } @@ -1220,17 +1220,17 @@ public AdminExecResp getResult() throws TException { } } - public void getLeaderParts(GetLeaderReq req, AsyncMethodCallback resultHandler455) throws TException { + public void getLeaderParts(GetLeaderReq req, AsyncMethodCallback resultHandler479) throws TException { checkReady(); - getLeaderParts_call method_call = new getLeaderParts_call(req, resultHandler455, this, ___protocolFactory, ___transport); + getLeaderParts_call method_call = new getLeaderParts_call(req, resultHandler479, 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 resultHandler456, TAsyncClient client452, TProtocolFactory protocolFactory453, TNonblockingTransport transport454) throws TException { - super(client452, protocolFactory453, transport454, resultHandler456, false); + public getLeaderParts_call(GetLeaderReq req, AsyncMethodCallback resultHandler480, TAsyncClient client476, TProtocolFactory protocolFactory477, TNonblockingTransport transport478) throws TException { + super(client476, protocolFactory477, transport478, resultHandler480, false); this.req = req; } @@ -1252,17 +1252,17 @@ public GetLeaderPartsResp getResult() throws TException { } } - public void checkPeers(CheckPeersReq req, AsyncMethodCallback resultHandler460) throws TException { + public void checkPeers(CheckPeersReq req, AsyncMethodCallback resultHandler484) throws TException { checkReady(); - checkPeers_call method_call = new checkPeers_call(req, resultHandler460, this, ___protocolFactory, ___transport); + checkPeers_call method_call = new checkPeers_call(req, resultHandler484, 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 resultHandler461, TAsyncClient client457, TProtocolFactory protocolFactory458, TNonblockingTransport transport459) throws TException { - super(client457, protocolFactory458, transport459, resultHandler461, false); + public checkPeers_call(CheckPeersReq req, AsyncMethodCallback resultHandler485, TAsyncClient client481, TProtocolFactory protocolFactory482, TNonblockingTransport transport483) throws TException { + super(client481, protocolFactory482, transport483, resultHandler485, false); this.req = req; } @@ -1284,17 +1284,17 @@ public AdminExecResp getResult() throws TException { } } - public void addAdminTask(AddAdminTaskRequest req, AsyncMethodCallback resultHandler465) throws TException { + public void addAdminTask(AddAdminTaskRequest req, AsyncMethodCallback resultHandler489) throws TException { checkReady(); - addAdminTask_call method_call = new addAdminTask_call(req, resultHandler465, this, ___protocolFactory, ___transport); + addAdminTask_call method_call = new addAdminTask_call(req, resultHandler489, 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 resultHandler466, TAsyncClient client462, TProtocolFactory protocolFactory463, TNonblockingTransport transport464) throws TException { - super(client462, protocolFactory463, transport464, resultHandler466, false); + public addAdminTask_call(AddAdminTaskRequest req, AsyncMethodCallback resultHandler490, TAsyncClient client486, TProtocolFactory protocolFactory487, TNonblockingTransport transport488) throws TException { + super(client486, protocolFactory487, transport488, resultHandler490, false); this.req = req; } @@ -1316,17 +1316,17 @@ public AdminExecResp getResult() throws TException { } } - public void stopAdminTask(StopAdminTaskRequest req, AsyncMethodCallback resultHandler470) throws TException { + public void stopAdminTask(StopAdminTaskRequest req, AsyncMethodCallback resultHandler494) throws TException { checkReady(); - stopAdminTask_call method_call = new stopAdminTask_call(req, resultHandler470, this, ___protocolFactory, ___transport); + stopAdminTask_call method_call = new stopAdminTask_call(req, resultHandler494, 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 resultHandler471, TAsyncClient client467, TProtocolFactory protocolFactory468, TNonblockingTransport transport469) throws TException { - super(client467, protocolFactory468, transport469, resultHandler471, false); + public stopAdminTask_call(StopAdminTaskRequest req, AsyncMethodCallback resultHandler495, TAsyncClient client491, TProtocolFactory protocolFactory492, TNonblockingTransport transport493) throws TException { + super(client491, protocolFactory492, transport493, resultHandler495, false); this.req = req; } @@ -1348,17 +1348,17 @@ public AdminExecResp getResult() throws TException { } } - public void listClusterInfo(ListClusterInfoReq req, AsyncMethodCallback resultHandler475) throws TException { + public void listClusterInfo(ListClusterInfoReq req, AsyncMethodCallback resultHandler499) throws TException { checkReady(); - listClusterInfo_call method_call = new listClusterInfo_call(req, resultHandler475, this, ___protocolFactory, ___transport); + listClusterInfo_call method_call = new listClusterInfo_call(req, resultHandler499, 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 resultHandler476, TAsyncClient client472, TProtocolFactory protocolFactory473, TNonblockingTransport transport474) throws TException { - super(client472, protocolFactory473, transport474, resultHandler476, false); + public listClusterInfo_call(ListClusterInfoReq req, AsyncMethodCallback resultHandler500, TAsyncClient client496, TProtocolFactory protocolFactory497, TNonblockingTransport transport498) throws TException { + super(client496, protocolFactory497, transport498, resultHandler500, false); this.req = req; } diff --git a/client/src/main/generated/com/vesoft/nebula/storage/TaskPara.java b/client/src/main/generated/com/vesoft/nebula/storage/TaskPara.java index e7366d6bd..7ba6a574d 100644 --- a/client/src/main/generated/com/vesoft/nebula/storage/TaskPara.java +++ b/client/src/main/generated/com/vesoft/nebula/storage/TaskPara.java @@ -345,15 +345,15 @@ public void read(TProtocol iprot) throws TException { case PARTS: if (__field.type == TType.LIST) { { - TList _list189 = iprot.readListBegin(); - this.parts = new ArrayList(Math.max(0, _list189.size)); - for (int _i190 = 0; - (_list189.size < 0) ? iprot.peekList() : (_i190 < _list189.size); - ++_i190) + TList _list213 = iprot.readListBegin(); + this.parts = new ArrayList(Math.max(0, _list213.size)); + for (int _i214 = 0; + (_list213.size < 0) ? iprot.peekList() : (_i214 < _list213.size); + ++_i214) { - int _elem191; - _elem191 = iprot.readI32(); - this.parts.add(_elem191); + int _elem215; + _elem215 = iprot.readI32(); + this.parts.add(_elem215); } iprot.readListEnd(); } @@ -364,15 +364,15 @@ public void read(TProtocol iprot) throws TException { case TASK_SPECFIC_PARAS: if (__field.type == TType.LIST) { { - TList _list192 = iprot.readListBegin(); - this.task_specfic_paras = new ArrayList(Math.max(0, _list192.size)); - for (int _i193 = 0; - (_list192.size < 0) ? iprot.peekList() : (_i193 < _list192.size); - ++_i193) + TList _list216 = iprot.readListBegin(); + this.task_specfic_paras = new ArrayList(Math.max(0, _list216.size)); + for (int _i217 = 0; + (_list216.size < 0) ? iprot.peekList() : (_i217 < _list216.size); + ++_i217) { - byte[] _elem194; - _elem194 = iprot.readBinary(); - this.task_specfic_paras.add(_elem194); + byte[] _elem218; + _elem218 = iprot.readBinary(); + this.task_specfic_paras.add(_elem218); } iprot.readListEnd(); } @@ -405,8 +405,8 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(PARTS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.I32, this.parts.size())); - for (int _iter195 : this.parts) { - oprot.writeI32(_iter195); + for (int _iter219 : this.parts) { + oprot.writeI32(_iter219); } oprot.writeListEnd(); } @@ -418,8 +418,8 @@ public void write(TProtocol oprot) throws TException { oprot.writeFieldBegin(TASK_SPECFIC_PARAS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.task_specfic_paras.size())); - for (byte[] _iter196 : this.task_specfic_paras) { - oprot.writeBinary(_iter196); + for (byte[] _iter220 : this.task_specfic_paras) { + oprot.writeBinary(_iter220); } oprot.writeListEnd(); } From dc5f1cd971ecec9c1189d9da8c7982ff0b2c23e2 Mon Sep 17 00:00:00 2001 From: Nicole00 Date: Thu, 18 Nov 2021 10:13:24 +0800 Subject: [PATCH 2/4] update storage scan implementation according to lastest server --- .../nebula/client/storage/StorageClient.java | 4 ++-- .../nebula/client/storage/scan/PartScanInfo.java | 9 +++++---- .../storage/scan/ScanEdgeResultIterator.java | 14 +++++++++----- .../storage/scan/ScanVertexResultIterator.java | 14 +++++++++----- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/client/src/main/java/com/vesoft/nebula/client/storage/StorageClient.java b/client/src/main/java/com/vesoft/nebula/client/storage/StorageClient.java index f66bb05e7..d4444f6f1 100644 --- a/client/src/main/java/com/vesoft/nebula/client/storage/StorageClient.java +++ b/client/src/main/java/com/vesoft/nebula/client/storage/StorageClient.java @@ -574,11 +574,11 @@ private ScanVertexResultIterator scanVertex(String spaceName, } } VertexProp vertexCols = new VertexProp((int) tag, props); - + List vertexProps = Arrays.asList(vertexCols); ScanVertexRequest request = new ScanVertexRequest(); request .setSpace_id(getSpaceId(spaceName)) - .setReturn_columns(vertexCols) + .setReturn_columns(vertexProps) .setLimit(limit) .setStart_time(startTime) .setEnd_time(endTime) diff --git a/client/src/main/java/com/vesoft/nebula/client/storage/scan/PartScanInfo.java b/client/src/main/java/com/vesoft/nebula/client/storage/scan/PartScanInfo.java index e72f3b40d..4d6f5f7d8 100644 --- a/client/src/main/java/com/vesoft/nebula/client/storage/scan/PartScanInfo.java +++ b/client/src/main/java/com/vesoft/nebula/client/storage/scan/PartScanInfo.java @@ -6,6 +6,7 @@ package com.vesoft.nebula.client.storage.scan; import com.vesoft.nebula.client.graph.data.HostAddress; +import com.vesoft.nebula.storage.ScanCursor; import java.io.Serializable; public class PartScanInfo implements Serializable { @@ -14,7 +15,7 @@ public class PartScanInfo implements Serializable { private int part; private HostAddress leader; - private byte[] cursor = null; + private ScanCursor cursor = null; public PartScanInfo(int part, HostAddress leader) { this.part = part; @@ -37,11 +38,11 @@ public void setLeader(HostAddress leader) { this.leader = leader; } - public byte[] getCursor() { + public ScanCursor getCursor() { return cursor; } - public void setCursor(byte[] cursor) { + public void setCursor(ScanCursor cursor) { this.cursor = cursor; } @@ -50,7 +51,7 @@ public String toString() { return "PartScanInfo{" + "part=" + part + ", leader=" + leader - + ", cursor=" + new String(cursor) + + ", cursor=" + new String(cursor.next_cursor) + '}'; } } diff --git a/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanEdgeResultIterator.java b/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanEdgeResultIterator.java index 2fd926391..7c6d5c935 100644 --- a/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanEdgeResultIterator.java +++ b/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanEdgeResultIterator.java @@ -14,11 +14,14 @@ import com.vesoft.nebula.client.storage.StorageConnPool; import com.vesoft.nebula.client.storage.data.ScanStatus; import com.vesoft.nebula.storage.PartitionResult; +import com.vesoft.nebula.storage.ScanCursor; import com.vesoft.nebula.storage.ScanEdgeRequest; import com.vesoft.nebula.storage.ScanEdgeResponse; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; @@ -70,7 +73,6 @@ public ScanEdgeResult next() throws Exception { threadPool = Executors.newFixedThreadPool(addresses.size()); for (HostAddress addr : addresses) { threadPool.submit(() -> { - ScanEdgeRequest partRequest = new ScanEdgeRequest(request); ScanEdgeResponse response; PartScanInfo partInfo = partScanQueue.getPart(addr); // no part need to scan @@ -91,8 +93,10 @@ public ScanEdgeResult next() throws Exception { return; } - partRequest.setPart_id(partInfo.getPart()); - partRequest.setCursor(partInfo.getCursor()); + Map cursorMap = new HashMap<>(); + cursorMap.put(partInfo.getPart(), partInfo.getCursor()); + ScanEdgeRequest partRequest = new ScanEdgeRequest(request); + partRequest.setParts(cursorMap); try { response = connection.scanEdge(partRequest); } catch (TException e) { @@ -162,10 +166,10 @@ private boolean isSuccessful(ScanEdgeResponse response) { private void handleSucceedResult(AtomicInteger existSuccess, ScanEdgeResponse response, PartScanInfo partInfo) { existSuccess.addAndGet(1); - if (!response.has_next) { + if (!response.getCursors().get(partInfo.getPart()).has_next) { partScanQueue.dropPart(partInfo); } else { - partInfo.setCursor(response.getNext_cursor()); + partInfo.setCursor(response.getCursors().get(partInfo.getPart())); } } diff --git a/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanVertexResultIterator.java b/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanVertexResultIterator.java index 7271a526f..1444b1785 100644 --- a/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanVertexResultIterator.java +++ b/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanVertexResultIterator.java @@ -14,11 +14,14 @@ import com.vesoft.nebula.client.storage.StorageConnPool; import com.vesoft.nebula.client.storage.data.ScanStatus; import com.vesoft.nebula.storage.PartitionResult; +import com.vesoft.nebula.storage.ScanCursor; import com.vesoft.nebula.storage.ScanVertexRequest; import com.vesoft.nebula.storage.ScanVertexResponse; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; @@ -73,7 +76,6 @@ public ScanVertexResult next() throws Exception { for (HostAddress addr : addresses) { threadPool.submit(() -> { - ScanVertexRequest partRequest = new ScanVertexRequest(request); ScanVertexResponse response; PartScanInfo partInfo = partScanQueue.getPart(addr); // no part need to scan @@ -93,8 +95,10 @@ public ScanVertexResult next() throws Exception { return; } - partRequest.setPart_id(partInfo.getPart()); - partRequest.setCursor(partInfo.getCursor()); + Map cursorMap = new HashMap<>(); + cursorMap.put(partInfo.getPart(), partInfo.getCursor()); + ScanVertexRequest partRequest = new ScanVertexRequest(request); + partRequest.setParts(cursorMap); try { response = connection.scanVertex(partRequest); } catch (TException e) { @@ -163,10 +167,10 @@ private boolean isSuccessful(ScanVertexResponse response) { private void handleSucceedResult(AtomicInteger existSuccess, ScanVertexResponse response, PartScanInfo partInfo) { existSuccess.addAndGet(1); - if (!response.has_next) { + if (!response.getCursors().get(partInfo.getPart()).has_next) { partScanQueue.dropPart(partInfo); } else { - partInfo.setCursor(response.getNext_cursor()); + partInfo.setCursor(response.getCursors().get(partInfo.getPart())); } } From 04a0cb18d6a96322a8020b1659f47e9e0ac18279 Mon Sep 17 00:00:00 2001 From: Nicole00 Date: Thu, 18 Nov 2021 10:13:51 +0800 Subject: [PATCH 3/4] update and add test --- .../client/storage/StorageClientTest.java | 63 +++++++------------ .../storage/scan/PartScanQueueTest.java | 5 +- 2 files changed, 25 insertions(+), 43 deletions(-) diff --git a/client/src/test/java/com/vesoft/nebula/client/storage/StorageClientTest.java b/client/src/test/java/com/vesoft/nebula/client/storage/StorageClientTest.java index ea303400e..a527daa82 100644 --- a/client/src/test/java/com/vesoft/nebula/client/storage/StorageClientTest.java +++ b/client/src/test/java/com/vesoft/nebula/client/storage/StorageClientTest.java @@ -64,6 +64,7 @@ public void testScanVertexWithNoCol() { ScanVertexResultIterator resultIterator = client.scanVertex( "testStorage", "person"); + int count = 0; while (resultIterator.hasNext()) { ScanVertexResult result = null; try { @@ -75,6 +76,7 @@ public void testScanVertexWithNoCol() { if (result.isEmpty()) { continue; } + count += result.getVertices().size(); Assert.assertEquals(1, result.getPropNames().size()); assert (result.getPropNames().get(0).equals("_vid")); assert (result.isAllSuccess()); @@ -104,6 +106,7 @@ public void testScanVertexWithNoCol() { } } } + assert (count == 5); } @Test @@ -118,6 +121,7 @@ public void testScanVertexWithCols() { "testStorage", "person", Arrays.asList("name", "age")); + int count = 0; while (resultIterator.hasNext()) { ScanVertexResult result = null; try { @@ -129,13 +133,13 @@ public void testScanVertexWithCols() { if (result.isEmpty()) { continue; } + count += result.getVertices().size(); Assert.assertEquals(3, result.getPropNames().size()); assert (result.getPropNames().get(0).equals("_vid")); assert (result.getPropNames().get(1).equals("name")); assert (result.getPropNames().get(2).equals("age")); assert (result.isAllSuccess()); - List rows = result.getVertices(); for (VertexRow row : rows) { try { @@ -168,6 +172,7 @@ public void testScanVertexWithCols() { assert (Arrays.asList(18L, 20L, 23L, 15L, 25L).contains(tableRow.getLong(2))); } } + assert (count == 5); } @Test @@ -182,6 +187,7 @@ public void testScanVertexWithAllCol() { "testStorage", "person", Arrays.asList()); + int count = 0; while (resultIterator.hasNext()) { ScanVertexResult result = null; try { @@ -193,12 +199,14 @@ public void testScanVertexWithAllCol() { if (result.isEmpty()) { continue; } + count += result.getVertices().size(); Assert.assertEquals(3, result.getPropNames().size()); assert (result.getPropNames().get(0).equals("_vid")); assert (Arrays.asList("name", "age").contains(result.getPropNames().get(1))); assert (Arrays.asList("name", "age").contains(result.getPropNames().get(2))); assert (result.isAllSuccess()); } + assert (count == 5); } @Test @@ -212,6 +220,7 @@ public void testScanEdgeWithoutCol() { ScanEdgeResultIterator resultIterator = client.scanEdge( "testStorage", "friend"); + int count = 0; while (resultIterator.hasNext()) { ScanEdgeResult result = null; try { @@ -223,6 +232,7 @@ public void testScanEdgeWithoutCol() { if (result.isEmpty()) { continue; } + count += result.getEdges().size(); Assert.assertEquals(3, result.getPropNames().size()); assert (result.getPropNames().get(0).equals("_src")); assert (result.getPropNames().get(1).equals("_dst")); @@ -260,6 +270,7 @@ public void testScanEdgeWithoutCol() { } } } + assert (count == 5); } @Test @@ -274,6 +285,7 @@ public void testScanEdgeWithCols() { "testStorage", "friend", Arrays.asList("likeness")); + int count = 0; while (resultIterator.hasNext()) { ScanEdgeResult result = null; try { @@ -285,6 +297,7 @@ public void testScanEdgeWithCols() { if (result.isEmpty()) { continue; } + count += result.getEdges().size(); Assert.assertEquals(4, result.getPropNames().size()); assert (result.getPropNames().get(0).equals("_src")); assert (result.getPropNames().get(1).equals("_dst")); @@ -328,6 +341,7 @@ public void testScanEdgeWithCols() { assert (Arrays.asList(1.0, 2.1, 3.2, 4.5, 5.9).contains(tableRow.getDouble(3))); } } + assert (count == 5); } @Test @@ -342,6 +356,7 @@ public void testScanEdgeWithAllCols() { "testStorage", "friend", Arrays.asList()); + int count = 0; while (resultIterator.hasNext()) { ScanEdgeResult result = null; try { @@ -353,6 +368,7 @@ public void testScanEdgeWithAllCols() { if (result.isEmpty()) { continue; } + count += result.getEdges().size(); Assert.assertEquals(4, result.getPropNames().size()); assert (Arrays.asList("_src", "_dst", "_rank", "likeness") .contains(result.getPropNames().get(0))); @@ -364,6 +380,7 @@ public void testScanEdgeWithAllCols() { .contains(result.getPropNames().get(3))); assert (result.isAllSuccess()); } + assert (count == 5); } @Test @@ -387,46 +404,7 @@ public void testCASignedSSL() { ScanVertexResultIterator resultIterator = sslClient.scanVertex( "testStorageCA", "person"); - while (resultIterator.hasNext()) { - ScanVertexResult result = null; - try { - result = resultIterator.next(); - } catch (Exception e) { - e.printStackTrace(); - assert (false); - } - if (result.isEmpty()) { - continue; - } - Assert.assertEquals(1, result.getPropNames().size()); - assert (result.getPropNames().get(0).equals("_vid")); - assert (result.isAllSuccess()); - - List rows = result.getVertices(); - for (VertexRow row : rows) { - try { - assert (Arrays.asList("1", "2", "3", "4", "5") - .contains(row.getVid().asString())); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - assert (false); - } - assert (row.getProps().size() == 0); - } - - List tableRows = result.getVertexTableRows(); - for (VertexTableRow tableRow : tableRows) { - try { - assert (Arrays.asList("1", "2", "3", "4", "5") - .contains(tableRow.getVid().asString())); - assert (Arrays.asList("1", "2", "3", "4", "5") - .contains(tableRow.getString(0))); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - assert (false); - } - } - } + assertIterator(resultIterator); } catch (Exception e) { e.printStackTrace(); assert (false); @@ -481,6 +459,7 @@ public void testSelfSignedSSL() { } private void assertIterator(ScanVertexResultIterator resultIterator) { + int count = 0; while (resultIterator.hasNext()) { ScanVertexResult result = null; try { @@ -492,6 +471,7 @@ private void assertIterator(ScanVertexResultIterator resultIterator) { if (result.isEmpty()) { continue; } + count += result.getVertices().size(); Assert.assertEquals(1, result.getPropNames().size()); assert (result.getPropNames().get(0).equals("_vid")); assert (result.isAllSuccess()); @@ -521,5 +501,6 @@ private void assertIterator(ScanVertexResultIterator resultIterator) { } } } + assert (count == 5); } } diff --git a/client/src/test/java/com/vesoft/nebula/client/storage/scan/PartScanQueueTest.java b/client/src/test/java/com/vesoft/nebula/client/storage/scan/PartScanQueueTest.java index 646f4018d..c96faa6d2 100644 --- a/client/src/test/java/com/vesoft/nebula/client/storage/scan/PartScanQueueTest.java +++ b/client/src/test/java/com/vesoft/nebula/client/storage/scan/PartScanQueueTest.java @@ -6,6 +6,7 @@ package com.vesoft.nebula.client.storage.scan; import com.vesoft.nebula.client.graph.data.HostAddress; +import com.vesoft.nebula.storage.ScanCursor; import java.util.HashSet; import java.util.Set; import org.junit.Before; @@ -35,7 +36,7 @@ public void testGetPart() { // test cursor HostAddress addr = new HostAddress("127.0.0.1", 3); assert (queue.getPart(addr).getLeader().getPort() == 3); - assert (new String(queue.getPart(addr).getCursor()).equals("cursor")); + assert (new String(queue.getPart(addr).getCursor().next_cursor).equals("cursor")); } @Test @@ -60,7 +61,7 @@ private Set mockPartScanInfo() { partScanInfoSet.add(new PartScanInfo(4, new HostAddress("127.0.0.1", 2))); PartScanInfo partScanInfo = new PartScanInfo(5, new HostAddress("127.0.0.1", 3)); - partScanInfo.setCursor("cursor".getBytes()); + partScanInfo.setCursor(new ScanCursor(true, "cursor".getBytes())); partScanInfoSet.add(partScanInfo); return partScanInfoSet; } From 7a31224cd6e11f256eecde6738a14abda665ecec Mon Sep 17 00:00:00 2001 From: Nicole00 Date: Thu, 18 Nov 2021 10:39:58 +0800 Subject: [PATCH 4/4] fix conflict --- .../main/java/com/vesoft/nebula/encoder/RowWriterImpl.java | 2 +- .../java/com/vesoft/nebula/encoder/SchemaProviderImpl.java | 2 +- .../java/com/vesoft/nebula/encoder/MetaCacheImplTest.java | 3 +-- .../src/test/java/com/vesoft/nebula/encoder/TestEncoder.java | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/client/src/main/java/com/vesoft/nebula/encoder/RowWriterImpl.java b/client/src/main/java/com/vesoft/nebula/encoder/RowWriterImpl.java index 65d8e1c6a..c995c1766 100644 --- a/client/src/main/java/com/vesoft/nebula/encoder/RowWriterImpl.java +++ b/client/src/main/java/com/vesoft/nebula/encoder/RowWriterImpl.java @@ -12,9 +12,9 @@ import com.vesoft.nebula.LineString; import com.vesoft.nebula.Point; import com.vesoft.nebula.Polygon; +import com.vesoft.nebula.PropertyType; import com.vesoft.nebula.Time; import com.vesoft.nebula.Value; -import com.vesoft.nebula.meta.PropertyType; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.ArrayList; diff --git a/client/src/main/java/com/vesoft/nebula/encoder/SchemaProviderImpl.java b/client/src/main/java/com/vesoft/nebula/encoder/SchemaProviderImpl.java index 114b868f5..d3b256d43 100644 --- a/client/src/main/java/com/vesoft/nebula/encoder/SchemaProviderImpl.java +++ b/client/src/main/java/com/vesoft/nebula/encoder/SchemaProviderImpl.java @@ -5,7 +5,7 @@ package com.vesoft.nebula.encoder; -import com.vesoft.nebula.meta.PropertyType; +import com.vesoft.nebula.PropertyType; import java.util.ArrayList; import java.util.HashMap; import java.util.List; 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 aec661f4f..f5be0c716 100644 --- a/client/src/test/java/com/vesoft/nebula/encoder/MetaCacheImplTest.java +++ b/client/src/test/java/com/vesoft/nebula/encoder/MetaCacheImplTest.java @@ -6,13 +6,12 @@ package com.vesoft.nebula.encoder; import com.vesoft.nebula.HostAddr; -import com.vesoft.nebula.client.graph.data.HostAddress; +import com.vesoft.nebula.PropertyType; import com.vesoft.nebula.client.meta.MetaCache; import com.vesoft.nebula.meta.ColumnDef; import com.vesoft.nebula.meta.ColumnTypeDef; import com.vesoft.nebula.meta.EdgeItem; import com.vesoft.nebula.meta.GeoShape; -import com.vesoft.nebula.meta.PropertyType; import com.vesoft.nebula.meta.Schema; import com.vesoft.nebula.meta.SpaceDesc; import com.vesoft.nebula.meta.SpaceItem; diff --git a/client/src/test/java/com/vesoft/nebula/encoder/TestEncoder.java b/client/src/test/java/com/vesoft/nebula/encoder/TestEncoder.java index 0ed452b78..7a0012781 100644 --- a/client/src/test/java/com/vesoft/nebula/encoder/TestEncoder.java +++ b/client/src/test/java/com/vesoft/nebula/encoder/TestEncoder.java @@ -3,7 +3,7 @@ * This source code is licensed under Apache 2.0 License. */ -package test.java.com.vesoft.nebula.encoder; +package com.vesoft.nebula.encoder; import com.vesoft.nebula.Coordinate; import com.vesoft.nebula.Date; @@ -14,12 +14,12 @@ import com.vesoft.nebula.NullType; import com.vesoft.nebula.Point; import com.vesoft.nebula.Polygon; +import com.vesoft.nebula.PropertyType; import com.vesoft.nebula.Time; import com.vesoft.nebula.Value; import com.vesoft.nebula.encoder.MetaCacheImplTest; import com.vesoft.nebula.encoder.NebulaCodecImpl; import com.vesoft.nebula.meta.EdgeItem; -import com.vesoft.nebula.meta.PropertyType; import com.vesoft.nebula.meta.SpaceItem; import com.vesoft.nebula.meta.TagItem; import java.util.ArrayList;