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

#include <quota_posix.h>

Inheritance diagram for PosixQuotaManager:
Collaboration diagram for PosixQuotaManager:

Classes

struct  EvictCandidate
 
struct  LruCommand
 

Public Member Functions

virtual ~PosixQuotaManager ()
 
virtual bool HasCapability (Capabilities capability)
 
virtual void Insert (const shash::Any &hash, const uint64_t size, const std::string &description)
 
virtual void InsertVolatile (const shash::Any &hash, const uint64_t size, const std::string &description)
 
virtual bool Pin (const shash::Any &hash, const uint64_t size, const std::string &description, const bool is_catalog)
 
virtual void Unpin (const shash::Any &hash)
 
virtual void Touch (const shash::Any &hash)
 
virtual void Remove (const shash::Any &file)
 
virtual bool Cleanup (const uint64_t leave_size)
 
virtual void RegisterBackChannel (int back_channel[2], const std::string &channel_id)
 
virtual void UnregisterBackChannel (int back_channel[2], const std::string &channel_id)
 
virtual std::vector< std::string > List ()
 
virtual std::vector< std::string > ListPinned ()
 
virtual std::vector< std::string > ListCatalogs ()
 
virtual std::vector< std::string > ListVolatile ()
 
virtual uint64_t GetMaxFileSize ()
 
virtual uint64_t GetCapacity ()
 
virtual uint64_t GetSize ()
 
virtual uint64_t GetSizePinned ()
 
virtual bool SetLimit (uint64_t limit)
 
virtual uint64_t GetCleanupRate (uint64_t period_s)
 
virtual void Spawn ()
 
virtual pid_t GetPid ()
 
virtual uint32_t GetProtocolRevision ()
 
void ManagedReadHalfPipe (int fd, void *buf, size_t nbyte)
 
void SetCacheMgrPid (pid_t pid_)
 
- Public Member Functions inherited from QuotaManager
 QuotaManager ()
 
virtual ~QuotaManager ()
 
void BroadcastBackchannels (const std::string &message)
 

Static Public Member Functions

static PosixQuotaManagerCreate (const std::string &cache_workspace, const uint64_t limit, const uint64_t cleanup_threshold, const bool rebuild_database)
 
static PosixQuotaManagerCreateShared (const std::string &exe_path, const std::string &cache_workspace, const uint64_t limit, const uint64_t cleanup_threshold, bool foreground)
 
static int MainCacheManager (int argc, char **argv)
 

Private Types

enum  FileTypes { kFileRegular = 0, kFileCatalog }
 
enum  CommandType {
  kTouch = 0, kInsert, kReserve, kPin,
  kUnpin, kRemove, kCleanup, kList,
  kListPinned, kListCatalogs, kStatus, kLimits,
  kPid, kPinRegular, kRegisterBackChannel, kUnregisterBackChannel,
  kGetProtocolRevision, kInsertVolatile, kListVolatile, kCleanupRate,
  kSetLimit
}
 

Private Member Functions

 FRIEND_TEST (T_QuotaManager, BindReturnPipe)
 
 FRIEND_TEST (T_QuotaManager, Cleanup)
 
 FRIEND_TEST (T_QuotaManager, Contains)
 
 FRIEND_TEST (T_QuotaManager, InitDatabase)
 
 FRIEND_TEST (T_QuotaManager, MakeReturnPipe)
 
bool InitDatabase (const bool rebuild_database)
 
bool RebuildDatabase ()
 
void CloseDatabase ()
 
bool Contains (const std::string &hash_str)
 
bool DoCleanup (const uint64_t leave_size)
 
bool EmptyTrash (const std::vector< std::string > &trash)
 
void MakeReturnPipe (int pipe[2])
 
int BindReturnPipe (int pipe_wronly)
 
void UnbindReturnPipe (int pipe_wronly)
 
void UnlinkReturnPipe (int pipe_wronly)
 
void CloseReturnPipe (int pipe[2])
 
void CleanupPipes ()
 
void CheckFreeSpace ()
 
void CheckHighPinWatermark ()
 
void ProcessCommandBunch (const unsigned num, const LruCommand *commands, const char *descriptions)
 
void DoInsert (const shash::Any &hash, const uint64_t size, const std::string &description, const CommandType command_type)
 
