NebulaGraph Java Client  release-3.6
NebulaPool Class Reference
+ Inheritance diagram for NebulaPool:
+ Collaboration diagram for NebulaPool:

Public Member Functions

boolean init (List< HostAddress > addresses, NebulaPoolConfig config) throws UnknownHostException, InvalidConfigException
 
void close ()
 close the pool, all connections will be closed
 
Session getSession (String userName, String password, boolean reconnect) throws NotValidConnectionException, IOErrorException, AuthFailedException, ClientServerIncompatibleException
 get a session from the NebulaPool More...
 
int getActiveConnNum ()
 Get the number of connections was used by users. More...
 
int getIdleConnNum ()
 Get the number of free connections in the pool. More...
 
int getWaitersNum ()
 Get the number of waits in a waiting get connection. More...
 

Protected Member Functions

void updateServerStatus ()
 Update the services' status when the connection is broken, it is called by Session and NebulaPool.
 
void setInvalidateConnection (SyncConnection connection)
 Set the connection is invalidate, and the object pool will destroy it. More...
 
void returnConnection (SyncConnection connection)
 Return the connection to object pool. More...
 
SyncConnection getConnection () throws NotValidConnectionException
 

Detailed Description

Definition at line 28 of file NebulaPool.java.

Member Function Documentation

◆ getActiveConnNum()

int getActiveConnNum ( )

Get the number of connections was used by users.

Returns
the active connection number

Definition at line 161 of file NebulaPool.java.

◆ getIdleConnNum()

int getIdleConnNum ( )

Get the number of free connections in the pool.

Returns
the idle connection number

Definition at line 170 of file NebulaPool.java.

◆ getSession()

Session getSession ( String  userName,
String  password,
boolean  reconnect 
) throws NotValidConnectionException, IOErrorException, AuthFailedException, ClientServerIncompatibleException

get a session from the NebulaPool

Parameters
userNamethe userName to authenticate with nebula-graph
passwordthe password to authenticate with nebula-graph
reconnectwhether to retry after the connection is disconnected
Returns
Session
Exceptions
NotValidConnectionExceptionif get connection failed
IOErrorExceptionif get unexpected exception
AuthFailedExceptionif authenticate failed

Definition at line 138 of file NebulaPool.java.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWaitersNum()

int getWaitersNum ( )

Get the number of waits in a waiting get connection.

Returns
the waiting connection number

Definition at line 179 of file NebulaPool.java.

◆ init()

boolean init ( List< HostAddress addresses,
NebulaPoolConfig  config 
) throws UnknownHostException, InvalidConfigException
Parameters
addressesthe graphd services addresses
configthe config for the pool
Returns
boolean if all graph services are ok, return true, if some of them broken return false
Exceptions
UnknownHostExceptionif host address is illegal
InvalidConfigExceptionif config is illegal

Definition at line 81 of file NebulaPool.java.

◆ returnConnection()

void returnConnection ( SyncConnection  connection)
protected

Return the connection to object pool.

Parameters
connectionthe return connection

Definition at line 212 of file NebulaPool.java.

+ Here is the caller graph for this function:

◆ setInvalidateConnection()

void setInvalidateConnection ( SyncConnection  connection)
protected

Set the connection is invalidate, and the object pool will destroy it.

Parameters
connectionthe invalidate connection

Definition at line 199 of file NebulaPool.java.

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: