Showing 1 of 1 files from the diff.

@@ -8,7 +8,10 @@
Loading
8 8
    discref::{Page, PageOps, ReadPage, PAGE_METADATA_SIZE},
9 9
    error::PRes,
10 10
    flush_checksum::{double_buffer_check, prepare_buffer_flush},
11 -
    io::{read_u64, write_u64, InfallibleRead, InfallibleReadFormat, InfallibleWrite, InfallibleWriteFormat},
11 +
    io::{
12 +
        read_u64, write_u64, InfallibleRead, InfallibleReadFormat, InfallibleReadVarInt, InfallibleWrite,
13 +
        InfallibleWriteFormat, InfallibleWriteVarInt,
14 +
    },
12 15
    persy::RecoverStatus,
13 16
};
14 17
use std::{
@@ -393,18 +396,18 @@
Loading
393 396
    }
394 397
395 398
    fn write(&self, buffer: &mut dyn InfallibleWrite) -> PRes<()> {
396 -
        buffer.write_u32(self.segment);
397 -
        buffer.write_u64(self.recref.page);
398 -
        buffer.write_u32(self.recref.pos);
399 -
        buffer.write_u16(self.version);
399 +
        buffer.write_varint_u32(self.segment);
400 +
        buffer.write_varint_u64(self.recref.page);
401 +
        buffer.write_varint_u32(self.recref.pos);
402 +
        buffer.write_varint_u16(self.version);
400 403
        Ok(())
401 404
    }
402 405
403 406
    fn read(&mut self, buffer: &mut dyn InfallibleRead) -> PRes<()> {
404 -
        self.segment = buffer.read_u32();
405 -
        self.recref.page = buffer.read_u64();
406 -
        self.recref.pos = buffer.read_u32();
407 -
        self.version = buffer.read_u16();
407 +
        self.segment = buffer.read_varint_u32();
408 +
        self.recref.page = buffer.read_varint_u64();
409 +
        self.recref.pos = buffer.read_varint_u32();
410 +
        self.version = buffer.read_varint_u16();
408 411
        Ok(())
409 412
    }
410 413
@@ -420,18 +423,18 @@
Loading
420 423
    }
421 424
422 425
    fn write(&self, buffer: &mut dyn InfallibleWrite) -> PRes<()> {
423 -
        buffer.write_u32(self.segment);
424 -
        buffer.write_u64(self.recref.page);
425 -
        buffer.write_u32(self.recref.pos);
426 -
        buffer.write_u16(self.version);
426 +
        buffer.write_varint_u32(self.segment);
427 +
        buffer.write_varint_u64(self.recref.page);
428 +
        buffer.write_varint_u32(self.recref.pos);
429 +
        buffer.write_varint_u16(self.version);
427 430
        Ok(())
428 431
    }
429 432
430 433
    fn read(&mut self, buffer: &mut dyn InfallibleRead) -> PRes<()> {
431 -
        self.segment = buffer.read_u32();
432 -
        self.recref.page = buffer.read_u64();
433 -
        self.recref.pos = buffer.read_u32();
434 -
        self.version = buffer.read_u16();
434 +
        self.segment = buffer.read_varint_u32();
435 +
        self.recref.page = buffer.read_varint_u64();
436 +
        self.recref.pos = buffer.read_varint_u32();
437 +
        self.version = buffer.read_varint_u16();
435 438
        Ok(())
436 439
    }
437 440
@@ -446,20 +449,20 @@
Loading
446 449
    }
447 450
448 451
    fn write(&self, buffer: &mut dyn InfallibleWrite) -> PRes<()> {
449 -
        buffer.write_u32(self.segment);
450 -
        buffer.write_u64(self.recref.page);
451 -
        buffer.write_u32(self.recref.pos);
452 -
        buffer.write_u64(self.record_page);
453 -
        buffer.write_u16(self.version);
452 +
        buffer.write_varint_u32(self.segment);
453 +
        buffer.write_varint_u64(self.recref.page);
454 +
        buffer.write_varint_u32(self.recref.pos);
455 +
        buffer.write_varint_u64(self.record_page);
456 +
        buffer.write_varint_u16(self.version);
454 457
        Ok(())
455 458
    }
456 459
457 460
    fn read(&mut self, buffer: &mut dyn InfallibleRead) -> PRes<()> {
458 -
        self.segment = buffer.read_u32();
459 -
        self.recref.page = buffer.read_u64();
460 -
        self.recref.pos = buffer.read_u32();
461 -
        self.record_page = buffer.read_u64();
462 -
        self.version = buffer.read_u16();
461 +
        self.segment = buffer.read_varint_u32();
462 +
        self.recref.page = buffer.read_varint_u64();
463 +
        self.recref.pos = buffer.read_varint_u32();
464 +
        self.record_page = buffer.read_varint_u64();
465 +
        self.version = buffer.read_varint_u16();
463 466
        Ok(())
464 467
    }
465 468
@@ -475,18 +478,18 @@
Loading
475 478
    }
476 479
477 480
    fn write(&self, buffer: &mut dyn InfallibleWrite) -> PRes<()> {
478 -
        buffer.write_u32(self.segment);
479 -
        buffer.write_u64(self.recref.page);
480 -
        buffer.write_u32(self.recref.pos);
481 -
        buffer.write_u64(self.record_page);
481 +
        buffer.write_varint_u32(self.segment);
482 +
        buffer.write_varint_u64(self.recref.page);
483 +
        buffer.write_varint_u32(self.recref.pos);
484 +
        buffer.write_varint_u64(self.record_page);
482 485
        Ok(())
483 486
    }
