XRootD
Loading...
Searching...
No Matches
XrdPfc.cc File Reference
#include <fcntl.h>
#include <sstream>
#include <algorithm>
#include <sys/statvfs.h>
#include "XrdCl/XrdClConstants.hh"
#include "XrdCl/XrdClURL.hh"
#include "XrdOuc/XrdOucEnv.hh"
#include "XrdOuc/XrdOucUtils.hh"
#include "XrdSys/XrdSysPthread.hh"
#include "XrdSys/XrdSysTimer.hh"
#include "XrdSys/XrdSysTrace.hh"
#include "XrdXrootd/XrdXrootdGStream.hh"
#include "XrdOss/XrdOss.hh"
#include "XrdPfc.hh"
#include "XrdPfcTrace.hh"
#include "XrdPfcFSctl.hh"
#include "XrdPfcInfo.hh"
#include "XrdPfcIOFile.hh"
#include "XrdPfcIOFileBlock.hh"
+ Include dependency graph for XrdPfc.cc:

Go to the source code of this file.

Functions

void * PrefetchThread (void *)
 
void * ProcessWriteTaskThread (void *)
 
void * PurgeThread (void *)
 
void * ResourceMonitorHeartBeatThread (void *)
 
XrdOucCacheXrdOucGetCache (XrdSysLogger *logger, const char *config_filename, const char *parameters, XrdOucEnv *env)
 

Function Documentation

◆ PrefetchThread()

void * PrefetchThread ( void *  )

Definition at line 70 of file XrdPfc.cc.

71{
73 return 0;
74}
static Cache & GetInstance()
Singleton access.
Definition XrdPfc.cc:159
void Prefetch()
Definition XrdPfc.cc:743

References XrdPfc::Cache::GetInstance(), and XrdPfc::Cache::Prefetch().

Referenced by XrdOucGetCache().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessWriteTaskThread()

void * ProcessWriteTaskThread ( void *  )

Definition at line 64 of file XrdPfc.cc.

65{
67 return 0;
68}
void ProcessWriteTasks()
Separate task which writes blocks from ram to disk.
Definition XrdPfc.cc:304

References XrdPfc::Cache::GetInstance(), and XrdPfc::Cache::ProcessWriteTasks().

Referenced by XrdOucGetCache().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PurgeThread()

void * PurgeThread ( void *  )

Definition at line 58 of file XrdPfc.cc.

59{
61 return 0;
62}
void Purge()
Thread function invoked to scan and purge files from disk when needed.

References XrdPfc::Cache::GetInstance(), and XrdPfc::Cache::Purge().

Referenced by XrdOucGetCache().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ResourceMonitorHeartBeatThread()

void * ResourceMonitorHeartBeatThread ( void *  )

Definition at line 52 of file XrdPfc.cc.

53{
55 return 0;
56}
void ResourceMonitorHeartBeat()
Thread function checking resource usage periodically.

References XrdPfc::Cache::GetInstance(), and XrdPfc::Cache::ResourceMonitorHeartBeat().

Referenced by XrdOucGetCache().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdOucGetCache()

XrdOucCache * XrdOucGetCache ( XrdSysLogger logger,
const char *  config_filename,
const char *  parameters,
XrdOucEnv env 
)

Definition at line 80 of file XrdPfc.cc.

84{
85 XrdSysError err(logger, "");
86 err.Say("++++++ Proxy file cache initialization started.");
87
88 if ( ! env ||
89 ! (XrdPfc::Cache::schedP = (XrdScheduler*) env->GetPtr("XrdScheduler*")))
90 {
93 }
94
95 Cache &instance = Cache::CreateInstance(logger, env);
96
97 if (! instance.Config(config_filename, parameters))
98 {
99 err.Say("Config Proxy file cache initialization failed.");
100 return 0;
101 }
102 err.Say("------ Proxy file cache initialization completed.");
103
104 {
105 pthread_t tid;
106
107 for (int wti = 0; wti < instance.RefConfiguration().m_wqueue_threads; ++wti)
108 {
109 XrdSysThread::Run(&tid, ProcessWriteTaskThread, 0, 0, "XrdPfc WriteTasks ");
110 }
111
112 if (instance.RefConfiguration().m_prefetch_max_blocks > 0)
113 {
114 XrdSysThread::Run(&tid, PrefetchThread, 0, 0, "XrdPfc Prefetch ");
115 }
116
117 XrdSysThread::Run(&tid, ResourceMonitorHeartBeatThread, 0, 0, "XrdPfc ResourceMonitorHeartBeat");
118
119 XrdSysThread::Run(&tid, PurgeThread, 0, 0, "XrdPfc Purge");
120 }
121
122 XrdPfcFSctl* pfcFSctl = new XrdPfcFSctl(instance, logger);
123 env->PutPtr("XrdFSCtl_PC*", pfcFSctl);
124
125 return &instance;
126}
void * ProcessWriteTaskThread(void *)
Definition XrdPfc.cc:64
void * ResourceMonitorHeartBeatThread(void *)
Definition XrdPfc.cc:52
void * PrefetchThread(void *)
Definition XrdPfc.cc:70
void * PurgeThread(void *)
Definition XrdPfc.cc:58
void * GetPtr(const char *varname)
Definition XrdOucEnv.cc:263
void PutPtr(const char *varname, void *value)
Definition XrdOucEnv.cc:298
Attaches/creates and detaches/deletes cache-io objects for disk based cache.
Definition XrdPfc.hh:267
bool Config(const char *config_filename, const char *parameters)
Parse configuration file.
const Configuration & RefConfiguration() const
Reference XrdPfc configuration.
Definition XrdPfc.hh:315
static XrdScheduler * schedP
Definition XrdPfc.hh:404
static Cache & CreateInstance(XrdSysLogger *logger, XrdOucEnv *env)
Singleton creation.
Definition XrdPfc.cc:152
static int Run(pthread_t *, void *(*proc)(void *), void *arg, int opts=0, const char *desc=0)
int m_prefetch_max_blocks
maximum number of blocks to prefetch per file
Definition XrdPfc.hh:106

References XrdPfc::Cache::Config(), XrdPfc::Cache::CreateInstance(), XrdOucEnv::GetPtr(), XrdPfc::Configuration::m_prefetch_max_blocks, PrefetchThread(), ProcessWriteTaskThread(), PurgeThread(), XrdOucEnv::PutPtr(), XrdPfc::Cache::RefConfiguration(), ResourceMonitorHeartBeatThread(), XrdSysThread::Run(), XrdSysError::Say(), XrdPfc::Cache::schedP, and XrdScheduler::Start().

Referenced by XrdPfc::Cache::Config().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: