CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BlockItem Class Reference

#include <item.h>

Inheritance diagram for BlockItem:
Collaboration diagram for BlockItem:

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 ()
 
FileItemfile_item ()
 
ChunkItemchunk_item ()
 

Static Public Member Functions

static BlockItemCreateQuitBeacon ()
 
static uint64_t managed_bytes ()
 

Private Member Functions

void Discharge ()
 
- Private Member Functions inherited from SingleCopy
 SingleCopy ()
 

Private Attributes

ItemAllocatorallocator_
 
BlockType type_
 
int64_t tag_
 
FileItemfile_item_
 
ChunkItemchunk_item_
 
unsigned char * data_
 
uint32_t capacity_
 
uint32_t size_
 

Static Private Attributes

static atomic_int64 managed_bytes_ = 0
 

Detailed Description

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.

Definition at line 180 of file item.h.

Member Enumeration Documentation

Enumerator
kBlockHollow 
kBlockData 
kBlockStop 

Definition at line 182 of file item.h.

Constructor & Destructor Documentation

BlockItem::BlockItem ( ItemAllocator allocator)
explicit

Definition at line 112 of file item.cc.

Referenced by CreateQuitBeacon().

Here is the caller graph for this function:

BlockItem::BlockItem ( int64_t  tag,
ItemAllocator allocator 
)

Definition at line 124 of file item.cc.

Here is the call graph for this function:

BlockItem::~BlockItem ( )

Definition at line 138 of file item.cc.

Here is the call graph for this function:

Member Function Documentation

uint32_t BlockItem::capacity ( )
inline

Definition at line 214 of file item.h.

Referenced by MakeData(), and TaskCompress::Process().

Here is the caller graph for this function:

ChunkItem* BlockItem::chunk_item ( )
inline

Definition at line 221 of file item.h.

Referenced by TaskHash::Process(), TaskWrite::Process(), TaskCompress::Process(), and TaskScrubbingCallback::Process().

Here is the caller graph for this function:

static BlockItem* BlockItem::CreateQuitBeacon ( )
inlinestatic

Definition at line 192 of file item.h.

Here is the call graph for this function:

unsigned char* BlockItem::data ( )
inline

Definition at line 213 of file item.h.

Referenced by Xor32Detector::DoFindNextCutMark(), TaskHash::Process(), TaskWrite::Process(), TaskCompress::Process(), and TaskChunk::Process().

Here is the caller graph for this function:

void BlockItem::Discharge ( )
private

Definition at line 145 of file item.cc.

Referenced by MakeDataMove().

Here is the caller graph for this function:

FileItem* BlockItem::file_item ( )
inline

Definition at line 220 of file item.h.

Referenced by TaskCompress::Process(), TaskChunk::Process(), and TaskScrubbingCallback::Process().

Here is the caller graph for this function:

bool BlockItem::IsEmpty ( )
inline

Definition at line 210 of file item.h.

bool BlockItem::IsFull ( )
inline

Definition at line 211 of file item.h.

Referenced by TaskCompress::Process().

Here is the caller graph for this function:

bool BlockItem::IsQuitBeacon ( )
inline

Definition at line 195 of file item.h.

void BlockItem::MakeData ( uint32_t  capacity)

Definition at line 157 of file item.cc.

Referenced by TaskCompress::Process().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void BlockItem::MakeDataMove ( BlockItem other)

Move data from one block to another.

Definition at line 172 of file item.cc.

Referenced by TaskChunk::Process().

Here is the call graph for this function:

Here is the caller graph for this function:

void BlockItem::MakeStop ( )

Definition at line 151 of file item.cc.

Referenced by TaskCompress::Process(), TaskChunk::Process(), and TaskRead::Process().

Here is the call graph for this function:

Here is the caller graph for this function:

static uint64_t BlockItem::managed_bytes ( )
inlinestatic

Definition at line 222 of file item.h.

Referenced by TaskRead::Process().

Here is the caller graph for this function:

void BlockItem::Reset ( )

Definition at line 205 of file item.cc.

Referenced by TaskChunk::Process().

Here is the call graph for this function:

Here is the caller graph for this function:

void BlockItem::set_size ( uint32_t  val)
inline

Definition at line 216 of file item.h.

Referenced by TaskCompress::Process().

Here is the call graph for this function:

Here is the caller graph for this function:

void BlockItem::SetChunkItem ( ChunkItem item)

Definition at line 216 of file item.cc.

Referenced by TaskCompress::Process(), and TaskChunk::Process().

Here is the call graph for this function:

Here is the caller graph for this function:

void BlockItem::SetFileItem ( FileItem item)

Definition at line 223 of file item.cc.

Referenced by TaskCompress::Process(), TaskChunk::Process(), and TaskRead::Process().

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t BlockItem::size ( )
inline
int64_t BlockItem::tag ( )
inline

Definition at line 219 of file item.h.

Referenced by TaskCompress::Process(), and TaskChunk::Process().

Here is the caller graph for this function:

BlockType BlockItem::type ( )
inline
uint32_t BlockItem::Write ( void *  buf,
uint32_t  count 
)

Definition at line 230 of file item.cc.

Here is the call graph for this function:

Member Data Documentation

ItemAllocator* BlockItem::allocator_
private

Definition at line 233 of file item.h.

Referenced by MakeData(), MakeDataCopy(), MakeDataMove(), Reset(), and ~BlockItem().

uint32_t BlockItem::capacity_
private
ChunkItem* BlockItem::chunk_item_
private

Definition at line 248 of file item.h.

Referenced by chunk_item(), and SetChunkItem().

unsigned char* BlockItem::data_
private

Managed by ItemAllocator

Definition at line 253 of file item.h.

Referenced by data(), Discharge(), MakeData(), MakeDataCopy(), MakeDataMove(), Reset(), Write(), and ~BlockItem().

FileItem* BlockItem::file_item_
private

Can be set exactly once.

Definition at line 247 of file item.h.

Referenced by file_item(), and SetFileItem().

atomic_int64 BlockItem::managed_bytes_ = 0
staticprivate

Total capacity of all BlockItem()

Definition at line 228 of file item.h.

Referenced by MakeData(), MakeDataCopy(), managed_bytes(), Reset(), and ~BlockItem().

uint32_t BlockItem::size_
private

Definition at line 255 of file item.h.

Referenced by Discharge(), IsEmpty(), IsFull(), MakeDataCopy(), MakeDataMove(), Reset(), set_size(), size(), and Write().

int64_t BlockItem::tag_
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().

BlockType BlockItem::type_
private

Definition at line 234 of file item.h.

Referenced by IsQuitBeacon(), MakeData(), MakeDataCopy(), MakeDataMove(), MakeStop(), Reset(), type(), and Write().


The documentation for this class was generated from the following files: