![]() |
CernVM-FS
2.13.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 226 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 197 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 251 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 275 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 297 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 315 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 369 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 398 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 435 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 460 of file channel.cc.
Referenced by MainProcessRequests().
|
private |
Definition at line 541 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 586 of file channel.cc.
Referenced by HandleRequest().
|
private |
Definition at line 559 of file channel.cc.
Referenced by HandleRequest().
|
inlinestaticprivate |
Definition at line 207 of file channel.h.
Referenced by CachePlugin().
bool CachePlugin::IsRunning | ( | ) |
Definition at line 674 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 745 of file channel.cc.
Referenced by HandleBreadcrumbStore(), HandleInfo(), HandleIoctl(), HandleList(), HandleObjectInfo(), HandleRead(), HandleRefcount(), HandleShrink(), HandleStore(), and HandleStoreAbort().
|
private |
Definition at line 734 of file channel.cc.
Referenced by HandleIoctl().
|
staticprivate |
Definition at line 759 of file channel.cc.
Referenced by ProcessRequests().
|
inlineprivate |
Definition at line 206 of file channel.h.
Referenced by HandleList().
|
inlineprivate |
Definition at line 202 of file channel.h.
Referenced by HandleHandshake().
|
inlineprivate |
Definition at line 205 of file channel.h.
Referenced by HandleStore().
|
private |
Used during startup to synchronize with the cvmfs client.
Definition at line 860 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 878 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 892 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 241 of file channel.h.
Referenced by capabilities(), and HandleHandshake().
|
private |
Definition at line 257 of file channel.h.
Referenced by MainProcessRequests(), and SendDetachRequests().
|
private |
Definition at line 242 of file channel.h.
Referenced by Listen(), MainProcessRequests(), and ~CachePlugin().
|
private |
Definition at line 243 of file channel.h.
Referenced by Listen(), and ~CachePlugin().
|
private |
Definition at line 240 of file channel.h.
Referenced by HandleHandshake(), and Listen().
|
staticprivate |
|
staticprivate |
Definition at line 139 of file channel.h.
Referenced by HandleList().
|
static |
Definition at line 69 of file channel.h.
Referenced by HandleHandshake().
|
staticprivate |
Definition at line 141 of file channel.h.
Referenced by AskToDetach(), and MainProcessRequests().
|
staticprivate |
Definition at line 140 of file channel.h.
Referenced by Terminate().
|
static |
Definition at line 70 of file channel.h.
Referenced by anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin::GetObjectInfo().
|
private |
Definition at line 246 of file channel.h.
Referenced by HandleHandshake(), HandleRead(), HandleRequest(), HandleStore(), and max_object_size().
|
private |
Definition at line 252 of file channel.h.
Referenced by HandleHandshake().
|
private |
Definition at line 255 of file channel.h.
Referenced by CachePlugin(), and NextLstId().
|
private |
Definition at line 253 of file channel.h.
Referenced by CachePlugin(), and NextSessionId().
|
private |
Definition at line 254 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 251 of file channel.h.
Referenced by HandleIoctl(), and MainProcessRequests().
|
private |
Definition at line 245 of file channel.h.
Referenced by ProcessRequests().
|
private |
Definition at line 260 of file channel.h.
Referenced by AskToDetach(), CachePlugin(), MainProcessRequests(), Terminate(), and ~CachePlugin().
|
private |
Definition at line 244 of file channel.h.
Referenced by IsRunning(), ProcessRequests(), and Terminate().
|
private |
Definition at line 258 of file channel.h.
Referenced by HandleHandshake(), HandleRequest(), LogSessionError(), LogSessionInfo(), and CachePlugin::SessionCtxGuard::SessionCtxGuard().
|
private |
Definition at line 259 of file channel.h.
Referenced by CachePlugin(), ProcessRequests(), Terminate(), and WaitFor().
|
private |
Definition at line 256 of file channel.h.
Referenced by CachePlugin(), HandleStore(), HandleStoreAbort(), and MainProcessRequests().