Skip to content

Commit

Permalink
Fixed reporting of repackable size for .zip datasets. refs: #279
Browse files Browse the repository at this point in the history
  • Loading branch information
spanezz committed Nov 19, 2021
1 parent c040085 commit 588f466
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arki/segment/dir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ struct CheckBackend : public AppendCheckBackend

size_t actual_end(off_t offset, size_t size) const override { return offset + 1; }
size_t offset_end() const override { return scanner.max_sequence + 1; }
size_t compute_unindexed_space(const std::vector<Span> indexed_spans) const
size_t compute_unindexed_space(const std::vector<Span> indexed_spans) const override
{
// When this is called, all elements found in the index have already
// been removed from scanner. We can just then add up what's left of
Expand Down
10 changes: 10 additions & 0 deletions arki/segment/zip.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ struct CheckBackend : public AppendCheckBackend
size_t actual_start(off_t offset, size_t size) const override { return offset - 1; }
size_t actual_end(off_t offset, size_t size) const override { return offset; }
size_t offset_end() const override { return max_sequence; }
size_t compute_unindexed_space(const std::vector<Span> indexed_spans) const override
{
// When this is called, all elements found in the index have already
// been removed from scanner. We can just then add up what's left of
// sizes in scanner
size_t res = 0;
for (const auto& i: on_disk)
res += i.second;
return res;
}

State check_source(const types::source::Blob& source) override
{
Expand Down

0 comments on commit 588f466

Please sign in to comment.