Search in sources :

Example 1 with StartupMessage

use of org.apache.cassandra.transport.messages.StartupMessage in project cassandra by apache.

the class SimpleClient method connect.

public void connect(boolean useCompression) throws IOException {
    establishConnection();
    Map<String, String> options = new HashMap<>();
    options.put(StartupMessage.CQL_VERSION, "3.0.0");
    if (useCompression) {
        options.put(StartupMessage.COMPRESSION, "snappy");
        connection.setCompressor(FrameCompressor.SnappyCompressor.instance);
    }
    execute(new StartupMessage(options));
}
Also used : HashMap(java.util.HashMap) StartupMessage(org.apache.cassandra.transport.messages.StartupMessage)

Aggregations

HashMap (java.util.HashMap)1 StartupMessage (org.apache.cassandra.transport.messages.StartupMessage)1