std::vector< std::string > DoList (const CommandType list_command)
 
void GetSharedStatus (uint64_t *gauge, uint64_t *pinned)
 
bool SetSharedLimit (uint64_t limit)
 
void GetLimits (uint64_t *limit, uint64_t *cleanup_threshold)
 
 PosixQuotaManager (const uint64_t limit, const uint64_t cleanup_threshold, const std::string &cache_workspace)
 

Static Private Member Functions

static void * MainCommandServer (void *data)
 
static void ParseDirectories (const std::string cache_workspace, std::string *cache_dir, std::string *workspace_dir)
 

Private Attributes

bool shared_
 
bool spawned_
 
uint64_t limit_
 
uint64_t cleanup_threshold_
 
uint64_t gauge_
 
uint64_t pinned_
 
uint64_t seq_
 
std::string cache_dir_
 
std::string workspace_dir_
 
std::map< shash::Any, uint64_t > pinned_chunks_
 
int pipe_lru_ [2]
 
pthread_t thread_lru_
 
int fd_lock_cachedb_
 
bool async_delete_
 
pid_t cachemgr_pid_
 
perf::MultiRecorder cleanup_recorder_
 
sqlite3 * database_
 
sqlite3_stmt * stmt_touch_
 
sqlite3_stmt * stmt_unpin_
 
sqlite3_stmt * stmt_block_
 
sqlite3_stmt * stmt_unblock_
 
sqlite3_stmt * stmt_new_
 
sqlite3_stmt * stmt_lru_
 
sqlite3_stmt * stmt_size_
 
sqlite3_stmt * stmt_rm_
 
sqlite3_stmt * stmt_rm_batch_
 
sqlite3_stmt * stmt_list_
 
sqlite3_stmt * stmt_list_pinned_
 
sqlite3_stmt * stmt_list_catalogs_
 
sqlite3_stmt * stmt_list_volatile_
 
bool initialized_
 

Static Private Attributes

static const unsigned kLockFileMagicNumber = 142857
 
static const unsigned kSqliteMemPerThread = 2*1024*1024
 
static const unsigned kCommandBufferSize = 32
 
static const unsigned kEvictBatchSize = 1000
 
static const unsigned kMaxDescription = 512-sizeof(LruCommand)
 
static const unsigned kHighPinWatermark = 75
 
static const uint64_t kVolatileFlag = 1ULL << 63
 

Additional Inherited Members

- Public Types inherited from QuotaManager
enum  Capabilities {
  kCapIntrospectSize = 0, kCapIntrospectCleanupRate, kCapList, kCapShrink,
  kCapListeners
}
 
- Static Public Attributes inherited from QuotaManager
static const uint32_t kProtocolRevision = 2
 
- Protected Member Functions inherited from QuotaManager
void LockBackChannels ()
 
void UnlockBackChannels ()
 
- Protected Attributes inherited from QuotaManager
std::map< shash::Md5, int > back_channels_
 
pthread_mutex_t * lock_back_channels_
 
uint32_t protocol_revision_
 

Detailed Description

Works with the PosixCacheManager. Uses an SQlite database for cache contents tracking. Tracking is asynchronously.

TODO(jblomer): split into client, server, and protocol classes.

Definition at line 35 of file quota_posix.h.

Member Enumeration Documentation

List of RPCs that can be sent to the cache manager.

Enumerator
kTouch 
kInsert 
kReserve 
kPin 
kUnpin 
kRemove 
kCleanup 
kList 
kListPinned 
kListCatalogs 
kStatus 
kLimits 
kPid 
kPinRegular 
kRegisterBackChannel 
kUnregisterBackChannel 
kGetProtocolRevision 
kInsertVolatile 
kListVolatile 
kCleanupRate 
kSetLimit 

Definition at line 104 of file quota_posix.h.

Loaded catalogs are pinned in the LRU and have to be treated differently.

Enumerator
kFileRegular 
kFileCatalog 

Definition at line 96 of file quota_posix.h.

Constructor & Destructor Documentation

PosixQuotaManager::~PosixQuotaManager ( )
virtual

Definition at line 1685 of file quota_posix.cc.

Here is the call graph for this function:

PosixQuotaManager::PosixQuotaManager ( const uint64_t  limit,
const uint64_t  cleanup_threshold,
const std::string &  cache_workspace 
)
private

