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 "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)
 

Function Documentation

◆ PrefetchThread()

void* PrefetchThread ( void *  )

Definition at line 64 of file XrdPfc.cc.

65 {
66  Cache::GetInstance().Prefetch();
67  return 0;
68 }

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

59 {
60  Cache::GetInstance().ProcessWriteTasks();
61  return 0;
62 }

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

53 {
54  Cache::ResMon().main_thread_function();
55  return 0;
56 }

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

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