aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/chunking.h
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-02-12 09:02:35 +0100
committerGitHub Enterprise <[email protected]>2025-02-12 09:02:35 +0100
commitda9179d330a37132488f6deb8d8068783b087256 (patch)
tree3309dfe685495bab7f18068f7c0d1dbd76a4b536 /src/zenstore/chunking.h
parentimproved builds api interface in jupiter (#281) (diff)
downloadzen-da9179d330a37132488f6deb8d8068783b087256.tar.xz
zen-da9179d330a37132488f6deb8d8068783b087256.zip
moving and small refactor of chunk blocks to prepare for builds api (#282)
Diffstat (limited to 'src/zenstore/chunking.h')
-rw-r--r--src/zenstore/chunking.h56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/zenstore/chunking.h b/src/zenstore/chunking.h
deleted file mode 100644
index 09c56454f..000000000
--- a/src/zenstore/chunking.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-
-#pragma once
-#include <zencore/zencore.h>
-
-namespace zen {
-
-/** Content-defined chunking helper
- */
-class ZenChunkHelper
-{
-public:
- void SetChunkSize(size_t MinSize, size_t MaxSize, size_t AvgSize);
- size_t ScanChunk(const void* DataBytes, size_t ByteCount);
- void Reset();
-
- // This controls which chunking approach is used - threshold or
- // modulo based. Threshold is faster and generates similarly sized
- // chunks
- void SetUseThreshold(bool NewState) { m_UseThreshold = NewState; }
-
- inline size_t ChunkSizeMin() const { return m_ChunkSizeMin; }
- inline size_t ChunkSizeMax() const { return m_ChunkSizeMax; }
- inline size_t ChunkSizeAvg() const { return m_ChunkSizeAvg; }
- inline uint64_t BytesScanned() const { return m_BytesScanned; }
-
- static constexpr size_t kNoBoundaryFound = size_t(~0ull);
-
-private:
- size_t m_ChunkSizeMin = 0;
- size_t m_ChunkSizeMax = 0;
- size_t m_ChunkSizeAvg = 0;
-
- uint32_t m_Discriminator = 0; // Computed in SetChunkSize()
- uint32_t m_Threshold = 0; // Computed in SetChunkSize()
-
- bool m_UseThreshold = true;
-
- static constexpr size_t kChunkSizeLimitMax = 64 * 1024 * 1024;
- static constexpr size_t kChunkSizeLimitMin = 1024;
- static constexpr size_t kDefaultAverageChunkSize = 64 * 1024;
-
- static constexpr int kWindowSize = 48;
- uint8_t m_Window[kWindowSize];
- uint32_t m_WindowSize = 0;
-
- uint32_t m_CurrentHash = 0;
- uint32_t m_CurrentChunkSize = 0;
-
- uint64_t m_BytesScanned = 0;
-
- size_t InternalScanChunk(const void* DataBytes, size_t ByteCount);
- void InternalReset();
-};
-
-} // namespace zen