XRootD
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/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 67 of file XrdPfc.cc.

68 {
69  Cache::GetInstance().Prefetch();
70  return 0;
71 }

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

62 {
63  Cache::GetInstance().ProcessWriteTasks();
64  return 0;
65 }

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

56 {
57  Cache::ResMon().main_thread_function();
58  return 0;
59 }

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

81 {
82  XrdSysError err(logger, "");
83  err.Say("++++++ Proxy file cache initialization started.");
84 
85  if ( ! env ||
86  ! (XrdPfc::Cache::schedP = (XrdScheduler*) env->GetPtr("XrdScheduler*")))
87  {
90  }
91 
92  Cache &instance = Cache::CreateInstance(logger, env);
93 
94  if (! instance.Config(config_filename, parameters))
95  {
96  err.Say("Config Proxy file cache initialization failed.");
97  return 0;
98  }
99  err.Say("++++++ Proxy file cache initialization completed.");
100 
101  {
102  pthread_t tid;
103 
104  XrdSysThread::Run(&tid, ResourceMonitorThread, 0, 0, "XrdPfc ResourceMonitor");
105 
106  for (int wti = 0; wti < instance.RefConfiguration().m_wqueue_threads; ++wti)
107  {
108  XrdSysThread::Run(&tid, ProcessWriteTaskThread, 0, 0, "XrdPfc WriteTasks ");
109  }
110 
111  if (instance.RefConfiguration().m_prefetch_max_blocks > 0)
112  {
113  XrdSysThread::Run(&tid, PrefetchThread, 0, 0, "XrdPfc Prefetch ");
114  }
115  }
116 
117  XrdPfcFSctl* pfcFSctl = new XrdPfcFSctl(instance, logger);
118  env->PutPtr("XrdFSCtl_PC*", pfcFSctl);
119 
120  return &instance;
121 }
void * ResourceMonitorThread(void *)
Definition: XrdPfc.cc:55
void * PrefetchThread(void *)
Definition: XrdPfc.cc:67
void * ProcessWriteTaskThread(void *)
Definition: XrdPfc.cc:61
void * GetPtr(const char *varname)
Definition: XrdOucEnv.cc:281
void PutPtr(const char *varname, void *value)
Definition: XrdOucEnv.cc:316
Attaches/creates and detaches/deletes cache-io objects for disk based cache.
Definition: XrdPfc.hh:151
bool Config(const char *config_filename, const char *parameters)
Parse configuration file.
const Configuration & RefConfiguration() const
Reference XrdPfc configuration.
Definition: XrdPfc.hh:203
static XrdScheduler * schedP
Definition: XrdPfc.hh:289
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:112

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

XrdSysXAttr* XrdSysXAttrActive
extern