org.scale7.cassandra.pelops.pool
Class CachePerNodePool.PooledConnection
java.lang.Object
org.scale7.cassandra.pelops.Connection
org.scale7.cassandra.pelops.pool.CachePerNodePool.PooledConnection
- All Implemented Interfaces:
- IConnection, IThriftPool.IPooledConnection
- Enclosing class:
- CachePerNodePool
public class CachePerNodePool.PooledConnection
- extends Connection
- implements IThriftPool.IPooledConnection
Encapsulates a connection to a Cassandra node.
- Author:
- dominicwilliams
Method Summary |
void |
close()
Close the connection. |
void |
corrupted()
Specify whether an exception has been thrown during usage of the connection. |
int |
getNodeSessionId()
|
void |
release()
Release a Connection that has previously been taken from the pool. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachePerNodePool.PooledConnection
public CachePerNodePool.PooledConnection(Cluster.Node node,
String keyspace,
org.scale7.cassandra.pelops.pool.CachePerNodePool.NodeContext nodeContext,
int nodeSessionId)
throws SocketException,
org.apache.thrift.TException,
org.apache.cassandra.thrift.InvalidRequestException
- Throws:
SocketException
org.apache.thrift.TException
org.apache.cassandra.thrift.InvalidRequestException
getNodeSessionId
public int getNodeSessionId()
close
public void close()
- Close the connection.
- Specified by:
close
in interface IConnection
- Overrides:
close
in class Connection
corrupted
public void corrupted()
- Description copied from interface:
IThriftPool.IPooledConnection
- Specify whether an exception has been thrown during usage of the connection. If an exception has been thrown, the
connection will not re-used since it may be corrupted (for example, it may contain partially written
data that disrupts the serialization of the Thrift protocol) however it is remains essential that all
connection objects are released.
- Specified by:
corrupted
in interface IThriftPool.IPooledConnection
release
public void release()
- Description copied from interface:
IThriftPool.IPooledConnection
- Release a
Connection
that has previously been taken from the pool.
- Specified by:
release
in interface IThriftPool.IPooledConnection
Copyright © 2011. All Rights Reserved.