Skip to content

Move tablet-routing payload decoding to tablets.py #974

Description

@dkropachev

PR #913 adds TABLETS_ROUTING_V2 decoding alongside the existing V1 decoding in ResponseFuture. The implementation is functional and can be merged as-is, but ResponseFuture now owns tablet wire-format descriptions, lazy decoder caches, payload decoding, and cache orchestration.

Move tablet-routing payload codec responsibilities to cassandra/tablets.py, which already owns Tablet, tablet-version handling, and the tablet cache.

Suggested scope:

  • Move the V1 and V2 CQL tuple layouts out of ResponseFuture.
  • Define/cache both payload decoders together in cassandra/tablets.py.
  • Expose a helper that decodes a routing payload into a Tablet.
  • Keep ResponseFuture responsible only for selecting the negotiated payload and storing the decoded tablet.
  • Remove _TABLET_ROUTING_CTYPE and _TABLET_ROUTING_V2_CTYPE from ResponseFuture.
  • Preserve existing V1/V2 wire behavior and add focused codec tests.

Follow-up to #913; no changes to #913 are required before merging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions