com.netflix.astyanax.thrift
Class ThriftSyncConnectionFactoryImpl.ThriftConnection

java.lang.Object
  extended by com.netflix.astyanax.thrift.ThriftSyncConnectionFactoryImpl.ThriftConnection
All Implemented Interfaces:
com.netflix.astyanax.connectionpool.Connection<org.apache.cassandra.thrift.Cassandra.Client>, com.netflix.astyanax.connectionpool.ConnectionContext
Enclosing class:
ThriftSyncConnectionFactoryImpl

public class ThriftSyncConnectionFactoryImpl.ThriftConnection
extends java.lang.Object
implements com.netflix.astyanax.connectionpool.Connection<org.apache.cassandra.thrift.Cassandra.Client>


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.netflix.astyanax.connectionpool.Connection
com.netflix.astyanax.connectionpool.Connection.AsyncOpenCallback<CL>
 
Constructor Summary
ThriftSyncConnectionFactoryImpl.ThriftConnection(com.netflix.astyanax.connectionpool.HostConnectionPool<org.apache.cassandra.thrift.Cassandra.Client> pool)
           
 
Method Summary
 void close()
           
 boolean equals(java.lang.Object obj)
          Compares the toString of these clients
<R> com.netflix.astyanax.connectionpool.OperationResult<R>
execute(com.netflix.astyanax.connectionpool.Operation<org.apache.cassandra.thrift.Cassandra.Client,R> op)
           
 com.netflix.astyanax.connectionpool.Host getHost()
           
 com.netflix.astyanax.connectionpool.HostConnectionPool<org.apache.cassandra.thrift.Cassandra.Client> getHostConnectionPool()
           
 com.netflix.astyanax.connectionpool.exceptions.ConnectionException getLastException()
           
 java.lang.Object getMetadata(java.lang.String key)
           
 long getOperationCount()
           
 boolean hasMetadata(java.lang.String key)
           
 void open()
           
 void openAsync(com.netflix.astyanax.connectionpool.Connection.AsyncOpenCallback<org.apache.cassandra.thrift.Cassandra.Client> callback)
           
 void setMetadata(java.lang.String key, java.lang.Object data)
           
 void setTimeout(int timeout)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThriftSyncConnectionFactoryImpl.ThriftConnection

public ThriftSyncConnectionFactoryImpl.ThriftConnection(com.netflix.astyanax.connectionpool.HostConnectionPool<org.apache.cassandra.thrift.Cassandra.Client> pool)
Method Detail

execute

public <R> com.netflix.astyanax.connectionpool.OperationResult<R> execute(com.netflix.astyanax.connectionpool.Operation<org.apache.cassandra.thrift.Cassandra.Client,R> op)
                                                               throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
Specified by:
execute in interface com.netflix.astyanax.connectionpool.Connection<org.apache.cassandra.thrift.Cassandra.Client>
Throws:
com.netflix.astyanax.connectionpool.exceptions.ConnectionException

open

public void open()
          throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
Specified by:
open in interface com.netflix.astyanax.connectionpool.Connection<org.apache.cassandra.thrift.Cassandra.Client>
Throws:
com.netflix.astyanax.connectionpool.exceptions.ConnectionException

openAsync

public void openAsync(com.netflix.astyanax.connectionpool.Connection.AsyncOpenCallback<org.apache.cassandra.thrift.Cassandra.Client> callback)
Specified by:
openAsync in interface com.netflix.astyanax.connectionpool.Connection<org.apache.cassandra.thrift.Cassandra.Client>

close

public void close()
Specified by:
close in interface com.netflix.astyanax.connectionpool.Connection<org.apache.cassandra.thrift.Cassandra.Client>

getHostConnectionPool

public com.netflix.astyanax.connectionpool.HostConnectionPool<org.apache.cassandra.thrift.Cassandra.Client> getHostConnectionPool()
Specified by:
getHostConnectionPool in interface com.netflix.astyanax.connectionpool.Connection<org.apache.cassandra.thrift.Cassandra.Client>

getLastException

public com.netflix.astyanax.connectionpool.exceptions.ConnectionException getLastException()
Specified by:
getLastException in interface com.netflix.astyanax.connectionpool.Connection<org.apache.cassandra.thrift.Cassandra.Client>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Compares the toString of these clients

Overrides:
equals in class java.lang.Object

getOperationCount

public long getOperationCount()
Specified by:
getOperationCount in interface com.netflix.astyanax.connectionpool.Connection<org.apache.cassandra.thrift.Cassandra.Client>

getHost

public com.netflix.astyanax.connectionpool.Host getHost()
Specified by:
getHost in interface com.netflix.astyanax.connectionpool.Connection<org.apache.cassandra.thrift.Cassandra.Client>

setTimeout

public void setTimeout(int timeout)

setMetadata

public void setMetadata(java.lang.String key,
                        java.lang.Object data)
Specified by:
setMetadata in interface com.netflix.astyanax.connectionpool.ConnectionContext

getMetadata

public java.lang.Object getMetadata(java.lang.String key)
Specified by:
getMetadata in interface com.netflix.astyanax.connectionpool.ConnectionContext

hasMetadata

public boolean hasMetadata(java.lang.String key)
Specified by:
hasMetadata in interface com.netflix.astyanax.connectionpool.ConnectionContext