public interface

ConnectionPoolMonitor

com.netflix.astyanax.connectionpool.ConnectionPoolMonitor
Known Indirect Subclasses

Class Overview

Monitoring interface to receive notification of pool events. A concrete monitor will make event stats available to a monitoring application and may also log events to a log file.

Summary

Public Methods
abstract long getConnectionBorrowedCount()
abstract long getConnectionClosedCount()
abstract long getConnectionCreateFailedCount()
abstract long getConnectionCreatedCount()
abstract long getConnectionReturnedCount()
abstract long getFailoverCount()
abstract Map<HostHostStats> getHostStats()
Return a mapping of all hosts and their statistics
abstract long getNoHostCount()
abstract long getOperationFailureCount()
abstract long getOperationSuccessCount()
abstract long getOperationTimeoutCount()
abstract long getPoolExhaustedTimeoutCount()
abstract void incConnectionBorrowed(Host host, long delay)
Incremented for each connection borrowed
abstract void incConnectionClosed(Host host, Exception reason)
Closed a connection
abstract void incConnectionCreateFailed(Host host, Exception reason)
Attempt to create a connection failed
abstract void incConnectionCreated(Host host)
Created a connection successfully
abstract void incConnectionReturned(Host host)
Incremented for each connection returned.
abstract void incFailover(Host host, Exception reason)
An operation failed by the connection pool will attempt to fail over to another host/connection.
abstract void incNoHosts()
There were no active hosts in the pool to borrow from.
abstract void incOperationFailure(Host host, Exception reason)
Errors trying to execute an operation
abstract void incOperationSuccess(Host host, long latency)
Succeeded in executing an operation
abstract void incOperationTimeout()
Timeout waiting for a response from the cluster
abstract void incPoolExhaustedTimeout()
Timeout trying to get a connection from the pool
abstract void onHostAdded(Host host, HostConnectionPool<?> pool)
A host was added and given the associated pool.
abstract void onHostDown(Host host, Exception reason)
A host was identified as downed.
abstract void onHostReactivated(Host host, HostConnectionPool<?> pool)
A host was reactivated after being marked down
abstract void onHostRemoved(Host host)
A host was removed from the pool.

Public Methods

public abstract long getConnectionBorrowedCount ()

public abstract long getConnectionClosedCount ()

public abstract long getConnectionCreateFailedCount ()

public abstract long getConnectionCreatedCount ()

public abstract long getConnectionReturnedCount ()

public abstract long getFailoverCount ()

public abstract Map<HostHostStats> getHostStats ()

Return a mapping of all hosts and their statistics

public abstract long getNoHostCount ()

public abstract long getOperationFailureCount ()

public abstract long getOperationSuccessCount ()

public abstract long getOperationTimeoutCount ()

public abstract long getPoolExhaustedTimeoutCount ()

public abstract void incConnectionBorrowed (Host host, long delay)

Incremented for each connection borrowed

Parameters
host Host from which the connection was borrowed
delay Time spent in the connection pool borrowing the connection

public abstract void incConnectionClosed (Host host, Exception reason)

Closed a connection

Parameters
reason TODO: Make the host available to this

public abstract void incConnectionCreateFailed (Host host, Exception reason)

Attempt to create a connection failed

public abstract void incConnectionCreated (Host host)

Created a connection successfully

public abstract void incConnectionReturned (Host host)

Incremented for each connection returned.

Parameters
host Host to which connection is returned

public abstract void incFailover (Host host, Exception reason)

An operation failed by the connection pool will attempt to fail over to another host/connection.

public abstract void incNoHosts ()

There were no active hosts in the pool to borrow from.

public abstract void incOperationFailure (Host host, Exception reason)

Errors trying to execute an operation

public abstract void incOperationSuccess (Host host, long latency)

Succeeded in executing an operation

public abstract void incOperationTimeout ()

Timeout waiting for a response from the cluster

public abstract void incPoolExhaustedTimeout ()

Timeout trying to get a connection from the pool

public abstract void onHostAdded (Host host, HostConnectionPool<?> pool)

A host was added and given the associated pool. The pool is immutable and can be used to get info about the number of open connections

public abstract void onHostDown (Host host, Exception reason)

A host was identified as downed.

Parameters
reason Exception that caused the host to be identified as down

public abstract void onHostReactivated (Host host, HostConnectionPool<?> pool)

A host was reactivated after being marked down

public abstract void onHostRemoved (Host host)

A host was removed from the pool. This is usually called when a downed host is removed from the ring.