Package org.apache.cassandra.transport
Class SimpleClient
java.lang.Object
org.apache.cassandra.transport.SimpleClient
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
Client
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected io.netty.bootstrap.Bootstrapprotected io.netty.channel.Channelprotected Stringprotected Connectionfinal Stringprotected io.netty.channel.ChannelFuturefinal intprotected final org.apache.cassandra.transport.SimpleClient.ResponseHandlerstatic final intprotected final Connection.Trackerprotected final ProtocolVersion -
Constructor Summary
ConstructorsConstructorDescriptionSimpleClient(String host, int port) SimpleClient(String host, int port, EncryptionOptions encryptionOptions) SimpleClient(String host, int port, ProtocolVersion version) SimpleClient(String host, int port, ProtocolVersion version, boolean useBeta, EncryptionOptions encryptionOptions) SimpleClient(String host, int port, ProtocolVersion version, EncryptionOptions encryptionOptions) -
Method Summary
Modifier and TypeMethodDescriptionstatic SimpleClient.Buildervoidclose()connect(boolean useCompression) connect(boolean useCompression, boolean throwOnOverload) execute(String query, List<ByteBuffer> values, ConsistencyLevel consistencyLevel) execute(String query, ConsistencyLevel consistency) execute(List<Message.Request> requests) execute(Message.Request request) execute(Message.Request request, boolean throwOnErrorResponse) executePrepared(ResultMessage.Prepared prepared, List<ByteBuffer> values, ConsistencyLevel consistency) voidsetEventHandler(SimpleClient.EventHandler eventHandler)
-
Field Details
-
TIMEOUT_SECONDS
public static final int TIMEOUT_SECONDS- See Also:
-
host
-
port
public final int port -
responseHandler
protected final org.apache.cassandra.transport.SimpleClient.ResponseHandler responseHandler -
tracker
-
version
-
connection
-
bootstrap
protected io.netty.bootstrap.Bootstrap bootstrap -
channel
protected io.netty.channel.Channel channel -
lastWriteFuture
protected io.netty.channel.ChannelFuture lastWriteFuture -
compression
-
-
Constructor Details
-
SimpleClient
public SimpleClient(String host, int port, ProtocolVersion version, EncryptionOptions encryptionOptions) -
SimpleClient
-
SimpleClient
-
SimpleClient
public SimpleClient(String host, int port, ProtocolVersion version, boolean useBeta, EncryptionOptions encryptionOptions) -
SimpleClient
-
-
Method Details
-
builder
-
connect
- Throws:
IOException
-
connect
- Throws:
IOException
-
setEventHandler
-
execute
-
execute
public ResultMessage execute(String query, List<ByteBuffer> values, ConsistencyLevel consistencyLevel) -
prepare
-
executePrepared
public ResultMessage executePrepared(ResultMessage.Prepared prepared, List<ByteBuffer> values, ConsistencyLevel consistency) -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
execute
-
execute
-
execute
-