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

#include <item.h>

Inheritance diagram for FileItem:
Collaboration diagram for FileItem:

Public Member Functions

 FileItem (IngestionSource *source, uint64_t min_chunk_size=4 *1024 *1024, uint64_t avg_chunk_size=8 *1024 *1024, uint64_t max_chunk_size=16 *1024 *1024, zlib::Algorithms compression_algorithm=zlib::kZlibDefault, shash::Algorithms hash_algorithm=shash::kSha1, shash::Suffix hash_suffix=shash::kSuffixNone, bool may_have_chunks=true, bool has_legacy_bulk_chunk=false)
 
 ~FileItem ()
 
bool IsQuitBeacon ()
 
std::string path ()
 
uint64_t size ()
 
Xor32Detectorchunk_detector ()
 
shash::Any bulk_hash ()
 
zlib::Algorithms compression_algorithm ()
 
shash::Algorithms hash_algorithm ()
 
shash::Suffix hash_suffix ()
 
bool may_have_chunks ()
 
bool has_legacy_bulk_chunk ()
 
void set_size (uint64_t val)
 
void set_may_have_chunks (bool val)
 
void set_is_fully_chunked ()
 
bool is_fully_chunked ()
 
uint64_t nchunks_in_fly ()
 
uint64_t GetNumChunks ()
 
FileChunkListGetChunksPtr ()
 
bool Open ()
 
ssize_t Read (void *buffer, size_t nbyte)
 
bool Close ()
 
bool GetSize (uint64_t *size)
 
void IncNchunksInFly ()
 
void RegisterChunk (const FileChunk &file_chunk)
 
bool IsProcessed ()
 

Static Public Member Functions

static FileItemCreateQuitBeacon ()
 

Private Attributes

UniquePtr< IngestionSourcesource_
 
const zlib::Algorithms compression_algorithm_
 
const shash::Algorithms hash_algorithm_
 
const shash::Suffix hash_suffix_
 
const bool has_legacy_bulk_chunk_
 
uint64_t size_
 
bool may_have_chunks_
 
Xor32Detector chunk_detector_
 
shash::Any bulk_hash_
 
FileChunkList chunks_
 
atomic_int64 nchunks_in_fly_
 
atomic_int32 is_fully_chunked_
 
pthread_mutex_t lock_
 

Static Private Attributes

static const uint64_t kSizeUnknown = uint64_t(-1)
 
static const char kQuitBeaconMarker = '\0'
 

Additional Inherited Members

- Private Member Functions inherited from SingleCopy
 SingleCopy ()
 

Detailed Description

Carries the information necessary to compress and checksum a file. During processing, the bulk chunk and the chunks_ vector are filled.

Definition at line 34 of file item.h.

Constructor & Destructor Documentation

FileItem::FileItem ( IngestionSource source,
uint64_t  min_chunk_size = 4 * 1024 * 1024,
uint64_t  avg_chunk_size = 8 * 1024 * 1024,
uint64_t  max_chunk_size = 16 * 1024 * 1024,
zlib::Algorithms  compression_algorithm = zlib::kZlibDefault,
shash::Algorithms  hash_algorithm = shash::kSha1,
shash::Suffix  hash_suffix = shash::kSuffixNone,
bool  may_have_chunks = true,
bool  has_legacy_bulk_chunk = false 
)
explicit

This file is part of the CernVM File System.

Definition at line 17 of file item.cc.

Referenced by CreateQuitBeacon().

Here is the call graph for this function:

Here is the caller graph for this function:

FileItem::~FileItem ( )

Definition at line 44 of file item.cc.

Member Function Documentation

shash::Any FileItem::bulk_hash ( )
inline

Definition at line 60 of file item.h.

Referenced by TaskRegister::Process().

Here is the caller graph for this function:

Xor32Detector* FileItem::chunk_detector ( )
inline

Definition at line 59 of file item.h.

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

Here is the caller graph for this function:

bool FileItem::Close ( )
inline

Definition at line 80 of file item.h.

Referenced by TaskRead::Process().

Here is the caller graph for this function:

zlib::Algorithms FileItem::compression_algorithm ( )
inline

Definition at line 61 of file item.h.

Referenced by ChunkItem::GetCompressor(), and TaskRegister::Process().

Here is the caller graph for this function:

static FileItem* FileItem::CreateQuitBeacon ( )
inlinestatic

Definition at line 48 of file item.h.

Here is the call graph for this function:

FileChunkList* FileItem::GetChunksPtr ( )
inline

Definition at line 74 of file item.h.

Referenced by TaskRegister::Process().

Here is the caller graph for this function:

uint64_t FileItem::GetNumChunks ( )
inline

Definition at line 73 of file item.h.

Referenced by TaskRegister::Process().

Here is the call graph for this function:

Here is the caller graph for this function:

bool FileItem::GetSize ( uint64_t *  size)
inline

Definition at line 81 of file item.h.

Referenced by TaskRead::Process().

Here is the caller graph for this function:

bool FileItem::has_legacy_bulk_chunk ( )
inline

Definition at line 65 of file item.h.

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

Here is the caller graph for this function:

shash::Algorithms FileItem::hash_algorithm ( )
inline

Definition at line 62 of file item.h.

Referenced by ChunkItem::ChunkItem(), and TaskRegister::Process().

