Send keyspace in QUERY, PREPARE, and BATCH messages in v5

Description

CASSANDRA-10145 allows the client to send the keyspace name in QUERY, PREPARE, and BATCH messages as of v5 (when there is a current keyspace).

The driver should leverage this feature and eventually (after v4 support is dropped) this will allow us to simplify session management in the client. We'd no longer need different connection pools for different sessions since connections will no longer have keyspaces bound to them. It would be great if part of this fix included logic to avoid creating extra pools if we're speaking v5 or later.

QUERY message changes:
flag 0x80 means a keyspace name is being provided in the message; if set, add the keyspace [string] after timestamp

PREPARE message changes:
A flags field has been added such that the message format is now:
<query><flags>[<keyspace>]
flag 0x01 means a keyspace name is being provided in the message.

BATCH message changes:
Pretty much the same as QUERY message; flag 0x80 means there's a keyspace [string] after the timestamp.

See the native_protocol_v5.spec file in the patch in CASSANDRA-10145 for details.

Environment

None

Pull Requests

None

Activity

Show:
Jorge Bay Gondra
December 9, 2016, 8:56 AM

Thanks for posting it !

Assignee

Unassigned

Reporter

Sandeep Tamhankar

Reviewer

None

Fix versions

None

Labels

None

Components

None

PM Priority

None

Pull Request

None

Priority

Major

Sprint

Node P-MAJOR-NEXT
Configure