XRootD
Loading...
Searching...
No Matches
XrdPfc.cc File Reference
#include <fcntl.h>
#include <sstream>
#include <algorithm>
#include <sys/statvfs.h>
#include "XrdCl/XrdClURL.hh"
#include "XrdOuc/XrdOucEnv.hh"
#include "XrdOuc/XrdOucUtils.hh"
#include "XrdOuc/XrdOucPrivateUtils.hh"
#include "XrdSys/XrdSysTimer.hh"
#include "XrdSys/XrdSysTrace.hh"
#include "XrdSys/XrdSysXAttr.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 "XrdPfcResourceMonitor.hh"
+ Include dependency graph for XrdPfc.cc:

Go to the source code of this file.

Functions

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

Variables

XrdSysXAttrXrdSysXAttrActive
 

Function Documentation

◆ PrefetchThread()

void * PrefetchThread ( void *  )

Definition at line 66 of file XrdPfc.cc.

67{
69 return 0;
70}
static Cache & GetInstance()
Singleton access.
Definition XrdPfc.cc:132
void Prefetch()
Definition XrdPfc.cc:751

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

61{
63 return 0;
64}
void ProcessWriteTasks()
Separate task which writes blocks from ram to disk.
Definition XrdPfc.cc:273

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:

◆ ResourceMonitorThread()

void * ResourceMonitorThread ( void *  )

Definition at line 54 of file XrdPfc.cc.

55{
57 return 0;
58}
static ResourceMonitor & ResMon()
Definition XrdPfc.cc:135

References XrdPfc::ResourceMonitor::main_thread_function(), and XrdPfc::Cache::ResMon().

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

80{
81 XrdSysError err(logger, "");
82 err.Say("++++++ Proxy file cache initialization started.");
83
84 if ( ! env ||
85 ! (XrdPfc::Cache::schedP = (XrdScheduler*) env->GetPtr("XrdScheduler*")))
86 {
89 }
90
91 Cache &instance = Cache::CreateInstance(logger, env);
92
93 if (! instance.Config(config_filename, parameters))
94 {
95 err.Say("Config Proxy file cache initialization failed.");
96 return 0;
97 }
98 err.Say("++++++ Proxy file cache initialization completed.");
99
100 {
101 pthread_t tid;
102
103 XrdSysThread::Run(&tid, ResourceMonitorThread, 0, 0, "XrdPfc ResourceMonitor");
104
105 for (int wti = 0; wti < instance.RefConfiguration().m_wqueue_threads; ++wti)
106 {
107 XrdSysThread::Run(&tid, ProcessWriteTaskThread, 0, 0, "XrdPfc WriteTasks ");
108 }
109
110 if (instance.RefConfiguration().m_prefetch_max_blocks > 0)
111 {
112 XrdSysThread::Run(&tid, PrefetchThread, 0, 0, "XrdPfc Prefetch ");
113 }
114 }
115
116 XrdPfcFSctl* pfcFSctl = new XrdPfcFSctl(instance, logger);
117 env->PutPtr("XrdFSCtl_PC*", pfcFSctl);
118
119 return &instance;
120}
void * ProcessWriteTaskThread(void *)
Definition XrdPfc.cc:60
void * ResourceMonitorThread(void *)
Definition XrdPfc.cc:54
void * PrefetchThread(void *)
Definition XrdPfc.cc:66
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:152
bool Config(const char *config_filename, const char *parameters)
Parse configuration file.
const Configuration & RefConfiguration() const
Reference XrdPfc configuration.
Definition XrdPfc.hh:204
static XrdScheduler * schedP
Definition XrdPfc.hh:290
static Cache & CreateInstance(XrdSysLogger *logger, XrdOucEnv *env)
Singleton creation.
Definition XrdPfc.cc:125
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:113

References XrdPfc::Cache::Config(), XrdPfc::Cache::CreateInstance(), XrdOucEnv::GetPtr(), XrdPfc::Configuration::m_prefetch_max_blocks, PrefetchThread(), ProcessWriteTaskThread(), XrdOucEnv::PutPtr(), XrdPfc::Cache::RefConfiguration(), ResourceMonitorThread(), 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:

Variable Documentation

◆ XrdSysXAttrActive