484 487
485 488
    fn read(&mut self, buffer: &mut dyn InfallibleRead) -> PRes<()> {
486 -
        self.segment = buffer.read_u32();
487 -
        self.recref.page = buffer.read_u64();
488 -
        self.recref.pos = buffer.read_u32();
489 -
        self.record_page = buffer.read_u64();
489 +
        self.segment = buffer.read_varint_u32();
490 +
        self.recref.page = buffer.read_varint_u64();
491 +
        self.recref.pos = buffer.read_varint_u32();
492 +
        self.record_page = buffer.read_varint_u64();
490 493
        Ok(())
491 494
    }
492 495
@@ -556,16 +559,16 @@
Loading
556 559
    }
557 560
558 561
    fn write(&self, write: &mut dyn InfallibleWrite) -> PRes<()> {
559 -
        write.write_u8(self.strategy.value());
562 +
        write.write_varint_u8(self.strategy.value());
560 563
        let len = self.meta_id.len();
561 -
        write.write_u16(len as u16);
564 +
        write.write_varint_u16(len as u16);
562 565
        write.write_all(&self.meta_id);
563 566
        Ok(())
564 567
    }
565 568
566 569
    fn read(&mut self, read: &mut dyn InfallibleRead) -> PRes<()> {
567 -
        self.strategy = TxStrategy::from_value(read.read_u8());
568 -
        let len = read.read_u16();
570 +
        self.strategy = TxStrategy::from_value(read.read_varint_u8());
571 +
        let len = read.read_varint_u16();
569 572
        let mut slice: Vec<u8> = vec![0; len as usize];
570 573
        read.read_exact(&mut slice[0..len as usize]);
571 574
        self.meta_id = slice;
@@ -619,17 +622,17 @@
Loading
619 622
    }
620 623
621 624
    fn write(&self, buffer: &mut dyn InfallibleWrite) -> PRes<()> {
622 -
        buffer.write_u32(self.segment_id);
623 -
        buffer.write_u64(self.first_page);
624 -
        buffer.write_u16(self.name.len() as u16);
625 +
        buffer.write_varint_u32(self.segment_id);
626 +
        buffer.write_varint_u64(self.first_page);
627 +
        buffer.write_varint_u16(self.name.len() as u16);
625 628
        buffer.write_all(self.name.as_bytes());
626 629
        Ok(())
627 630
    }
628 631
629 632
    fn read(&mut self, buffer: &mut dyn InfallibleRead) -> PRes<()> {
630 -
        self.segment_id = buffer.read_u32();
631 -
        self.first_page = buffer.read_u64();
632 -
        let string_size = buffer.read_u16();
633 +
        self.segment_id = buffer.read_varint_u32();
634 +
        self.first_page = buffer.read_varint_u64();
635 +
        let string_size = buffer.read_varint_u16();
633 636
        let mut slice: Vec<u8> = vec![0; string_size as usize];
634 637
        buffer.read_exact(&mut slice[0..string_size as usize]);
635 638
        self.name = str::from_utf8(&slice[0..string_size as usize])?.into();
@@ -648,15 +651,15 @@
Loading
648 651
    }
649 652
650 653
    fn write(&self, buffer: &mut dyn InfallibleWrite) -> PRes<()> {
651 -
        buffer.write_u32(self.segment_id);
652 -
        buffer.write_u16(self.name.len() as u16);
654 +
        buffer.write_varint_u32(self.segment_id);
655 +
        buffer.write_varint_u16(self.name.len() as u16);
653 656
        buffer.write_all(self.name.as_bytes());
654 657
        Ok(())
655 658
    }
656 659
657 660
    fn read(&mut self, buffer: &mut dyn InfallibleRead) -> PRes<()> {
658 -
        self.segment_id = buffer.read_u32();
659 -
        let string_size = buffer.read_u16();
661 +
        self.segment_id = buffer.read_varint_u32();
662 +
        let string_size = buffer.read_varint_u16();
660 663
        let mut slice: Vec<u8> = vec![0; string_size as usize];
661 664
        buffer.read_exact(&mut slice[0..string_size as usize]);
662 665
        self.name = str::from_utf8(&slice[0..string_size as usize])?.into();
@@ -696,16 +699,16 @@
Loading
696 699
    }
697 700
698 701
    fn write(&self, buffer: &mut dyn InfallibleWrite) -> PRes<()> {
699 -
        buffer.write_u32(self.segment);
700 -
        buffer.write_u64(self.page);
701 -
        buffer.write_u64(self.previous);
702 +
        buffer.write_varint_u32(self.segment);
703 +
        buffer.write_varint_u64(self.page);
704 +
        buffer.write_varint_u64(self.previous);
702 705
        Ok(())
703 706
    }
704 707
705 708
    fn read(&mut self, buffer: &mut dyn InfallibleRead) -> PRes<()> {
706 -
        self.segment = buffer.read_u32();
707 -
        self.page = buffer.read_u64();
708 -
        self.previous = buffer.read_u64();
709 +
        self.segment = buffer.read_varint_u32();
710 +
        self.page = buffer.read_varint_u64();
711 +
        self.previous = buffer.read_varint_u64();
709 712
        Ok(())
710 713
    }
711 714
Files Coverage
src 93.15%
tests 98.56%
Project Totals (29 files) 94.14%
1
coverage:
2
  status:
3
    project:
4
      default:
5
        target: 80%
6
        threshold: 1.0%
7
    patch: off
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading