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 "XrdOuc/XrdOucPrivateUtils.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 71 of file XrdPfc.cc.

72{
74 return 0;
75}
static Cache & GetInstance()
Singleton access.
Definition XrdPfc.cc:160
void Prefetch()
Definition XrdPfc.cc:744

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 65 of file XrdPfc.cc.

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

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 59 of file XrdPfc.cc.

60{
62 return 0;
63}
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 53 of file XrdPfc.cc.

54{
56 return 0;
57}
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 81 of file XrdPfc.cc.

85{
86 XrdSysError err(logger, "");
87 err.Say("++++++ Proxy file cache initialization started.");
88
89 if ( ! env ||
90 ! (XrdPfc::Cache::schedP = (XrdScheduler*) env->GetPtr("XrdScheduler*")))
91 {
94 }
95
96 Cache &instance = Cache::CreateInstance(logger, env);
97
98 if (! instance.Config(config_filename, parameters))
99 {
100 err.Say("Config Proxy file cache initialization failed.");
101 return 0;
102 }
103 err.Say("------ Proxy file cache initialization completed.");
104
105 {
106 pthread_t tid;
107
108 for (int wti = 0; wti < instance.RefConfiguration().m_wqueue_threads; ++wti)
109 {
110 XrdSysThread::Run(&tid, ProcessWriteTaskThread, 0, 0, "XrdPfc WriteTasks ");
111 }
112
113 if (instance.RefConfiguration().m_prefetch_max_blocks > 0)
114 {
115 XrdSysThread::Run(&tid, PrefetchThread, 0, 0, "XrdPfc Prefetch ");
116 }
117
118 XrdSysThread::Run(&tid, ResourceMonitorHeartBeatThread, 0, 0, "XrdPfc ResourceMonitorHeartBeat");
119
120 XrdSysThread::Run(&tid, PurgeThread, 0, 0, "XrdPfc Purge");
121 }
122
123 XrdPfcFSctl* pfcFSctl = new XrdPfcFSctl(instance, logger);
124 env->PutPtr("XrdFSCtl_PC*", pfcFSctl);
125
126 return &instance;
127}
void * ProcessWriteTaskThread(void *)
Definition XrdPfc.cc:65
void * ResourceMonitorHeartBeatThread(void *)
Definition XrdPfc.cc:53
void * PrefetchThread(void *)
Definition XrdPfc.cc:71
void * PurgeThread(void *)
Definition XrdPfc.cc:59
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:153
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: