github.com/zuoyebang/bitalostable@v1.0.1-0.20240229032404-e3b99a834294/testdata/ingest_target_level (about) 1 define 2 ---- 3 4 # An empty LSM ingests into the bottom level. 5 target 6 a-b 7 ---- 8 6 9 10 define 11 L5 12 b.SET.1:1 13 c.SET.2:2 14 ---- 15 5: 16 000004:[b#1,SET-c#2,SET] 17 18 # Overlapping cases. 19 target 20 a-b 21 b-c 22 c-d 23 ---- 24 4 25 4 26 4 27 28 # Non-overlapping cases: 29 # - Ingested file lies entirely before the existing file. 30 # - Ingested file lies entirely after the existing file. 31 # - Ingested file has no data overlap (falls through the middle of the existing 32 # file). 33 target 34 a-aa 35 d-e 36 bb-bb 37 ---- 38 6 39 6 40 6 41 42 define 43 L0 44 b.SET.3:3 45 e.SET.4:4 46 L0 47 d.SET.5:5 48 f.SET.6:6 49 L0 50 x.SET.7:7 51 y.SET.8:8 52 L3 53 g.SET.1:1 54 h.SET.2:2 55 ---- 56 0.1: 57 000005:[d#5,SET-f#6,SET] 58 0.0: 59 000004:[b#3,SET-e#4,SET] 60 000006:[x#7,SET-y#8,SET] 61 3: 62 000007:[g#1,SET-h#2,SET] 63 64 # Files overlap with L0. Files ingested into L0. 65 target 66 b-c 67 d-e 68 ---- 69 0 70 0 71 72 # Files overlap with L3. Files ingested into L2. 73 target 74 g-m 75 ---- 76 2 77 78 # No overlap. Files ingested into L6. 79 target 80 i-m 81 c-c 82 ---- 83 6 84 6 85 86 define 87 L5 88 a.SET.4:4 89 L5 90 c.SET.3:3 91 L6 92 a.SET.2:2 93 L6 94 c.SET.1:1 95 ---- 96 5: 97 000004:[a#4,SET-a#4,SET] 98 000005:[c#3,SET-c#3,SET] 99 6: 100 000006:[a#2,SET-a#2,SET] 101 000007:[c#1,SET-c#1,SET] 102 103 # The ingested file slips through the gaps in both L5 and L6. 104 target 105 b-b 106 ---- 107 6 108 109 define 110 L5 111 a.SET.4:4 112 L5 113 c.SET.3:3 114 L6 115 a.SET.2:2 116 L6 117 c.SET.1:1 118 compact:a-c 119 ---- 120 5: 121 000004:[a#4,SET-a#4,SET] 122 000005:[c#3,SET-c#3,SET] 123 6: 124 000006:[a#2,SET-a#2,SET] 125 000007:[c#1,SET-c#1,SET] 126 127 # The ingested file cannot reach L6 as there is a compaction outputting a file 128 # into the range [a,c]. 129 target 130 b-b 131 ---- 132 5 133 134 define 135 L0 136 c.SET.4:4 137 d.SET.3:3 138 d.RANGEDEL.2:g 139 L2 140 a.RANGEDEL.1:g 141 ---- 142 0.0: 143 000004:[c#4,SET-g#72057594037927935,RANGEDEL] 144 2: 145 000005:[a#1,RANGEDEL-g#72057594037927935,RANGEDEL] 146 147 # Overlapping cases: 148 # - The ingested file overlaps with with [c,c]. 149 # - The rangedel over [d,g) keeps the ingested file in L0. 150 # - Ditto. 151 target 152 c-c 153 d-d 154 e-e 155 ---- 156 0 157 0 158 0 159 160 # Non-overlapping cases: 161 # - The ingested file [cc,cc] slips through L0, but is kept at L1 by the 162 # rangedel in L2. 163 # - The ingested file is to completely to right of all files. 164 # - The ingested file is to the left of all files in L0, but is kept at L1 by 165 # the rangedel in L2. 166 target 167 cc-cc 168 g-g 169 a-a 170 ---- 171 1 172 6 173 1 174 175 # A more complicated example demonstrating data overlap. 176 # |--| ingested file: [d-e] - data overlap 177 # |-| ingested file: [cc-d] - no data overlap 178 # |--| ingested file: [ee-ff] - no data overlap 179 # |*--*--*----*------*| existing file: [a-g], points: [a, b, c, dd, g] 180 # _____________________ 181 # a b c d e f g 182 define 183 L1 184 a.SET.0:a 185 b.SET.0:b 186 c.SET.0:c 187 dd.SET.0:dd 188 g.SET.0:g 189 ---- 190 1: 191 000004:[a#0,SET-g#0,SET] 192 193 # Data overlap. 194 target 195 d-e 196 ---- 197 0 198 199 # No data overlap. 200 target 201 cc-d 202 ee-ff 203 ---- 204 6 205 6