github.com/zuoyebang/bitalostable@v1.0.1-0.20240229032404-e3b99a834294/sstable/testdata/reader/iter (about) 1 build 2 a.SET.1:A 3 b.SET.2:B 4 c.SET.3:C 5 d.SET.4:D 6 ---- 7 8 iter 9 first 10 next 11 next 12 next 13 next 14 ---- 15 <a:1> 16 <b:2> 17 <c:3> 18 <d:4> 19 . 20 21 iter 22 seek-ge a 23 next 24 next 25 next 26 next 27 ---- 28 <a:1> 29 <b:2> 30 <c:3> 31 <d:4> 32 . 33 34 iter 35 seek-ge b 36 next 37 next 38 next 39 ---- 40 <b:2> 41 <c:3> 42 <d:4> 43 . 44 45 iter 46 seek-ge c 47 next 48 next 49 ---- 50 <c:3> 51 <d:4> 52 . 53 54 iter 55 seek-ge d 56 next 57 ---- 58 <d:4> 59 . 60 61 iter 62 seek-ge e 63 ---- 64 . 65 66 iter 67 seek-ge d 68 seek-ge z 69 ---- 70 <d:4> 71 . 72 73 iter 74 seek-ge b 75 seek-ge c 76 seek-ge d 77 seek-ge e 78 ---- 79 <b:2> 80 <c:3> 81 <d:4> 82 . 83 84 iter 85 last 86 prev 87 prev 88 prev 89 prev 90 ---- 91 <d:4> 92 <c:3> 93 <b:2> 94 <a:1> 95 . 96 97 iter 98 seek-lt e 99 prev 100 prev 101 prev 102 prev 103 ---- 104 <d:4> 105 <c:3> 106 <b:2> 107 <a:1> 108 . 109 110 iter 111 seek-lt d 112 prev 113 prev 114 prev 115 ---- 116 <c:3> 117 <b:2> 118 <a:1> 119 . 120 121 iter 122 seek-lt c 123 prev 124 prev 125 ---- 126 <b:2> 127 <a:1> 128 . 129 130 iter 131 seek-lt b 132 prev 133 ---- 134 <a:1> 135 . 136 137 iter 138 seek-lt a 139 ---- 140 . 141 142 iter 143 seek-lt d 144 seek-lt c 145 seek-lt b 146 seek-lt a 147 ---- 148 <c:3> 149 <b:2> 150 <a:1> 151 . 152 153 iter globalSeqNum=1 154 first 155 next 156 next 157 next 158 next 159 ---- 160 <a:1> 161 <b:1> 162 <c:1> 163 <d:1> 164 . 165 166 iter globalSeqNum=10 167 first 168 next 169 next 170 next 171 next 172 ---- 173 <a:10> 174 <b:10> 175 <c:10> 176 <d:10> 177 . 178 179 iter globalSeqNum=0 180 seek-lt x 181 ---- 182 <d:4> 183 184 get 185 b 186 a 187 f 188 d 189 c 190 ---- 191 B 192 A 193 <err: bitalostable: not found> 194 D 195 C 196 197 # Verify that clearing the bounds on an iterator also clears 198 # previously set block{Lower,Upper}. 199 200 iter 201 seek-ge c 202 seek-lt b 203 set-bounds lower=b upper=c 204 seek-ge c 205 seek-lt b 206 set-bounds lower= upper= 207 seek-ge c 208 seek-lt b 209 ---- 210 <c:3> 211 <a:1> 212 . 213 . 214 . 215 . 216 <c:3> 217 <a:1> 218 219 # Verify that seeking past the end of the sstable leaves the iterator 220 # in a state where prev returns the last key in the table. 221 222 iter 223 seek-lt d 224 seek-ge f 225 prev 226 ---- 227 <c:3> 228 . 229 <d:4> 230 231 # Verify that seeking before the beginning of the sstable leaves the 232 # iterator in a state where next returns the first key in the table. 233 234 iter 235 seek-ge b 236 seek-lt a 237 next 238 ---- 239 <b:2> 240 . 241 <a:1> 242 243 244 # Verify the optimization to use next when doing SeekGE. 245 246 iter 247 seek-ge a false 248 seek-ge a true 249 seek-ge b true 250 seek-ge c true 251 seek-ge d true 252 seek-ge e true 253 ---- 254 <a:1> 255 <a:1> 256 <b:2> 257 <c:3> 258 <d:4> 259 . 260 261 # Verify the optimization to use next when doing SeekPrefixGE. 262 263 iter 264 seek-prefix-ge a false 265 seek-prefix-ge a true 266 seek-prefix-ge b true 267 seek-prefix-ge c true 268 seek-prefix-ge d true 269 seek-prefix-ge e true 270 ---- 271 <a:1> 272 <a:1> 273 <b:2> 274 <c:3> 275 <d:4> 276 . 277 278 # Verify that iteration from before the beginning or after the end of 279 # the sstable does not "wrap around". A bug previously allowed this to 280 # happen by letting the data block iterator and index iterator get out 281 # of sync. 282 283 build 284 a.SET.1:a 285 ---- 286 287 iter 288 first 289 prev 290 next 291 next 292 next 293 ---- 294 <a:1> 295 . 296 <a:1> 297 . 298 . 299 300 iter 301 last 302 next 303 prev 304 prev 305 prev 306 ---- 307 <a:1> 308 . 309 <a:1> 310 . 311 . 312 313 # Build a sufficiently large SST to enable two-level indexes. 314 315 build 316 a.SET.1:A 317 aae.SET.1:E 318 aaf.SET.1:F 319 aag.SET.1:G 320 aah.SET.1:H 321 aai.SET.1:I 322 aaj.SET.1:J 323 aak.SET.1:K 324 aal.SET.1:L 325 aam.SET.1:M 326 aan.SET.1:N 327 aao.SET.1:O 328 aap.SET.1:P 329 aaq.SET.1:Q 330 aar.SET.1:R 331 aas.SET.1:S 332 aat.SET.1:T 333 aau.SET.1:U 334 aav.SET.1:V 335 aaw.SET.1:W 336 aax.SET.1:X 337 aay.SET.1:Y 338 aaz.SET.1:Z 339 b.SET.2:B 340 bbe.SET.2:E 341 bbf.SET.2:F 342 bbg.SET.2:G 343 bbh.SET.2:H 344 bbi.SET.2:I 345 bbj.SET.2:J 346 bbk.SET.2:K 347 bbl.SET.2:L 348 bbm.SET.2:M 349 bbn.SET.2:N 350 bbo.SET.2:O 351 bbp.SET.2:P 352 bbq.SET.2:Q 353 bbr.SET.2:R 354 bbs.SET.2:S 355 bbt.SET.2:T 356 bbu.SET.2:U 357 bbv.SET.2:V 358 bbw.SET.2:W 359 bbx.SET.2:X 360 bby.SET.2:Y 361 bbz.SET.2:Z 362 c.SET.3:C 363 cc.RANGEDEL.3:ccc 364 cce.SET.3:E 365 ccf.SET.3:F 366 ccg.SET.3:G 367 cch.SET.3:H 368 cci.SET.3:I 369 ccj.SET.3:J 370 cck.SET.3:K 371 ccl.SET.3:L 372 ccm.SET.3:M 373 ccn.SET.3:N 374 cco.SET.3:O 375 ccp.SET.3:P 376 ccq.SET.3:Q 377 ccr.SET.3:R 378 ccs.SET.3:S 379 cct.SET.3:T 380 ccu.SET.3:U 381 ccv.SET.3:V 382 ccw.SET.3:W 383 ccx.SET.3:X 384 ccy.SET.3:Y 385 ccz.SET.3:Z 386 d.SET.4:D 387 dd.RANGEDEL.4:ddd 388 dde.SET.4:E 389 ddf.SET.4:F 390 ddg.SET.4:G 391 ddh.SET.4:H 392 ddi.SET.4:I 393 ddj.SET.4:J 394 ddk.SET.4:K 395 ddl.SET.4:L 396 ddm.SET.4:M 397 ddn.SET.4:N 398 ddo.SET.4:O 399 ddp.SET.4:P 400 ddq.SET.4:Q 401 ddr.SET.4:R 402 dds.SET.4:S 403 ddt.SET.4:T 404 ddu.SET.4:U 405 ddv.SET.4:V 406 ddw.SET.4:W 407 ddx.SET.4:X 408 ddy.SET.4:Y 409 ddz.SET.4:Z 410 ---- 411 412 iter 413 first 414 prev 415 next 416 next 417 next 418 next 419 next 420 ---- 421 <a:1> 422 . 423 <a:1> 424 <aae:1> 425 <aaf:1> 426 <aag:1> 427 <aah:1> 428 429 iter 430 last 431 next 432 prev 433 prev 434 prev 435 ---- 436 <ddz:4> 437 . 438 <ddz:4> 439 <ddy:4> 440 <ddx:4> 441 442 iter 443 first 444 prev 445 next 446 next 447 seek-ge x 448 prev 449 prev 450 ---- 451 <a:1> 452 . 453 <a:1> 454 <aae:1> 455 . 456 <ddz:4> 457 <ddy:4> 458 459 iter 460 first 461 prev 462 next 463 next 464 seek-prefix-ge x 465 prev 466 prev 467 ---- 468 <a:1> 469 . 470 <a:1> 471 <aae:1> 472 . 473 . 474 . 475 476 iter 477 last 478 next 479 prev 480 prev 481 seek-lt a 482 next 483 next 484 ---- 485 <ddz:4> 486 . 487 <ddz:4> 488 <ddy:4> 489 . 490 <a:1> 491 <aae:1> 492 493 # Test that SeekPrefixGE does not position the iterator far outside the iterator bounds. 494 # Doing so would break the subsequent SeekGE that is utilizing the next instead of seek 495 # optimization. 496 iter 497 set-bounds lower=a upper=aae 498 seek-ge a 499 seek-prefix-ge aad 500 set-bounds lower=aae upper=b 501 seek-ge aae 502 next 503 ---- 504 . 505 <a:1> 506 . 507 . 508 <aae:1> 509 <aaf:1> 510 511 # Test that using Next does not mislead a twoLevelIterator into believing that the 512 # iterator has been positioned based on the latest iterator bounds. The Next call 513 # immediately after SetBounds has a non-deterministic result, hence we use 514 # next-ignore-result. 515 iter 516 set-bounds lower=bbq upper=d 517 seek-ge bbq 518 set-bounds lower=b upper=bbf 519 next-ignore-result 520 set-bounds lower=bbf upper=c 521 seek-ge bbf 522 next 523 ---- 524 . 525 <bbq:2> 526 . 527 . 528 . 529 <bbf:2> 530 <bbg:2>