Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-9974 Improve debuggability
  3. CASSANDRA-9975

Flatten Iterator call hierarchy with a shared Transformer

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 3.0.0
    • None
    • None

    Description

      Stepping through a read response is made exceedingly difficult by the sheer depth of the call hierarchy, and how rapidly your context jumps around. This ticket intend to partially address that, by flattening one of the main causes of this: iterator transformations.

      I have a patch that attempts to mitigate (but not entirely eliminate) this, through the introduction of a RowTransformer class that all transformations are applied through. If a transformation has already been applied, the RowTransformer class does not wrap a new iterator, but instead returns a new RowTransformer that wraps the original underlying (untransformed) iterator and both transformations. This can accumulate an arbitrary number of transformations and, quite importantly, can apply the filtration step Unfiltered -> Row in the same instance as well. The intention being that a majority of control flow happens inside this RowTransformer, so there is far less context jumping to cope with.

      Attachments

        1. before - schema query.png
          190 kB
          Benedict Elliott Smith
        2. before - limit query.png
          222 kB
          Benedict Elliott Smith
        3. after - schema query.png
          232 kB
          Benedict Elliott Smith
        4. after - limit query.png
          246 kB
          Benedict Elliott Smith

        Issue Links

          Activity

            People

              benedict Benedict Elliott Smith
              benedict Benedict Elliott Smith
              Benedict Elliott Smith
              Branimir Lambov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: