Showing 2 of 2 files from the diff.

@@ -628,6 +628,15 @@
Loading
628 628
        Ok(SegmentRawIter::new(segment, self.address.scan(segment)?, read_snapshot))
629 629
    }
630 630
631 +
    pub fn scan_snapshot_index(&self, segment_id: SegmentId, snapshot: SnapshotId) -> PRes<SegmentSnapshotRawIter> {
632 +
        let res = if let Some(r) = self.snapshots.scan(snapshot, segment_id)? {
633 +
            r
634 +
        } else {
635 +
            self.address.scan(segment_id)?
636 +
        };
637 +
        Ok(SegmentSnapshotRawIter::new(segment_id, res, snapshot))
638 +
    }
639 +
631 640
    pub fn scan_snapshot(&self, segment_id: SegmentId, snapshot: SnapshotId) -> PRes<SegmentSnapshotRawIter> {
632 641
        let res = self.snapshots.scan(snapshot, segment_id)?.unwrap();
633 642
        Ok(SegmentSnapshotRawIter::new(segment_id, res, snapshot))
@@ -745,7 +754,7 @@
Loading
745 754
        K: IndexType,
746 755
        V: IndexType,
747 756
    {
748 -
        let read_snapshot = self.snapshot()?;
757 +
        let read_snapshot = self.snapshots.read_snapshot()?;
749 758
        let r = self.get_snapshot(index_id, read_snapshot, k);
750 759
        release_snapshot(read_snapshot, &self.snapshots, &self.allocator, &self.journal)?;
751 760
        r
@@ -791,7 +800,7 @@
Loading
791 800
        V: IndexType,
792 801
        R: RangeBounds<K>,
793 802
    {
794 -
        let read_snapshot = self.snapshot()?;
803 +
        let read_snapshot = self.snapshots.read_snapshot()?;
795 804
        self.range_snapshot(index_id, read_snapshot, range, true)
796 805
    }
797 806
@@ -847,6 +856,7 @@
Loading
847 856
        release_snapshot(snapshot, &self.snapshots, &self.allocator, &self.journal)?;
848 857
        res
849 858
    }
859 +
850 860
    pub fn list_indexes_snapshot(&self, snapshot: SnapshotId) -> PRes<Vec<(String, IndexInfo)>> {
851 861
        let list = self.snapshots.list(snapshot)?;
852 862
        list.into_iter()

@@ -386,7 +386,7 @@
Loading
386 386
387 387
    pub fn get_index(p: &PersyImpl, snapshot_id: SnapshotId, index_id: &IndexId) -> PRes<IndexConfig> {
388 388
        let segment_meta = index_id_to_segment_id_meta(index_id);
389 -
        p.scan_snapshot(segment_meta, snapshot_id)
389 +
        p.scan_snapshot_index(segment_meta, snapshot_id)
390 390
            .map_err(error_map)?
391 391
            .next(p)
392 392
            .map(|(_, content)| IndexConfig::deserialize(&mut Cursor::new(content)))
Files Coverage
src 92.77%
tests 98.56%
Project Totals (29 files) 93.81%
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