Files
scylladb/cql/server.hh
Pekka Enberg 2a7da21481 CQL binary protocol
This patch implement initial support for CQL binary protocol versions 1,
2, 3, and 4. The CQL server is able to handshake with cqlsh and
cassandra-stress from Cassandra 2.1 which uses the STARTUP and OPTIONS
messages. Queries or other functionality is not supported.

To try it out, start Urchin:

  $ build/release/seastar --smp 1 --datadir data
  CQL server listening on port 9042 ...
  Thrift server listening on port 9160 ...

Then try to login with cqlsh:

  $ ./bin/cqlsh 127.0.0.1

Urchin side will fail with:

  CQL_VERSION => 3.2.0
  warning: ignoring event registration
  warning: ignoring query SELECT peer, data_center, rack, tokens, rpc_address, schema_version FROM system.peers
  seastar: cql/server.cc:222: future<> cql_server::connection::process_query(uint16_t, temporary_buffer<char>&): Assertion `0' failed.
  Aborted (core dumped)

TODO:

  - Compression is not supported.

  - Authentication is not supported.

  - Supported options are defined to make cqlsh and cassandra-stress
    happy. We really need to decide which CQL versions and compression
    algorithms we want to support.

  - std::string is used everywhere because sstring does not work with
    std::map, std::multimap, and others.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
2015-02-02 19:28:31 +01:00

24 lines
374 B
C++

/*
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
#ifndef CQL_SERVER_HH
#define CQL_SERVER_HH
#include "core/reactor.hh"
class database;
class cql_server {
std::vector<server_socket> _listeners;
public:
cql_server(database& db);
future<> listen(ipv4_addr addr);
void do_accepts(int which);
private:
class connection;
class response;
};
#endif