CernVM-FS
2.12.0
|
#include <item.h>
Public Types | |
enum | BlockType { kBlockHollow, kBlockData, kBlockStop } |
Public Member Functions | |
BlockItem (ItemAllocator *allocator) | |
BlockItem (int64_t tag, ItemAllocator *allocator) | |
~BlockItem () | |
bool | IsQuitBeacon () |
void | MakeStop () |
void | MakeData (uint32_t capacity) |
void | MakeDataMove (BlockItem *other) |
void | MakeDataCopy (const unsigned char *data, uint32_t size) |
void | SetFileItem (FileItem *item) |
void | SetChunkItem (ChunkItem *item) |
void | Reset () |
uint32_t | Write (void *buf, uint32_t count) |
bool | IsEmpty () |
bool | IsFull () |
unsigned char * | data () |
uint32_t | capacity () |
uint32_t | size () |
void | set_size (uint32_t val) |
BlockType | type () |
int64_t | tag () |
FileItem * | file_item () |
ChunkItem * | chunk_item () |
Static Public Member Functions | |
static BlockItem * | CreateQuitBeacon () |
static uint64_t | managed_bytes () |
Private Member Functions | |
void | Discharge () |
Private Member Functions inherited from SingleCopy | |
SingleCopy () | |
Private Attributes | |
ItemAllocator * | allocator_ |
BlockType | type_ |
int64_t | tag_ |
FileItem * | file_item_ |
ChunkItem * | chunk_item_ |
unsigned char * | data_ |
uint32_t | capacity_ |
uint32_t | size_ |
Static Private Attributes | |
static atomic_int64 | managed_bytes_ = 0 |
A block is an item of work in the pipeline. A sequence of data blocks followed by a stop block constitutes a Chunk. A sequence of Chunks in turn build constitute a file. A block that carries data must have a non-zero-length payload.
enum BlockItem::BlockType |
|
explicit |
Definition at line 112 of file item.cc.
Referenced by CreateQuitBeacon().
BlockItem::BlockItem | ( | int64_t | tag, |
ItemAllocator * | allocator | ||
) |
BlockItem::~BlockItem | ( | ) |
|
inline |
Definition at line 214 of file item.h.
Referenced by MakeData(), and TaskCompress::Process().
|
inline |
Definition at line 221 of file item.h.
Referenced by TaskHash::Process(), TaskWrite::Process(), TaskCompress::Process(), and TaskScrubbingCallback::Process().
|
inlinestatic |
|
inline |
Definition at line 213 of file item.h.
Referenced by Xor32Detector::DoFindNextCutMark(), TaskHash::Process(), TaskWrite::Process(), TaskCompress::Process(), and TaskChunk::Process().
|
private |
Definition at line 145 of file item.cc.
Referenced by MakeDataMove().
|
inline |
Definition at line 220 of file item.h.
Referenced by TaskCompress::Process(), TaskChunk::Process(), and TaskScrubbingCallback::Process().
|
inline |
Definition at line 211 of file item.h.
Referenced by TaskCompress::Process().
void BlockItem::MakeData | ( | uint32_t | capacity | ) |
Definition at line 157 of file item.cc.
Referenced by TaskCompress::Process().
void BlockItem::MakeDataCopy | ( | const unsigned char * | data, |
uint32_t | size | ||
) |
Copy a piece of one block's data into a new block.
Definition at line 189 of file item.cc.
Referenced by TaskChunk::Process(), and TaskRead::Process().
void BlockItem::MakeDataMove | ( | BlockItem * | other | ) |
Move data from one block to another.
Definition at line 172 of file item.cc.
Referenced by TaskChunk::Process().
void BlockItem::MakeStop | ( | ) |
Definition at line 151 of file item.cc.
Referenced by TaskCompress::Process(), TaskChunk::Process(), and TaskRead::Process().
|
inlinestatic |
Definition at line 222 of file item.h.
Referenced by TaskRead::Process().
void BlockItem::Reset | ( | ) |
Definition at line 205 of file item.cc.
Referenced by TaskChunk::Process().
|
inline |
Definition at line 216 of file item.h.
Referenced by TaskCompress::Process().
void BlockItem::SetChunkItem | ( | ChunkItem * | item | ) |
Definition at line 216 of file item.cc.
Referenced by TaskCompress::Process(), and TaskChunk::Process().
void BlockItem::SetFileItem | ( | FileItem * | item | ) |
Definition at line 223 of file item.cc.
Referenced by TaskCompress::Process(), TaskChunk::Process(), and TaskRead::Process().
|
inline |
Definition at line 215 of file item.h.
Referenced by StaticOffsetDetector::DoFindNextCutMark(), Xor32Detector::DoFindNextCutMark(), ChunkDetector::FindNextCutMark(), MakeDataCopy(), TaskHash::Process(), TaskWrite::Process(), TaskCompress::Process(), and TaskChunk::Process().
|
inline |
Definition at line 219 of file item.h.
Referenced by TaskCompress::Process(), and TaskChunk::Process().
|
inline |
Definition at line 218 of file item.h.
Referenced by StaticOffsetDetector::DoFindNextCutMark(), TaskHash::Process(), TaskWrite::Process(), TaskCompress::Process(), TaskChunk::Process(), and TaskScrubbingCallback::Process().
uint32_t BlockItem::Write | ( | void * | buf, |
uint32_t | count | ||
) |
|
private |
Definition at line 233 of file item.h.
Referenced by MakeData(), MakeDataCopy(), MakeDataMove(), Reset(), and ~BlockItem().
|
private |
Definition at line 254 of file item.h.
Referenced by capacity(), Discharge(), IsFull(), MakeData(), MakeDataCopy(), MakeDataMove(), Reset(), set_size(), Write(), and ~BlockItem().
|
private |
Definition at line 248 of file item.h.
Referenced by chunk_item(), and SetChunkItem().
|
private |
Managed by ItemAllocator
Definition at line 253 of file item.h.
Referenced by data(), Discharge(), MakeData(), MakeDataCopy(), MakeDataMove(), Reset(), Write(), and ~BlockItem().
|
private |
Can be set exactly once.
Definition at line 247 of file item.h.
Referenced by file_item(), and SetFileItem().
|
staticprivate |
Total capacity of all BlockItem()
Definition at line 228 of file item.h.
Referenced by MakeData(), MakeDataCopy(), managed_bytes(), Reset(), and ~BlockItem().
|
private |
Definition at line 255 of file item.h.
Referenced by Discharge(), IsEmpty(), IsFull(), MakeDataCopy(), MakeDataMove(), Reset(), set_size(), size(), and Write().
|
private |
Blocks with the same tag need to be processed sequentially. That is, no two threads of the same pipeline stage must operate on blocks of the same tag. The tags roughly correspond to chunks. Tags can (and should) be set exactly once in the life time of a block.
Definition at line 242 of file item.h.
Referenced by BlockItem(), and tag().
|
private |
Definition at line 234 of file item.h.
Referenced by IsQuitBeacon(), MakeData(), MakeDataCopy(), MakeDataMove(), MakeStop(), Reset(), type(), and Write().