Definition at line 1641 of file quota_posix.cc.

Here is the call graph for this function:

Member Function Documentation

int PosixQuotaManager::BindReturnPipe ( int  pipe_wronly)
private

Definition at line 64 of file quota_posix.cc.

Referenced by MainCommandServer().

Here is the call graph for this function:

Here is the caller graph for this function:

void PosixQuotaManager::CheckFreeSpace ( )
private

Definition at line 206 of file quota_posix.cc.

Referenced by Create(), and MainCacheManager().

Here is the call graph for this function:

Here is the caller graph for this function:

void PosixQuotaManager::CheckHighPinWatermark ( )
private

Definition at line 82 of file quota_posix.cc.

Referenced by MainCommandServer().

Here is the call graph for this function:

Here is the caller graph for this function:

bool PosixQuotaManager::Cleanup ( const uint64_t  leave_size)
virtual

Cleans up in data cache, until cache size is below leave_size. The actual unlinking is done in a separate process (fork).

Returns
True on success, false otherwise

Implements QuotaManager.

Definition at line 125 of file quota_posix.cc.

Referenced by FileSystem::SetupPosixQuotaMgr().

Here is the call graph for this function:

Here is the caller graph for this function:

void PosixQuotaManager::CleanupPipes ( )
private

Definition at line 93 of file quota_posix.cc.

Referenced by MainCacheManager().

Here is the call graph for this function:

Here is the caller graph for this function:

void PosixQuotaManager::CloseDatabase ( )
private

Definition at line 146 of file quota_posix.cc.

Referenced by MainCacheManager(), and ~PosixQuotaManager().

Here is the call graph for this function:

Here is the caller graph for this function:

void PosixQuotaManager::CloseReturnPipe ( int  pipe[2])
private

Definition at line 181 of file quota_posix.cc.

Referenced by Remove().

Here is the call graph for this function:

Here is the caller graph for this function:

bool PosixQuotaManager::Contains ( const std::string &  hash_str)
private

Definition at line 191 of file quota_posix.cc.

Referenced by ProcessCommandBunch().

Here is the call graph for this function:

Here is the caller graph for this function:

PosixQuotaManager * PosixQuotaManager::Create ( const std::string &  cache_workspace,
const uint64_t  limit,
const uint64_t  cleanup_threshold,
const bool  rebuild_database 
)
static

Definition at line 232 of file quota_posix.cc.

Referenced by FileSystem::SetupPosixQuotaMgr().

Here is the call graph for this function:

Here is the caller graph for this function:

PosixQuotaManager * PosixQuotaManager::CreateShared ( const std::string &  exe_path,
const std::string &  cache_workspace,
const uint64_t  limit,
const uint64_t  cleanup_threshold,
bool  foreground 
)
static

Connects to a running shared local quota manager. Creates one if necessary.

Definition at line 264 of file quota_posix.cc.

Referenced by FileSystem::SetupPosixQuotaMgr().

Here is the call graph for this function:

Here is the caller graph for this function:

bool PosixQuotaManager::DoCleanup ( const uint64_t  leave_size)
private

Definition at line 472 of file quota_posix.cc.

Referenced by MainCommandServer(), and ProcessCommandBunch().

Here is the call graph for this function:

Here is the caller graph for this function:

void PosixQuotaManager::DoInsert ( const shash::Any hash,
const uint64_t  size,
const std::string &  description,
const CommandType  command_type 
)
private

Definition at line 606 of file quota_posix.cc.

Here is the call graph for this function:

vector< string > PosixQuotaManager::DoList ( const CommandType  list_command)
private

Definition at line 631 of file quota_posix.cc.

Here is the call graph for this function:

bool PosixQuotaManager::EmptyTrash ( const std::vector< std::string > &  trash)
private

Definition at line 566 of file quota_posix.cc.

Here is the call graph for this function:

PosixQuotaManager::FRIEND_TEST ( T_QuotaManager  ,
BindReturnPipe   
)
private
PosixQuotaManager::FRIEND_TEST ( T_QuotaManager  ,
Cleanup   
)
private
PosixQuotaManager::FRIEND_TEST ( T_QuotaManager  ,
Contains   
)
private
PosixQuotaManager::FRIEND_TEST ( T_QuotaManager  ,
InitDatabase   
)
private
PosixQuotaManager::FRIEND_TEST ( T_QuotaManager  ,
MakeReturnPipe   
)
private
uint64_t PosixQuotaManager::GetCapacity ( )
virtual

Implements QuotaManager.

Definition at line 657 of file quota_posix.cc.

Referenced by FileSystem::SetupPosixQuotaMgr().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t PosixQuotaManager::GetCleanupRate ( uint64_t  period_s)
virtual

Implements QuotaManager.

Definition at line 793 of file quota_posix.cc.

Here is the call graph for this function:

void PosixQuotaManager::GetLimits ( uint64_t *  limit,
uint64_t *  cleanup_threshold 
)
private

Definition at line 673 of file quota_posix.cc.

Referenced by CreateShared().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t PosixQuotaManager::GetMaxFileSize ( )
virtual

Since we only cleanup until cleanup_threshold, we can only add files smaller than limit-cleanup_threshold.

Implements QuotaManager.

Definition at line 692 of file quota_posix.cc.

pid_t PosixQuotaManager::GetPid ( )
virtual

Implements QuotaManager.

Definition at line 697 of file quota_posix.cc.

Referenced by CreateShared().

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t PosixQuotaManager::GetProtocolRevision ( )
virtual

Implements QuotaManager.

Definition at line 719 of file quota_posix.cc.

Referenced by CreateShared().

Here is the call graph for this function:

Here is the caller graph for this function:

void PosixQuotaManager::GetSharedStatus ( uint64_t *  gauge,
uint64_t *  pinned 
)
private

Queries the shared local hard disk quota manager.

Definition at line 738 of file quota_posix.cc.

Here is the call graph for this function:

uint64_t PosixQuotaManager::GetSize ( )
virtual

Implements QuotaManager.

Definition at line 777 of file quota_posix.cc.

Referenced by FileSystem::SetupPosixQuotaMgr().

Here is the caller graph for this function:

uint64_t PosixQuotaManager::GetSizePinned ( )
virtual

Implements QuotaManager.

Definition at line 785 of file quota_posix.cc.

virtual bool PosixQuotaManager::HasCapability ( Capabilities  capability)
inlinevirtual

Implements QuotaManager.

Definition at line 55 of file quota_posix.h.

bool PosixQuotaManager::InitDatabase ( const bool  rebuild_database)
private

Definition at line 811 of file quota_posix.cc.

Referenced by Create(), and MainCacheManager().

Here is the call graph for this function:

Here is the caller graph for this function:

void PosixQuotaManager::Insert ( const shash::Any hash,
const uint64_t  size,
const std::string &  description 
)
virtual

Inserts a new file into cache catalog. This file gets a new, highest sequence number. Does cache cleanup if necessary.

Implements QuotaManager.

Definition at line 1001 of file quota_posix.cc.

void PosixQuotaManager::InsertVolatile ( const shash::Any hash,
const uint64_t  size,
const std::string &  description 
)
virtual

Inserts a new file into cache catalog. This file is marked as volatile and gets a new highest sequence number with the first bit set. Cache cleanup treats these files with priority.

Implements QuotaManager.

Definition at line 1015 of file quota_posix.cc.

vector< string > PosixQuotaManager::List ( )
virtual

Lists all path names from the cache db.

Implements QuotaManager.

Definition at line 1027 of file quota_posix.cc.

vector< string > PosixQuotaManager::ListCatalogs ( )
virtual

Lists all sqlite catalog files from the cache db.

Implements QuotaManager.

Definition at line 1043 of file quota_posix.cc.

vector< string > PosixQuotaManager::ListPinned ( )
virtual

Lists all pinned files from the cache db.

Implements QuotaManager.

Definition at line 1035 of file quota_posix.cc.

vector< string > PosixQuotaManager::ListVolatile ( )
virtual

Lists only files flagged as volatile (priority removal)

Implements QuotaManager.

Definition at line 1051 of file quota_posix.cc.

int PosixQuotaManager::MainCacheManager ( int  argc,
char **  argv 
)
static

Entry point for the shared cache manager process

Definition at line 1059 of file quota_posix.cc.

Referenced by AltProcessFlavor().

