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 "XrdCl/XrdClFileSystem.hh"
#include "XrdCl/XrdClFileStateHandler.hh"
#include "XrdOuc/XrdOucEnv.hh"
#include "XrdOuc/XrdOucUtils.hh"
#include "XrdOuc/XrdOucPrivateUtils.hh"
#include "XrdOuc/XrdOucJson.hh"
#include "XrdSys/XrdSysTimer.hh"
#include "XrdSys/XrdSysTrace.hh"
#include "XrdSys/XrdSysXAttr.hh"
#include "XrdXrootd/XrdXrootdGStream.hh"
#include "XrdOss/XrdOss.hh"
#include "XrdPosix/XrdPosixExtra.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 70 of file XrdPfc.cc.

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

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:281

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

59{
61 return 0;
62}
static ResourceMonitor & ResMon()
Definition XrdPfc.cc:139

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 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 {
92 XrdPfc::Cache::schedP->Start();
93 }
94
95 Cache &instance = Cache::CreateInstance(logger, env);
96
97 if (! instance.Config(config_filename, parameters, env))
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 XrdSysThread::Run(&tid, ResourceMonitorThread, 0, 0, "XrdPfc ResourceMonitor");
108
109 for (int wti = 0; wti < instance.RefConfiguration().m_wqueue_threads; ++wti)
110 {
111 XrdSysThread::Run(&tid, ProcessWriteTaskThread, 0, 0, "XrdPfc WriteTasks ");
112 }
113
114 if (instance.is_prefetch_enabled())
115 {
116 XrdSysThread::Run(&tid, PrefetchThread, 0, 0, "XrdPfc Prefetch ");
117 }
118 }
119
120 XrdPfcFSctl* pfcFSctl = new XrdPfcFSctl(instance, logger);
121 env->PutPtr("XrdFSCtl_PC*", pfcFSctl);
122
123 return &instance;
124}
void * ProcessWriteTaskThread(void *)
Definition XrdPfc.cc:64
void * ResourceMonitorThread(void *)
Definition XrdPfc.cc:58
void * PrefetchThread(void *)
Definition XrdPfc.cc:70
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:169
const Configuration & RefConfiguration() const
Reference XrdPfc configuration.
Definition XrdPfc.hh:225
bool Config(const char *config_filename, const char *parameters, XrdOucEnv *env)
Parse configuration file.
static XrdScheduler * schedP
Definition XrdPfc.hh:312
static Cache & CreateInstance(XrdSysLogger *logger, XrdOucEnv *env)
Singleton creation.
Definition XrdPfc.cc:129
bool is_prefetch_enabled() const
Definition XrdPfc.hh:317
static int Run(pthread_t *, void *(*proc)(void *), void *arg, int opts=0, const char *desc=0)

References XrdPfc::Cache::Config(), XrdPfc::Cache::CreateInstance(), XrdOucEnv::GetPtr(), XrdPfc::Cache::is_prefetch_enabled(), PrefetchThread(), ProcessWriteTaskThread(), XrdOucEnv::PutPtr(), XrdPfc::Cache::RefConfiguration(), ResourceMonitorThread(), XrdSysThread::Run(), XrdSysError::Say(), and XrdPfc::Cache::schedP.

Referenced by XrdPfc::Cache::Config(), and XrdVERSIONINFO().

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

Variable Documentation

◆ XrdSysXAttrActive