Package com.datastax.oss.driver.api.core
Class DriverTimeoutException.NodeDiagnostics
- java.lang.Object
-
- com.datastax.oss.driver.api.core.DriverTimeoutException.NodeDiagnostics
-
- Enclosing class:
- DriverTimeoutException
public static final class DriverTimeoutException.NodeDiagnostics extends Object
Per-node diagnostic snapshot captured at timeout time.Fields:
getNodeState(): the state of the node (UP, DOWN, etc.) at timeout time.getNodeDistance(): the distance assigned to the node by the load-balancing policy (LOCAL, REMOTE, or IGNORED).getDatacenter(): the datacenter the node belongs to.getChannelInFlight(): requests currently awaiting a response on the specific connection used for this request.getPoolSize(): number of active connections in the pool (DriverTimeoutException.UNAVAILABLEif the pool was already removed).getPoolInFlight(): total in-flight across all connections to this host (DriverTimeoutException.UNAVAILABLEif the pool was already removed).getPoolAvailableIds(): remaining stream IDs available to send new requests; a low value indicates pool contention (DriverTimeoutException.UNAVAILABLEif pool was already removed).getPoolOrphanedIds(): stream IDs from previously timed-out or cancelled requests that cannot be released yet; a high value indicates stale stream ID accumulation (DriverTimeoutException.UNAVAILABLEif pool was already removed).
Diagnosing failure modes:
poolAvailableIdsnear zero → pool contention; requests queuing inside the driver before reaching the server.poolAvailableIdsnormal + highchannelInFlight→ server is slow; requests were sent but not answered within the timeout.- High
poolOrphanedIds→ previous timeouts consumed stream IDs that the driver is still waiting to reclaim. poolSizebelow expected → pool is degraded; some connections have been lost.nodeStateDOWN or FORCED_DOWN → node is known to be unavailable.
-
-
Constructor Summary
Constructors Constructor Description NodeDiagnostics(EndPoint endPoint, NodeState nodeState, NodeDistance nodeDistance, String datacenter, int channelInFlight)Creates a partial diagnostic snapshot for when the pool was unavailable at timeout time.NodeDiagnostics(EndPoint endPoint, NodeState nodeState, NodeDistance nodeDistance, String datacenter, int channelInFlight, int poolSize, int poolInFlight, int poolAvailableIds, int poolOrphanedIds)Creates a full diagnostic snapshot (pool was available at timeout time).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetChannelInFlight()Returns the number of in-flight requests on the specific connection at timeout time, orDriverTimeoutException.UNAVAILABLEif not available.StringgetDatacenter()Returns the datacenter this node belongs to, ornullif not available.EndPointgetEndPoint()Returns the endpoint of the node that had in-flight requests at timeout time.NodeDistancegetNodeDistance()Returns the distance assigned to this node by the load-balancing policy at timeout time (e.g.NodeStategetNodeState()Returns the state of the node at timeout time (e.g.intgetPoolAvailableIds()Returns the number of remaining stream IDs available in the pool at timeout time, orDriverTimeoutException.UNAVAILABLEif the pool was no longer available.intgetPoolInFlight()Returns the total number of in-flight requests across all connections to this host at timeout time, orDriverTimeoutException.UNAVAILABLEif the pool was no longer available.intgetPoolOrphanedIds()Returns the number of orphaned stream IDs in the pool at timeout time, orDriverTimeoutException.UNAVAILABLEif the pool was no longer available.intgetPoolSize()Returns the number of active connections in the pool at timeout time, orDriverTimeoutException.UNAVAILABLEif the pool was no longer available.static DriverTimeoutException.NodeDiagnosticsof(EndPoint endPoint, NodeState nodeState, NodeDistance nodeDistance, String datacenter, int channelInFlight, int poolSize, int poolInFlight, int poolAvailableIds, int poolOrphanedIds)Creates a diagnostic snapshot using pre-computed pool stats.StringtoString()
-
-
-
Constructor Detail
-
NodeDiagnostics
public NodeDiagnostics(@NonNull EndPoint endPoint, @Nullable NodeState nodeState, @Nullable NodeDistance nodeDistance, @Nullable String datacenter, int channelInFlight, int poolSize, int poolInFlight, int poolAvailableIds, int poolOrphanedIds)Creates a full diagnostic snapshot (pool was available at timeout time).- Parameters:
endPoint- the endpoint of the node.nodeState- the state of the node at timeout time.nodeDistance- the distance assigned to the node by the load-balancing policy.datacenter- the datacenter the node belongs to.channelInFlight- in-flight count on the specific channel.poolSize- number of active connections in the pool.poolInFlight- total in-flight across the pool for this host.poolAvailableIds- remaining stream IDs available in the pool.poolOrphanedIds- orphaned stream IDs in the pool.
-
NodeDiagnostics
public NodeDiagnostics(@NonNull EndPoint endPoint, @Nullable NodeState nodeState, @Nullable NodeDistance nodeDistance, @Nullable String datacenter, int channelInFlight)Creates a partial diagnostic snapshot for when the pool was unavailable at timeout time. The pool-related fields (getPoolSize(),getPoolInFlight(),getPoolAvailableIds(),getPoolOrphanedIds()) will beDriverTimeoutException.UNAVAILABLE.- Parameters:
endPoint- the endpoint of the node.nodeState- the state of the node at timeout time.nodeDistance- the distance assigned to the node by the load-balancing policy.datacenter- the datacenter the node belongs to.channelInFlight- in-flight count on the specific channel.
-
-
Method Detail
-
of
@NonNull public static DriverTimeoutException.NodeDiagnostics of(@NonNull EndPoint endPoint, @Nullable NodeState nodeState, @Nullable NodeDistance nodeDistance, @Nullable String datacenter, int channelInFlight, int poolSize, int poolInFlight, int poolAvailableIds, int poolOrphanedIds)
Creates a diagnostic snapshot using pre-computed pool stats. PassDriverTimeoutException.UNAVAILABLEfor pool fields when the pool was not available at timeout time.- Parameters:
endPoint- the endpoint of the node.nodeState- the state of the node at timeout time.nodeDistance- the distance assigned to the node by the load-balancing policy.datacenter- the datacenter the node belongs to.channelInFlight- in-flight count on the specific channel.poolSize- number of active connections in the pool, orDriverTimeoutException.UNAVAILABLE.poolInFlight- total in-flight across the pool, orDriverTimeoutException.UNAVAILABLE.poolAvailableIds- remaining stream IDs in the pool, orDriverTimeoutException.UNAVAILABLE.poolOrphanedIds- orphaned stream IDs in the pool, orDriverTimeoutException.UNAVAILABLE.
-
getEndPoint
@NonNull public EndPoint getEndPoint()
Returns the endpoint of the node that had in-flight requests at timeout time.
-
getNodeState
@Nullable public NodeState getNodeState()
Returns the state of the node at timeout time (e.g. UP, DOWN, FORCED_DOWN), ornullif not available.
-
getNodeDistance
@Nullable public NodeDistance getNodeDistance()
Returns the distance assigned to this node by the load-balancing policy at timeout time (e.g. LOCAL, REMOTE, IGNORED), ornullif not available.
-
getDatacenter
@Nullable public String getDatacenter()
Returns the datacenter this node belongs to, ornullif not available.
-
getChannelInFlight
public int getChannelInFlight()
Returns the number of in-flight requests on the specific connection at timeout time, orDriverTimeoutException.UNAVAILABLEif not available.
-
getPoolSize
public int getPoolSize()
Returns the number of active connections in the pool at timeout time, orDriverTimeoutException.UNAVAILABLEif the pool was no longer available.
-
getPoolInFlight
public int getPoolInFlight()
Returns the total number of in-flight requests across all connections to this host at timeout time, orDriverTimeoutException.UNAVAILABLEif the pool was no longer available.
-
getPoolAvailableIds
public int getPoolAvailableIds()
Returns the number of remaining stream IDs available in the pool at timeout time, orDriverTimeoutException.UNAVAILABLEif the pool was no longer available. A low value indicates pool contention.
-
getPoolOrphanedIds
public int getPoolOrphanedIds()
Returns the number of orphaned stream IDs in the pool at timeout time, orDriverTimeoutException.UNAVAILABLEif the pool was no longer available. A high value indicates stale stream ID accumulation from previous timeouts.
-
-