Here is the call graph for this function:

Here is the caller graph for this function:

void * PosixQuotaManager::MainCommandServer ( void *  data)
staticprivate

Definition at line 1194 of file quota_posix.cc.

Referenced by MainCacheManager(), and Spawn().

Here is the call graph for this function:

Here is the caller graph for this function:

void PosixQuotaManager::MakeReturnPipe ( int  pipe[2])
private

Definition at line 1524 of file quota_posix.cc.

Referenced by RegisterBackChannel(), and Remove().

Here is the call graph for this function:

Here is the caller graph for this function:

void PosixQuotaManager::ManagedReadHalfPipe ( int  fd,
void *  buf,
size_t  nbyte 
)

Definition at line 2052 of file quota_posix.cc.

Referenced by RegisterBackChannel(), and Remove().

Here is the call graph for this function:

Here is the caller graph for this function:

void PosixQuotaManager::ParseDirectories ( const std::string  cache_workspace,
std::string *  cache_dir,
std::string *  workspace_dir 
)
staticprivate

Definition at line 1548 of file quota_posix.cc.

Referenced by PosixQuotaManager().

Here is the call graph for this function:

Here is the caller graph for this function:

bool PosixQuotaManager::Pin ( const shash::Any hash,
const uint64_t  size,
const std::string &  description,
const bool  is_catalog 
)
virtual

Immediately inserts a new pinned catalog. Does cache cleanup if necessary.

Returns
True on success, false otherwise

Implements QuotaManager.

Definition at line 1573 of file quota_posix.cc.

Here is the call graph for this function:

void PosixQuotaManager::ProcessCommandBunch ( const unsigned  num,
const LruCommand commands,
const char *  descriptions 
)
private

Definition at line 1707 of file quota_posix.cc.

Referenced by MainCommandServer().

Here is the call graph for this function:

Here is the caller graph for this function:

bool PosixQuotaManager::RebuildDatabase ( )
private

Definition at line 1804 of file quota_posix.cc.

Here is the call graph for this function:

void PosixQuotaManager::RegisterBackChannel ( int  back_channel[2],
const std::string &  channel_id 
)
virtual

Register a channel that allows the cache manager to trigger action to its clients. Currently used for releasing pinned catalogs.

Implements QuotaManager.

Definition at line 1933 of file quota_posix.cc.

Here is the call graph for this function:

void PosixQuotaManager::Remove ( const shash::Any hash)
virtual

Removes a chunk from cache, if it exists.

Implements QuotaManager.

Definition at line 1965 of file quota_posix.cc.

Here is the call graph for this function:

void PosixQuotaManager::SetCacheMgrPid ( pid_t  pid_)
inline

Definition at line 89 of file quota_posix.h.

Referenced by CreateShared().

Here is the caller graph for this function:

bool PosixQuotaManager::SetLimit ( uint64_t  limit)
virtual

Implements QuotaManager.

Definition at line 767 of file quota_posix.cc.

Here is the call graph for this function:

bool PosixQuotaManager::SetSharedLimit ( uint64_t  limit)
private

Definition at line 751 of file quota_posix.cc.

Here is the call graph for this function:

void PosixQuotaManager::Spawn ( )
virtual

Implements QuotaManager.

Definition at line 1985 of file quota_posix.cc.

Here is the call graph for this function:

void PosixQuotaManager::Touch ( const shash::Any hash)
virtual

Updates the sequence number of the file specified by the hash.

Implements QuotaManager.

Definition at line 2002 of file quota_posix.cc.

Here is the call graph for this function:

void PosixQuotaManager::UnbindReturnPipe ( int  pipe_wronly)
private

Definition at line 2010 of file quota_posix.cc.

Referenced by MainCommandServer().

Here is the caller graph for this function:

void PosixQuotaManager::UnlinkReturnPipe ( int  pipe_wronly)
private

Definition at line 2016 of file quota_posix.cc.

Referenced by MainCommandServer().

Here is the call graph for this function:

Here is the caller graph for this function:

void PosixQuotaManager::Unpin ( const shash::Any hash)
virtual

Implements QuotaManager.

Definition at line 2022 of file quota_posix.cc.

Here is the call graph for this function:

void PosixQuotaManager::UnregisterBackChannel ( int  back_channel[2],
const std::string &  channel_id 
)
virtual

