CernVM-FS
2.12.0
|
#include <chunk_detector.h>
Public Member Functions | |
Xor32Detector (const uint64_t minimal_chunk_size, const uint64_t average_chunk_size, const uint64_t maximal_chunk_size) | |
bool | MightFindChunks (const uint64_t size) const |
Public Member Functions inherited from ChunkDetector | |
ChunkDetector () | |
virtual | ~ChunkDetector () |
uint64_t | FindNextCutMark (BlockItem *block) |
Protected Member Functions | |
virtual uint64_t | DoFindNextCutMark (BlockItem *buffer) |
virtual uint64_t | DoCut (const uint64_t offset) |
virtual uint64_t | NoCut (const uint64_t offset) |
void | xor32 (const unsigned char byte) |
bool | CheckThreshold () |
Protected Member Functions inherited from ChunkDetector | |
uint64_t | last_cut () const |
uint64_t | offset () const |
Private Member Functions | |
FRIEND_TEST (T_ChunkDetectors, Xor32) | |
Private Attributes | |
const uint64_t | minimal_chunk_size_ |
const uint64_t | average_chunk_size_ |
const uint64_t | maximal_chunk_size_ |
const int32_t | threshold_ |
uint64_t | xor32_ptr_ |
uint32_t | xor32_ |
Static Private Attributes | |
static const unsigned | kXor32Window = 32 |
static const int32_t | kMagicNumber |
The xor32 rolling used in Igor-FS [1].
It takes a byte stream and constantly computes a 32-bit checksum in a way that the result is only dependent on the last read 32 bytes of the stream. Given random input data, the checksum eventually produces each number in the 32-bit value range with roughly the same probability. We exploit that by constantly checking the rolling checksum result for a specific interval. Thus, we detect characteristic 32-byte long patches in a file that do not depend on their actual position inside the data stream. Thereby local modifications of a file might not affect global chunk creation.
[1] "The Decentralized File System Igor-FS as an Application for Overlay-Networks" Dissertation of Dipl.-Ing. Kendy Kutzner (2008)
Definition at line 90 of file chunk_detector.h.
Xor32Detector::Xor32Detector | ( | const uint64_t | minimal_chunk_size, |
const uint64_t | average_chunk_size, | ||
const uint64_t | maximal_chunk_size | ||
) |
|
inlineprotected |
Definition at line 120 of file chunk_detector.h.
Referenced by DoFindNextCutMark().
|
inlineprotectedvirtual |
When returning from an implemented FindNextCutMark call you must call this function when a cut mark has been found. Like: return DoCut(found_offset)
Reimplemented from ChunkDetector.
Definition at line 105 of file chunk_detector.h.
Referenced by DoFindNextCutMark().
|
protectedvirtual |
Implements ChunkDetector.
Definition at line 73 of file chunk_detector.cc.
|
private |
|
inlinevirtual |
Implements ChunkDetector.
Definition at line 98 of file chunk_detector.h.
Referenced by TaskRead::Process().
|
inlineprotectedvirtual |
Same as DoCut() but if no cut mark has been found in the given buffer in FindNextCutMark()
Reimplemented from ChunkDetector.
Definition at line 111 of file chunk_detector.h.
Referenced by DoFindNextCutMark().
|
inlineprotected |
Definition at line 116 of file chunk_detector.h.
Referenced by DoFindNextCutMark().
|
private |
Definition at line 130 of file chunk_detector.h.
Referenced by Xor32Detector().
|
staticprivate |
Definition at line 127 of file chunk_detector.h.
Referenced by CheckThreshold().
|
staticprivate |
Definition at line 126 of file chunk_detector.h.
Referenced by DoFindNextCutMark(), and Xor32Detector().
|
private |
Definition at line 131 of file chunk_detector.h.
Referenced by DoFindNextCutMark(), and Xor32Detector().
|
private |
Definition at line 129 of file chunk_detector.h.
Referenced by DoFindNextCutMark(), MightFindChunks(), and Xor32Detector().
|
private |
Definition at line 132 of file chunk_detector.h.
Referenced by CheckThreshold().
|
private |
Definition at line 135 of file chunk_detector.h.
Referenced by CheckThreshold(), DoCut(), and xor32().
|
private |
Definition at line 134 of file chunk_detector.h.
Referenced by DoCut(), DoFindNextCutMark(), and NoCut().