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/XrdSysPthread.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 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)
 

Variables

XrdSysXAttrXrdSysXAttrActive
 

Function Documentation

◆ PrefetchThread()

void* PrefetchThread ( void *  )

Definition at line 74 of file XrdPfc.cc.

75 {
76  Cache::GetInstance().Prefetch();
77  return 0;
78 }

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

69 {
70  Cache::GetInstance().ProcessWriteTasks();
71  return 0;
72 }

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

63 {
64  Cache::GetInstance().Purge();
65  return 0;
66 }

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

57 {
58  Cache::GetInstance().ResourceMonitorHeartBeat();
59  return 0;
60 }

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

88 {
89  XrdSysError err(logger, "");
90  err.Say("++++++ Proxy file cache initialization started.");
91 
92  if ( ! env ||
93  ! (XrdPfc::Cache::schedP = (XrdScheduler*) env->GetPtr("XrdScheduler*")))
94  {
97  }
98 
99  Cache &instance = Cache::CreateInstance(logger, env);
100 
101  if (! instance.Config(config_filename, parameters))
102  {
103  err.Say("Config Proxy file cache initialization failed.");
104  return 0;
105  }
106  err.Say("------ Proxy file cache initialization completed.");
107 
108  {
109  pthread_t tid;
110 
111  for (int wti = 0; wti < instance.RefConfiguration().m_wqueue_threads; ++wti)
112  {
113  XrdSysThread::Run(&tid, ProcessWriteTaskThread, 0, 0, "XrdPfc WriteTasks ");
114  }
115 
116  if (instance.RefConfiguration().m_prefetch_max_blocks > 0)
117  {
118  XrdSysThread::Run(&tid, PrefetchThread, 0, 0, "XrdPfc Prefetch ");
119  }
120 
121  XrdSysThread::Run(&tid, ResourceMonitorHeartBeatThread, 0, 0, "XrdPfc ResourceMonitorHeartBeat");
122 
123  XrdSysThread::Run(&tid, PurgeThread, 0, 0, "XrdPfc Purge");
124  }
125 
126  XrdPfcFSctl* pfcFSctl = new XrdPfcFSctl(instance, logger);
127  env->PutPtr("XrdFSCtl_PC*", pfcFSctl);
128 
129  return &instance;
130 }
void * PrefetchThread(void *)
Definition: XrdPfc.cc:74
void * PurgeThread(void *)
Definition: XrdPfc.cc:62
void * ResourceMonitorHeartBeatThread(void *)
Definition: XrdPfc.cc:56
void * ProcessWriteTaskThread(void *)
Definition: XrdPfc.cc:68
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:267
bool Config(const char *config_filename, const char *parameters)
Parse configuration file.
const Configuration & RefConfiguration() const
Reference XrdPfc configuration.
Definition: XrdPfc.hh:319
static XrdScheduler * schedP
Definition: XrdPfc.hh:408
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:

Variable Documentation

◆ XrdSysXAttrActive

XrdSysXAttr* XrdSysXAttrActive
extern