public class SessionPool extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
AtomicBoolean |
hasInit |
AtomicInteger |
idleSessionSize |
AtomicBoolean |
isClosed |
CopyOnWriteArrayList<NebulaSession> |
sessionList |
| Constructor and Description |
|---|
SessionPool(SessionPoolConfig poolConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
close the session pool
|
ResultSet |
execute(String stmt)
Execute the nGql sentence.
|
ResultSet |
execute(String stmt,
Map<String,Object> parameterMap)
Execute the nGql sentence with parameter
|
HostAddress |
getAddress() |
int |
getIdleSessionNums()
get the number of idle Session
|
int |
getSessionNums()
get the number of all Session
|
boolean |
init()
init the SessionPool
|
boolean |
isActive()
if the SessionPool has been initialized
|
boolean |
isClosed()
if the SessionPool is closed
|
public CopyOnWriteArrayList<NebulaSession> sessionList
public AtomicInteger idleSessionSize
public AtomicBoolean hasInit
public AtomicBoolean isClosed
public SessionPool(SessionPoolConfig poolConfig)
public boolean init()
public ResultSet execute(String stmt) throws IOErrorException, ClientServerIncompatibleException, AuthFailedException, BindSpaceFailedException
stmt - The nGql sentence.
such as insert ngql `INSERT VERTEX person(name) VALUES "Tom":("Tom");`IOErrorExceptionClientServerIncompatibleExceptionAuthFailedExceptionBindSpaceFailedExceptionpublic ResultSet execute(String stmt, Map<String,Object> parameterMap) throws ClientServerIncompatibleException, AuthFailedException, IOErrorException, BindSpaceFailedException
stmt - The nGql sentence.parameterMap - The nGql parameter mapClientServerIncompatibleExceptionAuthFailedExceptionIOErrorExceptionBindSpaceFailedExceptionpublic void close()
public boolean isActive()
public boolean isClosed()
public int getSessionNums()
public int getIdleSessionNums()
public HostAddress getAddress()
Copyright © 2023. All rights reserved.