Here is the caller graph for this function:

shash::Suffix FileItem::hash_suffix ( )
inline

Definition at line 63 of file item.h.

Referenced by ChunkItem::MakeBulkChunk(), and TaskRegister::Process().

Here is the caller graph for this function:

void FileItem::IncNchunksInFly ( )
inline

Definition at line 84 of file item.h.

Referenced by ChunkItem::ChunkItem().

Here is the caller graph for this function:

bool FileItem::is_fully_chunked ( )
inline

Definition at line 70 of file item.h.

Referenced by IsProcessed().

Here is the caller graph for this function:

bool FileItem::IsProcessed ( )
inline

Definition at line 86 of file item.h.

Referenced by TaskWrite::OnChunkComplete().

Here is the call graph for this function:

Here is the caller graph for this function:

bool FileItem::IsQuitBeacon ( )
inline

Definition at line 53 of file item.h.

Here is the call graph for this function:

bool FileItem::may_have_chunks ( )
inline

Definition at line 64 of file item.h.

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

Here is the caller graph for this function:

uint64_t FileItem::nchunks_in_fly ( )
inline

Definition at line 71 of file item.h.

Referenced by TaskRegister::Process().

Here is the caller graph for this function:

bool FileItem::Open ( )
inline

Definition at line 76 of file item.h.

Referenced by TaskRead::Process().

Here is the caller graph for this function:

std::string FileItem::path ( )
inline

Definition at line 57 of file item.h.

Referenced by IsQuitBeacon(), TaskRegister::Process(), TaskRead::Process(), and TaskScrubbingCallback::Process().

Here is the caller graph for this function:

ssize_t FileItem::Read ( void *  buffer,
size_t  nbyte 
)
inline

Definition at line 77 of file item.h.

Referenced by TaskRead::Process().

Here is the caller graph for this function:

void FileItem::RegisterChunk ( const FileChunk file_chunk)

Definition at line 48 of file item.cc.

Referenced by TaskWrite::OnChunkComplete().

Here is the call graph for this function:

Here is the caller graph for this function:

void FileItem::set_is_fully_chunked ( )
inline

Definition at line 69 of file item.h.

Referenced by TaskChunk::Process().

Here is the caller graph for this function:

void FileItem::set_may_have_chunks ( bool  val)
inline

Definition at line 68 of file item.h.

Referenced by TaskRead::Process().

Here is the caller graph for this function:

void FileItem::set_size ( uint64_t  val)
inline

Definition at line 67 of file item.h.

Referenced by TaskRead::Process().

Here is the caller graph for this function:

uint64_t FileItem::size ( )
inline

Definition at line 58 of file item.h.

Referenced by ChunkItem::IsSolePiece(), TaskChunk::Process(), and TaskRead::Process().

Here is the caller graph for this function:

Member Data Documentation

shash::Any FileItem::bulk_hash_
private

Definition at line 104 of file item.h.

Referenced by bulk_hash(), and RegisterChunk().

Xor32Detector FileItem::chunk_detector_
private

Definition at line 103 of file item.h.

Referenced by chunk_detector().

FileChunkList FileItem::chunks_
private

Definition at line 105 of file item.h.

Referenced by GetChunksPtr(), GetNumChunks(), and RegisterChunk().

const zlib::Algorithms FileItem::compression_algorithm_
private

Definition at line 95 of file item.h.

Referenced by compression_algorithm().

const bool FileItem::has_legacy_bulk_chunk_
private

Definition at line 98 of file item.h.

Referenced by has_legacy_bulk_chunk().

const shash::Algorithms FileItem::hash_algorithm_
private

Definition at line 96 of file item.h.

Referenced by hash_algorithm().

const shash::Suffix FileItem::hash_suffix_
private

Definition at line 97 of file item.h.

Referenced by hash_suffix().

atomic_int32 FileItem::is_fully_chunked_
private

Switches to true once all of the file has been through the chunking stage

Definition at line 114 of file item.h.

Referenced by FileItem(), is_fully_chunked(), and set_is_fully_chunked().

const char FileItem::kQuitBeaconMarker = '\0'
staticprivate

Definition at line 92 of file item.h.

Referenced by CreateQuitBeacon(), and IsQuitBeacon().

const uint64_t FileItem::kSizeUnknown = uint64_t(-1)
staticprivate

Definition at line 91 of file item.h.

pthread_mutex_t FileItem::lock_
private

Definition at line 115 of file item.h.

Referenced by FileItem(), RegisterChunk(), and ~FileItem().

bool FileItem::may_have_chunks_
private

Definition at line 101 of file item.h.

Referenced by may_have_chunks(), and set_may_have_chunks().

atomic_int64 FileItem::nchunks_in_fly_
private

Number of chunks created but not yet uploaded and registered

Definition at line 109 of file item.h.

Referenced by FileItem(), IncNchunksInFly(), IsProcessed(), nchunks_in_fly(), and RegisterChunk().

uint64_t FileItem::size_
private

Definition at line 100 of file item.h.

Referenced by RegisterChunk(), set_size(), and size().

UniquePtr<IngestionSource> FileItem::source_
private

Definition at line 94 of file item.h.

Referenced by Close(), GetSize(), Open(), path(), and Read().


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