Implements QuotaManager.

Definition at line 2032 of file quota_posix.cc.

Here is the call graph for this function:

Member Data Documentation

bool PosixQuotaManager::async_delete_
private

If this is true, the unlink operations that correspond to a cleanup run will be performed in a detached, asynchronous process.

Definition at line 341 of file quota_posix.h.

std::string PosixQuotaManager::cache_dir_
private

Should match the directory given to the cache manager.

Definition at line 308 of file quota_posix.h.

Referenced by MainCacheManager(), MainCommandServer(), PosixQuotaManager(), RebuildDatabase(), and Remove().

pid_t PosixQuotaManager::cachemgr_pid_
private

Record pid of current cache manager in order to check if its process disappeared.

Definition at line 348 of file quota_posix.h.

Referenced by ManagedReadHalfPipe(), and SetCacheMgrPid().

perf::MultiRecorder PosixQuotaManager::cleanup_recorder_
private

Keeps track of the number of cleanups over time. Use by cvmfs_talk cleanup rate

Definition at line 354 of file quota_posix.h.

Referenced by MainCommandServer(), and PosixQuotaManager().

uint64_t PosixQuotaManager::cleanup_threshold_
private

Cleanup until cleanup_threshold_ are left in the cache.

Definition at line 287 of file quota_posix.h.

Referenced by CreateShared(), MainCacheManager(), MainCommandServer(), and ProcessCommandBunch().

sqlite3* PosixQuotaManager::database_
private

Definition at line 356 of file quota_posix.h.

Referenced by ProcessCommandBunch(), and RebuildDatabase().

int PosixQuotaManager::fd_lock_cachedb_
private

Ensures exclusive cache database access through POSIX file lock.

Definition at line 335 of file quota_posix.h.

uint64_t PosixQuotaManager::gauge_
private

Current size of cache.

Definition at line 292 of file quota_posix.h.

Referenced by MainCommandServer(), ProcessCommandBunch(), and RebuildDatabase().

bool PosixQuotaManager::initialized_
private

Used in the destructor to steer closing of the database and so on.

Definition at line 374 of file quota_posix.h.

Referenced by Create(), CreateShared(), and ~PosixQuotaManager().

const unsigned PosixQuotaManager::kCommandBufferSize = 32
staticprivate

Collect a number of insert and touch operations before processing them as sqlite commands.

Definition at line 207 of file quota_posix.h.

const unsigned PosixQuotaManager::kEvictBatchSize = 1000
staticprivate

Batch size for database operations during DoCleanup()

Definition at line 212 of file quota_posix.h.

const unsigned PosixQuotaManager::kHighPinWatermark = 75
staticprivate

Alarm when more than 75% of the cache fraction allowed for pinned files (50%) is filled with pinned files

Definition at line 224 of file quota_posix.h.

const unsigned PosixQuotaManager::kLockFileMagicNumber = 142857
staticprivate

Magic number to make reading PIDs from lockfiles more robust and versionable

Definition at line 196 of file quota_posix.h.

Referenced by CreateShared().

const unsigned PosixQuotaManager::kMaxDescription = 512-sizeof(LruCommand)
staticprivate

Make sure that the amount of data transferred through the RPC pipe is within the OS's guarantees for atomicity.

Definition at line 218 of file quota_posix.h.

Referenced by ProcessCommandBunch().

const unsigned PosixQuotaManager::kSqliteMemPerThread = 2*1024*1024
staticprivate

Maximum page cache per thread (Bytes).

Definition at line 201 of file quota_posix.h.

Referenced by MainCommandServer().

const uint64_t PosixQuotaManager::kVolatileFlag = 1ULL << 63
staticprivate

The last bit in the sequence number indicates if an entry is volatile. Such sequence numbers are negative and they are preferred during cleanup. Volatile entries are used for instance for ALICE conditions data.

Definition at line 231 of file quota_posix.h.

Referenced by ProcessCommandBunch().

uint64_t PosixQuotaManager::limit_
private

Soft limit in bytes, start cleanup when reached.

Definition at line 282 of file quota_posix.h.

Referenced by CreateShared(), MainCacheManager(), MainCommandServer(), and ProcessCommandBunch().

uint64_t PosixQuotaManager::pinned_
private

Size of pinned files in bytes (usually file catalogs).

Definition at line 297 of file quota_posix.h.

Referenced by MainCacheManager(), and MainCommandServer().

std::map<shash::Any, uint64_t> PosixQuotaManager::pinned_chunks_
private

Pinned content hashes and their size.

Definition at line 320 of file quota_posix.h.

Referenced by MainCommandServer().

int PosixQuotaManager::pipe_lru_[2]
private

Used to send RPCs to the quota manager thread or process.

Definition at line 325 of file quota_posix.h.

Referenced by Create(), CreateShared(), MainCacheManager(), MainCommandServer(), PosixQuotaManager(), RegisterBackChannel(), Remove(), Touch(), Unpin(), UnregisterBackChannel(), and ~PosixQuotaManager().

uint64_t PosixQuotaManager::seq_
private

Current access sequence number. Gets increased on every access/insert operation.

Definition at line 303 of file quota_posix.h.

Referenced by ProcessCommandBunch(), and RebuildDatabase().

bool PosixQuotaManager::shared_
private

Indicates if the cache manager is a shared process or a thread within the same process (exclusive cache manager)

Definition at line 271 of file quota_posix.h.

Referenced by CreateShared(), MainCacheManager(), UnbindReturnPipe(), UnlinkReturnPipe(), and ~PosixQuotaManager().

bool PosixQuotaManager::spawned_
private

True once the program switches into multi-threaded mode or the quota manager process has been forked resp.

Definition at line 277 of file quota_posix.h.

Referenced by CreateShared(), MainCacheManager(), Spawn(), and ~PosixQuotaManager().

sqlite3_stmt* PosixQuotaManager::stmt_block_
private

Definition at line 359 of file quota_posix.h.

sqlite3_stmt* PosixQuotaManager::stmt_list_
private

Definition at line 366 of file quota_posix.h.

Referenced by MainCommandServer().

sqlite3_stmt* PosixQuotaManager::stmt_list_catalogs_
private

Definition at line 368 of file quota_posix.h.

Referenced by MainCommandServer().

sqlite3_stmt* PosixQuotaManager::stmt_list_pinned_
private

Loaded catalogs are pinned.

Definition at line 367 of file quota_posix.h.

Referenced by MainCommandServer().

sqlite3_stmt* PosixQuotaManager::stmt_list_volatile_
private

Definition at line 369 of file quota_posix.h.

Referenced by MainCommandServer().

sqlite3_stmt* PosixQuotaManager::stmt_lru_
private

Definition at line 362 of file quota_posix.h.

sqlite3_stmt* PosixQuotaManager::stmt_new_
private

Definition at line 361 of file quota_posix.h.

Referenced by ProcessCommandBunch().

sqlite3_stmt* PosixQuotaManager::stmt_rm_
private

Definition at line 364 of file quota_posix.h.

Referenced by MainCommandServer().

sqlite3_stmt* PosixQuotaManager::stmt_rm_batch_
private

Definition at line 365 of file quota_posix.h.

sqlite3_stmt* PosixQuotaManager::stmt_size_
private

Definition at line 363 of file quota_posix.h.

Referenced by MainCommandServer().

sqlite3_stmt* PosixQuotaManager::stmt_touch_
private

Definition at line 357 of file quota_posix.h.

Referenced by ProcessCommandBunch().

sqlite3_stmt* PosixQuotaManager::stmt_unblock_
private

Definition at line 360 of file quota_posix.h.

sqlite3_stmt* PosixQuotaManager::stmt_unpin_
private

Definition at line 358 of file quota_posix.h.

Referenced by ProcessCommandBunch().

pthread_t PosixQuotaManager::thread_lru_
private

In exclusive mode, controls the quota manager thread.

Definition at line 330 of file quota_posix.h.

Referenced by Spawn(), and ~PosixQuotaManager().

std::string PosixQuotaManager::workspace_dir_
private

Directory for the database lock (shared manager) and the pipes (also shared manager). Usually the same as cache_dir_. Can be different if CVMFS_WORKSPACE or CVMFS_CACHE_WORKSPACE is set.

Definition at line 315 of file quota_posix.h.

Referenced by MainCacheManager(), PosixQuotaManager(), and UnlinkReturnPipe().


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