public class DataNode extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DataNode.CheckDnStateResult
The result of checking dn state.
|
| Modifier and Type | Method and Description |
|---|---|
int |
checkConnectionsValidity()
Check cached connections validity, and remove invalid connections.
|
boolean |
checkDnState(Properties properties)
check a dn of the cluster if valid,
|
DataNode.CheckDnStateResult |
checkDnStateAndProperties(Properties properties)
Check dn state and the validity of properties.
|
int |
clearCachedConnections()
Close cached connections, and clear cachedConnectionList.
|
boolean |
closeConnection(PgConnection pgConnection)
Close connection.
|
int |
decrementCachedCreatingConnectionSize()
decrement cachedCreatingConnectionSize
|
boolean |
equals(Object obj) |
List<ConnectionInfo> |
filterIdleConnections(long quickAutoBalanceStartTime)
Filter idle connections from cachedConnectionsList.
|
int |
getCachedConnectionListSize()
Get the size of cachedConnectionList.
|
int |
getCachedCreatingConnectionSize()
get cachedCreatingConnectionSize
|
ConnectionInfo |
getConnectionInfo(PgConnection pgConnection)
Get connection info if the connection exits.
|
boolean |
getDataNodeState() |
int |
hashCode() |
int |
incrementCachedCreatingConnectionSize()
increment cachedCreatingConnectionSize
|
void |
setConnection(PgConnection pgConnection,
Properties properties,
HostSpec hostSpec)
Set connection.
|
void |
setConnectionState(PgConnection pgConnection,
StatementCancelState state)
Set connection state.
|
void |
setDataNodeState(boolean isDnValid) |
public DataNode(HostSpec hostSpec)
public void setConnectionState(PgConnection pgConnection, StatementCancelState state)
pgConnection - pgConnectionstate - statepublic void setConnection(PgConnection pgConnection, Properties properties, HostSpec hostSpec) throws PSQLException
pgConnection - pgConnectionproperties - propertieshostSpec - hostSpecPSQLExceptionpublic ConnectionInfo getConnectionInfo(PgConnection pgConnection)
pgConnection - pgConnectionpublic int getCachedConnectionListSize()
public DataNode.CheckDnStateResult checkDnStateAndProperties(Properties properties)
properties - propertiespublic List<ConnectionInfo> filterIdleConnections(long quickAutoBalanceStartTime)
quickAutoBalanceStartTime - the time since the start of quickAutoBalancepublic void setDataNodeState(boolean isDnValid)
public boolean getDataNodeState()
public boolean checkDnState(Properties properties) throws PSQLException, InvocationTargetException
properties - propertiesPSQLException - psql exceptionInvocationTargetException - invocation target exceptionpublic int checkConnectionsValidity()
public int clearCachedConnections()
public boolean closeConnection(PgConnection pgConnection)
pgConnection - pgConnectionpublic int getCachedCreatingConnectionSize()
public int incrementCachedCreatingConnectionSize()
public int decrementCachedCreatingConnectionSize()
Copyright © 2023 openGauss. All rights reserved.