XRootD
XrdPosixCache Class Reference

#include <XrdPosixCache.hh>

+ Collaboration diagram for XrdPosixCache:

Public Member Functions

 XrdPosixCache ()
 Constructor and destructor. More...
 
 ~XrdPosixCache ()
 
int CachePath (const char *url, char *buff, int blen)
 
int CacheQuery (const char *url, bool hold=false)
 
int Rename (const char *oldPath, const char *newPath)
 
int Rmdir (const char *path)
 
int Stat (const char *path, struct stat &sbuff)
 
void Statistics (XrdOucCacheStats &Stats)
 
int Truncate (const char *path, off_t size)
 
int Unlink (const char *path)
 

Detailed Description

Definition at line 35 of file XrdPosixCache.hh.

Constructor & Destructor Documentation

◆ XrdPosixCache()

XrdPosixCache::XrdPosixCache ( )
inline

Constructor and destructor.

Definition at line 138 of file XrdPosixCache.hh.

138 {}

◆ ~XrdPosixCache()

XrdPosixCache::~XrdPosixCache ( )
inline

Definition at line 139 of file XrdPosixCache.hh.

139 {}

Member Function Documentation

◆ CachePath()

int XrdPosixCache::CachePath ( const char *  url,
char *  buff,
int  blen 
)

Convert a logical path to the path of the corresonding entry in the cache.

Parameters
url-> url of the directory or file to be converted.
buff-> buffer to receive the result.
blenThe length of the buffer (should be at least 1024).
Returns
=0 Buffer holds the result.
<0 Conversion failed, the return value is -errno.

Definition at line 50 of file XrdPosixCache.cc.

51 {
52  return theCache->LocalFilePath(url, buff, blen, XrdOucCache::ForPath);
53 }
virtual int LocalFilePath(const char *url, char *buff=0, int blen=0, LFP_Reason why=ForAccess, bool forall=false)
Definition: XrdOucCache.hh:572
XrdOucCache * theCache

References XrdOucCache::ForPath, XrdOucCache::LocalFilePath(), and XrdPosixGlobals::theCache.

+ Here is the call graph for this function:

◆ CacheQuery()

int XrdPosixCache::CacheQuery ( const char *  url,
bool  hold = false 
)

Check cache status of a file.

Parameters
url-> url of the logical file to be checked in the cache.
holdWhen true, the file purge time is extended to allow the file to be accessed before eligible for purging. When false (the default) only status information is returned.
Returns
>0 The file is fully cached.
=0 The file exists in the cache but is not fully cached.
<0 The file does not exist in the cache.

Definition at line 59 of file XrdPosixCache.cc.

60 {
61 
62  int rc = theCache->LocalFilePath(url, 0, 0,
65  );
66  if (!rc) return 1;
67  if (rc == -EREMOTE) return 0;
68  return -1;
69 }

References XrdOucCache::ForAccess, XrdOucCache::ForInfo, XrdOucCache::LocalFilePath(), and XrdPosixGlobals::theCache.

+ Here is the call graph for this function:

◆ Rename()

int XrdPosixCache::Rename ( const char *  oldPath,
const char *  newPath 
)

Rename a file or directory in the cache.

Parameters
oldPath-> filepath of existing directory or file.
newPath-> filepath the directory or file is to have.
Returns
0 This method is currently not supported.

Definition at line 82 of file XrdPosixCache.cc.

83  {return theCache->Rename(oldPath, newPath);}
virtual int Rename(const char *oldp, const char *newp)
Definition: XrdOucCache.hh:610

References XrdOucCache::Rename(), and XrdPosixGlobals::theCache.

+ Here is the call graph for this function:

◆ Rmdir()

int XrdPosixCache::Rmdir ( const char *  path)

Remove directory from the cache.

Parameters
path-> filepath of directory to be removed
Returns
0 This method is currently not supported.

Definition at line 75 of file XrdPosixCache.cc.

76  {return theCache->Rmdir(path);}
virtual int Rmdir(const char *dirp)
Definition: XrdOucCache.hh:622

References XrdOucCache::Rmdir(), and XrdPosixGlobals::theCache.

+ Here is the call graph for this function:

◆ Stat()

int XrdPosixCache::Stat ( const char *  path,
struct stat sbuff 
)

Rename a file or directory in the cache.

Parameters
path-> filepath of existing directory or file. This is the actual path in the cache (see CachePath()).
sbuffReference to the stat structure to hold the information.
Returns
=0 The sbuff hold the information.
!0 The file or direcory does not exist in the cache.

Definition at line 89 of file XrdPosixCache.cc.

90  {return theCache->Stat(path, sbuff);}
virtual int Stat(const char *url, struct stat &sbuff)
Definition: XrdOucCache.hh:638

References XrdOucCache::Stat(), and XrdPosixGlobals::theCache.

+ Here is the call graph for this function:

◆ Statistics()

void XrdPosixCache::Statistics ( XrdOucCacheStats Stats)

Rename a file or directory in the cache.

Parameters
StatsReference to the statistics object to be filled in.

Definition at line 96 of file XrdPosixCache.cc.

97  {return theCache->Statistics.Get(Stats);}
void Get(XrdOucCacheStats &D)
XrdOucCacheStats Statistics
Definition: XrdOucCache.hh:686
XrdPosixStats Stats
Definition: XrdPosixFile.cc:64

References XrdOucCacheStats::Get(), XrdOucCache::Statistics, XrdPosixGlobals::Stats, and XrdPosixGlobals::theCache.

+ Here is the call graph for this function:

◆ Truncate()

int XrdPosixCache::Truncate ( const char *  path,
off_t  size 
)

Truncate a file in the cache.

Parameters
path-> filepath of file to be truncated.
sizeThe size in bytes the file should have.
Returns
0 This method is currently not supported.

Definition at line 103 of file XrdPosixCache.cc.

104  {return theCache->Truncate(path, size);}
virtual int Truncate(const char *path, off_t size)
Definition: XrdOucCache.hh:651

References XrdPosixGlobals::theCache, and XrdOucCache::Truncate().

+ Here is the call graph for this function:

◆ Unlink()

int XrdPosixCache::Unlink ( const char *  path)

Remove a file from the cache.

Parameters
path-> filepath of file to be removed.
Returns
=0 File was removed.
!0 File could not be removed, because of one of the below: -EBUSY - the file is in use. -EAGAIN - file is currently subject to internal processing. -errno - file was not removed, filesystem unlink() failed.

Definition at line 110 of file XrdPosixCache.cc.

111  {return theCache->Unlink(path);}
virtual int Unlink(const char *path)
Definition: XrdOucCache.hh:663

References XrdPosixGlobals::theCache, and XrdOucCache::Unlink().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: