CernVM-FS
2.12.0
|
#include <channel.h>
Classes | |
struct | Info |
struct | ObjectInfo |
class | SessionCtxGuard |
struct | SessionInfo |
struct | UniqueRequest |
Public Member Functions | |
bool | Listen (const std::string &locator) |
virtual | ~CachePlugin () |
void | ProcessRequests (unsigned num_workers) |
bool | IsRunning () |
void | Terminate () |
void | WaitFor () |
void | AskToDetach () |
unsigned | max_object_size () const |
uint64_t | capabilities () const |
Static Public Attributes | |
static const unsigned | kPbProtocolVersion = 1 |
static const uint64_t | kSizeUnknown = uint64_t(-1) |
Protected Member Functions | |
CachePlugin (uint64_t capabilities) | |
virtual cvmfs::EnumStatus | ChangeRefcount (const shash::Any &id, int32_t change_by)=0 |
virtual cvmfs::EnumStatus | GetObjectInfo (const shash::Any &id, ObjectInfo *info)=0 |
virtual cvmfs::EnumStatus | Pread (const shash::Any &id, uint64_t offset, uint32_t *size, unsigned char *buffer)=0 |
virtual cvmfs::EnumStatus | StartTxn (const shash::Any &id, const uint64_t txn_id, const ObjectInfo &info)=0 |
virtual cvmfs::EnumStatus | WriteTxn (const uint64_t txn_id, unsigned char *buffer, uint32_t size)=0 |
virtual cvmfs::EnumStatus | AbortTxn (const uint64_t txn_id)=0 |
virtual cvmfs::EnumStatus | CommitTxn (const uint64_t txn_id)=0 |
virtual cvmfs::EnumStatus | GetInfo (Info *info)=0 |
virtual cvmfs::EnumStatus | Shrink (uint64_t shrink_to, uint64_t *used_bytes)=0 |
virtual cvmfs::EnumStatus | ListingBegin (uint64_t lst_id, cvmfs::EnumObjectType type)=0 |
virtual cvmfs::EnumStatus | ListingNext (int64_t lst_id, ObjectInfo *item)=0 |
virtual cvmfs::EnumStatus | ListingEnd (int64_t lst_id)=0 |
virtual cvmfs::EnumStatus | LoadBreadcrumb (const std::string &fqrn, manifest::Breadcrumb *breadcrumb)=0 |
virtual cvmfs::EnumStatus | StoreBreadcrumb (const std::string &fqrn, const manifest::Breadcrumb &breadcrumb)=0 |
Private Member Functions | |
uint64_t | NextSessionId () |
uint64_t | NextTxnId () |
uint64_t | NextLstId () |
bool | HandleRequest (int fd_con) |
void | HandleHandshake (cvmfs::MsgHandshake *msg_req, CacheTransport *transport) |
void | HandleRefcount (cvmfs::MsgRefcountReq *msg_req, CacheTransport *transport) |
void | HandleObjectInfo (cvmfs::MsgObjectInfoReq *msg_req, CacheTransport *transport) |
void | HandleRead (cvmfs::MsgReadReq *msg_req, CacheTransport *transport) |
void | HandleStore (cvmfs::MsgStoreReq *msg_req, CacheTransport::Frame *frame, CacheTransport *transport) |
void | HandleStoreAbort (cvmfs::MsgStoreAbortReq *msg_req, CacheTransport *transport) |
void | HandleInfo (cvmfs::MsgInfoReq *msg_req, CacheTransport *transport) |
void | HandleShrink (cvmfs::MsgShrinkReq *msg_req, CacheTransport *transport) |
void | HandleList (cvmfs::MsgListReq *msg_req, CacheTransport *transport) |
void | HandleBreadcrumbStore (cvmfs::MsgBreadcrumbStoreReq *msg_req, CacheTransport *transport) |
void | HandleBreadcrumbLoad (cvmfs::MsgBreadcrumbLoadReq *msg_req, CacheTransport *transport) |
void | HandleIoctl (cvmfs::MsgIoctl *msg_req) |
void | SendDetachRequests () |
void | NotifySupervisor (char signal) |
void | LogSessionError (uint64_t session_id, cvmfs::EnumStatus status, const std::string &msg) |
void | LogSessionInfo (uint64_t session_id, const std::string &msg) |
Static Private Member Functions | |
static void * | MainProcessRequests (void *data) |
static uint32_t | HashUniqueRequest (const UniqueRequest &req) |
Private Attributes | |
bool | is_local_ |
uint64_t | capabilities_ |
int | fd_socket_ |
int | fd_socket_lock_ |
atomic_int32 | running_ |
unsigned | num_workers_ |
unsigned | max_object_size_ |
uint64_t | num_inlimbo_clients_ |
std::string | name_ |
atomic_int64 | next_session_id_ |
atomic_int64 | next_txn_id_ |
atomic_int64 | next_lst_id_ |
SmallHashDynamic < UniqueRequest, uint64_t > | txn_ids_ |
std::set< int > | connections_ |
std::map< uint64_t, SessionInfo > | sessions_ |
pthread_t | thread_io_ |
int | pipe_ctrl_ [2] |
Static Private Attributes | |
static const unsigned | kDefaultMaxObjectSize = 256 * 1024 |
static const unsigned | kListingSize = 4 * 1024 * 1024 |
static const char | kSignalTerminate = 'q' |
static const char | kSignalDetach = 'd' |
|
virtual |
|
explicitprotected |
|
protectedpure virtual |
Implemented in anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin.
Referenced by HandleStoreAbort().
void CachePlugin::AskToDetach | ( | ) |
|
protectedpure virtual |
Implemented in anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin.
Referenced by HandleRefcount().
|
protectedpure virtual |
Implemented in anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin.
Referenced by HandleStore().
|
protectedpure virtual |
Implemented in anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin.
Referenced by HandleInfo().
|
protectedpure virtual |
Implemented in anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin.
Referenced by HandleObjectInfo().
|
private |
Definition at line 231 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 200 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 259 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 285 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 309 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 327 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 383 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 414 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 453 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 480 of file channel.cc.
Referenced by MainProcessRequests().
|
private |
Definition at line 561 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 610 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 581 of file channel.cc.
Referenced by HandleRequest().
|
inlinestaticprivate |
Definition at line 213 of file channel.h.
Referenced by CachePlugin().
bool CachePlugin::IsRunning | ( | ) |
Definition at line 696 of file channel.cc.
Referenced by Terminate(), and WaitFor().
bool CachePlugin::Listen | ( | const std::string & | locator | ) |
|
protectedpure virtual |
Implemented in anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin.
Referenced by HandleList().
|
protectedpure virtual |
Implemented in anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin.
Referenced by HandleList().
|
protectedpure virtual |
Implemented in anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin.
Referenced by HandleList().
|
protectedpure virtual |
Implemented in anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin.
Referenced by HandleBreadcrumbLoad().
|
private |
Definition at line 769 of file channel.cc.
Referenced by HandleBreadcrumbStore(), HandleInfo(), HandleIoctl(), HandleList(), HandleObjectInfo(), HandleRead(), HandleRefcount(), HandleShrink(), HandleStore(), and HandleStoreAbort().
|
private |
Definition at line 758 of file channel.cc.
Referenced by HandleIoctl().
|
staticprivate |
Definition at line 786 of file channel.cc.
Referenced by ProcessRequests().
|
inlineprivate |
Definition at line 210 of file channel.h.
Referenced by HandleList().
|
inlineprivate |
Definition at line 204 of file channel.h.
Referenced by HandleHandshake().
|
inlineprivate |
Definition at line 207 of file channel.h.
Referenced by HandleStore().
|
private |
Used during startup to synchronize with the cvmfs client.
Definition at line 888 of file channel.cc.
Referenced by Listen(), and ProcessRequests().
|
protectedpure virtual |
Implemented in anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin.
Referenced by HandleRead().
void CachePlugin::ProcessRequests | ( | unsigned | num_workers | ) |
|
private |
Definition at line 906 of file channel.cc.
Referenced by MainProcessRequests().
|
protectedpure virtual |
Implemented in anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin.
Referenced by HandleShrink().
|
protectedpure virtual |
Implemented in anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin.
Referenced by HandleStore().
|
protectedpure virtual |
Implemented in anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin.
Referenced by HandleBreadcrumbStore().
void CachePlugin::Terminate | ( | ) |
Definition at line 920 of file channel.cc.
Referenced by ~CachePlugin().
void CachePlugin::WaitFor | ( | ) |
|
protectedpure virtual |
Implemented in anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin.
Referenced by HandleStore().
|
private |
Definition at line 249 of file channel.h.
Referenced by capabilities(), and HandleHandshake().
|
private |
Definition at line 265 of file channel.h.
Referenced by MainProcessRequests(), and SendDetachRequests().
|
private |
Definition at line 250 of file channel.h.
Referenced by Listen(), MainProcessRequests(), and ~CachePlugin().
|
private |
Definition at line 251 of file channel.h.
Referenced by Listen(), and ~CachePlugin().
|
private |
Definition at line 248 of file channel.h.
Referenced by HandleHandshake(), and Listen().
|
staticprivate |
|
staticprivate |
Definition at line 141 of file channel.h.
Referenced by HandleList().
|
static |
Definition at line 70 of file channel.h.
Referenced by HandleHandshake().
|
staticprivate |
Definition at line 143 of file channel.h.
Referenced by AskToDetach(), and MainProcessRequests().
|
staticprivate |
Definition at line 142 of file channel.h.
Referenced by Terminate().
|
static |
Definition at line 71 of file channel.h.
Referenced by anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin::GetObjectInfo().
|
private |
Definition at line 254 of file channel.h.
Referenced by HandleHandshake(), HandleRead(), HandleRequest(), HandleStore(), and max_object_size().
|
private |
Definition at line 260 of file channel.h.
Referenced by HandleHandshake().
|
private |
Definition at line 263 of file channel.h.
Referenced by CachePlugin(), and NextLstId().
|
private |
Definition at line 261 of file channel.h.
Referenced by CachePlugin(), and NextSessionId().
|
private |
Definition at line 262 of file channel.h.
Referenced by CachePlugin(), and NextTxnId().
|
private |
Number of clients undergoing a reload, i.e. they promise to come back and open a new connection soon.
Definition at line 259 of file channel.h.
Referenced by HandleIoctl(), and MainProcessRequests().
|
private |
Definition at line 253 of file channel.h.
Referenced by ProcessRequests().
|
private |
Definition at line 268 of file channel.h.
Referenced by AskToDetach(), CachePlugin(), MainProcessRequests(), Terminate(), and ~CachePlugin().
|
private |
Definition at line 252 of file channel.h.
Referenced by IsRunning(), ProcessRequests(), and Terminate().
|
private |
Definition at line 266 of file channel.h.
Referenced by HandleHandshake(), HandleRequest(), LogSessionError(), LogSessionInfo(), and CachePlugin::SessionCtxGuard::SessionCtxGuard().
|
private |
Definition at line 267 of file channel.h.
Referenced by CachePlugin(), ProcessRequests(), Terminate(), and WaitFor().
|
private |
Definition at line 264 of file channel.h.
Referenced by CachePlugin(), HandleStore(), HandleStoreAbort(), and MainProcessRequests().