CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
libcvmfs_cache.cc File Reference
#include "cvmfs_config.h"
#include "libcvmfs_cache.h"
#include <unistd.h>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <string>
#include "cache_plugin/channel.h"
#include "cache_transport.h"
#include "hash.h"
#include "manifest.h"
#include "monitor.h"
#include "util/pointer.h"
Include dependency graph for libcvmfs_cache.cc:

Go to the source code of this file.

Classes

class  anonymous_namespace{libcvmfs_cache.cc}::ForwardCachePlugin
 
struct  cvmcache_context
 

Namespaces

 anonymous_namespace{libcvmfs_cache.cc}
 

Macros

#define _FILE_OFFSET_BITS   64
 
#define __STDC_FORMAT_MACROS
 

Functions

static shash::Any anonymous_namespace{libcvmfs_cache.cc}::Chash2Cpphash (const struct cvmcache_hash *h)
 
static struct cvmcache_hash anonymous_namespace{libcvmfs_cache.cc}::Cpphash2Chash (const shash::Any &hash)
 
static enum cvmcache_object_type anonymous_namespace{libcvmfs_cache.cc}::ObjectType2CType (cvmfs::EnumObjectType type)
 
int cvmcache_hash_cmp (struct cvmcache_hash *a, struct cvmcache_hash *b)
 
char * cvmcache_hash_print (const struct cvmcache_hash *h)
 
void cvmcache_init_global ()
 
void cvmcache_cleanup_global ()
 
int cvmcache_is_supervised ()
 
struct cvmcache_contextcvmcache_init (struct cvmcache_callbacks *callbacks)
 
int cvmcache_listen (struct cvmcache_context *ctx, char *locator)
 
void cvmcache_process_requests (struct cvmcache_context *ctx, unsigned nworkers)
 
void cvmcache_ask_detach (struct cvmcache_context *ctx)
 
void cvmcache_wait_for (struct cvmcache_context *ctx)
 
void cvmcache_terminate (struct cvmcache_context *ctx)
 
uint32_t cvmcache_max_object_size (struct cvmcache_context *ctx)
 
void cvmcache_get_session (cvmcache_session *session)
 
void cvmcache_spawn_watchdog (const char *crash_dump_file)
 
void cvmcache_terminate_watchdog ()
 

Variables

Watchdoganonymous_namespace{libcvmfs_cache.cc}::g_watchdog = NULL
 

Macro Definition Documentation

#define __STDC_FORMAT_MACROS

Definition at line 6 of file libcvmfs_cache.cc.

#define _FILE_OFFSET_BITS   64

This file is part of the CernVM File System.

Definition at line 5 of file libcvmfs_cache.cc.

Function Documentation

void cvmcache_ask_detach ( struct cvmcache_context ctx)

Politely ask connected clients to release open nested catalogs so that more objects in the cache become unpinned.

Definition at line 333 of file libcvmfs_cache.cc.

Referenced by PluginRamCache::CheckHighPinWatermark(), and main().

Here is the caller graph for this function:

void cvmcache_cleanup_global ( )

Deletes global state, afterwards no further calls to cvmcache_... functions should take place.

Definition at line 314 of file libcvmfs_cache.cc.

Referenced by main().

Here is the caller graph for this function:

void cvmcache_get_session ( cvmcache_session session)

Returns a static pointer to an origin struct that identifies the client connection that triggered a callback. Calling this function is only valid from within a callback. Otherwise the function returns NULL values.

Definition at line 350 of file libcvmfs_cache.cc.

Here is the call graph for this function:

int cvmcache_hash_cmp ( struct cvmcache_hash a,
struct cvmcache_hash b 
)

Returns -1, 0, or 1 like other C comparison functions

Definition at line 294 of file libcvmfs_cache.cc.

Referenced by ComparableHash::operator!=(), ComparableHash::operator<(), ComparableHash::operator==(), and ComparableHash::operator>().

Here is the call graph for this function:

Here is the caller graph for this function:

char* cvmcache_hash_print ( const struct cvmcache_hash h)

The caller has to free the resulting string

Definition at line 305 of file libcvmfs_cache.cc.

Here is the call graph for this function:

struct cvmcache_context* cvmcache_init ( struct cvmcache_callbacks callbacks)

Definition at line 320 of file libcvmfs_cache.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void cvmcache_init_global ( )

Should be called before any other cvmcache_... function.

Definition at line 311 of file libcvmfs_cache.cc.

Referenced by main().

Here is the caller graph for this function:

int cvmcache_is_supervised ( )

True if the plugin was started from a cvmfs mountpoint and thus will terminate by itself when the last mount point disconnects.

Definition at line 316 of file libcvmfs_cache.cc.

Referenced by main().

Here is the caller graph for this function:

int cvmcache_listen ( struct cvmcache_context ctx,
char *  locator 
)

The locator is either a UNIX domain socket (unix=/path/to/socket) or a tcp socket (tcp=hostname:port)

Definition at line 324 of file libcvmfs_cache.cc.

Referenced by main().

Here is the caller graph for this function:

uint32_t cvmcache_max_object_size ( struct cvmcache_context ctx)

Definition at line 346 of file libcvmfs_cache.cc.

void cvmcache_process_requests ( struct cvmcache_context ctx,
unsigned  nworkers 
)

Spawns a separate I/O thread that can be stopped with cvmcache_terminate. The nworkers parameter is currently unused.

Definition at line 328 of file libcvmfs_cache.cc.

Referenced by main().

Here is the caller graph for this function:

void cvmcache_spawn_watchdog ( const char *  crash_dump_file)

Can be used to spawn a second process that superwises the cache plugin. The watchdog can use gdb/lldb to generate stack traces. Must be closed by a call to cvmcache_close_watchdog(), otherwise the main process will be reported has having died unexpectedly.

Definition at line 359 of file libcvmfs_cache.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void cvmcache_terminate ( struct cvmcache_context ctx)

Stops the processing thread.

Definition at line 342 of file libcvmfs_cache.cc.

Referenced by anonymous_namespace{cvmfs_cache_posix.cc}::handle_sigint(), and main().

Here is the caller graph for this function:

void cvmcache_terminate_watchdog ( )

Definition at line 369 of file libcvmfs_cache.cc.

Referenced by main().

Here is the caller graph for this function:

void cvmcache_wait_for ( struct cvmcache_context ctx)

Blocks until the processing thread finishes. Can either happen due to a call to cvmcache_terminate or – when the plugin is started from cvmfs – when the last repository is unmounted. Invalidates the context object.

Definition at line 337 of file libcvmfs_cache.cc.

Referenced by main().

Here is the caller graph for this function: