aboutsummaryrefslogtreecommitdiff
path: root/zenstore/include
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-19 23:19:06 +0200
committerStefan Boberg <[email protected]>2021-09-19 23:19:06 +0200
commit3cf9dedfd08fe4d7a049e51b14a937f7a34afce3 (patch)
treed68b5203818665f6f54aceea586f550dc6aadca4 /zenstore/include
parentAdded BasicFile::StreamFile helper function to support reading large files in... (diff)
downloadzen-3cf9dedfd08fe4d7a049e51b14a937f7a34afce3.tar.xz
zen-3cf9dedfd08fe4d7a049e51b14a937f7a34afce3.zip
Implemended basic scrubbing / detection of disk corruption. Still needs more code to propagate errors and make adjustments to account for them in higher level data structures
Diffstat (limited to 'zenstore/include')
-rw-r--r--zenstore/include/zenstore/CAS.h21
1 files changed, 9 insertions, 12 deletions
diff --git a/zenstore/include/zenstore/CAS.h b/zenstore/include/zenstore/CAS.h
index c6c919593..bb310b179 100644
--- a/zenstore/include/zenstore/CAS.h
+++ b/zenstore/include/zenstore/CAS.h
@@ -37,6 +37,14 @@ public:
private:
};
+class ScrubContext
+{
+public:
+ virtual void ReportBadChunks(std::span<IoHash> BadChunks);
+
+private:
+};
+
class CasChunkSet
{
public:
@@ -54,17 +62,7 @@ class CasStore
public:
virtual ~CasStore() = default;
- struct Stats
- {
- uint64_t PutBytes = 0;
- uint64_t PutCount = 0;
-
- uint64_t GetBytes = 0;
- uint64_t GetCount = 0;
- };
-
const CasStoreConfiguration& Config() { return m_Config; }
- const Stats& GetStats() const { return m_Stats; }
struct InsertResult
{
@@ -76,11 +74,10 @@ public:
virtual IoBuffer FindChunk(const IoHash& ChunkHash) = 0;
virtual void FilterChunks(CasChunkSet& InOutChunks) = 0;
virtual void Flush() = 0;
- virtual void Scrub() = 0;
+ virtual void Scrub(ScrubContext& Ctx) = 0;
protected:
CasStoreConfiguration m_Config;
- Stats m_Stats;
};
ZENCORE_API CasStore* CreateCasStore();