github.com/cockroachdb/pebble@v1.1.1-0.20240513155919-3622ade60459/internal/keyspan/testdata/filtering_iter (about)

     1  # The following filters are available:
     2  # - no-op: passes through all spans.
     3  # - key-kind-{set,unset,del}: filters keys in spans with the given key kind.
     4  
     5  define
     6  a-c:{(#3,RANGEKEYUNSET,@5) (#2,RANGEKEYSET,@5,apples) (#1,RANGEKEYSET,@3,bananas)}
     7  c-d:{(#4,RANGEKEYSET,@3,bananas) (#3,RANGEKEYDEL)}
     8  d-e:{(#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@1,pineapple)}
     9  ----
    10  
    11  iter filter=no-op
    12  first
    13  next
    14  next
    15  next
    16  ----
    17  a-c:{(#3,RANGEKEYUNSET,@5) (#2,RANGEKEYSET,@5,apples) (#1,RANGEKEYSET,@3,bananas)}
    18  c-d:{(#4,RANGEKEYSET,@3,bananas) (#3,RANGEKEYDEL)}
    19  d-e:{(#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@1,pineapple)}
    20  .
    21  
    22  iter filter=key-kind-set
    23  first
    24  next
    25  next
    26  next
    27  ----
    28  a-c:{(#2,RANGEKEYSET,@5,apples) (#1,RANGEKEYSET,@3,bananas)}
    29  c-d:{(#4,RANGEKEYSET,@3,bananas)}
    30  d-e:{(#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@1,pineapple)}
    31  .
    32  
    33  iter filter=key-kind-set
    34  last
    35  prev
    36  prev
    37  prev
    38  ----
    39  d-e:{(#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@1,pineapple)}
    40  c-d:{(#4,RANGEKEYSET,@3,bananas)}
    41  a-c:{(#2,RANGEKEYSET,@5,apples) (#1,RANGEKEYSET,@3,bananas)}
    42  .
    43  
    44  iter filter=key-kind-set
    45  seek-ge a
    46  seek-ge c
    47  next
    48  seek-lt b
    49  prev
    50  next
    51  seek-lt z
    52  next
    53  ----
    54  a-c:{(#2,RANGEKEYSET,@5,apples) (#1,RANGEKEYSET,@3,bananas)}
    55  c-d:{(#4,RANGEKEYSET,@3,bananas)}
    56  d-e:{(#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@1,pineapple)}
    57  a-c:{(#2,RANGEKEYSET,@5,apples) (#1,RANGEKEYSET,@3,bananas)}
    58  .
    59  a-c:{(#2,RANGEKEYSET,@5,apples) (#1,RANGEKEYSET,@3,bananas)}
    60  d-e:{(#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@1,pineapple)}
    61  .
    62  
    63  iter filter=key-kind-set
    64  first
    65  next
    66  next
    67  ----
    68  a-c:{(#2,RANGEKEYSET,@5,apples) (#1,RANGEKEYSET,@3,bananas)}
    69  c-d:{(#4,RANGEKEYSET,@3,bananas)}
    70  d-e:{(#4,RANGEKEYSET,@3,bananas) (#4,RANGEKEYSET,@1,pineapple)}
    71  
    72  iter filter=key-kind-unset
    73  first
    74  next
    75  ----
    76  a-c:{(#3,RANGEKEYUNSET,@5)}
    77  .
    78  
    79  iter filter=key-kind-del
    80  first
    81  next
    82  ----
    83  c-d:{(#3,RANGEKEYDEL)}
    84  .