voldemort.client.protocol.admin
Class SocketPool

java.lang.Object
  extended by voldemort.client.protocol.admin.SocketPool

public class SocketPool
extends java.lang.Object

A pool of sockets keyed off the socket destination. This wrapper just translates exceptions and delegates to apache commons pool as well as providing some JMX access.


Constructor Summary
SocketPool(int maxConnectionsPerNode, int connectionTimeoutMs, int soTimeoutMs, int socketBufferSize)
           
SocketPool(int maxConnectionsPerNode, int connectionTimeoutMs, int soTimeoutMs, int socketBufferSize, boolean socketKeepAlive)
           
 
Method Summary
 void checkin(SocketDestination destination, SocketAndStreams socket)
          Check the socket back into the pool.
 SocketAndStreams checkout(SocketDestination destination)
          Checkout a socket from the pool
 void close()
          Close the socket pool
 void close(SocketDestination destination)
           
 double getAvgWaitTimeMs()
           
 int getNumberOfActiveConnections()
           
 int getNumberOfCheckedInConnections()
           
 int getNumberSocketsCreated()
           
 int getNumberSocketsDestroyed()
           
 void setMonitoringInterval(int count)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketPool

public SocketPool(int maxConnectionsPerNode,
                  int connectionTimeoutMs,
                  int soTimeoutMs,
                  int socketBufferSize,
                  boolean socketKeepAlive)

SocketPool

public SocketPool(int maxConnectionsPerNode,
                  int connectionTimeoutMs,
                  int soTimeoutMs,
                  int socketBufferSize)
Method Detail

checkout

public SocketAndStreams checkout(SocketDestination destination)
Checkout a socket from the pool

Parameters:
destination - The socket destination you want to connect to
Returns:
The socket

checkin

public void checkin(SocketDestination destination,
                    SocketAndStreams socket)
Check the socket back into the pool.

Parameters:
destination - The socket destination of the socket
socket - The socket to check back in

close

public void close(SocketDestination destination)

close

public void close()
Close the socket pool


getNumberSocketsCreated

public int getNumberSocketsCreated()

getNumberSocketsDestroyed

public int getNumberSocketsDestroyed()

getNumberOfActiveConnections

public int getNumberOfActiveConnections()

getNumberOfCheckedInConnections

public int getNumberOfCheckedInConnections()

getAvgWaitTimeMs

public double getAvgWaitTimeMs()

setMonitoringInterval

public void setMonitoringInterval(int count)


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu