diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/NebulaPoolConfig.java b/client/src/main/java/com/vesoft/nebula/client/graph/NebulaPoolConfig.java index 5c064a833..d3e308902 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/NebulaPoolConfig.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/NebulaPoolConfig.java @@ -6,8 +6,12 @@ package com.vesoft.nebula.client.graph; import com.vesoft.nebula.client.graph.data.SSLParam; +import java.io.Serializable; + +public class NebulaPoolConfig implements Serializable { + + private static final long serialVersionUID = 3977910115039279651L; -public class NebulaPoolConfig { // The min connections in pool for all addresses private int minConnsSize = 0; diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/SessionsManagerConfig.java b/client/src/main/java/com/vesoft/nebula/client/graph/SessionsManagerConfig.java index 6285cb3f4..0b6c25f5f 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/SessionsManagerConfig.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/SessionsManagerConfig.java @@ -7,10 +7,14 @@ import com.vesoft.nebula.client.graph.data.HostAddress; import com.vesoft.nebula.client.graph.net.NebulaPool; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; -public class SessionsManagerConfig { +public class SessionsManagerConfig implements Serializable { + + private static final long serialVersionUID = -2460063747630193912L; + // graphd addresses private List addresses = new ArrayList<>(); diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/data/BaseDataObject.java b/client/src/main/java/com/vesoft/nebula/client/graph/data/BaseDataObject.java index 1b3e83197..2078bafe3 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/data/BaseDataObject.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/data/BaseDataObject.java @@ -5,7 +5,9 @@ package com.vesoft.nebula.client.graph.data; -public abstract class BaseDataObject { +import java.io.Serializable; + +public abstract class BaseDataObject implements Serializable { private String decodeType = "utf-8"; private int timezoneOffset = 0; diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/data/HostAddress.java b/client/src/main/java/com/vesoft/nebula/client/graph/data/HostAddress.java index 0fa8918d2..6071e47a1 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/data/HostAddress.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/data/HostAddress.java @@ -5,7 +5,9 @@ package com.vesoft.nebula.client.graph.data; -public class HostAddress { +import java.io.Serializable; + +public class HostAddress implements Serializable { private final String host; private final int port; diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/data/SSLParam.java b/client/src/main/java/com/vesoft/nebula/client/graph/data/SSLParam.java index c31608d8d..4cf293105 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/data/SSLParam.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/data/SSLParam.java @@ -5,7 +5,12 @@ package com.vesoft.nebula.client.graph.data; -public abstract class SSLParam { +import java.io.Serializable; + +public abstract class SSLParam implements Serializable { + + private static final long serialVersionUID = 7410233298826490747L; + public enum SignMode { NONE, SELF_SIGNED, diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/AuthResult.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/AuthResult.java index 8237153f1..1a0307485 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/AuthResult.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/AuthResult.java @@ -5,7 +5,12 @@ package com.vesoft.nebula.client.graph.net; -public class AuthResult { +import java.io.Serializable; + +public class AuthResult implements Serializable { + + private static final long serialVersionUID = 8795815613377375650L; + private final long sessionId; private final int timezoneOffset; diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/ConnObjectPool.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/ConnObjectPool.java index b9f088b89..bb5eb383e 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/ConnObjectPool.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/ConnObjectPool.java @@ -4,11 +4,16 @@ import com.vesoft.nebula.client.graph.data.HostAddress; import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; +import java.io.Serializable; import org.apache.commons.pool2.BasePooledObjectFactory; import org.apache.commons.pool2.PooledObject; import org.apache.commons.pool2.impl.DefaultPooledObject; -public class ConnObjectPool extends BasePooledObjectFactory { +public class ConnObjectPool extends BasePooledObjectFactory + implements Serializable { + + private static final long serialVersionUID = 6101157301791971560L; + private final NebulaPoolConfig config; private final LoadBalancer loadBalancer; private static final int retryTime = 3; @@ -32,7 +37,7 @@ public SyncConnection create() throws IOErrorException, ClientServerIncompatible if (config.isEnableSsl()) { if (config.getSslParam() == null) { throw new IllegalArgumentException("SSL Param is required when enableSsl " - + "is set to true"); + + "is set to true"); } conn.open(address, config.getTimeout(), config.getSslParam()); } else { diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/Connection.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/Connection.java index 76944bb58..7648360cc 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/Connection.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/Connection.java @@ -4,8 +4,12 @@ import com.vesoft.nebula.client.graph.data.SSLParam; import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; +import java.io.Serializable; + +public abstract class Connection implements Serializable { + + private static final long serialVersionUID = -8425216612015802331L; -public abstract class Connection { protected HostAddress serverAddr = null; public HostAddress getServerAddress() { diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java index ec4d419f1..f2734cba1 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/NebulaPool.java @@ -12,6 +12,7 @@ import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.client.graph.exception.InvalidConfigException; import com.vesoft.nebula.client.graph.exception.NotValidConnectionException; +import java.io.Serializable; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.ArrayList; @@ -24,7 +25,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class NebulaPool { +public class NebulaPool implements Serializable { + + private static final long serialVersionUID = 6226487268001127885L; + private GenericObjectPool objectPool = null; private LoadBalancer loadBalancer; private final Logger log = LoggerFactory.getLogger(this.getClass()); diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/Session.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/Session.java index 212152dbc..2fe85ce47 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/Session.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/Session.java @@ -18,6 +18,7 @@ import com.vesoft.nebula.client.graph.data.ResultSet; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.graph.ExecutionResponse; +import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -38,7 +39,10 @@ * The user can directly read the data using the interface of ValueWrapper. */ -public class Session { +public class Session implements Serializable { + + private static final long serialVersionUID = -8855886967097862376L; + private final long sessionID; private final int timezoneOffset; private SyncConnection connection; diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionWrapper.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionWrapper.java index faa2cf2dd..bde95e257 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionWrapper.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionWrapper.java @@ -8,9 +8,13 @@ import com.vesoft.nebula.client.graph.data.ResultSet; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.client.graph.exception.InvalidSessionException; +import java.io.Serializable; import java.util.concurrent.atomic.AtomicBoolean; -public class SessionWrapper { +public class SessionWrapper implements Serializable { + + private static final long serialVersionUID = -8128331485649098264L; + private final Session session; private final AtomicBoolean available = new AtomicBoolean(true); diff --git a/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionsManager.java b/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionsManager.java index 6fe4da3dc..c1b8192c7 100644 --- a/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionsManager.java +++ b/client/src/main/java/com/vesoft/nebula/client/graph/net/SessionsManager.java @@ -11,11 +11,15 @@ import com.vesoft.nebula.client.graph.exception.ClientServerIncompatibleException; import com.vesoft.nebula.client.graph.exception.IOErrorException; import com.vesoft.nebula.client.graph.exception.NotValidConnectionException; +import java.io.Serializable; import java.net.UnknownHostException; import java.util.BitSet; import java.util.concurrent.CopyOnWriteArrayList; -public class SessionsManager { +public class SessionsManager implements Serializable { + + private static final long serialVersionUID = 7519424097351713021L; + private final SessionsManagerConfig config; private NebulaPool pool = null; private final CopyOnWriteArrayList sessionList; diff --git a/client/src/main/java/com/vesoft/nebula/client/storage/GraphStorageConnection.java b/client/src/main/java/com/vesoft/nebula/client/storage/GraphStorageConnection.java index a3bfc260a..4d0f75843 100644 --- a/client/src/main/java/com/vesoft/nebula/client/storage/GraphStorageConnection.java +++ b/client/src/main/java/com/vesoft/nebula/client/storage/GraphStorageConnection.java @@ -22,10 +22,14 @@ import com.vesoft.nebula.storage.ScanVertexRequest; import com.vesoft.nebula.util.SslUtil; import java.io.IOException; +import java.io.Serializable; import java.net.InetAddress; import javax.net.ssl.SSLSocketFactory; -public class GraphStorageConnection { +public class GraphStorageConnection implements Serializable { + + private static final long serialVersionUID = -3631352515689239788L; + protected TTransport transport = null; protected TProtocol protocol = null; public HostAddress address; diff --git a/client/src/main/java/com/vesoft/nebula/client/storage/StorageConnPool.java b/client/src/main/java/com/vesoft/nebula/client/storage/StorageConnPool.java index c9ae1ed2b..dda8aca25 100644 --- a/client/src/main/java/com/vesoft/nebula/client/storage/StorageConnPool.java +++ b/client/src/main/java/com/vesoft/nebula/client/storage/StorageConnPool.java @@ -6,14 +6,16 @@ package com.vesoft.nebula.client.storage; import com.vesoft.nebula.client.graph.data.HostAddress; +import java.io.Serializable; import org.apache.commons.pool2.impl.GenericKeyedObjectPool; import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class StorageConnPool { +public class StorageConnPool implements Serializable { private static final Logger LOGGER = LoggerFactory.getLogger(StorageConnPool.class); + private static final long serialVersionUID = -6459633350295900558L; private final GenericKeyedObjectPool keyedPool; private final StorageConnPoolFactory poolFactory; diff --git a/client/src/main/java/com/vesoft/nebula/client/storage/StoragePoolConfig.java b/client/src/main/java/com/vesoft/nebula/client/storage/StoragePoolConfig.java index a458ce0bc..cc4e17fcd 100644 --- a/client/src/main/java/com/vesoft/nebula/client/storage/StoragePoolConfig.java +++ b/client/src/main/java/com/vesoft/nebula/client/storage/StoragePoolConfig.java @@ -6,8 +6,12 @@ package com.vesoft.nebula.client.storage; import com.vesoft.nebula.client.graph.data.SSLParam; +import java.io.Serializable; + +public class StoragePoolConfig implements Serializable { + + private static final long serialVersionUID = 8022858741090966149L; -public class StoragePoolConfig { // The min connections in pool for all addresses private int minConnsSize = 0; diff --git a/client/src/main/java/com/vesoft/nebula/client/storage/scan/PartScanQueue.java b/client/src/main/java/com/vesoft/nebula/client/storage/scan/PartScanQueue.java index 676664c86..805b86d84 100644 --- a/client/src/main/java/com/vesoft/nebula/client/storage/scan/PartScanQueue.java +++ b/client/src/main/java/com/vesoft/nebula/client/storage/scan/PartScanQueue.java @@ -6,9 +6,12 @@ package com.vesoft.nebula.client.storage.scan; import com.vesoft.nebula.client.graph.data.HostAddress; +import java.io.Serializable; import java.util.Set; -public class PartScanQueue { +public class PartScanQueue implements Serializable { + + private static final long serialVersionUID = 4817985176727025002L; private final Set partScanInfoSet; diff --git a/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanEdgeResult.java b/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanEdgeResult.java index eec686bf7..3c6ca5ac3 100644 --- a/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanEdgeResult.java +++ b/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanEdgeResult.java @@ -10,13 +10,15 @@ import com.vesoft.nebula.client.storage.data.EdgeTableRow; import com.vesoft.nebula.client.storage.data.ScanStatus; import com.vesoft.nebula.client.storage.processor.EdgeProcessor; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class ScanEdgeResult { +public class ScanEdgeResult implements Serializable { private static final Logger LOGGER = LoggerFactory.getLogger(ScanEdgeResult.class); + private static final long serialVersionUID = 519190254786197550L; private final List dataSets; diff --git a/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanVertexResult.java b/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanVertexResult.java index 8b15218ef..38c190c67 100644 --- a/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanVertexResult.java +++ b/client/src/main/java/com/vesoft/nebula/client/storage/scan/ScanVertexResult.java @@ -11,6 +11,7 @@ import com.vesoft.nebula.client.storage.data.VertexRow; import com.vesoft.nebula.client.storage.data.VertexTableRow; import com.vesoft.nebula.client.storage.processor.VertexProcessor; +import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -18,8 +19,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class ScanVertexResult { +public class ScanVertexResult implements Serializable { + private static final Logger LOGGER = LoggerFactory.getLogger(ScanVertexResult.class); + private static final long serialVersionUID = -2446261806893848521L; private final List dataSets;